@techdocs/cli 1.4.0-next.2 → 1.4.0
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 +16 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{6051.784227d8.chunk.js → 6051.3a9f0bec.chunk.js} +1 -1
- package/dist/embedded-app/static/{6051.784227d8.chunk.js.map → 6051.3a9f0bec.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js → 8951.4ffeac5f.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js.map → 8951.4ffeac5f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js → 9323.a4a386cd.chunk.js} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js.map → 9323.a4a386cd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{main.e99a7512.js → main.08eb1867.js} +9 -9
- package/dist/embedded-app/static/main.08eb1867.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js +30 -0
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js.map +1 -0
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js} +2 -2
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js.map → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.e99a7512.js → runtime.08eb1867.js} +2 -2
- package/dist/embedded-app/static/{runtime.e99a7512.js.map → runtime.08eb1867.js.map} +1 -1
- package/dist/embedded-app/static/vendor.08eb1867.js +252 -0
- package/dist/embedded-app/static/vendor.08eb1867.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/main.e99a7512.js.map +0 -1
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js +0 -12
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js.map +0 -1
- package/dist/embedded-app/static/vendor.e99a7512.js +0 -270
- package/dist/embedded-app/static/vendor.e99a7512.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5109],{39857:function(dr,St,De){De.d(St,{VK:function(){return Ee},rU:function(){return Oe}});var N=De(2784),_=De(79635),L=De(27381);/**
|
|
2
|
+
* React Router DOM v6.9.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(s){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(s[b]=E[b])}return s},Le.apply(this,arguments)}function xt(s,p){if(s==null)return{};var E={},b=Object.keys(s),S,k;for(k=0;k<b.length;k++)S=b[k],!(p.indexOf(S)>=0)&&(E[S]=s[S]);return E}const ft="get",Y="application/x-www-form-urlencoded";function he(s){return s!=null&&typeof s.tagName=="string"}function Ct(s){return he(s)&&s.tagName.toLowerCase()==="button"}function Dt(s){return he(s)&&s.tagName.toLowerCase()==="form"}function Pe(s){return he(s)&&s.tagName.toLowerCase()==="input"}function me(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function de(s,p){return s.button===0&&(!p||p==="_self")&&!me(s)}function $e(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((p,E)=>{let b=s[E];return p.concat(Array.isArray(b)?b.map(S=>[E,S]):[[E,b]])},[]))}function re(s,p){let E=$e(s);if(p)for(let b of p.keys())E.has(b)||p.getAll(b).forEach(S=>{E.append(b,S)});return E}function Bt(s,p,E){let b,S,k,j;if(Dt(s)){let Z=E.submissionTrigger;b=E.method||s.getAttribute("method")||ft,S=E.action||s.getAttribute("action")||p,k=E.encType||s.getAttribute("enctype")||Y,j=new FormData(s),Z&&Z.name&&j.append(Z.name,Z.value)}else if(Ct(s)||Pe(s)&&(s.type==="submit"||s.type==="image")){let Z=s.form;if(Z==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');b=E.method||s.getAttribute("formmethod")||Z.getAttribute("method")||ft,S=E.action||s.getAttribute("formaction")||Z.getAttribute("action")||p,k=E.encType||s.getAttribute("formenctype")||Z.getAttribute("enctype")||Y,j=new FormData(Z),s.name&&j.append(s.name,s.value)}else{if(he(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(b=E.method||ft,S=E.action||p,k=E.encType||Y,s instanceof FormData)j=s;else if(j=new FormData,s instanceof URLSearchParams)for(let[Z,we]of s)j.append(Z,we);else if(s!=null)for(let Z of Object.keys(s))j.append(Z,s[Z])}let{protocol:q,host:ne}=window.location;return{url:new URL(S,q+"//"+ne),method:b.toLowerCase(),encType:k,formData:j}}const It=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],ht=null,be=null;function Ve(s,p){return createRouter({basename:p==null?void 0:p.basename,history:createBrowserHistory({window:p==null?void 0:p.window}),hydrationData:(p==null?void 0:p.hydrationData)||Fe(),routes:s,detectErrorBoundary:UNSAFE_detectErrorBoundary}).initialize()}function Ye(s,p){return createRouter({basename:p==null?void 0:p.basename,history:createHashHistory({window:p==null?void 0:p.window}),hydrationData:(p==null?void 0:p.hydrationData)||Fe(),routes:s,detectErrorBoundary:UNSAFE_detectErrorBoundary}).initialize()}function Fe(){var s;let p=(s=window)==null?void 0:s.__staticRouterHydrationData;return p&&p.errors&&(p=Le({},p,{errors:je(p.errors)})),p}function je(s){if(!s)return null;let p=Object.entries(s),E={};for(let[b,S]of p)if(S&&S.__type==="RouteErrorResponse")E[b]=new ErrorResponse(S.status,S.statusText,S.data,S.internal===!0);else if(S&&S.__type==="Error"){let k=new Error(S.message);k.stack="",E[b]=k}else E[b]=S;return E}function Ee(s){let{basename:p,children:E,window:b}=s,S=N.useRef();S.current==null&&(S.current=(0,L.lX)({window:b,v5Compat:!0}));let k=S.current,[j,q]=N.useState({action:k.action,location:k.location});return N.useLayoutEffect(()=>k.listen(q),[k]),N.createElement(_.F0,{basename:p,children:E,location:j.location,navigationType:j.action,navigator:k})}function Lt(s){let{basename:p,children:E,window:b}=s,S=React.useRef();S.current==null&&(S.current=createHashHistory({window:b,v5Compat:!0}));let k=S.current,[j,q]=React.useState({action:k.action,location:k.location});return React.useLayoutEffect(()=>k.listen(q),[k]),React.createElement(Router,{basename:p,children:E,location:j.location,navigationType:j.action,navigator:k})}function mt(s){let{basename:p,children:E,history:b}=s;const[S,k]=React.useState({action:b.action,location:b.location});return React.useLayoutEffect(()=>b.listen(k),[b]),React.createElement(Router,{basename:p,children:E,location:S.location,navigationType:S.action,navigator:b})}const _t=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oe=N.forwardRef(function(p,E){let{onClick:b,relative:S,reloadDocument:k,replace:j,state:q,target:ne,to:G,preventScrollReset:Z}=p,we=xt(p,It),{basename:Xe}=N.useContext(_.Us),Ne,Ae=!1;if(typeof G=="string"&&Se.test(G)&&(Ne=G,_t)){let xe=new URL(window.location.href),et=G.startsWith("//")?new URL(xe.protocol+G):new URL(G),Rt=(0,L.Zn)(et.pathname,Xe);et.origin===xe.origin&&Rt!=null?G=Rt+et.search+et.hash:Ae=!0}let qe=(0,_.oQ)(G,{relative:S}),at=gt(G,{replace:j,state:q,target:ne,preventScrollReset:Z,relative:S});function ue(xe){b&&b(xe),xe.defaultPrevented||at(xe)}return N.createElement("a",Le({},we,{href:Ne||qe,onClick:Ae||k?b:ue,ref:E,target:ne}))}),Xt=null,qt=null,pt=null;function At(s){let{getKey:p,storageKey:E}=s;return Mt({getKey:p,storageKey:E}),null}var Ge;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmitImpl="useSubmitImpl",s.UseFetcher="useFetcher"})(Ge||(Ge={}));var He;(function(s){s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(He||(He={}));function jt(s){return s+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Qe(s){let p=React.useContext(UNSAFE_DataRouterContext);return p||UNSAFE_invariant(!1),p}function Te(s){let p=React.useContext(UNSAFE_DataRouterStateContext);return p||UNSAFE_invariant(!1),p}function gt(s,p){let{target:E,replace:b,state:S,preventScrollReset:k,relative:j}=p===void 0?{}:p,q=(0,_.s0)(),ne=(0,_.TH)(),G=(0,_.WU)(s,{relative:j});return N.useCallback(Z=>{if(de(Z,E)){Z.preventDefault();let we=b!==void 0?b:(0,L.Ep)(ne)===(0,L.Ep)(G);q(s,{replace:we,state:S,preventScrollReset:k,relative:j})}},[ne,q,G,b,S,E,s,k,j])}function Ht(s){let p=React.useRef($e(s)),E=React.useRef(!1),b=useLocation(),S=React.useMemo(()=>re(b.search,E.current?null:p.current),[b.search]),k=useNavigate(),j=React.useCallback((q,ne)=>{const G=$e(typeof q=="function"?q(S):q);E.current=!0,k("?"+G,ne)},[k,S]);return[S,j]}function vt(){return ze()}function ze(s,p){let{router:E}=Qe(Ge.UseSubmitImpl),b=We();return React.useCallback(function(S,k){if(k===void 0&&(k={}),typeof document=="undefined")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{method:j,encType:q,formData:ne,url:G}=Bt(S,b,k),Z=G.pathname+G.search,we={replace:k.replace,preventScrollReset:k.preventScrollReset,formData:ne,formMethod:j,formEncType:q};s?(p==null&&UNSAFE_invariant(!1),E.fetch(s,p,Z,we)):E.navigate(Z,we)},[b,E,s,p])}function We(s,p){let{relative:E}=p===void 0?{}:p,{basename:b}=React.useContext(UNSAFE_NavigationContext),S=React.useContext(UNSAFE_RouteContext);S||UNSAFE_invariant(!1);let[k]=S.matches.slice(-1),j=Le({},useResolvedPath(s||".",{relative:E})),q=useLocation();if(s==null&&(j.search=q.search,j.hash=q.hash,k.route.index)){let ne=new URLSearchParams(j.search);ne.delete("index"),j.search=ne.toString()?"?"+ne.toString():""}return(!s||s===".")&&k.route.index&&(j.search=j.search?j.search.replace(/^\?/,"?index&"):"?index"),b!=="/"&&(j.pathname=j.pathname==="/"?b:joinPaths([b,j.pathname])),createPath(j)}function ve(s,p){return React.forwardRef((b,S)=>React.createElement(pt,Le({},b,{ref:S,fetcherKey:s,routeId:p})))}let Ke=0;function Ut(){var s;let{router:p}=Qe(Ge.UseFetcher),E=React.useContext(UNSAFE_RouteContext);E||UNSAFE_invariant(!1);let b=(s=E.matches[E.matches.length-1])==null?void 0:s.route.id;b==null&&UNSAFE_invariant(!1);let[S]=React.useState(()=>String(++Ke)),[k]=React.useState(()=>(b||UNSAFE_invariant(!1),ve(S,b))),[j]=React.useState(()=>Z=>{p||UNSAFE_invariant(!1),b||UNSAFE_invariant(!1),p.fetch(S,b,Z)}),q=ze(S,b),ne=p.getFetcher(S),G=React.useMemo(()=>Le({Form:k,submit:q,load:j},ne),[ne,k,q,j]);return React.useEffect(()=>()=>{if(!p){console.warn("No fetcher available to clean up from useFetcher()");return}p.deleteFetcher(S)},[p,S]),G}function _e(){return[...Te(He.UseFetchers).fetchers.values()]}const yt="react-router-scroll-positions";let Ze={};function Mt(s){let{getKey:p,storageKey:E}=s===void 0?{}:s,{router:b}=Qe(Ge.UseScrollRestoration),{restoreScrollPosition:S,preventScrollReset:k}=Te(He.UseScrollRestoration),j=useLocation(),q=useMatches(),ne=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Wt(React.useCallback(()=>{if(ne.state==="idle"){let G=(p?p(j,q):null)||j.key;Ze[G]=window.scrollY}sessionStorage.setItem(E||yt,JSON.stringify(Ze)),window.history.scrollRestoration="auto"},[E,p,ne.state,j,q])),typeof document!="undefined"&&(React.useLayoutEffect(()=>{try{let G=sessionStorage.getItem(E||yt);G&&(Ze=JSON.parse(G))}catch{}},[E]),React.useLayoutEffect(()=>{let G=b==null?void 0:b.enableScrollRestoration(Ze,()=>window.scrollY,p);return()=>G&&G()},[b,p]),React.useLayoutEffect(()=>{if(S!==!1){if(typeof S=="number"){window.scrollTo(0,S);return}if(j.hash){let G=document.getElementById(j.hash.slice(1));if(G){G.scrollIntoView();return}}k!==!0&&window.scrollTo(0,0)}},[j,S,k]))}function zt(s,p){let{capture:E}=p||{};React.useEffect(()=>{let b=E!=null?{capture:E}:void 0;return window.addEventListener("beforeunload",s,b),()=>{window.removeEventListener("beforeunload",s,b)}},[s,E])}function Wt(s,p){let{capture:E}=p||{};React.useEffect(()=>{let b=E!=null?{capture:E}:void 0;return window.addEventListener("pagehide",s,b),()=>{window.removeEventListener("pagehide",s,b)}},[s,E])}function er(s){let{when:p,message:E}=s,b=unstable_useBlocker(p);React.useEffect(()=>{b.state==="blocked"&&!p&&b.reset()},[b,p]),React.useEffect(()=>{b.state==="blocked"&&(window.confirm(E)?setTimeout(b.proceed,0):b.reset())},[b,E])}},27381:function(dr,St,De){De.d(St,{Ep:function(){return me},Gn:function(){return At},J0:function(){return Y},PP:function(){return Le},RQ:function(){return Ke},WK:function(){return b},Zn:function(){return Te},Zq:function(){return ze},aU:function(){return _},cP:function(){return de},fp:function(){return be},i3:function(){return gt},lX:function(){return xt},pC:function(){return We}});/**
|
|
11
|
+
* @remix-run/router v1.4.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 N(){return N=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},N.apply(this,arguments)}var _;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(_||(_={}));const L="popstate";function Le(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((x,D)=>C(x,typeof x=="string"?null:x.state,D===0?"default":void 0));let c=w(r==null?a.length-1:r),d=_.Pop,g=null;function w(x){return Math.min(Math.max(x,0),a.length-1)}function B(){return a[c]}function C(x,D,o){D===void 0&&(D=null);let h=Pe(a?B().pathname:"/",x,D,o);return he(h.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(x)),h}function R(x){return typeof x=="string"?x:me(x)}return{get index(){return c},get action(){return d},get location(){return B()},createHref:R,createURL(x){return new URL(R(x),"http://localhost")},encodeLocation(x){let D=typeof x=="string"?de(x):x;return{pathname:D.pathname||"",search:D.search||"",hash:D.hash||""}},push(x,D){d=_.Push;let o=C(x,D);c+=1,a.splice(c,a.length,o),n&&g&&g({action:d,location:o,delta:1})},replace(x,D){d=_.Replace;let o=C(x,D);a[c]=o,n&&g&&g({action:d,location:o,delta:0})},go(x){d=_.Pop;let D=w(c+x),o=a[D];c=D,g&&g({action:d,location:o,delta:x})},listen(x){return g=x,()=>{g=null}}}}function xt(e){e===void 0&&(e={});function t(n,a){let{pathname:c,search:d,hash:g}=n.location;return Pe("",{pathname:c,search:d,hash:g},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:me(a)}return $e(t,r,null,e)}function ft(e){e===void 0&&(e={});function t(a,c){let{pathname:d="/",search:g="",hash:w=""}=de(a.location.hash.substr(1));return Pe("",{pathname:d,search:g,hash:w},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function r(a,c){let d=a.document.querySelector("base"),g="";if(d&&d.getAttribute("href")){let w=a.location.href,B=w.indexOf("#");g=B===-1?w:w.slice(0,B)}return g+"#"+(typeof c=="string"?c:me(c))}function n(a,c){he(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(c)+")")}return $e(t,r,n,e)}function Y(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function he(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ct(){return Math.random().toString(36).substr(2,8)}function Dt(e,t){return{usr:e.state,key:e.key,idx:t}}function Pe(e,t,r,n){return r===void 0&&(r=null),N({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?de(t):t,{state:r,key:t&&t.key||n||Ct()})}function me(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 de(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 $e(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:c=!1}=n,d=a.history,g=_.Pop,w=null,B=C();B==null&&(B=0,d.replaceState(N({},d.state,{idx:B}),""));function C(){return(d.state||{idx:null}).idx}function R(){g=_.Pop;let h=C(),J=h==null?null:h-B;B=h,w&&w({action:g,location:o.location,delta:J})}function M(h,J){g=_.Push;let K=Pe(o.location,h,J);r&&r(K,h),B=C()+1;let W=Dt(K,B),$=o.createHref(K);try{d.pushState(W,"",$)}catch{a.location.assign($)}c&&w&&w({action:g,location:o.location,delta:1})}function x(h,J){g=_.Replace;let K=Pe(o.location,h,J);r&&r(K,h),B=C();let W=Dt(K,B),$=o.createHref(K);d.replaceState(W,"",$),c&&w&&w({action:g,location:o.location,delta:0})}function D(h){let J=a.location.origin!=="null"?a.location.origin:a.location.href,K=typeof h=="string"?h:me(h);return Y(J,"No window.location.(origin|href) available to create URL for href: "+K),new URL(K,J)}let o={get action(){return g},get location(){return e(a,d)},listen(h){if(w)throw new Error("A history only accepts one active listener");return a.addEventListener(L,R),w=h,()=>{a.removeEventListener(L,R),w=null}},createHref(h){return t(a,h)},createURL:D,encodeLocation(h){let J=D(h);return{pathname:J.pathname,search:J.search,hash:J.hash}},push:M,replace:x,go(h){return d.go(h)}};return o}var re;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(re||(re={}));const Bt=new Set(["lazy","caseSensitive","path","id","index","children"]);function It(e){return e.index===!0}function ht(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,c)=>{let d=[...r,c],g=typeof a.id=="string"?a.id:d.join("-");if(Y(a.index!==!0||!a.children,"Cannot specify children on an index route"),Y(!n[g],'Found a route id collision on id "'+g+`". Route id's must be globally unique within Data Router usages`),It(a)){let w=N({},a,{hasErrorBoundary:t(a),id:g});return n[g]=w,w}else{let w=N({},a,{id:g,hasErrorBoundary:t(a),children:void 0});return n[g]=w,a.children&&(w.children=ht(a.children,t,d,n)),w}})}function be(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?de(t):t,a=Te(n.pathname||"/",r);if(a==null)return null;let c=Ve(e);Fe(c);let d=null;for(let g=0;d==null&&g<c.length;++g)d=pt(c[g],jt(a));return d}function Ve(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(c,d,g)=>{let w={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};w.relativePath.startsWith("/")&&(Y(w.relativePath.startsWith(n),'Absolute route path "'+w.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),w.relativePath=w.relativePath.slice(n.length));let B=Ke([n,w.relativePath]),C=r.concat(w);c.children&&c.children.length>0&&(Y(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+B+'".')),Ve(c.children,t,C,B)),!(c.path==null&&!c.index)&&t.push({path:B,score:Xt(B,c.index),routesMeta:C})};return e.forEach((c,d)=>{var g;if(c.path===""||!((g=c.path)!=null&&g.includes("?")))a(c,d);else for(let w of Ye(c.path))a(c,d,w)}),t}function Ye(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),c=r.replace(/\?$/,"");if(n.length===0)return a?[c,""]:[c];let d=Ye(n.join("/")),g=[];return g.push(...d.map(w=>w===""?c:[c,w].join("/"))),a&&g.push(...d),g.map(w=>e.startsWith("/")&&w===""?"/":w)}function Fe(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:qt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const je=/^:\w+$/,Ee=3,Lt=2,mt=1,_t=10,Se=-2,Oe=e=>e==="*";function Xt(e,t){let r=e.split("/"),n=r.length;return r.some(Oe)&&(n+=Se),t&&(n+=Lt),r.filter(a=>!Oe(a)).reduce((a,c)=>a+(je.test(c)?Ee:c===""?mt:_t),n)}function qt(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 pt(e,t){let{routesMeta:r}=e,n={},a="/",c=[];for(let d=0;d<r.length;++d){let g=r[d],w=d===r.length-1,B=a==="/"?t:t.slice(a.length)||"/",C=Ge({path:g.relativePath,caseSensitive:g.caseSensitive,end:w},B);if(!C)return null;Object.assign(n,C.params);let R=g.route;c.push({params:n,pathname:Ke([a,C.pathname]),pathnameBase:Ut(Ke([a,C.pathnameBase])),route:R}),C.pathnameBase!=="/"&&(a=Ke([a,C.pathnameBase]))}return c}function At(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(he(!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=r.split(/\/+/).map((c,d,g)=>{if(d===g.length-1&&c==="*")return t["*"];const B=c.match(/^:(\w+)(\??)$/);if(B){const[,C,R]=B;let M=t[C];return R==="?"?M==null?"":M:(M==null&&Y(!1,'Missing ":'+C+'" param'),M)}return c.replace(/\?$/g,"")}).filter(c=>!!c);return n+a.join("/")}function Ge(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=He(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let c=a[0],d=c.replace(/(.)\/+$/,"$1"),g=a.slice(1);return{params:n.reduce((B,C,R)=>{if(C==="*"){let M=g[R]||"";d=c.slice(0,c.length-M.length).replace(/(.)\/+$/,"$1")}return B[C]=Qe(g[R]||"",C),B},{}),pathname:c,pathnameBase:d,pattern:e}}function He(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),he(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,(d,g)=>(n.push(g),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function jt(e){try{return decodeURI(e)}catch(t){return he(!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 Qe(e,t){try{return decodeURIComponent(e)}catch(r){return he(!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 Te(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 gt(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?de(e):e;return{pathname:r?r.startsWith("/")?r:Ht(r,t):t,search:_e(n),hash:yt(a)}}function Ht(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 vt(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 ze(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function We(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=de(e):(a=N({},e),Y(!a.pathname||!a.pathname.includes("?"),vt("?","pathname","search",a)),Y(!a.pathname||!a.pathname.includes("#"),vt("#","pathname","hash",a)),Y(!a.search||!a.search.includes("#"),vt("#","search","hash",a)));let c=e===""||a.pathname==="",d=c?"/":a.pathname,g;if(n||d==null)g=r;else{let R=t.length-1;if(d.startsWith("..")){let M=d.split("/");for(;M[0]==="..";)M.shift(),R-=1;a.pathname=M.join("/")}g=R>=0?t[R]:"/"}let w=gt(a,g),B=d&&d!=="/"&&d.endsWith("/"),C=(c||d===".")&&r.endsWith("/");return!w.pathname.endsWith("/")&&(B||C)&&(w.pathname+="/"),w}function ve(e){return e===""||e.pathname===""?"/":typeof e=="string"?de(e).pathname:e.pathname}const Ke=e=>e.join("/").replace(/\/\/+/g,"/"),Ut=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_e=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ze=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),N({},n,{headers:a}))};class Mt extends Error{}class zt{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],Y(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((c,d)=>n=d),this.controller=new AbortController;let a=()=>n(new Mt("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((c,d)=>{let[g,w]=d;return Object.assign(c,{[g]:this.trackPromise(g,w)})},{}),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,null,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){return this.controller.signal.aborted&&n instanceof Mt?(this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n)):(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n?(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(c=>{t.removeEventListener("abort",n),(c||this.done)&&a(c)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return Y(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]:er(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Wt(e){return e instanceof Promise&&e._tracked===!0}function er(e){if(!Wt(e))return e;if(e._error)throw e._error;return e._data}const s=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new zt(t,n)},p=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,N({},n,{headers:a}))};class E{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 b(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const S=["post","put","patch","delete"],k=new Set(S),j=["get",...S],q=new Set(j),ne=new Set([301,302,303,307,308]),G=new Set([307,308]),Z={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},we={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Xe={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ae=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",qe=!Ae,at=e=>Boolean(e.hasErrorBoundary);function ue(e){Y(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=e.detectErrorBoundary||at,r={},n=ht(e.routes,t,void 0,r),a,c=null,d=new Set,g=null,w=null,B=null,C=e.hydrationData!=null,R=be(n,e.history.location,e.basename),M=null;if(R==null){let u=te(404,{pathname:e.history.location.pathname}),{matches:f,route:y}=ye(n);R=f,M={[y.id]:u}}let x=!R.some(u=>u.route.lazy)&&(!R.some(u=>u.route.loader)||e.hydrationData!=null),D,o={historyAction:e.history.action,location:e.history.location,matches:R,initialized:x,navigation:Z,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||M,fetchers:new Map,blockers:new Map},h=_.Pop,J=!1,K,W=!1,$=!1,Q=[],oe=[],H=new Map,Ue=0,wt=-1,ut=new Map,$t=new Set,Et=new Map,ct=new Map,rt=new Map,nr=!1;function Cr(){if(c=e.history.listen(y=>{let{action:U,location:O,delta:z}=y;if(nr){nr=!1;return}he(rt.size===0||z!=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 I=Er({currentLocation:o.location,nextLocation:O,historyAction:U});if(I&&z!=null){nr=!0,e.history.go(z*-1),Yt(I,{state:"blocked",location:O,proceed(){Yt(I,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),e.history.go(z)},reset(){Nt(I),fe({blockers:new Map(D.state.blockers)})}});return}return nt(U,O)}),o.initialized)return D;let u=o.matches.filter(y=>y.route.lazy);if(u.length===0)return nt(_.Pop,o.location),D;let f=u.map(y=>m(y.route,t,r));return Promise.all(f).then(()=>{!o.matches.some(U=>U.route.loader)||e.hydrationData!=null?fe({initialized:!0}):nt(_.Pop,o.location)}),D}function Dr(){c&&c(),d.clear(),K&&K.abort(),o.fetchers.forEach((u,f)=>ir(f)),o.blockers.forEach((u,f)=>Nt(f))}function Lr(u){return d.add(u),()=>d.delete(u)}function fe(u){o=N({},o,u),d.forEach(f=>f(o))}function Ot(u,f){var y,U;let O=o.actionData!=null&&o.navigation.formMethod!=null&&ke(o.navigation.formMethod)&&o.navigation.state==="loading"&&((y=u.state)==null?void 0:y._isRedirect)!==!0,z;f.actionData?Object.keys(f.actionData).length>0?z=f.actionData:z=null:O?z=o.actionData:z=null;let I=f.loaderData?ie(o.loaderData,f.loaderData,f.matches||[],f.errors):o.loaderData;for(let[T]of rt)Nt(T);let V=J===!0||o.navigation.formMethod!=null&&ke(o.navigation.formMethod)&&((U=u.state)==null?void 0:U._isRedirect)!==!0;a&&(n=a,a=void 0),fe(N({},f,{actionData:z,loaderData:I,historyAction:h,location:u,initialized:!0,navigation:Z,revalidation:"idle",restoreScrollPosition:Pr(u,f.matches||o.matches),preventScrollReset:V,blockers:new Map(o.blockers)})),W||h===_.Pop||(h===_.Push?e.history.push(u,u.state):h===_.Replace&&e.history.replace(u,u.state)),h=_.Pop,J=!1,W=!1,$=!1,Q=[],oe=[]}async function vr(u,f){if(typeof u=="number"){e.history.go(u);return}let{path:y,submission:U,error:O}=Kt(u,f),z=o.location,I=Pe(o.location,y,f&&f.state);I=N({},I,e.history.encodeLocation(I));let V=f&&f.replace!=null?f.replace:void 0,T=_.Push;V===!0?T=_.Replace:V===!1||U!=null&&ke(U.formMethod)&&U.formAction===o.location.pathname+o.location.search&&(T=_.Replace);let pe=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,ee=Er({currentLocation:z,nextLocation:I,historyAction:T});if(ee){Yt(ee,{state:"blocked",location:I,proceed(){Yt(ee,{state:"proceeding",proceed:void 0,reset:void 0,location:I}),vr(u,f)},reset(){Nt(ee),fe({blockers:new Map(o.blockers)})}});return}return await nt(T,I,{submission:U,pendingError:O,preventScrollReset:pe,replace:f&&f.replace})}function _r(){if(ar(),fe({revalidation:"loading"}),o.navigation.state!=="submitting"){if(o.navigation.state==="idle"){nt(o.historyAction,o.location,{startUninterruptedRevalidation:!0});return}nt(h||o.historyAction,o.navigation.location,{overrideNavigation:o.navigation})}}async function nt(u,f,y){K&&K.abort(),K=null,h=u,W=(y&&y.startUninterruptedRevalidation)===!0,Br(o.location,o.matches),J=(y&&y.preventScrollReset)===!0;let U=a||n,O=y&&y.overrideNavigation,z=be(U,f,e.basename);if(!z){let se=te(404,{pathname:f.pathname}),{matches:Be,route:Me}=ye(U);lr(),Ot(f,{matches:Be,loaderData:{},errors:{[Me.id]:se}});return}if(lt(o.location,f)&&!(y&&y.submission&&ke(y.submission.formMethod))){Ot(f,{matches:z});return}K=new AbortController;let I=A(e.history,f,K.signal,y&&y.submission),V,T;if(y&&y.pendingError)T={[le(z).route.id]:y.pendingError};else if(y&&y.submission&&ke(y.submission.formMethod)){let se=await Ar(I,f,y.submission,z,{replace:y.replace});if(se.shortCircuited)return;V=se.pendingActionData,T=se.pendingActionError,O=N({state:"loading",location:f},y.submission),I=new Request(I.url,{signal:I.signal})}let{shortCircuited:pe,loaderData:ee,errors:Re}=await Ur(I,f,z,O,y&&y.submission,y&&y.replace,V,T);pe||(K=null,Ot(f,N({matches:z},V?{actionData:V}:{},{loaderData:ee,errors:Re})))}async function Ar(u,f,y,U,O){ar();let z=N({state:"submitting",location:f},y);fe({navigation:z});let I,V=Ft(U,f);if(!V.route.action&&!V.route.lazy)I={type:re.error,error:te(405,{method:u.method,pathname:f.pathname,routeId:V.route.id})};else if(I=await P("action",u,V,U,r,t,D.basename),u.signal.aborted)return{shortCircuited:!0};if(st(I)){let T;return O&&O.replace!=null?T=O.replace:T=I.location===o.location.pathname+o.location.search,await Tt(o,I,{submission:y,replace:T}),{shortCircuited:!0}}if(ce(I)){let T=le(U,V.route.id);return(O&&O.replace)!==!0&&(h=_.Push),{pendingActionData:{},pendingActionError:{[T.route.id]:I.error}}}if(Ce(I))throw te(400,{type:"defer-action"});return{pendingActionData:{[V.route.id]:I.data}}}async function Ur(u,f,y,U,O,z,I,V){let T=U;T||(T=N({state:"loading",location:f,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},O));let pe=O||(T.formMethod&&T.formAction&&T.formData&&T.formEncType?{formMethod:T.formMethod,formAction:T.formAction,formData:T.formData,formEncType:T.formEncType}:void 0),ee=a||n,[Re,se]=tr(e.history,o,y,pe,f,$,Q,oe,Et,ee,e.basename,I,V);if(lr(ge=>!(y&&y.some(Ie=>Ie.route.id===ge))||Re&&Re.some(Ie=>Ie.route.id===ge)),Re.length===0&&se.length===0)return Ot(f,N({matches:y,loaderData:{},errors:V||null},I?{actionData:I}:{})),{shortCircuited:!0};if(!W){se.forEach(Ie=>{let dt=o.fetchers.get(Ie.key),Zt={state:"loading",data:dt&&dt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(Ie.key,Zt)});let ge=I||o.actionData;fe(N({navigation:T},ge?Object.keys(ge).length===0?{actionData:null}:{actionData:ge}:{},se.length>0?{fetchers:new Map(o.fetchers)}:{}))}wt=++Ue,se.forEach(ge=>H.set(ge.key,K));let{results:Be,loaderResults:Me,fetcherResults:kt}=await Rr(o.matches,y,Re,se,u);if(u.signal.aborted)return{shortCircuited:!0};se.forEach(ge=>H.delete(ge.key));let Gt=tt(Be);if(Gt)return await Tt(o,Gt,{replace:z}),{shortCircuited:!0};let{loaderData:Qt,errors:Pt}=X(o,y,Re,Me,V,se,kt,ct);ct.forEach((ge,Ie)=>{ge.subscribe(dt=>{(dt||ge.done)&&ct.delete(Ie)})}),Tr();let sr=wr(wt);return N({loaderData:Qt,errors:Pt},sr||se.length>0?{fetchers:new Map(o.fetchers)}:{})}function yr(u){return o.fetchers.get(u)||we}function Mr(u,f,y,U){if(qe)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.");H.has(u)&&Vt(u);let z=be(a||n,y,e.basename);if(!z){or(u,f,te(404,{pathname:y}));return}let{path:I,submission:V}=Kt(y,U,!0),T=Ft(z,I);if(J=(U&&U.preventScrollReset)===!0,V&&ke(V.formMethod)){Fr(u,f,I,T,z,V);return}Et.set(u,{routeId:f,path:I}),Or(u,f,I,T,z,V)}async function Fr(u,f,y,U,O,z){if(ar(),Et.delete(u),!U.route.action&&!U.route.lazy){let Je=te(405,{method:z.formMethod,pathname:y,routeId:f});or(u,f,Je);return}let I=o.fetchers.get(u),V=N({state:"submitting"},z,{data:I&&I.data," _hasFetcherDoneAnything ":!0});o.fetchers.set(u,V),fe({fetchers:new Map(o.fetchers)});let T=new AbortController,pe=A(e.history,y,T.signal,z);H.set(u,T);let ee=await P("action",pe,U,O,r,t,D.basename);if(pe.signal.aborted){H.get(u)===T&&H.delete(u);return}if(st(ee)){H.delete(u),$t.add(u);let Je=N({state:"loading"},z,{data:void 0," _hasFetcherDoneAnything ":!0});return o.fetchers.set(u,Je),fe({fetchers:new Map(o.fetchers)}),Tt(o,ee,{isFetchActionRedirect:!0})}if(ce(ee)){or(u,f,ee.error);return}if(Ce(ee))throw te(400,{type:"defer-action"});let Re=o.navigation.location||o.location,se=A(e.history,Re,T.signal),Be=a||n,Me=o.navigation.state!=="idle"?be(Be,o.navigation.location,e.basename):o.matches;Y(Me,"Didn't find any matches after fetcher action");let kt=++Ue;ut.set(u,kt);let Gt=N({state:"loading",data:ee.data},z,{" _hasFetcherDoneAnything ":!0});o.fetchers.set(u,Gt);let[Qt,Pt]=tr(e.history,o,Me,z,Re,$,Q,oe,Et,Be,e.basename,{[U.route.id]:ee.data},void 0);Pt.filter(Je=>Je.key!==u).forEach(Je=>{let cr=Je.key,Sr=o.fetchers.get(cr),zr={state:"loading",data:Sr&&Sr.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(cr,zr),H.set(cr,T)}),fe({fetchers:new Map(o.fetchers)});let{results:sr,loaderResults:ge,fetcherResults:Ie}=await Rr(o.matches,Me,Qt,Pt,se);if(T.signal.aborted)return;ut.delete(u),H.delete(u),Pt.forEach(Je=>H.delete(Je.key));let dt=tt(sr);if(dt)return Tt(o,dt);let{loaderData:Zt,errors:ur}=X(o,o.matches,Qt,ge,void 0,Pt,Ie,ct),jr={state:"idle",data:ee.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(u,jr);let Hr=wr(kt);o.navigation.state==="loading"&&kt>wt?(Y(h,"Expected pending action"),K&&K.abort(),Ot(o.navigation.location,{matches:Me,loaderData:Zt,errors:ur,fetchers:new Map(o.fetchers)})):(fe(N({errors:ur,loaderData:ie(o.loaderData,Zt,Me,ur)},Hr?{fetchers:new Map(o.fetchers)}:{})),$=!1)}async function Or(u,f,y,U,O,z){let I=o.fetchers.get(u),V=N({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},z,{data:I&&I.data," _hasFetcherDoneAnything ":!0});o.fetchers.set(u,V),fe({fetchers:new Map(o.fetchers)});let T=new AbortController,pe=A(e.history,y,T.signal);H.set(u,T);let ee=await P("loader",pe,U,O,r,t,D.basename);if(Ce(ee)&&(ee=await mr(ee,pe.signal,!0)||ee),H.get(u)===T&&H.delete(u),pe.signal.aborted)return;if(st(ee)){await Tt(o,ee);return}if(ce(ee)){let se=le(o.matches,f);o.fetchers.delete(u),fe({fetchers:new Map(o.fetchers),errors:{[se.route.id]:ee.error}});return}Y(!Ce(ee),"Unhandled fetcher deferred data");let Re={state:"idle",data:ee.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(u,Re),fe({fetchers:new Map(o.fetchers)})}async function Tt(u,f,y){var U;let{submission:O,replace:z,isFetchActionRedirect:I}=y===void 0?{}:y;f.revalidate&&($=!0);let V=Pe(u.location,f.location,N({_isRedirect:!0},I?{_isFetchActionRedirect:!0}:{}));if(Y(V,"Expected a location on the redirect navigation"),Ne.test(f.location)&&Ae&&typeof((U=window)==null?void 0:U.location)!="undefined"){let Be=e.history.createURL(f.location),Me=Te(Be.pathname,e.basename||"/")==null;if(window.location.origin!==Be.origin||Me){z?window.location.replace(f.location):window.location.assign(f.location);return}}K=null;let T=z===!0?_.Replace:_.Push,{formMethod:pe,formAction:ee,formEncType:Re,formData:se}=u.navigation;!O&&pe&&ee&&se&&Re&&(O={formMethod:pe,formAction:ee,formEncType:Re,formData:se}),G.has(f.status)&&O&&ke(O.formMethod)?await nt(T,V,{submission:N({},O,{formAction:f.location}),preventScrollReset:J}):await nt(T,V,{overrideNavigation:{state:"loading",location:V,formMethod:O?O.formMethod:void 0,formAction:O?O.formAction:void 0,formEncType:O?O.formEncType:void 0,formData:O?O.formData:void 0},preventScrollReset:J})}async function Rr(u,f,y,U,O){let z=await Promise.all([...y.map(T=>P("loader",O,T,f,r,t,D.basename)),...U.map(T=>T.matches&&T.match?P("loader",A(e.history,T.path,O.signal),T.match,T.matches,r,t,D.basename):{type:re.error,error:te(404,{pathname:T.path})})]),I=z.slice(0,y.length),V=z.slice(y.length);return await Promise.all([hr(u,y,I,O.signal,!1,o.loaderData),hr(u,U.map(T=>T.match),V,O.signal,!0)]),{results:z,loaderResults:I,fetcherResults:V}}function ar(){$=!0,Q.push(...lr()),Et.forEach((u,f)=>{H.has(f)&&(oe.push(f),Vt(f))})}function or(u,f,y){let U=le(o.matches,f);ir(u),fe({errors:{[U.route.id]:y},fetchers:new Map(o.fetchers)})}function ir(u){H.has(u)&&Vt(u),Et.delete(u),ut.delete(u),$t.delete(u),o.fetchers.delete(u)}function Vt(u){let f=H.get(u);Y(f,"Expected fetch controller: "+u),f.abort(),H.delete(u)}function br(u){for(let f of u){let U={state:"idle",data:yr(f).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(f,U)}}function Tr(){let u=[];for(let f of $t){let y=o.fetchers.get(f);Y(y,"Expected fetcher: "+f),y.state==="loading"&&($t.delete(f),u.push(f))}br(u)}function wr(u){let f=[];for(let[y,U]of ut)if(U<u){let O=o.fetchers.get(y);Y(O,"Expected fetcher: "+y),O.state==="loading"&&(Vt(y),ut.delete(y),f.push(y))}return br(f),f.length>0}function Nr(u,f){let y=o.blockers.get(u)||Xe;return rt.get(u)!==f&&rt.set(u,f),y}function Nt(u){o.blockers.delete(u),rt.delete(u)}function Yt(u,f){let y=o.blockers.get(u)||Xe;Y(y.state==="unblocked"&&f.state==="blocked"||y.state==="blocked"&&f.state==="blocked"||y.state==="blocked"&&f.state==="proceeding"||y.state==="blocked"&&f.state==="unblocked"||y.state==="proceeding"&&f.state==="unblocked","Invalid blocker state transition: "+y.state+" -> "+f.state),o.blockers.set(u,f),fe({blockers:new Map(o.blockers)})}function Er(u){let{currentLocation:f,nextLocation:y,historyAction:U}=u;if(rt.size===0)return;rt.size>1&&he(!1,"A router only supports one blocker at a time");let O=Array.from(rt.entries()),[z,I]=O[O.length-1],V=o.blockers.get(z);if(!(V&&V.state==="proceeding")&&I({currentLocation:f,nextLocation:y,historyAction:U}))return z}function lr(u){let f=[];return ct.forEach((y,U)=>{(!u||u(U))&&(y.cancel(),f.push(U),ct.delete(U))}),f}function kr(u,f,y){if(g=u,B=f,w=y||(U=>U.key),!C&&o.navigation===Z){C=!0;let U=Pr(o.location,o.matches);U!=null&&fe({restoreScrollPosition:U})}return()=>{g=null,B=null,w=null}}function Br(u,f){if(g&&w&&B){let y=f.map(O=>gr(O,o.loaderData)),U=w(u,y)||u.key;g[U]=B()}}function Pr(u,f){if(g&&w&&B){let y=f.map(z=>gr(z,o.loaderData)),U=w(u,y)||u.key,O=g[U];if(typeof O=="number")return O}return null}function Ir(u){a=u}return D={get basename(){return e.basename},get state(){return o},get routes(){return n},initialize:Cr,subscribe:Lr,enableScrollRestoration:kr,navigate:vr,fetch:Mr,revalidate:_r,createHref:u=>e.history.createHref(u),encodeLocation:u=>e.history.encodeLocation(u),getFetcher:yr,deleteFetcher:ir,dispose:Dr,getBlocker:Nr,deleteBlocker:Nt,_internalFetchControllers:H,_internalActiveDeferreds:ct,_internalSetRoutes:Ir},D}const xe=Symbol("deferred");function et(e,t){Y(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(t==null?void 0:t.detectErrorBoundary)||at,a=ht(e,n,void 0,r),c=(t?t.basename:null)||"/";async function d(R,M){let{requestContext:x}=M===void 0?{}:M,D=new URL(R.url),o=R.method.toLowerCase(),h=Pe("",me(D),null,"default"),J=be(a,h,c);if(!rr(o)&&o!=="head"){let W=te(405,{method:o}),{matches:$,route:Q}=ye(a);return{basename:c,location:h,matches:$,loaderData:{},actionData:null,errors:{[Q.id]:W},statusCode:W.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!J){let W=te(404,{pathname:h.pathname}),{matches:$,route:Q}=ye(a);return{basename:c,location:h,matches:$,loaderData:{},actionData:null,errors:{[Q.id]:W},statusCode:W.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let K=await w(R,h,J,x);return bt(K)?K:N({location:h,basename:c},K)}async function g(R,M){let{routeId:x,requestContext:D}=M===void 0?{}:M,o=new URL(R.url),h=R.method.toLowerCase(),J=Pe("",me(o),null,"default"),K=be(a,J,c);if(!rr(h)&&h!=="head"&&h!=="options")throw te(405,{method:h});if(!K)throw te(404,{pathname:J.pathname});let W=x?K.find(H=>H.route.id===x):Ft(K,J);if(x&&!W)throw te(403,{pathname:J.pathname,routeId:x});if(!W)throw te(404,{pathname:J.pathname});let $=await w(R,J,K,D,W);if(bt($))return $;let Q=$.errors?Object.values($.errors)[0]:void 0;if(Q!==void 0)throw Q;if($.actionData)return Object.values($.actionData)[0];if($.loaderData){var oe;let H=Object.values($.loaderData)[0];return(oe=$.activeDeferreds)!=null&&oe[W.route.id]&&(H[xe]=$.activeDeferreds[W.route.id]),H}}async function w(R,M,x,D,o){Y(R.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ke(R.method.toLowerCase()))return await B(R,x,o||Ft(x,M),D,o!=null);let h=await C(R,x,D,o);return bt(h)?h:N({},h,{actionData:null,actionHeaders:{}})}catch(h){if(xr(h)){if(h.type===re.error&&!fr(h.response))throw h.response;return h.response}if(fr(h))return h;throw h}}async function B(R,M,x,D,o){let h;if(!x.route.action&&!x.route.lazy){let W=te(405,{method:R.method,pathname:new URL(R.url).pathname,routeId:x.route.id});if(o)throw W;h={type:re.error,error:W}}else if(h=await P("action",R,x,M,r,n,c,!0,o,D),R.signal.aborted){let W=o?"queryRoute":"query";throw new Error(W+"() call aborted")}if(st(h))throw new Response(null,{status:h.status,headers:{Location:h.location}});if(Ce(h)){let W=te(400,{type:"defer-action"});if(o)throw W;h={type:re.error,error:W}}if(o){if(ce(h))throw h.error;return{matches:[x],loaderData:{},actionData:{[x.route.id]:h.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(ce(h)){let W=le(M,x.route.id),$=await C(R,M,D,void 0,{[W.route.id]:h.error});return N({},$,{statusCode:b(h.error)?h.error.status:500,actionData:null,actionHeaders:N({},h.headers?{[x.route.id]:h.headers}:{})})}let J=new Request(R.url,{headers:R.headers,redirect:R.redirect,signal:R.signal}),K=await C(J,M,D);return N({},K,h.statusCode?{statusCode:h.statusCode}:{},{actionData:{[x.route.id]:h.data},actionHeaders:N({},h.headers?{[x.route.id]:h.headers}:{})})}async function C(R,M,x,D,o){let h=D!=null;if(h&&!(D!=null&&D.route.loader)&&!(D!=null&&D.route.lazy))throw te(400,{method:R.method,pathname:new URL(R.url).pathname,routeId:D==null?void 0:D.route.id});let K=(D?[D]:Jt(M,Object.keys(o||{})[0])).filter(H=>H.route.loader||H.route.lazy);if(K.length===0)return{matches:M,loaderData:M.reduce((H,Ue)=>Object.assign(H,{[Ue.route.id]:null}),{}),errors:o||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let W=await Promise.all([...K.map(H=>P("loader",R,H,M,r,n,c,!0,h,x))]);if(R.signal.aborted){let H=h?"queryRoute":"query";throw new Error(H+"() call aborted")}let $=new Map,Q=ae(M,K,W,o,$),oe=new Set(K.map(H=>H.route.id));return M.forEach(H=>{oe.has(H.route.id)||(Q.loaderData[H.route.id]=null)}),N({},Q,{matches:M,activeDeferreds:$.size>0?Object.fromEntries($.entries()):null})}return{dataRoutes:a,query:d,queryRoute:g}}function Rt(e,t,r){return N({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function ot(e){return e!=null&&"formData"in e}function Kt(e,t,r){r===void 0&&(r=!1);let n=typeof e=="string"?e:me(e);if(!t||!ot(t))return{path:n};if(t.formMethod&&!rr(t.formMethod))return{path:n,error:te(405,{method:t.formMethod})};let a;if(t.formData&&(a={formMethod:t.formMethod||"get",formAction:it(n),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},ke(a.formMethod)))return{path:n,submission:a};let c=de(n),d=F(t.formData);return r&&c.search&&pr(c.search)&&d.append("index",""),c.search="?"+d,{path:me(c),submission:a}}function Jt(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 tr(e,t,r,n,a,c,d,g,w,B,C,R,M){let x=M?Object.values(M)[0]:R?Object.values(R)[0]:void 0,D=e.createURL(t.location),o=e.createURL(a),h=c||D.toString()===o.toString()||D.search!==o.search,J=M?Object.keys(M)[0]:void 0,W=Jt(r,J).filter((Q,oe)=>{if(Q.route.lazy)return!0;if(Q.route.loader==null)return!1;if(i(t.loaderData,t.matches[oe],Q)||d.some(wt=>wt===Q.route.id))return!0;let H=t.matches[oe],Ue=Q;return v(Q,N({currentUrl:D,currentParams:H.params,nextUrl:o,nextParams:Ue.params},n,{actionResult:x,defaultShouldRevalidate:h||l(H,Ue)}))}),$=[];return w.forEach((Q,oe)=>{if(!r.some(ut=>ut.route.id===Q.routeId))return;let H=be(B,Q.path,C);if(!H){$.push(N({key:oe},Q,{matches:null,match:null}));return}let Ue=Ft(H,Q.path);if(g.includes(oe)){$.push(N({key:oe,matches:H,match:Ue},Q));return}v(Ue,N({currentUrl:D,currentParams:t.matches[t.matches.length-1].params,nextUrl:o,nextParams:r[r.length-1].params},n,{actionResult:x,defaultShouldRevalidate:h}))&&$.push(N({key:oe,matches:H,match:Ue},Q))}),[W,$]}function i(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function l(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 m(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];Y(a,"No route found in manifest");let c={};for(let d in n){let w=a[d]!==void 0&&d!=="hasErrorBoundary";he(!w,'Route "'+a.id+'" has a static property "'+d+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+d+'" will be ignored.')),!w&&!Bt.has(d)&&(c[d]=n[d])}Object.assign(a,c),Object.assign(a,{hasErrorBoundary:t(N({},a)),lazy:void 0})}async function P(e,t,r,n,a,c,d,g,w,B){d===void 0&&(d="/"),g===void 0&&(g=!1),w===void 0&&(w=!1);let C,R,M,x=h=>{let J,K=new Promise((W,$)=>J=$);return M=()=>J(),t.signal.addEventListener("abort",M),Promise.race([h({request:t,params:r.params,context:B}),K])};try{let h=r.route[e];if(r.route.lazy)if(h)R=(await Promise.all([x(h),m(r.route,c,a)]))[0];else if(await m(r.route,c,a),h=r.route[e],h)R=await x(h);else{if(e==="action")throw te(405,{method:t.method,pathname:new URL(t.url).pathname,routeId:r.route.id});return{type:re.data,data:void 0}}else Y(h,"Could not find the "+e+' to run on the "'+r.route.id+'" route'),R=await x(h);Y(R!==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(h){C=re.error,R=h}finally{M&&t.signal.removeEventListener("abort",M)}if(bt(R)){let h=R.status;if(ne.has(h)){let W=R.headers.get("Location");if(Y(W,"Redirects returned/thrown from loaders/actions must have a Location header"),Ne.test(W)){if(!g){let $=new URL(t.url),Q=W.startsWith("//")?new URL($.protocol+W):new URL(W),oe=Te(Q.pathname,d)!=null;Q.origin===$.origin&&oe&&(W=Q.pathname+Q.search+Q.hash)}}else{let $=n.slice(0,n.indexOf(r)+1),Q=ze($).map(H=>H.pathnameBase),oe=We(W,Q,new URL(t.url).pathname);if(Y(me(oe),"Unable to resolve redirect location: "+W),d){let H=oe.pathname;oe.pathname=H==="/"?d:Ke([d,H])}W=me(oe)}if(g)throw R.headers.set("Location",W),R;return{type:re.redirect,status:h,location:W,revalidate:R.headers.get("X-Remix-Revalidate")!==null}}if(w)throw{type:C||re.data,response:R};let J,K=R.headers.get("Content-Type");return K&&/\bapplication\/json\b/.test(K)?J=await R.json():J=await R.text(),C===re.error?{type:C,error:new E(h,R.statusText,J),headers:R.headers}:{type:re.data,data:J,statusCode:R.status,headers:R.headers}}if(C===re.error)return{type:C,error:R};if(R instanceof zt){var D,o;return{type:re.deferred,deferredData:R,statusCode:(D=R.init)==null?void 0:D.status,headers:((o=R.init)==null?void 0:o.headers)&&new Headers(R.init.headers)}}return{type:re.data,data:R}}function A(e,t,r,n){let a=e.createURL(it(t)).toString(),c={signal:r};if(n&&ke(n.formMethod)){let{formMethod:d,formEncType:g,formData:w}=n;c.method=d.toUpperCase(),c.body=g==="application/x-www-form-urlencoded"?F(w):w}return new Request(a,c)}function F(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,n instanceof File?n.name:n);return t}function ae(e,t,r,n,a){let c={},d=null,g,w=!1,B={};return r.forEach((C,R)=>{let M=t[R].route.id;if(Y(!st(C),"Cannot handle redirect results in processLoaderData"),ce(C)){let x=le(e,M),D=C.error;n&&(D=Object.values(n)[0],n=void 0),d=d||{},d[x.route.id]==null&&(d[x.route.id]=D),c[M]=void 0,w||(w=!0,g=b(C.error)?C.error.status:500),C.headers&&(B[M]=C.headers)}else Ce(C)?(a.set(M,C.deferredData),c[M]=C.deferredData.data):c[M]=C.data,C.statusCode!=null&&C.statusCode!==200&&!w&&(g=C.statusCode),C.headers&&(B[M]=C.headers)}),n&&(d=n,c[Object.keys(n)[0]]=void 0),{loaderData:c,errors:d,statusCode:g||200,loaderHeaders:B}}function X(e,t,r,n,a,c,d,g){let{loaderData:w,errors:B}=ae(t,r,n,a,g);for(let C=0;C<c.length;C++){let{key:R,match:M}=c[C];Y(d!==void 0&&d[C]!==void 0,"Did not find corresponding fetcher result");let x=d[C];if(ce(x)){let D=le(e.matches,M==null?void 0:M.route.id);B&&B[D.route.id]||(B=N({},B,{[D.route.id]:x.error})),e.fetchers.delete(R)}else if(st(x))Y(!1,"Unhandled fetcher revalidation redirect");else if(Ce(x))Y(!1,"Unhandled fetcher deferred data");else{let D={state:"idle",data:x.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};e.fetchers.set(R,D)}}return{loaderData:w,errors:B}}function ie(e,t,r,n){let a=N({},t);for(let c of r){let d=c.route.id;if(t.hasOwnProperty(d)?t[d]!==void 0&&(a[d]=t[d]):e[d]!==void 0&&c.route.loader&&(a[d]=e[d]),n&&n.hasOwnProperty(d))break}return a}function le(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 ye(e){let t=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:c}=t===void 0?{}:t,d="Unknown Server Error",g="Unknown @remix-run/router error";return e===400?(d="Bad Request",a&&r&&n?g="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.":c==="defer-action"&&(g="defer() is not supported in actions")):e===403?(d="Forbidden",g='Route "'+n+'" does not match URL "'+r+'"'):e===404?(d="Not Found",g='No route matches URL "'+r+'"'):e===405&&(d="Method Not Allowed",a&&r&&n?g="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&&(g='Invalid request method "'+a.toUpperCase()+'"')),new E(e||500,d,new Error(g),!0)}function tt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(st(r))return r}}function it(e){let t=typeof e=="string"?de(e):e;return me(N({},t,{hash:""}))}function lt(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function Ce(e){return e.type===re.deferred}function ce(e){return e.type===re.error}function st(e){return(e&&e.type)===re.redirect}function bt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function fr(e){if(!bt(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function xr(e){return e&&bt(e.response)&&(e.type===re.data||re.error)}function rr(e){return q.has(e)}function ke(e){return k.has(e)}async function hr(e,t,r,n,a,c){for(let d=0;d<r.length;d++){let g=r[d],w=t[d];if(!w)continue;let B=e.find(R=>R.route.id===w.route.id),C=B!=null&&!l(B,w)&&(c&&c[w.route.id])!==void 0;Ce(g)&&(a||C)&&await mr(g,n,a).then(R=>{R&&(r[d]=R||r[d])})}}async function mr(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:re.data,data:e.deferredData.unwrappedData}}catch(a){return{type:re.error,error:a}}return{type:re.data,data:e.deferredData.data}}}function pr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function gr(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){let r=typeof t=="string"?de(t).search:t.search;if(e[e.length-1].route.index&&pr(r||""))return e[e.length-1];let n=ze(e);return n[n.length-1]}},79635:function(dr,St,De){var N;De.d(St,{AW:function(){return Ne},F0:function(){return Ae},Fg:function(){return we},GV:function(){return Se},TH:function(){return Oe},UO:function(){return jt},Us:function(){return Fe},V$:function(){return Te},VA:function(){return Z},WU:function(){return Qe},Z5:function(){return qe},is:function(){return ot},j3:function(){return Xe},oQ:function(){return _t},pC:function(){return He},s0:function(){return pt}});var _=De(27381),L=De(2784);/**
|
|
20
|
+
* React Router v6.9.0
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Remix Software Inc.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
26
|
+
*
|
|
27
|
+
* @license MIT
|
|
28
|
+
*/function Le(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}const xt=typeof Object.is=="function"?Object.is:Le,{useState:ft,useEffect:Y,useLayoutEffect:he,useDebugValue:Ct}=N||(N=De.t(L,2));let Dt=!1,Pe=!1;function me(i,l,v){const m=l(),[{inst:P},A]=ft({inst:{value:m,getSnapshot:l}});return he(()=>{P.value=m,P.getSnapshot=l,de(P)&&A({inst:P})},[i,m,l]),Y(()=>(de(P)&&A({inst:P}),i(()=>{de(P)&&A({inst:P})})),[i]),Ct(m),m}function de(i){const l=i.getSnapshot,v=i.value;try{const m=l();return!xt(v,m)}catch{return!0}}function $e(i,l,v){return l()}const ht=!(typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined")?$e:me,be=L.createContext(null),Ve=L.createContext(null),Ye=null,Fe=L.createContext(null),je=L.createContext(null),Ee=L.createContext({outlet:null,matches:[]}),Lt=L.createContext(null);function mt(){return mt=Object.assign?Object.assign.bind():function(i){for(var l=1;l<arguments.length;l++){var v=arguments[l];for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(i[m]=v[m])}return i},mt.apply(this,arguments)}function _t(i,l){let{relative:v}=l===void 0?{}:l;Se()||(0,_.J0)(!1);let{basename:m,navigator:P}=L.useContext(Fe),{hash:A,pathname:F,search:ae}=Qe(i,{relative:v}),X=F;return m!=="/"&&(X=F==="/"?m:(0,_.RQ)([m,F])),P.createHref({pathname:X,search:ae,hash:A})}function Se(){return L.useContext(je)!=null}function Oe(){return Se()||(0,_.J0)(!1),L.useContext(je).location}function Xt(){return React.useContext(je).navigationType}function qt(i){Se()||UNSAFE_invariant(!1);let{pathname:l}=Oe();return React.useMemo(()=>matchPath(i,l),[l,i])}function pt(){Se()||(0,_.J0)(!1);let{basename:i,navigator:l}=L.useContext(Fe),{matches:v}=L.useContext(Ee),{pathname:m}=Oe(),P=JSON.stringify((0,_.Zq)(v).map(ae=>ae.pathnameBase)),A=L.useRef(!1);return L.useEffect(()=>{A.current=!0}),L.useCallback(function(ae,X){if(X===void 0&&(X={}),!A.current)return;if(typeof ae=="number"){l.go(ae);return}let ie=(0,_.pC)(ae,JSON.parse(P),m,X.relative==="path");i!=="/"&&(ie.pathname=ie.pathname==="/"?i:(0,_.RQ)([i,ie.pathname])),(X.replace?l.replace:l.push)(ie,X.state,X)},[i,l,P,m])}const At=L.createContext(null);function Ge(){return React.useContext(At)}function He(i){let l=L.useContext(Ee).outlet;return l&&L.createElement(At.Provider,{value:i},l)}function jt(){let{matches:i}=L.useContext(Ee),l=i[i.length-1];return l?l.params:{}}function Qe(i,l){let{relative:v}=l===void 0?{}:l,{matches:m}=L.useContext(Ee),{pathname:P}=Oe(),A=JSON.stringify((0,_.Zq)(m).map(F=>F.pathnameBase));return L.useMemo(()=>(0,_.pC)(i,JSON.parse(A),P,v==="path"),[i,A,P,v])}function Te(i,l){Se()||(0,_.J0)(!1);let{navigator:v}=L.useContext(Fe),m=L.useContext(Ve),{matches:P}=L.useContext(Ee),A=P[P.length-1],F=A?A.params:{},ae=A?A.pathname:"/",X=A?A.pathnameBase:"/",ie=A&&A.route,le=Oe(),ye;if(l){var te;let ce=typeof l=="string"?(0,_.cP)(l):l;X==="/"||(te=ce.pathname)!=null&&te.startsWith(X)||(0,_.J0)(!1),ye=ce}else ye=le;let tt=ye.pathname||"/",it=X==="/"?tt:tt.slice(X.length)||"/",lt=(0,_.fp)(i,{pathname:it}),Ce=ze(lt&<.map(ce=>Object.assign({},ce,{params:Object.assign({},F,ce.params),pathname:(0,_.RQ)([X,v.encodeLocation?v.encodeLocation(ce.pathname).pathname:ce.pathname]),pathnameBase:ce.pathnameBase==="/"?X:(0,_.RQ)([X,v.encodeLocation?v.encodeLocation(ce.pathnameBase).pathname:ce.pathnameBase])})),P,m||void 0);return l&&Ce?L.createElement(je.Provider,{value:{location:mt({pathname:"/",search:"",hash:"",state:null,key:"default"},ye),navigationType:_.aU.Pop}},Ce):Ce}function gt(){let i=E(),l=(0,_.WK)(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),v=i instanceof Error?i.stack:null,m="rgba(200,200,200, 0.5)",P={padding:"0.5rem",backgroundColor:m},A={padding:"2px 4px",backgroundColor:m},F=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},l),v?L.createElement("pre",{style:P},v):null,F)}class Ht extends L.Component{constructor(l){super(l),this.state={location:l.location,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,v){return v.location!==l.location?{error:l.error,location:l.location}:{error:l.error||v.error,location:v.location}}componentDidCatch(l,v){console.error("React Router caught the following error during render",l,v)}render(){return this.state.error?L.createElement(Ee.Provider,{value:this.props.routeContext},L.createElement(Lt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vt(i){let{routeContext:l,match:v,children:m}=i,P=L.useContext(be);return P&&P.static&&P.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(P.staticContext._deepestRenderedBoundaryId=v.route.id),L.createElement(Ee.Provider,{value:l},m)}function ze(i,l,v){if(l===void 0&&(l=[]),i==null)if(v!=null&&v.errors)i=v.matches;else return null;let m=i,P=v==null?void 0:v.errors;if(P!=null){let A=m.findIndex(F=>F.route.id&&(P==null?void 0:P[F.route.id]));A>=0||(0,_.J0)(!1),m=m.slice(0,Math.min(m.length,A+1))}return m.reduceRight((A,F,ae)=>{let X=F.route.id?P==null?void 0:P[F.route.id]:null,ie=null;v&&(F.route.ErrorBoundary?ie=L.createElement(F.route.ErrorBoundary,null):F.route.errorElement?ie=F.route.errorElement:ie=L.createElement(gt,null));let le=l.concat(m.slice(0,ae+1)),ye=()=>{let te=A;return X?te=ie:F.route.Component?te=L.createElement(F.route.Component,null):F.route.element&&(te=F.route.element),L.createElement(vt,{match:F,routeContext:{outlet:A,matches:le},children:te})};return v&&(F.route.ErrorBoundary||F.route.errorElement||ae===0)?L.createElement(Ht,{location:v.location,component:ie,error:X,children:ye(),routeContext:{outlet:null,matches:le}}):ye()},null)}var We;(function(i){i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator"})(We||(We={}));var ve;(function(i){i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator"})(ve||(ve={}));function Ke(i){return i+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Ut(i){let l=React.useContext(be);return l||UNSAFE_invariant(!1),l}function _e(i){let l=L.useContext(Ve);return l||(0,_.J0)(!1),l}function yt(i){let l=L.useContext(Ee);return l||(0,_.J0)(!1),l}function Ze(i){let l=yt(i),v=l.matches[l.matches.length-1];return v.route.id||(0,_.J0)(!1),v.route.id}function Mt(){return _e(ve.UseNavigation).navigation}function zt(){let i=Ut(We.UseRevalidator),l=_e(ve.UseRevalidator);return{revalidate:i.router.revalidate,state:l.revalidation}}function Wt(){let{matches:i,loaderData:l}=_e(ve.UseMatches);return React.useMemo(()=>i.map(v=>{let{pathname:m,params:P}=v;return{id:v.route.id,pathname:m,params:P,data:l[v.route.id],handle:v.route.handle}}),[i,l])}function er(){let i=_e(ve.UseLoaderData),l=Ze(ve.UseLoaderData);if(i.errors&&i.errors[l]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+l+")");return}return i.loaderData[l]}function s(i){return _e(ve.UseRouteLoaderData).loaderData[i]}function p(){let i=_e(ve.UseActionData);return React.useContext(Ee)||UNSAFE_invariant(!1),Object.values((i==null?void 0:i.actionData)||{})[0]}function E(){var i;let l=L.useContext(Lt),v=_e(ve.UseRouteError),m=Ze(ve.UseRouteError);return l||((i=v.errors)==null?void 0:i[m])}function b(){let i=React.useContext(Ye);return i==null?void 0:i._data}function S(){let i=React.useContext(Ye);return i==null?void 0:i._error}let k=0;function j(i){let{router:l}=Ut(We.UseBlocker),v=_e(ve.UseBlocker),[m]=React.useState(()=>String(++k)),P=React.useCallback(F=>typeof i=="function"?!!i(F):!!i,[i]),A=l.getBlocker(m,P);return React.useEffect(()=>()=>l.deleteBlocker(m),[l,m]),v.blockers.get(m)||A}const q={};function ne(i,l,v){!l&&!q[i]&&(q[i]=!0)}function G(i){let{fallbackElement:l,router:v}=i,m=React.useCallback(()=>v.state,[v]),P=ht(v.subscribe,m,m),A=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:X=>v.navigate(X),push:(X,ie,le)=>v.navigate(X,{state:ie,preventScrollReset:le==null?void 0:le.preventScrollReset}),replace:(X,ie,le)=>v.navigate(X,{replace:!0,state:ie,preventScrollReset:le==null?void 0:le.preventScrollReset})}),[v]),F=v.basename||"/",ae=React.useMemo(()=>({router:v,navigator:A,static:!1,basename:F}),[v,A,F]);return React.createElement(React.Fragment,null,React.createElement(be.Provider,{value:ae},React.createElement(Ve.Provider,{value:P},React.createElement(Ae,{basename:v.basename,location:v.state.location,navigationType:v.state.historyAction,navigator:A},v.state.initialized?React.createElement(qe,null):l))),null)}function Z(i){let{basename:l,children:v,initialEntries:m,initialIndex:P}=i,A=L.useRef();A.current==null&&(A.current=(0,_.PP)({initialEntries:m,initialIndex:P,v5Compat:!0}));let F=A.current,[ae,X]=L.useState({action:F.action,location:F.location});return L.useLayoutEffect(()=>F.listen(X),[F]),L.createElement(Ae,{basename:l,children:v,location:ae.location,navigationType:ae.action,navigator:F})}function we(i){let{to:l,replace:v,state:m,relative:P}=i;Se()||(0,_.J0)(!1);let A=L.useContext(Ve),F=pt();return L.useEffect(()=>{A&&A.navigation.state!=="idle"||F(l,{replace:v,state:m,relative:P})}),null}function Xe(i){return He(i.context)}function Ne(i){(0,_.J0)(!1)}function Ae(i){let{basename:l="/",children:v=null,location:m,navigationType:P=_.aU.Pop,navigator:A,static:F=!1}=i;Se()&&(0,_.J0)(!1);let ae=l.replace(/^\/*/,"/"),X=L.useMemo(()=>({basename:ae,navigator:A,static:F}),[ae,A,F]);typeof m=="string"&&(m=(0,_.cP)(m));let{pathname:ie="/",search:le="",hash:ye="",state:te=null,key:tt="default"}=m,it=L.useMemo(()=>{let lt=(0,_.Zn)(ie,ae);return lt==null?null:{location:{pathname:lt,search:le,hash:ye,state:te,key:tt},navigationType:P}},[ae,ie,le,ye,te,tt,P]);return it==null?null:L.createElement(Fe.Provider,{value:X},L.createElement(je.Provider,{children:v,value:it}))}function qe(i){let{children:l,location:v}=i,m=L.useContext(be),P=m&&!l?m.router.routes:ot(l);return Te(P,v)}function at(i){let{children:l,errorElement:v,resolve:m}=i;return React.createElement(et,{resolve:m,errorElement:v},React.createElement(Rt,null,l))}var ue;(function(i){i[i.pending=0]="pending",i[i.success=1]="success",i[i.error=2]="error"})(ue||(ue={}));const xe=new Promise(()=>{});class et extends L.Component{constructor(l){super(l),this.state={error:null}}static getDerivedStateFromError(l){return{error:l}}componentDidCatch(l,v){console.error("<Await> caught the following error during render",l,v)}render(){let{children:l,errorElement:v,resolve:m}=this.props,P=null,A=ue.pending;if(!(m instanceof Promise))A=ue.success,P=Promise.resolve(),Object.defineProperty(P,"_tracked",{get:()=>!0}),Object.defineProperty(P,"_data",{get:()=>m});else if(this.state.error){A=ue.error;let F=this.state.error;P=Promise.reject().catch(()=>{}),Object.defineProperty(P,"_tracked",{get:()=>!0}),Object.defineProperty(P,"_error",{get:()=>F})}else m._tracked?(P=m,A=P._error!==void 0?ue.error:P._data!==void 0?ue.success:ue.pending):(A=ue.pending,Object.defineProperty(m,"_tracked",{get:()=>!0}),P=m.then(F=>Object.defineProperty(m,"_data",{get:()=>F}),F=>Object.defineProperty(m,"_error",{get:()=>F})));if(A===ue.error&&P._error instanceof AbortedDeferredError)throw xe;if(A===ue.error&&!v)throw P._error;if(A===ue.error)return React.createElement(Ye.Provider,{value:P,children:v});if(A===ue.success)return React.createElement(Ye.Provider,{value:P,children:l});throw P}}function Rt(i){let{children:l}=i,v=b(),m=typeof l=="function"?l(v):l;return React.createElement(React.Fragment,null,m)}function ot(i,l){l===void 0&&(l=[]);let v=[];return L.Children.forEach(i,(m,P)=>{if(!L.isValidElement(m))return;if(m.type===L.Fragment){v.push.apply(v,ot(m.props.children,l));return}m.type!==Ne&&(0,_.J0)(!1),!m.props.index||!m.props.children||(0,_.J0)(!1);let A=[...l,P],F={id:m.props.id||A.join("-"),caseSensitive:m.props.caseSensitive,element:m.props.element,Component:m.props.Component,index:m.props.index,path:m.props.path,loader:m.props.loader,action:m.props.action,errorElement:m.props.errorElement,ErrorBoundary:m.props.ErrorBoundary,hasErrorBoundary:m.props.ErrorBoundary!=null||m.props.errorElement!=null,shouldRevalidate:m.props.shouldRevalidate,handle:m.props.handle,lazy:m.props.lazy};m.props.children&&(F.children=ot(m.props.children,A)),v.push(F)}),v}function Kt(i){return ze(i)}function Jt(i){return Boolean(i.ErrorBoundary)||Boolean(i.errorElement)}function tr(i,l){return createRouter({basename:l==null?void 0:l.basename,history:createMemoryHistory({initialEntries:l==null?void 0:l.initialEntries,initialIndex:l==null?void 0:l.initialIndex}),hydrationData:l==null?void 0:l.hydrationData,routes:i,detectErrorBoundary:Jt}).initialize()}}}]);})();
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=module-react-router-dom.34e67991.js.map
|