var ia=Object.defineProperty;var la=(e,t,r)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vt=(e,t,r)=>la(e,typeof t!="symbol"?t+"":t,r);function sa(e,t){for(var r=0;ra[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ui=typeof globalThis<"u"?globalthis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ut={exports:{}},z={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Or;function ca(){if(Or)return z;Or=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(w){return w===null||typeof w!="object"?null:(w=p&&w[p]||w["@@iterator"],typeof w=="function"?w:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,S={};function b(w,P,U){this.props=w,this.con w!="object"&&typeof w!="function"&&w!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,P,"setState")},b.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function R(){}R.prototype=b.prototype;function x(w,P,U){this.props=w,this.con T=x.prototype=new R;T.constructor=x,g(T,b.prototype),T.isPureReactComponent=!0;var D=Array.isArray,C=Object.prototype.hasOwnProperty,f={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function N(w,P,U){var W,Y={},J=null,re=null;if(P!=null)for(W in P.ref!==void 0&&(re=P.ref),P.key!==void 0&&(J=""+P.key),P)C.call(P,W)&&!O.hasOwnProperty(W)&&(Y[W]=P[W]);var te=arguments.length-2;if(te===1)Y.children=U;else if(1{this.resolve=t,this.reject=r})}};function Ma(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(` `);t=o.pop()||"";for(const l of o)a.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("0円");var Ht=typeof window<"u"?window:typeof globalThis<"u"?globalthis:void 0;function Jt(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return _r.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,_r.call(this,a)}function _r(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case wa:u(void 0);continue;case va:u(null);continue;case ma:u(NaN);continue;case ga:u(1/0);continue;case pa:u(-1/0);continue;case ya:u(-0);continue}if(t[i]){u(t[i]);continue}const h=r[i];if(!h||typeof h!="object"){t[i]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[p,m,v]=h;switch(p){case ba:u(t[i]=new Date(m));continue;case Pa:u(t[i]=new URL(m));continue;case Ea:u(t[i]=BigInt(m));continue;case xa:u(t[i]=new RegExp(m,v));continue;case Ca:u(t[i]=Symbol.for(m));continue;case La:const g=new Set;t[i]=g;for(let D=1;D{g.add(C)}]);u(g);continue;case Ra:const S=new Map;t[i]=S;for(let D=1;D{C[1]=f}]),l.push([h[D],f=>{C[0]=f}]),s.push(()=>{S.set(C[0],C[1])})}u(S);continue;case Sa:const b=Object.create(null);t[i]=b;for(const D of Object.keys(m).reverse()){const C=[];l.push([m[D],f=>{C[1]=f}]),l.push([Number(D.slice(1)),f=>{C[0]=f}]),s.push(()=>{b[C[0]]=C[1]})}u(b);continue;case ln:if(t[m])u(t[i]=t[m]);else{const D=new sn;a[m]=D,u(t[i]=D.promise)}continue;case on:const[,R,x]=h;let T=x&&Ht&&Ht[x]?new Ht[x](R):new Error(R);t[i]=T,u(T);continue;case Da:u(t[i]=t[m]);continue;default:if(Array.isArray(n)){const D=[],C=h.slice(1);for(let f=0;f{D[f]=N}])}s.push(()=>{for(const f of n){const O=f(h[0],...D);if(O){u(t[i]=O.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const p=[];t[i]=p;for(let m=0;m{p[m]=g}])}u(p);continue}else{const p={};t[i]=p;for(const m of Object.keys(h).reverse()){const v=[];l.push([h[m],g=>{v[1]=g}]),l.push([Number(m.slice(1)),g=>{v[0]=g}]),s.push(()=>{p[v[0]]=v[1]})}u(p);continue}}for(;s.length>0;)s.pop()();return o}async function Ta(e,t){const{plugins:r}=t??{},a=new sn,n=e.pipeThrough(Ma()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await ka.call(o,n);let s=a.promise;return l.done?a.resolve():s=Oa.call(o,n).then(a.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);a.reject(i)}),{done:s.then(()=>n.closed),value:l.value}}async function ka(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:Jt.call(this,r)}}async function Oa(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case ln:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=Jt.call(this,s);o.resolve(i);break}case on:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=Jt.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}var tt={},$r;function Fa(){if($r)return tt;$r=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.parse=l,tt.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function l(m,v){const g=new o,S=m.length;if(S<2)return g;const b=(v==null?void 0:v.decode)||h;let R=0;do{const x=m.indexOf("=",R);if(x===-1)break;const T=m.indexOf(";",R),D=T===-1?S:T;if(x>D){R=m.lastIndexOf(";",x-1)+1;continue}const C=s(m,R,x),f=i(m,x,C),O=m.slice(C,f);if(g[O]===void 0){let N=s(m,x+1,D),A=i(m,D,N);const V=b(m.slice(N,A));g[O]=V}R=D+1}while(Rg;){const S=m.charCodeAt(--v);if(S!==32&&S!==9)return v+1}return g}function u(m,v,g){const S=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const b=S(v);if(!t.test(b))throw new TypeError(`argument val is invalid: ${v}`);let R=m+"="+b;if(!g)return R;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);R+="; Max-Age="+g.maxAge}if(g.domain){if(!r.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);R+="; Domain="+g.domain}if(g.path){if(!a.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);R+="; Path="+g.path}if(g.expires){if(!p(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);R+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(R+="; HttpOnly"),g.secure&&(R+="; Secure"),g.partitioned&&(R+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return R}function h(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function p(m){return n.call(m)==="[object Date]"}return tt}Fa();/** * react-router v7.2.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var Ar="popstate";function zi(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return it("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Fe(n)}return $a(t,r,null,e)}function H(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function le(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _a(){return Math.random().toString(36).substring(2,10)}function Nr(e,t){return{usr:e.state,key:e.key,idx:t}}function it(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$e(t):t,state:r,key:t&&t.key||a||_a()}}function Fe({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function $e(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $a(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",i=null,u=h();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function h(){return(l.state||{idx:null}).idx}function p(){s="POP";let b=h(),R=b==null?null:b-u;u=b,i&&i({action:s,location:S.location,delta:R})}function m(b,R){s="PUSH";let x=it(S.location,b,R);u=h()+1;let T=Nr(x,u),D=S.createHref(x);try{l.pushState(T,"",D)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(D)}o&&i&&i({action:s,location:S.location,delta:1})}function v(b,R){s="REPLACE";let x=it(S.location,b,R);u=h();let T=Nr(x,u),D=S.createHref(x);l.replaceState(T,"",D),o&&i&&i({action:s,location:S.location,delta:0})}function g(b){let R=n.location.origin!=="null"?n.location.origin:n.location.href,x=typeof b=="string"?b:Fe(b);return x=x.replace(/ $/,"%20"),H(R,`No window.location.(origin|href) available to create URL for href: ${x}`),new URL(x,R)}let S={get action(){return s},get location(){return e(n,l)},listen(b){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Ar,p),i=b,()=>{n.removeEventListener(Ar,p),i=null}},createHref(b){return t(n,b)},createURL:g,encodeLocation(b){let R=g(b);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:v,go(b){return l.go(b)}};return S}var Aa=new Set(["lazy","caseSensitive","path","id","index","children"]);function Na(e){return e.index===!0}function Pt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(H(n.index!==!0||!n.children,"Cannot specify children on an index route"),H(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Na(n)){let i={...n,...t(n),id:s};return a[s]=i,i}else{let i={...n,...t(n),id:s,children:void 0};return a[s]=i,n.children&&(i.children=Pt(n.children,t,l,a)),i}})}function De(e,t,r="/"){return Rt(e,t,r,!1)}function Rt(e,t,r,a){let n=typeof t=="string"?$e(t):t,o=ve(n.pathname||"/",r);if(o==null)return null;let l=cn(e);Ia(l);let s=null;for(let i=0;s==null&&i{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(H(i.relativePath.startsWith(a),`Absolute route path "${i.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(a.length));let u=xe([a,i.relativePath]),h=r.concat(i);o.children&&o.children.length>0&&(H(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),cn(o.children,t,h,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Wa(u,o.index),routesMeta:h})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))n(o,l);else for(let i of dn(o.path))n(o,l,i)}),t}function dn(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let l=dn(a.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),n&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function Ia(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ya(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var ja=/^:[\w-]+$/,Ua=3,Ha=2,Ba=1,za=10,Va=-2,Ir=e=>e==="*";function Wa(e,t){let r=e.split("/"),a=r.length;return r.some(Ir)&&(a+=Va),t&&(a+=Ha),r.filter(n=>!Ir(n)).reduce((n,o)=>n+(ja.test(o)?Ua:o===""?Ba:za),a)}function Ya(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Ja(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s{if(h==="*"){let g=s[m]||"";l=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"1ドル")}const v=s[m];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function Ka(e,t=!1,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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,i)=>(a.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Ga(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return le(!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 ve(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Xa(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?$e(e):e;return{pathname:r?r.startsWith("/")?r:Qa(r,t):t,search:Za(a),hash:eo(n)}}function Qa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Bt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function fn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function rr(e){let t=fn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function nr(e,t,r,a=!1){let n;typeof e=="string"?n=$e(e):(n={...e},H(!n.pathname||!n.pathname.includes("?"),Bt("?","pathname","search",n)),H(!n.pathname||!n.pathname.includes("#"),Bt("#","pathname","hash",n)),H(!n.search||!n.search.includes("#"),Bt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let p=t.length-1;if(!a&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),p-=1;n.pathname=m.join("/")}s=p>=0?t[p]:"/"}let i=Xa(n,s),u=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||h)&&(i.pathname+="/"),i}var xe=e=>e.join("/").replace(/\/\/+/g,"/"),qa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Za=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,to=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function ro(e,t){return new to(e,typeof t=="number"?{status:t}:t)}var no=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},_e=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function He(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var hn=["POST","PUT","PATCH","DELETE"],ao=new Set(hn),oo=["GET",...hn],io=new Set(oo),lo=new Set([301,302,303,307,308]),so=new Set([307,308]),zt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ar=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),pn="remix-router-transitions",yn=Symbol("ResetLoaderData");function Vi(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";h(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.mapRouteProperties||uo,n={},o=Pt(e.routes,a,void 0,n),l,s=e.basename||"/",i=e.dataStrategy||po,u=e.patchRoutesOnNavigation,h={...e.future},p=null,m=new Set,v=null,g=null,S=null,b=e.hydrationData!=null,R=De(o,e.history.location,s),x=!1,T=null;if(R==null&&!u){let d=pe(404,{pathname:e.history.location.pathname}),{matches:y,route:E}=Gr(o);R=y,T={[E.id]:d}}R&&!e.hydrationData&&ft(R,o,e.history.location.pathname).active&&(R=null);let D;if(R)if(R.some(d=>d.route.lazy))D=!1;else if(!R.some(d=>d.route.loader))D=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null;if(y){let E=R.findIndex(L=>y[L.route.id]!==void 0);D=R.slice(0,E+1).every(L=>!Gt(L.route,d,y))}else D=R.every(E=>!Gt(E.route,d,y))}else{D=!1,R=[];let d=ft(null,o,e.history.location.pathname);d.active&&d.matches&&(x=!0,R=d.matches)}let C,f={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:zt,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||T,fetchers:new Map,blockers:new Map},O="POP",N=!1,A,V=!1,q=new Map,ue=null,de=!1,he=!1,Le=new Set,ne=new Map,ae=0,Re=-1,Me=new Map,me=new Set,w=new Map,P=new Map,U=new Set,W=new Map,Y,J=null;function re(){if(p=e.history.listen(({action:d,location:y,delta:E})=>{if(Y){Y(),Y=void 0;return}le(W.size===0||E!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let L=Dr({currentLocation:f.location,nextLocation:y,historyAction:d});if(L&&E!=null){let k=new Promise($=>{Y=$});e.history.go(E*-1),dt(L,{state:"blocked",location:y,proceed(){dt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),k.then(()=>e.history.go(E))},reset(){let $=new Map(f.blockers);$.set(L,rt),K({blockers:$})}});return}return Ae(d,y)}),r){Co(t,q);let d=()=>Po(t,q);t.addEventListener("pagehide",d),ue=()=>t.removeEventListener("pagehide",d)}return f.initialized||Ae("POP",f.location,{initialHydration:!0}),C}function te(){p&&p(),ue&&ue(),m.clear(),A&&A.abort(),f.fetchers.forEach((d,y)=>Nt(y)),f.blockers.forEach((d,y)=>Pr(y))}function Z(d){return m.add(d),()=>m.delete(d)}function K(d,y={}){f={...f,...d};let E=[],L=[];f.fetchers.forEach((k,$)=>{k.state==="idle"&&(U.has($)?E.push($):L.push($))}),U.forEach(k=>{!f.fetchers.has(k)&&!ne.has(k)&&E.push(k)}),[...m].forEach(k=>k(f,{deletedFetchers:E,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),E.forEach(k=>Nt(k)),L.forEach(k=>f.fetchers.delete(k))}function Ve(d,y,{flushSync:E}={}){var M,j;let L=f.actionData!=null&&f.navigation.formMethod!=null&&Ee(f.navigation.formMethod)&&f.navigation.state==="loading"&&((M=d.state)==null?void 0:M._isRedirect)!==!0,k;y.actionData?Object.keys(y.actionData).length>0?k=y.actionData:k=null:L?k=f.actionData:k=null;let $=y.loaderData?Jr(f.loaderData,y.loaderData,y.matches||[],y.errors):f.loaderData,I=f.blockers;I.size>0&&(I=new Map(I),I.forEach((B,Q)=>I.set(Q,rt)));let F=N===!0||f.navigation.formMethod!=null&&Ee(f.navigation.formMethod)&&((j=d.state)==null?void 0:j._isRedirect)!==!0;l&&(o=l,l=void 0),de||O==="POP"||(O==="PUSH"?e.history.push(d,d.state):O==="REPLACE"&&e.history.replace(d,d.state));let _;if(O==="POP"){let B=q.get(f.location.pathname);B&&B.has(d.pathname)?_={currentLocation:f.location,nextLocation:d}:q.has(d.pathname)&&(_={currentLocation:d,nextLocation:f.location})}else if(V){let B=q.get(f.location.pathname);B?B.add(d.pathname):(B=new Set([d.pathname]),q.set(f.location.pathname,B)),_={currentLocation:f.location,nextLocation:d}}K({...y,actionData:k,loaderData:,ドルhistoryAction:O,location:d,initialized:!0,navigation:zt,revalidation:"idle",restoreScrollPosition:Tr(d,y.matches||f.matches),preventScrollReset:F,blockers:I},{viewTransitionOpts:_,flushSync:E===!0}),O="POP",N=!1,V=!1,de=!1,he=!1,J==null||J.resolve(),J=null}async function Er(d,y){if(typeof d=="number"){e.history.go(d);return}let E=Kt(f.location,f.matches,s,d,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:L,submission:k,error:$}=jr(!1,E,y),I=f.location,F=it(f.location,L,y&&y.state);F={...F,...e.history.encodeLocation(F)};let _=y&&y.replace!=null?y.replace:void 0,M="PUSH";_===!0?M="REPLACE":_===!1||k!=null&&Ee(k.formMethod)&&k.formAction===f.location.pathname+f.location.search&&(M="REPLACE");let j=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,B=(y&&y.flushSync)===!0,Q=Dr({currentLocation:I,nextLocation:F,historyAction:M});if(Q){dt(Q,{state:"blocked",location:F,proceed(){dt(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),Er(d,y)},reset(){let se=new Map(f.blockers);se.set(Q,rt),K({blockers:se})}});return}await Ae(M,F,{submission:k,pendingError:,ドルpreventScrollReset:j,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:B})}function Yn(){J||(J=Do()),At(),K({revalidation:"loading"});let d=J.promise;return f.navigation.state==="submitting"?d:f.navigation.state==="idle"?(Ae(f.historyAction,f.location,{startUninterruptedRevalidation:!0}),d):(Ae(O||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation,enableViewTransition:V===!0}),d)}async function Ae(d,y,E){A&&A.abort(),A=null,O=d,de=(E&&E.startUninterruptedRevalidation)===!0,ra(f.location,f.matches),N=(E&&E.preventScrollReset)===!0,V=(E&&E.enableViewTransition)===!0;let L=l||o,k=E&&E.overrideNavigation,$=E!=null&&E.initialHydration&&f.matches&&f.matches.length>0&&!x?f.matches:De(L,y,s),I=(E&&E.flushSync)===!0;if($&&f.initialized&&!he&&bo(f.location,y)&&!(E&&E.submission&&Ee(E.submission.formMethod))){Ve(y,{matches:$},{flushSync:I});return}let F=ft(,ドルL,y.pathname);if(F.active&&F.matches&&($=F.matches),!$){let{error:ee,notFoundMatches:X,route:ie}=It(y.pathname);Ve(y,{matches:X,loaderData:{},errors:{[ie.id]:ee}},{flushSync:I});return}A=new AbortController;let _=Je(e.history,y,A.signal,E&&E.submission),M;if(E&&E.pendingError)M=[je($).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&Ee(E.submission.formMethod)){let ee=await Jn(_,y,E.submission,,ドルF.active,{replace:E.replace,flushSync:I});if(ee.shortCircuited)return;if(ee.pendingActionResult){let[X,ie]=ee.pendingActionResult;if(fe(ie)&&He(ie.error)&&ie.error.status===404){A=null,Ve(y,{matches:ee.matches,loaderData:{},errors:{[X]:ie.error}});return}}$=ee.matches||,ドルM=ee.pendingActionResult,k=Vt(y,E.submission),I=!1,F.active=!1,_=Je(e.history,_.url,_.signal)}let{shortCircuited:j,matches:B,loaderData:Q,errors:se}=await Kn(_,y,,ドルF.active,k,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,I,M);j||(A=null,Ve(y,{matches:B||,ドル...Kr(M),loaderData:Q,errors:se}))}async function Jn(d,y,E,L,k,$={}){At();let I=xo(y,E);if(K({navigation:I},{flushSync:$.flushSync===!0}),k){let M=await ht(L,y.pathname,d.signal);if(M.type==="aborted")return{shortCircuited:!0};if(M.type==="error"){let j=je(M.partialMatches).route.id;return{matches:M.partialMatches,pendingActionResult:[j,{type:"error",error:M.error}]}}else if(M.matches)L=M.matches;else{let{notFoundMatches:j,error:B,route:Q}=It(y.pathname);return{matches:j,pendingActionResult:[Q.id,{type:"error",error:B}]}}}let F,_=ot(L,y);if(!_.route.action&&!_.route.lazy)F={type:"error",error:pe(405,{method:d.method,pathname:y.pathname,routeId:_.route.id})};else if(F=(await Qe("action",f,d,[_],L,null))[_.route.id],d.signal.aborted)return{shortCircuited:!0};if(Ue(F)){let M;return $&&$.replace!=null?M=$.replace:M=Vr(F.response.headers.get("Location"),new URL(d.url),s)===f.location.pathname+f.location.search,await Ne(d,F,!0,{submission:E,replace:M}),{shortCircuited:!0}}if(fe(F)){let M=je(L,_.route.id);return($&&$.replace)!==!0&&(O="PUSH"),{matches:L,pendingActionResult:[M.route.id,F]}}return{matches:L,pendingActionResult:[_.route.id,F]}}async function Kn(d,y,E,L,k,,ドルI,F,_,M,j){let B=k||Vt(y,$),Q=$||I||Qr(B),se=!de&&!_;if(L){if(se){let ce=br(j);K({navigation:B,...ce!==void 0?{actionData:ce}:{}},{flushSync:M})}let G=await ht(E,y.pathname,d.signal);if(G.type==="aborted")return{shortCircuited:!0};if(G.type==="error"){let ce=je(G.partialMatches).route.id;return{matches:G.partialMatches,loaderData:{},errors:{[ce]:G.error}}}else if(G.matches)E=G.matches;else{let{error:ce,notFoundMatches:yt,route:et}=It(y.pathname);return{matches:yt,loaderData:{},errors:{[et.id]:ce}}}}let ee=l||o,[X,ie]=Hr(e.history,f,E,Q,y,_===!0,he,Le,U,w,me,ee,s,j);if(Re=++ae,X.length===0&&ie.length===0){let G=Lr();return Ve(y,{matches:E,loaderData:{},errors:j&&fe(j[1])?{[j[0]]:j[1].error}:null,...Kr(j),...G?{fetchers:new Map(f.fetchers)}:{}},{flushSync:M}),{shortCircuited:!0}}if(se){let G={};if(!L){G.navigation=B;let ce=br(j);ce!==void 0&&(G.actionData=ce)}ie.length>0&&(G.fetchers=Gn(ie)),K(G,{flushSync:M})}ie.forEach(G=>{ke(G.key),G.controller&&ne.set(G.key,G.controller)});let We=()=>ie.forEach(G=>ke(G.key));A&&A.signal.addEventListener("abort",We);let{loaderResults:qe,fetcherResults:Pe}=await Rr(f,E,X,ie,d);if(d.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",We),ie.forEach(G=>ne.delete(G.key));let Se=gt(qe);if(Se)return await Ne(d,Se.result,!0,{replace:F}),{shortCircuited:!0};if(Se=gt(Pe),Se)return me.add(Se.key),await Ne(d,Se.result,!0,{replace:F}),{shortCircuited:!0};let{loaderData:jt,errors:Ze}=Yr(f,E,qe,j,ie,Pe);_&&f.errors&&(Ze={...f.errors,...Ze});let Ie=Lr(),mt=Cr(Re),pt=Ie||mt||ie.length>0;return{matches:E,loaderData:jt,errors:Ze,...pt?{fetchers:new Map(f.fetchers)}:{}}}function br(d){if(d&&!fe(d[1]))return{[d[0]]:d[1].data};if(f.actionData)return Object.keys(f.actionData).length===0?null:f.actionData}function Gn(d){return d.forEach(y=>{let E=f.fetchers.get(y.key),L=nt(void 0,E?E.data:void 0);f.fetchers.set(y.key,L)}),new Map(f.fetchers)}async function Xn(d,y,E,L){ke(d);let k=(L&&L.flushSync)===!0,$=l||o,I=Kt(f.location,f.matches,s,E,y,L==null?void 0:L.relative),F=De(,ドルI,s),_=ft(F,,ドルI);if(_.active&&_.matches&&(F=_.matches),!F){Ce(d,y,pe(404,{pathname:I}),{flushSync:k});return}let{path:M,submission:j,error:B}=jr(!0,I,L);if(B){Ce(d,y,B,{flushSync:k});return}let Q=ot(F,M),se=(L&&L.preventScrollReset)===!0;if(j&&Ee(j.formMethod)){await Qn(d,y,M,Q,F,_.active,k,se,j);return}w.set(d,{routeId:y,path:M}),await qn(d,y,M,Q,F,_.active,k,se,j)}async function Qn(d,y,E,L,k,,ドルI,F,_){At(),w.delete(d);function M(oe){if(!oe.route.action&&!oe.route.lazy){let Ye=pe(405,{method:_.formMethod,pathname:E,routeId:y});return Ce(d,y,Ye,{flushSync:I}),!0}return!1}if(!$&&M(L))return;let j=f.fetchers.get(d);Te(d,Lo(_,j),{flushSync:I});let B=new AbortController,Q=Je(e.history,E,B.signal,_);if($){let oe=await ht(k,E,Q.signal);if(oe.type==="aborted")return;if(oe.type==="error"){Ce(d,y,oe.error,{flushSync:I});return}else if(oe.matches){if(k=oe.matches,L=ot(k,E),M(L))return}else{Ce(d,y,pe(404,{pathname:E}),{flushSync:I});return}}ne.set(d,B);let se=ae,X=(await Qe("action",f,Q,[L],k,d))[L.route.id];if(Q.signal.aborted){ne.get(d)===B&&ne.delete(d);return}if(U.has(d)){if(Ue(X)||fe(X)){Te(d,Oe(void 0));return}}else{if(Ue(X))if(ne.delete(d),Re>se){Te(d,Oe(void 0));return}else return me.add(d),Te(d,nt(_)),Ne(Q,X,!1,{fetcherSubmission:_,preventScrollReset:F});if(fe(X)){Ce(d,y,X.error);return}}let ie=f.navigation.location||f.location,We=Je(e.history,ie,B.signal),qe=l||o,Pe=f.navigation.state!=="idle"?De(qe,f.navigation.location,s):f.matches;H(Pe,"Didn't find any matches after fetcher action");let Se=++ae;Me.set(d,Se);let jt=nt(_,X.data);f.fetchers.set(d,jt);let[Ze,Ie]=Hr(e.history,f,Pe,_,ie,!1,he,Le,U,w,me,qe,s,[L.route.id,X]);Ie.filter(oe=>oe.key!==d).forEach(oe=>{let Ye=oe.key,kr=f.fetchers.get(Ye),oa=nt(void 0,kr?kr.data:void 0);f.fetchers.set(Ye,oa),ke(Ye),oe.controller&&ne.set(Ye,oe.controller)}),K({fetchers:new Map(f.fetchers)});let mt=()=>Ie.forEach(oe=>ke(oe.key));B.signal.addEventListener("abort",mt);let{loaderResults:pt,fetcherResults:G}=await Rr(f,Pe,Ze,Ie,We);if(B.signal.aborted)return;B.signal.removeEventListener("abort",mt),Me.delete(d),ne.delete(d),Ie.forEach(oe=>ne.delete(oe.key));let ce=gt(pt);if(ce)return Ne(We,ce.result,!1,{preventScrollReset:F});if(ce=gt(G),ce)return me.add(ce.key),Ne(We,ce.result,!1,{preventScrollReset:F});let{loaderData:yt,errors:et}=Yr(f,Pe,pt,void 0,Ie,G);if(f.fetchers.has(d)){let oe=Oe(X.data);f.fetchers.set(d,oe)}Cr(Se),f.navigation.state==="loading"&&Se>Re?(H(O,"Expected pending action"),A&&A.abort(),Ve(f.navigation.location,{matches:Pe,loaderData:yt,errors:et,fetchers:new Map(f.fetchers)})):(K({errors:et,loaderData:Jr(f.loaderData,yt,Pe,et),fetchers:new Map(f.fetchers)}),he=!1)}async function qn(d,y,E,L,k,,ドルI,F,_){let M=f.fetchers.get(d);Te(d,nt(_,M?M.data:void 0),{flushSync:I});let j=new AbortController,B=Je(e.history,E,j.signal);if($){let X=await ht(k,E,B.signal);if(X.type==="aborted")return;if(X.type==="error"){Ce(d,y,X.error,{flushSync:I});return}else if(X.matches)k=X.matches,L=ot(k,E);else{Ce(d,y,pe(404,{pathname:E}),{flushSync:I});return}}ne.set(d,j);let Q=ae,ee=(await Qe("loader",f,B,[L],k,d))[L.route.id];if(ne.get(d)===j&&ne.delete(d),!B.signal.aborted){if(U.has(d)){Te(d,Oe(void 0));return}if(Ue(ee))if(Re>Q){Te(d,Oe(void 0));return}else{me.add(d),await Ne(B,ee,!1,{preventScrollReset:F});return}if(fe(ee)){Ce(d,y,ee.error);return}Te(d,Oe(ee.data))}}async function Ne(d,y,E,{submission:L,fetcherSubmission:k,preventScrollReset:,ドルreplace:I}={}){y.response.headers.has("X-Remix-Revalidate")&&(he=!0);let F=y.response.headers.get("Location");H(F,"Expected a Location header on the redirect Response"),F=Vr(F,new URL(d.url),s);let _=it(f.location,F,{_isRedirect:!0});if(r){let ee=!1;if(y.response.headers.has("X-Remix-Reload-Document"))ee=!0;else if(ar.test(F)){const X=e.history.createURL(F);ee=X.origin!==t.location.origin||ve(X.pathname,s)==null}if(ee){I?t.location.replace(F):t.location.assign(F);return}}A=null;let M=I===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:j,formAction:B,formEncType:Q}=f.navigation;!L&&!k&&j&&B&&Q&&(L=Qr(f.navigation));let se=L||k;if(so.has(y.response.status)&&se&&Ee(se.formMethod))await Ae(M,_,{submission:{...se,formAction:F},preventScrollReset:$||N,enableViewTransition:E?V:void 0});else{let ee=Vt(_,L);await Ae(M,_,{overrideNavigation:ee,fetcherSubmission:k,preventScrollReset:$||N,enableViewTransition:E?V:void 0})}}async function Qe(d,y,E,L,k,$){let I,F={};try{I=await yo(i,d,y,E,L,k,,ドルn,a)}catch(_){return L.forEach(M=>{F[M.route.id]={type:"error",error:_}}),F}for(let[_,M]of Object.entries(I))if(Ro(M)){let j=M.result;F[_]={type:"redirect",response:wo(j,E,_,k,s)}}else F[_]=await go(M);return F}async function Rr(d,y,E,L,k){let $=Qe("loader",d,k,E,y,null),I=Promise.all(L.map(async M=>{if(M.matches&&M.match&&M.controller){let B=(await Qe("loader",d,Je(e.history,M.path,M.controller.signal),[M.match],M.matches,M.key))[M.match.route.id];return{[M.key]:B}}else return Promise.resolve({[M.key]:{type:"error",error:pe(404,{pathname:M.path})}})})),F=await ,ドル_=(await I).reduce((M,j)=>Object.assign(M,j),{});return{loaderResults:F,fetcherResults:_}}function At(){he=!0,w.forEach((d,y)=>{ne.has(y)&&Le.add(y),ke(y)})}function Te(d,y,E={}){f.fetchers.set(d,y),K({fetchers:new Map(f.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Ce(d,y,E,L={}){let k=je(f.matches,y);Nt(d),K({errors:{[k.route.id]:E},fetchers:new Map(f.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function Sr(d){return P.set(d,(P.get(d)||0)+1),U.has(d)&&U.delete(d),f.fetchers.get(d)||mn}function Nt(d){let y=f.fetchers.get(d);ne.has(d)&&!(y&&y.state==="loading"&&Me.has(d))&&ke(d),w.delete(d),Me.delete(d),me.delete(d),U.delete(d),Le.delete(d),f.fetchers.delete(d)}function Zn(d){let y=(P.get(d)||0)-1;y<=0?(p.delete(d),u.add(d)):p.set(d,y),k({fetchers:new Map(f.fetchers)})}function ke(d){let y=ne.get(d);y&&(y.abort(),ne.delete(d))}function xr(d){for(let y of d){let E=Sr(y),L=Oe(E.data);f.fetchers.set(y,L)}}function Lr(){let d=[],y=!1;for(let E of me){let L=f.fetchers.get(E);H(L,`Expected fetcher: ${E}`),L.state==="loading"&&(me.delete(E),d.push(E),y=!0)}return xr(d),y}function Cr(d){let y=[];for(let[E,L]of Me)if(L0}function ea(d,y){let E=f.blockers.get(d)||rt;return W.get(d)!==y&&W.set(d,y),E}function Pr(d){f.blockers.delete(d),W.delete(d)}function dt(d,y){let E=f.blockers.get(d)||rt;H(E.state==="unblocked"&&y.state==="blocked"||E.state==="blocked"&&y.state==="blocked"||E.state==="blocked"&&y.state==="proceeding"||E.state==="blocked"&&y.state==="unblocked"||E.state==="proceeding"&&y.state==="unblocked",`Invalid blocker state transition: ${E.state} -> ${y.state}`);let L=new Map(f.blockers);L.set(d,y),K({blockers:L})}function Dr({currentLocation:d,nextLocation:y,historyAction:E}){if(W.size===0)return;W.size>1&&le(!1,"A router only supports one blocker at a time");let L=Array.from(W.entries()),[k,$]=L[L.length-1],I=f.blockers.get(k);if(!(I&&I.state==="proceeding")&&$({currentLocation:d,nextLocation:y,historyAction:E}))return k}function It(d){let y=pe(404,{pathname:d}),E=l||o,{matches:L,route:k}=Gr(E);return{notFoundMatches:L,route:k,error:y}}function ta(d,y,E){if(v=d,S=y,g=E||null,!b&&f.navigation===zt){b=!0;let L=Tr(f.location,f.matches);L!=null&&K({restoreScrollPosition:L})}return()=>{v=null,S=null,g=null}}function Mr(d,y){return g&&g(d,y.map(L=>un(L,f.loaderData)))||d.key}function ra(d,y){if(v&&S){let E=Mr(d,y);v[E]=S()}}function Tr(d,y){if(v){let E=Mr(d,y),L=v[E];if(typeof L=="number")return L}return null}function ft(d,y,E){if(u)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:Rt(y,E,s,!0)}}else return{active:!0,matches:Rt(y,E,s,!0)||[]};return{active:!1,matches:null}}async function ht(d,y,E){if(!u)return{type:"success",matches:d};let L=d;for(;;){let k=l==null,$=l||o,I=n;try{await u({signal:E,path:y,matches:L,patch:(M,j)=>{E.aborted||zr(M,j,,ドルI,a)}})}catch(M){return{type:"error",error:M,partialMatches:L}}finally{k&&!E.aborted&&(o=[...o])}if(E.aborted)return{type:"aborted"};let F=De(,ドルy,s);if(F)return{type:"success",matches:F};let _=Rt(,ドルy,s,!0);if(!_||L.length===_.length&&L.every((M,j)=>M.route.id===_[j].route.id))return{type:"success",matches:null};L=_}}function na(d){n={},l=Pt(d,a,void 0,n)}function aa(d,y){let E=l==null;zr(d,y,l||o,n,a),E&&(o=[...o],K({}))}return C={get basename(){return s},get future(){return h},get state(){return f},get routes(){return o},get window(){return t},initialize:re,subscribe:Z,enableScrollRestoration:ta,navigate:Er,fetch:Xn,revalidate:Yn,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Sr,deleteFetcher:Zn,dispose:te,getBlocker:ea,deleteBlocker:Pr,patchRoutes:aa,_internalFetchControllers:ne,_internalSetRoutes:na},C}function co(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Kt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let u of t)if(l.push(u),u.route.id===n){s=u;break}}else l=t,s=t[t.length-1];let i=nr(a||".",rr(l),ve(e.pathname,r)||e.pathname,o==="path");if(a==null&&(i.search=e.search,i.hash=e.hash),(a==null||a===""||a===".")&&s){let u=ir(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let h=new URLSearchParams(i.search),p=h.getAll("index");h.delete("index"),p.filter(v=>v).forEach(v=>h.append("index",v));let m=h.toString();i.search=m?`?${m}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:xe([r,i.pathname])),Fe(i)}function jr(e,t,r){if(!r||!co(r))return{path:t};if(r.formMethod&&!So(r.formMethod))return{path:t,error:pe(405,{method:r.formMethod})};let a=()=>({path:t,error:pe(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=gn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ee(o))return a();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[v,g])=>`${m}${v}=${g} `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!Ee(o))return a();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return a()}}}H(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=Xt(r.formData),i=r.formData;else if(r.body instanceof FormData)s=Xt(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=Wr(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=Wr(s)}catch{return a()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Ee(u.formMethod))return{path:t,submission:u};let h=$e(t);return e&&h.search&&ir(h.search)&&s.append("index",""),h.search=`?${s}`,{path:Fe(h),submission:u}}function Ur(e,t,r=!1){let a=e.findIndex(n=>n.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function Hr(e,t,r,a,n,o,l,s,i,u,h,p,m,v){let g=v?fe(v[1])?v[1].error:v[1].data:void 0,S=e.createURL(t.location),b=e.createURL(n),R=r;o&&t.errors?R=Ur(r,Object.keys(t.errors)[0],!0):v&&fe(v[1])&&(R=Ur(r,v[0]));let x=v?v[1].statusCode:void 0,T=x&&x>=400,D=R.filter((f,O)=>{let{route:N}=f;if(N.lazy)return!0;if(N.loader==null)return!1;if(o)return Gt(N,t.loaderData,t.errors);if(fo(t.loaderData,t.matches[O],f))return!0;let A=t.matches[O],V=f;return Br(f,{currentUrl:S,currentParams:A.params,nextUrl:b,nextParams:V.params,...a,actionResult:g,actionStatus:x,defaultShouldRevalidate:T?!1:l||S.pathname+S.search===b.pathname+b.search||S.search!==b.search||ho(A,V)})}),C=[];return u.forEach((f,O)=>{if(o||!r.some(ue=>ue.route.id===f.routeId)||i.has(O))return;let N=De(p,f.path,m);if(!N){C.push({key:O,routeId:f.routeId,path:f.path,matches:null,match:null,controller:null});return}let A=t.fetchers.get(O),V=ot(N,f.path),q=!1;h.has(O)?q=!1:s.has(O)?(s.delete(O),q=!0):A&&A.state!=="idle"&&A.data===void 0?q=l:q=Br(V,{currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params,...a,actionResult:g,actionStatus:x,defaultShouldRevalidate:T?!1:l}),q&&C.push({key:O,routeId:f.routeId,path:f.path,matches:N,match:V,controller:new AbortController})}),[D,C]}function Gt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&t[e.id]!==void 0,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function fo(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function ho(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Br(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function zr(e,t,r,a,n){let o;if(e){let i=a[e];H(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>vn(i,u))),s=Pt(l,n,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...s)}function vn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>{var n;return(n=t.children)==null?void 0:n.some(o=>vn(r,o))}):!1}async function mo(e,t,r){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let n=r[e.id];H(n,"No route found in manifest");let o={};for(let l in a){let i=n[l]!==void 0&&l!=="hasErrorBoundary";le(!i,`Route "${n.id}" has a static property "${l}" defined but its lazy function is also returning a value for this property. The lazy route property "${l}" will be ignored.`),!i&&!Aa.has(l)&&(o[l]=a[l])}Object.assign(n,o),Object.assign(n,{...t(n),lazy:void 0})}async function po({matches:e}){let t=e.filter(a=>a.shouldLoad);return(await Promise.all(t.map(a=>a.resolve()))).reduce((a,n,o)=>Object.assign(a,{[t[o].route.id]:n}),{})}async function yo(e,t,r,a,n,o,l,s,i,u){let h=o.map(v=>v.route.lazy?mo(v.route,i,s):void 0),p=o.map((v,g)=>{let S=h[g],b=n.some(x=>x.route.id===v.route.id);return{...v,shouldLoad:b,resolve:async x=>(x&&a.method==="GET"&&(v.route.lazy||v.route.loader)&&(b=!0),b?vo(t,a,v,S,x,u):Promise.resolve({type:"data",result:void 0}))}}),m=await e({matches:p,request:a,params:o[0].params,fetcherKey:l,context:u});try{await Promise.all(h)}catch{}return m}async function vo(e,t,r,a,n,o){let l,s,i=u=>{let h,p=new Promise((g,S)=>h=S);s=()=>h(),t.signal.addEventListener("abort",s);let m=g=>typeof u!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):u({request:t,params:r.params,context:o},...g!==void 0?[g]:[]),v=(async()=>{try{return{type:"data",result:await(n?n(S=>m(S)):m())}}catch(g){return{type:"error",result:g}}})();return Promise.race([v,p])};try{let u=r.route[e];if(a)if(u){let h,[p]=await Promise.all([i(u).catch(m=>{h=m}),a]);if(h!==void 0)throw h;l=p}else if(await a,u=r.route[e],u)l=await i(u);else if(e==="action"){let h=new URL(t.url),p=h.pathname+h.search;throw pe(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:"data",result:void 0};else if(u)l=await i(u);else{let h=new URL(t.url),p=h.pathname+h.search;throw pe(404,{pathname:p})}}catch(u){return{type:"error",result:u}}finally{s&&t.signal.removeEventListener("abort",s)}return l}async function go(e){var a,n,o,l,s,i;let{result:t,type:r}=e;if(or(t)){let u;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(h){return{type:"error",error:h}}return r==="error"?{type:"error",error:new _e(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?Xr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(n=t.init)!=null&&n.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new _e(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:He(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:He(t)?t.status:void 0}:Xr(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function wo(e,t,r,a,n){let o=e.headers.get("Location");if(H(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ar.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Kt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function Vr(e,t,r){if(ar.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ve(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Je(e,t,r,a){let n=e.createURL(gn(t)).toString(),o={signal:r};if(a&&Ee(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=Xt(a.formData):o.body=a.formData}return new Request(n,o)}function Xt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Wr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Eo(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},h=r&&fe(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let m=p.route.id,v=t[m];if(H(!Ue(v),"Cannot handle redirect results in processLoaderData"),fe(v)){let g=v.error;if(h!==void 0&&(g=h,h=void 0),l=l||{},n)l[m]=g;else{let S=je(e,m);l[S.route.id]==null&&(l[S.route.id]=g)}a||(o[m]=yn),i||(i=!0,s=He(v.error)?v.error.status:500),v.headers&&(u[m]=v.headers)}else o[m]=v.data,v.statusCode&&v.statusCode!==200&&!i&&(s=v.statusCode),v.headers&&(u[m]=v.headers)}),h!==void 0&&r&&(l={[r[0]]:h},o[r[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function Yr(e,t,r,a,n,o){let{loaderData:l,errors:s}=Eo(t,r,a);return n.forEach(i=>{let{key:u,match:h,controller:p}=i,m=o[u];if(H(m,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(fe(m)){let v=je(e.matches,h==null?void 0:h.route.id);s&&s[v.route.id]||(s={...s,[v.route.id]:m.error}),e.fetchers.delete(u)}else if(Ue(m))H(!1,"Unhandled fetcher revalidation redirect");else{let v=Oe(m.data);e.fetchers.set(u,v)}}),{loaderData:l,errors:s}}function Jr(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==yn).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function Kr(e){return e?fe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function je(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Gr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function pe(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(s=`Invalid request method "${a.toUpperCase()}"`)),new _e(e||500,l,new Error(s),!0)}function gt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ue(n))return{key:a,result:n}}}function gn(e){let t=typeof e=="string"?$e(e):e;return Fe({...t,hash:""})}function bo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ro(e){return or(e.result)&&lo.has(e.result.status)}function fe(e){return e.type==="error"}function Ue(e){return(e&&e.type)==="redirect"}function Xr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function or(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function So(e){return io.has(e.toUpperCase())}function Ee(e){return ao.has(e.toUpperCase())}function ir(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ot(e,t){let r=typeof t=="string"?$e(t).search:t.search;if(e[e.length-1].route.index&&ir(r||""))return e[e.length-1];let a=fn(e);return a[a.length-1]}function Qr(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Vt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function xo(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function nt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Lo(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Oe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Co(e,t){try{let r=e.sessionStorage.getItem(pn);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function Po(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(pn,JSON.stringify(r))}catch(a){le(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Do(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Be=c.createContext(null);Be.displayName="DataRouter";var Ge=c.createContext(null);Ge.displayName="DataRouterState";var lr=c.createContext({isTransitioning:!1});lr.displayName="ViewTransition";var sr=c.createContext(new Map);sr.displayName="Fetchers";var Mo=c.createContext(null);Mo.displayName="Await";var ge=c.createContext(null);ge.displayName="Navigation";var Tt=c.createContext(null);Tt.displayName="Location";var we=c.createContext({outlet:null,matches:[],isDataRoute:!1});we.displayName="Route";var ur=c.createContext(null);ur.displayName="RouteError";function To(e,{relative:t}={}){H(lt(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:a}=c.useContext(ge),{hash:n,pathname:o,search:l}=st(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:xe([r,o])),a.createHref({pathname:s,search:l,hash:n})}function lt(){return c.useContext(Tt)!=null}function be(){return H(lt(),"useLocation() may be used only in the context of a component."),c.useContext(Tt).location}var wn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function En(e){c.useContext(ge).static||c.useLayoutEffect(e)}function bn(){let{isDataRoute:e}=c.useContext(we);return e?Bo():ko()}function ko(){H(lt(),"useNavigate() may be used only in the context of a component.");let e=c.useContext(Be),{basename:t,navigator:r}=c.useContext(ge),{matches:a}=c.useContext(we),{pathname:n}=be(),o=JSON.stringify(rr(a)),l=c.useRef(!1);return En(()=>{l.current=!0}),c.useCallback((i,u={})=>{if(le(l.current,wn),!l.current)return;if(typeof i=="number"){r.go(i);return}let h=nr(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:xe([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,n,e])}var Rn=c.createContext(null);function Wi(){return c.useContext(Rn)}function Oo(e){let t=c.useContext(we).outlet;return t&&c.createElement(Rn.Provider,{value:e},t)}function Yi(){let{matches:e}=c.useContext(we),t=e[e.length-1];return t?t.params:{}}function st(e,{relative:t}={}){let{matches:r}=c.useContext(we),{pathname:a}=be(),n=JSON.stringify(rr(r));return c.useMemo(()=>nr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Fo(e,t,r,a){H(lt(),"useRoutes() may be used only in the context of a component.");let{navigator:n,static:o}=c.useContext(ge),{matches:l}=c.useContext(we),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",p=s&&s.route;{let x=p&&p.path||"";Cn(u,!p||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (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. Please change the parent to .`)}let m=be(),v;v=m;let g=v.pathname||"/",S=g;if(h!=="/"){let x=h.replace(/^\//,"").split("/");S="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=!o&&r&&r.matches&&r.matches.length>0?r.matches:De(e,{pathname:S});return le(p||b!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),le(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),Io(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},i,x.params),pathname:xe([h,n.encodeLocation?n.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?h:xe([h,n.encodeLocation?n.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),l,r,a)}function _o(){let e=Ln(),t=He(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:o},"ErrorBoundary")," or"," ",c.createElement("code",{style:o},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:n},r):null,l)}var $o=c.createElement(_o,null),Ao=class extends c.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||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?c.createElement(we.Provider,{value:this.props.routeContext},c.createElement(ur.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function No({routeContext:e,match:t,children:r}){let a=c.useContext(Be);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(we.Provider,{value:e},r)}function Io(e,t=[],r=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,o=r==null?void 0:r.errors;if(o!=null){let i=n.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);H(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((i,u,h)=>{let p,m=!1,v=null,g=null;r&&(p=o&&u.route.id?o[u.route.id]:void 0,v=u.route.errorElement||$o,l&&(s<0&&h===0?(cn("route-fallback",!1,"no `HydrateFallback` element provided to render during initial hydration"),m=!0,g=null):s===h&&(m=!0,g=u.route.hydrateFallbackElement||null)));let S=t.concat(n.slice(0,h+1)),b=()=>{let R;return p?R=v:m?R=g:u.route.Component?R=c.createElement(u.route.Component,null):u.route.element?R=u.route.element:R=i,c.createElement(No,{match:u,routeContext:{outlet:i,matches:S,isDataRoute:r!=null},children:R})};return r&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?c.createElement(Ao,{location:r.location,revalidation:r.revalidation,component:v,error:p,children:b(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):b()},null)}function cr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sn(e){let t=c.useContext(Be);return H(t,cr(e)),t}function ze(e){let t=c.useContext(Ge);return H(t,cr(e)),t}function jo(e){let t=c.useContext(we);return H(t,cr(e)),t}function ut(e){let t=jo(e),r=t.matches[t.matches.length-1];return H(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Uo(){return ut("useRouteId")}function Ho(){return ze("useNavigation").navigation}function Ji(){let e=Sn("useRevalidator"),t=ze("useRevalidator");return c.useMemo(()=>({async revalidate(){await e.router.revalidate()},state:t.revalidation}),[e.router,t.revalidation])}function xn(){let{matches:e,loaderData:t}=ze("useMatches");return c.useMemo(()=>e.map(r=>un(r,t)),[e,t])}function Ki(){let e=ze("useLoaderData"),t=ut("useLoaderData");return e.loaderData[t]}function Gi(e){return ze("useRouteLoaderData").loaderData[e]}function Xi(){let e=ze("useActionData"),t=ut("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Ln(){var a;let e=c.useContext(ur),t=ze("useRouteError"),r=ut("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Bo(){let{router:e}=Sn("useNavigate"),t=ut("useNavigate"),r=c.useRef(!1);return En(()=>{r.current=!0}),c.useCallback(async(n,o={})=>{le(r.current,wn),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var qr={};function Cn(e,t,r){!t&&!qr[e]&&(qr[e]=!0,le(!1,r))}var Zr={};function en(e,t){!e&&!Zr[t]&&(Zr[t]=!0,console.warn(t))}function Qi(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&le(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:c.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&le(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:c.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&le(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:c.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var zo=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function qi({router:e,flushSync:t}){let[r,a]=c.useState(e.state),[n,o]=c.useState(),[l,s]=c.useState({isTransitioning:!1}),[i,u]=c.useState(),[h,p]=c.useState(),[m,v]=c.useState(),g=c.useRef(new Map),S=c.useCallback((T,{deletedFetchers:D,flushSync:C,viewTransitionOpts:f})=>{T.fetchers.forEach((N,A)=>{N.data!==void 0&&g.current.set(A,N.data)}),D.forEach(N=>g.current.delete(N)),en(C===!1||t!=null,'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 O=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(en(f==null||O,"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."),!f||!O){t&&C?t(()=>a(T)):c.startTransition(()=>a(T));return}if(t&&C){t(()=>{h&&(i&&i.resolve(),h.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:f.currentLocation,nextLocation:f.nextLocation})});let N=e.window.document.startViewTransition(()=>{t(()=>a(T))});N.finished.finally(()=>{t(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>p(N));return}h?(i&&i.resolve(),h.skipTransition(),v({state:T,currentLocation:f.currentLocation,nextLocation:f.nextLocation})):(o(T),s({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}))},[e.window,t,h,i]);c.useLayoutEffect(()=>e.subscribe(S),[e,S]),c.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new zo)},[l]),c.useEffect(()=>{if(i&&n&&e.window){let T=n,D=i.promise,C=e.window.document.startViewTransition(async()=>{c.startTransition(()=>a(T)),await D});C.finished.finally(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})}),p(C)}},[n,i,e.window]),c.useEffect(()=>{i&&n&&r.location.key===n.location.key&&i.resolve()},[i,h,r.location,n]),c.useEffect(()=>{!l.isTransitioning&&m&&(o(m.state),s({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[l.isTransitioning,m]);let b=c.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,D,C)=>e.navigate(T,{state:D,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(T,D,C)=>e.navigate(T,{replace:!0,state:D,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[e]),R=e.basename||"/",x=c.useMemo(()=>({router:e,navigator:b,static:!1,basename:R}),[e,b,R]);return c.createElement(c.Fragment,null,c.createElement(Be.Provider,{value:x},c.createElement(Ge.Provider,{value:r},c.createElement(sr.Provider,{value:g.current},c.createElement(lr.Provider,{value:l},c.createElement(Yo,{basename:R,location:r.location,navigationType:r.historyAction,navigator:b},c.createElement(Vo,{routes:e.routes,future:e.future,state:r})))))),null)}var Vo=c.memo(Wo);function Wo({routes:e,future:t,state:r}){return Fo(e,void 0,r,t)}function Zi(e){return Oo(e.context)}function Yo({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){H(!lt(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=c.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=$e(r));let{pathname:i="/",search:u="",hash:h="",state:p=null,key:m="default"}=r,v=c.useMemo(()=>{let g=ve(i,l);return g==null?null:{location:{pathname:g,search:u,hash:h,state:p,key:m},navigationType:a}},[l,i,u,h,p,m,a]);return le(v!=null,` is not able to match the URL "${i}${u}${h}" because it does not start with the basename, so the won't render anything.`),v==null?null:c.createElement(ge.Provider,{value:s},c.createElement(Tt.Provider,{children:t,value:v}))}var St="get",xt="application/x-www-form-urlencoded";function kt(e){return e!=null&&typeof e.tagName=="string"}function Jo(e){return kt(e)&&e.tagName.toLowerCase()==="button"}function Ko(e){return kt(e)&&e.tagName.toLowerCase()==="form"}function Go(e){return kt(e)&&e.tagName.toLowerCase()==="input"}function Xo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qo(e,t){return e.button===0&&(!t||t==="_self")&&!Xo(e)}function Qt(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function qo(e,t){let r=Qt(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var wt=null;function Zo(){if(wt===null)try{new FormData(document.createElement("form"),0),wt=!1}catch{wt=!0}return wt}var ei=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wt(e){return e!=null&&!ei.has(e)?(le(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${xt}"`),null):e}function ti(e,t){let r,a,n,o,l;if(Ko(e)){let s=e.getAttribute("action");a=s?ve(s,t):null,r=e.getAttribute("method")||St,n=Wt(e.getAttribute("enctype"))||xt,o=new FormData(e)}else if(Jo(e)||Go(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a