o(l,n))uo(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(uo(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],d=1,h=null,f=3,p=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function w(e){if(g=!1,b(e),!m)if(null!==r(u))m=!0,N(k);else{var t=r(c);null!==t&&A(w,t.startTime-e)}}function k(e,n){m=!1,g&&(g=!1,y(E),E=-1),p=!0;var o=f;try{for(b(n),h=r(u);null!==h&&(!(h.expirationTime>n)||e&&!C());){var a=h.callback;if("function"==typeof a){h.callback=null,f=h.priorityLevel;var s=a(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?h.callback=s:h===r(u)&&i(u),b(n)}else i(u);h=r(u)}if(null!==h)var l=!0;else{var d=r(c);null!==d&&A(w,d.startTime-n),l=!1}return l}finally{h=null,f=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,S=!1,T=null,E=-1,P=5,L=-1;function C(){return!(t.unstable_now()-Le||125a?(e.sortIndex=o,n(c,e),null===r(u)&&e===r(c)&&(g?(y(E),E=-1):g=!0,A(w,o-a))):(e.sortIndex=s,n(u,e),m||p||(m=!0,N(k))),e},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982:(e,t,n)=>{"use strict";e.exports=n(463)},72:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>n[e]));return a.default=()=>n,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0,(()=>{"use strict";var e=i(848),t=i(540),n=i.t(t,2);var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?d(w,--_):0,v--,10===b&&(v=1,g--),b}function T(){return b=_2||C(b)>3?"":" "}function A(e,t){for(;--t&&T()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return L(e,P()+(t<6&&32==E()&&32==T()))}function D(e){for(;T();)switch(b){case e:return _;case 34:case 39:34!==e&&39!==e&&D(b);break;case 40:41===e&&D(e);break;case 92:T()}return _}function R(e,t){for(;T()&&e+b!==57&&(e+b!==84||47!==E()););return"/*"+L(t,_-1)+"*"+a(47===e?e:T())}function I(e){for(;!C(E());)T();return L(e,_)}var j="-ms-",F="-moz-",$="-webkit-",Z="comm",B="rule",V="decl",U="@keyframes";function H(e,t){for(var n="",r=p(e),i=0;i0&&f(j)-v&&m(_>32?J(j+";",r,n,v-1):J(u(j," ","")+";",r,n,v-2),h);break;case 59:j+=";";default:if(m(D=Y(j,t,n,p,g,i,l,C,M=[],z=[],v),o),123===L)if(0===g)G(j,t,D,D,M,o,v,l,z);else switch(99===y&&110===d(j,3)?100:y){case 100:case 108:case 109:case 115:G(e,D,D,r&&m(Y(e,D,D,0,0,i,l,C,i,M=[],v),z),i,z,v,l,r?M:z);break;default:G(j,D,D,D,[""],z,0,l,z)}}p=g=_=0,w=x=1,C=j="",v=s;break;case 58:v=1+f(j),_=b;default:if(w<1)if(123==L)--w;else if(125==L&&0==w++&&125==S())continue;switch(j+=a(L),L*w){case 38:x=g>0?1:(j+="\f",-1);break;case 44:l[p++]=(f(j)-1)*x,x=1;break;case 64:45===E()&&(j+=O(T())),y=E(),g=v=f(C=j+=I(P())),L++;break;case 45:45===b&&2==f(j)&&(w=0)}}return o}function Y(e,t,n,r,i,a,s,c,d,f,m){for(var g=i-1,v=0===i?a:[""],y=p(v),_=0,b=0,w=0;_0?v[x]+" "+S:u(S,/&\f/g,v[x])))&&(d[w++]=T);return k(e,t,n,0===i?B:c,d,f,m)}function K(e,t,n){return k(e,t,n,Z,a(b),h(e,2,-2),0)}function J(e,t,n,r){return k(e,t,n,V,h(e,0,r),h(e,r+1,-1),r)}var Q=function(e,t,n){for(var r=0,i=0;r=i,i=E(),38===r&&12===i&&(t[n]=1),!C(i);)T();return L(e,_)},X=function(e,t){return z(function(e,t){var n=-1,r=44;do{switch(C(r)){case 0:38===r&&12===E()&&(t[n]=1),e[n]+=Q(_-1,t,n);break;case 2:e[n]+=O(r);break;case 4:if(44===r){e[++n]=58===E()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=a(r)}}while(r=T());return e}(M(e),t))},ee=new WeakMap,te=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ee.get(n))&&!r){ee.set(e,!0);for(var i=[],o=X(t,i),a=n.props,s=0,l=0;s6)switch(d(e,t+1)){case 109:if(45!==d(e,t+4))break;case 102:return u(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+F+(108==d(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?re(u(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==d(e,t+1))break;case 6444:switch(d(e,f(e)-3-(~c(e,"!important")&&10))){case 107:return u(e,":",":"+$)+e;case 101:return u(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(45===d(e,14)?"inline-":"")+"box$3$1"+$+"$2$3$1"+j+"$2box$3")+e}break;case 5936:switch(d(e,t+11)){case 114:return $+e+j+u(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+j+u(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+j+u(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+j+e+e}return e}var ie=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case V:e.return=re(e.value,e.length);break;case U:return H([x(e,{value:u(e.value,"@","@"+$)})],r);case B:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return H([x(e,{props:[u(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return H([x(e,{props:[u(t,/:(plac\w+)/,":"+$+"input-$1")]}),x(e,{props:[u(t,/:(plac\w+)/,":-moz-$1")]}),x(e,{props:[u(t,/:(plac\w+)/,j+"input-$1")]})],r)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i=e.stylisPlugins||ie;var o,a,s={},l=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:u,styles:i,next:ve}},be=!!n.useInsertionEffect&&n.useInsertionEffect,we=be||function(e){return e()},ke=be||t.useLayoutEffect,xe={}.hasOwnProperty,Se=t.createContext("undefined"!=typeof HTMLElement?oe({key:"css"}):null);Se.Provider;var Te=function(e){return(0,t.forwardRef)((function(n,r){var i=(0,t.useContext)(Se);return e(n,i,r)}))};var Ee=t.createContext({});var Pe="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Le=function(e,t){var n={};for(var r in t)xe.call(t,r)&&(n[r]=t[r]);return n[Pe]=e,n},Ce=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ae(t,n,r),we((function(){return se(t,n,r)})),null};var Me=Te((function(e,n,r){var i=e.css;"string"==typeof i&&void 0!==n.registered[i]&&(i=n.registered[i]);var o=e[Pe],a=[i],s="";"string"==typeof e.className?s=function(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}(n.registered,a,e.className):null!=e.className&&(s=e.className+" ");var l=_e(a,void 0,t.useContext(Ee));s+=n.key+"-"+l.name;var u={};for(var c in e)xe.call(e,c)&&"css"!==c&&c!==Pe&&(u[c]=e[c]);return u.ref=r,u.className=s,t.createElement(t.Fragment,null,t.createElement(Ce,{cache:n,serialized:l,isStringTag:"string"==typeof o}),t.createElement(o,u))})),ze=(i(146),e.Fragment);function Oe(t,n,r){return xe.call(n,"css")?e.jsx(Me,Le(t,n),r):e.jsx(t,n,r)}function Ne(t,n,r){return xe.call(n,"css")?e.jsxs(Me,Le(t,n),r):e.jsxs(t,n,r)}var Ae,De=i(338),Re=e=>{throw TypeError(e)},Ie=(e,t,n)=>(((e,t,n)=>{t.has(e)||Re("Cannot "+n)})(e,t,"read from private field"),n?n.call(e):t.get(e)),je="popstate";function Fe(e={}){return qe((function(e,t){let{pathname:n,search:r,hash:i}=e.location;return Ue("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:He(t)}),null,e)}function $e(e={}){return qe((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=We(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),Ue("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:He(t))}),(function(e,t){Be("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}),e)}function Ze(e,t){if(!1===e||null==e)throw new Error(t)}function Be(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function Ve(e,t){return{usr:e.state,key:e.key,idx:t}}function Ue(e,t,n=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?We(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function He({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function We(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function qe(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s="POP",l=null,u=c();function c(){return(a.state||{idx:null}).idx}function d(){s="POP";let e=c(),t=null==e?null:e-u;u=e,l&&l({action:s,location:f.location,delta:t})}function h(e){return Ge(e)}null==u&&(u=0,a.replaceState({...a.state,idx:u},""));let f={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(je,d),l=e,()=>{i.removeEventListener(je,d),l=null}},createHref:e=>t(i,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=Ue(f.location,e,t);n&&n(r,e),u=c()+1;let d=Ve(r,u),h=f.createHref(r);try{a.pushState(d,"",h)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(h)}o&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s="REPLACE";let r=Ue(f.location,e,t);n&&n(r,e),u=c();let i=Ve(r,u),d=f.createHref(r);a.replaceState(i,"",d),o&&l&&l({action:s,location:f.location,delta:0})},go:e=>a.go(e)};return f}function Ge(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),Ze(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:He(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ye=class{constructor(e){var t,n,r;if(t=this,n=Ae,r=new Map,n.has(t)?Re("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Ie(this,Ae).has(e))return Ie(this,Ae).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ie(this,Ae).set(e,t)}};Ae=new WeakMap;var Ke=new Set(["lazy","caseSensitive","path","id","index","children"]);var Je=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Qe(e,t,n=[],r={},i=!1){return e.map(((e,o)=>{let a=[...n,String(o)],s="string"==typeof e.id?e.id:a.join("-");if(Ze(!0!==e.index||!e.children,"Cannot specify children on an index route"),Ze(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let n={...e,...t(e),id:s};return r[s]=n,n}{let n={...e,...t(e),id:s,children:void 0};return r[s]=n,e.children&&(n.children=Qe(e.children,t,a,r,i)),n}}))}function Xe(e,t,n="/"){return et(e,t,n,!1)}function et(e,t,n,r){let i=gt(("string"==typeof t?We(t):t).pathname||"/",n);if(null==i)return null;let o=nt(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;Ze(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=wt([r,l.relativePath]),c=n.concat(l);e.children&&e.children.length>0&&(Ze(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),nt(e.children,t,c,u,a)),(null!=e.path||e.index)&&t.push({path:u,score:dt(u,e.index),routesMeta:c})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of rt(e.path))o(e,t,!0,n);else o(e,t)})),t}function rt(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=rt(r.join("/")),s=[];return s.push(...a.map((e=>""===e?o:[o,e].join("/")))),i&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}var it=/^:[\w-]+$/,ot=3,at=2,st=1,lt=10,ut=-2,ct=e=>"*"===e;function dt(e,t){let n=e.split("/"),r=n.length;return n.some(ct)&&(r+=ut),t&&(r+=at),n.filter((e=>!ct(e))).reduce(((e,t)=>e+(it.test(t)?ot:""===t?st:lt)),r)}function ht(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",a=[];for(let e=0;e{if("*"===t){let e=s[r]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const i=s[r];return e[t]=n&&!i?void 0:(i||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:a,pattern:e}}function pt(e,t=!1,n=!0){Be("*"===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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"))).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function mt(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Be(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function gt(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function vt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function yt(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function _t(e){let t=yt(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function bt(e,t,n,r=!1){let i;"string"==typeof e?i=We(e):(i={...e},Ze(!i.pathname||!i.pathname.includes("?"),vt("?","pathname","search",i)),Ze(!i.pathname||!i.pathname.includes("#"),vt("#","pathname","hash",i)),Ze(!i.search||!i.search.includes("#"),vt("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:i=""}="string"==typeof e?We(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:xt(r),hash:St(i)}}(i,o),u=s&&"/"!==s&&s.endsWith("/"),c=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!u&&!c||(l.pathname+="/"),l}var wt=e=>e.join("/").replace(/\/\/+/g,"/"),kt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xt=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",St=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var Tt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Et(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var Pt=["POST","PUT","PATCH","DELETE"],Lt=new Set(Pt),Ct=["GET",...Pt],Mt=new Set(Ct),zt=new Set([301,302,303,307,308]),Ot=new Set([307,308]),Nt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},At={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Rt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,It=e=>Rt.test(e),jt=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ft="remix-router-transitions",$t=Symbol("ResetLoaderData");function Zt(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;Ze(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,i=e.hydrationRouteProperties||[],o=e.mapRouteProperties||jt,a={},s=Qe(e.routes,o,void 0,a),l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let u,c,d=e.dataStrategy||Xt,h={...e.future},f=null,p=new Set,m=null,g=null,v=null,y=null!=e.hydrationData,_=Xe(s,e.history.location,l),b=!1,w=null;if(null!=_||e.patchRoutesOnNavigation){if(_&&!e.hydrationData){de(_,s,e.history.location.pathname).active&&(_=null)}if(_)if(_.some((e=>e.route.lazy)))u=!1;else if(_.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=_.findIndex((e=>void 0!==n[e.route.id]));u=_.slice(0,e+1).every((e=>!Ht(e.route,t,n)))}else u=_.every((e=>!Ht(e.route,t,n)))}else u=!0;else{u=!1,_=[];let t=de(null,s,e.history.location.pathname);t.active&&t.matches&&(b=!0,_=t.matches)}}else{let t=wn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=bn(s);u=!0,_=n,w={[r.id]:t}}let k,x,S={historyAction:e.history.action,location:e.history.location,matches:_,initialized:u,navigation:Nt,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},T="POP",E=!1,P=!1,L=new Map,C=null,M=!1,z=!1,O=new Set,N=new Map,A=0,D=-1,R=new Map,I=new Set,j=new Map,F=new Map,$=new Set,Z=new Map,B=null;function V(e,t={}){e.matches&&(e.matches=e.matches.map((e=>{let t=a[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}))),S={...S,...e};let n=[],r=[];S.fetchers.forEach(((e,t)=>{"idle"===e.state&&($.has(t)?n.push(t):r.push(t))})),$.forEach((e=>{S.fetchers.has(e)||N.has(e)||n.push(e)})),[...p].forEach((e=>e(S,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>ee(e))),r.forEach((e=>S.fetchers.delete(e)))}function U(t,n,{flushSync:i}={}){let o,a=null!=S.actionData&&null!=S.navigation.formMethod&&On(S.navigation.formMethod)&&"loading"===S.navigation.state&&!0!==t.state?._isRedirect;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?S.actionData:null;let l=n.loaderData?vn(S.loaderData,n.loaderData,n.matches||[],n.errors):S.loaderData,u=S.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,Dt))));let c,d=!M&&ce(t,n.matches||S.matches),h=!0===E||null!=S.navigation.formMethod&&On(S.navigation.formMethod)&&!0!==t.state?._isRedirect;if(r&&(s=r,r=void 0),M||"POP"===T||("PUSH"===T?e.history.push(t,t.state):"REPLACE"===T&&e.history.replace(t,t.state)),"POP"===T){let e=L.get(S.location.pathname);e&&e.has(t.pathname)?c={currentLocation:S.location,nextLocation:t}:L.has(t.pathname)&&(c={currentLocation:t,nextLocation:S.location})}else if(P){let e=L.get(S.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),L.set(S.location.pathname,e)),c={currentLocation:S.location,nextLocation:t}}V({...n,actionData:o,loaderData:l,historyAction:T,location:t,initialized:!0,navigation:Nt,revalidation:"idle",restoreScrollPosition:d,preventScrollReset:h,blockers:u},{viewTransitionOpts:c,flushSync:!0===i}),T="POP",E=!1,P=!1,M=!1,z=!1,B?.resolve(),B=null}async function H(t,n,u){k&&k.abort(),k=null,T=t,M=!0===(u&&u.startUninterruptedRevalidation),function(e,t){if(m&&v){let n=ue(e,t);m[n]=v()}}(S.location,S.matches),E=!0===(u&&u.preventScrollReset),P=!0===(u&&u.enableViewTransition);let c=r||s,d=u&&u.overrideNavigation,h=u?.initialHydration&&S.matches&&S.matches.length>0&&!b?S.matches:Xe(c,n,l),f=!0===(u&&u.flushSync);if(h&&S.initialized&&!z&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(S.location,n)&&!(u&&u.submission&&On(u.submission.formMethod)))return void U(n,{matches:h},{flushSync:f});let p=de(h,c,n.pathname);if(p.active&&p.matches&&(h=p.matches),!h){let{error:e,notFoundMatches:t,route:r}=le(n.pathname);return void U(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:f})}k=new AbortController;let g,y=hn(e.history,n,k.signal,u&&u.submission),_=e.getContext?await e.getContext():new Ye;if(u&&u.pendingError)g=[_n(h).route.id,{type:"error",error:u.pendingError}];else if(u&&u.submission&&On(u.submission.formMethod)){let t=await async function(e,t,n,r,u,c,d,h={}){K();let f,p=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(t,n);if(V({navigation:p},{flushSync:!0===h.flushSync}),c){let n=await he(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){if(0===n.partialMatches.length){let{matches:e,route:t}=bn(s);return{matches:e,pendingActionResult:[t.id,{type:"error",error:n.error}]}}let e=_n(n.partialMatches).route.id;return{matches:n.partialMatches,pendingActionResult:[e,{type:"error",error:n.error}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=le(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:n}]}}r=n.matches}let m=An(r,t);if(m.route.action||m.route.lazy){let t=an(o,a,e,r,m,d?[]:i,u),n=await G(e,t,u,null);if(f=n[m.route.id],!f)for(let e of r)if(n[e.route.id]){f=n[e.route.id];break}if(e.signal.aborted)return{shortCircuited:!0}}else f={type:"error",error:wn(405,{method:e.method,pathname:t.pathname,routeId:m.route.id})};if(Ln(f)){let t;if(h&&null!=h.replace)t=h.replace;else{t=dn(f.response.headers.get("Location"),new URL(e.url),l)===S.location.pathname+S.location.search}return await q(e,f,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Pn(f)){let e=_n(r,m.route.id);return!0!==(h&&h.replace)&&(T="PUSH"),{matches:r,pendingActionResult:[e.route.id,f,m.route.id]}}return{matches:r,pendingActionResult:[m.route.id,f]}}(y,n,u.submission,h,_,p.active,u&&!0===u.initialHydration,{replace:u.replace,flushSync:f});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Pn(r)&&Et(r.error)&&404===r.error.status)return k=null,void U(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}h=t.matches||h,g=t.pendingActionResult,d=Rn(n,u.submission),f=!1,p.active=!1,y=hn(e.history,y.url,y.signal)}let{shortCircuited:w,matches:x,loaderData:L,errors:C}=await async function(t,n,u,c,d,h,f,p,m,g,v,y){let _=h||Rn(n,f),b=f||p||Dn(_),w=!M&&!g;if(d){if(w){let e=W(y);V({navigation:_,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await he(u,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=bn(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=_n(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=le(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}u=e.matches}let x=r||s,{dsMatches:T,revalidatingFetchers:E}=Ut(t,c,o,a,e.history,S,u,b,n,g?[]:i,!0===g,z,O,$,j,I,x,l,null!=e.patchRoutesOnNavigation,y);if(D=++A,!e.dataStrategy&&!T.some((e=>e.shouldLoad))&&!T.some((e=>e.route.middleware))&&0===E.length){let e=re();return U(n,{matches:u,loaderData:{},errors:y&&Pn(y[1])?{[y[0]]:y[1].error}:null,...yn(y),...e?{fetchers:new Map(S.fetchers)}:{}},{flushSync:v}),{shortCircuited:!0}}if(w){let e={};if(!d){e.navigation=_;let t=W(y);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=S.fetchers.get(e.key),n=In(void 0,t?t.data:void 0);S.fetchers.set(e.key,n)})),new Map(S.fetchers)}(E)),V(e,{flushSync:v})}E.forEach((e=>{te(e.key),e.controller&&N.set(e.key,e.controller)}));let P=()=>E.forEach((e=>te(e.key)));k&&k.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:C}=await Y(T,E,t,c);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",P);E.forEach((e=>N.delete(e.key)));let R=kn(L);if(R)return await q(t,R.result,!0,{replace:m}),{shortCircuited:!0};if(R=kn(C),R)return I.add(R.key),await q(t,R.result,!0,{replace:m}),{shortCircuited:!0};let{loaderData:F,errors:Z}=gn(S,u,L,y,E,C);g&&S.errors&&(Z={...S.errors,...Z});let B=re(),H=ie(D),G=B||H||E.length>0;return{matches:u,loaderData:F,errors:Z,...G?{fetchers:new Map(S.fetchers)}:{}}}(y,n,h,_,p.active,d,u&&u.submission,u&&u.fetcherSubmission,u&&u.replace,u&&!0===u.initialHydration,f,g);w||(k=null,U(n,{matches:x||h,...yn(g),loaderData:L,errors:C}))}function W(e){return e&&!Pn(e[1])?{[e[0]]:e[1].data}:S.actionData?0===Object.keys(S.actionData).length?null:S.actionData:void 0}async function q(e,r,i,{submission:o,fetcherSubmission:a,preventScrollReset:s,replace:u}={}){r.response.headers.has("X-Remix-Revalidate")&&(z=!0);let c=r.response.headers.get("Location");Ze(c,"Expected a Location header on the redirect Response"),c=dn(c,new URL(e.url),l);let d=Ue(S.location,c,{_isRedirect:!0});if(n){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(It(c)){const n=Ge(c,!0);e=n.origin!==t.location.origin||null==gt(n.pathname,l)}if(e)return void(u?t.location.replace(c):t.location.assign(c))}k=null;let h=!0===u||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:f,formAction:p,formEncType:m}=S.navigation;!o&&!a&&f&&p&&m&&(o=Dn(S.navigation));let g=o||a;if(Ot.has(r.response.status)&&g&&On(g.formMethod))await H(h,d,{submission:{...g,formAction:c},preventScrollReset:s||E,enableViewTransition:i?P:void 0});else{let e=Rn(d,o);await H(h,d,{overrideNavigation:e,fetcherSubmission:a,preventScrollReset:s||E,enableViewTransition:i?P:void 0})}}async function G(e,t,n,r){let i,o={};try{i=await sn(d,e,t,r,n,!1)}catch(e){return t.filter((e=>e.shouldLoad)).forEach((t=>{o[t.route.id]={type:"error",error:e}})),o}if(e.signal.aborted)return o;for(let[n,r]of Object.entries(i))if(En(r)){let i=r.result;o[n]={type:"redirect",response:cn(i,e,n,t,l)}}else o[n]=await un(r);return o}async function Y(e,t,n,r){let i=G(n,e,r,null),o=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await G(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:wn(404,{pathname:e.path})}})})));return{loaderResults:await i,fetcherResults:(await o).reduce(((e,t)=>Object.assign(e,t)),{})}}function K(){z=!0,j.forEach(((e,t)=>{N.has(t)&&O.add(t),te(t)}))}function J(e,t,n={}){S.fetchers.set(e,t),V({fetchers:new Map(S.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Q(e,t,n,r={}){let i=_n(S.matches,t);ee(e),V({errors:{[i.route.id]:n},fetchers:new Map(S.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function X(e){return F.set(e,(F.get(e)||0)+1),$.has(e)&&$.delete(e),S.fetchers.get(e)||At}function ee(e){let t=S.fetchers.get(e);!N.has(e)||t&&"loading"===t.state&&R.has(e)||te(e),j.delete(e),R.delete(e),I.delete(e),$.delete(e),O.delete(e),S.fetchers.delete(e)}function te(e){let t=N.get(e);t&&(t.abort(),N.delete(e))}function ne(e){for(let t of e){let e=jn(X(t).data);S.fetchers.set(t,e)}}function re(){let e=[],t=!1;for(let n of I){let r=S.fetchers.get(n);Ze(r,`Expected fetcher: ${n}`),"loading"===r.state&&(I.delete(n),e.push(n),t=!0)}return ne(e),t}function ie(e){let t=[];for(let[n,r]of R)if(r0}function oe(e){S.blockers.delete(e),Z.delete(e)}function ae(e,t){let n=S.blockers.get(e)||Dt;Ze("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(S.blockers);r.set(e,t),V({blockers:r})}function se({currentLocation:e,nextLocation:t,historyAction:n}){if(0===Z.size)return;Z.size>1&&Be(!1,"A router only supports one blocker at a time");let r=Array.from(Z.entries()),[i,o]=r[r.length-1],a=S.blockers.get(i);return a&&"proceeding"===a.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:n})?i:void 0}function le(e){let t=wn(404,{pathname:e}),n=r||s,{matches:i,route:o}=bn(n);return{notFoundMatches:i,route:o,error:t}}function ue(e,t){if(g){return g(e,t.map((e=>tt(e,S.loaderData))))||e.key}return e.key}function ce(e,t){if(m){let n=ue(e,t),r=m[n];if("number"==typeof r)return r}return null}function de(t,n,r){if(e.patchRoutesOnNavigation){if(!t){return{active:!0,matches:et(n,r,l,!0)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:et(n,r,l,!0)}}}return{active:!1,matches:null}}async function he(t,n,i,u){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let c=t;for(;;){let t=null==r,d=r||s,h=a;try{await e.patchRoutesOnNavigation({signal:i,path:n,matches:c,fetcherKey:u,patch:(e,t)=>{i.aborted||qt(e,t,d,h,o,!1)}})}catch(e){return{type:"error",error:e,partialMatches:c}}finally{t&&!i.aborted&&(s=[...s])}if(i.aborted)return{type:"aborted"};let f=Xe(d,n,l);if(f)return{type:"success",matches:f};let p=et(d,n,l,!0);if(!p||c.length===p.length&&c.every(((e,t)=>e.route.id===p[t].route.id)))return{type:"success",matches:null};c=p}}return c={get basename(){return l},get future(){return h},get state(){return S},get routes(){return s},get window(){return t},initialize:function(){if(f=e.history.listen((({action:t,location:n,delta:r})=>{if(x)return x(),void(x=void 0);Be(0===Z.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=se({currentLocation:S.location,nextLocation:n,historyAction:t});if(i&&null!=r){let t=new Promise((e=>{x=e}));return e.history.go(-1*r),void ae(i,{state:"blocked",location:n,proceed(){ae(i,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(S.blockers);e.set(i,Dt),V({blockers:e})}})}return H(t,n)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(Ft);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,L);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ft,JSON.stringify(n))}catch(e){Be(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,L);t.addEventListener("pagehide",e),C=()=>t.removeEventListener("pagehide",e)}return S.initialized||H("POP",S.location,{initialHydration:!0}),c},subscribe:function(e){return p.add(e),()=>p.delete(e)},enableScrollRestoration:function(e,t,n){if(m=e,v=t,g=n||null,!y&&S.navigation===Nt){y=!0;let e=ce(S.location,S.matches);null!=e&&V({restoreScrollPosition:e})}return()=>{m=null,v=null,g=null}},navigate:async function t(n,r){if("number"==typeof n)return void e.history.go(n);let i=Bt(S.location,S.matches,l,n,r?.fromRouteId,r?.relative),{path:o,submission:a,error:s}=Vt(!1,i,r),u=S.location,c=Ue(S.location,o,r&&r.state);c={...c,...e.history.encodeLocation(c)};let d=r&&null!=r.replace?r.replace:void 0,h="PUSH";!0===d?h="REPLACE":!1===d||null!=a&&On(a.formMethod)&&a.formAction===S.location.pathname+S.location.search&&(h="REPLACE");let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,p=!0===(r&&r.flushSync),m=se({currentLocation:u,nextLocation:c,historyAction:h});m?ae(m,{state:"blocked",location:c,proceed(){ae(m,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(S.blockers);e.set(m,Dt),V({blockers:e})}}):await H(h,c,{submission:a,pendingError:s,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:p})},fetch:async function(t,n,u,c){te(t);let d=!0===(c&&c.flushSync),h=r||s,f=Bt(S.location,S.matches,l,u,n,c?.relative),p=Xe(h,f,l),m=de(p,h,f);if(m.active&&m.matches&&(p=m.matches),!p)return void Q(t,n,wn(404,{pathname:f}),{flushSync:d});let{path:g,submission:v,error:y}=Vt(!0,f,c);if(y)return void Q(t,n,y,{flushSync:d});let _=e.getContext?await e.getContext():new Ye,b=!0===(c&&c.preventScrollReset);v&&On(v.formMethod)?await async function(t,n,u,c,d,h,f,p,m){K(),j.delete(t);let g=S.fetchers.get(t);J(t,function(e,t){let n={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};return n}(m,g),{flushSync:f});let v=new AbortController,y=hn(e.history,u,v.signal,m);if(h){let e=await he(c,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Q(t,n,e.error,{flushSync:f});if(!e.matches)return void Q(t,n,wn(404,{pathname:u}),{flushSync:f});c=e.matches}let _=An(c,u);if(!_.route.action&&!_.route.lazy){let e=wn(405,{method:m.formMethod,pathname:u,routeId:n});return void Q(t,n,e,{flushSync:f})}N.set(t,v);let b=A,w=an(o,a,y,c,_,i,d),x=await G(y,w,d,t),E=x[_.route.id];if(y.signal.aborted)return void(N.get(t)===v&&N.delete(t));if($.has(t)){if(Ln(E)||Pn(E))return void J(t,jn(void 0))}else{if(Ln(E))return N.delete(t),D>b?void J(t,jn(void 0)):(I.add(t),J(t,In(m)),q(y,E,!1,{fetcherSubmission:m,preventScrollReset:p}));if(Pn(E))return void Q(t,n,E.error)}let P=S.navigation.location||S.location,L=hn(e.history,P,v.signal),C=r||s,M="idle"!==S.navigation.state?Xe(C,S.navigation.location,l):S.matches;Ze(M,"Didn't find any matches after fetcher action");let F=++A;R.set(t,F);let Z=In(m,E.data);S.fetchers.set(t,Z);let{dsMatches:B,revalidatingFetchers:H}=Ut(L,d,o,a,e.history,S,M,m,P,i,!1,z,O,$,j,I,C,l,null!=e.patchRoutesOnNavigation,[_.route.id,E]);H.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=S.fetchers.get(t),r=In(void 0,n?n.data:void 0);S.fetchers.set(t,r),te(t),e.controller&&N.set(t,e.controller)})),V({fetchers:new Map(S.fetchers)});let W=()=>H.forEach((e=>te(e.key)));v.signal.addEventListener("abort",W);let{loaderResults:X,fetcherResults:ee}=await Y(B,H,L,d);if(v.signal.aborted)return;if(v.signal.removeEventListener("abort",W),R.delete(t),N.delete(t),H.forEach((e=>N.delete(e.key))),S.fetchers.has(t)){let e=jn(E.data);S.fetchers.set(t,e)}let ne=kn(X);if(ne)return q(L,ne.result,!1,{preventScrollReset:p});if(ne=kn(ee),ne)return I.add(ne.key),q(L,ne.result,!1,{preventScrollReset:p});let{loaderData:re,errors:oe}=gn(S,M,X,void 0,H,ee);ie(F),"loading"===S.navigation.state&&F>D?(Ze(T,"Expected pending action"),k&&k.abort(),U(S.navigation.location,{matches:M,loaderData:re,errors:oe,fetchers:new Map(S.fetchers)})):(V({errors:oe,loaderData:vn(S.loaderData,re,M,oe),fetchers:new Map(S.fetchers)}),z=!1)}(t,n,g,p,_,m.active,d,b,v):(j.set(t,{routeId:n,path:g}),await async function(t,n,r,s,l,u,c,d,h){let f=S.fetchers.get(t);J(t,In(h,f?f.data:void 0),{flushSync:c});let p=new AbortController,m=hn(e.history,r,p.signal);if(u){let e=await he(s,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Q(t,n,e.error,{flushSync:c});if(!e.matches)return void Q(t,n,wn(404,{pathname:r}),{flushSync:c});s=e.matches}let g=An(s,r);N.set(t,p);let v=A,y=an(o,a,m,s,g,i,l),_=await G(m,y,l,t),b=_[g.route.id];N.get(t)===p&&N.delete(t);if(m.signal.aborted)return;if($.has(t))return void J(t,jn(void 0));if(Ln(b))return D>v?void J(t,jn(void 0)):(I.add(t),void await q(m,b,!1,{preventScrollReset:d}));if(Pn(b))return void Q(t,n,b.error);J(t,jn(b.data))}(t,n,g,p,_,m.active,d,b,v))},revalidate:function(){B||(B=function(){let e,t,n=new Promise(((r,i)=>{e=async e=>{r(e);try{await n}catch(e){}},t=async e=>{i(e);try{await n}catch(e){}}}));return{promise:n,resolve:e,reject:t}}()),K(),V({revalidation:"loading"});let e=B.promise;return"submitting"===S.navigation.state?e:"idle"===S.navigation.state?(H(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),e):(H(T||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:!0===P}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:X,deleteFetcher:function(e){let t=(F.get(e)||0)-1;t<=0?(F.delete(e),$.add(e)):F.set(e,t),V({fetchers:new Map(S.fetchers)})},dispose:function(){f&&f(),C&&C(),p.clear(),k&&k.abort(),S.fetchers.forEach(((e,t)=>ee(t))),S.blockers.forEach(((e,t)=>oe(t)))},getBlocker:function(e,t){let n=S.blockers.get(e)||Dt;return Z.get(e)!==t&&Z.set(e,t),n},deleteBlocker:oe,patchRoutes:function(e,t,n=!1){let i=null==r;qt(e,t,r||s,a,o,n),i&&(s=[...s],V({}))},_internalFetchControllers:N,_internalSetRoutes:function(e){a={},r=Qe(e,o,void 0,a)},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},c}function Bt(e,t,n,r,i,o){let a,s;if(i){a=[];for(let e of t)if(a.push(e),e.route.id===i){s=e;break}}else a=t,s=t[t.length-1];let l=bt(r||".",_t(a),gt(e.pathname,n)||e.pathname,"path"===o);if(null==r&&(l.search=e.search,l.hash=e.hash),(null==r||""===r||"."===r)&&s){let e=Nn(l.search);if(s.route.index&&!e)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&e){let e=new URLSearchParams(l.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();l.search=n?`?${n}`:""}}return"/"!==n&&(l.pathname=function({basename:e,pathname:t}){return"/"===t?e:wt([e,t])}({basename:n,pathname:l.pathname})),He(l)}function Vt(e,t,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:t};if(n.formMethod&&!zn(n.formMethod))return{path:t,error:wn(405,{method:n.formMethod})};let r,i,o=()=>({path:t,error:wn(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),s=xn(t);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!On(a))return o();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,[t,n])=>`${e}${t}=${n}\n`),""):String(n.body);return{path:t,submission:{formMethod:a,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!On(a))return o();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:s,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return o()}}}if(Ze("function"==typeof FormData,"FormData is not available in this environment"),n.formData)r=fn(n.formData),i=n.formData;else if(n.body instanceof FormData)r=fn(n.body),i=n.body;else if(n.body instanceof URLSearchParams)r=n.body,i=pn(r);else if(null==n.body)r=new URLSearchParams,i=new FormData;else try{r=new URLSearchParams(n.body),i=pn(r)}catch(e){return o()}let l={formMethod:a,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(On(l.formMethod))return{path:t,submission:l};let u=We(t);return e&&u.search&&Nn(u.search)&&r.append("index",""),u.search=`?${r}`,{path:He(u),submission:l}}function Ut(e,t,n,r,i,o,a,s,l,u,c,d,h,f,p,m,g,v,y,_){let b,w=_?Pn(_[1])?_[1].error:_[1].data:void 0,k=i.createURL(o.location),x=i.createURL(l);if(c&&o.errors){let e=Object.keys(o.errors)[0];b=a.findIndex((t=>t.route.id===e))}else if(_&&Pn(_[1])){let e=_[0];b=a.findIndex((t=>t.route.id===e))-1}let S=_?_[1].statusCode:void 0,T=S&&S>=400,E={currentUrl:k,currentParams:o.matches[0]?.params||{},nextUrl:x,nextParams:a[0].params,...s,actionResult:w,actionStatus:S},P=a.map(((i,a)=>{let{route:s}=i,l=null;if(null!=b&&a>b?l=!1:s.lazy?l=!0:null==s.loader?l=!1:c?l=Ht(s,o.loaderData,o.errors):function(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}(o.loaderData,o.matches[a],i)&&(l=!0),null!==l)return on(n,r,e,i,u,t,l);let h=!T&&(d||k.pathname+k.search===x.pathname+x.search||k.search!==x.search||function(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[a],i)),f={...E,defaultShouldRevalidate:h},p=Wt(i,f);return on(n,r,e,i,u,t,p,f)})),L=[];return p.forEach(((e,s)=>{if(c||!a.some((t=>t.route.id===e.routeId))||f.has(s))return;let l=o.fetchers.get(s),p=l&&"idle"!==l.state&&void 0===l.data,_=Xe(g,e.path,v);if(!_){if(y&&p)return;return void L.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(m.has(s))return;let b=An(_,e.path),w=new AbortController,k=hn(i,e.path,w.signal),x=null;if(h.has(s))h.delete(s),x=an(n,r,k,_,b,u,t);else if(p)d&&(x=an(n,r,k,_,b,u,t));else{let e={...E,defaultShouldRevalidate:!T&&d};Wt(b,e)&&(x=an(n,r,k,_,b,u,t,e))}x&&L.push({key:s,routeId:e.routeId,path:e.path,matches:x,match:b,request:k,controller:w})})),{dsMatches:P,revalidatingFetchers:L}}function Ht(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=null!=t&&e.id in t,i=null!=n&&void 0!==n[e.id];return!(!r&&i)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!i)}function Wt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}function qt(e,t,n,r,i,o){let a;if(e){let t=r[e];Ze(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),a=t.children}else a=n;let s=[],l=[];if(t.forEach((e=>{let t=a.find((t=>Gt(e,t)));t?l.push({existingRoute:t,newRoute:e}):s.push(e)})),s.length>0){let t=Qe(s,i,[e||"_","patch",String(a?.length||"0")],r);a.push(...t)}if(o&&l.length>0)for(let e=0;et.children?.some((t=>Gt(e,t))))))}var Yt=new WeakMap,Kt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Ze(i,"No route found in manifest"),!i.lazy||"object"!=typeof i.lazy)return;let o=i.lazy[e];if(!o)return;let a=Yt.get(i);a||(a={},Yt.set(i,a));let s=a[e];if(s)return s;let l=(async()=>{let t=function(e){return Ke.has(e)}(e),n=void 0!==i[e]&&"hasErrorBoundary"!==e;if(t)Be(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(n)Be(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}"object"==typeof i.lazy&&(i.lazy[e]=void 0,Object.values(i.lazy).every((e=>void 0===e))&&(i.lazy=void 0))})();return a[e]=l,l},Jt=new WeakMap;async function Qt(e){let t=e.matches.filter((e=>e.shouldLoad)),n={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{n[t[r].route.id]=e})),n}async function Xt(e){return e.matches.some((e=>e.route.middleware))?en(e,(()=>Qt(e))):Qt(e)}function en(e,t){return tn(e,t,(e=>e),Sn,(function(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:"error",result:t}}));{let{matches:r}=e,i=Math.min(r.findIndex((e=>e.route.id===n))||0,r.findIndex((e=>e.unstable_shouldCallHandler()))||0),o=_n(r,r[i].route.id).route.id;return Promise.resolve({[o]:{type:"error",result:t}})}}))}async function tn(e,t,n,r,i){let{matches:o,request:a,params:s,context:l}=e,u=o.flatMap((e=>e.route.middleware?e.route.middleware.map((t=>[e.route.id,t])):[]));return await nn({request:a,params:s,context:l},u,t,n,r,i)}async function nn(e,t,n,r,i,o,a=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[a];if(!l){return await n()}let u,[c,d]=l,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{let s=await nn(e,t,n,r,i,o,a+1);return u={value:s},u.value}catch(e){return u={value:await o(e,c,u)},u.value}};try{let t=await d(e,h),n=null!=t?r(t):void 0;return i(n)?n:u?n??u.value:(u={value:await h()},u.value)}catch(e){return await o(e,c,u)}}function rn(e,t,n,r,i){let o=Kt({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),a=function(e,t,n,r,i){let o=n[e.id];if(Ze(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=Jt.get(o);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Ze("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(void 0===r)continue;let a=(i=e,Je.has(i)),s=void 0!==o[e]&&"hasErrorBoundary"!==e;a?Be(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):s?Be(!s,`Route "${o.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}var i;Object.assign(o,n),Object.assign(o,{...r(o),lazy:void 0})})();return Jt.set(o,n),n.catch((()=>{})),{lazyRoutePromise:n,lazyHandlerPromise:n}}let a,s=Object.keys(e.lazy),l=[];for(let o of s){if(i&&i.includes(o))continue;let s=Kt({key:o,route:e,manifest:n,mapRouteProperties:r});s&&(l.push(s),o===t&&(a=s))}let u=l.length>0?Promise.all(l).then((()=>{})):void 0;return u?.catch((()=>{})),a?.catch((()=>{})),{lazyRoutePromise:u,lazyHandlerPromise:a}}(r.route,On(n.method)?"action":"loader",t,e,i);return{middleware:o,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function on(e,t,n,r,i,o,a,s=null){let l=!1,u=rn(e,t,n,r,i);return{...r,_lazyPromises:u,shouldLoad:a,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:e=>(l=!0,s?Wt(r,"boolean"==typeof e?{...s,defaultShouldRevalidate:e}:s):a),resolve:e=>l||a||e&&!On(n.method)&&(r.route.lazy||r.route.loader)?async function({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:o}){let a,s,l=On(e.method),u=l?"action":"loader",c=n=>{let r,a=new Promise(((e,t)=>r=t));s=()=>r(),e.signal.addEventListener("abort",s);let l=r=>"function"!=typeof n?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):n({request:e,params:t.params,context:o},...void 0!==r?[r]:[]),c=(async()=>{try{return{type:"data",result:await(i?i((e=>l(e))):l())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,a])};try{let i=l?t.route.action:t.route.loader;if(n||r)if(i){let e,[t]=await Promise.all([c(i).catch((t=>{e=t})),n,r]);if(void 0!==e)throw e;a=t}else{await n;let i=l?t.route.action:t.route.loader;if(!i){if("action"===u){let n=new URL(e.url),r=n.pathname+n.search;throw wn(405,{method:e.method,pathname:r,routeId:t.route.id})}return{type:"data",result:void 0}}[a]=await Promise.all([c(i),r])}else{if(!i){let t=new URL(e.url);throw wn(404,{pathname:t.pathname+t.search})}a=await c(i)}}catch(e){return{type:"error",result:e}}finally{s&&e.signal.removeEventListener("abort",s)}return a}({request:n,match:r,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}function an(e,t,n,r,i,o,a,s=null){return r.map((r=>r.route.id!==i.route.id?{...r,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:rn(e,t,n,r,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:on(e,t,n,r,o,a,!0,s)))}async function sn(e,t,n,r,i,o){n.some((e=>e._lazyPromises?.middleware))&&await Promise.all(n.map((e=>e._lazyPromises?.middleware)));let a={request:t,params:n[0].params,context:i,matches:n},s=o?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=a;return en(t,(()=>e({...t,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})))},l=await e({...a,fetcherKey:r,runClientMiddleware:s});try{await Promise.all(n.flatMap((e=>[e._lazyPromises?.handler,e._lazyPromises?.route])))}catch(e){}return l}async function ln(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function un(e){let{result:t,type:n}=e;if(Mn(t)){let e;try{e=await ln(t)}catch(e){return{type:"error",error:e}}return"error"===n?{type:"error",error:new Tt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===n?Cn(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Tt(t.init?.status||500,void 0,t.data),statusCode:Et(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Et(t)?t.status:void 0}:Cn(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function cn(e,t,n,r,i){let o=e.headers.get("Location");if(Ze(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!It(o)){let a=r.slice(0,r.findIndex((e=>e.route.id===n))+1);o=Bt(new URL(t.url),a,i,o),e.headers.set("Location",o)}return e}function dn(e,t,n){if(It(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=null!=gt(i.pathname,n);if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function hn(e,t,n,r){let i=e.createURL(xn(t)).toString(),o={signal:n};if(r&&On(r.formMethod)){let{formMethod:e,formEncType:t}=r;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(r.json)):"text/plain"===t?o.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?o.body=fn(r.formData):o.body=r.formData}return new Request(i,o)}function fn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"==typeof r?r:r.name);return t}function pn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function mn(e,t,n,r=!1,i=!1){let o,a={},s=null,l=!1,u={},c=n&&Pn(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let d=n.route.id,h=t[d];if(Ze(!Ln(h),"Cannot handle redirect results in processLoaderData"),Pn(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),s=s||{},i)s[d]=t;else{let n=_n(e,d);null==s[n.route.id]&&(s[n.route.id]=t)}r||(a[d]=$t),l||(l=!0,o=Et(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else a[d]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(o=h.statusCode),h.headers&&(u[d]=h.headers)})),void 0!==c&&n&&(s={[n[0]]:c},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function gn(e,t,n,r,i,o){let{loaderData:a,errors:s}=mn(t,n,r);return i.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let a=o[n];if(Ze(a,"Did not find corresponding fetcher result"),Pn(a)){let t=_n(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:a.error}),e.fetchers.delete(n)}else if(Ln(a))Ze(!1,"Unhandled fetcher revalidation redirect");else{let t=jn(a.data);e.fetchers.set(n,t)}})),{loaderData:a,errors:s}}function vn(e,t,n,r){let i=Object.entries(t).filter((([,e])=>e!==$t)).reduce(((e,[t,n])=>(e[t]=n,e)),{});for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function yn(e){return e?Pn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _n(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function bn(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function wn(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let a="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(a="Bad Request",r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:"invalid-body"===i&&(s="Unable to encode submission body")):403===e?(a="Forbidden",s=`Route "${n}" does not match URL "${t}"`):404===e?(a="Not Found",s=`No route matches URL "${t}"`):405===e&&(a="Method Not Allowed",r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Tt(e||500,a,new Error(s),!0)}function kn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Ln(r))return{key:n,result:r}}}function xn(e){return He({..."string"==typeof e?We(e):e,hash:""})}function Sn(e){return null!=e&&"object"==typeof e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&Tn(t)))}function Tn(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}function En(e){return Mn(e.result)&&zt.has(e.result.status)}function Pn(e){return"error"===e.type}function Ln(e){return"redirect"===(e&&e.type)}function Cn(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Mn(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function zn(e){return Mt.has(e.toUpperCase())}function On(e){return Lt.has(e.toUpperCase())}function Nn(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function An(e,t){let n="string"==typeof t?We(t).search:t.search;if(e[e.length-1].route.index&&Nn(n||""))return e[e.length-1];let r=yt(e);return r[r.length-1]}function Dn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(t&&n&&r)return null!=i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i}:null!=o?{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0}:void 0!==a?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}:void 0}function Rn(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function In(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var Fn=t.createContext(null);Fn.displayName="DataRouter";var $n=t.createContext(null);$n.displayName="DataRouterState";var Zn=t.createContext(!1);var Bn=t.createContext({isTransitioning:!1});Bn.displayName="ViewTransition";var Vn=t.createContext(new Map);Vn.displayName="Fetchers";var Un=t.createContext(null);Un.displayName="Await";var Hn=t.createContext(null);Hn.displayName="Navigation";var Wn=t.createContext(null);Wn.displayName="Location";var qn=t.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var Gn=t.createContext(null);Gn.displayName="RouteError";var Yn=!0;function Kn(){return null!=t.useContext(Wn)}function Jn(){return Ze(Kn(),"useLocation() may be used only in the context of a component."),t.useContext(Wn).location}var Qn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xn(e){t.useContext(Hn).static||t.useLayoutEffect(e)}function er(){let{isDataRoute:e}=t.useContext(qn);return e?function(){let{router:e}=dr("useNavigate"),n=fr("useNavigate"),r=t.useRef(!1);Xn((()=>{r.current=!0}));let i=t.useCallback((async(t,i={})=>{Be(r.current,Qn),r.current&&("number"==typeof t?e.navigate(t):await e.navigate(t,{fromRouteId:n,...i}))}),[e,n]);return i}():function(){Ze(Kn(),"useNavigate() may be used only in the context of a component.");let e=t.useContext(Fn),{basename:n,navigator:r}=t.useContext(Hn),{matches:i}=t.useContext(qn),{pathname:o}=Jn(),a=JSON.stringify(_t(i)),s=t.useRef(!1);Xn((()=>{s.current=!0}));let l=t.useCallback(((t,i={})=>{if(Be(s.current,Qn),!s.current)return;if("number"==typeof t)return void r.go(t);let l=bt(t,JSON.parse(a),o,"path"===i.relative);null==e&&"/"!==n&&(l.pathname="/"===l.pathname?n:wt([n,l.pathname])),(i.replace?r.replace:r.push)(l,i.state,i)}),[n,r,a,o,e]);return l}()}var tr=t.createContext(null);function nr(){let{matches:e}=t.useContext(qn),n=e[e.length-1];return n?n.params:{}}function rr(e,{relative:n}={}){let{matches:r}=t.useContext(qn),{pathname:i}=Jn(),o=JSON.stringify(_t(r));return t.useMemo((()=>bt(e,JSON.parse(o),i,"path"===n)),[e,o,i,n])}function ir(e,n,r,i,o){Ze(Kn(),"useRoutes() may be used only in the context of a component.");let{navigator:a}=t.useContext(Hn),{matches:s}=t.useContext(qn),l=s[s.length-1],u=l?l.params:{},c=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;if(Yn){let e=h&&h.path||"";gr(c,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent to .`)}let f,p=Jn();if(n){let e="string"==typeof n?We(n):n;Ze("/"===d||e.pathname?.startsWith(d),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=p;let m=f.pathname||"/",g=m;if("/"!==d){let e=d.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=Xe(e,{pathname:g});Yn&&(Be(h||null!=v,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Be(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`));let y=ur(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:wt([d,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:wt([d,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,r,i,o);return n&&y?t.createElement(Wn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},y):y}function or(){let e=pr(),n=Et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},s=null;return Yn&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=t.createElement(t.Fragment,null,t.createElement("p",null,"💿 Hey developer 👋"),t.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",t.createElement("code",{style:a},"ErrorBoundary")," or"," ",t.createElement("code",{style:a},"errorElement")," prop on your route."))),t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:o},r):null,s)}var ar=t.createElement(or,null),sr=class extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return void 0!==this.state.error?t.createElement(qn.Provider,{value:this.props.routeContext},t.createElement(Gn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function lr({routeContext:e,match:n,children:r}){let i=t.useContext(Fn);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),t.createElement(qn.Provider,{value:e},r)}function ur(e,n=[],r=null,i=null,o=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==n.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let a=e,s=r?.errors;if(null!=s){let e=a.findIndex((e=>e.route.id&&void 0!==s?.[e.route.id]));Ze(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let l=!1,u=-1;if(r)for(let e=0;e=0?a.slice(0,u+1):[a[0]];break}}}return a.reduceRight(((e,o,c)=>{let d,h=!1,f=null,p=null;r&&(d=s&&o.route.id?s[o.route.id]:void 0,f=o.route.errorElement||ar,l&&(u<0&&0===c?(gr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):u===c&&(h=!0,p=o.route.hydrateFallbackElement||null)));let m=n.concat(a.slice(0,c+1)),g=()=>{let n;return n=d?f:h?p:o.route.Component?t.createElement(o.route.Component,null):o.route.element?o.route.element:e,t.createElement(lr,{match:o,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===c)?t.createElement(sr,{location:r.location,revalidation:r.revalidation,component:f,error:d,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0},unstable_onError:i}):g()}),null)}function cr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dr(e){let n=t.useContext(Fn);return Ze(n,cr(e)),n}function hr(e){let n=t.useContext($n);return Ze(n,cr(e)),n}function fr(e){let n=function(e){let n=t.useContext(qn);return Ze(n,cr(e)),n}(e),r=n.matches[n.matches.length-1];return Ze(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function pr(){let e=t.useContext(Gn),n=hr("useRouteError"),r=fr("useRouteError");return void 0!==e?e:n.errors?.[r]}var mr={};function gr(e,t,n){t||mr[e]||(mr[e]=!0,Be(!1,n))}var vr={};function yr(e,t){e||vr[t]||(vr[t]=!0,console.warn(t))}function _r(e){let n={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(Yn&&e.element&&Be(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:t.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(Yn&&e.hydrateFallbackElement&&Be(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:t.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(Yn&&e.errorElement&&Be(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:t.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var br=["HydrateFallback","hydrateFallbackElement"];var wr=class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}};function kr({router:e,flushSync:n,unstable_onError:r}){let[i,o]=t.useState(e.state),[a,s]=t.useState(),[l,u]=t.useState({isTransitioning:!1}),[c,d]=t.useState(),[h,f]=t.useState(),[p,m]=t.useState(),g=t.useRef(new Map),v=t.useCallback((e=>{o((t=>(e.errors&&r&&Object.entries(e.errors).forEach((([e,n])=>{t.errors?.[e]!==n&&r(n)})),e)))}),[r]),y=t.useCallback(((r,{deletedFetchers:i,flushSync:o,viewTransitionOpts:a})=>{r.fetchers.forEach(((e,t)=>{void 0!==e.data&&g.current.set(t,e.data)})),i.forEach((e=>g.current.delete(e))),yr(!1===o||null!=n,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let l=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(yr(null==a||l,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),a&&l){if(n&&o){n((()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:a.currentLocation,nextLocation:a.nextLocation})}));let t=e.window.document.startViewTransition((()=>{n((()=>v(r)))}));return t.finished.finally((()=>{n((()=>{d(void 0),f(void 0),s(void 0),u({isTransitioning:!1})}))})),void n((()=>f(t)))}h?(c&&c.resolve(),h.skipTransition(),m({state:r,currentLocation:a.currentLocation,nextLocation:a.nextLocation})):(s(r),u({isTransitioning:!0,flushSync:!1,currentLocation:a.currentLocation,nextLocation:a.nextLocation}))}else n&&o?n((()=>v(r))):t.startTransition((()=>v(r)))}),[e.window,n,h,c,v]);t.useLayoutEffect((()=>e.subscribe(y)),[e,y]),t.useEffect((()=>{l.isTransitioning&&!l.flushSync&&d(new wr)}),[l]),t.useEffect((()=>{if(c&&a&&e.window){let n=a,r=c.promise,i=e.window.document.startViewTransition((async()=>{t.startTransition((()=>v(n))),await r}));i.finished.finally((()=>{d(void 0),f(void 0),s(void 0),u({isTransitioning:!1})})),f(i)}}),[a,c,e.window,v]),t.useEffect((()=>{c&&a&&i.location.key===a.location.key&&c.resolve()}),[c,h,i.location,a]),t.useEffect((()=>{!l.isTransitioning&&p&&(s(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),m(void 0))}),[l.isTransitioning,p]);let _=t.useMemo((()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})})),[e]),b=e.basename||"/",w=t.useMemo((()=>({router:e,navigator:_,static:!1,basename:b,unstable_onError:r})),[e,_,b,r]);return t.createElement(t.Fragment,null,t.createElement(Fn.Provider,{value:w},t.createElement($n.Provider,{value:i},t.createElement(Vn.Provider,{value:g.current},t.createElement(Bn.Provider,{value:l},t.createElement(Tr,{basename:b,location:i.location,navigationType:i.historyAction,navigator:_},t.createElement(xr,{routes:e.routes,future:e.future,state:i,unstable_onError:r})))))),null)}var xr=t.memo((function({routes:e,future:t,state:n,unstable_onError:r}){return ir(e,void 0,n,r,t)}));function Sr(e){return function(e){let n=t.useContext(qn).outlet;return n?t.createElement(tr.Provider,{value:e},n):n}(e.context)}function Tr({basename:e="/",children:n=null,location:r,navigationType:i="POP",navigator:o,static:a=!1}){Ze(!Kn(),"You cannot render a inside another . You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=t.useMemo((()=>({basename:s,navigator:o,static:a,future:{}})),[s,o,a]);"string"==typeof r&&(r=We(r));let{pathname:u="/",search:c="",hash:d="",state:h=null,key:f="default"}=r,p=t.useMemo((()=>{let e=gt(u,s);return null==e?null:{location:{pathname:e,search:c,hash:d,state:h,key:f},navigationType:i}}),[s,u,c,d,h,f,i]);return Be(null!=p,` is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the won't render anything.`),null==p?null:t.createElement(Hn.Provider,{value:l},t.createElement(Wn.Provider,{children:n,value:p}))}t.Component;var Er="get",Pr="application/x-www-form-urlencoded";function Lr(e){return null!=e&&"string"==typeof e.tagName}function Cr(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var Mr=null;var zr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Or(e){return null==e||zr.has(e)?e:(Be(!1,`"${e}" is not a valid \`encType\` for \`