@techdocs/cli 1.8.0-next.1 → 1.8.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.58e94ce8.js → main.2d8911ca.js} +3 -3
- package/dist/embedded-app/static/main.2d8911ca.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.2d8911ca.js} +1 -1
- package/dist/embedded-app/static/{runtime.58e94ce8.js.map → runtime.2d8911ca.js.map} +1 -1
- package/dist/embedded-app/static/vendor.2d8911ca.js +164 -0
- package/dist/embedded-app/static/vendor.2d8911ca.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- 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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5109],{71597:function(ta,yr,ye){ye.d(yr,{VK:function(){return Cn},rU:function(){return _n}});var Q=ye(2784),vr=ye.t(Q,2),wr=ye(28316),Rr=ye.t(wr,2),Le=ye(73557),Pt=ye(84800);/**
|
|
2
|
+
* @remix-run/router v1.13.1
|
|
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 M(){return M=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},M.apply(this,arguments)}var k;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(k||(k={}));const xt="popstate";function ra(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((w,v)=>h(w,typeof w=="string"?null:w.state,v===0?"default":void 0));let o=l(r==null?a.length-1:r),i=k.Pop,s=null;function l(w){return Math.min(Math.max(w,0),a.length-1)}function d(){return a[o]}function h(w,v,R){v===void 0&&(v=null);let m=se(a?d().pathname:"/",w,v,R);return ie(m.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(w)),m}function g(w){return typeof w=="string"?w:ue(w)}return{get index(){return o},get action(){return i},get location(){return d()},createHref:g,createURL(w){return new URL(g(w),"http://localhost")},encodeLocation(w){let v=typeof w=="string"?oe(w):w;return{pathname:v.pathname||"",search:v.search||"",hash:v.hash||""}},push(w,v){i=k.Push;let R=h(w,v);o+=1,a.splice(o,a.length,R),n&&s&&s({action:i,location:R,delta:1})},replace(w,v){i=k.Replace;let R=h(w,v);a[o]=R,n&&s&&s({action:i,location:R,delta:0})},go(w){i=k.Pop;let v=l(o+w),R=a[v];o=v,s&&s({action:i,location:R,delta:w})},listen(w){return s=w,()=>{s=null}}}}function br(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:i,hash:s}=n.location;return se("",{pathname:o,search:i,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ue(a)}return Dt(t,r,null,e)}function na(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:s="",hash:l=""}=oe(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),se("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(a,o){let i=a.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let l=a.location.href,d=l.indexOf("#");s=d===-1?l:l.slice(0,d)}return s+"#"+(typeof o=="string"?o:ue(o))}function n(a,o){ie(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Dt(t,r,n,e)}function N(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function ie(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function Sr(){return Math.random().toString(36).substr(2,8)}function Lt(e,t){return{usr:e.state,key:e.key,idx:t}}function se(e,t,r,n){return r===void 0&&(r=null),M({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?oe(t):t,{state:r,key:t&&t.key||n||Sr()})}function ue(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 oe(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 Dt(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s=k.Pop,l=null,d=h();d==null&&(d=0,i.replaceState(M({},i.state,{idx:d}),""));function h(){return(i.state||{idx:null}).idx}function g(){s=k.Pop;let m=h(),E=m==null?null:m-d;d=m,l&&l({action:s,location:R.location,delta:E})}function y(m,E){s=k.Push;let D=se(R.location,m,E);r&&r(D,m),d=h()+1;let L=Lt(D,d),c=R.createHref(D);try{i.pushState(L,"",c)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(c)}o&&l&&l({action:s,location:R.location,delta:1})}function w(m,E){s=k.Replace;let D=se(R.location,m,E);r&&r(D,m),d=h();let L=Lt(D,d),c=R.createHref(D);i.replaceState(L,"",c),o&&l&&l({action:s,location:R.location,delta:0})}function v(m){let E=a.location.origin!=="null"?a.location.origin:a.location.href,D=typeof m=="string"?m:ue(m);return N(E,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,E)}let R={get action(){return s},get location(){return e(a,i)},listen(m){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(xt,g),l=m,()=>{a.removeEventListener(xt,g),l=null}},createHref(m){return t(a,m)},createURL:v,encodeLocation(m){let E=v(m);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:w,go(m){return i.go(m)}};return R}var O;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(O||(O={}));const Er=new Set(["lazy","caseSensitive","path","id","index","children"]);function Pr(e){return e.index===!0}function Ge(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,o)=>{let i=[...r,o],s=typeof a.id=="string"?a.id:i.join("-");if(N(a.index!==!0||!a.children,"Cannot specify children on an index route"),N(!n[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Pr(a)){let l=M({},a,t(a),{id:s});return n[s]=l,l}else{let l=M({},a,t(a),{id:s,children:void 0});return n[s]=l,a.children&&(l.children=Ge(a.children,t,i,n)),l}})}function ve(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?oe(t):t,a=Ne(n.pathname||"/",r);if(a==null)return null;let o=Tt(e);Lr(o);let i=null;for(let s=0;i==null&&s<o.length;++s)i=Nr(o[s],Ir(a));return i}function xr(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 Tt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(N(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let d=je([n,l.relativePath]),h=r.concat(l);o.children&&o.children.length>0&&(N(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Tt(o.children,t,h,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:Ur(d,o.index),routesMeta:h})};return e.forEach((o,i)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))a(o,i);else for(let l of Ct(o.path))a(o,i,l)}),t}function Ct(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Ct(n.join("/")),s=[];return s.push(...i.map(l=>l===""?o:[o,l].join("/"))),a&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Lr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Mr(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Dr=/^:\w+$/,Tr=3,Cr=2,Ar=1,Fr=10,_r=null,At=e=>e==="*";function Ur(e,t){let r=e.split("/"),n=r.length;return r.some(At)&&(n+=_r),t&&(n+=Cr),r.filter(a=>!At(a)).reduce((a,o)=>a+(Dr.test(o)?Tr:o===""?Ar:Fr),n)}function Mr(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 Nr(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let i=0;i<r.length;++i){let s=r[i],l=i===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=jr({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},d);if(!h)return null;Object.assign(n,h.params);let g=s.route;o.push({params:n,pathname:je([a,h.pathname]),pathnameBase:Kr(je([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=je([a,h.pathnameBase]))}return o}function aa(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(ie(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=i=>i==null?"":typeof i=="string"?i:String(i),o=r.split(/\/+/).map((i,s,l)=>{if(s===l.length-1&&i==="*")return a(t["*"]);const h=i.match(/^:(\w+)(\??)$/);if(h){const[,g,y]=h;let w=t[g];return N(y==="?"||w!=null,'Missing ":'+g+'" param'),a(w)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+o.join("/")}function jr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Or(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((d,h,g)=>{let{paramName:y,isOptional:w}=h;if(y==="*"){let R=s[g]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const v=s[g];return w&&!v?d[y]=void 0:d[y]=Hr(v||"",y),d},{}),pathname:o,pathnameBase:i,pattern:e}}function Or(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(i,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Ir(e){try{return decodeURI(e)}catch(t){return ie(!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 Hr(e,t){try{return decodeURIComponent(e)}catch(r){return ie(!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 Ne(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 Br(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?oe(e):e;return{pathname:r?r.startsWith("/")?r:kr(r,t):t,search:Wr(n),hash:Vr(a)}}function kr(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 it(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 Ft(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function zr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=oe(e):(a=M({},e),N(!a.pathname||!a.pathname.includes("?"),it("?","pathname","search",a)),N(!a.pathname||!a.pathname.includes("#"),it("#","pathname","hash",a)),N(!a.search||!a.search.includes("#"),it("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,s;if(i==null)s=r;else if(n){let g=t[t.length-1].replace(/^\//,"").split("/");if(i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),g.pop();a.pathname=y.join("/")}s="/"+g.join("/")}else{let g=t.length-1;if(i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),g-=1;a.pathname=y.join("/")}s=g>=0?t[g]:"/"}let l=Br(a,s),d=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||h)&&(l.pathname+="/"),l}function ia(e){return e===""||e.pathname===""?"/":typeof e=="string"?oe(e).pathname:e.pathname}const je=e=>e.join("/").replace(/\/\/+/g,"/"),Kr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oa=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),M({},n,{headers:a}))};class _t extends null{}class $r{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],N(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((o,i)=>n=i),this.controller=new AbortController;let a=()=>n(new _t("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((o,i)=>{let[s,l]=i;return Object.assign(o,{[s]:this.trackPromise(s,l)})},{}),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 _t)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 o=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:()=>o}),this.emit(!1,r),Promise.reject(o)}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(o=>{t.removeEventListener("abort",n),(o||this.done)&&a(o)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return N(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]:Jr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Yr(e){return e instanceof Promise&&e._tracked===!0}function Jr(e){if(!Yr(e))return e;if(e._error)throw e._error;return e._data}const la=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new $r(t,n)},Gr=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,M({},n,{headers:a}))},sa=(e,t)=>{let r=Gr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Ut{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 Mt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Nt=["post","put","patch","delete"],Xr=new Set(Nt),Qr=["get",...Nt],Zr=new Set(Qr),qr=new Set([301,302,303,307,308]),en=new Set([307,308]),ot={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Oe={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ot=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),It="remix-router-transitions";function ua(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;N(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 u=e.detectErrorBoundary;a=f=>({hasErrorBoundary:u(f)})}else a=Ot;let o={},i=Ge(e.routes,a,void 0,o),s,l=e.basename||"/",d=M({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,g=new Set,y=null,w=null,v=null,R=e.hydrationData!=null,m=ve(i,e.history.location,l),E=null;if(m==null){let u=K(404,{pathname:e.history.location.pathname}),{matches:f,route:p}=Xe(i);m=f,E={[p.id]:u}}let D=!m.some(u=>u.route.lazy)&&(!m.some(u=>u.route.loader)||e.hydrationData!=null),L,c={historyAction:e.history.action,location:e.history.location,matches:m,initialized:D,navigation:ot,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||E,fetchers:new Map,blockers:new Map},_=k.Pop,j=!1,S,W=!1,B=new Map,ee=null,Y=!1,ne=!1,te=[],Ae=[],V=new Map,tt=0,Ke=-1,Fe=new Map,ce=new Set,_e=new Map,We=new Map,de=new Set,Se=new Map,Ee=new Map,yt=!1;function Bn(){if(h=e.history.listen(u=>{let{action:f,location:p,delta:b}=u;if(yt){yt=!1;return}ie(Ee.size===0||b!=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 P=hr({currentLocation:c.location,nextLocation:p,historyAction:f});if(P&&b!=null){yt=!0,e.history.go(b*-1),nt(P,{state:"blocked",location:p,proceed(){nt(P,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),e.history.go(b)},reset(){let A=new Map(c.blockers);A.set(P,Oe),X({blockers:A})}});return}return Pe(f,p)}),r){fn(t,B);let u=()=>hn(t,B);t.addEventListener("pagehide",u),ee=()=>t.removeEventListener("pagehide",u)}return c.initialized||Pe(k.Pop,c.location),L}function kn(){h&&h(),ee&&ee(),g.clear(),S&&S.abort(),c.fetchers.forEach((u,f)=>rt(f)),c.blockers.forEach((u,f)=>fr(f))}function zn(u){return g.add(u),()=>g.delete(u)}function X(u,f){f===void 0&&(f={}),c=M({},c,u);let p=[],b=[];d.v7_fetcherPersist&&c.fetchers.forEach((P,A)=>{P.state==="idle"&&(de.has(A)?b.push(A):p.push(A))}),[...g].forEach(P=>P(c,{deletedFetchers:b,unstable_viewTransitionOpts:f.viewTransitionOpts,unstable_flushSync:f.flushSync===!0})),d.v7_fetcherPersist&&(p.forEach(P=>c.fetchers.delete(P)),b.forEach(P=>rt(P)))}function Ve(u,f,p){var b,P;let{flushSync:A}=p===void 0?{}:p,C=c.actionData!=null&&c.navigation.formMethod!=null&&Z(c.navigation.formMethod)&&c.navigation.state==="loading"&&((b=u.state)==null?void 0:b._isRedirect)!==!0,T;f.actionData?Object.keys(f.actionData).length>0?T=f.actionData:T=null:C?T=c.actionData:T=null;let x=f.loaderData?Jt(c.loaderData,f.loaderData,f.matches||[],f.errors):c.loaderData,U=c.blockers;U.size>0&&(U=new Map(U),U.forEach((I,z)=>U.set(z,Oe)));let J=j===!0||c.navigation.formMethod!=null&&Z(c.navigation.formMethod)&&((P=u.state)==null?void 0:P._isRedirect)!==!0;s&&(i=s,s=void 0),Y||_===k.Pop||(_===k.Push?e.history.push(u,u.state):_===k.Replace&&e.history.replace(u,u.state));let F;if(_===k.Pop){let I=B.get(c.location.pathname);I&&I.has(u.pathname)?F={currentLocation:c.location,nextLocation:u}:B.has(u.pathname)&&(F={currentLocation:u,nextLocation:c.location})}else if(W){let I=B.get(c.location.pathname);I?I.add(u.pathname):(I=new Set([u.pathname]),B.set(c.location.pathname,I)),F={currentLocation:c.location,nextLocation:u}}X(M({},f,{actionData:T,loaderData:x,historyAction:_,location:u,initialized:!0,navigation:ot,revalidation:"idle",restoreScrollPosition:pr(u,f.matches||c.matches),preventScrollReset:J,blockers:U}),{viewTransitionOpts:F,flushSync:A===!0}),_=k.Pop,j=!1,W=!1,Y=!1,ne=!1,te=[],Ae=[]}async function or(u,f){if(typeof u=="number"){e.history.go(u);return}let p=lt(c.location,c.matches,l,d.v7_prependBasename,u,f==null?void 0:f.fromRouteId,f==null?void 0:f.relative),{path:b,submission:P,error:A}=Ht(d.v7_normalizeFormMethod,!1,p,f),C=c.location,T=se(c.location,b,f&&f.state);T=M({},T,e.history.encodeLocation(T));let x=f&&f.replace!=null?f.replace:void 0,U=k.Push;x===!0?U=k.Replace:x===!1||P!=null&&Z(P.formMethod)&&P.formAction===c.location.pathname+c.location.search&&(U=k.Replace);let J=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,F=(f&&f.unstable_flushSync)===!0,I=hr({currentLocation:C,nextLocation:T,historyAction:U});if(I){nt(I,{state:"blocked",location:T,proceed(){nt(I,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),or(u,f)},reset(){let z=new Map(c.blockers);z.set(I,Oe),X({blockers:z})}});return}return await Pe(U,T,{submission:P,pendingError:A,preventScrollReset:J,replace:f&&f.replace,enableViewTransition:f&&f.unstable_viewTransition,flushSync:F})}function Kn(){if(vt(),X({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){Pe(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}Pe(_||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function Pe(u,f,p){S&&S.abort(),S=null,_=u,Y=(p&&p.startUninterruptedRevalidation)===!0,Zn(c.location,c.matches),j=(p&&p.preventScrollReset)===!0,W=(p&&p.enableViewTransition)===!0;let b=s||i,P=p&&p.overrideNavigation,A=ve(b,f,l),C=(p&&p.flushSync)===!0;if(!A){let z=K(404,{pathname:f.pathname}),{matches:G,route:le}=Xe(b);wt(),Ve(f,{matches:G,loaderData:{},errors:{[le.id]:z}},{flushSync:C});return}if(c.initialized&&!ne&&on(c.location,f)&&!(p&&p.submission&&Z(p.submission.formMethod))){Ve(f,{matches:A},{flushSync:C});return}S=new AbortController;let T=Ie(e.history,f,S.signal,p&&p.submission),x,U;if(p&&p.pendingError)U={[De(A).route.id]:p.pendingError};else if(p&&p.submission&&Z(p.submission.formMethod)){let z=await Wn(T,f,p.submission,A,{replace:p.replace,flushSync:C});if(z.shortCircuited)return;x=z.pendingActionData,U=z.pendingActionError,P=dt(f,p.submission),C=!1,T=new Request(T.url,{signal:T.signal})}let{shortCircuited:J,loaderData:F,errors:I}=await Vn(T,f,A,P,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,C,x,U);J||(S=null,Ve(f,M({matches:A},x?{actionData:x}:{},{loaderData:F,errors:I})))}async function Wn(u,f,p,b,P){P===void 0&&(P={}),vt();let A=cn(f,p);X({navigation:A},{flushSync:P.flushSync===!0});let C,T=He(b,f);if(!T.route.action&&!T.route.lazy)C={type:O.error,error:K(405,{method:u.method,pathname:f.pathname,routeId:T.route.id})};else if(C=await we("action",u,T,b,o,a,l),u.signal.aborted)return{shortCircuited:!0};if(be(C)){let x;return P&&P.replace!=null?x=P.replace:x=C.location===c.location.pathname+c.location.search,await $e(c,C,{submission:p,replace:x}),{shortCircuited:!0}}if(Re(C)){let x=De(b,T.route.id);return(P&&P.replace)!==!0&&(_=k.Push),{pendingActionData:{},pendingActionError:{[x.route.id]:C.error}}}if(fe(C))throw K(400,{type:"defer-action"});return{pendingActionData:{[T.route.id]:C.data}}}async function Vn(u,f,p,b,P,A,C,T,x,U){let J=b||dt(f,P),F=P||A||qt(J),I=s||i,[z,G]=kt(e.history,c,p,F,f,ne,te,Ae,de,_e,ce,I,l,x,U);if(wt(H=>!(p&&p.some(re=>re.route.id===H))||z&&z.some(re=>re.route.id===H)),Ke=++tt,z.length===0&&G.length===0){let H=cr();return Ve(f,M({matches:p,loaderData:{},errors:U||null},x?{actionData:x}:{},H?{fetchers:new Map(c.fetchers)}:{}),{flushSync:T}),{shortCircuited:!0}}if(!Y){G.forEach(re=>{let $=c.fetchers.get(re.key),xe=Be(void 0,$?$.data:void 0);c.fetchers.set(re.key,xe)});let H=x||c.actionData;X(M({navigation:J},H?Object.keys(H).length===0?{actionData:null}:{actionData:H}:{},G.length>0?{fetchers:new Map(c.fetchers)}:{}),{flushSync:T})}G.forEach(H=>{V.has(H.key)&&ge(H.key),H.controller&&V.set(H.key,H.controller)});let le=()=>G.forEach(H=>ge(H.key));S&&S.signal.addEventListener("abort",le);let{results:Je,loaderResults:Rt,fetcherResults:Ue}=await lr(c.matches,p,z,G,u);if(u.signal.aborted)return{shortCircuited:!0};S&&S.signal.removeEventListener("abort",le),G.forEach(H=>V.delete(H.key));let ae=Gt(Je);if(ae){if(ae.idx>=z.length){let H=G[ae.idx-z.length].key;ce.add(H)}return await $e(c,ae.result,{replace:C}),{shortCircuited:!0}}let{loaderData:at,errors:bt}=Yt(c,p,z,Rt,U,G,Ue,Se);Se.forEach((H,re)=>{H.subscribe($=>{($||H.done)&&Se.delete(re)})});let St=cr(),Et=dr(Ke),Me=St||Et||G.length>0;return M({loaderData:at,errors:bt},Me?{fetchers:new Map(c.fetchers)}:{})}function $n(u,f,p,b){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.");V.has(u)&&ge(u);let P=(b&&b.unstable_flushSync)===!0,A=s||i,C=lt(c.location,c.matches,l,d.v7_prependBasename,p,f,b==null?void 0:b.relative),T=ve(A,C,l);if(!T){Ye(u,f,K(404,{pathname:C}),{flushSync:P});return}let{path:x,submission:U,error:J}=Ht(d.v7_normalizeFormMethod,!0,C,b);if(J){Ye(u,f,J,{flushSync:P});return}let F=He(T,x);if(j=(b&&b.preventScrollReset)===!0,U&&Z(U.formMethod)){Yn(u,f,x,F,T,P,U);return}_e.set(u,{routeId:f,path:x}),Jn(u,f,x,F,T,P,U)}async function Yn(u,f,p,b,P,A,C){if(vt(),_e.delete(u),!b.route.action&&!b.route.lazy){let $=K(405,{method:C.formMethod,pathname:p,routeId:f});Ye(u,f,$,{flushSync:A});return}let T=c.fetchers.get(u);pe(u,dn(C,T),{flushSync:A});let x=new AbortController,U=Ie(e.history,p,x.signal,C);V.set(u,x);let J=tt,F=await we("action",U,b,P,o,a,l);if(U.signal.aborted){V.get(u)===x&&V.delete(u);return}if(de.has(u)){pe(u,he(void 0));return}if(be(F))if(V.delete(u),Ke>J){pe(u,he(void 0));return}else return ce.add(u),pe(u,Be(C)),$e(c,F,{fetcherSubmission:C});if(Re(F)){Ye(u,f,F.error);return}if(fe(F))throw K(400,{type:"defer-action"});let I=c.navigation.location||c.location,z=Ie(e.history,I,x.signal),G=s||i,le=c.navigation.state!=="idle"?ve(G,c.navigation.location,l):c.matches;N(le,"Didn't find any matches after fetcher action");let Je=++tt;Fe.set(u,Je);let Rt=Be(C,F.data);c.fetchers.set(u,Rt);let[Ue,ae]=kt(e.history,c,le,C,I,ne,te,Ae,de,_e,ce,G,l,{[b.route.id]:F.data},void 0);ae.filter($=>$.key!==u).forEach($=>{let xe=$.key,gr=c.fetchers.get(xe),ea=Be(void 0,gr?gr.data:void 0);c.fetchers.set(xe,ea),V.has(xe)&&ge(xe),$.controller&&V.set(xe,$.controller)}),X({fetchers:new Map(c.fetchers)});let at=()=>ae.forEach($=>ge($.key));x.signal.addEventListener("abort",at);let{results:bt,loaderResults:St,fetcherResults:Et}=await lr(c.matches,le,Ue,ae,z);if(x.signal.aborted)return;x.signal.removeEventListener("abort",at),Fe.delete(u),V.delete(u),ae.forEach($=>V.delete($.key));let Me=Gt(bt);if(Me){if(Me.idx>=Ue.length){let $=ae[Me.idx-Ue.length].key;ce.add($)}return $e(c,Me.result)}let{loaderData:H,errors:re}=Yt(c,c.matches,Ue,St,void 0,ae,Et,Se);if(c.fetchers.has(u)){let $=he(F.data);c.fetchers.set(u,$)}dr(Je),c.navigation.state==="loading"&&Je>Ke?(N(_,"Expected pending action"),S&&S.abort(),Ve(c.navigation.location,{matches:le,loaderData:H,errors:re,fetchers:new Map(c.fetchers)})):(X({errors:re,loaderData:Jt(c.loaderData,H,le,re),fetchers:new Map(c.fetchers)}),ne=!1)}async function Jn(u,f,p,b,P,A,C){let T=c.fetchers.get(u);pe(u,Be(C,T?T.data:void 0),{flushSync:A});let x=new AbortController,U=Ie(e.history,p,x.signal);V.set(u,x);let J=tt,F=await we("loader",U,b,P,o,a,l);if(fe(F)&&(F=await Zt(F,U.signal,!0)||F),V.get(u)===x&&V.delete(u),!U.signal.aborted){if(de.has(u)){pe(u,he(void 0));return}if(be(F))if(Ke>J){pe(u,he(void 0));return}else{ce.add(u),await $e(c,F);return}if(Re(F)){Ye(u,f,F.error);return}N(!fe(F),"Unhandled fetcher deferred data"),pe(u,he(F.data))}}async function $e(u,f,p){let{submission:b,fetcherSubmission:P,replace:A}=p===void 0?{}:p;f.revalidate&&(ne=!0);let C=se(u.location,f.location,{_isRedirect:!0});if(N(C,"Expected a location on the redirect navigation"),r){let I=!1;if(f.reloadDocument)I=!0;else if(jt.test(f.location)){const z=e.history.createURL(f.location);I=z.origin!==t.location.origin||Ne(z.pathname,l)==null}if(I){A?t.location.replace(f.location):t.location.assign(f.location);return}}S=null;let T=A===!0?k.Replace:k.Push,{formMethod:x,formAction:U,formEncType:J}=u.navigation;!b&&!P&&x&&U&&J&&(b=qt(u.navigation));let F=b||P;if(en.has(f.status)&&F&&Z(F.formMethod))await Pe(T,C,{submission:M({},F,{formAction:f.location}),preventScrollReset:j});else{let I=dt(C,b);await Pe(T,C,{overrideNavigation:I,fetcherSubmission:P,preventScrollReset:j})}}async function lr(u,f,p,b,P){let A=await Promise.all([...p.map(x=>we("loader",P,x,f,o,a,l)),...b.map(x=>x.matches&&x.match&&x.controller?we("loader",Ie(e.history,x.path,x.controller.signal),x.match,x.matches,o,a,l):{type:O.error,error:K(404,{pathname:x.path})})]),C=A.slice(0,p.length),T=A.slice(p.length);return await Promise.all([Qt(u,p,C,C.map(()=>P.signal),!1,c.loaderData),Qt(u,b.map(x=>x.match),T,b.map(x=>x.controller?x.controller.signal:null),!0)]),{results:A,loaderResults:C,fetcherResults:T}}function vt(){ne=!0,te.push(...wt()),_e.forEach((u,f)=>{V.has(f)&&(Ae.push(f),ge(f))})}function pe(u,f,p){p===void 0&&(p={}),c.fetchers.set(u,f),X({fetchers:new Map(c.fetchers)},{flushSync:(p&&p.flushSync)===!0})}function Ye(u,f,p,b){b===void 0&&(b={});let P=De(c.matches,f);rt(u),X({errors:{[P.route.id]:p},fetchers:new Map(c.fetchers)},{flushSync:(b&&b.flushSync)===!0})}function sr(u){return d.v7_fetcherPersist&&(We.set(u,(We.get(u)||0)+1),de.has(u)&&de.delete(u)),c.fetchers.get(u)||tn}function rt(u){let f=c.fetchers.get(u);V.has(u)&&!(f&&f.state==="loading"&&Fe.has(u))&&ge(u),_e.delete(u),Fe.delete(u),ce.delete(u),de.delete(u),c.fetchers.delete(u)}function Gn(u){if(d.v7_fetcherPersist){let f=(We.get(u)||0)-1;f<=0?(We.delete(u),de.add(u)):We.set(u,f)}else rt(u);X({fetchers:new Map(c.fetchers)})}function ge(u){let f=V.get(u);N(f,"Expected fetch controller: "+u),f.abort(),V.delete(u)}function ur(u){for(let f of u){let p=sr(f),b=he(p.data);c.fetchers.set(f,b)}}function cr(){let u=[],f=!1;for(let p of ce){let b=c.fetchers.get(p);N(b,"Expected fetcher: "+p),b.state==="loading"&&(ce.delete(p),u.push(p),f=!0)}return ur(u),f}function dr(u){let f=[];for(let[p,b]of Fe)if(b<u){let P=c.fetchers.get(p);N(P,"Expected fetcher: "+p),P.state==="loading"&&(ge(p),Fe.delete(p),f.push(p))}return ur(f),f.length>0}function Xn(u,f){let p=c.blockers.get(u)||Oe;return Ee.get(u)!==f&&Ee.set(u,f),p}function fr(u){c.blockers.delete(u),Ee.delete(u)}function nt(u,f){let p=c.blockers.get(u)||Oe;N(p.state==="unblocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="proceeding"||p.state==="blocked"&&f.state==="unblocked"||p.state==="proceeding"&&f.state==="unblocked","Invalid blocker state transition: "+p.state+" -> "+f.state);let b=new Map(c.blockers);b.set(u,f),X({blockers:b})}function hr(u){let{currentLocation:f,nextLocation:p,historyAction:b}=u;if(Ee.size===0)return;Ee.size>1&&ie(!1,"A router only supports one blocker at a time");let P=Array.from(Ee.entries()),[A,C]=P[P.length-1],T=c.blockers.get(A);if(!(T&&T.state==="proceeding")&&C({currentLocation:f,nextLocation:p,historyAction:b}))return A}function wt(u){let f=[];return Se.forEach((p,b)=>{(!u||u(b))&&(p.cancel(),f.push(b),Se.delete(b))}),f}function Qn(u,f,p){if(y=u,v=f,w=p||null,!R&&c.navigation===ot){R=!0;let b=pr(c.location,c.matches);b!=null&&X({restoreScrollPosition:b})}return()=>{y=null,v=null,w=null}}function mr(u,f){return w&&w(u,f.map(b=>xr(b,c.loaderData)))||u.key}function Zn(u,f){if(y&&v){let p=mr(u,f);y[p]=v()}}function pr(u,f){if(y){let p=mr(u,f),b=y[p];if(typeof b=="number")return b}return null}function qn(u){o={},s=Ge(u,a,void 0,o)}return L={get basename(){return l},get state(){return c},get routes(){return i},get window(){return t},initialize:Bn,subscribe:zn,enableScrollRestoration:Qn,navigate:or,fetch:$n,revalidate:Kn,createHref:u=>e.history.createHref(u),encodeLocation:u=>e.history.encodeLocation(u),getFetcher:sr,deleteFetcher:Gn,dispose:kn,getBlocker:Xn,deleteBlocker:fr,_internalFetchControllers:V,_internalActiveDeferreds:Se,_internalSetRoutes:qn},L}const rn=Symbol("deferred");function ca(e,t){N(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 g=t.detectErrorBoundary;a=y=>({hasErrorBoundary:g(y)})}else a=Ot;let o=Ge(e,a,void 0,r);async function i(g,y){let{requestContext:w}=y===void 0?{}:y,v=new URL(g.url),R=g.method,m=se("",ue(v),null,"default"),E=ve(o,m,n);if(!ut(R)&&R!=="HEAD"){let L=K(405,{method:R}),{matches:c,route:_}=Xe(o);return{basename:n,location:m,matches:c,loaderData:{},actionData:null,errors:{[_.id]:L},statusCode:L.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!E){let L=K(404,{pathname:m.pathname}),{matches:c,route:_}=Xe(o);return{basename:n,location:m,matches:c,loaderData:{},actionData:null,errors:{[_.id]:L},statusCode:L.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let D=await l(g,m,E,w);return Te(D)?D:M({location:m,basename:n},D)}async function s(g,y){let{routeId:w,requestContext:v}=y===void 0?{}:y,R=new URL(g.url),m=g.method,E=se("",ue(R),null,"default"),D=ve(o,E,n);if(!ut(m)&&m!=="HEAD"&&m!=="OPTIONS")throw K(405,{method:m});if(!D)throw K(404,{pathname:E.pathname});let L=w?D.find(S=>S.route.id===w):He(D,E);if(w&&!L)throw K(403,{pathname:E.pathname,routeId:w});if(!L)throw K(404,{pathname:E.pathname});let c=await l(g,E,D,v,L);if(Te(c))return c;let _=c.errors?Object.values(c.errors)[0]:void 0;if(_!==void 0)throw _;if(c.actionData)return Object.values(c.actionData)[0];if(c.loaderData){var j;let S=Object.values(c.loaderData)[0];return(j=c.activeDeferreds)!=null&&j[L.route.id]&&(S[rn]=c.activeDeferreds[L.route.id]),S}}async function l(g,y,w,v,R){N(g.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(Z(g.method.toLowerCase()))return await d(g,w,R||He(w,y),v,R!=null);let m=await h(g,w,v,R);return Te(m)?m:M({},m,{actionData:null,actionHeaders:{}})}catch(m){if(un(m)){if(m.type===O.error)throw m.response;return m.response}if(sn(m))return m;throw m}}async function d(g,y,w,v,R){let m;if(!w.route.action&&!w.route.lazy){let L=K(405,{method:g.method,pathname:new URL(g.url).pathname,routeId:w.route.id});if(R)throw L;m={type:O.error,error:L}}else if(m=await we("action",g,w,y,r,a,n,{isStaticRequest:!0,isRouteRequest:R,requestContext:v}),g.signal.aborted){let L=R?"queryRoute":"query";throw new Error(L+"() call aborted: "+g.method+" "+g.url)}if(be(m))throw new Response(null,{status:m.status,headers:{Location:m.location}});if(fe(m)){let L=K(400,{type:"defer-action"});if(R)throw L;m={type:O.error,error:L}}if(R){if(Re(m))throw m.error;return{matches:[w],loaderData:{},actionData:{[w.route.id]:m.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(Re(m)){let L=De(y,w.route.id),c=await h(g,y,v,void 0,{[L.route.id]:m.error});return M({},c,{statusCode:Mt(m.error)?m.error.status:500,actionData:null,actionHeaders:M({},m.headers?{[w.route.id]:m.headers}:{})})}let E=new Request(g.url,{headers:g.headers,redirect:g.redirect,signal:g.signal}),D=await h(E,y,v);return M({},D,m.statusCode?{statusCode:m.statusCode}:{},{actionData:{[w.route.id]:m.data},actionHeaders:M({},m.headers?{[w.route.id]:m.headers}:{})})}async function h(g,y,w,v,R){let m=v!=null;if(m&&!(v!=null&&v.route.loader)&&!(v!=null&&v.route.lazy))throw K(400,{method:g.method,pathname:new URL(g.url).pathname,routeId:v==null?void 0:v.route.id});let D=(v?[v]:Bt(y,Object.keys(R||{})[0])).filter(S=>S.route.loader||S.route.lazy);if(D.length===0)return{matches:y,loaderData:y.reduce((S,W)=>Object.assign(S,{[W.route.id]:null}),{}),errors:R||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let L=await Promise.all([...D.map(S=>we("loader",g,S,y,r,a,n,{isStaticRequest:!0,isRouteRequest:m,requestContext:w}))]);if(g.signal.aborted){let S=m?"queryRoute":"query";throw new Error(S+"() call aborted: "+g.method+" "+g.url)}let c=new Map,_=$t(y,D,L,R,c),j=new Set(D.map(S=>S.route.id));return y.forEach(S=>{j.has(S.route.id)||(_.loaderData[S.route.id]=null)}),M({},_,{matches:y,activeDeferreds:c.size>0?Object.fromEntries(c.entries()):null})}return{dataRoutes:o,query:i,queryRoute:s}}function da(e,t,r){return M({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function nn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function lt(e,t,r,n,a,o,i){let s,l;if(o){s=[];for(let h of t)if(s.push(h),h.route.id===o){l=h;break}}else s=t,l=t[t.length-1];let d=zr(a||".",Ft(s).map(h=>h.pathnameBase),Ne(e.pathname,r)||e.pathname,i==="path");return a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&l&&l.route.index&&!ct(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:je([r,d.pathname])),ue(d)}function Ht(e,t,r,n){if(!n||!nn(n))return{path:r};if(n.formMethod&&!ut(n.formMethod))return{path:r,error:K(405,{method:n.formMethod})};let a=()=>({path:r,error:K(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),s=Xt(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Z(i))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,v)=>{let[R,m]=v;return""+w+R+"="+m+`
|
|
11
|
+
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Z(i))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}N(typeof FormData=="function","FormData is not available in this environment");let l,d;if(n.formData)l=st(n.formData),d=n.formData;else if(n.body instanceof FormData)l=st(n.body),d=n.body;else if(n.body instanceof URLSearchParams)l=n.body,d=Vt(l);else if(n.body==null)l=new URLSearchParams,d=new FormData;else try{l=new URLSearchParams(n.body),d=Vt(l)}catch{return a()}let h={formMethod:i,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(Z(h.formMethod))return{path:r,submission:h};let g=oe(r);return t&&g.search&&ct(g.search)&&l.append("index",""),g.search="?"+l,{path:ue(g),submission:h}}function Bt(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 kt(e,t,r,n,a,o,i,s,l,d,h,g,y,w,v){let R=v?Object.values(v)[0]:w?Object.values(w)[0]:void 0,m=e.createURL(t.location),E=e.createURL(a),D=v?Object.keys(v)[0]:void 0,c=Bt(r,D).filter((j,S)=>{if(j.route.lazy)return!0;if(j.route.loader==null)return!1;if(an(t.loaderData,t.matches[S],j)||i.some(ee=>ee===j.route.id))return!0;let W=t.matches[S],B=j;return Kt(j,M({currentUrl:m,currentParams:W.params,nextUrl:E,nextParams:B.params},n,{actionResult:R,defaultShouldRevalidate:o||m.pathname+m.search===E.pathname+E.search||m.search!==E.search||zt(W,B)}))}),_=[];return d.forEach((j,S)=>{if(!r.some(ne=>ne.route.id===j.routeId)||l.has(S))return;let W=ve(g,j.path,y);if(!W){_.push({key:S,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let B=t.fetchers.get(S),ee=He(W,j.path),Y=!1;h.has(S)?Y=!1:s.includes(S)?Y=!0:B&&B.state!=="idle"&&B.data===void 0?Y=o:Y=Kt(ee,M({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:r[r.length-1].params},n,{actionResult:R,defaultShouldRevalidate:o})),Y&&_.push({key:S,routeId:j.routeId,path:j.path,matches:W,match:ee,controller:new AbortController})}),[c,_]}function an(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function zt(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Kt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function Wt(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];N(a,"No route found in manifest");let o={};for(let i in n){let l=a[i]!==void 0&&i!=="hasErrorBoundary";ie(!l,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!l&&!Er.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,M({},t(a),{lazy:void 0}))}async function we(e,t,r,n,a,o,i,s){s===void 0&&(s={});let l,d,h,g=v=>{let R,m=new Promise((E,D)=>R=D);return h=()=>R(),t.signal.addEventListener("abort",h),Promise.race([v({request:t,params:r.params,context:s.requestContext}),m])};try{let v=r.route[e];if(r.route.lazy)if(v){let R,m=await Promise.all([g(v).catch(E=>{R=E}),Wt(r.route,o,a)]);if(R)throw R;d=m[0]}else if(await Wt(r.route,o,a),v=r.route[e],v)d=await g(v);else if(e==="action"){let R=new URL(t.url),m=R.pathname+R.search;throw K(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:O.data,data:void 0};else if(v)d=await g(v);else{let R=new URL(t.url),m=R.pathname+R.search;throw K(404,{pathname:m})}N(d!==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(v){l=O.error,d=v}finally{h&&t.signal.removeEventListener("abort",h)}if(Te(d)){let v=d.status;if(qr.has(v)){let E=d.headers.get("Location");if(N(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!jt.test(E))E=lt(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,E);else if(!s.isStaticRequest){let D=new URL(t.url),L=E.startsWith("//")?new URL(D.protocol+E):new URL(E),c=Ne(L.pathname,i)!=null;L.origin===D.origin&&c&&(E=L.pathname+L.search+L.hash)}if(s.isStaticRequest)throw d.headers.set("Location",E),d;return{type:O.redirect,status:v,location:E,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:l===O.error?O.error:O.data,response:d};let R,m=d.headers.get("Content-Type");return m&&/\bapplication\/json\b/.test(m)?R=await d.json():R=await d.text(),l===O.error?{type:l,error:new Ut(v,d.statusText,R),headers:d.headers}:{type:O.data,data:R,statusCode:d.status,headers:d.headers}}if(l===O.error)return{type:l,error:d};if(ln(d)){var y,w;return{type:O.deferred,deferredData:d,statusCode:(y=d.init)==null?void 0:y.status,headers:((w=d.init)==null?void 0:w.headers)&&new Headers(d.init.headers)}}return{type:O.data,data:d}}function Ie(e,t,r,n){let a=e.createURL(Xt(t)).toString(),o={signal:r};if(n&&Z(n.formMethod)){let{formMethod:i,formEncType:s}=n;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=st(n.formData):o.body=n.formData}return new Request(a,o)}function st(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Vt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function $t(e,t,r,n,a){let o={},i=null,s,l=!1,d={};return r.forEach((h,g)=>{let y=t[g].route.id;if(N(!be(h),"Cannot handle redirect results in processLoaderData"),Re(h)){let w=De(e,y),v=h.error;n&&(v=Object.values(n)[0],n=void 0),i=i||{},i[w.route.id]==null&&(i[w.route.id]=v),o[y]=void 0,l||(l=!0,s=Mt(h.error)?h.error.status:500),h.headers&&(d[y]=h.headers)}else fe(h)?(a.set(y,h.deferredData),o[y]=h.deferredData.data):o[y]=h.data,h.statusCode!=null&&h.statusCode!==200&&!l&&(s=h.statusCode),h.headers&&(d[y]=h.headers)}),n&&(i=n,o[Object.keys(n)[0]]=void 0),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:d}}function Yt(e,t,r,n,a,o,i,s){let{loaderData:l,errors:d}=$t(t,r,n,a,s);for(let h=0;h<o.length;h++){let{key:g,match:y,controller:w}=o[h];N(i!==void 0&&i[h]!==void 0,"Did not find corresponding fetcher result");let v=i[h];if(!(w&&w.signal.aborted))if(Re(v)){let R=De(e.matches,y==null?void 0:y.route.id);d&&d[R.route.id]||(d=M({},d,{[R.route.id]:v.error})),e.fetchers.delete(g)}else if(be(v))N(!1,"Unhandled fetcher revalidation redirect");else if(fe(v))N(!1,"Unhandled fetcher deferred data");else{let R=he(v.data);e.fetchers.set(g,R)}}return{loaderData:l,errors:d}}function Jt(e,t,r,n){let a=M({},t);for(let o of r){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function De(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 Xe(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 K(e,t){let{pathname:r,routeId:n,method:a,type:o}=t===void 0?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?s="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.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",s='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?s="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&&(s='Invalid request method "'+a.toUpperCase()+'"')),new Ut(e||500,i,new Error(s),!0)}function Gt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(be(r))return{result:r,idx:t}}}function Xt(e){let t=typeof e=="string"?oe(e):e;return ue(M({},t,{hash:""}))}function on(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function fe(e){return e.type===O.deferred}function Re(e){return e.type===O.error}function be(e){return(e&&e.type)===O.redirect}function ln(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 Te(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function sn(e){if(!Te(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function un(e){return e&&Te(e.response)&&(e.type===O.data||e.type===O.error)}function ut(e){return Zr.has(e.toLowerCase())}function Z(e){return Xr.has(e.toLowerCase())}async function Qt(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let s=r[i],l=t[i];if(!l)continue;let d=e.find(g=>g.route.id===l.route.id),h=d!=null&&!zt(d,l)&&(o&&o[l.route.id])!==void 0;if(fe(s)&&(a||h)){let g=n[i];N(g,"Expected an AbortSignal for revalidating fetcher deferred result"),await Zt(s,g,a).then(y=>{y&&(r[i]=y||r[i])})}}}async function Zt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:O.data,data:e.deferredData.unwrappedData}}catch(a){return{type:O.error,error:a}}return{type:O.data,data:e.deferredData.data}}}function ct(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function He(e,t){let r=typeof t=="string"?oe(t).search:t.search;if(e[e.length-1].route.index&&ct(r||""))return e[e.length-1];let n=Ft(e);return n[n.length-1]}function qt(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function dt(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 cn(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 Be(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 dn(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 he(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 fn(e,t){try{let r=e.sessionStorage.getItem(It);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function hn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(It,JSON.stringify(r))}catch(n){ie(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
12
|
+
* React Router DOM v6.20.1
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Remix Software Inc.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
18
|
+
*
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/function q(){return q=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},q.apply(this,arguments)}function mn(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}const ft="get",ht="application/x-www-form-urlencoded";function Qe(e){return e!=null&&typeof e.tagName=="string"}function pn(e){return Qe(e)&&e.tagName.toLowerCase()==="button"}function gn(e){return Qe(e)&&e.tagName.toLowerCase()==="form"}function yn(e){return Qe(e)&&e.tagName.toLowerCase()==="input"}function vn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wn(e,t){return e.button===0&&(!t||t==="_self")&&!vn(e)}function mt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Rn(e,t){let r=mt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let Ze=null;function bn(){if(Ze===null)try{new FormData(document.createElement("form"),0),Ze=!1}catch{Ze=!0}return Ze}const Sn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pt(e){return e!=null&&!Sn.has(e)?null:e}function En(e,t){let r,n,a,o,i;if(gn(e)){let s=e.getAttribute("action");n=s?stripBasename(s,t):null,r=e.getAttribute("method")||ft,a=pt(e.getAttribute("enctype"))||ht,o=new FormData(e)}else if(pn(e)||yn(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?stripBasename(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||ft,a=pt(e.getAttribute("formenctype"))||pt(s.getAttribute("enctype"))||ht,o=new FormData(s,e),!bn()){let{name:d,type:h,value:g}=e;if(h==="image"){let y=d?d+".":"";o.append(y+"x","0"),o.append(y+"y","0")}else d&&o.append(d,g)}}else{if(Qe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ft,n=null,a=ht,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const Pn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],fa=null,ha=null;function ma(e,t){return createRouter({basename:t==null?void 0:t.basename,future:q({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||er(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function pa(e,t){return createRouter({basename:t==null?void 0:t.basename,future:q({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:createHashHistory({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||er(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function er(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=q({},t,{errors:xn(t.errors)})),t}function xn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new UNSAFE_ErrorResponseImpl(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack="",r[n]=o}}else r[n]=a;return r}const tr=Q.createContext({isTransitioning:!1}),rr=Q.createContext(new Map),me=vr["startTransition"],nr=Rr["flushSync"];function Ln(e){me?me(e):e()}function ke(e){nr?nr(e):e()}class Dn{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function va(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=React.useState(r.state),[i,s]=React.useState(),[l,d]=React.useState({isTransitioning:!1}),[h,g]=React.useState(),[y,w]=React.useState(),[v,R]=React.useState(),m=React.useRef(new Map),{v7_startTransition:E}=n||{},D=React.useCallback(S=>{E?Ln(S):S()},[E]),L=React.useCallback((S,W)=>{let{deletedFetchers:B,unstable_flushSync:ee,unstable_viewTransitionOpts:Y}=W;B.forEach(te=>m.current.delete(te)),S.fetchers.forEach((te,Ae)=>{te.data!==void 0&&m.current.set(Ae,te.data)});let ne=r.window==null||typeof r.window.document.startViewTransition!="function";if(!Y||ne){ee?ke(()=>o(S)):D(()=>o(S));return}if(ee){ke(()=>{y&&(h&&h.resolve(),y.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let te=r.window.document.startViewTransition(()=>{ke(()=>o(S))});te.finished.finally(()=>{ke(()=>{g(void 0),w(void 0),s(void 0),d({isTransitioning:!1})})}),ke(()=>w(te));return}y?(h&&h.resolve(),y.skipTransition(),R({state:S,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(s(S),d({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[r.window,y,h,m,D]);React.useLayoutEffect(()=>r.subscribe(L),[r,L]),React.useEffect(()=>{l.isTransitioning&&!l.flushSync&&g(new Dn)},[l]),React.useEffect(()=>{if(h&&i&&r.window){let S=i,W=h.promise,B=r.window.document.startViewTransition(async()=>{D(()=>o(S)),await W});B.finished.finally(()=>{g(void 0),w(void 0),s(void 0),d({isTransitioning:!1})}),w(B)}},[D,i,h,r.window]),React.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,y,a.location,i]),React.useEffect(()=>{!l.isTransitioning&&v&&(s(v.state),d({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),R(void 0))},[l.isTransitioning,v]);let c=React.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:S=>r.navigate(S),push:(S,W,B)=>r.navigate(S,{state:W,preventScrollReset:B==null?void 0:B.preventScrollReset}),replace:(S,W,B)=>r.navigate(S,{replace:!0,state:W,preventScrollReset:B==null?void 0:B.preventScrollReset})}),[r]),_=r.basename||"/",j=React.useMemo(()=>({router:r,navigator:c,static:!1,basename:_}),[r,c,_]);return React.createElement(React.Fragment,null,React.createElement(UNSAFE_DataRouterContext.Provider,{value:j},React.createElement(UNSAFE_DataRouterStateContext.Provider,{value:a},React.createElement(rr.Provider,{value:m.current},React.createElement(tr.Provider,{value:l},React.createElement(Router,{basename:_,location:a.location,navigationType:a.historyAction,navigator:c},a.initialized?React.createElement(Tn,{routes:r.routes,state:a}):t))))),null)}function Tn(e){let{routes:t,state:r}=e;return UNSAFE_useRoutesImpl(t,void 0,r)}function Cn(e){let{basename:t,children:r,future:n,window:a}=e,o=Q.useRef();o.current==null&&(o.current=br({window:a,v5Compat:!0}));let i=o.current,[s,l]=Q.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},h=Q.useCallback(g=>{d&&me?me(()=>l(g)):l(g)},[l,d]);return Q.useLayoutEffect(()=>i.listen(h),[i,h]),Q.createElement(Le.F0,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i})}function wa(e){let{basename:t,children:r,future:n,window:a}=e,o=React.useRef();o.current==null&&(o.current=createHashHistory({window:a,v5Compat:!0}));let i=o.current,[s,l]=React.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},h=React.useCallback(g=>{d&&me?me(()=>l(g)):l(g)},[l,d]);return React.useLayoutEffect(()=>i.listen(h),[i,h]),React.createElement(Router,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i})}function Ra(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=React.useState({action:a.action,location:a.location}),{v7_startTransition:s}=n||{},l=React.useCallback(d=>{s&&me?me(()=>i(d)):i(d)},[i,s]);return React.useLayoutEffect(()=>a.listen(l),[a,l]),React.createElement(Router,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a})}const An=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Fn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_n=Q.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:s,target:l,to:d,preventScrollReset:h,unstable_viewTransition:g}=t,y=mn(t,Pn),{basename:w}=Q.useContext(Le.Us),v,R=!1;if(typeof d=="string"&&Fn.test(d)&&(v=d,An))try{let L=new URL(window.location.href),c=d.startsWith("//")?new URL(L.protocol+d):new URL(d),_=Ne(c.pathname,w);c.origin===L.origin&&_!=null?d=_+c.search+c.hash:R=!0}catch{}let m=(0,Le.oQ)(d,{relative:a}),E=Mn(d,{replace:i,state:s,target:l,preventScrollReset:h,relative:a,unstable_viewTransition:g});function D(L){n&&n(L),L.defaultPrevented||E(L)}return Q.createElement("a",q({},y,{href:v||m,onClick:R||o?n:D,ref:r,target:l}))}),ba=null,Un=null;function Sa(e){let{getKey:t,storageKey:r}=e;return In({getKey:t,storageKey:r}),null}var Ce;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ce||(Ce={}));var ze;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ze||(ze={}));function Ea(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function qe(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function gt(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function Mn(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s}=t===void 0?{}:t,l=(0,Le.s0)(),d=(0,Le.TH)(),h=(0,Le.WU)(e,{relative:i});return Q.useCallback(g=>{if(wn(g,r)){g.preventDefault();let y=n!==void 0?n:(0,Pt.Ep)(d)===(0,Pt.Ep)(h);l(e,{replace:y,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s})}},[d,l,h,n,a,r,e,o,i,s])}function Pa(e){let t=React.useRef(mt(e)),r=React.useRef(!1),n=useLocation(),a=React.useMemo(()=>Rn(n.search,r.current?null:t.current),[n.search]),o=useNavigate(),i=React.useCallback((s,l)=>{const d=mt(typeof s=="function"?s(a):s);r.current=!0,o("?"+d,l)},[o,a]);return[a,i]}function Nn(){if(typeof document=="undefined")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let jn=0,ar=()=>"__"+String(++jn)+"__";function On(){let{router:e}=qe(Ce.UseSubmit),{basename:t}=React.useContext(UNSAFE_NavigationContext),r=UNSAFE_useRouteId();return React.useCallback(function(n,a){a===void 0&&(a={}),Nn();let{action:o,method:i,encType:s,formData:l,body:d}=En(n,t);if(a.navigate===!1){let h=a.fetcherKey||ar();e.fetch(h,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:d,formMethod:a.method||i,formEncType:a.encType||s,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:d,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function xa(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=React.useContext(UNSAFE_NavigationContext),a=React.useContext(UNSAFE_RouteContext);a||UNSAFE_invariant(!1);let[o]=a.matches.slice(-1),i=q({},useResolvedPath(e||".",{relative:r})),s=useLocation();if(e==null){i.search=s.search;let l=new URLSearchParams(i.search);l.has("index")&&l.get("index")===""&&(l.delete("index"),i.search=l.toString()?"?"+l.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:joinPaths([n,i.pathname])),createPath(i)}function La(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=qe(Ce.UseFetcher),a=gt(ze.UseFetcher),o=React.useContext(rr),i=React.useContext(UNSAFE_RouteContext),s=(t=i.matches[i.matches.length-1])==null?void 0:t.route.id;o||UNSAFE_invariant(!1),i||UNSAFE_invariant(!1),s==null&&UNSAFE_invariant(!1);let[l,d]=React.useState(r||"");r&&r!==l?d(r):l||d(ar()),React.useEffect(()=>(n.getFetcher(l),()=>{n.deleteFetcher(l)}),[n,l]);let h=React.useCallback((E,D)=>{s||UNSAFE_invariant(!1),n.fetch(l,s,E,D)},[l,s,n]),g=On(),y=React.useCallback((E,D)=>{g(E,q({},D,{navigate:!1,fetcherKey:l}))},[l,g]),w=React.useMemo(()=>React.forwardRef((D,L)=>React.createElement(Un,q({},D,{navigate:!1,fetcherKey:l,ref:L}))),[l]),v=a.fetchers.get(l)||IDLE_FETCHER,R=o.get(l);return React.useMemo(()=>q({Form:w,submit:y,load:h},v,{data:R}),[w,y,h,v,R])}function Da(){let e=gt(ze.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[r,n]=t;return q({},n,{key:r})})}const ir="react-router-scroll-positions";let et={};function In(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=qe(Ce.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=gt(ze.UseScrollRestoration),{basename:i}=React.useContext(UNSAFE_NavigationContext),s=useLocation(),l=useMatches(),d=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Hn(React.useCallback(()=>{if(d.state==="idle"){let h=(t?t(s,l):null)||s.key;et[h]=window.scrollY}try{sessionStorage.setItem(r||ir,JSON.stringify(et))}catch{}window.history.scrollRestoration="auto"},[r,t,d.state,s,l])),typeof document!="undefined"&&(React.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(r||ir);h&&(et=JSON.parse(h))}catch{}},[r]),React.useLayoutEffect(()=>{let h=t&&i!=="/"?(y,w)=>t(q({},y,{pathname:stripBasename(y.pathname,i)||y.pathname}),w):t,g=n==null?void 0:n.enableScrollRestoration(et,()=>window.scrollY,h);return()=>g&&g()},[n,i,t]),React.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(s.hash){let h=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(h){h.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[s,a,o]))}function Ta(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}function Hn(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Ca(e){let{when:t,message:r}=e,n=useBlocker(t);React.useEffect(()=>{n.state==="blocked"&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),React.useEffect(()=>{n.state==="blocked"&&!t&&n.reset()},[n,t])}function Aa(e,t){t===void 0&&(t={});let r=React.useContext(tr);r==null&&UNSAFE_invariant(!1);let{basename:n}=qe(Ce.useViewTransitionState),a=useResolvedPath(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=stripBasename(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=stripBasename(r.nextLocation.pathname,n)||r.nextLocation.pathname;return matchPath(a.pathname,i)!=null||matchPath(a.pathname,o)!=null}}}]);})();
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=module-react-router-dom.8011e8db.js.map
|