@techdocs/cli 1.4.0-next.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/embedded-app/.config-schema.json +8 -0
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/{6051.784227d8.chunk.js → 6051.3a9f0bec.chunk.js} +1 -1
  5. package/dist/embedded-app/static/{6051.784227d8.chunk.js.map → 6051.3a9f0bec.chunk.js.map} +1 -1
  6. package/dist/embedded-app/static/{8951.8fbde266.chunk.js → 8951.4ffeac5f.chunk.js} +1 -1
  7. package/dist/embedded-app/static/{8951.8fbde266.chunk.js.map → 8951.4ffeac5f.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/{9323.f715e2ef.chunk.js → 9323.a4a386cd.chunk.js} +1 -1
  9. package/dist/embedded-app/static/{9323.f715e2ef.chunk.js.map → 9323.a4a386cd.chunk.js.map} +1 -1
  10. package/dist/embedded-app/static/main.08eb1867.js +503 -0
  11. package/dist/embedded-app/static/main.08eb1867.js.map +1 -0
  12. package/dist/embedded-app/static/module-react-router-dom.34e67991.js +30 -0
  13. package/dist/embedded-app/static/module-react-router-dom.34e67991.js.map +1 -0
  14. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js} +2 -2
  15. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js.map → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js.map} +1 -1
  16. package/dist/embedded-app/static/{runtime.f29d79fc.js → runtime.08eb1867.js} +2 -2
  17. package/dist/embedded-app/static/{runtime.f29d79fc.js.map → runtime.08eb1867.js.map} +1 -1
  18. package/dist/embedded-app/static/vendor.08eb1867.js +252 -0
  19. package/dist/embedded-app/static/vendor.08eb1867.js.map +1 -0
  20. package/dist/index.cjs.js +1 -1
  21. package/package.json +7 -7
  22. package/dist/embedded-app/static/main.f29d79fc.js +0 -503
  23. package/dist/embedded-app/static/main.f29d79fc.js.map +0 -1
  24. package/dist/embedded-app/static/module-remix-run.4d35bb97.js +0 -12
  25. package/dist/embedded-app/static/module-remix-run.4d35bb97.js.map +0 -1
  26. package/dist/embedded-app/static/vendor.f29d79fc.js +0 -270
  27. package/dist/embedded-app/static/vendor.f29d79fc.js.map +0 -1
