react-router 0.0.0-experimental-c7dd3d3a → 0.0.0-experimental-e53172d16

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -10
  3. package/dist/index.d.ts +37 -16
  4. package/dist/index.js +9809 -1087
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/components.d.ts +13 -2
  7. package/dist/lib/context.d.ts +2 -2
  8. package/dist/lib/dom/dom.d.ts +104 -0
  9. package/dist/lib/dom/global.d.ts +36 -0
  10. package/dist/lib/dom/lib.d.ts +304 -0
  11. package/dist/lib/dom/server.d.ts +32 -0
  12. package/dist/lib/dom/ssr/browser.d.ts +3 -0
  13. package/dist/lib/dom/ssr/components.d.ts +61 -0
  14. package/dist/lib/dom/ssr/create-remix-stub.d.ts +56 -0
  15. package/dist/lib/dom/ssr/data.d.ts +16 -0
  16. package/dist/lib/dom/ssr/errorBoundaries.d.ts +33 -0
  17. package/dist/lib/dom/ssr/errors.d.ts +2 -0
  18. package/dist/lib/dom/ssr/fallback.d.ts +2 -0
  19. package/dist/lib/dom/ssr/invariant.d.ts +2 -0
  20. package/dist/lib/dom/ssr/links.d.ts +127 -0
  21. package/dist/lib/dom/ssr/markup.d.ts +5 -0
  22. package/dist/lib/dom/ssr/routeModules.d.ts +141 -0
  23. package/dist/lib/dom/ssr/routes.d.ts +32 -0
  24. package/dist/lib/dom/ssr/server.d.ts +13 -0
  25. package/dist/lib/dom/ssr/single-fetch.d.ts +36 -0
  26. package/dist/lib/hooks.d.ts +3 -3
  27. package/dist/lib/router/history.d.ts +250 -0
  28. package/dist/lib/router/index.d.ts +9 -0
  29. package/dist/lib/router/router.d.ts +512 -0
  30. package/dist/lib/router/utils.d.ts +520 -0
  31. package/dist/main.js +1 -1
  32. package/dist/react-router.development.js +10495 -1126
  33. package/dist/react-router.development.js.map +1 -1
  34. package/dist/react-router.production.min.js +2 -2
  35. package/dist/react-router.production.min.js.map +1 -1
  36. package/dist/umd/react-router.development.js +10876 -1287
  37. package/dist/umd/react-router.development.js.map +1 -1
  38. package/dist/umd/react-router.production.min.js +2 -2
  39. package/dist/umd/react-router.production.min.js.map +1 -1
  40. package/package.json +12 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v0.0.0-experimental-c7dd3d3a
