@techdocs/cli 1.8.1-next.2 → 1.8.2-next.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 +22 -0
- package/dist/embedded-app/.config-schema.json +22 -67
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.962f0dc0.chunk.js → 1032.140ea063.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.962f0dc0.chunk.js.map → 1032.140ea063.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.b895d544.chunk.js → 1105.d3f18e31.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.b895d544.chunk.js.map → 1105.d3f18e31.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.1dc24a02.chunk.js → 184.fb5a152a.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.1dc24a02.chunk.js.map → 184.fb5a152a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.c190961f.chunk.js → 2440.7a3710e0.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.c190961f.chunk.js.map → 2440.7a3710e0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3487.033f70d1.chunk.js → 3487.00057c69.chunk.js} +2 -2
- package/dist/embedded-app/static/{3487.033f70d1.chunk.js.map → 3487.00057c69.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{4917.a5e1279c.chunk.js → 4917.5d4a6c52.chunk.js} +2 -2
- package/dist/embedded-app/static/{4917.a5e1279c.chunk.js.map → 4917.5d4a6c52.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.ee26d731.chunk.js → 5458.7bf88cf3.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.ee26d731.chunk.js.map → 5458.7bf88cf3.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5877.917fd5e0.chunk.js → 5877.fce91b72.chunk.js} +2 -2
- package/dist/embedded-app/static/{5877.917fd5e0.chunk.js.map → 5877.fce91b72.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6051.4b8c1634.chunk.js → 6051.71a9b063.chunk.js} +2 -2
- package/dist/embedded-app/static/{6051.4b8c1634.chunk.js.map → 6051.71a9b063.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.259f7924.chunk.js → 7750.a9abe428.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.259f7924.chunk.js.map → 7750.a9abe428.chunk.js.map} +1 -1
- package/dist/embedded-app/static/87.06c3bfc1.chunk.js +3 -0
- package/dist/embedded-app/static/87.06c3bfc1.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9545.21600bcf.chunk.js → 9545.264135de.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.21600bcf.chunk.js.map → 9545.264135de.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.69fa838c.chunk.js → 9770.cfa9f314.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.69fa838c.chunk.js.map → 9770.cfa9f314.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.5a486dfb.js +491 -0
- package/dist/embedded-app/static/main.5a486dfb.js.map +1 -0
- package/dist/embedded-app/static/{module-material-table.b510f85c.js → module-material-table.dc2e7a78.js} +2 -2
- package/dist/embedded-app/static/{module-material-table.b510f85c.js.map → module-material-table.dc2e7a78.js.map} +1 -1
- package/dist/embedded-app/static/{module-material-ui.c8f92ef8.js → module-material-ui.e26d0f76.js} +7 -7
- package/dist/embedded-app/static/module-material-ui.e26d0f76.js.map +1 -0
- package/dist/embedded-app/static/module-react-beautiful-dnd.d66821d2.js +67 -0
- package/dist/embedded-app/static/module-react-beautiful-dnd.d66821d2.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.6a4a6115.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.6a4a6115.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.fc2430de.js +22 -0
- package/dist/embedded-app/static/module-react-router.fc2430de.js.map +1 -0
- package/dist/embedded-app/static/{runtime.f231fd80.js → runtime.5a486dfb.js} +3 -3
- package/dist/embedded-app/static/runtime.5a486dfb.js.map +1 -0
- package/dist/embedded-app/static/vendor.5a486dfb.js +164 -0
- package/dist/embedded-app/static/vendor.5a486dfb.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/9814.cc1c4811.chunk.js +0 -3
- package/dist/embedded-app/static/9814.cc1c4811.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.f231fd80.js +0 -491
- package/dist/embedded-app/static/main.f231fd80.js.map +0 -1
- package/dist/embedded-app/static/module-material-ui.c8f92ef8.js.map +0 -1
- package/dist/embedded-app/static/module-react-beautiful-dnd.1f1d9332.js +0 -67
- package/dist/embedded-app/static/module-react-beautiful-dnd.1f1d9332.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.81a9f610.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.81a9f610.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.e7f42b6c.js +0 -22
- package/dist/embedded-app/static/module-react-router.e7f42b6c.js.map +0 -1
- package/dist/embedded-app/static/runtime.f231fd80.js.map +0 -1
- package/dist/embedded-app/static/vendor.f231fd80.js +0 -164
- package/dist/embedded-app/static/vendor.f231fd80.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(ia,br,Re){Re.d(br,{VK:function(){return Un},rU:function(){return On}});var ee=Re(2784),Dt=Re.t(ee,2),Sr=Re(28316),Er=Re.t(Sr,2),De=Re(73557),Tt=Re(84800);/**
|
|
2
|
+
* @remix-run/router v1.14.2
|
|
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 j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var K;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(K||(K={}));const _t="popstate";function oa(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((y,R)=>c(y,typeof y=="string"?null:y.state,R===0?"default":void 0));let o=u(r==null?a.length-1:r),i=K.Pop,s=null;function u(y){return Math.min(Math.max(y,0),a.length-1)}function d(){return a[o]}function c(y,R,w){R===void 0&&(R=null);let v=le(a?d().pathname:"/",y,R,w);return ae(v.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(y)),v}function b(y){return typeof y=="string"?y:se(y)}return{get index(){return o},get action(){return i},get location(){return d()},createHref:b,createURL(y){return new URL(b(y),"http://localhost")},encodeLocation(y){let R=typeof y=="string"?ie(y):y;return{pathname:R.pathname||"",search:R.search||"",hash:R.hash||""}},push(y,R){i=K.Push;let w=c(y,R);o+=1,a.splice(o,a.length,w),n&&s&&s({action:i,location:w,delta:1})},replace(y,R){i=K.Replace;let w=c(y,R);a[o]=w,n&&s&&s({action:i,location:w,delta:0})},go(y){i=K.Pop;let R=u(o+y),w=a[R];o=R,s&&s({action:i,location:w,delta:y})},listen(y){return s=y,()=>{s=null}}}}function Pr(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:i,hash:s}=n.location;return le("",{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:se(a)}return At(t,r,null,e)}function la(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:s="",hash:u=""}=ie(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),le("",{pathname:i,search:s,hash:u},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 u=a.location.href,d=u.indexOf("#");s=d===-1?u:u.slice(0,d)}return s+"#"+(typeof o=="string"?o:se(o))}function n(a,o){ae(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return At(t,r,n,e)}function I(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function ae(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function xr(){return Math.random().toString(36).substr(2,8)}function Ct(e,t){return{usr:e.state,key:e.key,idx:t}}function le(e,t,r,n){return r===void 0&&(r=null),j({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ie(t):t,{state:r,key:t&&t.key||n||xr()})}function se(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ie(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function At(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s=K.Pop,u=null,d=c();d==null&&(d=0,i.replaceState(j({},i.state,{idx:d}),""));function c(){return(i.state||{idx:null}).idx}function b(){s=K.Pop;let v=c(),p=v==null?null:v-d;d=v,u&&u({action:s,location:w.location,delta:p})}function g(v,p){s=K.Push;let P=le(w.location,v,p);r&&r(P,v),d=c()+1;let L=Ct(P,d),_=w.createHref(P);try{i.pushState(L,"",_)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(_)}o&&u&&u({action:s,location:w.location,delta:1})}function y(v,p){s=K.Replace;let P=le(w.location,v,p);r&&r(P,v),d=c();let L=Ct(P,d),_=w.createHref(P);i.replaceState(L,"",_),o&&u&&u({action:s,location:w.location,delta:0})}function R(v){let p=a.location.origin!=="null"?a.location.origin:a.location.href,P=typeof v=="string"?v:se(v);return I(p,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,p)}let w={get action(){return s},get location(){return e(a,i)},listen(v){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(_t,b),u=v,()=>{a.removeEventListener(_t,b),u=null}},createHref(v){return t(a,v)},createURL:R,encodeLocation(v){let p=R(v);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:g,replace:y,go(v){return i.go(v)}};return w}var H;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(H||(H={}));const Lr=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dr(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(I(a.index!==!0||!a.children,"Cannot specify children on an index route"),I(!n[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Dr(a)){let u=j({},a,t(a),{id:s});return n[s]=u,u}else{let u=j({},a,t(a),{id:s,children:void 0});return n[s]=u,a.children&&(u.children=Ge(a.children,t,i,n)),u}})}function be(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ie(t):t,a=Oe(n.pathname||"/",r);if(a==null)return null;let o=Ft(e);_r(o);let i=null;for(let s=0;i==null&&s<o.length;++s)i=Ir(o[s],kr(a));return i}function Tr(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Ft(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,s)=>{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(I(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let d=je([n,u.relativePath]),c=r.concat(u);o.children&&o.children.length>0&&(I(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Ft(o.children,t,c,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:Or(d,o.index),routesMeta:c})};return e.forEach((o,i)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))a(o,i);else for(let u of Ut(o.path))a(o,i,u)}),t}function Ut(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=Ut(n.join("/")),s=[];return s.push(...i.map(u=>u===""?o:[o,u].join("/"))),a&&s.push(...i),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function _r(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:jr(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Cr=/^:[\w-]+$/,Ar=3,Fr=2,Ur=1,Mr=10,Nr=null,Mt=e=>e==="*";function Or(e,t){let r=e.split("/"),n=r.length;return r.some(Mt)&&(n+=Nr),t&&(n+=Fr),r.filter(a=>!Mt(a)).reduce((a,o)=>a+(Cr.test(o)?Ar:o===""?Ur:Mr),n)}function jr(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 Ir(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let i=0;i<r.length;++i){let s=r[i],u=i===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",c=Hr({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},d);if(!c)return null;Object.assign(n,c.params);let b=s.route;o.push({params:n,pathname:je([a,c.pathname]),pathnameBase:Yr(je([a,c.pathnameBase])),route:b}),c.pathnameBase!=="/"&&(a=je([a,c.pathnameBase]))}return o}function sa(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(ae(!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,u)=>{if(s===u.length-1&&i==="*")return a(t["*"]);const c=i.match(/^:([\w-]+)(\??)$/);if(c){const[,b,g]=c;let y=t[b];return I(g==="?"||y!=null,'Missing ":'+b+'" param'),a(y)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+o.join("/")}function Hr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Br(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,c,b)=>{let{paramName:g,isOptional:y}=c;if(g==="*"){let w=s[b]||"";i=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const R=s[b];return y&&!R?d[g]=void 0:d[g]=zr(R||"",g),d},{}),pathname:o,pathnameBase:i,pattern:e}}function Br(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ae(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,u)=>(n.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function kr(e){try{return decodeURI(e)}catch(t){return ae(!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 zr(e,t){try{return decodeURIComponent(e)}catch(r){return ae(!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 Oe(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 Kr(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ie(e):e;return{pathname:r?r.startsWith("/")?r:Wr(r,t):t,search:Jr(n),hash:Gr(a)}}function Wr(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 st(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 Nt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Vr(e,t){let r=Nt(e);return t?r.map((n,a)=>a===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function $r(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ie(e):(a=j({},e),I(!a.pathname||!a.pathname.includes("?"),st("?","pathname","search",a)),I(!a.pathname||!a.pathname.includes("#"),st("#","pathname","hash",a)),I(!a.search||!a.search.includes("#"),st("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,s;if(i==null)s=r;else{let b=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),b-=1;a.pathname=g.join("/")}s=b>=0?t[b]:"/"}let u=Kr(a,s),d=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||c)&&(u.pathname+="/"),u}function ua(e){return e===""||e.pathname===""?"/":typeof e=="string"?ie(e).pathname:e.pathname}const je=e=>e.join("/").replace(/\/\/+/g,"/"),Yr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Jr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Gr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ca=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),j({},n,{headers:a}))};class Ot extends null{}class Xr{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],I(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 Ot("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,u]=i;return Object.assign(o,{[s]:this.trackPromise(s,u)})},{}),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 Ot)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 I(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]:Zr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Qr(e){return e instanceof Promise&&e._tracked===!0}function Zr(e){if(!Qr(e))return e;if(e._error)throw e._error;return e._data}const da=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Xr(t,n)},qr=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status=="undefined"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,j({},n,{headers:a}))},fa=(e,t)=>{let r=qr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class jt{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 It(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ht=["post","put","patch","delete"],en=new Set(Ht),tn=["get",...Ht],rn=new Set(tn),nn=new Set([301,302,303,307,308]),an=new Set([307,308]),ut={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},on={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ie={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Bt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kt=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),zt="remix-router-transitions";function ha(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;I(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 l=e.detectErrorBoundary;a=f=>({hasErrorBoundary:l(f)})}else a=kt;let o={},i=Ge(e.routes,a,void 0,o),s,u=e.basename||"/",d=j({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),c=null,b=new Set,g=null,y=null,R=null,w=e.hydrationData!=null,v=be(i,e.history.location,u),p=null;if(v==null){let l=W(404,{pathname:e.history.location.pathname}),{matches:f,route:m}=Xe(i);v=f,p={[m.id]:l}}let P,L=v.some(l=>l.route.lazy),_=v.some(l=>l.route.loader);if(L)P=!1;else if(!_)P=!0;else if(d.v7_partialHydration){let l=e.hydrationData?e.hydrationData.loaderData:null,f=e.hydrationData?e.hydrationData.errors:null;P=v.every(m=>m.route.loader&&m.route.loader.hydrate!==!0&&(l&&l[m.route.id]!==void 0||f&&f[m.route.id]!==void 0))}else P=e.hydrationData!=null;let M,h={historyAction:e.history.action,location:e.history.location,matches:v,initialized:P,navigation:ut,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||p,fetchers:new Map,blockers:new Map},D=K.Pop,A=!1,U,X=!1,V=new Map,Z=null,Q=!1,ue=!1,tt=[],rt=[],$=new Map,nt=0,We=-1,Ae=new Map,ce=new Set,Fe=new Map,Ve=new Map,de=new Set,Ee=new Map,Pe=new Map,Rt=!1;function Wn(){if(c=e.history.listen(l=>{let{action:f,location:m,delta:S}=l;if(Rt){Rt=!1;return}ae(Pe.size===0||S!=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 E=vr({currentLocation:h.location,nextLocation:m,historyAction:f});if(E&&S!=null){Rt=!0,e.history.go(S*-1),it(E,{state:"blocked",location:m,proceed(){it(E,{state:"proceeding",proceed:void 0,reset:void 0,location:m}),e.history.go(S)},reset(){let N=new Map(h.blockers);N.set(E,Ie),q({blockers:N})}});return}return xe(f,m)}),r){gn(t,V);let l=()=>yn(t,V);t.addEventListener("pagehide",l),Z=()=>t.removeEventListener("pagehide",l)}return h.initialized||xe(K.Pop,h.location,{initialHydration:!0}),M}function Vn(){c&&c(),Z&&Z(),b.clear(),U&&U.abort(),h.fetchers.forEach((l,f)=>at(f)),h.blockers.forEach((l,f)=>yr(f))}function $n(l){return b.add(l),()=>b.delete(l)}function q(l,f){f===void 0&&(f={}),h=j({},h,l);let m=[],S=[];d.v7_fetcherPersist&&h.fetchers.forEach((E,N)=>{E.state==="idle"&&(de.has(N)?S.push(N):m.push(N))}),[...b].forEach(E=>E(h,{deletedFetchers:S,unstable_viewTransitionOpts:f.viewTransitionOpts,unstable_flushSync:f.flushSync===!0})),d.v7_fetcherPersist&&(m.forEach(E=>h.fetchers.delete(E)),S.forEach(E=>at(E)))}function $e(l,f,m){var S,E;let{flushSync:N}=m===void 0?{}:m,C=h.actionData!=null&&h.navigation.formMethod!=null&&te(h.navigation.formMethod)&&h.navigation.state==="loading"&&((S=l.state)==null?void 0:S._isRedirect)!==!0,T;f.actionData?Object.keys(f.actionData).length>0?T=f.actionData:T=null:C?T=h.actionData:T=null;let x=f.loaderData?Zt(h.loaderData,f.loaderData,f.matches||[],f.errors):h.loaderData,O=h.blockers;O.size>0&&(O=new Map(O),O.forEach((k,G)=>O.set(G,Ie)));let Y=A===!0||h.navigation.formMethod!=null&&te(h.navigation.formMethod)&&((E=l.state)==null?void 0:E._isRedirect)!==!0;s&&(i=s,s=void 0),Q||D===K.Pop||(D===K.Push?e.history.push(l,l.state):D===K.Replace&&e.history.replace(l,l.state));let F;if(D===K.Pop){let k=V.get(h.location.pathname);k&&k.has(l.pathname)?F={currentLocation:h.location,nextLocation:l}:V.has(l.pathname)&&(F={currentLocation:l,nextLocation:h.location})}else if(X){let k=V.get(h.location.pathname);k?k.add(l.pathname):(k=new Set([l.pathname]),V.set(h.location.pathname,k)),F={currentLocation:h.location,nextLocation:l}}q(j({},f,{actionData:T,loaderData:x,historyAction:D,location:l,initialized:!0,navigation:ut,revalidation:"idle",restoreScrollPosition:Rr(l,f.matches||h.matches),preventScrollReset:Y,blockers:O}),{viewTransitionOpts:F,flushSync:N===!0}),D=K.Pop,A=!1,X=!1,Q=!1,ue=!1,tt=[],rt=[]}async function dr(l,f){if(typeof l=="number"){e.history.go(l);return}let m=ct(h.location,h.matches,u,d.v7_prependBasename,l,d.v7_relativeSplatPath,f==null?void 0:f.fromRouteId,f==null?void 0:f.relative),{path:S,submission:E,error:N}=Kt(d.v7_normalizeFormMethod,!1,m,f),C=h.location,T=le(h.location,S,f&&f.state);T=j({},T,e.history.encodeLocation(T));let x=f&&f.replace!=null?f.replace:void 0,O=K.Push;x===!0?O=K.Replace:x===!1||E!=null&&te(E.formMethod)&&E.formAction===h.location.pathname+h.location.search&&(O=K.Replace);let Y=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,F=(f&&f.unstable_flushSync)===!0,k=vr({currentLocation:C,nextLocation:T,historyAction:O});if(k){it(k,{state:"blocked",location:T,proceed(){it(k,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),dr(l,f)},reset(){let G=new Map(h.blockers);G.set(k,Ie),q({blockers:G})}});return}return await xe(O,T,{submission:E,pendingError:N,preventScrollReset:Y,replace:f&&f.replace,enableViewTransition:f&&f.unstable_viewTransition,flushSync:F})}function Yn(){if(bt(),q({revalidation:"loading"}),h.navigation.state!=="submitting"){if(h.navigation.state==="idle"){xe(h.historyAction,h.location,{startUninterruptedRevalidation:!0});return}xe(D||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation})}}async function xe(l,f,m){U&&U.abort(),U=null,D=l,Q=(m&&m.startUninterruptedRevalidation)===!0,ra(h.location,h.matches),A=(m&&m.preventScrollReset)===!0,X=(m&&m.enableViewTransition)===!0;let S=s||i,E=m&&m.overrideNavigation,N=be(S,f,u),C=(m&&m.flushSync)===!0;if(!N){let G=W(404,{pathname:f.pathname}),{matches:ne,route:J}=Xe(S);St(),$e(f,{matches:ne,loaderData:{},errors:{[J.id]:G}},{flushSync:C});return}if(h.initialized&&!ue&&cn(h.location,f)&&!(m&&m.submission&&te(m.submission.formMethod))){$e(f,{matches:N},{flushSync:C});return}U=new AbortController;let T=He(e.history,f,U.signal,m&&m.submission),x,O;if(m&&m.pendingError)O={[Te(N).route.id]:m.pendingError};else if(m&&m.submission&&te(m.submission.formMethod)){let G=await Jn(T,f,m.submission,N,{replace:m.replace,flushSync:C});if(G.shortCircuited)return;x=G.pendingActionData,O=G.pendingActionError,E=mt(f,m.submission),C=!1,T=new Request(T.url,{signal:T.signal})}let{shortCircuited:Y,loaderData:F,errors:k}=await Gn(T,f,N,E,m&&m.submission,m&&m.fetcherSubmission,m&&m.replace,m&&m.initialHydration===!0,C,x,O);Y||(U=null,$e(f,j({matches:N},x?{actionData:x}:{},{loaderData:F,errors:k})))}async function Jn(l,f,m,S,E){E===void 0&&(E={}),bt();let N=mn(f,m);q({navigation:N},{flushSync:E.flushSync===!0});let C,T=Be(S,f);if(!T.route.action&&!T.route.lazy)C={type:H.error,error:W(405,{method:l.method,pathname:f.pathname,routeId:T.route.id})};else if(C=await Se("action",l,T,S,o,a,u,d.v7_relativeSplatPath),l.signal.aborted)return{shortCircuited:!0};if(me(C)){let x;return E&&E.replace!=null?x=E.replace:x=C.location===h.location.pathname+h.location.search,await Ye(h,C,{submission:m,replace:x}),{shortCircuited:!0}}if(he(C)){let x=Te(S,T.route.id);return(E&&E.replace)!==!0&&(D=K.Push),{pendingActionData:{},pendingActionError:{[x.route.id]:C.error}}}if(fe(C))throw W(400,{type:"defer-action"});return{pendingActionData:{[T.route.id]:C.data}}}async function Gn(l,f,m,S,E,N,C,T,x,O,Y){let F=S||mt(f,E),k=E||N||nr(F),G=s||i,[ne,J]=Vt(e.history,h,m,k,f,d.v7_partialHydration&&T===!0,ue,tt,rt,de,Fe,ce,G,u,O,Y);if(St(B=>!(m&&m.some(z=>z.route.id===B))||ne&&ne.some(z=>z.route.id===B)),We=++nt,ne.length===0&&J.length===0){let B=pr();return $e(f,j({matches:m,loaderData:{},errors:Y||null},O?{actionData:O}:{},B?{fetchers:new Map(h.fetchers)}:{}),{flushSync:x}),{shortCircuited:!0}}if(!Q&&(!d.v7_partialHydration||!T)){J.forEach(z=>{let oe=h.fetchers.get(z.key),lt=ke(void 0,oe?oe.data:void 0);h.fetchers.set(z.key,lt)});let B=O||h.actionData;q(j({navigation:F},B?Object.keys(B).length===0?{actionData:null}:{actionData:B}:{},J.length>0?{fetchers:new Map(h.fetchers)}:{}),{flushSync:x})}J.forEach(B=>{$.has(B.key)&&ve(B.key),B.controller&&$.set(B.key,B.controller)});let Ue=()=>J.forEach(B=>ve(B.key));U&&U.signal.addEventListener("abort",Ue);let{results:Et,loaderResults:Me,fetcherResults:we}=await fr(h.matches,m,ne,J,l);if(l.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ue),J.forEach(B=>$.delete(B.key));let Le=qt(Et);if(Le){if(Le.idx>=ne.length){let B=J[Le.idx-ne.length].key;ce.add(B)}return await Ye(h,Le.result,{replace:C}),{shortCircuited:!0}}let{loaderData:Pt,errors:xt}=Qt(h,m,ne,Me,Y,J,we,Ee);Ee.forEach((B,z)=>{B.subscribe(oe=>{(oe||B.done)&&Ee.delete(z)})});let Lt=pr(),Ne=gr(We),ot=Lt||Ne||J.length>0;return j({loaderData:Pt,errors:xt},ot?{fetchers:new Map(h.fetchers)}:{})}function Xn(l,f,m,S){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.");$.has(l)&&ve(l);let E=(S&&S.unstable_flushSync)===!0,N=s||i,C=ct(h.location,h.matches,u,d.v7_prependBasename,m,d.v7_relativeSplatPath,f,S==null?void 0:S.relative),T=be(N,C,u);if(!T){Je(l,f,W(404,{pathname:C}),{flushSync:E});return}let{path:x,submission:O,error:Y}=Kt(d.v7_normalizeFormMethod,!0,C,S);if(Y){Je(l,f,Y,{flushSync:E});return}let F=Be(T,x);if(A=(S&&S.preventScrollReset)===!0,O&&te(O.formMethod)){Qn(l,f,x,F,T,E,O);return}Fe.set(l,{routeId:f,path:x}),Zn(l,f,x,F,T,E,O)}async function Qn(l,f,m,S,E,N,C){if(bt(),Fe.delete(l),!S.route.action&&!S.route.lazy){let z=W(405,{method:C.formMethod,pathname:m,routeId:f});Je(l,f,z,{flushSync:N});return}let T=h.fetchers.get(l);ye(l,pn(C,T),{flushSync:N});let x=new AbortController,O=He(e.history,m,x.signal,C);$.set(l,x);let Y=nt,F=await Se("action",O,S,E,o,a,u,d.v7_relativeSplatPath);if(O.signal.aborted){$.get(l)===x&&$.delete(l);return}if(d.v7_fetcherPersist&&de.has(l)){if(me(F)||he(F)){ye(l,pe(void 0));return}}else{if(me(F))if($.delete(l),We>Y){ye(l,pe(void 0));return}else return ce.add(l),ye(l,ke(C)),Ye(h,F,{fetcherSubmission:C});if(he(F)){Je(l,f,F.error);return}}if(fe(F))throw W(400,{type:"defer-action"});let k=h.navigation.location||h.location,G=He(e.history,k,x.signal),ne=s||i,J=h.navigation.state!=="idle"?be(ne,h.navigation.location,u):h.matches;I(J,"Didn't find any matches after fetcher action");let Ue=++nt;Ae.set(l,Ue);let Et=ke(C,F.data);h.fetchers.set(l,Et);let[Me,we]=Vt(e.history,h,J,C,k,!1,ue,tt,rt,de,Fe,ce,ne,u,{[S.route.id]:F.data},void 0);we.filter(z=>z.key!==l).forEach(z=>{let oe=z.key,lt=h.fetchers.get(oe),aa=ke(void 0,lt?lt.data:void 0);h.fetchers.set(oe,aa),$.has(oe)&&ve(oe),z.controller&&$.set(oe,z.controller)}),q({fetchers:new Map(h.fetchers)});let Le=()=>we.forEach(z=>ve(z.key));x.signal.addEventListener("abort",Le);let{results:Pt,loaderResults:xt,fetcherResults:Lt}=await fr(h.matches,J,Me,we,G);if(x.signal.aborted)return;x.signal.removeEventListener("abort",Le),Ae.delete(l),$.delete(l),we.forEach(z=>$.delete(z.key));let Ne=qt(Pt);if(Ne){if(Ne.idx>=Me.length){let z=we[Ne.idx-Me.length].key;ce.add(z)}return Ye(h,Ne.result)}let{loaderData:ot,errors:B}=Qt(h,h.matches,Me,xt,void 0,we,Lt,Ee);if(h.fetchers.has(l)){let z=pe(F.data);h.fetchers.set(l,z)}gr(Ue),h.navigation.state==="loading"&&Ue>We?(I(D,"Expected pending action"),U&&U.abort(),$e(h.navigation.location,{matches:J,loaderData:ot,errors:B,fetchers:new Map(h.fetchers)})):(q({errors:B,loaderData:Zt(h.loaderData,ot,J,B),fetchers:new Map(h.fetchers)}),ue=!1)}async function Zn(l,f,m,S,E,N,C){let T=h.fetchers.get(l);ye(l,ke(C,T?T.data:void 0),{flushSync:N});let x=new AbortController,O=He(e.history,m,x.signal);$.set(l,x);let Y=nt,F=await Se("loader",O,S,E,o,a,u,d.v7_relativeSplatPath);if(fe(F)&&(F=await rr(F,O.signal,!0)||F),$.get(l)===x&&$.delete(l),!O.signal.aborted){if(de.has(l)){ye(l,pe(void 0));return}if(me(F))if(We>Y){ye(l,pe(void 0));return}else{ce.add(l),await Ye(h,F);return}if(he(F)){Je(l,f,F.error);return}I(!fe(F),"Unhandled fetcher deferred data"),ye(l,pe(F.data))}}async function Ye(l,f,m){let{submission:S,fetcherSubmission:E,replace:N}=m===void 0?{}:m;f.revalidate&&(ue=!0);let C=le(l.location,f.location,{_isRedirect:!0});if(I(C,"Expected a location on the redirect navigation"),r){let k=!1;if(f.reloadDocument)k=!0;else if(Bt.test(f.location)){const G=e.history.createURL(f.location);k=G.origin!==t.location.origin||Oe(G.pathname,u)==null}if(k){N?t.location.replace(f.location):t.location.assign(f.location);return}}U=null;let T=N===!0?K.Replace:K.Push,{formMethod:x,formAction:O,formEncType:Y}=l.navigation;!S&&!E&&x&&O&&Y&&(S=nr(l.navigation));let F=S||E;if(an.has(f.status)&&F&&te(F.formMethod))await xe(T,C,{submission:j({},F,{formAction:f.location}),preventScrollReset:A});else{let k=mt(C,S);await xe(T,C,{overrideNavigation:k,fetcherSubmission:E,preventScrollReset:A})}}async function fr(l,f,m,S,E){let N=await Promise.all([...m.map(x=>Se("loader",E,x,f,o,a,u,d.v7_relativeSplatPath)),...S.map(x=>x.matches&&x.match&&x.controller?Se("loader",He(e.history,x.path,x.controller.signal),x.match,x.matches,o,a,u,d.v7_relativeSplatPath):{type:H.error,error:W(404,{pathname:x.path})})]),C=N.slice(0,m.length),T=N.slice(m.length);return await Promise.all([tr(l,m,C,C.map(()=>E.signal),!1,h.loaderData),tr(l,S.map(x=>x.match),T,S.map(x=>x.controller?x.controller.signal:null),!0)]),{results:N,loaderResults:C,fetcherResults:T}}function bt(){ue=!0,tt.push(...St()),Fe.forEach((l,f)=>{$.has(f)&&(rt.push(f),ve(f))})}function ye(l,f,m){m===void 0&&(m={}),h.fetchers.set(l,f),q({fetchers:new Map(h.fetchers)},{flushSync:(m&&m.flushSync)===!0})}function Je(l,f,m,S){S===void 0&&(S={});let E=Te(h.matches,f);at(l),q({errors:{[E.route.id]:m},fetchers:new Map(h.fetchers)},{flushSync:(S&&S.flushSync)===!0})}function hr(l){return d.v7_fetcherPersist&&(Ve.set(l,(Ve.get(l)||0)+1),de.has(l)&&de.delete(l)),h.fetchers.get(l)||on}function at(l){let f=h.fetchers.get(l);$.has(l)&&!(f&&f.state==="loading"&&Ae.has(l))&&ve(l),Fe.delete(l),Ae.delete(l),ce.delete(l),de.delete(l),h.fetchers.delete(l)}function qn(l){if(d.v7_fetcherPersist){let f=(Ve.get(l)||0)-1;f<=0?(Ve.delete(l),de.add(l)):Ve.set(l,f)}else at(l);q({fetchers:new Map(h.fetchers)})}function ve(l){let f=$.get(l);I(f,"Expected fetch controller: "+l),f.abort(),$.delete(l)}function mr(l){for(let f of l){let m=hr(f),S=pe(m.data);h.fetchers.set(f,S)}}function pr(){let l=[],f=!1;for(let m of ce){let S=h.fetchers.get(m);I(S,"Expected fetcher: "+m),S.state==="loading"&&(ce.delete(m),l.push(m),f=!0)}return mr(l),f}function gr(l){let f=[];for(let[m,S]of Ae)if(S<l){let E=h.fetchers.get(m);I(E,"Expected fetcher: "+m),E.state==="loading"&&(ve(m),Ae.delete(m),f.push(m))}return mr(f),f.length>0}function ea(l,f){let m=h.blockers.get(l)||Ie;return Pe.get(l)!==f&&Pe.set(l,f),m}function yr(l){h.blockers.delete(l),Pe.delete(l)}function it(l,f){let m=h.blockers.get(l)||Ie;I(m.state==="unblocked"&&f.state==="blocked"||m.state==="blocked"&&f.state==="blocked"||m.state==="blocked"&&f.state==="proceeding"||m.state==="blocked"&&f.state==="unblocked"||m.state==="proceeding"&&f.state==="unblocked","Invalid blocker state transition: "+m.state+" -> "+f.state);let S=new Map(h.blockers);S.set(l,f),q({blockers:S})}function vr(l){let{currentLocation:f,nextLocation:m,historyAction:S}=l;if(Pe.size===0)return;Pe.size>1&&ae(!1,"A router only supports one blocker at a time");let E=Array.from(Pe.entries()),[N,C]=E[E.length-1],T=h.blockers.get(N);if(!(T&&T.state==="proceeding")&&C({currentLocation:f,nextLocation:m,historyAction:S}))return N}function St(l){let f=[];return Ee.forEach((m,S)=>{(!l||l(S))&&(m.cancel(),f.push(S),Ee.delete(S))}),f}function ta(l,f,m){if(g=l,R=f,y=m||null,!w&&h.navigation===ut){w=!0;let S=Rr(h.location,h.matches);S!=null&&q({restoreScrollPosition:S})}return()=>{g=null,R=null,y=null}}function wr(l,f){return y&&y(l,f.map(S=>Tr(S,h.loaderData)))||l.key}function ra(l,f){if(g&&R){let m=wr(l,f);g[m]=R()}}function Rr(l,f){if(g){let m=wr(l,f),S=g[m];if(typeof S=="number")return S}return null}function na(l){o={},s=Ge(l,a,void 0,o)}return M={get basename(){return u},get future(){return d},get state(){return h},get routes(){return i},get window(){return t},initialize:Wn,subscribe:$n,enableScrollRestoration:ta,navigate:dr,fetch:Xn,revalidate:Yn,createHref:l=>e.history.createHref(l),encodeLocation:l=>e.history.encodeLocation(l),getFetcher:hr,deleteFetcher:qn,dispose:Vn,getBlocker:ea,deleteBlocker:yr,_internalFetchControllers:$,_internalActiveDeferreds:Ee,_internalSetRoutes:na},M}const ln=Symbol("deferred");function ma(e,t){I(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=kt;let o=j({v7_relativeSplatPath:!1},t?t.future:null),i=Ge(e,a,void 0,r);async function s(g,y){let{requestContext:R}=y===void 0?{}:y,w=new URL(g.url),v=g.method,p=le("",se(w),null,"default"),P=be(i,p,n);if(!ft(v)&&v!=="HEAD"){let _=W(405,{method:v}),{matches:M,route:h}=Xe(i);return{basename:n,location:p,matches:M,loaderData:{},actionData:null,errors:{[h.id]:_},statusCode:_.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!P){let _=W(404,{pathname:p.pathname}),{matches:M,route:h}=Xe(i);return{basename:n,location:p,matches:M,loaderData:{},actionData:null,errors:{[h.id]:_},statusCode:_.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let L=await d(g,p,P,R);return _e(L)?L:j({location:p,basename:n},L)}async function u(g,y){let{routeId:R,requestContext:w}=y===void 0?{}:y,v=new URL(g.url),p=g.method,P=le("",se(v),null,"default"),L=be(i,P,n);if(!ft(p)&&p!=="HEAD"&&p!=="OPTIONS")throw W(405,{method:p});if(!L)throw W(404,{pathname:P.pathname});let _=R?L.find(A=>A.route.id===R):Be(L,P);if(R&&!_)throw W(403,{pathname:P.pathname,routeId:R});if(!_)throw W(404,{pathname:P.pathname});let M=await d(g,P,L,w,_);if(_e(M))return M;let h=M.errors?Object.values(M.errors)[0]:void 0;if(h!==void 0)throw h;if(M.actionData)return Object.values(M.actionData)[0];if(M.loaderData){var D;let A=Object.values(M.loaderData)[0];return(D=M.activeDeferreds)!=null&&D[_.route.id]&&(A[ln]=M.activeDeferreds[_.route.id]),A}}async function d(g,y,R,w,v){I(g.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(te(g.method.toLowerCase()))return await c(g,R,v||Be(R,y),w,v!=null);let p=await b(g,R,w,v);return _e(p)?p:j({},p,{actionData:null,actionHeaders:{}})}catch(p){if(hn(p)){if(p.type===H.error)throw p.response;return p.response}if(fn(p))return p;throw p}}async function c(g,y,R,w,v){let p;if(!R.route.action&&!R.route.lazy){let _=W(405,{method:g.method,pathname:new URL(g.url).pathname,routeId:R.route.id});if(v)throw _;p={type:H.error,error:_}}else if(p=await Se("action",g,R,y,r,a,n,o.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:v,requestContext:w}),g.signal.aborted){let _=v?"queryRoute":"query";throw new Error(_+"() call aborted: "+g.method+" "+g.url)}if(me(p))throw new Response(null,{status:p.status,headers:{Location:p.location}});if(fe(p)){let _=W(400,{type:"defer-action"});if(v)throw _;p={type:H.error,error:_}}if(v){if(he(p))throw p.error;return{matches:[R],loaderData:{},actionData:{[R.route.id]:p.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(he(p)){let _=Te(y,R.route.id),M=await b(g,y,w,void 0,{[_.route.id]:p.error});return j({},M,{statusCode:It(p.error)?p.error.status:500,actionData:null,actionHeaders:j({},p.headers?{[R.route.id]:p.headers}:{})})}let P=new Request(g.url,{headers:g.headers,redirect:g.redirect,signal:g.signal}),L=await b(P,y,w);return j({},L,p.statusCode?{statusCode:p.statusCode}:{},{actionData:{[R.route.id]:p.data},actionHeaders:j({},p.headers?{[R.route.id]:p.headers}:{})})}async function b(g,y,R,w,v){let p=w!=null;if(p&&!(w!=null&&w.route.loader)&&!(w!=null&&w.route.lazy))throw W(400,{method:g.method,pathname:new URL(g.url).pathname,routeId:w==null?void 0:w.route.id});let L=(w?[w]:Wt(y,Object.keys(v||{})[0])).filter(A=>A.route.loader||A.route.lazy);if(L.length===0)return{matches:y,loaderData:y.reduce((A,U)=>Object.assign(A,{[U.route.id]:null}),{}),errors:v||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let _=await Promise.all([...L.map(A=>Se("loader",g,A,y,r,a,n,o.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:p,requestContext:R}))]);if(g.signal.aborted){let A=p?"queryRoute":"query";throw new Error(A+"() call aborted: "+g.method+" "+g.url)}let M=new Map,h=Xt(y,L,_,v,M),D=new Set(L.map(A=>A.route.id));return y.forEach(A=>{D.has(A.route.id)||(h.loaderData[A.route.id]=null)}),j({},h,{matches:y,activeDeferreds:M.size>0?Object.fromEntries(M.entries()):null})}return{dataRoutes:i,query:s,queryRoute:u}}function pa(e,t,r){return j({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function sn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ct(e,t,r,n,a,o,i,s){let u,d;if(i){u=[];for(let b of t)if(u.push(b),b.route.id===i){d=b;break}}else u=t,d=t[t.length-1];let c=$r(a||".",Vr(u,o),Oe(e.pathname,r)||e.pathname,s==="path");return a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&d&&d.route.index&&!ht(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(c.pathname=c.pathname==="/"?r:je([r,c.pathname])),se(c)}function Kt(e,t,r,n){if(!n||!sn(n))return{path:r};if(n.formMethod&&!ft(n.formMethod))return{path:r,error:W(405,{method:n.formMethod})};let a=()=>({path:r,error:W(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),s=er(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!te(i))return a();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,R)=>{let[w,v]=R;return""+y+w+"="+v+`
|
|
11
|
+
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!te(i))return a();try{let g=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:g,text:void 0}}}catch{return a()}}}I(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=dt(n.formData),d=n.formData;else if(n.body instanceof FormData)u=dt(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=Gt(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=Gt(u)}catch{return a()}let c={formMethod:i,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(te(c.formMethod))return{path:r,submission:c};let b=ie(r);return t&&b.search&&ht(b.search)&&u.append("index",""),b.search="?"+u,{path:se(b),submission:c}}function Wt(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 Vt(e,t,r,n,a,o,i,s,u,d,c,b,g,y,R,w){let v=w?Object.values(w)[0]:R?Object.values(R)[0]:void 0,p=e.createURL(t.location),P=e.createURL(a),L=w?Object.keys(w)[0]:void 0,M=Wt(r,L).filter((D,A)=>{let{route:U}=D;if(U.lazy)return!0;if(U.loader==null)return!1;if(o)return U.loader.hydrate?!0:t.loaderData[U.id]===void 0&&(!t.errors||t.errors[U.id]===void 0);if(un(t.loaderData,t.matches[A],D)||s.some(Z=>Z===D.route.id))return!0;let X=t.matches[A],V=D;return Yt(D,j({currentUrl:p,currentParams:X.params,nextUrl:P,nextParams:V.params},n,{actionResult:v,defaultShouldRevalidate:i||p.pathname+p.search===P.pathname+P.search||p.search!==P.search||$t(X,V)}))}),h=[];return c.forEach((D,A)=>{if(o||!r.some(Q=>Q.route.id===D.routeId)||d.has(A))return;let U=be(g,D.path,y);if(!U){h.push({key:A,routeId:D.routeId,path:D.path,matches:null,match:null,controller:null});return}let X=t.fetchers.get(A),V=Be(U,D.path),Z=!1;b.has(A)?Z=!1:u.includes(A)?Z=!0:X&&X.state!=="idle"&&X.data===void 0?Z=i:Z=Yt(V,j({currentUrl:p,currentParams:t.matches[t.matches.length-1].params,nextUrl:P,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:i})),Z&&h.push({key:A,routeId:D.routeId,path:D.path,matches:U,match:V,controller:new AbortController})}),[M,h]}function un(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function $t(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Yt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function Jt(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];I(a,"No route found in manifest");let o={};for(let i in n){let u=a[i]!==void 0&&i!=="hasErrorBoundary";ae(!u,'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.')),!u&&!Lr.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,j({},t(a),{lazy:void 0}))}async function Se(e,t,r,n,a,o,i,s,u){u===void 0&&(u={});let d,c,b,g=w=>{let v,p=new Promise((P,L)=>v=L);return b=()=>v(),t.signal.addEventListener("abort",b),Promise.race([w({request:t,params:r.params,context:u.requestContext}),p])};try{let w=r.route[e];if(r.route.lazy)if(w){let v,p=await Promise.all([g(w).catch(P=>{v=P}),Jt(r.route,o,a)]);if(v)throw v;c=p[0]}else if(await Jt(r.route,o,a),w=r.route[e],w)c=await g(w);else if(e==="action"){let v=new URL(t.url),p=v.pathname+v.search;throw W(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:H.data,data:void 0};else if(w)c=await g(w);else{let v=new URL(t.url),p=v.pathname+v.search;throw W(404,{pathname:p})}I(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(w){d=H.error,c=w}finally{b&&t.signal.removeEventListener("abort",b)}if(_e(c)){let w=c.status;if(nn.has(w)){let p=c.headers.get("Location");if(I(p,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bt.test(p))p=ct(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,p,s);else if(!u.isStaticRequest){let P=new URL(t.url),L=p.startsWith("//")?new URL(P.protocol+p):new URL(p),_=Oe(L.pathname,i)!=null;L.origin===P.origin&&_&&(p=L.pathname+L.search+L.hash)}if(u.isStaticRequest)throw c.headers.set("Location",p),c;return{type:H.redirect,status:w,location:p,revalidate:c.headers.get("X-Remix-Revalidate")!==null,reloadDocument:c.headers.get("X-Remix-Reload-Document")!==null}}if(u.isRouteRequest)throw{type:d===H.error?H.error:H.data,response:c};let v;try{let p=c.headers.get("Content-Type");p&&/\bapplication\/json\b/.test(p)?c.body==null?v=null:v=await c.json():v=await c.text()}catch(p){return{type:H.error,error:p}}return d===H.error?{type:d,error:new jt(w,c.statusText,v),headers:c.headers}:{type:H.data,data:v,statusCode:c.status,headers:c.headers}}if(d===H.error)return{type:d,error:c};if(dn(c)){var y,R;return{type:H.deferred,deferredData:c,statusCode:(y=c.init)==null?void 0:y.status,headers:((R=c.init)==null?void 0:R.headers)&&new Headers(c.init.headers)}}return{type:H.data,data:c}}function He(e,t,r,n){let a=e.createURL(er(t)).toString(),o={signal:r};if(n&&te(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=dt(n.formData):o.body=n.formData}return new Request(a,o)}function dt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Gt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Xt(e,t,r,n,a){let o={},i=null,s,u=!1,d={};return r.forEach((c,b)=>{let g=t[b].route.id;if(I(!me(c),"Cannot handle redirect results in processLoaderData"),he(c)){let y=Te(e,g),R=c.error;n&&(R=Object.values(n)[0],n=void 0),i=i||{},i[y.route.id]==null&&(i[y.route.id]=R),o[g]=void 0,u||(u=!0,s=It(c.error)?c.error.status:500),c.headers&&(d[g]=c.headers)}else fe(c)?(a.set(g,c.deferredData),o[g]=c.deferredData.data):o[g]=c.data,c.statusCode!=null&&c.statusCode!==200&&!u&&(s=c.statusCode),c.headers&&(d[g]=c.headers)}),n&&(i=n,o[Object.keys(n)[0]]=void 0),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:d}}function Qt(e,t,r,n,a,o,i,s){let{loaderData:u,errors:d}=Xt(t,r,n,a,s);for(let c=0;c<o.length;c++){let{key:b,match:g,controller:y}=o[c];I(i!==void 0&&i[c]!==void 0,"Did not find corresponding fetcher result");let R=i[c];if(!(y&&y.signal.aborted))if(he(R)){let w=Te(e.matches,g==null?void 0:g.route.id);d&&d[w.route.id]||(d=j({},d,{[w.route.id]:R.error})),e.fetchers.delete(b)}else if(me(R))I(!1,"Unhandled fetcher revalidation redirect");else if(fe(R))I(!1,"Unhandled fetcher deferred data");else{let w=pe(R.data);e.fetchers.set(b,w)}}return{loaderData:u,errors:d}}function Zt(e,t,r,n){let a=j({},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 Te(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 W(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 jt(e||500,i,new Error(s),!0)}function qt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(me(r))return{result:r,idx:t}}}function er(e){let t=typeof e=="string"?ie(e):e;return se(j({},t,{hash:""}))}function cn(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===H.deferred}function he(e){return e.type===H.error}function me(e){return(e&&e.type)===H.redirect}function dn(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 _e(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function fn(e){if(!_e(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function hn(e){return e&&_e(e.response)&&(e.type===H.data||e.type===H.error)}function ft(e){return rn.has(e.toLowerCase())}function te(e){return en.has(e.toLowerCase())}async function tr(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let s=r[i],u=t[i];if(!u)continue;let d=e.find(b=>b.route.id===u.route.id),c=d!=null&&!$t(d,u)&&(o&&o[u.route.id])!==void 0;if(fe(s)&&(a||c)){let b=n[i];I(b,"Expected an AbortSignal for revalidating fetcher deferred result"),await rr(s,b,a).then(g=>{g&&(r[i]=g||r[i])})}}}async function rr(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:H.data,data:e.deferredData.unwrappedData}}catch(a){return{type:H.error,error:a}}return{type:H.data,data:e.deferredData.data}}}function ht(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Be(e,t){let r=typeof t=="string"?ie(t).search:t.search;if(e[e.length-1].route.index&&ht(r||""))return e[e.length-1];let n=Nt(e);return n[n.length-1]}function nr(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 mt(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 mn(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 ke(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 pn(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 pe(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 gn(e,t){try{let r=e.sessionStorage.getItem(zt);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 yn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(zt,JSON.stringify(r))}catch(n){ae(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
12
|
+
* React Router DOM v6.21.3
|
|
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 re(){return re=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},re.apply(this,arguments)}function vn(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 pt="get",gt="application/x-www-form-urlencoded";function Qe(e){return e!=null&&typeof e.tagName=="string"}function wn(e){return Qe(e)&&e.tagName.toLowerCase()==="button"}function Rn(e){return Qe(e)&&e.tagName.toLowerCase()==="form"}function bn(e){return Qe(e)&&e.tagName.toLowerCase()==="input"}function Sn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function En(e,t){return e.button===0&&(!t||t==="_self")&&!Sn(e)}function yt(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 Pn(e,t){let r=yt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let Ze=null;function xn(){if(Ze===null)try{new FormData(document.createElement("form"),0),Ze=!1}catch{Ze=!0}return Ze}const Ln=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vt(e){return e!=null&&!Ln.has(e)?null:e}function Dn(e,t){let r,n,a,o,i;if(Rn(e)){let s=e.getAttribute("action");n=s?stripBasename(s,t):null,r=e.getAttribute("method")||pt,a=vt(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(wn(e)||bn(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 u=e.getAttribute("formaction")||s.getAttribute("action");if(n=u?stripBasename(u,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||pt,a=vt(e.getAttribute("formenctype"))||vt(s.getAttribute("enctype"))||gt,o=new FormData(s,e),!xn()){let{name:d,type:c,value:b}=e;if(c==="image"){let g=d?d+".":"";o.append(g+"x","0"),o.append(g+"y","0")}else d&&o.append(d,b)}}else{if(Qe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=pt,n=null,a=gt,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const Tn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ga=null,ya=null;function va(e,t){return createRouter({basename:t==null?void 0:t.basename,future:re({},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)||ar(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function wa(e,t){return createRouter({basename:t==null?void 0:t.basename,future:re({},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)||ar(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function ar(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=re({},t,{errors:_n(t.errors)})),t}function _n(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 ir=ee.createContext({isTransitioning:!1}),or=ee.createContext(new Map),ge=Dt["startTransition"],lr=Er["flushSync"],sr=Dt["useId"];function Cn(e){ge?ge(e):e()}function ze(e){lr?lr(e):e()}class An{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 Ea(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=React.useState(r.state),[i,s]=React.useState(),[u,d]=React.useState({isTransitioning:!1}),[c,b]=React.useState(),[g,y]=React.useState(),[R,w]=React.useState(),v=React.useRef(new Map),{v7_startTransition:p}=n||{},P=React.useCallback(D=>{p?Cn(D):D()},[p]),L=React.useCallback((D,A)=>{let{deletedFetchers:U,unstable_flushSync:X,unstable_viewTransitionOpts:V}=A;U.forEach(Q=>v.current.delete(Q)),D.fetchers.forEach((Q,ue)=>{Q.data!==void 0&&v.current.set(ue,Q.data)});let Z=r.window==null||typeof r.window.document.startViewTransition!="function";if(!V||Z){X?ze(()=>o(D)):P(()=>o(D));return}if(X){ze(()=>{g&&(c&&c.resolve(),g.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let Q=r.window.document.startViewTransition(()=>{ze(()=>o(D))});Q.finished.finally(()=>{ze(()=>{b(void 0),y(void 0),s(void 0),d({isTransitioning:!1})})}),ze(()=>y(Q));return}g?(c&&c.resolve(),g.skipTransition(),w({state:D,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(s(D),d({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[r.window,g,c,v,P]);React.useLayoutEffect(()=>r.subscribe(L),[r,L]),React.useEffect(()=>{u.isTransitioning&&!u.flushSync&&b(new An)},[u]),React.useEffect(()=>{if(c&&i&&r.window){let D=i,A=c.promise,U=r.window.document.startViewTransition(async()=>{P(()=>o(D)),await A});U.finished.finally(()=>{b(void 0),y(void 0),s(void 0),d({isTransitioning:!1})}),y(U)}},[P,i,c,r.window]),React.useEffect(()=>{c&&i&&a.location.key===i.location.key&&c.resolve()},[c,g,a.location,i]),React.useEffect(()=>{!u.isTransitioning&&R&&(s(R.state),d({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),w(void 0))},[u.isTransitioning,R]),React.useEffect(()=>{},[]);let _=React.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:D=>r.navigate(D),push:(D,A,U)=>r.navigate(D,{state:A,preventScrollReset:U==null?void 0:U.preventScrollReset}),replace:(D,A,U)=>r.navigate(D,{replace:!0,state:A,preventScrollReset:U==null?void 0:U.preventScrollReset})}),[r]),M=r.basename||"/",h=React.useMemo(()=>({router:r,navigator:_,static:!1,basename:M}),[r,_,M]);return React.createElement(React.Fragment,null,React.createElement(UNSAFE_DataRouterContext.Provider,{value:h},React.createElement(UNSAFE_DataRouterStateContext.Provider,{value:a},React.createElement(or.Provider,{value:v.current},React.createElement(ir.Provider,{value:u},React.createElement(Router,{basename:M,location:a.location,navigationType:a.historyAction,navigator:_,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?React.createElement(Fn,{routes:r.routes,future:r.future,state:a}):t))))),null)}function Fn(e){let{routes:t,future:r,state:n}=e;return UNSAFE_useRoutesImpl(t,void 0,n,r)}function Un(e){let{basename:t,children:r,future:n,window:a}=e,o=ee.useRef();o.current==null&&(o.current=Pr({window:a,v5Compat:!0}));let i=o.current,[s,u]=ee.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},c=ee.useCallback(b=>{d&&ge?ge(()=>u(b)):u(b)},[u,d]);return ee.useLayoutEffect(()=>i.listen(c),[i,c]),ee.createElement(De.F0,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function Pa(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,u]=React.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},c=React.useCallback(b=>{d&&ge?ge(()=>u(b)):u(b)},[u,d]);return React.useLayoutEffect(()=>i.listen(c),[i,c]),React.createElement(Router,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function xa(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||{},u=React.useCallback(d=>{s&&ge?ge(()=>i(d)):i(d)},[i,s]);return React.useLayoutEffect(()=>a.listen(u),[a,u]),React.createElement(Router,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const Mn=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Nn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,On=ee.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:s,target:u,to:d,preventScrollReset:c,unstable_viewTransition:b}=t,g=vn(t,Tn),{basename:y}=ee.useContext(De.Us),R,w=!1;if(typeof d=="string"&&Nn.test(d)&&(R=d,Mn))try{let L=new URL(window.location.href),_=d.startsWith("//")?new URL(L.protocol+d):new URL(d),M=Oe(_.pathname,y);_.origin===L.origin&&M!=null?d=M+_.search+_.hash:w=!0}catch{}let v=(0,De.oQ)(d,{relative:a}),p=In(d,{replace:i,state:s,target:u,preventScrollReset:c,relative:a,unstable_viewTransition:b});function P(L){n&&n(L),L.defaultPrevented||p(L)}return ee.createElement("a",re({},g,{href:R||v,onClick:w||o?n:P,ref:r,target:u}))}),La=null,jn=null;function Da(e){let{getKey:t,storageKey:r}=e;return zn({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 Ke;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ke||(Ke={}));function Ta(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 wt(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function In(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s}=t===void 0?{}:t,u=(0,De.s0)(),d=(0,De.TH)(),c=(0,De.WU)(e,{relative:i});return ee.useCallback(b=>{if(En(b,r)){b.preventDefault();let g=n!==void 0?n:(0,Tt.Ep)(d)===(0,Tt.Ep)(c);u(e,{replace:g,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s})}},[d,u,c,n,a,r,e,o,i,s])}function _a(e){let t=React.useRef(yt(e)),r=React.useRef(!1),n=useLocation(),a=React.useMemo(()=>Pn(n.search,r.current?null:t.current),[n.search]),o=useNavigate(),i=React.useCallback((s,u)=>{const d=yt(typeof s=="function"?s(a):s);r.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function Hn(){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 Bn=0,ur=()=>"__"+String(++Bn)+"__";function kn(){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={}),Hn();let{action:o,method:i,encType:s,formData:u,body:d}=Dn(n,t);if(a.navigate===!1){let c=a.fetcherKey||ur();e.fetch(c,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,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:u,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 Ca(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=re({},useResolvedPath(e||".",{relative:r})),s=useLocation();if(e==null){i.search=s.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.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 Aa(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=qe(Ce.UseFetcher),a=wt(Ke.UseFetcher),o=React.useContext(or),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 u=sr?sr():"",[d,c]=React.useState(r||u);r&&r!==d?c(r):d||c(ur()),React.useEffect(()=>(n.getFetcher(d),()=>{n.deleteFetcher(d)}),[n,d]);let b=React.useCallback((P,L)=>{s||UNSAFE_invariant(!1),n.fetch(d,s,P,L)},[d,s,n]),g=kn(),y=React.useCallback((P,L)=>{g(P,re({},L,{navigate:!1,fetcherKey:d}))},[d,g]),R=React.useMemo(()=>React.forwardRef((L,_)=>React.createElement(jn,re({},L,{navigate:!1,fetcherKey:d,ref:_}))),[d]),w=a.fetchers.get(d)||IDLE_FETCHER,v=o.get(d);return React.useMemo(()=>re({Form:R,submit:y,load:b},w,{data:v}),[R,y,b,w,v])}function Fa(){let e=wt(Ke.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[r,n]=t;return re({},n,{key:r})})}const cr="react-router-scroll-positions";let et={};function zn(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=qe(Ce.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=wt(Ke.UseScrollRestoration),{basename:i}=React.useContext(UNSAFE_NavigationContext),s=useLocation(),u=useMatches(),d=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Kn(React.useCallback(()=>{if(d.state==="idle"){let c=(t?t(s,u):null)||s.key;et[c]=window.scrollY}try{sessionStorage.setItem(r||cr,JSON.stringify(et))}catch{}window.history.scrollRestoration="auto"},[r,t,d.state,s,u])),typeof document!="undefined"&&(React.useLayoutEffect(()=>{try{let c=sessionStorage.getItem(r||cr);c&&(et=JSON.parse(c))}catch{}},[r]),React.useLayoutEffect(()=>{let c=t&&i!=="/"?(g,y)=>t(re({},g,{pathname:stripBasename(g.pathname,i)||g.pathname}),y):t,b=n==null?void 0:n.enableScrollRestoration(et,()=>window.scrollY,c);return()=>b&&b()},[n,i,t]),React.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(s.hash){let c=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(c){c.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[s,a,o]))}function Ua(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 Kn(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 Ma(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 Na(e,t){t===void 0&&(t={});let r=React.useContext(ir);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.6a4a6115.js.map
|