@@ -1,12 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5924],{16060:function(xr,Mt,xt){xt.d(Mt,{Ep:function(){return $},Gn:function(){return Bt},PP:function(){return Et},RQ:function(){return se},WK:function(){return Ee},Zn:function(){return Ve},Zq:function(){return xe},aU:function(){return O},cP:function(){return B},fp:function(){return Z},i3:function(){return Ye},kG:function(){return U},lX:function(){return At},pC:function(){return Ge}});/**
2
- * @remix-run/router v1.3.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 x(){return x=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},x.apply(this,arguments)}var O;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(O||(O={}));const He="popstate";function Et(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((p,c)=>m(p,typeof p=="string"?null:p.state,c===0?"default":void 0));let s=g(r==null?a.length-1:r),i=O.Pop,h=null;function g(p){return Math.min(Math.max(p,0),a.length-1)}function u(){return a[s]}function m(p,c,R){c===void 0&&(c=null);let b=Y(a?u().pathname:"/",p,c,R);return Ne(b.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(p)),b}function v(p){return typeof p=="string"?p:$(p)}return{get index(){return s},get action(){return i},get location(){return u()},createHref:v,createURL(p){return new URL(v(p),"http://localhost")},encodeLocation(p){let c=typeof p=="string"?B(p):p;return{pathname:c.pathname||"",search:c.search||"",hash:c.hash||""}},push(p,c){i=O.Push;let R=m(p,c);s+=1,a.splice(s,a.length,R),n&&h&&h({action:i,location:R,delta:1})},replace(p,c){i=O.Replace;let R=m(p,c);a[s]=R,n&&h&&h({action:i,location:R,delta:0})},go(p){i=O.Pop;let c=g(s+p),R=a[c];s=c,h&&h({action:i,location:R,delta:p})},listen(p){return h=p,()=>{h=null}}}}function At(e){e===void 0&&(e={});function t(n,a){let{pathname:s,search:i,hash:h}=n.location;return Y("",{pathname:s,search:i,hash:h},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:$(a)}return Be(t,r,null,e)}function Er(e){e===void 0&&(e={});function t(a,s){let{pathname:i="/",search:h="",hash:g=""}=B(a.location.hash.substr(1));return Y("",{pathname:i,search:h,hash:g},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(a,s){let i=a.document.querySelector("base"),h="";if(i&&i.getAttribute("href")){let g=a.location.href,u=g.indexOf("#");h=u===-1?g:g.slice(0,u)}return h+"#"+(typeof s=="string"?s:$(s))}function n(a,s){Ne(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Be(t,r,n,e)}function U(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function Ne(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ct(){return Math.random().toString(36).substr(2,8)}function $e(e,t){return{usr:e.state,key:e.key,idx:t}}function Y(e,t,r,n){return r===void 0&&(r=null),x({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?B(t):t,{state:r,key:t&&t.key||n||Ct()})}function $(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 B(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 Be(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:s=!1}=n,i=a.history,h=O.Pop,g=null,u=m();u==null&&(u=0,i.replaceState(x({},i.state,{idx:u}),""));function m(){return(i.state||{idx:null}).idx}function v(){h=O.Pop;let b=m(),D=b==null?null:b-u;u=b,g&&g({action:h,location:R.location,delta:D})}function o(b,D){h=O.Push;let S=Y(R.location,b,D);r&&r(S,b),u=m()+1;let _=$e(S,u),E=R.createHref(S);try{i.pushState(_,"",E)}catch{a.location.assign(E)}s&&g&&g({action:h,location:R.location,delta:1})}function p(b,D){h=O.Replace;let S=Y(R.location,b,D);r&&r(S,b),u=m();let _=$e(S,u),E=R.createHref(S);i.replaceState(_,"",E),s&&g&&g({action:h,location:R.location,delta:0})}function c(b){let D=a.location.origin!=="null"?a.location.origin:a.location.href,S=typeof b=="string"?b:$(b);return U(D,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,D)}let R={get action(){return h},get location(){return e(a,i)},listen(b){if(g)throw new Error("A history only accepts one active listener");return a.addEventListener(He,v),g=b,()=>{a.removeEventListener(He,v),g=null}},createHref(b){return t(a,b)},createURL:c,encodeLocation(b){let D=c(b);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:o,replace:p,go(b){return i.go(b)}};return R}var T;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(T||(T={}));function _t(e){return e.index===!0}function Le(e,t,r){return t===void 0&&(t=[]),r===void 0&&(r=new Set),e.map((n,a)=>{let s=[...t,a],i=typeof n.id=="string"?n.id:s.join("-");return U(n.index!==!0||!n.children,"Cannot specify children on an index route"),U(!r.has(i),'Found a route id collision on id "'+i+`". Route id's must be globally unique within Data Router usages`),r.add(i),_t(n)?x({},n,{id:i}):x({},n,{id:i,children:n.children?Le(n.children,s,r):void 0})})}function Z(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?B(t):t,a=Ve(n.pathname||"/",r);if(a==null)return null;let s=We(e);Ut(s);let i=null;for(let h=0;i==null&&h<s.length;++h)i=$t(s[h],zt(a));return i}function We(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(s,i,h)=>{let g={relativePath:h===void 0?s.path||"":h,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};g.relativePath.startsWith("/")&&(U(g.relativePath.startsWith(n),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(n.length));let u=se([n,g.relativePath]),m=r.concat(g);s.children&&s.children.length>0&&(U(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),We(s.children,t,m,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Ht(u,s.index),routesMeta:m})};return e.forEach((s,i)=>{var h;if(s.path===""||!((h=s.path)!=null&&h.includes("?")))a(s,i);else for(let g of Ke(s.path))a(s,i,g)}),t}function Ke(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return a?[s,""]:[s];let i=Ke(n.join("/")),h=[];return h.push(...i.map(g=>g===""?s:[s,g].join("/"))),a&&h.push(...i),h.map(g=>e.startsWith("/")&&g===""?"/":g)}function Ut(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Nt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Ft=/^:\w+$/,Ot=3,Tt=2,jt=1,It=10,kt=-2,ze=e=>e==="*";function Ht(e,t){let r=e.split("/"),n=r.length;return r.some(ze)&&(n+=kt),t&&(n+=Tt),r.filter(a=>!ze(a)).reduce((a,s)=>a+(Ft.test(s)?Ot:s===""?jt:It),n)}function Nt(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 $t(e,t){let{routesMeta:r}=e,n={},a="/",s=[];for(let i=0;i<r.length;++i){let h=r[i],g=i===r.length-1,u=a==="/"?t:t.slice(a.length)||"/",m=Wt({path:h.relativePath,caseSensitive:h.caseSensitive,end:g},u);if(!m)return null;Object.assign(n,m.params);let v=h.route;s.push({params:n,pathname:se([a,m.pathname]),pathnameBase:Gt(se([a,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(a=se([a,m.pathnameBase]))}return s}function Bt(e,t){t===void 0&&(t={});let r=e;return r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(le(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*")),r.replace(/^:(\w+)(\??)/g,(n,a,s)=>{let i=t[a];return s==="?"?i==null?"":i:(i==null&&U(!1,'Missing ":'+a+'" param'),i)}).replace(/\/:(\w+)(\??)/g,(n,a,s)=>{let i=t[a];return s==="?"?i==null?"":"/"+i:(i==null&&U(!1,'Missing ":'+a+'" param'),"/"+i)}).replace(/\?/g,"").replace(/(\/?)\*/,(n,a,s,i)=>{const h="*";return t[h]==null?i==="/*"?"/":"":""+a+t[h]})}function Wt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Kt(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let s=a[0],i=s.replace(/(.)\/+$/,"$1"),h=a.slice(1);return{params:n.reduce((u,m,v)=>{if(m==="*"){let o=h[v]||"";i=s.slice(0,s.length-o.length).replace(/(.)\/+$/,"$1")}return u[m]=Vt(h[v]||"",m),u},{}),pathname:s,pathnameBase:i,pattern:e}}function Kt(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),le(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,h)=>(n.push(h),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function zt(e){try{return decodeURI(e)}catch(t){return le(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Vt(e,t){try{return decodeURIComponent(e)}catch(r){return le(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Ve(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 le(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ye(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?B(e):e;return{pathname:r?r.startsWith("/")?r:Yt(r,t):t,search:Jt(n),hash:Qt(a)}}function Yt(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 Me(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 xe(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ge(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=B(e):(a=x({},e),U(!a.pathname||!a.pathname.includes("?"),Me("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),Me("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),Me("#","search","hash",a)));let s=e===""||a.pathname==="",i=s?"/":a.pathname,h;if(n||i==null)h=r;else{let v=t.length-1;if(i.startsWith("..")){let o=i.split("/");for(;o[0]==="..";)o.shift(),v-=1;a.pathname=o.join("/")}h=v>=0?t[v]:"/"}let g=Ye(a,h),u=i&&i!=="/"&&i.endsWith("/"),m=(s||i===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(u||m)&&(g.pathname+="/"),g}function Ar(e){return e===""||e.pathname===""?"/":typeof e=="string"?B(e).pathname:e.pathname}const se=e=>e.join("/").replace(/\/\/+/g,"/"),Gt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Jt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Qt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Cr=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),x({},n,{headers:a}))};class Je extends Error{}class Qe{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],U(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((s,i)=>n=i),this.controller=new AbortController;let a=()=>n(new Je("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((s,i)=>{let[h,g]=i;return Object.assign(s,{[h]:this.trackPromise(h,g)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,null,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){return this.controller.signal.aborted&&n instanceof Je?(this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n)):(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a))}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(s=>{t.removeEventListener("abort",n),(s||this.done)&&a(s)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return U(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]:Zt(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Xt(e){return e instanceof Promise&&e._tracked===!0}function Zt(e){if(!Xt(e))return e;if(e._error)throw e._error;return e._data}const _r=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Qe(t,n)},Ur=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,x({},n,{headers:a}))};class Xe{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 Ee(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ze=["post","put","patch","delete"],qt=new Set(Ze),er=["get",...Ze],tr=new Set(er),rr=new Set([301,302,303,307,308]),nr=new Set([307,308]),Ae={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ar={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},qe={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},et=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",or=!tt;function Fr(e){U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=Le(e.routes),r=null,n=new Set,a=null,s=null,i=null,h=e.hydrationData!=null,g=Z(t,e.history.location,e.basename),u=null;if(g==null){let l=I(404,{pathname:e.history.location.pathname}),{matches:d,route:f}=ye(t);g=d,u={[f.id]:l}}let m=!g.some(l=>l.route.loader)||e.hydrationData!=null,v,o={historyAction:e.history.action,location:e.history.location,matches:g,initialized:m,navigation:Ae,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||u,fetchers:new Map,blockers:new Map},p=O.Pop,c=!1,R,b=!1,D=!1,S=[],_=[],E=new Map,F=0,Q=-1,ne=new Map,be=new Set,ue=new Map,ae=new Map,X=new Map,_e=!1;function cr(){return r=e.history.listen(l=>{let{action:d,location:f,delta:w}=l;if(_e){_e=!1;return}le(X.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 y=Pt({currentLocation:o.location,nextLocation:f,historyAction:d});if(y&&w!=null){_e=!0,e.history.go(w*-1),Re(y,{state:"blocked",location:f,proceed(){Re(y,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),e.history.go(w)},reset(){me(y),k({blockers:new Map(v.state.blockers)})}});return}return oe(d,f)}),o.initialized||oe(O.Pop,o.location),v}function fr(){r&&r(),n.clear(),R&&R.abort(),o.fetchers.forEach((l,d)=>Oe(d)),o.blockers.forEach((l,d)=>me(d))}function hr(l){return n.add(l),()=>n.delete(l)}function k(l){o=x({},o,l),n.forEach(d=>d(o))}function he(l,d){var f,w;let y=o.actionData!=null&&o.navigation.formMethod!=null&&z(o.navigation.formMethod)&&o.navigation.state==="loading"&&((f=l.state)==null?void 0:f._isRedirect)!==!0,M;d.actionData?Object.keys(d.actionData).length>0?M=d.actionData:M=null:y?M=o.actionData:M=null;let L=d.loaderData?ut(o.loaderData,d.loaderData,d.matches||[],d.errors):o.loaderData;for(let[P]of X)me(P);let A=c===!0||o.navigation.formMethod!=null&&z(o.navigation.formMethod)&&((w=l.state)==null?void 0:w._isRedirect)!==!0;k(x({},d,{actionData:M,loaderData:L,historyAction:p,location:l,initialized:!0,navigation:Ae,revalidation:"idle",restoreScrollPosition:St(l,d.matches||o.matches),preventScrollReset:A,blockers:new Map(o.blockers)})),b||p===O.Pop||(p===O.Push?e.history.push(l,l.state):p===O.Replace&&e.history.replace(l,l.state)),p=O.Pop,c=!1,b=!1,D=!1,S=[],_=[]}async function vt(l,d){if(typeof l=="number"){e.history.go(l);return}let{path:f,submission:w,error:y}=rt(l,d),M=o.location,L=Y(o.location,f,d&&d.state);L=x({},L,e.history.encodeLocation(L));let A=d&&d.replace!=null?d.replace:void 0,P=O.Push;A===!0?P=O.Replace:A===!1||w!=null&&z(w.formMethod)&&w.formAction===o.location.pathname+o.location.search&&(P=O.Replace);let N=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,C=Pt({currentLocation:M,nextLocation:L,historyAction:P});if(C){Re(C,{state:"blocked",location:L,proceed(){Re(C,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),vt(l,d)},reset(){me(C),k({blockers:new Map(o.blockers)})}});return}return await oe(P,L,{submission:w,pendingError:y,preventScrollReset:N,replace:d&&d.replace})}function pr(){if(Ue(),k({revalidation:"loading"}),o.navigation.state!=="submitting"){if(o.navigation.state==="idle"){oe(o.historyAction,o.location,{startUninterruptedRevalidation:!0});return}oe(p||o.historyAction,o.navigation.location,{overrideNavigation:o.navigation})}}async function oe(l,d,f){R&&R.abort(),R=null,p=l,b=(f&&f.startUninterruptedRevalidation)===!0,Pr(o.location,o.matches),c=(f&&f.preventScrollReset)===!0;let w=f&&f.overrideNavigation,y=Z(t,d,e.basename);if(!y){let j=I(404,{pathname:d.pathname}),{matches:W,route:K}=ye(t);Te(),he(d,{matches:W,loaderData:{},errors:{[K.id]:j}});return}if(dr(o.location,d)&&!(f&&f.submission&&z(f.submission.formMethod))){he(d,{matches:y});return}R=new AbortController;let M=fe(e.history,d,R.signal,f&&f.submission),L,A;if(f&&f.pendingError)A={[ee(y).route.id]:f.pendingError};else if(f&&f.submission&&z(f.submission.formMethod)){let j=await mr(M,d,f.submission,y,{replace:f.replace});if(j.shortCircuited)return;L=j.pendingActionData,A=j.pendingActionError,w=x({state:"loading",location:d},f.submission),M=new Request(M.url,{signal:M.signal})}let{shortCircuited:P,loaderData:N,errors:C}=await gr(M,d,y,w,f&&f.submission,f&&f.replace,L,A);P||(R=null,he(d,x({matches:y},L?{actionData:L}:{},{loaderData:N,errors:C})))}async function mr(l,d,f,w,y){Ue();let M=x({state:"submitting",location:d},f);k({navigation:M});let L,A=ve(w,d);if(!A.route.action)L={type:T.error,error:I(405,{method:l.method,pathname:d.pathname,routeId:A.route.id})};else if(L=await q("action",l,A,w,v.basename),l.signal.aborted)return{shortCircuited:!0};if(re(L)){let P;return y&&y.replace!=null?P=y.replace:P=L.location===o.location.pathname+o.location.search,await pe(o,L,{submission:f,replace:P}),{shortCircuited:!0}}if(te(L)){let P=ee(w,A.route.id);return(y&&y.replace)!==!0&&(p=O.Push),{pendingActionData:{},pendingActionError:{[P.route.id]:L.error}}}if(J(L))throw I(400,{type:"defer-action"});return{pendingActionData:{[A.route.id]:L.data}}}async function gr(l,d,f,w,y,M,L,A){let P=w;P||(P=x({state:"loading",location:d,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},y));let N=y||(P.formMethod&&P.formAction&&P.formData&&P.formEncType?{formMethod:P.formMethod,formAction:P.formAction,formData:P.formData,formEncType:P.formEncType}:void 0),[C,j]=at(e.history,o,f,N,d,D,S,_,L,A,ue);if(Te(H=>!(f&&f.some(V=>V.route.id===H))||C&&C.some(V=>V.route.id===H)),C.length===0&&j.length===0)return he(d,x({matches:f,loaderData:{},errors:A||null},L?{actionData:L}:{})),{shortCircuited:!0};if(!b){j.forEach(V=>{let ie=o.fetchers.get(V.key),Se={state:"loading",data:ie&&ie.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(V.key,Se)});let H=L||o.actionData;k(x({navigation:P},H?Object.keys(H).length===0?{actionData:null}:{actionData:H}:{},j.length>0?{fetchers:new Map(o.fetchers)}:{}))}Q=++F,j.forEach(H=>E.set(H.key,R));let{results:W,loaderResults:K,fetcherResults:ge}=await wt(o.matches,f,C,j,l);if(l.signal.aborted)return{shortCircuited:!0};j.forEach(H=>E.delete(H.key));let De=ct(W);if(De)return await pe(o,De,{replace:M}),{shortCircuited:!0};let{loaderData:Pe,errors:ce}=dt(o,f,C,K,A,j,ge,ae);ae.forEach((H,V)=>{H.subscribe(ie=>{(ie||H.done)&&ae.delete(V)})}),wr();let je=Dt(Q);return x({loaderData:Pe,errors:ce},je||j.length>0?{fetchers:new Map(o.fetchers)}:{})}function bt(l){return o.fetchers.get(l)||ar}function yr(l,d,f,w){if(or)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.");E.has(l)&&we(l);let y=Z(t,f,e.basename);if(!y){Fe(l,d,I(404,{pathname:f}));return}let{path:M,submission:L}=rt(f,w,!0),A=ve(y,M);if(c=(w&&w.preventScrollReset)===!0,L&&z(L.formMethod)){vr(l,d,M,A,y,L);return}ue.set(l,{routeId:d,path:M,match:A,matches:y}),br(l,d,M,A,y,L)}async function vr(l,d,f,w,y,M){if(Ue(),ue.delete(l),!w.route.action){let G=I(405,{method:M.formMethod,pathname:f,routeId:d});Fe(l,d,G);return}let L=o.fetchers.get(l),A=x({state:"submitting"},M,{data:L&&L.data," _hasFetcherDoneAnything ":!0});o.fetchers.set(l,A),k({fetchers:new Map(o.fetchers)});let P=new AbortController,N=fe(e.history,f,P.signal,M);E.set(l,P);let C=await q("action",N,w,y,v.basename);if(N.signal.aborted){E.get(l)===P&&E.delete(l);return}if(re(C)){E.delete(l),be.add(l);let G=x({state:"loading"},M,{data:void 0," _hasFetcherDoneAnything ":!0});return o.fetchers.set(l,G),k({fetchers:new Map(o.fetchers)}),pe(o,C,{isFetchActionRedirect:!0})}if(te(C)){Fe(l,d,C.error);return}if(J(C))throw I(400,{type:"defer-action"});let j=o.navigation.location||o.location,W=fe(e.history,j,P.signal),K=o.navigation.state!=="idle"?Z(t,o.navigation.location,e.basename):o.matches;U(K,"Didn't find any matches after fetcher action");let ge=++F;ne.set(l,ge);let De=x({state:"loading",data:C.data},M,{" _hasFetcherDoneAnything ":!0});o.fetchers.set(l,De);let[Pe,ce]=at(e.history,o,K,M,j,D,S,_,{[w.route.id]:C.data},void 0,ue);ce.filter(G=>G.key!==l).forEach(G=>{let ke=G.key,Lt=o.fetchers.get(ke),Mr={state:"loading",data:Lt&&Lt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(ke,Mr),E.set(ke,P)}),k({fetchers:new Map(o.fetchers)});let{results:je,loaderResults:H,fetcherResults:V}=await wt(o.matches,K,Pe,ce,W);if(P.signal.aborted)return;ne.delete(l),E.delete(l),ce.forEach(G=>E.delete(G.key));let ie=ct(je);if(ie)return pe(o,ie);let{loaderData:Se,errors:Ie}=dt(o,o.matches,Pe,H,void 0,ce,V,ae),Sr={state:"idle",data:C.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(l,Sr);let Lr=Dt(ge);o.navigation.state==="loading"&&ge>Q?(U(p,"Expected pending action"),R&&R.abort(),he(o.navigation.location,{matches:K,loaderData:Se,errors:Ie,fetchers:new Map(o.fetchers)})):(k(x({errors:Ie,loaderData:ut(o.loaderData,Se,K,Ie)},Lr?{fetchers:new Map(o.fetchers)}:{})),D=!1)}async function br(l,d,f,w,y,M){let L=o.fetchers.get(l),A=x({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},M,{data:L&&L.data," _hasFetcherDoneAnything ":!0});o.fetchers.set(l,A),k({fetchers:new Map(o.fetchers)});let P=new AbortController,N=fe(e.history,f,P.signal);E.set(l,P);let C=await q("loader",N,w,y,v.basename);if(J(C)&&(C=await mt(C,N.signal,!0)||C),E.get(l)===P&&E.delete(l),N.signal.aborted)return;if(re(C)){await pe(o,C);return}if(te(C)){let W=ee(o.matches,d);o.fetchers.delete(l),k({fetchers:new Map(o.fetchers),errors:{[W.route.id]:C.error}});return}U(!J(C),"Unhandled fetcher deferred data");let j={state:"idle",data:C.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(l,j),k({fetchers:new Map(o.fetchers)})}async function pe(l,d,f){var w;let{submission:y,replace:M,isFetchActionRedirect:L}=f===void 0?{}:f;d.revalidate&&(D=!0);let A=Y(l.location,d.location,x({_isRedirect:!0},L?{_isFetchActionRedirect:!0}:{}));if(U(A,"Expected a location on the redirect navigation"),et.test(d.location)&&tt&&typeof((w=window)==null?void 0:w.location)!="undefined"){let K=e.history.createURL(d.location).origin;if(window.location.origin!==K){M?window.location.replace(d.location):window.location.assign(d.location);return}}R=null;let P=M===!0?O.Replace:O.Push,{formMethod:N,formAction:C,formEncType:j,formData:W}=l.navigation;!y&&N&&C&&W&&j&&(y={formMethod:N,formAction:C,formEncType:j,formData:W}),nr.has(d.status)&&y&&z(y.formMethod)?await oe(P,A,{submission:x({},y,{formAction:d.location}),preventScrollReset:c}):await oe(P,A,{overrideNavigation:{state:"loading",location:A,formMethod:y?y.formMethod:void 0,formAction:y?y.formAction:void 0,formEncType:y?y.formEncType:void 0,formData:y?y.formData:void 0},preventScrollReset:c})}async function wt(l,d,f,w,y){let M=await Promise.all([...f.map(P=>q("loader",y,P,d,v.basename)),...w.map(P=>q("loader",fe(e.history,P.path,y.signal),P.match,P.matches,v.basename))]),L=M.slice(0,f.length),A=M.slice(f.length);return await Promise.all([pt(l,f,L,y.signal,!1,o.loaderData),pt(l,w.map(P=>P.match),A,y.signal,!0)]),{results:M,loaderResults:L,fetcherResults:A}}function Ue(){D=!0,S.push(...Te()),ue.forEach((l,d)=>{E.has(d)&&(_.push(d),we(d))})}function Fe(l,d,f){let w=ee(o.matches,d);Oe(l),k({errors:{[w.route.id]:f},fetchers:new Map(o.fetchers)})}function Oe(l){E.has(l)&&we(l),ue.delete(l),ne.delete(l),be.delete(l),o.fetchers.delete(l)}function we(l){let d=E.get(l);U(d,"Expected fetch controller: "+l),d.abort(),E.delete(l)}function Rt(l){for(let d of l){let w={state:"idle",data:bt(d).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};o.fetchers.set(d,w)}}function wr(){let l=[];for(let d of be){let f=o.fetchers.get(d);U(f,"Expected fetcher: "+d),f.state==="loading"&&(be.delete(d),l.push(d))}Rt(l)}function Dt(l){let d=[];for(let[f,w]of ne)if(w<l){let y=o.fetchers.get(f);U(y,"Expected fetcher: "+f),y.state==="loading"&&(we(f),ne.delete(f),d.push(f))}return Rt(d),d.length>0}function Rr(l,d){let f=o.blockers.get(l)||qe;return X.get(l)!==d&&X.set(l,d),f}function me(l){o.blockers.delete(l),X.delete(l)}function Re(l,d){let f=o.blockers.get(l)||qe;U(f.state==="unblocked"&&d.state==="blocked"||f.state==="blocked"&&d.state==="blocked"||f.state==="blocked"&&d.state==="proceeding"||f.state==="blocked"&&d.state==="unblocked"||f.state==="proceeding"&&d.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+d.state),o.blockers.set(l,d),k({blockers:new Map(o.blockers)})}function Pt(l){let{currentLocation:d,nextLocation:f,historyAction:w}=l;if(X.size===0)return;X.size>1&&le(!1,"A router only supports one blocker at a time");let y=Array.from(X.entries()),[M,L]=y[y.length-1],A=o.blockers.get(M);if(!(A&&A.state==="proceeding")&&L({currentLocation:d,nextLocation:f,historyAction:w}))return M}function Te(l){let d=[];return ae.forEach((f,w)=>{(!l||l(w))&&(f.cancel(),d.push(w),ae.delete(w))}),d}function Dr(l,d,f){if(a=l,i=d,s=f||(w=>w.key),!h&&o.navigation===Ae){h=!0;let w=St(o.location,o.matches);w!=null&&k({restoreScrollPosition:w})}return()=>{a=null,i=null,s=null}}function Pr(l,d){if(a&&s&&i){let f=d.map(y=>yt(y,o.loaderData)),w=s(l,f)||l.key;a[w]=i()}}function St(l,d){if(a&&s&&i){let f=d.map(M=>yt(M,o.loaderData)),w=s(l,f)||l.key,y=a[w];if(typeof y=="number")return y}return null}return v={get basename(){return e.basename},get state(){return o},get routes(){return t},initialize:cr,subscribe:hr,enableScrollRestoration:Dr,navigate:vt,fetch:yr,revalidate:pr,createHref:l=>e.history.createHref(l),encodeLocation:l=>e.history.encodeLocation(l),getFetcher:bt,deleteFetcher:Oe,dispose:fr,getBlocker:Rr,deleteBlocker:me,_internalFetchControllers:E,_internalActiveDeferreds:ae},v}const ir=Symbol("deferred");function Or(e,t){U(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r=Le(e),n=(t?t.basename:null)||"/";async function a(u,m){let{requestContext:v}=m===void 0?{}:m,o=new URL(u.url),p=u.method.toLowerCase(),c=Y("",$(o),null,"default"),R=Z(r,c,n);if(!Ce(p)&&p!=="head"){let D=I(405,{method:p}),{matches:S,route:_}=ye(r);return{basename:n,location:c,matches:S,loaderData:{},actionData:null,errors:{[_.id]:D},statusCode:D.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!R){let D=I(404,{pathname:c.pathname}),{matches:S,route:_}=ye(r);return{basename:n,location:c,matches:S,loaderData:{},actionData:null,errors:{[_.id]:D},statusCode:D.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let b=await i(u,c,R,v);return de(b)?b:x({location:c,basename:n},b)}async function s(u,m){let{routeId:v,requestContext:o}=m===void 0?{}:m,p=new URL(u.url),c=u.method.toLowerCase(),R=Y("",$(p),null,"default"),b=Z(r,R,n);if(!Ce(c)&&c!=="head"&&c!=="options")throw I(405,{method:c});if(!b)throw I(404,{pathname:R.pathname});let D=v?b.find(F=>F.route.id===v):ve(b,R);if(v&&!D)throw I(403,{pathname:R.pathname,routeId:v});if(!D)throw I(404,{pathname:R.pathname});let S=await i(u,R,b,o,D);if(de(S))return S;let _=S.errors?Object.values(S.errors)[0]:void 0;if(_!==void 0)throw _;if(S.actionData)return Object.values(S.actionData)[0];if(S.loaderData){var E;let F=Object.values(S.loaderData)[0];return(E=S.activeDeferreds)!=null&&E[D.route.id]&&(F[ir]=S.activeDeferreds[D.route.id]),F}}async function i(u,m,v,o,p){U(u.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(z(u.method.toLowerCase()))return await h(u,v,p||ve(v,m),o,p!=null);let c=await g(u,v,o,p);return de(c)?c:x({},c,{actionData:null,actionHeaders:{}})}catch(c){if(ur(c)){if(c.type===T.error&&!ht(c.response))throw c.response;return c.response}if(ht(c))return c;throw c}}async function h(u,m,v,o,p){let c;if(v.route.action){if(c=await q("action",u,v,m,n,!0,p,o),u.signal.aborted){let D=p?"queryRoute":"query";throw new Error(D+"() call aborted")}}else{let D=I(405,{method:u.method,pathname:new URL(u.url).pathname,routeId:v.route.id});if(p)throw D;c={type:T.error,error:D}}if(re(c))throw new Response(null,{status:c.status,headers:{Location:c.location}});if(J(c)){let D=I(400,{type:"defer-action"});if(p)throw D;c={type:T.error,error:D}}if(p){if(te(c))throw c.error;return{matches:[v],loaderData:{},actionData:{[v.route.id]:c.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(te(c)){let D=ee(m,v.route.id),S=await g(u,m,o,void 0,{[D.route.id]:c.error});return x({},S,{statusCode:Ee(c.error)?c.error.status:500,actionData:null,actionHeaders:x({},c.headers?{[v.route.id]:c.headers}:{})})}let R=new Request(u.url,{headers:u.headers,redirect:u.redirect,signal:u.signal}),b=await g(R,m,o);return x({},b,c.statusCode?{statusCode:c.statusCode}:{},{actionData:{[v.route.id]:c.data},actionHeaders:x({},c.headers?{[v.route.id]:c.headers}:{})})}async function g(u,m,v,o,p){let c=o!=null;if(c&&!(o!=null&&o.route.loader))throw I(400,{method:u.method,pathname:new URL(u.url).pathname,routeId:o==null?void 0:o.route.id});let b=(o?[o]:nt(m,Object.keys(p||{})[0])).filter(F=>F.route.loader);if(b.length===0)return{matches:m,loaderData:m.reduce((F,Q)=>Object.assign(F,{[Q.route.id]:null}),{}),errors:p||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let D=await Promise.all([...b.map(F=>q("loader",u,F,m,n,!0,c,v))]);if(u.signal.aborted){let F=c?"queryRoute":"query";throw new Error(F+"() call aborted")}let S=new Map,_=st(m,b,D,p,S),E=new Set(b.map(F=>F.route.id));return m.forEach(F=>{E.has(F.route.id)||(_.loaderData[F.route.id]=null)}),x({},_,{matches:m,activeDeferreds:S.size>0?Object.fromEntries(S.entries()):null})}return{dataRoutes:r,query:a,queryRoute:s}}function Tr(e,t,r){return x({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function lr(e){return e!=null&&"formData"in e}function rt(e,t,r){r===void 0&&(r=!1);let n=typeof e=="string"?e:$(e);if(!t||!lr(t))return{path:n};if(t.formMethod&&!Ce(t.formMethod))return{path:n,error:I(405,{method:t.formMethod})};let a;if(t.formData&&(a={formMethod:t.formMethod||"get",formAction:ft(n),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},z(a.formMethod)))return{path:n,submission:a};let s=B(n),i=lt(t.formData);return r&&s.search&&gt(s.search)&&i.append("index",""),s.search="?"+i,{path:$(s),submission:a}}function nt(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 at(e,t,r,n,a,s,i,h,g,u,m){let v=u?Object.values(u)[0]:g?Object.values(g)[0]:void 0,o=e.createURL(t.location),p=e.createURL(a),c=s||o.toString()===p.toString()||o.search!==p.search,R=u?Object.keys(u)[0]:void 0,D=nt(r,R).filter((_,E)=>{if(_.route.loader==null)return!1;if(sr(t.loaderData,t.matches[E],_)||i.some(ne=>ne===_.route.id))return!0;let F=t.matches[E],Q=_;return it(_,x({currentUrl:o,currentParams:F.params,nextUrl:p,nextParams:Q.params},n,{actionResult:v,defaultShouldRevalidate:c||ot(F,Q)}))}),S=[];return m&&m.forEach((_,E)=>{if(r.some(F=>F.route.id===_.routeId))h.includes(E)?S.push(x({key:E},_)):it(_.match,x({currentUrl:o,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:c}))&&S.push(x({key:E},_));else return}),[D,S]}function sr(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function ot(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function it(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function q(e,t,r,n,a,s,i,h){a===void 0&&(a="/"),s===void 0&&(s=!1),i===void 0&&(i=!1);let g,u,m,v=new Promise((p,c)=>m=c),o=()=>m();t.signal.addEventListener("abort",o);try{let p=r.route[e];U(p,"Could not find the "+e+' to run on the "'+r.route.id+'" route'),u=await Promise.race([p({request:t,params:r.params,context:h}),v]),U(u!==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(p){g=T.error,u=p}finally{t.signal.removeEventListener("abort",o)}if(de(u)){let p=u.status;if(rr.has(p)){let b=u.headers.get("Location");if(U(b,"Redirects returned/thrown from loaders/actions must have a Location header"),et.test(b)){if(!s){let D=new URL(t.url),S=b.startsWith("//")?new URL(D.protocol+b):new URL(b);S.origin===D.origin&&(b=S.pathname+S.search+S.hash)}}else{let D=n.slice(0,n.indexOf(r)+1),S=xe(D).map(E=>E.pathnameBase),_=Ge(b,S,new URL(t.url).pathname);if(U($(_),"Unable to resolve redirect location: "+b),a){let E=_.pathname;_.pathname=E==="/"?a:se([a,E])}b=$(_)}if(s)throw u.headers.set("Location",b),u;return{type:T.redirect,status:p,location:b,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(i)throw{type:g||T.data,response:u};let c,R=u.headers.get("Content-Type");return R&&/\bapplication\/json\b/.test(R)?c=await u.json():c=await u.text(),g===T.error?{type:g,error:new Xe(p,u.statusText,c),headers:u.headers}:{type:T.data,data:c,statusCode:u.status,headers:u.headers}}return g===T.error?{type:g,error:u}:u instanceof Qe?{type:T.deferred,deferredData:u}:{type:T.data,data:u}}function fe(e,t,r,n){let a=e.createURL(ft(t)).toString(),s={signal:r};if(n&&z(n.formMethod)){let{formMethod:i,formEncType:h,formData:g}=n;s.method=i.toUpperCase(),s.body=h==="application/x-www-form-urlencoded"?lt(g):g}return new Request(a,s)}function lt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,n instanceof File?n.name:n);return t}function st(e,t,r,n,a){let s={},i=null,h,g=!1,u={};return r.forEach((m,v)=>{let o=t[v].route.id;if(U(!re(m),"Cannot handle redirect results in processLoaderData"),te(m)){let p=ee(e,o),c=m.error;n&&(c=Object.values(n)[0],n=void 0),i=i||{},i[p.route.id]==null&&(i[p.route.id]=c),s[o]=void 0,g||(g=!0,h=Ee(m.error)?m.error.status:500),m.headers&&(u[o]=m.headers)}else J(m)?(a.set(o,m.deferredData),s[o]=m.deferredData.data):s[o]=m.data,m.statusCode!=null&&m.statusCode!==200&&!g&&(h=m.statusCode),m.headers&&(u[o]=m.headers)}),n&&(i=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:i,statusCode:h||200,loaderHeaders:u}}function dt(e,t,r,n,a,s,i,h){let{loaderData:g,errors:u}=st(t,r,n,a,h);for(let m=0;m<s.length;m++){let{key:v,match:o}=s[m];U(i!==void 0&&i[m]!==void 0,"Did not find corresponding fetcher result");let p=i[m];if(te(p)){let c=ee(e.matches,o.route.id);u&&u[c.route.id]||(u=x({},u,{[c.route.id]:p.error})),e.fetchers.delete(v)}else if(re(p))U(!1,"Unhandled fetcher revalidation redirect");else if(J(p))U(!1,"Unhandled fetcher deferred data");else{let c={state:"idle",data:p.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};e.fetchers.set(v,c)}}return{loaderData:g,errors:u}}function ut(e,t,r,n){let a=x({},t);for(let s of r){let i=s.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function ee(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function ye(e){let t=e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function I(e,t){let{pathname:r,routeId:n,method:a,type:s}=t===void 0?{}:t,i="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?h="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.":s==="defer-action"&&(h="defer() is not supported in actions")):e===403?(i="Forbidden",h='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",h='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?h="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&&(h='Invalid request method "'+a.toUpperCase()+'"')),new Xe(e||500,i,new Error(h),!0)}function ct(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(re(r))return r}}function ft(e){let t=typeof e=="string"?B(e):e;return $(x({},t,{hash:""}))}function dr(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function J(e){return e.type===T.deferred}function te(e){return e.type===T.error}function re(e){return(e&&e.type)===T.redirect}function de(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function ht(e){if(!de(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function ur(e){return e&&de(e.response)&&(e.type===T.data||T.error)}function Ce(e){return tr.has(e)}function z(e){return qt.has(e)}async function pt(e,t,r,n,a,s){for(let i=0;i<r.length;i++){let h=r[i],g=t[i],u=e.find(v=>v.route.id===g.route.id),m=u!=null&&!ot(u,g)&&(s&&s[g.route.id])!==void 0;J(h)&&(a||m)&&await mt(h,n,a).then(v=>{v&&(r[i]=v||r[i])})}}async function mt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:T.data,data:e.deferredData.unwrappedData}}catch(a){return{type:T.error,error:a}}return{type:T.data,data:e.deferredData.data}}}function gt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function yt(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 ve(e,t){let r=typeof t=="string"?B(t).search:t.search;if(e[e.length-1].route.index&&gt(r||""))return e[e.length-1];let n=xe(e);return n[n.length-1]}}}]);})();
11
-
12
- //# sourceMappingURL=module-remix-run.4d35bb97.js.map