2
+ * React Router v0.0.0-experimental-e53172d16
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,5 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as n,UNSAFE_getResolveToMatches as a,resolveTo as o,parsePath as l,matchRoutes as i,Action as u,UNSAFE_convertRouteMatchToUiMatch as s,stripBasename as c,IDLE_BLOCKER as d,isRouteErrorResponse as p,createMemoryHistory as m,AbortedDeferredError as h,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,resolvePath}from"@remix-run/router";const v=e.createContext(null),E=e.createContext(null),g=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext({outlet:null,matches:[],isDataRoute:!1}),b=e.createContext(null);function R(n,{relative:a}={}){S()||t(!1);let{basename:o,navigator:l}=e.useContext(y),{hash:i,pathname:u,search:s}=O(n,{relative:a}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),l.createHref({pathname:c,search:s,hash:i})}function S(){return null!=e.useContext(x)}function P(){return S()||t(!1),e.useContext(x).location}function U(){return e.useContext(x).navigationType}function _(r){S()||t(!1);let{pathname:a}=P();return e.useMemo((()=>n(r,a)),[a,r])}function k(t){e.useContext(y).static||e.useLayoutEffect(t)}function D(){let{isDataRoute:n}=e.useContext(C);return n?function(){let{router:t}=$(J.UseNavigateStable),r=W(z.UseNavigateStable),n=e.useRef(!1);return k((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){S()||t(!1);let n=e.useContext(v),{basename:l,future:i,navigator:u}=e.useContext(y),{matches:s}=e.useContext(C),{pathname:c}=P(),d=JSON.stringify(a(s,i.v7_relativeSplatPath)),p=e.useRef(!1);return k((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let a=o(e,JSON.parse(d),c,"path"===t.relative);null==n&&"/"!==l&&(a.pathname="/"===a.pathname?l:r([l,a.pathname])),(t.replace?u.replace:u.push)(a,t.state,t)}),[l,u,d,c,n])}()}const B=e.createContext(null);function N(){return e.useContext(B)}function F(t){let r=e.useContext(C).outlet;return r?e.createElement(B.Provider,{value:t},r):r}function L(){let{matches:t}=e.useContext(C),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:n}=e.useContext(y),{matches:l}=e.useContext(C),{pathname:i}=P(),u=JSON.stringify(a(l,n.v7_relativeSplatPath));return e.useMemo((()=>o(t,JSON.parse(u),i,"path"===r)),[t,u,i,r])}function A(e,t){return j(e,t)}function j(n,a,o,s){S()||t(!1);let{navigator:c}=e.useContext(y),{matches:d}=e.useContext(C),p=d[d.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let f,v=P();if(a){let e="string"==typeof a?l(a):a;"/"===h||e.pathname?.startsWith(h)||t(!1),f=e}else f=v;let E=f.pathname||"/",g=E;if("/"!==h){let e=h.replace(/^\//,"").split("/");g="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=i(n,{pathname:g}),R=w(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r([h,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r([h,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,s);return a&&R?e.createElement(x.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:u.Pop}},R):R}function I(){let t=ee(),r=p(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const M=e.createElement(I,null);class T extends e.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?e.createElement(C.Provider,{value:this.props.routeContext},e.createElement(b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H({routeContext:t,match:r,children:n}){let a=e.useContext(v);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(C.Provider,{value:t},n)}function w(r,n=[],a=null,o=null){if(null==r){if(!a?.errors)return null;r=a.matches}let l=r,i=a?.errors;if(null!=i){let e=l.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));e>=0||t(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,s=-1;if(a&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=a,n=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||n){u=!0,l=s>=0?l.slice(0,s+1):[l[0]];break}}}return l.reduceRight(((t,r,o)=>{let c,d=!1,p=null,m=null;var h;a&&(c=i&&r.route.id?i[r.route.id]:void 0,p=r.route.errorElement||M,u&&(s<0&&0===o?(h="route-fallback",!1||oe[h]||(oe[h]=!0),d=!0,m=null):s===o&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(l.slice(0,o+1)),v=()=>{let n;return n=c?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(H,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(T,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),z=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}(z||{});function $(r){let n=e.useContext(v);return n||t(!1),n}function V(r){let n=e.useContext(E);return n||t(!1),n}function W(r){let n=function(r){let n=e.useContext(C);return n||t(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||t(!1),a.route.id}function Y(){return W(z.UseRouteId)}function q(){return V(z.UseNavigation).navigation}function G(){let t=$(J.UseRevalidator),r=V(z.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function K(){let{matches:t,loaderData:r}=V(z.UseMatches);return e.useMemo((()=>t.map((e=>s(e,r)))),[t,r])}function Q(){let e=V(z.UseLoaderData),t=W(z.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function X(e){return V(z.UseRouteLoaderData).loaderData[e]}function Z(){let e=V(z.UseActionData),t=W(z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ee(){let t=e.useContext(b),r=V(z.UseRouteError),n=W(z.UseRouteError);return void 0!==t?t:r.errors?.[n]}function te(){return e.useContext(g)?._data}function re(){return e.useContext(g)?._error}let ne=0;function ae(t){let{router:r,basename:n}=$(J.UseBlocker),a=V(z.UseBlocker),[o,l]=e.useState(""),i=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:c(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:c(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++ne);return l(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,i)}),[r,o,i]),o&&a.blockers.has(o)?a.blockers.get(o):d}const oe={};const le=e.startTransition;function ie({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:l}=n||{},i=e.useCallback((e=>{l&&le?le((()=>o(e))):o(e)}),[o,l]);e.useLayoutEffect((()=>r.subscribe(i)),[r,i]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s})),[r,u,s]);return e.createElement(e.Fragment,null,e.createElement(v.Provider,{value:c},e.createElement(E.Provider,{value:a},e.createElement(me,{basename:s,location:a.location,navigationType:a.historyAction,navigator:u,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(ue,{routes:r.routes,future:r.future,state:a}):t))),null)}function ue({routes:e,future:t,state:r}){return j(e,void 0,r,t)}function se({basename:t,children:r,initialEntries:n,initialIndex:a,future:o}){let l=e.useRef();null==l.current&&(l.current=m({initialEntries:n,initialIndex:a,v5Compat:!0}));let i=l.current,[u,s]=e.useState({action:i.action,location:i.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&le?le((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>i.listen(d)),[i,d]),e.createElement(me,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:i,future:o})}function ce({to:r,replace:n,state:l,relative:i}){S()||t(!1);let{future:u,static:s}=e.useContext(y),{matches:c}=e.useContext(C),{pathname:d}=P(),p=D(),m=o(r,a(c,u.v7_relativeSplatPath),d,"path"===i),h=JSON.stringify(m);return e.useEffect((()=>p(JSON.parse(h),{replace:n,state:l,relative:i})),[p,h,i,n,l]),null}function de(e){return F(e.context)}function pe(e){t(!1)}function me({basename:r="/",children:n=null,location:a,navigationType:o=u.Pop,navigator:i,static:s=!1,future:d}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:p,navigator:i,static:s,future:{v7_relativeSplatPath:!1,...d}})),[p,d,i,s]);"string"==typeof a&&(a=l(a));let{pathname:h="/",search:f="",hash:v="",state:E=null,key:g="default"}=a,C=e.useMemo((()=>{let e=c(h,p);return null==e?null:{location:{pathname:e,search:f,hash:v,state:E,key:g},navigationType:o}}),[p,h,f,v,E,g,o]);return null==C?null:e.createElement(y.Provider,{value:m},e.createElement(x.Provider,{children:n,value:C}))}function he({children:e,location:t}){return A(xe(e),t)}function fe({children:t,errorElement:r,resolve:n}){return e.createElement(ge,{resolve:n,errorElement:r},e.createElement(ye,null,t))}var ve=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ve||{});const Ee=new Promise((()=>{}));class ge extends e.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:t,errorElement:r,resolve:n}=this.props,a=null,o=ve.pending;if(n instanceof Promise)if(this.state.error){o=ve.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?ve.error:void 0!==a._data?ve.success:ve.pending):(o=ve.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=ve.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===ve.error&&a._error instanceof h)throw Ee;if(o===ve.error&&!r)throw a._error;if(o===ve.error)return e.createElement(g.Provider,{value:a,children:r});if(o===ve.success)return e.createElement(g.Provider,{value:a,children:t});throw a}}function ye({children:t}){let r=te(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function xe(r,n=[]){let a=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let l=[...n,o];if(r.type===e.Fragment)return void a.push.apply(a,xe(r.props.children,l));r.type!==pe&&t(!1),r.props.index&&r.props.children&&t(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=xe(r.props.children,l)),a.push(i)})),a}function Ce(e){return w(e)}function be(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Re(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:be,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}export{fe as Await,se as MemoryRouter,ce as Navigate,de as Outlet,pe as Route,me as Router,ie as RouterProvider,he as Routes,v as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,x as UNSAFE_LocationContext,y as UNSAFE_NavigationContext,C as UNSAFE_RouteContext,be as UNSAFE_mapRouteProperties,Y as UNSAFE_useRouteId,j as UNSAFE_useRoutesImpl,Re as createMemoryRouter,xe as createRoutesFromChildren,xe as createRoutesFromElements,Ce as renderMatches,Z as useActionData,re as useAsyncError,te as useAsyncValue,ae as useBlocker,R as useHref,S as useInRouterContext,Q as useLoaderData,P as useLocation,_ as useMatch,K as useMatches,D as useNavigate,q as useNavigation,U as useNavigationType,F as useOutlet,N as useOutletContext,L as useParams,O as useResolvedPath,G as useRevalidator,ee as useRouteError,X as useRouteLoaderData,A as useRoutes};
11
+ import*as e from"react";import*as t from"react-dom";import{decode as r}from"turbo-stream";let n=function(e){return e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e}({});function a(e={}){let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=f(null==a?t.length-1:a),s=n.Pop,l=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function h(){return t[i]}function m(e,r=null,n){return u(t?h().pathname:"/",e,r,n)}function p(e){return"string"==typeof e?e:c(e)}return{get index(){return i},get action(){return s},get location(){return h()},createHref:p,createURL:e=>new URL(p(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?d(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s=n.Push;let a=m(e,r);i+=1,t.splice(i,t.length,a),o&&l&&l({action:s,location:a,delta:1})},replace(e,r){s=n.Replace;let a=m(e,r);t[i]=a,o&&l&&l({action:s,location:a,delta:0})},go(e){s=n.Pop;let r=f(i+e),a=t[r];i=r,l&&l({action:s,location:a,delta:e})},listen:e=>(l=e,()=>{l=null})}}function o(e={}){return f((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return u("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:c(t)}),null,e)}function i(e={}){return f((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=d(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),u("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:c(t))}),(function(e,t){}),e)}function s(e,t){if(!1===e||null==e)throw new Error(t)}function l(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?d(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)}}function c({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function d(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function f(e,t,r,a={}){let{window:o=document.defaultView,v5Compat:i=!1}=a,d=o.history,f=n.Pop,h=null,m=p();function p(){return(d.state||{idx:null}).idx}function y(){f=n.Pop;let e=p(),t=null==e?null:e-m;m=e,h&&h({action:f,location:g.location,delta:t})}function v(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:c(e);return r=r.replace(/ $/,"%20"),t||s(!1),new URL(r,t)}null==m&&(m=0,d.replaceState({...d.state,idx:m},""));let g={get action(){return f},get location(){return e(o,d)},listen(e){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener("popstate",y),h=e,()=>{o.removeEventListener("popstate",y),h=null}},createHref:e=>t(o,e),createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){f=n.Push;let a=u(g.location,e,t);r&&r(a,e),m=p()+1;let s=l(a,m),c=g.createHref(a);try{d.pushState(s,"",c)}catch(y){if(y instanceof DOMException&&"DataCloneError"===y.name)throw y;o.location.assign(c)}i&&h&&h({action:f,location:g.location,delta:1})},replace:function(e,t){f=n.Replace;let a=u(g.location,e,t);r&&r(a,e),m=p();let o=l(a,m),s=g.createHref(a);d.replaceState(o,"",s),i&&h&&h({action:f,location:g.location,delta:0})},go:e=>d.go(e)};return g}let h=function(e){return e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error",e}({});const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function p(e,t,r=[],n={}){return e.map(((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(!0===e.index&&e.children&&s(!1),n[i]&&s(!1),function(e){return!0===e.index}(e)){let r={...e,...t(e),id:i};return n[i]=r,r}{let r={...e,...t(e),id:i,children:void 0};return n[i]=r,e.children&&(r.children=p(e.children,t,o,n)),r}}))}function y(e,t,r="/"){let n=D(("string"==typeof t?d(t):t).pathname||"/",r);if(null==n)return null;let a=g(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 i=0;null==o&&i<a.length;++i){let e=C(n);o=x(a[i],e)}return o}function v(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 g(e,t=[],r=[],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("/")&&(i.relativePath.startsWith(n)||s(!1),i.relativePath=i.relativePath.slice(n.length));let l=T([n,i.relativePath]),u=r.concat(i);e.children&&e.children.length>0&&(!0===e.index&&s(!1),g(e.children,t,u,l)),(null!=e.path||e.index)&&t.push({path:l,score:S(l,e.index),routesMeta:u})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of w(e.path))a(e,t,r);else a(e,t)})),t}function w(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=w(n.join("/")),s=[];return s.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const b=/^:[\w-]+$/,E=e=>"*"===e;function S(e,t){let r=e.split("/"),n=r.length;return r.some(E)&&(n+=-2),t&&(n+=2),r.filter((e=>!E(e))).reduce(((e,t)=>e+(b.test(t)?3:""===t?1:10)),n)}function x(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let i=0;i<r.length;++i){let e=r[i],s=i===r.length-1,l="/"===a?t:t.slice(a.length)||"/",u=R({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!u)return null;Object.assign(n,u.params);let c=e.route;o.push({params:n,pathname:T([a,u.pathname]),pathnameBase:j(T([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=T([a,u.pathnameBase]))}return o}function _(e,t={}){let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(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"?"!==r&&null==n&&s(!1),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");return[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce(((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=s[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function C(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return e}}function D(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 k(e,t="/"){let{pathname:r,search:n="",hash:a=""}="string"==typeof e?d(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:O(n),hash:A(a)}}function L(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function P(e,t){let r=L(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function M(e,t,r,n=!1){let a;"string"==typeof e?a=d(e):(a={...e},a.pathname&&a.pathname.includes("?")&&s(!1),a.pathname&&a.pathname.includes("#")&&s(!1),a.search&&a.search.includes("#")&&s(!1));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=k(a,o),c=l&&"/"!==l&&l.endsWith("/"),f=(i||"."===l)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!f||(u.pathname+="/"),u}const T=e=>e.join("/").replace(/\/\/+/g,"/"),j=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",A=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",U=(e,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),{...r,headers:n})};class F extends Error{}class ${pendingKeysSet=new Set;subscribers=new Set;deferredKeys=[];constructor(e,t){let r;(!e||"object"!=typeof e||Array.isArray(e))&&s(!1),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new F("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,r])=>Object.assign(e,{[t]:this.trackPromise(t,r)})),{}),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 F)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 null!==this.data&&this.done||s(!1),Object.entries(this.data).reduce(((e,[t,r])=>Object.assign(e,{[t]:H(r)})),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function H(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const N=(e,t={})=>new $(e,"number"==typeof t?{status:t}:t),B=(e,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,{...r,headers:n})},I=(e,t)=>{let r=B(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class z{constructor(e,t,r,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 J(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const W=["post","put","patch","delete"],K=new Set(W),q=["get",...W],X=new Set(q),Y=new Set([301,302,303,307,308]),V=new Set([307,308]),G={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Q={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,te=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function re(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(e.routes.length>0||s(!1),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=te;let i,l,c={},d=p(e.routes,o,void 0,c),f=e.basename||"/",m=e.unstable_dataStrategy||me,g={v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1,...e.future},w=null,b=new Set,E=null,S=null,x=null,_=null!=e.hydrationData,R=y(d,e.history.location,f),C=null;if(null==R){let t=ke(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=De(d);R=r,C={[n.id]:t}}let k,L=R.some((e=>e.route.lazy)),P=R.some((e=>e.route.loader));if(L)l=!1;else if(P)if(g.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||("function"!=typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=R.findIndex((e=>void 0!==r[e.route.id]));l=R.slice(0,e+1).every(n)}else l=R.every(n)}else l=null!=e.hydrationData;else l=!0;let M,T={historyAction:e.history.action,location:e.history.location,matches:R,initialized:l,navigation:G,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||C,fetchers:new Map,blockers:new Map},j=n.Pop,O=!1,A=!1,U=new Map,F=null,$=!1,H=!1,N=[],B=[],I=new Map,z=0,J=-1,W=new Map,K=new Set,q=new Map,X=new Map,Y=new Set,re=new Map,ne=new Map,ae=!1;function oe(e,t={}){T={...T,...e};let r=[],n=[];g.v7_fetcherPersist&&T.fetchers.forEach(((e,t)=>{"idle"===e.state&&(Y.has(t)?n.push(t):r.push(t))})),[...b].forEach((e=>e(T,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),g.v7_fetcherPersist&&(r.forEach((e=>T.fetchers.delete(e))),n.forEach((e=>Ae(e))))}function ie(t,r,{flushSync:a}={}){let o,s=null!=T.actionData&&null!=T.navigation.formMethod&&Fe(T.navigation.formMethod)&&"loading"===T.navigation.state&&!0!==t.state?._isRedirect;o=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:s?T.actionData:null;let l=r.loaderData?_e(T.loaderData,r.loaderData,r.matches||[],r.errors):T.loaderData,u=T.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,Z))));let c,f=!0===O||null!=T.navigation.formMethod&&Fe(T.navigation.formMethod)&&!0!==t.state?._isRedirect;if(i&&(d=i,i=void 0),$||j===n.Pop||(j===n.Push?e.history.push(t,t.state):j===n.Replace&&e.history.replace(t,t.state)),j===n.Pop){let e=U.get(T.location.pathname);e&&e.has(t.pathname)?c={currentLocation:T.location,nextLocation:t}:U.has(t.pathname)&&(c={currentLocation:t,nextLocation:T.location})}else if(A){let e=U.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),U.set(T.location.pathname,e)),c={currentLocation:T.location,nextLocation:t}}oe({...r,actionData:o,loaderData:l,historyAction:j,location:t,initialized:!0,navigation:G,revalidation:"idle",restoreScrollPosition:et(t,r.matches||T.matches),preventScrollReset:f,blockers:u},{viewTransitionOpts:c,flushSync:!0===a}),j=n.Pop,O=!1,A=!1,$=!1,H=!1,N=[],B=[]}async function ue(t,r,a){M&&M.abort(),M=null,j=t,$=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(E&&x){let r=Ze(e,t);E[r]=x()}}(T.location,T.matches),O=!0===(a&&a.preventScrollReset),A=!0===(a&&a.enableViewTransition);let o=i||d,s=a&&a.overrideNavigation,l=y(o,r,f),u=!0===(a&&a.flushSync);if(!l){let e=ke(404,{pathname:r.pathname}),{matches:t,route:n}=De(o);return Qe(),void ie(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:u})}if(T.initialized&&!H&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(T.location,r)&&!(a&&a.submission&&Fe(a.submission.formMethod)))return void ie(r,{matches:l},{flushSync:u});M=new AbortController;let c,m=we(e.history,r,M.signal,a&&a.submission);if(a&&a.pendingError)c=[Ce(l).route.id,{type:h.error,error:a.pendingError}];else if(a&&a.submission&&Fe(a.submission.formMethod)){let t=await async function(e,t,r,a,o={}){let i;be(),oe({navigation:Je(t,r)},{flushSync:!0===o.flushSync});let s=Be(a,t);if(s.route.action||s.route.lazy){if(i=(await fe("action",e,[s],a))[0],e.signal.aborted)return{shortCircuited:!0}}else i={type:h.error,error:ke(405,{method:e.method,pathname:t.pathname,routeId:s.route.id})};if(Oe(i)){let t;if(o&&null!=o.replace)t=o.replace;else{t=ge(i.response.headers.get("Location"),new URL(e.url),f)===T.location.pathname+T.location.search}return await de(e,i,{submission:r,replace:t}),{shortCircuited:!0}}if(Te(i))throw ke(400,{type:"defer-action"});if(je(i)){let e=Ce(a,s.route.id);return!0!==(o&&o.replace)&&(j=n.Push),{pendingActionResult:[e.route.id,i]}}return{pendingActionResult:[s.route.id,i]}}(m,r,a.submission,l,{replace:a.replace,flushSync:u});if(t.shortCircuited)return;c=t.pendingActionResult,s=ze(r,a.submission),u=!1,m=we(e.history,m.url,m.signal)}let{shortCircuited:p,loaderData:v,errors:w}=await async function(t,r,n,a,o,s,l,u,c,h){let m=a||ze(r,o),p=o||s||Ie(m),y=i||d,[v,w]=ce(e.history,T,n,p,r,g.v7_partialHydration&&!0===u,g.unstable_skipActionErrorRevalidation,H,N,B,Y,q,K,y,f,h);if(Qe((e=>!(n&&n.some((t=>t.route.id===e)))||v&&v.some((t=>t.route.id===e)))),J=++z,0===v.length&&0===w.length){let e=qe();return ie(r,{matches:n,loaderData:{},errors:h&&je(h[1])?{[h[0]]:h[1].error}:null,...Re(h),...e?{fetchers:new Map(T.fetchers)}:{}},{flushSync:c}),{shortCircuited:!0}}if(!($||g.v7_partialHydration&&u)){let e;w.forEach((e=>{let t=T.fetchers.get(e.key),r=We(void 0,t?t.data:void 0);T.fetchers.set(e.key,r)})),h&&!je(h[1])?e={[h[0]]:h[1].data}:T.actionData&&(e=0===Object.keys(T.actionData).length?null:T.actionData),oe({navigation:m,...void 0!==e?{actionData:e}:{},...w.length>0?{fetchers:new Map(T.fetchers)}:{}},{flushSync:c})}w.forEach((e=>{I.has(e.key)&&Ue(e.key),e.controller&&I.set(e.key,e.controller)}));let b=()=>w.forEach((e=>Ue(e.key)));M&&M.signal.addEventListener("abort",b);let{loaderResults:E,fetcherResults:S}=await he(T.matches,n,v,w,t);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",b);w.forEach((e=>I.delete(e.key)));let x=Le([...E,...S]);if(x){if(x.idx>=v.length){let e=w[x.idx-v.length].key;K.add(e)}return await de(t,x.result,{replace:l}),{shortCircuited:!0}}let{loaderData:_,errors:R}=xe(T,n,v,E,h,w,S,re);re.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&re.delete(t)}))})),g.v7_partialHydration&&u&&T.errors&&Object.entries(T.errors).filter((([e])=>!v.some((t=>t.route.id===e)))).forEach((([e,t])=>{R=Object.assign(R||{},{[e]:t})}));let C=qe(),D=Xe(J),k=C||D||w.length>0;return{loaderData:_,errors:R,...k?{fetchers:new Map(T.fetchers)}:{}}}(m,r,l,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,u,c);p||(M=null,ie(r,{matches:l,...Re(c),loaderData:v,errors:w}))}async function de(a,o,{submission:i,fetcherSubmission:l,replace:c}={}){o.response.headers.has("X-Remix-Revalidate")&&(H=!0);let d=o.response.headers.get("Location");d||s(!1),d=ge(d,new URL(a.url),f);let h=u(T.location,d,{_isRedirect:!0});if(r){let r=!1;if(o.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(ee.test(d)){const n=e.history.createURL(d);r=n.origin!==t.location.origin||null==D(n.pathname,f)}if(r)return void(c?t.location.replace(d):t.location.assign(d))}M=null;let m=!0===c?n.Replace:n.Push,{formMethod:p,formAction:y,formEncType:v}=T.navigation;!i&&!l&&p&&y&&v&&(i=Ie(T.navigation));let g=i||l;if(V.has(o.response.status)&&g&&Fe(g.formMethod))await ue(m,h,{submission:{...g,formAction:d},preventScrollReset:O});else{let e=ze(h,i);await ue(m,h,{overrideNavigation:e,fetcherSubmission:l,preventScrollReset:O})}}async function fe(e,t,r,n){try{let a=await pe(m,e,t,r,n,c,o);return await Promise.all(a.map(((e,a)=>{if(Me(e)){let o=e.result;return{type:h.redirect,response:ve(o,t,r[a].route.id,n,f,g.v7_relativeSplatPath)}}return ye(e)})))}catch(a){return r.map((()=>({type:h.error,error:a})))}}async function he(t,r,n,a,o){let[i,...s]=await Promise.all([n.length?fe("loader",o,n,r):[],...a.map((t=>{if(t.matches&&t.match&&t.controller){return fe("loader",we(e.history,t.path,t.controller.signal),[t.match],t.matches).then((e=>e[0]))}return Promise.resolve({type:h.error,error:ke(404,{pathname:t.path})})}))]);return await Promise.all([$e(t,n,i,i.map((()=>o.signal)),!1,T.loaderData),$e(t,a.map((e=>e.match)),s,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:i,fetcherResults:s}}function be(){H=!0,N.push(...Qe()),q.forEach(((e,t)=>{I.has(t)&&(B.push(t),Ue(t))}))}function Ee(e,t,r={}){T.fetchers.set(e,t),oe({fetchers:new Map(T.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Se(e,t,r,n={}){let a=Ce(T.matches,t);Ae(e),oe({errors:{[a.route.id]:r},fetchers:new Map(T.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Pe(e){return g.v7_fetcherPersist&&(X.set(e,(X.get(e)||0)+1),Y.has(e)&&Y.delete(e)),T.fetchers.get(e)||Q}function Ae(e){let t=T.fetchers.get(e);!I.has(e)||t&&"loading"===t.state&&W.has(e)||Ue(e),q.delete(e),W.delete(e),K.delete(e),Y.delete(e),T.fetchers.delete(e)}function Ue(e){let t=I.get(e);t||s(!1),t.abort(),I.delete(e)}function Ne(e){for(let t of e){let e=Ke(Pe(t).data);T.fetchers.set(t,e)}}function qe(){let e=[],t=!1;for(let r of K){let n=T.fetchers.get(r);n||s(!1),"loading"===n.state&&(K.delete(r),e.push(r),t=!0)}return Ne(e),t}function Xe(e){let t=[];for(let[r,n]of W)if(n<e){let e=T.fetchers.get(r);e||s(!1),"loading"===e.state&&(Ue(r),W.delete(r),t.push(r))}return Ne(t),t.length>0}function Ye(e){T.blockers.delete(e),ne.delete(e)}function Ve(e,t){let r=T.blockers.get(e)||Z;"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||s(!1);let n=new Map(T.blockers);n.set(e,t),oe({blockers:n})}function Ge({currentLocation:e,nextLocation:t,historyAction:r}){if(0===ne.size)return;ne.size;let n=Array.from(ne.entries()),[a,o]=n[n.length-1],i=T.blockers.get(a);return i&&"proceeding"===i.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:r})?a:void 0}function Qe(e){let t=[];return re.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),re.delete(n))})),t}function Ze(e,t){if(S){return S(e,t.map((e=>v(e,T.loaderData))))||e.key}return e.key}function et(e,t){if(E){let r=Ze(e,t),n=E[r];if("number"==typeof n)return n}return null}return k={get basename(){return f},get future(){return g},get state(){return T},get routes(){return d},get window(){return t},initialize:function(){if(w=e.history.listen((({action:t,location:r,delta:n})=>{if(ae)return void(ae=!1);let a=Ge({currentLocation:T.location,nextLocation:r,historyAction:t});return a&&null!=n?(ae=!0,e.history.go(-1*n),void Ve(a,{state:"blocked",location:r,proceed(){Ve(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),e.history.go(n)},reset(){let e=new Map(T.blockers);e.set(a,Z),oe({blockers:e})}})):ue(t,r)})),r){!function(e,t){try{let r=e.sessionStorage.getItem("remix-router-transitions");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(r){}}(t,U);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem("remix-router-transitions",JSON.stringify(n))}catch(r){}}}(t,U);t.addEventListener("pagehide",e),F=()=>t.removeEventListener("pagehide",e)}return T.initialized||ue(n.Pop,T.location,{initialHydration:!0}),k},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(E=e,x=t,S=r||null,!_&&T.navigation===G){_=!0;let e=et(T.location,T.matches);null!=e&&oe({restoreScrollPosition:e})}return()=>{E=null,x=null,S=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=se(T.location,T.matches,f,g.v7_prependBasename,r,g.v7_relativeSplatPath,a?.fromRouteId,a?.relative),{path:i,submission:s,error:l}=le(g.v7_normalizeFormMethod,!1,o,a),c=T.location,d=u(T.location,i,a&&a.state);d={...d,...e.history.encodeLocation(d)};let h=a&&null!=a.replace?a.replace:void 0,m=n.Push;!0===h?m=n.Replace:!1===h||null!=s&&Fe(s.formMethod)&&s.formAction===T.location.pathname+T.location.search&&(m=n.Replace);let p=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=!0===(a&&a.unstable_flushSync),v=Ge({currentLocation:c,nextLocation:d,historyAction:m});if(!v)return await ue(m,d,{submission:s,pendingError:l,preventScrollReset:p,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:y});Ve(v,{state:"blocked",location:d,proceed(){Ve(v,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(T.blockers);e.set(v,Z),oe({blockers:e})}})},fetch:function(t,r,n,o){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(t)&&Ue(t);let l=!0===(o&&o.unstable_flushSync),u=i||d,c=se(T.location,T.matches,f,g.v7_prependBasename,n,g.v7_relativeSplatPath,r,o?.relative),h=y(u,c,f);if(!h)return void Se(t,r,ke(404,{pathname:c}),{flushSync:l});let{path:m,submission:p,error:v}=le(g.v7_normalizeFormMethod,!0,c,o);if(v)return void Se(t,r,v,{flushSync:l});let w=Be(h,m);O=!0===(o&&o.preventScrollReset),p&&Fe(p.formMethod)?async function(t,r,n,a,o,l,u){if(be(),q.delete(t),!a.route.action&&!a.route.lazy){let e=ke(405,{method:u.formMethod,pathname:n,routeId:r});return void Se(t,r,e,{flushSync:l})}let c=T.fetchers.get(t);Ee(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(u,c),{flushSync:l});let h=new AbortController,m=we(e.history,n,h.signal,u);I.set(t,h);let p=z,v=(await fe("action",m,[a],o))[0];if(m.signal.aborted)return void(I.get(t)===h&&I.delete(t));if(g.v7_fetcherPersist&&Y.has(t)){if(Oe(v)||je(v))return void Ee(t,Ke(void 0))}else{if(Oe(v))return I.delete(t),J>p?void Ee(t,Ke(void 0)):(K.add(t),Ee(t,We(u)),de(m,v,{fetcherSubmission:u}));if(je(v))return void Se(t,r,v.error)}if(Te(v))throw ke(400,{type:"defer-action"});let w=T.navigation.location||T.location,b=we(e.history,w,h.signal),E=i||d,S="idle"!==T.navigation.state?y(E,T.navigation.location,f):T.matches;S||s(!1);let x=++z;W.set(t,x);let _=We(u,v.data);T.fetchers.set(t,_);let[R,C]=ce(e.history,T,S,u,w,!1,g.unstable_skipActionErrorRevalidation,H,N,B,Y,q,K,E,f,[a.route.id,v]);C.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=T.fetchers.get(t),n=We(void 0,r?r.data:void 0);T.fetchers.set(t,n),I.has(t)&&Ue(t),e.controller&&I.set(t,e.controller)})),oe({fetchers:new Map(T.fetchers)});let D=()=>C.forEach((e=>Ue(e.key)));h.signal.addEventListener("abort",D);let{loaderResults:k,fetcherResults:L}=await he(T.matches,S,R,C,b);if(h.signal.aborted)return;h.signal.removeEventListener("abort",D),W.delete(t),I.delete(t),C.forEach((e=>I.delete(e.key)));let P=Le([...k,...L]);if(P){if(P.idx>=R.length){let e=C[P.idx-R.length].key;K.add(e)}return de(b,P.result)}let{loaderData:O,errors:A}=xe(T,T.matches,R,k,void 0,C,L,re);if(T.fetchers.has(t)){let e=Ke(v.data);T.fetchers.set(t,e)}Xe(x),"loading"===T.navigation.state&&x>J?(j||s(!1),M&&M.abort(),ie(T.navigation.location,{matches:S,loaderData:O,errors:A,fetchers:new Map(T.fetchers)})):(oe({errors:A,loaderData:_e(T.loaderData,O,S,A),fetchers:new Map(T.fetchers)}),H=!1)}(t,r,m,w,h,l,p):(q.set(t,{routeId:r,path:m}),async function(t,r,n,a,o,i,l){let u=T.fetchers.get(t);Ee(t,We(l,u?u.data:void 0),{flushSync:i});let c=new AbortController,d=we(e.history,n,c.signal);I.set(t,c);let f=z,h=(await fe("loader",d,[a],o))[0];Te(h)&&(h=await He(h,d.signal,!0)||h);I.get(t)===c&&I.delete(t);if(d.signal.aborted)return;if(Y.has(t))return void Ee(t,Ke(void 0));if(Oe(h))return J>f?void Ee(t,Ke(void 0)):(K.add(t),void(await de(d,h)));if(je(h))return void Se(t,r,h.error);Te(h)&&s(!1),Ee(t,Ke(h.data))}(t,r,m,w,h,l,p))},revalidate:function(){be(),oe({revalidation:"loading"}),"submitting"!==T.navigation.state&&("idle"!==T.navigation.state?ue(j||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation}):ue(T.historyAction,T.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,deleteFetcher:function(e){if(g.v7_fetcherPersist){let t=(X.get(e)||0)-1;t<=0?(X.delete(e),Y.add(e)):X.set(e,t)}else Ae(e);oe({fetchers:new Map(T.fetchers)})},dispose:function(){w&&w(),F&&F(),b.clear(),M&&M.abort(),T.fetchers.forEach(((e,t)=>Ae(t))),T.blockers.forEach(((e,t)=>Ye(t)))},getBlocker:function(e,t){let r=T.blockers.get(e)||Z;return ne.get(e)!==t&&ne.set(e,t),r},deleteBlocker:Ye,_internalFetchControllers:I,_internalActiveDeferreds:re,_internalSetRoutes:function(e){c={},i=p(e,o,void 0,c)}},k}const ne=Symbol("deferred");function ae(e,t){e.length>0||s(!1);let r,n={},a=(t?t.basename:null)||"/";if(t?.mapRouteProperties)r=t.mapRouteProperties;else if(t?.detectErrorBoundary){let e=t.detectErrorBoundary;r=t=>({hasErrorBoundary:e(t)})}else r=te;let o={v7_relativeSplatPath:!1,v7_throwAbortReason:!1,...t?t.future:null},i=p(e,r,void 0,n);async function l(e,t,r,n,a,i,l){e.signal||s(!1);try{if(Fe(e.method.toLowerCase())){let s=await async function(e,t,r,n,a,i,s){let l;if(r.route.action||r.route.lazy){l=(await f("action",e,[r],t,s,n,a))[0],e.signal.aborted&&ie(e,s,o)}else{let t=ke(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:r.route.id});if(s)throw t;l={type:h.error,error:t}}if(Oe(l))throw new Response(null,{status:l.response.status,headers:{Location:l.response.headers.get("Location")}});if(Te(l)){let e=ke(400,{type:"defer-action"});if(s)throw e;l={type:h.error,error:e}}if(s){if(je(l))throw l.error;return{matches:[r],loaderData:{},actionData:{[r.route.id]:l.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let u=new Request(e.url,{headers:e.headers,redirect:e.redirect,signal:e.signal});if(je(l)){let e=i?r:Ce(t,r.route.id);return{...await d(u,t,n,a,i,null,[e.route.id,l]),statusCode:J(l.error)?l.error.status:null!=l.statusCode?l.statusCode:500,actionData:null,actionHeaders:{...l.headers?{[r.route.id]:l.headers}:{}}}}return{...await d(u,t,n,a,i,null),actionData:{[r.route.id]:l.data},...l.statusCode?{statusCode:l.statusCode}:{},actionHeaders:l.headers?{[r.route.id]:l.headers}:{}}}(e,r,l||Be(r,t),n,a,i,null!=l);return s}let s=await d(e,r,n,a,i,l);return Ae(s)?s:{...s,actionData:null,actionHeaders:{}}}catch(u){if(function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&(e.type===h.data||e.type===h.error)}(u)&&Ae(u.result)){if(u.type===h.error)throw u.result;return u.result}if(function(e){if(!Ae(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&null!=r}(u))return u;throw u}}async function d(e,t,r,n,a,i,s){let l=null!=i;if(l&&!i?.route.loader&&!i?.route.lazy)throw ke(400,{method:e.method,pathname:new URL(e.url).pathname,routeId:i?.route.id});let u=(i?[i]:s&&je(s[1])?ue(t,s[0]):t).filter((e=>e.route.loader||e.route.lazy));if(0===u.length)return{matches:t,loaderData:t.reduce(((e,t)=>Object.assign(e,{[t.route.id]:null})),{}),errors:s&&je(s[1])?{[s[0]]:s[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let c=await f("loader",e,u,t,l,r,n);e.signal.aborted&&ie(e,l,o);let d=new Map,h=Se(t,u,c,s,d,a),m=new Set(u.map((e=>e.route.id)));return t.forEach((e=>{m.has(e.route.id)||(h.loaderData[e.route.id]=null)})),{...h,matches:t,activeDeferreds:d.size>0?Object.fromEntries(d.entries()):null}}async function f(e,t,i,s,l,u,c){let d=await pe(c||me,e,t,i,s,n,r,u);return await Promise.all(d.map(((e,r)=>{if(Me(e)){throw ve(e.result,t,i[r].route.id,s,a,o.v7_relativeSplatPath)}if(Ae(e.result)&&l)throw e;return ye(e)})))}return{dataRoutes:i,query:async function(e,{requestContext:t,skipLoaderErrorBubbling:r,unstable_dataStrategy:n}={}){let o=new URL(e.url),s=e.method,d=u("",c(o),null,"default"),f=y(i,d,a);if(!Ue(s)&&"HEAD"!==s){let e=ke(405,{method:s}),{matches:t,route:r}=De(i);return{basename:a,location:d,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(!f){let e=ke(404,{pathname:d.pathname}),{matches:t,route:r}=De(i);return{basename:a,location:d,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let h=await l(e,d,f,t,n||null,!0===r,null);return Ae(h)?h:{location:d,basename:a,...h}},queryRoute:async function(e,{routeId:t,requestContext:r}={}){let n=new URL(e.url),o=e.method,s=u("",c(n),null,"default"),d=y(i,s,a);if(!Ue(o)&&"HEAD"!==o&&"OPTIONS"!==o)throw ke(405,{method:o});if(!d)throw ke(404,{pathname:s.pathname});let f=t?d.find((e=>e.route.id===t)):Be(d,s);if(t&&!f)throw ke(403,{pathname:s.pathname,routeId:t});if(!f)throw ke(404,{pathname:s.pathname});let h=await l(e,s,d,r,null,!1,f);if(Ae(h))return h;let m=h.errors?Object.values(h.errors)[0]:void 0;if(void 0!==m)throw m;if(h.actionData)return Object.values(h.actionData)[0];if(h.loaderData){let e=Object.values(h.loaderData)[0];return h.activeDeferreds?.[f.route.id]&&(e[ne]=h.activeDeferreds[f.route.id]),e}}}}function oe(e,t,r){return{...t,statusCode:J(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}}}function ie(e,t,r){if(r.v7_throwAbortReason&&void 0!==e.signal.reason)throw e.signal.reason;throw new Error(`${t?"queryRoute":"query"}() call aborted: ${e.method} ${e.url}`)}function se(e,t,r,n,a,o,i,s){let l,u;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){u=e;break}}else l=t,u=t[t.length-1];let d=M(a||".",P(l,o),D(e.pathname,r)||e.pathname,"path"===s);return null==a&&(d.search=e.search,d.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||Ne(d.search)||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(d.pathname="/"===d.pathname?r:T([r,d.pathname])),c(d)}function le(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&&!Ue(n.formMethod))return{path:r,error:ke(405,{method:n.formMethod})};let a,o,i=()=>({path:r,error:ke(400,{type:"invalid-body"})}),l=n.formMethod||"get",u=e?l.toUpperCase():l.toLowerCase(),f=Pe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Fe(u))return i();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,[t,r])=>`${e}${t}=${r}\n`),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Fe(u))return i();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(p){return i()}}}if("function"!=typeof FormData&&s(!1),n.formData)a=be(n.formData),o=n.formData;else if(n.body instanceof FormData)a=be(n.body),o=n.body;else if(n.body instanceof URLSearchParams)a=n.body,o=Ee(a);else if(null==n.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(n.body),o=Ee(a)}catch(p){return i()}let h={formMethod:u,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(Fe(h.formMethod))return{path:r,submission:h};let m=d(r);return t&&m.search&&Ne(m.search)&&a.append("index",""),m.search=`?${a}`,{path:c(m),submission:h}}function ue(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}function ce(e,t,r,n,a,o,i,s,l,u,c,d,f,h,m,p){let v=p?je(p[1])?p[1].error:p[1].data:void 0,g=e.createURL(t.location),w=e.createURL(a),b=p&&je(p[1])?p[0]:void 0,E=b?ue(r,b):r,S=p?p[1].statusCode:void 0,x=i&&S&&S>=400,_=E.filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!("function"==typeof a.loader&&!a.loader.hydrate)||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||l.some((t=>t===e.route.id)))return!0;let i=t.matches[r],u=e;return fe(e,{currentUrl:g,currentParams:i.params,nextUrl:w,nextParams:u.params,...n,actionResult:v,unstable_actionStatus:S,defaultShouldRevalidate:!x&&(s||g.pathname+g.search===w.pathname+w.search||g.search!==w.search||de(i,u))})})),R=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let i=y(h,e.path,m);if(!i)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(a),d=Be(i,e.path),p=!1;p=!f.has(a)&&(!!u.includes(a)||(l&&"idle"!==l.state&&void 0===l.data?s:fe(d,{currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params,...n,actionResult:v,unstable_actionStatus:S,defaultShouldRevalidate:!x&&s}))),p&&R.push({key:a,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})})),[_,R]}function de(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function fe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function he(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];a||s(!1);let o={};for(let i in n){void 0!==a[i]&&"hasErrorBoundary"!==i||m.has(i)||(o[i]=n[i])}Object.assign(a,o),Object.assign(a,{...t(a),lazy:void 0})}function me(e){return Promise.all(e.matches.map((e=>e.resolve())))}async function pe(e,t,r,n,a,o,i,l){let u=n.reduce(((e,t)=>e.add(t.route.id)),new Set),c=new Set,d=await e({matches:a.map((e=>{let n=u.has(e.route.id);return{...e,shouldLoad:n,resolve:a=>(c.add(e.route.id),n?async function(e,t,r,n,a,o,i){let l,u,c=n=>{let a,s=new Promise(((e,t)=>a=t));u=()=>a(),t.signal.addEventListener("abort",u);let l,c=a=>"function"!=typeof n?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):n({request:t,params:r.params,context:i},...void 0!==a?[a]:[]);return l=o?o((e=>c(e))):(async()=>{try{return{type:"data",result:await c()}}catch(e){return{type:"error",result:e}}})(),Promise.race([l,s])};try{let o=r.route[e];if(r.route.lazy)if(o){let e,[t]=await Promise.all([c(o).catch((t=>{e=t})),he(r.route,a,n)]);if(void 0!==e)throw e;l=t}else{if(await he(r.route,a,n),o=r.route[e],!o){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw ke(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:h.data,result:void 0}}l=await c(o)}else{if(!o){let e=new URL(t.url);throw ke(404,{pathname:e.pathname+e.search})}l=await c(o)}void 0===l.result&&s(!1)}catch(d){return{type:h.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return l}(t,r,e,o,i,a,l):Promise.resolve({type:h.data,result:void 0}))}})),request:r,params:a[0].params,context:l});return a.forEach((e=>c.has(e.route.id)?void 0:s(!1))),d.filter(((e,t)=>u.has(a[t].route.id)))}async function ye(e){let{result:t,type:r,status:n}=e;if(Ae(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(a){return{type:h.error,error:a}}return r===h.error?{type:h.error,error:new z(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:h.data,data:e,statusCode:t.status,headers:t.headers}}return r===h.error?{type:h.error,error:t,statusCode:J(t)?t.status:n}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:h.deferred,deferredData:t,statusCode:t.init?.status,headers:t.init?.headers&&new Headers(t.init.headers)}:{type:h.data,data:t,statusCode:n}}function ve(e,t,r,n,a,o){let i=e.headers.get("Location");if(i||s(!1),!ee.test(i)){let s=n.slice(0,n.findIndex((e=>e.route.id===r))+1);i=se(new URL(t.url),s,a,!0,i,o),e.headers.set("Location",i)}return e}function ge(e,t,r){if(ee.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=null!=D(a.pathname,r);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function we(e,t,r,n){let a=e.createURL(Pe(t)).toString(),o={signal:r};if(n&&Fe(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=be(n.formData):o.body=n.formData}return new Request(a,o)}function be(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Ee(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Se(e,t,r,n,a,o){let i,l={},u=null,c=!1,d={},f=n&&je(n[1])?n[1].error:void 0;return r.forEach(((r,n)=>{let h=t[n].route.id;if(Oe(r)&&s(!1),je(r)){let t=r.error;if(void 0!==f&&(t=f,f=void 0),u=u||{},o)u[h]=t;else{let r=Ce(e,h);null==u[r.route.id]&&(u[r.route.id]=t)}l[h]=void 0,c||(c=!0,i=J(r.error)?r.error.status:500),r.headers&&(d[h]=r.headers)}else Te(r)?(a.set(h,r.deferredData),l[h]=r.deferredData.data,null==r.statusCode||200===r.statusCode||c||(i=r.statusCode),r.headers&&(d[h]=r.headers)):(l[h]=r.data,r.statusCode&&200!==r.statusCode&&!c&&(i=r.statusCode),r.headers&&(d[h]=r.headers))})),void 0!==f&&n&&(u={[n[0]]:f},l[n[0]]=void 0),{loaderData:l,errors:u,statusCode:i||200,loaderHeaders:d}}function xe(e,t,r,n,a,o,i,l){let{loaderData:u,errors:c}=Se(t,r,n,a,l,!1);for(let d=0;d<o.length;d++){let{key:t,match:r,controller:n}=o[d];(void 0===i||void 0===i[d])&&s(!1);let a=i[d];if(!n||!n.signal.aborted)if(je(a)){let n=Ce(e.matches,r?.route.id);c&&c[n.route.id]||(c={...c,[n.route.id]:a.error}),e.fetchers.delete(t)}else if(Oe(a))s(!1);else if(Te(a))s(!1);else{let r=Ke(a.data);e.fetchers.set(t,r)}}return{loaderData:u,errors:c}}function _e(e,t,r,n){let a={...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 Re(e){return e?je(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ce(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 De(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 ke(e,{pathname:t,routeId:r,method:n,type:a}={}){let o="Unknown Server Error",i="Unknown @remix-run/router error";return 400===e?(o="Bad Request",n&&t&&r?i=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"defer-action"===a?i="defer() is not supported in actions":"invalid-body"===a&&(i="Unable to encode submission body")):403===e?(o="Forbidden",i=`Route "${r}" does not match URL "${t}"`):404===e?(o="Not Found",i=`No route matches URL "${t}"`):405===e&&(o="Method Not Allowed",n&&t&&r?i=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(i=`Invalid request method "${n.toUpperCase()}"`)),new z(e||500,o,new Error(i),!0)}function Le(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Oe(r))return{result:r,idx:t}}}function Pe(e){return c({..."string"==typeof e?d(e):e,hash:""})}function Me(e){return Ae(e.result)&&Y.has(e.result.status)}function Te(e){return e.type===h.deferred}function je(e){return e.type===h.error}function Oe(e){return(e&&e.type)===h.redirect}function Ae(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Ue(e){return X.has(e.toLowerCase())}function Fe(e){return K.has(e.toLowerCase())}async function $e(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],u=t[i];if(!u)continue;let c=e.find((e=>e.route.id===u.route.id)),d=null!=c&&!de(c,u)&&void 0!==(o&&o[u.route.id]);if(Te(l)&&(a||d)){let e=n[i];e||s(!1),await He(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function He(e,t,r=!1){if(!(await e.deferredData.resolveData(t))){if(r)try{return{type:h.data,data:e.deferredData.unwrappedData}}catch(n){return{type:h.error,error:n}}return{type:h.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?d(t).search:t.search;if(e[e.length-1].route.index&&Ne(r||""))return e[e.length-1];let n=L(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){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Je(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function We(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ke(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}const qe=e.createContext(null),Xe=e.createContext(null),Ye=e.createContext(null),Ve=e.createContext(null),Ge=e.createContext(null),Qe=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Ze=e.createContext(null);function et(t,{relative:r}={}){tt()||s(!1);let{basename:n,navigator:a}=e.useContext(Ve),{hash:o,pathname:i,search:l}=dt(t,{relative:r}),u=i;return"/"!==n&&(u="/"===i?n:T([n,i])),a.createHref({pathname:u,search:l,hash:o})}function tt(){return null!=e.useContext(Ge)}function rt(){return tt()||s(!1),e.useContext(Ge).location}function nt(){return e.useContext(Ge).navigationType}function at(t){tt()||s(!1);let{pathname:r}=rt();return e.useMemo((()=>R(t,r)),[r,t])}function ot(t){e.useContext(Ve).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Qe);return t?function(){let{router:t}=Et(wt.UseNavigateStable),r=xt(bt.UseNavigateStable),n=e.useRef(!1);return ot((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){tt()||s(!1);let t=e.useContext(qe),{basename:r,future:n,navigator:a}=e.useContext(Ve),{matches:o}=e.useContext(Qe),{pathname:i}=rt(),l=JSON.stringify(P(o,n.v7_relativeSplatPath)),u=e.useRef(!1);return ot((()=>{u.current=!0})),e.useCallback(((e,n={})=>{if(!u.current)return;if("number"==typeof e)return void a.go(e);let o=M(e,JSON.parse(l),i,"path"===n.relative);null==t&&"/"!==r&&(o.pathname="/"===o.pathname?r:T([r,o.pathname])),(n.replace?a.replace:a.push)(o,n.state,n)}),[r,a,l,i,t])}()}const st=e.createContext(null);function lt(){return e.useContext(st)}function ut(t){let r=e.useContext(Qe).outlet;return r?e.createElement(st.Provider,{value:t},r):r}function ct(){let{matches:t}=e.useContext(Qe),r=t[t.length-1];return r?r.params:{}}function dt(t,{relative:r}={}){let{future:n}=e.useContext(Ve),{matches:a}=e.useContext(Qe),{pathname:o}=rt(),i=JSON.stringify(P(a,n.v7_relativeSplatPath));return e.useMemo((()=>M(t,JSON.parse(i),o,"path"===r)),[t,i,o,r])}function ft(e,t){return ht(e,t)}function ht(t,r,a,o){tt()||s(!1);let{navigator:i}=e.useContext(Ve),{matches:l}=e.useContext(Qe),u=l[l.length-1],c=u?u.params:{};!u||u.pathname;let f=u?u.pathnameBase:"/";u&&u.route;let h,m=rt();if(r){let e="string"==typeof r?d(r):r;"/"===f||e.pathname?.startsWith(f)||s(!1),h=e}else h=m;let p=h.pathname||"/",v=p;if("/"!==f){let e=f.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=y(t,{pathname:v}),w=gt(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:T([f,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:T([f,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,a,o);return r&&w?e.createElement(Ge.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:n.Pop}},w):w}function mt(){let t=Mt(),r=J(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const pt=e.createElement(mt,null);class yt extends e.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?e.createElement(Qe.Provider,{value:this.props.routeContext},e.createElement(Ze.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vt({routeContext:t,match:r,children:n}){let a=e.useContext(qe);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(Qe.Provider,{value:t},n)}function gt(t,r=[],n=null,a=null){if(null==t){if(!n?.errors)return null;t=n.matches}let o=t,i=n?.errors;if(null!=i){let e=o.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));e>=0||s(!1),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,u=-1;if(n&&a&&a.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){l=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight(((t,a,s)=>{let c,d=!1,f=null,h=null;var m;n&&(c=i&&a.route.id?i[a.route.id]:void 0,f=a.route.errorElement||pt,l&&(u<0&&0===s?(m="route-fallback",!1||Ut[m]||(Ut[m]=!0),d=!0,h=null):u===s&&(d=!0,h=a.route.hydrateFallbackElement||null)));let p=r.concat(o.slice(0,s+1)),y=()=>{let r;return r=c?f:d?h:a.route.Component?e.createElement(a.route.Component,null):a.route.element?a.route.element:t,e.createElement(vt,{match:a,routeContext:{outlet:t,matches:p,isDataRoute:null!=n},children:r})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===s)?e.createElement(yt,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):y()}),null)}var wt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(wt||{}),bt=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}(bt||{});function Et(t){let r=e.useContext(qe);return r||s(!1),r}function St(t){let r=e.useContext(Xe);return r||s(!1),r}function xt(t){let r=function(t){let r=e.useContext(Qe);return r||s(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||s(!1),n.route.id}function _t(){return xt(bt.UseRouteId)}function Rt(){return St(bt.UseNavigation).navigation}function Ct(){let t=Et(wt.UseRevalidator),r=St(bt.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function Dt(){let{matches:t,loaderData:r}=St(bt.UseMatches);return e.useMemo((()=>t.map((e=>v(e,r)))),[t,r])}function kt(){let e=St(bt.UseLoaderData),t=xt(bt.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 St(bt.UseRouteLoaderData).loaderData[e]}function Pt(){let e=St(bt.UseActionData),t=xt(bt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Mt(){let t=e.useContext(Ze),r=St(bt.UseRouteError),n=xt(bt.UseRouteError);return void 0!==t?t:r.errors?.[n]}function Tt(){return e.useContext(Ye)?._data}function jt(){return e.useContext(Ye)?._error}let Ot=0;function At(t){let{router:r,basename:n}=Et(wt.UseBlocker),a=St(bt.UseBlocker),[o,i]=e.useState(""),s=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:D(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:D(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++Ot);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,s)}),[r,o,s]),o&&a.blockers.has(o)?a.blockers.get(o):Z}const Ut={};function Ft(t){let r={hasErrorBoundary:t.hasErrorBoundary||null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function $t(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:a({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:Ft,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}const Ht=e.startTransition;function Nt({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:i}=n||{},s=e.useCallback((e=>{i&&Ht?Ht((()=>o(e))):o(e)}),[o,i]);e.useLayoutEffect((()=>r.subscribe(s)),[r,s]),e.useEffect((()=>{}),[]);let l=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),u=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:l,static:!1,basename:u})),[r,l,u]);return e.createElement(e.Fragment,null,e.createElement(qe.Provider,{value:c},e.createElement(Xe.Provider,{value:a},e.createElement(Kt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:l,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(Bt,{routes:r.routes,future:r.future,state:a}):t))),null)}function Bt({routes:e,future:t,state:r}){return ht(e,void 0,r,t)}function It({basename:t,children:r,initialEntries:n,initialIndex:o,future:i}){let s=e.useRef();null==s.current&&(s.current=a({initialEntries:n,initialIndex:o,v5Compat:!0}));let l=s.current,[u,c]=e.useState({action:l.action,location:l.location}),{v7_startTransition:d}=i||{},f=e.useCallback((e=>{d&&Ht?Ht((()=>c(e))):c(e)}),[c,d]);return e.useLayoutEffect((()=>l.listen(f)),[l,f]),e.createElement(Kt,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l,future:i})}function zt({to:t,replace:r,state:n,relative:a}){tt()||s(!1);let{future:o,static:i}=e.useContext(Ve),{matches:l}=e.useContext(Qe),{pathname:u}=rt(),c=it(),d=M(t,P(l,o.v7_relativeSplatPath),u,"path"===a),f=JSON.stringify(d);return e.useEffect((()=>c(JSON.parse(f),{replace:r,state:n,relative:a})),[c,f,a,r,n]),null}function Jt(e){return ut(e.context)}function Wt(e){s(!1)}function Kt({basename:t="/",children:r=null,location:a,navigationType:o=n.Pop,navigator:i,static:l=!1,future:u}){tt()&&s(!1);let c=t.replace(/^\/*/,"/"),f=e.useMemo((()=>({basename:c,navigator:i,static:l,future:{v7_relativeSplatPath:!1,...u}})),[c,u,i,l]);"string"==typeof a&&(a=d(a));let{pathname:h="/",search:m="",hash:p="",state:y=null,key:v="default"}=a,g=e.useMemo((()=>{let e=D(h,c);return null==e?null:{location:{pathname:e,search:m,hash:p,state:y,key:v},navigationType:o}}),[c,h,m,p,y,v,o]);return null==g?null:e.createElement(Ve.Provider,{value:f},e.createElement(Ge.Provider,{children:r,value:g}))}function qt({children:e,location:t}){return ft(Zt(e),t)}function Xt({children:t,errorElement:r,resolve:n}){return e.createElement(Gt,{resolve:n,errorElement:r},e.createElement(Qt,null,t))}var Yt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Yt||{});const Vt=new Promise((()=>{}));class Gt extends e.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:t,errorElement:r,resolve:n}=this.props,a=null,o=Yt.pending;if(n instanceof Promise)if(this.state.error){o=Yt.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?Yt.error:void 0!==a._data?Yt.success:Yt.pending):(o=Yt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=Yt.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===Yt.error&&a._error instanceof F)throw Vt;if(o===Yt.error&&!r)throw a._error;if(o===Yt.error)return e.createElement(Ye.Provider,{value:a,children:r});if(o===Yt.success)return e.createElement(Ye.Provider,{value:a,children:t});throw a}}function Qt({children:t}){let r=Tt(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function Zt(t,r=[]){let n=[];return e.Children.forEach(t,((t,a)=>{if(!e.isValidElement(t))return;let o=[...r,a];if(t.type===e.Fragment)return void n.push.apply(n,Zt(t.props.children,o));t.type!==Wt&&s(!1),t.props.index&&t.props.children&&s(!1);let i={id:t.props.id||o.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=Zt(t.props.children,o)),n.push(i)})),n}function er(e){return gt(e)}const tr="application/x-www-form-urlencoded";function rr(e){return null!=e&&"string"==typeof e.tagName}function nr(e=""){return 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 ar=null;const or=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ir(e){return null==e||or.has(e)?e:null}function sr(e,t){let r,n,a,o,i;if(rr(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?D(i,t):null,r=e.getAttribute("method")||"get",a=ir(e.getAttribute("enctype"))||tr,o=new FormData(e)}else if(function(e){return rr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return rr(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 s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?D(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",a=ir(e.getAttribute("formenctype"))||ir(i.getAttribute("enctype"))||tr,o=new FormData(i,e),!function(){if(null===ar)try{new FormData(document.createElement("form"),0),ar=!1}catch(e){ar=!0}return ar}()){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(rr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r="get",n=null,a=tr,i=e}var s;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}function lr(e,t){if(!1===e||null==e)throw new Error(t)}async function ur(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(window.__remixContext&&window.__remixContext.isSpaMode&&void 0!==import.meta.hot)throw console.error(`Error loading route module \`${e.module}\`:`,r),r;return window.location.reload(),new Promise((()=>{}))}}function cr(e,t,r){let n=e.map((e=>{let n=t[e.route.id],a=r.routes[e.route.id];return[a.css?a.css.map((e=>({rel:"stylesheet",href:e}))):[],n?.links?.()||[]]})).flat(2),a=function(e,t){return yr(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(e,r);return vr(n,a)}async function dr(e,t){if(!e.css&&!t.links||!function(){if(void 0!==wr)return wr;let e=document.createElement("link");return wr=e.relList.supports("preload"),e=null,wr}())return;let r=[];if(e.css&&r.push(...e.css.map((e=>({rel:"stylesheet",href:e})))),t.links&&r.push(...t.links()),0===r.length)return;let n=[];for(let o of r)hr(o)||"stylesheet"!==o.rel||n.push({...o,rel:"preload",as:"style"});let a=n.filter((e=>(!e.media||window.matchMedia(e.media).matches)&&!document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`)));await Promise.all(a.map(fr))}async function fr(e){return new Promise((t=>{let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)}))}function hr(e){return null!=e&&"string"==typeof e.page}function mr(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function pr(e,t,r,n,a,o){let i=gr(e),s=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"data"===o&&a.search!==i.search?t.filter(((t,o)=>{if(!n.routes[t.route.id].hasLoader)return!1;if(s(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0})):t.filter(((e,t)=>{let r=n.routes[e.route.id];return("assets"===o||r.hasLoader)&&(s(e,t)||l(e,t))}))}function yr(e){return[...new Set(e)]}function vr(e,t){let r=new Set,n=new Set(t);return e.reduce(((e,a)=>{if(t&&!hr(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e}),[])}function gr(e){let t=d(e);return void 0===t.search&&(t.search=""),t}let wr;const br={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Er=/[&><\u2028\u2029]/g;function Sr(e){return e.replace(Er,(e=>br[e]))}function xr(e){return{__html:e}}function _r(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}async function Rr(e,t,r=0){let n=new URL(e.url);n.searchParams.set("_data",t),r>0&&await new Promise((e=>setTimeout(e,5**r*10)));let a=await Cr(e),o=window.__remixRevalidation,i=await fetch(n.href,a).catch((n=>{if("number"==typeof o&&o===window.__remixRevalidation&&"TypeError"===n?.name&&r<3)return Rr(e,t,r+1);throw n}));if(function(e){return null!=e.headers.get("X-Remix-Error")}(i)){let e=await i.json(),t=new Error(e.message);return t.stack=e.stack,t}if(function(e){return _r(e)&&e.status>=400&&null==e.headers.get("X-Remix-Error")&&null==e.headers.get("X-Remix-Catch")&&null==e.headers.get("X-Remix-Response")}(i)){let e=await i.text(),t=new Error(e);return t.stack=void 0,t}return i}async function Cr(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}async function Dr(e){if(!e)throw new Error("parseDeferredReadableStream requires stream argument");let t,r={};try{let n=async function*(e){let t=e.getReader(),r=[],n=[],a=!1,o=new TextEncoder,i=new TextDecoder,s=async()=>{if(n.length>0)return n.shift();for(;!a&&0===n.length;){let e=await t.read();if(e.done){a=!0;break}r.push(e.value);try{let e=i.decode(kr(...r)).split("\n\n");if(e.length>=2&&(n.push(...e.slice(0,-1)),r=[o.encode(e.slice(-1).join("\n\n"))]),n.length>0)break}catch{continue}}if(n.length>0)return n.shift();if(r.length>0){let e=i.decode(kr(...r));n=e.split("\n\n").filter((e=>e)),r=[]}return n.shift()},l=await s();for(;l;)yield l,l=await s()}(e),a=(await n.next()).value;if(!a)throw new Error("no critical data");let o=JSON.parse(a);if("object"==typeof o&&null!==o)for(let[e,i]of Object.entries(o))"string"==typeof i&&i.startsWith("__deferred_promise:")&&(t=t||{},t[e]=new Promise(((t,n)=>{r[e]={resolve:n=>{t(n),delete r[e]},reject:t=>{n(t),delete r[e]}}})));return(async()=>{try{for await(let e of n){let[t,...n]=e.split(":"),a=n.join(":"),o=JSON.parse(a);if("data"===t)for(let[e,i]of Object.entries(o))r[e]&&r[e].resolve(i);else if("error"===t)for(let[e,i]of Object.entries(o)){let t=new Error(i.message);t.stack=i.stack,r[e]&&r[e].reject(t)}}for(let[e,t]of Object.entries(r))t.reject(new F(`Deferred ${e} will never be resolved`))}catch(e){for(let t of Object.values(r))t.reject(e)}})(),new $({...o,...t})}catch(n){for(let e of Object.values(r))e.reject(n);throw n}}function kr(...e){let t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}const Lr=Symbol("SingleFetchRedirect");function Pr({context:t,identifier:r,reader:n,textDecoder:a}){if(!t.renderMeta||!t.renderMeta.didRenderScripts)return null;t.renderMeta.streamCache||(t.renderMeta.streamCache={});let{streamCache:o}=t.renderMeta,i=o[r];if(i||(i=o[r]=n.read().then((e=>{o[r].result={done:e.done,value:a.decode(e.value,{stream:!0})}})).catch((e=>{o[r].error=e}))),i.error)throw i.error;if(void 0===i.result)throw i;let{done:s,value:l}=i.result,u=l?e.createElement("script",{dangerouslySetInnerHTML:{__html:`window.__remixContext.streamController.enqueue(${Sr(JSON.stringify(l))});`}}):null;return s?e.createElement(e.Fragment,null,u,e.createElement("script",{dangerouslySetInnerHTML:{__html:"window.__remixContext.streamController.close();"}})):e.createElement(e.Fragment,null,u,e.createElement(e.Suspense,null,e.createElement(Pr,{context:t,identifier:r+1,reader:n,textDecoder:a})))}function Mr(e,t){return async({request:r,matches:n})=>"GET"!==r.method?function(e,t){return Promise.all(t.map((async t=>{let r;return{...await t.resolve((async n=>({type:"data",result:await n((async()=>{let n=jr(e.url),a=await Cr(e),{data:o,status:i}=await Or(n,a);return r=i,Fr(o,t.route.id)})),status:r}))),status:r}})))}(r,n):function(e,t,r,n){let a;return Promise.all(n.map((async o=>o.resolve((async i=>{let s,l=function(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}(jr(r.url));return s=e.routes[o.route.id].hasClientLoader?await i((async()=>{l.searchParams.set("_routes",o.route.id);let{data:e}=await Or(l);return Ur(e,o.route.id)})):await i((async()=>(a||(l=Tr(e,t,n.map((e=>e.route)),n.filter((e=>e.shouldLoad)).map((e=>e.route)),l),a=Or(l).then((({data:e})=>e))),Ur(await a,o.route.id)))),{type:"data",result:s}})))))}(e,t,r,n)}function Tr(e,t,r,n,a){let o=t=>t.filter((t=>e.routes[t].hasLoader)).join(",");if(!r.some((r=>t[r.id]?.shouldRevalidate||e.routes[r.id]?.hasClientLoader)))return a;let i=o(r.map((e=>e.id))),s=o(n.filter((t=>!e.routes[t.id]?.hasClientLoader)).map((e=>e.id)));return i!==s&&a.searchParams.set("_routes",s),a}function jr(e){let t="string"==typeof e?new URL(e,window.location.origin):e;return t.pathname=`${"/"===t.pathname?"_root":t.pathname}.data`,t}async function Or(e,t){let r=await fetch(e,t);if(r.headers.get("Content-Type")?.includes("text/x-turbo")){r.body||lr(!1);let e=await Ar(r.body,window);return{status:r.status,data:e.value}}throw new Error(await r.text())}function Ar(e,t){return r(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,a]=r,o=Error;e&&e in t&&"function"==typeof t[e]&&(o=t[e]);let i=new o(n);return i.stack=a,{value:i}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new z(t,n,e)}}if("SingleFetchRedirect"===e)return{value:{[Lr]:r[0]}}}]})}function Ur(e,t){let r=e[Lr];return r?Fr(r,t):void 0!==e[t]?Fr(e[t],t):null}function Fr(e,t){if("error"in e)throw e.error;if("redirect"in e){let t={};return e.revalidate&&(t["X-Remix-Revalidate"]="yes"),e.reload&&(t["X-Remix-Reload-Document"]="yes"),B(e.redirect,{status:e.status,headers:t})}if("data"in e)return e.data;throw new Error(`No response found for routeId "${t}"`)}function $r(){let t=e.useContext(qe);return t||lr(!1),t}function Hr(){let t=e.useContext(Xe);return t||lr(!1),t}const Nr=e.createContext(void 0);function Br(){let t=e.useContext(Nr);return t||lr(!1),t}function Ir(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function zr(e,t,r){if(r&&!Yr)return[e[0]];if(t){let r=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,r+1)}return e}function Jr(){let{isSpaMode:t,manifest:r,routeModules:n,criticalCss:a}=Br(),{errors:o,matches:i}=Hr(),s=zr(i,o,t),l=e.useMemo((()=>cr(s,n,r)),[s,n,r]);return e.createElement(e.Fragment,null,a?e.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,l.map((({key:t,link:r})=>hr(r)?e.createElement(Wr,Object.assign({key:t},r)):e.createElement("link",Object.assign({key:t},r)))))}function Wr({page:t,...r}){let{router:n}=$r(),a=e.useMemo((()=>y(n.routes,t,n.basename)),[n.routes,t,n.basename]);return a?e.createElement(qr,Object.assign({page:t,matches:a},r)):(console.warn(`Tried to prefetch ${t} but no routes matched.`),null)}function Kr(t){let{manifest:r,routeModules:n}=Br(),[a,o]=e.useState([]);return e.useEffect((()=>{let e=!1;return async function(e,t,r){return vr((await Promise.all(e.map((async e=>{let n=await ur(t.routes[e.route.id],r);return n.links?n.links():[]})))).flat(1).filter(mr).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(t,r,n).then((t=>{e||o(t)})),()=>{e=!0}}),[t,r,n]),a}function qr({page:t,matches:r,...n}){let a=rt(),{future:o,manifest:i,routeModules:s}=Br(),{matches:l}=Hr(),u=e.useMemo((()=>pr(t,r,l,i,a,"data")),[t,r,l,i,a]),c=e.useMemo((()=>pr(t,r,l,i,a,"assets")),[t,r,l,i,a]),d=e.useMemo((()=>function(e,t,r){let n=gr(e);return yr(t.filter((e=>r.routes[e.route.id].hasLoader)).map((e=>{let{pathname:t,search:r}=n,a=new URLSearchParams(r);return a.set("_data",e.route.id),`${t}?${a}`})))}(t,u,i)),[u,t,i]),f=e.useMemo((()=>function(e,t){return yr(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(c,i)),[c,i]),h=Kr(c),m=null;if(o.unstable_singleFetch){if(u.length>0){let a=Tr(i,s,r.map((e=>e.route)),u.map((e=>e.route)),jr(t));""!==a.searchParams.get("_routes")&&(m=e.createElement("link",Object.assign({key:a.pathname+a.search,rel:"prefetch",as:"fetch",href:a.pathname+a.search},n)))}}else m=d.map((t=>e.createElement("link",Object.assign({key:t,rel:"prefetch",as:"fetch",href:t},n))));return e.createElement(e.Fragment,null,m,f.map((t=>e.createElement("link",Object.assign({key:t,rel:"modulepreload",href:t},n)))),h.map((({key:t,link:r})=>e.createElement("link",Object.assign({key:t},r)))))}function Xr(){let{isSpaMode:t,routeModules:r}=Br(),{errors:n,matches:a,loaderData:o}=Hr(),i=rt(),s=zr(a,n,t),l=null;n&&(l=n[s[s.length-1].route.id]);let u=[],c=null,d=[];for(let e=0;e<s.length;e++){let t=s[e],n=t.route.id,a=o[n],f=t.params,h=r[n],m=[],p={id:n,data:a,meta:[],params:t.params,pathname:t.pathname,handle:t.route.handle,error:l};if(d[e]=p,h?.meta?m="function"==typeof h.meta?h.meta({data:a,params:f,location:i,matches:d,error:l}):Array.isArray(h.meta)?[...h.meta]:h.meta:c&&(m=[...c]),m=m||[],!Array.isArray(m))throw new Error("The route at "+t.route.path+" returns an invalid value. All route meta functions must return an array of meta objects.\n\nTo reference the meta function API, see https://remix.run/route/meta");p.meta=m,d[e]=p,u=[...m],c=u}return e.createElement(e.Fragment,null,u.flat().map((t=>{if(!t)return null;if("tagName"in t){let{tagName:r,...n}=t;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(r))return console.warn(`A meta object uses an invalid tagName: ${r}. Expected either 'link' or 'meta'`),null;let a=r;return e.createElement(a,Object.assign({key:JSON.stringify(n)},n))}if("title"in t)return e.createElement("title",{key:"title"},String(t.title));if("charset"in t&&(t.charSet??=t.charset,delete t.charset),"charSet"in t&&null!=t.charSet)return"string"==typeof t.charSet?e.createElement("meta",{key:"charSet",charSet:t.charSet}):null;if("script:ld+json"in t)try{let r=JSON.stringify(t["script:ld+json"]);return e.createElement("script",{key:`script:ld+json:${r}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:r}})}catch(r){return null}return e.createElement("meta",Object.assign({key:JSON.stringify(t)},t))})))}Nr.displayName="Remix";let Yr=!1;function Vr(t){let{manifest:r,serverHandoffString:n,abortDelay:a,serializeError:o,isSpaMode:i,future:s,renderMeta:l}=Br(),{router:u,static:c,staticContext:d}=$r(),{matches:f}=Hr(),h=Rt();l&&(l.didRenderScripts=!0);let m=zr(f,null,i);e.useEffect((()=>{Yr=!0}),[]);let p=(e,t)=>{let r;return r=o&&t instanceof Error?o(t):t,`${JSON.stringify(e)}:__remixContext.p(!1, ${Sr(JSON.stringify(r))})`},v=(e,t,r)=>{let n;return n=o&&r instanceof Error?o(r):r,`__remixContext.r(${JSON.stringify(e)}, ${JSON.stringify(t)}, !1, ${Sr(JSON.stringify(n))})`},g=(e,t,r)=>{let n;try{n=JSON.stringify(r)}catch(a){return v(e,t,a)}return`__remixContext.r(${JSON.stringify(e)}, ${JSON.stringify(t)}, ${Sr(n)})`},w=[],b=e.useMemo((()=>{let o=s.unstable_singleFetch?"window.__remixContext.stream = new ReadableStream({start(controller){window.__remixContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());":"",i=d?`window.__remixContext = ${n};${o}`:" ",l=s.unstable_singleFetch?void 0:d?.activeDeferreds;i+=l?["__remixContext.p = function(v,e,p,x) {"," if (typeof e !== 'undefined') {",' x=new Error("Unexpected Server Error");\n x.stack=undefined;'," p=Promise.reject(x);"," } else {"," p=Promise.resolve(v);"," }"," return p;","};","__remixContext.n = function(i,k) {"," __remixContext.t = __remixContext.t || {};"," __remixContext.t[i] = __remixContext.t[i] || {};"," let p = new Promise((r, e) => {__remixContext.t[i][k] = {r:(v)=>{r(v);},e:(v)=>{e(v);}};});","number"==typeof a?`setTimeout(() => {if(typeof p._error !== "undefined" || typeof p._data !== "undefined"){return;} __remixContext.t[i][k].e(new Error("Server timeout."))}, ${a});`:""," return p;","};","__remixContext.r = function(i,k,v,e,p,x) {"," p = __remixContext.t[i][k];"," if (typeof e !== 'undefined') {",' x=new Error("Unexpected Server Error");\n x.stack=undefined;'," p.e(x);"," } else {"," p.r(v);"," }","};"].join("\n")+Object.entries(l).map((([r,n])=>{let a=new Set(n.pendingKeys),o=n.deferredKeys.map((o=>{if(a.has(o))return w.push(e.createElement(Gr,{key:`${r} | ${o}`,deferredData:n,routeId:r,dataKey:o,scriptProps:t,serializeData:g,serializeError:v})),`${JSON.stringify(o)}:__remixContext.n(${JSON.stringify(r)}, ${JSON.stringify(o)})`;{let e=n.data[o];return void 0!==e._error?p(o,e._error):((e,t,r)=>{let n;try{n=JSON.stringify(r)}catch(a){return p(t,a)}return`${JSON.stringify(t)}:__remixContext.p(${Sr(n)})`})(0,o,e._data)}})).join(",\n");return`Object.assign(__remixContext.state.loaderData[${JSON.stringify(r)}], {${o}});`})).join("\n")+(w.length>0?`__remixContext.a=${w.length};`:""):"";let u=c?`${r.hmr?.runtime?`import ${JSON.stringify(r.hmr.runtime)};`:""}import ${JSON.stringify(r.url)};\n${m.map(((e,t)=>`import * as route${t} from ${JSON.stringify(r.routes[e.route.id].module)};`)).join("\n")}\nwindow.__remixRouteModules = {${m.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(r.entry.module)});`:" ";return e.createElement(e.Fragment,null,e.createElement("script",Object.assign({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:xr(i),type:void 0})),e.createElement("script",Object.assign({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:xr(u),type:"module",async:!0})))}),[]);if(!c&&"object"==typeof __remixContext&&__remixContext.a)for(let y=0;y<__remixContext.a;y++)w.push(e.createElement(Gr,{key:y,scriptProps:t,serializeData:g,serializeError:v}));let E=e.useMemo((()=>{if(h.location){let e=y(u.routes,h.location,u.basename);return e||lr(!1),e}return[]}),[h.location,u.routes,u.basename]),S=m.concat(E).map((e=>{let t=r.routes[e.route.id];return(t.imports||[]).concat([t.module])})).flat(1),x=Yr?[]:r.entry.imports.concat(S);return Yr?null:e.createElement(e.Fragment,null,e.createElement("link",{rel:"modulepreload",href:r.url,crossOrigin:t.crossOrigin}),e.createElement("link",{rel:"modulepreload",href:r.entry.module,crossOrigin:t.crossOrigin}),(_=x,[...new Set(_)]).map((r=>e.createElement("link",{key:r,rel:"modulepreload",href:r,crossOrigin:t.crossOrigin}))),b,w);var _}function Gr({dataKey:t,deferredData:r,routeId:n,scriptProps:a,serializeData:o,serializeError:i}){return"undefined"==typeof document&&r&&t&&n&&(r.pendingKeys.includes(t)||lr(!1)),e.createElement(e.Suspense,{fallback:"undefined"==typeof document&&r&&t&&n?null:e.createElement("script",Object.assign({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}}))},"undefined"==typeof document&&r&&t&&n?e.createElement(Xt,{resolve:r.data[t],errorElement:e.createElement(Qr,{dataKey:t,routeId:n,scriptProps:a,serializeError:i}),children:r=>e.createElement("script",Object.assign({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o(n,t,r)}}))}):e.createElement("script",Object.assign({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}})))}function Qr({dataKey:t,routeId:r,scriptProps:n,serializeError:a}){let o=jt();return e.createElement("script",Object.assign({},n,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a(r,t,o)}}))}function Zr(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}const en="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{en&&(window.__reactRouterVersion="0")}catch(Sa){}function tn(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:o({window:t?.window}),hydrationData:t?.hydrationData||nn(),routes:e,mapRouteProperties:Ft,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function rn(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:i({window:t?.window}),hydrationData:t?.hydrationData||nn(),routes:e,mapRouteProperties:Ft,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function nn(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:an(e.errors)}),e}function an(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[n]=new z(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack="",r[n]=t}catch(Sa){}}if(null==r[n]){let e=new Error(a.message);e.stack="",r[n]=e}}else r[n]=a;return r}const on=e.createContext({isTransitioning:!1}),sn=e.createContext(new Map),ln=e.startTransition,un=t.flushSync,cn=e.useId;function dn(e){un?un(e):e()}class fn{status="pending";constructor(){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 hn({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),[i,s]=e.useState(),[l,u]=e.useState({isTransitioning:!1}),[c,d]=e.useState(),[f,h]=e.useState(),[m,p]=e.useState(),y=e.useRef(new Map),{v7_startTransition:v}=n||{},g=e.useCallback((e=>{v?function(e){ln?ln(e):e()}(e):e()}),[v]),w=e.useCallback(((e,{deletedFetchers:t,unstable_flushSync:n,unstable_viewTransitionOpts:a})=>{t.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let i=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(a&&!i){if(n){dn((()=>{f&&(c&&c.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:a.currentLocation,nextLocation:a.nextLocation})}));let t=r.window.document.startViewTransition((()=>{dn((()=>o(e)))}));return t.finished.finally((()=>{dn((()=>{d(void 0),h(void 0),s(void 0),u({isTransitioning:!1})}))})),void dn((()=>h(t)))}f?(c&&c.resolve(),f.skipTransition(),p({state:e,currentLocation:a.currentLocation,nextLocation:a.nextLocation})):(s(e),u({isTransitioning:!0,flushSync:!1,currentLocation:a.currentLocation,nextLocation:a.nextLocation}))}else n?dn((()=>o(e))):g((()=>o(e)))}),[r.window,f,c,y,g]);e.useLayoutEffect((()=>r.subscribe(w)),[r,w]),e.useEffect((()=>{l.isTransitioning&&!l.flushSync&&d(new fn)}),[l]),e.useEffect((()=>{if(c&&i&&r.window){let e=i,t=c.promise,n=r.window.document.startViewTransition((async()=>{g((()=>o(e))),await t}));n.finished.finally((()=>{d(void 0),h(void 0),s(void 0),u({isTransitioning:!1})})),h(n)}}),[g,i,c,r.window]),e.useEffect((()=>{c&&i&&a.location.key===i.location.key&&c.resolve()}),[c,f,a.location,i]),e.useEffect((()=>{!l.isTransitioning&&m&&(s(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))}),[l.isTransitioning,m]),e.useEffect((()=>{}),[]);let b=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),E=r.basename||"/",S=e.useMemo((()=>({router:r,navigator:b,static:!1,basename:E})),[r,b,E]);return e.createElement(e.Fragment,null,e.createElement(qe.Provider,{value:S},e.createElement(Xe.Provider,{value:a},e.createElement(sn.Provider,{value:y.current},e.createElement(on.Provider,{value:l},e.createElement(Kt,{basename:E,location:a.location,navigationType:a.historyAction,navigator:b,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(mn,{routes:r.routes,future:r.future,state:a}):t))))),null)}function mn({routes:e,future:t,state:r}){return ht(e,void 0,r,t)}function pn({basename:t,children:r,future:n,window:a}){let i=e.useRef();null==i.current&&(i.current=o({window:a,v5Compat:!0}));let s=i.current,[l,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},d=e.useCallback((e=>{c&&ln?ln((()=>u(e))):u(e)}),[u,c]);return e.useLayoutEffect((()=>s.listen(d)),[s,d]),e.createElement(Kt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function yn({basename:t,children:r,future:n,window:a}){let o=e.useRef();null==o.current&&(o.current=i({window:a,v5Compat:!0}));let s=o.current,[l,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},d=e.useCallback((e=>{c&&ln?ln((()=>u(e))):u(e)}),[u,c]);return e.useLayoutEffect((()=>s.listen(d)),[s,d]),e.createElement(Kt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function vn({basename:t,children:r,future:n,history:a}){let[o,i]=e.useState({action:a.action,location:a.location}),{v7_startTransition:s}=n||{},l=e.useCallback((e=>{s&&ln?ln((()=>i(e))):i(e)}),[i,s]);return e.useLayoutEffect((()=>a.listen(l)),[a,l]),e.createElement(Kt,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const gn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wn=e.forwardRef((function({onClick:t,prefetch:r="none",relative:n,reloadDocument:a,replace:o,state:i,target:s,to:l,preventScrollReset:u,unstable_viewTransition:c,...d},f){let h,{basename:m}=e.useContext(Ve),p="string"==typeof l&&gn.test(l),y=!1;if("string"==typeof l&&p&&(h=l,en))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),r=D(t.pathname,m);t.origin===e.origin&&null!=r?l=r+t.search+t.hash:y=!0}catch(Sa){}let v=et(l,{relative:n}),[g,w,b]=function(t,r){let n=e.useContext(Nr),[a,o]=e.useState(!1),[i,s]=e.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:f}=r,h=e.useRef(null);e.useEffect((()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver((e=>{e.forEach((e=>{s(e.isIntersecting)}))}),{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}}),[t]),e.useEffect((()=>{if(a){let e=setTimeout((()=>{s(!0)}),100);return()=>{clearTimeout(e)}}}),[a]);let m=()=>{o(!0)},p=()=>{o(!1),s(!1)};return n?"intent"!==t?[i,h,{}]:[i,h,{onFocus:Ir(l,m),onBlur:Ir(u,p),onMouseEnter:Ir(c,m),onMouseLeave:Ir(d,p),onTouchStart:Ir(f,m)}]:[!1,h,{}]}(r,d),E=Dn(l,{replace:o,state:i,target:s,preventScrollReset:u,relative:n,unstable_viewTransition:c});let S=e.createElement("a",Object.assign({},d,b,{href:h||v,onClick:y||a?t:function(e){t&&t(e),e.defaultPrevented||E(e)},ref:Zr(f,w),target:s}));return g&&!p?e.createElement(e.Fragment,null,S,e.createElement(Wr,{page:v})):S})),bn=e.forwardRef((function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,unstable_viewTransition:s,children:l,...u},c){let d=dt(i,{relative:u.relative}),f=rt(),h=e.useContext(Xe),{navigator:m,basename:p}=e.useContext(Ve),y=null!=h&&Bn(d)&&!0===s,v=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=f.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(g=g.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&p&&(w=D(w,p)||w);const b="/"!==v&&v.endsWith("/")?v.length-1:v.length;let E,S=g===v||!a&&g.startsWith(v)&&"/"===g.charAt(b),x=null!=w&&(w===v||!a&&w.startsWith(v)&&"/"===w.charAt(v.length)),_={isActive:S,isPending:x,isTransitioning:y},R=S?t:void 0;E="function"==typeof n?n(_):[n,S?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof o?o(_):o;return e.createElement(wn,Object.assign({},u,{"aria-current":R,className:E,ref:c,style:C,to:i,unstable_viewTransition:s}),"function"==typeof l?l(_):l)})),En=e.forwardRef((({fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i="get",action:s,onSubmit:l,relative:u,preventScrollReset:c,unstable_viewTransition:d,...f},h)=>{let m=Mn(),p=Tn(s,{relative:u}),y="get"===i.toLowerCase()?"get":"post";return e.createElement("form",Object.assign({ref:h,method:y,action:p,onSubmit:n?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,s=n?.getAttribute("formmethod")||i;m(n||e.currentTarget,{fetcherKey:t,method:s,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,unstable_viewTransition:d})}},f))}));function Sn({getKey:t,storageKey:r,...n}){let a=e.useContext(Nr),{basename:o}=e.useContext(Ve),i=rt(),s=Dt();$n({getKey:t,storageKey:r});let l=e.useMemo((()=>{if(!a||!t)return null;let e=Fn(i,s,o,t);return e!==i.key?e:null}),[]);if(!a||a.isSpaMode)return null;let u=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(r){console.error(r),sessionStorage.removeItem(e)}}).toString();return e.createElement("script",Object.assign({},n,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${u})(${JSON.stringify(r||An)}, ${JSON.stringify(l)})`}}))}var xn=function(e){return e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState",e}(xn||{}),_n=function(e){return e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration",e}(_n||{});function Rn(t){let r=e.useContext(qe);return r||s(!1),r}function Cn(t){let r=e.useContext(Xe);return r||s(!1),r}function Dn(t,{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s}={}){let l=it(),u=rt(),d=dt(t,{relative:i});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,r)){e.preventDefault();let r=void 0!==n?n:c(u)===c(d);l(t,{replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s})}}),[u,l,d,n,a,r,t,o,i,s])}function kn(t){let r=e.useRef(nr(t)),n=e.useRef(!1),a=rt(),o=e.useMemo((()=>function(e,t){let r=nr(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(a.search,n.current?null:r.current)),[a.search]),i=it(),s=e.useCallback(((e,t)=>{const r=nr("function"==typeof e?e(o):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,s]}let Ln=0,Pn=()=>`__${String(++Ln)}__`;function Mn(){let{router:t}=Rn(xn.UseSubmit),{basename:r}=e.useContext(Ve),n=_t();return e.useCallback(((e,a={})=>{!function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:s,formData:l,body:u}=sr(e,r);if(!1===a.navigate){let e=a.fetcherKey||Pn();t.fetch(e,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,unstable_flushSync:a.unstable_flushSync})}else t.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[t,r,n])}function Tn(t,{relative:r}={}){let{basename:n}=e.useContext(Ve),a=e.useContext(Qe);a||s(!1);let[o]=a.matches.slice(-1),i={...dt(t||".",{relative:r})},l=rt();if(null==t){i.search=l.search;let e=new URLSearchParams(i.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),i.search=e.toString()?`?${e.toString()}`:"")}return t&&"."!==t||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:T([n,i.pathname])),c(i)}function jn({key:t}={}){let{router:r}=Rn(xn.UseFetcher),n=Cn(_n.UseFetcher),a=e.useContext(sn),o=e.useContext(Qe),i=o.matches[o.matches.length-1]?.route.id;a||s(!1),o||s(!1),null==i&&s(!1);let l=cn?cn():"",[u,c]=e.useState(t||l);t&&t!==u?c(t):u||c(Pn()),e.useEffect((()=>(r.getFetcher(u),()=>{r.deleteFetcher(u)})),[r,u]);let d=e.useCallback(((e,t)=>{i||s(!1),r.fetch(u,i,e,t)}),[u,i,r]),f=Mn(),h=e.useCallback(((e,t)=>{f(e,{...t,navigate:!1,fetcherKey:u})}),[u,f]),m=e.useMemo((()=>e.forwardRef(((t,r)=>e.createElement(En,Object.assign({},t,{navigate:!1,fetcherKey:u,ref:r}))))),[u]),p=n.fetchers.get(u)||Q,y=a.get(u);return e.useMemo((()=>({Form:m,submit:h,load:d,...p,data:y})),[m,h,d,p,y])}function On(){let e=Cn(_n.UseFetchers);return Array.from(e.fetchers.entries()).map((([e,t])=>({...t,key:e})))}const An="react-router-scroll-positions";let Un={};function Fn(e,t,r,n){let a=null;return n&&(a=n("/"!==r?{...e,pathname:D(e.pathname,r)||e.pathname}:e,t)),null==a&&(a=e.key),a}function $n({getKey:t,storageKey:r}={}){let{router:n}=Rn(xn.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=Cn(_n.UseScrollRestoration),{basename:i}=e.useContext(Ve),s=rt(),l=Dt(),u=Rt();e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("pagehide",t,e),()=>{window.removeEventListener("pagehide",t,e)}}),[t,n])}(e.useCallback((()=>{if("idle"===u.state){let e=Fn(s,l,i,t);Un[e]=window.scrollY}try{sessionStorage.setItem(r||An,JSON.stringify(Un))}catch(e){}window.history.scrollRestoration="auto"}),[u.state,t,i,s,l,r])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||An);e&&(Un=JSON.parse(e))}catch(Sa){}}),[r]),e.useLayoutEffect((()=>{let e=n?.enableScrollRestoration(Un,(()=>window.scrollY),t?(e,r)=>Fn(e,r,i,t):void 0);return()=>e&&e()}),[n,i,t]),e.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==o&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,o]))}function Hn(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("beforeunload",t,e),()=>{window.removeEventListener("beforeunload",t,e)}}),[t,n])}function Nn({when:t,message:r}){let n=At(t);e.useEffect((()=>{if("blocked"===n.state){window.confirm(r)?setTimeout(n.proceed,0):n.reset()}}),[n,r]),e.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Bn(t,r={}){let n=e.useContext(on);null==n&&s(!1);let{basename:a}=Rn(xn.useViewTransitionState),o=dt(t,{relative:r.relative});if(!n.isTransitioning)return!1;let i=D(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=D(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=R(o.pathname,l)||null!=R(o.pathname,i)}function In({basename:t,children:r,location:a="/",future:o}){"string"==typeof a&&(a=d(a));let i=n.Pop,s={pathname:a.pathname||"/",search:a.search||"",hash:a.hash||"",state:a.state||null,key:a.key||"default"},l=Kn();return e.createElement(Kt,{basename:t,children:r,location:s,navigationType:i,navigator:l,future:o,static:!0})}function zn({context:t,router:r,hydrate:n=!0,nonce:a}){r&&t||s(!1);let o={router:r,navigator:Kn(),static:!0,staticContext:t,basename:t.basename||"/"},i=new Map,l="";if(!1!==n){let e={loaderData:t.loaderData,actionData:t.actionData,errors:Wn(t.errors)};l=`window.__staticRouterHydrationData = JSON.parse(${JSON.stringify(JSON.stringify(e)).replace(Zn,(e=>Qn[e]))});`}let{state:u}=o.router;return e.createElement(e.Fragment,null,e.createElement(qe.Provider,{value:o},e.createElement(Xe.Provider,{value:u},e.createElement(sn.Provider,{value:i},e.createElement(on.Provider,{value:{isTransitioning:!1}},e.createElement(Kt,{basename:o.basename,location:u.location,navigationType:u.historyAction,navigator:o.navigator,static:o.static,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},e.createElement(Jn,{routes:r.routes,future:r.future,state:u})))))),l?e.createElement("script",{suppressHydrationWarning:!0,nonce:a,dangerouslySetInnerHTML:{__html:l}}):null)}function Jn({routes:e,future:t,state:r}){return ht(e,void 0,r,t)}function Wn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)J(a)?r[n]={...a,__type:"RouteErrorResponse"}:a instanceof Error?r[n]={message:a.message,__type:"Error",..."Error"!==a.name?{__subType:a.name}:{}}:r[n]=a;return r}function Kn(){return{createHref:Yn,encodeLocation:Vn,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}}}function qn(e,t){return ae(e,{...t,mapRouteProperties:Ft})}function Xn(e,t,r={}){let a={},o=p(e,Ft,void 0,a),i=t.matches.map((e=>{let t=a[e.route.id]||e.route;return{...e,route:t}})),s=e=>`You cannot use router.${e}() on the server because it is a stateless environment`;return{get basename(){return t.basename},get future(){return{v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!0===r.future?.v7_partialHydration,v7_prependBasename:!1,v7_relativeSplatPath:!0===r.future?.v7_relativeSplatPath,unstable_skipActionErrorRevalidation:!1}},get state(){return{historyAction:n.Pop,location:t.location,matches:i,loaderData:t.loaderData,actionData:t.actionData,errors:t.errors,initialized:!0,navigation:G,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",fetchers:new Map,blockers:new Map}},get routes(){return o},get window(){},initialize(){throw s("initialize")},subscribe(){throw s("subscribe")},enableScrollRestoration(){throw s("enableScrollRestoration")},navigate(){throw s("navigate")},fetch(){throw s("fetch")},revalidate(){throw s("revalidate")},createHref:Yn,encodeLocation:Vn,getFetcher:()=>Q,deleteFetcher(){throw s("deleteFetcher")},dispose(){throw s("dispose")},getBlocker:()=>Z,deleteBlocker(){throw s("deleteBlocker")},_internalFetchControllers:new Map,_internalActiveDeferreds:new Map,_internalSetRoutes(){throw s("_internalSetRoutes")}}}function Yn(e){return"string"==typeof e?e:c(e)}function Vn(e){let t="string"==typeof e?e:c(e);t=t.replace(/ $/,"%20");let r=Gn.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:r.pathname,search:r.search,hash:r.hash}}const Gn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Zn=/[&><\u2028\u2029]/g;class ea extends e.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?e.createElement(ta,{error:this.state.error}):this.props.children}}function ta({error:t}){console.error(t);let r,n=e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."\n );\n '}});if(J(t))return e.createElement(ra,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),n);if(t instanceof Error)r=t;else{let e=null==t?"Unknown Error":"object"==typeof t&&"toString"in t?t.toString():JSON.stringify(t);r=new Error(e)}return e.createElement(ra,{title:"Application Error!"},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function ra({title:t,renderScripts:r,children:n}){let{routeModules:a}=Br();return a.root?.Layout?n:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,t)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,r?e.createElement(Vr,null):null)))}function na(){return e.createElement(ra,{title:"Loading...",renderScripts:!0},e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this " +\n "when your app is running `clientLoader` functions on hydration. " +\n "Check out https://remix.run/route/hydrate-fallback for more information."\n );\n '}}))}function aa(e){let t={};return Object.values(e).forEach((e=>{let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)})),t}function oa(t,r,n){let a=fa(r),o=!r.HydrateFallback||n&&"root"!==t.id?"root"===t.id?na:void 0:r.HydrateFallback,i=r.ErrorBoundary?r.ErrorBoundary:"root"===t.id?()=>e.createElement(ta,{error:Mt()}):void 0;return"root"===t.id&&r.Layout?{...a?{element:e.createElement(r.Layout,null,e.createElement(a,null))}:{Component:a},...i?{errorElement:e.createElement(r.Layout,null,e.createElement(i,null))}:{ErrorBoundary:i},...o?{hydrateFallbackElement:e.createElement(r.Layout,null,e.createElement(o,null))}:{HydrateFallback:o}}:{Component:a,ErrorBoundary:i,HydrateFallback:o}}function ia(e,t,r,n,a="",o=aa(e),i=Promise.resolve({Component:()=>null})){return(o[a]||[]).map((a=>{let s=t[a.id];s||lr(!1);let l={...oa(a,s,n),caseSensitive:a.caseSensitive,id:a.id,index:a.index,path:a.path,handle:s.handle,lazy:n?()=>i:void 0,loader:a.hasLoader||a.hasClientLoader?()=>null:void 0},u=ia(e,t,r,n,a.id,o,i);return u.length>0&&(l.children=u),l}))}function sa(e,t,r,n,a,o){return ca(t,r,n,a,o,"",aa(t),e)}function la(e,t,r){if(r){let r=`You cannot call ${"action"===e?"serverAction()":"serverLoader()"} in SPA Mode (routeId: "${t.id}")`;throw console.error(r),new z(400,"Bad Request",new Error(r),!0)}let n=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction)throw console.error(n),new z(400,"Bad Request",new Error(n),!0)}function ua(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new z(405,"Method Not Allowed",new Error(n),!0)}function ca(e,t,r,n,a,o="",i=aa(e),s){return(i[o]||[]).map((o=>{let l=t[o.id];async function u(e,t,r){if("function"==typeof r){return await r()}let n=await async function(e,t){let r=await Rr(e,t.id);if(r instanceof Error)throw r;if(n=r,null!=n.headers.get("X-Remix-Redirect"))throw function(e){let t=parseInt(e.headers.get("X-Remix-Status"),10)||302,r=e.headers.get("X-Remix-Redirect"),n={},a=e.headers.get("X-Remix-Revalidate");a&&(n["X-Remix-Revalidate"]=a);let o=e.headers.get("X-Remix-Reload-Document");o&&(n["X-Remix-Reload-Document"]=o);return B(r,{status:t,headers:n})}(r);var n;if(function(e){return null!=e.headers.get("X-Remix-Catch")}(r))throw r;if(function(e){return!!e.headers.get("Content-Type")?.match(/text\/remix-deferred/)}(r)&&r.body)return await Dr(r.body);return r}(e,o);return t?function(e){if(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}(e))return e.data;if(_r(e)){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.json():e.text()}return e}(n):n}function c(e,t,r){return o.hasLoader?u(e,t,r):Promise.resolve(null)}function d(e,t,r){if(!o.hasAction)throw ua("action",o.id);return u(e,t,r)}async function f(e){let r=t[o.id],n=r?dr(o,r):Promise.resolve();try{return e()}finally{await n}}let h={id:o.id,index:o.index,path:o.path};if(l){Object.assign(h,{...h,...oa(o,l,a),handle:l.handle,shouldRevalidate:s?da(o.id,l.shouldRevalidate,s):l.shouldRevalidate});let e=r?.loaderData?.[o.id],t=r?.errors?.[o.id],n=null==s&&(!0===l.clientLoader?.hydrate||!o.hasLoader);h.loader=async({request:r,params:i},s)=>{try{return await f((async()=>(l||lr(!1),l.clientLoader?l.clientLoader({request:r,params:i,async serverLoader(){if(la("loader",o,a),n){if(void 0!==t)throw t;return e}return c(r,!0,s)}}):a?null:c(r,!1,s))))}finally{n=!1}},h.loader.hydrate=ha(o,l,a),h.action=({request:e,params:t},r)=>f((async()=>{if(l||lr(!1),!l.clientAction){if(a)throw ua("clientAction",o.id);return d(e,!1,r)}return l.clientAction({request:e,params:t,serverAction:async()=>(la("action",o,a),d(e,!0,r))})}))}else o.hasClientLoader||(h.loader=({request:e},t)=>f((()=>a?Promise.resolve(null):c(e,!1,t)))),o.hasClientAction||(h.action=({request:e},t)=>f((()=>{if(a)throw ua("clientAction",o.id);return d(e,!1,t)}))),h.lazy=async()=>{let e=await async function(e,t){let r=await ur(e,t);return await dr(e,r),{Component:fa(r),ErrorBoundary:r.ErrorBoundary,clientAction:r.clientAction,clientLoader:r.clientLoader,handle:r.handle,links:r.links,meta:r.meta,shouldRevalidate:r.shouldRevalidate}}(o,t),r={...e};if(e.clientLoader){let t=e.clientLoader;r.loader=(e,r)=>t({...e,serverLoader:async()=>(la("loader",o,a),c(e.request,!0,r))})}if(e.clientAction){let t=e.clientAction;r.action=(e,r)=>t({...e,serverAction:async()=>(la("action",o,a),d(e.request,!0,r))})}return s&&(r.shouldRevalidate=da(o.id,e.shouldRevalidate,s)),{...r.loader?{loader:r.loader}:{},...r.action?{action:r.action}:{},hasErrorBoundary:r.hasErrorBoundary,shouldRevalidate:r.shouldRevalidate,handle:r.handle,Component:r.Component,ErrorBoundary:r.ErrorBoundary}};let m=ca(e,t,r,n,a,o.id,i,s);return m.length>0&&(h.children=m),h}))}function da(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}function fa(e){if(null==e.default)return;return"object"==typeof e.default&&0===Object.keys(e.default).length?void 0:e.default}function ha(e,t,r){return r&&"root"!==e.id||null!=t.clientLoader&&(!0===t.clientLoader.hydrate||!0!==e.hasLoader)}let ma=null,pa=null;let ya=null;if(import.meta&&import.meta.hot&&window.__remixManifest){let e,t=new Promise((t=>{e=t})).catch((()=>{}));ya={abortController:void 0,routerReadyResolve:e,routerReadyPromise:t},import.meta.hot.accept("remix:manifest",(async({assetsManifest:e,needsRevalidation:t})=>{let r=await ya.routerReadyPromise;if(!r||!ma||!ya)return void console.error("Failed to accept HMR update because the router/ssrInfo was not ready.");let n=[...new Set(r.state.matches.map((e=>e.route.id)).concat(Object.keys(ma.routeModules)))];ya.abortController?.abort(),ya.abortController=new AbortController;let a=ya.abortController.signal,o=Object.assign({},ma.routeModules,Object.fromEntries((await Promise.all(n.map((async t=>{if(!e.routes[t])return null;let r=await import(e.routes[t].module+`?t=${e.hmr?.timestamp}`);return ma||lr(!1),[t,{...r,default:r.default&&ma.routeModules[t]?.default||r.default,ErrorBoundary:r.ErrorBoundary&&ma.routeModules[t]?.ErrorBoundary||r.ErrorBoundary,HydrateFallback:r.HydrateFallback&&ma.routeModules[t]?.HydrateFallback||r.HydrateFallback}]})))).filter(Boolean)));Object.assign(ma.routeModules,o);let i=sa(t,e.routes,ma.routeModules,ma.context.state,ma.context.future,ma.context.isSpaMode);r._internalSetRoutes(i);let s=r.subscribe((t=>{if("idle"===t.revalidation){if(s(),a.aborted)return;setTimeout((()=>{Object.assign(ma.manifest,e),window.$RefreshRuntime$.performReactRefresh()}),1)}}));window.__remixRevalidation=(window.__remixRevalidation||0)+1,r.revalidate()}))}function va(){if(!ma&&window.__remixContext&&window.__remixManifest&&window.__remixRouteModules&&(ma={context:window.__remixContext,manifest:window.__remixManifest,routeModules:window.__remixRouteModules,stateDecodingPromise:void 0,router:void 0,routerInitialized:!1}),!ma)throw new Error("You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`");if(ma.context.future.unstable_singleFetch){let e=ma;if(!ma.stateDecodingPromise){let t=ma.context.stream;t||lr(!1),ma.context.stream=void 0,ma.stateDecodingPromise=Ar(t,window).then((t=>{ma.context.state=t.value,e.stateDecodingPromise.value=!0})).catch((t=>{e.stateDecodingPromise.error=t}))}if(ma.stateDecodingPromise.error)throw ma.stateDecodingPromise.error;if(!ma.stateDecodingPromise.value)throw ma.stateDecodingPromise}let e,t=ca(ma.manifest.routes,ma.routeModules,ma.context.state,ma.context.future,ma.context.isSpaMode);if(!ma.context.isSpaMode){e={...ma.context.state,loaderData:{...ma.context.state.loaderData}};let r=y(t,window.location);if(r)for(let t of r){let r=t.route.id,n=ma.routeModules[r],a=ma.manifest.routes[r];n&&ha(a,n,ma.context.isSpaMode)&&(n.HydrateFallback||!a.hasLoader)?e.loaderData[r]=void 0:a&&!a.hasLoader&&(e.loaderData[r]=null)}e&&e.errors&&(e.errors=function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[n]=new z(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack=a.stack,r[n]=t}catch(Sa){}}if(null==r[n]){let e=new Error(a.message);e.stack=a.stack,r[n]=e}}else r[n]=a;return r}(e.errors))}let r=re({routes:t,history:o(),basename:ma.context.basename,future:{v7_normalizeFormMethod:!0,v7_fetcherPersist:ma.context.future.v3_fetcherPersist,v7_partialHydration:!0,v7_prependBasename:!0,v7_relativeSplatPath:ma.context.future.v3_relativeSplatPath,unstable_skipActionErrorRevalidation:!0===ma.context.future.unstable_singleFetch},hydrationData:e,mapRouteProperties:Ft,unstable_dataStrategy:ma.context.future.unstable_singleFetch?Mr(ma.manifest,ma.routeModules):void 0});return ma.router=r,r.state.initialized&&(ma.routerInitialized=!0,r.initialize()),r.createRoutesForHMR=sa,window.__remixRouter=r,ya?.routerReadyResolve(r),r}function ga(){pa||(pa=va());let[t,r]=e.useState(void 0),[n,a]=e.useState(pa.state.location);return e.useLayoutEffect((()=>{ma&&ma.router&&!ma.routerInitialized&&(ma.routerInitialized=!0,ma.router.initialize())}),[]),e.useLayoutEffect((()=>{if(ma&&ma.router)return ma.router.subscribe((e=>{e.location!==n&&a(e.location)}))}),[n]),ma||lr(!1),e.createElement(e.Fragment,null,e.createElement(Nr.Provider,{value:{manifest:ma.manifest,routeModules:ma.routeModules,future:ma.context.future,criticalCss:t,isSpaMode:ma.context.isSpaMode}},e.createElement(ea,{location:n},e.createElement(hn,{router:pa}))),ma.context.future.unstable_singleFetch?e.createElement(e.Fragment,null):null)}function wa({context:t,url:r,abortDelay:n}){"string"==typeof r&&(r=new URL(r));let{manifest:a,routeModules:o,criticalCss:i,serverHandoffString:s}=t,l=ia(a.routes,o,t.future,t.isSpaMode);t.staticHandlerContext.loaderData={...t.staticHandlerContext.loaderData};for(let e of t.staticHandlerContext.matches){let r=e.route.id,n=o[r],a=t.manifest.routes[r];n&&ha(a,n,t.isSpaMode)&&(n.HydrateFallback||!a.hasLoader)&&(t.staticHandlerContext.loaderData[r]=void 0)}let u=Xn(l,t.staticHandlerContext,{future:{v7_partialHydration:!0,v7_relativeSplatPath:t.future.v3_relativeSplatPath}});return e.createElement(e.Fragment,null,e.createElement(Nr.Provider,{value:{manifest:a,routeModules:o,criticalCss:i,serverHandoffString:s,future:t.future,isSpaMode:t.isSpaMode,serializeError:t.serializeError,abortDelay:n,renderMeta:t.renderMeta}},e.createElement(ea,{location:u.state.location},e.createElement(zn,{router:u,context:t.staticHandlerContext,hydrate:!1}))),t.future.unstable_singleFetch&&t.serverHandoffStream?e.createElement(e.Suspense,null,e.createElement(Pr,{context:t,identifier:0,reader:t.serverHandoffStream.getReader(),textDecoder:new TextDecoder})):null)}function ba(t,r={}){return function({initialEntries:n,initialIndex:a,hydrationData:o,future:i}){let s=e.useRef(),l=e.useRef();if(null==s.current){l.current={future:{v3_fetcherPersist:!0===i?.v3_fetcherPersist,v3_relativeSplatPath:!0===i?.v3_relativeSplatPath,unstable_singleFetch:!0===i?.unstable_singleFetch},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},isSpaMode:!1};let e=Ea(p(t,(e=>e)),r,l.current.manifest,l.current.routeModules);s.current=$t(e,{initialEntries:n,initialIndex:a,hydrationData:o})}return e.createElement(Nr.Provider,{value:l.current},e.createElement(hn,{router:s.current}))}}function Ea(e,t,r,n,a){return e.map((e=>{if(!e.id)throw new Error("Expected a route.id in @remix-run/testing processRoutes() function");let{loader:o,action:i}=e,s={id:e.id,path:e.path,index:e.index,Component:e.Component,ErrorBoundary:e.ErrorBoundary,action:i?e=>i({...e,context:t}):void 0,loader:o?e=>o({...e,context:t}):void 0,handle:e.handle,shouldRevalidate:e.shouldRevalidate},l={id:e.id,path:e.path,index:e.index,parentId:a,hasAction:null!=e.action,hasLoader:null!=e.loader,hasClientAction:!1,hasClientLoader:!1,hasErrorBoundary:null!=e.ErrorBoundary,module:"build/stub-path-to-module.js"};return r.routes[s.id]=l,n[e.id]={default:e.Component||Jt,ErrorBoundary:e.ErrorBoundary||void 0,handle:e.handle,links:e.links,meta:e.meta,shouldRevalidate:e.shouldRevalidate},e.children&&(s.children=Ea(e.children,t,r,n,s.id)),s}))}export{F as AbortedDeferredError,Xt as Await,pn as BrowserRouter,En as Form,yn as HashRouter,ga as HydratedRouter,wn as Link,Jr as Links,It as MemoryRouter,Xr as Meta,bn as NavLink,zt as Navigate,n as NavigationType,Jt as Outlet,Wr as PrefetchPageLinks,wa as RemixServer,Wt as Route,Kt as Router,Nt as RouterProvider,qt as Routes,Vr as Scripts,Sn as ScrollRestoration,In as StaticRouter,zn as StaticRouterProvider,ne as UNSAFE_DEFERRED_SYMBOL,qe as UNSAFE_DataRouterContext,Xe as UNSAFE_DataRouterStateContext,z as UNSAFE_ErrorResponseImpl,sn as UNSAFE_FetchersContext,Ge as UNSAFE_LocationContext,Ve as UNSAFE_NavigationContext,Nr as UNSAFE_RemixContext,Qe as UNSAFE_RouteContext,Lr as UNSAFE_SingleFetchRedirectSymbol,on as UNSAFE_ViewTransitionContext,p as UNSAFE_convertRoutesToDataRoutes,Ar as UNSAFE_decodeViaTurboStream,Ft as UNSAFE_mapRouteProperties,_t as UNSAFE_useRouteId,ht as UNSAFE_useRoutesImpl,$n as UNSAFE_useScrollRestoration,tn as createBrowserRouter,rn as createHashRouter,$t as createMemoryRouter,c as createPath,ba as createRemixStub,Zt as createRoutesFromChildren,Zt as createRoutesFromElements,nr as createSearchParams,qn as createStaticHandler,Xn as createStaticRouter,N as defer,_ as generatePath,oe as getStaticContextFromError,J as isRouteErrorResponse,U as json,R as matchPath,y as matchRoutes,d as parsePath,B as redirect,I as redirectDocument,er as renderMatches,k as resolvePath,D as stripBasename,vn as unstable_HistoryRouter,Nn as unstable_usePrompt,Bn as unstable_useViewTransitionState,Pt as useActionData,jt as useAsyncError,Tt as useAsyncValue,Hn as useBeforeUnload,At as useBlocker,jn as useFetcher,On as useFetchers,Tn as useFormAction,et as useHref,tt as useInRouterContext,Dn as useLinkClickHandler,kt as useLoaderData,rt as useLocation,at as useMatch,Dt as useMatches,it as useNavigate,Rt as useNavigation,nt as useNavigationType,ut as useOutlet,lt as useOutletContext,ct as useParams,dt as useResolvedPath,Ct as useRevalidator,Mt as useRouteError,Lt as useRouteLoaderData,ft as useRoutes,kn as useSearchParams,Mn as useSubmit};
12
12
  //# sourceMappingURL=react-router.production.min.js.map