@techdocs/cli 1.8.0-next.1 → 1.8.0-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 +22 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{4109.703c7257.chunk.js → 4109.02fdecdd.chunk.js} +2 -2
- package/dist/embedded-app/static/4109.02fdecdd.chunk.js.map +1 -0
- package/dist/embedded-app/static/{main.58e94ce8.js → main.2d90956b.js} +3 -3
- package/dist/embedded-app/static/main.2d90956b.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.8011e8db.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.8011e8db.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.5b9ed471.js +22 -0
- package/dist/embedded-app/static/module-react-router.5b9ed471.js.map +1 -0
- package/dist/embedded-app/static/{runtime.58e94ce8.js → runtime.2d90956b.js} +2 -2
- package/dist/embedded-app/static/{runtime.58e94ce8.js.map → runtime.2d90956b.js.map} +1 -1
- package/dist/embedded-app/static/vendor.2d90956b.js +164 -0
- package/dist/embedded-app/static/vendor.2d90956b.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/4109.703c7257.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.58e94ce8.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.48ea1f60.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.48ea1f60.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.67245b2c.js +0 -22
- package/dist/embedded-app/static/module-react-router.67245b2c.js.map +0 -1
- package/dist/embedded-app/static/vendor.58e94ce8.js +0 -164
- package/dist/embedded-app/static/vendor.58e94ce8.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[242],{73557:function(kr,zt,Qe){var J;Qe.d(zt,{AW:function(){return Ot},F0:function(){return ct},Fg:function(){return Ut},GV:function(){return re},TH:function(){return Le},UO:function(){return Jt},Us:function(){return le},V$:function(){return Et},VA:function(){return ut},WU:function(){return Rt},Z5:function(){return tr},is:function(){return ze},j3:function(){return er},oQ:function(){return ve},pC:function(){return bt},s0:function(){return Ee}});var y=Qe(2784),z=Qe(84800);/**
|
|
2
|
-
* React Router v6.19.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 Ce(){return Ce=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var v=arguments[s];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(i[b]=v[b])}return i},Ce.apply(this,arguments)}const it=y.createContext(null),kt=y.createContext(null),k=y.createContext(null),le=y.createContext(null),Ie=y.createContext(null),fe=y.createContext({outlet:null,matches:[],isDataRoute:!1}),ge=y.createContext(null);function ve(i,s){let{relative:v}=s===void 0?{}:s;re()||(0,z.J0)(!1);let{basename:b,navigator:C}=y.useContext(le),{hash:M,pathname:j,search:W}=Rt(i,{relative:v}),O=j;return b!=="/"&&(O=j==="/"?b:(0,z.RQ)([b,j])),C.createHref({pathname:O,search:W,hash:M})}function re(){return y.useContext(Ie)!=null}function Le(){return re()||(0,z.J0)(!1),y.useContext(Ie).location}function Q(){return React.useContext(Ie).navigationType}function pr(i){re()||UNSAFE_invariant(!1);let{pathname:s}=Le();return React.useMemo(()=>matchPath(i,s),[s,i])}const mr=null;function Fe(i){y.useContext(le).static||y.useLayoutEffect(i)}function Ee(){let{isDataRoute:i}=y.useContext(fe);return i?qt():Ht()}function Ht(){re()||(0,z.J0)(!1);let i=y.useContext(it),{basename:s,navigator:v}=y.useContext(le),{matches:b}=y.useContext(fe),{pathname:C}=Le(),M=JSON.stringify((0,z.Zq)(b).map(O=>O.pathnameBase)),j=y.useRef(!1);return Fe(()=>{j.current=!0}),y.useCallback(function(O,V){if(V===void 0&&(V={}),!j.current)return;if(typeof O=="number"){v.go(O);return}let X=(0,z.pC)(O,JSON.parse(M),C,V.relative==="path");i==null&&s!=="/"&&(X.pathname=X.pathname==="/"?s:(0,z.RQ)([s,X.pathname])),(V.replace?v.replace:v.push)(X,V.state,V)},[s,v,M,C,i])}const lt=y.createContext(null);function Wt(){return React.useContext(lt)}function bt(i){let s=y.useContext(fe).outlet;return s&&y.createElement(lt.Provider,{value:i},s)}function Jt(){let{matches:i}=y.useContext(fe),s=i[i.length-1];return s?s.params:{}}function Rt(i,s){let{relative:v}=s===void 0?{}:s,{matches:b}=y.useContext(fe),{pathname:C}=Le(),M=JSON.stringify((0,z.Zq)(b).map((j,W)=>W===b.length-1?j.pathname:j.pathnameBase));return y.useMemo(()=>(0,z.pC)(i,JSON.parse(M),C,v==="path"),[i,M,C,v])}function Et(i,s){return wt(i,s)}function wt(i,s,v){re()||(0,z.J0)(!1);let{navigator:b}=y.useContext(le),{matches:C}=y.useContext(fe),M=C[C.length-1],j=M?M.params:{},W=M?M.pathname:"/",O=M?M.pathnameBase:"/",V=M&&M.route,X=Le(),Y;if(s){var ee;let pe=typeof s=="string"?(0,z.cP)(s):s;O==="/"||(ee=pe.pathname)!=null&&ee.startsWith(O)||(0,z.J0)(!1),Y=pe}else Y=X;let ie=Y.pathname||"/",he=O==="/"?ie:ie.slice(O.length)||"/",Oe=(0,z.fp)(i,{pathname:he}),Xe=Dt(Oe&&Oe.map(pe=>Object.assign({},pe,{params:Object.assign({},j,pe.params),pathname:(0,z.RQ)([O,b.encodeLocation?b.encodeLocation(pe.pathname).pathname:pe.pathname]),pathnameBase:pe.pathnameBase==="/"?O:(0,z.RQ)([O,b.encodeLocation?b.encodeLocation(pe.pathnameBase).pathname:pe.pathnameBase])})),C,v);return s&&Xe?y.createElement(Ie.Provider,{value:{location:Ce({pathname:"/",search:"",hash:"",state:null,key:"default"},Y),navigationType:z.aU.Pop}},Xe):Xe}function Kt(){let i=Gt(),s=(0,z.WK)(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),v=i instanceof Error?i.stack:null,b="rgba(200,200,200, 0.5)",C={padding:"0.5rem",backgroundColor:b},M={padding:"2px 4px",backgroundColor:b},j=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,j)}const $t=y.createElement(Kt,null);class xt 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||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?y.createElement(fe.Provider,{value:this.props.routeContext},y.createElement(ge.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Vt(i){let{routeContext:s,match:v,children:b}=i,C=y.useContext(it);return C&&C.static&&C.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(C.staticContext._deepestRenderedBoundaryId=v.route.id),y.createElement(fe.Provider,{value:s},b)}function Dt(i,s,v){var b;if(s===void 0&&(s=[]),v===void 0&&(v=null),i==null){var C;if((C=v)!=null&&C.errors)i=v.matches;else return null}let M=i,j=(b=v)==null?void 0:b.errors;if(j!=null){let W=M.findIndex(O=>O.route.id&&(j==null?void 0:j[O.route.id]));W>=0||(0,z.J0)(!1),M=M.slice(0,Math.min(M.length,W+1))}return M.reduceRight((W,O,V)=>{let X=O.route.id?j==null?void 0:j[O.route.id]:null,Y=null;v&&(Y=O.route.errorElement||$t);let ee=s.concat(M.slice(0,V+1)),ie=()=>{let he;return X?he=Y:O.route.Component?he=y.createElement(O.route.Component,null):O.route.element?he=O.route.element:he=W,y.createElement(Vt,{match:O,routeContext:{outlet:W,matches:ee,isDataRoute:v!=null},children:he})};return v&&(O.route.ErrorBoundary||O.route.errorElement||V===0)?y.createElement(xt,{location:v.location,revalidation:v.revalidation,component:Y,error:X,children:ie(),routeContext:{outlet:null,matches:ee,isDataRoute:!0}}):ie()},null)}var Ze=function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i}(Ze||{}),ue=function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i}(ue||{});function gr(i){return i+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function st(i){let s=y.useContext(it);return s||(0,z.J0)(!1),s}function Pe(i){let s=y.useContext(kt);return s||(0,z.J0)(!1),s}function Yt(i){let s=y.useContext(fe);return s||(0,z.J0)(!1),s}function we(i){let s=Yt(i),v=s.matches[s.matches.length-1];return v.route.id||(0,z.J0)(!1),v.route.id}function Qt(){return we(ue.UseRouteId)}function vr(){return Pe(ue.UseNavigation).navigation}function Pt(){let i=st(Ze.UseRevalidator),s=Pe(ue.UseRevalidator);return React.useMemo(()=>({revalidate:i.router.revalidate,state:s.revalidation}),[i.router.revalidate,s.revalidation])}function St(){let{matches:i,loaderData:s}=Pe(ue.UseMatches);return React.useMemo(()=>i.map(v=>UNSAFE_convertRouteMatchToUiMatch(v,s)),[i,s])}function Zt(){let i=Pe(ue.UseLoaderData),s=we(ue.UseLoaderData);if(i.errors&&i.errors[s]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+s+")");return}return i.loaderData[s]}function Hr(i){return Pe(ue.UseRouteLoaderData).loaderData[i]}function Be(){let i=Pe(ue.UseActionData),s=we(ue.UseLoaderData);return i.actionData?i.actionData[s]:void 0}function Gt(){var i;let s=y.useContext(ge),v=Pe(ue.UseRouteError),b=we(ue.UseRouteError);return s||((i=v.errors)==null?void 0:i[b])}function Xt(){let i=React.useContext(k);return i==null?void 0:i._data}function yr(){let i=React.useContext(k);return i==null?void 0:i._error}let br=0;function Ct(i){let{router:s,basename:v}=st(Ze.UseBlocker),b=Pe(ue.UseBlocker),[C,M]=React.useState(""),j=React.useCallback(W=>{if(typeof i!="function")return!!i;if(v==="/")return i(W);let{currentLocation:O,nextLocation:V,historyAction:X}=W;return i({currentLocation:Ce({},O,{pathname:stripBasename(O.pathname,v)||O.pathname}),nextLocation:Ce({},V,{pathname:stripBasename(V.pathname,v)||V.pathname}),historyAction:X})},[v,i]);return React.useEffect(()=>{let W=String(++br);return M(W),()=>s.deleteBlocker(W)},[s]),React.useEffect(()=>{C!==""&&s.getBlocker(C,j)},[s,C,j]),C&&b.blockers.has(C)?b.blockers.get(C):IDLE_BLOCKER}function qt(){let{router:i}=st(Ze.UseNavigateStable),s=we(ue.UseNavigateStable),v=y.useRef(!1);return Fe(()=>{v.current=!0}),y.useCallback(function(C,M){M===void 0&&(M={}),v.current&&(typeof C=="number"?i.navigate(C):i.navigate(C,Ce({fromRouteId:s},M)))},[i,s])}const Lt={};function Rr(i,s,v){!s&&!Lt[i]&&(Lt[i]=!0)}const Er="startTransition",Ge=(J||(J=Qe.t(y,2)))[Er];function Wr(i){let{fallbackElement:s,router:v,future:b}=i,[C,M]=React.useState(v.state),{v7_startTransition:j}=b||{},W=React.useCallback(Y=>{j&&Ge?Ge(()=>M(Y)):M(Y)},[M,j]);React.useLayoutEffect(()=>v.subscribe(W),[v,W]);let O=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:Y=>v.navigate(Y),push:(Y,ee,ie)=>v.navigate(Y,{state:ee,preventScrollReset:ie==null?void 0:ie.preventScrollReset}),replace:(Y,ee,ie)=>v.navigate(Y,{replace:!0,state:ee,preventScrollReset:ie==null?void 0:ie.preventScrollReset})}),[v]),V=v.basename||"/",X=React.useMemo(()=>({router:v,navigator:O,static:!1,basename:V}),[v,O,V]);return React.createElement(React.Fragment,null,React.createElement(it.Provider,{value:X},React.createElement(kt.Provider,{value:C},React.createElement(ct,{basename:V,location:C.location,navigationType:C.historyAction,navigator:O},C.initialized?React.createElement(Mt,{routes:v.routes,state:C}):s))),null)}function Mt(i){let{routes:s,state:v}=i;return wt(s,void 0,v)}function ut(i){let{basename:s,children:v,initialEntries:b,initialIndex:C,future:M}=i,j=y.useRef();j.current==null&&(j.current=(0,z.PP)({initialEntries:b,initialIndex:C,v5Compat:!0}));let W=j.current,[O,V]=y.useState({action:W.action,location:W.location}),{v7_startTransition:X}=M||{},Y=y.useCallback(ee=>{X&&Ge?Ge(()=>V(ee)):V(ee)},[V,X]);return y.useLayoutEffect(()=>W.listen(Y),[W,Y]),y.createElement(ct,{basename:s,children:v,location:O.location,navigationType:O.action,navigator:W})}function Ut(i){let{to:s,replace:v,state:b,relative:C}=i;re()||(0,z.J0)(!1);let{matches:M}=y.useContext(fe),{pathname:j}=Le(),W=Ee(),O=(0,z.pC)(s,(0,z.Zq)(M).map(X=>X.pathnameBase),j,C==="path"),V=JSON.stringify(O);return y.useEffect(()=>W(JSON.parse(V),{replace:v,state:b,relative:C}),[W,V,C,v,b]),null}function er(i){return bt(i.context)}function Ot(i){(0,z.J0)(!1)}function ct(i){let{basename:s="/",children:v=null,location:b,navigationType:C=z.aU.Pop,navigator:M,static:j=!1}=i;re()&&(0,z.J0)(!1);let W=s.replace(/^\/*/,"/"),O=y.useMemo(()=>({basename:W,navigator:M,static:j}),[W,M,j]);typeof b=="string"&&(b=(0,z.cP)(b));let{pathname:V="/",search:X="",hash:Y="",state:ee=null,key:ie="default"}=b,he=y.useMemo(()=>{let Oe=(0,z.Zn)(V,W);return Oe==null?null:{location:{pathname:Oe,search:X,hash:Y,state:ee,key:ie},navigationType:C}},[W,V,X,Y,ee,ie,C]);return he==null?null:y.createElement(le.Provider,{value:O},y.createElement(Ie.Provider,{children:v,value:he}))}function tr(i){let{children:s,location:v}=i;return Et(ze(s),v)}function wr(i){let{children:s,errorElement:v,resolve:b}=i;return React.createElement(Ne,{resolve:b,errorElement:v},React.createElement(Tt,null,s))}var ce=function(i){return i[i.pending=0]="pending",i[i.success=1]="success",i[i.error=2]="error",i}(ce||{});const rr=new Promise(()=>{});class Ne 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:b}=this.props,C=null,M=ce.pending;if(!(b instanceof Promise))M=ce.success,C=Promise.resolve(),Object.defineProperty(C,"_tracked",{get:()=>!0}),Object.defineProperty(C,"_data",{get:()=>b});else if(this.state.error){M=ce.error;let j=this.state.error;C=Promise.reject().catch(()=>{}),Object.defineProperty(C,"_tracked",{get:()=>!0}),Object.defineProperty(C,"_error",{get:()=>j})}else b._tracked?(C=b,M=C._error!==void 0?ce.error:C._data!==void 0?ce.success:ce.pending):(M=ce.pending,Object.defineProperty(b,"_tracked",{get:()=>!0}),C=b.then(j=>Object.defineProperty(b,"_data",{get:()=>j}),j=>Object.defineProperty(b,"_error",{get:()=>j})));if(M===ce.error&&C._error instanceof z.X3)throw rr;if(M===ce.error&&!v)throw C._error;if(M===ce.error)return y.createElement(k.Provider,{value:C,children:v});if(M===ce.success)return y.createElement(k.Provider,{value:C,children:s});throw C}}function Tt(i){let{children:s}=i,v=Xt(),b=typeof s=="function"?s(v):s;return React.createElement(React.Fragment,null,b)}function ze(i,s){s===void 0&&(s=[]);let v=[];return y.Children.forEach(i,(b,C)=>{if(!y.isValidElement(b))return;let M=[...s,C];if(b.type===y.Fragment){v.push.apply(v,ze(b.props.children,M));return}b.type!==Ot&&(0,z.J0)(!1),!b.props.index||!b.props.children||(0,z.J0)(!1);let j={id:b.props.id||M.join("-"),caseSensitive:b.props.caseSensitive,element:b.props.element,Component:b.props.Component,index:b.props.index,path:b.props.path,loader:b.props.loader,action:b.props.action,errorElement:b.props.errorElement,ErrorBoundary:b.props.ErrorBoundary,hasErrorBoundary:b.props.ErrorBoundary!=null||b.props.errorElement!=null,shouldRevalidate:b.props.shouldRevalidate,handle:b.props.handle,lazy:b.props.lazy};b.props.children&&(j.children=ze(b.props.children,M)),v.push(j)}),v}function nr(i){return Dt(i)}function xr(i){let s={hasErrorBoundary:i.ErrorBoundary!=null||i.errorElement!=null};return i.Component&&Object.assign(s,{element:React.createElement(i.Component),Component:void 0}),i.ErrorBoundary&&Object.assign(s,{errorElement:React.createElement(i.ErrorBoundary),ErrorBoundary:void 0}),s}function Dr(i,s){return createRouter({basename:s==null?void 0:s.basename,future:Ce({},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:i,mapRouteProperties:xr}).initialize()}},84800:function(kr,zt,Qe){Qe.d(zt,{Ep:function(){return ve},Gn:function(){return ue},J0:function(){return k},PP:function(){return Ce},RQ:function(){return Be},WK:function(){return ut},X3:function(){return Ct},Zn:function(){return we},Zq:function(){return St},aU:function(){return y},cP:function(){return re},fp:function(){return Ee},i3:function(){return Qt},pC:function(){return Zt}});/**
|
|
11
|
-
* @remix-run/router v1.12.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 J(){return J=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},J.apply(this,arguments)}var y;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(y||(y={}));const z="popstate";function Ce(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((E,w)=>x(E,typeof E=="string"?null:E.state,w===0?"default":void 0));let u=h(r==null?a.length-1:r),l=y.Pop,f=null;function h(E){return Math.min(Math.max(E,0),a.length-1)}function m(){return a[u]}function x(E,w,P){w===void 0&&(w=null);let g=ge(a?m().pathname:"/",E,w,P);return le(g.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(E)),g}function R(E){return typeof E=="string"?E:ve(E)}return{get index(){return u},get action(){return l},get location(){return m()},createHref:R,createURL(E){return new URL(R(E),"http://localhost")},encodeLocation(E){let w=typeof E=="string"?re(E):E;return{pathname:w.pathname||"",search:w.search||"",hash:w.hash||""}},push(E,w){l=y.Push;let P=x(E,w);u+=1,a.splice(u,a.length,P),n&&f&&f({action:l,location:P,delta:1})},replace(E,w){l=y.Replace;let P=x(E,w);a[u]=P,n&&f&&f({action:l,location:P,delta:0})},go(E){l=y.Pop;let w=h(u+E),P=a[w];u=w,f&&f({action:l,location:P,delta:E})},listen(E){return f=E,()=>{f=null}}}}function it(e){e===void 0&&(e={});function t(n,a){let{pathname:u,search:l,hash:f}=n.location;return ge("",{pathname:u,search:l,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ve(a)}return Le(t,r,null,e)}function kt(e){e===void 0&&(e={});function t(a,u){let{pathname:l="/",search:f="",hash:h=""}=re(a.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),ge("",{pathname:l,search:f,hash:h},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function r(a,u){let l=a.document.querySelector("base"),f="";if(l&&l.getAttribute("href")){let h=a.location.href,m=h.indexOf("#");f=m===-1?h:h.slice(0,m)}return f+"#"+(typeof u=="string"?u:ve(u))}function n(a,u){le(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(u)+")")}return Le(t,r,n,e)}function k(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function le(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ie(){return Math.random().toString(36).substr(2,8)}function fe(e,t){return{usr:e.state,key:e.key,idx:t}}function ge(e,t,r,n){return r===void 0&&(r=null),J({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?re(t):t,{state:r,key:t&&t.key||n||Ie()})}function ve(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 re(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 Le(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:u=!1}=n,l=a.history,f=y.Pop,h=null,m=x();m==null&&(m=0,l.replaceState(J({},l.state,{idx:m}),""));function x(){return(l.state||{idx:null}).idx}function R(){f=y.Pop;let g=x(),_=g==null?null:g-m;m=g,h&&h({action:f,location:P.location,delta:_})}function S(g,_){f=y.Push;let K=ge(P.location,g,_);r&&r(K,g),m=x()+1;let F=fe(K,m),d=P.createHref(K);try{l.pushState(F,"",d)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;a.location.assign(d)}u&&h&&h({action:f,location:P.location,delta:1})}function E(g,_){f=y.Replace;let K=ge(P.location,g,_);r&&r(K,g),m=x();let F=fe(K,m),d=P.createHref(K);l.replaceState(F,"",d),u&&h&&h({action:f,location:P.location,delta:0})}function w(g){let _=a.location.origin!=="null"?a.location.origin:a.location.href,K=typeof g=="string"?g:ve(g);return k(_,"No window.location.(origin|href) available to create URL for href: "+K),new URL(K,_)}let P={get action(){return f},get location(){return e(a,l)},listen(g){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(z,R),h=g,()=>{a.removeEventListener(z,R),h=null}},createHref(g){return t(a,g)},createURL:w,encodeLocation(g){let _=w(g);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:S,replace:E,go(g){return l.go(g)}};return P}var Q;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q||(Q={}));const pr=new Set(["lazy","caseSensitive","path","id","index","children"]);function mr(e){return e.index===!0}function Fe(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,u)=>{let l=[...r,u],f=typeof a.id=="string"?a.id:l.join("-");if(k(a.index!==!0||!a.children,"Cannot specify children on an index route"),k(!n[f],'Found a route id collision on id "'+f+`". Route id's must be globally unique within Data Router usages`),mr(a)){let h=J({},a,t(a),{id:f});return n[f]=h,h}else{let h=J({},a,t(a),{id:f,children:void 0});return n[f]=h,a.children&&(h.children=Fe(a.children,t,l,n)),h}})}function Ee(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?re(t):t,a=we(n.pathname||"/",r);if(a==null)return null;let u=lt(e);bt(u);let l=null;for(let f=0;l==null&&f<u.length;++f)l=Ze(u[f],Pe(a));return l}function Ht(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 lt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(u,l,f)=>{let h={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:l,route:u};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 m=Be([n,h.relativePath]),x=r.concat(h);u.children&&u.children.length>0&&(k(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),lt(u.children,t,x,m)),!(u.path==null&&!u.index)&&t.push({path:m,score:Vt(m,u.index),routesMeta:x})};return e.forEach((u,l)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))a(u,l);else for(let h of Wt(u.path))a(u,l,h)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return a?[u,""]:[u];let l=Wt(n.join("/")),f=[];return f.push(...l.map(h=>h===""?u:[u,h].join("/"))),a&&f.push(...l),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function bt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Dt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Jt=/^:\w+$/,Rt=3,Et=2,wt=1,Kt=10,$t=-2,xt=e=>e==="*";function Vt(e,t){let r=e.split("/"),n=r.length;return r.some(xt)&&(n+=$t),t&&(n+=Et),r.filter(a=>!xt(a)).reduce((a,u)=>a+(Jt.test(u)?Rt:u===""?wt:Kt),n)}function Dt(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 Ze(e,t){let{routesMeta:r}=e,n={},a="/",u=[];for(let l=0;l<r.length;++l){let f=r[l],h=l===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",x=gr({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m);if(!x)return null;Object.assign(n,x.params);let R=f.route;u.push({params:n,pathname:Be([a,x.pathname]),pathnameBase:Gt(Be([a,x.pathnameBase])),route:R}),x.pathnameBase!=="/"&&(a=Be([a,x.pathnameBase]))}return u}function ue(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(le(!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=l=>l==null?"":typeof l=="string"?l:String(l),u=r.split(/\/+/).map((l,f,h)=>{if(f===h.length-1&&l==="*")return a(t["*"]);const x=l.match(/^:(\w+)(\??)$/);if(x){const[,R,S]=x;let E=t[R];return k(S==="?"||E!=null,'Missing ":'+R+'" param'),a(E)}return l.replace(/\?$/g,"")}).filter(l=>!!l);return n+u.join("/")}function gr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=st(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let u=a[0],l=u.replace(/(.)\/+$/,"$1"),f=a.slice(1);return{params:n.reduce((m,x,R)=>{let{paramName:S,isOptional:E}=x;if(S==="*"){let P=f[R]||"";l=u.slice(0,u.length-P.length).replace(/(.)\/+$/,"$1")}const w=f[R];return E&&!w?m[S]=void 0:m[S]=Yt(w||"",S),m},{}),pathname:u,pathnameBase:l,pattern:e}}function st(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),le(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,(l,f,h)=>(n.push({paramName:f,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 Pe(e){try{return decodeURI(e)}catch(t){return le(!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 Yt(e,t){try{return decodeURIComponent(e)}catch(r){return le(!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 we(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 Qt(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?re(e):e;return{pathname:r?r.startsWith("/")?r:vr(r,t):t,search:Xt(n),hash:yr(a)}}function vr(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 Pt(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 St(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Zt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=re(e):(a=J({},e),k(!a.pathname||!a.pathname.includes("?"),Pt("?","pathname","search",a)),k(!a.pathname||!a.pathname.includes("#"),Pt("#","pathname","hash",a)),k(!a.search||!a.search.includes("#"),Pt("#","search","hash",a)));let u=e===""||a.pathname==="",l=u?"/":a.pathname,f;if(l==null)f=r;else if(n){let R=t[t.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let S=l.split("/");for(;S[0]==="..";)S.shift(),R.pop();a.pathname=S.join("/")}f="/"+R.join("/")}else{let R=t.length-1;if(l.startsWith("..")){let S=l.split("/");for(;S[0]==="..";)S.shift(),R-=1;a.pathname=S.join("/")}f=R>=0?t[R]:"/"}let h=Qt(a,f),m=l&&l!=="/"&&l.endsWith("/"),x=(u||l===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(m||x)&&(h.pathname+="/"),h}function Hr(e){return e===""||e.pathname===""?"/":typeof e=="string"?re(e).pathname:e.pathname}const Be=e=>e.join("/").replace(/\/\/+/g,"/"),Gt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,br=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),J({},n,{headers:a}))};class Ct extends Error{}class qt{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((u,l)=>n=l),this.controller=new AbortController;let a=()=>n(new Ct("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((u,l)=>{let[f,h]=l;return Object.assign(u,{[f]:this.trackPromise(f,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 Ct)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 u=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:()=>u}),this.emit(!1,r),Promise.reject(u)}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(u=>{t.removeEventListener("abort",n),(u||this.done)&&a(u)})})}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]:Rr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Lt(e){return e instanceof Promise&&e._tracked===!0}function Rr(e){if(!Lt(e))return e;if(e._error)throw e._error;return e._data}const Er=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new qt(t,n)},Ge=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,J({},n,{headers:a}))},Wr=(e,t)=>{let r=Ge(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Mt{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 ut(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ut=["post","put","patch","delete"],er=new Set(Ut),Ot=["get",...Ut],ct=new Set(Ot),tr=new Set([301,302,303,307,308]),wr=new Set([307,308]),ce={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Tt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ze=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),nr="remix-router-transitions";function xr(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=c=>({hasErrorBoundary:o(c)})}else a=ze;let u={},l=Fe(e.routes,a,void 0,u),f,h=e.basename||"/",m=J({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),x=null,R=new Set,S=null,E=null,w=null,P=e.hydrationData!=null,g=Ee(l,e.history.location,h),_=null;if(g==null){let o=te(404,{pathname:e.history.location.pathname}),{matches:c,route:p}=jt(l);g=c,_={[p.id]:o}}let K=!g.some(o=>o.route.lazy)&&(!g.some(o=>o.route.loader)||e.hydrationData!=null),F,d={historyAction:e.history.action,location:e.history.location,matches:g,initialized:K,navigation:ce,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||_,fetchers:new Map,blockers:new Map},B=y.Pop,ne=!1,I,be=!1,xe=new Map,Me=null,tt=!1,We=!1,_t=[],At=[],ae=new Map,It=0,ht=-1,rt=new Map,Ue=new Set,nt=new Map,pt=new Map,Je=new Set,Ke=new Map,$e=new Map,lr=!1;function Xr(){if(x=e.history.listen(o=>{let{action:c,location:p,delta:D}=o;if(lr){lr=!1;return}le($e.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 L=Fr({currentLocation:d.location,nextLocation:p,historyAction:c});if(L&&D!=null){lr=!0,e.history.go(D*-1),Bt(L,{state:"blocked",location:p,proceed(){Bt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),e.history.go(D)},reset(){let N=new Map(d.blockers);N.set(L,Ne),me({blockers:N})}});return}return Ve(c,p)}),r){Zr(t,xe);let o=()=>Gr(t,xe);t.addEventListener("pagehide",o),Me=()=>t.removeEventListener("pagehide",o)}return d.initialized||Ve(y.Pop,d.location),F}function qr(){x&&x(),Me&&Me(),R.clear(),I&&I.abort(),d.fetchers.forEach((o,c)=>Ft(c)),d.blockers.forEach((o,c)=>Ir(c))}function en(o){return R.add(o),()=>R.delete(o)}function me(o,c){c===void 0&&(c={}),d=J({},d,o);let p=[],D=[];m.v7_fetcherPersist&&d.fetchers.forEach((L,N)=>{L.state==="idle"&&(Je.has(N)?D.push(N):p.push(N))}),[...R].forEach(L=>L(d,{deletedFetchers:D,unstable_viewTransitionOpts:c.viewTransitionOpts,unstable_flushSync:c.flushSync===!0})),m.v7_fetcherPersist&&(p.forEach(L=>d.fetchers.delete(L)),D.forEach(L=>Ft(L)))}function mt(o,c,p){var D,L;let{flushSync:N}=p===void 0?{}:p,A=d.actionData!=null&&d.navigation.formMethod!=null&&ye(d.navigation.formMethod)&&d.navigation.state==="loading"&&((D=o.state)==null?void 0:D._isRedirect)!==!0,T;c.actionData?Object.keys(c.actionData).length>0?T=c.actionData:T=null:A?T=d.actionData:T=null;let U=c.loaderData?pe(d.loaderData,c.loaderData,c.matches||[],c.errors):d.loaderData,$=d.blockers;$.size>0&&($=new Map($),$.forEach((Z,q)=>$.set(q,Ne)));let se=ne===!0||d.navigation.formMethod!=null&&ye(d.navigation.formMethod)&&((L=o.state)==null?void 0:L._isRedirect)!==!0;f&&(l=f,f=void 0),tt||B===y.Pop||(B===y.Push?e.history.push(o,o.state):B===y.Replace&&e.history.replace(o,o.state));let H;if(B===y.Pop){let Z=xe.get(d.location.pathname);Z&&Z.has(o.pathname)?H={currentLocation:d.location,nextLocation:o}:xe.has(o.pathname)&&(H={currentLocation:o,nextLocation:d.location})}else if(be){let Z=xe.get(d.location.pathname);Z?Z.add(o.pathname):(Z=new Set([o.pathname]),xe.set(d.location.pathname,Z)),H={currentLocation:d.location,nextLocation:o}}me(J({},c,{actionData:T,loaderData:U,historyAction:B,location:o,initialized:!0,navigation:ce,revalidation:"idle",restoreScrollPosition:Nr(o,c.matches||d.matches),preventScrollReset:se,blockers:$}),{viewTransitionOpts:H,flushSync:N===!0}),B=y.Pop,ne=!1,be=!1,tt=!1,We=!1,_t=[],At=[]}async function Ur(o,c){if(typeof o=="number"){e.history.go(o);return}let p=b(d.location,d.matches,h,m.v7_prependBasename,o,c==null?void 0:c.fromRouteId,c==null?void 0:c.relative),{path:D,submission:L,error:N}=C(m.v7_normalizeFormMethod,!1,p,c),A=d.location,T=ge(d.location,D,c&&c.state);T=J({},T,e.history.encodeLocation(T));let U=c&&c.replace!=null?c.replace:void 0,$=y.Push;U===!0?$=y.Replace:U===!1||L!=null&&ye(L.formMethod)&&L.formAction===d.location.pathname+d.location.search&&($=y.Replace);let se=c&&"preventScrollReset"in c?c.preventScrollReset===!0:void 0,H=(c&&c.unstable_flushSync)===!0,Z=Fr({currentLocation:A,nextLocation:T,historyAction:$});if(Z){Bt(Z,{state:"blocked",location:T,proceed(){Bt(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),Ur(o,c)},reset(){let q=new Map(d.blockers);q.set(Z,Ne),me({blockers:q})}});return}return await Ve($,T,{submission:L,pendingError:N,preventScrollReset:se,replace:c&&c.replace,enableViewTransition:c&&c.unstable_viewTransition,flushSync:H})}function tn(){if(sr(),me({revalidation:"loading"}),d.navigation.state!=="submitting"){if(d.navigation.state==="idle"){Ve(d.historyAction,d.location,{startUninterruptedRevalidation:!0});return}Ve(B||d.historyAction,d.navigation.location,{overrideNavigation:d.navigation})}}async function Ve(o,c,p){I&&I.abort(),I=null,B=o,tt=(p&&p.startUninterruptedRevalidation)===!0,dn(d.location,d.matches),ne=(p&&p.preventScrollReset)===!0,be=(p&&p.enableViewTransition)===!0;let D=f||l,L=p&&p.overrideNavigation,N=Ee(D,c,h),A=(p&&p.flushSync)===!0;if(!N){let q=te(404,{pathname:c.pathname}),{matches:de,route:Se}=jt(D);ur(),mt(c,{matches:de,loaderData:{},errors:{[Se.id]:q}},{flushSync:A});return}if(d.initialized&&!We&&Jr(d.location,c)&&!(p&&p.submission&&ye(p.submission.formMethod))){mt(c,{matches:N},{flushSync:A});return}I=new AbortController;let T=ee(e.history,c,I.signal,p&&p.submission),U,$;if(p&&p.pendingError)$={[qe(N).route.id]:p.pendingError};else if(p&&p.submission&&ye(p.submission.formMethod)){let q=await rn(T,c,p.submission,N,{replace:p.replace,flushSync:A});if(q.shortCircuited)return;U=q.pendingActionData,$=q.pendingActionError,L=ir(c,p.submission),A=!1,T=new Request(T.url,{signal:T.signal})}let{shortCircuited:se,loaderData:H,errors:Z}=await nn(T,c,N,L,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,A,U,$);se||(I=null,mt(c,J({matches:N},U?{actionData:U}:{},{loaderData:H,errors:Z})))}async function rn(o,c,p,D,L){L===void 0&&(L={}),sr();let N=Yr(c,p);me({navigation:N},{flushSync:L.flushSync===!0});let A,T=dt(D,c);if(!T.route.action&&!T.route.lazy)A={type:Q.error,error:te(405,{method:o.method,pathname:c.pathname,routeId:T.route.id})};else if(A=await Y("action",o,T,D,u,a,h),o.signal.aborted)return{shortCircuited:!0};if(He(A)){let U;return L&&L.replace!=null?U=L.replace:U=A.location===d.location.pathname+d.location.search,await gt(d,A,{submission:p,replace:U}),{shortCircuited:!0}}if(ke(A)){let U=qe(D,T.route.id);return(L&&L.replace)!==!0&&(B=y.Push),{pendingActionData:{},pendingActionError:{[U.route.id]:A.error}}}if(Te(A))throw te(400,{type:"defer-action"});return{pendingActionData:{[T.route.id]:A.data}}}async function nn(o,c,p,D,L,N,A,T,U,$){let se=D||ir(c,L),H=L||N||Mr(se),Z=f||l,[q,de]=j(e.history,d,p,H,c,We,_t,At,nt,Ue,Z,h,U,$);if(ur(G=>!(p&&p.some(Re=>Re.route.id===G))||q&&q.some(Re=>Re.route.id===G)),ht=++It,q.length===0&&de.length===0){let G=_r();return mt(c,J({matches:p,loaderData:{},errors:$||null},U?{actionData:U}:{},G?{fetchers:new Map(d.fetchers)}:{}),{flushSync:T}),{shortCircuited:!0}}if(!tt){de.forEach(Re=>{let oe=d.fetchers.get(Re.key),Ye=ft(void 0,oe?oe.data:void 0);d.fetchers.set(Re.key,Ye)});let G=U||d.actionData;me(J({navigation:se},G?Object.keys(G).length===0?{actionData:null}:{actionData:G}:{},de.length>0?{fetchers:new Map(d.fetchers)}:{}),{flushSync:T})}de.forEach(G=>{ae.has(G.key)&&Ae(G.key),G.controller&&ae.set(G.key,G.controller)});let Se=()=>de.forEach(G=>Ae(G.key));I&&I.signal.addEventListener("abort",Se);let{results:yt,loaderResults:cr,fetcherResults:at}=await Or(d.matches,p,q,de,o);if(o.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Se),de.forEach(G=>ae.delete(G.key));let De=Pr(yt);if(De){if(De.idx>=q.length){let G=de[De.idx-q.length].key;Ue.add(G)}return await gt(d,De.result,{replace:A}),{shortCircuited:!0}}let{loaderData:Nt,errors:dr}=Xe(d,p,q,cr,$,de,at,Ke);Ke.forEach((G,Re)=>{G.subscribe(oe=>{(oe||G.done)&&Ke.delete(Re)})});let fr=_r(),hr=Ar(ht),ot=fr||hr||de.length>0;return J({loaderData:Nt,errors:dr},ot?{fetchers:new Map(d.fetchers)}:{})}function an(o,c,p,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.");ae.has(o)&&Ae(o);let L=(D&&D.unstable_flushSync)===!0,N=f||l,A=b(d.location,d.matches,h,m.v7_prependBasename,p,c,D==null?void 0:D.relative),T=Ee(N,A,h);if(!T){vt(o,c,te(404,{pathname:A}),{flushSync:L});return}let{path:U,submission:$,error:se}=C(m.v7_normalizeFormMethod,!0,A,D);if(se){vt(o,c,se,{flushSync:L});return}let H=dt(T,U);if(ne=(D&&D.preventScrollReset)===!0,$&&ye($.formMethod)){on(o,c,U,H,T,L,$);return}nt.set(o,{routeId:c,path:U}),ln(o,c,U,H,T,L,$)}async function on(o,c,p,D,L,N,A){if(sr(),nt.delete(o),!D.route.action&&!D.route.lazy){let oe=te(405,{method:A.formMethod,pathname:p,routeId:c});vt(o,c,oe,{flushSync:N});return}let T=d.fetchers.get(o);_e(o,Qr(A,T),{flushSync:N});let U=new AbortController,$=ee(e.history,p,U.signal,A);ae.set(o,U);let se=It,H=await Y("action",$,D,L,u,a,h);if($.signal.aborted){ae.get(o)===U&&ae.delete(o);return}if(Je.has(o)){_e(o,je(void 0));return}if(He(H))if(ae.delete(o),ht>se){_e(o,je(void 0));return}else return Ue.add(o),_e(o,ft(A)),gt(d,H,{fetcherSubmission:A});if(ke(H)){vt(o,c,H.error);return}if(Te(H))throw te(400,{type:"defer-action"});let Z=d.navigation.location||d.location,q=ee(e.history,Z,U.signal),de=f||l,Se=d.navigation.state!=="idle"?Ee(de,d.navigation.location,h):d.matches;k(Se,"Didn't find any matches after fetcher action");let yt=++It;rt.set(o,yt);let cr=ft(A,H.data);d.fetchers.set(o,cr);let[at,De]=j(e.history,d,Se,A,Z,We,_t,At,nt,Ue,de,h,{[D.route.id]:H.data},void 0);De.filter(oe=>oe.key!==o).forEach(oe=>{let Ye=oe.key,zr=d.fetchers.get(Ye),hn=ft(void 0,zr?zr.data:void 0);d.fetchers.set(Ye,hn),ae.has(Ye)&&Ae(Ye),oe.controller&&ae.set(Ye,oe.controller)}),me({fetchers:new Map(d.fetchers)});let Nt=()=>De.forEach(oe=>Ae(oe.key));U.signal.addEventListener("abort",Nt);let{results:dr,loaderResults:fr,fetcherResults:hr}=await Or(d.matches,Se,at,De,q);if(U.signal.aborted)return;U.signal.removeEventListener("abort",Nt),rt.delete(o),ae.delete(o),De.forEach(oe=>ae.delete(oe.key));let ot=Pr(dr);if(ot){if(ot.idx>=at.length){let oe=De[ot.idx-at.length].key;Ue.add(oe)}return gt(d,ot.result)}let{loaderData:G,errors:Re}=Xe(d,d.matches,at,fr,void 0,De,hr,Ke);if(d.fetchers.has(o)){let oe=je(H.data);d.fetchers.set(o,oe)}Ar(yt),d.navigation.state==="loading"&&yt>ht?(k(B,"Expected pending action"),I&&I.abort(),mt(d.navigation.location,{matches:Se,loaderData:G,errors:Re,fetchers:new Map(d.fetchers)})):(me({errors:Re,loaderData:pe(d.loaderData,G,Se,Re),fetchers:new Map(d.fetchers)}),We=!1)}async function ln(o,c,p,D,L,N,A){let T=d.fetchers.get(o);_e(o,ft(A,T?T.data:void 0),{flushSync:N});let U=new AbortController,$=ee(e.history,p,U.signal);ae.set(o,U);let se=It,H=await Y("loader",$,D,L,u,a,h);if(Te(H)&&(H=await Lr(H,$.signal,!0)||H),ae.get(o)===U&&ae.delete(o),!$.signal.aborted){if(Je.has(o)){_e(o,je(void 0));return}if(He(H))if(ht>se){_e(o,je(void 0));return}else{Ue.add(o),await gt(d,H);return}if(ke(H)){vt(o,c,H.error);return}k(!Te(H),"Unhandled fetcher deferred data"),_e(o,je(H.data))}}async function gt(o,c,p){let{submission:D,fetcherSubmission:L,replace:N}=p===void 0?{}:p;c.revalidate&&(We=!0);let A=ge(o.location,c.location,{_isRedirect:!0});if(k(A,"Expected a location on the redirect navigation"),r){let Z=!1;if(c.reloadDocument)Z=!0;else if(Tt.test(c.location)){const q=e.history.createURL(c.location);Z=q.origin!==t.location.origin||we(q.pathname,h)==null}if(Z){N?t.location.replace(c.location):t.location.assign(c.location);return}}I=null;let T=N===!0?y.Replace:y.Push,{formMethod:U,formAction:$,formEncType:se}=o.navigation;!D&&!L&&U&&$&&se&&(D=Mr(o.navigation));let H=D||L;if(wr.has(c.status)&&H&&ye(H.formMethod))await Ve(T,A,{submission:J({},H,{formAction:c.location}),preventScrollReset:ne});else{let Z=ir(A,D);await Ve(T,A,{overrideNavigation:Z,fetcherSubmission:L,preventScrollReset:ne})}}async function Or(o,c,p,D,L){let N=await Promise.all([...p.map(U=>Y("loader",L,U,c,u,a,h)),...D.map(U=>U.matches&&U.match&&U.controller?Y("loader",ee(e.history,U.path,U.controller.signal),U.match,U.matches,u,a,h):{type:Q.error,error:te(404,{pathname:U.path})})]),A=N.slice(0,p.length),T=N.slice(p.length);return await Promise.all([Cr(o,p,A,A.map(()=>L.signal),!1,d.loaderData),Cr(o,D.map(U=>U.match),T,D.map(U=>U.controller?U.controller.signal:null),!0)]),{results:N,loaderResults:A,fetcherResults:T}}function sr(){We=!0,_t.push(...ur()),nt.forEach((o,c)=>{ae.has(c)&&(At.push(c),Ae(c))})}function _e(o,c,p){p===void 0&&(p={}),d.fetchers.set(o,c),me({fetchers:new Map(d.fetchers)},{flushSync:(p&&p.flushSync)===!0})}function vt(o,c,p,D){D===void 0&&(D={});let L=qe(d.matches,c);Ft(o),me({errors:{[L.route.id]:p},fetchers:new Map(d.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function Tr(o){return m.v7_fetcherPersist&&(pt.set(o,(pt.get(o)||0)+1),Je.has(o)&&Je.delete(o)),d.fetchers.get(o)||rr}function Ft(o){let c=d.fetchers.get(o);ae.has(o)&&!(c&&c.state==="loading"&&rt.has(o))&&Ae(o),nt.delete(o),rt.delete(o),Ue.delete(o),Je.delete(o),d.fetchers.delete(o)}function sn(o){if(m.v7_fetcherPersist){let c=(pt.get(o)||0)-1;c<=0?(pt.delete(o),Je.add(o)):pt.set(o,c)}else Ft(o);me({fetchers:new Map(d.fetchers)})}function Ae(o){let c=ae.get(o);k(c,"Expected fetch controller: "+o),c.abort(),ae.delete(o)}function jr(o){for(let c of o){let p=Tr(c),D=je(p.data);d.fetchers.set(c,D)}}function _r(){let o=[],c=!1;for(let p of Ue){let D=d.fetchers.get(p);k(D,"Expected fetcher: "+p),D.state==="loading"&&(Ue.delete(p),o.push(p),c=!0)}return jr(o),c}function Ar(o){let c=[];for(let[p,D]of rt)if(D<o){let L=d.fetchers.get(p);k(L,"Expected fetcher: "+p),L.state==="loading"&&(Ae(p),rt.delete(p),c.push(p))}return jr(c),c.length>0}function un(o,c){let p=d.blockers.get(o)||Ne;return $e.get(o)!==c&&$e.set(o,c),p}function Ir(o){d.blockers.delete(o),$e.delete(o)}function Bt(o,c){let p=d.blockers.get(o)||Ne;k(p.state==="unblocked"&&c.state==="blocked"||p.state==="blocked"&&c.state==="blocked"||p.state==="blocked"&&c.state==="proceeding"||p.state==="blocked"&&c.state==="unblocked"||p.state==="proceeding"&&c.state==="unblocked","Invalid blocker state transition: "+p.state+" -> "+c.state);let D=new Map(d.blockers);D.set(o,c),me({blockers:D})}function Fr(o){let{currentLocation:c,nextLocation:p,historyAction:D}=o;if($e.size===0)return;$e.size>1&&le(!1,"A router only supports one blocker at a time");let L=Array.from($e.entries()),[N,A]=L[L.length-1],T=d.blockers.get(N);if(!(T&&T.state==="proceeding")&&A({currentLocation:c,nextLocation:p,historyAction:D}))return N}function ur(o){let c=[];return Ke.forEach((p,D)=>{(!o||o(D))&&(p.cancel(),c.push(D),Ke.delete(D))}),c}function cn(o,c,p){if(S=o,w=c,E=p||null,!P&&d.navigation===ce){P=!0;let D=Nr(d.location,d.matches);D!=null&&me({restoreScrollPosition:D})}return()=>{S=null,w=null,E=null}}function Br(o,c){return E&&E(o,c.map(D=>Ht(D,d.loaderData)))||o.key}function dn(o,c){if(S&&w){let p=Br(o,c);S[p]=w()}}function Nr(o,c){if(S){let p=Br(o,c),D=S[p];if(typeof D=="number")return D}return null}function fn(o){u={},f=Fe(o,a,void 0,u)}return F={get basename(){return h},get state(){return d},get routes(){return l},get window(){return t},initialize:Xr,subscribe:en,enableScrollRestoration:cn,navigate:Ur,fetch:an,revalidate:tn,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:Tr,deleteFetcher:sn,dispose:qr,getBlocker:un,deleteBlocker:Ir,_internalFetchControllers:ae,_internalActiveDeferreds:Ke,_internalSetRoutes:fn},F}const Dr=Symbol("deferred");function i(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 R=t.detectErrorBoundary;a=S=>({hasErrorBoundary:R(S)})}else a=ze;let u=Fe(e,a,void 0,r);async function l(R,S){let{requestContext:E}=S===void 0?{}:S,w=new URL(R.url),P=R.method,g=ge("",ve(w),null,"default"),_=Ee(u,g,n);if(!ar(P)&&P!=="HEAD"){let F=te(405,{method:P}),{matches:d,route:B}=jt(u);return{basename:n,location:g,matches:d,loaderData:{},actionData:null,errors:{[B.id]:F},statusCode:F.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!_){let F=te(404,{pathname:g.pathname}),{matches:d,route:B}=jt(u);return{basename:n,location:g,matches:d,loaderData:{},actionData:null,errors:{[B.id]:F},statusCode:F.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let K=await h(R,g,_,E);return et(K)?K:J({location:g,basename:n},K)}async function f(R,S){let{routeId:E,requestContext:w}=S===void 0?{}:S,P=new URL(R.url),g=R.method,_=ge("",ve(P),null,"default"),K=Ee(u,_,n);if(!ar(g)&&g!=="HEAD"&&g!=="OPTIONS")throw te(405,{method:g});if(!K)throw te(404,{pathname:_.pathname});let F=E?K.find(I=>I.route.id===E):dt(K,_);if(E&&!F)throw te(403,{pathname:_.pathname,routeId:E});if(!F)throw te(404,{pathname:_.pathname});let d=await h(R,_,K,w,F);if(et(d))return d;let B=d.errors?Object.values(d.errors)[0]:void 0;if(B!==void 0)throw B;if(d.actionData)return Object.values(d.actionData)[0];if(d.loaderData){var ne;let I=Object.values(d.loaderData)[0];return(ne=d.activeDeferreds)!=null&&ne[F.route.id]&&(I[Dr]=d.activeDeferreds[F.route.id]),I}}async function h(R,S,E,w,P){k(R.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ye(R.method.toLowerCase()))return await m(R,E,P||dt(E,S),w,P!=null);let g=await x(R,E,w,P);return et(g)?g:J({},g,{actionData:null,actionHeaders:{}})}catch(g){if(Vr(g)){if(g.type===Q.error)throw g.response;return g.response}if($r(g))return g;throw g}}async function m(R,S,E,w,P){let g;if(!E.route.action&&!E.route.lazy){let F=te(405,{method:R.method,pathname:new URL(R.url).pathname,routeId:E.route.id});if(P)throw F;g={type:Q.error,error:F}}else if(g=await Y("action",R,E,S,r,a,n,{isStaticRequest:!0,isRouteRequest:P,requestContext:w}),R.signal.aborted){let F=P?"queryRoute":"query";throw new Error(F+"() call aborted: "+R.method+" "+R.url)}if(He(g))throw new Response(null,{status:g.status,headers:{Location:g.location}});if(Te(g)){let F=te(400,{type:"defer-action"});if(P)throw F;g={type:Q.error,error:F}}if(P){if(ke(g))throw g.error;return{matches:[E],loaderData:{},actionData:{[E.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(ke(g)){let F=qe(S,E.route.id),d=await x(R,S,w,void 0,{[F.route.id]:g.error});return J({},d,{statusCode:ut(g.error)?g.error.status:500,actionData:null,actionHeaders:J({},g.headers?{[E.route.id]:g.headers}:{})})}let _=new Request(R.url,{headers:R.headers,redirect:R.redirect,signal:R.signal}),K=await x(_,S,w);return J({},K,g.statusCode?{statusCode:g.statusCode}:{},{actionData:{[E.route.id]:g.data},actionHeaders:J({},g.headers?{[E.route.id]:g.headers}:{})})}async function x(R,S,E,w,P){let g=w!=null;if(g&&!(w!=null&&w.route.loader)&&!(w!=null&&w.route.lazy))throw te(400,{method:R.method,pathname:new URL(R.url).pathname,routeId:w==null?void 0:w.route.id});let K=(w?[w]:M(S,Object.keys(P||{})[0])).filter(I=>I.route.loader||I.route.lazy);if(K.length===0)return{matches:S,loaderData:S.reduce((I,be)=>Object.assign(I,{[be.route.id]:null}),{}),errors:P||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let F=await Promise.all([...K.map(I=>Y("loader",R,I,S,r,a,n,{isStaticRequest:!0,isRouteRequest:g,requestContext:E}))]);if(R.signal.aborted){let I=g?"queryRoute":"query";throw new Error(I+"() call aborted: "+R.method+" "+R.url)}let d=new Map,B=Oe(S,K,F,P,d),ne=new Set(K.map(I=>I.route.id));return S.forEach(I=>{ne.has(I.route.id)||(B.loaderData[I.route.id]=null)}),J({},B,{matches:S,activeDeferreds:d.size>0?Object.fromEntries(d.entries()):null})}return{dataRoutes:u,query:l,queryRoute:f}}function s(e,t,r){return J({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function v(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function b(e,t,r,n,a,u,l){let f,h;if(u){f=[];for(let x of t)if(f.push(x),x.route.id===u){h=x;break}}else f=t,h=t[t.length-1];let m=Zt(a||".",St(f).map(x=>x.pathnameBase),we(e.pathname,r)||e.pathname,l==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&h&&h.route.index&&!or(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Be([r,m.pathname])),ve(m)}function C(e,t,r,n){if(!n||!v(n))return{path:r};if(n.formMethod&&!ar(n.formMethod))return{path:r,error:te(405,{method:n.formMethod})};let a=()=>({path:r,error:te(400,{type:"invalid-body"})}),u=n.formMethod||"get",l=e?u.toUpperCase():u.toLowerCase(),f=Sr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ye(l))return a();let S=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((E,w)=>{let[P,g]=w;return""+E+P+"="+g+`
|
|
20
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:l,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:S}}}else if(n.formEncType==="application/json"){if(!ye(l))return a();try{let S=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:f,formEncType:n.formEncType,formData:void 0,json:S,text:void 0}}}catch{return a()}}}k(typeof FormData=="function","FormData is not available in this environment");let h,m;if(n.formData)h=ie(n.formData),m=n.formData;else if(n.body instanceof FormData)h=ie(n.body),m=n.body;else if(n.body instanceof URLSearchParams)h=n.body,m=he(h);else if(n.body==null)h=new URLSearchParams,m=new FormData;else try{h=new URLSearchParams(n.body),m=he(h)}catch{return a()}let x={formMethod:l,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(ye(x.formMethod))return{path:r,submission:x};let R=re(r);return t&&R.search&&or(R.search)&&h.append("index",""),R.search="?"+h,{path:ve(R),submission:x}}function M(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 j(e,t,r,n,a,u,l,f,h,m,x,R,S,E){let w=E?Object.values(E)[0]:S?Object.values(S)[0]:void 0,P=e.createURL(t.location),g=e.createURL(a),_=E?Object.keys(E)[0]:void 0,F=M(r,_).filter((B,ne)=>{if(B.route.lazy)return!0;if(B.route.loader==null)return!1;if(W(t.loaderData,t.matches[ne],B)||l.some(xe=>xe===B.route.id))return!0;let I=t.matches[ne],be=B;return V(B,J({currentUrl:P,currentParams:I.params,nextUrl:g,nextParams:be.params},n,{actionResult:w,defaultShouldRevalidate:u||P.pathname+P.search===g.pathname+g.search||P.search!==g.search||O(I,be)}))}),d=[];return h.forEach((B,ne)=>{if(!r.some(tt=>tt.route.id===B.routeId))return;let I=Ee(x,B.path,R);if(!I){d.push({key:ne,routeId:B.routeId,path:B.path,matches:null,match:null,controller:null});return}let be=t.fetchers.get(ne),xe=dt(I,B.path),Me=!1;m.has(ne)?Me=!1:f.includes(ne)?Me=!0:be&&be.state!=="idle"&&be.data===void 0?Me=u:Me=V(xe,J({currentUrl:P,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:w,defaultShouldRevalidate:u})),Me&&d.push({key:ne,routeId:B.routeId,path:B.path,matches:I,match:xe,controller:new AbortController})}),[F,d]}function W(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function O(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function V(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function X(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 u={};for(let l in n){let h=a[l]!==void 0&&l!=="hasErrorBoundary";le(!h,'Route "'+a.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!h&&!pr.has(l)&&(u[l]=n[l])}Object.assign(a,u),Object.assign(a,J({},t(a),{lazy:void 0}))}async function Y(e,t,r,n,a,u,l,f){f===void 0&&(f={});let h,m,x,R=w=>{let P,g=new Promise((_,K)=>P=K);return x=()=>P(),t.signal.addEventListener("abort",x),Promise.race([w({request:t,params:r.params,context:f.requestContext}),g])};try{let w=r.route[e];if(r.route.lazy)if(w){let P,g=await Promise.all([R(w).catch(_=>{P=_}),X(r.route,u,a)]);if(P)throw P;m=g[0]}else if(await X(r.route,u,a),w=r.route[e],w)m=await R(w);else if(e==="action"){let P=new URL(t.url),g=P.pathname+P.search;throw te(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:Q.data,data:void 0};else if(w)m=await R(w);else{let P=new URL(t.url),g=P.pathname+P.search;throw te(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(w){h=Q.error,m=w}finally{x&&t.signal.removeEventListener("abort",x)}if(et(m)){let w=m.status;if(tr.has(w)){let _=m.headers.get("Location");if(k(_,"Redirects returned/thrown from loaders/actions must have a Location header"),!Tt.test(_))_=b(new URL(t.url),n.slice(0,n.indexOf(r)+1),l,!0,_);else if(!f.isStaticRequest){let K=new URL(t.url),F=_.startsWith("//")?new URL(K.protocol+_):new URL(_),d=we(F.pathname,l)!=null;F.origin===K.origin&&d&&(_=F.pathname+F.search+F.hash)}if(f.isStaticRequest)throw m.headers.set("Location",_),m;return{type:Q.redirect,status:w,location:_,revalidate:m.headers.get("X-Remix-Revalidate")!==null,reloadDocument:m.headers.get("X-Remix-Reload-Document")!==null}}if(f.isRouteRequest)throw{type:h===Q.error?Q.error:Q.data,response:m};let P,g=m.headers.get("Content-Type");return g&&/\bapplication\/json\b/.test(g)?P=await m.json():P=await m.text(),h===Q.error?{type:h,error:new Mt(w,m.statusText,P),headers:m.headers}:{type:Q.data,data:P,statusCode:m.status,headers:m.headers}}if(h===Q.error)return{type:h,error:m};if(Kr(m)){var S,E;return{type:Q.deferred,deferredData:m,statusCode:(S=m.init)==null?void 0:S.status,headers:((E=m.init)==null?void 0:E.headers)&&new Headers(m.init.headers)}}return{type:Q.data,data:m}}function ee(e,t,r,n){let a=e.createURL(Sr(t)).toString(),u={signal:r};if(n&&ye(n.formMethod)){let{formMethod:l,formEncType:f}=n;u.method=l.toUpperCase(),f==="application/json"?(u.headers=new Headers({"Content-Type":f}),u.body=JSON.stringify(n.json)):f==="text/plain"?u.body=n.text:f==="application/x-www-form-urlencoded"&&n.formData?u.body=ie(n.formData):u.body=n.formData}return new Request(a,u)}function ie(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function he(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Oe(e,t,r,n,a){let u={},l=null,f,h=!1,m={};return r.forEach((x,R)=>{let S=t[R].route.id;if(k(!He(x),"Cannot handle redirect results in processLoaderData"),ke(x)){let E=qe(e,S),w=x.error;n&&(w=Object.values(n)[0],n=void 0),l=l||{},l[E.route.id]==null&&(l[E.route.id]=w),u[S]=void 0,h||(h=!0,f=ut(x.error)?x.error.status:500),x.headers&&(m[S]=x.headers)}else Te(x)?(a.set(S,x.deferredData),u[S]=x.deferredData.data):u[S]=x.data,x.statusCode!=null&&x.statusCode!==200&&!h&&(f=x.statusCode),x.headers&&(m[S]=x.headers)}),n&&(l=n,u[Object.keys(n)[0]]=void 0),{loaderData:u,errors:l,statusCode:f||200,loaderHeaders:m}}function Xe(e,t,r,n,a,u,l,f){let{loaderData:h,errors:m}=Oe(t,r,n,a,f);for(let x=0;x<u.length;x++){let{key:R,match:S,controller:E}=u[x];k(l!==void 0&&l[x]!==void 0,"Did not find corresponding fetcher result");let w=l[x];if(!(E&&E.signal.aborted))if(ke(w)){let P=qe(e.matches,S==null?void 0:S.route.id);m&&m[P.route.id]||(m=J({},m,{[P.route.id]:w.error})),e.fetchers.delete(R)}else if(He(w))k(!1,"Unhandled fetcher revalidation redirect");else if(Te(w))k(!1,"Unhandled fetcher deferred data");else{let P=je(w.data);e.fetchers.set(R,P)}}return{loaderData:h,errors:m}}function pe(e,t,r,n){let a=J({},t);for(let u of r){let l=u.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(a[l]=t[l]):e[l]!==void 0&&u.route.loader&&(a[l]=e[l]),n&&n.hasOwnProperty(l))break}return a}function qe(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 jt(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 te(e,t){let{pathname:r,routeId:n,method:a,type:u}=t===void 0?{}:t,l="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&r&&n?f="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.":u==="defer-action"?f="defer() is not supported in actions":u==="invalid-body"&&(f="Unable to encode submission body")):e===403?(l="Forbidden",f='Route "'+n+'" does not match URL "'+r+'"'):e===404?(l="Not Found",f='No route matches URL "'+r+'"'):e===405&&(l="Method Not Allowed",a&&r&&n?f="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&&(f='Invalid request method "'+a.toUpperCase()+'"')),new Mt(e||500,l,new Error(f),!0)}function Pr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(He(r))return{result:r,idx:t}}}function Sr(e){let t=typeof e=="string"?re(e):e;return ve(J({},t,{hash:""}))}function Jr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Te(e){return e.type===Q.deferred}function ke(e){return e.type===Q.error}function He(e){return(e&&e.type)===Q.redirect}function Kr(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 et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function $r(e){if(!et(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Vr(e){return e&&et(e.response)&&(e.type===Q.data||e.type===Q.error)}function ar(e){return ct.has(e.toLowerCase())}function ye(e){return er.has(e.toLowerCase())}async function Cr(e,t,r,n,a,u){for(let l=0;l<r.length;l++){let f=r[l],h=t[l];if(!h)continue;let m=e.find(R=>R.route.id===h.route.id),x=m!=null&&!O(m,h)&&(u&&u[h.route.id])!==void 0;if(Te(f)&&(a||x)){let R=n[l];k(R,"Expected an AbortSignal for revalidating fetcher deferred result"),await Lr(f,R,a).then(S=>{S&&(r[l]=S||r[l])})}}}async function Lr(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Q.data,data:e.deferredData.unwrappedData}}catch(a){return{type:Q.error,error:a}}return{type:Q.data,data:e.deferredData.data}}}function or(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function dt(e,t){let r=typeof t=="string"?re(t).search:t.search;if(e[e.length-1].route.index&&or(r||""))return e[e.length-1];let n=St(e);return n[n.length-1]}function Mr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:u,json:l}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(u!=null)return{formMethod:t,formAction:r,formEncType:n,formData:u,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:l,text:void 0}}}function ir(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 Yr(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 ft(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 Qr(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 je(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 Zr(e,t){try{let r=e.sessionStorage.getItem(nr);if(r){let n=JSON.parse(r);for(let[a,u]of Object.entries(n||{}))u&&Array.isArray(u)&&t.set(a,new Set(u||[]))}}catch{}}function Gr(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(nr,JSON.stringify(r))}catch(n){le(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=module-react-router.67245b2c.js.map
|