@techdocs/cli 1.6.1-next.1 → 1.7.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 +23 -0
- package/dist/cjs/{mkdocs-571e2dc0.cjs.js → mkdocs-062c745e.cjs.js} +11 -4
- package/dist/cjs/mkdocs-062c745e.cjs.js.map +1 -0
- package/dist/cjs/{serve-bf2ff8e3.cjs.js → serve-d8eba600.cjs.js} +11 -4
- package/dist/cjs/serve-d8eba600.cjs.js.map +1 -0
- package/dist/cjs/{mkdocsServer-107b8efd.cjs.js → utils-fa60b533.cjs.js} +20 -1
- package/dist/cjs/utils-fa60b533.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +151 -151
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1059.84ba853b.chunk.js +10 -0
- package/dist/embedded-app/static/1059.84ba853b.chunk.js.map +1 -0
- package/dist/embedded-app/static/1600.ec5e759e.chunk.js +3 -0
- package/dist/embedded-app/static/1600.ec5e759e.chunk.js.map +1 -0
- package/dist/embedded-app/static/3510.6d8cb98c.chunk.js +3 -0
- package/dist/embedded-app/static/3510.6d8cb98c.chunk.js.map +1 -0
- package/dist/embedded-app/static/{5914.111b8c95.chunk.js → 5914.633b2934.chunk.js} +2 -2
- package/dist/embedded-app/static/{5914.111b8c95.chunk.js.map → 5914.633b2934.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7241.a066d2d0.chunk.js +3 -0
- package/dist/embedded-app/static/7241.a066d2d0.chunk.js.map +1 -0
- package/dist/embedded-app/static/8096.752da27d.chunk.js +11 -0
- package/dist/embedded-app/static/8096.752da27d.chunk.js.map +1 -0
- package/dist/embedded-app/static/8629.ee337616.chunk.js +7 -0
- package/dist/embedded-app/static/8629.ee337616.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.6ea4af3c.js +487 -0
- package/dist/embedded-app/static/main.6ea4af3c.js.map +1 -0
- package/dist/embedded-app/static/{module-react-beautiful-dnd.0ca788d0.js → module-react-beautiful-dnd.71ae82d9.js} +2 -2
- package/dist/embedded-app/static/{module-react-beautiful-dnd.0ca788d0.js.map → module-react-beautiful-dnd.71ae82d9.js.map} +1 -1
- package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.d96a5b36.js +22 -0
- package/dist/embedded-app/static/module-react-router.d96a5b36.js.map +1 -0
- package/dist/embedded-app/static/{runtime.f8ffa716.js → runtime.6ea4af3c.js} +3 -3
- package/dist/embedded-app/static/runtime.6ea4af3c.js.map +1 -0
- package/dist/embedded-app/static/vendor.6ea4af3c.js +207 -0
- package/dist/embedded-app/static/vendor.6ea4af3c.js.map +1 -0
- package/dist/index.cjs.js +3 -3
- package/package.json +4 -4
- package/dist/cjs/mkdocs-571e2dc0.cjs.js.map +0 -1
- package/dist/cjs/mkdocsServer-107b8efd.cjs.js.map +0 -1
- package/dist/cjs/serve-bf2ff8e3.cjs.js.map +0 -1
- package/dist/embedded-app/static/1600.ef4a7196.chunk.js +0 -3
- package/dist/embedded-app/static/1600.ef4a7196.chunk.js.map +0 -1
- package/dist/embedded-app/static/3893.118c937c.chunk.js +0 -3
- package/dist/embedded-app/static/3893.118c937c.chunk.js.map +0 -1
- package/dist/embedded-app/static/4966.e30bae7f.chunk.js +0 -49
- package/dist/embedded-app/static/4966.e30bae7f.chunk.js.map +0 -1
- package/dist/embedded-app/static/7893.2112ad7c.chunk.js +0 -3
- package/dist/embedded-app/static/7893.2112ad7c.chunk.js.map +0 -1
- package/dist/embedded-app/static/8629.34b012ba.chunk.js +0 -7
- package/dist/embedded-app/static/8629.34b012ba.chunk.js.map +0 -1
- package/dist/embedded-app/static/967.dadcb6bd.chunk.js +0 -11
- package/dist/embedded-app/static/967.dadcb6bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.f8ffa716.js +0 -487
- package/dist/embedded-app/static/main.f8ffa716.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.8eff32d7.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.8eff32d7.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.05179f87.js +0 -22
- package/dist/embedded-app/static/module-react-router.05179f87.js.map +0 -1
- package/dist/embedded-app/static/runtime.f8ffa716.js.map +0 -1
- package/dist/embedded-app/static/vendor.f8ffa716.js +0 -167
- package/dist/embedded-app/static/vendor.f8ffa716.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5109],{71597:function(On,ur,Ce){Ce.d(ur,{VK:function(){return hn},rU:function(){return gn}});var Q=Ce(2784),cr=Ce.t(Q,2),Re=Ce(73557),yt=Ce(84800);/**
|
|
2
|
-
* @remix-run/router v1.9.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Remix Software Inc.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/function 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 vt="popstate";function In(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((y,v)=>h(y,typeof y=="string"?null:y.state,v===0?"default":void 0));let o=u(r==null?a.length-1:r),i=k.Pop,l=null;function u(y){return Math.min(Math.max(y,0),a.length-1)}function d(){return a[o]}function h(y,v,R){v===void 0&&(v=null);let m=re(a?d().pathname:"/",y,v,R);return te(m.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(y)),m}function g(y){return typeof y=="string"?y:ne(y)}return{get index(){return o},get action(){return i},get location(){return d()},createHref:g,createURL(y){return new URL(g(y),"http://localhost")},encodeLocation(y){let v=typeof y=="string"?Z(y):y;return{pathname:v.pathname||"",search:v.search||"",hash:v.hash||""}},push(y,v){i=k.Push;let R=h(y,v);o+=1,a.splice(o,a.length,R),n&&l&&l({action:i,location:R,delta:1})},replace(y,v){i=k.Replace;let R=h(y,v);a[o]=R,n&&l&&l({action:i,location:R,delta:0})},go(y){i=k.Pop;let v=u(o+y),R=a[v];o=v,l&&l({action:i,location:R,delta:y})},listen(y){return l=y,()=>{l=null}}}}function dr(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return re("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ne(a)}return Rt(t,r,null,e)}function kn(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:l="",hash:u=""}=Z(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),re("",{pathname:i,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(a,o){let i=a.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let u=a.location.href,d=u.indexOf("#");l=d===-1?u:u.slice(0,d)}return l+"#"+(typeof o=="string"?o:ne(o))}function n(a,o){te(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Rt(t,r,n,e)}function _(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function te(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function fr(){return Math.random().toString(36).substr(2,8)}function bt(e,t){return{usr:e.state,key:e.key,idx:t}}function re(e,t,r,n){return r===void 0&&(r=null),M({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Z(t):t,{state:r,key:t&&t.key||n||fr()})}function ne(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 Z(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 Rt(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l=k.Pop,u=null,d=h();d==null&&(d=0,i.replaceState(M({},i.state,{idx:d}),""));function h(){return(i.state||{idx:null}).idx}function g(){l=k.Pop;let m=h(),E=m==null?null:m-d;d=m,u&&u({action:l,location:R.location,delta:E})}function b(m,E){l=k.Push;let C=re(R.location,m,E);r&&r(C,m),d=h()+1;let P=bt(C,d),s=R.createHref(C);try{i.pushState(P,"",s)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;a.location.assign(s)}o&&u&&u({action:l,location:R.location,delta:1})}function y(m,E){l=k.Replace;let C=re(R.location,m,E);r&&r(C,m),d=h();let P=bt(C,d),s=R.createHref(C);i.replaceState(P,"",s),o&&u&&u({action:l,location:R.location,delta:0})}function v(m){let E=a.location.origin!=="null"?a.location.origin:a.location.href,C=typeof m=="string"?m:ne(m);return _(E,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,E)}let R={get action(){return l},get location(){return e(a,i)},listen(m){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(vt,g),u=m,()=>{a.removeEventListener(vt,g),u=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:b,replace:y,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 hr=new Set(["lazy","caseSensitive","path","id","index","children"]);function mr(e){return e.index===!0}function He(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,o)=>{let i=[...r,o],l=typeof a.id=="string"?a.id:i.join("-");if(_(a.index!==!0||!a.children,"Cannot specify children on an index route"),_(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),mr(a)){let u=M({},a,t(a),{id:l});return n[l]=u,u}else{let u=M({},a,t(a),{id:l,children:void 0});return n[l]=u,a.children&&(u.children=He(a.children,t,i,n)),u}})}function ce(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?Z(t):t,a=Ae(n.pathname||"/",r);if(a==null)return null;let o=wt(e);gr(o);let i=null;for(let l=0;i==null&&l<o.length;++l)i=Pr(o[l],Cr(a));return i}function pr(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 wt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,l)=>{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(_(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=Fe([n,u.relativePath]),h=r.concat(u);o.children&&o.children.length>0&&(_(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),wt(o.children,t,h,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:Er(d,o.index),routesMeta:h})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))a(o,i);else for(let u of St(o.path))a(o,i,u)}),t}function St(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=St(n.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),a&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function gr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:xr(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const yr=/^:\w+$/,vr=3,br=2,Rr=1,wr=10,Sr=null,Et=e=>e==="*";function Er(e,t){let r=e.split("/"),n=r.length;return r.some(Et)&&(n+=Sr),t&&(n+=br),r.filter(a=>!Et(a)).reduce((a,o)=>a+(yr.test(o)?vr:o===""?Rr:wr),n)}function xr(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 Pr(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let i=0;i<r.length;++i){let l=r[i],u=i===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=Dr({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d);if(!h)return null;Object.assign(n,h.params);let g=l.route;o.push({params:n,pathname:Fe([a,h.pathname]),pathnameBase:Tr(Fe([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=Fe([a,h.pathnameBase]))}return o}function Hn(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(te(!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,l,u)=>{if(l===u.length-1&&i==="*")return a(t["*"]);const h=i.match(/^:(\w+)(\??)$/);if(h){const[,g,b]=h;let y=t[g];return _(b==="?"||y!=null,'Missing ":'+g+'" param'),a(y)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+o.join("/")}function Dr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Lr(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,h,g)=>{if(h==="*"){let b=l[g]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}return d[h]=Ar(l[g]||"",h),d},{}),pathname:o,pathnameBase:i,pattern:e}}function Lr(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),te(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,l)=>(n.push(l),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Cr(e){try{return decodeURI(e)}catch(t){return te(!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 Ar(e,t){try{return decodeURIComponent(e)}catch(r){return te(!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 Ae(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 Fr(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Z(e):e;return{pathname:r?r.startsWith("/")?r:Ur(r,t):t,search:_r(n),hash:Nr(a)}}function Ur(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 Qe(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 xt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Mr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Z(e):(a=M({},e),_(!a.pathname||!a.pathname.includes("?"),Qe("?","pathname","search",a)),_(!a.pathname||!a.pathname.includes("#"),Qe("#","pathname","hash",a)),_(!a.search||!a.search.includes("#"),Qe("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(n||i==null)l=r;else{let g=t.length-1;if(i.startsWith("..")){let b=i.split("/");for(;b[0]==="..";)b.shift(),g-=1;a.pathname=b.join("/")}l=g>=0?t[g]:"/"}let u=Fr(a,l),d=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}function Bn(e){return e===""||e.pathname===""?"/":typeof e=="string"?Z(e).pathname:e.pathname}const Fe=e=>e.join("/").replace(/\/\/+/g,"/"),Tr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_r=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zn=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 Pt extends null{}class jr{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],_(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 Pt("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[l,u]=i;return Object.assign(o,{[l]:this.trackPromise(l,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 Pt)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let 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 _(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]:Ir(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Or(e){return e instanceof Promise&&e._tracked===!0}function Ir(e){if(!Or(e))return e;if(e._error)throw e._error;return e._data}const Kn=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new jr(t,n)},kr=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}))},Wn=(e,t)=>{let r=kr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Dt{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 Lt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ct=["post","put","patch","delete"],Hr=new Set(Ct),Br=["get",...Ct],zr=new Set(Br),Kr=new Set([301,302,303,307,308]),Wr=new Set([307,308]),Ze={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$r={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},At=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ft=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function $n(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;_(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 c=e.detectErrorBoundary;a=f=>({hasErrorBoundary:c(f)})}else a=Ft;let o={},i=He(e.routes,a,void 0,o),l,u=e.basename||"/",d=M({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,g=new Set,b=null,y=null,v=null,R=e.hydrationData!=null,m=ce(i,e.history.location,u),E=null;if(m==null){let c=H(404,{pathname:e.history.location.pathname}),{matches:f,route:p}=Be(i);m=f,E={[p.id]:c}}let C=!m.some(c=>c.route.lazy)&&(!m.some(c=>c.route.loader)||e.hydrationData!=null),P,s={historyAction:e.history.action,location:e.history.location,matches:m,initialized:C,navigation:Ze,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},U=k.Pop,B=!1,F,Y=!1,G=!1,ee=[],Pe=[],K=new Map,Ye=0,Ne=-1,De=new Map,ae=new Set,Le=new Map,pe=new Map,ge=new Map,st=!1;function En(){return h=e.history.listen(c=>{let{action:f,location:p,delta:w}=c;if(st){st=!1;return}te(ge.size===0||w!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let L=or({currentLocation:s.location,nextLocation:p,historyAction:f});if(L&&w!=null){st=!0,e.history.go(w*-1),Ge(L,{state:"blocked",location:p,proceed(){Ge(L,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),e.history.go(w)},reset(){let D=new Map(s.blockers);D.set(L,Ue),$({blockers:D})}});return}return ye(f,p)}),s.initialized||ye(k.Pop,s.location),P}function xn(){h&&h(),g.clear(),F&&F.abort(),s.fetchers.forEach((c,f)=>ct(f)),s.blockers.forEach((c,f)=>ar(f))}function Pn(c){return g.add(c),()=>g.delete(c)}function $(c){s=M({},s,c),g.forEach(f=>f(s))}function je(c,f){var p,w;let L=s.actionData!=null&&s.navigation.formMethod!=null&&J(s.navigation.formMethod)&&s.navigation.state==="loading"&&((p=c.state)==null?void 0:p._isRedirect)!==!0,D;f.actionData?Object.keys(f.actionData).length>0?D=f.actionData:D=null:L?D=s.actionData:D=null;let A=f.loaderData?Ht(s.loaderData,f.loaderData,f.matches||[],f.errors):s.loaderData,x=s.blockers;x.size>0&&(x=new Map(x),x.forEach((I,V)=>x.set(V,Ue)));let S=B===!0||s.navigation.formMethod!=null&&J(s.navigation.formMethod)&&((w=c.state)==null?void 0:w._isRedirect)!==!0;l&&(i=l,l=void 0),Y||U===k.Pop||(U===k.Push?e.history.push(c,c.state):U===k.Replace&&e.history.replace(c,c.state)),$(M({},f,{actionData:D,loaderData:A,historyAction:U,location:c,initialized:!0,navigation:Ze,revalidation:"idle",restoreScrollPosition:lr(c,f.matches||s.matches),preventScrollReset:S,blockers:x})),U=k.Pop,B=!1,Y=!1,G=!1,ee=[],Pe=[]}async function Zt(c,f){if(typeof c=="number"){e.history.go(c);return}let p=qe(s.location,s.matches,u,d.v7_prependBasename,c,f==null?void 0:f.fromRouteId,f==null?void 0:f.relative),{path:w,submission:L,error:D}=Ut(d.v7_normalizeFormMethod,!1,p,f),A=s.location,x=re(s.location,w,f&&f.state);x=M({},x,e.history.encodeLocation(x));let S=f&&f.replace!=null?f.replace:void 0,I=k.Push;S===!0?I=k.Replace:S===!1||L!=null&&J(L.formMethod)&&L.formAction===s.location.pathname+s.location.search&&(I=k.Replace);let V=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,T=or({currentLocation:A,nextLocation:x,historyAction:I});if(T){Ge(T,{state:"blocked",location:x,proceed(){Ge(T,{state:"proceeding",proceed:void 0,reset:void 0,location:x}),Zt(c,f)},reset(){let j=new Map(s.blockers);j.set(T,Ue),$({blockers:j})}});return}return await ye(I,x,{submission:L,pendingError:D,preventScrollReset:V,replace:f&&f.replace})}function Dn(){if(ut(),$({revalidation:"loading"}),s.navigation.state!=="submitting"){if(s.navigation.state==="idle"){ye(s.historyAction,s.location,{startUninterruptedRevalidation:!0});return}ye(U||s.historyAction,s.navigation.location,{overrideNavigation:s.navigation})}}async function ye(c,f,p){F&&F.abort(),F=null,U=c,Y=(p&&p.startUninterruptedRevalidation)===!0,_n(s.location,s.matches),B=(p&&p.preventScrollReset)===!0;let w=l||i,L=p&&p.overrideNavigation,D=ce(w,f,u);if(!D){let j=H(404,{pathname:f.pathname}),{matches:z,route:ve}=Be(w);dt(),je(f,{matches:z,loaderData:{},errors:{[ve.id]:j}});return}if(s.initialized&&!G&&Gr(s.location,f)&&!(p&&p.submission&&J(p.submission.formMethod))){je(f,{matches:D});return}F=new AbortController;let A=Me(e.history,f,F.signal,p&&p.submission),x,S;if(p&&p.pendingError)S={[fe(D).route.id]:p.pendingError};else if(p&&p.submission&&J(p.submission.formMethod)){let j=await Ln(A,f,p.submission,D,{replace:p.replace});if(j.shortCircuited)return;x=j.pendingActionData,S=j.pendingActionError,L=nt(f,p.submission),A=new Request(A.url,{signal:A.signal})}let{shortCircuited:I,loaderData:V,errors:T}=await Cn(A,f,D,L,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,x,S);I||(F=null,je(f,M({matches:D},x?{actionData:x}:{},{loaderData:V,errors:T})))}async function Ln(c,f,p,w,L){L===void 0&&(L={}),ut();let D=qr(f,p);$({navigation:D});let A,x=Te(w,f);if(!x.route.action&&!x.route.lazy)A={type:O.error,error:H(405,{method:c.method,pathname:f.pathname,routeId:x.route.id})};else if(A=await de("action",c,x,w,o,a,u),c.signal.aborted)return{shortCircuited:!0};if(me(A)){let S;return L&&L.replace!=null?S=L.replace:S=A.location===s.location.pathname+s.location.search,await Oe(s,A,{submission:p,replace:S}),{shortCircuited:!0}}if(he(A)){let S=fe(w,x.route.id);return(L&&L.replace)!==!0&&(U=k.Push),{pendingActionData:{},pendingActionError:{[S.route.id]:A.error}}}if(le(A))throw H(400,{type:"defer-action"});return{pendingActionData:{[x.route.id]:A.data}}}async function Cn(c,f,p,w,L,D,A,x,S){let I=w||nt(f,L),V=L||D||$t(I),T=l||i,[j,z]=Tt(e.history,s,p,V,f,G,ee,Pe,Le,ae,T,u,x,S);if(dt(N=>!(p&&p.some(X=>X.route.id===N))||j&&j.some(X=>X.route.id===N)),Ne=++Ye,j.length===0&&z.length===0){let N=rr();return je(f,M({matches:p,loaderData:{},errors:S||null},x?{actionData:x}:{},N?{fetchers:new Map(s.fetchers)}:{})),{shortCircuited:!0}}if(!Y){z.forEach(X=>{let ue=s.fetchers.get(X.key),gt=_e(void 0,ue?ue.data:void 0);s.fetchers.set(X.key,gt)});let N=x||s.actionData;$(M({navigation:I},N?Object.keys(N).length===0?{actionData:null}:{actionData:N}:{},z.length>0?{fetchers:new Map(s.fetchers)}:{}))}z.forEach(N=>{K.has(N.key)&&se(N.key),N.controller&&K.set(N.key,N.controller)});let ve=()=>z.forEach(N=>se(N.key));F&&F.signal.addEventListener("abort",ve);let{results:be,loaderResults:Ie,fetcherResults:ft}=await er(s.matches,p,j,z,c);if(c.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ve),z.forEach(N=>K.delete(N.key));let oe=Bt(be);if(oe){if(oe.idx>=j.length){let N=z[oe.idx-j.length].key;ae.add(N)}return await Oe(s,oe.result,{replace:A}),{shortCircuited:!0}}let{loaderData:ie,errors:Xe}=kt(s,p,j,Ie,S,z,ft,pe);pe.forEach((N,X)=>{N.subscribe(ue=>{(ue||N.done)&&pe.delete(X)})});let ht=rr(),mt=nr(Ne),pt=ht||mt||z.length>0;return M({loaderData:ie,errors:Xe},pt?{fetchers:new Map(s.fetchers)}:{})}function qt(c){return s.fetchers.get(c)||$r}function An(c,f,p,w){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.");K.has(c)&&se(c);let L=l||i,D=qe(s.location,s.matches,u,d.v7_prependBasename,p,f,w==null?void 0:w.relative),A=ce(L,D,u);if(!A){Je(c,f,H(404,{pathname:D}));return}let{path:x,submission:S,error:I}=Ut(d.v7_normalizeFormMethod,!0,D,w);if(I){Je(c,f,I);return}let V=Te(A,x);if(B=(w&&w.preventScrollReset)===!0,S&&J(S.formMethod)){Fn(c,f,x,V,A,S);return}Le.set(c,{routeId:f,path:x}),Un(c,f,x,V,A,S)}async function Fn(c,f,p,w,L,D){if(ut(),Le.delete(c),!w.route.action&&!w.route.lazy){let W=H(405,{method:D.formMethod,pathname:p,routeId:f});Je(c,f,W);return}let A=s.fetchers.get(c),x=en(D,A);s.fetchers.set(c,x),$({fetchers:new Map(s.fetchers)});let S=new AbortController,I=Me(e.history,p,S.signal,D);K.set(c,S);let V=Ye,T=await de("action",I,w,L,o,a,u);if(I.signal.aborted){K.get(c)===S&&K.delete(c);return}if(me(T))if(K.delete(c),Ne>V){let W=Se(void 0);s.fetchers.set(c,W),$({fetchers:new Map(s.fetchers)});return}else{ae.add(c);let W=_e(D);return s.fetchers.set(c,W),$({fetchers:new Map(s.fetchers)}),Oe(s,T,{fetcherSubmission:D})}if(he(T)){Je(c,f,T.error);return}if(le(T))throw H(400,{type:"defer-action"});let j=s.navigation.location||s.location,z=Me(e.history,j,S.signal),ve=l||i,be=s.navigation.state!=="idle"?ce(ve,s.navigation.location,u):s.matches;_(be,"Didn't find any matches after fetcher action");let Ie=++Ye;De.set(c,Ie);let ft=_e(D,T.data);s.fetchers.set(c,ft);let[oe,ie]=Tt(e.history,s,be,D,j,G,ee,Pe,Le,ae,ve,u,{[w.route.id]:T.data},void 0);ie.filter(W=>W.key!==c).forEach(W=>{let ke=W.key,sr=s.fetchers.get(ke),jn=_e(void 0,sr?sr.data:void 0);s.fetchers.set(ke,jn),K.has(ke)&&se(ke),W.controller&&K.set(ke,W.controller)}),$({fetchers:new Map(s.fetchers)});let Xe=()=>ie.forEach(W=>se(W.key));S.signal.addEventListener("abort",Xe);let{results:ht,loaderResults:mt,fetcherResults:pt}=await er(s.matches,be,oe,ie,z);if(S.signal.aborted)return;S.signal.removeEventListener("abort",Xe),De.delete(c),K.delete(c),ie.forEach(W=>K.delete(W.key));let N=Bt(ht);if(N){if(N.idx>=oe.length){let W=ie[N.idx-oe.length].key;ae.add(W)}return Oe(s,N.result)}let{loaderData:X,errors:ue}=kt(s,s.matches,oe,mt,void 0,ie,pt,pe);if(s.fetchers.has(c)){let W=Se(T.data);s.fetchers.set(c,W)}let gt=nr(Ie);s.navigation.state==="loading"&&Ie>Ne?(_(U,"Expected pending action"),F&&F.abort(),je(s.navigation.location,{matches:be,loaderData:X,errors:ue,fetchers:new Map(s.fetchers)})):($(M({errors:ue,loaderData:Ht(s.loaderData,X,be,ue)},gt||ie.length>0?{fetchers:new Map(s.fetchers)}:{})),G=!1)}async function Un(c,f,p,w,L,D){let A=s.fetchers.get(c),x=_e(D,A?A.data:void 0);s.fetchers.set(c,x),$({fetchers:new Map(s.fetchers)});let S=new AbortController,I=Me(e.history,p,S.signal);K.set(c,S);let V=Ye,T=await de("loader",I,w,L,o,a,u);if(le(T)&&(T=await Wt(T,I.signal,!0)||T),K.get(c)===S&&K.delete(c),I.signal.aborted)return;if(me(T))if(Ne>V){let z=Se(void 0);s.fetchers.set(c,z),$({fetchers:new Map(s.fetchers)});return}else{ae.add(c),await Oe(s,T);return}if(he(T)){let z=fe(s.matches,f);s.fetchers.delete(c),$({fetchers:new Map(s.fetchers),errors:{[z.route.id]:T.error}});return}_(!le(T),"Unhandled fetcher deferred data");let j=Se(T.data);s.fetchers.set(c,j),$({fetchers:new Map(s.fetchers)})}async function Oe(c,f,p){let{submission:w,fetcherSubmission:L,replace:D}=p===void 0?{}:p;f.revalidate&&(G=!0);let A=re(c.location,f.location,{_isRedirect:!0});if(_(A,"Expected a location on the redirect navigation"),r){let j=!1;if(f.reloadDocument)j=!0;else if(At.test(f.location)){const z=e.history.createURL(f.location);j=z.origin!==t.location.origin||Ae(z.pathname,u)==null}if(j){D?t.location.replace(f.location):t.location.assign(f.location);return}}F=null;let x=D===!0?k.Replace:k.Push,{formMethod:S,formAction:I,formEncType:V}=c.navigation;!w&&!L&&S&&I&&V&&(w=$t(c.navigation));let T=w||L;if(Wr.has(f.status)&&T&&J(T.formMethod))await ye(x,A,{submission:M({},T,{formAction:f.location}),preventScrollReset:B});else{let j=nt(A,w);await ye(x,A,{overrideNavigation:j,fetcherSubmission:L,preventScrollReset:B})}}async function er(c,f,p,w,L){let D=await Promise.all([...p.map(S=>de("loader",L,S,f,o,a,u)),...w.map(S=>S.matches&&S.match&&S.controller?de("loader",Me(e.history,S.path,S.controller.signal),S.match,S.matches,o,a,u):{type:O.error,error:H(404,{pathname:S.path})})]),A=D.slice(0,p.length),x=D.slice(p.length);return await Promise.all([Kt(c,p,A,A.map(()=>L.signal),!1,s.loaderData),Kt(c,w.map(S=>S.match),x,w.map(S=>S.controller?S.controller.signal:null),!0)]),{results:D,loaderResults:A,fetcherResults:x}}function ut(){G=!0,ee.push(...dt()),Le.forEach((c,f)=>{K.has(f)&&(Pe.push(f),se(f))})}function Je(c,f,p){let w=fe(s.matches,f);ct(c),$({errors:{[w.route.id]:p},fetchers:new Map(s.fetchers)})}function ct(c){let f=s.fetchers.get(c);K.has(c)&&!(f&&f.state==="loading"&&De.has(c))&&se(c),Le.delete(c),De.delete(c),ae.delete(c),s.fetchers.delete(c)}function se(c){let f=K.get(c);_(f,"Expected fetch controller: "+c),f.abort(),K.delete(c)}function tr(c){for(let f of c){let p=qt(f),w=Se(p.data);s.fetchers.set(f,w)}}function rr(){let c=[],f=!1;for(let p of ae){let w=s.fetchers.get(p);_(w,"Expected fetcher: "+p),w.state==="loading"&&(ae.delete(p),c.push(p),f=!0)}return tr(c),f}function nr(c){let f=[];for(let[p,w]of De)if(w<c){let L=s.fetchers.get(p);_(L,"Expected fetcher: "+p),L.state==="loading"&&(se(p),De.delete(p),f.push(p))}return tr(f),f.length>0}function Mn(c,f){let p=s.blockers.get(c)||Ue;return ge.get(c)!==f&&ge.set(c,f),p}function ar(c){s.blockers.delete(c),ge.delete(c)}function Ge(c,f){let p=s.blockers.get(c)||Ue;_(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 w=new Map(s.blockers);w.set(c,f),$({blockers:w})}function or(c){let{currentLocation:f,nextLocation:p,historyAction:w}=c;if(ge.size===0)return;ge.size>1&&te(!1,"A router only supports one blocker at a time");let L=Array.from(ge.entries()),[D,A]=L[L.length-1],x=s.blockers.get(D);if(!(x&&x.state==="proceeding")&&A({currentLocation:f,nextLocation:p,historyAction:w}))return D}function dt(c){let f=[];return pe.forEach((p,w)=>{(!c||c(w))&&(p.cancel(),f.push(w),pe.delete(w))}),f}function Tn(c,f,p){if(b=c,v=f,y=p||null,!R&&s.navigation===Ze){R=!0;let w=lr(s.location,s.matches);w!=null&&$({restoreScrollPosition:w})}return()=>{b=null,v=null,y=null}}function ir(c,f){return y&&y(c,f.map(w=>pr(w,s.loaderData)))||c.key}function _n(c,f){if(b&&v){let p=ir(c,f);b[p]=v()}}function lr(c,f){if(b){let p=ir(c,f),w=b[p];if(typeof w=="number")return w}return null}function Nn(c){o={},l=He(c,a,void 0,o)}return P={get basename(){return u},get state(){return s},get routes(){return i},initialize:En,subscribe:Pn,enableScrollRestoration:Tn,navigate:Zt,fetch:An,revalidate:Dn,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:qt,deleteFetcher:ct,dispose:xn,getBlocker:Mn,deleteBlocker:ar,_internalFetchControllers:K,_internalActiveDeferreds:pe,_internalSetRoutes:Nn},P}const Vr=Symbol("deferred");function Vn(e,t){_(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=b=>({hasErrorBoundary:g(b)})}else a=Ft;let o=He(e,a,void 0,r);async function i(g,b){let{requestContext:y}=b===void 0?{}:b,v=new URL(g.url),R=g.method,m=re("",ne(v),null,"default"),E=ce(o,m,n);if(!tt(R)&&R!=="HEAD"){let P=H(405,{method:R}),{matches:s,route:U}=Be(o);return{basename:n,location:m,matches:s,loaderData:{},actionData:null,errors:{[U.id]:P},statusCode:P.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!E){let P=H(404,{pathname:m.pathname}),{matches:s,route:U}=Be(o);return{basename:n,location:m,matches:s,loaderData:{},actionData:null,errors:{[U.id]:P},statusCode:P.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let C=await u(g,m,E,y);return we(C)?C:M({location:m,basename:n},C)}async function l(g,b){let{routeId:y,requestContext:v}=b===void 0?{}:b,R=new URL(g.url),m=g.method,E=re("",ne(R),null,"default"),C=ce(o,E,n);if(!tt(m)&&m!=="HEAD"&&m!=="OPTIONS")throw H(405,{method:m});if(!C)throw H(404,{pathname:E.pathname});let P=y?C.find(F=>F.route.id===y):Te(C,E);if(y&&!P)throw H(403,{pathname:E.pathname,routeId:y});if(!P)throw H(404,{pathname:E.pathname});let s=await u(g,E,C,v,P);if(we(s))return s;let U=s.errors?Object.values(s.errors)[0]:void 0;if(U!==void 0)throw U;if(s.actionData)return Object.values(s.actionData)[0];if(s.loaderData){var B;let F=Object.values(s.loaderData)[0];return(B=s.activeDeferreds)!=null&&B[P.route.id]&&(F[Vr]=s.activeDeferreds[P.route.id]),F}}async function u(g,b,y,v,R){_(g.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(J(g.method.toLowerCase()))return await d(g,y,R||Te(y,b),v,R!=null);let m=await h(g,y,v,R);return we(m)?m:M({},m,{actionData:null,actionHeaders:{}})}catch(m){if(Zr(m)){if(m.type===O.error)throw m.response;return m.response}if(Qr(m))return m;throw m}}async function d(g,b,y,v,R){let m;if(!y.route.action&&!y.route.lazy){let P=H(405,{method:g.method,pathname:new URL(g.url).pathname,routeId:y.route.id});if(R)throw P;m={type:O.error,error:P}}else if(m=await de("action",g,y,b,r,a,n,{isStaticRequest:!0,isRouteRequest:R,requestContext:v}),g.signal.aborted){let P=R?"queryRoute":"query";throw new Error(P+"() call aborted: "+g.method+" "+g.url)}if(me(m))throw new Response(null,{status:m.status,headers:{Location:m.location}});if(le(m)){let P=H(400,{type:"defer-action"});if(R)throw P;m={type:O.error,error:P}}if(R){if(he(m))throw m.error;return{matches:[y],loaderData:{},actionData:{[y.route.id]:m.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(he(m)){let P=fe(b,y.route.id),s=await h(g,b,v,void 0,{[P.route.id]:m.error});return M({},s,{statusCode:Lt(m.error)?m.error.status:500,actionData:null,actionHeaders:M({},m.headers?{[y.route.id]:m.headers}:{})})}let E=new Request(g.url,{headers:g.headers,redirect:g.redirect,signal:g.signal}),C=await h(E,b,v);return M({},C,m.statusCode?{statusCode:m.statusCode}:{},{actionData:{[y.route.id]:m.data},actionHeaders:M({},m.headers?{[y.route.id]:m.headers}:{})})}async function h(g,b,y,v,R){let m=v!=null;if(m&&!(v!=null&&v.route.loader)&&!(v!=null&&v.route.lazy))throw H(400,{method:g.method,pathname:new URL(g.url).pathname,routeId:v==null?void 0:v.route.id});let C=(v?[v]:Mt(b,Object.keys(R||{})[0])).filter(F=>F.route.loader||F.route.lazy);if(C.length===0)return{matches:b,loaderData:b.reduce((F,Y)=>Object.assign(F,{[Y.route.id]:null}),{}),errors:R||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let P=await Promise.all([...C.map(F=>de("loader",g,F,b,r,a,n,{isStaticRequest:!0,isRouteRequest:m,requestContext:y}))]);if(g.signal.aborted){let F=m?"queryRoute":"query";throw new Error(F+"() call aborted: "+g.method+" "+g.url)}let s=new Map,U=It(b,C,P,R,s),B=new Set(C.map(F=>F.route.id));return b.forEach(F=>{B.has(F.route.id)||(U.loaderData[F.route.id]=null)}),M({},U,{matches:b,activeDeferreds:s.size>0?Object.fromEntries(s.entries()):null})}return{dataRoutes:o,query:i,queryRoute:l}}function Yn(e,t,r){return M({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function Yr(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qe(e,t,r,n,a,o,i){let l,u;if(o!=null&&i!=="path"){l=[];for(let h of t)if(l.push(h),h.route.id===o){u=h;break}}else l=t,u=t[t.length-1];let d=Mr(a||".",xt(l).map(h=>h.pathnameBase),Ae(e.pathname,r)||e.pathname,i==="path");return a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&u&&u.route.index&&!rt(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:Fe([r,d.pathname])),ne(d)}function Ut(e,t,r,n){if(!n||!Yr(n))return{path:r};if(n.formMethod&&!tt(n.formMethod))return{path:r,error:H(405,{method:n.formMethod})};let a=()=>({path:r,error:H(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),l=zt(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!J(i))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,v)=>{let[R,m]=v;return""+y+R+"="+m+`
|
|
11
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!J(i))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}_(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=et(n.formData),d=n.formData;else if(n.body instanceof FormData)u=et(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=Ot(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=Ot(u)}catch{return a()}let h={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(J(h.formMethod))return{path:r,submission:h};let g=Z(r);return t&&g.search&&rt(g.search)&&u.append("index",""),g.search="?"+u,{path:ne(g),submission:h}}function Mt(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 Tt(e,t,r,n,a,o,i,l,u,d,h,g,b,y){let v=y?Object.values(y)[0]:b?Object.values(b)[0]:void 0,R=e.createURL(t.location),m=e.createURL(a),E=y?Object.keys(y)[0]:void 0,P=Mt(r,E).filter((U,B)=>{if(U.route.lazy)return!0;if(U.route.loader==null)return!1;if(Jr(t.loaderData,t.matches[B],U)||i.some(G=>G===U.route.id))return!0;let F=t.matches[B],Y=U;return Nt(U,M({currentUrl:R,currentParams:F.params,nextUrl:m,nextParams:Y.params},n,{actionResult:v,defaultShouldRevalidate:o||R.pathname+R.search===m.pathname+m.search||R.search!==m.search||_t(F,Y)}))}),s=[];return u.forEach((U,B)=>{if(!r.some(Pe=>Pe.route.id===U.routeId))return;let F=ce(h,U.path,g);if(!F){s.push({key:B,routeId:U.routeId,path:U.path,matches:null,match:null,controller:null});return}let Y=t.fetchers.get(B),G=Te(F,U.path),ee=!1;d.has(B)?ee=!1:l.includes(B)?ee=!0:Y&&Y.state!=="idle"&&Y.data===void 0?ee=o:ee=Nt(G,M({currentUrl:R,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:o})),ee&&s.push({key:B,routeId:U.routeId,path:U.path,matches:F,match:G,controller:new AbortController})}),[P,s]}function Jr(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 Nt(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];_(a,"No route found in manifest");let o={};for(let i in n){let u=a[i]!==void 0&&i!=="hasErrorBoundary";te(!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&&!hr.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,M({},t(a),{lazy:void 0}))}async function de(e,t,r,n,a,o,i,l){l===void 0&&(l={});let u,d,h,g=v=>{let R,m=new Promise((E,C)=>R=C);return h=()=>R(),t.signal.addEventListener("abort",h),Promise.race([v({request:t,params:r.params,context:l.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}),jt(r.route,o,a)]);if(R)throw R;d=m[0]}else if(await jt(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 H(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 H(404,{pathname:m})}_(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){u=O.error,d=v}finally{h&&t.signal.removeEventListener("abort",h)}if(we(d)){let v=d.status;if(Kr.has(v)){let E=d.headers.get("Location");if(_(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!At.test(E))E=qe(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,E);else if(!l.isStaticRequest){let C=new URL(t.url),P=E.startsWith("//")?new URL(C.protocol+E):new URL(E),s=Ae(P.pathname,i)!=null;P.origin===C.origin&&s&&(E=P.pathname+P.search+P.hash)}if(l.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(l.isRouteRequest)throw{type:u===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(),u===O.error?{type:u,error:new Dt(v,d.statusText,R),headers:d.headers}:{type:O.data,data:R,statusCode:d.status,headers:d.headers}}if(u===O.error)return{type:u,error:d};if(Xr(d)){var b,y;return{type:O.deferred,deferredData:d,statusCode:(b=d.init)==null?void 0:b.status,headers:((y=d.init)==null?void 0:y.headers)&&new Headers(d.init.headers)}}return{type:O.data,data:d}}function Me(e,t,r,n){let a=e.createURL(zt(t)).toString(),o={signal:r};if(n&&J(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=et(n.formData):o.body=n.formData}return new Request(a,o)}function et(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Ot(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function It(e,t,r,n,a){let o={},i=null,l,u=!1,d={};return r.forEach((h,g)=>{let b=t[g].route.id;if(_(!me(h),"Cannot handle redirect results in processLoaderData"),he(h)){let y=fe(e,b),v=h.error;n&&(v=Object.values(n)[0],n=void 0),i=i||{},i[y.route.id]==null&&(i[y.route.id]=v),o[b]=void 0,u||(u=!0,l=Lt(h.error)?h.error.status:500),h.headers&&(d[b]=h.headers)}else le(h)?(a.set(b,h.deferredData),o[b]=h.deferredData.data):o[b]=h.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(l=h.statusCode),h.headers&&(d[b]=h.headers)}),n&&(i=n,o[Object.keys(n)[0]]=void 0),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:d}}function kt(e,t,r,n,a,o,i,l){let{loaderData:u,errors:d}=It(t,r,n,a,l);for(let h=0;h<o.length;h++){let{key:g,match:b,controller:y}=o[h];_(i!==void 0&&i[h]!==void 0,"Did not find corresponding fetcher result");let v=i[h];if(!(y&&y.signal.aborted))if(he(v)){let R=fe(e.matches,b==null?void 0:b.route.id);d&&d[R.route.id]||(d=M({},d,{[R.route.id]:v.error})),e.fetchers.delete(g)}else if(me(v))_(!1,"Unhandled fetcher revalidation redirect");else if(le(v))_(!1,"Unhandled fetcher deferred data");else{let R=Se(v.data);e.fetchers.set(g,R)}}return{loaderData:u,errors:d}}function Ht(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 fe(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 Be(e){let t=e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function H(e,t){let{pathname:r,routeId:n,method:a,type:o}=t===void 0?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?l="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"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",l='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?l="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&&(l='Invalid request method "'+a.toUpperCase()+'"')),new Dt(e||500,i,new Error(l),!0)}function Bt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(me(r))return{result:r,idx:t}}}function zt(e){let t=typeof e=="string"?Z(e):e;return ne(M({},t,{hash:""}))}function Gr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function le(e){return e.type===O.deferred}function he(e){return e.type===O.error}function me(e){return(e&&e.type)===O.redirect}function Xr(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 we(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function Qr(e){if(!we(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Zr(e){return e&&we(e.response)&&(e.type===O.data||e.type===O.error)}function tt(e){return zr.has(e.toLowerCase())}function J(e){return Hr.has(e.toLowerCase())}async function Kt(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],u=t[i];if(!u)continue;let d=e.find(g=>g.route.id===u.route.id),h=d!=null&&!_t(d,u)&&(o&&o[u.route.id])!==void 0;if(le(l)&&(a||h)){let g=n[i];_(g,"Expected an AbortSignal for revalidating fetcher deferred result"),await Wt(l,g,a).then(b=>{b&&(r[i]=b||r[i])})}}}async function Wt(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 rt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Te(e,t){let r=typeof t=="string"?Z(t).search:t.search;if(e[e.length-1].route.index&&rt(r||""))return e[e.length-1];let n=xt(e);return n[n.length-1]}function $t(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 nt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function qr(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function _e(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 en(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 Se(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}/**
|
|
12
|
-
* React Router DOM v6.16.0
|
|
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 tn(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 at="get",ot="application/x-www-form-urlencoded";function ze(e){return e!=null&&typeof e.tagName=="string"}function rn(e){return ze(e)&&e.tagName.toLowerCase()==="button"}function nn(e){return ze(e)&&e.tagName.toLowerCase()==="form"}function an(e){return ze(e)&&e.tagName.toLowerCase()==="input"}function on(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ln(e,t){return e.button===0&&(!t||t==="_self")&&!on(e)}function it(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 sn(e,t){let r=it(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let Ke=null;function un(){if(Ke===null)try{new FormData(document.createElement("form"),0),Ke=!1}catch{Ke=!0}return Ke}const cn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lt(e){return e!=null&&!cn.has(e)?null:e}function Vt(e,t){let r,n,a,o,i;if(nn(e)){let l=e.getAttribute("action");n=l?stripBasename(l,t):null,r=e.getAttribute("method")||at,a=lt(e.getAttribute("enctype"))||ot,o=new FormData(e)}else if(rn(e)||an(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(n=u?stripBasename(u,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||at,a=lt(e.getAttribute("formenctype"))||lt(l.getAttribute("enctype"))||ot,o=new FormData(l,e),!un()){let{name:d,type:h,value:g}=e;if(h==="image"){let b=d?d+".":"";o.append(b+"x","0"),o.append(b+"y","0")}else d&&o.append(d,g)}}else{if(ze(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=at,n=null,a=ot,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const dn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Jn=null,Gn=null;function Xn(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)||Yt(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties}).initialize()}function Qn(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)||Yt(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties}).initialize()}function Yt(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=q({},t,{errors:fn(t.errors)})),t}function fn(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 Ee=cr["startTransition"];function hn(e){let{basename:t,children:r,future:n,window:a}=e,o=Q.useRef();o.current==null&&(o.current=dr({window:a,v5Compat:!0}));let i=o.current,[l,u]=Q.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},h=Q.useCallback(g=>{d&&Ee?Ee(()=>u(g)):u(g)},[u,d]);return Q.useLayoutEffect(()=>i.listen(h),[i,h]),Q.createElement(Re.F0,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i})}function qn(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,[l,u]=React.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},h=React.useCallback(g=>{d&&Ee?Ee(()=>u(g)):u(g)},[u,d]);return React.useLayoutEffect(()=>i.listen(h),[i,h]),React.createElement(Router,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i})}function ea(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=React.useState({action:a.action,location:a.location}),{v7_startTransition:l}=n||{},u=React.useCallback(d=>{l&&Ee?Ee(()=>i(d)):i(d)},[i,l]);return React.useLayoutEffect(()=>a.listen(u),[a,u]),React.createElement(Router,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a})}const mn=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",pn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gn=Q.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:l,target:u,to:d,preventScrollReset:h}=t,g=tn(t,dn),{basename:b}=Q.useContext(Re.Us),y,v=!1;if(typeof d=="string"&&pn.test(d)&&(y=d,mn))try{let C=new URL(window.location.href),P=d.startsWith("//")?new URL(C.protocol+d):new URL(d),s=Ae(P.pathname,b);P.origin===C.origin&&s!=null?d=s+P.search+P.hash:v=!0}catch{}let R=(0,Re.oQ)(d,{relative:a}),m=vn(d,{replace:i,state:l,target:u,preventScrollReset:h,relative:a});function E(C){n&&n(C),C.defaultPrevented||m(C)}return Q.createElement("a",q({},g,{href:y||R,onClick:v||o?n:E,ref:r,target:u}))}),ta=null,ra=null,yn=null;function na(e){let{getKey:t,storageKey:r}=e;return wn({getKey:t,storageKey:r}),null}var xe;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(xe||(xe={}));var We;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(We||(We={}));function aa(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function $e(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function Jt(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function vn(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i}=t===void 0?{}:t,l=(0,Re.s0)(),u=(0,Re.TH)(),d=(0,Re.WU)(e,{relative:i});return Q.useCallback(h=>{if(ln(h,r)){h.preventDefault();let g=n!==void 0?n:(0,yt.Ep)(u)===(0,yt.Ep)(d);l(e,{replace:g,state:a,preventScrollReset:o,relative:i})}},[u,l,d,n,a,r,e,o,i])}function oa(e){let t=React.useRef(it(e)),r=React.useRef(!1),n=useLocation(),a=React.useMemo(()=>sn(n.search,r.current?null:t.current),[n.search]),o=useNavigate(),i=React.useCallback((l,u)=>{const d=it(typeof l=="function"?l(a):l);r.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function Gt(){if(typeof document=="undefined")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function ia(){let{router:e}=$e(xe.UseSubmit),{basename:t}=React.useContext(UNSAFE_NavigationContext),r=UNSAFE_useRouteId();return React.useCallback(function(n,a){a===void 0&&(a={}),Gt();let{action:o,method:i,encType:l,formData:u,body:d}=Vt(n,t);e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r})},[e,t,r])}function Xt(e,t){let{router:r}=$e(xe.UseSubmitFetcher),{basename:n}=React.useContext(UNSAFE_NavigationContext);return React.useCallback(function(a,o){o===void 0&&(o={}),Gt();let{action:i,method:l,encType:u,formData:d,body:h}=Vt(a,n);t==null&&UNSAFE_invariant(!1),r.fetch(e,t,o.action||i,{preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||l,formEncType:o.encType||u})},[r,n,e,t])}function la(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})),l=useLocation();if(e==null&&(i.search=l.search,o.route.index)){let u=new URLSearchParams(i.search);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 bn(e,t){return React.forwardRef((n,a)=>{let o=Xt(e,t);return React.createElement(yn,q({},n,{ref:a,submit:o}))})}let Rn=0;function sa(){var e;let{router:t}=$e(xe.UseFetcher),r=React.useContext(UNSAFE_RouteContext);r||UNSAFE_invariant(!1);let n=(e=r.matches[r.matches.length-1])==null?void 0:e.route.id;n==null&&UNSAFE_invariant(!1);let[a]=React.useState(()=>String(++Rn)),[o]=React.useState(()=>(n||UNSAFE_invariant(!1),bn(a,n))),[i]=React.useState(()=>h=>{t||UNSAFE_invariant(!1),n||UNSAFE_invariant(!1),t.fetch(a,n,h)}),l=Xt(a,n),u=t.getFetcher(a),d=React.useMemo(()=>q({Form:o,submit:l,load:i},u),[u,o,l,i]);return React.useEffect(()=>()=>{if(!t){console.warn("No router available to clean up from useFetcher()");return}t.deleteFetcher(a)},[t,a]),d}function ua(){return[...Jt(We.UseFetchers).fetchers.values()]}const Qt="react-router-scroll-positions";let Ve={};function wn(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=$e(xe.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=Jt(We.UseScrollRestoration),{basename:i}=React.useContext(UNSAFE_NavigationContext),l=useLocation(),u=useMatches(),d=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Sn(React.useCallback(()=>{if(d.state==="idle"){let h=(t?t(l,u):null)||l.key;Ve[h]=window.scrollY}sessionStorage.setItem(r||Qt,JSON.stringify(Ve)),window.history.scrollRestoration="auto"},[r,t,d.state,l,u])),typeof document!="undefined"&&(React.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(r||Qt);h&&(Ve=JSON.parse(h))}catch{}},[r]),React.useLayoutEffect(()=>{let h=t&&i!=="/"?(b,y)=>t(q({},b,{pathname:stripBasename(b.pathname,i)||b.pathname}),y):t,g=n==null?void 0:n.enableScrollRestoration(Ve,()=>window.scrollY,h);return()=>g&&g()},[n,i,t]),React.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[l,a,o]))}function ca(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 Sn(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 da(e){let{when:t,message:r}=e,n=unstable_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])}}}]);})();
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=module-react-router-dom.8eff32d7.js.map
|