@openmrs/esm-fast-data-entry-app 1.3.1-pre.269 → 1.3.1-pre.277
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/dist/1003.js +1 -0
- package/dist/1003.js.map +1 -0
- package/dist/1119.js +1 -1
- package/dist/1197.js +1 -1
- package/dist/1258.js +2 -0
- package/dist/1258.js.LICENSE.txt +9 -0
- package/dist/1258.js.map +1 -0
- package/dist/2146.js +1 -1
- package/dist/2656.js +1 -0
- package/dist/2656.js.map +1 -0
- package/dist/2690.js +1 -1
- package/dist/282.js +1 -1
- package/dist/282.js.map +1 -1
- package/dist/3012.js +2 -0
- package/dist/3012.js.LICENSE.txt +5 -0
- package/dist/3012.js.map +1 -0
- package/dist/3099.js +1 -1
- package/dist/3414.js +1 -0
- package/dist/3414.js.map +1 -0
- package/dist/3584.js +1 -1
- package/dist/3889.js +1 -0
- package/dist/3889.js.map +1 -0
- package/dist/4055.js +1 -1
- package/dist/4132.js +1 -1
- package/dist/4300.js +1 -1
- package/dist/4335.js +1 -1
- package/dist/4513.js +2 -0
- package/dist/4513.js.LICENSE.txt +14 -0
- package/dist/4513.js.map +1 -0
- package/dist/4618.js +1 -1
- package/dist/4652.js +1 -1
- package/dist/4944.js +1 -1
- package/dist/4957.js +1 -1
- package/dist/4957.js.map +1 -1
- package/dist/5173.js +1 -1
- package/dist/5241.js +1 -1
- package/dist/531.js +2 -0
- package/dist/{3009.js.LICENSE.txt → 531.js.LICENSE.txt} +0 -6
- package/dist/531.js.map +1 -0
- package/dist/5442.js +1 -1
- package/dist/564.js +1 -0
- package/dist/564.js.map +1 -0
- package/dist/5661.js +1 -1
- package/dist/5732.js +2 -0
- package/dist/5732.js.map +1 -0
- package/dist/6022.js +1 -1
- package/dist/6468.js +1 -1
- package/dist/6540.js +1 -1
- package/dist/6540.js.map +1 -1
- package/dist/6679.js +1 -1
- package/dist/6840.js +1 -1
- package/dist/6859.js +1 -1
- package/dist/7069.js +1 -0
- package/dist/7069.js.map +1 -0
- package/dist/7097.js +1 -1
- package/dist/7159.js +1 -1
- package/dist/7195.js +1 -0
- package/dist/7195.js.map +1 -0
- package/dist/7219.js +1 -0
- package/dist/{5265.js.map → 7219.js.map} +1 -1
- package/dist/723.js +1 -1
- package/dist/7617.js +1 -1
- package/dist/8091.js +1 -0
- package/dist/8091.js.map +1 -0
- package/dist/8163.js +1 -1
- package/dist/8349.js +1 -1
- package/dist/8618.js +1 -1
- package/dist/890.js +1 -1
- package/dist/9214.js +1 -1
- package/dist/9543.js +1 -1
- package/dist/9543.js.map +1 -1
- package/dist/9578.js +1 -0
- package/dist/9578.js.map +1 -0
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/986.js +1 -1
- package/dist/9879.js +1 -1
- package/dist/9900.js +1 -1
- package/dist/9913.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +326 -308
- package/dist/openmrs-esm-fast-data-entry-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/jest.config.json +1 -1
- package/package.json +4 -4
- package/src/add-group-modal/AddGroupModal.tsx +1 -0
- package/src/forms-page/FormsPage.tsx +6 -7
- package/src/forms-page/forms-table/FormsTable.tsx +30 -20
- package/src/group-form-entry-workflow/SessionDetailsForm.tsx +5 -5
- package/src/group-form-entry-workflow/attendance-table/AttendanceTable.tsx +1 -1
- package/src/group-form-entry-workflow/group-search/CompactGroupResults.tsx +1 -6
- package/src/group-form-entry-workflow/group-search/CompactGroupSearch.tsx +4 -5
- package/src/group-form-entry-workflow/group-search/compact-group-result.scss +5 -0
- package/dist/2127.js +0 -1
- package/dist/2127.js.map +0 -1
- package/dist/3009.js +0 -2
- package/dist/3009.js.map +0 -1
- package/dist/3041.js +0 -1
- package/dist/3041.js.map +0 -1
- package/dist/3262.js +0 -2
- package/dist/3262.js.map +0 -1
- package/dist/3579.js +0 -1
- package/dist/3579.js.map +0 -1
- package/dist/4993.js +0 -1
- package/dist/4993.js.map +0 -1
- package/dist/5151.js +0 -2
- package/dist/5151.js.LICENSE.txt +0 -7
- package/dist/5151.js.map +0 -1
- package/dist/5265.js +0 -1
- package/dist/5422.js +0 -2
- package/dist/5422.js.LICENSE.txt +0 -9
- package/dist/5422.js.map +0 -1
- package/dist/6066.js +0 -1
- package/dist/6066.js.map +0 -1
- package/dist/6077.js +0 -1
- package/dist/6077.js.map +0 -1
- package/dist/6141.js +0 -2
- package/dist/6141.js.LICENSE.txt +0 -9
- package/dist/6141.js.map +0 -1
- package/dist/6269.js +0 -1
- package/dist/6269.js.map +0 -1
- package/dist/7236.js +0 -1
- package/dist/7236.js.map +0 -1
- package/dist/9088.js +0 -1
- package/dist/9088.js.map +0 -1
- package/dist/962.js +0 -1
- package/dist/962.js.map +0 -1
- /package/dist/{3262.js.LICENSE.txt → 5732.js.LICENSE.txt} +0 -0
package/dist/282.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 282.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[282],{282:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>V,Await:()=>Ht,BrowserRouter:()=>Sr,Form:()=>_r,HashRouter:()=>Rr,Link:()=>Lr,MemoryRouter:()=>Ot,NavLink:()=>Pr,Navigate:()=>Ft,NavigationType:()=>n,Outlet:()=>Nt,Route:()=>Bt,Router:()=>It,RouterProvider:()=>wr,Routes:()=>zt,ScrollRestoration:()=>kr,UNSAFE_DataRouterContext:()=>$e,UNSAFE_DataRouterStateContext:()=>Je,UNSAFE_FetchersContext:()=>pr,UNSAFE_LocationContext:()=>Ye,UNSAFE_NavigationContext:()=>Ve,UNSAFE_RouteContext:()=>Xe,UNSAFE_ViewTransitionContext:()=>fr,UNSAFE_useRouteId:()=>St,UNSAFE_useScrollRestoration:()=>$r,createBrowserRouter:()=>ur,createHashRouter:()=>cr,createMemoryRouter:()=>Xt,createPath:()=>m,createRoutesFromChildren:()=>qt,createRoutesFromElements:()=>qt,createSearchParams:()=>rr,defer:()=>G,generatePath:()=>j,isRouteErrorResponse:()=>te,json:()=>q,matchPath:()=>M,matchRoutes:()=>E,parsePath:()=>v,redirect:()=>Q,redirectDocument:()=>Z,renderMatches:()=>Vt,resolvePath:()=>N,unstable_HistoryRouter:()=>xr,unstable_usePrompt:()=>qr,unstable_useViewTransitionState:()=>Vr,useActionData:()=>Pt,useAsyncError:()=>Tt,useAsyncValue:()=>kt,useBeforeUnload:()=>Jr,useBlocker:()=>Ut,useFetcher:()=>zr,useFetchers:()=>Hr,useFormAction:()=>Ir,useHref:()=>Qe,useInRouterContext:()=>Ze,useLinkClickHandler:()=>Mr,useLoaderData:()=>Ct,useLocation:()=>et,useMatch:()=>rt,useMatches:()=>Dt,useNavigate:()=>at,useNavigation:()=>Rt,useNavigationType:()=>tt,useOutlet:()=>lt,useOutletContext:()=>it,useParams:()=>st,useResolvedPath:()=>ut,useRevalidator:()=>xt,useRouteError:()=>_t,useRouteLoaderData:()=>Lt,useRoutes:()=>ct,useSearchParams:()=>Or,useSubmit:()=>Br});var n,a=r(6072),o=r(2646);function i(){return i=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},i.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const l="popstate";function s(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==a?t.length-1:a),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=p(t?c().pathname:"/",e,r,n);return h("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function f(e){return"string"==typeof e?e:m(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:f,createURL:e=>new URL(f(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?v(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=u(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function u(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:m(t)}),null,e)}function c(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=v(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:m(t))}),(function(e,t){h("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function d(e,t){if(!1===e||null==e)throw new Error(t)}function h(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,r,n){return void 0===r&&(r=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?v(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function m(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function v(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function y(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:s=!1}=a,u=o.history,c=n.Pop,h=null,v=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-v;v=e,h&&h({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:m(e);return r=r.replace(/ $/,"%20"),d(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,u.replaceState(i({},u.state,{idx:v}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(l,g),h=e,()=>{o.removeEventListener(l,g),h=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=p(w.location,e,t);r&&r(a,e),v=y()+1;let i=f(a,v),l=w.createHref(a);try{u.pushState(i,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(l)}s&&h&&h({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=p(w.location,e,t);r&&r(a,e),v=y();let o=f(a,v),i=w.createHref(a);u.replaceState(o,"",i),s&&h&&h({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var g;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));const b=new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,a],l="string"==typeof e.id?e.id:o.join("-");if(d(!0!==e.index||!e.children,"Cannot specify children on an index route"),d(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=i({},e,t(e),{id:l});return n[l]=r,r}{let r=i({},e,t(e),{id:l,children:void 0});return n[l]=r,e.children&&(r.children=w(e.children,t,o,n)),r}}))}function E(e,t,r){void 0===r&&(r="/");let n=F(("string"==typeof t?v(t):t).pathname||"/",r);if(null==n)return null;let a=R(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=O(n);o=U(a[e],t)}return o}function S(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function R(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(d(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=W([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(d(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),R(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:A(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of x(e.path))a(e,t,r);else a(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=x(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const D=/^:[\w-]+$/,C=3,L=2,P=1,_=10,k=-2,T=e=>"*"===e;function A(e,t){let r=e.split("/"),n=r.length;return r.some(T)&&(n+=k),t&&(n+=L),r.filter((e=>!T(e))).reduce(((e,t)=>e+(D.test(t)?C:""===t?P:_)),n)}function U(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=M({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:W([a,u.pathname]),pathnameBase:K(W([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=W([a,u.pathnameBase]))}return o}function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(h(!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(/\*$/,"/*"));const 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["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return d("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function M(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),h("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function O(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return h(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function N(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?v(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:$(n),hash:J(a)}}function B(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function I(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function z(e,t){let r=I(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function H(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=v(e):(a=i({},e),d(!a.pathname||!a.pathname.includes("?"),B("?","pathname","search",a)),d(!a.pathname||!a.pathname.includes("#"),B("#","pathname","hash",a)),d(!a.search||!a.search.includes("#"),B("#","search","hash",a)));let o,l=""===e||""===a.pathname,s=l?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=N(a,o),c=s&&"/"!==s&&s.endsWith("/"),h=(l||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!h||(u.pathname+="/"),u}const W=e=>e.join("/").replace(/\/\/+/g,"/"),K=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",J=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),i({},r,{headers:n}))};class V extends Error{}class Y{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],d(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new V("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof V)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return d(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:X(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function X(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const G=function(e,t){return void 0===t&&(t={}),new Y(e,"number"==typeof t?{status:t}:t)},Q=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,i({},r,{headers:n}))},Z=(e,t)=>{let r=Q(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class ee{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 te(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const re=["post","put","patch","delete"],ne=new Set(re),ae=["get",...re],oe=new Set(ae),ie=new Set([301,302,303,307,308]),le=new Set([307,308]),se={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ue={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},de=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,he=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),fe="remix-router-transitions";function pe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(d(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=he;let l,s,u={},c=w(e.routes,o,void 0,u),f=e.basename||"/",m=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),v=null,y=new Set,b=null,R=null,x=null,D=null!=e.hydrationData,C=E(c,e.history.location,f),L=null;if(null==C){let t=_e(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Pe(c);C=r,L={[n.id]:t}}let P,_=C.some((e=>e.route.lazy)),k=C.some((e=>e.route.loader));if(_)s=!1;else if(k)if(m.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=C.findIndex((e=>void 0!==r[e.route.id]));s=C.slice(0,e+1).every(n)}else s=C.every(n)}else s=null!=e.hydrationData;else s=!0;let T,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:s,navigation:se,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||L,fetchers:new Map,blockers:new Map},U=n.Pop,j=!1,M=!1,O=new Map,N=null,B=!1,I=!1,z=[],H=[],W=new Map,K=0,$=-1,J=new Map,q=new Set,V=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),A=i({},A,e);let r=[],n=[];m.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))})),[...y].forEach((e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),m.v7_fetcherPersist&&(r.forEach((e=>A.fetchers.delete(e))),n.forEach((e=>be(e))))}function te(t,r,a){var o,s;let u,{flushSync:d}=void 0===a?{}:a,h=null!=A.actionData&&null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?A.actionData:null;let f=r.loaderData?Ce(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,p=A.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,ce))));let m,v=!0===j||null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&!0!==(null==(s=t.state)?void 0:s._isRedirect);if(l&&(c=l,l=void 0),B||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=O.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:O.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(M){let e=O.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}ee(i({},r,{actionData:u,loaderData:f,historyAction:U,location:t,initialized:!0,navigation:se,revalidation:"idle",restoreScrollPosition:Ve(t,r.matches||A.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),U=n.Pop,j=!1,M=!1,B=!1,I=!1,z=[],H=[]}async function re(t,r,a){T&&T.abort(),T=null,U=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(b&&x){let r=qe(e,t);b[r]=x()}}(A.location,A.matches),j=!0===(a&&a.preventScrollReset),M=!0===(a&&a.enableViewTransition);let s=l||c,d=a&&a.overrideNavigation,h=E(s,r,f),p=!0===(a&&a.flushSync);if(!h){let e=_e(404,{pathname:r.pathname}),{matches:t,route:n}=Pe(s);return Je(),void te(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:p})}if(A.initialized&&!I&&(v=A.location,y=r,v.pathname===y.pathname&&v.search===y.search&&(""===v.hash?""!==y.hash:v.hash===y.hash||""!==y.hash))&&!(a&&a.submission&&Me(a.submission.formMethod)))return void te(r,{matches:h},{flushSync:p});var v,y;T=new AbortController;let w,S,R=Se(e.history,r,T.signal,a&&a.submission);if(a&&a.pendingError)S={[Le(h).route.id]:a.pendingError};else if(a&&a.submission&&Me(a.submission.formMethod)){let e=await async function(e,t,r,a,i){void 0===i&&(i={}),oe();let l,s=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,r);ee({navigation:s},{flushSync:!0===i.flushSync});let c=Be(a,t);if(c.route.action||c.route.lazy){if(l=await Ee("action",e,c,a,u,o,f,m.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:g.error,error:_e(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(je(l)){let e;return e=i&&null!=i.replace?i.replace:l.location===A.location.pathname+A.location.search,await ne(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(Ue(l)){let e=Le(a,c.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Ae(l))throw _e(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(R,r,a.submission,h,{replace:a.replace,flushSync:p});if(e.shortCircuited)return;w=e.pendingActionData,S=e.pendingActionError,d=ze(r,a.submission),p=!1,R=new Request(R.url,{signal:R.signal})}let{shortCircuited:D,loaderData:C,errors:L}=await async function(t,r,n,a,o,s,u,d,h,p,v){let y=a||ze(r,o),g=o||s||Ie(y),b=l||c,[w,E]=ye(e.history,A,n,g,r,m.v7_partialHydration&&!0===d,I,z,H,X,V,q,b,f,p,v);if(Je((e=>!(n&&n.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),$=++K,0===w.length&&0===E.length){let e=xe();return te(r,i({matches:n,loaderData:{},errors:v||null},p?{actionData:p}:{},e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(!(B||m.v7_partialHydration&&d)){E.forEach((e=>{let t=A.fetchers.get(e.key),r=He(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=p||A.actionData;ee(i({navigation:y},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},E.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:h})}E.forEach((e=>{W.has(e.key)&&we(e.key),e.controller&&W.set(e.key,e.controller)}));let S=()=>E.forEach((e=>we(e.key)));T&&T.signal.addEventListener("abort",S);let{results:R,loaderResults:x,fetcherResults:D}=await ae(A.matches,n,w,E,t);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",S),E.forEach((e=>W.delete(e.key)));let C=ke(R);if(C){if(C.idx>=w.length){let e=E[C.idx-w.length].key;q.add(e)}return await ne(A,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:P}=De(A,n,w,x,v,E,D,G);G.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&G.delete(t)}))})),m.v7_partialHydration&&d&&A.errors&&Object.entries(A.errors).filter((e=>{let[t]=e;return!w.some((e=>e.route.id===t))})).forEach((e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})}));let _=xe(),k=Te($),U=_||k||E.length>0;return i({loaderData:L,errors:P},U?{fetchers:new Map(A.fetchers)}:{})}(R,r,h,d,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,p,w,S);D||(T=null,te(r,i({matches:h},w?{actionData:w}:{},{loaderData:C,errors:L})))}async function ne(a,o,l){let{submission:s,fetcherSubmission:u,replace:c}=void 0===l?{}:l;o.revalidate&&(I=!0);let h=p(a.location,o.location,{_isRedirect:!0});if(d(h,"Expected a location on the redirect navigation"),r){let r=!1;if(o.reloadDocument)r=!0;else if(de.test(o.location)){const n=e.history.createURL(o.location);r=n.origin!==t.location.origin||null==F(n.pathname,f)}if(r)return void(c?t.location.replace(o.location):t.location.assign(o.location))}T=null;let m=!0===c?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=a.navigation;!s&&!u&&v&&y&&g&&(s=Ie(a.navigation));let b=s||u;if(le.has(o.status)&&b&&Me(b.formMethod))await re(m,h,{submission:i({},b,{formAction:o.location}),preventScrollReset:j});else{let e=ze(h,s);await re(m,h,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:j})}}async function ae(t,r,n,a,i){let l=await Promise.all([...n.map((e=>Ee("loader",i,e,r,u,o,f,m.v7_relativeSplatPath))),...a.map((t=>t.matches&&t.match&&t.controller?Ee("loader",Se(e.history,t.path,t.controller.signal),t.match,t.matches,u,o,f,m.v7_relativeSplatPath):{type:g.error,error:_e(404,{pathname:t.path})}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Oe(t,n,s,s.map((()=>i.signal)),!1,A.loaderData),Oe(t,a.map((e=>e.match)),c,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function oe(){I=!0,z.push(...Je()),V.forEach(((e,t)=>{W.has(t)&&(H.push(t),we(t))}))}function ie(e,t,r){void 0===r&&(r={}),A.fetchers.set(e,t),ee({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function pe(e,t,r,n){void 0===n&&(n={});let a=Le(A.matches,t);be(e),ee({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ge(e){return m.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),A.fetchers.get(e)||ue}function be(e){let t=A.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&J.has(e)||we(e),V.delete(e),J.delete(e),q.delete(e),X.delete(e),A.fetchers.delete(e)}function we(e){let t=W.get(e);d(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function Re(e){for(let t of e){let e=We(ge(t).data);A.fetchers.set(t,e)}}function xe(){let e=[],t=!1;for(let r of q){let n=A.fetchers.get(r);d(n,"Expected fetcher: "+r),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return Re(e),t}function Te(e){let t=[];for(let[r,n]of J)if(n<e){let e=A.fetchers.get(r);d(e,"Expected fetcher: "+r),"loading"===e.state&&(we(r),J.delete(r),t.push(r))}return Re(t),t.length>0}function Ne(e){A.blockers.delete(e),Q.delete(e)}function Ke(e,t){let r=A.blockers.get(e)||ce;d("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(A.blockers);n.set(e,t),ee({blockers:n})}function $e(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&h(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=A.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function Je(e){let t=[];return G.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),G.delete(n))})),t}function qe(e,t){return R&&R(e,t.map((e=>S(e,A.loaderData))))||e.key}function Ve(e,t){if(b){let r=qe(e,t),n=b[r];if("number"==typeof n)return n}return null}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:function(){if(v=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(Z)return void(Z=!1);h(0===Q.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=$e({currentLocation:A.location,nextLocation:n,historyAction:r});return o&&null!=a?(Z=!0,e.history.go(-1*a),void Ke(o,{state:"blocked",location:n,proceed(){Ke(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(A.blockers);e.set(o,ce),ee({blockers:e})}})):re(r,n)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(fe);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,O);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(fe,JSON.stringify(r))}catch(e){h(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,O);t.addEventListener("pagehide",e),N=()=>t.removeEventListener("pagehide",e)}return A.initialized||re(n.Pop,A.location,{initialHydration:!0}),P},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(b=e,x=t,R=r||null,!D&&A.navigation===se){D=!0;let e=Ve(A.location,A.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{b=null,x=null,R=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=me(A.location,A.matches,f,m.v7_prependBasename,r,m.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:u}=ve(m.v7_normalizeFormMethod,!1,o,a),c=A.location,d=p(A.location,l,a&&a.state);d=i({},d,e.history.encodeLocation(d));let h=a&&null!=a.replace?a.replace:void 0,v=n.Push;!0===h?v=n.Replace:!1===h||null!=s&&Me(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=!0===(a&&a.unstable_flushSync),b=$e({currentLocation:c,nextLocation:d,historyAction:v});if(!b)return await re(v,d,{submission:s,pendingError:u,preventScrollReset:y,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:g});Ke(b,{state:"blocked",location:d,proceed(){Ke(b,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(b,ce),ee({blockers:e})}})},fetch:function(t,r,n,i){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");W.has(t)&&we(t);let s=!0===(i&&i.unstable_flushSync),h=l||c,p=me(A.location,A.matches,f,m.v7_prependBasename,n,m.v7_relativeSplatPath,r,null==i?void 0:i.relative),v=E(h,p,f);if(!v)return void pe(t,r,_e(404,{pathname:p}),{flushSync:s});let{path:y,submission:g,error:b}=ve(m.v7_normalizeFormMethod,!0,p,i);if(b)return void pe(t,r,b,{flushSync:s});let w=Be(v,y);j=!0===(i&&i.preventScrollReset),g&&Me(g.formMethod)?async function(t,r,n,a,i,s,h){if(oe(),V.delete(t),!a.route.action&&!a.route.lazy){let e=_e(405,{method:h.formMethod,pathname:n,routeId:r});return void pe(t,r,e,{flushSync:s})}let p=A.fetchers.get(t);ie(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(h,p),{flushSync:s});let v=new AbortController,y=Se(e.history,n,v.signal,h);W.set(t,v);let g=K,b=await Ee("action",y,a,i,u,o,f,m.v7_relativeSplatPath);if(y.signal.aborted)return void(W.get(t)===v&&W.delete(t));if(m.v7_fetcherPersist&&X.has(t)){if(je(b)||Ue(b))return void ie(t,We(void 0))}else{if(je(b))return W.delete(t),$>g?void ie(t,We(void 0)):(q.add(t),ie(t,He(h)),ne(A,b,{fetcherSubmission:h}));if(Ue(b))return void pe(t,r,b.error)}if(Ae(b))throw _e(400,{type:"defer-action"});let w=A.navigation.location||A.location,S=Se(e.history,w,v.signal),R=l||c,x="idle"!==A.navigation.state?E(R,A.navigation.location,f):A.matches;d(x,"Didn't find any matches after fetcher action");let D=++K;J.set(t,D);let C=He(h,b.data);A.fetchers.set(t,C);let[L,P]=ye(e.history,A,x,h,w,!1,I,z,H,X,V,q,R,f,{[a.route.id]:b.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=He(void 0,r?r.data:void 0);A.fetchers.set(t,n),W.has(t)&&we(t),e.controller&&W.set(t,e.controller)})),ee({fetchers:new Map(A.fetchers)});let _=()=>P.forEach((e=>we(e.key)));v.signal.addEventListener("abort",_);let{results:k,loaderResults:j,fetcherResults:M}=await ae(A.matches,x,L,P,S);if(v.signal.aborted)return;v.signal.removeEventListener("abort",_),J.delete(t),W.delete(t),P.forEach((e=>W.delete(e.key)));let O=ke(k);if(O){if(O.idx>=L.length){let e=P[O.idx-L.length].key;q.add(e)}return ne(A,O.result)}let{loaderData:F,errors:N}=De(A,A.matches,L,j,void 0,P,M,G);if(A.fetchers.has(t)){let e=We(b.data);A.fetchers.set(t,e)}Te(D),"loading"===A.navigation.state&&D>$?(d(U,"Expected pending action"),T&&T.abort(),te(A.navigation.location,{matches:x,loaderData:F,errors:N,fetchers:new Map(A.fetchers)})):(ee({errors:N,loaderData:Ce(A.loaderData,F,x,N),fetchers:new Map(A.fetchers)}),I=!1)}(t,r,y,w,v,s,g):(V.set(t,{routeId:r,path:y}),async function(t,r,n,a,i,l,s){let c=A.fetchers.get(t);ie(t,He(s,c?c.data:void 0),{flushSync:l});let h=new AbortController,p=Se(e.history,n,h.signal);W.set(t,h);let v=K,y=await Ee("loader",p,a,i,u,o,f,m.v7_relativeSplatPath);if(Ae(y)&&(y=await Fe(y,p.signal,!0)||y),W.get(t)===h&&W.delete(t),!p.signal.aborted){if(!X.has(t))return je(y)?$>v?void ie(t,We(void 0)):(q.add(t),void await ne(A,y)):void(Ue(y)?pe(t,r,y.error):(d(!Ae(y),"Unhandled fetcher deferred data"),ie(t,We(y.data))));ie(t,We(void 0))}}(t,r,y,w,v,s,g))},revalidate:function(){oe(),ee({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?re(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):re(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ge,deleteFetcher:function(e){if(m.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else be(e);ee({fetchers:new Map(A.fetchers)})},dispose:function(){v&&v(),N&&N(),y.clear(),T&&T.abort(),A.fetchers.forEach(((e,t)=>be(t))),A.blockers.forEach(((e,t)=>Ne(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||ce;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:Ne,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){u={},l=w(e,o,void 0,u)}},P}function me(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=H(a||".",z(s,o),F(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||Ne(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:W([r,c.pathname])),m(c)}function ve(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!oe.has(a.toLowerCase())))return{path:r,error:_e(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:_e(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=Te(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Me(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}}}if("application/json"===n.formEncType){if(!Me(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(d("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=Re(n.formData),i=n.formData;else if(n.body instanceof FormData)o=Re(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=xe(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=xe(o)}catch(e){return l()}let h={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Me(h.formMethod))return{path:r,submission:h};let f=v(r);return t&&f.search&&Ne(f.search)&&o.append("index",""),f.search="?"+o,{path:m(f),submission:h}}function ye(e,t,r,n,a,o,l,s,u,c,d,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v?Object.keys(v)[0]:void 0,S=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(r,w).filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||s.some((t=>t===e.route.id)))return!0;let u=t.matches[r],c=e;return be(e,i({currentUrl:g,currentParams:u.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,defaultShouldRevalidate:l||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||ge(u,c)}))})),R=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let s=E(f,e.path,p);if(!s)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let d=t.fetchers.get(a),m=Be(s,e.path),v=!1;v=!h.has(a)&&(!!u.includes(a)||(d&&"idle"!==d.state&&void 0===d.data?l:be(m,i({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:l})))),v&&R.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:m,controller:new AbortController})})),[S,R]}function ge(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function be(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function we(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];d(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;h(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||b.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,i({},t(a),{lazy:void 0}))}async function Ee(e,t,r,n,a,o,i,l,s){let u,c,h;void 0===s&&(s={});let f=e=>{let n,a=new Promise(((e,t)=>n=t));return h=()=>n(),t.signal.addEventListener("abort",h),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([f(n).catch((t=>{e=t})),we(r.route,o,a)]);if(e)throw e;c=t[0]}else{if(await we(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw _e(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:g.data,data:void 0}}c=await f(n)}else{if(!n){let e=new URL(t.url);throw _e(404,{pathname:e.pathname+e.search})}c=await f(n)}d(void 0!==c,"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){u=g.error,c=e}finally{h&&t.signal.removeEventListener("abort",h)}if(null!=(p=c)&&"number"==typeof p.status&&"string"==typeof p.statusText&&"object"==typeof p.headers&&void 0!==p.body){let e,a=c.status;if(ie.has(a)){let e=c.headers.get("Location");if(d(e,"Redirects returned/thrown from loaders/actions must have a Location header"),de.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=F(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=me(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:g.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:u===g.error?g.error:g.data,response:c};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:g.error,error:e}}return u===g.error?{type:u,error:new ee(a,c.statusText,e),headers:c.headers}:{type:g.data,data:e,statusCode:c.status,headers:c.headers}}var p,m,v;return u===g.error?{type:u,error:c}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(c)?{type:g.deferred,deferredData:c,statusCode:null==(m=c.init)?void 0:m.status,headers:(null==(v=c.init)?void 0:v.headers)&&new Headers(c.init.headers)}:{type:g.data,data:c}}function Se(e,t,r,n){let a=e.createURL(Te(t)).toString(),o={signal:r};if(n&&Me(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=Re(n.formData):o.body=n.formData}return new Request(a,o)}function Re(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function xe(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function De(e,t,r,n,a,o,l,s){let{loaderData:u,errors:c}=function(e,t,r,n,a){let o,i={},l=null,s=!1,u={};return r.forEach(((r,c)=>{let h=t[c].route.id;if(d(!je(r),"Cannot handle redirect results in processLoaderData"),Ue(r)){let t=Le(e,h),a=r.error;n&&(a=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=a),i[h]=void 0,s||(s=!0,o=te(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else Ae(r)?(a.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||s||(o=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n,a,s);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];d(void 0!==l&&void 0!==l[t],"Did not find corresponding fetcher result");let s=l[t];if(!a||!a.signal.aborted)if(Ue(s)){let t=Le(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=i({},c,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(je(s))d(!1,"Unhandled fetcher revalidation redirect");else if(Ae(s))d(!1,"Unhandled fetcher deferred data");else{let t=We(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:c}}function Ce(e,t,r,n){let a=i({},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 Le(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 Pe(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 _e(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new ee(e||500,i,new Error(l),!0)}function ke(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Te(e){return m(i({},"string"==typeof e?v(e):e,{hash:""}))}function Ae(e){return e.type===g.deferred}function Ue(e){return e.type===g.error}function je(e){return(e&&e.type)===g.redirect}function Me(e){return ne.has(e.toLowerCase())}async function Oe(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),c=null!=u&&!ge(u,s)&&void 0!==(o&&o[s.route.id]);if(Ae(l)&&(a||c)){let e=n[i];d(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Fe(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Fe(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:g.data,data:e.deferredData.unwrappedData}}catch(e){return{type:g.error,error:e}}return{type:g.data,data:e.deferredData.data}}}function Ne(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let r="string"==typeof t?v(t).search:t.search;if(e[e.length-1].route.index&&Ne(r||""))return e[e.length-1];let n=I(e);return n[n.length-1]}function Ie(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function ze(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 He(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 We(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 Ke(){return Ke=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},Ke.apply(this,arguments)}Symbol("deferred");const $e=a.createContext(null),Je=a.createContext(null),qe=a.createContext(null),Ve=a.createContext(null),Ye=a.createContext(null),Xe=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Ge=a.createContext(null);function Qe(e,t){let{relative:r}=void 0===t?{}:t;Ze()||d(!1);let{basename:n,navigator:o}=a.useContext(Ve),{hash:i,pathname:l,search:s}=ut(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:W([n,l])),o.createHref({pathname:u,search:s,hash:i})}function Ze(){return null!=a.useContext(Ye)}function et(){return Ze()||d(!1),a.useContext(Ye).location}function tt(){return a.useContext(Ye).navigationType}function rt(e){Ze()||d(!1);let{pathname:t}=et();return a.useMemo((()=>M(e,t)),[t,e])}function nt(e){a.useContext(Ve).static||a.useLayoutEffect(e)}function at(){let{isDataRoute:e}=a.useContext(Xe);return e?function(){let{router:e}=bt(yt.UseNavigateStable),t=Et(gt.UseNavigateStable),r=a.useRef(!1);return nt((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,Ke({fromRouteId:t},a)))}),[e,t])}():function(){Ze()||d(!1);let e=a.useContext($e),{basename:t,future:r,navigator:n}=a.useContext(Ve),{matches:o}=a.useContext(Xe),{pathname:i}=et(),l=JSON.stringify(z(o,r.v7_relativeSplatPath)),s=a.useRef(!1);return nt((()=>{s.current=!0})),a.useCallback((function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let o=H(r,JSON.parse(l),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:W([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)}),[t,n,l,i,e])}()}const ot=a.createContext(null);function it(){return a.useContext(ot)}function lt(e){let t=a.useContext(Xe).outlet;return t?a.createElement(ot.Provider,{value:e},t):t}function st(){let{matches:e}=a.useContext(Xe),t=e[e.length-1];return t?t.params:{}}function ut(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(Ve),{matches:o}=a.useContext(Xe),{pathname:i}=et(),l=JSON.stringify(z(o,n.v7_relativeSplatPath));return a.useMemo((()=>H(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function ct(e,t){return dt(e,t)}function dt(e,t,r,o){Ze()||d(!1);let{navigator:i}=a.useContext(Ve),{matches:l}=a.useContext(Xe),s=l[l.length-1],u=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let h,f=et();if(t){var p;let e="string"==typeof t?v(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||d(!1),h=e}else h=f;let m=h.pathname||"/",y=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=E(e,{pathname:y}),b=vt(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:W([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:W([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,r,o);return t&&b?a.createElement(Ye.Provider,{value:{location:Ke({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:n.Pop}},b):b}function ht(){let e=_t(),t=te(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const ft=a.createElement(ht,null);class pt extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(Xe.Provider,{value:this.props.routeContext},a.createElement(Ge.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext($e);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(Xe.Provider,{value:t},n)}function vt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||d(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=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){u=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}}return l.reduceRight(((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=s&&n.route.id?s[n.route.id]:void 0,h=n.route.errorElement||ft,u&&(c<0&&0===o?(jt[p="route-fallback"]||(jt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(pt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),null)}var yt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yt||{}),gt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(gt||{});function bt(e){let t=a.useContext($e);return t||d(!1),t}function wt(e){let t=a.useContext(Je);return t||d(!1),t}function Et(e){let t=function(e){let t=a.useContext(Xe);return t||d(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||d(!1),r.route.id}function St(){return Et(gt.UseRouteId)}function Rt(){return wt(gt.UseNavigation).navigation}function xt(){let e=bt(yt.UseRevalidator),t=wt(gt.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function Dt(){let{matches:e,loaderData:t}=wt(gt.UseMatches);return a.useMemo((()=>e.map((e=>S(e,t)))),[e,t])}function Ct(){let e=wt(gt.UseLoaderData),t=Et(gt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function Lt(e){return wt(gt.UseRouteLoaderData).loaderData[e]}function Pt(){let e=wt(gt.UseActionData),t=Et(gt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function _t(){var e;let t=a.useContext(Ge),r=wt(gt.UseRouteError),n=Et(gt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function kt(){let e=a.useContext(qe);return null==e?void 0:e._data}function Tt(){let e=a.useContext(qe);return null==e?void 0:e._error}let At=0;function Ut(e){let{router:t,basename:r}=bt(yt.UseBlocker),n=wt(gt.UseBlocker),[o,i]=a.useState(""),l=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:Ke({},n,{pathname:F(n.pathname,r)||n.pathname}),nextLocation:Ke({},a,{pathname:F(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return a.useEffect((()=>{let e=String(++At);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,l)}),[t,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):ce}const jt={},Mt=a.startTransition;function Ot(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,l=a.useRef();null==l.current&&(l.current=s({initialEntries:n,initialIndex:o,v5Compat:!0}));let u=l.current,[c,d]=a.useState({action:u.action,location:u.location}),{v7_startTransition:h}=i||{},f=a.useCallback((e=>{h&&Mt?Mt((()=>d(e))):d(e)}),[d,h]);return a.useLayoutEffect((()=>u.listen(f)),[u,f]),a.createElement(It,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u,future:i})}function Ft(e){let{to:t,replace:r,state:n,relative:o}=e;Ze()||d(!1);let{future:i,static:l}=a.useContext(Ve),{matches:s}=a.useContext(Xe),{pathname:u}=et(),c=at(),h=H(t,z(s,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(h);return a.useEffect((()=>c(JSON.parse(f),{replace:r,state:n,relative:o})),[c,f,o,r,n]),null}function Nt(e){return lt(e.context)}function Bt(e){d(!1)}function It(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:l,static:s=!1,future:u}=e;Ze()&&d(!1);let c=t.replace(/^\/*/,"/"),h=a.useMemo((()=>({basename:c,navigator:l,static:s,future:Ke({v7_relativeSplatPath:!1},u)})),[c,u,l,s]);"string"==typeof o&&(o=v(o));let{pathname:f="/",search:p="",hash:m="",state:y=null,key:g="default"}=o,b=a.useMemo((()=>{let e=F(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:y,key:g},navigationType:i}}),[c,f,p,m,y,g,i]);return null==b?null:a.createElement(Ve.Provider,{value:h},a.createElement(Ye.Provider,{children:r,value:b}))}function zt(e){let{children:t,location:r}=e;return ct(qt(t),r)}function Ht(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement($t,{resolve:n,errorElement:r},a.createElement(Jt,null,t))}var Wt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Wt||{});const Kt=new Promise((()=>{}));class $t extends a.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=Wt.pending;if(r instanceof Promise)if(this.state.error){o=Wt.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o=void 0!==n._error?Wt.error:void 0!==n._data?Wt.success:Wt.pending):(o=Wt.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=Wt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===Wt.error&&n._error instanceof V)throw Kt;if(o===Wt.error&&!t)throw n._error;if(o===Wt.error)return a.createElement(qe.Provider,{value:n,children:t});if(o===Wt.success)return a.createElement(qe.Provider,{value:n,children:e});throw n}}function Jt(e){let{children:t}=e,r=kt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function qt(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,((e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,qt(e.props.children,o));e.type!==Bt&&d(!1),e.props.index&&e.props.children&&d(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=qt(e.props.children,o)),r.push(i)})),r}function Vt(e){return vt(e)}function Yt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Xt(e,t){return pe({basename:null==t?void 0:t.basename,future:Ke({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:s({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Yt}).initialize()}function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}function Qt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const Zt="get",er="application/x-www-form-urlencoded";function tr(e){return null!=e&&"string"==typeof e.tagName}function rr(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 nr=null;const ar=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function or(e){return null==e||ar.has(e)?e:null}const ir=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],sr=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function ur(e,t){return pe({basename:null==t?void 0:t.basename,future:Gt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||dr(),routes:e,mapRouteProperties:Yt,window:null==t?void 0:t.window}).initialize()}function cr(e,t){return pe({basename:null==t?void 0:t.basename,future:Gt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||dr(),routes:e,mapRouteProperties:Yt,window:null==t?void 0:t.window}).initialize()}function dr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Gt({},t,{errors:hr(t.errors)})),t}function hr(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 ee(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const fr=a.createContext({isTransitioning:!1}),pr=a.createContext(new Map),mr=a.startTransition,vr=o.flushSync,yr=a.useId;function gr(e){vr?vr(e):e()}class br{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 wr(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[l,s]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback((e=>{g?function(e){mr?mr(e):e()}(e):e()}),[g]),w=a.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(o&&!l){if(a){gr((()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})}));let t=r.window.document.startViewTransition((()=>{gr((()=>i(e)))}));return t.finished.finally((()=>{gr((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}))})),void gr((()=>p(t)))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?gr((()=>i(e))):b((()=>i(e)))}),[r.window,f,d,y,b]);a.useLayoutEffect((()=>r.subscribe(w)),[r,w]),a.useEffect((()=>{u.isTransitioning&&!u.flushSync&&h(new br)}),[u]),a.useEffect((()=>{if(d&&l&&r.window){let e=l,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>i(e))),await t}));n.finished.finally((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})),p(n)}}),[b,l,d,r.window]),a.useEffect((()=>{d&&l&&o.location.key===l.location.key&&d.resolve()}),[d,f,o.location,l]),a.useEffect((()=>{!u.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[u.isTransitioning,m]),a.useEffect((()=>{}),[]);let E=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",R=a.useMemo((()=>({router:r,navigator:E,static:!1,basename:S})),[r,E,S]);return a.createElement(a.Fragment,null,a.createElement($e.Provider,{value:R},a.createElement(Je.Provider,{value:o},a.createElement(pr.Provider,{value:y.current},a.createElement(fr.Provider,{value:u},a.createElement(It,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(Er,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Er(e){let{routes:t,future:r,state:n}=e;return dt(t,void 0,n,r)}function Sr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=u({window:o,v5Compat:!0}));let l=i.current,[s,c]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&mr?mr((()=>c(e))):c(e)}),[c,d]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(It,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function Rr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&mr?mr((()=>u(e))):u(e)}),[u,d]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(It,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function xr(e){let{basename:t,children:r,future:n,history:o}=e,[i,l]=a.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},u=a.useCallback((e=>{s&&mr?mr((()=>l(e))):l(e)}),[l,s]);return a.useLayoutEffect((()=>o.listen(u)),[o,u]),a.createElement(It,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Dr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Cr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lr=a.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=Qt(e,ir),{basename:p}=a.useContext(Ve),m=!1;if("string"==typeof c&&Cr.test(c)&&(r=c,Dr))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=F(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=Qe(c,{relative:o}),y=Mr(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",Gt({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))})),Pr=a.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=Qt(e,lr),h=ut(s,{relative:d.relative}),f=et(),p=a.useContext(Je),{navigator:m,basename:v}=a.useContext(Ve),y=null!=p&&Vr(h)&&!0===u,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=f.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=F(w,v)||w);const E="/"!==g&&g.endsWith("/")?g.length-1:g.length;let S,R=b===g||!i&&b.startsWith(g)&&"/"===b.charAt(E),x=null!=w&&(w===g||!i&&w.startsWith(g)&&"/"===w.charAt(g.length)),D={isActive:R,isPending:x,isTransitioning:y},C=R?r:void 0;S="function"==typeof o?o(D):[o,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof l?l(D):l;return a.createElement(Lr,Gt({},d,{"aria-current":C,className:S,ref:t,style:L,to:s,unstable_viewTransition:u}),"function"==typeof c?c(D):c)})),_r=a.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:l,method:s=Zt,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=Qt(e,sr),m=Br(),v=Ir(u,{relative:d}),y="get"===s.toLowerCase()?"get":"post";return a.createElement("form",Gt({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:l,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))}));function kr(e){let{getKey:t,storageKey:r}=e;return $r({getKey:t,storageKey:r}),null}var Tr,Ar;function Ur(e){let t=a.useContext($e);return t||d(!1),t}function jr(e){let t=a.useContext(Je);return t||d(!1),t}function Mr(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,u=at(),c=et(),d=ut(e,{relative:l});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:m(c)===m(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[c,u,d,n,o,r,e,i,l,s])}function Or(e){let t=a.useRef(rr(e)),r=a.useRef(!1),n=et(),o=a.useMemo((()=>function(e,t){let r=rr(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=at(),l=a.useCallback(((e,t)=>{const n=rr("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)}),[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Tr||(Tr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ar||(Ar={}));let Fr=0,Nr=()=>"__"+String(++Fr)+"__";function Br(){let{router:e}=Ur(Tr.UseSubmit),{basename:t}=a.useContext(Ve),r=St();return a.useCallback((function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tr(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?F(i,t):null,r=e.getAttribute("method")||Zt,a=or(e.getAttribute("enctype"))||er,o=new FormData(e)}else if(function(e){return tr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return tr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?F(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Zt,a=or(e.getAttribute("formenctype"))||or(i.getAttribute("enctype"))||er,o=new FormData(i,e),!function(){if(null===nr)try{new FormData(document.createElement("form"),0),nr=!1}catch(e){nr=!0}return nr}()){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(tr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Zt,n=null,a=er,i=e}var l;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||Nr();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[e,t,r])}function Ir(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext(Ve),o=a.useContext(Xe);o||d(!1);let[i]=o.matches.slice(-1),l=Gt({},ut(e||".",{relative:r})),s=et();if(null==e){l.search=s.search;let e=new URLSearchParams(l.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),l.search=e.toString()?"?"+e.toString():"")}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:W([n,l.pathname])),m(l)}function zr(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseFetcher),o=jr(Ar.UseFetcher),i=a.useContext(pr),l=a.useContext(Xe),s=null==(t=l.matches[l.matches.length-1])?void 0:t.route.id;i||d(!1),l||d(!1),null==s&&d(!1);let u=yr?yr():"",[c,h]=a.useState(r||u);r&&r!==c?h(r):c||h(Nr()),a.useEffect((()=>(n.getFetcher(c),()=>{n.deleteFetcher(c)})),[n,c]);let f=a.useCallback(((e,t)=>{s||d(!1),n.fetch(c,s,e,t)}),[c,s,n]),p=Br(),m=a.useCallback(((e,t)=>{p(e,Gt({},t,{navigate:!1,fetcherKey:c}))}),[c,p]),v=a.useMemo((()=>a.forwardRef(((e,t)=>a.createElement(_r,Gt({},e,{navigate:!1,fetcherKey:c,ref:t}))))),[c]),y=o.fetchers.get(c)||ue,g=i.get(c);return a.useMemo((()=>Gt({Form:v,submit:m,load:f},y,{data:g})),[v,m,f,y,g])}function Hr(){let e=jr(Ar.UseFetchers);return Array.from(e.fetchers.entries()).map((e=>{let[t,r]=e;return Gt({},r,{key:t})}))}const Wr="react-router-scroll-positions";let Kr={};function $r(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=jr(Ar.UseScrollRestoration),{basename:l}=a.useContext(Ve),s=et(),u=Dt(),c=Rt();a.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e,t){let{capture:r}={};a.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}}),[e,r])}(a.useCallback((()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;Kr[e]=window.scrollY}try{sessionStorage.setItem(r||Wr,JSON.stringify(Kr))}catch(e){}window.history.scrollRestoration="auto"}),[r,t,c.state,s,u])),"undefined"!=typeof document&&(a.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Wr);e&&(Kr=JSON.parse(e))}catch(e){}}),[r]),a.useLayoutEffect((()=>{let e=t&&"/"!==l?(e,r)=>t(Gt({},e,{pathname:F(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Kr,(()=>window.scrollY),e);return()=>r&&r()}),[n,l,t]),a.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[s,o,i]))}function Jr(e,t){let{capture:r}=t||{};a.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function qr(e){let{when:t,message:r}=e,n=Ut(t);a.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),a.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Vr(e,t){void 0===t&&(t={});let r=a.useContext(fr);null==r&&d(!1);let{basename:n}=Ur(Tr.useViewTransitionState),o=ut(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=F(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=F(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=M(o.pathname,l)||null!=M(o.pathname,i)}}}]);
|
|
2
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[282],{20282:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>V,Await:()=>Ht,BrowserRouter:()=>Sr,Form:()=>_r,HashRouter:()=>Rr,Link:()=>Lr,MemoryRouter:()=>Ot,NavLink:()=>Pr,Navigate:()=>Ft,NavigationType:()=>n,Outlet:()=>Nt,Route:()=>Bt,Router:()=>It,RouterProvider:()=>wr,Routes:()=>zt,ScrollRestoration:()=>kr,UNSAFE_DataRouterContext:()=>$e,UNSAFE_DataRouterStateContext:()=>Je,UNSAFE_FetchersContext:()=>pr,UNSAFE_LocationContext:()=>Ye,UNSAFE_NavigationContext:()=>Ve,UNSAFE_RouteContext:()=>Xe,UNSAFE_ViewTransitionContext:()=>fr,UNSAFE_useRouteId:()=>St,UNSAFE_useScrollRestoration:()=>$r,createBrowserRouter:()=>ur,createHashRouter:()=>cr,createMemoryRouter:()=>Xt,createPath:()=>m,createRoutesFromChildren:()=>qt,createRoutesFromElements:()=>qt,createSearchParams:()=>rr,defer:()=>G,generatePath:()=>j,isRouteErrorResponse:()=>te,json:()=>q,matchPath:()=>M,matchRoutes:()=>E,parsePath:()=>v,redirect:()=>Q,redirectDocument:()=>Z,renderMatches:()=>Vt,resolvePath:()=>N,unstable_HistoryRouter:()=>xr,unstable_usePrompt:()=>qr,unstable_useViewTransitionState:()=>Vr,useActionData:()=>Pt,useAsyncError:()=>Tt,useAsyncValue:()=>kt,useBeforeUnload:()=>Jr,useBlocker:()=>Ut,useFetcher:()=>zr,useFetchers:()=>Hr,useFormAction:()=>Ir,useHref:()=>Qe,useInRouterContext:()=>Ze,useLinkClickHandler:()=>Mr,useLoaderData:()=>Ct,useLocation:()=>et,useMatch:()=>rt,useMatches:()=>Dt,useNavigate:()=>at,useNavigation:()=>Rt,useNavigationType:()=>tt,useOutlet:()=>lt,useOutletContext:()=>it,useParams:()=>st,useResolvedPath:()=>ut,useRevalidator:()=>xt,useRouteError:()=>_t,useRouteLoaderData:()=>Lt,useRoutes:()=>ct,useSearchParams:()=>Or,useSubmit:()=>Br});var n,a=r(16072),o=r(92646);function i(){return i=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},i.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const l="popstate";function s(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==a?t.length-1:a),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=p(t?c().pathname:"/",e,r,n);return h("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function f(e){return"string"==typeof e?e:m(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:f,createURL:e=>new URL(f(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?v(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=u(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function u(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:m(t)}),null,e)}function c(e){return void 0===e&&(e={}),y((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=v(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),p("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:m(t))}),(function(e,t){h("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function d(e,t){if(!1===e||null==e)throw new Error(t)}function h(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,r,n){return void 0===r&&(r=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?v(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function m(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function v(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function y(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:s=!1}=a,u=o.history,c=n.Pop,h=null,v=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-v;v=e,h&&h({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:m(e);return r=r.replace(/ $/,"%20"),d(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,u.replaceState(i({},u.state,{idx:v}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(l,g),h=e,()=>{o.removeEventListener(l,g),h=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=p(w.location,e,t);r&&r(a,e),v=y()+1;let i=f(a,v),l=w.createHref(a);try{u.pushState(i,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(l)}s&&h&&h({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=p(w.location,e,t);r&&r(a,e),v=y();let o=f(a,v),i=w.createHref(a);u.replaceState(o,"",i),s&&h&&h({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var g;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));const b=new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,a],l="string"==typeof e.id?e.id:o.join("-");if(d(!0!==e.index||!e.children,"Cannot specify children on an index route"),d(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=i({},e,t(e),{id:l});return n[l]=r,r}{let r=i({},e,t(e),{id:l,children:void 0});return n[l]=r,e.children&&(r.children=w(e.children,t,o,n)),r}}))}function E(e,t,r){void 0===r&&(r="/");let n=F(("string"==typeof t?v(t):t).pathname||"/",r);if(null==n)return null;let a=R(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=O(n);o=U(a[e],t)}return o}function S(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function R(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(d(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=W([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(d(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),R(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:A(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of x(e.path))a(e,t,r);else a(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=x(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const D=/^:[\w-]+$/,C=3,L=2,P=1,_=10,k=-2,T=e=>"*"===e;function A(e,t){let r=e.split("/"),n=r.length;return r.some(T)&&(n+=k),t&&(n+=L),r.filter((e=>!T(e))).reduce(((e,t)=>e+(D.test(t)?C:""===t?P:_)),n)}function U(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=M({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:W([a,u.pathname]),pathnameBase:K(W([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=W([a,u.pathnameBase]))}return o}function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(h(!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(/\*$/,"/*"));const 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["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return d("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function M(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),h("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function O(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return h(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function N(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?v(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:$(n),hash:J(a)}}function B(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function I(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function z(e,t){let r=I(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function H(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=v(e):(a=i({},e),d(!a.pathname||!a.pathname.includes("?"),B("?","pathname","search",a)),d(!a.pathname||!a.pathname.includes("#"),B("#","pathname","hash",a)),d(!a.search||!a.search.includes("#"),B("#","search","hash",a)));let o,l=""===e||""===a.pathname,s=l?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=N(a,o),c=s&&"/"!==s&&s.endsWith("/"),h=(l||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!h||(u.pathname+="/"),u}const W=e=>e.join("/").replace(/\/\/+/g,"/"),K=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",J=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),i({},r,{headers:n}))};class V extends Error{}class Y{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],d(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new V("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof V)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return d(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:X(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function X(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const G=function(e,t){return void 0===t&&(t={}),new Y(e,"number"==typeof t?{status:t}:t)},Q=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,i({},r,{headers:n}))},Z=(e,t)=>{let r=Q(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class ee{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 te(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const re=["post","put","patch","delete"],ne=new Set(re),ae=["get",...re],oe=new Set(ae),ie=new Set([301,302,303,307,308]),le=new Set([307,308]),se={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ue={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},de=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,he=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),fe="remix-router-transitions";function pe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(d(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=he;let l,s,u={},c=w(e.routes,o,void 0,u),f=e.basename||"/",m=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),v=null,y=new Set,b=null,R=null,x=null,D=null!=e.hydrationData,C=E(c,e.history.location,f),L=null;if(null==C){let t=_e(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Pe(c);C=r,L={[n.id]:t}}let P,_=C.some((e=>e.route.lazy)),k=C.some((e=>e.route.loader));if(_)s=!1;else if(k)if(m.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=C.findIndex((e=>void 0!==r[e.route.id]));s=C.slice(0,e+1).every(n)}else s=C.every(n)}else s=null!=e.hydrationData;else s=!0;let T,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:s,navigation:se,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||L,fetchers:new Map,blockers:new Map},U=n.Pop,j=!1,M=!1,O=new Map,N=null,B=!1,I=!1,z=[],H=[],W=new Map,K=0,$=-1,J=new Map,q=new Set,V=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),A=i({},A,e);let r=[],n=[];m.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))})),[...y].forEach((e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),m.v7_fetcherPersist&&(r.forEach((e=>A.fetchers.delete(e))),n.forEach((e=>be(e))))}function te(t,r,a){var o,s;let u,{flushSync:d}=void 0===a?{}:a,h=null!=A.actionData&&null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?A.actionData:null;let f=r.loaderData?Ce(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,p=A.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,ce))));let m,v=!0===j||null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&!0!==(null==(s=t.state)?void 0:s._isRedirect);if(l&&(c=l,l=void 0),B||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=O.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:O.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(M){let e=O.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}ee(i({},r,{actionData:u,loaderData:f,historyAction:U,location:t,initialized:!0,navigation:se,revalidation:"idle",restoreScrollPosition:Ve(t,r.matches||A.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),U=n.Pop,j=!1,M=!1,B=!1,I=!1,z=[],H=[]}async function re(t,r,a){T&&T.abort(),T=null,U=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(b&&x){let r=qe(e,t);b[r]=x()}}(A.location,A.matches),j=!0===(a&&a.preventScrollReset),M=!0===(a&&a.enableViewTransition);let s=l||c,d=a&&a.overrideNavigation,h=E(s,r,f),p=!0===(a&&a.flushSync);if(!h){let e=_e(404,{pathname:r.pathname}),{matches:t,route:n}=Pe(s);return Je(),void te(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:p})}if(A.initialized&&!I&&(v=A.location,y=r,v.pathname===y.pathname&&v.search===y.search&&(""===v.hash?""!==y.hash:v.hash===y.hash||""!==y.hash))&&!(a&&a.submission&&Me(a.submission.formMethod)))return void te(r,{matches:h},{flushSync:p});var v,y;T=new AbortController;let w,S,R=Se(e.history,r,T.signal,a&&a.submission);if(a&&a.pendingError)S={[Le(h).route.id]:a.pendingError};else if(a&&a.submission&&Me(a.submission.formMethod)){let e=await async function(e,t,r,a,i){void 0===i&&(i={}),oe();let l,s=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,r);ee({navigation:s},{flushSync:!0===i.flushSync});let c=Be(a,t);if(c.route.action||c.route.lazy){if(l=await Ee("action",e,c,a,u,o,f,m.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:g.error,error:_e(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(je(l)){let e;return e=i&&null!=i.replace?i.replace:l.location===A.location.pathname+A.location.search,await ne(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(Ue(l)){let e=Le(a,c.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Ae(l))throw _e(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(R,r,a.submission,h,{replace:a.replace,flushSync:p});if(e.shortCircuited)return;w=e.pendingActionData,S=e.pendingActionError,d=ze(r,a.submission),p=!1,R=new Request(R.url,{signal:R.signal})}let{shortCircuited:D,loaderData:C,errors:L}=await async function(t,r,n,a,o,s,u,d,h,p,v){let y=a||ze(r,o),g=o||s||Ie(y),b=l||c,[w,E]=ye(e.history,A,n,g,r,m.v7_partialHydration&&!0===d,I,z,H,X,V,q,b,f,p,v);if(Je((e=>!(n&&n.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),$=++K,0===w.length&&0===E.length){let e=xe();return te(r,i({matches:n,loaderData:{},errors:v||null},p?{actionData:p}:{},e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(!(B||m.v7_partialHydration&&d)){E.forEach((e=>{let t=A.fetchers.get(e.key),r=He(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=p||A.actionData;ee(i({navigation:y},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},E.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:h})}E.forEach((e=>{W.has(e.key)&&we(e.key),e.controller&&W.set(e.key,e.controller)}));let S=()=>E.forEach((e=>we(e.key)));T&&T.signal.addEventListener("abort",S);let{results:R,loaderResults:x,fetcherResults:D}=await ae(A.matches,n,w,E,t);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",S),E.forEach((e=>W.delete(e.key)));let C=ke(R);if(C){if(C.idx>=w.length){let e=E[C.idx-w.length].key;q.add(e)}return await ne(A,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:P}=De(A,n,w,x,v,E,D,G);G.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&G.delete(t)}))})),m.v7_partialHydration&&d&&A.errors&&Object.entries(A.errors).filter((e=>{let[t]=e;return!w.some((e=>e.route.id===t))})).forEach((e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})}));let _=xe(),k=Te($),U=_||k||E.length>0;return i({loaderData:L,errors:P},U?{fetchers:new Map(A.fetchers)}:{})}(R,r,h,d,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,p,w,S);D||(T=null,te(r,i({matches:h},w?{actionData:w}:{},{loaderData:C,errors:L})))}async function ne(a,o,l){let{submission:s,fetcherSubmission:u,replace:c}=void 0===l?{}:l;o.revalidate&&(I=!0);let h=p(a.location,o.location,{_isRedirect:!0});if(d(h,"Expected a location on the redirect navigation"),r){let r=!1;if(o.reloadDocument)r=!0;else if(de.test(o.location)){const n=e.history.createURL(o.location);r=n.origin!==t.location.origin||null==F(n.pathname,f)}if(r)return void(c?t.location.replace(o.location):t.location.assign(o.location))}T=null;let m=!0===c?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=a.navigation;!s&&!u&&v&&y&&g&&(s=Ie(a.navigation));let b=s||u;if(le.has(o.status)&&b&&Me(b.formMethod))await re(m,h,{submission:i({},b,{formAction:o.location}),preventScrollReset:j});else{let e=ze(h,s);await re(m,h,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:j})}}async function ae(t,r,n,a,i){let l=await Promise.all([...n.map((e=>Ee("loader",i,e,r,u,o,f,m.v7_relativeSplatPath))),...a.map((t=>t.matches&&t.match&&t.controller?Ee("loader",Se(e.history,t.path,t.controller.signal),t.match,t.matches,u,o,f,m.v7_relativeSplatPath):{type:g.error,error:_e(404,{pathname:t.path})}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Oe(t,n,s,s.map((()=>i.signal)),!1,A.loaderData),Oe(t,a.map((e=>e.match)),c,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function oe(){I=!0,z.push(...Je()),V.forEach(((e,t)=>{W.has(t)&&(H.push(t),we(t))}))}function ie(e,t,r){void 0===r&&(r={}),A.fetchers.set(e,t),ee({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function pe(e,t,r,n){void 0===n&&(n={});let a=Le(A.matches,t);be(e),ee({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ge(e){return m.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),A.fetchers.get(e)||ue}function be(e){let t=A.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&J.has(e)||we(e),V.delete(e),J.delete(e),q.delete(e),X.delete(e),A.fetchers.delete(e)}function we(e){let t=W.get(e);d(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function Re(e){for(let t of e){let e=We(ge(t).data);A.fetchers.set(t,e)}}function xe(){let e=[],t=!1;for(let r of q){let n=A.fetchers.get(r);d(n,"Expected fetcher: "+r),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return Re(e),t}function Te(e){let t=[];for(let[r,n]of J)if(n<e){let e=A.fetchers.get(r);d(e,"Expected fetcher: "+r),"loading"===e.state&&(we(r),J.delete(r),t.push(r))}return Re(t),t.length>0}function Ne(e){A.blockers.delete(e),Q.delete(e)}function Ke(e,t){let r=A.blockers.get(e)||ce;d("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(A.blockers);n.set(e,t),ee({blockers:n})}function $e(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&h(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=A.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function Je(e){let t=[];return G.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),G.delete(n))})),t}function qe(e,t){return R&&R(e,t.map((e=>S(e,A.loaderData))))||e.key}function Ve(e,t){if(b){let r=qe(e,t),n=b[r];if("number"==typeof n)return n}return null}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:function(){if(v=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(Z)return void(Z=!1);h(0===Q.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=$e({currentLocation:A.location,nextLocation:n,historyAction:r});return o&&null!=a?(Z=!0,e.history.go(-1*a),void Ke(o,{state:"blocked",location:n,proceed(){Ke(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(A.blockers);e.set(o,ce),ee({blockers:e})}})):re(r,n)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(fe);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,O);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(fe,JSON.stringify(r))}catch(e){h(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,O);t.addEventListener("pagehide",e),N=()=>t.removeEventListener("pagehide",e)}return A.initialized||re(n.Pop,A.location,{initialHydration:!0}),P},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(b=e,x=t,R=r||null,!D&&A.navigation===se){D=!0;let e=Ve(A.location,A.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{b=null,x=null,R=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=me(A.location,A.matches,f,m.v7_prependBasename,r,m.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:u}=ve(m.v7_normalizeFormMethod,!1,o,a),c=A.location,d=p(A.location,l,a&&a.state);d=i({},d,e.history.encodeLocation(d));let h=a&&null!=a.replace?a.replace:void 0,v=n.Push;!0===h?v=n.Replace:!1===h||null!=s&&Me(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=!0===(a&&a.unstable_flushSync),b=$e({currentLocation:c,nextLocation:d,historyAction:v});if(!b)return await re(v,d,{submission:s,pendingError:u,preventScrollReset:y,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:g});Ke(b,{state:"blocked",location:d,proceed(){Ke(b,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(b,ce),ee({blockers:e})}})},fetch:function(t,r,n,i){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");W.has(t)&&we(t);let s=!0===(i&&i.unstable_flushSync),h=l||c,p=me(A.location,A.matches,f,m.v7_prependBasename,n,m.v7_relativeSplatPath,r,null==i?void 0:i.relative),v=E(h,p,f);if(!v)return void pe(t,r,_e(404,{pathname:p}),{flushSync:s});let{path:y,submission:g,error:b}=ve(m.v7_normalizeFormMethod,!0,p,i);if(b)return void pe(t,r,b,{flushSync:s});let w=Be(v,y);j=!0===(i&&i.preventScrollReset),g&&Me(g.formMethod)?async function(t,r,n,a,i,s,h){if(oe(),V.delete(t),!a.route.action&&!a.route.lazy){let e=_e(405,{method:h.formMethod,pathname:n,routeId:r});return void pe(t,r,e,{flushSync:s})}let p=A.fetchers.get(t);ie(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(h,p),{flushSync:s});let v=new AbortController,y=Se(e.history,n,v.signal,h);W.set(t,v);let g=K,b=await Ee("action",y,a,i,u,o,f,m.v7_relativeSplatPath);if(y.signal.aborted)return void(W.get(t)===v&&W.delete(t));if(m.v7_fetcherPersist&&X.has(t)){if(je(b)||Ue(b))return void ie(t,We(void 0))}else{if(je(b))return W.delete(t),$>g?void ie(t,We(void 0)):(q.add(t),ie(t,He(h)),ne(A,b,{fetcherSubmission:h}));if(Ue(b))return void pe(t,r,b.error)}if(Ae(b))throw _e(400,{type:"defer-action"});let w=A.navigation.location||A.location,S=Se(e.history,w,v.signal),R=l||c,x="idle"!==A.navigation.state?E(R,A.navigation.location,f):A.matches;d(x,"Didn't find any matches after fetcher action");let D=++K;J.set(t,D);let C=He(h,b.data);A.fetchers.set(t,C);let[L,P]=ye(e.history,A,x,h,w,!1,I,z,H,X,V,q,R,f,{[a.route.id]:b.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=He(void 0,r?r.data:void 0);A.fetchers.set(t,n),W.has(t)&&we(t),e.controller&&W.set(t,e.controller)})),ee({fetchers:new Map(A.fetchers)});let _=()=>P.forEach((e=>we(e.key)));v.signal.addEventListener("abort",_);let{results:k,loaderResults:j,fetcherResults:M}=await ae(A.matches,x,L,P,S);if(v.signal.aborted)return;v.signal.removeEventListener("abort",_),J.delete(t),W.delete(t),P.forEach((e=>W.delete(e.key)));let O=ke(k);if(O){if(O.idx>=L.length){let e=P[O.idx-L.length].key;q.add(e)}return ne(A,O.result)}let{loaderData:F,errors:N}=De(A,A.matches,L,j,void 0,P,M,G);if(A.fetchers.has(t)){let e=We(b.data);A.fetchers.set(t,e)}Te(D),"loading"===A.navigation.state&&D>$?(d(U,"Expected pending action"),T&&T.abort(),te(A.navigation.location,{matches:x,loaderData:F,errors:N,fetchers:new Map(A.fetchers)})):(ee({errors:N,loaderData:Ce(A.loaderData,F,x,N),fetchers:new Map(A.fetchers)}),I=!1)}(t,r,y,w,v,s,g):(V.set(t,{routeId:r,path:y}),async function(t,r,n,a,i,l,s){let c=A.fetchers.get(t);ie(t,He(s,c?c.data:void 0),{flushSync:l});let h=new AbortController,p=Se(e.history,n,h.signal);W.set(t,h);let v=K,y=await Ee("loader",p,a,i,u,o,f,m.v7_relativeSplatPath);if(Ae(y)&&(y=await Fe(y,p.signal,!0)||y),W.get(t)===h&&W.delete(t),!p.signal.aborted){if(!X.has(t))return je(y)?$>v?void ie(t,We(void 0)):(q.add(t),void await ne(A,y)):void(Ue(y)?pe(t,r,y.error):(d(!Ae(y),"Unhandled fetcher deferred data"),ie(t,We(y.data))));ie(t,We(void 0))}}(t,r,y,w,v,s,g))},revalidate:function(){oe(),ee({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?re(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):re(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ge,deleteFetcher:function(e){if(m.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else be(e);ee({fetchers:new Map(A.fetchers)})},dispose:function(){v&&v(),N&&N(),y.clear(),T&&T.abort(),A.fetchers.forEach(((e,t)=>be(t))),A.blockers.forEach(((e,t)=>Ne(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||ce;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:Ne,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){u={},l=w(e,o,void 0,u)}},P}function me(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=H(a||".",z(s,o),F(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||Ne(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:W([r,c.pathname])),m(c)}function ve(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!oe.has(a.toLowerCase())))return{path:r,error:_e(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:_e(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=Te(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Me(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}}}if("application/json"===n.formEncType){if(!Me(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(d("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=Re(n.formData),i=n.formData;else if(n.body instanceof FormData)o=Re(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=xe(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=xe(o)}catch(e){return l()}let h={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Me(h.formMethod))return{path:r,submission:h};let f=v(r);return t&&f.search&&Ne(f.search)&&o.append("index",""),f.search="?"+o,{path:m(f),submission:h}}function ye(e,t,r,n,a,o,l,s,u,c,d,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v?Object.keys(v)[0]:void 0,S=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(r,w).filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||s.some((t=>t===e.route.id)))return!0;let u=t.matches[r],c=e;return be(e,i({currentUrl:g,currentParams:u.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,defaultShouldRevalidate:l||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||ge(u,c)}))})),R=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let s=E(f,e.path,p);if(!s)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let d=t.fetchers.get(a),m=Be(s,e.path),v=!1;v=!h.has(a)&&(!!u.includes(a)||(d&&"idle"!==d.state&&void 0===d.data?l:be(m,i({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:l})))),v&&R.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:m,controller:new AbortController})})),[S,R]}function ge(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function be(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function we(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];d(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;h(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||b.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,i({},t(a),{lazy:void 0}))}async function Ee(e,t,r,n,a,o,i,l,s){let u,c,h;void 0===s&&(s={});let f=e=>{let n,a=new Promise(((e,t)=>n=t));return h=()=>n(),t.signal.addEventListener("abort",h),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([f(n).catch((t=>{e=t})),we(r.route,o,a)]);if(e)throw e;c=t[0]}else{if(await we(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw _e(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:g.data,data:void 0}}c=await f(n)}else{if(!n){let e=new URL(t.url);throw _e(404,{pathname:e.pathname+e.search})}c=await f(n)}d(void 0!==c,"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){u=g.error,c=e}finally{h&&t.signal.removeEventListener("abort",h)}if(null!=(p=c)&&"number"==typeof p.status&&"string"==typeof p.statusText&&"object"==typeof p.headers&&void 0!==p.body){let e,a=c.status;if(ie.has(a)){let e=c.headers.get("Location");if(d(e,"Redirects returned/thrown from loaders/actions must have a Location header"),de.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=F(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=me(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:g.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:u===g.error?g.error:g.data,response:c};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:g.error,error:e}}return u===g.error?{type:u,error:new ee(a,c.statusText,e),headers:c.headers}:{type:g.data,data:e,statusCode:c.status,headers:c.headers}}var p,m,v;return u===g.error?{type:u,error:c}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(c)?{type:g.deferred,deferredData:c,statusCode:null==(m=c.init)?void 0:m.status,headers:(null==(v=c.init)?void 0:v.headers)&&new Headers(c.init.headers)}:{type:g.data,data:c}}function Se(e,t,r,n){let a=e.createURL(Te(t)).toString(),o={signal:r};if(n&&Me(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=Re(n.formData):o.body=n.formData}return new Request(a,o)}function Re(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function xe(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function De(e,t,r,n,a,o,l,s){let{loaderData:u,errors:c}=function(e,t,r,n,a){let o,i={},l=null,s=!1,u={};return r.forEach(((r,c)=>{let h=t[c].route.id;if(d(!je(r),"Cannot handle redirect results in processLoaderData"),Ue(r)){let t=Le(e,h),a=r.error;n&&(a=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=a),i[h]=void 0,s||(s=!0,o=te(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else Ae(r)?(a.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||s||(o=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n,a,s);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];d(void 0!==l&&void 0!==l[t],"Did not find corresponding fetcher result");let s=l[t];if(!a||!a.signal.aborted)if(Ue(s)){let t=Le(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=i({},c,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(je(s))d(!1,"Unhandled fetcher revalidation redirect");else if(Ae(s))d(!1,"Unhandled fetcher deferred data");else{let t=We(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:c}}function Ce(e,t,r,n){let a=i({},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 Le(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 Pe(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 _e(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new ee(e||500,i,new Error(l),!0)}function ke(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Te(e){return m(i({},"string"==typeof e?v(e):e,{hash:""}))}function Ae(e){return e.type===g.deferred}function Ue(e){return e.type===g.error}function je(e){return(e&&e.type)===g.redirect}function Me(e){return ne.has(e.toLowerCase())}async function Oe(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),c=null!=u&&!ge(u,s)&&void 0!==(o&&o[s.route.id]);if(Ae(l)&&(a||c)){let e=n[i];d(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Fe(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Fe(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:g.data,data:e.deferredData.unwrappedData}}catch(e){return{type:g.error,error:e}}return{type:g.data,data:e.deferredData.data}}}function Ne(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let r="string"==typeof t?v(t).search:t.search;if(e[e.length-1].route.index&&Ne(r||""))return e[e.length-1];let n=I(e);return n[n.length-1]}function Ie(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function ze(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 He(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 We(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 Ke(){return Ke=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},Ke.apply(this,arguments)}Symbol("deferred");const $e=a.createContext(null),Je=a.createContext(null),qe=a.createContext(null),Ve=a.createContext(null),Ye=a.createContext(null),Xe=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Ge=a.createContext(null);function Qe(e,t){let{relative:r}=void 0===t?{}:t;Ze()||d(!1);let{basename:n,navigator:o}=a.useContext(Ve),{hash:i,pathname:l,search:s}=ut(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:W([n,l])),o.createHref({pathname:u,search:s,hash:i})}function Ze(){return null!=a.useContext(Ye)}function et(){return Ze()||d(!1),a.useContext(Ye).location}function tt(){return a.useContext(Ye).navigationType}function rt(e){Ze()||d(!1);let{pathname:t}=et();return a.useMemo((()=>M(e,t)),[t,e])}function nt(e){a.useContext(Ve).static||a.useLayoutEffect(e)}function at(){let{isDataRoute:e}=a.useContext(Xe);return e?function(){let{router:e}=bt(yt.UseNavigateStable),t=Et(gt.UseNavigateStable),r=a.useRef(!1);return nt((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,Ke({fromRouteId:t},a)))}),[e,t])}():function(){Ze()||d(!1);let e=a.useContext($e),{basename:t,future:r,navigator:n}=a.useContext(Ve),{matches:o}=a.useContext(Xe),{pathname:i}=et(),l=JSON.stringify(z(o,r.v7_relativeSplatPath)),s=a.useRef(!1);return nt((()=>{s.current=!0})),a.useCallback((function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let o=H(r,JSON.parse(l),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:W([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)}),[t,n,l,i,e])}()}const ot=a.createContext(null);function it(){return a.useContext(ot)}function lt(e){let t=a.useContext(Xe).outlet;return t?a.createElement(ot.Provider,{value:e},t):t}function st(){let{matches:e}=a.useContext(Xe),t=e[e.length-1];return t?t.params:{}}function ut(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(Ve),{matches:o}=a.useContext(Xe),{pathname:i}=et(),l=JSON.stringify(z(o,n.v7_relativeSplatPath));return a.useMemo((()=>H(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function ct(e,t){return dt(e,t)}function dt(e,t,r,o){Ze()||d(!1);let{navigator:i}=a.useContext(Ve),{matches:l}=a.useContext(Xe),s=l[l.length-1],u=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let h,f=et();if(t){var p;let e="string"==typeof t?v(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||d(!1),h=e}else h=f;let m=h.pathname||"/",y=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=E(e,{pathname:y}),b=vt(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:W([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:W([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,r,o);return t&&b?a.createElement(Ye.Provider,{value:{location:Ke({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:n.Pop}},b):b}function ht(){let e=_t(),t=te(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const ft=a.createElement(ht,null);class pt extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(Xe.Provider,{value:this.props.routeContext},a.createElement(Ge.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext($e);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(Xe.Provider,{value:t},n)}function vt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||d(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=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){u=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}}return l.reduceRight(((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=s&&n.route.id?s[n.route.id]:void 0,h=n.route.errorElement||ft,u&&(c<0&&0===o?(jt[p="route-fallback"]||(jt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(pt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),null)}var yt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yt||{}),gt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(gt||{});function bt(e){let t=a.useContext($e);return t||d(!1),t}function wt(e){let t=a.useContext(Je);return t||d(!1),t}function Et(e){let t=function(){let e=a.useContext(Xe);return e||d(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||d(!1),r.route.id}function St(){return Et(gt.UseRouteId)}function Rt(){return wt(gt.UseNavigation).navigation}function xt(){let e=bt(yt.UseRevalidator),t=wt(gt.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function Dt(){let{matches:e,loaderData:t}=wt(gt.UseMatches);return a.useMemo((()=>e.map((e=>S(e,t)))),[e,t])}function Ct(){let e=wt(gt.UseLoaderData),t=Et(gt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function Lt(e){return wt(gt.UseRouteLoaderData).loaderData[e]}function Pt(){let e=wt(gt.UseActionData),t=Et(gt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function _t(){var e;let t=a.useContext(Ge),r=wt(gt.UseRouteError),n=Et(gt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function kt(){let e=a.useContext(qe);return null==e?void 0:e._data}function Tt(){let e=a.useContext(qe);return null==e?void 0:e._error}let At=0;function Ut(e){let{router:t,basename:r}=bt(yt.UseBlocker),n=wt(gt.UseBlocker),[o,i]=a.useState(""),l=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:Ke({},n,{pathname:F(n.pathname,r)||n.pathname}),nextLocation:Ke({},a,{pathname:F(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return a.useEffect((()=>{let e=String(++At);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,l)}),[t,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):ce}const jt={},Mt=a.startTransition;function Ot(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,l=a.useRef();null==l.current&&(l.current=s({initialEntries:n,initialIndex:o,v5Compat:!0}));let u=l.current,[c,d]=a.useState({action:u.action,location:u.location}),{v7_startTransition:h}=i||{},f=a.useCallback((e=>{h&&Mt?Mt((()=>d(e))):d(e)}),[d,h]);return a.useLayoutEffect((()=>u.listen(f)),[u,f]),a.createElement(It,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u,future:i})}function Ft(e){let{to:t,replace:r,state:n,relative:o}=e;Ze()||d(!1);let{future:i,static:l}=a.useContext(Ve),{matches:s}=a.useContext(Xe),{pathname:u}=et(),c=at(),h=H(t,z(s,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(h);return a.useEffect((()=>c(JSON.parse(f),{replace:r,state:n,relative:o})),[c,f,o,r,n]),null}function Nt(e){return lt(e.context)}function Bt(e){d(!1)}function It(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:l,static:s=!1,future:u}=e;Ze()&&d(!1);let c=t.replace(/^\/*/,"/"),h=a.useMemo((()=>({basename:c,navigator:l,static:s,future:Ke({v7_relativeSplatPath:!1},u)})),[c,u,l,s]);"string"==typeof o&&(o=v(o));let{pathname:f="/",search:p="",hash:m="",state:y=null,key:g="default"}=o,b=a.useMemo((()=>{let e=F(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:y,key:g},navigationType:i}}),[c,f,p,m,y,g,i]);return null==b?null:a.createElement(Ve.Provider,{value:h},a.createElement(Ye.Provider,{children:r,value:b}))}function zt(e){let{children:t,location:r}=e;return ct(qt(t),r)}function Ht(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement($t,{resolve:n,errorElement:r},a.createElement(Jt,null,t))}var Wt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Wt||{});const Kt=new Promise((()=>{}));class $t extends a.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=Wt.pending;if(r instanceof Promise)if(this.state.error){o=Wt.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o=void 0!==n._error?Wt.error:void 0!==n._data?Wt.success:Wt.pending):(o=Wt.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=Wt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===Wt.error&&n._error instanceof V)throw Kt;if(o===Wt.error&&!t)throw n._error;if(o===Wt.error)return a.createElement(qe.Provider,{value:n,children:t});if(o===Wt.success)return a.createElement(qe.Provider,{value:n,children:e});throw n}}function Jt(e){let{children:t}=e,r=kt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function qt(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,((e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,qt(e.props.children,o));e.type!==Bt&&d(!1),e.props.index&&e.props.children&&d(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=qt(e.props.children,o)),r.push(i)})),r}function Vt(e){return vt(e)}function Yt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Xt(e,t){return pe({basename:null==t?void 0:t.basename,future:Ke({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:s({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Yt}).initialize()}function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}function Qt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const Zt="get",er="application/x-www-form-urlencoded";function tr(e){return null!=e&&"string"==typeof e.tagName}function rr(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 nr=null;const ar=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function or(e){return null==e||ar.has(e)?e:null}const ir=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],sr=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function ur(e,t){return pe({basename:null==t?void 0:t.basename,future:Gt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||dr(),routes:e,mapRouteProperties:Yt,window:null==t?void 0:t.window}).initialize()}function cr(e,t){return pe({basename:null==t?void 0:t.basename,future:Gt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||dr(),routes:e,mapRouteProperties:Yt,window:null==t?void 0:t.window}).initialize()}function dr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Gt({},t,{errors:hr(t.errors)})),t}function hr(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 ee(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const fr=a.createContext({isTransitioning:!1}),pr=a.createContext(new Map),mr=a.startTransition,vr=o.flushSync,yr=a.useId;function gr(e){vr?vr(e):e()}class br{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 wr(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[l,s]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback((e=>{g?function(e){mr?mr(e):e()}(e):e()}),[g]),w=a.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(o&&!l){if(a){gr((()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})}));let t=r.window.document.startViewTransition((()=>{gr((()=>i(e)))}));return t.finished.finally((()=>{gr((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}))})),void gr((()=>p(t)))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?gr((()=>i(e))):b((()=>i(e)))}),[r.window,f,d,y,b]);a.useLayoutEffect((()=>r.subscribe(w)),[r,w]),a.useEffect((()=>{u.isTransitioning&&!u.flushSync&&h(new br)}),[u]),a.useEffect((()=>{if(d&&l&&r.window){let e=l,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>i(e))),await t}));n.finished.finally((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})),p(n)}}),[b,l,d,r.window]),a.useEffect((()=>{d&&l&&o.location.key===l.location.key&&d.resolve()}),[d,f,o.location,l]),a.useEffect((()=>{!u.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[u.isTransitioning,m]),a.useEffect((()=>{}),[]);let E=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",R=a.useMemo((()=>({router:r,navigator:E,static:!1,basename:S})),[r,E,S]);return a.createElement(a.Fragment,null,a.createElement($e.Provider,{value:R},a.createElement(Je.Provider,{value:o},a.createElement(pr.Provider,{value:y.current},a.createElement(fr.Provider,{value:u},a.createElement(It,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(Er,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Er(e){let{routes:t,future:r,state:n}=e;return dt(t,void 0,n,r)}function Sr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=u({window:o,v5Compat:!0}));let l=i.current,[s,c]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&mr?mr((()=>c(e))):c(e)}),[c,d]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(It,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function Rr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&mr?mr((()=>u(e))):u(e)}),[u,d]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(It,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function xr(e){let{basename:t,children:r,future:n,history:o}=e,[i,l]=a.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},u=a.useCallback((e=>{s&&mr?mr((()=>l(e))):l(e)}),[l,s]);return a.useLayoutEffect((()=>o.listen(u)),[o,u]),a.createElement(It,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Dr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Cr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lr=a.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=Qt(e,ir),{basename:p}=a.useContext(Ve),m=!1;if("string"==typeof c&&Cr.test(c)&&(r=c,Dr))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=F(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=Qe(c,{relative:o}),y=Mr(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",Gt({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))})),Pr=a.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=Qt(e,lr),h=ut(s,{relative:d.relative}),f=et(),p=a.useContext(Je),{navigator:m,basename:v}=a.useContext(Ve),y=null!=p&&Vr(h)&&!0===u,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=f.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=F(w,v)||w);const E="/"!==g&&g.endsWith("/")?g.length-1:g.length;let S,R=b===g||!i&&b.startsWith(g)&&"/"===b.charAt(E),x=null!=w&&(w===g||!i&&w.startsWith(g)&&"/"===w.charAt(g.length)),D={isActive:R,isPending:x,isTransitioning:y},C=R?r:void 0;S="function"==typeof o?o(D):[o,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof l?l(D):l;return a.createElement(Lr,Gt({},d,{"aria-current":C,className:S,ref:t,style:L,to:s,unstable_viewTransition:u}),"function"==typeof c?c(D):c)})),_r=a.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:l,method:s=Zt,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=Qt(e,sr),m=Br(),v=Ir(u,{relative:d}),y="get"===s.toLowerCase()?"get":"post";return a.createElement("form",Gt({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:l,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))}));function kr(e){let{getKey:t,storageKey:r}=e;return $r({getKey:t,storageKey:r}),null}var Tr,Ar;function Ur(e){let t=a.useContext($e);return t||d(!1),t}function jr(e){let t=a.useContext(Je);return t||d(!1),t}function Mr(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,u=at(),c=et(),d=ut(e,{relative:l});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:m(c)===m(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[c,u,d,n,o,r,e,i,l,s])}function Or(e){let t=a.useRef(rr(e)),r=a.useRef(!1),n=et(),o=a.useMemo((()=>function(e,t){let r=rr(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=at(),l=a.useCallback(((e,t)=>{const n=rr("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)}),[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Tr||(Tr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ar||(Ar={}));let Fr=0,Nr=()=>"__"+String(++Fr)+"__";function Br(){let{router:e}=Ur(Tr.UseSubmit),{basename:t}=a.useContext(Ve),r=St();return a.useCallback((function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tr(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?F(i,t):null,r=e.getAttribute("method")||Zt,a=or(e.getAttribute("enctype"))||er,o=new FormData(e)}else if(function(e){return tr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return tr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?F(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Zt,a=or(e.getAttribute("formenctype"))||or(i.getAttribute("enctype"))||er,o=new FormData(i,e),!function(){if(null===nr)try{new FormData(document.createElement("form"),0),nr=!1}catch(e){nr=!0}return nr}()){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(tr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Zt,n=null,a=er,i=e}var l;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||Nr();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[e,t,r])}function Ir(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext(Ve),o=a.useContext(Xe);o||d(!1);let[i]=o.matches.slice(-1),l=Gt({},ut(e||".",{relative:r})),s=et();if(null==e){l.search=s.search;let e=new URLSearchParams(l.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),l.search=e.toString()?"?"+e.toString():"")}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:W([n,l.pathname])),m(l)}function zr(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseFetcher),o=jr(Ar.UseFetcher),i=a.useContext(pr),l=a.useContext(Xe),s=null==(t=l.matches[l.matches.length-1])?void 0:t.route.id;i||d(!1),l||d(!1),null==s&&d(!1);let u=yr?yr():"",[c,h]=a.useState(r||u);r&&r!==c?h(r):c||h(Nr()),a.useEffect((()=>(n.getFetcher(c),()=>{n.deleteFetcher(c)})),[n,c]);let f=a.useCallback(((e,t)=>{s||d(!1),n.fetch(c,s,e,t)}),[c,s,n]),p=Br(),m=a.useCallback(((e,t)=>{p(e,Gt({},t,{navigate:!1,fetcherKey:c}))}),[c,p]),v=a.useMemo((()=>a.forwardRef(((e,t)=>a.createElement(_r,Gt({},e,{navigate:!1,fetcherKey:c,ref:t}))))),[c]),y=o.fetchers.get(c)||ue,g=i.get(c);return a.useMemo((()=>Gt({Form:v,submit:m,load:f},y,{data:g})),[v,m,f,y,g])}function Hr(){let e=jr(Ar.UseFetchers);return Array.from(e.fetchers.entries()).map((e=>{let[t,r]=e;return Gt({},r,{key:t})}))}const Wr="react-router-scroll-positions";let Kr={};function $r(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=jr(Ar.UseScrollRestoration),{basename:l}=a.useContext(Ve),s=et(),u=Dt(),c=Rt();a.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e){let{capture:t}={};a.useEffect((()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}}),[e,t])}(a.useCallback((()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;Kr[e]=window.scrollY}try{sessionStorage.setItem(r||Wr,JSON.stringify(Kr))}catch(e){}window.history.scrollRestoration="auto"}),[r,t,c.state,s,u])),"undefined"!=typeof document&&(a.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Wr);e&&(Kr=JSON.parse(e))}catch(e){}}),[r]),a.useLayoutEffect((()=>{let e=t&&"/"!==l?(e,r)=>t(Gt({},e,{pathname:F(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Kr,(()=>window.scrollY),e);return()=>r&&r()}),[n,l,t]),a.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[s,o,i]))}function Jr(e,t){let{capture:r}=t||{};a.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function qr(e){let{when:t,message:r}=e,n=Ut(t);a.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),a.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Vr(e,t){void 0===t&&(t={});let r=a.useContext(fr);null==r&&d(!1);let{basename:n}=Ur(Tr.useViewTransitionState),o=ut(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=F(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=F(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=M(o.pathname,l)||null!=M(o.pathname,i)}}}]);
|