(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Id(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iu={exports:{}},Ho={},lu={exports:{}},M={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $r=Symbol.for("react.element"),Od=Symbol.for("react.portal"),Dd=Symbol.for("react.fragment"),Ud=Symbol.for("react.strict_mode"),Bd=Symbol.for("react.profiler"),Ad=Symbol.for("react.provider"),Hd=Symbol.for("react.context"),Vd=Symbol.for("react.forward_ref"),Wd=Symbol.for("react.suspense"),Qd=Symbol.for("react.memo"),Kd=Symbol.for("react.lazy"),Ts=Symbol.iterator;function Gd(e){return e===null||typeof e!="object"?null:(e=Ts&&e[Ts]||e["@@iterator"],typeof e=="function"?e:null)}var su={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},au=Object.assign,uu={};function Dn(e,t,n){this.props=e,this.context=t,this.refs=uu,this.updater=n||su}Dn.prototype.isReactComponent={};Dn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cu(){}cu.prototype=Dn.prototype;function Dl(e,t,n){this.props=e,this.context=t,this.refs=uu,this.updater=n||su}var Ul=Dl.prototype=new cu;Ul.constructor=Dl;au(Ul,Dn.prototype);Ul.isPureReactComponent=!0;var Is=Array.isArray,du=Object.prototype.hasOwnProperty,Bl={current:null},fu={key:!0,ref:!0,__self:!0,__source:!0};function pu(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)du.call(t,r)&&!fu.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1(e.preventDefault(),e.returnValue=""),of=()=>{removeEventListener(vu,gu,{capture:!0})};function yu(e){let t=e.getLocation();const n=new Set;let r=[];const o=()=>{t=e.getLocation(),n.forEach(l=>l())},i=async(l,s)=>{var a;if(!((s==null?void 0:s.ignoreBlocker)??!1)&&typeof document<"u"&&r.length){for(const f of r)if(!await f()){(a=e.onBlocked)==null||a.call(e,o);return}}l()};return{get location(){return t},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,s,a)=>{s=bn(s),i(()=>{e.pushState(l,s),o()},a)},replace:(l,s,a)=>{s=bn(s),i(()=>{e.replaceState(l,s),o()},a)},go:(l,s)=>{i(()=>{e.go(l),o()},s)},back:l=>{i(()=>{e.back(),o()},l)},forward:l=>{i(()=>{e.forward(),o()},l)},createHref:l=>e.createHref(l),block:l=>(r.push(l),r.length===1&&addEventListener(vu,gu,{capture:!0}),()=>{r=r.filter(s=>s!==l),r.length||of()}),flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function bn(e){return e||(e={}),{...e,key:xu()}}function lf(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState,o=x=>x,i=()=>Ai(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);let l=i(),s;const a=()=>l;let u,f;const d=()=>{if(!u)return;(u.isPush?n:r).call(t.history,u.state,"",u.href),u=void 0,f=void 0,s=void 0},p=(x,k,m)=>{const h=o(k);f||(s=l),l=Ai(k,m),u={href:h,state:m,isPush:(u==null?void 0:u.isPush)||x==="push"},f||(f=Promise.resolve().then(()=>d()))},g=()=>{l=i(),y.notify()},y=yu({getLocation:a,pushState:(x,k)=>p("push",x,k),replaceState:(x,k)=>p("replace",x,k),back:()=>t.history.back(),forward:()=>t.history.forward(),go:x=>t.history.go(x),createHref:x=>o(x),flush:d,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ds,g),t.removeEventListener(Us,g)},onBlocked:x=>{s&&l!==s&&(l=s,x())}});return t.addEventListener(Ds,g),t.addEventListener(Us,g),t.history.pushState=function(...x){const k=n.apply(t.history,x);return g(),k},t.history.replaceState=function(...x){const k=r.apply(t.history,x);return g(),k},y}function sf(e={initialEntries:["/"]}){const t=e.initialEntries;let n=e.initialIndex??t.length-1,r={key:xu()};return yu({getLocation:()=>Ai(t[n],r),pushState:(i,l)=>{r=l,t.splice,n{r=l,t[n]=i},back:()=>{r=bn(r),n=Math.max(n-1,0)},forward:()=>{r=bn(r),n=Math.min(n+1,t.length-1)},go:i=>{r=bn(r),n=Math.min(Math.max(n+i,0),t.length-1)},createHref:i=>i})}function Ai(e,t){const n=e.indexOf("#"),r=e.indexOf("?");return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{}}}function xu(){return(Math.random()+1).toString(36).substring(7)}var af="Invariant failed";function Se(e,t){if(!e)throw new Error(af)}const di=O.createContext(null);function wu(){return typeof document>"u"?di:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=di,di)}function Tt(e){const t=O.useContext(wu());return e==null||e.warn,t}var Su={exports:{}},ku={},Cu={exports:{}},Eu={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Pn=O;function uf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cf=typeof Object.is=="function"?Object.is:uf,df=Pn.useState,ff=Pn.useEffect,pf=Pn.useLayoutEffect,hf=Pn.useDebugValue;function mf(e,t){var n=t(),r=df({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return pf(function(){o.value=n,o.getSnapshot=t,fi(o)&&i({inst:o})},[e,n,t]),ff(function(){return fi(o)&&i({inst:o}),e(function(){fi(o)&&i({inst:o})})},[e]),hf(n),n}function fi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cf(e,n)}catch{return!0}}function vf(e,t){return t()}var gf=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?vf:mf;Eu.useSyncExternalStore=Pn.useSyncExternalStore!==void 0?Pn.useSyncExternalStore:gf;Cu.exports=Eu;var yf=Cu.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Vo=O,xf=yf;function wf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sf=typeof Object.is=="function"?Object.is:wf,kf=xf.useSyncExternalStore,Cf=Vo.useRef,Ef=Vo.useEffect,_f=Vo.useMemo,jf=Vo.useDebugValue;ku.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Cf(null);if(i.current===null){var l={hasValue:!1,value:null};i.current=l}else l=i.current;i=_f(function(){function a(g){if(!u){if(u=!0,f=g,g=r(g),o!==void 0&&l.hasValue){var y=l.value;if(o(y,g))return d=y}return d=g}if(y=d,Sf(f,g))return y;var x=r(g);return o!==void 0&&o(y,x)?y:(f=g,d=x)}var u=!1,f,d,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,o]);var s=kf(e,i[0],i[1]);return Ef(function(){l.hasValue=!0,l.value=s},[s]),jf(s),s};Su.exports=ku;var Pf=Su.exports;class $f{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var o,i;this.listeners.add(r);const l=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,r,this);return()=>{this.listeners.delete(r),l==null||l()}},this.setState=r=>{var o,i,l;const s=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(s)(r):r(s),(l=(i=this.options)==null?void 0:i.onUpdate)==null||l.call(i),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(o=>{this._flushing===r&&o()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function Rf(e,t=n=>n){return Pf.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,Lf)}function Lf(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{t.substring(0,1)==="?"&&(t=t.substring(1));const n=Nf(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function If(e,t){function n(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(typeof r=="string"&&typeof t=="function")try{return t(r),e(r)}catch{}return r}return r=>{r={...r},Object.keys(r).forEach(i=>{const l=r[i];typeof l>"u"||l===void 0?delete r[i]:r[i]=n(l)});const o=zf(r).toString();return o?`?${o}`:""}}function mo(e){return e[e.length-1]}function Of(e){return typeof e=="function"}function Tr(e,t){return Of(e)?e(t):e}function er(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Je(e,t){if(e===t)return e;const n=t,r=Hs(e)&&Hs(n);if(r||vo(e)&&vo(n)){const o=r?e:Object.keys(e),i=o.length,l=r?n:Object.keys(n),s=l.length,a=r?[]:{};let u=0;for(let f=0;f"u")return!0;const n=t.prototype;return!(!As(n)||!n.hasOwnProperty("isPrototypeOf"))}function As(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tr(e,t,n=!1){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(vo(e)&&vo(t)){const r=Object.keys(e).filter(i=>e[i]!==void 0),o=Object.keys(t).filter(i=>t[i]!==void 0);return!n&&r.length!==o.length?!1:!o.some(i=>!(i in e)||!tr(e[i],t[i],n))}return Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:!e.some((r,o)=>!tr(r,t[o],n)):!1}const pi=typeof window<"u"?O.useLayoutEffect:O.useEffect;function sn(e){let t,n;const r=new Promise((o,i)=>{t=o,n=i});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e==null||e(o)},r.reject=o=>{r.status="rejected",n(o)},r}function Vs(e){const t=O.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Et(e){return Wo(e.filter(Boolean).join("/"))}function Wo(e){return e.replace(/\/{2,}/g,"/")}function Hl(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Wt(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Hi(e){return Wt(Hl(e))}function Df({basepath:e,base:t,to:n,trailingSlash:r="never"}){var o,i;t=t.replace(new RegExp(`^${e}`),"/"),n=n.replace(new RegExp(`^${e}`),"/");let l=$n(t);const s=$n(n);l.length>1&&((o=mo(l))==null?void 0:o.value)==="/"&&l.pop(),s.forEach((u,f)=>{u.value==="/"?f?f===s.length-1&&l.push(u):l=[u]:u.value===".."?l.pop():u.value==="."||l.push(u)}),l.length>1&&(((i=mo(l))==null?void 0:i.value)==="/"?r==="never"&&l.pop():r==="always"&&l.push({type:"pathname",value:"/"}));const a=Et([e,...l.map(u=>u.value)]);return Wo(a)}function $n(e){if(!e)return[];e=Wo(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>r==="$"||r==="*"?{type:"wildcard",value:r}:r.charAt(0)==="$"?{type:"param",value:r}:{type:"pathname",value:decodeURIComponent(r)})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function hi({path:e,params:t,leaveWildcards:n,leaveParams:r}){const o=$n(e),i={};for(const[l,s]of Object.entries(t)){const a=typeof s=="string";["*","_splat"].includes(l)?i[l]=a?encodeURI(s):s:i[l]=a?encodeURIComponent(s):s}return Et(o.map(l=>{if(l.type==="wildcard"){const s=i._splat;return n?`${l.value}${s??""}`:s}if(l.type==="param"){if(r){const s=i[l.value];return`${l.value}${s??""}`}return i[l.value.substring(1)]??"undefined"}return l.value}))}function Ir(e,t,n){const r=Uf(e,t,n);if(!(n.to&&!r))return r??{}}function Ws(e,t){switch(!0){case e==="/":return t;case t===e:return"";case t.length{for(let a=0;a=o.length-1,p=a>=i.length-1;if(f){if(f.type==="wildcard"){if(u!=null&&u.value){const g=decodeURI(Et(o.slice(a).map(y=>y.value)));return l["*"]=g,l._splat=g,!0}return!1}if(f.type==="pathname"){if(f.value==="/"&&!(u!=null&&u.value))return!0;if(u){if(n.caseSensitive){if(f.value!==u.value)return!1}else if(f.value.toLowerCase()!==u.value.toLowerCase())return!1}}if(!u)return!1;if(f.type==="param"){if(u.value==="/")return!1;u.value.charAt(0)!=="$"&&(l[f.value.substring(1)]=decodeURIComponent(u.value))}}if(!d&&p)return l["**"]=Et(o.slice(a+1).map(g=>g.value)),!!n.fuzzy&&(f==null?void 0:f.value)!=="/"}return!0})()?l:void 0}function Bt(e){return!!(e!=null&&e.isRedirect)}function Qs(e){return!!(e!=null&&e.isRedirect)&&e.href}function Vl(e){const t=e.errorComponent??Qo;return c.jsx(Bf,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?O.createElement(t,{error:n,reset:r}):e.children})}class Bf extends O.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Qo({error:e}){const[t,n]=O.useState(!1);return c.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[c.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),c.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),c.jsx("div",{style:{height:".25rem"}}),t?c.jsx("div",{children:c.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?c.jsx("code",{children:e.message}):null})}):null]})}function ye(e){const t=Tt({warn:(e==null?void 0:e.router)===void 0});return Rf(((e==null?void 0:e.router)||t).__store,e==null?void 0:e.select)}function be(e){return!!(e!=null&&e.isNotFound)}function Af(e){const t=ye({select:n=>`not-found-${n.location.pathname}-${n.status}`});return c.jsx(Vl,{getResetKey:()=>t,onCatch:(n,r)=>{var o;if(be(n))(o=e.onCatch)==null||o.call(e,n,r);else throw n},errorComponent:({error:n})=>{var r;return(r=e.fallback)==null?void 0:r.call(e,n)},children:e.children})}function Hf(){return c.jsx("p",{children:"Not Found"})}const Vf=["component","errorComponent","pendingComponent","notFoundComponent"];function Wf(e){return new Qf(e)}class Qf{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.subscribers=new Set,this.startReactTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options;this.options={...this.options,...n},this.isServer=this.options.isServer??typeof document>"u",(!this.basepath||n.basepath&&n.basepath!==r.basepath)&&(n.basepath===void 0||n.basepath===""||n.basepath==="/"?this.basepath="/":this.basepath=`/${Hi(n.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?sf({initialEntries:[this.basepath||"/"]}):lf()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new $f(Yf(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(o=>!["redirected"].includes(o.status))}}}))},this.buildRouteTree=()=>{this.routesById={},this.routesByPath={};const n=this.options.notFoundRoute;n&&(n.init({originalIndex:99999999999}),this.routesById[n.id]=n);const r=l=>{l.forEach((s,a)=>{s.init({originalIndex:a});const u=this.routesById[s.id];if(Se(!u,`Duplicate routes found with id: ${String(s.id)}`),this.routesById[s.id]=s,!s.isRoot&&s.path){const d=Wt(s.fullPath);(!this.routesByPath[d]||s.fullPath.endsWith("/"))&&(this.routesByPath[d]=s)}const f=s.children;f!=null&&f.length&&r(f)})};r([this.routeTree]);const o=[];Object.values(this.routesById).forEach((l,s)=>{var a;if(l.isRoot||!l.path)return;const u=Hl(l.fullPath),f=$n(u);for(;f.length>1&&((a=f[0])==null?void 0:a.value)==="/";)f.shift();const d=f.map(p=>p.value==="/"?.75:p.type==="param"?.5:p.type==="wildcard"?.25:1);o.push({child:l,trimmed:u,parsed:f,index:s,scores:d})}),this.flatRoutes=o.sort((l,s)=>{const a=Math.min(l.scores.length,s.scores.length);for(let u=0;us.parsed[u].value?1:-1;return l.index-s.index}).map((l,s)=>(l.child.rank=s,l.child))},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=n=>{const r=({pathname:s,search:a,hash:u,state:f})=>{const d=this.options.parseSearch(a),p=this.options.stringifySearch(d);return{pathname:s,searchStr:p,search:Je(n==null?void 0:n.search,d),hash:u.split("#").reverse()[0]??"",href:`${s}${p}${u}`,state:Je(n==null?void 0:n.state,f)}},o=r(this.history.location),{__tempLocation:i,__tempKey:l}=o.state;if(i&&(!l||l===this.tempLocationKey)){const s=r(i);return s.state.key=o.state.key,delete s.state.__tempLocation,{...s,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>Df({basepath:this.basepath,base:n,to:Wo(r),trailingSlash:this.options.trailingSlash}),this.matchRoutes=(n,r,o)=>{let i={};const l=this.flatRoutes.find(g=>{const y=Ir(this.basepath,Wt(n),{to:g.fullPath,caseSensitive:g.options.caseSensitive??this.options.caseSensitive,fuzzy:!0});return y?(i=y,!0):!1});let s=l||this.routesById[ve];const a=[s];let u=!1;for((l?l.path!=="/"&&i["**"]:Wt(n))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):u=!0);s.parentRoute;)s=s.parentRoute,a.unshift(s);const f=(()=>{if(u){if(this.options.notFoundMode!=="root")for(let g=a.length-1;g>=0;g--){const y=a[g];if(y.children)return y.id}return ve}})(),d=a.map(g=>{var y;let x;const k=((y=g.options.params)==null?void 0:y.parse)??g.options.parseParams;if(k)try{const m=k(i);Object.assign(i,m)}catch(m){if(x=new Gf(m.message,{cause:m}),o!=null&&o.throwOnError)throw x;return x}}),p=[];return a.forEach((g,y)=>{var x,k,m,h,v,w,C,P,j,S;const N=p[y-1],[z,B]=(()=>{const R=(N==null?void 0:N.search)??r;try{const L=typeof g.options.validateSearch=="object"?g.options.validateSearch.parse:g.options.validateSearch,F=(L==null?void 0:L(R))??{};return[{...R,...F},void 0]}catch(L){const F=new Kf(L.message,{cause:L});if(o!=null&&o.throwOnError)throw F;return[R,F]}})(),W=((k=(x=g.options).loaderDeps)==null?void 0:k.call(x,{search:z}))??"",I=W?JSON.stringify(W):"",ee=hi({path:g.fullPath,params:i}),le=hi({path:g.id,params:i,leaveWildcards:!0})+I,G=this.getMatch(le),re=this.state.matches.find(R=>R.id===le)?"stay":"enter";let _;if(G)_={...G,cause:re,params:i};else{const R=g.options.loader||g.options.beforeLoad||g.lazyFn?"pending":"success";_={id:le,index:y,routeId:g.id,params:i,pathname:Et([this.basepath,ee]),updatedAt:Date.now(),search:{},searchError:void 0,status:R,isFetching:!1,error:void 0,paramsError:d[y],routeContext:void 0,context:void 0,abortController:new AbortController,fetchCount:0,cause:re,loaderDeps:W,invalid:!1,preload:!1,links:(h=(m=g.options).links)==null?void 0:h.call(m),scripts:(w=(v=g.options).scripts)==null?void 0:w.call(v),staticData:g.options.staticData||{},loadPromise:sn()}}_.status==="success"&&(_.meta=(P=(C=g.options).meta)==null?void 0:P.call(C,{matches:p,match:_,params:_.params,loaderData:_.loaderData}),_.headers=(S=(j=g.options).headers)==null?void 0:S.call(j,{loaderData:_.loaderData})),o!=null&&o.preload||(_.globalNotFound=f===g.id),_.search=Je(_.search,z),_.searchError=B,p.push(_)}),p},this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r.pendingTimeout))},this.cancelMatches=()=>{var n;(n=this.state.pendingMatches)==null||n.forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=n=>{const r=(i={},l)=>{var s,a,u;const f=i._fromLocation!=null?this.matchRoutes(i._fromLocation.pathname,i.fromSearch||i._fromLocation.search):this.state.matches,d=i.from!=null?f.find(I=>Ir(this.basepath,Wt(I.pathname),{to:i.from,caseSensitive:!1,fuzzy:!1})):void 0,p=(d==null?void 0:d.pathname)||this.latestLocation.pathname;Se(i.from==null||d!=null,"Could not find match for from: "+i.from);const g=((s=mo(f))==null?void 0:s.search)||this.latestLocation.search,y=l==null?void 0:l.filter(I=>f.find(ee=>ee.routeId===I.routeId)),x=this.routesById[(a=y==null?void 0:y.find(I=>I.pathname===p))==null?void 0:a.routeId];let k=i.to?this.resolvePathWithBase(p,`${i.to}`):this.resolvePathWithBase(p,(x==null?void 0:x.to)??p);const m={...(u=mo(f))==null?void 0:u.params};let h=(i.params??!0)===!0?m:{...m,...Tr(i.params,m)};Object.keys(h).length>0&&(l==null||l.map(I=>{var ee;const le=this.looseRoutesById[I.routeId];return((ee=le==null?void 0:le.options.params)==null?void 0:ee.stringify)??le.options.stringifyParams}).filter(Boolean).forEach(I=>{h={...h,...I(h)}})),k=hi({path:k,params:h??{},leaveWildcards:!1,leaveParams:n.leaveParams});const v=(y==null?void 0:y.map(I=>this.looseRoutesById[I.routeId].options.preSearchFilters??[]).flat().filter(Boolean))??[],w=(y==null?void 0:y.map(I=>this.looseRoutesById[I.routeId].options.postSearchFilters??[]).flat().filter(Boolean))??[],C=v.length?v.reduce((I,ee)=>ee(I),g):g,P=i.search===!0?C:i.search?Tr(i.search,C):v.length?C:{},j=w.length?w.reduce((I,ee)=>ee(I),P):P,S=Je(g,j),N=this.options.stringifySearch(S),z=i.hash===!0?this.latestLocation.hash:i.hash?Tr(i.hash,this.latestLocation.hash):void 0,B=z?`#${z}`:"";let W=i.state===!0?this.latestLocation.state:i.state?Tr(i.state,this.latestLocation.state):{};return W=Je(this.latestLocation.state,W),{pathname:k,search:S,searchStr:N,state:W,hash:z??"",href:`${k}${N}${B}`,unmaskOnReload:i.unmaskOnReload}},o=(i={},l)=>{var s;const a=r(i);let u=l?r(l):void 0;if(!u){let y={};const x=(s=this.options.routeMasks)==null?void 0:s.find(k=>{const m=Ir(this.basepath,a.pathname,{to:k.from,caseSensitive:!1,fuzzy:!1});return m?(y=m,!0):!1});if(x){const{from:k,...m}=x;l={...er(n,["from"]),...m,params:y},u=r(l)}}const f=this.matchRoutes(a.pathname,a.search),d=u?this.matchRoutes(u.pathname,u.search):void 0,p=u?r(l,d):void 0,g=r(i,f);return p&&(g.maskedLocation=p),g};return n.mask?o(n,{...er(n,["from"]),...n.mask}):o(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...o})=>{const i=()=>{o.state.key=this.latestLocation.state.key;const a=tr(o.state,this.latestLocation.state);return delete o.state.key,a},l=this.latestLocation.href===o.href,s=this.commitLocationPromise;if(this.commitLocationPromise=sn(()=>{s==null||s.resolve()}),l&&i())this.load();else{let{maskedLocation:a,...u}=o;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](u.href,u.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,viewTransition:o,ignoreBlocker:i,...l}={})=>{const s=this.buildLocation(l);return this.commitLocation({...s,viewTransition:o,replace:n,resetScroll:r,ignoreBlocker:i})},this.navigate=({from:n,to:r,__isRedirect:o,...i})=>{const l=String(r);let s;try{new URL(`${l}`),s=!0}catch{}return Se(!s),this.buildAndCommitLocation({...i,from:n,to:r})},this.load=async()=>{this.latestLocation=this.parseLocation(this.latestLocation),this.__store.setState(i=>({...i,loadedAt:Date.now()}));let n,r;const o=new Promise(i=>{this.startReactTransition(async()=>{var l;try{const s=this.latestLocation,a=this.state.resolvedLocation,u=a.href!==s.href;this.cancelMatches();let f;this.__store.batch(()=>{f=this.matchRoutes(s.pathname,s.search),this.__store.setState(d=>({...d,status:"pending",isLoading:!0,location:s,pendingMatches:f,cachedMatches:d.cachedMatches.filter(p=>!f.find(g=>g.id===p.id))}))}),this.state.redirect||this.emit({type:"onBeforeNavigate",fromLocation:a,toLocation:s,pathChanged:u}),this.emit({type:"onBeforeLoad",fromLocation:a,toLocation:s,pathChanged:u}),await this.loadMatches({matches:f,location:s,onReady:async()=>{this.startViewTransition(async()=>{let d,p,g;this.__store.batch(()=>{this.__store.setState(y=>{const x=y.matches,k=y.pendingMatches||y.matches;return d=x.filter(m=>!k.find(h=>h.id===m.id)),p=k.filter(m=>!x.find(h=>h.id===m.id)),g=x.filter(m=>k.find(h=>h.id===m.id)),{...y,isLoading:!1,matches:k,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...d.filter(m=>m.status!=="error")]}}),this.cleanCache()}),[[d,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([y,x])=>{y.forEach(k=>{var m,h;(h=(m=this.looseRoutesById[k.routeId].options)[x])==null||h.call(m,k)})})})}})}catch(s){Qs(s)?(n=s,this.isServer||this.navigate({...s,replace:!0,__isRedirect:!0})):be(s)&&(r=s),this.__store.setState(a=>({...a,statusCode:n?n.statusCode:r?404:a.matches.some(u=>u.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&((l=this.commitLocationPromise)==null||l.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})});for(this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise},this.startViewTransition=n=>{var r,o;const i=this.shouldViewTransition??this.options.defaultViewTransition;delete this.shouldViewTransition,(o=(r=i&&typeof document<"u"?document:void 0)==null?void 0:r.startViewTransition)!=null&&o.call(r,n)||n()},this.updateMatch=(n,r)=>{var o;let i;const l=(o=this.state.pendingMatches)==null?void 0:o.find(u=>u.id===n),s=this.state.matches.find(u=>u.id===n),a=l?"pendingMatches":s?"matches":"cachedMatches";return this.__store.setState(u=>{var f;return{...u,[a]:(f=u[a])==null?void 0:f.map(d=>d.id===n?i=r(d):d)}}),i},this.getMatch=n=>[...this.state.cachedMatches,...this.state.pendingMatches??[],...this.state.matches].find(r=>r.id===n),this.loadMatches=async({location:n,matches:r,preload:o,onReady:i,updateMatch:l=this.updateMatch})=>{let s,a=!1;const u=async()=>{a||(a=!0,await(i==null?void 0:i()))};!this.isServer&&!this.state.matches.length&&u();const f=(d,p)=>{var g,y,x;if(Qs(p))throw p;if(Bt(p)||be(p)){if(l(d.id,k=>({...k,status:Bt(p)?"redirected":be(p)?"notFound":"error",isFetching:!1,error:p,beforeLoadPromise:void 0,loaderPromise:void 0})),p.routeId||(p.routeId=d.routeId),(g=d.beforeLoadPromise)==null||g.resolve(),(y=d.loaderPromise)==null||y.resolve(),(x=d.loadPromise)==null||x.resolve(),Bt(p))throw a=!0,p=this.resolveRedirect({...p,_fromLocation:n}),p;if(be(p))throw this._handleNotFound(r,p,{updateMatch:l}),p}};try{await new Promise((d,p)=>{(async()=>{var g,y,x;try{const k=(v,w,C)=>{var P,j;const{id:S,routeId:N}=r[v],z=this.looseRoutesById[N];if(w instanceof Promise)throw w;w.routerCode=C,s=s??v,f(this.getMatch(S),w);try{(j=(P=z.options).onError)==null||j.call(P,w)}catch(B){w=B,f(this.getMatch(S),w)}l(S,B=>{var W;return(W=B.beforeLoadPromise)==null||W.resolve(),{...B,error:w,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[v,{id:w,routeId:C}]of r.entries()){const P=this.getMatch(w);if(P.beforeLoadPromise||P.loaderPromise)await P.beforeLoadPromise;else{try{l(w,A=>({...A,loadPromise:sn(()=>{var se;(se=A.loadPromise)==null||se.resolve()}),beforeLoadPromise:sn()}));const j=this.looseRoutesById[C],S=new AbortController,N=(g=r[v-1])==null?void 0:g.id,z=()=>N?this.getMatch(N).context??this.options.context??{}:this.options.context??{},B=j.options.pendingMs??this.options.defaultPendingMs,W=!!(i&&!this.isServer&&!o&&(j.options.loader||j.options.beforeLoad)&&typeof B=="number"&&B!==1/0&&(j.options.pendingComponent??this.options.defaultPendingComponent));let I;W&&(I=setTimeout(()=>{try{u()}catch{}},B));const{paramsError:ee,searchError:le}=this.getMatch(w);ee&&k(v,ee,"PARSE_PARAMS"),le&&k(v,le,"VALIDATE_SEARCH");const G=z();l(w,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,routeContext:Je(A.routeContext,G),context:Je(A.context,G),abortController:S,pendingTimeout:I}));const{search:re,params:_,routeContext:R,cause:L}=this.getMatch(w),F={search:re,abortController:S,params:_,preload:!!o,context:R,location:n,navigate:A=>this.navigate({...A,_fromLocation:n}),buildLocation:this.buildLocation,cause:o?"preload":L},D=await((x=(y=j.options).beforeLoad)==null?void 0:x.call(y,F))??{};(Bt(D)||be(D))&&k(v,D,"BEFORE_LOAD"),l(w,A=>{const se={...A.routeContext,...D};return{...A,routeContext:Je(A.routeContext,se),context:Je(A.context,se),abortController:S}})}catch(j){k(v,j,"BEFORE_LOAD")}l(w,j=>{var S;return(S=j.beforeLoadPromise)==null||S.resolve(),{...j,beforeLoadPromise:void 0,isFetching:!1}})}}const m=r.slice(0,s),h=[];m.forEach(({id:v,routeId:w},C)=>{h.push((async()=>{const{loaderPromise:P}=this.getMatch(v);if(P)await P;else{const j=h[C-1],S=this.looseRoutesById[w],N=()=>{const{params:R,loaderDeps:L,abortController:F,context:D,cause:A}=this.getMatch(v);return{params:R,deps:L,preload:!!o,parentMatchPromise:j,abortController:F,context:D,location:n,navigate:se=>this.navigate({...se,_fromLocation:n}),cause:o?"preload":A,route:S}},z=Date.now()-this.getMatch(v).updatedAt,B=o?S.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:S.options.staleTime??this.options.defaultStaleTime??0,W=S.options.shouldReload,I=typeof W=="function"?W(N()):W;l(v,R=>({...R,loaderPromise:sn(),preload:!!o&&!this.state.matches.find(L=>L.id===v)}));const ee=async()=>{var R,L,F,D,A,se,rn,Xe;try{const rt=async()=>{const vt=this.getMatch(v);vt.minPendingPromise&&await vt.minPendingPromise};try{S._lazyPromise=S._lazyPromise||(S.lazyFn?S.lazyFn().then(Ut=>{Object.assign(S.options,Ut.options)}):Promise.resolve());const vt=this.getMatch(v).componentsPromise||S._lazyPromise.then(()=>Promise.all(Vf.map(async Ut=>{const ui=S.options[Ut];ui!=null&&ui.preload&&await ui.preload()})));l(v,Ut=>({...Ut,isFetching:"loader",componentsPromise:vt})),await S._lazyPromise;let ot=await((L=(R=S.options).loader)==null?void 0:L.call(R,N()));this.serializeLoaderData&&(ot=this.serializeLoaderData(ot,{router:this,match:this.getMatch(v)})),f(this.getMatch(v),ot),await rt();const on=(D=(F=S.options).meta)==null?void 0:D.call(F,{matches:r,match:this.getMatch(v),params:this.getMatch(v).params,loaderData:ot}),Td=(se=(A=S.options).headers)==null?void 0:se.call(A,{loaderData:ot});l(v,Ut=>({...Ut,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:ot,meta:on,headers:Td}))}catch(vt){let ot=vt;await rt(),f(this.getMatch(v),vt);try{(Xe=(rn=S.options).onError)==null||Xe.call(rn,vt)}catch(on){ot=on,f(this.getMatch(v),on)}l(v,on=>({...on,error:ot,status:"error",isFetching:!1}))}await this.getMatch(v).componentsPromise}catch(rt){f(this.getMatch(v),rt)}},{status:le,invalid:G}=this.getMatch(v);le==="success"&&(G||(I??z>B))?(async()=>{try{await ee()}catch{}})():le!=="success"&&await ee();const{loaderPromise:re,loadPromise:_}=this.getMatch(v);re==null||re.resolve(),_==null||_.resolve()}l(v,j=>({...j,isFetching:!1,loaderPromise:void 0}))})())}),await Promise.all(h),d()}catch(k){p(k)}})()}),await u()}catch(d){if(Bt(d)||be(d))throw be(d)&&!o&&await u(),d}return r},this.invalidate=()=>{const n=r=>({...r,invalid:!0,...r.status==="error"?{status:"pending",error:void 0}:{}});return this.__store.setState(r=>{var o;return{...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:(o=r.pendingMatches)==null?void 0:o.map(n)}}),this.load()},this.resolveRedirect=n=>{const r=n;return r.href||(r.href=this.buildLocation(r).href),r},this.cleanCache=()=>{this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!1;const i=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return r.status!=="error"&&Date.now()-r.updatedAt{const r=this.buildLocation(n);let o=this.matchRoutes(r.pathname,r.search,{throwOnError:!0,preload:!0});const i=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches].map(s=>[s.id,!0]));this.__store.batch(()=>{o.forEach(s=>{i[s.id]||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,s]}))})});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(s=>s.id));try{return o=await this.loadMatches({matches:o,location:r,preload:!0,updateMatch:(s,a)=>{l.has(s)?o=o.map(u=>u.id===s?a(u):u):this.updateMatch(s,a)}}),o}catch(s){if(Bt(s))return await this.preloadRoute({...s,_fromLocation:r});console.error(s);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(o);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const s=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation,a=Ir(this.basepath,s.pathname,{...r,to:i.pathname});return!a||n.params&&!tr(a,n.params,!0)?!1:a&&((r==null?void 0:r.includeSearch)??!0)?tr(s.search,i.search,!0)?a:!1:a},this.dehydrate=()=>{var n;const r=((n=this.options.errorSerializer)==null?void 0:n.serialize)??Xf;return{state:{dehydratedMatches:this.state.matches.map(o=>({...er(o,["id","status","updatedAt"]),error:o.error?{data:r(o.error),__isServerError:!0}:void 0}))},manifest:this.manifest}},this.hydrate=()=>{var n,r,o;let i;typeof document<"u"&&(i=this.options.transformer.parse((n=window.__TSR__)==null?void 0:n.dehydrated)),Se(i),this.dehydratedData=i.payload,(o=(r=this.options).hydrate)==null||o.call(r,i.payload);const l=i.router.state,s=this.matchRoutes(this.state.location.pathname,this.state.location.search).map(a=>{const u=l.dehydratedMatches.find(f=>f.id===a.id);return Se(u,`Could not find a client-side match for dehydrated match with id: ${a.id}!`),{...a,...u}});this.__store.setState(a=>({...a,matches:s})),this.manifest=i.router.manifest},this.injectedHtml=[],this.injectHtml=n=>{const r=()=>(this.injectedHtml=this.injectedHtml.filter(o=>o!==r),n);this.injectedHtml.push(r)},this.streamedKeys=new Set,this.getStreamedValue=n=>{var r;if(this.isServer)return;const o=(r=window.__TSR__)==null?void 0:r.streamedValues[n];if(o)return o.parsed||(o.parsed=this.options.transformer.parse(o.value)),o.parsed},this.streamValue=(n,r)=>{var o;this.streamedKeys.has(n),this.streamedKeys.add(n);const i=`__TSR__.streamedValues['${n}'] = { value: ${(o=this.serializer)==null?void 0:o.call(this,this.options.transformer.stringify(r))}}`;this.injectHtml(`