@openmrs/esm-form-engine-app 12.3.5-pre.11545 → 12.3.5-pre.11554
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 +2 -2
- package/dist/2681.js +2 -2
- package/dist/2681.js.map +1 -1
- package/dist/432.js +1 -1
- package/dist/432.js.map +1 -1
- package/dist/689.js +1 -0
- package/dist/689.js.map +1 -0
- package/dist/9712.js +1 -1
- package/dist/9712.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-form-engine-app.js +4 -4
- package/dist/openmrs-esm-form-engine-app.js.buildmanifest.json +40 -13
- package/dist/openmrs-esm-form-engine-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
package/dist/9712.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_form_engine_app=globalThis.webpackChunk_openmrs_esm_form_engine_app||[]).push([["9712"],{27059(e,t,r){r.r(t),r.d(t,{useFetchers:()=>rl,unstable_HistoryRouter:()=>tZ,useLoaderData:()=>tu,ScrollRestoration:()=>t7,Route:()=>tx,MemoryRouter:()=>tw,useMatches:()=>ts,redirect:()=>Y,useOutletContext:()=>e0,createRoutesFromElements:()=>tA,useLinkClickHandler:()=>t6,useRouteError:()=>th,generatePath:()=>M,useHref:()=>eq,useParams:()=>e4,useRoutes:()=>e2,useSubmit:()=>rr,Navigate:()=>tE,UNSAFE_NavigationContext:()=>eW,unstable_useBlocker:()=>tv,useAsyncError:()=>tp,createRoutesFromChildren:()=>tA,unstable_usePrompt:()=>rh,useFetcher:()=>ri,createHashRouter:()=>tY,UNSAFE_useRouteId:()=>ta,useMatch:()=>eX,useNavigation:()=>ti,HashRouter:()=>tQ,useFormAction:()=>ro,useResolvedPath:()=>e3,defer:()=>K,Router:()=>tS,Routes:()=>tC,useActionData:()=>td,useRouteLoaderData:()=>tc,Await:()=>tD,matchPath:()=>O,UNSAFE_DataRouterContext:()=>eF,BrowserRouter:()=>tG,NavigationType:()=>c,Form:()=>t2,UNSAFE_RouteContext:()=>eH,createSearchParams:()=>tF,RouterProvider:()=>ty,UNSAFE_LocationContext:()=>e$,parsePath:()=>C,Outlet:()=>tR,createMemoryRouter:()=>tO,UNSAFE_useScrollRestoration:()=>rc,useNavigate:()=>eQ,matchRoutes:()=>L,createPath:()=>S,resolvePath:()=>T,useInRouterContext:()=>eK,useOutlet:()=>e1,useAsyncValue:()=>tf,Link:()=>t4,AbortedDeferredError:()=>J,renderMatches:()=>tj,NavLink:()=>t3,UNSAFE_DataRouterStateContext:()=>eI,json:()=>H,useSearchParams:()=>re,redirectDocument:()=>V,useBeforeUnload:()=>rd,useLocation:()=>eY,createBrowserRouter:()=>tK,isRouteErrorResponse:()=>G,useNavigationType:()=>eV,useRevalidator:()=>tl});var n,o,a,i,l,s,u,c,d,h,f,p=r(35399);function m(){return(m=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 v="popstate";function g(e){let t;void 0===e&&(e={});let{initialEntries:r=["/"],initialIndex:n,v5Compat:o=!1}=e;t=r.map((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let a=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 o=x(t?t[a].pathname:"/",e,r,n);return E("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function d(e){return"string"==typeof e?e:S(e)}return{get index(){return a},get action(){return i},get location(){return t[a]},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?C(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){i=c.Push;let n=u(e,r);a+=1,t.splice(a,t.length,n),o&&l&&l({action:i,location:n,delta:1})},replace(e,r){i=c.Replace;let n=u(e,r);t[a]=n,o&&l&&l({action:i,location:n,delta:0})},go(e){i=c.Pop;let r=s(a+e),n=t[r];a=r,l&&l({action:i,location:n,delta:e})},listen:e=>(l=e,()=>{l=null})}}function y(e){return void 0===e&&(e={}),D(function(e,t){let{pathname:r,search:n,hash:o}=e.location;return x("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:S(t)},null,e)}function b(e){return void 0===e&&(e={}),D(function(e,t){let{pathname:r="/",search:n="",hash:o=""}=C(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),x("",{pathname:r,search:n,hash:o},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:S(t))},function(e,t){E("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function w(e,t){if(!1===e||null==e)throw Error(t)}function E(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 x(e,t,r,n){return void 0===r&&(r=null),m({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?C(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function S(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 C(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:o=document.defaultView,v5Compat:a=!1}=n,i=o.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"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:S(e);return w(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==u&&(u=0,i.replaceState(m({},i.state,{idx:u}),""));let p={get action(){return l},get location(){return e(o,i)},listen(e){if(s)throw Error("A history only accepts one active listener");return o.addEventListener(v,h),s=e,()=>{o.removeEventListener(v,h),s=null}},createHref:e=>t(o,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=x(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;o.location.assign(f)}a&&s&&s({action:l,location:p.location,delta:1})},replace:function(e,t){l=c.Replace;let n=x(p.location,e,t);r&&r(n,e);let o=R(n,u=d()),h=p.createHref(n);i.replaceState(o,"",h),a&&s&&s({action:l,location:p.location,delta:0})},go:e=>i.go(e)};return p}(o=d||(d={})).data="data",o.deferred="deferred",o.redirect="redirect",o.error="error";let P=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,o)=>{let a=[...r,o],i="string"==typeof e.id?e.id:a.join("-");if(w(!0!==e.index||!e.children,"Cannot specify children on an index route"),w(!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=m({},e,t(e),{id:i});return n[i]=r,r}{let r=m({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=k(e.children,t,a,n)),r}})}function L(e,t,r){void 0===r&&(r="/");let n=_(("string"==typeof t?C(t):t).pathname||"/",r);if(null==n)return null;let o=function e(t,r,n,o){void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===o&&(o="");let a=(t,a,i)=>{var l,s;let u,c,d={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:a,route:t};d.relativePath.startsWith("/")&&(w(d.relativePath.startsWith(o),'Absolute route path "'+d.relativePath+'" nested under path "'+o+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),d.relativePath=d.relativePath.slice(o.length));let h=I([o,d.relativePath]),f=n.concat(d);t.children&&t.children.length>0&&(w(!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,...o]=r,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===o.length)return a?[i,""]:[i];let l=e(o.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),a&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))a(e,t,r);else a(e,t)}),r}(e);o.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 a=null;for(let e=0;null==a&&e<o.length;++e)a=function(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.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;a.push({params:n,pathname:I([o,u.pathname]),pathnameBase:z(I([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=I([o,u.pathnameBase]))}return a}(o[e],function(e){try{return decodeURI(e)}catch(t){return E(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}(n));return a}function U(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,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("/*")&&(E(!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("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return o(t["*"]);let a=e.match(/^:(\w+)(\??)$/);if(a){let[,e,r]=a,n=t[e];return w("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function O(e,t){var r,n,o;let a,i;"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[l,s]=(r=e.path,n=e.caseSensitive,o=e.end,void 0===n&&(n=!1),void 0===o&&(o=!0),E("*"===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(/\*$/,"/*")+'".'),a=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(e,t)=>(a.push(t),"/([^\\/]+)")),r.endsWith("*")?(a.push("*"),i+="*"===r||"/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?i+="\\/*$":""!==r&&"/"!==r&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),a]),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)=>{if("*"===t){let e=h[r]||"";d=c.slice(0,c.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return E(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(h[r]||"",t),e},{}),pathname:c,pathnameBase:d,pattern:e}}function _(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 T(e,t){var r;let n;void 0===t&&(t="/");let{pathname:o,search:a="",hash:i=""}="string"==typeof e?C(e):e;return{pathname:o?o.startsWith("/")?o:(r=o,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:W(a),hash:$(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 N(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function F(e,t,r,n){let o,a;void 0===n&&(n=!1),"string"==typeof e?o=C(e):(w(!(o=m({},e)).pathname||!o.pathname.includes("?"),B("?","pathname","search",o)),w(!o.pathname||!o.pathname.includes("#"),B("#","pathname","hash",o)),w(!o.search||!o.search.includes("#"),B("#","search","hash",o)));let i=""===e||""===o.pathname,l=i?"/":o.pathname;if(n||null==l)a=r;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=T(o,a),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}let I=e=>e.join("/").replace(/\/\/+/g,"/"),z=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),W=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",$=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",H=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),m({},r,{headers:n}))};class J extends Error{}class q{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],w(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 J("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 J)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 w(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 K=function(e,t){return void 0===t&&(t={}),new q(e,"number"==typeof t?{status:t}:t)},Y=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,m({},r,{headers:n}))},V=(e,t)=>{let r=Y(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class X{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 G(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}let Q=["post","put","patch","delete"],Z=new Set(Q),ee=new Set(["get",...Q]),et=new Set([301,302,303,307,308]),er=new Set([307,308]),en={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eo={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ea={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ei=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,el=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function es(e){let t,r,n,o,a=e.window?e.window:"u">typeof window?window:void 0,i=void 0!==a&&void 0!==a.document&&void 0!==a.document.createElement,l=!i;if(w(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=el;let s={},u=k(e.routes,t,void 0,s),h=e.basename||"/",f=m({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,v=new Set,g=null,y=null,b=null,R=null!=e.hydrationData,S=L(u,e.history.location,h),C=null;if(null==S){let t=ex(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=eR(u);S=r,C={[n.id]:t}}let D=!S.some(e=>e.route.lazy)&&(!S.some(e=>e.route.loader)||null!=e.hydrationData),P={historyAction:e.history.action,location:e.history.location,matches:S,initialized:D,navigation:en,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||C,fetchers:new Map,blockers:new Map},A=c.Pop,j=!1,M=!1,O=!1,T=[],B=[],N=new Map,F=0,I=-1,z=new Map,W=new Set,$=new Map,H=new Map,J=new Map,q=!1;function K(e){P=m({},P,e),v.forEach(e=>e(P))}function Y(t,n){var o,a;let i,l=null!=P.actionData&&null!=P.navigation.formMethod&&eL(P.navigation.formMethod)&&"loading"===P.navigation.state&&(null==(o=t.state)?void 0:o._isRedirect)!==!0;i=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?P.actionData:null;let s=n.loaderData?ew(P.loaderData,n.loaderData,n.matches||[],n.errors):P.loaderData,d=P.blockers;d.size>0&&(d=new Map(d)).forEach((e,t)=>d.set(t,ea));let h=!0===j||null!=P.navigation.formMethod&&eL(P.navigation.formMethod)&&(null==(a=t.state)?void 0:a._isRedirect)!==!0;r&&(u=r,r=void 0),M||A===c.Pop||(A===c.Push?e.history.push(t,t.state):A===c.Replace&&e.history.replace(t,t.state)),K(m({},n,{actionData:i,loaderData:s,historyAction:A,location:t,initialized:!0,navigation:en,revalidation:"idle",restoreScrollPosition:eH(t,n.matches||P.matches),preventScrollReset:h,blockers:d})),A=c.Pop,j=!1,M=!1,O=!1,T=[],B=[]}async function V(t,r){if("number"==typeof t)return void e.history.go(t);let n=eu(P.location,P.matches,h,f.v7_prependBasename,t,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:o,submission:a,error:i}=ec(f.v7_normalizeFormMethod,!1,n,r),l=P.location,s=x(P.location,o,r&&r.state);s=m({},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!=a&&eL(a.formMethod)&&a.formAction===P.location.pathname+P.location.search&&(d=c.Replace);let p=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,v=ez({currentLocation:l,nextLocation:s,historyAction:d});return v?void eI(v,{state:"blocked",location:s,proceed(){eI(v,{state:"proceeding",proceed:void 0,reset:void 0,location:s}),V(t,r)},reset(){let e=new Map(P.blockers);e.set(v,ea),K({blockers:e})}}):await X(d,s,{submission:a,pendingError:i,preventScrollReset:p,replace:r&&r.replace})}async function X(t,n,a){var i,l,s,c;let d,f;o&&o.abort(),o=null,A=t,M=!0===(a&&a.startUninterruptedRevalidation),i=P.location,l=P.matches,g&&b&&(g[e$(i,l)]=b()),j=!0===(a&&a.preventScrollReset);let p=r||u,v=a&&a.overrideNavigation,y=L(p,n,h);if(!y){let e=ex(404,{pathname:n.pathname}),{matches:t,route:r}=eR(p);eW(),Y(n,{matches:t,loaderData:{},errors:{[r.id]:e}});return}if(P.initialized&&!O&&(s=P.location,c=n,s.pathname===c.pathname&&s.search===c.search&&(""===s.hash?""!==c.hash:s.hash===c.hash||""!==c.hash||!1))&&!(a&&a.submission&&eL(a.submission.formMethod)))return void Y(n,{matches:y});o=new AbortController;let w=ev(e.history,n,o.signal,a&&a.submission);if(a&&a.pendingError)f={[eE(y).route.id]:a.pendingError};else if(a&&a.submission&&eL(a.submission.formMethod)){let e=await G(w,n,a.submission,y,{replace:a.replace});if(e.shortCircuited)return;d=e.pendingActionData,f=e.pendingActionError,v=e_(n,a.submission),w=new Request(w.url,{signal:w.signal})}let{shortCircuited:E,loaderData:R,errors:x}=await Q(w,n,y,v,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,d,f);E||(o=null,Y(n,m({matches:y},d?{actionData:d}:{},{loaderData:R,errors:x})))}async function G(e,r,n,o,a){var i;let l;void 0===a&&(a={}),ef(),K({navigation:{state:"submitting",location:r,formMethod:(i=n).formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}});let u=eM(o,r);if(u.route.action||u.route.lazy){if(l=await em("action",e,u,o,s,t,h),e.signal.aborted)return{shortCircuited:!0}}else l={type:d.error,error:ex(405,{method:e.method,pathname:r.pathname,routeId:u.route.id})};if(ek(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===P.location.pathname+P.location.search,await es(P,l,{submission:n,replace:e}),{shortCircuited:!0}}if(eP(l)){let e=eE(o,u.route.id);return!0!==(a&&a.replace)&&(A=c.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(eD(l))throw ex(400,{type:"defer-action"});return{pendingActionData:{[u.route.id]:l.data}}}async function Q(t,n,a,i,l,s,c,d,f){let p=i||e_(n,l),v=l||s||eO(p),g=r||u,[y,b]=ed(e.history,P,a,v,n,O,T,B,$,W,g,h,d,f);if(eW(e=>!(a&&a.some(t=>t.route.id===e))||y&&y.some(t=>t.route.id===e)),I=++F,0===y.length&&0===b.length){let e=ej();return Y(n,m({matches:a,loaderData:{},errors:f||null},d?{actionData:d}:{},e?{fetchers:new Map(P.fetchers)}:{})),{shortCircuited:!0}}if(!M){b.forEach(e=>{let t=P.fetchers.get(e.key),r=eT(void 0,t?t.data:void 0);P.fetchers.set(e.key,r)});let e=d||P.actionData;K(m({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},b.length>0?{fetchers:new Map(P.fetchers)}:{}))}b.forEach(e=>{N.has(e.key)&&ey(e.key),e.controller&&N.set(e.key,e.controller)});let w=()=>b.forEach(e=>ey(e.key));o&&o.signal.addEventListener("abort",w);let{results:E,loaderResults:R,fetcherResults:x}=await eh(P.matches,a,y,b,t);if(t.signal.aborted)return{shortCircuited:!0};o&&o.signal.removeEventListener("abort",w),b.forEach(e=>N.delete(e.key));let S=eS(E);if(S){if(S.idx>=y.length){let e=b[S.idx-y.length].key;W.add(e)}return await es(P,S.result,{replace:c}),{shortCircuited:!0}}let{loaderData:C,errors:D}=eb(P,a,y,R,f,b,x,H);H.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&H.delete(t)})});let k=ej(),L=eN(I),U=k||L||b.length>0;return m({loaderData:C,errors:D},U?{fetchers:new Map(P.fetchers)}:{})}function Z(e){return P.fetchers.get(e)||eo}async function ee(n,a,i,l,c,d){var f,p;if(ef(),$.delete(n),!l.route.action&&!l.route.lazy){let e=ex(405,{method:d.formMethod,pathname:i,routeId:a});ep(n,a,e);return}let v=(f=d,p=P.fetchers.get(n),{state:"submitting",formMethod:f.formMethod,formAction:f.formAction,formEncType:f.formEncType,formData:f.formData,json:f.json,text:f.text,data:p?p.data:void 0});P.fetchers.set(n,v),K({fetchers:new Map(P.fetchers)});let g=new AbortController,y=ev(e.history,i,g.signal,d);N.set(n,g);let b=F,E=await em("action",y,l,c,s,t,h);if(y.signal.aborted){N.get(n)===g&&N.delete(n);return}if(ek(E)){if(N.delete(n),I>b){let e=eB(void 0);P.fetchers.set(n,e),K({fetchers:new Map(P.fetchers)});return}{W.add(n);let e=eT(d);return P.fetchers.set(n,e),K({fetchers:new Map(P.fetchers)}),es(P,E,{fetcherSubmission:d})}}if(eP(E))return void ep(n,a,E.error);if(eD(E))throw ex(400,{type:"defer-action"});let R=P.navigation.location||P.location,x=ev(e.history,R,g.signal),S=r||u,C="idle"!==P.navigation.state?L(S,P.navigation.location,h):P.matches;w(C,"Didn't find any matches after fetcher action");let D=++F;z.set(n,D);let k=eT(d,E.data);P.fetchers.set(n,k);let[U,j]=ed(e.history,P,C,d,R,O,T,B,$,W,S,h,{[l.route.id]:E.data},void 0);j.filter(e=>e.key!==n).forEach(e=>{let t=e.key,r=P.fetchers.get(t),n=eT(void 0,r?r.data:void 0);P.fetchers.set(t,n),N.has(t)&&ey(t),e.controller&&N.set(t,e.controller)}),K({fetchers:new Map(P.fetchers)});let M=()=>j.forEach(e=>ey(e.key));g.signal.addEventListener("abort",M);let{results:_,loaderResults:J,fetcherResults:q}=await eh(P.matches,C,U,j,x);if(g.signal.aborted)return;g.signal.removeEventListener("abort",M),z.delete(n),N.delete(n),j.forEach(e=>N.delete(e.key));let V=eS(_);if(V){if(V.idx>=U.length){let e=j[V.idx-U.length].key;W.add(e)}return es(P,V.result)}let{loaderData:X,errors:G}=eb(P,P.matches,U,J,void 0,j,q,H);if(P.fetchers.has(n)){let e=eB(E.data);P.fetchers.set(n,e)}let Q=eN(D);"loading"===P.navigation.state&&D>I?(w(A,"Expected pending action"),o&&o.abort(),Y(P.navigation.location,{matches:C,loaderData:X,errors:G,fetchers:new Map(P.fetchers)})):(K(m({errors:G,loaderData:ew(P.loaderData,X,C,G)},Q||j.length>0?{fetchers:new Map(P.fetchers)}:{})),O=!1)}async function et(r,n,o,a,i,l){let u=P.fetchers.get(r),c=eT(l,u?u.data:void 0);P.fetchers.set(r,c),K({fetchers:new Map(P.fetchers)});let d=new AbortController,f=ev(e.history,o,d.signal);N.set(r,d);let p=F,m=await em("loader",f,a,i,s,t,h);if(eD(m)&&(m=await eA(m,f.signal,!0)||m),N.get(r)===d&&N.delete(r),f.signal.aborted)return;if(ek(m))if(I>p){let e=eB(void 0);P.fetchers.set(r,e),K({fetchers:new Map(P.fetchers)});return}else{W.add(r),await es(P,m);return}if(eP(m)){let e=eE(P.matches,n);P.fetchers.delete(r),K({fetchers:new Map(P.fetchers),errors:{[e.route.id]:m.error}});return}w(!eD(m),"Unhandled fetcher deferred data");let v=eB(m.data);P.fetchers.set(r,v),K({fetchers:new Map(P.fetchers)})}async function es(t,r,n){let{submission:l,fetcherSubmission:s,replace:u}=void 0===n?{}:n;r.revalidate&&(O=!0);let d=x(t.location,r.location,{_isRedirect:!0});if(w(d,"Expected a location on the redirect navigation"),i){let t=!1;if(r.reloadDocument)t=!0;else if(ei.test(r.location)){let n=e.history.createURL(r.location);t=n.origin!==a.location.origin||null==_(n.pathname,h)}if(t)return void(u?a.location.replace(r.location):a.location.assign(r.location))}o=null;let f=!0===u?c.Replace:c.Push,{formMethod:p,formAction:v,formEncType:g}=t.navigation;!l&&!s&&p&&v&&g&&(l=eO(t.navigation));let y=l||s;if(er.has(r.status)&&y&&eL(y.formMethod))await X(f,d,{submission:m({},y,{formAction:r.location}),preventScrollReset:j});else{let e=e_(d,l);await X(f,d,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:j})}}async function eh(r,n,o,a,i){let l=await Promise.all([...o.map(e=>em("loader",i,e,n,s,t,h)),...a.map(r=>r.matches&&r.match&&r.controller?em("loader",ev(e.history,r.path,r.controller.signal),r.match,r.matches,s,t,h):{type:d.error,error:ex(404,{pathname:r.path})})]),u=l.slice(0,o.length),c=l.slice(o.length);return await Promise.all([eU(r,o,u,u.map(()=>i.signal),!1,P.loaderData),eU(r,a.map(e=>e.match),c,a.map(e=>e.controller?e.controller.signal:null),!0)]),{results:l,loaderResults:u,fetcherResults:c}}function ef(){O=!0,T.push(...eW()),$.forEach((e,t)=>{N.has(t)&&(B.push(t),ey(t))})}function ep(e,t,r){let n=eE(P.matches,t);eg(e),K({errors:{[n.route.id]:r},fetchers:new Map(P.fetchers)})}function eg(e){let t=P.fetchers.get(e);N.has(e)&&!(t&&"loading"===t.state&&z.has(e))&&ey(e),$.delete(e),z.delete(e),W.delete(e),P.fetchers.delete(e)}function ey(e){let t=N.get(e);w(t,"Expected fetch controller: "+e),t.abort(),N.delete(e)}function eC(e){for(let t of e){let e=eB(Z(t).data);P.fetchers.set(t,e)}}function ej(){let e=[],t=!1;for(let r of W){let n=P.fetchers.get(r);w(n,"Expected fetcher: "+r),"loading"===n.state&&(W.delete(r),e.push(r),t=!0)}return eC(e),t}function eN(e){let t=[];for(let[r,n]of z)if(n<e){let e=P.fetchers.get(r);w(e,"Expected fetcher: "+r),"loading"===e.state&&(ey(r),z.delete(r),t.push(r))}return eC(t),t.length>0}function eF(e){P.blockers.delete(e),J.delete(e)}function eI(e,t){let r=P.blockers.get(e)||ea;w("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(P.blockers);n.set(e,t),K({blockers:n})}function ez(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===J.size)return;J.size>1&&E(!1,"A router only supports one blocker at a time");let o=Array.from(J.entries()),[a,i]=o[o.length-1],l=P.blockers.get(a);if((!l||"proceeding"!==l.state)&&i({currentLocation:t,nextLocation:r,historyAction:n}))return a}function eW(e){let t=[];return H.forEach((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),H.delete(n))}),t}function e$(e,t){return y&&y(e,t.map(e=>U(e,P.loaderData)))||e.key}function eH(e,t){if(g){let r=g[e$(e,t)];if("number"==typeof r)return r}return null}return n={get basename(){return h},get state(){return P},get routes(){return u},initialize:function(){return p=e.history.listen(t=>{let{action:r,location:n,delta:o}=t;if(q){q=!1;return}E(0===J.size||null!=o,"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 a=ez({currentLocation:P.location,nextLocation:n,historyAction:r});if(a&&null!=o){q=!0,e.history.go(-1*o),eI(a,{state:"blocked",location:n,proceed(){eI(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(P.blockers);e.set(a,ea),K({blockers:e})}});return}return X(r,n)}),P.initialized||X(c.Pop,P.location),n},subscribe:function(e){return v.add(e),()=>v.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,b=t,y=r||null,!R&&P.navigation===en){R=!0;let e=eH(P.location,P.matches);null!=e&&K({restoreScrollPosition:e})}return()=>{g=null,b=null,y=null}},navigate:V,fetch:function(e,t,n,o){if(l)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.");N.has(e)&&ey(e);let a=r||u,i=eu(P.location,P.matches,h,f.v7_prependBasename,n,t,null==o?void 0:o.relative),s=L(a,i,h);if(!s)return void ep(e,t,ex(404,{pathname:i}));let{path:c,submission:d,error:p}=ec(f.v7_normalizeFormMethod,!0,i,o);if(p)return void ep(e,t,p);let m=eM(s,c);(j=!0===(o&&o.preventScrollReset),d&&eL(d.formMethod))?ee(e,t,c,m,s,d):($.set(e,{routeId:t,path:c}),et(e,t,c,m,s,d))},revalidate:function(){if(ef(),K({revalidation:"loading"}),"submitting"!==P.navigation.state){if("idle"===P.navigation.state)return void X(P.historyAction,P.location,{startUninterruptedRevalidation:!0});X(A||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Z,deleteFetcher:eg,dispose:function(){p&&p(),v.clear(),o&&o.abort(),P.fetchers.forEach((e,t)=>eg(t)),P.blockers.forEach((e,t)=>eF(t))},getBlocker:function(e,t){let r=P.blockers.get(e)||ea;return J.get(e)!==t&&J.set(e,t),r},deleteBlocker:eF,_internalFetchControllers:N,_internalActiveDeferreds:H,_internalSetRoutes:function(e){r=k(e,t,void 0,s={})}}}function eu(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){for(let e of(l=[],t))if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let u=F(o||".",N(l).map(e=>e.pathnameBase),_(e.pathname,r)||e.pathname,"path"===i);return null==o&&(u.search=e.search,u.hash=e.hash),(null==o||""===o||"."===o)&&s&&s.route.index&&!ej(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(u.pathname="/"===u.pathname?r:I([r,u.pathname])),S(u)}function ec(e,t,r,n){var o;let a,i;if(!n||!(null!=n&&("formData"in n&&null!=n.formData||"body"in n&&void 0!==n.body)))return{path:r};if(n.formMethod&&(o=n.formMethod,!ee.has(o.toLowerCase())))return{path:r,error:ex(405,{method:n.formMethod})};let l=()=>({path:r,error:ex(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=eC(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!eL(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(!eL(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(w("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=eg(n.formData),i=n.formData;else if(n.body instanceof FormData)a=eg(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=ey(a=n.body);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=ey(a)}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(eL(d.formMethod))return{path:r,submission:d};let h=C(r);return t&&h.search&&ej(h.search)&&a.append("index",""),h.search="?"+a,{path:S(h),submission:d}}function ed(e,t,r,n,o,a,i,l,s,u,c,d,h,f){let p=f?Object.values(f)[0]:h?Object.values(h)[0]:void 0,v=e.createURL(t.location),g=e.createURL(o),y=(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,f?Object.keys(f)[0]:void 0).filter((e,r)=>{var o,l,s;let u,c;if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(o=t.loaderData,l=t.matches[r],s=e,u=!l||s.route.id!==l.route.id,c=void 0===o[s.route.id],u||c||i.some(t=>t===e.route.id))return!0;let d=t.matches[r];return ef(e,m({currentUrl:v,currentParams:d.params,nextUrl:g,nextParams:e.params},n,{actionResult:p,defaultShouldRevalidate:a||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||eh(d,e)}))}),b=[];return s.forEach((e,o)=>{if(!r.some(t=>t.route.id===e.routeId))return;let i=L(c,e.path,d);if(!i)return void b.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let s=t.fetchers.get(o),h=eM(i,e.path);!u.has(o)&&(l.includes(o)||(s&&"idle"!==s.state&&void 0===s.data?a:ef(h,m({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a}))))&&b.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:h,controller:new AbortController})}),[y,b]}function eh(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ef(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ep(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];w(o,"No route found in manifest");let a={};for(let e in n){let t=void 0!==o[e]&&"hasErrorBoundary"!==e;E(!t,'Route "'+o.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||P.has(e)||(a[e]=n[e])}Object.assign(o,a),Object.assign(o,m({},t(o),{lazy:void 0}))}async function em(e,t,r,n,o,a,i,l){var s,u,c,h;let f,p,m;void 0===l&&(l={});let v=e=>{let n,o=new Promise((e,t)=>n=t);return m=()=>n(),t.signal.addEventListener("abort",m),Promise.race([e({request:t,params:r.params,context:l.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([v(n).catch(t=>{e=t}),ep(r.route,a,o)]);if(e)throw e;p=t[0]}else if(await ep(r.route,a,o),n=r.route[e])p=await v(n);else{if("action"!==e)return{type:d.data,data:void 0};let n=new URL(t.url),o=n.pathname+n.search;throw ex(405,{method:t.method,pathname:o,routeId:r.route.id})}else if(n)p=await v(n);else{let e=new URL(t.url),r=e.pathname+e.search;throw ex(404,{pathname:r})}w(void 0!==p,"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){f=d.error,p=e}finally{m&&t.signal.removeEventListener("abort",m)}if(null!=(s=p)&&"number"==typeof s.status&&"string"==typeof s.statusText&&"object"==typeof s.headers&&void 0!==s.body){let e,o=p.status;if(et.has(o)){let e=p.headers.get("Location");if(w(e,"Redirects returned/thrown from loaders/actions must have a Location header"),ei.test(e)){if(!l.isStaticRequest){let r=new URL(t.url),n=new URL(e.startsWith("//")?r.protocol+e:e),o=null!=_(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=eu(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(l.isStaticRequest)throw p.headers.set("Location",e),p;return{type:d.redirect,status:o,location:e,revalidate:null!==p.headers.get("X-Remix-Revalidate"),reloadDocument:null!==p.headers.get("X-Remix-Reload-Document")}}if(l.isRouteRequest)throw{type:f===d.error?d.error:d.data,response:p};let a=p.headers.get("Content-Type");return(e=a&&/\bapplication\/json\b/.test(a)?await p.json():await p.text(),f===d.error)?{type:f,error:new X(o,p.statusText,e),headers:p.headers}:{type:d.data,data:e,statusCode:p.status,headers:p.headers}}if(f===d.error)return{type:f,error:p};if((u=p)&&"object"==typeof u&&"object"==typeof u.data&&"function"==typeof u.subscribe&&"function"==typeof u.cancel&&"function"==typeof u.resolveData){return{type:d.deferred,deferredData:p,statusCode:null==(c=p.init)?void 0:c.status,headers:(null==(h=p.init)?void 0:h.headers)&&new Headers(p.init.headers)}}return{type:d.data,data:p}}function ev(e,t,r,n){let o=e.createURL(eC(t)).toString(),a={signal:r};if(n&&eL(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=eg(n.formData):a.body=n.formData}return new Request(o,a)}function eg(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function ey(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eb(e,t,r,n,o,a,i,l){var s;let u,c,d,h,f,{loaderData:p,errors:v}=(s=o,c={},d=null,h=!1,f={},n.forEach((e,n)=>{let o=r[n].route.id;if(w(!ek(e),"Cannot handle redirect results in processLoaderData"),eP(e)){let r=eE(t,o),n=e.error;s&&(n=Object.values(s)[0],s=void 0),null==(d=d||{})[r.route.id]&&(d[r.route.id]=n),c[o]=void 0,h||(h=!0,u=G(e.error)?e.error.status:500),e.headers&&(f[o]=e.headers)}else eD(e)?(l.set(o,e.deferredData),c[o]=e.deferredData.data):c[o]=e.data,null==e.statusCode||200===e.statusCode||h||(u=e.statusCode),e.headers&&(f[o]=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<a.length;t++){let{key:r,match:n,controller:o}=a[t];w(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let l=i[t];if(!o||!o.signal.aborted)if(eP(l)){let t=eE(e.matches,null==n?void 0:n.route.id);v&&v[t.route.id]||(v=m({},v,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(ek(l))w(!1,"Unhandled fetcher revalidation redirect");else if(eD(l))w(!1,"Unhandled fetcher deferred data");else{let t=eB(l.data);e.fetchers.set(r,t)}}return{loaderData:p,errors:v}}function ew(e,t,r,n){let o=m({},t);for(let a of r){let r=a.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(o[r]=t[r]):void 0!==e[r]&&a.route.loader&&(o[r]=e[r]),n&&n.hasOwnProperty(r))break}return o}function eE(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 eR(e){let t=e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ex(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(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",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new X(e||500,i,Error(l),!0)}function eS(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ek(r))return{result:r,idx:t}}}function eC(e){let t="string"==typeof e?C(e):e;return S(m({},t,{hash:""}))}function eD(e){return e.type===d.deferred}function eP(e){return e.type===d.error}function ek(e){return(e&&e.type)===d.redirect}function eL(e){return Z.has(e.toLowerCase())}async function eU(e,t,r,n,o,a){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&&!eh(u,s)&&(a&&a[s.route.id])!==void 0;if(eD(l)&&(o||c)){let e=n[i];w(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await eA(l,e,o).then(e=>{e&&(r[i]=e||r[i])})}}}async function eA(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 ej(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eM(e,t){let r="string"==typeof t?C(t).search:t.search;if(e[e.length-1].route.index&&ej(r||""))return e[e.length-1];let n=N(e);return n[n.length-1]}function eO(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n){if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};else if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:a,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 e_(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 eT(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 eB(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 eN(){return(eN=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 eF=p.createContext(null),eI=p.createContext(null),ez=p.createContext(null),eW=p.createContext(null),e$=p.createContext(null),eH=p.createContext({outlet:null,matches:[],isDataRoute:!1}),eJ=p.createContext(null);function eq(e,t){let{relative:r}=void 0===t?{}:t;eK()||w(!1);let{basename:n,navigator:o}=p.useContext(eW),{hash:a,pathname:i,search:l}=e3(e,{relative:r}),s=i;return"/"!==n&&(s="/"===i?n:I([n,i])),o.createHref({pathname:s,search:l,hash:a})}function eK(){return null!=p.useContext(e$)}function eY(){return eK()||w(!1),p.useContext(e$).location}function eV(){return p.useContext(e$).navigationType}function eX(e){eK()||w(!1);let{pathname:t}=eY();return p.useMemo(()=>O(e,t),[t,e])}function eG(e){p.useContext(eW).static||p.useLayoutEffect(e)}function eQ(){let{isDataRoute:e}=p.useContext(eH);return e?function(){let{router:e}=tr(te.UseNavigateStable),t=to(tt.UseNavigateStable),r=p.useRef(!1);return eG(()=>{r.current=!0}),p.useCallback(function(n,o){void 0===o&&(o={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,eN({fromRouteId:t},o)))},[e,t])}():function(){eK()||w(!1);let e=p.useContext(eF),{basename:t,navigator:r}=p.useContext(eW),{matches:n}=p.useContext(eH),{pathname:o}=eY(),a=JSON.stringify(N(n).map(e=>e.pathnameBase)),i=p.useRef(!1);return eG(()=>{i.current=!0}),p.useCallback(function(n,l){if(void 0===l&&(l={}),!i.current)return;if("number"==typeof n)return void r.go(n);let s=F(n,JSON.parse(a),o,"path"===l.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:I([t,s.pathname])),(l.replace?r.replace:r.push)(s,l.state,l)},[t,r,a,o,e])}()}let eZ=p.createContext(null);function e0(){return p.useContext(eZ)}function e1(e){let t=p.useContext(eH).outlet;return t?p.createElement(eZ.Provider,{value:e},t):t}function e4(){let{matches:e}=p.useContext(eH),t=e[e.length-1];return t?t.params:{}}function e3(e,t){let{relative:r}=void 0===t?{}:t,{matches:n}=p.useContext(eH),{pathname:o}=eY(),a=JSON.stringify(N(n).map(e=>e.pathnameBase));return p.useMemo(()=>F(e,JSON.parse(a),o,"path"===r),[e,a,o,r])}function e2(e,t){return e5(e,t)}function e5(e,t,r){let n;eK()||w(!1);let{navigator:o}=p.useContext(eW),{matches:a}=p.useContext(eH),i=a[a.length-1],l=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let u=eY();if(t){var d;let e="string"==typeof t?C(t):t;"/"===s||(null==(d=e.pathname)?void 0:d.startsWith(s))||w(!1),n=e}else n=u;let h=n.pathname||"/",f=L(e,{pathname:"/"===s?h:h.slice(s.length)||"/"}),m=e6(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:I([s,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:I([s,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,r);return t&&m?p.createElement(e$.Provider,{value:{location:eN({pathname:"/",search:"",hash:"",state:null,key:"default"},n),navigationType:c.Pop}},m):m}let e7=p.createElement(function(){let e=th(),t=G(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 e9 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: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 this.state.error?p.createElement(eH.Provider,{value:this.props.routeContext},p.createElement(eJ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function e8(e){let{routeContext:t,match:r,children:n}=e,o=p.useContext(eF);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(eH.Provider,{value:t},n)}function e6(e,t,r){var n,o;if(void 0===t&&(t=[]),void 0===r&&(r=null),null==e){if(null==(o=r)||!o.errors)return null;e=r.matches}let a=e,i=null==(n=r)?void 0:n.errors;if(null!=i){let e=a.findIndex(e=>e.route.id&&(null==i?void 0:i[e.route.id]));e>=0||w(!1),a=a.slice(0,Math.min(a.length,e+1))}return a.reduceRight((e,n,o)=>{let l=n.route.id?null==i?void 0:i[n.route.id]:null,s=null;r&&(s=n.route.errorElement||e7);let u=t.concat(a.slice(0,o+1)),c=()=>{let t;return t=l?s:n.route.Component?p.createElement(n.route.Component,null):n.route.element?n.route.element:e,p.createElement(e8,{match:n,routeContext:{outlet:e,matches:u,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?p.createElement(e9,{location:r.location,revalidation:r.revalidation,component:s,error:l,children:c(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):c()},null)}var te=((a=te||{}).UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a),tt=((i=tt||{}).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 tr(e){let t=p.useContext(eF);return t||w(!1),t}function tn(e){let t=p.useContext(eI);return t||w(!1),t}function to(e){let t,r=((t=p.useContext(eH))||w(!1),t),n=r.matches[r.matches.length-1];return n.route.id||w(!1),n.route.id}function ta(){return to(tt.UseRouteId)}function ti(){return tn(tt.UseNavigation).navigation}function tl(){let e=tr(te.UseRevalidator),t=tn(tt.UseRevalidator);return p.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function ts(){let{matches:e,loaderData:t}=tn(tt.UseMatches);return p.useMemo(()=>e.map(e=>U(e,t)),[e,t])}function tu(){let e=tn(tt.UseLoaderData),t=to(tt.UseLoaderData);return e.errors&&null!=e.errors[t]?void console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")"):e.loaderData[t]}function tc(e){return tn(tt.UseRouteLoaderData).loaderData[e]}function td(){let e=tn(tt.UseActionData);return p.useContext(eH)||w(!1),Object.values((null==e?void 0:e.actionData)||{})[0]}function th(){var e;let t=p.useContext(eJ),r=tn(tt.UseRouteError),n=to(tt.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}function tf(){let e=p.useContext(ez);return null==e?void 0:e._data}function tp(){let e=p.useContext(ez);return null==e?void 0:e._error}let tm=0;function tv(e){let{router:t,basename:r}=tr(te.UseBlocker),n=tn(tt.UseBlocker),[o,a]=p.useState(""),i=p.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:o,historyAction:a}=t;return e({currentLocation:eN({},n,{pathname:_(n.pathname,r)||n.pathname}),nextLocation:eN({},o,{pathname:_(o.pathname,r)||o.pathname}),historyAction:a})},[r,e]);return p.useEffect(()=>{let e=String(++tm);return a(e),()=>t.deleteBlocker(e)},[t]),p.useEffect(()=>{""!==o&&t.getBlocker(o,i)},[t,o,i]),o&&n.blockers.has(o)?n.blockers.get(o):ea}let tg=p.startTransition;function ty(e){let{fallbackElement:t,router:r,future:n}=e,[o,a]=p.useState(r.state),{v7_startTransition:i}=n||{},l=p.useCallback(e=>{i&&tg?tg(()=>a(e)):a(e)},[a,i]);p.useLayoutEffect(()=>r.subscribe(l),[r,l]);let s=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]),u=r.basename||"/",c=p.useMemo(()=>({router:r,navigator:s,static:!1,basename:u}),[r,s,u]);return p.createElement(p.Fragment,null,p.createElement(eF.Provider,{value:c},p.createElement(eI.Provider,{value:o},p.createElement(tS,{basename:u,location:o.location,navigationType:o.historyAction,navigator:s},o.initialized?p.createElement(tb,{routes:r.routes,state:o}):t))),null)}function tb(e){let{routes:t,state:r}=e;return e5(t,void 0,r)}function tw(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:a}=e,i=p.useRef();null==i.current&&(i.current=g({initialEntries:n,initialIndex:o,v5Compat:!0}));let l=i.current,[s,u]=p.useState({action:l.action,location:l.location}),{v7_startTransition:c}=a||{},d=p.useCallback(e=>{c&&tg?tg(()=>u(e)):u(e)},[u,c]);return p.useLayoutEffect(()=>l.listen(d),[l,d]),p.createElement(tS,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l})}function tE(e){let{to:t,replace:r,state:n,relative:o}=e;eK()||w(!1);let{matches:a}=p.useContext(eH),{pathname:i}=eY(),l=eQ(),s=JSON.stringify(F(t,N(a).map(e=>e.pathnameBase),i,"path"===o));return p.useEffect(()=>l(JSON.parse(s),{replace:r,state:n,relative:o}),[l,s,o,r,n]),null}function tR(e){return e1(e.context)}function tx(e){w(!1)}function tS(e){let{basename:t="/",children:r=null,location:n,navigationType:o=c.Pop,navigator:a,static:i=!1}=e;eK()&&w(!1);let l=t.replace(/^\/*/,"/"),s=p.useMemo(()=>({basename:l,navigator:a,static:i}),[l,a,i]);"string"==typeof n&&(n=C(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=n,v=p.useMemo(()=>{let e=_(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:f,key:m},navigationType:o}},[l,u,d,h,f,m,o]);return null==v?null:p.createElement(eW.Provider,{value:s},p.createElement(e$.Provider,{children:r,value:v}))}function tC(e){let{children:t,location:r}=e;return e5(tA(t),r)}function tD(e){let{children:t,errorElement:r,resolve:n}=e;return p.createElement(tL,{resolve:n,errorElement:r},p.createElement(tU,null,t))}var tP=((l=tP||{})[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l);let tk=new Promise(()=>{});class tL 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,o=tP.pending;if(r instanceof Promise)if(this.state.error){o=tP.error;let e=this.state.error;Object.defineProperty(n=Promise.reject().catch(()=>{}),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?o=void 0!==(n=r)._error?tP.error:void 0!==n._data?tP.success:tP.pending:(o=tP.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then(e=>Object.defineProperty(r,"_data",{get:()=>e}),e=>Object.defineProperty(r,"_error",{get:()=>e})));else o=tP.success,Object.defineProperty(n=Promise.resolve(),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===tP.error&&n._error instanceof J)throw tk;if(o===tP.error&&!t)throw n._error;if(o===tP.error)return p.createElement(ez.Provider,{value:n,children:t});if(o===tP.success)return p.createElement(ez.Provider,{value:n,children:e});throw n}}function tU(e){let{children:t}=e,r=tf(),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 o=[...t,n];if(e.type===p.Fragment)return void r.push.apply(r,tA(e.props.children,o));e.type!==tx&&w(!1),e.props.index&&e.props.children&&w(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=tA(e.props.children,o)),r.push(a)}),r}function tj(e){return e6(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.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function tO(e,t){return es({basename:null==t?void 0:t.basename,future:eN({},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 t_(){return(t_=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 tT(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}let tB="application/x-www-form-urlencoded";function tN(e){return null!=e&&"string"==typeof e.tagName}function tF(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 tI=null,tz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tW(e){return null==e||tz.has(e)?e:null}function t$(e,t){let r,n,o,a,i;if(tN(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?_(i,t):null,r=e.getAttribute("method")||"get",o=tW(e.getAttribute("enctype"))||tB,a=new FormData(e)}else if(tN(e)&&"button"===e.tagName.toLowerCase()||tN(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?_(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",o=tW(e.getAttribute("formenctype"))||tW(i.getAttribute("enctype"))||tB,a=new FormData(i,e),!function(){if(null===tI)try{new FormData(document.createElement("form"),0),tI=!1}catch(e){tI=!0}return tI}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";a.append(e+"x","0"),a.append(e+"y","0")}else t&&a.append(t,n)}}else if(tN(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,o=tB,i=e;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}let tH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],tJ=["aria-current","caseSensitive","className","end","style","to","children"],tq=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset"];function tK(e,t){return es({basename:null==t?void 0:t.basename,future:t_({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:y({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tV(),routes:e,mapRouteProperties:tM}).initialize()}function tY(e,t){return es({basename:null==t?void 0:t.basename,future:t_({},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)||tV(),routes:e,mapRouteProperties:tM}).initialize()}function tV(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=t_({},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 X(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 o=new t(n.message);o.stack="",r[e]=o}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 tX=p.startTransition;function tG(e){let{basename:t,children:r,future:n,window:o}=e,a=p.useRef();null==a.current&&(a.current=y({window:o,v5Compat:!0}));let i=a.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&tX?tX(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tS,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i})}function tQ(e){let{basename:t,children:r,future:n,window:o}=e,a=p.useRef();null==a.current&&(a.current=b({window:o,v5Compat:!0}));let i=a.current,[l,s]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=p.useCallback(e=>{u&&tX?tX(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.createElement(tS,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i})}function tZ(e){let{basename:t,children:r,future:n,history:o}=e,[a,i]=p.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},s=p.useCallback(e=>{l&&tX?tX(()=>i(e)):i(e)},[i,l]);return p.useLayoutEffect(()=>o.listen(s),[o,s]),p.createElement(tS,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:o})}let t0="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,t1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t4=p.forwardRef(function(e,t){let r,{onClick:n,relative:o,reloadDocument:a,replace:i,state:l,target:s,to:u,preventScrollReset:c}=e,d=tT(e,tH),{basename:h}=p.useContext(eW),f=!1;if("string"==typeof u&&t1.test(u)&&(r=u,t0))try{let e=new URL(window.location.href),t=new URL(u.startsWith("//")?e.protocol+u:u),r=_(t.pathname,h);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:f=!0}catch(e){}let m=eq(u,{relative:o}),v=t6(u,{replace:i,state:l,target:s,preventScrollReset:c,relative:o});return p.createElement("a",t_({},d,{href:r||m,onClick:f||a?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:s}))}),t3=p.forwardRef(function(e,t){let r,{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,children:u}=e,c=tT(e,tJ),d=e3(s,{relative:c.relative}),h=eY(),f=p.useContext(eI),{navigator:m}=p.useContext(eW),v=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=h.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;o||(g=g.toLowerCase(),y=y?y.toLowerCase():null,v=v.toLowerCase());let b=g===v||!i&&g.startsWith(v)&&"/"===g.charAt(v.length),w=null!=y&&(y===v||!i&&y.startsWith(v)&&"/"===y.charAt(v.length)),E=b?n:void 0;r="function"==typeof a?a({isActive:b,isPending:w}):[a,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return p.createElement(t4,t_({},c,{"aria-current":E,className:r,ref:t,style:R,to:s}),"function"==typeof u?u({isActive:b,isPending:w}):u)}),t2=p.forwardRef((e,t)=>{let r=rr();return p.createElement(t5,t_({},e,{submit:r,ref:t}))}),t5=p.forwardRef((e,t)=>{let{reloadDocument:r,replace:n,state:o,method:a="get",action:i,onSubmit:l,submit:s,relative:u,preventScrollReset:c}=e,d=tT(e,tq),h="get"===a.toLowerCase()?"get":"post",f=ro(i,{relative:u});return p.createElement("form",t_({ref:t,method:h,action:f,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||a;s(t||e.currentTarget,{method:r,replace:n,state:o,relative:u,preventScrollReset:c})}},d))});function t7(e){let{getKey:t,storageKey:r}=e;return rc({getKey:t,storageKey:r}),null}function t9(e){let t=p.useContext(eF);return t||w(!1),t}function t8(e){let t=p.useContext(eI);return t||w(!1),t}function t6(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:i}=void 0===t?{}:t,l=eQ(),s=eY(),u=e3(e,{relative:i});return p.useCallback(t=>{0!==t.button||r&&"_self"!==r||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),l(e,{replace:void 0!==n?n:S(s)===S(u),state:o,preventScrollReset:a,relative:i}))},[s,l,u,n,o,r,e,a,i])}function re(e){let t=p.useRef(tF(e)),r=p.useRef(!1),n=eY(),o=p.useMemo(()=>{var e,o;let a;return e=n.search,o=r.current?null:t.current,a=tF(e),o&&o.forEach((e,t)=>{a.has(t)||o.getAll(t).forEach(e=>{a.append(t,e)})}),a},[n.search]),a=eQ(),i=p.useCallback((e,t)=>{let n=tF("function"==typeof e?e(o):e);r.current=!0,a("?"+n,t)},[a,o]);return[o,i]}function rt(){if("u"<typeof document)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function rr(){let{router:e}=t9(h.UseSubmit),{basename:t}=p.useContext(eW),r=ta();return p.useCallback(function(n,o){void 0===o&&(o={}),rt();let{action:a,method:i,encType:l,formData:s,body:u}=t$(n,t);e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:r})},[e,t,r])}function rn(e,t){let{router:r}=t9(h.UseSubmitFetcher),{basename:n}=p.useContext(eW);return p.useCallback(function(o,a){void 0===a&&(a={}),rt();let{action:i,method:l,encType:s,formData:u,body:c}=t$(o,n);null==t&&w(!1),r.fetch(e,t,a.action||i,{preventScrollReset:a.preventScrollReset,formData:u,body:c,formMethod:a.method||l,formEncType:a.encType||s})},[r,n,e,t])}function ro(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=p.useContext(eW),o=p.useContext(eH);o||w(!1);let[a]=o.matches.slice(-1),i=t_({},e3(e||".",{relative:r})),l=eY();if(null==e&&(i.search=l.search,a.route.index)){let e=new URLSearchParams(i.search);e.delete("index"),i.search=e.toString()?"?"+e.toString():""}return(!e||"."===e)&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:I([n,i.pathname])),S(i)}(s=h||(h={})).UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",(u=f||(f={})).UseFetchers="useFetchers",u.UseScrollRestoration="useScrollRestoration";let ra=0;function ri(){var e;let{router:t}=t9(h.UseFetcher),r=p.useContext(eH);r||w(!1);let n=null==(e=r.matches[r.matches.length-1])?void 0:e.route.id;null==n&&w(!1);let[o]=p.useState(()=>String(++ra)),[a]=p.useState(()=>(n||w(!1),p.forwardRef((e,t)=>{let r=rn(o,n);return p.createElement(t5,t_({},e,{ref:t,submit:r}))}))),[i]=p.useState(()=>e=>{t||w(!1),n||w(!1),t.fetch(o,n,e)}),l=rn(o,n),s=t.getFetcher(o),u=p.useMemo(()=>t_({Form:a,submit:l,load:i},s),[s,a,l,i]);return p.useEffect(()=>()=>{t?t.deleteFetcher(o):console.warn("No router available to clean up from useFetcher()")},[t,o]),u}function rl(){return[...t8(f.UseFetchers).fetchers.values()]}let rs="react-router-scroll-positions",ru={};function rc(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=t9(h.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:a}=t8(f.UseScrollRestoration),{basename:i}=p.useContext(eW),l=eY(),s=ts(),u=ti();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&&(ru[(t?t(l,s):null)||l.key]=window.scrollY),sessionStorage.setItem(r||rs,JSON.stringify(ru)),window.history.scrollRestoration="auto"},[r,t,u.state,l,s])),"u">typeof document&&(p.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||rs);e&&(ru=JSON.parse(e))}catch(e){}},[r]),p.useLayoutEffect(()=>{let e=t&&"/"!==i?(e,r)=>t(t_({},e,{pathname:_(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(ru,()=>window.scrollY,e);return()=>r&&r()},[n,i,t]),p.useLayoutEffect(()=>{if(!1!==o){if("number"==typeof o)return void window.scrollTo(0,o);if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==a&&window.scrollTo(0,0)}},[l,o,a]))}function rd(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 rh(e){let{when:t,message:r}=e,n=tv(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])}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_form_engine_app=globalThis.webpackChunk_openmrs_esm_form_engine_app||[]).push([["9712"],{27059(e,t,r){r.r(t),r.d(t,{useFetchers:()=>rT,unstable_HistoryRouter:()=>ry,useLoaderData:()=>t_,ScrollRestoration:()=>rR,Route:()=>t$,MemoryRouter:()=>tz,useMatches:()=>tk,redirect:()=>er,useOutletContext:()=>td,createRoutesFromElements:()=>tQ,useLinkClickHandler:()=>rP,useRouteError:()=>tT,generatePath:()=>O,replace:()=>ea,useHref:()=>tn,useParams:()=>tf,UNSAFE_ViewTransitionContext:()=>ri,useRoutes:()=>tm,useSubmit:()=>r_,UNSAFE_NavigationContext:()=>e6,Navigate:()=>tH,UNSAFE_ErrorResponseImpl:()=>eo,UNSAFE_FetchersContext:()=>rl,useAsyncError:()=>tM,createRoutesFromChildren:()=>tQ,unstable_usePrompt:()=>rN,useFetcher:()=>rU,useBlocker:()=>tF,createHashRouter:()=>ra,UNSAFE_useRouteId:()=>tP,useMatch:()=>tl,useNavigation:()=>tD,HashRouter:()=>rv,useFormAction:()=>rA,useResolvedPath:()=>tp,defer:()=>et,Router:()=>tV,Routes:()=>tJ,useActionData:()=>tU,useRouteLoaderData:()=>tA,Await:()=>tK,matchPath:()=>F,UNSAFE_DataRouterContext:()=>e5,BrowserRouter:()=>rm,NavigationType:()=>c,Form:()=>rS,UNSAFE_RouteContext:()=>tt,createSearchParams:()=>t5,RouterProvider:()=>rf,UNSAFE_LocationContext:()=>te,parsePath:()=>D,Outlet:()=>tW,createMemoryRouter:()=>t1,UNSAFE_useScrollRestoration:()=>rO,useNavigate:()=>tu,matchRoutes:()=>A,createPath:()=>P,resolvePath:()=>z,useInRouterContext:()=>ta,useOutlet:()=>th,useAsyncValue:()=>tj,useViewTransitionState:()=>rB,Link:()=>rb,AbortedDeferredError:()=>Z,renderMatches:()=>tZ,NavLink:()=>rE,UNSAFE_DataRouterStateContext:()=>e9,json:()=>Q,useSearchParams:()=>rD,redirectDocument:()=>en,useBeforeUnload:()=>rF,useLocation:()=>to,createBrowserRouter:()=>rn,isRouteErrorResponse:()=>ei,useNavigationType:()=>ti,useRevalidator:()=>tL});var n,a,o,i,l,s,u,c,d,h,f,p=r(35399),m=r(43144),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)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}(n=c||(c={})).Pop="POP",n.Push="PUSH",n.Replace="REPLACE";let g="popstate";function w(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 R("/"===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 b(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){R("/"===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 R(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 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=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=C(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 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,String(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 A(e,t,r){return void 0===r&&(r="/"),U(e,t,r,!1)}function U(e,t,r,n){let a=B(("string"==typeof t?D(t):t).pathname||"/",r);if(null==a)return null;let o=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=Y([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(M)&&(c+=-2),s&&(c+=2),u.filter(e=>!M(e)).reduce((e,t)=>e+(j.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);o.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 i=null,l=N(a);for(let e=0;null==i&&e<o.length;++e)i=function(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=F({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},u),d=l.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=F({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Y([o,c.pathname]),pathnameBase:q(Y([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=Y([o,c.pathnameBase]))}return i}(o[e],l,n);return i}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 j=/^:[\w-]+$/,M=e=>"*"===e;function O(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(R(!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 F(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),R("*"===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 N(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return R(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function B(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)||"/"}let I=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function z(e,t){let r;void 0===t&&(t="/");let{pathname:n,search:a="",hash:o=""}="string"==typeof e?D(e):e;if(n){let e;(e=n,I.test(e))?r=n:(n.includes("//")&&R(!1,"Pathnames cannot have embedded double slashes - normalizing "+n+" -> "+(n=K(n))),r=n.startsWith("/")?H(n.substring(1),"/"):H(n,t))}else r=t;return{pathname:r,search:X(a),hash:G(o)}}function H(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function W(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 $(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function V(e,t){let r=$(e);return t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase)}function J(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("?"),W("?","pathname","search",a)),S(!a.pathname||!a.pathname.includes("#"),W("#","pathname","hash",a)),S(!a.search||!a.search.includes("#"),W("#","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=z(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}let K=e=>e.replace(/\/\/+/g,"/"),Y=e=>K(e.join("/")),q=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",G=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",Q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),y({},r,{headers:n}))};class Z extends Error{}class ee{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 Z("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 Z)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 et=function(e,t){return void 0===t&&(t={}),new ee(e,"number"==typeof t?{status:t}:t)},er=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}))},en=(e,t)=>{let r=er(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},ea=(e,t)=>{let r=er(e,t);return r.headers.set("X-Remix-Replace","true"),r};class eo{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 ei(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}let el=["post","put","patch","delete"],es=new Set(el),eu=new Set(["get",...el]),ec=new Set([301,302,303,307,308]),ed=new Set([307,308]),eh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ef={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ep={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},em=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ev=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ey="remix-router-transitions";function eg(e){let t,r,n,a,o,i,l=e.window?e.window:"u">typeof window?window:void 0,s=void 0!==l&&void 0!==l.document&&void 0!==l.document.createElement,u=!s;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=ev;let h={},f=_(e.routes,t,void 0,h),p=e.basename||"/",m=e.dataStrategy||eL,v=e.patchRoutesOnNavigation,g=y({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),w=null,b=new Set,E=null,x=null,P=null,D=null!=e.hydrationData,L=A(f,e.history.location,p),k=!1,j=null;if(null==L&&!v){let t=ez(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=eI(f);L=r,j={[n.id]:t}}if(L&&!e.hydrationData&&to(L,f,e.history.location.pathname).active&&(L=null),L)if(L.some(e=>e.route.lazy))n=!1;else if(L.some(e=>e.route.loader))if(g.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;if(r){let e=L.findIndex(e=>void 0!==r[e.route.id]);n=L.slice(0,e+1).every(e=>!eR(e.route,t,r))}else n=L.every(e=>!eR(e.route,t,r))}else n=null!=e.hydrationData;else n=!0;else if(n=!1,L=[],g.v7_partialHydration){let t=to(null,f,e.history.location.pathname);t.active&&t.matches&&(k=!0,L=t.matches)}let M={historyAction:e.history.action,location:e.history.location,matches:L,initialized:n,navigation:eh,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||j,fetchers:new Map,blockers:new Map},O=c.Pop,F=!1,N=!1,I=new Map,z=null,H=!1,W=!1,$=[],V=new Set,J=new Map,K=0,Y=-1,q=new Map,X=new Set,G=new Map,Q=new Map,Z=new Set,ee=new Map,et=new Map;function er(e,t){void 0===t&&(t={}),M=y({},M,e);let r=[],n=[];g.v7_fetcherPersist&&M.fetchers.forEach((e,t)=>{"idle"===e.state&&(Z.has(t)?n.push(t):r.push(t))}),Z.forEach(e=>{M.fetchers.has(e)||J.has(e)||n.push(e)}),[...b].forEach(e=>e(M,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),g.v7_fetcherPersist?(r.forEach(e=>M.fetchers.delete(e)),n.forEach(e=>eK(e))):n.forEach(e=>Z.delete(e))}function en(t,n,a){var o,i;let l,s,{flushSync:u}=void 0===a?{}:a,d=null!=M.actionData&&null!=M.navigation.formMethod&&eq(M.navigation.formMethod)&&"loading"===M.navigation.state&&(null==(o=t.state)?void 0:o._isRedirect)!==!0;l=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?M.actionData:null;let h=n.loaderData?eF(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,p=M.blockers;p.size>0&&(p=new Map(p)).forEach((e,t)=>p.set(t,ep));let m=!0===F||null!=M.navigation.formMethod&&eq(M.navigation.formMethod)&&(null==(i=t.state)?void 0:i._isRedirect)!==!0;if(r&&(f=r,r=void 0),H||O===c.Pop||(O===c.Push?e.history.push(t,t.state):O===c.Replace&&e.history.replace(t,t.state)),O===c.Pop){let e=I.get(M.location.pathname);e&&e.has(t.pathname)?s={currentLocation:M.location,nextLocation:t}:I.has(t.pathname)&&(s={currentLocation:t,nextLocation:M.location})}else if(N){let e=I.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),I.set(M.location.pathname,e)),s={currentLocation:M.location,nextLocation:t}}er(y({},n,{actionData:l,loaderData:h,historyAction:O,location:t,initialized:!0,navigation:eh,revalidation:"idle",restoreScrollPosition:ta(t,n.matches||M.matches),preventScrollReset:m,blockers:p}),{viewTransitionOpts:s,flushSync:!0===u}),O=c.Pop,F=!1,N=!1,H=!1,W=!1,$=[]}async function ea(t,r){if("number"==typeof t)return void e.history.go(t);let n=ew(M.location,M.matches,p,g.v7_prependBasename,t,g.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:a,submission:o,error:i}=eb(g.v7_normalizeFormMethod,!1,n,r),l=M.location,s=C(M.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&&eq(o.formMethod)&&o.formAction===M.location.pathname+M.location.search&&(d=c.Replace);let h=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,f=!0===(r&&r.flushSync),m=te({currentLocation:l,nextLocation:s,historyAction:d});return m?void e6(m,{state:"blocked",location:s,proceed(){e6(m,{state:"proceeding",proceed:void 0,reset:void 0,location:s}),ea(t,r)},reset(){let e=new Map(M.blockers);e.set(m,ep),er({blockers:e})}}):await eo(d,s,{submission:o,pendingError:i,preventScrollReset:h,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:f})}async function eo(t,n,a){var i,l,s,u;let c;o&&o.abort(),o=null,O=t,H=!0===(a&&a.startUninterruptedRevalidation),i=M.location,l=M.matches,E&&P&&(E[tn(i,l)]=P()),F=!0===(a&&a.preventScrollReset),N=!0===(a&&a.enableViewTransition);let h=r||f,m=a&&a.overrideNavigation,v=null!=a&&a.initialHydration&&M.matches&&M.matches.length>0&&!k?M.matches:A(h,n,p),g=!0===(a&&a.flushSync);if(v&&M.initialized&&!W&&(s=M.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&&eq(a.submission.formMethod)))return void en(n,{matches:v},{flushSync:g});let w=to(v,h,n.pathname);if(w.active&&w.matches&&(v=w.matches),!v){let{error:e,notFoundMatches:t,route:r}=tt(n.pathname);en(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:g});return}o=new AbortController;let b=eT(e.history,n,o.signal,a&&a.submission);if(a&&a.pendingError)c=[eB(v).route.id,{type:d.error,error:a.pendingError}];else if(a&&a.submission&&eq(a.submission.formMethod)){let t=await el(b,n,a.submission,v,w.active,{replace:a.replace,flushSync:g});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(eV(r)&&ei(r.error)&&404===r.error.status){o=null,en(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}v=t.matches||v,c=t.pendingActionResult,m=e7(n,a.submission),g=!1,w.active=!1,b=eT(e.history,b.url,b.signal)}let{shortCircuited:S,matches:R,loaderData:x,errors:C}=await es(b,n,v,w.active,m,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,g,c);S||(o=null,en(n,y({matches:R||v},eN(c),{loaderData:x,errors:C})))}async function el(t,r,n,a,o,i){var l;let s;if(void 0===i&&(i={}),e_(),er({navigation:{state:"submitting",location:r,formMethod:(l=n).formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}},{flushSync:!0===i.flushSync}),o){let e=await ti(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=eB(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:d.error,error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:n}=tt(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:d.error,error:t}]}}}let u=e0(a,r);if(u.route.action||u.route.lazy){if(s=(await eC("action",M,t,[u],a,null))[u.route.id],t.signal.aborted)return{shortCircuited:!0}}else s={type:d.error,error:ez(405,{method:t.method,pathname:r.pathname,routeId:u.route.id})};if(eJ(s)){let r;return r=i&&null!=i.replace?i.replace:eU(s.response.headers.get("Location"),new URL(t.url),p,e.history)===M.location.pathname+M.location.search,await ex(t,s,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(e$(s))throw ez(400,{type:"defer-action"});if(eV(s)){let e=eB(a,u.route.id);return!0!==(i&&i.replace)&&(O=c.Push),{matches:a,pendingActionResult:[e.route.id,s]}}return{matches:a,pendingActionResult:[u.route.id,s]}}async function es(t,n,a,i,l,s,u,c,d,h,m){let v=l||e7(n,s),w=s||u||e1(v),b=!H&&(!g.v7_partialHydration||!d);if(i){if(b){let e=eu(m);er(y({navigation:v},void 0!==e?{actionData:e}:{}),{flushSync:h})}let e=await ti(a,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=eB(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches;else{let{error:e,notFoundMatches:t,route:r}=tt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let E=r||f,[S,R]=eS(e.history,M,a,w,n,g.v7_partialHydration&&!0===d,g.v7_skipActionErrorRevalidation,W,$,V,Z,G,X,E,p,m);if(tr(e=>!(a&&a.some(t=>t.route.id===e))||S&&S.some(t=>t.route.id===e)),Y=++K,0===S.length&&0===R.length){let e=e5();return en(n,y({matches:a,loaderData:{},errors:m&&eV(m[1])?{[m[0]]:m[1].error}:null},eN(m),e?{fetchers:new Map(M.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(b){let e={};if(!i){e.navigation=v;let t=eu(m);void 0!==t&&(e.actionData=t)}R.length>0&&(R.forEach(e=>{let t=M.fetchers.get(e.key),r=e4(void 0,t?t.data:void 0);M.fetchers.set(e.key,r)}),e.fetchers=new Map(M.fetchers)),er(e,{flushSync:h})}R.forEach(e=>{eZ(e.key),e.controller&&J.set(e.key,e.controller)});let x=()=>R.forEach(e=>eZ(e.key));o&&o.signal.addEventListener("abort",x);let{loaderResults:C,fetcherResults:P}=await eD(M,a,S,R,t);if(t.signal.aborted)return{shortCircuited:!0};o&&o.signal.removeEventListener("abort",x),R.forEach(e=>J.delete(e.key));let D=eH(C);if(D)return await ex(t,D.result,!0,{replace:c}),{shortCircuited:!0};if(D=eH(P))return X.add(D.key),await ex(t,D.result,!0,{replace:c}),{shortCircuited:!0};let{loaderData:L,errors:k}=eO(M,a,C,m,R,P,ee);ee.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&ee.delete(t)})}),g.v7_partialHydration&&d&&M.errors&&(k=y({},M.errors,k));let _=e5(),A=e9(Y),U=_||A||R.length>0;return y({matches:a,loaderData:L,errors:k},U?{fetchers:new Map(M.fetchers)}:{})}function eu(e){if(e&&!eV(e[1]))return{[e[0]]:e[1].data};if(M.actionData)if(0===Object.keys(M.actionData).length)return null;else return M.actionData}async function eg(t,n,a,i,l,s,u,c,d){var h,m;function v(e){if(!e.route.action&&!e.route.lazy){let e=ez(405,{method:d.formMethod,pathname:a,routeId:n});return eM(t,n,e,{flushSync:u}),!0}return!1}if(e_(),G.delete(t),!s&&v(i))return;let y=M.fetchers.get(t);ej(t,(h=d,m=y,{state:"submitting",formMethod:h.formMethod,formAction:h.formAction,formEncType:h.formEncType,formData:h.formData,json:h.json,text:h.text,data:m?m.data:void 0}),{flushSync:u});let w=new AbortController,b=eT(e.history,a,w.signal,d);if(s){let e=await ti(l,new URL(b.url).pathname,b.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void eM(t,n,e.error,{flushSync:u});if(!e.matches)return void eM(t,n,ez(404,{pathname:a}),{flushSync:u});if(v(i=e0(l=e.matches,a)))return}J.set(t,w);let E=K,R=(await eC("action",M,b,[i],l,t))[i.route.id];if(b.signal.aborted){J.get(t)===w&&J.delete(t);return}if(g.v7_fetcherPersist&&Z.has(t)){if(eJ(R)||eV(R))return void ej(t,e2(void 0))}else{if(eJ(R))return(J.delete(t),Y>E)?void ej(t,e2(void 0)):(X.add(t),ej(t,e4(d)),ex(b,R,!1,{fetcherSubmission:d,preventScrollReset:c}));if(eV(R))return void eM(t,n,R.error)}if(e$(R))throw ez(400,{type:"defer-action"});let x=M.navigation.location||M.location,C=eT(e.history,x,w.signal),P=r||f,D="idle"!==M.navigation.state?A(P,M.navigation.location,p):M.matches;S(D,"Didn't find any matches after fetcher action");let L=++K;q.set(t,L);let k=e4(d,R.data);M.fetchers.set(t,k);let[_,U]=eS(e.history,M,D,d,x,!1,g.v7_skipActionErrorRevalidation,W,$,V,Z,G,X,P,p,[i.route.id,R]);U.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=M.fetchers.get(t),n=e4(void 0,r?r.data:void 0);M.fetchers.set(t,n),eZ(t),e.controller&&J.set(t,e.controller)}),er({fetchers:new Map(M.fetchers)});let T=()=>U.forEach(e=>eZ(e.key));w.signal.addEventListener("abort",T);let{loaderResults:j,fetcherResults:F}=await eD(M,D,_,U,C);if(w.signal.aborted)return;w.signal.removeEventListener("abort",T),q.delete(t),J.delete(t),U.forEach(e=>J.delete(e.key));let N=eH(j);if(N)return ex(C,N.result,!1,{preventScrollReset:c});if(N=eH(F))return X.add(N.key),ex(C,N.result,!1,{preventScrollReset:c});let{loaderData:B,errors:I}=eO(M,D,j,void 0,U,F,ee);if(M.fetchers.has(t)){let e=e2(R.data);M.fetchers.set(t,e)}e9(L),"loading"===M.navigation.state&&L>Y?(S(O,"Expected pending action"),o&&o.abort(),en(M.navigation.location,{matches:D,loaderData:B,errors:I,fetchers:new Map(M.fetchers)})):(er({errors:I,loaderData:eF(M.loaderData,B,D,I),fetchers:new Map(M.fetchers)}),W=!1)}async function eE(t,r,n,a,o,i,l,s,u){let c=M.fetchers.get(t);ej(t,e4(u,c?c.data:void 0),{flushSync:l});let d=new AbortController,h=eT(e.history,n,d.signal);if(i){let e=await ti(o,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void eM(t,r,e.error,{flushSync:l});if(!e.matches)return void eM(t,r,ez(404,{pathname:n}),{flushSync:l});a=e0(o=e.matches,n)}J.set(t,d);let f=K,p=(await eC("loader",M,h,[a],o,t))[a.route.id];if(e$(p)&&(p=await eQ(p,h.signal,!0)||p),J.get(t)===d&&J.delete(t),!h.signal.aborted){if(Z.has(t))return void ej(t,e2(void 0));if(eJ(p))if(Y>f)return void ej(t,e2(void 0));else{X.add(t),await ex(h,p,!1,{preventScrollReset:s});return}if(eV(p))return void eM(t,r,p.error);S(!e$(p),"Unhandled fetcher deferred data"),ej(t,e2(p.data))}}async function ex(t,r,n,a){let{submission:i,fetcherSubmission:u,preventScrollReset:d,replace:h}=void 0===a?{}:a;r.response.headers.has("X-Remix-Revalidate")&&(W=!0);let f=r.response.headers.get("Location");S(f,"Expected a Location header on the redirect Response"),f=eU(f,new URL(t.url),p,e.history);let m=C(M.location,f,{_isRedirect:!0});if(s){let t=!1;if(r.response.headers.has("X-Remix-Reload-Document"))t=!0;else if(em.test(f)){let r=e.history.createURL(f);t=r.origin!==l.location.origin||null==B(r.pathname,p)}if(t)return void(h?l.location.replace(f):l.location.assign(f))}o=null;let v=!0===h||r.response.headers.has("X-Remix-Replace")?c.Replace:c.Push,{formMethod:g,formAction:w,formEncType:b}=M.navigation;!i&&!u&&g&&w&&b&&(i=e1(M.navigation));let E=i||u;if(ed.has(r.response.status)&&E&&eq(E.formMethod))await eo(v,m,{submission:y({},E,{formAction:f}),preventScrollReset:d||F,enableViewTransition:n?N:void 0});else{let e=e7(m,i);await eo(v,m,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:d||F,enableViewTransition:n?N:void 0})}}async function eC(e,r,n,a,o,i){let l,s={};try{l=await ek(m,e,r,n,a,o,i,h,t)}catch(e){return a.forEach(t=>{s[t.route.id]={type:d.error,error:e}}),s}for(let[e,t]of Object.entries(l)){var u;if(eY((u=t).result)&&ec.has(u.result.status)){let r=t.result;s[e]={type:d.redirect,response:function(e,t,r,n,a,o){let i=e.headers.get("Location");if(S(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!em.test(i)){let l=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=ew(new URL(t.url),l,a,!0,i,o),e.headers.set("Location",i)}return e}(r,n,e,o,p,g.v7_relativeSplatPath)}}else s[e]=await eA(t)}return s}async function eD(t,r,n,a,o){let i=t.matches,l=eC("loader",t,o,n,r,null),s=Promise.all(a.map(async r=>{if(!r.matches||!r.match||!r.controller)return Promise.resolve({[r.key]:{type:d.error,error:ez(404,{pathname:r.path})}});{let n=(await eC("loader",t,eT(e.history,r.path,r.controller.signal),[r.match],r.matches,r.key))[r.match.route.id];return{[r.key]:n}}})),u=await l,c=(await s).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([eX(r,u,o.signal,i,t.loaderData),eG(r,c,a)]),{loaderResults:u,fetcherResults:c}}function e_(){W=!0,$.push(...tr()),G.forEach((e,t)=>{J.has(t)&&V.add(t),eZ(t)})}function ej(e,t,r){void 0===r&&(r={}),M.fetchers.set(e,t),er({fetchers:new Map(M.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eM(e,t,r,n){void 0===n&&(n={});let a=eB(M.matches,t);eK(e),er({errors:{[a.route.id]:r},fetchers:new Map(M.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eW(e){return Q.set(e,(Q.get(e)||0)+1),Z.has(e)&&Z.delete(e),M.fetchers.get(e)||ef}function eK(e){let t=M.fetchers.get(e);J.has(e)&&!(t&&"loading"===t.state&&q.has(e))&&eZ(e),G.delete(e),q.delete(e),X.delete(e),g.v7_fetcherPersist&&Z.delete(e),V.delete(e),M.fetchers.delete(e)}function eZ(e){let t=J.get(e);t&&(t.abort(),J.delete(e))}function e3(e){for(let t of e){let e=e2(eW(t).data);M.fetchers.set(t,e)}}function e5(){let e=[],t=!1;for(let r of X){let n=M.fetchers.get(r);S(n,"Expected fetcher: "+r),"loading"===n.state&&(X.delete(r),e.push(r),t=!0)}return e3(e),t}function e9(e){let t=[];for(let[r,n]of q)if(n<e){let e=M.fetchers.get(r);S(e,"Expected fetcher: "+r),"loading"===e.state&&(eZ(r),q.delete(r),t.push(r))}return e3(t),t.length>0}function e8(e){M.blockers.delete(e),et.delete(e)}function e6(e,t){let r=M.blockers.get(e)||ep;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(M.blockers);n.set(e,t),er({blockers:n})}function te(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===et.size)return;et.size>1&&R(!1,"A router only supports one blocker at a time");let a=Array.from(et.entries()),[o,i]=a[a.length-1],l=M.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:t,nextLocation:r,historyAction:n}))return o}function tt(e){let t=ez(404,{pathname:e}),{matches:n,route:a}=eI(r||f);return tr(),{notFoundMatches:n,route:a,error:t}}function tr(e){let t=[];return ee.forEach((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),ee.delete(n))}),t}function tn(e,t){return x&&x(e,t.map(e=>T(e,M.loaderData)))||e.key}function ta(e,t){if(E){let r=E[tn(e,t)];if("number"==typeof r)return r}return null}function to(e,t,r){if(v){if(!e)return{active:!0,matches:U(t,r,p,!0)||[]};else if(Object.keys(e[0].params).length>0)return{active:!0,matches:U(t,r,p,!0)}}return{active:!1,matches:null}}async function ti(e,n,a,o){if(!v)return{type:"success",matches:e};let i=e;for(;;){let e=null==r,l=r||f,s=h;try{await v({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,r)=>{a.aborted||eP(e,r,l,s,t)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{e&&!a.aborted&&(f=[...f])}if(a.aborted)return{type:"aborted"};let u=A(l,n,p);if(u)return{type:"success",matches:u};let c=U(l,n,p,!0);if(!c||i.length===c.length&&i.every((e,t)=>e.route.id===c[t].route.id))return{type:"success",matches:null};i=c}}return a={get basename(){return p},get future(){return g},get state(){return M},get routes(){return f},get window(){return l},initialize:function(){if(w=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(i){i(),i=void 0;return}R(0===et.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=te({currentLocation:M.location,nextLocation:n,historyAction:r});if(o&&null!=a){let t=new Promise(e=>{i=e});e.history.go(-1*a),e6(o,{state:"blocked",location:n,proceed(){e6(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(a))},reset(){let e=new Map(M.blockers);e.set(o,ep),er({blockers:e})}});return}return eo(r,n)}),s){var t=l,r=I;try{let e=t.sessionStorage.getItem(ey);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(ey,JSON.stringify(r))}catch(e){R(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}})(l,I);l.addEventListener("pagehide",e),z=()=>l.removeEventListener("pagehide",e)}return M.initialized||eo(c.Pop,M.location,{initialHydration:!0}),a},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(E=e,P=t,x=r||null,!D&&M.navigation===eh){D=!0;let e=ta(M.location,M.matches);null!=e&&er({restoreScrollPosition:e})}return()=>{E=null,P=null,x=null}},navigate:ea,fetch:function(e,t,n,a){if(u)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.");eZ(e);let o=!0===(a&&a.flushSync),i=r||f,l=ew(M.location,M.matches,p,g.v7_prependBasename,n,g.v7_relativeSplatPath,t,null==a?void 0:a.relative),s=A(i,l,p),c=to(s,i,l);if(c.active&&c.matches&&(s=c.matches),!s)return void eM(e,t,ez(404,{pathname:l}),{flushSync:o});let{path:d,submission:h,error:m}=eb(g.v7_normalizeFormMethod,!0,l,a);if(m)return void eM(e,t,m,{flushSync:o});let v=e0(s,d),y=!0===(a&&a.preventScrollReset);h&&eq(h.formMethod)?eg(e,t,d,v,s,c.active,o,y,h):(G.set(e,{routeId:t,path:d}),eE(e,t,d,v,s,c.active,o,y,h))},revalidate:function(){if(e_(),er({revalidation:"loading"}),"submitting"!==M.navigation.state){if("idle"===M.navigation.state)return void eo(M.historyAction,M.location,{startUninterruptedRevalidation:!0});eo(O||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:!0===N})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eW,deleteFetcher:function(e){let t=(Q.get(e)||0)-1;t<=0?(Q.delete(e),Z.add(e),g.v7_fetcherPersist||eK(e)):Q.set(e,t),er({fetchers:new Map(M.fetchers)})},dispose:function(){w&&w(),z&&z(),b.clear(),o&&o.abort(),M.fetchers.forEach((e,t)=>eK(t)),M.blockers.forEach((e,t)=>e8(t))},getBlocker:function(e,t){let r=M.blockers.get(e)||ep;return et.get(e)!==t&&et.set(e,t),r},deleteBlocker:e8,patchRoutes:function(e,n){let a=null==r;eP(e,n,r||f,h,t),a&&(f=[...f],er({}))},_internalFetchControllers:J,_internalActiveDeferreds:ee,_internalSetRoutes:function(e){r=_(e,t,void 0,h={})}}}function ew(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=J(a||".",V(s,o),B(e.pathname,r)||e.pathname,"path"===l);if(null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u){let e=eZ(c.search);if(u.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();c.search=r?"?"+r:""}}return n&&"/"!==r&&(c.pathname="/"===c.pathname?r:Y([r,c.pathname])),P(c)}function eb(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,!eu.has(a.toLowerCase())))return{path:r,error:ez(405,{method:n.formMethod})};let l=()=>({path:r,error:ez(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=eW(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!eq(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(!eq(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=ej(n.formData),i=n.formData;else if(n.body instanceof FormData)o=ej(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=eM(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=eM(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(eq(d.formMethod))return{path:r,submission:d};let h=D(r);return t&&h.search&&eZ(h.search)&&o.append("index",""),h.search="?"+o,{path:P(h),submission:d}}function eE(e,t,r){void 0===r&&(r=!1);let n=e.findIndex(e=>e.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function eS(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m){let v=m?eV(m[1])?m[1].error:m[1].data:void 0,g=e.createURL(t.location),w=e.createURL(a),b=r;o&&t.errors?b=eE(r,Object.keys(t.errors)[0],!0):m&&eV(m[1])&&(b=eE(r,m[0]));let E=m?m[1].statusCode:void 0,S=i&&E&&E>=400,R=b.filter((e,r)=>{var a,i,u;let c,d,{route:h}=e;if(h.lazy)return!0;if(null==h.loader)return!1;if(o)return eR(h,t.loaderData,t.errors);if(a=t.loaderData,i=t.matches[r],u=e,c=!i||u.route.id!==i.route.id,d=void 0===a[u.route.id],c||d||s.some(t=>t===e.route.id))return!0;let f=t.matches[r];return eC(e,y({currentUrl:g,currentParams:f.params,nextUrl:w,nextParams:e.params},n,{actionResult:v,actionStatus:E,defaultShouldRevalidate:!S&&(l||g.pathname+g.search===w.pathname+w.search||g.search!==w.search||ex(f,e))}))}),x=[];return d.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||c.has(a))return;let i=A(f,e.path,p);if(!i)return void x.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let s=t.fetchers.get(a),d=e0(i,e.path),m=!1;h.has(a)?m=!1:u.has(a)?(u.delete(a),m=!0):m=s&&"idle"!==s.state&&void 0===s.data?l:eC(d,y({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params},n,{actionResult:v,actionStatus:E,defaultShouldRevalidate:!S&&l})),m&&x.push({key:a,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})}),[R,x]}function eR(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=null!=t&&void 0!==t[e.id],a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function ex(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function eC(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function eP(e,t,r,n,a){var o;let i;if(e){let t=n[e];S(t,"No route found to patch children into: routeId = "+e),t.children||(t.children=[]),i=t.children}else i=r;let l=_(t.filter(e=>!i.some(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>{var a;return null==(a=r.children)?void 0:a.some(r=>e(t,r))}))})(e,t))),a,[e||"_","patch",String((null==(o=i)?void 0:o.length)||"0")],n);i.push(...l)}async function eD(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;R(!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 eL(e){let{matches:t}=e,r=t.filter(e=>e.shouldLoad);return(await Promise.all(r.map(e=>e.resolve()))).reduce((e,t,n)=>Object.assign(e,{[r[n].route.id]:t}),{})}async function ek(e,t,r,n,a,o,i,l,s,u){let c=o.map(e=>e.route.lazy?eD(e.route,s,l):void 0),h=o.map((e,r)=>{let o=c[r],i=a.some(t=>t.route.id===e.route.id),l=async r=>(r&&"GET"===n.method&&(e.route.lazy||e.route.loader)&&(i=!0),i?e_(t,n,e,o,r,u):Promise.resolve({type:d.data,result:void 0}));return y({},e,{shouldLoad:i,resolve:l})}),f=await e({matches:h,request:n,params:o[0].params,fetcherKey:i,context:u});try{await Promise.all(c)}catch(e){}return f}async function e_(e,t,r,n,a,o){let i,l,s=n=>{let i,s=new Promise((e,t)=>i=t);l=()=>i(),t.signal.addEventListener("abort",l);let u=a=>"function"!=typeof n?Promise.reject(Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: ')+r.route.id+"]")):n({request:t,params:r.params,context:o},...void 0!==a?[a]:[]);return Promise.race([(async()=>{try{let e=await (a?a(e=>u(e)):u());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),s])};try{let a=r.route[e];if(n)if(a){let e,[t]=await Promise.all([s(a).catch(t=>{e=t}),n]);if(void 0!==e)throw e;i=t}else if(await n,a=r.route[e])i=await s(a);else{if("action"!==e)return{type:d.data,result:void 0};let n=new URL(t.url),a=n.pathname+n.search;throw ez(405,{method:t.method,pathname:a,routeId:r.route.id})}else if(a)i=await s(a);else{let e=new URL(t.url),r=e.pathname+e.search;throw ez(404,{pathname:r})}S(void 0!==i.result,"You defined "+("action"===e?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `")+e+"` function. Please return a value or `null`.")}catch(e){return{type:d.error,result:e}}finally{l&&t.signal.removeEventListener("abort",l)}return i}async function eA(e){var t,r,n,a,o,i,l,s,u;let{result:c,type:h}=e;if(eY(c)){let e;try{let t=c.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==c.body?null:await c.json():await c.text()}catch(e){return{type:d.error,error:e}}return h===d.error?{type:d.error,error:new eo(c.status,c.statusText,e),statusCode:c.status,headers:c.headers}:{type:d.data,data:e,statusCode:c.status,headers:c.headers}}if(h===d.error)return eK(c)?c.data instanceof Error?{type:d.error,error:c.data,statusCode:null==(n=c.init)?void 0:n.status,headers:null!=(a=c.init)&&a.headers?new Headers(c.init.headers):void 0}:{type:d.error,error:new eo((null==(t=c.init)?void 0:t.status)||500,void 0,c.data),statusCode:ei(c)?c.status:void 0,headers:null!=(r=c.init)&&r.headers?new Headers(c.init.headers):void 0}:{type:d.error,error:c,statusCode:ei(c)?c.status:void 0};return(u=c)&&"object"==typeof u&&"object"==typeof u.data&&"function"==typeof u.subscribe&&"function"==typeof u.cancel&&"function"==typeof u.resolveData?{type:d.deferred,deferredData:c,statusCode:null==(o=c.init)?void 0:o.status,headers:(null==(i=c.init)?void 0:i.headers)&&new Headers(c.init.headers)}:eK(c)?{type:d.data,data:c.data,statusCode:null==(l=c.init)?void 0:l.status,headers:null!=(s=c.init)&&s.headers?new Headers(c.init.headers):void 0}:{type:d.data,data:c}}function eU(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(em.test(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e);if(a.includes(n.protocol))throw Error("Invalid redirect location");let o=null!=B(n.pathname,r);if(n.origin===t.origin&&o)return K(n.pathname)+n.search+n.hash}try{let t=n.createURL(e);if(a.includes(t.protocol))throw Error("Invalid redirect location")}catch(e){}return e}function eT(e,t,r,n){let a=e.createURL(eW(t)).toString(),o={signal:r};if(n&&eq(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=ej(n.formData):o.body=n.formData}return new Request(a,o)}function ej(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eM(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eO(e,t,r,n,a,o,i){let l,s,u,c,d,h,{loaderData:f,errors:p}=(s={},u=null,c=!1,d={},h=n&&eV(n[1])?n[1].error:void 0,t.forEach(e=>{if(!(e.route.id in r))return;let n=e.route.id,a=r[n];if(S(!eJ(a),"Cannot handle redirect results in processLoaderData"),eV(a)){let e=a.error;void 0!==h&&(e=h,h=void 0),u=u||{},1;{let r=eB(t,n);null==u[r.route.id]&&(u[r.route.id]=e)}s[n]=void 0,c||(c=!0,l=ei(a.error)?a.error.status:500),a.headers&&(d[n]=a.headers)}else e$(a)?(i.set(n,a.deferredData),s[n]=a.deferredData.data,null==a.statusCode||200===a.statusCode||c||(l=a.statusCode)):(s[n]=a.data,a.statusCode&&200!==a.statusCode&&!c&&(l=a.statusCode)),a.headers&&(d[n]=a.headers)}),void 0!==h&&n&&(u={[n[0]]:h},s[n[0]]=void 0),{loaderData:s,errors:u,statusCode:l||200,loaderHeaders:d});return a.forEach(t=>{let{key:r,match:n,controller:a}=t,i=o[r];if(S(i,"Did not find corresponding fetcher result"),!a||!a.signal.aborted)if(eV(i)){let t=eB(e.matches,null==n?void 0:n.route.id);p&&p[t.route.id]||(p=y({},p,{[t.route.id]:i.error})),e.fetchers.delete(r)}else if(eJ(i))S(!1,"Unhandled fetcher revalidation redirect");else if(e$(i))S(!1,"Unhandled fetcher deferred data");else{let t=e2(i.data);e.fetchers.set(r,t)}}),{loaderData:f,errors:p}}function eF(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 eN(e){return e?eV(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function eB(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 eI(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 ez(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=void 0===t?{}:t,l="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(l="Bad Request",a&&r&&n?s="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?s="defer() is not supported in actions":"invalid-body"===o&&(s="Unable to encode submission body")):403===e?(l="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):404===e?(l="Not Found",s='No route matches URL "'+r+'"'):405===e&&(l="Method Not Allowed",a&&r&&n?s="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(s='Invalid request method "'+a.toUpperCase()+'"')),new eo(e||500,l,Error(s),!0)}function eH(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eJ(n))return{key:r,result:n}}}function eW(e){let t="string"==typeof e?D(e):e;return P(y({},t,{hash:""}))}function e$(e){return e.type===d.deferred}function eV(e){return e.type===d.error}function eJ(e){return(e&&e.type)===d.redirect}function eK(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eY(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function eq(e){return es.has(e.toLowerCase())}async function eX(e,t,r,n,a){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[l,s]=o[i],u=e.find(e=>(null==e?void 0:e.route.id)===l);if(!u)continue;let c=n.find(e=>e.route.id===u.route.id),d=null!=c&&!ex(c,u)&&(a&&a[u.route.id])!==void 0;e$(s)&&d&&await eQ(s,r,!1).then(e=>{e&&(t[l]=e)})}}async function eG(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:o,controller:i}=r[n],l=t[a];e.find(e=>(null==e?void 0:e.route.id)===o)&&e$(l)&&(S(i,"Expected an AbortController for revalidating fetcher deferred result"),await eQ(l,i.signal,!0).then(e=>{e&&(t[a]=e)}))}}async function eQ(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 eZ(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function e0(e,t){let r="string"==typeof t?D(t).search:t.search;if(e[e.length-1].route.index&&eZ(r||""))return e[e.length-1];let n=$(e);return n[n.length-1]}function e1(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 e7(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 e4(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 e2(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 e3(){return(e3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}Symbol("deferred");let e5=p.createContext(null),e9=p.createContext(null),e8=p.createContext(null),e6=p.createContext(null),te=p.createContext(null),tt=p.createContext({outlet:null,matches:[],isDataRoute:!1}),tr=p.createContext(null);function tn(e,t){let{relative:r}=void 0===t?{}:t;ta()||S(!1);let{basename:n,navigator:a}=p.useContext(e6),{hash:o,pathname:i,search:l}=tp(e,{relative:r}),s=i;return"/"!==n&&(s="/"===i?n:Y([n,i])),a.createHref({pathname:s,search:l,hash:o})}function ta(){return null!=p.useContext(te)}function to(){return ta()||S(!1),p.useContext(te).location}function ti(){return p.useContext(te).navigationType}function tl(e){ta()||S(!1);let{pathname:t}=to();return p.useMemo(()=>F(e,N(t)),[t,e])}function ts(e){p.useContext(e6).static||p.useLayoutEffect(e)}function tu(){let{isDataRoute:e}=p.useContext(tt);return e?function(){let{router:e}=tR(tE.UseNavigateStable),t=tC(tS.UseNavigateStable),r=p.useRef(!1);return ts(()=>{r.current=!0}),p.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,e3({fromRouteId:t},a)))},[e,t])}():function(){ta()||S(!1);let e=p.useContext(e5),{basename:t,future:r,navigator:n}=p.useContext(e6),{matches:a}=p.useContext(tt),{pathname:o}=to(),i=JSON.stringify(V(a,r.v7_relativeSplatPath)),l=p.useRef(!1);return ts(()=>{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=J(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:Y([t,s.pathname])),(a.replace?n.replace:n.push)(s,a.state,a)},[t,n,i,o,e])}()}let tc=p.createContext(null);function td(){return p.useContext(tc)}function th(e){let t=p.useContext(tt).outlet;return t?p.createElement(tc.Provider,{value:e},t):t}function tf(){let{matches:e}=p.useContext(tt),t=e[e.length-1];return t?t.params:{}}function tp(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=p.useContext(e6),{matches:a}=p.useContext(tt),{pathname:o}=to(),i=JSON.stringify(V(a,n.v7_relativeSplatPath));return p.useMemo(()=>J(e,JSON.parse(i),o,"path"===r),[e,i,o,r])}function tm(e,t){return tv(e,t)}function tv(e,t,r,n){let a;ta()||S(!1);let{navigator:o}=p.useContext(e6),{matches:i}=p.useContext(tt),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let d=to();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=A(e,{pathname:m}),y=tb(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Y([u,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:Y([u,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,r,n);return t&&y?p.createElement(te.Provider,{value:{location:e3({pathname:"/",search:"",hash:"",state:null,key:"default"},a),navigationType:c.Pop}},y):y}let ty=p.createElement(function(){let e=tT(),t=ei(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 tg 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(tt.Provider,{value:this.props.routeContext},p.createElement(tr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tw(e){let{routeContext:t,match:r,children:n}=e,a=p.useContext(e5);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(tt.Provider,{value:t},n)}function tb(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(!r)return null;if(r.errors)e=r.matches;else{if(null==(o=n)||!o.v7_partialHydration||0!==t.length||r.initialized||!(r.matches.length>0))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])!==void 0);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||ty,s&&(u<0&&0===a?(o="route-fallback",tN[o]||(tN[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(tw,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?p.createElement(tg,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var tE=((o=tE||{}).UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o),tS=((i=tS||{}).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 tR(e){let t=p.useContext(e5);return t||S(!1),t}function tx(e){let t=p.useContext(e9);return t||S(!1),t}function tC(e){let t,r=((t=p.useContext(tt))||S(!1),t),n=r.matches[r.matches.length-1];return n.route.id||S(!1),n.route.id}function tP(){return tC(tS.UseRouteId)}function tD(){return tx(tS.UseNavigation).navigation}function tL(){let e=tR(tE.UseRevalidator),t=tx(tS.UseRevalidator);return p.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function tk(){let{matches:e,loaderData:t}=tx(tS.UseMatches);return p.useMemo(()=>e.map(e=>T(e,t)),[e,t])}function t_(){let e=tx(tS.UseLoaderData),t=tC(tS.UseLoaderData);return e.errors&&null!=e.errors[t]?void console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")"):e.loaderData[t]}function tA(e){return tx(tS.UseRouteLoaderData).loaderData[e]}function tU(){let e=tx(tS.UseActionData),t=tC(tS.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function tT(){var e;let t=p.useContext(tr),r=tx(tS.UseRouteError),n=tC(tS.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function tj(){let e=p.useContext(e8);return null==e?void 0:e._data}function tM(){let e=p.useContext(e8);return null==e?void 0:e._error}let tO=0;function tF(e){let{router:t,basename:r}=tR(tE.UseBlocker),n=tx(tS.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:e3({},n,{pathname:B(n.pathname,r)||n.pathname}),nextLocation:e3({},a,{pathname:B(a.pathname,r)||a.pathname}),historyAction:o})},[r,e]);return p.useEffect(()=>{let e=String(++tO);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):ep}let tN={};function tB(e,t){(null==e||e.v7_startTransition,(null==e?void 0:e.v7_relativeSplatPath)!==void 0||t&&void 0!==t.v7_relativeSplatPath,t)&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}let tI=p.startTransition;function tz(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:o}=e,i=p.useRef();null==i.current&&(i.current=w({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&&tI?tI(()=>u(e)):u(e)},[u,c]);return p.useLayoutEffect(()=>l.listen(d),[l,d]),p.useEffect(()=>tB(o),[o]),p.createElement(tV,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}function tH(e){let{to:t,replace:r,state:n,relative:a}=e;ta()||S(!1);let{future:o,static:i}=p.useContext(e6),{matches:l}=p.useContext(tt),{pathname:s}=to(),u=tu(),c=JSON.stringify(J(t,V(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 tW(e){return th(e.context)}function t$(e){S(!1)}function tV(e){let{basename:t="/",children:r=null,location:n,navigationType:a=c.Pop,navigator:o,static:i=!1,future:l}=e;ta()&&S(!1);let s=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:s,navigator:o,static:i,future:e3({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=B(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(e6.Provider,{value:u},p.createElement(te.Provider,{children:r,value:y}))}function tJ(e){let{children:t,location:r}=e;return tv(tQ(t),r)}function tK(e){let{children:t,errorElement:r,resolve:n}=e;return p.createElement(tX,{resolve:n,errorElement:r},p.createElement(tG,null,t))}var tY=((l=tY||{})[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l);let tq=new Promise(()=>{});class tX 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=tY.pending;if(r instanceof Promise)if(this.state.error){a=tY.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="_error"in(n=r)?tY.error:"_data"in n?tY.success:tY.pending:(a=tY.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=tY.success,Object.defineProperty(n=Promise.resolve(),"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(a===tY.error&&n._error instanceof Z)throw tq;if(a===tY.error&&!t)throw n._error;if(a===tY.error)return p.createElement(e8.Provider,{value:n,children:t});if(a===tY.success)return p.createElement(e8.Provider,{value:n,children:e});throw n}}function tG(e){let{children:t}=e,r=tj(),n="function"==typeof t?t(r):t;return p.createElement(p.Fragment,null,n)}function tQ(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,tQ(e.props.children,a));e.type!==t$&&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=tQ(e.props.children,a)),r.push(o)}),r}function tZ(e){return tb(e)}function t0(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 t1(e,t){return eg({basename:null==t?void 0:t.basename,future:e3({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:w({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:t0,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation}).initialize()}function t7(){return(t7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function t4(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}let t2="application/x-www-form-urlencoded";function t3(e){return null!=e&&"string"==typeof e.tagName}function t5(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 t9=null,t8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function t6(e){return null==e||t8.has(e)?e:null}let re=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rt=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],rr=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function rn(e,t){return eg({basename:null==t?void 0:t.basename,future:t7({},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)||ro(),routes:e,mapRouteProperties:t0,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function ra(e,t){return eg({basename:null==t?void 0:t.basename,future:t7({},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)||ro(),routes:e,mapRouteProperties:t0,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function ro(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=t7({},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 eo(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 ri=p.createContext({isTransitioning:!1}),rl=p.createContext(new Map),rs=p.startTransition,ru=v.flushSync,rc=p.useId;function rd(e){ru?ru(e):e()}class rh{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 rf(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||{},w=p.useCallback(e=>{if(g)rs?rs(e):e();else e()},[g]),b=p.useCallback((e,t)=>{let{deletedFetchers:n,flushSync:a,viewTransitionOpts:i}=t;e.fetchers.forEach((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}),n.forEach(e=>y.current.delete(e));let s=null==r.window||null==r.window.document||"function"!=typeof r.window.document.startViewTransition;if(!i||s)return void(a?rd(()=>o(e)):w(()=>o(e)));if(a){rd(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})});let t=r.window.document.startViewTransition(()=>{rd(()=>o(e))});t.finished.finally(()=>{rd(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})}),rd(()=>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,w]);p.useLayoutEffect(()=>r.subscribe(b),[r,b]),p.useEffect(()=>{s.isTransitioning&&!s.flushSync&&d(new rh)},[s]),p.useEffect(()=>{if(c&&i&&r.window){let e=c.promise,t=r.window.document.startViewTransition(async()=>{w(()=>o(i)),await e});t.finished.finally(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}),f(t)}},[w,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||"/",R=p.useMemo(()=>({router:r,navigator:E,static:!1,basename:S}),[r,E,S]),x=p.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return p.useEffect(()=>tB(n,r.future),[n,r.future]),p.createElement(p.Fragment,null,p.createElement(e5.Provider,{value:R},p.createElement(e9.Provider,{value:a},p.createElement(rl.Provider,{value:y.current},p.createElement(ri.Provider,{value:s},p.createElement(tV,{basename:S,location:a.location,navigationType:a.historyAction,navigator:E,future:x},a.initialized||r.future.v7_partialHydration?p.createElement(rp,{routes:r.routes,future:r.future,state:a}):t))))),null)}let rp=p.memo(function(e){let{routes:t,future:r,state:n}=e;return tv(t,void 0,n,r)});function rm(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&&rs?rs(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.useEffect(()=>tB(n),[n]),p.createElement(tV,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function rv(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&&rs?rs(()=>s(e)):s(e)},[s,u]);return p.useLayoutEffect(()=>i.listen(c),[i,c]),p.useEffect(()=>tB(n),[n]),p.createElement(tV,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function ry(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&&rs?rs(()=>i(e)):i(e)},[i,l]);return p.useLayoutEffect(()=>a.listen(s),[a,s]),p.useEffect(()=>tB(n),[n]),p.createElement(tV,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}let rg="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,rw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rb=p.forwardRef(function(e,t){let r,{onClick:n,relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:c,viewTransition:d}=e,h=t4(e,re),{basename:f}=p.useContext(e6),m=!1;if("string"==typeof u&&rw.test(u)&&(r=u,rg))try{let e=new URL(window.location.href),t=new URL(u.startsWith("//")?e.protocol+u:u),r=B(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch(e){}let v=tn(u,{relative:a}),y=rP(u,{replace:i,state:l,target:s,preventScrollReset:c,relative:a,viewTransition:d});return p.createElement("a",t7({},h,{href:r||v,onClick:m||o?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:s}))}),rE=p.forwardRef(function(e,t){let r,{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,viewTransition:u,children:c}=e,d=t4(e,rt),h=tp(s,{relative:d.relative}),f=to(),m=p.useContext(e9),{navigator:v,basename:y}=p.useContext(e6),g=null!=m&&rB(h)&&!0===u,w=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,b=f.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&y&&(E=B(E,y)||E);let S="/"!==w&&w.endsWith("/")?w.length-1:w.length,R=b===w||!i&&b.startsWith(w)&&"/"===b.charAt(S),x=null!=E&&(E===w||!i&&E.startsWith(w)&&"/"===E.charAt(w.length)),C={isActive:R,isPending:x,isTransitioning:g},P=R?n:void 0;r="function"==typeof o?o(C):[o,R?"active":null,x?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(C):l;return p.createElement(rb,t7({},d,{"aria-current":P,className:r,ref:t,style:D,to:s,viewTransition:u}),"function"==typeof c?c(C):c)}),rS=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,viewTransition:h}=e,f=t4(e,rr),m=r_(),v=rA(s,{relative:c}),y="get"===l.toLowerCase()?"get":"post";return p.createElement("form",t7({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,viewTransition:h})}},f))});function rR(e){let{getKey:t,storageKey:r}=e;return rO({getKey:t,storageKey:r}),null}function rx(e){let t=p.useContext(e5);return t||S(!1),t}function rC(e){let t=p.useContext(e9);return t||S(!1),t}function rP(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,viewTransition:l}=void 0===t?{}:t,s=tu(),u=to(),c=tp(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,viewTransition:l}))},[u,s,c,n,a,r,e,o,i,l])}function rD(e){let t=p.useRef(t5(e)),r=p.useRef(!1),n=to(),a=p.useMemo(()=>{var e,a;let o;return e=n.search,a=r.current?null:t.current,o=t5(e),a&&a.forEach((e,t)=>{o.has(t)||a.getAll(t).forEach(e=>{o.append(t,e)})}),o},[n.search]),o=tu(),i=p.useCallback((e,t)=>{let n=t5("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 rL=0,rk=()=>"__"+String(++rL)+"__";function r_(){let{router:e}=rx(h.UseSubmit),{basename:t}=p.useContext(e6),r=tP();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(t3(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?B(i,t):null,r=e.getAttribute("method")||"get",a=t6(e.getAttribute("enctype"))||t2,o=new FormData(e)}else if(t3(e)&&"button"===e.tagName.toLowerCase()||t3(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?B(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",a=t6(e.getAttribute("formenctype"))||t6(i.getAttribute("enctype"))||t2,o=new FormData(i,e),!function(){if(null===t9)try{new FormData(document.createElement("form"),0),t9=!1}catch(e){t9=!0}return t9}()){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(t3(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=t2,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||rk();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.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,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function rA(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=p.useContext(e6),a=p.useContext(tt);a||S(!1);let[o]=a.matches.slice(-1),i=t7({},tp(e||".",{relative:r})),l=to();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();i.search=r?"?"+r:""}}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:Y([n,i.pathname])),P(i)}function rU(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=rx(h.UseFetcher),a=rC(f.UseFetcher),o=p.useContext(rl),i=p.useContext(tt),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=rc?rc():"",[u,c]=p.useState(r||s);r&&r!==u?c(r):u||c(rk()),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=r_(),v=p.useCallback((e,t)=>{m(e,t7({},t,{navigate:!1,fetcherKey:u}))},[u,m]),y=p.useMemo(()=>p.forwardRef((e,t)=>p.createElement(rS,t7({},e,{navigate:!1,fetcherKey:u,ref:t}))),[u]),g=a.fetchers.get(u)||ef,w=o.get(u);return p.useMemo(()=>t7({Form:y,submit:v,load:d},g,{data:w}),[y,v,d,g,w])}function rT(){return Array.from(rC(f.UseFetchers).fetchers.entries()).map(e=>{let[t,r]=e;return t7({},r,{key:t})})}let rj="react-router-scroll-positions",rM={};function rO(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=rx(h.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=rC(f.UseScrollRestoration),{basename:i}=p.useContext(e6),l=to(),s=tk(),u=tD();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&&(rM[(t?t(l,s):null)||l.key]=window.scrollY);try{sessionStorage.setItem(r||rj,JSON.stringify(rM))}catch(e){}window.history.scrollRestoration="auto"},[r,t,u.state,l,s])),"u">typeof document&&(p.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||rj);e&&(rM=JSON.parse(e))}catch(e){}},[r]),p.useLayoutEffect(()=>{let e=t&&"/"!==i?(e,r)=>t(t7({},e,{pathname:B(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(rM,()=>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 rF(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 rN(e){let{when:t,message:r}=e,n=tF(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 rB(e,t){void 0===t&&(t={});let r=p.useContext(ri);null==r&&S(!1);let{basename:n}=rx(h.useViewTransitionState),a=tp(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=B(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=B(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=F(a.pathname,i)||null!=F(a.pathname,o)}}}]);
|