import{r as rn,g as nn,a as v,R as an}from"./vendor-query-Brcc40-Y.js";function on(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const u=Object.getOwnPropertyDescriptor(n,a);u&&Object.defineProperty(e,a,u.get?u:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var xt={exports:{}},ee={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Zt;function ln(){if(Zt)return ee;Zt=1;var e=rn();function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)i+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function u(s,i,f){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:s,containerInfo:i,implementation:f}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(s,i){if(s==="font")return"";if(typeof i=="string")return i==="use-credentials"?i:""}return ee.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,ee.createPortal=function(s,i){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)throw Error(t(299));return u(s,i,null,f)},ee.flushSync=function(s){var i=o.T,f=n.p;try{if(o.T=null,n.p=2,s)return s()}finally{o.T=i,n.p=f,n.d.f()}},ee.preconnect=function(s,i){typeof s=="string"&&(i?(i=i.crossOrigin,i=typeof i=="string"?i==="use-credentials"?i:"":void 0):i=null,n.d.C(s,i))},ee.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},ee.preinit=function(s,i){if(typeof s=="string"&&i&&typeof i.as=="string"){var f=i.as,m=d(f,i.crossOrigin),y=typeof i.integrity=="string"?i.integrity:void 0,w=typeof i.fetchPriority=="string"?i.fetchPriority:void 0;f==="style"?n.d.S(s,typeof i.precedence=="string"?i.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:w}):f==="script"&&n.d.X(s,{crossOrigin:m,integrity:y,fetchPriority:w,nonce:typeof i.nonce=="string"?i.nonce:void 0})}},ee.preinitModule=function(s,i){if(typeof s=="string")if(typeof i=="object"&&i!==null){if(i.as==null||i.as==="script"){var f=d(i.as,i.crossOrigin);n.d.M(s,{crossOrigin:f,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0})}}else i==null&&n.d.M(s)},ee.preload=function(s,i){if(typeof s=="string"&&typeof i=="object"&&i!==null&&typeof i.as=="string"){var f=i.as,m=d(f,i.crossOrigin);n.d.L(s,f,{crossOrigin:m,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0,type:typeof i.type=="string"?i.type:void 0,fetchPriority:typeof i.fetchPriority=="string"?i.fetchPriority:void 0,referrerPolicy:typeof i.referrerPolicy=="string"?i.referrerPolicy:void 0,imageSrcSet:typeof i.imageSrcSet=="string"?i.imageSrcSet:void 0,imageSizes:typeof i.imageSizes=="string"?i.imageSizes:void 0,media:typeof i.media=="string"?i.media:void 0})}},ee.preloadModule=function(s,i){if(typeof s=="string")if(i){var f=d(i.as,i.crossOrigin);n.d.m(s,{as:typeof i.as=="string"&&i.as!=="script"?i.as:void 0,crossOrigin:f,integrity:typeof i.integrity=="string"?i.integrity:void 0})}else n.d.m(s)},ee.requestFormReset=function(s){n.d.r(s)},ee.unstable_batchedUpdates=function(s,i){return s(i)},ee.useFormState=function(s,i,f){return o.H.useFormState(s,i,f)},ee.useFormStatus=function(){return o.H.useHostTransitionStatus()},ee.version="19.2.7",ee}var er;function sn(){if(er)return xt.exports;er=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xt.exports=ln(),xt.exports}var Er=sn();const un=nn(Er),cn=on({__proto__:null,default:un},[Er]);/**
 * @remix-run/router v1.23.3
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(null,arguments)}var X;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(X||(X={}));const tr="popstate";function dn(e){e===void 0&&(e={});function t(n,a){let{pathname:u,search:o,hash:d}=n.location;return Ze("",{pathname:u,search:o,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Oe(a)}return hn(t,r,null,e)}function N(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _e(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fn(){return Math.random().toString(36).substr(2,8)}function rr(e,t){return{usr:e.state,key:e.key,idx:t}}function Ze(e,t,r,n){return r===void 0&&(r=null),V({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ee(t):t,{state:r,key:t&&t.key||n||fn()})}function Oe(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ee(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function hn(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:u=!1}=n,o=a.history,d=X.Pop,s=null,i=f();i==null&&(i=0,o.replaceState(V({},o.state,{idx:i}),""));function f(){return(o.state||{idx:null}).idx}function m(){d=X.Pop;let T=f(),j=T==null?null:T-i;i=T,s&&s({action:d,location:b.location,delta:j})}function y(T,j){d=X.Push;let L=Ze(b.location,T,j);i=f()+1;let F=rr(L,i),I=b.createHref(L);try{o.pushState(F,"",I)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(I)}u&&s&&s({action:d,location:b.location,delta:1})}function w(T,j){d=X.Replace;let L=Ze(b.location,T,j);i=f();let F=rr(L,i),I=b.createHref(L);o.replaceState(F,"",I),u&&s&&s({action:d,location:b.location,delta:0})}function P(T){let j=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof T=="string"?T:Oe(T);return L=L.replace(/ $/,"%20"),N(j,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,j)}let b={get action(){return d},get location(){return e(a,o)},listen(T){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(tr,m),s=T,()=>{a.removeEventListener(tr,m),s=null}},createHref(T){return t(a,T)},createURL:P,encodeLocation(T){let j=P(T);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:w,go(T){return o.go(T)}};return b}var z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(z||(z={}));const mn=new Set(["lazy","caseSensitive","path","id","index","children"]);function pn(e){return e.index===!0}function mt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,u)=>{let o=[...r,String(u)],d=typeof a.id=="string"?a.id:o.join("-");if(N(a.index!==!0||!a.children,"Cannot specify children on an index route"),N(!n[d],'Found a route id collision on id "'+d+`".  Route id's must be globally unique within Data Router usages`),pn(a)){let s=V({},a,t(a),{id:d});return n[d]=s,s}else{let s=V({},a,t(a),{id:d,children:void 0});return n[d]=s,a.children&&(s.children=mt(a.children,t,o,n)),s}})}function Ce(e,t,r){return r===void 0&&(r="/"),ht(e,t,r,!1)}function ht(e,t,r,n){let a=typeof t=="string"?Ee(t):t,u=ve(a.pathname||"/",r);if(u==null)return null;let o=Sr(e);gn(o);let d=null,s=Cn(u);for(let i=0;d==null&&i<o.length;++i)d=Ln(o[i],s,n);return d}function vn(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Sr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(u,o,d)=>{let s={relativePath:d===void 0?u.path||"":d,caseSensitive:u.caseSensitive===!0,childrenIndex:o,route:u};s.relativePath.startsWith("/")&&(N(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(n.length));let i=pe([n,s.relativePath]),f=r.concat(s);u.children&&u.children.length>0&&(N(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),Sr(u.children,t,f,i)),!(u.path==null&&!u.index)&&t.push({path:i,score:Pn(i,u.index),routesMeta:f})};return e.forEach((u,o)=>{var d;if(u.path===""||!((d=u.path)!=null&&d.includes("?")))a(u,o);else for(let s of Pr(u.path))a(u,o,s)}),t}function Pr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return a?[u,""]:[u];let o=Pr(n.join("/")),d=[];return d.push(...o.map(s=>s===""?u:[u,s].join("/"))),a&&d.push(...o),d.map(s=>e.startsWith("/")&&s===""?"/":s)}function gn(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:xn(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const yn=/^:[\w-]+$/,wn=3,Rn=2,bn=1,En=10,Sn=-2,nr=e=>e==="*";function Pn(e,t){let r=e.split("/"),n=r.length;return r.some(nr)&&(n+=Sn),t&&(n+=Rn),r.filter(a=>!nr(a)).reduce((a,u)=>a+(yn.test(u)?wn:u===""?bn:En),n)}function xn(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Ln(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},u="/",o=[];for(let d=0;d<n.length;++d){let s=n[d],i=d===n.length-1,f=u==="/"?t:t.slice(u.length)||"/",m=pt({path:s.relativePath,caseSensitive:s.caseSensitive,end:i},f),y=s.route;if(!m&&i&&r&&!n[n.length-1].route.index&&(m=pt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!m)return null;Object.assign(a,m.params),o.push({params:a,pathname:pe([u,m.pathname]),pathnameBase:On(pe([u,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(u=pe([u,m.pathnameBase]))}return o}function pt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Dn(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let u=a[0],o=u.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:n.reduce((i,f,m)=>{let{paramName:y,isOptional:w}=f;if(y==="*"){let b=d[m]||"";o=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const P=d[m];return w&&!P?i[y]=void 0:i[y]=(P||"").replace(/%2F/g,"/"),i},{}),pathname:u,pathnameBase:o,pattern:e}}function Dn(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),_e(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,d,s)=>(n.push({paramName:d,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Cn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _e(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ve(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Tn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mn=e=>Tn.test(e);function _n(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ee(e):e,u;if(r)if(Mn(r))u=r;else{if(r.includes("//")){let o=r;r=Nt(r),_e(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?u=ar(r.substring(1),"/"):u=ar(r,t)}else u=t;return{pathname:u,search:Un(n),hash:Nn(a)}}function ar(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Lt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function xr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function yt(e,t){let r=xr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function wt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ee(e):(a=V({},e),N(!a.pathname||!a.pathname.includes("?"),Lt("?","pathname","search",a)),N(!a.pathname||!a.pathname.includes("#"),Lt("#","pathname","hash",a)),N(!a.search||!a.search.includes("#"),Lt("#","search","hash",a)));let u=e===""||a.pathname==="",o=u?"/":a.pathname,d;if(o==null)d=r;else{let m=t.length-1;if(!n&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}d=m>=0?t[m]:"/"}let s=_n(a,d),i=o&&o!=="/"&&o.endsWith("/"),f=(u||o===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(i||f)&&(s.pathname+="/"),s}const Nt=e=>e.replace(/\/\/+/g,"/"),pe=e=>Nt(e.join("/")),On=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Un=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class vt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Lr=["post","put","patch","delete"],Fn=new Set(Lr),An=["get",...Lr],jn=new Set(An),In=new Set([301,302,303,307,308]),Bn=new Set([307,308]),Dt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ye={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ft=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Dr="remix-router-transitions";function Hn(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;N(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let l=e.detectErrorBoundary;a=c=>({hasErrorBoundary:l(c)})}else a=zn;let u={},o=mt(e.routes,a,void 0,u),d,s=e.basename||"/",i=e.dataStrategy||Kn,f=e.patchRoutesOnNavigation,m=V({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),y=null,w=new Set,P=null,b=null,T=null,j=e.hydrationData!=null,L=Ce(o,e.history.location,s),F=!1,I=null;if(L==null&&!f){let l=ne(404,{pathname:e.history.location.pathname}),{matches:c,route:h}=pr(o);L=c,I={[h.id]:l}}L&&!e.hydrationData&&st(L,o,e.history.location.pathname).active&&(L=null);let $;if(L)if(L.some(l=>l.route.lazy))$=!1;else if(!L.some(l=>l.route.loader))$=!0;else if(m.v7_partialHydration){let l=e.hydrationData?e.hydrationData.loaderData:null,c=e.hydrationData?e.hydrationData.errors:null;if(c){let h=L.findIndex(g=>c[g.route.id]!==void 0);$=L.slice(0,h+1).every(g=>!Mt(g.route,l,c))}else $=L.every(h=>!Mt(h.route,l,c))}else $=e.hydrationData!=null;else if($=!1,L=[],m.v7_partialHydration){let l=st(null,o,e.history.location.pathname);l.active&&l.matches&&(F=!0,L=l.matches)}let oe,p={historyAction:e.history.action,location:e.history.location,matches:L,initialized:$,navigation:Dt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||I,fetchers:new Map,blockers:new Map},M=X.Pop,H=!1,U,q=!1,G=new Map,ae=null,re=!1,de=!1,rt=[],nt=new Set,Q=new Map,at=0,We=-1,Ne=new Map,fe=new Set,Fe=new Map,Ve=new Map,le=new Set,Se=new Map,Pe=new Map,it;function Br(){if(y=e.history.listen(l=>{let{action:c,location:h,delta:g}=l;if(it){it(),it=void 0;return}_e(Pe.size===0||g!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let R=Yt({currentLocation:p.location,nextLocation:h,historyAction:c});if(R&&g!=null){let C=new Promise(_=>{it=_});e.history.go(g*-1),lt(R,{state:"blocked",location:h,proceed(){lt(R,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),C.then(()=>e.history.go(g))},reset(){let _=new Map(p.blockers);_.set(R,Ye),te({blockers:_})}});return}return xe(c,h)}),r){oa(t,G);let l=()=>la(t,G);t.addEventListener("pagehide",l),ae=()=>t.removeEventListener("pagehide",l)}return p.initialized||xe(X.Pop,p.location,{initialHydration:!0}),oe}function kr(){y&&y(),ae&&ae(),w.clear(),U&&U.abort(),p.fetchers.forEach((l,c)=>ot(c)),p.blockers.forEach((l,c)=>Gt(c))}function zr(l){return w.add(l),()=>w.delete(l)}function te(l,c){c===void 0&&(c={}),p=V({},p,l);let h=[],g=[];m.v7_fetcherPersist&&p.fetchers.forEach((R,C)=>{R.state==="idle"&&(le.has(C)?g.push(C):h.push(C))}),le.forEach(R=>{!p.fetchers.has(R)&&!Q.has(R)&&g.push(R)}),[...w].forEach(R=>R(p,{deletedFetchers:g,viewTransitionOpts:c.viewTransitionOpts,flushSync:c.flushSync===!0})),m.v7_fetcherPersist?(h.forEach(R=>p.fetchers.delete(R)),g.forEach(R=>ot(R))):g.forEach(R=>le.delete(R))}function Ae(l,c,h){var g,R;let{flushSync:C}=h===void 0?{}:h,_=p.actionData!=null&&p.navigation.formMethod!=null&&se(p.navigation.formMethod)&&p.navigation.state==="loading"&&((g=l.state)==null?void 0:g._isRedirect)!==!0,S;c.actionData?Object.keys(c.actionData).length>0?S=c.actionData:S=null:_?S=p.actionData:S=null;let x=c.loaderData?hr(p.loaderData,c.loaderData,c.matches||[],c.errors):p.loaderData,E=p.blockers;E.size>0&&(E=new Map(E),E.forEach((A,Z)=>E.set(Z,Ye)));let D=H===!0||p.navigation.formMethod!=null&&se(p.navigation.formMethod)&&((R=l.state)==null?void 0:R._isRedirect)!==!0;d&&(o=d,d=void 0),re||M===X.Pop||(M===X.Push?e.history.push(l,l.state):M===X.Replace&&e.history.replace(l,l.state));let O;if(M===X.Pop){let A=G.get(p.location.pathname);A&&A.has(l.pathname)?O={currentLocation:p.location,nextLocation:l}:G.has(l.pathname)&&(O={currentLocation:l,nextLocation:p.location})}else if(q){let A=G.get(p.location.pathname);A?A.add(l.pathname):(A=new Set([l.pathname]),G.set(p.location.pathname,A)),O={currentLocation:p.location,nextLocation:l}}te(V({},c,{actionData:S,loaderData:x,historyAction:M,location:l,initialized:!0,navigation:Dt,revalidation:"idle",restoreScrollPosition:qt(l,c.matches||p.matches),preventScrollReset:D,blockers:E}),{viewTransitionOpts:O,flushSync:C===!0}),M=X.Pop,H=!1,q=!1,re=!1,de=!1,rt=[]}async function zt(l,c){if(typeof l=="number"){e.history.go(l);return}let h=Tt(p.location,p.matches,s,m.v7_prependBasename,l,m.v7_relativeSplatPath,c==null?void 0:c.fromRouteId,c==null?void 0:c.relative),{path:g,submission:R,error:C}=ir(m.v7_normalizeFormMethod,!1,h,c),_=p.location,S=Ze(p.location,g,c&&c.state);S=V({},S,e.history.encodeLocation(S));let x=c&&c.replace!=null?c.replace:void 0,E=X.Push;x===!0?E=X.Replace:x===!1||R!=null&&se(R.formMethod)&&R.formAction===p.location.pathname+p.location.search&&(E=X.Replace);let D=c&&"preventScrollReset"in c?c.preventScrollReset===!0:void 0,O=(c&&c.flushSync)===!0,A=Yt({currentLocation:_,nextLocation:S,historyAction:E});if(A){lt(A,{state:"blocked",location:S,proceed(){lt(A,{state:"proceeding",proceed:void 0,reset:void 0,location:S}),zt(l,c)},reset(){let Z=new Map(p.blockers);Z.set(A,Ye),te({blockers:Z})}});return}return await xe(E,S,{submission:R,pendingError:C,preventScrollReset:D,replace:c&&c.replace,enableViewTransition:c&&c.viewTransition,flushSync:O})}function Hr(){if(bt(),te({revalidation:"loading"}),p.navigation.state!=="submitting"){if(p.navigation.state==="idle"){xe(p.historyAction,p.location,{startUninterruptedRevalidation:!0});return}xe(M||p.historyAction,p.navigation.location,{overrideNavigation:p.navigation,enableViewTransition:q===!0})}}async function xe(l,c,h){U&&U.abort(),U=null,M=l,re=(h&&h.startUninterruptedRevalidation)===!0,Qr(p.location,p.matches),H=(h&&h.preventScrollReset)===!0,q=(h&&h.enableViewTransition)===!0;let g=d||o,R=h&&h.overrideNavigation,C=h!=null&&h.initialHydration&&p.matches&&p.matches.length>0&&!F?p.matches:Ce(g,c,s),_=(h&&h.flushSync)===!0;if(C&&p.initialized&&!de&&Qn(p.location,c)&&!(h&&h.submission&&se(h.submission.formMethod))){Ae(c,{matches:C},{flushSync:_});return}let S=st(C,g,c.pathname);if(S.active&&S.matches&&(C=S.matches),!C){let{error:W,notFoundMatches:k,route:K}=Et(c.pathname);Ae(c,{matches:k,loaderData:{},errors:{[K.id]:W}},{flushSync:_});return}U=new AbortController;let x=ke(e.history,c,U.signal,h&&h.submission),E;if(h&&h.pendingError)E=[Te(C).route.id,{type:z.error,error:h.pendingError}];else if(h&&h.submission&&se(h.submission.formMethod)){let W=await Wr(x,c,h.submission,C,S.active,{replace:h.replace,flushSync:_});if(W.shortCircuited)return;if(W.pendingActionResult){let[k,K]=W.pendingActionResult;if(ie(K)&&et(K.error)&&K.error.status===404){U=null,Ae(c,{matches:W.matches,loaderData:{},errors:{[k]:K.error}});return}}C=W.matches||C,E=W.pendingActionResult,R=Ct(c,h.submission),_=!1,S.active=!1,x=ke(e.history,x.url,x.signal)}let{shortCircuited:D,matches:O,loaderData:A,errors:Z}=await Vr(x,c,C,S.active,R,h&&h.submission,h&&h.fetcherSubmission,h&&h.replace,h&&h.initialHydration===!0,_,E);D||(U=null,Ae(c,V({matches:O||C},mr(E),{loaderData:A,errors:Z})))}async function Wr(l,c,h,g,R,C){C===void 0&&(C={}),bt();let _=aa(c,h);if(te({navigation:_},{flushSync:C.flushSync===!0}),R){let E=await ut(g,c.pathname,l.signal);if(E.type==="aborted")return{shortCircuited:!0};if(E.type==="error"){let D=Te(E.partialMatches).route.id;return{matches:E.partialMatches,pendingActionResult:[D,{type:z.error,error:E.error}]}}else if(E.matches)g=E.matches;else{let{notFoundMatches:D,error:O,route:A}=Et(c.pathname);return{matches:D,pendingActionResult:[A.id,{type:z.error,error:O}]}}}let S,x=Qe(g,c);if(!x.route.action&&!x.route.lazy)S={type:z.error,error:ne(405,{method:l.method,pathname:c.pathname,routeId:x.route.id})};else if(S=(await $e("action",p,l,[x],g,null))[x.route.id],l.signal.aborted)return{shortCircuited:!0};if(Me(S)){let E;return C&&C.replace!=null?E=C.replace:E=cr(S.response.headers.get("Location"),new URL(l.url),s,e.history)===p.location.pathname+p.location.search,await Le(l,S,!0,{submission:h,replace:E}),{shortCircuited:!0}}if(be(S))throw ne(400,{type:"defer-action"});if(ie(S)){let E=Te(g,x.route.id);return(C&&C.replace)!==!0&&(M=X.Push),{matches:g,pendingActionResult:[E.route.id,S]}}return{matches:g,pendingActionResult:[x.route.id,S]}}async function Vr(l,c,h,g,R,C,_,S,x,E,D){let O=R||Ct(c,C),A=C||_||gr(O),Z=!re&&(!m.v7_partialHydration||!x);if(g){if(Z){let J=Ht(D);te(V({navigation:O},J!==void 0?{actionData:J}:{}),{flushSync:E})}let B=await ut(h,c.pathname,l.signal);if(B.type==="aborted")return{shortCircuited:!0};if(B.type==="error"){let J=Te(B.partialMatches).route.id;return{matches:B.partialMatches,loaderData:{},errors:{[J]:B.error}}}else if(B.matches)h=B.matches;else{let{error:J,notFoundMatches:Ie,route:Ge}=Et(c.pathname);return{matches:Ie,loaderData:{},errors:{[Ge.id]:J}}}}let W=d||o,[k,K]=lr(e.history,p,h,A,c,m.v7_partialHydration&&x===!0,m.v7_skipActionErrorRevalidation,de,rt,nt,le,Fe,fe,W,s,D);if(St(B=>!(h&&h.some(J=>J.route.id===B))||k&&k.some(J=>J.route.id===B)),We=++at,k.length===0&&K.length===0){let B=Kt();return Ae(c,V({matches:h,loaderData:{},errors:D&&ie(D[1])?{[D[0]]:D[1].error}:null},mr(D),B?{fetchers:new Map(p.fetchers)}:{}),{flushSync:E}),{shortCircuited:!0}}if(Z){let B={};if(!g){B.navigation=O;let J=Ht(D);J!==void 0&&(B.actionData=J)}K.length>0&&(B.fetchers=$r(K)),te(B,{flushSync:E})}K.forEach(B=>{we(B.key),B.controller&&Q.set(B.key,B.controller)});let je=()=>K.forEach(B=>we(B.key));U&&U.signal.addEventListener("abort",je);let{loaderResults:Ke,fetcherResults:me}=await Wt(p,h,k,K,l);if(l.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",je),K.forEach(B=>Q.delete(B.key));let ue=ft(Ke);if(ue)return await Le(l,ue.result,!0,{replace:S}),{shortCircuited:!0};if(ue=ft(me),ue)return fe.add(ue.key),await Le(l,ue.result,!0,{replace:S}),{shortCircuited:!0};let{loaderData:Pt,errors:Je}=fr(p,h,Ke,D,K,me,Se);Se.forEach((B,J)=>{B.subscribe(Ie=>{(Ie||B.done)&&Se.delete(J)})}),m.v7_partialHydration&&x&&p.errors&&(Je=V({},p.errors,Je));let De=Kt(),ct=Jt(We),dt=De||ct||K.length>0;return V({matches:h,loaderData:Pt,errors:Je},dt?{fetchers:new Map(p.fetchers)}:{})}function Ht(l){if(l&&!ie(l[1]))return{[l[0]]:l[1].data};if(p.actionData)return Object.keys(p.actionData).length===0?null:p.actionData}function $r(l){return l.forEach(c=>{let h=p.fetchers.get(c.key),g=Xe(void 0,h?h.data:void 0);p.fetchers.set(c.key,g)}),new Map(p.fetchers)}function Kr(l,c,h,g){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");we(l);let R=(g&&g.flushSync)===!0,C=d||o,_=Tt(p.location,p.matches,s,m.v7_prependBasename,h,m.v7_relativeSplatPath,c,g==null?void 0:g.relative),S=Ce(C,_,s),x=st(S,C,_);if(x.active&&x.matches&&(S=x.matches),!S){he(l,c,ne(404,{pathname:_}),{flushSync:R});return}let{path:E,submission:D,error:O}=ir(m.v7_normalizeFormMethod,!0,_,g);if(O){he(l,c,O,{flushSync:R});return}let A=Qe(S,E),Z=(g&&g.preventScrollReset)===!0;if(D&&se(D.formMethod)){Jr(l,c,E,A,S,x.active,R,Z,D);return}Fe.set(l,{routeId:c,path:E}),Gr(l,c,E,A,S,x.active,R,Z,D)}async function Jr(l,c,h,g,R,C,_,S,x){bt(),Fe.delete(l);function E(Y){if(!Y.route.action&&!Y.route.lazy){let Be=ne(405,{method:x.formMethod,pathname:h,routeId:c});return he(l,c,Be,{flushSync:_}),!0}return!1}if(!C&&E(g))return;let D=p.fetchers.get(l);ye(l,ia(x,D),{flushSync:_});let O=new AbortController,A=ke(e.history,h,O.signal,x);if(C){let Y=await ut(R,new URL(A.url).pathname,A.signal,l);if(Y.type==="aborted")return;if(Y.type==="error"){he(l,c,Y.error,{flushSync:_});return}else if(Y.matches){if(R=Y.matches,g=Qe(R,h),E(g))return}else{he(l,c,ne(404,{pathname:h}),{flushSync:_});return}}Q.set(l,O);let Z=at,k=(await $e("action",p,A,[g],R,l))[g.route.id];if(A.signal.aborted){Q.get(l)===O&&Q.delete(l);return}if(m.v7_fetcherPersist&&le.has(l)){if(Me(k)||ie(k)){ye(l,Re(void 0));return}}else{if(Me(k))if(Q.delete(l),We>Z){ye(l,Re(void 0));return}else return fe.add(l),ye(l,Xe(x)),Le(A,k,!1,{fetcherSubmission:x,preventScrollReset:S});if(ie(k)){he(l,c,k.error);return}}if(be(k))throw ne(400,{type:"defer-action"});let K=p.navigation.location||p.location,je=ke(e.history,K,O.signal),Ke=d||o,me=p.navigation.state!=="idle"?Ce(Ke,p.navigation.location,s):p.matches;N(me,"Didn't find any matches after fetcher action");let ue=++at;Ne.set(l,ue);let Pt=Xe(x,k.data);p.fetchers.set(l,Pt);let[Je,De]=lr(e.history,p,me,x,K,!1,m.v7_skipActionErrorRevalidation,de,rt,nt,le,Fe,fe,Ke,s,[g.route.id,k]);De.filter(Y=>Y.key!==l).forEach(Y=>{let Be=Y.key,Qt=p.fetchers.get(Be),tn=Xe(void 0,Qt?Qt.data:void 0);p.fetchers.set(Be,tn),we(Be),Y.controller&&Q.set(Be,Y.controller)}),te({fetchers:new Map(p.fetchers)});let ct=()=>De.forEach(Y=>we(Y.key));O.signal.addEventListener("abort",ct);let{loaderResults:dt,fetcherResults:B}=await Wt(p,me,Je,De,je);if(O.signal.aborted)return;O.signal.removeEventListener("abort",ct),Ne.delete(l),Q.delete(l),De.forEach(Y=>Q.delete(Y.key));let J=ft(dt);if(J)return Le(je,J.result,!1,{preventScrollReset:S});if(J=ft(B),J)return fe.add(J.key),Le(je,J.result,!1,{preventScrollReset:S});let{loaderData:Ie,errors:Ge}=fr(p,me,dt,void 0,De,B,Se);if(p.fetchers.has(l)){let Y=Re(k.data);p.fetchers.set(l,Y)}Jt(ue),p.navigation.state==="loading"&&ue>We?(N(M,"Expected pending action"),U&&U.abort(),Ae(p.navigation.location,{matches:me,loaderData:Ie,errors:Ge,fetchers:new Map(p.fetchers)})):(te({errors:Ge,loaderData:hr(p.loaderData,Ie,me,Ge),fetchers:new Map(p.fetchers)}),de=!1)}async function Gr(l,c,h,g,R,C,_,S,x){let E=p.fetchers.get(l);ye(l,Xe(x,E?E.data:void 0),{flushSync:_});let D=new AbortController,O=ke(e.history,h,D.signal);if(C){let k=await ut(R,new URL(O.url).pathname,O.signal,l);if(k.type==="aborted")return;if(k.type==="error"){he(l,c,k.error,{flushSync:_});return}else if(k.matches)R=k.matches,g=Qe(R,h);else{he(l,c,ne(404,{pathname:h}),{flushSync:_});return}}Q.set(l,D);let A=at,W=(await $e("loader",p,O,[g],R,l))[g.route.id];if(be(W)&&(W=await At(W,O.signal,!0)||W),Q.get(l)===D&&Q.delete(l),!O.signal.aborted){if(le.has(l)){ye(l,Re(void 0));return}if(Me(W))if(We>A){ye(l,Re(void 0));return}else{fe.add(l),await Le(O,W,!1,{preventScrollReset:S});return}if(ie(W)){he(l,c,W.error);return}N(!be(W),"Unhandled fetcher deferred data"),ye(l,Re(W.data))}}async function Le(l,c,h,g){let{submission:R,fetcherSubmission:C,preventScrollReset:_,replace:S}=g===void 0?{}:g;c.response.headers.has("X-Remix-Revalidate")&&(de=!0);let x=c.response.headers.get("Location");N(x,"Expected a Location header on the redirect Response"),x=cr(x,new URL(l.url),s,e.history);let E=Ze(p.location,x,{_isRedirect:!0});if(r){let k=!1;if(c.response.headers.has("X-Remix-Reload-Document"))k=!0;else if(Ft.test(x)){const K=e.history.createURL(x);k=K.origin!==t.location.origin||ve(K.pathname,s)==null}if(k){S?t.location.replace(x):t.location.assign(x);return}}U=null;let D=S===!0||c.response.headers.has("X-Remix-Replace")?X.Replace:X.Push,{formMethod:O,formAction:A,formEncType:Z}=p.navigation;!R&&!C&&O&&A&&Z&&(R=gr(p.navigation));let W=R||C;if(Bn.has(c.response.status)&&W&&se(W.formMethod))await xe(D,E,{submission:V({},W,{formAction:x}),preventScrollReset:_||H,enableViewTransition:h?q:void 0});else{let k=Ct(E,R);await xe(D,E,{overrideNavigation:k,fetcherSubmission:C,preventScrollReset:_||H,enableViewTransition:h?q:void 0})}}async function $e(l,c,h,g,R,C){let _,S={};try{_=await Jn(i,l,c,h,g,R,C,u,a)}catch(x){return g.forEach(E=>{S[E.route.id]={type:z.error,error:x}}),S}for(let[x,E]of Object.entries(_))if(Zn(E)){let D=E.result;S[x]={type:z.redirect,response:Xn(D,h,x,R,s,m.v7_relativeSplatPath)}}else S[x]=await Yn(E);return S}async function Wt(l,c,h,g,R){let C=l.matches,_=$e("loader",l,R,h,c,null),S=Promise.all(g.map(async D=>{if(D.matches&&D.match&&D.controller){let A=(await $e("loader",l,ke(e.history,D.path,D.controller.signal),[D.match],D.matches,D.key))[D.match.route.id];return{[D.key]:A}}else return Promise.resolve({[D.key]:{type:z.error,error:ne(404,{pathname:D.path})}})})),x=await _,E=(await S).reduce((D,O)=>Object.assign(D,O),{});return await Promise.all([ra(c,x,R.signal,C,l.loaderData),na(c,E,g)]),{loaderResults:x,fetcherResults:E}}function bt(){de=!0,rt.push(...St()),Fe.forEach((l,c)=>{Q.has(c)&&nt.add(c),we(c)})}function ye(l,c,h){h===void 0&&(h={}),p.fetchers.set(l,c),te({fetchers:new Map(p.fetchers)},{flushSync:(h&&h.flushSync)===!0})}function he(l,c,h,g){g===void 0&&(g={});let R=Te(p.matches,c);ot(l),te({errors:{[R.route.id]:h},fetchers:new Map(p.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function Vt(l){return Ve.set(l,(Ve.get(l)||0)+1),le.has(l)&&le.delete(l),p.fetchers.get(l)||kn}function ot(l){let c=p.fetchers.get(l);Q.has(l)&&!(c&&c.state==="loading"&&Ne.has(l))&&we(l),Fe.delete(l),Ne.delete(l),fe.delete(l),m.v7_fetcherPersist&&le.delete(l),nt.delete(l),p.fetchers.delete(l)}function Yr(l){let c=(Ve.get(l)||0)-1;c<=0?(Ve.delete(l),le.add(l),m.v7_fetcherPersist||ot(l)):Ve.set(l,c),te({fetchers:new Map(p.fetchers)})}function we(l){let c=Q.get(l);c&&(c.abort(),Q.delete(l))}function $t(l){for(let c of l){let h=Vt(c),g=Re(h.data);p.fetchers.set(c,g)}}function Kt(){let l=[],c=!1;for(let h of fe){let g=p.fetchers.get(h);N(g,"Expected fetcher: "+h),g.state==="loading"&&(fe.delete(h),l.push(h),c=!0)}return $t(l),c}function Jt(l){let c=[];for(let[h,g]of Ne)if(g<l){let R=p.fetchers.get(h);N(R,"Expected fetcher: "+h),R.state==="loading"&&(we(h),Ne.delete(h),c.push(h))}return $t(c),c.length>0}function Xr(l,c){let h=p.blockers.get(l)||Ye;return Pe.get(l)!==c&&Pe.set(l,c),h}function Gt(l){p.blockers.delete(l),Pe.delete(l)}function lt(l,c){let h=p.blockers.get(l)||Ye;N(h.state==="unblocked"&&c.state==="blocked"||h.state==="blocked"&&c.state==="blocked"||h.state==="blocked"&&c.state==="proceeding"||h.state==="blocked"&&c.state==="unblocked"||h.state==="proceeding"&&c.state==="unblocked","Invalid blocker state transition: "+h.state+" -> "+c.state);let g=new Map(p.blockers);g.set(l,c),te({blockers:g})}function Yt(l){let{currentLocation:c,nextLocation:h,historyAction:g}=l;if(Pe.size===0)return;Pe.size>1&&_e(!1,"A router only supports one blocker at a time");let R=Array.from(Pe.entries()),[C,_]=R[R.length-1],S=p.blockers.get(C);if(!(S&&S.state==="proceeding")&&_({currentLocation:c,nextLocation:h,historyAction:g}))return C}function Et(l){let c=ne(404,{pathname:l}),h=d||o,{matches:g,route:R}=pr(h);return St(),{notFoundMatches:g,route:R,error:c}}function St(l){let c=[];return Se.forEach((h,g)=>{(!l||l(g))&&(h.cancel(),c.push(g),Se.delete(g))}),c}function qr(l,c,h){if(P=l,T=c,b=h||null,!j&&p.navigation===Dt){j=!0;let g=qt(p.location,p.matches);g!=null&&te({restoreScrollPosition:g})}return()=>{P=null,T=null,b=null}}function Xt(l,c){return b&&b(l,c.map(g=>vn(g,p.loaderData)))||l.key}function Qr(l,c){if(P&&T){let h=Xt(l,c);P[h]=T()}}function qt(l,c){if(P){let h=Xt(l,c),g=P[h];if(typeof g=="number")return g}return null}function st(l,c,h){if(f)if(l){if(Object.keys(l[0].params).length>0)return{active:!0,matches:ht(c,h,s,!0)}}else return{active:!0,matches:ht(c,h,s,!0)||[]};return{active:!1,matches:null}}async function ut(l,c,h,g){if(!f)return{type:"success",matches:l};let R=l;for(;;){let C=d==null,_=d||o,S=u;try{await f({signal:h,path:c,matches:R,fetcherKey:g,patch:(D,O)=>{h.aborted||ur(D,O,_,S,a)}})}catch(D){return{type:"error",error:D,partialMatches:R}}finally{C&&!h.aborted&&(o=[...o])}if(h.aborted)return{type:"aborted"};let x=Ce(_,c,s);if(x)return{type:"success",matches:x};let E=ht(_,c,s,!0);if(!E||R.length===E.length&&R.every((D,O)=>D.route.id===E[O].route.id))return{type:"success",matches:null};R=E}}function Zr(l){u={},d=mt(l,a,void 0,u)}function en(l,c){let h=d==null;ur(l,c,d||o,u,a),h&&(o=[...o],te({}))}return oe={get basename(){return s},get future(){return m},get state(){return p},get routes(){return o},get window(){return t},initialize:Br,subscribe:zr,enableScrollRestoration:qr,navigate:zt,fetch:Kr,revalidate:Hr,createHref:l=>e.history.createHref(l),encodeLocation:l=>e.history.encodeLocation(l),getFetcher:Vt,deleteFetcher:Yr,dispose:kr,getBlocker:Xr,deleteBlocker:Gt,patchRoutes:en,_internalFetchControllers:Q,_internalActiveDeferreds:Se,_internalSetRoutes:Zr},oe}function Wn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Tt(e,t,r,n,a,u,o,d){let s,i;if(o){s=[];for(let m of t)if(s.push(m),m.route.id===o){i=m;break}}else s=t,i=t[t.length-1];let f=wt(a||".",yt(s,u),ve(e.pathname,r)||e.pathname,d==="path");if(a==null&&(f.search=e.search,f.hash=e.hash),(a==null||a===""||a===".")&&i){let m=jt(f.search);if(i.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!i.route.index&&m){let y=new URLSearchParams(f.search),w=y.getAll("index");y.delete("index"),w.filter(b=>b).forEach(b=>y.append("index",b));let P=y.toString();f.search=P?"?"+P:""}}return n&&r!=="/"&&(f.pathname=f.pathname==="/"?r:pe([r,f.pathname])),Oe(f)}function ir(e,t,r,n){if(!n||!Wn(n))return{path:r};if(n.formMethod&&!ta(n.formMethod))return{path:r,error:ne(405,{method:n.formMethod})};let a=()=>({path:r,error:ne(400,{type:"invalid-body"})}),u=n.formMethod||"get",o=e?u.toUpperCase():u.toLowerCase(),d=Mr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!se(o))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,P)=>{let[b,T]=P;return""+w+b+"="+T+`
`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!se(o))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}N(typeof FormData=="function","FormData is not available in this environment");let s,i;if(n.formData)s=_t(n.formData),i=n.formData;else if(n.body instanceof FormData)s=_t(n.body),i=n.body;else if(n.body instanceof URLSearchParams)s=n.body,i=dr(s);else if(n.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(n.body),i=dr(s)}catch{return a()}let f={formMethod:o,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(se(f.formMethod))return{path:r,submission:f};let m=Ee(r);return t&&m.search&&jt(m.search)&&s.append("index",""),m.search="?"+s,{path:Oe(m),submission:f}}function or(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function lr(e,t,r,n,a,u,o,d,s,i,f,m,y,w,P,b){let T=b?ie(b[1])?b[1].error:b[1].data:void 0,j=e.createURL(t.location),L=e.createURL(a),F=r;u&&t.errors?F=or(r,Object.keys(t.errors)[0],!0):b&&ie(b[1])&&(F=or(r,b[0]));let I=b?b[1].statusCode:void 0,$=o&&I&&I>=400,oe=F.filter((M,H)=>{let{route:U}=M;if(U.lazy)return!0;if(U.loader==null)return!1;if(u)return Mt(U,t.loaderData,t.errors);if(Vn(t.loaderData,t.matches[H],M)||s.some(ae=>ae===M.route.id))return!0;let q=t.matches[H],G=M;return sr(M,V({currentUrl:j,currentParams:q.params,nextUrl:L,nextParams:G.params},n,{actionResult:T,actionStatus:I,defaultShouldRevalidate:$?!1:d||j.pathname+j.search===L.pathname+L.search||j.search!==L.search||Cr(q,G)}))}),p=[];return m.forEach((M,H)=>{if(u||!r.some(re=>re.route.id===M.routeId)||f.has(H))return;let U=Ce(w,M.path,P);if(!U){p.push({key:H,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let q=t.fetchers.get(H),G=Qe(U,M.path),ae=!1;y.has(H)?ae=!1:i.has(H)?(i.delete(H),ae=!0):q&&q.state!=="idle"&&q.data===void 0?ae=d:ae=sr(G,V({currentUrl:j,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:T,actionStatus:I,defaultShouldRevalidate:$?!1:d})),ae&&p.push({key:H,routeId:M.routeId,path:M.path,matches:U,match:G,controller:new AbortController})}),[oe,p]}function Mt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Vn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Cr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function sr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function ur(e,t,r,n,a){var u;let o;if(e){let i=n[e];N(i,"No route found to patch children into: routeId = "+e),i.children||(i.children=[]),o=i.children}else o=r;let d=t.filter(i=>!o.some(f=>Tr(i,f))),s=mt(d,a,[e||"_","patch",String(((u=o)==null?void 0:u.length)||"0")],n);o.push(...s)}function Tr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(u=>Tr(r,u))}):!1}async function $n(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];N(a,"No route found in manifest");let u={};for(let o in n){let s=a[o]!==void 0&&o!=="hasErrorBoundary";_e(!s,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!s&&!mn.has(o)&&(u[o]=n[o])}Object.assign(a,u),Object.assign(a,V({},t(a),{lazy:void 0}))}async function Kn(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,u,o)=>Object.assign(a,{[r[o].route.id]:u}),{})}async function Jn(e,t,r,n,a,u,o,d,s,i){let f=u.map(w=>w.route.lazy?$n(w.route,s,d):void 0),m=u.map((w,P)=>{let b=f[P],T=a.some(L=>L.route.id===w.route.id);return V({},w,{shouldLoad:T,resolve:async L=>(L&&n.method==="GET"&&(w.route.lazy||w.route.loader)&&(T=!0),T?Gn(t,n,w,b,L,i):Promise.resolve({type:z.data,result:void 0}))})}),y=await e({matches:m,request:n,params:u[0].params,fetcherKey:o,context:i});try{await Promise.all(f)}catch{}return y}async function Gn(e,t,r,n,a,u){let o,d,s=i=>{let f,m=new Promise((P,b)=>f=b);d=()=>f(),t.signal.addEventListener("abort",d);let y=P=>typeof i!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):i({request:t,params:r.params,context:u},...P!==void 0?[P]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(b=>y(b)):y())}}catch(P){return{type:"error",result:P}}})();return Promise.race([w,m])};try{let i=r.route[e];if(n)if(i){let f,[m]=await Promise.all([s(i).catch(y=>{f=y}),n]);if(f!==void 0)throw f;o=m}else if(await n,i=r.route[e],i)o=await s(i);else if(e==="action"){let f=new URL(t.url),m=f.pathname+f.search;throw ne(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:z.data,result:void 0};else if(i)o=await s(i);else{let f=new URL(t.url),m=f.pathname+f.search;throw ne(404,{pathname:m})}N(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(i){return{type:z.error,result:i}}finally{d&&t.signal.removeEventListener("abort",d)}return o}async function Yn(e){let{result:t,type:r}=e;if(_r(t)){let m;try{let y=t.headers.get("Content-Type");y&&/\bapplication\/json\b/.test(y)?t.body==null?m=null:m=await t.json():m=await t.text()}catch(y){return{type:z.error,error:y}}return r===z.error?{type:z.error,error:new vt(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:z.data,data:m,statusCode:t.status,headers:t.headers}}if(r===z.error){if(vr(t)){var n,a;if(t.data instanceof Error){var u,o;return{type:z.error,error:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:new vt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:et(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:t,statusCode:et(t)?t.status:void 0}}if(ea(t)){var d,s;return{type:z.deferred,deferredData:t,statusCode:(d=t.init)==null?void 0:d.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(vr(t)){var i,f;return{type:z.data,data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}}return{type:z.data,data:t}}function Xn(e,t,r,n,a,u){let o=e.headers.get("Location");if(N(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ft.test(o)){let d=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=Tt(new URL(t.url),d,a,!0,o,u),e.headers.set("Location",o)}return e}function cr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Ft.test(e)){let u=e,o=u.startsWith("//")?new URL(t.protocol+u):new URL(u);if(a.includes(o.protocol))throw new Error("Invalid redirect location");let d=ve(o.pathname,r)!=null;if(o.origin===t.origin&&d)return Nt(o.pathname)+o.search+o.hash}try{let u=n.createURL(e);if(a.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return e}function ke(e,t,r,n){let a=e.createURL(Mr(t)).toString(),u={signal:r};if(n&&se(n.formMethod)){let{formMethod:o,formEncType:d}=n;u.method=o.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(n.json)):d==="text/plain"?u.body=n.text:d==="application/x-www-form-urlencoded"&&n.formData?u.body=_t(n.formData):u.body=n.formData}return new Request(a,u)}function _t(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function dr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function qn(e,t,r,n,a){let u={},o=null,d,s=!1,i={},f=r&&ie(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let y=m.route.id,w=t[y];if(N(!Me(w),"Cannot handle redirect results in processLoaderData"),ie(w)){let P=w.error;f!==void 0&&(P=f,f=void 0),o=o||{};{let b=Te(e,y);o[b.route.id]==null&&(o[b.route.id]=P)}u[y]=void 0,s||(s=!0,d=et(w.error)?w.error.status:500),w.headers&&(i[y]=w.headers)}else be(w)?(n.set(y,w.deferredData),u[y]=w.deferredData.data,w.statusCode!=null&&w.statusCode!==200&&!s&&(d=w.statusCode),w.headers&&(i[y]=w.headers)):(u[y]=w.data,w.statusCode&&w.statusCode!==200&&!s&&(d=w.statusCode),w.headers&&(i[y]=w.headers))}),f!==void 0&&r&&(o={[r[0]]:f},u[r[0]]=void 0),{loaderData:u,errors:o,statusCode:d||200,loaderHeaders:i}}function fr(e,t,r,n,a,u,o){let{loaderData:d,errors:s}=qn(t,r,n,o);return a.forEach(i=>{let{key:f,match:m,controller:y}=i,w=u[f];if(N(w,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(ie(w)){let P=Te(e.matches,m==null?void 0:m.route.id);s&&s[P.route.id]||(s=V({},s,{[P.route.id]:w.error})),e.fetchers.delete(f)}else if(Me(w))N(!1,"Unhandled fetcher revalidation redirect");else if(be(w))N(!1,"Unhandled fetcher deferred data");else{let P=Re(w.data);e.fetchers.set(f,P)}}),{loaderData:d,errors:s}}function hr(e,t,r,n){let a=V({},t);for(let u of r){let o=u.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&u.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function mr(e){return e?ie(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Te(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function pr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ne(e,t){let{pathname:r,routeId:n,method:a,type:u,message:o}=t===void 0?{}:t,d="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(d="Bad Request",a&&r&&n?s="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":u==="defer-action"?s="defer() is not supported in actions":u==="invalid-body"&&(s="Unable to encode submission body")):e===403?(d="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):e===404?(d="Not Found",s='No route matches URL "'+r+'"'):e===405&&(d="Method Not Allowed",a&&r&&n?s="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(s='Invalid request method "'+a.toUpperCase()+'"')),new vt(e||500,d,new Error(s),!0)}function ft(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Me(a))return{key:n,result:a}}}function Mr(e){let t=typeof e=="string"?Ee(e):e;return Oe(V({},t,{hash:""}))}function Qn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Zn(e){return _r(e.result)&&In.has(e.result.status)}function be(e){return e.type===z.deferred}function ie(e){return e.type===z.error}function Me(e){return(e&&e.type)===z.redirect}function vr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ea(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function _r(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ta(e){return jn.has(e.toLowerCase())}function se(e){return Fn.has(e.toLowerCase())}async function ra(e,t,r,n,a){let u=Object.entries(t);for(let o=0;o<u.length;o++){let[d,s]=u[o],i=e.find(y=>(y==null?void 0:y.route.id)===d);if(!i)continue;let f=n.find(y=>y.route.id===i.route.id),m=f!=null&&!Cr(f,i)&&(a&&a[i.route.id])!==void 0;be(s)&&m&&await At(s,r,!1).then(y=>{y&&(t[d]=y)})}}async function na(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:u,controller:o}=r[n],d=t[a];e.find(i=>(i==null?void 0:i.route.id)===u)&&be(d)&&(N(o,"Expected an AbortController for revalidating fetcher deferred result"),await At(d,o.signal,!0).then(i=>{i&&(t[a]=i)}))}}async function At(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:z.error,error:a}}return{type:z.data,data:e.deferredData.data}}}function jt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qe(e,t){let r=typeof t=="string"?Ee(t).search:t.search;if(e[e.length-1].route.index&&jt(r||""))return e[e.length-1];let n=xr(e);return n[n.length-1]}function gr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:u,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(u!=null)return{formMethod:t,formAction:r,formEncType:n,formData:u,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Ct(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function aa(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Xe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ia(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Re(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function oa(e,t){try{let r=e.sessionStorage.getItem(Dr);if(r){let n=JSON.parse(r);for(let[a,u]of Object.entries(n||{}))u&&Array.isArray(u)&&t.set(a,new Set(u||[]))}}catch{}}function la(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Dr,JSON.stringify(r))}catch(n){_e(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
 * React Router v6.30.4
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gt.apply(null,arguments)}const tt=v.createContext(null),It=v.createContext(null),ge=v.createContext(null),Bt=v.createContext(null),ce=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Or=v.createContext(null);function sa(e,t){let{relative:r}=t===void 0?{}:t;He()||N(!1);let{basename:n,navigator:a}=v.useContext(ge),{hash:u,pathname:o,search:d}=Rt(e,{relative:r}),s=o;return n!=="/"&&(s=o==="/"?n:pe([n,o])),a.createHref({pathname:s,search:d,hash:u})}function He(){return v.useContext(Bt)!=null}function Ue(){return He()||N(!1),v.useContext(Bt).location}function Ur(e){v.useContext(ge).static||v.useLayoutEffect(e)}function kt(){let{isDataRoute:e}=v.useContext(ce);return e?Ea():ua()}function ua(){He()||N(!1);let e=v.useContext(tt),{basename:t,future:r,navigator:n}=v.useContext(ge),{matches:a}=v.useContext(ce),{pathname:u}=Ue(),o=JSON.stringify(yt(a,r.v7_relativeSplatPath)),d=v.useRef(!1);return Ur(()=>{d.current=!0}),v.useCallback(function(i,f){if(f===void 0&&(f={}),!d.current)return;if(typeof i=="number"){n.go(i);return}let m=wt(i,JSON.parse(o),u,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:pe([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,u,e])}const ca=v.createContext(null);function da(e){let t=v.useContext(ce).outlet;return t&&v.createElement(ca.Provider,{value:e},t)}function Ya(){let{matches:e}=v.useContext(ce),t=e[e.length-1];return t?t.params:{}}function Rt(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=v.useContext(ge),{matches:a}=v.useContext(ce),{pathname:u}=Ue(),o=JSON.stringify(yt(a,n.v7_relativeSplatPath));return v.useMemo(()=>wt(e,JSON.parse(o),u,r==="path"),[e,o,u,r])}function fa(e,t,r,n){He()||N(!1);let{navigator:a}=v.useContext(ge),{matches:u}=v.useContext(ce),o=u[u.length-1],d=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let i=Ue(),f;f=i;let m=f.pathname||"/",y=m;if(s!=="/"){let b=s.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=Ce(e,{pathname:y});return ga(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},d,b.params),pathname:pe([s,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?s:pe([s,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,r,n)}function ha(){let e=ba(),t=et(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),r?v.createElement("pre",{style:a},r):null,null)}const ma=v.createElement(ha,null);class pa extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?v.createElement(ce.Provider,{value:this.props.routeContext},v.createElement(Or.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function va(e){let{routeContext:t,match:r,children:n}=e,a=v.useContext(tt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),v.createElement(ce.Provider,{value:t},n)}function ga(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var u;if(!r)return null;if(r.errors)e=r.matches;else if((u=n)!=null&&u.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,d=(a=r)==null?void 0:a.errors;if(d!=null){let f=o.findIndex(m=>m.route.id&&(d==null?void 0:d[m.route.id])!==void 0);f>=0||N(!1),o=o.slice(0,Math.min(o.length,f+1))}let s=!1,i=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<o.length;f++){let m=o[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(i=f),m.route.id){let{loaderData:y,errors:w}=r,P=m.route.loader&&y[m.route.id]===void 0&&(!w||w[m.route.id]===void 0);if(m.route.lazy||P){s=!0,i>=0?o=o.slice(0,i+1):o=[o[0]];break}}}return o.reduceRight((f,m,y)=>{let w,P=!1,b=null,T=null;r&&(w=d&&m.route.id?d[m.route.id]:void 0,b=m.route.errorElement||ma,s&&(i<0&&y===0?(Sa("route-fallback"),P=!0,T=null):i===y&&(P=!0,T=m.route.hydrateFallbackElement||null)));let j=t.concat(o.slice(0,y+1)),L=()=>{let F;return w?F=b:P?F=T:m.route.Component?F=v.createElement(m.route.Component,null):m.route.element?F=m.route.element:F=f,v.createElement(va,{match:m,routeContext:{outlet:f,matches:j,isDataRoute:r!=null},children:F})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?v.createElement(pa,{location:r.location,revalidation:r.revalidation,component:b,error:w,children:L(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):L()},null)}var Nr=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Nr||{}),Fr=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Fr||{});function ya(e){let t=v.useContext(tt);return t||N(!1),t}function wa(e){let t=v.useContext(It);return t||N(!1),t}function Ra(e){let t=v.useContext(ce);return t||N(!1),t}function Ar(e){let t=Ra(),r=t.matches[t.matches.length-1];return r.route.id||N(!1),r.route.id}function ba(){var e;let t=v.useContext(Or),r=wa(),n=Ar();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Ea(){let{router:e}=ya(Nr.UseNavigateStable),t=Ar(Fr.UseNavigateStable),r=v.useRef(!1);return Ur(()=>{r.current=!0}),v.useCallback(function(a,u){u===void 0&&(u={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,gt({fromRouteId:t},u)))},[e,t])}const yr={};function Sa(e,t,r){yr[e]||(yr[e]=!0)}function Pa(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Xa(e){let{to:t,replace:r,state:n,relative:a}=e;He()||N(!1);let{future:u,static:o}=v.useContext(ge),{matches:d}=v.useContext(ce),{pathname:s}=Ue(),i=kt(),f=wt(t,yt(d,u.v7_relativeSplatPath),s,a==="path"),m=JSON.stringify(f);return v.useEffect(()=>i(JSON.parse(m),{replace:r,state:n,relative:a}),[i,m,a,r,n]),null}function qa(e){return da(e.context)}function xa(e){let{basename:t="/",children:r=null,location:n,navigationType:a=X.Pop,navigator:u,static:o=!1,future:d}=e;He()&&N(!1);let s=t.replace(/^\/*/,"/"),i=v.useMemo(()=>({basename:s,navigator:u,static:o,future:gt({v7_relativeSplatPath:!1},d)}),[s,d,u,o]);typeof n=="string"&&(n=Ee(n));let{pathname:f="/",search:m="",hash:y="",state:w=null,key:P="default"}=n,b=v.useMemo(()=>{let T=ve(f,s);return T==null?null:{location:{pathname:T,search:m,hash:y,state:w,key:P},navigationType:a}},[s,f,m,y,w,P,a]);return b==null?null:v.createElement(ge.Provider,{value:i},v.createElement(Bt.Provider,{children:r,value:b}))}new Promise(()=>{});function La(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
 * React Router DOM v6.30.4
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ze.apply(null,arguments)}function jr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Da(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ca(e,t){return e.button===0&&(!t||t==="_self")&&!Da(e)}function Ot(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Ta(e,t){let r=Ot(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(u=>{r.append(a,u)})}),r}const Ma=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_a=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Oa="6";try{window.__reactRouterVersion=Oa}catch{}function Qa(e,t){return Hn({basename:void 0,future:ze({},void 0,{v7_prependBasename:!0}),history:dn({window:void 0}),hydrationData:Ua(),routes:e,mapRouteProperties:La,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Ua(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ze({},t,{errors:Na(t.errors)})),t}function Na(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new vt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let u=window[a.__subType];if(typeof u=="function")try{let o=new u(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let u=new Error(a.message);u.stack="",r[n]=u}}else r[n]=a;return r}const Ir=v.createContext({isTransitioning:!1}),Fa=v.createContext(new Map),Aa="startTransition",wr=an[Aa],ja="flushSync",Rr=cn[ja];function Ia(e){wr?wr(e):e()}function qe(e){Rr?Rr(e):e()}class Ba{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function Za(e){let{fallbackElement:t,router:r,future:n}=e,[a,u]=v.useState(r.state),[o,d]=v.useState(),[s,i]=v.useState({isTransitioning:!1}),[f,m]=v.useState(),[y,w]=v.useState(),[P,b]=v.useState(),T=v.useRef(new Map),{v7_startTransition:j}=n||{},L=v.useCallback(M=>{j?Ia(M):M()},[j]),F=v.useCallback((M,H)=>{let{deletedFetchers:U,flushSync:q,viewTransitionOpts:G}=H;M.fetchers.forEach((re,de)=>{re.data!==void 0&&T.current.set(de,re.data)}),U.forEach(re=>T.current.delete(re));let ae=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!G||ae){q?qe(()=>u(M)):L(()=>u(M));return}if(q){qe(()=>{y&&(f&&f.resolve(),y.skipTransition()),i({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let re=r.window.document.startViewTransition(()=>{qe(()=>u(M))});re.finished.finally(()=>{qe(()=>{m(void 0),w(void 0),d(void 0),i({isTransitioning:!1})})}),qe(()=>w(re));return}y?(f&&f.resolve(),y.skipTransition(),b({state:M,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(d(M),i({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,y,f,T,L]);v.useLayoutEffect(()=>r.subscribe(F),[r,F]),v.useEffect(()=>{s.isTransitioning&&!s.flushSync&&m(new Ba)},[s]),v.useEffect(()=>{if(f&&o&&r.window){let M=o,H=f.promise,U=r.window.document.startViewTransition(async()=>{L(()=>u(M)),await H});U.finished.finally(()=>{m(void 0),w(void 0),d(void 0),i({isTransitioning:!1})}),w(U)}},[L,o,f,r.window]),v.useEffect(()=>{f&&o&&a.location.key===o.location.key&&f.resolve()},[f,y,a.location,o]),v.useEffect(()=>{!s.isTransitioning&&P&&(d(P.state),i({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),b(void 0))},[s.isTransitioning,P]),v.useEffect(()=>{},[]);let I=v.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:M=>r.navigate(M),push:(M,H,U)=>r.navigate(M,{state:H,preventScrollReset:U==null?void 0:U.preventScrollReset}),replace:(M,H,U)=>r.navigate(M,{replace:!0,state:H,preventScrollReset:U==null?void 0:U.preventScrollReset})}),[r]),$=r.basename||"/",oe=v.useMemo(()=>({router:r,navigator:I,static:!1,basename:$}),[r,I,$]),p=v.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return v.useEffect(()=>Pa(n,r.future),[n,r.future]),v.createElement(v.Fragment,null,v.createElement(tt.Provider,{value:oe},v.createElement(It.Provider,{value:a},v.createElement(Fa.Provider,{value:T.current},v.createElement(Ir.Provider,{value:s},v.createElement(xa,{basename:$,location:a.location,navigationType:a.historyAction,navigator:I,future:p},a.initialized||r.future.v7_partialHydration?v.createElement(ka,{routes:r.routes,future:r.future,state:a}):t))))),null)}const ka=v.memo(za);function za(e){let{routes:t,future:r,state:n}=e;return fa(t,void 0,n,r)}const Ha=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Wa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Va=v.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:u,replace:o,state:d,target:s,to:i,preventScrollReset:f,viewTransition:m}=t,y=jr(t,Ma),{basename:w}=v.useContext(ge),P,b=!1;if(typeof i=="string"&&Wa.test(i)&&(P=i,Ha))try{let F=new URL(window.location.href),I=i.startsWith("//")?new URL(F.protocol+i):new URL(i),$=ve(I.pathname,w);I.origin===F.origin&&$!=null?i=$+I.search+I.hash:b=!0}catch{}let T=sa(i,{relative:a}),j=Ka(i,{replace:o,state:d,target:s,preventScrollReset:f,relative:a,viewTransition:m});function L(F){n&&n(F),F.defaultPrevented||j(F)}return v.createElement("a",ze({},y,{href:P||T,onClick:b||u?n:L,ref:r,target:s}))}),ei=v.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:u="",end:o=!1,style:d,to:s,viewTransition:i,children:f}=t,m=jr(t,_a),y=Rt(s,{relative:m.relative}),w=Ue(),P=v.useContext(It),{navigator:b,basename:T}=v.useContext(ge),j=P!=null&&Ja(y)&&i===!0,L=b.encodeLocation?b.encodeLocation(y).pathname:y.pathname,F=w.pathname,I=P&&P.navigation&&P.navigation.location?P.navigation.location.pathname:null;a||(F=F.toLowerCase(),I=I?I.toLowerCase():null,L=L.toLowerCase()),I&&T&&(I=ve(I,T)||I);const $=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let oe=F===L||!o&&F.startsWith(L)&&F.charAt($)==="/",p=I!=null&&(I===L||!o&&I.startsWith(L)&&I.charAt(L.length)==="/"),M={isActive:oe,isPending:p,isTransitioning:j},H=oe?n:void 0,U;typeof u=="function"?U=u(M):U=[u,oe?"active":null,p?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let q=typeof d=="function"?d(M):d;return v.createElement(Va,ze({},m,{"aria-current":H,className:U,ref:r,style:q,to:s,viewTransition:i}),typeof f=="function"?f(M):f)});var Ut;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ut||(Ut={}));var br;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(br||(br={}));function $a(e){let t=v.useContext(tt);return t||N(!1),t}function Ka(e,t){let{target:r,replace:n,state:a,preventScrollReset:u,relative:o,viewTransition:d}=t===void 0?{}:t,s=kt(),i=Ue(),f=Rt(e,{relative:o});return v.useCallback(m=>{if(Ca(m,r)){m.preventDefault();let y=n!==void 0?n:Oe(i)===Oe(f);s(e,{replace:y,state:a,preventScrollReset:u,relative:o,viewTransition:d})}},[i,s,f,n,a,r,e,u,o,d])}function ti(e){let t=v.useRef(Ot(e)),r=v.useRef(!1),n=Ue(),a=v.useMemo(()=>Ta(n.search,r.current?null:t.current),[n.search]),u=kt(),o=v.useCallback((d,s)=>{const i=Ot(typeof d=="function"?d(a):d);r.current=!0,u("?"+i,s)},[u,a]);return[a,o]}function Ja(e,t){t===void 0&&(t={});let r=v.useContext(Ir);r==null&&N(!1);let{basename:n}=$a(Ut.useViewTransitionState),a=Rt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let u=ve(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=ve(r.nextLocation.pathname,n)||r.nextLocation.pathname;return pt(a.pathname,o)!=null||pt(a.pathname,u)!=null}export{Va as L,Xa as N,qa as O,Za as R,ei as a,ti as b,Qa as c,Ya as d,sn as r,kt as u};
