/*! For license information please see 6815.2368856e.storeFrontContainer.4.4.0.chunk.js.LICENSE.txt */ "use strict";(self.webpackChunkapp_container=self.webpackChunkapp_container||[]).push([[6815],{6815:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>Y,Await:()=>Yt,BrowserRouter:()=>_r,Form:()=>Or,HashRouter:()=>kr,Link:()=>Ur,MemoryRouter:()=>Wt,NavLink:()=>jr,Navigate:()=>Kt,NavigationType:()=>n,Outlet:()=>$t,Route:()=>Jt,Router:()=>Vt,RouterProvider:()=>Lr,Routes:()=>qt,ScrollRestoration:()=>Fr,UNSAFE_DataRouterContext:()=>Qe,UNSAFE_DataRouterStateContext:()=>Ze,UNSAFE_ErrorResponseImpl:()=>te,UNSAFE_FetchersContext:()=>Sr,UNSAFE_LocationContext:()=>rt,UNSAFE_NavigationContext:()=>tt,UNSAFE_RouteContext:()=>nt,UNSAFE_ViewTransitionContext:()=>wr,UNSAFE_useRouteId:()=>_t,UNSAFE_useScrollRestoration:()=>Qr,createBrowserRouter:()=>vr,createHashRouter:()=>yr,createMemoryRouter:()=>nr,createPath:()=>m,createRoutesFromChildren:()=>er,createRoutesFromElements:()=>er,createSearchParams:()=>ur,defer:()=>Q,generatePath:()=>j,isRouteErrorResponse:()=>re,json:()=>q,matchPath:()=>O,matchRoutes:()=>S,parsePath:()=>v,redirect:()=>Z,redirectDocument:()=>ee,renderMatches:()=>tr,resolvePath:()=>B,unstable_HistoryRouter:()=>Tr,unstable_usePrompt:()=>en,unstable_useViewTransitionState:()=>tn,useActionData:()=>jt,useAsyncError:()=>Nt,useAsyncValue:()=>Ft,useBeforeUnload:()=>Zr,useBlocker:()=>It,useFetcher:()=>qr,useFetchers:()=>Yr,useFormAction:()=>Vr,useHref:()=>ot,useInRouterContext:()=>it,useLinkClickHandler:()=>Hr,useLoaderData:()=>Mt,useLocation:()=>st,useMatch:()=>ut,useMatches:()=>At,useNavigate:()=>dt,useNavigation:()=>kt,useNavigationType:()=>lt,useOutlet:()=>pt,useOutletContext:()=>ft,useParams:()=>mt,useResolvedPath:()=>vt,useRevalidator:()=>Tt,useRouteError:()=>Ot,useRouteLoaderData:()=>Ut,useRoutes:()=>yt,useSearchParams:()=>Wr,useSubmit:()=>Jr});var n,a=r(4914),o=r(6672);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;td(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==a?t.length-1:a),s=n.Pop,l=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=p(t?c().pathname:"/",e,r,n);return h("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function f(e){return"string"==typeof e?e:m(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:f,createURL:e=>new URL(f(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?v(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&l&&l({action:s,location:a,delta:1})},replace(e,r){s=n.Replace;let a=d(e,r);t[i]=a,o&&l&&l({action:s,location:a,delta:0})},go(e){s=n.Pop;let r=u(i+e),a=t[r];i=r,l&&l({action:s,location:a,delta:e})},listen:e=>(l=e,()=>{l=null})}}function u(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:m(t)}),null,e)}function c(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=v(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:m(t))}),(function(e,t){h("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function d(e,t){if(!1===e||null==e)throw new Error(t)}function h(e,t){if(!e)try{throw new Error(t)}catch(e){}}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,r,n){return void 0===r&&(r=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?v(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function m(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 v(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 y(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:l=!1}=a,u=o.history,c=n.Pop,h=null,v=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-v;v=e,h&&h({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:m(e);return r=r.replace(/ $/,"%20"),d(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,u.replaceState(i({},u.state,{idx:v}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(s,g),h=e,()=>{o.removeEventListener(s,g),h=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=p(w.location,e,t);r&&r(a,e),v=y()+1;let i=f(a,v),s=w.createHref(a);try{u.pushState(i,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(s)}l&&h&&h({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=p(w.location,e,t);r&&r(a,e),v=y();let o=f(a,v),i=w.createHref(a);u.replaceState(o,"",i),l&&h&&h({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var g;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));const b=new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,String(a)],s="string"==typeof e.id?e.id:o.join("-");if(d(!0!==e.index||!e.children,"Cannot specify children on an index route"),d(!n[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=i({},e,t(e),{id:s});return n[s]=r,r}{let r=i({},e,t(e),{id:s,children:void 0});return n[s]=r,e.children&&(r.children=w(e.children,t,o,n)),r}}))}function S(e,t,r){return void 0===r&&(r="/"),E(e,t,r,!1)}function E(e,t,r,n){let a=N(("string"==typeof t?v(t):t).pathname||"/",r);if(null==a)return null;let o=x(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let e=0;null==i&&e{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(d(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=K([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(d(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),x(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:M(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of D(e.path))a(e,t,r);else a(e,t)})),t}function D(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=D(n.join("/")),s=[];return s.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const C=/^:[\w-]+$/,L=3,P=2,_=1,k=10,T=-2,A=e=>"*"===e;function M(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=T),t&&(n+=P),r.filter((e=>!A(e))).reduce(((e,t)=>e+(C.test(t)?L:""===t?_:k)),n)}function U(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;enull==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return d("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function O(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),h("*"===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,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=s[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[r];return e[n]=a&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function F(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return h(!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 N(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)||"/"}function B(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?v(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:J(n),hash:V(a)}}function I(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 and the router will parse it for you.'}function z(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function H(e,t){let r=z(e);return t?r.map(((e,t)=>t===r.length-1?e.pathname:e.pathnameBase)):r.map((e=>e.pathnameBase))}function W(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=v(e):(a=i({},e),d(!a.pathname||!a.pathname.includes("?"),I("?","pathname","search",a)),d(!a.pathname||!a.pathname.includes("#"),I("#","pathname","hash",a)),d(!a.search||!a.search.includes("#"),I("#","search","hash",a)));let o,s=""===e||""===a.pathname,l=s?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=B(a,o),c=l&&"/"!==l&&l.endsWith("/"),h=(s||"."===l)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!h||(u.pathname+="/"),u}const K=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",V=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),i({},r,{headers:n}))};class Y extends Error{}class X{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],d(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new Y("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof Y)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return d(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:G(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function G(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const Q=function(e,t){return void 0===t&&(t={}),new X(e,"number"==typeof t?{status:t}:t)},Z=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,i({},r,{headers:n}))},ee=(e,t)=>{let r=Z(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class te{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function re(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ne=["post","put","patch","delete"],ae=new Set(ne),oe=["get",...ne],ie=new Set(oe),se=new Set([301,302,303,307,308]),le=new Set([307,308]),ue={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},de={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},he=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),pe="remix-router-transitions";function me(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(d(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=fe;let s,l,u,c={},f=w(e.routes,o,void 0,c),m=e.basename||"/",v=e.unstable_dataStrategy||xe,y=e.unstable_patchRoutesOnMiss,b=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),x=null,D=new Set,C=null,L=null,P=null,_=null!=e.hydrationData,k=S(f,e.history.location,m),T=null;if(null==k&&!y){let t=je(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Ue(f);k=r,T={[n.id]:t}}if(k&&y&&dt(k,f,e.history.location.pathname).active&&(k=null),k)if(k.some((e=>e.route.lazy)))l=!1;else if(k.some((e=>e.route.loader)))if(b.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||("function"!=typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=k.findIndex((e=>void 0!==r[e.route.id]));l=k.slice(0,e+1).every(n)}else l=k.every(n)}else l=null!=e.hydrationData;else l=!0;else l=!1,k=[];let A,M={historyAction:e.history.action,location:e.history.location,matches:k,initialized:l,navigation:ue,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},U=n.Pop,j=!1,O=!1,F=new Map,B=null,I=!1,z=!1,H=[],W=[],K=new Map,$=0,J=-1,V=new Map,q=new Set,Y=new Map,X=new Map,G=new Set,Q=new Map,Z=new Map,ee=new Map,ne=!1;function ae(e,t){void 0===t&&(t={}),M=i({},M,e);let r=[],n=[];b.v7_fetcherPersist&&M.fetchers.forEach(((e,t)=>{"idle"===e.state&&(G.has(t)?n.push(t):r.push(t))})),[...D].forEach((e=>e(M,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),b.v7_fetcherPersist&&(r.forEach((e=>M.fetchers.delete(e))),n.forEach((e=>Qe(e))))}function oe(t,r,a){var o,l;let u,{flushSync:c}=void 0===a?{}:a,d=null!=M.actionData&&null!=M.navigation.formMethod&&He(M.navigation.formMethod)&&"loading"===M.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:d?M.actionData:null;let h=r.loaderData?Te(M.loaderData,r.loaderData,r.matches||[],r.errors):M.loaderData,p=M.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,de))));let m,v=!0===j||null!=M.navigation.formMethod&&He(M.navigation.formMethod)&&!0!==(null==(l=t.state)?void 0:l._isRedirect);if(s&&(f=s,s=void 0),I||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=F.get(M.location.pathname);e&&e.has(t.pathname)?m={currentLocation:M.location,nextLocation:t}:F.has(t.pathname)&&(m={currentLocation:t,nextLocation:M.location})}else if(O){let e=F.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(M.location.pathname,e)),m={currentLocation:M.location,nextLocation:t}}ae(i({},r,{actionData:u,loaderData:h,historyAction:U,location:t,initialized:!0,navigation:ue,revalidation:"idle",restoreScrollPosition:ct(t,r.matches||M.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===c}),U=n.Pop,j=!1,O=!1,I=!1,z=!1,H=[],W=[]}async function ie(t,r,a){A&&A.abort(),A=null,U=t,I=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(C&&P){let r=ut(e,t);C[r]=P()}}(M.location,M.matches),j=!0===(a&&a.preventScrollReset),O=!0===(a&&a.enableViewTransition);let o=s||f,l=a&&a.overrideNavigation,u=S(o,r,m),c=!0===(a&&a.flushSync),d=dt(u,o,r.pathname);if(d.active&&d.matches&&(u=d.matches),!u){let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return void oe(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:c})}if(M.initialized&&!z&&(p=r,(h=M.location).pathname===p.pathname&&h.search===p.search&&(""===h.hash?""!==p.hash:h.hash===p.hash||""!==p.hash))&&!(a&&a.submission&&He(a.submission.formMethod)))return void oe(r,{matches:u},{flushSync:c});var h,p;A=new AbortController;let v,y=Le(e.history,r,A.signal,a&&a.submission);if(a&&a.pendingError)v=[Me(u).route.id,{type:g.error,error:a.pendingError}];else if(a&&a.submission&&He(a.submission.formMethod)){let t=await async function(e,t,r,a,o,i){void 0===i&&(i={}),_e();let s,l=function(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}}(t,r);if(ae({navigation:l},{flushSync:!0===i.flushSync}),o){let r=await ht(a,t.pathname,e.signal);if("aborted"===r.type)return{shortCircuited:!0};if("error"===r.type){let{error:e,notFoundMatches:n,route:a}=st(t.pathname,r);return{matches:n,pendingActionResult:[a.id,{type:g.error,error:e}]}}if(!r.matches){let{notFoundMatches:e,error:r,route:n}=it(t.pathname);return{matches:e,pendingActionResult:[n.id,{type:g.error,error:r}]}}a=r.matches}let u=Je(a,t);if(u.route.action||u.route.lazy){if(s=(await we("action",e,[u],a))[0],e.signal.aborted)return{shortCircuited:!0}}else s={type:g.error,error:je(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(Ie(s)){let t;return t=i&&null!=i.replace?i.replace:Ce(s.response.headers.get("Location"),new URL(e.url),m)===M.location.pathname+M.location.search,await be(e,s,{submission:r,replace:t}),{shortCircuited:!0}}if(Ne(s))throw je(400,{type:"defer-action"});if(Be(s)){let e=Me(a,u.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{matches:a,pendingActionResult:[e.route.id,s]}}return{matches:a,pendingActionResult:[u.route.id,s]}}(y,r,a.submission,u,d.active,{replace:a.replace,flushSync:c});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,n]=t.pendingActionResult;if(Be(n)&&re(n.error)&&404===n.error.status)return A=null,void oe(r,{matches:t.matches,loaderData:{},errors:{[e]:n.error}})}u=t.matches||u,v=t.pendingActionResult,l=qe(r,a.submission),c=!1,d.active=!1,y=Le(e.history,y.url,y.signal)}let{shortCircuited:w,matches:E,loaderData:R,errors:x}=await async function(t,r,n,a,o,l,u,c,d,h,p){let v=o||qe(r,l),y=l||u||Ve(v),g=!(I||b.v7_partialHydration&&d);if(a){if(g){let e=me(p);ae(i({navigation:v},void 0!==e?{actionData:e}:{}),{flushSync:h})}let e=await ht(n,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let{error:t,notFoundMatches:n,route:a}=st(r.pathname,e);return{matches:n,loaderData:{},errors:{[a.id]:t}}}if(!e.matches){let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}n=e.matches}let w=s||f,[S,E]=ge(e.history,M,n,y,r,b.v7_partialHydration&&!0===d,b.unstable_skipActionErrorRevalidation,z,H,W,G,Y,q,w,m,p);if(lt((e=>!(n&&n.some((t=>t.route.id===e)))||S&&S.some((t=>t.route.id===e)))),J=++$,0===S.length&&0===E.length){let e=tt();return oe(r,i({matches:n,loaderData:{},errors:p&&Be(p[1])?{[p[0]]:p[1].error}:null},Ae(p),e?{fetchers:new Map(M.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(g){let e={};if(!a){e.navigation=v;let t=me(p);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=M.fetchers.get(e.key),r=Ye(void 0,t?t.data:void 0);M.fetchers.set(e.key,r)})),new Map(M.fetchers)}(E)),ae(e,{flushSync:h})}E.forEach((e=>{K.has(e.key)&&Ze(e.key),e.controller&&K.set(e.key,e.controller)}));let R=()=>E.forEach((e=>Ze(e.key)));A&&A.signal.addEventListener("abort",R);let{loaderResults:x,fetcherResults:D}=await Pe(M.matches,n,S,E,t);if(t.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",R),E.forEach((e=>K.delete(e.key)));let C=Oe([...x,...D]);if(C){if(C.idx>=S.length){let e=E[C.idx-S.length].key;q.add(e)}return await be(t,C.result,{replace:c}),{shortCircuited:!0}}let{loaderData:L,errors:P}=ke(M,n,S,x,p,E,D,Q);Q.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&Q.delete(t)}))})),b.v7_partialHydration&&d&&M.errors&&Object.entries(M.errors).filter((e=>{let[t]=e;return!S.some((e=>e.route.id===t))})).forEach((e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})}));let _=tt(),k=rt(J),T=_||k||E.length>0;return i({matches:n,loaderData:L,errors:P},T?{fetchers:new Map(M.fetchers)}:{})}(y,r,u,d.active,l,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,c,v);w||(A=null,oe(r,i({matches:E||u},Ae(v),{loaderData:R,errors:x})))}function me(e){return e&&!Be(e[1])?{[e[0]]:e[1].data}:M.actionData?0===Object.keys(M.actionData).length?null:M.actionData:void 0}async function be(a,o,s){let{submission:l,fetcherSubmission:u,replace:c}=void 0===s?{}:s;o.response.headers.has("X-Remix-Revalidate")&&(z=!0);let h=o.response.headers.get("Location");d(h,"Expected a Location header on the redirect Response"),h=Ce(h,new URL(a.url),m);let f=p(M.location,h,{_isRedirect:!0});if(r){let r=!1;if(o.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(he.test(h)){const n=e.history.createURL(h);r=n.origin!==t.location.origin||null==N(n.pathname,m)}if(r)return void(c?t.location.replace(h):t.location.assign(h))}A=null;let v=!0===c?n.Replace:n.Push,{formMethod:y,formAction:g,formEncType:b}=M.navigation;!l&&!u&&y&&g&&b&&(l=Ve(M.navigation));let w=l||u;if(le.has(o.response.status)&&w&&He(w.formMethod))await ie(v,f,{submission:i({},w,{formAction:h}),preventScrollReset:j});else{let e=qe(f,l);await ie(v,f,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:j})}}async function we(e,t,r,n){try{let a=await async function(e,t,r,n,a,o,s,l){let u=n.reduce(((e,t)=>e.add(t.route.id)),new Set),c=new Set,h=await e({matches:a.map((e=>{let n=u.has(e.route.id);return i({},e,{shouldLoad:n,resolve:a=>(c.add(e.route.id),n?async function(e,t,r,n,a,o,i){let s,l,u=n=>{let a,s=new Promise(((e,t)=>a=t));l=()=>a(),t.signal.addEventListener("abort",l);let u,c=a=>"function"!=typeof n?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+r.route.id+"]")):n({request:t,params:r.params,context:i},...void 0!==a?[a]:[]);return u=o?o((e=>c(e))):(async()=>{try{return{type:"data",result:await c()}}catch(e){return{type:"error",result:e}}})(),Promise.race([u,s])};try{let o=r.route[e];if(r.route.lazy)if(o){let e,[t]=await Promise.all([u(o).catch((t=>{e=t})),Re(r.route,a,n)]);if(void 0!==e)throw e;s=t}else{if(await Re(r.route,a,n),o=r.route[e],!o){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw je(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:g.data,result:void 0}}s=await u(o)}else{if(!o){let e=new URL(t.url);throw je(404,{pathname:e.pathname+e.search})}s=await u(o)}d(void 0!==s.result,"You defined "+("action"===e?"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(e){return{type:g.error,result:e}}finally{l&&t.signal.removeEventListener("abort",l)}return s}(t,r,e,o,s,a,l):Promise.resolve({type:g.data,result:void 0}))})})),request:r,params:a[0].params,context:l});return a.forEach((e=>d(c.has(e.route.id),'`match.resolve()` was not called for route id "'+e.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.'))),h.filter(((e,t)=>u.has(a[t].route.id)))}(v,e,t,r,n,c,o);return await Promise.all(a.map(((e,a)=>{if(function(e){return ze(e.result)&&se.has(e.result.status)}(e)){let o=e.result;return{type:g.redirect,response:De(o,t,r[a].route.id,n,m,b.v7_relativeSplatPath)}}return async function(e){let{result:t,type:r,status:n}=e;if(ze(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:g.error,error:e}}return r===g.error?{type:g.error,error:new te(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:g.data,data:e,statusCode:t.status,headers:t.headers}}return r===g.error?{type:g.error,error:t,statusCode:re(t)?t.status:n}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:g.deferred,deferredData:t,statusCode:null==(a=t.init)?void 0:a.status,headers:(null==(o=t.init)?void 0:o.headers)&&new Headers(t.init.headers)}:{type:g.data,data:t,statusCode:n};var a,o}(e)})))}catch(e){return r.map((()=>({type:g.error,error:e})))}}async function Pe(t,r,n,a,o){let[i,...s]=await Promise.all([n.length?we("loader",o,n,r):[],...a.map((t=>t.matches&&t.match&&t.controller?we("loader",Le(e.history,t.path,t.controller.signal),[t.match],t.matches).then((e=>e[0])):Promise.resolve({type:g.error,error:je(404,{pathname:t.path})})))]);return await Promise.all([We(t,n,i,i.map((()=>o.signal)),!1,M.loaderData),We(t,a.map((e=>e.match)),s,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:i,fetcherResults:s}}function _e(){z=!0,H.push(...lt()),Y.forEach(((e,t)=>{K.has(t)&&(W.push(t),Ze(t))}))}function Fe(e,t,r){void 0===r&&(r={}),M.fetchers.set(e,t),ae({fetchers:new Map(M.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function $e(e,t,r,n){void 0===n&&(n={});let a=Me(M.matches,t);Qe(e),ae({errors:{[a.route.id]:r},fetchers:new Map(M.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Ge(e){return b.v7_fetcherPersist&&(X.set(e,(X.get(e)||0)+1),G.has(e)&&G.delete(e)),M.fetchers.get(e)||ce}function Qe(e){let t=M.fetchers.get(e);!K.has(e)||t&&"loading"===t.state&&V.has(e)||Ze(e),Y.delete(e),V.delete(e),q.delete(e),G.delete(e),M.fetchers.delete(e)}function Ze(e){let t=K.get(e);d(t,"Expected fetch controller: "+e),t.abort(),K.delete(e)}function et(e){for(let t of e){let e=Xe(Ge(t).data);M.fetchers.set(t,e)}}function tt(){let e=[],t=!1;for(let r of q){let n=M.fetchers.get(r);d(n,"Expected fetcher: "+r),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return et(e),t}function rt(e){let t=[];for(let[r,n]of V)if(n0}function nt(e){M.blockers.delete(e),Z.delete(e)}function at(e,t){let r=M.blockers.get(e)||de;d("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(M.blockers);n.set(e,t),ae({blockers:n})}function ot(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Z.size)return;Z.size>1&&h(!1,"A router only supports one blocker at a time");let a=Array.from(Z.entries()),[o,i]=a[a.length-1],s=M.blockers.get(o);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function it(e){let t=je(404,{pathname:e}),r=s||f,{matches:n,route:a}=Ue(r);return lt(),{notFoundMatches:n,route:a,error:t}}function st(e,t){let r=t.partialMatches,n=r[r.length-1].route;return{notFoundMatches:r,route:n,error:je(400,{type:"route-discovery",routeId:n.id,pathname:e,message:null!=t.error&&"message"in t.error?t.error:String(t.error)})}}function lt(e){let t=[];return Q.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),Q.delete(n))})),t}function ut(e,t){return L&&L(e,t.map((e=>R(e,M.loaderData))))||e.key}function ct(e,t){if(C){let r=ut(e,t),n=C[r];if("number"==typeof n)return n}return null}function dt(e,t,r){if(y){if(!e)return{active:!0,matches:E(t,r,m,!0)||[]};{let n=e[e.length-1].route;if(n.path&&("*"===n.path||n.path.endsWith("/*")))return{active:!0,matches:E(t,r,m,!0)}}}return{active:!1,matches:null}}async function ht(e,t,r){let n=e,a=n.length>0?n[n.length-1].route:null;for(;;){let e=null==s,i=s||f;try{await Se(y,t,n,i,c,o,ee,r)}catch(e){return{type:"error",error:e,partialMatches:n}}finally{e&&(f=[...f])}if(r.aborted)return{type:"aborted"};let l=S(i,t,m),u=!1;if(l){let e=l[l.length-1].route;if(e.index)return{type:"success",matches:l};if(e.path&&e.path.length>0){if("*"!==e.path)return{type:"success",matches:l};u=!0}}let d=E(i,t,m,!0);if(!d||n.map((e=>e.route.id)).join("-")===d.map((e=>e.route.id)).join("-"))return{type:"success",matches:u?l:null};if(n=d,a=n[n.length-1].route,"*"===a.path)return{type:"success",matches:n}}}return u={get basename(){return m},get future(){return b},get state(){return M},get routes(){return f},get window(){return t},initialize:function(){if(x=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(ne)return void(ne=!1);h(0===Z.size||null!=a,"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 o=ot({currentLocation:M.location,nextLocation:n,historyAction:r});return o&&null!=a?(ne=!0,e.history.go(-1*a),void at(o,{state:"blocked",location:n,proceed(){at(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(M.blockers);e.set(o,de),ae({blockers:e})}})):ie(r,n)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(pe);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,F);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(pe,JSON.stringify(r))}catch(e){h(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,F);t.addEventListener("pagehide",e),B=()=>t.removeEventListener("pagehide",e)}return M.initialized||ie(n.Pop,M.location,{initialHydration:!0}),u},subscribe:function(e){return D.add(e),()=>D.delete(e)},enableScrollRestoration:function(e,t,r){if(C=e,P=t,L=r||null,!_&&M.navigation===ue){_=!0;let e=ct(M.location,M.matches);null!=e&&ae({restoreScrollPosition:e})}return()=>{C=null,P=null,L=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=ve(M.location,M.matches,m,b.v7_prependBasename,r,b.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:s,submission:l,error:u}=ye(b.v7_normalizeFormMethod,!1,o,a),c=M.location,d=p(M.location,s,a&&a.state);d=i({},d,e.history.encodeLocation(d));let h=a&&null!=a.replace?a.replace:void 0,f=n.Push;!0===h?f=n.Replace:!1===h||null!=l&&He(l.formMethod)&&l.formAction===M.location.pathname+M.location.search&&(f=n.Replace);let v=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=!0===(a&&a.unstable_flushSync),g=ot({currentLocation:c,nextLocation:d,historyAction:f});if(!g)return await ie(f,d,{submission:l,pendingError:u,preventScrollReset:v,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:y});at(g,{state:"blocked",location:d,proceed(){at(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(M.blockers);e.set(g,de),ae({blockers:e})}})},fetch:function(t,r,n,o){if(a)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.");K.has(t)&&Ze(t);let i=!0===(o&&o.unstable_flushSync),l=s||f,u=ve(M.location,M.matches,m,b.v7_prependBasename,n,b.v7_relativeSplatPath,r,null==o?void 0:o.relative),c=S(l,u,m),h=dt(c,l,u);if(h.active&&h.matches&&(c=h.matches),!c)return void $e(t,r,je(404,{pathname:u}),{flushSync:i});let{path:p,submission:v,error:y}=ye(b.v7_normalizeFormMethod,!0,u,o);if(y)return void $e(t,r,y,{flushSync:i});let g=Je(c,p);j=!0===(o&&o.preventScrollReset),v&&He(v.formMethod)?async function(t,r,n,a,o,i,l,u){function c(e){if(!e.route.action&&!e.route.lazy){let e=je(405,{method:u.formMethod,pathname:n,routeId:r});return $e(t,r,e,{flushSync:l}),!0}return!1}if(_e(),Y.delete(t),!i&&c(a))return;let h=M.fetchers.get(t);Fe(t,function(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}}(u,h),{flushSync:l});let p=new AbortController,v=Le(e.history,n,p.signal,u);if(i){let e=await ht(o,n,v.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:a}=st(n,e);return void $e(t,r,a,{flushSync:l})}if(!e.matches)return void $e(t,r,je(404,{pathname:n}),{flushSync:l});if(c(a=Je(o=e.matches,n)))return}K.set(t,p);let y=$,g=(await we("action",v,[a],o))[0];if(v.signal.aborted)return void(K.get(t)===p&&K.delete(t));if(b.v7_fetcherPersist&&G.has(t)){if(Ie(g)||Be(g))return void Fe(t,Xe(void 0))}else{if(Ie(g))return K.delete(t),J>y?void Fe(t,Xe(void 0)):(q.add(t),Fe(t,Ye(u)),be(v,g,{fetcherSubmission:u}));if(Be(g))return void $e(t,r,g.error)}if(Ne(g))throw je(400,{type:"defer-action"});let w=M.navigation.location||M.location,E=Le(e.history,w,p.signal),R=s||f,x="idle"!==M.navigation.state?S(R,M.navigation.location,m):M.matches;d(x,"Didn't find any matches after fetcher action");let D=++$;V.set(t,D);let C=Ye(u,g.data);M.fetchers.set(t,C);let[L,P]=ge(e.history,M,x,u,w,!1,b.unstable_skipActionErrorRevalidation,z,H,W,G,Y,q,R,m,[a.route.id,g]);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=M.fetchers.get(t),n=Ye(void 0,r?r.data:void 0);M.fetchers.set(t,n),K.has(t)&&Ze(t),e.controller&&K.set(t,e.controller)})),ae({fetchers:new Map(M.fetchers)});let _=()=>P.forEach((e=>Ze(e.key)));p.signal.addEventListener("abort",_);let{loaderResults:k,fetcherResults:T}=await Pe(M.matches,x,L,P,E);if(p.signal.aborted)return;p.signal.removeEventListener("abort",_),V.delete(t),K.delete(t),P.forEach((e=>K.delete(e.key)));let j=Oe([...k,...T]);if(j){if(j.idx>=L.length){let e=P[j.idx-L.length].key;q.add(e)}return be(E,j.result)}let{loaderData:O,errors:F}=ke(M,M.matches,L,k,void 0,P,T,Q);if(M.fetchers.has(t)){let e=Xe(g.data);M.fetchers.set(t,e)}rt(D),"loading"===M.navigation.state&&D>J?(d(U,"Expected pending action"),A&&A.abort(),oe(M.navigation.location,{matches:x,loaderData:O,errors:F,fetchers:new Map(M.fetchers)})):(ae({errors:F,loaderData:Te(M.loaderData,O,x,F),fetchers:new Map(M.fetchers)}),z=!1)}(t,r,p,g,c,h.active,i,v):(Y.set(t,{routeId:r,path:p}),async function(t,r,n,a,o,i,s,l){let u=M.fetchers.get(t);Fe(t,Ye(l,u?u.data:void 0),{flushSync:s});let c=new AbortController,h=Le(e.history,n,c.signal);if(i){let e=await ht(o,n,h.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:a}=st(n,e);return void $e(t,r,a,{flushSync:s})}if(!e.matches)return void $e(t,r,je(404,{pathname:n}),{flushSync:s});a=Je(o=e.matches,n)}K.set(t,c);let f=$,p=(await we("loader",h,[a],o))[0];if(Ne(p)&&(p=await Ke(p,h.signal,!0)||p),K.get(t)===c&&K.delete(t),!h.signal.aborted){if(!G.has(t))return Ie(p)?J>f?void Fe(t,Xe(void 0)):(q.add(t),void await be(h,p)):void(Be(p)?$e(t,r,p.error):(d(!Ne(p),"Unhandled fetcher deferred data"),Fe(t,Xe(p.data))));Fe(t,Xe(void 0))}}(t,r,p,g,c,h.active,i,v))},revalidate:function(){_e(),ae({revalidation:"loading"}),"submitting"!==M.navigation.state&&("idle"!==M.navigation.state?ie(U||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation}):ie(M.historyAction,M.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ge,deleteFetcher:function(e){if(b.v7_fetcherPersist){let t=(X.get(e)||0)-1;t<=0?(X.delete(e),G.add(e)):X.set(e,t)}else Qe(e);ae({fetchers:new Map(M.fetchers)})},dispose:function(){x&&x(),B&&B(),D.clear(),A&&A.abort(),M.fetchers.forEach(((e,t)=>Qe(t))),M.blockers.forEach(((e,t)=>nt(t)))},getBlocker:function(e,t){let r=M.blockers.get(e)||de;return Z.get(e)!==t&&Z.set(e,t),r},deleteBlocker:nt,patchRoutes:function(e,t){let r=null==s;Ee(e,t,s||f,c,o),r&&(f=[...f],ae({}))},_internalFetchControllers:K,_internalActiveDeferreds:Q,_internalSetRoutes:function(e){c={},s=w(e,o,void 0,c)}},u}function ve(e,t,r,n,a,o,i,s){let l,u;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){u=e;break}}else l=t,u=t[t.length-1];let c=W(a||".",H(l,o),N(e.pathname,r)||e.pathname,"path"===s);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||$e(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:K([r,c.pathname])),m(c)}function ye(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!ie.has(a.toLowerCase())))return{path:r,error:je(405,{method:n.formMethod})};var a;let o,i,s=()=>({path:r,error:je(400,{type:"invalid-body"})}),l=n.formMethod||"get",u=e?l.toUpperCase():l.toLowerCase(),c=Fe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!He(u))return s();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!He(u))return s();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(d("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=Pe(n.formData),i=n.formData;else if(n.body instanceof FormData)o=Pe(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=_e(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=_e(o)}catch(e){return s()}let h={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(He(h.formMethod))return{path:r,submission:h};let f=v(r);return t&&f.search&&$e(f.search)&&o.append("index",""),f.search="?"+o,{path:m(f),submission:h}}function ge(e,t,r,n,a,o,s,l,u,c,d,h,f,p,m,v){let y=v?Be(v[1])?v[1].error:v[1].data:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v&&Be(v[1])?v[0]:void 0,E=w?function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(r,w):r,R=v?v[1].statusCode:void 0,x=s&&R&&R>=400,D=E.filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!("function"==typeof a.loader&&!a.loader.hydrate&&(void 0!==t.loaderData[a.id]||t.errors&&void 0!==t.errors[a.id]));if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||u.some((t=>t===e.route.id)))return!0;let s=t.matches[r],c=e;return we(e,i({currentUrl:g,currentParams:s.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,unstable_actionStatus:R,defaultShouldRevalidate:!x&&(l||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||be(s,c))}))})),C=[];return h.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||d.has(a))return;let s=S(p,e.path,m);if(!s)return void C.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(a),h=Je(s,e.path),v=!1;v=!f.has(a)&&(!!c.includes(a)||(u&&"idle"!==u.state&&void 0===u.data?l:we(h,i({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,unstable_actionStatus:R,defaultShouldRevalidate:!x&&l})))),v&&C.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:h,controller:new AbortController})})),[D,C]}function be(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function we(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function Se(e,t,r,n,a,o,i,s){let l=[t,...r.map((e=>e.route.id))].join("-");try{let c=i.get(l);c||(c=e({path:t,matches:r,patch:(e,t)=>{s.aborted||Ee(e,t,n,a,o)}}),i.set(l,c)),c&&"object"==typeof(u=c)&&null!=u&&"then"in u&&await c}finally{i.delete(l)}var u}function Ee(e,t,r,n,a){if(e){var o;let r=n[e];d(r,"No route found to patch children into: routeId = "+e);let i=w(t,a,[e,"patch",String((null==(o=r.children)?void 0:o.length)||"0")],n);r.children?r.children.push(...i):r.children=i}else{let e=w(t,a,["patch",String(r.length||"0")],n);r.push(...e)}}async function Re(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];d(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;h(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||b.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,i({},t(a),{lazy:void 0}))}function xe(e){return Promise.all(e.matches.map((e=>e.resolve())))}function De(e,t,r,n,a,o){let i=e.headers.get("Location");if(d(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!he.test(i)){let s=n.slice(0,n.findIndex((e=>e.route.id===r))+1);i=ve(new URL(t.url),s,a,!0,i,o),e.headers.set("Location",i)}return e}function Ce(e,t,r){if(he.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=null!=N(a.pathname,r);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Le(e,t,r,n){let a=e.createURL(Fe(t)).toString(),o={signal:r};if(n&&He(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=Pe(n.formData):o.body=n.formData}return new Request(a,o)}function Pe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function _e(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ke(e,t,r,n,a,o,s,l){let{loaderData:u,errors:c}=function(e,t,r,n,a,o){let i,s={},l=null,u=!1,c={},h=n&&Be(n[1])?n[1].error:void 0;return r.forEach(((r,n)=>{let o=t[n].route.id;if(d(!Ie(r),"Cannot handle redirect results in processLoaderData"),Be(r)){let t=r.error;void 0!==h&&(t=h,h=void 0),l=l||{};{let r=Me(e,o);null==l[r.route.id]&&(l[r.route.id]=t)}s[o]=void 0,u||(u=!0,i=re(r.error)?r.error.status:500),r.headers&&(c[o]=r.headers)}else Ne(r)?(a.set(o,r.deferredData),s[o]=r.deferredData.data,null==r.statusCode||200===r.statusCode||u||(i=r.statusCode),r.headers&&(c[o]=r.headers)):(s[o]=r.data,r.statusCode&&200!==r.statusCode&&!u&&(i=r.statusCode),r.headers&&(c[o]=r.headers))})),void 0!==h&&n&&(l={[n[0]]:h},s[n[0]]=void 0),{loaderData:s,errors:l,statusCode:i||200,loaderHeaders:c}}(t,r,n,a,l);for(let t=0;te.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Ue(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function je(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=void 0===t?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(s="Bad Request","route-discovery"===o?l='Unable to match URL "'+r+'" - the `children()` function for route `'+n+"` threw the following error:\n"+i:a&&r&&n?l="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.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(s="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(s="Not Found",l='No route matches URL "'+r+'"'):405===e&&(s="Method Not Allowed",a&&r&&n?l="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&&(l='Invalid request method "'+a.toUpperCase()+'"')),new te(e||500,s,new Error(l),!0)}function Oe(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ie(r))return{result:r,idx:t}}}function Fe(e){return m(i({},"string"==typeof e?v(e):e,{hash:""}))}function Ne(e){return e.type===g.deferred}function Be(e){return e.type===g.error}function Ie(e){return(e&&e.type)===g.redirect}function ze(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function He(e){return ae.has(e.toLowerCase())}async function We(e,t,r,n,a,o){for(let i=0;ie.route.id===l.route.id)),c=null!=u&&!be(u,l)&&void 0!==(o&&o[l.route.id]);if(Ne(s)&&(a||c)){let e=n[i];d(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ke(s,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Ke(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:g.data,data:e.deferredData.unwrappedData}}catch(e){return{type:g.error,error:e}}return{type:g.data,data:e.deferredData.data}}}function $e(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Je(e,t){let r="string"==typeof t?v(t).search:t.search;if(e[e.length-1].route.index&&$e(r||""))return e[e.length-1];let n=z(e);return n[n.length-1]}function Ve(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function qe(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 Ye(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 Xe(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 Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var t=1;tO(e,t)),[t,e])}function ct(e){a.useContext(tt).static||a.useLayoutEffect(e)}function dt(){let{isDataRoute:e}=a.useContext(nt);return e?function(){let{router:e}=Ct(xt.UseNavigateStable),t=Pt(Dt.UseNavigateStable),r=a.useRef(!1);return ct((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,Ge({fromRouteId:t},a)))}),[e,t])}():function(){it()||d(!1);let e=a.useContext(Qe),{basename:t,future:r,navigator:n}=a.useContext(tt),{matches:o}=a.useContext(nt),{pathname:i}=st(),s=JSON.stringify(H(o,r.v7_relativeSplatPath)),l=a.useRef(!1);return ct((()=>{l.current=!0})),a.useCallback((function(r,a){if(void 0===a&&(a={}),!l.current)return;if("number"==typeof r)return void n.go(r);let o=W(r,JSON.parse(s),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:K([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)}),[t,n,s,i,e])}()}const ht=a.createContext(null);function ft(){return a.useContext(ht)}function pt(e){let t=a.useContext(nt).outlet;return t?a.createElement(ht.Provider,{value:e},t):t}function mt(){let{matches:e}=a.useContext(nt),t=e[e.length-1];return t?t.params:{}}function vt(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(tt),{matches:o}=a.useContext(nt),{pathname:i}=st(),s=JSON.stringify(H(o,n.v7_relativeSplatPath));return a.useMemo((()=>W(e,JSON.parse(s),i,"path"===r)),[e,s,i,r])}function yt(e,t){return gt(e,t)}function gt(e,t,r,o){it()||d(!1);let{navigator:i}=a.useContext(tt),{matches:s}=a.useContext(nt),l=s[s.length-1],u=l?l.params:{},c=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let h,f=st();if(t){var p;let e="string"==typeof t?v(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||d(!1),h=e}else h=f;let m=h.pathname||"/",y=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=S(e,{pathname:y}),b=Rt(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:K([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:K([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,r,o);return t&&b?a.createElement(rt.Provider,{value:{location:Ge({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:n.Pop}},b):b}function bt(){let e=Ot(),t=re(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)}const wt=a.createElement(bt,null);class St extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?a.createElement(nt.Provider,{value:this.props.routeContext},a.createElement(at.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Et(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(Qe);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(nt.Provider,{value:t},n)}function Rt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let s=e,l=null==(o=r)?void 0:o.errors;if(null!=l){let e=s.findIndex((e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id])));e>=0||d(!1),s=s.slice(0,Math.min(s.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e=0?s.slice(0,c+1):[s[0]];break}}}return s.reduceRight(((e,n,o)=>{let i,d=!1,h=null,f=null;r&&(i=l&&n.route.id?l[n.route.id]:void 0,h=n.route.errorElement||wt,u&&(c<0&&0===o?(zt["route-fallback"]||(zt["route-fallback"]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let p=t.concat(s.slice(0,o+1)),m=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(Et,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(St,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}var xt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(xt||{}),Dt=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}(Dt||{});function Ct(e){let t=a.useContext(Qe);return t||d(!1),t}function Lt(e){let t=a.useContext(Ze);return t||d(!1),t}function Pt(e){let t=function(e){let t=a.useContext(nt);return t||d(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||d(!1),r.route.id}function _t(){return Pt(Dt.UseRouteId)}function kt(){return Lt(Dt.UseNavigation).navigation}function Tt(){let e=Ct(xt.UseRevalidator),t=Lt(Dt.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function At(){let{matches:e,loaderData:t}=Lt(Dt.UseMatches);return a.useMemo((()=>e.map((e=>R(e,t)))),[e,t])}function Mt(){let e=Lt(Dt.UseLoaderData),t=Pt(Dt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t]}function Ut(e){return Lt(Dt.UseRouteLoaderData).loaderData[e]}function jt(){let e=Lt(Dt.UseActionData),t=Pt(Dt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Ot(){var e;let t=a.useContext(at),r=Lt(Dt.UseRouteError),n=Pt(Dt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function Ft(){let e=a.useContext(et);return null==e?void 0:e._data}function Nt(){let e=a.useContext(et);return null==e?void 0:e._error}let Bt=0;function It(e){let{router:t,basename:r}=Ct(xt.UseBlocker),n=Lt(Dt.UseBlocker),[o,i]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:Ge({},n,{pathname:N(n.pathname,r)||n.pathname}),nextLocation:Ge({},a,{pathname:N(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return a.useEffect((()=>{let e=String(++Bt);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,s)}),[t,o,s]),o&&n.blockers.has(o)?n.blockers.get(o):de}const zt={},Ht=a.startTransition;function Wt(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,s=a.useRef();null==s.current&&(s.current=l({initialEntries:n,initialIndex:o,v5Compat:!0}));let u=s.current,[c,d]=a.useState({action:u.action,location:u.location}),{v7_startTransition:h}=i||{},f=a.useCallback((e=>{h&&Ht?Ht((()=>d(e))):d(e)}),[d,h]);return a.useLayoutEffect((()=>u.listen(f)),[u,f]),a.createElement(Vt,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u,future:i})}function Kt(e){let{to:t,replace:r,state:n,relative:o}=e;it()||d(!1);let{future:i,static:s}=a.useContext(tt),{matches:l}=a.useContext(nt),{pathname:u}=st(),c=dt(),h=W(t,H(l,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(h);return a.useEffect((()=>c(JSON.parse(f),{replace:r,state:n,relative:o})),[c,f,o,r,n]),null}function $t(e){return pt(e.context)}function Jt(e){d(!1)}function Vt(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:s,static:l=!1,future:u}=e;it()&&d(!1);let c=t.replace(/^\/*/,"/"),h=a.useMemo((()=>({basename:c,navigator:s,static:l,future:Ge({v7_relativeSplatPath:!1},u)})),[c,u,s,l]);"string"==typeof o&&(o=v(o));let{pathname:f="/",search:p="",hash:m="",state:y=null,key:g="default"}=o,b=a.useMemo((()=>{let e=N(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:y,key:g},navigationType:i}}),[c,f,p,m,y,g,i]);return null==b?null:a.createElement(tt.Provider,{value:h},a.createElement(rt.Provider,{children:r,value:b}))}function qt(e){let{children:t,location:r}=e;return yt(er(t),r)}function Yt(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(Qt,{resolve:n,errorElement:r},a.createElement(Zt,null,t))}var Xt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Xt||{});const Gt=new Promise((()=>{}));class Qt extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=Xt.pending;if(r instanceof Promise)if(this.state.error){o=Xt.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o="_error"in n?Xt.error:"_data"in n?Xt.success:Xt.pending):(o=Xt.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else o=Xt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===Xt.error&&n._error instanceof Y)throw Gt;if(o===Xt.error&&!t)throw n._error;if(o===Xt.error)return a.createElement(et.Provider,{value:n,children:t});if(o===Xt.success)return a.createElement(et.Provider,{value:n,children:e});throw n}}function Zt(e){let{children:t}=e,r=Ft(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function er(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,((e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,er(e.props.children,o));e.type!==Jt&&d(!1),e.props.index&&e.props.children&&d(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=er(e.props.children,o)),r.push(i)})),r}function tr(e){return Rt(e)}function rr(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function nr(e,t){return me({basename:null==t?void 0:t.basename,future:Ge({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:l({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:rr,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:null==t?void 0:t.unstable_patchRoutesOnMiss}).initialize()}function ar(){return ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}const ir="get",sr="application/x-www-form-urlencoded";function lr(e){return null!=e&&"string"==typeof e.tagName}function ur(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||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((e=>[r,e])):[[r,n]])}),[]))}let cr=null;const dr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hr(e){return null==e||dr.has(e)?e:null}const fr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],pr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],mr=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function vr(e,t){return me({basename:null==t?void 0:t.basename,future:ar({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||gr(),routes:e,mapRouteProperties:rr,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:null==t?void 0:t.unstable_patchRoutesOnMiss,window:null==t?void 0:t.window}).initialize()}function yr(e,t){return me({basename:null==t?void 0:t.basename,future:ar({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||gr(),routes:e,mapRouteProperties:rr,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:null==t?void 0:t.unstable_patchRoutesOnMiss,window:null==t?void 0:t.window}).initialize()}function gr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ar({},t,{errors:br(t.errors)})),t}function br(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new te(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const wr=a.createContext({isTransitioning:!1}),Sr=a.createContext(new Map),Er=a.startTransition,Rr=o.flushSync,xr=a.useId;function Dr(e){Rr?Rr(e):e()}class Cr{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function Lr(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[s,l]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback((e=>{g?function(e){Er?Er(e):e()}(e):e()}),[g]),w=a.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let s=null==r.window||null==r.window.document||"function"!=typeof r.window.document.startViewTransition;if(o&&!s){if(a){Dr((()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})}));let t=r.window.document.startViewTransition((()=>{Dr((()=>i(e)))}));return t.finished.finally((()=>{Dr((()=>{h(void 0),p(void 0),l(void 0),c({isTransitioning:!1})}))})),void Dr((()=>p(t)))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(l(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?Dr((()=>i(e))):b((()=>i(e)))}),[r.window,f,d,y,b]);a.useLayoutEffect((()=>r.subscribe(w)),[r,w]),a.useEffect((()=>{u.isTransitioning&&!u.flushSync&&h(new Cr)}),[u]),a.useEffect((()=>{if(d&&s&&r.window){let e=s,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>i(e))),await t}));n.finished.finally((()=>{h(void 0),p(void 0),l(void 0),c({isTransitioning:!1})})),p(n)}}),[b,s,d,r.window]),a.useEffect((()=>{d&&s&&o.location.key===s.location.key&&d.resolve()}),[d,f,o.location,s]),a.useEffect((()=>{!u.isTransitioning&&m&&(l(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[u.isTransitioning,m]),a.useEffect((()=>{}),[]);let S=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),E=r.basename||"/",R=a.useMemo((()=>({router:r,navigator:S,static:!1,basename:E})),[r,S,E]);return a.createElement(a.Fragment,null,a.createElement(Qe.Provider,{value:R},a.createElement(Ze.Provider,{value:o},a.createElement(Sr.Provider,{value:y.current},a.createElement(wr.Provider,{value:u},a.createElement(Vt,{basename:E,location:o.location,navigationType:o.historyAction,navigator:S,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(Pr,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Pr(e){let{routes:t,future:r,state:n}=e;return gt(t,void 0,n,r)}function _r(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=u({window:o,v5Compat:!0}));let s=i.current,[l,c]=a.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&Er?Er((()=>c(e))):c(e)}),[c,d]);return a.useLayoutEffect((()=>s.listen(h)),[s,h]),a.createElement(Vt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function kr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let s=i.current,[l,u]=a.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&Er?Er((()=>u(e))):u(e)}),[u,d]);return a.useLayoutEffect((()=>s.listen(h)),[s,h]),a.createElement(Vt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function Tr(e){let{basename:t,children:r,future:n,history:o}=e,[i,s]=a.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},u=a.useCallback((e=>{l&&Er?Er((()=>s(e))):s(e)}),[s,l]);return a.useLayoutEffect((()=>o.listen(u)),[o,u]),a.createElement(Vt,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Ar="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Mr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ur=a.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=or(e,fr),{basename:p}=a.useContext(tt),m=!1;if("string"==typeof c&&Mr.test(c)&&(r=c,Ar))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=N(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=ot(c,{relative:o}),y=Hr(c,{replace:s,state:l,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",ar({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))})),jr=a.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:s,to:l,unstable_viewTransition:u,children:c}=e,d=or(e,pr),h=vt(l,{relative:d.relative}),f=st(),p=a.useContext(Ze),{navigator:m,basename:v}=a.useContext(tt),y=null!=p&&tn(h)&&!0===u,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=f.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=N(w,v)||w);const S="/"!==g&&g.endsWith("/")?g.length-1:g.length;let E,R=b===g||!i&&b.startsWith(g)&&"/"===b.charAt(S),x=null!=w&&(w===g||!i&&w.startsWith(g)&&"/"===w.charAt(g.length)),D={isActive:R,isPending:x,isTransitioning:y},C=R?r:void 0;E="function"==typeof o?o(D):[o,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof s?s(D):s;return a.createElement(Ur,ar({},d,{"aria-current":C,className:E,ref:t,style:L,to:l,unstable_viewTransition:u}),"function"==typeof c?c(D):c)})),Or=a.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:s,method:l=ir,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=or(e,mr),m=Jr(),v=Vr(u,{relative:d}),y="get"===l.toLowerCase()?"get":"post";return a.createElement("form",ar({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||l;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:s,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))}));function Fr(e){let{getKey:t,storageKey:r}=e;return Qr({getKey:t,storageKey:r}),null}var Nr,Br;function Ir(e){let t=a.useContext(Qe);return t||d(!1),t}function zr(e){let t=a.useContext(Ze);return t||d(!1),t}function Hr(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,u=dt(),c=st(),d=vt(e,{relative:s});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:m(c)===m(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:s,unstable_viewTransition:l})}}),[c,u,d,n,o,r,e,i,s,l])}function Wr(e){let t=a.useRef(ur(e)),r=a.useRef(!1),n=st(),o=a.useMemo((()=>function(e,t){let r=ur(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=dt(),s=a.useCallback(((e,t)=>{const n=ur("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)}),[i,o]);return[o,s]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Nr||(Nr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Br||(Br={}));let Kr=0,$r=()=>"__"+String(++Kr)+"__";function Jr(){let{router:e}=Ir(Nr.UseSubmit),{basename:t}=a.useContext(tt),r=_t();return a.useCallback((function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:s,formData:l,body:u}=function(e,t){let r,n,a,o,i;if(lr(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?N(i,t):null,r=e.getAttribute("method")||ir,a=hr(e.getAttribute("enctype"))||sr,o=new FormData(e)}else if(function(e){return lr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return lr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a