@openmrs/esm-metadataexport-app 4.4.1-pre.849 → 4.4.1-pre.852
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/dist/2935.js +5 -5
- package/dist/2935.js.map +1 -1
- package/dist/7688.js +2 -2
- package/dist/7688.js.map +1 -1
- package/dist/9712.js +1 -1
- package/dist/9712.js.map +1 -1
- package/dist/openmrs-esm-metadataexport-app.js +2 -2
- package/dist/openmrs-esm-metadataexport-app.js.buildmanifest.json +30 -8
- package/dist/openmrs-esm-metadataexport-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -1
package/dist/9712.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_metadataexport_app=globalThis.webpackChunk_openmrs_esm_metadataexport_app||[]).push([["9712"],{7059(e,t,r){r.r(t),r.d(t,{useFetchers:()=>rm,unstable_HistoryRouter:()=>t6,useLoaderData:()=>tf,ScrollRestoration:()=>ro,Route:()=>tP,MemoryRouter:()=>tx,useMatches:()=>th,redirect:()=>G,useOutletContext:()=>e2,createRoutesFromElements:()=>tj,useLinkClickHandler:()=>rs,useRouteError:()=>tv,generatePath:()=>M,useHref:()=>eX,useParams:()=>e5,useRoutes:()=>e8,UNSAFE_ViewTransitionContext:()=>tQ,useSubmit:()=>rh,Navigate:()=>tR,UNSAFE_NavigationContext:()=>eK,useAsyncError:()=>tg,UNSAFE_FetchersContext:()=>tZ,createRoutesFromChildren:()=>tj,unstable_usePrompt:()=>rw,useFetcher:()=>rp,useBlocker:()=>tw,createHashRouter:()=>tX,UNSAFE_useRouteId:()=>tu,useMatch:()=>e0,useNavigation:()=>tc,HashRouter:()=>t8,useFormAction:()=>rf,useResolvedPath:()=>e9,defer:()=>X,Router:()=>tD,Routes:()=>tL,useActionData:()=>tm,useRouteLoaderData:()=>tp,Await:()=>tk,matchPath:()=>O,UNSAFE_DataRouterContext:()=>eW,BrowserRouter:()=>t9,NavigationType:()=>c,Form:()=>ra,UNSAFE_RouteContext:()=>eq,createSearchParams:()=>tH,RouterProvider:()=>t3,UNSAFE_LocationContext:()=>eV,parsePath:()=>D,Outlet:()=>tC,createMemoryRouter:()=>tF,UNSAFE_useScrollRestoration:()=>rg,useNavigate:()=>e7,matchRoutes:()=>T,createPath:()=>P,resolvePath:()=>N,useInRouterContext:()=>eG,useOutlet:()=>e3,useAsyncValue:()=>ty,Link:()=>rr,AbortedDeferredError:()=>q,renderMatches:()=>tM,NavLink:()=>rn,UNSAFE_DataRouterStateContext:()=>e$,json:()=>V,useSearchParams:()=>ru,redirectDocument:()=>Q,useBeforeUnload:()=>rb,unstable_useViewTransitionState:()=>rE,createBrowserRouter:()=>tY,isRouteErrorResponse:()=>ee,useLocation:()=>eQ,useNavigationType:()=>eZ,useRevalidator:()=>td});var n,a,o,i,l,s,u,c,d,h,f,p=r(2491),m=r(3144),v=r.t(m,2);function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}(n=c||(c={})).Pop="POP",n.Push="PUSH",n.Replace="REPLACE";let g="popstate";function b(e){let t;void 0===e&&(e={});let{initialEntries:r=["/"],initialIndex:n,v5Compat:a=!1}=e;t=r.map((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let o=s(null==n?t.length-1:n),i=c.Pop,l=null;function s(e){return Math.min(Math.max(e,0),t.length-1)}function u(e,r,n){void 0===r&&(r=null);let a=C(t?t[o].pathname:"/",e,r,n);return x("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function d(e){return"string"==typeof e?e:P(e)}return{get index(){return o},get action(){return i},get location(){return t[o]},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?D(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){i=c.Push;let n=u(e,r);o+=1,t.splice(o,t.length,n),a&&l&&l({action:i,location:n,delta:1})},replace(e,r){i=c.Replace;let n=u(e,r);t[o]=n,a&&l&&l({action:i,location:n,delta:0})},go(e){i=c.Pop;let r=s(o+e),n=t[r];o=r,l&&l({action:i,location:n,delta:e})},listen:e=>(l=e,()=>{l=null})}}function w(e){return void 0===e&&(e={}),L(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return C("",{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:P(t)},null,e)}function E(e){return void 0===e&&(e={}),L(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=D(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),C("",{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:P(t))},function(e,t){x("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function S(e,t){if(!1===e||null==e)throw Error(t)}function x(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function R(e,t){return{usr:e.state,key:e.key,idx:t}}function C(e,t,r,n){return void 0===r&&(r=null),y({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?D(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function P(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 D(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 L(e,t,r,n){void 0===n&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l=c.Pop,s=null,u=d();function d(){return(i.state||{idx:null}).idx}function h(){l=c.Pop;let e=d(),t=null==e?null:e-u;u=e,s&&s({action:l,location:p.location,delta:t})}function f(e){let t="null"!==a.location.origin?a.location.origin:a.location.href,r="string"==typeof e?e:P(e);return S(t,"No window.location.(origin|href) available to create URL for href: "+(r=r.replace(/ $/,"%20"))),new URL(r,t)}null==u&&(u=0,i.replaceState(y({},i.state,{idx:u}),""));let p={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw Error("A history only accepts one active listener");return a.addEventListener(g,h),s=e,()=>{a.removeEventListener(g,h),s=null}},createHref:e=>t(a,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=c.Push;let n=C(p.location,e,t);r&&r(n,e);let h=R(n,u=d()+1),f=p.createHref(n);try{i.pushState(h,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(f)}o&&s&&s({action:l,location:p.location,delta:1})},replace:function(e,t){l=c.Replace;let n=C(p.location,e,t);r&&r(n,e);let a=R(n,u=d()),h=p.createHref(n);i.replaceState(a,"",h),o&&s&&s({action:l,location:p.location,delta:0})},go:e=>i.go(e)};return p}(a=d||(d={})).data="data",a.deferred="deferred",a.redirect="redirect",a.error="error";let k=new Set(["lazy","caseSensitive","path","id","index","children"]);function _(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(S(!0!==e.index||!e.children,"Cannot specify children on an index route"),S(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),!0===e.index){let r=y({},e,t(e),{id:i});return n[i]=r,r}{let r=y({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=_(e.children,t,o,n)),r}})}function T(e,t,r){void 0===r&&(r="/");let n=F(("string"==typeof t?D(t):t).pathname||"/",r);if(null==n)return null;let a=function e(t,r,n,a){void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===a&&(a="");let o=(t,o,i)=>{var l,s;let u,c,d={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:o,route:t};d.relativePath.startsWith("/")&&(S(d.relativePath.startsWith(a),'Absolute route path "'+d.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),d.relativePath=d.relativePath.slice(a.length));let h=W([a,d.relativePath]),f=n.concat(d);t.children&&t.children.length>0&&(S(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+h+'".'),e(t.children,r,f,h)),(null!=t.path||t.index)&&r.push({path:h,score:(l=h,s=t.index,c=(u=l.split("/")).length,u.some(j)&&(c+=-2),s&&(c+=2),u.filter(e=>!j(e)).reduce((e,t)=>e+(A.test(t)?3:""===t?1:10),c)),routesMeta:f})};return t.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))o(e,t,r);else o(e,t)}),r}(e);a.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)});let o=null;for(let e=0;null==o&&e<a.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return x(!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}}(n);o=function(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=O({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:W([a,u.pathname]),pathnameBase:$(W([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=W([a,u.pathnameBase]))}return o}(a[e],t)}return o}function U(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}}let A=/^:[\w-]+$/,j=e=>"*"===e;function M(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(x(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));let n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);let o=e.match(/^:([\w-]+)(\??)$/);if(o){let[,e,r]=o,n=t[e];return S("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function O(e,t){var r,n,a;let o,i;"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[l,s]=(r=e.path,n=e.caseSensitive,a=e.end,void 0===n&&(n=!1),void 0===a&&(a=!0),x("*"===r||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),o=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(o.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")),r.endsWith("*")?(o.push({paramName:"*"}),i+="*"===r||"/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==r&&"/"!==r&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),o]),u=t.match(l);if(!u)return null;let c=u[0],d=c.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:s.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=h[r]||"";d=c.slice(0,c.length-e.length).replace(/(.)\/+$/,"$1")}let o=h[r];return a&&!o?e[n]=void 0:e[n]=(o||"").replace(/%2F/g,"/"),e},{}),pathname:c,pathnameBase:d,pattern:e}}function F(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 N(e,t){var r;let n;void 0===t&&(t="/");let{pathname:a,search:o="",hash:i=""}="string"==typeof e?D(e):e;return{pathname:a?a.startsWith("/")?a:(r=a,n=t.replace(/\/+$/,"").split("/"),r.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"):t,search:J(o),hash:K(i)}}function B(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 I(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function z(e,t){let r=I(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function H(e,t,r,n){let a,o;void 0===n&&(n=!1),"string"==typeof e?a=D(e):(S(!(a=y({},e)).pathname||!a.pathname.includes("?"),B("?","pathname","search",a)),S(!a.pathname||!a.pathname.includes("#"),B("#","pathname","hash",a)),S(!a.search||!a.search.includes("#"),B("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":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 s=N(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}let W=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",K=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",V=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),y({},r,{headers:n}))};class q extends Error{}class Y{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],S(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 q("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 q)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=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 S(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]:function(e){if(!(e instanceof Promise&&!0===e._tracked))return e;if(e._error)throw e._error;return e._data}(n)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}let X=function(e,t){return void 0===t&&(t={}),new Y(e,"number"==typeof t?{status:t}:t)},G=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,y({},r,{headers:n}))},Q=(e,t)=>{let r=G(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Z{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 ee(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}let et=["post","put","patch","delete"],er=new Set(et),en=new Set(["get",...et]),ea=new Set([301,302,303,307,308]),eo=new Set([307,308]),ei={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},el={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},es={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ec=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ed="remix-router-transitions";function eh(e){let t,r,n,a,o,i=e.window?e.window:"u">typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement,s=!l;if(S(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){let r=e.detectErrorBoundary;t=e=>({hasErrorBoundary:r(e)})}else t=ec;let u={},h=_(e.routes,t,void 0,u),f=e.basename||"/",p=y({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,v=new Set,g=null,b=null,w=null,E=null!=e.hydrationData,R=T(h,e.history.location,f),P=null;if(null==R){let t=eD(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=eP(h);R=r,P={[n.id]:t}}let D=R.some(e=>e.route.lazy),L=R.some(e=>e.route.loader);if(D)n=!1;else if(L)if(p.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;n=R.every(e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]))}else n=null!=e.hydrationData;else n=!0;let k={historyAction:e.history.action,location:e.history.location,matches:R,initialized:n,navigation:ei,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||P,fetchers:new Map,blockers:new Map},A=c.Pop,j=!1,M=!1,O=new Map,N=null,B=!1,I=!1,z=[],H=[],W=new Map,$=0,J=-1,K=new Map,V=new Set,q=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),k=y({},k,e);let r=[],n=[];p.v7_fetcherPersist&&k.fetchers.forEach((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))}),[...v].forEach(e=>e(k,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync})),p.v7_fetcherPersist&&(r.forEach(e=>k.fetchers.delete(e)),n.forEach(e=>eW(e)))}function et(t,n,a){var o,i;let l,s,{flushSync:u}=void 0===a?{}:a,d=null!=k.actionData&&null!=k.navigation.formMethod&&eA(k.navigation.formMethod)&&"loading"===k.navigation.state&&(null==(o=t.state)?void 0:o._isRedirect)!==!0;l=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?k.actionData:null;let f=n.loaderData?eR(k.loaderData,n.loaderData,n.matches||[],n.errors):k.loaderData,p=k.blockers;p.size>0&&(p=new Map(p)).forEach((e,t)=>p.set(t,es));let m=!0===j||null!=k.navigation.formMethod&&eA(k.navigation.formMethod)&&(null==(i=t.state)?void 0:i._isRedirect)!==!0;if(r&&(h=r,r=void 0),B||A===c.Pop||(A===c.Push?e.history.push(t,t.state):A===c.Replace&&e.history.replace(t,t.state)),A===c.Pop){let e=O.get(k.location.pathname);e&&e.has(t.pathname)?s={currentLocation:k.location,nextLocation:t}:O.has(t.pathname)&&(s={currentLocation:t,nextLocation:k.location})}else if(M){let e=O.get(k.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(k.location.pathname,e)),s={currentLocation:k.location,nextLocation:t}}ee(y({},n,{actionData:l,loaderData:f,historyAction:A,location:t,initialized:!0,navigation:ei,revalidation:"idle",restoreScrollPosition:eZ(t,n.matches||k.matches),preventScrollReset:m,blockers:p}),{viewTransitionOpts:s,flushSync:!0===u}),A=c.Pop,j=!1,M=!1,B=!1,I=!1,z=[],H=[]}async function er(t,r){if("number"==typeof t)return void e.history.go(t);let n=ef(k.location,k.matches,f,p.v7_prependBasename,t,p.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:a,submission:o,error:i}=ep(p.v7_normalizeFormMethod,!1,n,r),l=k.location,s=C(k.location,a,r&&r.state);s=y({},s,e.history.encodeLocation(s));let u=r&&null!=r.replace?r.replace:void 0,d=c.Push;!0===u?d=c.Replace:!1===u||null!=o&&eA(o.formMethod)&&o.formAction===k.location.pathname+k.location.search&&(d=c.Replace);let h=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.unstable_flushSync),v=eX({currentLocation:l,nextLocation:s,historyAction:d});return v?void eY(v,{state:"blocked",location:s,proceed(){eY(v,{state:"proceeding",proceed:void 0,reset:void 0,location:s}),er(t,r)},reset(){let e=new Map(k.blockers);e.set(v,es),ee({blockers:e})}}):await en(d,s,{submission:o,pendingError:i,preventScrollReset:h,replace:r&&r.replace,enableViewTransition:r&&r.unstable_viewTransition,flushSync:m})}async function en(t,n,a){var i,l,s,u;let c,d;o&&o.abort(),o=null,A=t,B=!0===(a&&a.startUninterruptedRevalidation),i=k.location,l=k.matches,g&&w&&(g[eQ(i,l)]=w()),j=!0===(a&&a.preventScrollReset),M=!0===(a&&a.enableViewTransition);let p=r||h,m=a&&a.overrideNavigation,v=T(p,n,f),b=!0===(a&&a.flushSync);if(!v){let e=eD(404,{pathname:n.pathname}),{matches:t,route:r}=eP(p);eG(),et(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:b});return}if(k.initialized&&!I&&(s=k.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash||!1))&&!(a&&a.submission&&eA(a.submission.formMethod)))return void et(n,{matches:v},{flushSync:b});o=new AbortController;let E=ew(e.history,n,o.signal,a&&a.submission);if(a&&a.pendingError)d={[eC(v).route.id]:a.pendingError};else if(a&&a.submission&&eA(a.submission.formMethod)){let e=await ea(E,n,a.submission,v,{replace:a.replace,flushSync:b});if(e.shortCircuited)return;c=e.pendingActionData,d=e.pendingActionError,m=eB(n,a.submission),b=!1,E=new Request(E.url,{signal:E.signal})}let{shortCircuited:S,loaderData:x,errors:R}=await eh(E,n,v,m,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,b,c,d);S||(o=null,et(n,y({matches:v},c?{actionData:c}:{},{loaderData:x,errors:R})))}async function ea(e,r,n,a,o){var i;let l;void 0===o&&(o={}),eS(),ee({navigation:{state:"submitting",location:r,formMethod:(i=n).formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}},{flushSync:!0===o.flushSync});let s=eF(a,r);if(s.route.action||s.route.lazy){if(l=await eb("action",e,s,a,u,t,f,p.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:d.error,error:eD(405,{method:e.method,pathname:r.pathname,routeId:s.route.id})};if(eU(l)){let e;return e=o&&null!=o.replace?o.replace:l.location===k.location.pathname+k.location.search,await eg(k,l,{submission:n,replace:e}),{shortCircuited:!0}}if(eT(l)){let e=eC(a,s.route.id);return!0!==(o&&o.replace)&&(A=c.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(e_(l))throw eD(400,{type:"defer-action"});return{pendingActionData:{[s.route.id]:l.data}}}async function eh(t,n,a,i,l,s,u,c,d,m,v){let g=i||eB(n,l),b=l||s||eN(g),w=r||h,[E,S]=em(e.history,k,a,b,n,p.v7_partialHydration&&!0===c,I,z,H,X,q,V,w,f,m,v);if(eG(e=>!(a&&a.some(t=>t.route.id===e))||E&&E.some(t=>t.route.id===e)),J=++$,0===E.length&&0===S.length){let e=eK();return et(n,y({matches:a,loaderData:{},errors:v||null},m?{actionData:m}:{},e?{fetchers:new Map(k.fetchers)}:{}),{flushSync:d}),{shortCircuited:!0}}if(!B&&(!p.v7_partialHydration||!c)){S.forEach(e=>{let t=k.fetchers.get(e.key),r=eI(void 0,t?t.data:void 0);k.fetchers.set(e.key,r)});let e=m||k.actionData;ee(y({navigation:g},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},S.length>0?{fetchers:new Map(k.fetchers)}:{}),{flushSync:d})}S.forEach(e=>{W.has(e.key)&&e$(e.key),e.controller&&W.set(e.key,e.controller)});let x=()=>S.forEach(e=>e$(e.key));o&&o.signal.addEventListener("abort",x);let{results:R,loaderResults:C,fetcherResults:P}=await eE(k.matches,a,E,S,t);if(t.signal.aborted)return{shortCircuited:!0};o&&o.signal.removeEventListener("abort",x),S.forEach(e=>W.delete(e.key));let D=eL(R);if(D){if(D.idx>=E.length){let e=S[D.idx-E.length].key;V.add(e)}return await eg(k,D.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:_}=ex(k,a,E,C,v,S,P,G);G.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&G.delete(t)})}),p.v7_partialHydration&&c&&k.errors&&Object.entries(k.errors).filter(e=>{let[t]=e;return!E.some(e=>e.route.id===t)}).forEach(e=>{let[t,r]=e;_=Object.assign(_||{},{[t]:r})});let T=eK(),U=eV(J),A=T||U||S.length>0;return y({loaderData:L,errors:_},A?{fetchers:new Map(k.fetchers)}:{})}async function ev(n,a,i,l,s,c,d){var m,v;if(eS(),q.delete(n),!l.route.action&&!l.route.lazy){let e=eD(405,{method:d.formMethod,pathname:i,routeId:a});eO(n,a,e,{flushSync:c});return}let y=k.fetchers.get(n);ek(n,(m=d,v=y,{state:"submitting",formMethod:m.formMethod,formAction:m.formAction,formEncType:m.formEncType,formData:m.formData,json:m.json,text:m.text,data:v?v.data:void 0}),{flushSync:c});let g=new AbortController,b=ew(e.history,i,g.signal,d);W.set(n,g);let w=$,E=await eb("action",b,l,s,u,t,f,p.v7_relativeSplatPath);if(b.signal.aborted){W.get(n)===g&&W.delete(n);return}if(p.v7_fetcherPersist&&X.has(n)){if(eU(E)||eT(E))return void ek(n,ez(void 0))}else{if(eU(E))return(W.delete(n),J>w)?void ek(n,ez(void 0)):(V.add(n),ek(n,eI(d)),eg(k,E,{fetcherSubmission:d}));if(eT(E))return void eO(n,a,E.error)}if(e_(E))throw eD(400,{type:"defer-action"});let x=k.navigation.location||k.location,R=ew(e.history,x,g.signal),C=r||h,P="idle"!==k.navigation.state?T(C,k.navigation.location,f):k.matches;S(P,"Didn't find any matches after fetcher action");let D=++$;K.set(n,D);let L=eI(d,E.data);k.fetchers.set(n,L);let[_,U]=em(e.history,k,P,d,x,!1,I,z,H,X,q,V,C,f,{[l.route.id]:E.data},void 0);U.filter(e=>e.key!==n).forEach(e=>{let t=e.key,r=k.fetchers.get(t),n=eI(void 0,r?r.data:void 0);k.fetchers.set(t,n),W.has(t)&&e$(t),e.controller&&W.set(t,e.controller)}),ee({fetchers:new Map(k.fetchers)});let j=()=>U.forEach(e=>e$(e.key));g.signal.addEventListener("abort",j);let{results:M,loaderResults:O,fetcherResults:F}=await eE(k.matches,P,_,U,R);if(g.signal.aborted)return;g.signal.removeEventListener("abort",j),K.delete(n),W.delete(n),U.forEach(e=>W.delete(e.key));let N=eL(M);if(N){if(N.idx>=_.length){let e=U[N.idx-_.length].key;V.add(e)}return eg(k,N.result)}let{loaderData:B,errors:Y}=ex(k,k.matches,_,O,void 0,U,F,G);if(k.fetchers.has(n)){let e=ez(E.data);k.fetchers.set(n,e)}eV(D),"loading"===k.navigation.state&&D>J?(S(A,"Expected pending action"),o&&o.abort(),et(k.navigation.location,{matches:P,loaderData:B,errors:Y,fetchers:new Map(k.fetchers)})):(ee({errors:Y,loaderData:eR(k.loaderData,B,P,Y),fetchers:new Map(k.fetchers)}),I=!1)}async function ey(r,n,a,o,i,l,s){let c=k.fetchers.get(r);ek(r,eI(s,c?c.data:void 0),{flushSync:l});let d=new AbortController,h=ew(e.history,a,d.signal);W.set(r,d);let m=$,v=await eb("loader",h,o,i,u,t,f,p.v7_relativeSplatPath);if(e_(v)&&(v=await eM(v,h.signal,!0)||v),W.get(r)===d&&W.delete(r),!h.signal.aborted){if(X.has(r))return void ek(r,ez(void 0));if(eU(v))if(J>m)return void ek(r,ez(void 0));else{V.add(r),await eg(k,v);return}if(eT(v))return void eO(r,n,v.error);S(!e_(v),"Unhandled fetcher deferred data"),ek(r,ez(v.data))}}async function eg(t,r,n){let{submission:a,fetcherSubmission:s,replace:u}=void 0===n?{}:n;r.revalidate&&(I=!0);let d=C(t.location,r.location,{_isRedirect:!0});if(S(d,"Expected a location on the redirect navigation"),l){let t=!1;if(r.reloadDocument)t=!0;else if(eu.test(r.location)){let n=e.history.createURL(r.location);t=n.origin!==i.location.origin||null==F(n.pathname,f)}if(t)return void(u?i.location.replace(r.location):i.location.assign(r.location))}o=null;let h=!0===u?c.Replace:c.Push,{formMethod:p,formAction:m,formEncType:v}=t.navigation;!a&&!s&&p&&m&&v&&(a=eN(t.navigation));let g=a||s;if(eo.has(r.status)&&g&&eA(g.formMethod))await en(h,d,{submission:y({},g,{formAction:r.location}),preventScrollReset:j});else{let e=eB(d,a);await en(h,d,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:j})}}async function eE(r,n,a,o,i){let l=await Promise.all([...a.map(e=>eb("loader",i,e,n,u,t,f,p.v7_relativeSplatPath)),...o.map(r=>r.matches&&r.match&&r.controller?eb("loader",ew(e.history,r.path,r.controller.signal),r.match,r.matches,u,t,f,p.v7_relativeSplatPath):{type:d.error,error:eD(404,{pathname:r.path})})]),s=l.slice(0,a.length),c=l.slice(a.length);return await Promise.all([ej(r,a,s,s.map(()=>i.signal),!1,k.loaderData),ej(r,o.map(e=>e.match),c,o.map(e=>e.controller?e.controller.signal:null),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function eS(){I=!0,z.push(...eG()),q.forEach((e,t)=>{W.has(t)&&(H.push(t),e$(t))})}function ek(e,t,r){void 0===r&&(r={}),k.fetchers.set(e,t),ee({fetchers:new Map(k.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eO(e,t,r,n){void 0===n&&(n={});let a=eC(k.matches,t);eW(e),ee({errors:{[a.route.id]:r},fetchers:new Map(k.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eH(e){return p.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),k.fetchers.get(e)||el}function eW(e){let t=k.fetchers.get(e);W.has(e)&&!(t&&"loading"===t.state&&K.has(e))&&e$(e),q.delete(e),K.delete(e),V.delete(e),X.delete(e),k.fetchers.delete(e)}function e$(e){let t=W.get(e);S(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function eJ(e){for(let t of e){let e=ez(eH(t).data);k.fetchers.set(t,e)}}function eK(){let e=[],t=!1;for(let r of V){let n=k.fetchers.get(r);S(n,"Expected fetcher: "+r),"loading"===n.state&&(V.delete(r),e.push(r),t=!0)}return eJ(e),t}function eV(e){let t=[];for(let[r,n]of K)if(n<e){let e=k.fetchers.get(r);S(e,"Expected fetcher: "+r),"loading"===e.state&&(e$(r),K.delete(r),t.push(r))}return eJ(t),t.length>0}function eq(e){k.blockers.delete(e),Q.delete(e)}function eY(e,t){let r=k.blockers.get(e)||es;S("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(k.blockers);n.set(e,t),ee({blockers:n})}function eX(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&x(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=k.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:t,nextLocation:r,historyAction:n}))return o}function eG(e){let t=[];return G.forEach((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),G.delete(n))}),t}function eQ(e,t){return b&&b(e,t.map(e=>U(e,k.loaderData)))||e.key}function eZ(e,t){if(g){let r=g[eQ(e,t)];if("number"==typeof r)return r}return null}return a={get basename(){return f},get future(){return p},get state(){return k},get routes(){return h},get window(){return i},initialize:function(){if(m=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(Z){Z=!1;return}x(0===Q.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=eX({currentLocation:k.location,nextLocation:n,historyAction:r});if(o&&null!=a){Z=!0,e.history.go(-1*a),eY(o,{state:"blocked",location:n,proceed(){eY(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(k.blockers);e.set(o,es),ee({blockers:e})}});return}return en(r,n)}),l){var t=i,r=O;try{let e=t.sessionStorage.getItem(ed);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch(e){}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(ed,JSON.stringify(r))}catch(e){x(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}})(i,O);i.addEventListener("pagehide",e),N=()=>i.removeEventListener("pagehide",e)}return k.initialized||en(c.Pop,k.location,{initialHydration:!0}),a},subscribe:function(e){return v.add(e),()=>v.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,w=t,b=r||null,!E&&k.navigation===ei){E=!0;let e=eZ(k.location,k.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{g=null,w=null,b=null}},navigate:er,fetch:function(e,t,n,a){if(s)throw 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.");W.has(e)&&e$(e);let o=!0===(a&&a.unstable_flushSync),i=r||h,l=ef(k.location,k.matches,f,p.v7_prependBasename,n,p.v7_relativeSplatPath,t,null==a?void 0:a.relative),u=T(i,l,f);if(!u)return void eO(e,t,eD(404,{pathname:l}),{flushSync:o});let{path:c,submission:d,error:m}=ep(p.v7_normalizeFormMethod,!0,l,a);if(m)return void eO(e,t,m,{flushSync:o});let v=eF(u,c);(j=!0===(a&&a.preventScrollReset),d&&eA(d.formMethod))?ev(e,t,c,v,u,o,d):(q.set(e,{routeId:t,path:c}),ey(e,t,c,v,u,o,d))},revalidate:function(){if(eS(),ee({revalidation:"loading"}),"submitting"!==k.navigation.state){if("idle"===k.navigation.state)return void en(k.historyAction,k.location,{startUninterruptedRevalidation:!0});en(A||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eH,deleteFetcher:function(e){if(p.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else eW(e);ee({fetchers:new Map(k.fetchers)})},dispose:function(){m&&m(),N&&N(),v.clear(),o&&o.abort(),k.fetchers.forEach((e,t)=>eW(t)),k.blockers.forEach((e,t)=>eq(t))},getBlocker:function(e,t){let r=k.blockers.get(e)||es;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:eq,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){r=_(e,t,void 0,u={})}}}function ef(e,t,r,n,a,o,i,l){let s,u;if(i){for(let e of(s=[],t))if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=H(a||".",z(s,o),F(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u&&u.route.index&&!eO(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:W([r,c.pathname])),P(c)}function ep(e,t,r,n){var a;let o,i;if(!n||!(null!=n&&("formData"in n&&null!=n.formData||"body"in n&&void 0!==n.body)))return{path:r};if(n.formMethod&&(a=n.formMethod,!en.has(a.toLowerCase())))return{path:r,error:eD(405,{method:n.formMethod})};let l=()=>({path:r,error:eD(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=ek(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!eA(u))return l();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}}}else if("application/json"===n.formEncType){if(!eA(u))return l();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 l()}}}if(S("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=eE(n.formData),i=n.formData;else if(n.body instanceof FormData)o=eE(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=eS(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=eS(o)}catch(e){return l()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(eA(d.formMethod))return{path:r,submission:d};let h=D(r);return t&&h.search&&eO(h.search)&&o.append("index",""),h.search="?"+o,{path:P(h),submission:d}}function em(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m){let v=m?Object.values(m)[0]:p?Object.values(p)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),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,m?Object.keys(m)[0]:void 0).filter((e,r)=>{var a,s,u;let c,d,{route:h}=e;if(h.lazy)return!0;if(null==h.loader)return!1;if(o)return!!h.loader.hydrate||void 0===t.loaderData[h.id]&&(!t.errors||void 0===t.errors[h.id]);if(a=t.loaderData,s=t.matches[r],u=e,c=!s||u.route.id!==s.route.id,d=void 0===a[u.route.id],c||d||l.some(t=>t===e.route.id))return!0;let f=t.matches[r];return ey(e,y({currentUrl:g,currentParams:f.params,nextUrl:b,nextParams:e.params},n,{actionResult:v,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||ev(f,e)}))}),E=[];return c.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||u.has(a))return;let l=T(h,e.path,f);if(!l)return void E.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=t.fetchers.get(a),p=eF(l,e.path);!d.has(a)&&(s.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:ey(p,y({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:i}))))&&E.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:p,controller:new AbortController})}),[w,E]}function ev(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ey(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function eg(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];S(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;x(!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||k.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,y({},t(a),{lazy:void 0}))}async function eb(e,t,r,n,a,o,i,l,s){var u,c,h,f;let p,m,v;void 0===s&&(s={});let y=e=>{let n,a=new Promise((e,t)=>n=t);return v=()=>n(),t.signal.addEventListener("abort",v),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([y(n).catch(t=>{e=t}),eg(r.route,o,a)]);if(e)throw e;m=t[0]}else if(await eg(r.route,o,a),n=r.route[e])m=await y(n);else{if("action"!==e)return{type:d.data,data:void 0};let n=new URL(t.url),a=n.pathname+n.search;throw eD(405,{method:t.method,pathname:a,routeId:r.route.id})}else if(n)m=await y(n);else{let e=new URL(t.url),r=e.pathname+e.search;throw eD(404,{pathname:r})}S(void 0!==m,"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){p=d.error,m=e}finally{v&&t.signal.removeEventListener("abort",v)}if(null!=(u=m)&&"number"==typeof u.status&&"string"==typeof u.statusText&&"object"==typeof u.headers&&void 0!==u.body){let e,a=m.status;if(ea.has(a)){let e=m.headers.get("Location");if(S(e,"Redirects returned/thrown from loaders/actions must have a Location header"),eu.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=new URL(e.startsWith("//")?r.protocol+e:e),a=null!=F(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=ef(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw m.headers.set("Location",e),m;return{type:d.redirect,status:a,location:e,revalidate:null!==m.headers.get("X-Remix-Revalidate"),reloadDocument:null!==m.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:p===d.error?d.error:d.data,response:m};try{let t=m.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==m.body?null:await m.json():await m.text()}catch(e){return{type:d.error,error:e}}return p===d.error?{type:p,error:new Z(a,m.statusText,e),headers:m.headers}:{type:d.data,data:e,statusCode:m.status,headers:m.headers}}if(p===d.error)return{type:p,error:m};if((c=m)&&"object"==typeof c&&"object"==typeof c.data&&"function"==typeof c.subscribe&&"function"==typeof c.cancel&&"function"==typeof c.resolveData){return{type:d.deferred,deferredData:m,statusCode:null==(h=m.init)?void 0:h.status,headers:(null==(f=m.init)?void 0:f.headers)&&new Headers(m.init.headers)}}return{type:d.data,data:m}}function ew(e,t,r,n){let a=e.createURL(ek(t)).toString(),o={signal:r};if(n&&eA(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=eE(n.formData):o.body=n.formData}return new Request(a,o)}function eE(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eS(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ex(e,t,r,n,a,o,i,l){var s;let u,c,d,h,f,{loaderData:p,errors:m}=(s=a,c={},d=null,h=!1,f={},n.forEach((e,n)=>{let a=r[n].route.id;if(S(!eU(e),"Cannot handle redirect results in processLoaderData"),eT(e)){let r=eC(t,a),n=e.error;s&&(n=Object.values(s)[0],s=void 0),null==(d=d||{})[r.route.id]&&(d[r.route.id]=n),c[a]=void 0,h||(h=!0,u=ee(e.error)?e.error.status:500),e.headers&&(f[a]=e.headers)}else e_(e)?(l.set(a,e.deferredData),c[a]=e.deferredData.data):c[a]=e.data,null==e.statusCode||200===e.statusCode||h||(u=e.statusCode),e.headers&&(f[a]=e.headers)}),s&&(d=s,c[Object.keys(s)[0]]=void 0),{loaderData:c,errors:d,statusCode:u||200,loaderHeaders:f});for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];S(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let l=i[t];if(!a||!a.signal.aborted)if(eT(l)){let t=eC(e.matches,null==n?void 0:n.route.id);m&&m[t.route.id]||(m=y({},m,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(eU(l))S(!1,"Unhandled fetcher revalidation redirect");else if(e_(l))S(!1,"Unhandled fetcher deferred data");else{let t=ez(l.data);e.fetchers.set(r,t)}}return{loaderData:p,errors:m}}function eR(e,t,r,n){let a=y({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eC(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function eP(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 eD(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",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?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="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 Z(e||500,i,Error(l),!0)}function eL(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(eU(r))return{result:r,idx:t}}}function ek(e){let t="string"==typeof e?D(e):e;return P(y({},t,{hash:""}))}function e_(e){return e.type===d.deferred}function eT(e){return e.type===d.error}function eU(e){return(e&&e.type)===d.redirect}function eA(e){return er.has(e.toLowerCase())}async function ej(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find(e=>e.route.id===s.route.id),c=null!=u&&!ev(u,s)&&(o&&o[s.route.id])!==void 0;if(e_(l)&&(a||c)){let e=n[i];S(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await eM(l,e,a).then(e=>{e&&(r[i]=e||r[i])})}}}async function eM(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:d.data,data:e.deferredData.unwrappedData}}catch(e){return{type:d.error,error:e}}return{type:d.data,data:e.deferredData.data}}}function eO(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eF(e,t){let r="string"==typeof t?D(t).search:t.search;if(e[e.length-1].route.index&&eO(r||""))return e[e.length-1];let n=I(e);return n[n.length-1]}function eN(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eB(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 eI(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 ez(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 eH(){return(eH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}Symbol("deferred");let eW=p.createContext(null),e$=p.createContext(null),eJ=p.createContext(null),eK=p.createContext(null),eV=p.createContext(null),eq=p.createContext({outlet:null,matches:[],isDataRoute:!1}),eY=p.createContext(null);function eX(e,t){let{relative:r}=void 0===t?{}:t;eG()||S(!1);let{basename:n,navigator:a}=p.useContext(eK),{hash:o,pathname:i,search:l}=e9(e,{relative:r}),s=i;return"/"!==n&&(s="/"===i?n:W([n,i])),a.createHref({pathname:s,search:l,hash:o})}function eG(){return null!=p.useContext(eV)}function eQ(){return eG()||S(!1),p.useContext(eV).location}function eZ(){return p.useContext(eV).navigationType}function e0(e){eG()||S(!1);let{pathname:t}=eQ();return p.useMemo(()=>O(e,t),[t,e])}function e1(e){p.useContext(eK).static||p.useLayoutEffect(e)}function e7(){let{isDataRoute:e}=p.useContext(eq);return e?function(){let{router:e}=ti(ta.UseNavigateStable),t=ts(to.UseNavigateStable),r=p.useRef(!1);return e1(()=>{r.current=!0}),p.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,eH({fromRouteId:t},a)))},[e,t])}():function(){eG()||S(!1);let e=p.useContext(eW),{basename:t,future:r,navigator:n}=p.useContext(eK),{matches:a}=p.useContext(eq),{pathname:o}=eQ(),i=JSON.stringify(z(a,r.v7_relativeSplatPath)),l=p.useRef(!1);return e1(()=>{l.current=!0}),p.useCallback(function(r,a){if(void 0===a&&(a={}),!l.current)return;if("number"==typeof r)return void n.go(r);let s=H(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:W([t,s.pathname])),(a.replace?n.replace:n.push)(s,a.state,a)},[t,n,i,o,e])}()}let e4=p.createContext(null);function e2(){return p.useContext(e4)}function e3(e){let t=p.useContext(eq).outlet;return t?p.createElement(e4.Provider,{value:e},t):t}function e5(){let{matches:e}=p.useContext(eq),t=e[e.length-1];return t?t.params:{}}function e9(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=p.useContext(eK),{matches:a}=p.useContext(eq),{pathname:o}=eQ(),i=JSON.stringify(z(a,n.v7_relativeSplatPath));return p.useMemo(()=>H(e,JSON.parse(i),o,"path"===r),[e,i,o,r])}function e8(e,t){return e6(e,t)}function e6(e,t,r,n){let a;eG()||S(!1);let{navigator:o}=p.useContext(eK),{matches:i}=p.useContext(eq),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let d=eQ();if(t){var h;let e="string"==typeof t?D(t):t;"/"===u||(null==(h=e.pathname)?void 0:h.startsWith(u))||S(!1),a=e}else a=d;let f=a.pathname||"/",m=f;if("/"!==u){let e=u.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=T(e,{pathname:m}),y=tn(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:W([u,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:W([u,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,r,n);return t&&y?p.createElement(eV.Provider,{value:{location:eH({pathname:"/",search:"",hash:"",state:null,key:"default"},a),navigationType:c.Pop}},y):y}let te=p.createElement(function(){let e=tv(),t=ee(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)},null);class tt extends p.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){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?p.createElement(eq.Provider,{value:this.props.routeContext},p.createElement(eY.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tr(e){let{routeContext:t,match:r,children:n}=e,a=p.useContext(eW);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(eq.Provider,{value:t},n)}function tn(e,t,r,n){var a,o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){if(null==(o=r)||!o.errors)return null;e=r.matches}let i=e,l=null==(a=r)?void 0:a.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&(null==l?void 0:l[e.route.id]));e>=0||S(!1),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){s=!0,i=u>=0?i.slice(0,u+1):[i[0]];break}}}return i.reduceRight((e,n,a)=>{var o;let c,d=!1,h=null,f=null;r&&(c=l&&n.route.id?l[n.route.id]:void 0,h=n.route.errorElement||te,s&&(u<0&&0===a?(o="route-fallback",tE[o]||(tE[o]=!0),d=!0,f=null):u===a&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,a+1)),v=()=>{let t;return t=c?h:d?f:n.route.Component?p.createElement(n.route.Component,null):n.route.element?n.route.element:e,p.createElement(tr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?p.createElement(tt,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var ta=((o=ta||{}).UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o),to=((i=to||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);function ti(e){let t=p.useContext(eW);return t||S(!1),t}function tl(e){let t=p.useContext(e$);return t||S(!1),t}function ts(e){let t,r=((t=p.useContext(eq))||S(!1),t),n=r.matches[r.matches.length-1];return n.route.id||S(!1),n.route.id}function tu(){return ts(to.UseRouteId)}function tc(){return tl(to.UseNavigation).navigation}function td(){let e=ti(ta.UseRevalidator),t=tl(to.UseRevalidator);return p.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function th(){let{matches:e,loaderData:t}=tl(to.UseMatches);return p.useMemo(()=>e.map(e=>U(e,t)),[e,t])}function tf(){let e=tl(to.UseLoaderData),t=ts(to.UseLoaderData);return e.errors&&null!=e.errors[t]?void console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")"):e.loaderData[t]}function tp(e){return tl(to.UseRouteLoaderData).loaderData[e]}function tm(){let e=tl(to.UseActionData),t=ts(to.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function tv(){var e;let t=p.useContext(eY),r=tl(to.UseRouteError),n=ts(to.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function ty(){let e=p.useContext(eJ);return null==e?void 0:e._data}function tg(){let e=p.useContext(eJ);return null==e?void 0:e._error}let tb=0;function tw(e){let{router:t,basename:r}=ti(ta.UseBlocker),n=tl(to.UseBlocker),[a,o]=p.useState(""),i=p.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:eH({},n,{pathname:F(n.pathname,r)||n.pathname}),nextLocation:eH({},a,{pathname:F(a.pathname,r)||a.pathname}),historyAction:o})},[r,e]);return p.useEffect(()=>{let e=String(++tb);return o(e),()=>t.deleteBlocker(e)},[t]),p.useEffect(()=>{""!==a&&t.getBlocker(a,i)},[t,a,i]),a&&n.blockers.has(a)?n.blockers.get(a):es}let tE={},tS=p.startTransition;function tx(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:o}=e,i=p.useRef();null==i.current&&(i.current=b({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=i.current,[s,u]=p.useState({action:l.action,location:l.location}),{v7_startTransition:c}=o||{},d=p.useCallback(e=>{c&&tS?tS(()=>u(e)):u(e)},[u,c]);return p.useLayoutEffect(()=>l.listen(d),[l,d]),p.createElement(tD,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}function tR(e){let{to:t,replace:r,state:n,relative:a}=e;eG()||S(!1);let{future:o,static:i}=p.useContext(eK),{matches:l}=p.useContext(eq),{pathname:s}=eQ(),u=e7(),c=JSON.stringify(H(t,z(l,o.v7_relativeSplatPath),s,"path"===a));return p.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:a}),[u,c,a,r,n]),null}function tC(e){return e3(e.context)}function tP(e){S(!1)}function tD(e){let{basename:t="/",children:r=null,location:n,navigationType:a=c.Pop,navigator:o,static:i=!1,future:l}=e;eG()&&S(!1);let s=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:s,navigator:o,static:i,future:eH({v7_relativeSplatPath:!1},l)}),[s,l,o,i]);"string"==typeof n&&(n=D(n));let{pathname:d="/",search:h="",hash:f="",state:m=null,key:v="default"}=n,y=p.useMemo(()=>{let e=F(d,s);return null==e?null:{location:{pathname:e,search:h,hash:f,state:m,key:v},navigationType:a}},[s,d,h,f,m,v,a]);return null==y?null:p.createElement(eK.Provider,{value:u},p.createElement(eV.Provider,{children:r,value:y}))}function tL(e){let{children:t,location:r}=e;return e6(tj(t),r)}function tk(e){let{children:t,errorElement:r,resolve:n}=e;return p.createElement(tU,{resolve:n,errorElement:r},p.createElement(tA,null,t))}var t_=((l=t_||{})[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l);let tT=new Promise(()=>{});class tU extends p.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,a=t_.pending;if(r instanceof Promise)if(this.state.error){a=t_.error;let e=this.state.error;Object.defineProperty(n=Promise.reject().catch(()=>{}),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?a=void 0!==(n=r)._error?t_.error:void 0!==n._data?t_.success:t_.pending:(a=t_.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 a=t_.success,Object.defineProperty(n=Promise.resolve(),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(a===t_.error&&n._error instanceof q)throw tT;if(a===t_.error&&!t)throw n._error;if(a===t_.error)return p.createElement(eJ.Provider,{value:n,children:t});if(a===t_.success)return p.createElement(eJ.Provider,{value:n,children:e});throw n}}function tA(e){let{children:t}=e,r=ty(),n="function"==typeof t?t(r):t;return p.createElement(p.Fragment,null,n)}function tj(e,t){void 0===t&&(t=[]);let r=[];return p.Children.forEach(e,(e,n)=>{if(!p.isValidElement(e))return;let a=[...t,n];if(e.type===p.Fragment)return void r.push.apply(r,tj(e.props.children,a));e.type!==tP&&S(!1),e.props.index&&e.props.children&&S(!1);let o={id:e.props.id||a.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&&(o.children=tj(e.props.children,a)),r.push(o)}),r}function tM(e){return tn(e)}function tO(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function tF(e,t){return eh({basename:null==t?void 0:t.basename,future:eH({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:b({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:tO}).initialize()}function tN(){return(tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function tB(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}let tI="application/x-www-form-urlencoded";function tz(e){return null!=e&&"string"==typeof e.tagName}function tH(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 tW=null,t$=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tJ(e){return null==e||t$.has(e)?e:null}let tK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],tV=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],tq=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function tY(e,t){return eh({basename:null==t?void 0:t.basename,future:tN({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:w({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tG(),routes:e,mapRouteProperties:tO,window:null==t?void 0:t.window}).initialize()}function tX(e,t){return eh({basename:null==t?void 0:t.basename,future:tN({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:E({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tG(),routes:e,mapRouteProperties:tO,window:null==t?void 0:t.window}).initialize()}function tG(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=tN({},t,{errors:function(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 Z(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=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(t.errors)})),t}let tQ=p.createContext({isTransitioning:!1}),tZ=p.createContext(new Map),t0=p.startTransition,t1=v.flushSync,t7=p.useId;function t4(e){t1?t1(e):e()}class t2{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 t3(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=p.useState(r.state),[i,l]=p.useState(),[s,u]=p.useState({isTransitioning:!1}),[c,d]=p.useState(),[h,f]=p.useState(),[m,v]=p.useState(),y=p.useRef(new Map),{v7_startTransition:g}=n||{},b=p.useCallback(e=>{if(g)t0?t0(e):e();else e()},[g]),w=p.useCallback((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:i}=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||"function"!=typeof r.window.document.startViewTransition;if(!i||s)return void(a?t4(()=>o(e)):b(()=>o(e)));if(a){t4(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})});let t=r.window.document.startViewTransition(()=>{t4(()=>o(e))});t.finished.finally(()=>{t4(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})}),t4(()=>f(t));return}h?(c&&c.resolve(),h.skipTransition(),v({state:e,currentLocation:i.currentLocation,nextLocation:i.nextLocation})):(l(e),u({isTransitioning:!0,flushSync:!1,currentLocation:i.currentLocation,nextLocation:i.nextLocation}))},[r.window,h,c,y,b]);p.useLayoutEffect(()=>r.subscribe(w),[r,w]),p.useEffect(()=>{s.isTransitioning&&!s.flushSync&&d(new t2)},[s]),p.useEffect(()=>{if(c&&i&&r.window){let e=c.promise,t=r.window.document.startViewTransition(async()=>{b(()=>o(i)),await e});t.finished.finally(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}),f(t)}},[b,i,c,r.window]),p.useEffect(()=>{c&&i&&a.location.key===i.location.key&&c.resolve()},[c,h,a.location,i]),p.useEffect(()=>{!s.isTransitioning&&m&&(l(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[s.isTransitioning,m]),p.useEffect(()=>{},[]);let E=p.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]),S=r.basename||"/",x=p.useMemo(()=>({router:r,navigator:E,static:!1,basename:S}),[r,E,S]);return p.createElement(p.Fragment,null,p.createElement(eW.Provider,{value:x},p.createElement(e$.Provider,{value:a},p.createElement(tZ.Provider,{value:y.current},p.createElement(tQ.Provider,{value:s},p.createElement(tD,{basename:S,location:a.location,navigationType:a.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?p.createElement(t5,{routes:r.routes,future:r.future,state:a}):t))))),null)}function t5(e){let{routes:t,future:r,state:n}=e;return e6(t,void 0,n,r)}function t9(e){let{basename:t,children:r,future:n,window:a}=e,o=p.useRef();null==o.current&&(o.current=w({window:a,v5Compat:!0}));let i=o.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&t0?t0(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tD,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function t8(e){let{basename:t,children:r,future:n,window:a}=e,o=p.useRef();null==o.current&&(o.current=E({window:a,v5Compat:!0}));let i=o.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&t0?t0(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tD,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function t6(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=p.useState({action:a.action,location:a.location}),{v7_startTransition:l}=n||{},s=p.useCallback(e=>{l&&t0?t0(()=>i(e)):i(e)},[i,l]);return p.useLayoutEffect(()=>a.listen(s),[a,s]),p.createElement(tD,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}let re="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,rt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rr=p.forwardRef(function(e,t){let r,{onClick:n,relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:c,unstable_viewTransition:d}=e,h=tB(e,tK),{basename:f}=p.useContext(eK),m=!1;if("string"==typeof u&&rt.test(u)&&(r=u,re))try{let e=new URL(window.location.href),t=new URL(u.startsWith("//")?e.protocol+u:u),r=F(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch(e){}let v=eX(u,{relative:a}),y=rs(u,{replace:i,state:l,target:s,preventScrollReset:c,relative:a,unstable_viewTransition:d});return p.createElement("a",tN({},h,{href:r||v,onClick:m||o?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:s}))}),rn=p.forwardRef(function(e,t){let r,{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=tB(e,tV),h=e9(s,{relative:d.relative}),f=eQ(),m=p.useContext(e$),{navigator:v,basename:y}=p.useContext(eK),g=null!=m&&rE(h)&&!0===u,b=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,w=f.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(w=w.toLowerCase(),E=E?E.toLowerCase():null,b=b.toLowerCase()),E&&y&&(E=F(E,y)||E);let S="/"!==b&&b.endsWith("/")?b.length-1:b.length,x=w===b||!i&&w.startsWith(b)&&"/"===w.charAt(S),R=null!=E&&(E===b||!i&&E.startsWith(b)&&"/"===E.charAt(b.length)),C={isActive:x,isPending:R,isTransitioning:g},P=x?n:void 0;r="function"==typeof o?o(C):[o,x?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(C):l;return p.createElement(rr,tN({},d,{"aria-current":P,className:r,ref:t,style:D,to:s,unstable_viewTransition:u}),"function"==typeof c?c(C):c)}),ra=p.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:i,method:l="get",action:s,onSubmit:u,relative:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=tB(e,tq),m=rh(),v=rf(s,{relative:c}),y="get"===l.toLowerCase()?"get":"post";return p.createElement("form",tN({ref:t,method:y,action:v,onSubmit:a?u:e=>{if(u&&u(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:o,state:i,relative:c,preventScrollReset:d,unstable_viewTransition:h})}},f))});function ro(e){let{getKey:t,storageKey:r}=e;return rg({getKey:t,storageKey:r}),null}function ri(e){let t=p.useContext(eW);return t||S(!1),t}function rl(e){let t=p.useContext(e$);return t||S(!1),t}function rs(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:l}=void 0===t?{}:t,s=e7(),u=eQ(),c=e9(e,{relative:i});return p.useCallback(t=>{0!==t.button||r&&"_self"!==r||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),s(e,{replace:void 0!==n?n:P(u)===P(c),state:a,preventScrollReset:o,relative:i,unstable_viewTransition:l}))},[u,s,c,n,a,r,e,o,i,l])}function ru(e){let t=p.useRef(tH(e)),r=p.useRef(!1),n=eQ(),a=p.useMemo(()=>{var e,a;let o;return e=n.search,a=r.current?null:t.current,o=tH(e),a&&a.forEach((e,t)=>{o.has(t)||a.getAll(t).forEach(e=>{o.append(t,e)})}),o},[n.search]),o=e7(),i=p.useCallback((e,t)=>{let n=tH("function"==typeof e?e(a):e);r.current=!0,o("?"+n,t)},[o,a]);return[a,i]}(s=h||(h={})).UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState",(u=f||(f={})).UseFetcher="useFetcher",u.UseFetchers="useFetchers",u.UseScrollRestoration="useScrollRestoration";let rc=0,rd=()=>"__"+String(++rc)+"__";function rh(){let{router:e}=ri(h.UseSubmit),{basename:t}=p.useContext(eK),r=tu();return p.useCallback(function(n,a){if(void 0===a&&(a={}),"u"<typeof document)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tz(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?F(i,t):null,r=e.getAttribute("method")||"get",a=tJ(e.getAttribute("enctype"))||tI,o=new FormData(e)}else if(tz(e)&&"button"===e.tagName.toLowerCase()||tz(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?F(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",a=tJ(e.getAttribute("formenctype"))||tJ(i.getAttribute("enctype"))||tI,o=new FormData(i,e),!function(){if(null===tW)try{new FormData(document.createElement("form"),0),tW=!1}catch(e){tW=!0}return tW}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else if(tz(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=tI,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||rd();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function rf(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=p.useContext(eK),a=p.useContext(eq);a||S(!1);let[o]=a.matches.slice(-1),i=tN({},e9(e||".",{relative:r})),l=eQ();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),i.search=e.toString()?"?"+e.toString():"")}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:W([n,i.pathname])),P(i)}function rp(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=ri(h.UseFetcher),a=rl(f.UseFetcher),o=p.useContext(tZ),i=p.useContext(eq),l=null==(t=i.matches[i.matches.length-1])?void 0:t.route.id;o||S(!1),i||S(!1),null==l&&S(!1);let s=t7?t7():"",[u,c]=p.useState(r||s);r&&r!==u?c(r):u||c(rd()),p.useEffect(()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)}),[n,u]);let d=p.useCallback((e,t)=>{l||S(!1),n.fetch(u,l,e,t)},[u,l,n]),m=rh(),v=p.useCallback((e,t)=>{m(e,tN({},t,{navigate:!1,fetcherKey:u}))},[u,m]),y=p.useMemo(()=>p.forwardRef((e,t)=>p.createElement(ra,tN({},e,{navigate:!1,fetcherKey:u,ref:t}))),[u]),g=a.fetchers.get(u)||el,b=o.get(u);return p.useMemo(()=>tN({Form:y,submit:v,load:d},g,{data:b}),[y,v,d,g,b])}function rm(){return Array.from(rl(f.UseFetchers).fetchers.entries()).map(e=>{let[t,r]=e;return tN({},r,{key:t})})}let rv="react-router-scroll-positions",ry={};function rg(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=ri(h.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=rl(f.UseScrollRestoration),{basename:i}=p.useContext(eK),l=eQ(),s=th(),u=tc();p.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e){let{capture:t}={};p.useEffect(()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,t])}(p.useCallback(()=>{"idle"===u.state&&(ry[(t?t(l,s):null)||l.key]=window.scrollY);try{sessionStorage.setItem(r||rv,JSON.stringify(ry))}catch(e){}window.history.scrollRestoration="auto"},[r,t,u.state,l,s])),"u">typeof document&&(p.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||rv);e&&(ry=JSON.parse(e))}catch(e){}},[r]),p.useLayoutEffect(()=>{let e=t&&"/"!==i?(e,r)=>t(tN({},e,{pathname:F(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(ry,()=>window.scrollY,e);return()=>r&&r()},[n,i,t]),p.useLayoutEffect(()=>{if(!1!==a){if("number"==typeof a)return void window.scrollTo(0,a);if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==o&&window.scrollTo(0,0)}},[l,a,o]))}function rb(e,t){let{capture:r}=t||{};p.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}function rw(e){let{when:t,message:r}=e,n=tw(t);p.useEffect(()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),p.useEffect(()=>{"blocked"!==n.state||t||n.reset()},[n,t])}function rE(e,t){void 0===t&&(t={});let r=p.useContext(tQ);null==r&&S(!1);let{basename:n}=ri(h.useViewTransitionState),a=e9(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=F(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=F(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=O(a.pathname,i)||null!=O(a.pathname,o)}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_metadataexport_app=globalThis.webpackChunk_openmrs_esm_metadataexport_app||[]).push([["9712"],{7059(e,t,r){r.r(t),r.d(t,{useFetchers:()=>rp,unstable_HistoryRouter:()=>t8,useLoaderData:()=>th,ScrollRestoration:()=>ra,Route:()=>tC,MemoryRouter:()=>tS,useMatches:()=>td,redirect:()=>X,useOutletContext:()=>e4,createRoutesFromElements:()=>tA,useLinkClickHandler:()=>rl,useRouteError:()=>tm,generatePath:()=>j,useHref:()=>eY,useParams:()=>e3,useRoutes:()=>e9,UNSAFE_ViewTransitionContext:()=>tG,useSubmit:()=>rd,Navigate:()=>tx,UNSAFE_NavigationContext:()=>eJ,useAsyncError:()=>ty,UNSAFE_FetchersContext:()=>tQ,createRoutesFromChildren:()=>tA,unstable_usePrompt:()=>rb,useFetcher:()=>rf,useBlocker:()=>tb,createHashRouter:()=>tY,UNSAFE_useRouteId:()=>ts,useMatch:()=>eZ,useNavigation:()=>tu,HashRouter:()=>t9,useFormAction:()=>rh,useResolvedPath:()=>e5,defer:()=>Y,Router:()=>tP,Routes:()=>tD,useActionData:()=>tp,useRouteLoaderData:()=>tf,Await:()=>tL,matchPath:()=>M,UNSAFE_DataRouterContext:()=>eH,BrowserRouter:()=>t5,NavigationType:()=>c,Form:()=>rn,UNSAFE_RouteContext:()=>eV,createSearchParams:()=>tz,RouterProvider:()=>t2,UNSAFE_LocationContext:()=>eK,parsePath:()=>P,Outlet:()=>tR,createMemoryRouter:()=>tO,UNSAFE_useScrollRestoration:()=>ry,useNavigate:()=>e1,matchRoutes:()=>_,createPath:()=>C,resolvePath:()=>F,useInRouterContext:()=>eX,useOutlet:()=>e2,useAsyncValue:()=>tv,Link:()=>rt,AbortedDeferredError:()=>V,renderMatches:()=>tj,NavLink:()=>rr,UNSAFE_DataRouterStateContext:()=>eW,json:()=>K,useSearchParams:()=>rs,redirectDocument:()=>G,useBeforeUnload:()=>rg,unstable_useViewTransitionState:()=>rw,createBrowserRouter:()=>tq,isRouteErrorResponse:()=>Z,useLocation:()=>eG,useNavigationType:()=>eQ,useRevalidator:()=>tc});var n,a,o,i,l,s,u,c,d,h,f,p=r(2491),m=r(5427);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)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}(n=c||(c={})).Pop="POP",n.Push="PUSH",n.Replace="REPLACE";let y="popstate";function g(e){let t;void 0===e&&(e={});let{initialEntries:r=["/"],initialIndex:n,v5Compat:a=!1}=e;t=r.map((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let o=s(null==n?t.length-1:n),i=c.Pop,l=null;function s(e){return Math.min(Math.max(e,0),t.length-1)}function u(e,r,n){void 0===r&&(r=null);let a=R(t?t[o].pathname:"/",e,r,n);return S("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function d(e){return"string"==typeof e?e:C(e)}return{get index(){return o},get action(){return i},get location(){return t[o]},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?P(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){i=c.Push;let n=u(e,r);o+=1,t.splice(o,t.length,n),a&&l&&l({action:i,location:n,delta:1})},replace(e,r){i=c.Replace;let n=u(e,r);t[o]=n,a&&l&&l({action:i,location:n,delta:0})},go(e){i=c.Pop;let r=s(o+e),n=t[r];o=r,l&&l({action:i,location:n,delta:e})},listen:e=>(l=e,()=>{l=null})}}function b(e){return void 0===e&&(e={}),D(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return R("",{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:C(t)},null,e)}function w(e){return void 0===e&&(e={}),D(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=P(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),R("",{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:C(t))},function(e,t){S("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function E(e,t){if(!1===e||null==e)throw Error(t)}function S(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function x(e,t){return{usr:e.state,key:e.key,idx:t}}function R(e,t,r,n){return void 0===r&&(r=null),v({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?P(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function C(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 P(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 D(e,t,r,n){void 0===n&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l=c.Pop,s=null,u=d();function d(){return(i.state||{idx:null}).idx}function h(){l=c.Pop;let e=d(),t=null==e?null:e-u;u=e,s&&s({action:l,location:p.location,delta:t})}function f(e){let t="null"!==a.location.origin?a.location.origin:a.location.href,r="string"==typeof e?e:C(e);return E(t,"No window.location.(origin|href) available to create URL for href: "+(r=r.replace(/ $/,"%20"))),new URL(r,t)}null==u&&(u=0,i.replaceState(v({},i.state,{idx:u}),""));let p={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw Error("A history only accepts one active listener");return a.addEventListener(y,h),s=e,()=>{a.removeEventListener(y,h),s=null}},createHref:e=>t(a,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=c.Push;let n=R(p.location,e,t);r&&r(n,e);let h=x(n,u=d()+1),f=p.createHref(n);try{i.pushState(h,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(f)}o&&s&&s({action:l,location:p.location,delta:1})},replace:function(e,t){l=c.Replace;let n=R(p.location,e,t);r&&r(n,e);let a=x(n,u=d()),h=p.createHref(n);i.replaceState(a,"",h),o&&s&&s({action:l,location:p.location,delta:0})},go:e=>i.go(e)};return p}(a=d||(d={})).data="data",a.deferred="deferred",a.redirect="redirect",a.error="error";let L=new Set(["lazy","caseSensitive","path","id","index","children"]);function k(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(E(!0!==e.index||!e.children,"Cannot specify children on an index route"),E(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),!0===e.index){let r=v({},e,t(e),{id:i});return n[i]=r,r}{let r=v({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=k(e.children,t,o,n)),r}})}function _(e,t,r){void 0===r&&(r="/");let n=O(("string"==typeof t?P(t):t).pathname||"/",r);if(null==n)return null;let a=function e(t,r,n,a){void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===a&&(a="");let o=(t,o,i)=>{var l,s;let u,c,d={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:o,route:t};d.relativePath.startsWith("/")&&(E(d.relativePath.startsWith(a),'Absolute route path "'+d.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),d.relativePath=d.relativePath.slice(a.length));let h=H([a,d.relativePath]),f=n.concat(d);t.children&&t.children.length>0&&(E(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+h+'".'),e(t.children,r,f,h)),(null!=t.path||t.index)&&r.push({path:h,score:(l=h,s=t.index,c=(u=l.split("/")).length,u.some(A)&&(c+=-2),s&&(c+=2),u.filter(e=>!A(e)).reduce((e,t)=>e+(U.test(t)?3:""===t?1:10),c)),routesMeta:f})};return t.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))o(e,t,r);else o(e,t)}),r}(e);a.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)});let o=null;for(let e=0;null==o&&e<a.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return S(!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}}(n);o=function(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=M({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:H([a,u.pathname]),pathnameBase:W(H([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=H([a,u.pathnameBase]))}return o}(a[e],t)}return o}function T(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}}let U=/^:[\w-]+$/,A=e=>"*"===e;function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(S(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));let n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);let o=e.match(/^:([\w-]+)(\??)$/);if(o){let[,e,r]=o,n=t[e];return E("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function M(e,t){var r,n,a;let o,i;"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[l,s]=(r=e.path,n=e.caseSensitive,a=e.end,void 0===n&&(n=!1),void 0===a&&(a=!0),S("*"===r||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),o=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(o.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")),r.endsWith("*")?(o.push({paramName:"*"}),i+="*"===r||"/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==r&&"/"!==r&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),o]),u=t.match(l);if(!u)return null;let c=u[0],d=c.replace(/(.)\/+$/,"$1"),h=u.slice(1);return{params:s.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=h[r]||"";d=c.slice(0,c.length-e.length).replace(/(.)\/+$/,"$1")}let o=h[r];return a&&!o?e[n]=void 0:e[n]=(o||"").replace(/%2F/g,"/"),e},{}),pathname:c,pathnameBase:d,pattern:e}}function O(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 F(e,t){var r;let n;void 0===t&&(t="/");let{pathname:a,search:o="",hash:i=""}="string"==typeof e?P(e):e;return{pathname:a?a.startsWith("/")?a:(r=a,n=t.replace(/\/+$/,"").split("/"),r.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"):t,search:$(o),hash:J(i)}}function N(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 B(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function I(e,t){let r=B(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function z(e,t,r,n){let a,o;void 0===n&&(n=!1),"string"==typeof e?a=P(e):(E(!(a=v({},e)).pathname||!a.pathname.includes("?"),N("?","pathname","search",a)),E(!a.pathname||!a.pathname.includes("#"),N("#","pathname","hash",a)),E(!a.search||!a.search.includes("#"),N("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":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 s=F(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}let H=e=>e.join("/").replace(/\/\/+/g,"/"),W=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",J=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",K=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),v({},r,{headers:n}))};class V extends Error{}class q{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],E(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 V("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 V)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=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 E(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]:function(e){if(!(e instanceof Promise&&!0===e._tracked))return e;if(e._error)throw e._error;return e._data}(n)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}let Y=function(e,t){return void 0===t&&(t={}),new q(e,"number"==typeof t?{status:t}:t)},X=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,v({},r,{headers:n}))},G=(e,t)=>{let r=X(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Q{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 Z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}let ee=["post","put","patch","delete"],et=new Set(ee),er=new Set(["get",...ee]),en=new Set([301,302,303,307,308]),ea=new Set([307,308]),eo={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ei={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},el={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},es=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eu=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ec="remix-router-transitions";function ed(e){let t,r,n,a,o,i=e.window?e.window:"u">typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement,s=!l;if(E(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){let r=e.detectErrorBoundary;t=e=>({hasErrorBoundary:r(e)})}else t=eu;let u={},h=k(e.routes,t,void 0,u),f=e.basename||"/",p=v({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,y=new Set,g=null,b=null,w=null,x=null!=e.hydrationData,C=_(h,e.history.location,f),P=null;if(null==C){let t=eP(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=eC(h);C=r,P={[n.id]:t}}let D=C.some(e=>e.route.lazy),L=C.some(e=>e.route.loader);if(D)n=!1;else if(L)if(p.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;n=C.every(e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]))}else n=null!=e.hydrationData;else n=!0;let U={historyAction:e.history.action,location:e.history.location,matches:C,initialized:n,navigation:eo,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||P,fetchers:new Map,blockers:new Map},A=c.Pop,j=!1,M=!1,F=new Map,N=null,B=!1,I=!1,z=[],H=[],W=new Map,$=0,J=-1,K=new Map,V=new Set,q=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),U=v({},U,e);let r=[],n=[];p.v7_fetcherPersist&&U.fetchers.forEach((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))}),[...y].forEach(e=>e(U,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync})),p.v7_fetcherPersist&&(r.forEach(e=>U.fetchers.delete(e)),n.forEach(e=>eW(e)))}function et(t,n,a){var o,i;let l,s,{flushSync:u}=void 0===a?{}:a,d=null!=U.actionData&&null!=U.navigation.formMethod&&eU(U.navigation.formMethod)&&"loading"===U.navigation.state&&(null==(o=t.state)?void 0:o._isRedirect)!==!0;l=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?U.actionData:null;let f=n.loaderData?ex(U.loaderData,n.loaderData,n.matches||[],n.errors):U.loaderData,p=U.blockers;p.size>0&&(p=new Map(p)).forEach((e,t)=>p.set(t,el));let m=!0===j||null!=U.navigation.formMethod&&eU(U.navigation.formMethod)&&(null==(i=t.state)?void 0:i._isRedirect)!==!0;if(r&&(h=r,r=void 0),B||A===c.Pop||(A===c.Push?e.history.push(t,t.state):A===c.Replace&&e.history.replace(t,t.state)),A===c.Pop){let e=F.get(U.location.pathname);e&&e.has(t.pathname)?s={currentLocation:U.location,nextLocation:t}:F.has(t.pathname)&&(s={currentLocation:t,nextLocation:U.location})}else if(M){let e=F.get(U.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(U.location.pathname,e)),s={currentLocation:U.location,nextLocation:t}}ee(v({},n,{actionData:l,loaderData:f,historyAction:A,location:t,initialized:!0,navigation:eo,revalidation:"idle",restoreScrollPosition:eZ(t,n.matches||U.matches),preventScrollReset:m,blockers:p}),{viewTransitionOpts:s,flushSync:!0===u}),A=c.Pop,j=!1,M=!1,B=!1,I=!1,z=[],H=[]}async function er(t,r){if("number"==typeof t)return void e.history.go(t);let n=eh(U.location,U.matches,f,p.v7_prependBasename,t,p.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:a,submission:o,error:i}=ef(p.v7_normalizeFormMethod,!1,n,r),l=U.location,s=R(U.location,a,r&&r.state);s=v({},s,e.history.encodeLocation(s));let u=r&&null!=r.replace?r.replace:void 0,d=c.Push;!0===u?d=c.Replace:!1===u||null!=o&&eU(o.formMethod)&&o.formAction===U.location.pathname+U.location.search&&(d=c.Replace);let h=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.unstable_flushSync),y=eX({currentLocation:l,nextLocation:s,historyAction:d});return y?void eY(y,{state:"blocked",location:s,proceed(){eY(y,{state:"proceeding",proceed:void 0,reset:void 0,location:s}),er(t,r)},reset(){let e=new Map(U.blockers);e.set(y,el),ee({blockers:e})}}):await en(d,s,{submission:o,pendingError:i,preventScrollReset:h,replace:r&&r.replace,enableViewTransition:r&&r.unstable_viewTransition,flushSync:m})}async function en(t,n,a){var i,l,s,u;let c,d;o&&o.abort(),o=null,A=t,B=!0===(a&&a.startUninterruptedRevalidation),i=U.location,l=U.matches,g&&w&&(g[eQ(i,l)]=w()),j=!0===(a&&a.preventScrollReset),M=!0===(a&&a.enableViewTransition);let p=r||h,m=a&&a.overrideNavigation,y=_(p,n,f),b=!0===(a&&a.flushSync);if(!y){let e=eP(404,{pathname:n.pathname}),{matches:t,route:r}=eC(p);eG(),et(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:b});return}if(U.initialized&&!I&&(s=U.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash||!1))&&!(a&&a.submission&&eU(a.submission.formMethod)))return void et(n,{matches:y},{flushSync:b});o=new AbortController;let E=eb(e.history,n,o.signal,a&&a.submission);if(a&&a.pendingError)d={[eR(y).route.id]:a.pendingError};else if(a&&a.submission&&eU(a.submission.formMethod)){let e=await ed(E,n,a.submission,y,{replace:a.replace,flushSync:b});if(e.shortCircuited)return;c=e.pendingActionData,d=e.pendingActionError,m=eN(n,a.submission),b=!1,E=new Request(E.url,{signal:E.signal})}let{shortCircuited:S,loaderData:x,errors:R}=await em(E,n,y,m,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,b,c,d);S||(o=null,et(n,v({matches:y},c?{actionData:c}:{},{loaderData:x,errors:R})))}async function ed(e,r,n,a,o){var i;let l;void 0===o&&(o={}),eL(),ee({navigation:{state:"submitting",location:r,formMethod:(i=n).formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}},{flushSync:!0===o.flushSync});let s=eO(a,r);if(s.route.action||s.route.lazy){if(l=await eg("action",e,s,a,u,t,f,p.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:d.error,error:eP(405,{method:e.method,pathname:r.pathname,routeId:s.route.id})};if(eT(l)){let e;return e=o&&null!=o.replace?o.replace:l.location===U.location.pathname+U.location.search,await ew(U,l,{submission:n,replace:e}),{shortCircuited:!0}}if(e_(l)){let e=eR(a,s.route.id);return!0!==(o&&o.replace)&&(A=c.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(ek(l))throw eP(400,{type:"defer-action"});return{pendingActionData:{[s.route.id]:l.data}}}async function em(t,n,a,i,l,s,u,c,d,m,y){let g=i||eN(n,l),b=l||s||eF(g),w=r||h,[E,S]=ep(e.history,U,a,b,n,p.v7_partialHydration&&!0===c,I,z,H,X,q,V,w,f,m,y);if(eG(e=>!(a&&a.some(t=>t.route.id===e))||E&&E.some(t=>t.route.id===e)),J=++$,0===E.length&&0===S.length){let e=eK();return et(n,v({matches:a,loaderData:{},errors:y||null},m?{actionData:m}:{},e?{fetchers:new Map(U.fetchers)}:{}),{flushSync:d}),{shortCircuited:!0}}if(!B&&(!p.v7_partialHydration||!c)){S.forEach(e=>{let t=U.fetchers.get(e.key),r=eB(void 0,t?t.data:void 0);U.fetchers.set(e.key,r)});let e=m||U.actionData;ee(v({navigation:g},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},S.length>0?{fetchers:new Map(U.fetchers)}:{}),{flushSync:d})}S.forEach(e=>{W.has(e.key)&&e$(e.key),e.controller&&W.set(e.key,e.controller)});let x=()=>S.forEach(e=>e$(e.key));o&&o.signal.addEventListener("abort",x);let{results:R,loaderResults:C,fetcherResults:P}=await eE(U.matches,a,E,S,t);if(t.signal.aborted)return{shortCircuited:!0};o&&o.signal.removeEventListener("abort",x),S.forEach(e=>W.delete(e.key));let D=eD(R);if(D){if(D.idx>=E.length){let e=S[D.idx-E.length].key;V.add(e)}return await ew(U,D.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:k}=eS(U,a,E,C,y,S,P,G);G.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&G.delete(t)})}),p.v7_partialHydration&&c&&U.errors&&Object.entries(U.errors).filter(e=>{let[t]=e;return!E.some(e=>e.route.id===t)}).forEach(e=>{let[t,r]=e;k=Object.assign(k||{},{[t]:r})});let _=eK(),T=eV(J),A=_||T||S.length>0;return v({loaderData:L,errors:k},A?{fetchers:new Map(U.fetchers)}:{})}async function ev(n,a,i,l,s,c,d){var m,v;if(eL(),q.delete(n),!l.route.action&&!l.route.lazy){let e=eP(405,{method:d.formMethod,pathname:i,routeId:a});ez(n,a,e,{flushSync:c});return}let y=U.fetchers.get(n);eM(n,(m=d,v=y,{state:"submitting",formMethod:m.formMethod,formAction:m.formAction,formEncType:m.formEncType,formData:m.formData,json:m.json,text:m.text,data:v?v.data:void 0}),{flushSync:c});let g=new AbortController,b=eb(e.history,i,g.signal,d);W.set(n,g);let w=$,S=await eg("action",b,l,s,u,t,f,p.v7_relativeSplatPath);if(b.signal.aborted){W.get(n)===g&&W.delete(n);return}if(p.v7_fetcherPersist&&X.has(n)){if(eT(S)||e_(S))return void eM(n,eI(void 0))}else{if(eT(S))return(W.delete(n),J>w)?void eM(n,eI(void 0)):(V.add(n),eM(n,eB(d)),ew(U,S,{fetcherSubmission:d}));if(e_(S))return void ez(n,a,S.error)}if(ek(S))throw eP(400,{type:"defer-action"});let x=U.navigation.location||U.location,R=eb(e.history,x,g.signal),C=r||h,P="idle"!==U.navigation.state?_(C,U.navigation.location,f):U.matches;E(P,"Didn't find any matches after fetcher action");let D=++$;K.set(n,D);let L=eB(d,S.data);U.fetchers.set(n,L);let[k,T]=ep(e.history,U,P,d,x,!1,I,z,H,X,q,V,C,f,{[l.route.id]:S.data},void 0);T.filter(e=>e.key!==n).forEach(e=>{let t=e.key,r=U.fetchers.get(t),n=eB(void 0,r?r.data:void 0);U.fetchers.set(t,n),W.has(t)&&e$(t),e.controller&&W.set(t,e.controller)}),ee({fetchers:new Map(U.fetchers)});let j=()=>T.forEach(e=>e$(e.key));g.signal.addEventListener("abort",j);let{results:M,loaderResults:O,fetcherResults:F}=await eE(U.matches,P,k,T,R);if(g.signal.aborted)return;g.signal.removeEventListener("abort",j),K.delete(n),W.delete(n),T.forEach(e=>W.delete(e.key));let N=eD(M);if(N){if(N.idx>=k.length){let e=T[N.idx-k.length].key;V.add(e)}return ew(U,N.result)}let{loaderData:B,errors:Y}=eS(U,U.matches,k,O,void 0,T,F,G);if(U.fetchers.has(n)){let e=eI(S.data);U.fetchers.set(n,e)}eV(D),"loading"===U.navigation.state&&D>J?(E(A,"Expected pending action"),o&&o.abort(),et(U.navigation.location,{matches:P,loaderData:B,errors:Y,fetchers:new Map(U.fetchers)})):(ee({errors:Y,loaderData:ex(U.loaderData,B,P,Y),fetchers:new Map(U.fetchers)}),I=!1)}async function ey(r,n,a,o,i,l,s){let c=U.fetchers.get(r);eM(r,eB(s,c?c.data:void 0),{flushSync:l});let d=new AbortController,h=eb(e.history,a,d.signal);W.set(r,d);let m=$,v=await eg("loader",h,o,i,u,t,f,p.v7_relativeSplatPath);if(ek(v)&&(v=await ej(v,h.signal,!0)||v),W.get(r)===d&&W.delete(r),!h.signal.aborted){if(X.has(r))return void eM(r,eI(void 0));if(eT(v))if(J>m)return void eM(r,eI(void 0));else{V.add(r),await ew(U,v);return}if(e_(v))return void ez(r,n,v.error);E(!ek(v),"Unhandled fetcher deferred data"),eM(r,eI(v.data))}}async function ew(t,r,n){let{submission:a,fetcherSubmission:s,replace:u}=void 0===n?{}:n;r.revalidate&&(I=!0);let d=R(t.location,r.location,{_isRedirect:!0});if(E(d,"Expected a location on the redirect navigation"),l){let t=!1;if(r.reloadDocument)t=!0;else if(es.test(r.location)){let n=e.history.createURL(r.location);t=n.origin!==i.location.origin||null==O(n.pathname,f)}if(t)return void(u?i.location.replace(r.location):i.location.assign(r.location))}o=null;let h=!0===u?c.Replace:c.Push,{formMethod:p,formAction:m,formEncType:y}=t.navigation;!a&&!s&&p&&m&&y&&(a=eF(t.navigation));let g=a||s;if(ea.has(r.status)&&g&&eU(g.formMethod))await en(h,d,{submission:v({},g,{formAction:r.location}),preventScrollReset:j});else{let e=eN(d,a);await en(h,d,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:j})}}async function eE(r,n,a,o,i){let l=await Promise.all([...a.map(e=>eg("loader",i,e,n,u,t,f,p.v7_relativeSplatPath)),...o.map(r=>r.matches&&r.match&&r.controller?eg("loader",eb(e.history,r.path,r.controller.signal),r.match,r.matches,u,t,f,p.v7_relativeSplatPath):{type:d.error,error:eP(404,{pathname:r.path})})]),s=l.slice(0,a.length),c=l.slice(a.length);return await Promise.all([eA(r,a,s,s.map(()=>i.signal),!1,U.loaderData),eA(r,o.map(e=>e.match),c,o.map(e=>e.controller?e.controller.signal:null),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function eL(){I=!0,z.push(...eG()),q.forEach((e,t)=>{W.has(t)&&(H.push(t),e$(t))})}function eM(e,t,r){void 0===r&&(r={}),U.fetchers.set(e,t),ee({fetchers:new Map(U.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ez(e,t,r,n){void 0===n&&(n={});let a=eR(U.matches,t);eW(e),ee({errors:{[a.route.id]:r},fetchers:new Map(U.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eH(e){return p.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),U.fetchers.get(e)||ei}function eW(e){let t=U.fetchers.get(e);W.has(e)&&!(t&&"loading"===t.state&&K.has(e))&&e$(e),q.delete(e),K.delete(e),V.delete(e),X.delete(e),U.fetchers.delete(e)}function e$(e){let t=W.get(e);E(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function eJ(e){for(let t of e){let e=eI(eH(t).data);U.fetchers.set(t,e)}}function eK(){let e=[],t=!1;for(let r of V){let n=U.fetchers.get(r);E(n,"Expected fetcher: "+r),"loading"===n.state&&(V.delete(r),e.push(r),t=!0)}return eJ(e),t}function eV(e){let t=[];for(let[r,n]of K)if(n<e){let e=U.fetchers.get(r);E(e,"Expected fetcher: "+r),"loading"===e.state&&(e$(r),K.delete(r),t.push(r))}return eJ(t),t.length>0}function eq(e){U.blockers.delete(e),Q.delete(e)}function eY(e,t){let r=U.blockers.get(e)||el;E("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(U.blockers);n.set(e,t),ee({blockers:n})}function eX(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&S(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=U.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:t,nextLocation:r,historyAction:n}))return o}function eG(e){let t=[];return G.forEach((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),G.delete(n))}),t}function eQ(e,t){return b&&b(e,t.map(e=>T(e,U.loaderData)))||e.key}function eZ(e,t){if(g){let r=g[eQ(e,t)];if("number"==typeof r)return r}return null}return a={get basename(){return f},get future(){return p},get state(){return U},get routes(){return h},get window(){return i},initialize:function(){if(m=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(Z){Z=!1;return}S(0===Q.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=eX({currentLocation:U.location,nextLocation:n,historyAction:r});if(o&&null!=a){Z=!0,e.history.go(-1*a),eY(o,{state:"blocked",location:n,proceed(){eY(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(U.blockers);e.set(o,el),ee({blockers:e})}});return}return en(r,n)}),l){var t=i,r=F;try{let e=t.sessionStorage.getItem(ec);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch(e){}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(ec,JSON.stringify(r))}catch(e){S(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}})(i,F);i.addEventListener("pagehide",e),N=()=>i.removeEventListener("pagehide",e)}return U.initialized||en(c.Pop,U.location,{initialHydration:!0}),a},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,w=t,b=r||null,!x&&U.navigation===eo){x=!0;let e=eZ(U.location,U.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{g=null,w=null,b=null}},navigate:er,fetch:function(e,t,n,a){if(s)throw 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.");W.has(e)&&e$(e);let o=!0===(a&&a.unstable_flushSync),i=r||h,l=eh(U.location,U.matches,f,p.v7_prependBasename,n,p.v7_relativeSplatPath,t,null==a?void 0:a.relative),u=_(i,l,f);if(!u)return void ez(e,t,eP(404,{pathname:l}),{flushSync:o});let{path:c,submission:d,error:m}=ef(p.v7_normalizeFormMethod,!0,l,a);if(m)return void ez(e,t,m,{flushSync:o});let v=eO(u,c);(j=!0===(a&&a.preventScrollReset),d&&eU(d.formMethod))?ev(e,t,c,v,u,o,d):(q.set(e,{routeId:t,path:c}),ey(e,t,c,v,u,o,d))},revalidate:function(){if(eL(),ee({revalidation:"loading"}),"submitting"!==U.navigation.state){if("idle"===U.navigation.state)return void en(U.historyAction,U.location,{startUninterruptedRevalidation:!0});en(A||U.historyAction,U.navigation.location,{overrideNavigation:U.navigation})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eH,deleteFetcher:function(e){if(p.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else eW(e);ee({fetchers:new Map(U.fetchers)})},dispose:function(){m&&m(),N&&N(),y.clear(),o&&o.abort(),U.fetchers.forEach((e,t)=>eW(t)),U.blockers.forEach((e,t)=>eq(t))},getBlocker:function(e,t){let r=U.blockers.get(e)||el;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:eq,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){r=k(e,t,void 0,u={})}}}function eh(e,t,r,n,a,o,i,l){let s,u;if(i){for(let e of(s=[],t))if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=z(a||".",I(s,o),O(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u&&u.route.index&&!eM(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:H([r,c.pathname])),C(c)}function ef(e,t,r,n){var a;let o,i;if(!n||!(null!=n&&("formData"in n&&null!=n.formData||"body"in n&&void 0!==n.body)))return{path:r};if(n.formMethod&&(a=n.formMethod,!er.has(a.toLowerCase())))return{path:r,error:eP(405,{method:n.formMethod})};let l=()=>({path:r,error:eP(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=eL(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!eU(u))return l();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}}}else if("application/json"===n.formEncType){if(!eU(u))return l();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 l()}}}if(E("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=ew(n.formData),i=n.formData;else if(n.body instanceof FormData)o=ew(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=eE(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=eE(o)}catch(e){return l()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(eU(d.formMethod))return{path:r,submission:d};let h=P(r);return t&&h.search&&eM(h.search)&&o.append("index",""),h.search="?"+o,{path:C(h),submission:d}}function ep(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m){let y=m?Object.values(m)[0]:p?Object.values(p)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),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,m?Object.keys(m)[0]:void 0).filter((e,r)=>{var a,s,u;let c,d,{route:h}=e;if(h.lazy)return!0;if(null==h.loader)return!1;if(o)return!!h.loader.hydrate||void 0===t.loaderData[h.id]&&(!t.errors||void 0===t.errors[h.id]);if(a=t.loaderData,s=t.matches[r],u=e,c=!s||u.route.id!==s.route.id,d=void 0===a[u.route.id],c||d||l.some(t=>t===e.route.id))return!0;let f=t.matches[r];return ev(e,v({currentUrl:g,currentParams:f.params,nextUrl:b,nextParams:e.params},n,{actionResult:y,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||em(f,e)}))}),E=[];return c.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||u.has(a))return;let l=_(h,e.path,f);if(!l)return void E.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=t.fetchers.get(a),p=eO(l,e.path);!d.has(a)&&(s.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:ev(p,v({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i}))))&&E.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:p,controller:new AbortController})}),[w,E]}function em(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ev(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ey(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];E(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;S(!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||L.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,v({},t(a),{lazy:void 0}))}async function eg(e,t,r,n,a,o,i,l,s){var u,c,h,f;let p,m,v;void 0===s&&(s={});let y=e=>{let n,a=new Promise((e,t)=>n=t);return v=()=>n(),t.signal.addEventListener("abort",v),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([y(n).catch(t=>{e=t}),ey(r.route,o,a)]);if(e)throw e;m=t[0]}else if(await ey(r.route,o,a),n=r.route[e])m=await y(n);else{if("action"!==e)return{type:d.data,data:void 0};let n=new URL(t.url),a=n.pathname+n.search;throw eP(405,{method:t.method,pathname:a,routeId:r.route.id})}else if(n)m=await y(n);else{let e=new URL(t.url),r=e.pathname+e.search;throw eP(404,{pathname:r})}E(void 0!==m,"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){p=d.error,m=e}finally{v&&t.signal.removeEventListener("abort",v)}if(null!=(u=m)&&"number"==typeof u.status&&"string"==typeof u.statusText&&"object"==typeof u.headers&&void 0!==u.body){let e,a=m.status;if(en.has(a)){let e=m.headers.get("Location");if(E(e,"Redirects returned/thrown from loaders/actions must have a Location header"),es.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=new URL(e.startsWith("//")?r.protocol+e:e),a=null!=O(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=eh(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw m.headers.set("Location",e),m;return{type:d.redirect,status:a,location:e,revalidate:null!==m.headers.get("X-Remix-Revalidate"),reloadDocument:null!==m.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:p===d.error?d.error:d.data,response:m};try{let t=m.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==m.body?null:await m.json():await m.text()}catch(e){return{type:d.error,error:e}}return p===d.error?{type:p,error:new Q(a,m.statusText,e),headers:m.headers}:{type:d.data,data:e,statusCode:m.status,headers:m.headers}}if(p===d.error)return{type:p,error:m};if((c=m)&&"object"==typeof c&&"object"==typeof c.data&&"function"==typeof c.subscribe&&"function"==typeof c.cancel&&"function"==typeof c.resolveData){return{type:d.deferred,deferredData:m,statusCode:null==(h=m.init)?void 0:h.status,headers:(null==(f=m.init)?void 0:f.headers)&&new Headers(m.init.headers)}}return{type:d.data,data:m}}function eb(e,t,r,n){let a=e.createURL(eL(t)).toString(),o={signal:r};if(n&&eU(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=ew(n.formData):o.body=n.formData}return new Request(a,o)}function ew(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eE(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eS(e,t,r,n,a,o,i,l){var s;let u,c,d,h,f,{loaderData:p,errors:m}=(s=a,c={},d=null,h=!1,f={},n.forEach((e,n)=>{let a=r[n].route.id;if(E(!eT(e),"Cannot handle redirect results in processLoaderData"),e_(e)){let r=eR(t,a),n=e.error;s&&(n=Object.values(s)[0],s=void 0),null==(d=d||{})[r.route.id]&&(d[r.route.id]=n),c[a]=void 0,h||(h=!0,u=Z(e.error)?e.error.status:500),e.headers&&(f[a]=e.headers)}else ek(e)?(l.set(a,e.deferredData),c[a]=e.deferredData.data):c[a]=e.data,null==e.statusCode||200===e.statusCode||h||(u=e.statusCode),e.headers&&(f[a]=e.headers)}),s&&(d=s,c[Object.keys(s)[0]]=void 0),{loaderData:c,errors:d,statusCode:u||200,loaderHeaders:f});for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];E(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let l=i[t];if(!a||!a.signal.aborted)if(e_(l)){let t=eR(e.matches,null==n?void 0:n.route.id);m&&m[t.route.id]||(m=v({},m,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(eT(l))E(!1,"Unhandled fetcher revalidation redirect");else if(ek(l))E(!1,"Unhandled fetcher deferred data");else{let t=eI(l.data);e.fetchers.set(r,t)}}return{loaderData:p,errors:m}}function ex(e,t,r,n){let a=v({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eR(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function eC(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 eP(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",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?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="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 Q(e||500,i,Error(l),!0)}function eD(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(eT(r))return{result:r,idx:t}}}function eL(e){let t="string"==typeof e?P(e):e;return C(v({},t,{hash:""}))}function ek(e){return e.type===d.deferred}function e_(e){return e.type===d.error}function eT(e){return(e&&e.type)===d.redirect}function eU(e){return et.has(e.toLowerCase())}async function eA(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find(e=>e.route.id===s.route.id),c=null!=u&&!em(u,s)&&(o&&o[s.route.id])!==void 0;if(ek(l)&&(a||c)){let e=n[i];E(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await ej(l,e,a).then(e=>{e&&(r[i]=e||r[i])})}}}async function ej(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:d.data,data:e.deferredData.unwrappedData}}catch(e){return{type:d.error,error:e}}return{type:d.data,data:e.deferredData.data}}}function eM(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eO(e,t){let r="string"==typeof t?P(t).search:t.search;if(e[e.length-1].route.index&&eM(r||""))return e[e.length-1];let n=B(e);return n[n.length-1]}function eF(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eN(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 eB(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 eI(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 ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}Symbol("deferred");let eH=p.createContext(null),eW=p.createContext(null),e$=p.createContext(null),eJ=p.createContext(null),eK=p.createContext(null),eV=p.createContext({outlet:null,matches:[],isDataRoute:!1}),eq=p.createContext(null);function eY(e,t){let{relative:r}=void 0===t?{}:t;eX()||E(!1);let{basename:n,navigator:a}=p.useContext(eJ),{hash:o,pathname:i,search:l}=e5(e,{relative:r}),s=i;return"/"!==n&&(s="/"===i?n:H([n,i])),a.createHref({pathname:s,search:l,hash:o})}function eX(){return null!=p.useContext(eK)}function eG(){return eX()||E(!1),p.useContext(eK).location}function eQ(){return p.useContext(eK).navigationType}function eZ(e){eX()||E(!1);let{pathname:t}=eG();return p.useMemo(()=>M(e,t),[t,e])}function e0(e){p.useContext(eJ).static||p.useLayoutEffect(e)}function e1(){let{isDataRoute:e}=p.useContext(eV);return e?function(){let{router:e}=to(tn.UseNavigateStable),t=tl(ta.UseNavigateStable),r=p.useRef(!1);return e0(()=>{r.current=!0}),p.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,ez({fromRouteId:t},a)))},[e,t])}():function(){eX()||E(!1);let e=p.useContext(eH),{basename:t,future:r,navigator:n}=p.useContext(eJ),{matches:a}=p.useContext(eV),{pathname:o}=eG(),i=JSON.stringify(I(a,r.v7_relativeSplatPath)),l=p.useRef(!1);return e0(()=>{l.current=!0}),p.useCallback(function(r,a){if(void 0===a&&(a={}),!l.current)return;if("number"==typeof r)return void n.go(r);let s=z(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:H([t,s.pathname])),(a.replace?n.replace:n.push)(s,a.state,a)},[t,n,i,o,e])}()}let e7=p.createContext(null);function e4(){return p.useContext(e7)}function e2(e){let t=p.useContext(eV).outlet;return t?p.createElement(e7.Provider,{value:e},t):t}function e3(){let{matches:e}=p.useContext(eV),t=e[e.length-1];return t?t.params:{}}function e5(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=p.useContext(eJ),{matches:a}=p.useContext(eV),{pathname:o}=eG(),i=JSON.stringify(I(a,n.v7_relativeSplatPath));return p.useMemo(()=>z(e,JSON.parse(i),o,"path"===r),[e,i,o,r])}function e9(e,t){return e8(e,t)}function e8(e,t,r,n){let a;eX()||E(!1);let{navigator:o}=p.useContext(eJ),{matches:i}=p.useContext(eV),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let d=eG();if(t){var h;let e="string"==typeof t?P(t):t;"/"===u||(null==(h=e.pathname)?void 0:h.startsWith(u))||E(!1),a=e}else a=d;let f=a.pathname||"/",m=f;if("/"!==u){let e=u.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=_(e,{pathname:m}),y=tr(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:H([u,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:H([u,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,r,n);return t&&y?p.createElement(eK.Provider,{value:{location:ez({pathname:"/",search:"",hash:"",state:null,key:"default"},a),navigationType:c.Pop}},y):y}let e6=p.createElement(function(){let e=tm(),t=Z(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)},null);class te extends p.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){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?p.createElement(eV.Provider,{value:this.props.routeContext},p.createElement(eq.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tt(e){let{routeContext:t,match:r,children:n}=e,a=p.useContext(eH);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(eV.Provider,{value:t},n)}function tr(e,t,r,n){var a,o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){if(null==(o=r)||!o.errors)return null;e=r.matches}let i=e,l=null==(a=r)?void 0:a.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&(null==l?void 0:l[e.route.id]));e>=0||E(!1),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){s=!0,i=u>=0?i.slice(0,u+1):[i[0]];break}}}return i.reduceRight((e,n,a)=>{var o;let c,d=!1,h=null,f=null;r&&(c=l&&n.route.id?l[n.route.id]:void 0,h=n.route.errorElement||e6,s&&(u<0&&0===a?(o="route-fallback",tw[o]||(tw[o]=!0),d=!0,f=null):u===a&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,a+1)),v=()=>{let t;return t=c?h:d?f:n.route.Component?p.createElement(n.route.Component,null):n.route.element?n.route.element:e,p.createElement(tt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?p.createElement(te,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var tn=((o=tn||{}).UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o),ta=((i=ta||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);function to(e){let t=p.useContext(eH);return t||E(!1),t}function ti(e){let t=p.useContext(eW);return t||E(!1),t}function tl(e){let t,r=((t=p.useContext(eV))||E(!1),t),n=r.matches[r.matches.length-1];return n.route.id||E(!1),n.route.id}function ts(){return tl(ta.UseRouteId)}function tu(){return ti(ta.UseNavigation).navigation}function tc(){let e=to(tn.UseRevalidator),t=ti(ta.UseRevalidator);return p.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function td(){let{matches:e,loaderData:t}=ti(ta.UseMatches);return p.useMemo(()=>e.map(e=>T(e,t)),[e,t])}function th(){let e=ti(ta.UseLoaderData),t=tl(ta.UseLoaderData);return e.errors&&null!=e.errors[t]?void console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")"):e.loaderData[t]}function tf(e){return ti(ta.UseRouteLoaderData).loaderData[e]}function tp(){let e=ti(ta.UseActionData),t=tl(ta.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function tm(){var e;let t=p.useContext(eq),r=ti(ta.UseRouteError),n=tl(ta.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function tv(){let e=p.useContext(e$);return null==e?void 0:e._data}function ty(){let e=p.useContext(e$);return null==e?void 0:e._error}let tg=0;function tb(e){let{router:t,basename:r}=to(tn.UseBlocker),n=ti(ta.UseBlocker),[a,o]=p.useState(""),i=p.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:ez({},n,{pathname:O(n.pathname,r)||n.pathname}),nextLocation:ez({},a,{pathname:O(a.pathname,r)||a.pathname}),historyAction:o})},[r,e]);return p.useEffect(()=>{let e=String(++tg);return o(e),()=>t.deleteBlocker(e)},[t]),p.useEffect(()=>{""!==a&&t.getBlocker(a,i)},[t,a,i]),a&&n.blockers.has(a)?n.blockers.get(a):el}let tw={},tE=p.startTransition;function tS(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:o}=e,i=p.useRef();null==i.current&&(i.current=g({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=i.current,[s,u]=p.useState({action:l.action,location:l.location}),{v7_startTransition:c}=o||{},d=p.useCallback(e=>{c&&tE?tE(()=>u(e)):u(e)},[u,c]);return p.useLayoutEffect(()=>l.listen(d),[l,d]),p.createElement(tP,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}function tx(e){let{to:t,replace:r,state:n,relative:a}=e;eX()||E(!1);let{future:o,static:i}=p.useContext(eJ),{matches:l}=p.useContext(eV),{pathname:s}=eG(),u=e1(),c=JSON.stringify(z(t,I(l,o.v7_relativeSplatPath),s,"path"===a));return p.useEffect(()=>u(JSON.parse(c),{replace:r,state:n,relative:a}),[u,c,a,r,n]),null}function tR(e){return e2(e.context)}function tC(e){E(!1)}function tP(e){let{basename:t="/",children:r=null,location:n,navigationType:a=c.Pop,navigator:o,static:i=!1,future:l}=e;eX()&&E(!1);let s=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:s,navigator:o,static:i,future:ez({v7_relativeSplatPath:!1},l)}),[s,l,o,i]);"string"==typeof n&&(n=P(n));let{pathname:d="/",search:h="",hash:f="",state:m=null,key:v="default"}=n,y=p.useMemo(()=>{let e=O(d,s);return null==e?null:{location:{pathname:e,search:h,hash:f,state:m,key:v},navigationType:a}},[s,d,h,f,m,v,a]);return null==y?null:p.createElement(eJ.Provider,{value:u},p.createElement(eK.Provider,{children:r,value:y}))}function tD(e){let{children:t,location:r}=e;return e8(tA(t),r)}function tL(e){let{children:t,errorElement:r,resolve:n}=e;return p.createElement(tT,{resolve:n,errorElement:r},p.createElement(tU,null,t))}var tk=((l=tk||{})[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l);let t_=new Promise(()=>{});class tT extends p.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,a=tk.pending;if(r instanceof Promise)if(this.state.error){a=tk.error;let e=this.state.error;Object.defineProperty(n=Promise.reject().catch(()=>{}),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?a=void 0!==(n=r)._error?tk.error:void 0!==n._data?tk.success:tk.pending:(a=tk.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 a=tk.success,Object.defineProperty(n=Promise.resolve(),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(a===tk.error&&n._error instanceof V)throw t_;if(a===tk.error&&!t)throw n._error;if(a===tk.error)return p.createElement(e$.Provider,{value:n,children:t});if(a===tk.success)return p.createElement(e$.Provider,{value:n,children:e});throw n}}function tU(e){let{children:t}=e,r=tv(),n="function"==typeof t?t(r):t;return p.createElement(p.Fragment,null,n)}function tA(e,t){void 0===t&&(t=[]);let r=[];return p.Children.forEach(e,(e,n)=>{if(!p.isValidElement(e))return;let a=[...t,n];if(e.type===p.Fragment)return void r.push.apply(r,tA(e.props.children,a));e.type!==tC&&E(!1),e.props.index&&e.props.children&&E(!1);let o={id:e.props.id||a.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&&(o.children=tA(e.props.children,a)),r.push(o)}),r}function tj(e){return tr(e)}function tM(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function tO(e,t){return ed({basename:null==t?void 0:t.basename,future:ez({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:g({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:tM}).initialize()}function tF(){return(tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function tN(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}let tB="application/x-www-form-urlencoded";function tI(e){return null!=e&&"string"==typeof e.tagName}function tz(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 tH=null,tW=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function t$(e){return null==e||tW.has(e)?e:null}let tJ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],tK=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],tV=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function tq(e,t){return ed({basename:null==t?void 0:t.basename,future:tF({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:b({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tX(),routes:e,mapRouteProperties:tM,window:null==t?void 0:t.window}).initialize()}function tY(e,t){return ed({basename:null==t?void 0:t.basename,future:tF({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:w({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tX(),routes:e,mapRouteProperties:tM,window:null==t?void 0:t.window}).initialize()}function tX(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=tF({},t,{errors:function(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 Q(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=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(t.errors)})),t}let tG=p.createContext({isTransitioning:!1}),tQ=p.createContext(new Map),tZ=p.startTransition,t0=m.flushSync,t1=p.useId;function t7(e){t0?t0(e):e()}class t4{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 t2(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=p.useState(r.state),[i,l]=p.useState(),[s,u]=p.useState({isTransitioning:!1}),[c,d]=p.useState(),[h,f]=p.useState(),[m,v]=p.useState(),y=p.useRef(new Map),{v7_startTransition:g}=n||{},b=p.useCallback(e=>{if(g)tZ?tZ(e):e();else e()},[g]),w=p.useCallback((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:i}=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||"function"!=typeof r.window.document.startViewTransition;if(!i||s)return void(a?t7(()=>o(e)):b(()=>o(e)));if(a){t7(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})});let t=r.window.document.startViewTransition(()=>{t7(()=>o(e))});t.finished.finally(()=>{t7(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})}),t7(()=>f(t));return}h?(c&&c.resolve(),h.skipTransition(),v({state:e,currentLocation:i.currentLocation,nextLocation:i.nextLocation})):(l(e),u({isTransitioning:!0,flushSync:!1,currentLocation:i.currentLocation,nextLocation:i.nextLocation}))},[r.window,h,c,y,b]);p.useLayoutEffect(()=>r.subscribe(w),[r,w]),p.useEffect(()=>{s.isTransitioning&&!s.flushSync&&d(new t4)},[s]),p.useEffect(()=>{if(c&&i&&r.window){let e=c.promise,t=r.window.document.startViewTransition(async()=>{b(()=>o(i)),await e});t.finished.finally(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}),f(t)}},[b,i,c,r.window]),p.useEffect(()=>{c&&i&&a.location.key===i.location.key&&c.resolve()},[c,h,a.location,i]),p.useEffect(()=>{!s.isTransitioning&&m&&(l(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[s.isTransitioning,m]),p.useEffect(()=>{},[]);let E=p.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]),S=r.basename||"/",x=p.useMemo(()=>({router:r,navigator:E,static:!1,basename:S}),[r,E,S]);return p.createElement(p.Fragment,null,p.createElement(eH.Provider,{value:x},p.createElement(eW.Provider,{value:a},p.createElement(tQ.Provider,{value:y.current},p.createElement(tG.Provider,{value:s},p.createElement(tP,{basename:S,location:a.location,navigationType:a.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?p.createElement(t3,{routes:r.routes,future:r.future,state:a}):t))))),null)}function t3(e){let{routes:t,future:r,state:n}=e;return e8(t,void 0,n,r)}function t5(e){let{basename:t,children:r,future:n,window:a}=e,o=p.useRef();null==o.current&&(o.current=b({window:a,v5Compat:!0}));let i=o.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&tZ?tZ(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tP,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function t9(e){let{basename:t,children:r,future:n,window:a}=e,o=p.useRef();null==o.current&&(o.current=w({window:a,v5Compat:!0}));let i=o.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&tZ?tZ(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tP,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function t8(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=p.useState({action:a.action,location:a.location}),{v7_startTransition:l}=n||{},s=p.useCallback(e=>{l&&tZ?tZ(()=>i(e)):i(e)},[i,l]);return p.useLayoutEffect(()=>a.listen(s),[a,s]),p.createElement(tP,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}let t6="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,re=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=p.forwardRef(function(e,t){let r,{onClick:n,relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:c,unstable_viewTransition:d}=e,h=tN(e,tJ),{basename:f}=p.useContext(eJ),m=!1;if("string"==typeof u&&re.test(u)&&(r=u,t6))try{let e=new URL(window.location.href),t=new URL(u.startsWith("//")?e.protocol+u:u),r=O(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch(e){}let v=eY(u,{relative:a}),y=rl(u,{replace:i,state:l,target:s,preventScrollReset:c,relative:a,unstable_viewTransition:d});return p.createElement("a",tF({},h,{href:r||v,onClick:m||o?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:s}))}),rr=p.forwardRef(function(e,t){let r,{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=tN(e,tK),h=e5(s,{relative:d.relative}),f=eG(),m=p.useContext(eW),{navigator:v,basename:y}=p.useContext(eJ),g=null!=m&&rw(h)&&!0===u,b=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,w=f.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(w=w.toLowerCase(),E=E?E.toLowerCase():null,b=b.toLowerCase()),E&&y&&(E=O(E,y)||E);let S="/"!==b&&b.endsWith("/")?b.length-1:b.length,x=w===b||!i&&w.startsWith(b)&&"/"===w.charAt(S),R=null!=E&&(E===b||!i&&E.startsWith(b)&&"/"===E.charAt(b.length)),C={isActive:x,isPending:R,isTransitioning:g},P=x?n:void 0;r="function"==typeof o?o(C):[o,x?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(C):l;return p.createElement(rt,tF({},d,{"aria-current":P,className:r,ref:t,style:D,to:s,unstable_viewTransition:u}),"function"==typeof c?c(C):c)}),rn=p.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:i,method:l="get",action:s,onSubmit:u,relative:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=tN(e,tV),m=rd(),v=rh(s,{relative:c}),y="get"===l.toLowerCase()?"get":"post";return p.createElement("form",tF({ref:t,method:y,action:v,onSubmit:a?u:e=>{if(u&&u(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:o,state:i,relative:c,preventScrollReset:d,unstable_viewTransition:h})}},f))});function ra(e){let{getKey:t,storageKey:r}=e;return ry({getKey:t,storageKey:r}),null}function ro(e){let t=p.useContext(eH);return t||E(!1),t}function ri(e){let t=p.useContext(eW);return t||E(!1),t}function rl(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:l}=void 0===t?{}:t,s=e1(),u=eG(),c=e5(e,{relative:i});return p.useCallback(t=>{0!==t.button||r&&"_self"!==r||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),s(e,{replace:void 0!==n?n:C(u)===C(c),state:a,preventScrollReset:o,relative:i,unstable_viewTransition:l}))},[u,s,c,n,a,r,e,o,i,l])}function rs(e){let t=p.useRef(tz(e)),r=p.useRef(!1),n=eG(),a=p.useMemo(()=>{var e,a;let o;return e=n.search,a=r.current?null:t.current,o=tz(e),a&&a.forEach((e,t)=>{o.has(t)||a.getAll(t).forEach(e=>{o.append(t,e)})}),o},[n.search]),o=e1(),i=p.useCallback((e,t)=>{let n=tz("function"==typeof e?e(a):e);r.current=!0,o("?"+n,t)},[o,a]);return[a,i]}(s=h||(h={})).UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState",(u=f||(f={})).UseFetcher="useFetcher",u.UseFetchers="useFetchers",u.UseScrollRestoration="useScrollRestoration";let ru=0,rc=()=>"__"+String(++ru)+"__";function rd(){let{router:e}=ro(h.UseSubmit),{basename:t}=p.useContext(eJ),r=ts();return p.useCallback(function(n,a){if(void 0===a&&(a={}),"u"<typeof document)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tI(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?O(i,t):null,r=e.getAttribute("method")||"get",a=t$(e.getAttribute("enctype"))||tB,o=new FormData(e)}else if(tI(e)&&"button"===e.tagName.toLowerCase()||tI(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?O(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",a=t$(e.getAttribute("formenctype"))||t$(i.getAttribute("enctype"))||tB,o=new FormData(i,e),!function(){if(null===tH)try{new FormData(document.createElement("form"),0),tH=!1}catch(e){tH=!0}return tH}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else if(tI(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=tB,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||rc();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function rh(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=p.useContext(eJ),a=p.useContext(eV);a||E(!1);let[o]=a.matches.slice(-1),i=tF({},e5(e||".",{relative:r})),l=eG();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),i.search=e.toString()?"?"+e.toString():"")}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:H([n,i.pathname])),C(i)}function rf(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=ro(h.UseFetcher),a=ri(f.UseFetcher),o=p.useContext(tQ),i=p.useContext(eV),l=null==(t=i.matches[i.matches.length-1])?void 0:t.route.id;o||E(!1),i||E(!1),null==l&&E(!1);let s=t1?t1():"",[u,c]=p.useState(r||s);r&&r!==u?c(r):u||c(rc()),p.useEffect(()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)}),[n,u]);let d=p.useCallback((e,t)=>{l||E(!1),n.fetch(u,l,e,t)},[u,l,n]),m=rd(),v=p.useCallback((e,t)=>{m(e,tF({},t,{navigate:!1,fetcherKey:u}))},[u,m]),y=p.useMemo(()=>p.forwardRef((e,t)=>p.createElement(rn,tF({},e,{navigate:!1,fetcherKey:u,ref:t}))),[u]),g=a.fetchers.get(u)||ei,b=o.get(u);return p.useMemo(()=>tF({Form:y,submit:v,load:d},g,{data:b}),[y,v,d,g,b])}function rp(){return Array.from(ri(f.UseFetchers).fetchers.entries()).map(e=>{let[t,r]=e;return tF({},r,{key:t})})}let rm="react-router-scroll-positions",rv={};function ry(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=ro(h.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=ri(f.UseScrollRestoration),{basename:i}=p.useContext(eJ),l=eG(),s=td(),u=tu();p.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e){let{capture:t}={};p.useEffect(()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,t])}(p.useCallback(()=>{"idle"===u.state&&(rv[(t?t(l,s):null)||l.key]=window.scrollY);try{sessionStorage.setItem(r||rm,JSON.stringify(rv))}catch(e){}window.history.scrollRestoration="auto"},[r,t,u.state,l,s])),"u">typeof document&&(p.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||rm);e&&(rv=JSON.parse(e))}catch(e){}},[r]),p.useLayoutEffect(()=>{let e=t&&"/"!==i?(e,r)=>t(tF({},e,{pathname:O(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(rv,()=>window.scrollY,e);return()=>r&&r()},[n,i,t]),p.useLayoutEffect(()=>{if(!1!==a){if("number"==typeof a)return void window.scrollTo(0,a);if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==o&&window.scrollTo(0,0)}},[l,a,o]))}function rg(e,t){let{capture:r}=t||{};p.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}function rb(e){let{when:t,message:r}=e,n=tb(t);p.useEffect(()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),p.useEffect(()=>{"blocked"!==n.state||t||n.reset()},[n,t])}function rw(e,t){void 0===t&&(t={});let r=p.useContext(tG);null==r&&E(!1);let{basename:n}=ro(h.useViewTransitionState),a=e5(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=O(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=O(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=M(a.pathname,i)||null!=M(a.pathname,o)}}}]);
|