function ma(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt={exports:{}},et={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fr;function pa(){if(Fr)return et;Fr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var s in a)s!=="key"&&(o[s]=a[s])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return et.Fragment=t,et.jsx=r,et.jsxs=r,et}var jr;function ya(){return jr||(jr=1,zt.exports=pa()),zt.exports}var Sl=ya(),Bt={exports:{}},Y={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ur;function va(){if(Ur)return Y;Ur=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),f=Symbol.iterator;function p(m){return m===null||typeof m!="object"?null:(m=f&&m[f]||m["@@iterator"],typeof m=="function"?m:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,M={};function w(m,x,$){this.props=m,this.context=x,this.refs=M,this.updater=$||g}w.prototype.isReactComponent={},w.prototype.setState=function(m,x){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,x,"setState")},w.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function S(){}S.prototype=w.prototype;function P(m,x,$){this.props=m,this.context=x,this.refs=M,this.updater=$||g}var O=P.prototype=new S;O.constructor=P,R(O,w.prototype),O.isPureReactComponent=!0;var k=Array.isArray,b={H:null,A:null,T:null,S:null,V:null},v=Object.prototype.hasOwnProperty;function L(m,x,$,D,V,Z){return $=Z.ref,{$$typeof:e,type:m,key:x,ref:$!==void 0?$:null,props:Z}}function U(m,x){return L(m.type,x,void 0,void 0,void 0,m.props)}function j(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function G(m){var x={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function($){return x[$]})}var re=/\/+/g;function ue(m,x){return typeof m=="object"&&m!==null&&m.key!=null?G(""+m.key):x.toString(36)}function le(){}function X(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(le,le):(m.status="pending",m.then(function(x){m.status==="pending"&&(m.status="fulfilled",m.value=x)},function(x){m.status==="pending"&&(m.status="rejected",m.reason=x)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function Q(m,x,$,D,V){var Z=typeof m;(Z==="undefined"||Z==="boolean")&&(m=null);var B=!1;if(m===null)B=!0;else switch(Z){case"bigint":case"string":case"number":B=!0;break;case"object":switch(m.$$typeof){case e:case t:B=!0;break;case c:return B=m._init,Q(B(m._payload),x,$,D,V)}}if(B)return V=V(m),B=D===""?"."+ue(m,0):D,k(V)?($="",B!=null&&($=B.replace(re,"$&/")+"/"),Q(V,x,$,"",function(It){return It})):V!=null&&(j(V)&&(V=U(V,$+(V.key==null||m&&m.key===V.key?"":(""+V.key).replace(re,"$&/")+"/")+B)),x.push(V)),1;B=0;var Se=D===""?".":D+":";if(k(m))for(var ie=0;ie<m.length;ie++)D=m[ie],Z=Se+ue(D,ie),B+=Q(D,x,$,Z,V);else if(ie=p(m),typeof ie=="function")for(m=ie.call(m),ie=0;!(D=m.next()).done;)D=D.value,Z=Se+ue(D,ie++),B+=Q(D,x,$,Z,V);else if(Z==="object"){if(typeof m.then=="function")return Q(X(m),x,$,D,V);throw x=String(m),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return B}function K(m,x,$){if(m==null)return m;var D=[],V=0;return Q(m,D,"","",function(Z){return x.call($,Z,V++)}),D}function ae(m){if(m._status===-1){var x=m._result;x=x(),x.then(function($){(m._status===0||m._status===-1)&&(m._status=1,m._result=$)},function($){(m._status===0||m._status===-1)&&(m._status=2,m._result=$)}),m._status===-1&&(m._status=0,m._result=x)}if(m._status===1)return m._result.default;throw m._result}var fe=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(x))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)};function de(){}return Y.Children={map:K,forEach:function(m,x,$){K(m,function(){x.apply(this,arguments)},$)},count:function(m){var x=0;return K(m,function(){x++}),x},toArray:function(m){return K(m,function(x){return x})||[]},only:function(m){if(!j(m))throw Error("React.Children.only expected to receive a single React element child.");return m}},Y.Component=w,Y.Fragment=r,Y.Profiler=a,Y.PureComponent=P,Y.StrictMode=n,Y.Suspense=l,Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,Y.__COMPILER_RUNTIME={__proto__:null,c:function(m){return b.H.useMemoCache(m)}},Y.cache=function(m){return function(){return m.apply(null,arguments)}},Y.cloneElement=function(m,x,$){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var D=R({},m.props),V=m.key,Z=void 0;if(x!=null)for(B in x.ref!==void 0&&(Z=void 0),x.key!==void 0&&(V=""+x.key),x)!v.call(x,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&x.ref===void 0||(D[B]=x[B]);var B=arguments.length-2;if(B===1)D.children=$;else if(1<B){for(var Se=Array(B),ie=0;ie<B;ie++)Se[ie]=arguments[ie+2];D.children=Se}return L(m.type,V,void 0,void 0,Z,D)},Y.createContext=function(m){return m={$$typeof:i,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:o,_context:m},m},Y.createElement=function(m,x,$){var D,V={},Z=null;if(x!=null)for(D in x.key!==void 0&&(Z=""+x.key),x)v.call(x,D)&&D!=="key"&&D!=="__self"&&D!=="__source"&&(V[D]=x[D]);var B=arguments.length-2;if(B===1)V.children=$;else if(1<B){for(var Se=Array(B),ie=0;ie<B;ie++)Se[ie]=arguments[ie+2];V.children=Se}if(m&&m.defaultProps)for(D in B=m.defaultProps,B)V[D]===void 0&&(V[D]=B[D]);return L(m,Z,void 0,void 0,null,V)},Y.createRef=function(){return{current:null}},Y.forwardRef=function(m){return{$$typeof:s,render:m}},Y.isValidElement=j,Y.lazy=function(m){return{$$typeof:c,_payload:{_status:-1,_result:m},_init:ae}},Y.memo=function(m,x){return{$$typeof:u,type:m,compare:x===void 0?null:x}},Y.startTransition=function(m){var x=b.T,$={};b.T=$;try{var D=m(),V=b.S;V!==null&&V($,D),typeof D=="object"&&D!==null&&typeof D.then=="function"&&D.then(de,fe)}catch(Z){fe(Z)}finally{b.T=x}},Y.unstable_useCacheRefresh=function(){return b.H.useCacheRefresh()},Y.use=function(m){return b.H.use(m)},Y.useActionState=function(m,x,$){return b.H.useActionState(m,x,$)},Y.useCallback=function(m,x){return b.H.useCallback(m,x)},Y.useContext=function(m){return b.H.useContext(m)},Y.useDebugValue=function(){},Y.useDeferredValue=function(m,x){return b.H.useDeferredValue(m,x)},Y.useEffect=function(m,x,$){var D=b.H;if(typeof $=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return D.useEffect(m,x)},Y.useId=function(){return b.H.useId()},Y.useImperativeHandle=function(m,x,$){return b.H.useImperativeHandle(m,x,$)},Y.useInsertionEffect=function(m,x){return b.H.useInsertionEffect(m,x)},Y.useLayoutEffect=function(m,x){return b.H.useLayoutEffect(m,x)},Y.useMemo=function(m,x){return b.H.useMemo(m,x)},Y.useOptimistic=function(m,x){return b.H.useOptimistic(m,x)},Y.useReducer=function(m,x,$){return b.H.useReducer(m,x,$)},Y.useRef=function(m){return b.H.useRef(m)},Y.useState=function(m){return b.H.useState(m)},Y.useSyncExternalStore=function(m,x,$){return b.H.useSyncExternalStore(m,x,$)},Y.useTransition=function(){return b.H.useTransition()},Y.version="19.1.1",Y}var Hr;function ga(){return Hr||(Hr=1,Bt.exports=va()),Bt.exports}var h=ga();const xl=ma(h);/**
 * react-router v7.9.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 fn=e=>{throw TypeError(e)},wa=(e,t,r)=>t.has(e)||fn("Cannot "+r),Wt=(e,t,r)=>(wa(e,t,"read from private field"),r?r.call(e):t.get(e)),Ea=(e,t,r)=>t.has(e)?fn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),zr="popstate";function Cl(e={}){function t(n,a){let{pathname:o,search:i,hash:s}=n.location;return ot("",{pathname:o,search:i,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ke(a)}return ba(t,r,null,e)}function J(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ra(){return Math.random().toString(36).substring(2,10)}function Br(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ne(t):t,state:r,key:t&&t.key||n||Ra()}}function ke({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 Ne(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ba(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",l=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function f(){s="POP";let w=c(),S=w==null?null:w-u;u=w,l&&l({action:s,location:M.location,delta:S})}function p(w,S){s="PUSH";let P=ot(M.location,w,S);u=c()+1;let O=Br(P,u),k=M.createHref(P);try{i.pushState(O,"",k)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(k)}o&&l&&l({action:s,location:M.location,delta:1})}function g(w,S){s="REPLACE";let P=ot(M.location,w,S);u=c();let O=Br(P,u),k=M.createHref(P);i.replaceState(O,"",k),o&&l&&l({action:s,location:M.location,delta:0})}function R(w){return hn(w)}let M={get action(){return s},get location(){return e(a,i)},listen(w){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(zr,f),l=w,()=>{a.removeEventListener(zr,f),l=null}},createHref(w){return t(a,w)},createURL:R,encodeLocation(w){let S=R(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:g,go(w){return i.go(w)}};return M}function hn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),J(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:ke(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var at,Wr=class{constructor(e){if(Ea(this,at,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Wt(this,at).has(e))return Wt(this,at).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Wt(this,at).set(e,t)}};at=new WeakMap;var Sa=new Set(["lazy","caseSensitive","path","id","index","children"]);function xa(e){return Sa.has(e)}var Ca=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function La(e){return Ca.has(e)}function Pa(e){return e.index===!0}function it(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let s=[...r,String(i)],l=typeof o.id=="string"?o.id:s.join("-");if(J(o.index!==!0||!o.children,"Cannot specify children on an index route"),J(a||!n[l],`Found a route id collision on id "${l}".  Route id's must be globally unique within Data Router usages`),Pa(o)){let u={...o,...t(o),id:l};return n[l]=u,u}else{let u={...o,...t(o),id:l,children:void 0};return n[l]=u,o.children&&(u.children=it(o.children,t,s,n,a)),u}})}function Me(e,t,r="/"){return xt(e,t,r,!1)}function xt(e,t,r,n){let a=typeof t=="string"?Ne(t):t,o=we(a.pathname||"/",r);if(o==null)return null;let i=pn(e);Ma(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let u=Fa(o);s=Ia(i[l],u,n)}return s}function mn(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function pn(e,t=[],r=[],n="",a=!1){let o=(i,s,l=a,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(n)&&l)return;J(c.relativePath.startsWith(n),`Absolute route path "${c.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(n.length)}let f=Ce([n,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(J(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),pn(i.children,t,p,f,l)),!(i.path==null&&!i.index)&&t.push({path:f,score:Na(f,i.index),routesMeta:p})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let u of yn(i.path))o(i,s,!0,u)}),t}function yn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=yn(n.join("/")),s=[];return s.push(...i.map(l=>l===""?o:[o,l].join("/"))),a&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Ma(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:$a(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Ta=/^:[\w-]+$/,Da=3,_a=2,Oa=1,Aa=10,ka=-2,Yr=e=>e==="*";function Na(e,t){let r=e.split("/"),n=r.length;return r.some(Yr)&&(n+=ka),t&&(n+=_a),r.filter(a=>!Yr(a)).reduce((a,o)=>a+(Ta.test(o)?Da:o===""?Oa:Aa),n)}function $a(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Ia(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],u=s===n.length-1,c=o==="/"?t:t.slice(o.length)||"/",f=Tt({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),p=l.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=Tt({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!f)return null;Object.assign(a,f.params),i.push({params:a,pathname:Ce([o,f.pathname]),pathnameBase:za(Ce([o,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(o=Ce([o,f.pathnameBase]))}return i}function Tt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=vn(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((u,{paramName:c,isOptional:f},p)=>{if(c==="*"){let R=s[p]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=s[p];return f&&!g?u[c]=void 0:u[c]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function vn(e,t=!1,r=!0){oe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Fa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oe(!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 we(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ja({basename:e,pathname:t}){return t==="/"?e:Ce([e,t])}function Ua(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ne(e):e;return{pathname:r?r.startsWith("/")?r:Ha(r,t):t,search:Ba(n),hash:Wa(a)}}function Ha(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Yt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function gn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ur(e){let t=gn(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function cr(e,t,r,n=!1){let a;typeof e=="string"?a=Ne(e):(a={...e},J(!a.pathname||!a.pathname.includes("?"),Yt("?","pathname","search",a)),J(!a.pathname||!a.pathname.includes("#"),Yt("#","pathname","hash",a)),J(!a.search||!a.search.includes("#"),Yt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,s;if(i==null)s=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=Ua(a,s),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),za=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ba=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Wa=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ya=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Va(e,t){return new Ya(e,typeof t=="number"?{status:t}:t)}var Ja=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},ze=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Be(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wn=["POST","PUT","PATCH","DELETE"],Ga=new Set(wn),Xa=["GET",...wn],Ka=new Set(Xa),qa=new Set([301,302,303,307,308]),Qa=new Set([307,308]),Vt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Za={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},eo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=e=>eo.test(e),to=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),En="remix-router-transitions",Rn=Symbol("ResetLoaderData");function Ll(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";J(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||to,o={},i=it(e.routes,a,void 0,o),s,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let u=e.dataStrategy||io,c={...e.future},f=null,p=new Set,g=null,R=null,M=null,w=e.hydrationData!=null,S=Me(i,e.history.location,l),P=!1,O=null,k;if(S==null&&!e.patchRoutesOnNavigation){let d=Ee(404,{pathname:e.history.location.pathname}),{matches:y,route:E}=gt(i);k=!0,S=y,O={[E.id]:d}}else if(S&&!e.hydrationData&&ht(S,i,e.history.location.pathname).active&&(S=null),S)if(S.some(d=>d.route.lazy))k=!1;else if(!S.some(d=>d.route.loader))k=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null;if(y){let E=S.findIndex(C=>y[C.route.id]!==void 0);k=S.slice(0,E+1).every(C=>!Zt(C.route,d,y))}else k=S.every(E=>!Zt(E.route,d,y))}else{k=!1,S=[];let d=ht(null,i,e.history.location.pathname);d.active&&d.matches&&(P=!0,S=d.matches)}let b,v={historyAction:e.history.action,location:e.history.location,matches:S,initialized:k,navigation:Vt,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||O,fetchers:new Map,blockers:new Map},L="POP",U=!1,j,G=!1,re=new Map,ue=null,le=!1,X=!1,Q=new Set,K=new Map,ae=0,fe=-1,de=new Map,m=new Set,x=new Map,$=new Map,D=new Set,V=new Map,Z,B=null;function Se(){if(f=e.history.listen(({action:d,location:y,delta:E})=>{if(Z){Z(),Z=void 0;return}oe(V.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 C=kr({currentLocation:v.location,nextLocation:y,historyAction:d});if(C&&E!=null){let T=new Promise(N=>{Z=N});e.history.go(E*-1),ft(C,{state:"blocked",location:y,proceed(){ft(C,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),T.then(()=>e.history.go(E))},reset(){let N=new Map(v.blockers);N.set(C,tt),he({blockers:N})}});return}return $e(d,y)}),r){bo(t,re);let d=()=>So(t,re);t.addEventListener("pagehide",d),ue=()=>t.removeEventListener("pagehide",d)}return v.initialized||$e("POP",v.location,{initialHydration:!0}),b}function ie(){f&&f(),ue&&ue(),p.clear(),j&&j.abort(),v.fetchers.forEach((d,y)=>jt(y)),v.blockers.forEach((d,y)=>Ar(y))}function It(d){return p.add(d),()=>p.delete(d)}function he(d,y={}){d.matches&&(d.matches=d.matches.map(T=>{let N=o[T.route.id],I=T.route;return I.element!==N.element||I.errorElement!==N.errorElement||I.hydrateFallbackElement!==N.hydrateFallbackElement?{...T,route:N}:T})),v={...v,...d};let E=[],C=[];v.fetchers.forEach((T,N)=>{T.state==="idle"&&(D.has(N)?E.push(N):C.push(N))}),D.forEach(T=>{!v.fetchers.has(T)&&!K.has(T)&&E.push(T)}),[...p].forEach(T=>T(v,{deletedFetchers:E,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),E.forEach(T=>jt(T)),C.forEach(T=>v.fetchers.delete(T))}function Ye(d,y,{flushSync:E}={}){var H,A;let C=v.actionData!=null&&v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&v.navigation.state==="loading"&&((H=d.state)==null?void 0:H._isRedirect)!==!0,T;y.actionData?Object.keys(y.actionData).length>0?T=y.actionData:T=null:C?T=v.actionData:T=null;let N=y.loaderData?tn(v.loaderData,y.loaderData,y.matches||[],y.errors):v.loaderData,I=v.blockers;I.size>0&&(I=new Map(I),I.forEach((W,ee)=>I.set(ee,tt)));let _=le?!1:$r(d,y.matches||v.matches),F=U===!0||v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&((A=d.state)==null?void 0:A._isRedirect)!==!0;s&&(i=s,s=void 0),le||L==="POP"||(L==="PUSH"?e.history.push(d,d.state):L==="REPLACE"&&e.history.replace(d,d.state));let z;if(L==="POP"){let W=re.get(v.location.pathname);W&&W.has(d.pathname)?z={currentLocation:v.location,nextLocation:d}:re.has(d.pathname)&&(z={currentLocation:d,nextLocation:v.location})}else if(G){let W=re.get(v.location.pathname);W?W.add(d.pathname):(W=new Set([d.pathname]),re.set(v.location.pathname,W)),z={currentLocation:v.location,nextLocation:d}}he({...y,actionData:T,loaderData:N,historyAction:L,location:d,initialized:!0,navigation:Vt,revalidation:"idle",restoreScrollPosition:_,preventScrollReset:F,blockers:I},{viewTransitionOpts:z,flushSync:E===!0}),L="POP",U=!1,G=!1,le=!1,X=!1,B==null||B.resolve(),B=null}async function Lr(d,y){if(typeof d=="number"){e.history.go(d);return}let E=Qt(v.location,v.matches,l,d,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:C,submission:T,error:N}=Vr(!1,E,y),I=v.location,_=ot(v.location,C,y&&y.state);_={..._,...e.history.encodeLocation(_)};let F=y&&y.replace!=null?y.replace:void 0,z="PUSH";F===!0?z="REPLACE":F===!1||T!=null&&ve(T.formMethod)&&T.formAction===v.location.pathname+v.location.search&&(z="REPLACE");let H=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,A=(y&&y.flushSync)===!0,W=kr({currentLocation:I,nextLocation:_,historyAction:z});if(W){ft(W,{state:"blocked",location:_,proceed(){ft(W,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),Lr(d,y)},reset(){let ee=new Map(v.blockers);ee.set(W,tt),he({blockers:ee})}});return}await $e(z,_,{submission:T,pendingError:N,preventScrollReset:H,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:A})}function ea(){B||(B=xo()),Ft(),he({revalidation:"loading"});let d=B.promise;return v.navigation.state==="submitting"?d:v.navigation.state==="idle"?($e(v.historyAction,v.location,{startUninterruptedRevalidation:!0}),d):($e(L||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:G===!0}),d)}async function $e(d,y,E){j&&j.abort(),j=null,L=d,le=(E&&E.startUninterruptedRevalidation)===!0,ca(v.location,v.matches),U=(E&&E.preventScrollReset)===!0,G=(E&&E.enableViewTransition)===!0;let C=s||i,T=E&&E.overrideNavigation,N=E!=null&&E.initialHydration&&v.matches&&v.matches.length>0&&!P?v.matches:Me(C,y,l),I=(E&&E.flushSync)===!0;if(N&&v.initialized&&!X&&po(v.location,y)&&!(E&&E.submission&&ve(E.submission.formMethod))){Ye(y,{matches:N},{flushSync:I});return}let _=ht(N,C,y.pathname);if(_.active&&_.matches&&(N=_.matches),!N){let{error:pe,notFoundMatches:ne,route:te}=Ut(y.pathname);Ye(y,{matches:ne,loaderData:{},errors:{[te.id]:pe}},{flushSync:I});return}j=new AbortController;let F=Je(e.history,y,j.signal,E&&E.submission),z=e.getContext?await e.getContext():new Wr,H;if(E&&E.pendingError)H=[Ae(N).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&ve(E.submission.formMethod)){let pe=await ta(F,y,E.submission,N,z,_.active,E&&E.initialHydration===!0,{replace:E.replace,flushSync:I});if(pe.shortCircuited)return;if(pe.pendingActionResult){let[ne,te]=pe.pendingActionResult;if(ge(te)&&Be(te.error)&&te.error.status===404){j=null,Ye(y,{matches:pe.matches,loaderData:{},errors:{[ne]:te.error}});return}}N=pe.matches||N,H=pe.pendingActionResult,T=Jt(y,E.submission),I=!1,_.active=!1,F=Je(e.history,F.url,F.signal)}let{shortCircuited:A,matches:W,loaderData:ee,errors:ce}=await ra(F,y,N,z,_.active,T,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,I,H);A||(j=null,Ye(y,{matches:W||N,...rn(H),loaderData:ee,errors:ce}))}async function ta(d,y,E,C,T,N,I,_={}){Ft();let F=Eo(y,E);if(he({navigation:F},{flushSync:_.flushSync===!0}),N){let A=await mt(C,y.pathname,d.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){if(A.partialMatches.length===0){let{matches:ee,route:ce}=gt(i);return{matches:ee,pendingActionResult:[ce.id,{type:"error",error:A.error}]}}let W=Ae(A.partialMatches).route.id;return{matches:A.partialMatches,pendingActionResult:[W,{type:"error",error:A.error}]}}else if(A.matches)C=A.matches;else{let{notFoundMatches:W,error:ee,route:ce}=Ut(y.pathname);return{matches:W,pendingActionResult:[ce.id,{type:"error",error:ee}]}}}let z,H=Ct(C,y);if(!H.route.action&&!H.route.lazy)z={type:"error",error:Ee(405,{method:d.method,pathname:y.pathname,routeId:H.route.id})};else{let A=Ge(a,o,d,C,H,I?[]:n,T),W=await qe(d,A,T,null);if(z=W[H.route.id],!z){for(let ee of C)if(W[ee.route.id]){z=W[ee.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(He(z)){let A;return _&&_.replace!=null?A=_.replace:A=Qr(z.response.headers.get("Location"),new URL(d.url),l)===v.location.pathname+v.location.search,await Ie(d,z,!0,{submission:E,replace:A}),{shortCircuited:!0}}if(ge(z)){let A=Ae(C,H.route.id);return(_&&_.replace)!==!0&&(L="PUSH"),{matches:C,pendingActionResult:[A.route.id,z,H.route.id]}}return{matches:C,pendingActionResult:[H.route.id,z]}}async function ra(d,y,E,C,T,N,I,_,F,z,H,A){let W=N||Jt(y,I),ee=I||_||nn(W),ce=!le&&!z;if(T){if(ce){let me=Pr(A);he({navigation:W,...me!==void 0?{actionData:me}:{}},{flushSync:H})}let q=await mt(E,y.pathname,d.signal);if(q.type==="aborted")return{shortCircuited:!0};if(q.type==="error"){if(q.partialMatches.length===0){let{matches:Ve,route:Ue}=gt(i);return{matches:Ve,loaderData:{},errors:{[Ue.id]:q.error}}}let me=Ae(q.partialMatches).route.id;return{matches:q.partialMatches,loaderData:{},errors:{[me]:q.error}}}else if(q.matches)E=q.matches;else{let{error:me,notFoundMatches:Ve,route:Ue}=Ut(y.pathname);return{matches:Ve,loaderData:{},errors:{[Ue.id]:me}}}}let pe=s||i,{dsMatches:ne,revalidatingFetchers:te}=Jr(d,C,a,o,e.history,v,E,ee,y,z?[]:n,z===!0,X,Q,D,x,m,pe,l,e.patchRoutesOnNavigation!=null,A);if(fe=++ae,!e.dataStrategy&&!ne.some(q=>q.shouldLoad)&&!ne.some(q=>q.route.middleware)&&te.length===0){let q=_r();return Ye(y,{matches:E,loaderData:{},errors:A&&ge(A[1])?{[A[0]]:A[1].error}:null,...rn(A),...q?{fetchers:new Map(v.fetchers)}:{}},{flushSync:H}),{shortCircuited:!0}}if(ce){let q={};if(!T){q.navigation=W;let me=Pr(A);me!==void 0&&(q.actionData=me)}te.length>0&&(q.fetchers=na(te)),he(q,{flushSync:H})}te.forEach(q=>{De(q.key),q.controller&&K.set(q.key,q.controller)});let Fe=()=>te.forEach(q=>De(q.key));j&&j.signal.addEventListener("abort",Fe);let{loaderResults:Qe,fetcherResults:_e}=await Mr(ne,te,d,C);if(d.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Fe),te.forEach(q=>K.delete(q.key));let xe=wt(Qe);if(xe)return await Ie(d,xe.result,!0,{replace:F}),{shortCircuited:!0};if(xe=wt(_e),xe)return m.add(xe.key),await Ie(d,xe.result,!0,{replace:F}),{shortCircuited:!0};let{loaderData:Ht,errors:Ze}=en(v,E,Qe,A,te,_e);z&&v.errors&&(Ze={...v.errors,...Ze});let je=_r(),pt=Or(fe),yt=je||pt||te.length>0;return{matches:E,loaderData:Ht,errors:Ze,...yt?{fetchers:new Map(v.fetchers)}:{}}}function Pr(d){if(d&&!ge(d[1]))return{[d[0]]:d[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function na(d){return d.forEach(y=>{let E=v.fetchers.get(y.key),C=rt(void 0,E?E.data:void 0);v.fetchers.set(y.key,C)}),new Map(v.fetchers)}async function aa(d,y,E,C){De(d);let T=(C&&C.flushSync)===!0,N=s||i,I=Qt(v.location,v.matches,l,E,y,C==null?void 0:C.relative),_=Me(N,I,l),F=ht(_,N,I);if(F.active&&F.matches&&(_=F.matches),!_){Pe(d,y,Ee(404,{pathname:I}),{flushSync:T});return}let{path:z,submission:H,error:A}=Vr(!0,I,C);if(A){Pe(d,y,A,{flushSync:T});return}let W=e.getContext?await e.getContext():new Wr,ee=(C&&C.preventScrollReset)===!0;if(H&&ve(H.formMethod)){await oa(d,y,z,_,W,F.active,T,ee,H);return}x.set(d,{routeId:y,path:z}),await ia(d,y,z,_,W,F.active,T,ee,H)}async function oa(d,y,E,C,T,N,I,_,F){Ft(),x.delete(d);let z=v.fetchers.get(d);Te(d,Ro(F,z),{flushSync:I});let H=new AbortController,A=Je(e.history,E,H.signal,F);if(N){let se=await mt(C,new URL(A.url).pathname,A.signal,d);if(se.type==="aborted")return;if(se.type==="error"){Pe(d,y,se.error,{flushSync:I});return}else if(se.matches)C=se.matches;else{Pe(d,y,Ee(404,{pathname:E}),{flushSync:I});return}}let W=Ct(C,E);if(!W.route.action&&!W.route.lazy){let se=Ee(405,{method:F.formMethod,pathname:E,routeId:y});Pe(d,y,se,{flushSync:I});return}K.set(d,H);let ee=ae,ce=Ge(a,o,A,C,W,n,T),ne=(await qe(A,ce,T,d))[W.route.id];if(A.signal.aborted){K.get(d)===H&&K.delete(d);return}if(D.has(d)){if(He(ne)||ge(ne)){Te(d,Oe(void 0));return}}else{if(He(ne))if(K.delete(d),fe>ee){Te(d,Oe(void 0));return}else return m.add(d),Te(d,rt(F)),Ie(A,ne,!1,{fetcherSubmission:F,preventScrollReset:_});if(ge(ne)){Pe(d,y,ne.error);return}}let te=v.navigation.location||v.location,Fe=Je(e.history,te,H.signal),Qe=s||i,_e=v.navigation.state!=="idle"?Me(Qe,v.navigation.location,l):v.matches;J(_e,"Didn't find any matches after fetcher action");let xe=++ae;de.set(d,xe);let Ht=rt(F,ne.data);v.fetchers.set(d,Ht);let{dsMatches:Ze,revalidatingFetchers:je}=Jr(Fe,T,a,o,e.history,v,_e,F,te,n,!1,X,Q,D,x,m,Qe,l,e.patchRoutesOnNavigation!=null,[W.route.id,ne]);je.filter(se=>se.key!==d).forEach(se=>{let vt=se.key,Ir=v.fetchers.get(vt),ha=rt(void 0,Ir?Ir.data:void 0);v.fetchers.set(vt,ha),De(vt),se.controller&&K.set(vt,se.controller)}),he({fetchers:new Map(v.fetchers)});let pt=()=>je.forEach(se=>De(se.key));H.signal.addEventListener("abort",pt);let{loaderResults:yt,fetcherResults:q}=await Mr(Ze,je,Fe,T);if(H.signal.aborted)return;if(H.signal.removeEventListener("abort",pt),de.delete(d),K.delete(d),je.forEach(se=>K.delete(se.key)),v.fetchers.has(d)){let se=Oe(ne.data);v.fetchers.set(d,se)}let me=wt(yt);if(me)return Ie(Fe,me.result,!1,{preventScrollReset:_});if(me=wt(q),me)return m.add(me.key),Ie(Fe,me.result,!1,{preventScrollReset:_});let{loaderData:Ve,errors:Ue}=en(v,_e,yt,void 0,je,q);Or(xe),v.navigation.state==="loading"&&xe>fe?(J(L,"Expected pending action"),j&&j.abort(),Ye(v.navigation.location,{matches:_e,loaderData:Ve,errors:Ue,fetchers:new Map(v.fetchers)})):(he({errors:Ue,loaderData:tn(v.loaderData,Ve,_e,Ue),fetchers:new Map(v.fetchers)}),X=!1)}async function ia(d,y,E,C,T,N,I,_,F){let z=v.fetchers.get(d);Te(d,rt(F,z?z.data:void 0),{flushSync:I});let H=new AbortController,A=Je(e.history,E,H.signal);if(N){let te=await mt(C,new URL(A.url).pathname,A.signal,d);if(te.type==="aborted")return;if(te.type==="error"){Pe(d,y,te.error,{flushSync:I});return}else if(te.matches)C=te.matches;else{Pe(d,y,Ee(404,{pathname:E}),{flushSync:I});return}}let W=Ct(C,E);K.set(d,H);let ee=ae,ce=Ge(a,o,A,C,W,n,T),ne=(await qe(A,ce,T,d))[W.route.id];if(K.get(d)===H&&K.delete(d),!A.signal.aborted){if(D.has(d)){Te(d,Oe(void 0));return}if(He(ne))if(fe>ee){Te(d,Oe(void 0));return}else{m.add(d),await Ie(A,ne,!1,{preventScrollReset:_});return}if(ge(ne)){Pe(d,y,ne.error);return}Te(d,Oe(ne.data))}}async function Ie(d,y,E,{submission:C,fetcherSubmission:T,preventScrollReset:N,replace:I}={}){y.response.headers.has("X-Remix-Revalidate")&&(X=!0);let _=y.response.headers.get("Location");J(_,"Expected a Location header on the redirect Response"),_=Qr(_,new URL(d.url),l);let F=ot(v.location,_,{_isRedirect:!0});if(r){let ce=!1;if(y.response.headers.has("X-Remix-Reload-Document"))ce=!0;else if(dr(_)){const pe=hn(_,!0);ce=pe.origin!==t.location.origin||we(pe.pathname,l)==null}if(ce){I?t.location.replace(_):t.location.assign(_);return}}j=null;let z=I===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:H,formAction:A,formEncType:W}=v.navigation;!C&&!T&&H&&A&&W&&(C=nn(v.navigation));let ee=C||T;if(Qa.has(y.response.status)&&ee&&ve(ee.formMethod))await $e(z,F,{submission:{...ee,formAction:_},preventScrollReset:N||U,enableViewTransition:E?G:void 0});else{let ce=Jt(F,C);await $e(z,F,{overrideNavigation:ce,fetcherSubmission:T,preventScrollReset:N||U,enableViewTransition:E?G:void 0})}}async function qe(d,y,E,C){let T,N={};try{T=await so(u,d,y,C,E,!1)}catch(I){return y.filter(_=>_.shouldLoad).forEach(_=>{N[_.route.id]={type:"error",error:I}}),N}if(d.signal.aborted)return N;for(let[I,_]of Object.entries(T))if(go(_)){let F=_.result;N[I]={type:"redirect",response:ho(F,d,I,y,l)}}else N[I]=await fo(_);return N}async function Mr(d,y,E,C){let T=qe(E,d,C,null),N=Promise.all(y.map(async F=>{if(F.matches&&F.match&&F.request&&F.controller){let H=(await qe(F.request,F.matches,C,F.key))[F.match.route.id];return{[F.key]:H}}else return Promise.resolve({[F.key]:{type:"error",error:Ee(404,{pathname:F.path})}})})),I=await T,_=(await N).reduce((F,z)=>Object.assign(F,z),{});return{loaderResults:I,fetcherResults:_}}function Ft(){X=!0,x.forEach((d,y)=>{K.has(y)&&Q.add(y),De(y)})}function Te(d,y,E={}){v.fetchers.set(d,y),he({fetchers:new Map(v.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Pe(d,y,E,C={}){let T=Ae(v.matches,y);jt(d),he({errors:{[T.route.id]:E},fetchers:new Map(v.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function Tr(d){return $.set(d,($.get(d)||0)+1),D.has(d)&&D.delete(d),v.fetchers.get(d)||Za}function jt(d){let y=v.fetchers.get(d);K.has(d)&&!(y&&y.state==="loading"&&de.has(d))&&De(d),x.delete(d),de.delete(d),m.delete(d),D.delete(d),Q.delete(d),v.fetchers.delete(d)}function la(d){let y=($.get(d)||0)-1;y<=0?($.delete(d),D.add(d)):$.set(d,y),he({fetchers:new Map(v.fetchers)})}function De(d){let y=K.get(d);y&&(y.abort(),K.delete(d))}function Dr(d){for(let y of d){let E=Tr(y),C=Oe(E.data);v.fetchers.set(y,C)}}function _r(){let d=[],y=!1;for(let E of m){let C=v.fetchers.get(E);J(C,`Expected fetcher: ${E}`),C.state==="loading"&&(m.delete(E),d.push(E),y=!0)}return Dr(d),y}function Or(d){let y=[];for(let[E,C]of de)if(C<d){let T=v.fetchers.get(E);J(T,`Expected fetcher: ${E}`),T.state==="loading"&&(De(E),de.delete(E),y.push(E))}return Dr(y),y.length>0}function sa(d,y){let E=v.blockers.get(d)||tt;return V.get(d)!==y&&V.set(d,y),E}function Ar(d){v.blockers.delete(d),V.delete(d)}function ft(d,y){let E=v.blockers.get(d)||tt;J(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 C=new Map(v.blockers);C.set(d,y),he({blockers:C})}function kr({currentLocation:d,nextLocation:y,historyAction:E}){if(V.size===0)return;V.size>1&&oe(!1,"A router only supports one blocker at a time");let C=Array.from(V.entries()),[T,N]=C[C.length-1],I=v.blockers.get(T);if(!(I&&I.state==="proceeding")&&N({currentLocation:d,nextLocation:y,historyAction:E}))return T}function Ut(d){let y=Ee(404,{pathname:d}),E=s||i,{matches:C,route:T}=gt(E);return{notFoundMatches:C,route:T,error:y}}function ua(d,y,E){if(g=d,M=y,R=E||null,!w&&v.navigation===Vt){w=!0;let C=$r(v.location,v.matches);C!=null&&he({restoreScrollPosition:C})}return()=>{g=null,M=null,R=null}}function Nr(d,y){return R&&R(d,y.map(C=>mn(C,v.loaderData)))||d.key}function ca(d,y){if(g&&M){let E=Nr(d,y);g[E]=M()}}function $r(d,y){if(g){let E=Nr(d,y),C=g[E];if(typeof C=="number")return C}return null}function ht(d,y,E){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:xt(y,E,l,!0)}}else return{active:!0,matches:xt(y,E,l,!0)||[]};return{active:!1,matches:null}}async function mt(d,y,E,C){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let T=d;for(;;){let N=s==null,I=s||i,_=o;try{await e.patchRoutesOnNavigation({signal:E,path:y,matches:T,fetcherKey:C,patch:(H,A)=>{E.aborted||Gr(H,A,I,_,a,!1)}})}catch(H){return{type:"error",error:H,partialMatches:T}}finally{N&&!E.aborted&&(i=[...i])}if(E.aborted)return{type:"aborted"};let F=Me(I,y,l);if(F)return{type:"success",matches:F};let z=xt(I,y,l,!0);if(!z||T.length===z.length&&T.every((H,A)=>H.route.id===z[A].route.id))return{type:"success",matches:null};T=z}}function da(d){o={},s=it(d,a,void 0,o)}function fa(d,y,E=!1){let C=s==null;Gr(d,y,s||i,o,a,E),C&&(i=[...i],he({}))}return b={get basename(){return l},get future(){return c},get state(){return v},get routes(){return i},get window(){return t},initialize:Se,subscribe:It,enableScrollRestoration:ua,navigate:Lr,fetch:aa,revalidate:ea,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Tr,deleteFetcher:la,dispose:ie,getBlocker:sa,deleteBlocker:Ar,patchRoutes:fa,_internalFetchControllers:K,_internalSetRoutes:da,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){he(d)}},b}function ro(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Qt(e,t,r,n,a,o){let i,s;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){s=u;break}}else i=t,s=t[t.length-1];let l=cr(n||".",ur(i),we(e.pathname,r)||e.pathname,o==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&s){let u=hr(l.search);if(s.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(l.search),f=c.getAll("index");c.delete("index"),f.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();l.search=p?`?${p}`:""}}return r!=="/"&&(l.pathname=ja({basename:r,pathname:l.pathname})),ke(l)}function Vr(e,t,r){if(!r||!ro(r))return{path:t};if(r.formMethod&&!wo(r.formMethod))return{path:t,error:Ee(405,{method:r.formMethod})};let n=()=>({path:t,error:Ee(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Pn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[g,R])=>`${p}${g}=${R}
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return n()}}}J(typeof FormData=="function","FormData is not available in this environment");let s,l;if(r.formData)s=tr(r.formData),l=r.formData;else if(r.body instanceof FormData)s=tr(r.body),l=r.body;else if(r.body instanceof URLSearchParams)s=r.body,l=Zr(s);else if(r.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(r.body),l=Zr(s)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let c=Ne(t);return e&&c.search&&hr(c.search)&&s.append("index",""),c.search=`?${s}`,{path:ke(c),submission:u}}function Jr(e,t,r,n,a,o,i,s,l,u,c,f,p,g,R,M,w,S,P,O){var le;let k=O?ge(O[1])?O[1].error:O[1].data:void 0,b=a.createURL(o.location),v=a.createURL(l),L;if(c&&o.errors){let X=Object.keys(o.errors)[0];L=i.findIndex(Q=>Q.route.id===X)}else if(O&&ge(O[1])){let X=O[0];L=i.findIndex(Q=>Q.route.id===X)-1}let U=O?O[1].statusCode:void 0,j=U&&U>=400,G={currentUrl:b,currentParams:((le=o.matches[0])==null?void 0:le.params)||{},nextUrl:v,nextParams:i[0].params,...s,actionResult:k,actionStatus:U},re=i.map((X,Q)=>{let{route:K}=X,ae=null;if(L!=null&&Q>L?ae=!1:K.lazy?ae=!0:K.loader==null?ae=!1:c?ae=Zt(K,o.loaderData,o.errors):no(o.loaderData,o.matches[Q],X)&&(ae=!0),ae!==null)return er(r,n,e,X,u,t,ae);let fe=j?!1:f||b.pathname+b.search===v.pathname+v.search||b.search!==v.search||ao(o.matches[Q],X),de={...G,defaultShouldRevalidate:fe},m=Dt(X,de);return er(r,n,e,X,u,t,m,de)}),ue=[];return R.forEach((X,Q)=>{if(c||!i.some(D=>D.route.id===X.routeId)||g.has(Q))return;let K=o.fetchers.get(Q),ae=K&&K.state!=="idle"&&K.data===void 0,fe=Me(w,X.path,S);if(!fe){if(P&&ae)return;ue.push({key:Q,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(M.has(Q))return;let de=Ct(fe,X.path),m=new AbortController,x=Je(a,X.path,m.signal),$=null;if(p.has(Q))p.delete(Q),$=Ge(r,n,x,fe,de,u,t);else if(ae)f&&($=Ge(r,n,x,fe,de,u,t));else{let D={...G,defaultShouldRevalidate:j?!1:f};Dt(de,D)&&($=Ge(r,n,x,fe,de,u,t,D))}$&&ue.push({key:Q,routeId:X.routeId,path:X.path,matches:$,match:de,request:x,controller:m})}),{dsMatches:re,revalidatingFetchers:ue}}function Zt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function no(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function ao(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Gr(e,t,r,n,a,o){let i;if(e){let u=n[e];J(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let s=[],l=[];if(t.forEach(u=>{let c=i.find(f=>bn(u,f));c?l.push({existingRoute:c,newRoute:u}):s.push(u)}),s.length>0){let u=it(s,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...u)}if(o&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:c,newRoute:f}=l[u],p=c,[g]=it([f],a,[],{},!0);Object.assign(p,{element:g.element?g.element:p.element,errorElement:g.errorElement?g.errorElement:p.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:p.hydrateFallbackElement})}}function bn(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,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>bn(r,o))}):!1}var Xr=new WeakMap,Sn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(J(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=Xr.get(a);i||(i={},Xr.set(a,i));let s=i[e];if(s)return s;let l=(async()=>{let u=xa(e),f=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)oe(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)oe(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(a,{[e]:p}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(p=>p===void 0)&&(a.lazy=void 0))})();return i[e]=l,l},Kr=new WeakMap;function oo(e,t,r,n,a){let o=r[e.id];if(J(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=Kr.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let f=(async()=>{J(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),g={};for(let R in p){let M=p[R];if(M===void 0)continue;let w=La(R),P=o[R]!==void 0&&R!=="hasErrorBoundary";w?oe(!w,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):P?oe(!P,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=M}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return Kr.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),s=[],l;for(let c of i){if(a&&a.includes(c))continue;let f=Sn({key:c,route:e,manifest:r,mapRouteProperties:n});f&&(s.push(f),c===t&&(l=f))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u==null||u.catch(()=>{}),l==null||l.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function qr(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function io(e){return e.matches.some(t=>t.route.middleware)?xn(e,()=>qr(e)):qr(e)}function xn(e,t){return lo(e,t,n=>n,yo,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,s=Math.min(i.findIndex(u=>u.route.id===a)||0,i.findIndex(u=>u.unstable_shouldCallHandler())||0),l=Ae(i,i[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:n}})}}}async function lo(e,t,r,n,a){let{matches:o,request:i,params:s,context:l}=e,u=o.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await Cn({request:i,params:s,context:l},u,t,r,n,a)}async function Cn(e,t,r,n,a,o,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[i];if(!l)return await r();let[u,c]=l,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Cn(e,t,r,n,a,o,i+1)},f.value}catch(g){return f={value:await o(g,u,f)},f.value}};try{let g=await c(e,p),R=g!=null?n(g):void 0;return a(R)?R:f?R??f.value:(f={value:await p()},f.value)}catch(g){return await o(g,u,f)}}function Ln(e,t,r,n,a){let o=Sn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=oo(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function er(e,t,r,n,a,o,i,s=null){let l=!1,u=Ln(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(c){return l=!0,s?typeof c=="boolean"?Dt(n,{...s,defaultShouldRevalidate:c}):Dt(n,s):i},resolve(c){return l||i||c&&!ve(r.method)&&(n.route.lazy||n.route.loader)?uo({request:r,match:n,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Ge(e,t,r,n,a,o,i,s=null){return n.map(l=>l.route.id!==a.route.id?{...l,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:Ln(e,t,r,l,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:er(e,t,r,l,o,i,!0,s))}async function so(e,t,r,n,a,o){r.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(r.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let i={request:t,params:r[0].params,context:a,matches:r},l=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let c=i;return xn(c,()=>u({...c,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>{var c,f;return[(c=u._lazyPromises)==null?void 0:c.handler,(f=u._lazyPromises)==null?void 0:f.route]}))}catch{}return l}async function uo({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let i,s,l=ve(e.method),u=l?"action":"loader",c=f=>{let p,g=new Promise((w,S)=>p=S);s=()=>p(),e.signal.addEventListener("abort",s);let R=w=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):f({request:e,params:t.params,context:o},...w!==void 0?[w]:[]),M=(async()=>{try{return{type:"data",result:await(a?a(S=>R(S)):R())}}catch(w){return{type:"error",result:w}}})();return Promise.race([M,g])};try{let f=l?t.route.action:t.route.loader;if(r||n)if(f){let p,[g]=await Promise.all([c(f).catch(R=>{p=R}),r,n]);if(p!==void 0)throw p;i=g}else{await r;let p=l?t.route.action:t.route.loader;if(p)[i]=await Promise.all([c(p),n]);else if(u==="action"){let g=new URL(e.url),R=g.pathname+g.search;throw Ee(405,{method:e.method,pathname:R,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(f)i=await c(f);else{let p=new URL(e.url),g=p.pathname+p.search;throw Ee(404,{pathname:g})}}catch(f){return{type:"error",result:f}}finally{s&&e.signal.removeEventListener("abort",s)}return i}async function co(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function fo(e){var n,a,o,i,s,l;let{result:t,type:r}=e;if(fr(t)){let u;try{u=await co(t)}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new ze(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?rr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ze(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:Be(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Be(t)?t.status:void 0}:rr(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function ho(e,t,r,n,a){let o=e.headers.get("Location");if(J(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!dr(o)){let i=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=Qt(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function Qr(e,t,r){if(dr(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=we(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Je(e,t,r,n){let a=e.createURL(Pn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:s}=n;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=tr(n.formData):o.body=n.formData}return new Request(a,o)}function tr(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Zr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function mo(e,t,r,n=!1,a=!1){let o={},i=null,s,l=!1,u={},c=r&&ge(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,g=t[p];if(J(!He(g),"Cannot handle redirect results in processLoaderData"),ge(g)){let R=g.error;if(c!==void 0&&(R=c,c=void 0),i=i||{},a)i[p]=R;else{let M=Ae(e,p);i[M.route.id]==null&&(i[M.route.id]=R)}n||(o[p]=Rn),l||(l=!0,s=Be(g.error)?g.error.status:500),g.headers&&(u[p]=g.headers)}else o[p]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(s=g.statusCode),g.headers&&(u[p]=g.headers)}),c!==void 0&&r&&(i={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:u}}function en(e,t,r,n,a,o){let{loaderData:i,errors:s}=mo(t,r,n);return a.filter(l=>!l.matches||l.matches.some(u=>u.shouldLoad)).forEach(l=>{let{key:u,match:c,controller:f}=l;if(f&&f.signal.aborted)return;let p=o[u];if(J(p,"Did not find corresponding fetcher result"),ge(p)){let g=Ae(e.matches,c==null?void 0:c.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:p.error}),e.fetchers.delete(u)}else if(He(p))J(!1,"Unhandled fetcher revalidation redirect");else{let g=Oe(p.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:s}}function tn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Rn).reduce((o,[i,s])=>(o[i]=s,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function rn(e){return e?ge(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ae(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function gt(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 Ee(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new ze(e||500,i,new Error(s),!0)}function wt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(He(a))return{key:n,result:a}}}function Pn(e){let t=typeof e=="string"?Ne(e):e;return ke({...t,hash:""})}function po(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function yo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&vo(r))}function vo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function go(e){return fr(e.result)&&qa.has(e.result.status)}function ge(e){return e.type==="error"}function He(e){return(e&&e.type)==="redirect"}function rr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function fr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wo(e){return Ka.has(e.toUpperCase())}function ve(e){return Ga.has(e.toUpperCase())}function hr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ct(e,t){let r=typeof t=="string"?Ne(t).search:t.search;if(e[e.length-1].route.index&&hr(r||""))return e[e.length-1];let n=gn(e);return n[n.length-1]}function nn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Jt(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 Eo(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 rt(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 Ro(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 bo(e,t){try{let r=e.sessionStorage.getItem(En);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function So(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(En,JSON.stringify(r))}catch(n){oe(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function xo(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var We=h.createContext(null);We.displayName="DataRouter";var Xe=h.createContext(null);Xe.displayName="DataRouterState";var Co=h.createContext(!1);function Lo(){return h.useContext(Co)}var mr=h.createContext({isTransitioning:!1});mr.displayName="ViewTransition";var Mn=h.createContext(new Map);Mn.displayName="Fetchers";var Po=h.createContext(null);Po.displayName="Await";var Re=h.createContext(null);Re.displayName="Navigation";var At=h.createContext(null);At.displayName="Location";var be=h.createContext({outlet:null,matches:[],isDataRoute:!1});be.displayName="Route";var pr=h.createContext(null);pr.displayName="RouteError";function Mo(e,{relative:t}={}){J(st(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Re),{hash:a,pathname:o,search:i}=ut(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Ce([r,o])),n.createHref({pathname:s,search:i,hash:a})}function st(){return h.useContext(At)!=null}function Le(){return J(st(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(At).location}var Tn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dn(e){h.useContext(Re).static||h.useLayoutEffect(e)}function To(){let{isDataRoute:e}=h.useContext(be);return e?Bo():Do()}function Do(){J(st(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(We),{basename:t,navigator:r}=h.useContext(Re),{matches:n}=h.useContext(be),{pathname:a}=Le(),o=JSON.stringify(ur(n)),i=h.useRef(!1);return Dn(()=>{i.current=!0}),h.useCallback((l,u={})=>{if(oe(i.current,Tn),!i.current)return;if(typeof l=="number"){r.go(l);return}let c=cr(l,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Ce([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,a,e])}var _o=h.createContext(null);function Oo(e){let t=h.useContext(be).outlet;return t&&h.createElement(_o.Provider,{value:e},t)}function _n(){let{matches:e}=h.useContext(be),t=e[e.length-1];return t?t.params:{}}function ut(e,{relative:t}={}){let{matches:r}=h.useContext(be),{pathname:n}=Le(),a=JSON.stringify(ur(r));return h.useMemo(()=>cr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Ao(e,t,r,n,a){J(st(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(Re),{matches:i}=h.useContext(be),s=i[i.length-1],l=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",f=s&&s.route;{let P=f&&f.path||"";kn(u,!f||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${P}">) 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 <Route path="${P}"> to <Route path="${P==="/"?"*":`${P}/*`}">.`)}let p=Le(),g;g=p;let R=g.pathname||"/",M=R;if(c!=="/"){let P=c.replace(/^\//,"").split("/");M="/"+R.replace(/^\//,"").split("/").slice(P.length).join("/")}let w=Me(e,{pathname:M});return oe(f||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oe(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Fo(w&&w.map(P=>Object.assign({},P,{params:Object.assign({},l,P.params),pathname:Ce([c,o.encodeLocation?o.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?c:Ce([c,o.encodeLocation?o.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),i,r,n,a)}function ko(){let e=gr(),t=Be(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,i)}var No=h.createElement(ko,null),$o=class extends h.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){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?h.createElement(be.Provider,{value:this.props.routeContext},h.createElement(pr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Io({routeContext:e,match:t,children:r}){let n=h.useContext(We);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(be.Provider,{value:e},r)}function Fo(e,t=[],r=null,n=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 o=e,i=r==null?void 0:r.errors;if(i!=null){let u=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);J(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let s=!1,l=-1;if(r)for(let u=0;u<o.length;u++){let c=o[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:f,errors:p}=r,g=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!p||p[c.route.id]===void 0);if(c.route.lazy||g){s=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,c,f)=>{let p,g=!1,R=null,M=null;r&&(p=i&&c.route.id?i[c.route.id]:void 0,R=c.route.errorElement||No,s&&(l<0&&f===0?(kn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,M=null):l===f&&(g=!0,M=c.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,f+1)),S=()=>{let P;return p?P=R:g?P=M:c.route.Component?P=h.createElement(c.route.Component,null):c.route.element?P=c.route.element:P=u,h.createElement(Io,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:r!=null},children:P})};return r&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?h.createElement($o,{location:r.location,revalidation:r.revalidation,component:R,error:p,children:S(),routeContext:{outlet:null,matches:w,isDataRoute:!0},unstable_onError:n}):S()},null)}function yr(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function jo(e){let t=h.useContext(We);return J(t,yr(e)),t}function ct(e){let t=h.useContext(Xe);return J(t,yr(e)),t}function Uo(e){let t=h.useContext(be);return J(t,yr(e)),t}function dt(e){let t=Uo(e),r=t.matches[t.matches.length-1];return J(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ho(){return dt("useRouteId")}function zo(){return ct("useNavigation").navigation}function vr(){let{matches:e,loaderData:t}=ct("useMatches");return h.useMemo(()=>e.map(r=>mn(r,t)),[e,t])}function On(){let e=ct("useLoaderData"),t=dt("useLoaderData");return e.loaderData[t]}function An(){let e=ct("useActionData"),t=dt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function gr(){var n;let e=h.useContext(pr),t=ct("useRouteError"),r=dt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Bo(){let{router:e}=jo("useNavigate"),t=dt("useNavigate"),r=h.useRef(!1);return Dn(()=>{r.current=!0}),h.useCallback(async(a,o={})=>{oe(r.current,Tn),r.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var an={};function kn(e,t,r){!t&&!an[e]&&(an[e]=!0,oe(!1,r))}var on={};function nr(e,t){!e&&!on[t]&&(on[t]=!0,console.warn(t))}function Pl(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&oe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&oe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&oe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ml=["HydrateFallback","hydrateFallbackElement"],Wo=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 Tl({router:e,flushSync:t,unstable_onError:r}){let[n,a]=h.useState(e.state),[o,i]=h.useState(),[s,l]=h.useState({isTransitioning:!1}),[u,c]=h.useState(),[f,p]=h.useState(),[g,R]=h.useState(),M=h.useRef(new Map),w=h.useCallback(b=>{a(v=>(b.errors&&r&&Object.entries(b.errors).forEach(([L,U])=>{var j;((j=v.errors)==null?void 0:j[L])!==U&&r(U)}),b))},[r]),S=h.useCallback((b,{deletedFetchers:v,flushSync:L,viewTransitionOpts:U})=>{b.fetchers.forEach((G,re)=>{G.data!==void 0&&M.current.set(re,G.data)}),v.forEach(G=>M.current.delete(G)),nr(L===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` 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 j=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(nr(U==null||j,"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."),!U||!j){t&&L?t(()=>w(b)):h.startTransition(()=>w(b));return}if(t&&L){t(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let G=e.window.document.startViewTransition(()=>{t(()=>w(b))});G.finished.finally(()=>{t(()=>{c(void 0),p(void 0),i(void 0),l({isTransitioning:!1})})}),t(()=>p(G));return}f?(u&&u.resolve(),f.skipTransition(),R({state:b,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(i(b),l({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,t,f,u,w]);h.useLayoutEffect(()=>e.subscribe(S),[e,S]),h.useEffect(()=>{s.isTransitioning&&!s.flushSync&&c(new Wo)},[s]),h.useEffect(()=>{if(u&&o&&e.window){let b=o,v=u.promise,L=e.window.document.startViewTransition(async()=>{h.startTransition(()=>w(b)),await v});L.finished.finally(()=>{c(void 0),p(void 0),i(void 0),l({isTransitioning:!1})}),p(L)}},[o,u,e.window,w]),h.useEffect(()=>{u&&o&&n.location.key===o.location.key&&u.resolve()},[u,f,n.location,o]),h.useEffect(()=>{!s.isTransitioning&&g&&(i(g.state),l({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),R(void 0))},[s.isTransitioning,g]);let P=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:b=>e.navigate(b),push:(b,v,L)=>e.navigate(b,{state:v,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(b,v,L)=>e.navigate(b,{replace:!0,state:v,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[e]),O=e.basename||"/",k=h.useMemo(()=>({router:e,navigator:P,static:!1,basename:O,unstable_onError:r}),[e,P,O,r]);return h.createElement(h.Fragment,null,h.createElement(We.Provider,{value:k},h.createElement(Xe.Provider,{value:n},h.createElement(Mn.Provider,{value:M.current},h.createElement(mr.Provider,{value:s},h.createElement(Jo,{basename:O,location:n.location,navigationType:n.historyAction,navigator:P},h.createElement(Yo,{routes:e.routes,future:e.future,state:n,unstable_onError:r})))))),null)}var Yo=h.memo(Vo);function Vo({routes:e,future:t,state:r,unstable_onError:n}){return Ao(e,void 0,r,n,t)}function Dl(e){return Oo(e.context)}function Jo({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1}){J(!st(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:i,navigator:a,static:o,future:{}}),[i,a,o]);typeof r=="string"&&(r=Ne(r));let{pathname:l="/",search:u="",hash:c="",state:f=null,key:p="default"}=r,g=h.useMemo(()=>{let R=we(l,i);return R==null?null:{location:{pathname:R,search:u,hash:c,state:f,key:p},navigationType:n}},[i,l,u,c,f,p,n]);return oe(g!=null,`<Router basename="${i}"> is not able to match the URL "${l}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(Re.Provider,{value:s},h.createElement(At.Provider,{children:t,value:g}))}function Go(){return{params:_n(),loaderData:On(),actionData:An(),matches:vr()}}function _l(e){return function(){const r=Go();return h.createElement(e,r)}}function Xo(){return{params:_n(),loaderData:On(),actionData:An(),error:gr()}}function Ol(e){return function(){const r=Xo();return h.createElement(e,r)}}var Lt="get",Pt="application/x-www-form-urlencoded";function kt(e){return e!=null&&typeof e.tagName=="string"}function Ko(e){return kt(e)&&e.tagName.toLowerCase()==="button"}function qo(e){return kt(e)&&e.tagName.toLowerCase()==="form"}function Qo(e){return kt(e)&&e.tagName.toLowerCase()==="input"}function Zo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ei(e,t){return e.button===0&&(!t||t==="_self")&&!Zo(e)}var Et=null;function ti(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var ri=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gt(e){return e!=null&&!ri.has(e)?(oe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function ni(e,t){let r,n,a,o,i;if(qo(e)){let s=e.getAttribute("action");n=s?we(s,t):null,r=e.getAttribute("method")||Lt,a=Gt(e.getAttribute("enctype"))||Pt,o=new FormData(e)}else if(Ko(e)||Qo(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?we(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Lt,a=Gt(e.getAttribute("formenctype"))||Gt(s.getAttribute("enctype"))||Pt,o=new FormData(s,e),!ti()){let{name:u,type:c,value:f}=e;if(c==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,f)}}else{if(kt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Lt,n=null,a=Pt,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var ai=-1,oi=-2,ii=-3,li=-4,si=-5,ui=-6,ci=-7,di="B",fi="D",Nn="E",hi="M",mi="N",$n="P",pi="R",yi="S",vi="Y",gi="U",wi="Z",In=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Ei(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
`);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Xt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function ar(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return ln.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,ln.call(this,n)}function ln(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,l=>{o=l}]];let s=[];for(;i.length>0;){const[l,u]=i.pop();switch(l){case ci:u(void 0);continue;case si:u(null);continue;case oi:u(NaN);continue;case ui:u(1/0);continue;case ii:u(-1/0);continue;case li:u(-0);continue}if(t[l]){u(t[l]);continue}const c=r[l];if(!c||typeof c!="object"){t[l]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[f,p,g]=c;switch(f){case fi:u(t[l]=new Date(p));continue;case gi:u(t[l]=new URL(p));continue;case di:u(t[l]=BigInt(p));continue;case pi:u(t[l]=new RegExp(p,g));continue;case vi:u(t[l]=Symbol.for(p));continue;case yi:const R=new Set;t[l]=R;for(let k=c.length-1;k>0;k--)i.push([c[k],b=>{R.add(b)}]);u(R);continue;case hi:const M=new Map;t[l]=M;for(let k=c.length-2;k>0;k-=2){const b=[];i.push([c[k+1],v=>{b[1]=v}]),i.push([c[k],v=>{b[0]=v}]),s.push(()=>{M.set(b[0],b[1])})}u(M);continue;case mi:const w=Object.create(null);t[l]=w;for(const k of Object.keys(p).reverse()){const b=[];i.push([p[k],v=>{b[1]=v}]),i.push([Number(k.slice(1)),v=>{b[0]=v}]),s.push(()=>{w[b[0]]=b[1]})}u(w);continue;case $n:if(t[p])u(t[l]=t[p]);else{const k=new In;n[p]=k,u(t[l]=k.promise)}continue;case Nn:const[,S,P]=c;let O=P&&Xt&&Xt[P]?new Xt[P](S):new Error(S);t[l]=O,u(O);continue;case wi:u(t[l]=t[p]);continue;default:if(Array.isArray(a)){const k=[],b=c.slice(1);for(let v=0;v<b.length;v++){const L=b[v];i.push([L,U=>{k[v]=U}])}s.push(()=>{for(const v of a){const L=v(c[0],...k);if(L){u(t[l]=L.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const f=[];t[l]=f;for(let p=0;p<c.length;p++){const g=c[p];g!==ai&&i.push([g,R=>{f[p]=R}])}u(f);continue}else{const f={};t[l]=f;for(const p of Object.keys(c).reverse()){const g=[];i.push([c[p],R=>{g[1]=R}]),i.push([Number(p.slice(1)),R=>{g[0]=R}]),s.push(()=>{f[g[0]]=g[1]})}u(f);continue}}for(;s.length>0;)s.pop()();return o}async function Ri(e,t){const{plugins:r}=t??{},n=new In,a=e.pipeThrough(Ei()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await bi.call(o,a);let s=n.promise;return i.done?n.resolve():s=Si.call(o,a).then(n.resolve).catch(l=>{for(const u of Object.values(o.deferred))u.reject(l);n.reject(l)}),{done:s.then(()=>a.closed),value:i.value}}async function bi(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:ar.call(this,r)}}async function Si(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case $n:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=ar.call(this,s);o.resolve(l);break}case Nn:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=ar.call(this,s);o.reject(l);break}default:throw new SyntaxError}t=await e.read()}}async function xi(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var Ci={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Li=/[&><\u2028\u2029]/g;function Pi(e){return e.replace(Li,t=>Ci[t])}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var or=Symbol("SingleFetchRedirect"),Fn=class extends Error{},Mi=202,Ti=new Set([100,101,204,205]);function Al(e,t,r,n,a){let o=Di(e,i=>{let s=t.routes[i.route.id];ye(s,"Route not found in manifest");let l=r[i.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(l!=null&&l.shouldRevalidate)}},Ii,n,a);return async i=>i.runClientMiddleware(o)}function Di(e,t,r,n,a,o=()=>!0){return async i=>{let{request:s,matches:l,fetcherKey:u}=i,c=e();if(s.method!=="GET")return _i(i,r,a);let f=l.some(p=>{let{hasLoader:g,hasClientLoader:R}=t(p);return p.unstable_shouldCallHandler()&&g&&!R});return!n&&!f?Oi(i,t,r,a):u?Ni(i,r,a):Ai(i,c,t,r,n,a,o)}}async function _i(e,t,r){let n=e.matches.find(i=>i.unstable_shouldCallHandler());ye(n,"No action match found");let a,o=await n.resolve(async i=>await i(async()=>{let{data:l,status:u}=await t(e,r,[n.route.id]);return a=u,lt(l,n.route.id)}));return fr(o.result)||Be(o.result)||rr(o.result)?{[n.route.id]:o}:{[n.route.id]:{type:o.type,result:Va(o.result,a)}}}async function Oi(e,t,r,n){let a=e.matches.filter(i=>i.unstable_shouldCallHandler()),o={};return await Promise.all(a.map(i=>i.resolve(async s=>{try{let{hasClientLoader:l}=t(i),u=i.route.id,c=l?await s(async()=>{let{data:f}=await r(e,n,[u]);return lt(f,u)}):await s();o[i.route.id]={type:"data",result:c}}catch(l){o[i.route.id]={type:"error",result:l}}}))),o}async function Ai(e,t,r,n,a,o,i=()=>!0){let s=new Set,l=!1,u=e.matches.map(()=>sn()),c=sn(),f={},p=Promise.all(e.matches.map(async(R,M)=>R.resolve(async w=>{u[M].resolve();let S=R.route.id,{hasLoader:P,hasClientLoader:O,hasShouldRevalidate:k}=r(R),b=!R.unstable_shouldRevalidateArgs||R.unstable_shouldRevalidateArgs.actionStatus==null||R.unstable_shouldRevalidateArgs.actionStatus<400;if(!R.unstable_shouldCallHandler(b)){l||(l=R.unstable_shouldRevalidateArgs!=null&&P&&k===!0);return}if(i(R)&&O){P&&(l=!0);try{let L=await w(async()=>{let{data:U}=await n(e,o,[S]);return lt(U,S)});f[S]={type:"data",result:L}}catch(L){f[S]={type:"error",result:L}}return}P&&s.add(S);try{let L=await w(async()=>{let U=await c.promise;return lt(U,S)});f[S]={type:"data",result:L}}catch(L){f[S]={type:"error",result:L}}})));if(await Promise.all(u.map(R=>R.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let R=a&&l&&s.size>0?[...s.keys()]:void 0;try{let M=await n(e,o,R);c.resolve(M.data)}catch(M){c.reject(M)}}return await p,await ki(c.promise,e.matches,s,f),f}async function ki(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let s of t)if(s.route.id in i.routes){let l=i.routes[s.route.id];if("error"in l){o=l.error,((a=n[s.route.id])==null?void 0:a.result)==null&&(n[s.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(s=>{n[s].result instanceof Fn&&(n[s].result=o)})}catch{}}async function Ni(e,t,r){let n=e.matches.find(i=>i.unstable_shouldCallHandler());ye(n,"No fetcher match found");let a=n.route.id,o=await n.resolve(async i=>i(async()=>{let{data:s}=await t(e,r,[a]);return lt(s,a)}));return{[n.route.id]:o}}function $i(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function jn(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&we(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function Ii(e,t,r){let{request:n}=e,a=jn(n.url,t,"data");n.method==="GET"&&(a=$i(a),r&&a.searchParams.set("_routes",r.join(",")));let o=await fetch(a,await xi(n));if(o.status===404&&!o.headers.has("X-Remix-Response"))throw new ze(404,"Not Found",!0);if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:Mi,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Ti.has(o.status)){let i={};return r&&n.method!=="GET"&&(i[r[0]]={data:void 0}),{status:o.status,data:{routes:i}}}ye(o.body,"No response body to decode");try{let i=await Fi(o.body,window),s;if(n.method==="GET"){let l=i.value;or in l?s={redirect:l[or]}:s={routes:l}}else{let l=i.value,u=r==null?void 0:r[0];ye(u,"No routeId found for single fetch call decoding"),"redirect"in l?s={redirect:l}:s={routes:{[u]:l}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Fi(e,t){return Ri(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,s=Error;a&&a in t&&typeof t[a]=="function"&&(s=t[a]);let l=new s(o);return l.stack=i,{value:l}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new ze(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[or]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function lt(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:s}=e.redirect;throw Ja(n,{status:s,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Fn(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function sn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function Un(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ji(e,t,r){let n=e.map(o=>{var l;let i=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(u=>({rel:"stylesheet",href:u})):[],((l=i==null?void 0:i.links)==null?void 0:l.call(i))||[]]}).flat(2),a=Er(e,r);return Wn(n,a)}function Hn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Ui(e){if(!e.css)return;let t=Hn(e);await Promise.all(t.map(Bn))}async function zn(e,t){if(!e.css&&!t.links||!Yi())return;let r=[];if(e.css&&r.push(...Hn(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!wr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(Bn))}async function Bn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function wr(e){return e!=null&&typeof e.page=="string"}function Hi(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function zi(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await Un(o,r);return i.links?i.links():[]}return[]}));return Wn(n.flat(1).filter(Hi).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function un(e,t,r,n,a,o){let i=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>{var c;return r[u].pathname!==l.pathname||((c=r[u].route.path)==null?void 0:c.endsWith("*"))&&r[u].params["*"]!==l.params["*"]};return o==="assets"?t.filter((l,u)=>i(l,u)||s(l,u)):o==="data"?t.filter((l,u)=>{var f;let c=n.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(i(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let p=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Er(e,t,{includeHydrateFallback:r}={}){return Bi(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Bi(e){return[...new Set(e)]}function Wi(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Wn(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!wr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let s=JSON.stringify(Wi(o));return r.has(s)||(r.add(s),a.push({key:s,link:o})),a},[])}var Rt;function Yi(){if(Rt!==void 0)return Rt;let e=document.createElement("link");return Rt=e.relList.supports("preload"),e=null,Rt}function Vi(){return h.createElement(ir,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:`
              console.log(
                "💿 Hey developer 👋. You can provide a way better UX than this " +
                "when your app is loading JS modules and/or running \`clientLoader\` " +
                "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
                "for more information."
              );
            `}}))}function Yn(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Ji(e,t,r){let n=Vn(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Vi:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(Xn,{error:gr()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function kl(e,t,r,n,a,o){return Rr(t,r,n,a,o,"",Yn(t),e)}function bt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new ze(400,"Bad Request",new Error(n),!0)}}function Kt(e,t){let r=e==="clientAction"?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new ze(405,"Method Not Allowed",new Error(n),!0)}function Rr(e,t,r,n,a,o="",i=Yn(e),s){return(i[o]||[]).map(l=>{var P,O,k;let u=t[l.id];function c(b){return ye(typeof b=="function","No single fetch function available for route handler"),b()}function f(b){return l.hasLoader?c(b):Promise.resolve(null)}function p(b){if(!l.hasAction)throw Kt("action",l.id);return c(b)}function g(b){import(b)}function R(b){b.clientActionModule&&g(b.clientActionModule),b.clientLoaderModule&&g(b.clientLoaderModule)}async function M(b){let v=t[l.id],L=v?zn(l,v):Promise.resolve();try{return b()}finally{await L}}let w={id:l.id,index:l.index,path:l.path};if(u){Object.assign(w,{...w,...Ji(l,u,a),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:cn(w.path,u,l,n,s)});let b=r&&r.loaderData&&l.id in r.loaderData,v=b?(P=r==null?void 0:r.loaderData)==null?void 0:P[l.id]:void 0,L=r&&r.errors&&l.id in r.errors,U=L?(O=r==null?void 0:r.errors)==null?void 0:O[l.id]:void 0,j=s==null&&(((k=u.clientLoader)==null?void 0:k.hydrate)===!0||!l.hasLoader);w.loader=async({request:G,params:re,context:ue},le)=>{try{return await M(async()=>(ye(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:G,params:re,context:ue,async serverLoader(){if(bt("loader",l),j){if(b)return v;if(L)throw U}return f(le)}}):f(le)))}finally{j=!1}},w.loader.hydrate=Ki(l.id,u.clientLoader,l.hasLoader,a),w.action=({request:G,params:re,context:ue},le)=>M(async()=>{if(ye(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw Kt("clientAction",l.id);return p(le)}return u.clientAction({request:G,params:re,context:ue,async serverAction(){return bt("action",l),p(le)}})})}else{l.hasClientLoader||(w.loader=(L,U)=>M(()=>f(U))),l.hasClientAction||(w.action=(L,U)=>M(()=>{if(a)throw Kt("clientAction",l.id);return p(U)}));let b;async function v(){return b?await b:(b=(async()=>{(l.clientLoaderModule||l.clientActionModule)&&await new Promise(U=>setTimeout(U,0));let L=Xi(l,t);return R(l),await L})(),await b)}w.lazy={loader:l.hasClientLoader?async()=>{let{clientLoader:L}=l.clientLoaderModule?await import(l.clientLoaderModule):await v();return ye(L,"No `clientLoader` export found"),(U,j)=>L({...U,async serverLoader(){return bt("loader",l),f(j)}})}:void 0,action:l.hasClientAction?async()=>{let L=l.clientActionModule?import(l.clientActionModule):v();R(l);let{clientAction:U}=await L;return ye(U,"No `clientAction` export found"),(j,G)=>U({...j,async serverAction(){return bt("action",l),p(G)}})}:void 0,middleware:l.hasClientMiddleware?async()=>{let{clientMiddleware:L}=l.clientMiddlewareModule?await import(l.clientMiddlewareModule):await v();return ye(L,"No `clientMiddleware` export found"),L}:void 0,shouldRevalidate:async()=>{let L=await v();return cn(w.path,L,l,n,s)},handle:async()=>(await v()).handle,Component:async()=>(await v()).Component,ErrorBoundary:l.hasErrorBoundary?async()=>(await v()).ErrorBoundary:void 0}}let S=Rr(e,t,r,n,a,l.id,i,s);return S.length>0&&(w.children=S),w})}function cn(e,t,r,n,a){if(a)return Gi(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?vn(e)[1].map(s=>s.paramName):[];const i=s=>o.some(l=>s.currentParams[l]!==s.nextParams[l]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return l=>s({...l,defaultShouldRevalidate:i(l)})}else return s=>i(s)}if(n&&t.shouldRevalidate){let o=t.shouldRevalidate;return i=>o({...i,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function Gi(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function Xi(e,t){let r=Un(e,t),n=Ui(e),a=await r;return await Promise.all([n,zn(e,a)]),{Component:Vn(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function Vn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Ki(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Mt=new Set,qi=1e3,_t=new Set,Qi=7680;function br(e,t){return e.mode==="lazy"&&t===!0}function Zi({sri:e,...t},r){let n=new Set(r.state.matches.map(s=>s.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(s=>{let l=Me(r.routes,s,r.basename);l&&l.forEach(u=>n.add(u.route.id))});let i=[...n].reduce((s,l)=>Object.assign(s,{[l]:t.routes[l]}),{});return{...t,routes:i,sri:e?!0:void 0}}function Nl(e,t,r,n,a,o){if(br(n,r))return async({path:i,patch:s,signal:l,fetcherKey:u})=>{_t.has(i)||await Jn([i],u?window.location.href:i,e,t,r,a,o,n.manifestPath,s,l)}}function $l(e,t,r,n,a,o){h.useEffect(()=>{var c,f;if(!br(a,n)||((f=(c=window.navigator)==null?void 0:c.connection)==null?void 0:f.saveData)===!0)return;function i(p){let g=p.tagName==="FORM"?p.getAttribute("action"):p.getAttribute("href");if(!g)return;let R=p.tagName==="A"?p.pathname:new URL(g,window.location.origin).pathname;_t.has(R)||Mt.add(R)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let p=Array.from(Mt.keys()).filter(g=>_t.has(g)?(Mt.delete(g),!1):!0);if(p.length!==0)try{await Jn(p,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let l=rl(s,100);s();let u=new MutationObserver(()=>l());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[n,o,t,r,e,a])}function el(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var qt="react-router-manifest-version";async function Jn(e,t,r,n,a,o,i,s,l,u){const c=new URLSearchParams;e.sort().forEach(w=>c.append("p",w)),c.set("version",r.version);let f=new URL(el(s,i),window.location.origin);if(f.search=c.toString(),f.toString().length>Qi){Mt.clear();return}let p;try{let w=await fetch(f,{signal:u});if(w.ok){if(w.status===204&&w.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}if(sessionStorage.getItem(qt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(qt,r.version),window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(w.status>=400)throw new Error(await w.text())}else throw new Error(`${w.status} ${w.statusText}`);sessionStorage.removeItem(qt),p=await w.json()}catch(w){if(u!=null&&u.aborted)return;throw w}let g=new Set(Object.keys(r.routes)),R=Object.values(p).reduce((w,S)=>(S&&!g.has(S.id)&&(w[S.id]=S),w),{});Object.assign(r.routes,R),e.forEach(w=>tl(w,_t));let M=new Set;Object.values(R).forEach(w=>{w&&(!w.parentId||!R[w.parentId])&&M.add(w.parentId)}),M.forEach(w=>l(w||null,Rr(R,n,null,a,o,w)))}function tl(e,t){if(t.size>=qi){let r=t.values().next().value;t.delete(r)}t.add(e)}function rl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Sr(){let e=h.useContext(We);return ye(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Nt(){let e=h.useContext(Xe);return ye(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $t=h.createContext(void 0);$t.displayName="FrameworkContext";function Ke(){let e=h.useContext($t);return ye(e,"You must render this element inside a <HydratedRouter> element"),e}function nl(e,t){let r=h.useContext($t),[n,a]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:f}=t,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let M=S=>{S.forEach(P=>{i(P.isIntersecting)})},w=new IntersectionObserver(M,{threshold:.5});return p.current&&w.observe(p.current),()=>{w.disconnect()}}},[e]),h.useEffect(()=>{if(n){let M=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(M)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:nt(s,g),onBlur:nt(l,R),onMouseEnter:nt(u,g),onMouseLeave:nt(c,R),onTouchStart:nt(f,g)}]:[!1,p,{}]}function nt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function xr(e,t,r){if(r&&!Ot)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var dn="data-react-router-critical-css";function Il({nonce:e}){let{isSpaMode:t,manifest:r,routeModules:n,criticalCss:a}=Ke(),{errors:o,matches:i}=Nt(),s=xr(i,o,t),l=h.useMemo(()=>ji(s,n,r),[s,n,r]);return h.createElement(h.Fragment,null,typeof a=="string"?h.createElement("style",{[dn]:"",dangerouslySetInnerHTML:{__html:a}}):null,typeof a=="object"?h.createElement("link",{[dn]:"",rel:"stylesheet",href:a.href,nonce:e}):null,l.map(({key:u,link:c})=>wr(c)?h.createElement(Gn,{key:u,nonce:e,...c}):h.createElement("link",{key:u,nonce:e,...c})))}function Gn({page:e,...t}){let{router:r}=Sr(),n=h.useMemo(()=>Me(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?h.createElement(ol,{page:e,matches:n,...t}):null}function al(e){let{manifest:t,routeModules:r}=Ke(),[n,a]=h.useState([]);return h.useEffect(()=>{let o=!1;return zi(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function ol({page:e,matches:t,...r}){let n=Le(),{manifest:a,routeModules:o}=Ke(),{basename:i}=Sr(),{loaderData:s,matches:l}=Nt(),u=h.useMemo(()=>un(e,t,l,a,n,"data"),[e,t,l,a,n]),c=h.useMemo(()=>un(e,t,l,a,n,"assets"),[e,t,l,a,n]),f=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let R=new Set,M=!1;if(t.forEach(S=>{var O;let P=a.routes[S.route.id];!P||!P.hasLoader||(!u.some(k=>k.route.id===S.route.id)&&S.route.id in s&&((O=o[S.route.id])!=null&&O.shouldRevalidate)||P.hasClientLoader?M=!0:R.add(S.route.id))}),R.size===0)return[];let w=jn(e,i,"data");return M&&R.size>0&&w.searchParams.set("_routes",t.filter(S=>R.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[i,s,n,a,u,t,e,o]),p=h.useMemo(()=>Er(c,a),[c,a]),g=al(c);return h.createElement(h.Fragment,null,f.map(R=>h.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...r})),p.map(R=>h.createElement("link",{key:R,rel:"modulepreload",href:R,...r})),g.map(({key:R,link:M})=>h.createElement("link",{key:R,nonce:r.nonce,...M})))}function Fl(){let{isSpaMode:e,routeModules:t}=Ke(),{errors:r,matches:n,loaderData:a}=Nt(),o=Le(),i=xr(n,r,e),s=null;r&&(s=r[i[i.length-1].route.id]);let l=[],u=null,c=[];for(let f=0;f<i.length;f++){let p=i[f],g=p.route.id,R=a[g],M=p.params,w=t[g],S=[],P={id:g,data:R,loaderData:R,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:s};if(c[f]=P,w!=null&&w.meta?S=typeof w.meta=="function"?w.meta({data:R,loaderData:R,params:M,location:o,matches:c,error:s}):Array.isArray(w.meta)?[...w.meta]:w.meta:u&&(S=[...u]),S=S||[],!Array.isArray(S))throw new Error("The route at "+p.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.

To reference the meta function API, see https://remix.run/route/meta`);P.meta=S,c[f]=P,l=[...S],u=l}return h.createElement(h.Fragment,null,l.flat().map(f=>{if(!f)return null;if("tagName"in f){let{tagName:p,...g}=f;if(!il(p))return console.warn(`A meta object uses an invalid tagName: ${p}. Expected either 'link' or 'meta'`),null;let R=p;return h.createElement(R,{key:JSON.stringify(g),...g})}if("title"in f)return h.createElement("title",{key:"title"},String(f.title));if("charset"in f&&(f.charSet??(f.charSet=f.charset),delete f.charset),"charSet"in f&&f.charSet!=null)return typeof f.charSet=="string"?h.createElement("meta",{key:"charSet",charSet:f.charSet}):null;if("script:ld+json"in f)try{let p=JSON.stringify(f["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:Pi(p)}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(f),...f})}))}function il(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Ot=!1;function ll(){Ot=!0}function sl(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=Ke(),{router:s,static:l,staticContext:u}=Sr(),{matches:c}=Nt(),f=Lo(),p=br(o,i);a&&(a.didRenderScripts=!0);let g=xr(c,null,n);h.useEffect(()=>{ll()},[]);let R=h.useMemo(()=>{var k;if(f)return null;let P=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",O=l?`${(k=t.hmr)!=null&&k.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};
${g.map((b,v)=>{let L=`route${v}`,U=t.routes[b.route.id];ye(U,`Route ${b.route.id} not found in manifest`);let{clientActionModule:j,clientLoaderModule:G,clientMiddlewareModule:re,hydrateFallbackModule:ue,module:le}=U,X=[...j?[{module:j,varName:`${L}_clientAction`}]:[],...G?[{module:G,varName:`${L}_clientLoader`}]:[],...re?[{module:re,varName:`${L}_clientMiddleware`}]:[],...ue?[{module:ue,varName:`${L}_HydrateFallback`}]:[],{module:le,varName:`${L}_main`}];if(X.length===1)return`import * as ${L} from ${JSON.stringify(le)};`;let Q=X.map(ae=>`import * as ${ae.varName} from "${ae.module}";`).join(`
`),K=`const ${L} = {${X.map(ae=>`...${ae.varName}`).join(",")}};`;return[Q,K].join(`
`)}).join(`
`)}
  ${p?`window.__reactRouterManifest = ${JSON.stringify(Zi(t,s),null,2)};`:""}
  window.__reactRouterRouteModules = {${g.map((b,v)=>`${JSON.stringify(b.route.id)}:route${v}`).join(",")}};

import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:P},type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:O},type:"module",async:!0}))},[]),M=Ot||f?[]:ul(t.entry.imports.concat(Er(g,t,{includeHydrateFallback:!0}))),w=typeof t.sri=="object"?t.sri:{};return nr(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Ot||f?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:w})}}):null,p?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:w[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:w[t.entry.module],suppressHydrationWarning:!0}),M.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,crossOrigin:e.crossOrigin,integrity:w[S],suppressHydrationWarning:!0})),R)}function ul(e){return[...new Set(e)]}function cl(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var jl=class extends h.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?h.createElement(Xn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Xn({error:e,isOutsideRemixApp:t}){console.error(e);let r=h.createElement("script",{dangerouslySetInnerHTML:{__html:`
        console.log(
          "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
        );
      `}});if(Be(e))return h.createElement(ir,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return h.createElement(ir,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function ir({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=Ke();return(o=a.root)!=null&&o.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(sl,null):null)))}var Kn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Kn&&(window.__reactRouterVersion="7.9.0")}catch{}var qn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qn=h.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f,...p},g){let{basename:R}=h.useContext(Re),M=typeof u=="string"&&qn.test(u),w,S=!1;if(typeof u=="string"&&M&&(w=u,Kn))try{let j=new URL(window.location.href),G=u.startsWith("//")?new URL(j.protocol+u):new URL(u),re=we(G.pathname,R);G.origin===j.origin&&re!=null?u=re+G.search+G.hash:S=!0}catch{oe(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=Mo(u,{relative:a}),[O,k,b]=nl(n,p),v=pl(u,{replace:i,state:s,target:l,preventScrollReset:c,relative:a,viewTransition:f});function L(j){t&&t(j),j.defaultPrevented||v(j)}let U=h.createElement("a",{...p,...b,href:w||P,onClick:S||o?t:L,ref:cl(g,k),target:l,"data-discover":!M&&r==="render"?"true":void 0});return O&&!M?h.createElement(h.Fragment,null,U,h.createElement(Gn,{page:P})):U});Qn.displayName="Link";var dl=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:s,children:l,...u},c){let f=ut(i,{relative:u.relative}),p=Le(),g=h.useContext(Xe),{navigator:R,basename:M}=h.useContext(Re),w=g!=null&&bl(f)&&s===!0,S=R.encodeLocation?R.encodeLocation(f).pathname:f.pathname,P=p.pathname,O=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(P=P.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&M&&(O=we(O,M)||O);const k=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let b=P===S||!a&&P.startsWith(S)&&P.charAt(k)==="/",v=O!=null&&(O===S||!a&&O.startsWith(S)&&O.charAt(S.length)==="/"),L={isActive:b,isPending:v,isTransitioning:w},U=b?t:void 0,j;typeof n=="function"?j=n(L):j=[n,b?"active":null,v?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let G=typeof o=="function"?o(L):o;return h.createElement(Qn,{...u,"aria-current":U,className:j,ref:c,style:G,to:i,viewTransition:s},typeof l=="function"?l(L):l)});dl.displayName="NavLink";var fl=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Lt,action:s,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:f,...p},g)=>{let R=gl(),M=wl(s,{relative:u}),w=i.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&qn.test(s),P=O=>{if(l&&l(O),O.defaultPrevented)return;O.preventDefault();let k=O.nativeEvent.submitter,b=(k==null?void 0:k.getAttribute("formmethod"))||i;R(k||O.currentTarget,{fetcherKey:t,method:b,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,viewTransition:f})};return h.createElement("form",{ref:g,method:w,action:M,onSubmit:n?l:P,...p,"data-discover":!S&&e==="render"?"true":void 0})});fl.displayName="Form";function hl({getKey:e,storageKey:t,...r}){let n=h.useContext($t),{basename:a}=h.useContext(Re),o=Le(),i=vr();El({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!n||!e)return null;let u=sr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,c)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(t||lr)}, ${JSON.stringify(s)})`}})}hl.displayName="ScrollRestoration";function Zn(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cr(e){let t=h.useContext(We);return J(t,Zn(e)),t}function ml(e){let t=h.useContext(Xe);return J(t,Zn(e)),t}function pl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i}={}){let s=To(),l=Le(),u=ut(e,{relative:o});return h.useCallback(c=>{if(ei(c,t)){c.preventDefault();let f=r!==void 0?r:ke(l)===ke(u);s(e,{replace:f,state:n,preventScrollReset:a,relative:o,viewTransition:i})}},[l,s,u,r,n,t,e,a,o,i])}var yl=0,vl=()=>`__${String(++yl)}__`;function gl(){let{router:e}=Cr("useSubmit"),{basename:t}=h.useContext(Re),r=Ho();return h.useCallback(async(n,a={})=>{let{action:o,method:i,encType:s,formData:l,body:u}=ni(n,t);if(a.navigate===!1){let c=a.fetcherKey||vl();await e.fetch(c,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function wl(e,{relative:t}={}){let{basename:r}=h.useContext(Re),n=h.useContext(be);J(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ut(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),l=s.getAll("index");if(l.some(c=>c==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let c=s.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),ke(o)}var lr="react-router-scroll-positions",St={};function sr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:we(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function El({getKey:e,storageKey:t}={}){let{router:r}=Cr("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ml("useScrollRestoration"),{basename:o}=h.useContext(Re),i=Le(),s=vr(),l=zo();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Rl(h.useCallback(()=>{if(l.state==="idle"){let u=sr(i,s,o,e);St[u]=window.scrollY}try{sessionStorage.setItem(t||lr,JSON.stringify(St))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,o,i,s,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||lr);u&&(St=JSON.parse(u))}catch{}},[t]),h.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(St,()=>window.scrollY,e?(c,f)=>sr(c,f,o,e):void 0);return()=>u&&u()},[r,o,e]),h.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function Rl(e,t){let{capture:r}={};h.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function bl(e,{relative:t}={}){let r=h.useContext(mr);J(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Cr("useViewTransitionState"),a=ut(e,{relative:t});if(!r.isTransitioning)return!1;let o=we(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=we(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Tt(a.pathname,i)!=null||Tt(a.pathname,o)!=null}export{ze as E,$t as F,Il as L,Fl as M,Ti as N,Dl as O,xl as R,hl as S,h as a,J as b,jl as c,Tl as d,Fi as e,Rr as f,Ll as g,Nl as h,Be as i,Al as j,Cl as k,kl as l,Me as m,Pl as n,Ml as o,Sl as p,Ol as q,ga as r,Ki as s,sl as t,$l as u,On as v,_l as w,dl as x,Qn as y,ma as z};
