@techdocs/cli 1.8.2-next.2 → 1.8.2-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/.config-schema.json +93 -93
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/2000.e59f95de.chunk.js +5 -0
- package/dist/embedded-app/static/2000.e59f95de.chunk.js.map +1 -0
- package/dist/embedded-app/static/2136.04b92ddc.chunk.js +5 -0
- package/dist/embedded-app/static/2136.04b92ddc.chunk.js.map +1 -0
- package/dist/embedded-app/static/2604.82403d28.chunk.js +5 -0
- package/dist/embedded-app/static/2604.82403d28.chunk.js.map +1 -0
- package/dist/embedded-app/static/{3216.ac631978.chunk.js → 3216.2ad91911.chunk.js} +2 -2
- package/dist/embedded-app/static/{3216.ac631978.chunk.js.map → 3216.2ad91911.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3472.d6c98551.chunk.js → 3472.083d3a54.chunk.js} +2 -2
- package/dist/embedded-app/static/{3472.d6c98551.chunk.js.map → 3472.083d3a54.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4256.28999c0e.chunk.js +5 -0
- package/dist/embedded-app/static/4256.28999c0e.chunk.js.map +1 -0
- package/dist/embedded-app/static/496.fa9edfbf.chunk.js +5 -0
- package/dist/embedded-app/static/{2136.ba64702c.chunk.js.map → 496.fa9edfbf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{356.9eae4154.chunk.js → 636.6da734d7.chunk.js} +3 -3
- package/dist/embedded-app/static/636.6da734d7.chunk.js.map +1 -0
- package/dist/embedded-app/static/72.86c6077c.chunk.js +5 -0
- package/dist/embedded-app/static/72.86c6077c.chunk.js.map +1 -0
- package/dist/embedded-app/static/732.ba37d04a.chunk.js +5 -0
- package/dist/embedded-app/static/732.ba37d04a.chunk.js.map +1 -0
- package/dist/embedded-app/static/736.aa1a24e1.chunk.js +3 -0
- package/dist/embedded-app/static/736.aa1a24e1.chunk.js.map +1 -0
- package/dist/embedded-app/static/7380.48342232.chunk.js +5 -0
- package/dist/embedded-app/static/7380.48342232.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.fe153bbe.js +495 -0
- package/dist/embedded-app/static/main.fe153bbe.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.dd995f7e.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.dd995f7e.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.07bc98eb.js +22 -0
- package/dist/embedded-app/static/module-react-router.07bc98eb.js.map +1 -0
- package/dist/embedded-app/static/{runtime.a5edb6db.js → runtime.fe153bbe.js} +3 -3
- package/dist/embedded-app/static/runtime.fe153bbe.js.map +1 -0
- package/dist/embedded-app/static/vendor.fe153bbe.js +163 -0
- package/dist/embedded-app/static/vendor.fe153bbe.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/2000.29c21849.chunk.js +0 -5
- package/dist/embedded-app/static/2000.29c21849.chunk.js.map +0 -1
- package/dist/embedded-app/static/2136.ba64702c.chunk.js +0 -5
- package/dist/embedded-app/static/2604.e7dcd742.chunk.js +0 -5
- package/dist/embedded-app/static/2604.e7dcd742.chunk.js.map +0 -1
- package/dist/embedded-app/static/356.9eae4154.chunk.js.map +0 -1
- package/dist/embedded-app/static/4256.3a3f74a4.chunk.js +0 -5
- package/dist/embedded-app/static/4256.3a3f74a4.chunk.js.map +0 -1
- package/dist/embedded-app/static/496.cfeba817.chunk.js +0 -5
- package/dist/embedded-app/static/496.cfeba817.chunk.js.map +0 -1
- package/dist/embedded-app/static/72.9a3dbf13.chunk.js +0 -5
- package/dist/embedded-app/static/72.9a3dbf13.chunk.js.map +0 -1
- package/dist/embedded-app/static/732.1ba465ce.chunk.js +0 -5
- package/dist/embedded-app/static/732.1ba465ce.chunk.js.map +0 -1
- package/dist/embedded-app/static/7380.13fba490.chunk.js +0 -5
- package/dist/embedded-app/static/7380.13fba490.chunk.js.map +0 -1
- package/dist/embedded-app/static/9892.775e589e.chunk.js +0 -3
- package/dist/embedded-app/static/9892.775e589e.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.a5edb6db.js +0 -495
- package/dist/embedded-app/static/main.a5edb6db.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.139b0dd8.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.139b0dd8.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.5cd3c8c6.js +0 -22
- package/dist/embedded-app/static/module-react-router.5cd3c8c6.js.map +0 -1
- package/dist/embedded-app/static/runtime.a5edb6db.js.map +0 -1
- package/dist/embedded-app/static/vendor.a5edb6db.js +0 -164
- package/dist/embedded-app/static/vendor.a5edb6db.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[6101],{33648:function(Kr,$t,et){var z;et.d($t,{CF:function(){return Ye},E5:function(){return vt},IT:function(){return Ue},Iz:function(){return ie},W4:function(){return qt},YX:function(){return rt},ag:function(){return Pt},c5:function(){return sr},co:function(){return be},i6:function(){return Pe},kX:function(){return jt},oT:function(){return St},wF:function(){return Tt},wh:function(){return Ct},yY:function(){return At},yo:function(){return se}});var y=et(85668),B=et(75696);/**
|
|
2
|
+
* React Router v6.22.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/function Le(){return Le=Object.assign?Object.assign.bind():function(l){for(var s=1;s<arguments.length;s++){var v=arguments[s];for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(l[R]=v[R])}return l},Le.apply(this,arguments)}const ct=y.createContext(null),Jt=y.createContext(null),k=y.createContext(null),se=y.createContext(null),$e=y.createContext(null),ve=y.createContext({outlet:null,matches:[],isDataRoute:!1}),ye=y.createContext(null);function be(l,s){let{relative:v}=s===void 0?{}:s;ie()||(0,B.q4)(!1);let{basename:R,navigator:C}=y.useContext(se),{hash:U,pathname:L,search:W}=St(l,{relative:v}),Q=L;return R!=="/"&&(Q=L==="/"?R:(0,B.En)([R,L])),C.createHref({pathname:Q,search:W,hash:U})}function ie(){return y.useContext($e)!=null}function Ue(){return ie()||(0,B.q4)(!1),y.useContext($e).location}function G(){return React.useContext($e).navigationType}function Er(l){ie()||UNSAFE_invariant(!1);let{pathname:s}=Ue();return React.useMemo(()=>matchPath(l,s),[s,l])}const wr=null;function Je(l){y.useContext(se).static||y.useLayoutEffect(l)}function Pe(){let{isDataRoute:l}=y.useContext(ve);return l?pt():Vt()}function Vt(){ie()||(0,B.q4)(!1);let l=y.useContext(ct),{basename:s,future:v,navigator:R}=y.useContext(se),{matches:C}=y.useContext(ve),{pathname:U}=Ue(),L=JSON.stringify((0,B.M5)(C,v.v7_relativeSplatPath)),W=y.useRef(!1);return Je(()=>{W.current=!0}),y.useCallback(function(H,$){if($===void 0&&($={}),!W.current)return;if(typeof H=="number"){R.go(H);return}let T=(0,B._)(H,JSON.parse(L),U,$.relative==="path");l==null&&s!=="/"&&(T.pathname=T.pathname==="/"?s:(0,B.En)([s,T.pathname])),($.replace?R.replace:R.push)(T,$.state,$)},[s,R,L,U,l])}const ft=y.createContext(null);function Yt(){return React.useContext(ft)}function Pt(l){let s=y.useContext(ve).outlet;return s&&y.createElement(ft.Provider,{value:l},s)}function qt(){let{matches:l}=y.useContext(ve),s=l[l.length-1];return s?s.params:{}}function St(l,s){let{relative:v}=s===void 0?{}:s,{future:R}=y.useContext(se),{matches:C}=y.useContext(ve),{pathname:U}=Ue(),L=JSON.stringify((0,B.M5)(C,R.v7_relativeSplatPath));return y.useMemo(()=>(0,B._)(l,JSON.parse(L),U,v==="path"),[l,L,U,v])}function Ct(l,s){return Lt(l,s)}function Lt(l,s,v,R){ie()||(0,B.q4)(!1);let{navigator:C}=y.useContext(se),{matches:U}=y.useContext(ve),L=U[U.length-1],W=L?L.params:{},Q=L?L.pathname:"/",H=L?L.pathnameBase:"/",$=L&&L.route,T=Ue(),ne;if(s){var te;let pe=typeof s=="string"?(0,B.O8)(s):s;H==="/"||(te=pe.pathname)!=null&&te.startsWith(H)||(0,B.q4)(!1),ne=pe}else ne=T;let ce=ne.pathname||"/",Re=H==="/"?ce:ce.slice(H.length)||"/",Ee=(0,B.Cm)(l,{pathname:Re}),Te=_t(Ee&&Ee.map(pe=>Object.assign({},pe,{params:Object.assign({},W,pe.params),pathname:(0,B.En)([H,C.encodeLocation?C.encodeLocation(pe.pathname).pathname:pe.pathname]),pathnameBase:pe.pathnameBase==="/"?H:(0,B.En)([H,C.encodeLocation?C.encodeLocation(pe.pathnameBase).pathname:pe.pathnameBase])})),U,v,R);return s&&Te?y.createElement($e.Provider,{value:{location:Le({pathname:"/",search:"",hash:"",state:null,key:"default"},ne),navigationType:B.So.Pop}},Te):Te}function Xt(){let l=Ie(),s=(0,B.e8)(l)?l.status+" "+l.statusText:l instanceof Error?l.message:JSON.stringify(l),v=l instanceof Error?l.stack:null,R="rgba(200,200,200, 0.5)",C={padding:"0.5rem",backgroundColor:R},U={padding:"2px 4px",backgroundColor:R},L=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),v?y.createElement("pre",{style:C},v):null,L)}const Gt=y.createElement(Xt,null);class Mt extends y.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,v){return v.location!==s.location||v.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:v.error,location:v.location,revalidation:s.revalidation||v.revalidation}}componentDidCatch(s,v){console.error("React Router caught the following error during render",s,v)}render(){return this.state.error!==void 0?y.createElement(ve.Provider,{value:this.props.routeContext},y.createElement(ye.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Qt(l){let{routeContext:s,match:v,children:R}=l,C=y.useContext(ct);return C&&C.static&&C.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(C.staticContext._deepestRenderedBoundaryId=v.route.id),y.createElement(ve.Provider,{value:s},R)}function _t(l,s,v,R){var C;if(s===void 0&&(s=[]),v===void 0&&(v=null),R===void 0&&(R=null),l==null){var U;if((U=v)!=null&&U.errors)l=v.matches;else return null}let L=l,W=(C=v)==null?void 0:C.errors;if(W!=null){let $=L.findIndex(T=>T.route.id&&(W==null?void 0:W[T.route.id]));$>=0||(0,B.q4)(!1),L=L.slice(0,Math.min(L.length,$+1))}let Q=!1,H=-1;if(v&&R&&R.v7_partialHydration)for(let $=0;$<L.length;$++){let T=L[$];if((T.route.HydrateFallback||T.route.hydrateFallbackElement)&&(H=$),T.route.id){let{loaderData:ne,errors:te}=v,ce=T.route.loader&&ne[T.route.id]===void 0&&(!te||te[T.route.id]===void 0);if(T.route.lazy||ce){Q=!0,H>=0?L=L.slice(0,H+1):L=[L[0]];break}}}return L.reduceRight(($,T,ne)=>{let te,ce=!1,Re=null,Ee=null;v&&(te=W&&T.route.id?W[T.route.id]:void 0,Re=T.route.errorElement||Gt,Q&&(H<0&&ne===0?(ir("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),ce=!0,Ee=null):H===ne&&(ce=!0,Ee=T.route.hydrateFallbackElement||null)));let Te=s.concat(L.slice(0,ne+1)),pe=()=>{let Ae;return te?Ae=Re:ce?Ae=Ee:T.route.Component?Ae=y.createElement(T.route.Component,null):T.route.element?Ae=T.route.element:Ae=$,y.createElement(Qt,{match:T,routeContext:{outlet:$,matches:Te,isDataRoute:v!=null},children:Ae})};return v&&(T.route.ErrorBoundary||T.route.errorElement||ne===0)?y.createElement(Mt,{location:v.location,revalidation:v.revalidation,component:Re,error:te,children:pe(),routeContext:{outlet:null,matches:Te,isDataRoute:!0}}):pe()},null)}var tt=function(l){return l.UseBlocker="useBlocker",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l}(tt||{}),he=function(l){return l.UseBlocker="useBlocker",l.UseLoaderData="useLoaderData",l.UseActionData="useActionData",l.UseRouteError="useRouteError",l.UseNavigation="useNavigation",l.UseRouteLoaderData="useRouteLoaderData",l.UseMatches="useMatches",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l.UseRouteId="useRouteId",l}(he||{});function xr(l){return l+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ht(l){let s=y.useContext(ct);return s||(0,B.q4)(!1),s}function Me(l){let s=y.useContext(Jt);return s||(0,B.q4)(!1),s}function Zt(l){let s=y.useContext(ve);return s||(0,B.q4)(!1),s}function Se(l){let s=Zt(l),v=s.matches[s.matches.length-1];return v.route.id||(0,B.q4)(!1),v.route.id}function er(){return Se(he.UseRouteId)}function Dr(){return Me(he.UseNavigation).navigation}function Ot(){let l=ht(tt.UseRevalidator),s=Me(he.UseRevalidator);return React.useMemo(()=>({revalidate:l.router.revalidate,state:s.revalidation}),[l.router.revalidate,s.revalidation])}function tr(){let{matches:l,loaderData:s}=Me(he.UseMatches);return React.useMemo(()=>l.map(v=>UNSAFE_convertRouteMatchToUiMatch(v,s)),[l,s])}function rr(){let l=Me(he.UseLoaderData),s=Se(he.UseLoaderData);if(l.errors&&l.errors[s]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+s+")");return}return l.loaderData[s]}function nr(l){return Me(he.UseRouteLoaderData).loaderData[l]}function $r(){let l=Me(he.UseActionData),s=Se(he.UseLoaderData);return l.actionData?l.actionData[s]:void 0}function Ie(){var l;let s=y.useContext(ye),v=Me(he.UseRouteError),R=Se(he.UseRouteError);return s!==void 0?s:(l=v.errors)==null?void 0:l[R]}function ar(){let l=React.useContext(k);return l==null?void 0:l._data}function Pr(){let l=React.useContext(k);return l==null?void 0:l._error}let or=0;function Jr(l){let{router:s,basename:v}=ht(tt.UseBlocker),R=Me(he.UseBlocker),[C,U]=React.useState(""),L=React.useCallback(W=>{if(typeof l!="function")return!!l;if(v==="/")return l(W);let{currentLocation:Q,nextLocation:H,historyAction:$}=W;return l({currentLocation:Le({},Q,{pathname:stripBasename(Q.pathname,v)||Q.pathname}),nextLocation:Le({},H,{pathname:stripBasename(H.pathname,v)||H.pathname}),historyAction:$})},[v,l]);return React.useEffect(()=>{let W=String(++or);return U(W),()=>s.deleteBlocker(W)},[s]),React.useEffect(()=>{C!==""&&s.getBlocker(C,L)},[s,C,L]),C&&R.blockers.has(C)?R.blockers.get(C):IDLE_BLOCKER}function pt(){let{router:l}=ht(tt.UseNavigateStable),s=Se(he.UseNavigateStable),v=y.useRef(!1);return Je(()=>{v.current=!0}),y.useCallback(function(C,U){U===void 0&&(U={}),v.current&&(typeof C=="number"?l.navigate(C):l.navigate(C,Le({fromRouteId:s},U)))},[l,s])}const Ut={};function ir(l,s,v){!s&&!Ut[l]&&(Ut[l]=!0)}const lr="startTransition",mt=(z||(z=et.t(y,2)))[lr];function Sr(l){let{fallbackElement:s,router:v,future:R}=l,[C,U]=React.useState(v.state),{v7_startTransition:L}=R||{},W=React.useCallback(T=>{L&&mt?mt(()=>U(T)):U(T)},[U,L]);React.useLayoutEffect(()=>v.subscribe(W),[v,W]),React.useEffect(()=>{},[]);let Q=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:T=>v.navigate(T),push:(T,ne,te)=>v.navigate(T,{state:ne,preventScrollReset:te==null?void 0:te.preventScrollReset}),replace:(T,ne,te)=>v.navigate(T,{replace:!0,state:ne,preventScrollReset:te==null?void 0:te.preventScrollReset})}),[v]),H=v.basename||"/",$=React.useMemo(()=>({router:v,navigator:Q,static:!1,basename:H}),[v,Q,H]);return React.createElement(React.Fragment,null,React.createElement(ct.Provider,{value:$},React.createElement(Jt.Provider,{value:C},React.createElement(vt,{basename:H,location:C.location,navigationType:C.historyAction,navigator:Q,future:{v7_relativeSplatPath:v.future.v7_relativeSplatPath}},C.initialized||v.future.v7_partialHydration?React.createElement(Cr,{routes:v.routes,future:v.future,state:C}):s))),null)}function Cr(l){let{routes:s,future:v,state:R}=l;return Lt(s,void 0,R,v)}function Tt(l){let{basename:s,children:v,initialEntries:R,initialIndex:C,future:U}=l,L=y.useRef();L.current==null&&(L.current=(0,B.Wi)({initialEntries:R,initialIndex:C,v5Compat:!0}));let W=L.current,[Q,H]=y.useState({action:W.action,location:W.location}),{v7_startTransition:$}=U||{},T=y.useCallback(ne=>{$&&mt?mt(()=>H(ne)):H(ne)},[H,$]);return y.useLayoutEffect(()=>W.listen(T),[W,T]),y.createElement(vt,{basename:s,children:v,location:Q.location,navigationType:Q.action,navigator:W,future:U})}function rt(l){let{to:s,replace:v,state:R,relative:C}=l;ie()||(0,B.q4)(!1);let{future:U,static:L}=y.useContext(se),{matches:W}=y.useContext(ve),{pathname:Q}=Ue(),H=Pe(),$=(0,B._)(s,(0,B.M5)(W,U.v7_relativeSplatPath),Q,C==="path"),T=JSON.stringify($);return y.useEffect(()=>H(JSON.parse(T),{replace:v,state:R,relative:C}),[H,T,C,v,R]),null}function At(l){return Pt(l.context)}function jt(l){(0,B.q4)(!1)}function vt(l){let{basename:s="/",children:v=null,location:R,navigationType:C=B.So.Pop,navigator:U,static:L=!1,future:W}=l;ie()&&(0,B.q4)(!1);let Q=s.replace(/^\/*/,"/"),H=y.useMemo(()=>({basename:Q,navigator:U,static:L,future:Le({v7_relativeSplatPath:!1},W)}),[Q,W,U,L]);typeof R=="string"&&(R=(0,B.O8)(R));let{pathname:$="/",search:T="",hash:ne="",state:te=null,key:ce="default"}=R,Re=y.useMemo(()=>{let Ee=(0,B.mc)($,Q);return Ee==null?null:{location:{pathname:Ee,search:T,hash:ne,state:te,key:ce},navigationType:C}},[Q,$,T,ne,te,ce,C]);return Re==null?null:y.createElement(se.Provider,{value:H},y.createElement($e.Provider,{children:v,value:Re}))}function sr(l){let{children:s,location:v}=l;return Ct(Ye(s),v)}function Lr(l){let{children:s,errorElement:v,resolve:R}=l;return React.createElement(ur,{resolve:R,errorElement:v},React.createElement(Ve,null,s))}var me=function(l){return l[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l}(me||{});const gt=new Promise(()=>{});class ur extends y.Component{constructor(s){super(s),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,v){console.error("<Await> caught the following error during render",s,v)}render(){let{children:s,errorElement:v,resolve:R}=this.props,C=null,U=me.pending;if(!(R instanceof Promise))U=me.success,C=Promise.resolve(),Object.defineProperty(C,"_tracked",{get:()=>!0}),Object.defineProperty(C,"_data",{get:()=>R});else if(this.state.error){U=me.error;let L=this.state.error;C=Promise.reject().catch(()=>{}),Object.defineProperty(C,"_tracked",{get:()=>!0}),Object.defineProperty(C,"_error",{get:()=>L})}else R._tracked?(C=R,U=C._error!==void 0?me.error:C._data!==void 0?me.success:me.pending):(U=me.pending,Object.defineProperty(R,"_tracked",{get:()=>!0}),C=R.then(L=>Object.defineProperty(R,"_data",{get:()=>L}),L=>Object.defineProperty(R,"_error",{get:()=>L})));if(U===me.error&&C._error instanceof B.ay)throw gt;if(U===me.error&&!v)throw C._error;if(U===me.error)return y.createElement(k.Provider,{value:C,children:v});if(U===me.success)return y.createElement(k.Provider,{value:C,children:s});throw C}}function Ve(l){let{children:s}=l,v=ar(),R=typeof s=="function"?s(v):s;return React.createElement(React.Fragment,null,R)}function Ye(l,s){s===void 0&&(s=[]);let v=[];return y.Children.forEach(l,(R,C)=>{if(!y.isValidElement(R))return;let U=[...s,C];if(R.type===y.Fragment){v.push.apply(v,Ye(R.props.children,U));return}R.type!==jt&&(0,B.q4)(!1),!R.props.index||!R.props.children||(0,B.q4)(!1);let L={id:R.props.id||U.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:R.props.ErrorBoundary!=null||R.props.errorElement!=null,shouldRevalidate:R.props.shouldRevalidate,handle:R.props.handle,lazy:R.props.lazy};R.props.children&&(L.children=Ye(R.props.children,U)),v.push(L)}),v}function dr(l){return _t(l)}function Ft(l){let s={hasErrorBoundary:l.ErrorBoundary!=null||l.errorElement!=null};return l.Component&&Object.assign(s,{element:React.createElement(l.Component),Component:void 0}),l.HydrateFallback&&Object.assign(s,{hydrateFallbackElement:React.createElement(l.HydrateFallback),HydrateFallback:void 0}),l.ErrorBoundary&&Object.assign(s,{errorElement:React.createElement(l.ErrorBoundary),ErrorBoundary:void 0}),s}function Vr(l,s){return createRouter({basename:s==null?void 0:s.basename,future:Le({},s==null?void 0:s.future,{v7_prependBasename:!0}),history:createMemoryHistory({initialEntries:s==null?void 0:s.initialEntries,initialIndex:s==null?void 0:s.initialIndex}),hydrationData:s==null?void 0:s.hydrationData,routes:l,mapRouteProperties:Ft}).initialize()}},75696:function(Kr,$t,et){et.d($t,{Cm:function(){return Pe},En:function(){return Ie},Ep:function(){return be},M5:function(){return rr},MP:function(){return er},O8:function(){return ie},So:function(){return y},Wi:function(){return Le},Yz:function(){return he},_:function(){return nr},ay:function(){return pt},e8:function(){return rt},mc:function(){return Se},q4:function(){return k}});/**
|
|
11
|
+
* @remix-run/router v1.15.0
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Remix Software Inc.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
+
*
|
|
18
|
+
* @license MIT
|
|
19
|
+
*/function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}var y;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(y||(y={}));const B="popstate";function Le(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((x,S)=>m(x,typeof x=="string"?null:x.state,S===0?"default":void 0));let d=h(r==null?a.length-1:r),i=y.Pop,p=null;function h(x){return Math.min(Math.max(x,0),a.length-1)}function b(){return a[d]}function m(x,S,P){S===void 0&&(S=null);let w=ye(a?b().pathname:"/",x,S,P);return se(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(x)),w}function _(x){return typeof x=="string"?x:be(x)}return{get index(){return d},get action(){return i},get location(){return b()},createHref:_,createURL(x){return new URL(_(x),"http://localhost")},encodeLocation(x){let S=typeof x=="string"?ie(x):x;return{pathname:S.pathname||"",search:S.search||"",hash:S.hash||""}},push(x,S){i=y.Push;let P=m(x,S);d+=1,a.splice(d,a.length,P),n&&p&&p({action:i,location:P,delta:1})},replace(x,S){i=y.Replace;let P=m(x,S);a[d]=P,n&&p&&p({action:i,location:P,delta:0})},go(x){i=y.Pop;let S=h(d+x),P=a[S];d=S,p&&p({action:i,location:P,delta:x})},listen(x){return p=x,()=>{p=null}}}}function ct(e){e===void 0&&(e={});function t(n,a){let{pathname:d,search:i,hash:p}=n.location;return ye("",{pathname:d,search:i,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:be(a)}return Ue(t,r,null,e)}function Jt(e){e===void 0&&(e={});function t(a,d){let{pathname:i="/",search:p="",hash:h=""}=ie(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ye("",{pathname:i,search:p,hash:h},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(a,d){let i=a.document.querySelector("base"),p="";if(i&&i.getAttribute("href")){let h=a.location.href,b=h.indexOf("#");p=b===-1?h:h.slice(0,b)}return p+"#"+(typeof d=="string"?d:be(d))}function n(a,d){se(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(d)+")")}return Ue(t,r,n,e)}function k(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function se(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function $e(){return Math.random().toString(36).substr(2,8)}function ve(e,t){return{usr:e.state,key:e.key,idx:t}}function ye(e,t,r,n){return r===void 0&&(r=null),z({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ie(t):t,{state:r,key:t&&t.key||n||$e()})}function be(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ie(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 Ue(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:d=!1}=n,i=a.history,p=y.Pop,h=null,b=m();b==null&&(b=0,i.replaceState(z({},i.state,{idx:b}),""));function m(){return(i.state||{idx:null}).idx}function _(){p=y.Pop;let w=m(),g=w==null?null:w-b;b=w,h&&h({action:p,location:P.location,delta:g})}function E(w,g){p=y.Push;let F=ye(P.location,w,g);r&&r(F,w),b=m()+1;let V=ve(F,b),Y=P.createHref(F);try{i.pushState(V,"",Y)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;a.location.assign(Y)}d&&h&&h({action:p,location:P.location,delta:1})}function x(w,g){p=y.Replace;let F=ye(P.location,w,g);r&&r(F,w),b=m();let V=ve(F,b),Y=P.createHref(F);i.replaceState(V,"",Y),d&&h&&h({action:p,location:P.location,delta:0})}function S(w){let g=a.location.origin!=="null"?a.location.origin:a.location.href,F=typeof w=="string"?w:be(w);return k(g,"No window.location.(origin|href) available to create URL for href: "+F),new URL(F,g)}let P={get action(){return p},get location(){return e(a,i)},listen(w){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(B,_),h=w,()=>{a.removeEventListener(B,_),h=null}},createHref(w){return t(a,w)},createURL:S,encodeLocation(w){let g=S(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:E,replace:x,go(w){return i.go(w)}};return P}var G;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(G||(G={}));const Er=new Set(["lazy","caseSensitive","path","id","index","children"]);function wr(e){return e.index===!0}function Je(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,d)=>{let i=[...r,d],p=typeof a.id=="string"?a.id:i.join("-");if(k(a.index!==!0||!a.children,"Cannot specify children on an index route"),k(!n[p],'Found a route id collision on id "'+p+`". Route id's must be globally unique within Data Router usages`),wr(a)){let h=z({},a,t(a),{id:p});return n[p]=h,h}else{let h=z({},a,t(a),{id:p,children:void 0});return n[p]=h,a.children&&(h.children=Je(a.children,t,i,n)),h}})}function Pe(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ie(t):t,a=Se(n.pathname||"/",r);if(a==null)return null;let d=ft(e);Pt(d);let i=null;for(let p=0;i==null&&p<d.length;++p)i=tt(d[p],Me(a));return i}function Vt(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 ft(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(d,i,p)=>{let h={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:i,route:d};h.relativePath.startsWith("/")&&(k(h.relativePath.startsWith(n),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(n.length));let b=Ie([n,h.relativePath]),m=r.concat(h);d.children&&d.children.length>0&&(k(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+b+'".')),ft(d.children,t,m,b)),!(d.path==null&&!d.index)&&t.push({path:b,score:Qt(b,d.index),routesMeta:m})};return e.forEach((d,i)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))a(d,i);else for(let h of Yt(d.path))a(d,i,h)}),t}function Yt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),d=r.replace(/\?$/,"");if(n.length===0)return a?[d,""]:[d];let i=Yt(n.join("/")),p=[];return p.push(...i.map(h=>h===""?d:[d,h].join("/"))),a&&p.push(...i),p.map(h=>e.startsWith("/")&&h===""?"/":h)}function Pt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:_t(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qt=/^:[\w-]+$/,St=3,Ct=2,Lt=1,Xt=10,Gt=-2,Mt=e=>e==="*";function Qt(e,t){let r=e.split("/"),n=r.length;return r.some(Mt)&&(n+=Gt),t&&(n+=Ct),r.filter(a=>!Mt(a)).reduce((a,d)=>a+(qt.test(d)?St:d===""?Lt:Xt),n)}function _t(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function tt(e,t){let{routesMeta:r}=e,n={},a="/",d=[];for(let i=0;i<r.length;++i){let p=r[i],h=i===r.length-1,b=a==="/"?t:t.slice(a.length)||"/",m=xr({path:p.relativePath,caseSensitive:p.caseSensitive,end:h},b);if(!m)return null;Object.assign(n,m.params);let _=p.route;d.push({params:n,pathname:Ie([a,m.pathname]),pathnameBase:ar(Ie([a,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(a=Ie([a,m.pathnameBase]))}return d}function he(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(se(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=i=>i==null?"":typeof i=="string"?i:String(i),d=r.split(/\/+/).map((i,p,h)=>{if(p===h.length-1&&i==="*")return a(t["*"]);const m=i.match(/^:([\w-]+)(\??)$/);if(m){const[,_,E]=m;let x=t[_];return k(E==="?"||x!=null,'Missing ":'+_+'" param'),a(x)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+d.join("/")}function xr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ht(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let d=a[0],i=d.replace(/(.)\/+$/,"$1"),p=a.slice(1);return{params:n.reduce((b,m,_)=>{let{paramName:E,isOptional:x}=m;if(E==="*"){let P=p[_]||"";i=d.slice(0,d.length-P.length).replace(/(.)\/+$/,"$1")}const S=p[_];return x&&!S?b[E]=void 0:b[E]=Zt(S||"",E),b},{}),pathname:d,pathnameBase:i,pattern:e}}function ht(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),se(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,p,h)=>(n.push({paramName:p,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Me(e){try{return decodeURI(e)}catch(t){return se(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Zt(e,t){try{return decodeURIComponent(e)}catch(r){return se(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Se(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 er(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ie(e):e;return{pathname:r?r.startsWith("/")?r:Dr(r,t):t,search:Pr(n),hash:or(a)}}function Dr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Ot(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function tr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function rr(e,t){let r=tr(e);return t?r.map((n,a)=>a===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function nr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ie(e):(a=z({},e),k(!a.pathname||!a.pathname.includes("?"),Ot("?","pathname","search",a)),k(!a.pathname||!a.pathname.includes("#"),Ot("#","pathname","hash",a)),k(!a.search||!a.search.includes("#"),Ot("#","search","hash",a)));let d=e===""||a.pathname==="",i=d?"/":a.pathname,p;if(i==null)p=r;else{let _=t.length-1;if(!n&&i.startsWith("..")){let E=i.split("/");for(;E[0]==="..";)E.shift(),_-=1;a.pathname=E.join("/")}p=_>=0?t[_]:"/"}let h=er(a,p),b=i&&i!=="/"&&i.endsWith("/"),m=(d||i===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(b||m)&&(h.pathname+="/"),h}function $r(e){return e===""||e.pathname===""?"/":typeof e=="string"?ie(e).pathname:e.pathname}const Ie=e=>e.join("/").replace(/\/\/+/g,"/"),ar=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Pr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,or=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Jr=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),z({},n,{headers:a}))};class pt extends Error{}class Ut{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],k(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((d,i)=>n=i),this.controller=new AbortController;let a=()=>n(new pt("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((d,i)=>{let[p,h]=i;return Object.assign(d,{[p]:this.trackPromise(p,h)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,void 0,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){if(this.controller.signal.aborted&&n instanceof pt)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let d=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>d}),this.emit(!1,r),Promise.reject(d)}return a===void 0?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(d=>{t.removeEventListener("abort",n),(d||this.done)&&a(d)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return k(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,r)=>{let[n,a]=r;return Object.assign(t,{[n]:lr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function ir(e){return e instanceof Promise&&e._tracked===!0}function lr(e){if(!ir(e))return e;if(e._error)throw e._error;return e._data}const mt=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Ut(t,n)},Sr=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status=="undefined"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,z({},n,{headers:a}))},Cr=(e,t)=>{let r=Sr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Tt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const At=["post","put","patch","delete"],jt=new Set(At),vt=["get",...At],sr=new Set(vt),Lr=new Set([301,302,303,307,308]),me=new Set([307,308]),gt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ur={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ve={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ft="remix-router-transitions";function Vr(e){const t=e.window?e.window:typeof window!="undefined"?window:void 0,r=typeof t!="undefined"&&typeof t.document!="undefined"&&typeof t.document.createElement!="undefined",n=!r;k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let o=e.detectErrorBoundary;a=u=>({hasErrorBoundary:o(u)})}else a=dr;let d={},i=Je(e.routes,a,void 0,d),p,h=e.basename||"/",b=z({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,_=new Set,E=null,x=null,S=null,P=e.hydrationData!=null,w=Pe(i,e.history.location,h),g=null;if(w==null){let o=oe(404,{pathname:e.history.location.pathname}),{matches:u,route:f}=It(i);w=u,g={[f.id]:o}}let F,V=w.some(o=>o.route.lazy),Y=w.some(o=>o.route.loader);if(V)F=!1;else if(!Y)F=!0;else if(b.v7_partialHydration){let o=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;F=w.every(f=>f.route.loader&&f.route.loader.hydrate!==!0&&(o&&o[f.route.id]!==void 0||u&&u[f.route.id]!==void 0))}else F=e.hydrationData!=null;let q,c={historyAction:e.history.action,location:e.history.location,matches:w,initialized:F,navigation:gt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||g,fetchers:new Map,blockers:new Map},X=y.Pop,J=!1,Z,_e=!1,xe=new Map,Ce=null,ot=!1,qe=!1,Nt=[],Bt=[],le=new Map,kt=0,Rt=-1,it=new Map,je=new Set,lt=new Map,Et=new Map,Fe=new Set,Xe=new Map,Ge=new Map,pr=!1;function rn(){if(m=e.history.listen(o=>{let{action:u,location:f,delta:D}=o;if(pr){pr=!1;return}se(Ge.size===0||D!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let M=zr({currentLocation:c.location,nextLocation:f,historyAction:u});if(M&&D!=null){pr=!0,e.history.go(D*-1),Ht(M,{state:"blocked",location:f,proceed(){Ht(M,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),e.history.go(D)},reset(){let N=new Map(c.blockers);N.set(M,Ve),ge({blockers:N})}});return}return Qe(u,f)}),r){en(t,xe);let o=()=>tn(t,xe);t.addEventListener("pagehide",o),Ce=()=>t.removeEventListener("pagehide",o)}return c.initialized||Qe(y.Pop,c.location,{initialHydration:!0}),q}function nn(){m&&m(),Ce&&Ce(),_.clear(),Z&&Z.abort(),c.fetchers.forEach((o,u)=>zt(u)),c.blockers.forEach((o,u)=>kr(u))}function an(o){return _.add(o),()=>_.delete(o)}function ge(o,u){u===void 0&&(u={}),c=z({},c,o);let f=[],D=[];b.v7_fetcherPersist&&c.fetchers.forEach((M,N)=>{M.state==="idle"&&(Fe.has(N)?D.push(N):f.push(N))}),[..._].forEach(M=>M(c,{deletedFetchers:D,unstable_viewTransitionOpts:u.viewTransitionOpts,unstable_flushSync:u.flushSync===!0})),b.v7_fetcherPersist&&(f.forEach(M=>c.fetchers.delete(M)),D.forEach(M=>zt(M)))}function wt(o,u,f){var D,M;let{flushSync:N}=f===void 0?{}:f,j=c.actionData!=null&&c.navigation.formMethod!=null&&we(c.navigation.formMethod)&&c.navigation.state==="loading"&&((D=o.state)==null?void 0:D._isRedirect)!==!0,A;u.actionData?Object.keys(u.actionData).length>0?A=u.actionData:A=null:j?A=c.actionData:A=null;let O=u.loaderData?Ae(c.loaderData,u.loaderData,u.matches||[],u.errors):c.loaderData,K=c.blockers;K.size>0&&(K=new Map(K),K.forEach((re,fe)=>K.set(fe,Ve)));let ue=J===!0||c.navigation.formMethod!=null&&we(c.navigation.formMethod)&&((M=o.state)==null?void 0:M._isRedirect)!==!0;p&&(i=p,p=void 0),ot||X===y.Pop||(X===y.Push?e.history.push(o,o.state):X===y.Replace&&e.history.replace(o,o.state));let I;if(X===y.Pop){let re=xe.get(c.location.pathname);re&&re.has(o.pathname)?I={currentLocation:c.location,nextLocation:o}:xe.has(o.pathname)&&(I={currentLocation:o,nextLocation:c.location})}else if(_e){let re=xe.get(c.location.pathname);re?re.add(o.pathname):(re=new Set([o.pathname]),xe.set(c.location.pathname,re)),I={currentLocation:c.location,nextLocation:o}}ge(z({},u,{actionData:A,loaderData:O,historyAction:X,location:o,initialized:!0,navigation:gt,revalidation:"idle",restoreScrollPosition:Wr(o,u.matches||c.matches),preventScrollReset:ue,blockers:K}),{viewTransitionOpts:I,flushSync:N===!0}),X=y.Pop,J=!1,_e=!1,ot=!1,qe=!1,Nt=[],Bt=[]}async function Ar(o,u){if(typeof o=="number"){e.history.go(o);return}let f=U(c.location,c.matches,h,b.v7_prependBasename,o,b.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:D,submission:M,error:N}=L(b.v7_normalizeFormMethod,!1,f,u),j=c.location,A=ye(c.location,D,u&&u.state);A=z({},A,e.history.encodeLocation(A));let O=u&&u.replace!=null?u.replace:void 0,K=y.Push;O===!0?K=y.Replace:O===!1||M!=null&&we(M.formMethod)&&M.formAction===c.location.pathname+c.location.search&&(K=y.Replace);let ue=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,I=(u&&u.unstable_flushSync)===!0,re=zr({currentLocation:j,nextLocation:A,historyAction:K});if(re){Ht(re,{state:"blocked",location:A,proceed(){Ht(re,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),Ar(o,u)},reset(){let fe=new Map(c.blockers);fe.set(re,Ve),ge({blockers:fe})}});return}return await Qe(K,A,{submission:M,pendingError:N,preventScrollReset:ue,replace:u&&u.replace,enableViewTransition:u&&u.unstable_viewTransition,flushSync:I})}function on(){if(mr(),ge({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){Qe(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}Qe(X||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function Qe(o,u,f){Z&&Z.abort(),Z=null,X=o,ot=(f&&f.startUninterruptedRevalidation)===!0,mn(c.location,c.matches),J=(f&&f.preventScrollReset)===!0,_e=(f&&f.enableViewTransition)===!0;let D=p||i,M=f&&f.overrideNavigation,N=Pe(D,u,h),j=(f&&f.flushSync)===!0;if(!N){let fe=oe(404,{pathname:u.pathname}),{matches:De,route:de}=It(D);vr(),wt(u,{matches:De,loaderData:{},errors:{[de.id]:fe}},{flushSync:j});return}if(c.initialized&&!qe&&Yr(c.location,u)&&!(f&&f.submission&&we(f.submission.formMethod))){wt(u,{matches:N},{flushSync:j});return}Z=new AbortController;let A=ce(e.history,u,Z.signal,f&&f.submission),O,K;if(f&&f.pendingError)K={[nt(N).route.id]:f.pendingError};else if(f&&f.submission&&we(f.submission.formMethod)){let fe=await ln(A,u,f.submission,N,{replace:f.replace,flushSync:j});if(fe.shortCircuited)return;O=fe.pendingActionData,K=fe.pendingActionError,M=hr(u,f.submission),j=!1,A=new Request(A.url,{signal:A.signal})}let{shortCircuited:ue,loaderData:I,errors:re}=await sn(A,u,N,M,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,j,O,K);ue||(Z=null,wt(u,z({matches:N},O?{actionData:O}:{},{loaderData:I,errors:re})))}async function ln(o,u,f,D,M){M===void 0&&(M={}),mr();let N=Qr(u,f);ge({navigation:N},{flushSync:M.flushSync===!0});let j,A=yt(D,u);if(!A.route.action&&!A.route.lazy)j={type:G.error,error:oe(405,{method:o.method,pathname:u.pathname,routeId:A.route.id})};else if(j=await te("action",o,A,D,d,a,h,b.v7_relativeSplatPath),o.signal.aborted)return{shortCircuited:!0};if(ke(j)){let O;return M&&M.replace!=null?O=M.replace:O=j.location===c.location.pathname+c.location.search,await xt(c,j,{submission:f,replace:O}),{shortCircuited:!0}}if(Be(j)){let O=nt(D,A.route.id);return(M&&M.replace)!==!0&&(X=y.Push),{pendingActionData:{},pendingActionError:{[O.route.id]:j.error}}}if(Ne(j))throw oe(400,{type:"defer-action"});return{pendingActionData:{[A.route.id]:j.data}}}async function sn(o,u,f,D,M,N,j,A,O,K,ue){let I=D||hr(u,M),re=M||N||Tr(I),fe=p||i,[De,de]=Q(e.history,c,f,re,u,b.v7_partialHydration&&A===!0,qe,Nt,Bt,Fe,lt,je,fe,h,K,ue);if(vr(ee=>!(f&&f.some(ae=>ae.route.id===ee))||De&&De.some(ae=>ae.route.id===ee)),Rt=++kt,De.length===0&&de.length===0){let ee=Nr();return wt(u,z({matches:f,loaderData:{},errors:ue||null},K?{actionData:K}:{},ee?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O}),{shortCircuited:!0}}if(!ot&&(!b.v7_partialHydration||!A)){de.forEach(ae=>{let Oe=c.fetchers.get(ae.key),Kt=bt(void 0,Oe?Oe.data:void 0);c.fetchers.set(ae.key,Kt)});let ee=K||c.actionData;ge(z({navigation:I},ee?Object.keys(ee).length===0?{actionData:null}:{actionData:ee}:{},de.length>0?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O})}de.forEach(ee=>{le.has(ee.key)&&We(ee.key),ee.controller&&le.set(ee.key,ee.controller)});let st=()=>de.forEach(ee=>We(ee.key));Z&&Z.signal.addEventListener("abort",st);let{results:gr,loaderResults:ut,fetcherResults:Ke}=await jr(c.matches,f,De,de,o);if(o.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",st),de.forEach(ee=>le.delete(ee.key));let Ze=Mr(gr);if(Ze){if(Ze.idx>=De.length){let ee=de[Ze.idx-De.length].key;je.add(ee)}return await xt(c,Ze.result,{replace:j}),{shortCircuited:!0}}let{loaderData:yr,errors:br}=pe(c,f,De,ut,ue,de,Ke,Xe);Xe.forEach((ee,ae)=>{ee.subscribe(Oe=>{(Oe||ee.done)&&Xe.delete(ae)})});let Rr=Nr(),dt=Br(Rt),Wt=Rr||dt||de.length>0;return z({loaderData:yr,errors:br},Wt?{fetchers:new Map(c.fetchers)}:{})}function un(o,u,f,D){if(n)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.");le.has(o)&&We(o);let M=(D&&D.unstable_flushSync)===!0,N=p||i,j=U(c.location,c.matches,h,b.v7_prependBasename,f,b.v7_relativeSplatPath,u,D==null?void 0:D.relative),A=Pe(N,j,h);if(!A){Dt(o,u,oe(404,{pathname:j}),{flushSync:M});return}let{path:O,submission:K,error:ue}=L(b.v7_normalizeFormMethod,!0,j,D);if(ue){Dt(o,u,ue,{flushSync:M});return}let I=yt(A,O);if(J=(D&&D.preventScrollReset)===!0,K&&we(K.formMethod)){dn(o,u,O,I,A,M,K);return}lt.set(o,{routeId:u,path:O}),cn(o,u,O,I,A,M,K)}async function dn(o,u,f,D,M,N,j){if(mr(),lt.delete(o),!D.route.action&&!D.route.lazy){let ae=oe(405,{method:j.formMethod,pathname:f,routeId:u});Dt(o,u,ae,{flushSync:N});return}let A=c.fetchers.get(o);He(o,Zr(j,A),{flushSync:N});let O=new AbortController,K=ce(e.history,f,O.signal,j);le.set(o,O);let ue=kt,I=await te("action",K,D,M,d,a,h,b.v7_relativeSplatPath);if(K.signal.aborted){le.get(o)===O&&le.delete(o);return}if(b.v7_fetcherPersist&&Fe.has(o)){if(ke(I)||Be(I)){He(o,ze(void 0));return}}else{if(ke(I))if(le.delete(o),Rt>ue){He(o,ze(void 0));return}else return je.add(o),He(o,bt(j)),xt(c,I,{fetcherSubmission:j});if(Be(I)){Dt(o,u,I.error);return}}if(Ne(I))throw oe(400,{type:"defer-action"});let re=c.navigation.location||c.location,fe=ce(e.history,re,O.signal),De=p||i,de=c.navigation.state!=="idle"?Pe(De,c.navigation.location,h):c.matches;k(de,"Didn't find any matches after fetcher action");let st=++kt;it.set(o,st);let gr=bt(j,I.data);c.fetchers.set(o,gr);let[ut,Ke]=Q(e.history,c,de,j,re,!1,qe,Nt,Bt,Fe,lt,je,De,h,{[D.route.id]:I.data},void 0);Ke.filter(ae=>ae.key!==o).forEach(ae=>{let Oe=ae.key,Kt=c.fetchers.get(Oe),gn=bt(void 0,Kt?Kt.data:void 0);c.fetchers.set(Oe,gn),le.has(Oe)&&We(Oe),ae.controller&&le.set(Oe,ae.controller)}),ge({fetchers:new Map(c.fetchers)});let Ze=()=>Ke.forEach(ae=>We(ae.key));O.signal.addEventListener("abort",Ze);let{results:yr,loaderResults:br,fetcherResults:Rr}=await jr(c.matches,de,ut,Ke,fe);if(O.signal.aborted)return;O.signal.removeEventListener("abort",Ze),it.delete(o),le.delete(o),Ke.forEach(ae=>le.delete(ae.key));let dt=Mr(yr);if(dt){if(dt.idx>=ut.length){let ae=Ke[dt.idx-ut.length].key;je.add(ae)}return xt(c,dt.result)}let{loaderData:Wt,errors:ee}=pe(c,c.matches,ut,br,void 0,Ke,Rr,Xe);if(c.fetchers.has(o)){let ae=ze(I.data);c.fetchers.set(o,ae)}Br(st),c.navigation.state==="loading"&&st>Rt?(k(X,"Expected pending action"),Z&&Z.abort(),wt(c.navigation.location,{matches:de,loaderData:Wt,errors:ee,fetchers:new Map(c.fetchers)})):(ge({errors:ee,loaderData:Ae(c.loaderData,Wt,de,ee),fetchers:new Map(c.fetchers)}),qe=!1)}async function cn(o,u,f,D,M,N,j){let A=c.fetchers.get(o);He(o,bt(j,A?A.data:void 0),{flushSync:N});let O=new AbortController,K=ce(e.history,f,O.signal);le.set(o,O);let ue=kt,I=await te("loader",K,D,M,d,a,h,b.v7_relativeSplatPath);if(Ne(I)&&(I=await Ur(I,K.signal,!0)||I),le.get(o)===O&&le.delete(o),!K.signal.aborted){if(Fe.has(o)){He(o,ze(void 0));return}if(ke(I))if(Rt>ue){He(o,ze(void 0));return}else{je.add(o),await xt(c,I);return}if(Be(I)){Dt(o,u,I.error);return}k(!Ne(I),"Unhandled fetcher deferred data"),He(o,ze(I.data))}}async function xt(o,u,f){let{submission:D,fetcherSubmission:M,replace:N}=f===void 0?{}:f;u.revalidate&&(qe=!0);let j=ye(o.location,u.location,{_isRedirect:!0});if(k(j,"Expected a location on the redirect navigation"),r){let re=!1;if(u.reloadDocument)re=!0;else if(Ye.test(u.location)){const fe=e.history.createURL(u.location);re=fe.origin!==t.location.origin||Se(fe.pathname,h)==null}if(re){N?t.location.replace(u.location):t.location.assign(u.location);return}}Z=null;let A=N===!0?y.Replace:y.Push,{formMethod:O,formAction:K,formEncType:ue}=o.navigation;!D&&!M&&O&&K&&ue&&(D=Tr(o.navigation));let I=D||M;if(me.has(u.status)&&I&&we(I.formMethod))await Qe(A,j,{submission:z({},I,{formAction:u.location}),preventScrollReset:J});else{let re=hr(j,D);await Qe(A,j,{overrideNavigation:re,fetcherSubmission:M,preventScrollReset:J})}}async function jr(o,u,f,D,M){let N=await Promise.all([...f.map(O=>te("loader",M,O,u,d,a,h,b.v7_relativeSplatPath)),...D.map(O=>O.matches&&O.match&&O.controller?te("loader",ce(e.history,O.path,O.controller.signal),O.match,O.matches,d,a,h,b.v7_relativeSplatPath):{type:G.error,error:oe(404,{pathname:O.path})})]),j=N.slice(0,f.length),A=N.slice(f.length);return await Promise.all([Or(o,f,j,j.map(()=>M.signal),!1,c.loaderData),Or(o,D.map(O=>O.match),A,D.map(O=>O.controller?O.controller.signal:null),!0)]),{results:N,loaderResults:j,fetcherResults:A}}function mr(){qe=!0,Nt.push(...vr()),lt.forEach((o,u)=>{le.has(u)&&(Bt.push(u),We(u))})}function He(o,u,f){f===void 0&&(f={}),c.fetchers.set(o,u),ge({fetchers:new Map(c.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function Dt(o,u,f,D){D===void 0&&(D={});let M=nt(c.matches,u);zt(o),ge({errors:{[M.route.id]:f},fetchers:new Map(c.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function Fr(o){return b.v7_fetcherPersist&&(Et.set(o,(Et.get(o)||0)+1),Fe.has(o)&&Fe.delete(o)),c.fetchers.get(o)||ur}function zt(o){let u=c.fetchers.get(o);le.has(o)&&!(u&&u.state==="loading"&&it.has(o))&&We(o),lt.delete(o),it.delete(o),je.delete(o),Fe.delete(o),c.fetchers.delete(o)}function fn(o){if(b.v7_fetcherPersist){let u=(Et.get(o)||0)-1;u<=0?(Et.delete(o),Fe.add(o)):Et.set(o,u)}else zt(o);ge({fetchers:new Map(c.fetchers)})}function We(o){let u=le.get(o);k(u,"Expected fetch controller: "+o),u.abort(),le.delete(o)}function Ir(o){for(let u of o){let f=Fr(u),D=ze(f.data);c.fetchers.set(u,D)}}function Nr(){let o=[],u=!1;for(let f of je){let D=c.fetchers.get(f);k(D,"Expected fetcher: "+f),D.state==="loading"&&(je.delete(f),o.push(f),u=!0)}return Ir(o),u}function Br(o){let u=[];for(let[f,D]of it)if(D<o){let M=c.fetchers.get(f);k(M,"Expected fetcher: "+f),M.state==="loading"&&(We(f),it.delete(f),u.push(f))}return Ir(u),u.length>0}function hn(o,u){let f=c.blockers.get(o)||Ve;return Ge.get(o)!==u&&Ge.set(o,u),f}function kr(o){c.blockers.delete(o),Ge.delete(o)}function Ht(o,u){let f=c.blockers.get(o)||Ve;k(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let D=new Map(c.blockers);D.set(o,u),ge({blockers:D})}function zr(o){let{currentLocation:u,nextLocation:f,historyAction:D}=o;if(Ge.size===0)return;Ge.size>1&&se(!1,"A router only supports one blocker at a time");let M=Array.from(Ge.entries()),[N,j]=M[M.length-1],A=c.blockers.get(N);if(!(A&&A.state==="proceeding")&&j({currentLocation:u,nextLocation:f,historyAction:D}))return N}function vr(o){let u=[];return Xe.forEach((f,D)=>{(!o||o(D))&&(f.cancel(),u.push(D),Xe.delete(D))}),u}function pn(o,u,f){if(E=o,S=u,x=f||null,!P&&c.navigation===gt){P=!0;let D=Wr(c.location,c.matches);D!=null&&ge({restoreScrollPosition:D})}return()=>{E=null,S=null,x=null}}function Hr(o,u){return x&&x(o,u.map(D=>Vt(D,c.loaderData)))||o.key}function mn(o,u){if(E&&S){let f=Hr(o,u);E[f]=S()}}function Wr(o,u){if(E){let f=Hr(o,u),D=E[f];if(typeof D=="number")return D}return null}function vn(o){d={},p=Je(o,a,void 0,d)}return q={get basename(){return h},get future(){return b},get state(){return c},get routes(){return i},get window(){return t},initialize:rn,subscribe:an,enableScrollRestoration:pn,navigate:Ar,fetch:un,revalidate:on,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:Fr,deleteFetcher:fn,dispose:nn,getBlocker:hn,deleteBlocker:kr,_internalFetchControllers:le,_internalActiveDeferreds:Xe,_internalSetRoutes:vn},q}const l=Symbol("deferred");function s(e,t){k(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(t?t.basename:null)||"/",a;if(t!=null&&t.mapRouteProperties)a=t.mapRouteProperties;else if(t!=null&&t.detectErrorBoundary){let E=t.detectErrorBoundary;a=x=>({hasErrorBoundary:E(x)})}else a=dr;let d=z({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},t?t.future:null),i=Je(e,a,void 0,r);async function p(E,x){let{requestContext:S}=x===void 0?{}:x,P=new URL(E.url),w=E.method,g=ye("",be(P),null,"default"),F=Pe(i,g,n);if(!cr(w)&&w!=="HEAD"){let Y=oe(405,{method:w}),{matches:q,route:c}=It(i);return{basename:n,location:g,matches:q,loaderData:{},actionData:null,errors:{[c.id]:Y},statusCode:Y.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!F){let Y=oe(404,{pathname:g.pathname}),{matches:q,route:c}=It(i);return{basename:n,location:g,matches:q,loaderData:{},actionData:null,errors:{[c.id]:Y},statusCode:Y.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let V=await b(E,g,F,S);return at(V)?V:z({location:g,basename:n},V)}async function h(E,x){let{routeId:S,requestContext:P}=x===void 0?{}:x,w=new URL(E.url),g=E.method,F=ye("",be(w),null,"default"),V=Pe(i,F,n);if(!cr(g)&&g!=="HEAD"&&g!=="OPTIONS")throw oe(405,{method:g});if(!V)throw oe(404,{pathname:F.pathname});let Y=S?V.find(J=>J.route.id===S):yt(V,F);if(S&&!Y)throw oe(403,{pathname:F.pathname,routeId:S});if(!Y)throw oe(404,{pathname:F.pathname});let q=await b(E,F,V,P,Y);if(at(q))return q;let c=q.errors?Object.values(q.errors)[0]:void 0;if(c!==void 0)throw c;if(q.actionData)return Object.values(q.actionData)[0];if(q.loaderData){var X;let J=Object.values(q.loaderData)[0];return(X=q.activeDeferreds)!=null&&X[Y.route.id]&&(J[l]=q.activeDeferreds[Y.route.id]),J}}async function b(E,x,S,P,w){k(E.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(we(E.method.toLowerCase()))return await m(E,S,w||yt(S,x),P,w!=null);let g=await _(E,S,P,w);return at(g)?g:z({},g,{actionData:null,actionHeaders:{}})}catch(g){if(Gr(g)){if(g.type===G.error)throw g.response;return g.response}if(Xr(g))return g;throw g}}async function m(E,x,S,P,w){let g;if(!S.route.action&&!S.route.lazy){let Y=oe(405,{method:E.method,pathname:new URL(E.url).pathname,routeId:S.route.id});if(w)throw Y;g={type:G.error,error:Y}}else g=await te("action",E,S,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:w,requestContext:P}),E.signal.aborted&&R(E,w,d);if(ke(g))throw new Response(null,{status:g.status,headers:{Location:g.location}});if(Ne(g)){let Y=oe(400,{type:"defer-action"});if(w)throw Y;g={type:G.error,error:Y}}if(w){if(Be(g))throw g.error;return{matches:[S],loaderData:{},actionData:{[S.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(Be(g)){let Y=nt(x,S.route.id),q=await _(E,x,P,void 0,{[Y.route.id]:g.error});return z({},q,{statusCode:rt(g.error)?g.error.status:500,actionData:null,actionHeaders:z({},g.headers?{[S.route.id]:g.headers}:{})})}let F=new Request(E.url,{headers:E.headers,redirect:E.redirect,signal:E.signal}),V=await _(F,x,P);return z({},V,g.statusCode?{statusCode:g.statusCode}:{},{actionData:{[S.route.id]:g.data},actionHeaders:z({},g.headers?{[S.route.id]:g.headers}:{})})}async function _(E,x,S,P,w){let g=P!=null;if(g&&!(P!=null&&P.route.loader)&&!(P!=null&&P.route.lazy))throw oe(400,{method:E.method,pathname:new URL(E.url).pathname,routeId:P==null?void 0:P.route.id});let V=(P?[P]:W(x,Object.keys(w||{})[0])).filter(J=>J.route.loader||J.route.lazy);if(V.length===0)return{matches:x,loaderData:x.reduce((J,Z)=>Object.assign(J,{[Z.route.id]:null}),{}),errors:w||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let Y=await Promise.all([...V.map(J=>te("loader",E,J,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:g,requestContext:S}))]);E.signal.aborted&&R(E,g,d);let q=new Map,c=Te(x,V,Y,w,q),X=new Set(V.map(J=>J.route.id));return x.forEach(J=>{X.has(J.route.id)||(c.loaderData[J.route.id]=null)}),z({},c,{matches:x,activeDeferreds:q.size>0?Object.fromEntries(q.entries()):null})}return{dataRoutes:i,query:p,queryRoute:h}}function v(e,t,r){return z({},t,{statusCode:rt(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function R(e,t,r){if(r.v7_throwAbortReason&&e.signal.reason!==void 0)throw e.signal.reason;let n=t?"queryRoute":"query";throw new Error(n+"() call aborted: "+e.method+" "+e.url)}function C(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function U(e,t,r,n,a,d,i,p){let h,b;if(i){h=[];for(let _ of t)if(h.push(_),_.route.id===i){b=_;break}}else h=t,b=t[t.length-1];let m=nr(a||".",rr(h,d),Se(e.pathname,r)||e.pathname,p==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&b&&b.route.index&&!fr(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ie([r,m.pathname])),be(m)}function L(e,t,r,n){if(!n||!C(n))return{path:r};if(n.formMethod&&!cr(n.formMethod))return{path:r,error:oe(405,{method:n.formMethod})};let a=()=>({path:r,error:oe(400,{type:"invalid-body"})}),d=n.formMethod||"get",i=e?d.toUpperCase():d.toLowerCase(),p=_r(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!we(i))return a();let E=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,S)=>{let[P,w]=S;return""+x+P+"="+w+`
|
|
20
|
+
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:void 0,text:E}}}else if(n.formEncType==="application/json"){if(!we(i))return a();try{let E=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}k(typeof FormData=="function","FormData is not available in this environment");let h,b;if(n.formData)h=Re(n.formData),b=n.formData;else if(n.body instanceof FormData)h=Re(n.body),b=n.body;else if(n.body instanceof URLSearchParams)h=n.body,b=Ee(h);else if(n.body==null)h=new URLSearchParams,b=new FormData;else try{h=new URLSearchParams(n.body),b=Ee(h)}catch{return a()}let m={formMethod:i,formAction:p,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:b,json:void 0,text:void 0};if(we(m.formMethod))return{path:r,submission:m};let _=ie(r);return t&&_.search&&fr(_.search)&&h.append("index",""),_.search="?"+h,{path:be(_),submission:m}}function W(e,t){let r=e;if(t){let n=e.findIndex(a=>a.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function Q(e,t,r,n,a,d,i,p,h,b,m,_,E,x,S,P){let w=P?Object.values(P)[0]:S?Object.values(S)[0]:void 0,g=e.createURL(t.location),F=e.createURL(a),V=P?Object.keys(P)[0]:void 0,q=W(r,V).filter((X,J)=>{let{route:Z}=X;if(Z.lazy)return!0;if(Z.loader==null)return!1;if(d)return Z.loader.hydrate?!0:t.loaderData[Z.id]===void 0&&(!t.errors||t.errors[Z.id]===void 0);if(H(t.loaderData,t.matches[J],X)||p.some(Ce=>Ce===X.route.id))return!0;let _e=t.matches[J],xe=X;return T(X,z({currentUrl:g,currentParams:_e.params,nextUrl:F,nextParams:xe.params},n,{actionResult:w,defaultShouldRevalidate:i||g.pathname+g.search===F.pathname+F.search||g.search!==F.search||$(_e,xe)}))}),c=[];return m.forEach((X,J)=>{if(d||!r.some(ot=>ot.route.id===X.routeId)||b.has(J))return;let Z=Pe(E,X.path,x);if(!Z){c.push({key:J,routeId:X.routeId,path:X.path,matches:null,match:null,controller:null});return}let _e=t.fetchers.get(J),xe=yt(Z,X.path),Ce=!1;_.has(J)?Ce=!1:h.includes(J)?Ce=!0:_e&&_e.state!=="idle"&&_e.data===void 0?Ce=i:Ce=T(xe,z({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:F,nextParams:r[r.length-1].params},n,{actionResult:w,defaultShouldRevalidate:i})),Ce&&c.push({key:J,routeId:X.routeId,path:X.path,matches:Z,match:xe,controller:new AbortController})}),[q,c]}function H(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function $(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function T(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function ne(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];k(a,"No route found in manifest");let d={};for(let i in n){let h=a[i]!==void 0&&i!=="hasErrorBoundary";se(!h,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!h&&!Er.has(i)&&(d[i]=n[i])}Object.assign(a,d),Object.assign(a,z({},t(a),{lazy:void 0}))}async function te(e,t,r,n,a,d,i,p,h){h===void 0&&(h={});let b,m,_,E=P=>{let w,g=new Promise((F,V)=>w=V);return _=()=>w(),t.signal.addEventListener("abort",_),Promise.race([P({request:t,params:r.params,context:h.requestContext}),g])};try{let P=r.route[e];if(r.route.lazy)if(P){let w,g=await Promise.all([E(P).catch(F=>{w=F}),ne(r.route,d,a)]);if(w)throw w;m=g[0]}else if(await ne(r.route,d,a),P=r.route[e],P)m=await E(P);else if(e==="action"){let w=new URL(t.url),g=w.pathname+w.search;throw oe(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:G.data,data:void 0};else if(P)m=await E(P);else{let w=new URL(t.url),g=w.pathname+w.search;throw oe(404,{pathname:g})}k(m!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(P){b=G.error,m=P}finally{_&&t.signal.removeEventListener("abort",_)}if(at(m)){let P=m.status;if(Lr.has(P)){let g=m.headers.get("Location");if(k(g,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ye.test(g))g=U(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,g,p);else if(!h.isStaticRequest){let F=new URL(t.url),V=g.startsWith("//")?new URL(F.protocol+g):new URL(g),Y=Se(V.pathname,i)!=null;V.origin===F.origin&&Y&&(g=V.pathname+V.search+V.hash)}if(h.isStaticRequest)throw m.headers.set("Location",g),m;return{type:G.redirect,status:P,location:g,revalidate:m.headers.get("X-Remix-Revalidate")!==null,reloadDocument:m.headers.get("X-Remix-Reload-Document")!==null}}if(h.isRouteRequest)throw{type:b===G.error?G.error:G.data,response:m};let w;try{let g=m.headers.get("Content-Type");g&&/\bapplication\/json\b/.test(g)?m.body==null?w=null:w=await m.json():w=await m.text()}catch(g){return{type:G.error,error:g}}return b===G.error?{type:b,error:new Tt(P,m.statusText,w),headers:m.headers}:{type:G.data,data:w,statusCode:m.status,headers:m.headers}}if(b===G.error)return{type:b,error:m};if(qr(m)){var x,S;return{type:G.deferred,deferredData:m,statusCode:(x=m.init)==null?void 0:x.status,headers:((S=m.init)==null?void 0:S.headers)&&new Headers(m.init.headers)}}return{type:G.data,data:m}}function ce(e,t,r,n){let a=e.createURL(_r(t)).toString(),d={signal:r};if(n&&we(n.formMethod)){let{formMethod:i,formEncType:p}=n;d.method=i.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(n.json)):p==="text/plain"?d.body=n.text:p==="application/x-www-form-urlencoded"&&n.formData?d.body=Re(n.formData):d.body=n.formData}return new Request(a,d)}function Re(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?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 Te(e,t,r,n,a){let d={},i=null,p,h=!1,b={};return r.forEach((m,_)=>{let E=t[_].route.id;if(k(!ke(m),"Cannot handle redirect results in processLoaderData"),Be(m)){let x=nt(e,E),S=m.error;n&&(S=Object.values(n)[0],n=void 0),i=i||{},i[x.route.id]==null&&(i[x.route.id]=S),d[E]=void 0,h||(h=!0,p=rt(m.error)?m.error.status:500),m.headers&&(b[E]=m.headers)}else Ne(m)?(a.set(E,m.deferredData),d[E]=m.deferredData.data):d[E]=m.data,m.statusCode!=null&&m.statusCode!==200&&!h&&(p=m.statusCode),m.headers&&(b[E]=m.headers)}),n&&(i=n,d[Object.keys(n)[0]]=void 0),{loaderData:d,errors:i,statusCode:p||200,loaderHeaders:b}}function pe(e,t,r,n,a,d,i,p){let{loaderData:h,errors:b}=Te(t,r,n,a,p);for(let m=0;m<d.length;m++){let{key:_,match:E,controller:x}=d[m];k(i!==void 0&&i[m]!==void 0,"Did not find corresponding fetcher result");let S=i[m];if(!(x&&x.signal.aborted))if(Be(S)){let P=nt(e.matches,E==null?void 0:E.route.id);b&&b[P.route.id]||(b=z({},b,{[P.route.id]:S.error})),e.fetchers.delete(_)}else if(ke(S))k(!1,"Unhandled fetcher revalidation redirect");else if(Ne(S))k(!1,"Unhandled fetcher deferred data");else{let P=ze(S.data);e.fetchers.set(_,P)}}return{loaderData:h,errors:b}}function Ae(e,t,r,n){let a=z({},t);for(let d of r){let i=d.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&d.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function nt(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function It(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function oe(e,t){let{pathname:r,routeId:n,method:a,type:d}=t===void 0?{}:t,i="Unknown Server Error",p="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?p="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":d==="defer-action"?p="defer() is not supported in actions":d==="invalid-body"&&(p="Unable to encode submission body")):e===403?(i="Forbidden",p='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",p='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?p="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(p='Invalid request method "'+a.toUpperCase()+'"')),new Tt(e||500,i,new Error(p),!0)}function Mr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ke(r))return{result:r,idx:t}}}function _r(e){let t=typeof e=="string"?ie(e):e;return be(z({},t,{hash:""}))}function Yr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ne(e){return e.type===G.deferred}function Be(e){return e.type===G.error}function ke(e){return(e&&e.type)===G.redirect}function qr(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function at(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function Xr(e){if(!at(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Gr(e){return e&&at(e.response)&&(e.type===G.data||e.type===G.error)}function cr(e){return sr.has(e.toLowerCase())}function we(e){return jt.has(e.toLowerCase())}async function Or(e,t,r,n,a,d){for(let i=0;i<r.length;i++){let p=r[i],h=t[i];if(!h)continue;let b=e.find(_=>_.route.id===h.route.id),m=b!=null&&!$(b,h)&&(d&&d[h.route.id])!==void 0;if(Ne(p)&&(a||m)){let _=n[i];k(_,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ur(p,_,a).then(E=>{E&&(r[i]=E||r[i])})}}}async function Ur(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:G.data,data:e.deferredData.unwrappedData}}catch(a){return{type:G.error,error:a}}return{type:G.data,data:e.deferredData.data}}}function fr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function yt(e,t){let r=typeof t=="string"?ie(t).search:t.search;if(e[e.length-1].route.index&&fr(r||""))return e[e.length-1];let n=tr(e);return n[n.length-1]}function Tr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:d,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(d!=null)return{formMethod:t,formAction:r,formEncType:n,formData:d,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function hr(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qr(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 bt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Zr(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}}function ze(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function en(e,t){try{let r=e.sessionStorage.getItem(Ft);if(r){let n=JSON.parse(r);for(let[a,d]of Object.entries(n||{}))d&&Array.isArray(d)&&t.set(a,new Set(d||[]))}}catch{}}function tn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Ft,JSON.stringify(r))}catch(n){se(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=module-react-router.07bc98eb.js.map
|