"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[410],{1315(t,e,o){o.d(e,{dy:()=>c,zR:()=>a});var s="__TSR_index",r="popstate",n="beforeunload";function i(t,e){e||(e={});const o=l();return{...e,key:o,__TSR_key:o,[s]:t}}function a(t){const e=t?.window??("undefined"!=typeof document?window:void 0),o=e.history.pushState,a=e.history.replaceState;let u=[];const d=()=>u,h=t?.createHref??(t=>t),f=t?.parseLocation??(()=>c(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const t=l();e.history.replaceState({[s]:0,key:t,__TSR_key:t},"")}let p,g,m,v=f(),y=!1,S=!1,b=!1,w=!1;const x=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?e.history.pushState:e.history.replaceState)(g.state,"",g.href),C._ignoreSubscribers=!1,g=void 0,m=void 0,p=void 0)},_=(t,e,o)=>{const s=h(e);m||(p=v),v=c(e,o),g={href:s,state:o,isPush:g?.isPush||"push"===t},m||(m=Promise.resolve().then(()=>x()))},R=t=>{v=f(),C.notify({type:t})},P=async()=>{if(S)return void(S=!1);const t=f(),o=t.state[s]-v.state[s],r=-1===o,n=!(1===o)&&!r||y;y=!1;const i=n?"GO":r?"BACK":"FORWARD",a=n?{type:"GO",index:o}:{type:r?"BACK":"FORWARD"};if(b)b=!1;else{const o=d();if("undefined"!=typeof document&&o.length)for(const s of o)if(await s.blockerFn({currentLocation:v,nextLocation:t,action:i}))return S=!0,e.history.go(1),void C.notify(a)}v=f(),C.notify(a)},L=t=>{if(w)return void(w=!1);let e=!1;const o=d();if("undefined"!=typeof document&&o.length)for(const t of o){const o=t.enableBeforeUnload??!0;if(!0===o){e=!0;break}if("function"==typeof o&&!0===o()){e=!0;break}}return e?(t.preventDefault(),t.returnValue=""):void 0},C=function(t){let e=t.getLocation();const o=new Set,r=s=>{e=t.getLocation(),o.forEach(t=>t({location:e,action:s}))},n=o=>{t.notifyOnIndexChange??1?r(o):e=t.getLocation()},a=async({task:o,navigateOpts:s,...r})=>{if(s?.ignoreBlocker)return void o();const n=t.getBlockers?.()??[],i="PUSH"===r.type||"REPLACE"===r.type;if("undefined"!=typeof document&&n.length&&i)for(const o of n){const s=c(r.path,r.state);if(await o.blockerFn({currentLocation:e,nextLocation:s,action:r.type}))return void t.onBlocked?.()}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(o,n,c)=>{const l=e.state[s];n=i(l+1,n),a({task:()=>{t.pushState(o,n),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:o,state:n})},replace:(o,n,c)=>{const l=e.state[s];n=i(l,n),a({task:()=>{t.replaceState(o,n),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:o,state:n})},go:(e,o)=>{a({task:()=>{t.go(e),n({type:"GO",index:e})},navigateOpts:o,type:"GO"})},back:e=>{a({task:()=>{t.back(e?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:e,type:"BACK"})},forward:e=>{a({task:()=>{t.forward(e?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:e,type:"FORWARD"})},canGoBack:()=>0!==e.state[s],createHref:e=>t.createHref(e),block:e=>{if(!t.setBlockers)return()=>{};const o=t.getBlockers?.()??[];return t.setBlockers([...o,e]),()=>{const o=t.getBlockers?.()??[];t.setBlockers?.(o.filter(t=>t!==e))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}({getLocation:()=>v,getLength:()=>e.history.length,pushState:(t,e)=>_("push",t,e),replaceState:(t,e)=>_("replace",t,e),back:t=>(t&&(b=!0),w=!0,e.history.back()),forward:t=>{t&&(b=!0),w=!0,e.history.forward()},go:t=>{y=!0,e.history.go(t)},createHref:t=>h(t),flush:x,destroy:()=>{e.history.pushState=o,e.history.replaceState=a,e.removeEventListener(n,L,{capture:!0}),e.removeEventListener(r,P)},onBlocked:()=>{p&&v!==p&&(v=p)},getBlockers:d,setBlockers:t=>u=t,notifyOnIndexChange:!1});return e.addEventListener(n,L,{capture:!0}),e.addEventListener(r,P),e.history.pushState=function(...t){const s=o.apply(e.history,t);return C._ignoreSubscribers||R("PUSH"),s},e.history.replaceState=function(...t){const o=a.apply(e.history,t);return C._ignoreSubscribers||R("REPLACE"),o},C}function c(t,e){const o=function(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}(t),r=o.indexOf("#"),n=o.indexOf("?"),i=l();return{href:o,pathname:o.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:o.length),hash:r>-1?o.substring(r):"",search:n>-1?o.slice(n,-1===r?void 0:r):"",state:e||{[s]:0,key:i,__TSR_key:i}}}function l(){return(Math.random()+1).toString(36).substring(7)}},2927(t,e,o){o.d(e,{A:()=>a,g:()=>n});var s=o(1609),r=o(790);function n(t){const e=t.errorComponent??a;return(0,r.jsx)(i,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:o,reset:r})=>o?s.createElement(e,{error:o,reset:r}):t.children})}var i=class extends s.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){const o=t.getResetKey();return e.error&&e.resetKey!==o?{resetKey:o,error:null}:{resetKey:o}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function a({error:t}){const[e,o]=s.useState(!1);return(0,r.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,r.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,r.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>o(t=>!t),children:e?"Hide Error":"Show Error"})]}),(0,r.jsx)("div",{style:{height:".25rem"}}),e?(0,r.jsx)("div",{children:(0,r.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,r.jsx)("code",{children:t.message}):null})}):null]})}},7517(t,e,o){o.d(e,{Y:()=>n,p:()=>i});var s=o(1609),r=o(790);function n({children:t,fallback:e=null}){return i()?(0,r.jsx)(s.Fragment,{children:t}):(0,r.jsx)(s.Fragment,{children:e})}function i(){return s.useSyncExternalStore(a,()=>!0,()=>!1)}function a(){return()=>{}}},6918(t,e,o){o.d(e,{Y:()=>R,s:()=>I});var s=o(3655),r=o(2927),n=o(7517),i=o(6712),a=o(396),c=o(4002),l=o(1609),u=o(790),d=o(184),h=o(969);function f(t){const e=(0,a.r)();if(h.S??e.isServer){const o=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,u.jsx)(r.g,{getResetKey:()=>o,onCatch:(e,o)=>{if(!(0,c.c)(e))throw e;t.onCatch?.(e,o)},errorComponent:({error:e})=>{if((0,c.c)(e))return t.fallback?.(e);throw e},children:t.children})}const o=`not-found-${(0,d.P)(e.stores.location,t=>t.pathname)}-${(0,d.P)(e.stores.status,t=>t)}`;return(0,u.jsx)(r.g,{getResetKey:()=>o,onCatch:(e,o)=>{if(!(0,c.c)(e))throw e;t.onCatch?.(e,o)},errorComponent:({error:e})=>{if((0,c.c)(e))return t.fallback?.(e);throw e},children:t.children})}function p(){return(0,u.jsx)("p",{children:"Not Found"})}var g=o(8541);function m(t,e,o){return e.options.notFoundComponent?(0,u.jsx)(e.options.notFoundComponent,{...o}):t.options.defaultNotFoundComponent?(0,u.jsx)(t.options.defaultNotFoundComponent,{...o}):(0,u.jsx)(p,{})}function v({children:t}){const e=(0,a.r)();return h.S??e.isServer?(0,u.jsx)("script",{nonce:e.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:t+";document.currentScript.remove()"}}):null}function y(){const t=((0,a.r)(),null);return t?(0,u.jsx)(v,{children:t}):null}var S=o(3870),b=o(7264),w=o(5019),x=o(7244),_=o(9239),R=l.memo(function({matchId:t}){const e=(0,a.r)();if(h.S??e.isServer){const o=e.stores.matchStores.get(t)?.get();o||(0,S.V)();const s=o.routeId,r=e.routesById[s].parentRoute?.id;return(0,u.jsx)(P,{router:e,matchId:t,resetKey:e.stores.loadedAt.get(),matchState:{routeId:s,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:r}})}const o=e.stores.matchStores.get(t);o||(0,S.V)();const s=(0,d.P)(e.stores.loadedAt,t=>t),r=(0,d.P)(o,t=>t);return(0,u.jsx)(P,{router:e,matchId:t,resetKey:s,matchState:l.useMemo(()=>{const t=r.routeId,o=e.routesById[t].parentRoute?.id;return{routeId:t,ssr:r.ssr,_displayPending:r._displayPending,parentRouteId:o}},[r._displayPending,r.routeId,r.ssr,e.routesById])})});function P({router:t,matchId:e,resetKey:o,matchState:s}){const a=t.routesById[s.routeId],d=a.options.pendingComponent??t.options.defaultPendingComponent,p=d?(0,u.jsx)(d,{}):null,m=a.options.errorComponent??t.options.defaultErrorComponent,v=a.options.onCatch??t.options.defaultOnCatch,S=a.isRoot?a.options.notFoundComponent??t.options.notFoundRoute?.options.component:a.options.notFoundComponent,w=!1===s.ssr||"data-only"===s.ssr,x=(!a.isRoot||a.options.wrapInSuspense||w)&&(a.options.wrapInSuspense??d??(a.options.errorComponent?.preload||w))?l.Suspense:g._,_=m?r.g:g._,R=S?f:g._;return(0,u.jsxs)(a.isRoot?a.options.shellComponent??g._:g._,{children:[(0,u.jsx)(i.$.Provider,{value:e,children:(0,u.jsx)(x,{fallback:p,children:(0,u.jsx)(_,{getResetKey:()=>o,errorComponent:m||r.A,onCatch:(t,e)=>{if((0,c.c)(t))throw t.routeId??=s.routeId,t;v?.(t,e)},children:(0,u.jsx)(R,{fallback:t=>{if(t.routeId??=s.routeId,!S||t.routeId&&t.routeId!==s.routeId||!t.routeId&&!a.isRoot)throw t;return l.createElement(S,t)},children:w||s._displayPending?(0,u.jsx)(n.Y,{fallback:p,children:(0,u.jsx)(C,{matchId:e})}):(0,u.jsx)(C,{matchId:e})})})})}),s.parentRouteId===b.n?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(L,{resetKey:o}),t.options.scrollRestoration&&(h.S??t.isServer)?(0,u.jsx)(y,{}):null]}):null]})}function L({resetKey:t}){const e=(0,a.r)();if(h.S??e.isServer)return null;const o=l.useRef(void 0);return(0,s.Nf)(()=>{const t=e.latestLocation.href;void 0!==o.current&&o.current===t||(e.emit({type:"onRendered",...(0,w.CG)(e.stores.location.get(),e.stores.resolvedLocation.get())}),o.current=t)},[e.latestLocation.state.__TSR_key,t,e]),null}var C=l.memo(function({matchId:t}){const e=(0,a.r)(),o=(t,o)=>e.getMatch(t.id)?._nonReactive[o]??t._nonReactive[o];if(h.S??e.isServer){const s=e.stores.matchStores.get(t)?.get();s||(0,S.V)();const n=s.routeId,i=e.routesById[n],a=(e.routesById[n].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:n,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch}),l=a?JSON.stringify(a):void 0,d=i.options.component??e.options.defaultComponent,h=d?(0,u.jsx)(d,{},l):(0,u.jsx)(I,{});if(s._displayPending)throw o(s,"displayPendingPromise");if(s._forcePending)throw o(s,"minPendingPromise");if("pending"===s.status)throw o(s,"loadPromise");if("notFound"===s.status)return(0,c.c)(s.error)||(0,S.V)(),m(e,i,s.error);if("redirected"===s.status)throw(0,x.N6)(s.error)||(0,S.V)(),o(s,"loadPromise");return"error"===s.status?(0,u.jsx)((i.options.errorComponent??e.options.defaultErrorComponent)||r.A,{error:s.error,reset:void 0,info:{componentStack:""}}):h}const s=e.stores.matchStores.get(t);s||(0,S.V)();const n=(0,d.P)(s,t=>t),i=n.routeId,f=e.routesById[i],p=l.useMemo(()=>{const t=(e.routesById[i].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:i,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return t?JSON.stringify(t):void 0},[i,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),g=l.useMemo(()=>{const t=f.options.component??e.options.defaultComponent;return t?(0,u.jsx)(t,{},p):(0,u.jsx)(I,{})},[p,f.options.component,e.options.defaultComponent]);if(n._displayPending)throw o(n,"displayPendingPromise");if(n._forcePending)throw o(n,"minPendingPromise");if("pending"===n.status){const t=f.options.pendingMinMs??e.options.defaultPendingMinMs;if(t){const o=e.getMatch(n.id);if(o&&!o._nonReactive.minPendingPromise&&!(h.S??e.isServer)){const e=(0,_.Su)();o._nonReactive.minPendingPromise=e,setTimeout(()=>{e.resolve(),o._nonReactive.minPendingPromise=void 0},t)}}throw o(n,"loadPromise")}if("notFound"===n.status)return(0,c.c)(n.error)||(0,S.V)(),m(e,f,n.error);if("redirected"===n.status)throw(0,x.N6)(n.error)||(0,S.V)(),o(n,"loadPromise");if("error"===n.status){if(h.S??e.isServer)return(0,u.jsx)((f.options.errorComponent??e.options.defaultErrorComponent)||r.A,{error:n.error,reset:void 0,info:{componentStack:""}});throw n.error}return g}),I=l.memo(function(){const t=(0,a.r)(),e=l.useContext(i.$);let o,s,r=!1;if(h.S??t.isServer){const n=t.stores.matches.get(),i=e?n.findIndex(t=>t.id===e):-1,a=i>=0?n[i]:void 0;o=a?.routeId,r=a?.globalNotFound??!1,s=i>=0?n[i+1]?.id:void 0}else{const n=e?t.stores.matchStores.get(e):void 0;[o,r]=(0,d.P)(n,t=>[t?.routeId,t?.globalNotFound??!1]),s=(0,d.P)(t.stores.matchesId,t=>t[t.findIndex(t=>t===e)+1])}const n=o?t.routesById[o]:void 0,c=t.options.defaultPendingComponent?(0,u.jsx)(t.options.defaultPendingComponent,{}):null;if(r)return n||(0,S.V)(),m(t,n,void 0);if(!s)return null;const f=(0,u.jsx)(R,{matchId:s});return o===b.n?(0,u.jsx)(l.Suspense,{fallback:c,children:f}):f})},7410(t,e,o){o.d(e,{p:()=>_});var s=o(414),r=o(2927),n=o(6712),i=o(396),a=o(3655),c=o(6847),l=o(5019),u=o(1609),d=o(184),h=o(5851);function f(){const t=(0,i.r)(),e=u.useRef({router:t,mounted:!1}),[o,s]=u.useState(!1),r=(0,d.P)(t.stores.isLoading,t=>t),n=(0,d.P)(t.stores.hasPending,t=>t),f=(0,a.ZC)(r),p=r||o||n,g=(0,a.ZC)(p),m=r||n,v=(0,a.ZC)(m);return t.startTransition=t=>{s(!0),u.startTransition(()=>{t(),s(!1)})},u.useEffect(()=>{const e=t.history.subscribe(t.load),o=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return(0,c.gx)(t.latestLocation.publicHref)!==(0,c.gx)(o.publicHref)&&t.commitLocation({...o,replace:!0}),()=>{e()}},[t,t.history]),(0,a.Nf)(()=>{"undefined"!=typeof window&&t.ssr||e.current.router===t&&e.current.mounted||(e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(t){console.error(t)}})())},[t]),(0,a.Nf)(()=>{f&&!r&&t.emit({type:"onLoad",...(0,l.CG)(t.stores.location.get(),t.stores.resolvedLocation.get())})},[f,t,r]),(0,a.Nf)(()=>{v&&!m&&t.emit({type:"onBeforeRouteMount",...(0,l.CG)(t.stores.location.get(),t.stores.resolvedLocation.get())})},[m,v,t]),(0,a.Nf)(()=>{if(g&&!p){const e=(0,l.CG)(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...e}),(0,h.vA)(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())}),e.hrefChanged&&function(t){if("undefined"!=typeof document&&document.querySelector){const e=t.stores.location.get(),o=e.state.__hashScrollIntoViewOptions??!0;if(o&&""!==e.hash){const t=document.getElementById(e.hash);t&&t.scrollIntoView(o)}}}(t)}},[p,g,t]),null}var p=o(8541),g=o(6918),m=o(7264),v=o(790),y=o(969);function S(){const t=(0,i.r)(),e=t.routesById[m.n].options.pendingComponent??t.options.defaultPendingComponent,o=e?(0,v.jsx)(e,{}):null,s=(0,v.jsxs)((y.S??t.isServer)||"undefined"!=typeof document&&t.ssr?p._:u.Suspense,{fallback:o,children:[!(y.S??t.isServer)&&(0,v.jsx)(f,{}),(0,v.jsx)(b,{})]});return t.options.InnerWrap?(0,v.jsx)(t.options.InnerWrap,{children:s}):s}function b(){const t=(0,i.r)(),e=y.S??t.isServer,o=e?t.stores.firstId.get():(0,d.P)(t.stores.firstId,t=>t),s=e?t.stores.loadedAt.get():(0,d.P)(t.stores.loadedAt,t=>t),a=o?(0,v.jsx)(g.Y,{matchId:o}):null;return(0,v.jsx)(n.$.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?a:(0,v.jsx)(r.g,{getResetKey:()=>s,errorComponent:r.A,onCatch:void 0,children:a})})}var w=o(9239);function x({router:t,children:e,...o}){(0,w.xV)(o)&&t.update({...t.options,...o,context:{...t.options.context,...o.context}});const r=(0,v.jsx)(s.F.Provider,{value:t,children:e});return t.options.Wrap?(0,v.jsx)(t.options.Wrap,{children:r}):r}function _({router:t,...e}){return(0,v.jsx)(x,{router:t,...e,children:(0,v.jsx)(S,{})})}},8541(t,e,o){o.d(e,{_:()=>r}),o(1609);var s=o(790);function r(t){return(0,s.jsx)(s.Fragment,{children:t.children})}},6037(t,e,o){o.d(e,{AF:()=>h});var s=o(396),r=o(4396),n=o(5698),i=o(584),a=o(835),c=o(8081),l=o(2166),u=o(3345),d=class{constructor(t){this.useMatch=t=>(0,r.R)({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>(0,u.s)({...t,from:this.options.id}),this.useSearch=t=>(0,c.S)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>(0,a.g)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>(0,i.x)({...t,from:this.options.id}),this.useLoaderData=t=>(0,n.L)({...t,from:this.options.id}),this.useNavigate=()=>(0,l.Z)({from:(0,s.r)().routesById[this.options.id].fullPath}),this.options=t}};function h(t){return e=>new d({id:t,...e})}},9681(t,e,o){o.d(e,{N_:()=>R,d:()=>_});var s=o(3655),r=o(7517),n=o(396),i=o(9239),a=o(6847),c=o(1609),l=o(790),u=o(184),d=o(969),h=o(5795),f={},p={className:"active"},g={role:"link","aria-disabled":!0},m={"data-status":"active","aria-current":"page"},v={"data-transitioning":"transitioning"},y=new WeakMap,S={rootMargin:"100px"},b=t=>e=>{for(const o of t)if(o){if(e.defaultPrevented)return;o(e)}};function w(t,e,o,s){if(!s)return e?{href:t,external:!0}:{href:o.createHref(t)||"/",external:!1}}function x(t){if("string"!=typeof t)return!1;const e=t.charCodeAt(0);return 47===e?47!==t.charCodeAt(1):46===e}function _(t){return c.forwardRef(function(e,o){return(0,l.jsx)(R,{...e,_asChild:t,ref:o})})}var R=c.forwardRef((t,e)=>{const{_asChild:o,...l}=t,{type:_,...R}=function(t,e){const o=(0,n.r)(),l=(0,s.N)(e),_=d.S??o.isServer,{activeProps:R,inactiveProps:P,activeOptions:L,to:C,preload:I,preloadDelay:k,preloadIntentProximity:M,hashScrollIntoView:T,replace:j,startTransition:B,resetScroll:A,viewTransition:F,children:O,target:E,disabled:D,style:N,className:V,onClick:H,onBlur:U,onFocus:$,onMouseEnter:W,onMouseLeave:K,onTouchStart:z,ignoreBlocker:Z,params:G,search:q,hash:J,state:Y,mask:Q,reloadDocument:X,unsafeRelative:tt,from:et,_fromLocation:ot,...st}=t;if(_){const e=x(C);if("string"==typeof C&&!e&&C.indexOf(":")>-1)try{return new URL(C),(0,i.Rp)(C,o.protocolAllowlist)?{...st,ref:l,href:void 0,...O&&{children:O},...E&&{target:E},...D&&{disabled:D},...N&&{style:N},...V&&{className:V}}:{...st,ref:l,href:C,...O&&{children:O},...E&&{target:E},...D&&{disabled:D},...N&&{style:N},...V&&{className:V}}}catch{}const s=o.buildLocation({...t,from:t.from}),r=w(s.maskedLocation?s.maskedLocation.publicHref:s.publicHref,s.maskedLocation?s.maskedLocation.external:s.external,o.history,D),n=(()=>{if(r?.external)return(0,i.Rp)(r.href,o.protocolAllowlist)?void 0:r.href;if(!e&&"string"==typeof C&&C.indexOf(":")>-1)try{return new URL(C),(0,i.Rp)(C,o.protocolAllowlist)?void 0:C}catch{}})(),c=(()=>{if(n)return!1;const t=o.stores.location.get(),e=L?.exact??!1;if(e){if(!(0,a.l$)(t.pathname,s.pathname,o.basepath))return!1}else{const e=(0,a.UC)(t.pathname,o.basepath),r=(0,a.UC)(s.pathname,o.basepath);if(!e.startsWith(r)||e.length!==r.length&&"/"!==e[r.length])return!1}if((L?.includeSearch??1)&&t.search!==s.search){const o=!t.search||"object"==typeof t.search&&!(0,i.xV)(t.search),r=!s.search||"object"==typeof s.search&&!(0,i.xV)(s.search);if(!(o&&r||(0,i.bD)(t.search,s.search,{partial:!e,ignoreUndefined:!L?.explicitUndefined})))return!1}return!L?.includeHash})();if(n)return{...st,ref:l,href:n,...O&&{children:O},...E&&{target:E},...D&&{disabled:D},...N&&{style:N},...V&&{className:V}};const u=c?(0,i.Zw)(R,{})??p:f,d=c?f:(0,i.Zw)(P,{})??f,h=(()=>{const t=N,e=u.style,o=d.style;if(t||e||o)return!t||e||o?t||!e||o?t||e||!o?{...t,...e,...o}:o:e:t})(),v=(()=>{const t=V,e=u.className,o=d.className;if(!t&&!e&&!o)return"";let s="";return t&&(s=t),e&&(s=s?`${s} ${e}`:e),o&&(s=s?`${s} ${o}`:o),s})();return{...st,...u,...d,href:r?.href,ref:l,disabled:!!D,target:E,...h&&{style:h},...v&&{className:v},...D&&g,...c&&m}}const rt=(0,r.p)(),nt=c.useMemo(()=>t,[o,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),it=(0,u.P)(o.stores.location,t=>t,(t,e)=>t.href===e.href),at=c.useMemo(()=>{const t={_fromLocation:it,...nt};return o.buildLocation(t)},[o,it,nt]),ct=at.maskedLocation?at.maskedLocation.publicHref:at.publicHref,lt=at.maskedLocation?at.maskedLocation.external:at.external,ut=c.useMemo(()=>w(ct,lt,o.history,D),[D,lt,ct,o.history]),dt=c.useMemo(()=>{if(ut?.external)return(0,i.Rp)(ut.href,o.protocolAllowlist)?void 0:ut.href;if(!x(C)&&"string"==typeof C&&-1!==C.indexOf(":"))try{return new URL(C),(0,i.Rp)(C,o.protocolAllowlist)?void 0:C}catch{}},[C,ut,o.protocolAllowlist]),ht=c.useMemo(()=>{if(dt)return!1;if(L?.exact){if(!(0,a.l$)(it.pathname,at.pathname,o.basepath))return!1}else{const t=(0,a.UC)(it.pathname,o.basepath),e=(0,a.UC)(at.pathname,o.basepath);if(!t.startsWith(e)||t.length!==e.length&&"/"!==t[e.length])return!1}return!((L?.includeSearch??1)&&!(0,i.bD)(it.search,at.search,{partial:!L?.exact,ignoreUndefined:!L?.explicitUndefined}))&&(!L?.includeHash||rt&&it.hash===at.hash)},[L?.exact,L?.explicitUndefined,L?.includeHash,L?.includeSearch,it,dt,rt,at.hash,at.pathname,at.search,o.basepath]),ft=ht?(0,i.Zw)(R,{})??p:f,pt=ht?f:(0,i.Zw)(P,{})??f,gt=[V,ft.className,pt.className].filter(Boolean).join(" "),mt=(N||ft.style||pt.style)&&{...N,...ft.style,...pt.style},[vt,yt]=c.useState(!1),St=c.useRef(!1),bt=!t.reloadDocument&&!dt&&(I??o.options.defaultPreload),wt=k??o.options.defaultPreloadDelay??0,xt=c.useCallback(()=>{o.preloadRoute({...nt,_builtLocation:at}).catch(t=>{console.warn(t),console.warn("Error preloading route! ☝️")})},[o,nt,at]);if((0,s.BL)(l,c.useCallback(t=>{t?.isIntersecting&&xt()},[xt]),S,{disabled:!(!D&&"viewport"===bt)}),c.useEffect(()=>{St.current||D||"render"!==bt||(xt(),St.current=!0)},[D,xt,bt]),dt)return{...st,ref:l,href:dt,...O&&{children:O},...E&&{target:E},...D&&{disabled:D},...N&&{style:N},...V&&{className:V},...H&&{onClick:H},...U&&{onBlur:U},...$&&{onFocus:$},...W&&{onMouseEnter:W},...K&&{onMouseLeave:K},...z&&{onTouchStart:z}};const _t=t=>{if(D||"intent"!==bt)return;if(!wt)return void xt();const e=t.currentTarget;if(y.has(e))return;const o=setTimeout(()=>{y.delete(e),xt()},wt);y.set(e,o)},Rt=t=>{if(D||!bt||!wt)return;const e=t.currentTarget,o=y.get(e);o&&(clearTimeout(o),y.delete(e))};return{...st,...ft,...pt,href:ut?.href,ref:l,onClick:b([H,t=>{const e=t.currentTarget.getAttribute("target"),s=void 0!==E?E:e;if(!(D||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||s&&"_self"!==s||0!==t.button)){t.preventDefault(),(0,h.flushSync)(()=>{yt(!0)});const e=o.subscribe("onResolved",()=>{e(),yt(!1)});o.navigate({...nt,replace:j,resetScroll:A,hashScrollIntoView:T,startTransition:B,viewTransition:F,ignoreBlocker:Z})}}]),onBlur:b([U,Rt]),onFocus:b([$,_t]),onMouseEnter:b([W,_t]),onMouseLeave:b([K,Rt]),onTouchStart:b([z,t=>{D||"intent"!==bt||xt()}]),disabled:!!D,target:E,...mt&&{style:mt},...gt&&{className:gt},...D&&g,...ht&&m,...rt&&vt&&v}}(l,e),P="function"==typeof l.children?l.children({isActive:"active"===R["data-status"]}):l.children;if(!o){const{disabled:t,...e}=R;return c.createElement("a",e,P)}return c.createElement(o,R,P)})},6712(t,e,o){o.d(e,{$:()=>r,n:()=>n});var s=o(1609),r=s.createContext(void 0),n=s.createContext(void 0)},7003(t,e,o){o.d(e,{gI:()=>x,un:()=>b}),o(396);var s=o(4396),r=o(5698),n=o(584),i=o(835),a=o(8081),c=o(2166),l=o(3345),u=o(9681),d=o(3870),h=o(6847),f=(o(4002),o(7264)),p=o(7244),g=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=t=>{this.originalIndex=t.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=f.n:this.parentRoute||(0,d.V)();let s=o?f.n:e?.path;s&&"/"!==s&&(s=(0,h.p1)(s));const r=e?.id||s;let n=o?f.n:(0,h.HS)(["__root__"===this.parentRoute.id?"":this.parentRoute.id,r]);"__root__"===s&&(s="/"),"__root__"!==n&&(n=(0,h.HS)(["/",n]));const i="__root__"===n?"/":(0,h.HS)([this.parentRoute.fullPath,s]);this._path=s,this._id=n,this._fullPath=i,this._to=(0,h.gx)(i)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),"object"==typeof t&&null!==t&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>(0,p.V2)({from:this.fullPath,...t}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},m=class extends g{constructor(t){super(t)}},v=o(1609),y=o(790),S=class extends g{constructor(t){super(t),this.useMatch=t=>(0,s.R)({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>(0,l.s)({...t,from:this.id}),this.useSearch=t=>(0,a.S)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>(0,i.g)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>(0,n.x)({...t,from:this.id}),this.useLoaderData=t=>(0,r.L)({...t,from:this.id}),this.useNavigate=()=>(0,c.Z)({from:this.fullPath}),this.Link=v.forwardRef((t,e)=>(0,y.jsx)(u.N_,{ref:e,from:this.fullPath,...t}))}};function b(t){return new S(t)}var w=class extends m{constructor(t){super(t),this.useMatch=t=>(0,s.R)({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>(0,l.s)({...t,from:this.id}),this.useSearch=t=>(0,a.S)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>(0,i.g)({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>(0,n.x)({...t,from:this.id}),this.useLoaderData=t=>(0,r.L)({...t,from:this.id}),this.useNavigate=()=>(0,c.Z)({from:this.fullPath}),this.Link=v.forwardRef((t,e)=>(0,y.jsx)(u.N_,{ref:e,from:this.fullPath,...t}))}};function x(t){return new w(t)}},1591(t,e,o){o.d(e,{a:()=>c});var s=o(18),r=o(5851),n=o(969),i=t=>n.S??t.isServer?{createMutableStore:s.c7,createReadonlyStore:s.en,batch:t=>t()}:{createMutableStore:r.MN,createReadonlyStore:r.MN,batch:r.vA},a=o(5019),c=t=>new l(t),l=class extends a.rm{constructor(t){super(t,i)}}},414(t,e,o){o.d(e,{F:()=>s});var s=o(1609).createContext(null)},5698(t,e,o){o.d(e,{L:()=>r});var s=o(4396);function r(t){return(0,s.R)({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}},584(t,e,o){o.d(e,{x:()=>r});var s=o(4396);function r(t){const{select:e,...o}=t;return(0,s.R)({...o,select:t=>e?e(t.loaderDeps):t.loaderDeps})}},8590(t,e,o){o.d(e,{z:()=>c});var s=o(396),r=o(9239),n=o(1609),i=o(184),a=o(969);function c(t){const e=(0,s.r)();if(a.S??e.isServer){const o=e.stores.location.get();return t?.select?t.select(o):o}const o=(0,n.useRef)(void 0);return(0,i.P)(e.stores.location,s=>{const n=t?.select?t.select(s):s;if(t?.structuralSharing??e.options.defaultStructuralSharing){const t=(0,r.BH)(o.current,n);return o.current=t,t}return n})}},4396(t,e,o){o.d(e,{R:()=>d});var s=o(6712),r=o(396),n=o(9239),i=o(3870),a=o(1609),c=o(184),l=o(969),u={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function d(t){const e=(0,r.r)(),o=a.useContext(t.from?s.n:s.$),d=t.from??o,h=d?t.from?e.stores.getRouteMatchStore(d):e.stores.matchStores.get(d):void 0;if(l.S??e.isServer){const e=h?.get();if((t.shouldThrow??1)&&!e&&(0,i.V)(),void 0===e)return;return t.select?t.select(e):e}const f=a.useRef(void 0);return(0,c.P)(h??u,o=>{if((t.shouldThrow??1)&&!o&&(0,i.V)(),void 0===o)return;const s=t.select?t.select(o):o;if(t.structuralSharing??e.options.defaultStructuralSharing){const t=(0,n.BH)(f.current,s);return f.current=t,t}return s})}},2166(t,e,o){o.d(e,{Z:()=>n});var s=o(396),r=o(1609);function n(t){const e=(0,s.r)();return r.useCallback(o=>e.navigate({...o,from:o.from??t?.from}),[t?.from,e])}},835(t,e,o){o.d(e,{g:()=>r});var s=o(4396);function r(t){return(0,s.R)({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const o=!1===t.strict?e.params:e._strictParams;return t.select?t.select(o):o}})}},3345(t,e,o){o.d(e,{s:()=>r});var s=o(4396);function r(t){return(0,s.R)({...t,select:e=>t.select?t.select(e.context):e.context})}},396(t,e,o){o.d(e,{r:()=>n});var s=o(414),r=o(1609);function n(t){return r.useContext(s.F)}},8081(t,e,o){o.d(e,{S:()=>r});var s=o(4396);function r(t){return(0,s.R)({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}},3655(t,e,o){o.d(e,{BL:()=>i,N:()=>a,Nf:()=>r,ZC:()=>n});var s=o(1609),r=(s.use,"undefined"!=typeof window?s.useLayoutEffect:s.useEffect);function n(t){const e=s.useRef({value:t,prev:null}),o=e.current.value;return t!==o&&(e.current={value:t,prev:o}),e.current.prev}function i(t,e,o={},r={}){s.useEffect(()=>{if(!t.current||r.disabled||"function"!=typeof IntersectionObserver)return;const s=new IntersectionObserver(([t])=>{e(t)},o);return s.observe(t.current),()=>{s.disconnect()}},[e,o,r.disabled,t])}function a(t){const e=s.useRef(null);return s.useImperativeHandle(t,()=>e.current,[]),e}},184(t,e,o){o.d(e,{P:()=>i});var s=o(1609),r=o(9242);function n(t,e){return t===e}function i(t,e,o=n){const i=(0,s.useCallback)(e=>{if(!t)return()=>{};const{unsubscribe:o}=t.subscribe(e);return o},[t]),a=(0,s.useCallback)(()=>t?.get(),[t]);return(0,r.useSyncExternalStoreWithSelector)(i,a,a,e,o)}},3870(t,e,o){function s(){throw new Error("Invariant failed")}o.d(e,{V:()=>s})},969(t,e,o){o.d(e,{S:()=>s});const s=!1},4076(t,e,o){function s(t){const e=new Map;let o,s;const r=t=>{t.next&&(t.prev?(t.prev.next=t.next,t.next.prev=t.prev,t.next=void 0,s&&(s.next=t,t.prev=s)):(t.next.prev=void 0,o=t.next,t.next=void 0,s&&(t.prev=s,s.next=t)),s=t)};return{get(t){const o=e.get(t);if(o)return r(o),o.value},set(n,i){if(e.size>=t&&o){const t=o;e.delete(t.key),t.next&&(o=t.next,t.next.prev=void 0),t===s&&(s=void 0)}const a=e.get(n);if(a)a.value=i,r(a);else{const t={key:n,value:i,prev:s};s&&(s.next=t),s=t,o||(o=t),e.set(n,t)}},clear(){e.clear(),o=void 0,s=void 0}}}o.d(e,{s:()=>s})},9481(t,e,o){o.d(e,{AH:()=>S,DC:()=>m,Qh:()=>g,Zs:()=>i,iR:()=>f,nk:()=>p,uK:()=>h});var s=o(9239),r=o(3870),n=o(4076);function i(t,e,o=new Uint16Array(6)){const s=t.indexOf("/",e),r=-1===s?t.length:s,n=t.substring(e,r);if(!n||!n.includes("$"))return o[0]=0,o[1]=e,o[2]=e,o[3]=r,o[4]=r,o[5]=r,o;if("$"===n){const s=t.length;return o[0]=2,o[1]=e,o[2]=e,o[3]=s,o[4]=s,o[5]=s,o}if(36===n.charCodeAt(0))return o[0]=1,o[1]=e,o[2]=e+1,o[3]=r,o[4]=r,o[5]=r,o;const i=function(t){const e=t.indexOf("{");if(-1===e)return null;const o=t.indexOf("}",e);return-1===o||e+1>=t.length?null:[e,o]}(n);if(i){const[s,a]=i,c=n.charCodeAt(s+1);if(45===c){if(s+2!t.parse&&t.caseSensitive===l&&t.prefix===u&&t.suffix===g);if(m)a=m;else{const t=d(1,o.fullPath??o.from,l,u,g);a=t,t.depth=n,t.parent=r,r.dynamic??=[],r.dynamic.push(t)}break}case 3:{const e=s.substring(f,t[1]),i=s.substring(t[4],p),l=c&&!(!e&&!i),u=e?l?e:e.toLowerCase():void 0,g=i?l?i:i.toLowerCase():void 0,m=!h&&r.optional?.find(t=>!t.parse&&t.caseSensitive===l&&t.prefix===u&&t.suffix===g);if(m)a=m;else{const t=d(3,o.fullPath??o.from,l,u,g);a=t,t.parent=r,t.depth=n,r.optional??=[],r.optional.push(t)}break}case 2:{const e=s.substring(f,t[1]),i=s.substring(t[4],p),l=c&&!(!e&&!i),u=e?l?e:e.toLowerCase():void 0,h=i?l?i:i.toLowerCase():void 0,g=d(2,o.fullPath??o.from,l,u,h);a=g,g.parent=r,g.depth=n,r.wildcard??=[],r.wildcard.push(g)}}r=a}if(h&&o.children&&!o.isRoot&&o.id&&95===o.id.charCodeAt(o.id.lastIndexOf("/")+1)){const t=u(o.fullPath??o.from);t.kind=5,t.parent=r,n++,t.depth=n,r.pathless??=[],r.pathless.push(t),r=t}const f=(o.path||!o.children)&&!o.isRoot;if(f&&s.endsWith("/")){const t=u(o.fullPath??o.from);t.kind=4,t.parent=r,n++,t.depth=n,r.index=t,r=t}r.parse=h??null,f&&!r.route&&(r.route=o,r.fullPath=o.fullPath??o.from)}if(o.children)for(const s of o.children)a(t,e,s,l,r,n,c)}function c(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function l(t){if(t.pathless)for(const e of t.pathless)l(e);if(t.static)for(const e of t.static.values())l(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())l(e);if(t.dynamic?.length){t.dynamic.sort(c);for(const e of t.dynamic)l(e)}if(t.optional?.length){t.optional.sort(c);for(const e of t.optional)l(e)}if(t.wildcard?.length){t.wildcard.sort(c);for(const e of t.wildcard)l(e)}}function u(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null}}function d(t,e,o,s,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,caseSensitive:o,prefix:s,suffix:r}}function h(t,e){const o=u("/"),s=new Uint16Array(6);for(const e of t)a(!1,s,e,1,o,0);l(o),e.masksTree=o,e.flatCache=(0,n.s)(1e3)}function f(t,e){t||="/";const o=e.flatCache.get(t);if(o)return o;const s=v(t,e.masksTree);return e.flatCache.set(t,s),s}function p(t,e,o,s,r){t||="/",s||="/";const n=e?`case\0${t}`:t;let i=r.singleCache.get(n);return i||(i=u("/"),a(e,new Uint16Array(6),{from:t},1,i,0),r.singleCache.set(n,i)),v(s,i,o)}function g(t,e,o=!1){const s=o?t:`nofuzz\0${t}`,r=e.matchCache.get(s);if(void 0!==r)return r;let n;t||="/";try{n=v(t,e.segmentTree,o)}catch(t){if(!(t instanceof URIError))throw t;n=null}return n&&(n.branch=S(n.route)),e.matchCache.set(s,n),n}function m(t,e=!1,o){const s=u(t.fullPath),i=new Uint16Array(6),c={},d={};let h=0;return a(e,i,t,1,s,0,t=>{if(o?.(t,h),t.id in c&&(0,r.V)(),c[t.id]=t,0!==h&&t.path){const o="/"===(e=t.fullPath)?e:e.replace(/\/{1,}$/,"");d[o]&&!t.fullPath.endsWith("/")||(d[o]=t)}var e;h++}),l(s),{processedTree:{segmentTree:s,singleCache:(0,n.s)(1e3),matchCache:(0,n.s)(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function v(t,e,o=!1){const r=t.split("/"),n=function(t,e,o,r){if("/"===t&&o.index)return{node:o.index,skipped:0};const n=!(0,s.HV)(e),i=n&&"/"!==t,a=e.length-(n?1:0),c=[{node:o,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,u=null;for(;c.length;){const o=c.pop(),{node:s,index:n,skipped:d,depth:h,statics:f,dynamics:p,optionals:g}=o;let{extract:m,rawParams:v}=o;if(2===s.kind&&s.route&&!_(u,o))continue;if(s.parse){if(!x(t,e,o))continue;v=o.rawParams,m=o.extract}r&&s.route&&4!==s.kind&&_(l,o)&&(l=o);const y=n===a;if(y&&(!s.route||i&&4!==s.kind&&2!==s.kind||!_(u,o)||(u=o),!(s.optional||s.wildcard||s.index||s.pathless)))continue;const S=y?void 0:e[n];let R;if(y&&s.index){const o={node:s.index,index:n,skipped:d,depth:h+1,statics:f,dynamics:p,optionals:g,extract:m,rawParams:v};let r=!0;if(s.index.parse&&(x(t,e,o)||(r=!1)),r){if(!p&&!g&&!d&&w(f,a))return o;_(u,o)&&(u=o)}}if(s.wildcard)for(let t=s.wildcard.length-1;t>=0;t--){const o=s.wildcard[t],{prefix:r,suffix:i}=o;if(r){if(y)continue;if(!(o.caseSensitive?S:R??=S.toLowerCase()).startsWith(r))continue}if(i){if(y)continue;const t=e.slice(n).join("/").slice(-i.length);if((o.caseSensitive?t:t.toLowerCase())!==i)continue}c.push({node:o,index:a,skipped:d,depth:h+1,statics:f,dynamics:p,optionals:g,extract:m,rawParams:v})}if(s.optional){const t=d|1<=0;o--){const r=s.optional[o];c.push({node:r,index:n,skipped:t,depth:e,statics:f,dynamics:p,optionals:g,extract:m,rawParams:v})}if(!y)for(let t=s.optional.length-1;t>=0;t--){const o=s.optional[t],{prefix:r,suffix:i}=o;if(r||i){const t=o.caseSensitive?S:R??=S.toLowerCase();if(r&&!t.startsWith(r))continue;if(i&&!t.endsWith(i))continue}c.push({node:o,index:n+1,skipped:d,depth:e,statics:f,dynamics:p,optionals:g+b(a,n),extract:m,rawParams:v})}}if(!y&&s.dynamic&&S)for(let t=s.dynamic.length-1;t>=0;t--){const e=s.dynamic[t],{prefix:o,suffix:r}=e;if(o||r){const t=e.caseSensitive?S:R??=S.toLowerCase();if(o&&!t.startsWith(o))continue;if(r&&!t.endsWith(r))continue}c.push({node:e,index:n+1,skipped:d,depth:h+1,statics:f,dynamics:p+b(a,n),optionals:g,extract:m,rawParams:v})}if(!y&&s.staticInsensitive){const t=s.staticInsensitive.get(R??=S.toLowerCase());t&&c.push({node:t,index:n+1,skipped:d,depth:h+1,statics:f+b(a,n),dynamics:p,optionals:g,extract:m,rawParams:v})}if(!y&&s.static){const t=s.static.get(S);t&&c.push({node:t,index:n+1,skipped:d,depth:h+1,statics:f+b(a,n),dynamics:p,optionals:g,extract:m,rawParams:v})}if(s.pathless){const t=h+1;for(let e=s.pathless.length-1;e>=0;e--){const o=s.pathless[e];c.push({node:o,index:n,skipped:d,depth:t,statics:f,dynamics:p,optionals:g,extract:m,rawParams:v})}}}if(u)return u;if(r&&l){let o=l.index;for(let t=0;tt.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((4===e.node.kind)>(4===t.node.kind)||4===e.node.kind==(4===t.node.kind)&&e.depth>t.depth)))}},4002(t,e,o){function s(t={}){if(t.isNotFound=!0,t.throw)throw t;return t}function r(t){return!0===t?.isNotFound}o.d(e,{c:()=>r,m:()=>s})},6847(t,e,o){o.d(e,{HS:()=>i,UC:()=>d,cg:()=>u,gx:()=>l,kM:()=>p,l$:()=>h,o1:()=>f,p1:()=>c,ts:()=>a,xv:()=>m});var s=o(9239),r=o(9481),n=o(969);function i(t){return a(t.filter(t=>void 0!==t).join("/"))}function a(t){return t.replace(/\/{2,}/g,"/")}function c(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function l(t){const e=t.length;return e>1&&"/"===t[e-1]?t.replace(/\/{1,}$/,""):t}function u(t){return l(c(t))}function d(t,e){return t?.endsWith("/")&&"/"!==t&&t!==`${e}/`?t.slice(0,-1):t}function h(t,e,o){return d(t,o)===d(e,o)}function f({base:t,to:e,trailingSlash:o="never",cache:r}){const n=e.startsWith("/"),i=!n&&"."===e;let c,l;if(r){c=n?e:i?t:t+"\0"+e;const o=r.get(c);if(o)return o}if(i)l=t.split("/");else if(n)l=e.split("/");else{for(l=t.split("/");l.length>1&&""===(0,s.HV)(l);)l.pop();const o=e.split("/");for(let t=0,e=o.length;t1&&(""===(0,s.HV)(l)?"never"===o&&l.pop():"always"===o&&l.push(""));const u=a(l.join("/"))||"/";return c&&r&&r.set(c,u),u}function p(t){const e=new Map(t.map(t=>[encodeURIComponent(t),t])),o=Array.from(e.keys()).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(o,"g");return t=>t.replace(s,t=>e.get(t)??t)}function g(t,e,o){const s=e[t];return"string"!=typeof s?s:"_splat"===t?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(t=>v(t,o)).join("/"):v(s,o)}function m({path:t,params:e,decoder:o,...s}){let i=!1;const a=Object.create(null);if(!t||"/"===t)return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!t.includes("$"))return{interpolatedPath:t,usedParams:a,isMissingParams:i};if((n.S??s.server)&&-1===t.indexOf("{")){const s=t.length;let r=0,n="";for(;r=s)break;const c=r;let l=t.indexOf("/",r);-1===l&&(l=s),r=l;const u=t.substring(c,l);if(u)if(36===u.charCodeAt(0))if(1===u.length){const t=e._splat;if(a._splat=t,a["*"]=t,!t){i=!0;continue}n+="/"+g("_splat",e,o)}else{const t=u.substring(1);i||t in e||(i=!0),a[t]=e[t],n+="/"+(g(t,e,o)??"undefined")}else n+="/"+u}return t.endsWith("/")&&(n+="/"),{usedParams:a,interpolatedPath:n||"/",isMissingParams:i}}const c=t.length;let l,u=0,d="";for(;ur,V2:()=>s})},7264(t,e,o){o.d(e,{n:()=>s});const s="__root__"},5019(t,e,o){o.d(e,{rm:()=>Z,CG:()=>z});var s=o(9239),r=o(4076),n=o(9481),i=o(6847),a=o(4002),c=o(969);const l=function(){const t=function(){try{return"undefined"!=typeof window&&"object"==typeof window.sessionStorage?window.sessionStorage:void 0}catch{return}}();if(!t)return null;let e={};try{const o=JSON.parse(t.getItem("tsr-scroll-restoration-v1_3")||"{}");(0,s.Qd)(o)&&(e=o)}catch{}return{get state(){return e},set:t=>{e=(0,s.Zw)(t,e)||e},persist:()=>{try{t.setItem("tsr-scroll-restoration-v1_3",JSON.stringify(e))}catch{}}}}(),u=t=>t.state.__TSR_key||t.href;function d(t){const e=[];let o;for(;o=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(o.children,t)+1})`),t=o;return`${e.reverse().join(" > ")}`.toLowerCase()}let h=!1;const f="window",p="data-scroll-restoration-id";function g(t){return t?"false"!==t&&("true"===t||(0*+t==0&&+t+""===t?+t:t)):""}const m=(v=JSON.parse,t=>{"?"===t[0]&&(t=t.substring(1));const e=function(t){const e=new URLSearchParams(t),o=Object.create(null);for(const[t,s]of e.entries()){const e=o[t];null==e?o[t]=g(s):Array.isArray(e)?e.push(g(s)):o[t]=[e,g(s)]}return o}(t);for(const t in e){const o=e[t];if("string"==typeof o)try{e[t]=v(o)}catch(t){}}return e});var v;const y=function(t,e){const o="function"==typeof e;function s(s){if("object"==typeof s&&null!==s)try{return t(s)}catch(t){}else if(o&&"string"==typeof s)try{return e(s),t(s)}catch(t){}return s}return t=>{const e=function(t,e=String){const o=new URLSearchParams;for(const s in t){const r=t[s];void 0!==r&&o.set(s,e(r))}return o.toString()}(t,s);return e?`?${e}`:""}}(JSON.stringify,JSON.parse);var S=o(7264),b=o(7244),w=o(3870);const x=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},_=(t,e)=>!(!t.preload||t.router.stores.matchStores.has(e)),R=(t,e,o=!0)=>{const s={...t.router.options.context??{}},r=o?e:e-1;for(let e=0;e<=r;e++){const o=t.matches[e];if(!o)continue;const r=t.router.getMatch(o.id);r&&Object.assign(s,r.__routeContext,r.__beforeLoadContext)}return s},P=(t,e)=>{if(!t.matches.length)return;const o=e.routeId,s=t.matches.findIndex(e=>e.routeId===t.router.routeTree.id),r=s>=0?s:0;let n=o?t.matches.findIndex(t=>t.routeId===o):t.firstBadMatchIndex??t.matches.length-1;n<0&&(n=r);for(let e=n;e>=0;e--){const o=t.matches[e];if(t.router.looseRoutesById[o.routeId].options.notFoundComponent)return e}return o?n:r},L=(t,e,o)=>{if((0,b.N6)(o)||(0,a.c)(o)){if((0,b.N6)(o)&&o.redirectHandled&&!o.options.reloadDocument)throw o;throw e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=o,t.updateMatch(e.id,s=>({...s,status:(0,b.N6)(o)?"redirected":(0,a.c)(o)?"notFound":"pending"===s.status?"success":s.status,context:R(t,e.index),isFetching:!1,error:o})),(0,a.c)(o)&&!o.routeId&&(o.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),(0,b.N6)(o)&&(t.rendered=!0,o.options._fromLocation=t.location,o.redirectHandled=!0,o=t.router.resolveRedirect(o)),o}},C=(t,e)=>{const o=t.router.getMatch(e);return!o||!((c.S??t.router.isServer)||!o._nonReactive.dehydrated)||!(!(c.S??t.router.isServer)||!1!==o.ssr)},I=(t,e,o)=>{const s=R(t,o);t.updateMatch(e,t=>({...t,context:s}))},k=(t,e,o,s)=>{const{id:r,routeId:n}=t.matches[e],i=t.router.looseRoutesById[n];if(o instanceof Promise)throw o;o.routerCode=s,t.firstBadMatchIndex??=e,L(t,t.router.getMatch(r),o);try{i.options.onError?.(o)}catch(e){o=e,L(t,t.router.getMatch(r),o)}t.updateMatch(r,t=>(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loadPromise?.resolve(),{...t,error:o,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),t.preload||(0,b.N6)(o)||(0,a.c)(o)||(t.serialError??=o)},M=(t,e,o,s)=>{if(void 0!==s._nonReactive.pendingTimeout)return;const r=o.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!(c.S??t.router.isServer)&&!_(t,e)&&(o.options.loader||o.options.beforeLoad||V(o))&&"number"==typeof r&&r!==1/0&&(o.options.pendingComponent??t.router.options?.defaultPendingComponent)){const e=setTimeout(()=>{x(t)},r);s._nonReactive.pendingTimeout=e}},T=(t,e)=>{const{id:o,routeId:r}=t.matches[e],n=t.router.looseRoutesById[r],i=()=>((t,e,o,r)=>{const n=t.router.getMatch(e);let i=n._nonReactive.loadPromise;n._nonReactive.loadPromise=(0,s.Su)(()=>{i?.resolve(),i=void 0});const{paramsError:c,searchError:l}=n;c&&k(t,o,c,"PARSE_PARAMS"),l&&k(t,o,l,"VALIDATE_SEARCH"),M(t,e,r,n);const u=new AbortController;let d=!1;const h=()=>{d||(d=!0,t.updateMatch(e,t=>({...t,isFetching:"beforeLoad",fetchCount:t.fetchCount+1,abortController:u})))},f=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,t=>({...t,isFetching:!1}))};if(!r.options.beforeLoad)return void t.router.batch(()=>{h(),f()});n._nonReactive.beforeLoadPromise=(0,s.Su)();const p={...R(t,o,!1),...n.__routeContext},{search:g,params:m,cause:v}=n,y=_(t,e),S={search:g,abortController:u,params:m,preload:y,context:p,location:t.location,navigate:e=>t.router.navigate({...e,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:y?"preload":v,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},w=s=>{void 0!==s?(((0,b.N6)(s)||(0,a.c)(s))&&(h(),k(t,o,s,"BEFORE_LOAD")),t.router.batch(()=>{h(),t.updateMatch(e,t=>({...t,__beforeLoadContext:s})),f()})):t.router.batch(()=>{h(),f()})};let x;try{if(x=r.options.beforeLoad(S),(0,s.yL)(x))return h(),x.catch(e=>{k(t,o,e,"BEFORE_LOAD")}).then(w)}catch(e){h(),k(t,o,e,"BEFORE_LOAD")}w(x)})(t,o,e,n),l=()=>{if(C(t,o))return;const e=((t,e,o)=>{const s=t.router.getMatch(e);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;M(t,e,o,s);const r=()=>{const o=t.router.getMatch(e);!o.preload||"redirected"!==o.status&&"notFound"!==o.status||L(t,o,o.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()})(t,o,n);return(0,s.yL)(e)?e.then(i):i()};return(()=>{if(c.S??t.router.isServer){const r=((t,e,o,r)=>{const n=t.router.getMatch(e),i=t.matches[o-1]?.id,a=i?t.router.getMatch(i):void 0;if(t.router.isShell())return void(n.ssr=r.id===S.n);if(!1===a?.ssr)return void(n.ssr=!1);const c=t=>!0===t&&"data-only"===a?.ssr?"data-only":t,l=t.router.options.defaultSsr??!0;if(void 0===r.options.ssr)return void(n.ssr=c(l));if("function"!=typeof r.options.ssr)return void(n.ssr=c(r.options.ssr));const{search:u,params:d}=n,h={search:N(u,n.searchError),params:N(d,n.paramsError),location:t.location,matches:t.matches.map(t=>({index:t.index,pathname:t.pathname,fullPath:t.fullPath,staticData:t.staticData,id:t.id,routeId:t.routeId,search:N(t.search,t.searchError),params:N(t.params,t.paramsError),ssr:t.ssr}))},f=r.options.ssr(h);if((0,s.yL)(f))return f.then(t=>{n.ssr=c(t??l)});n.ssr=c(f??l)})(t,o,e,n);if((0,s.yL)(r))return r.then(l)}return l()})()},j=(t,e,o)=>{const s=t.router.getMatch(e);if(!s)return;if(!o.options.head&&!o.options.scripts&&!o.options.headers)return;const r={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([o.options.head?.(r),o.options.scripts?.(r),o.options.headers?.(r)]).then(([t,e,o])=>({meta:t?.meta,links:t?.links,headScripts:t?.scripts,headers:o,scripts:e,styles:t?.styles}))},B=(t,e,o,s,r)=>{const n=e[s-1],{params:i,loaderDeps:a,abortController:c,cause:l}=t.router.getMatch(o),u=R(t,s),d=_(t,o);return{params:i,deps:a,preload:!!d,parentMatchPromise:n,abortController:c,context:u,location:t.location,navigate:e=>t.router.navigate({...e,_fromLocation:t.location}),cause:d?"preload":l,route:r,...t.router.options.additionalContext}},A=async(t,e,o,r,n)=>{try{const i=t.router.getMatch(o);try{(c.S??t.router.isServer)&&!0!==i.ssr||D(n);const a=n.options.loader,l="function"==typeof a?a:a?.handler,u=l?.(B(t,e,o,r,n)),d=!!l&&(0,s.yL)(u);if((d||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||i._nonReactive.minPendingPromise)&&t.updateMatch(o,t=>({...t,isFetching:"loader"})),l){const e=d?await u:u;L(t,t.router.getMatch(o),e),void 0!==e&&t.updateMatch(o,t=>({...t,loaderData:e}))}n._lazyPromise&&await n._lazyPromise;const h=i._nonReactive.minPendingPromise;h&&await h,n._componentsPromise&&await n._componentsPromise,t.updateMatch(o,e=>({...e,error:void 0,context:R(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(e){let s=e;if("AbortError"===s?.name)return i.abortController.signal.aborted?(i._nonReactive.loaderPromise?.resolve(),void(i._nonReactive.loaderPromise=void 0)):void t.updateMatch(o,e=>({...e,status:"pending"===e.status?"success":e.status,isFetching:!1,context:R(t,r)}));const c=i._nonReactive.minPendingPromise;c&&await c,(0,a.c)(e)&&await(n.options.notFoundComponent?.preload?.()),L(t,t.router.getMatch(o),e);try{n.options.onError?.(e)}catch(e){s=e,L(t,t.router.getMatch(o),e)}(0,b.N6)(s)||(0,a.c)(s)||await D(n,["errorComponent"]),t.updateMatch(o,e=>({...e,error:s,context:R(t,r),status:"error",isFetching:!1}))}}catch(e){const s=t.router.getMatch(o);s&&(s._nonReactive.loaderPromise=void 0),L(t,s,e)}},F=async(t,e,o)=>{async function r(s,r,i,c,u){const d=Date.now()-r.updatedAt,f=s?u.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.router.options.defaultStaleTime??0,p=u.options.shouldReload,g="function"==typeof p?p(B(t,e,n,o,u)):p,{status:m,invalid:v}=c,y=d>=f&&(!!t.forceStaleReload||"enter"===c.cause||void 0!==i&&i!==c.id);a="success"===m&&(v||(g??y)),s&&!1===u.options.preload||(a&&!t.sync&&h?(l=!0,(async()=>{try{await A(t,e,n,o,u);const s=t.router.getMatch(n);s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loadPromise?.resolve(),s._nonReactive.loaderPromise=void 0,s._nonReactive.loadPromise=void 0}catch(e){(0,b.N6)(e)&&await t.router.navigate(e.options)}})()):"success"!==m||a?await A(t,e,n,o,u):I(t,n,o))}const{id:n,routeId:i}=t.matches[o];let a=!1,l=!1;const u=t.router.looseRoutesById[i],d=u.options.loader,h="blocking"!==(("function"==typeof d?void 0:d?.staleReloadMode)??t.router.options.defaultStaleReloadMode);if(C(t,n)){if(!t.router.getMatch(n))return t.matches[o];if(I(t,n,o),c.S??t.router.isServer)return t.router.getMatch(n)}else{const e=t.router.getMatch(n),a=t.router.stores.matchesId.get()[o],c=(a&&t.router.stores.matchStores.get(a)||null)?.routeId===i?a:t.router.stores.matches.get().find(t=>t.routeId===i)?.id,l=_(t,n);if(e._nonReactive.loaderPromise){if("success"===e.status&&!t.sync&&!e.preload&&h)return e;await e._nonReactive.loaderPromise;const o=t.router.getMatch(n),s=o._nonReactive.error||o.error;s&&L(t,o,s),"pending"===o.status&&await r(l,e,c,o,u)}else{const o=l&&!t.router.stores.matchStores.has(n),i=t.router.getMatch(n);i._nonReactive.loaderPromise=(0,s.Su)(),o!==i.preload&&t.updateMatch(n,t=>({...t,preload:o})),await r(l,e,c,i,u)}}const f=t.router.getMatch(n);l||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,l||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const p=!!l&&f.isFetching;return p!==f.isFetching||!1!==f.invalid?(t.updateMatch(n,t=>({...t,isFetching:p,invalid:!1})),t.router.getMatch(n)):f};async function O(t){const e=t,o=[];var r;let n;!(c.S??e.router.isServer)&&(r=e.router).stores.matchesId.get().some(t=>r.stores.matchStores.get(t)?.get()._forcePending)&&x(e);for(let t=0;t({...t,...n?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=t,await D(s,["notFoundComponent"])}else if(!e.preload){const t=e.matches[0];t.globalNotFound||e.router.getMatch(t.id)?.globalNotFound&&e.updateMatch(t.id,t=>({...t,globalNotFound:!1,error:void 0}))}if(e.serialError&&void 0!==e.firstBadMatchIndex){const t=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await D(t,["errorComponent"])}for(let t=0;t<=p;t++){const{id:o,routeId:s}=e.matches[t],r=e.router.looseRoutesById[s];try{const t=j(e,o,r);if(t){const s=await t;e.updateMatch(o,t=>({...t,...s}))}}catch(t){console.error(`Error executing head for route ${s}:`,t)}}const g=x(e);if((0,s.yL)(g)&&await g,f)throw f;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}function E(t,e){const o=e.map(e=>t.options[e]?.preload?.()).filter(Boolean);if(0!==o.length)return Promise.all(o)}function D(t,e=H){t._lazyLoaded||void 0!==t._lazyPromise||(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:o,...s}=e.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const o=()=>t._componentsLoaded?void 0:e===H?(()=>{if(void 0===t._componentsPromise){const e=E(t,H);e?t._componentsPromise=e.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():E(t,e);return t._lazyPromise?t._lazyPromise.then(o):o()}function N(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}function V(t){for(const e of H)if(t.options[e]?.preload)return!0;return!1}const H=["component","errorComponent","pendingComponent","notFoundComponent"];function U(t,e){const o=t?.input?.({url:e});if(o){if("string"==typeof o)return new URL(o);if(o instanceof URL)return o}return e}function $(t,e){const o=t?.output?.({url:e});if(o){if("string"==typeof o)return new URL(o);if(o instanceof URL)return o}return e}var W=o(18),K=o(1315);function z(t,e){const o=e,s=t;return{fromLocation:o,toLocation:s,pathChanged:o?.pathname!==s.pathname,hrefChanged:o?.href!==s.href,hashChanged:o?.hash!==s.hash}}var Z=class{constructor(t,e){this.tempLocationKey=`${Math.round(1e7*Math.random())}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=t=>t(),this.update=t=>{const e=this.options,o=this.basepath??e?.basepath??"/",n=void 0===this.basepath,a=e?.rewrite;if(this.options={...e,...t},this.isServer=this.options.isServer??"undefined"==typeof document,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=(0,i.kM)(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:(c.S??this.isServer)||(this.history=(0,K.zR)())),this.origin=this.options.origin,this.origin||(!(c.S??this.isServer)&&window?.origin&&"null"!==window.origin?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){let t;if(this.routeTree=this.options.routeTree,(c.S??this.isServer)&&globalThis.__TSR_CACHE__&&globalThis.__TSR_CACHE__.routeTree===this.routeTree){const e=globalThis.__TSR_CACHE__;this.resolvePathCache=e.resolvePathCache,t=e.processRouteTreeResult}else this.resolvePathCache=(0,r.s)(1e3),t=this.buildRouteTree(),(c.S??this.isServer)&&void 0===globalThis.__TSR_CACHE__&&(globalThis.__TSR_CACHE__={routeTree:this.routeTree,processRouteTreeResult:t,resolvePathCache:this.resolvePathCache});this.setRoutes(t)}if(!this.stores&&this.latestLocation){const t=this.getStoreConfig(this);this.batch=t.batch,this.stores=(0,W.qD)({loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:this.latestLocation,matches:[],statusCode:200},t),(c.S??this.isServer)||function(t){if(!l&&!(c.S??t.isServer))return;const e=l;if(t.options.scrollRestoration&&(t.isScrollRestoring=!0),(c.S??t.isServer)||t.isScrollRestorationSetup||!e)return;t.isScrollRestorationSetup=!0,h=!1;const o=t.options.getScrollRestorationKey||u,r=new Map;window.history.scrollRestoration="manual";const n=o=>{if(!t.isScrollRestoring||!o||0===r.size||!e)return;const s=e.state[o]||={};for(const[t,e]of r){let o;if(t===f)o=f;else if(t.isConnected){const e=t.getAttribute(p);o=e?`[${p}="${e}"]`:d(t)}o&&(s[o]=e)}};document.addEventListener("scroll",e=>{if(!h&&t.isScrollRestoring)if(e.target===document||e.target===window)r.set(f,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const t=e.target;r.set(t,{scrollX:t.scrollLeft||0,scrollY:t.scrollTop||0})}},!0),t.subscribe("onBeforeLoad",t=>{n(t.fromLocation?o(t.fromLocation):void 0),r.clear()}),window.addEventListener("pagehide",()=>{n(o(t.stores.resolvedLocation.get()??t.stores.location.get())),e.persist()}),t.subscribe("onRendered",n=>{const i=o(n.toLocation),a=t.options.scrollRestorationBehavior,c=t.options.scrollToTopSelectors;if(r.clear(),t.resetNextScroll){if("function"!=typeof t.options.scrollRestoration||t.options.scrollRestoration({location:t.latestLocation})){h=!0;try{const o=t.isScrollRestoring?e.state[i]:void 0;let r=!1;if(o)for(const t in o){const e=o[t];if(!(0,s.Qd)(e))continue;const{scrollX:n,scrollY:i}=e;if(Number.isFinite(n)&&Number.isFinite(i))if(t===f)window.scrollTo({top:i,left:n,behavior:a}),r=!0;else if(t){let e;try{e=document.querySelector(t)}catch{continue}e&&(e.scrollLeft=n,e.scrollTop=i,r=!0)}}if(!r){const e=t.history.location.hash.slice(1);if(e){const t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){const o=document.getElementById(e);o&&o.scrollIntoView(t)}}else{const t={top:0,left:0,behavior:a};if(window.scrollTo(t),c)for(const e of c){if(e===f)continue;const o="function"==typeof e?e():document.querySelector(e);o&&o.scrollTo(t)}}}}finally{h=!1}t.isScrollRestoring&&e.set(t=>(t[i]||={},t))}}else t.resetNextScroll=!0})}(this)}let g=!1;const m=this.options.basepath??"/",v=this.options.rewrite;if(n||o!==m||a!==v){this.basepath=m;const t=[],e=(0,i.cg)(m);e&&"/"!==e&&t.push(function(t){const e=(0,i.cg)(t.basepath),o=`/${e}`,s=`${o}/`,r=t.caseSensitive?o:o.toLowerCase(),n=t.caseSensitive?s:s.toLowerCase();return{input:({url:e})=>{const s=t.caseSensitive?e.pathname:e.pathname.toLowerCase();return s===r?e.pathname="/":s.startsWith(n)&&(e.pathname=e.pathname.slice(o.length)),e},output:({url:t})=>(t.pathname=(0,i.HS)(["/",e,t.pathname]),t)}}({basepath:m})),v&&t.push(v),this.rewrite=0===t.length?void 0:1===t.length?t[0]:function(t){return{input:({url:e})=>{for(const o of t)e=U(o,e);return e},output:({url:e})=>{for(let o=t.length-1;o>=0;o--)e=$(t[o],e);return e}}}(t),this.history&&this.updateLatestLocation(),g=!0}g&&this.stores&&this.stores.location.set(this.latestLocation),"undefined"!=typeof window&&"CSS"in window&&"function"==typeof window.CSS?.supports&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=(0,n.DC)(this.routeTree,this.options.caseSensitive,(t,e)=>{t.init({originalIndex:e})});return this.options.routeMasks&&(0,n.uK)(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,e)=>{const o={eventType:t,fn:e};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=t=>{this.subscribers.forEach(e=>{e.eventType===t.type&&e.fn(t)})},this.parseLocation=(t,e)=>{const o=({pathname:t,search:o,hash:r,href:n,state:i})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(t)){const n=this.options.parseSearch(o),a=this.options.stringifySearch(n);return{href:t+a+r,publicHref:t+a+r,pathname:(0,s.q0)(t).path,external:!1,searchStr:a,search:(0,s.Ey)(e?.search,n),hash:(0,s.q0)(r.slice(1)).path,state:(0,s.BH)(e?.state,i)}}const a=new URL(n,this.origin),c=U(this.rewrite,a),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,""),publicHref:n,pathname:(0,s.q0)(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:(0,s.Ey)(e?.search,l),hash:(0,s.q0)(c.hash.slice(1)).path,state:(0,s.BH)(e?.state,i)}},r=o(t),{__tempLocation:n,__tempKey:i}=r.state;if(n&&(!i||i===this.tempLocationKey)){const t=o(n);return t.state.key=r.state.key,t.state.__TSR_key=r.state.__TSR_key,delete t.state.__tempLocation,{...t,maskedLocation:r}}return r},this.resolvePathWithBase=(t,e)=>(0,i.o1)({base:t,to:e.includes("//")?(0,i.ts)(e):e,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,e,o)=>"string"==typeof t?this.matchRoutesInternal({pathname:t,search:e},o):this.matchRoutesInternal(t,e),this.getMatchedRoutes=t=>function({pathname:t,routesById:e,processedTree:o}){const s=Object.create(null),r=(0,i.gx)(t);let a;const c=(0,n.Qh)(r,o,!0);return c&&(a=c.route,Object.assign(s,c.rawParams)),{matchedRoutes:c?.branch||[e.__root__],routeParams:s,foundRoute:a}}({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const e=this.getMatch(t);e&&(e.abortController.abort(),clearTimeout(e._nonReactive.pendingTimeout),e._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(t=>{this.cancelMatch(t)}),this.stores.matchesId.get().forEach(t=>{if(this.stores.pendingMatchStores.has(t))return;const e=this.stores.matchStores.get(t)?.get();e&&("pending"!==e.status&&"loader"!==e.isFetching||this.cancelMatch(t))})},this.buildLocation=t=>{const e=(e={})=>{const o=e._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(o);e.from;const n="path"===e.unsafeRelative?o.pathname:e.from??r.fullPath,a=e.to?`${e.to}`:void 0,c=r.search,l=Object.assign(Object.create(null),r.params),u=47===a?.charCodeAt(0)?"/":this.resolvePathWithBase(n,"."),d=a?this.resolvePathWithBase(u,a):u,h=!1===e.params||null===e.params?Object.create(null):!0===(e.params??!0)?l:Object.assign(l,(0,s.Zw)(e.params,l)),f=this.routesByPath[(0,i.gx)(d)];let p;if(f)p=this.getRouteBranch(f);else if(d.includes("$"))p=[];else{const t=this.getMatchedRoutes(d);p=t.matchedRoutes,this.options.notFoundRoute&&(!t.foundRoute||"/"!==t.foundRoute.path&&t.routeParams["**"])&&(p=[...p,this.options.notFoundRoute])}if(p.length&&(0,s.xV)(h))for(const t of p){const e=t.options.params?.stringify??t.options.stringifyParams;if(e)try{Object.assign(h,e(h))}catch{}}const g=t.leaveParams?d:(0,s.q0)((0,i.xv)({path:d,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let m=c;if(t._includeValidateSearch&&this.options.search?.strict){const t={};p.forEach(e=>{if(e.options.validateSearch)try{Object.assign(t,J(e.options.validateSearch,{...t,...m}))}catch{}}),m=t}m=function({search:t,dest:e,destRoutes:o,_includeValidateSearch:r}){return function(t){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of t){if("search"in o.options)o.options.search?.middlewares&&e.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const t=({search:t,next:e})=>{let s=t;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(s=o.options.preSearchFilters.reduce((t,e)=>e(t),t));const r=e(s);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((t,e)=>e(t),r):r};e.middlewares.push(t)}if(o.options.validateSearch){const t=({search:t,next:s})=>{const r=s(t);if(!e._includeValidateSearch)return r;try{return{...r,...J(o.options.validateSearch,r)??void 0}}catch{return r}};e.middlewares.push(t)}}e.middlewares.push(({search:t})=>{const o=e.dest;return o.search?!0===o.search?t:(0,s.Zw)(o.search,t):{}});const o=(t,e,s)=>t>=s.length?e:(0,s[t])({search:e,next:e=>o(t+1,e,s)});return function(t,s,r){return e.dest=s,e._includeValidateSearch=r,o(0,t,e.middlewares)}}(o)(t,e,r??!1)}({search:m,dest:e,destRoutes:p,_includeValidateSearch:t._includeValidateSearch}),m=(0,s.Ey)(c,m);const v=this.options.stringifySearch(m),y=!0===e.hash?o.hash:e.hash?(0,s.Zw)(e.hash,o.hash):void 0,S=y?`#${y}`:"";let b=!0===e.state?o.state:e.state?(0,s.Zw)(e.state,o.state):{};b=(0,s.BH)(o.state,b);const w=`${g}${v}${S}`;let x,_,R=!1;if(this.rewrite){const t=new URL(w,this.origin),e=$(this.rewrite,t);x=t.href.replace(t.origin,""),e.origin!==this.origin?(_=e.href,R=!0):_=e.pathname+e.search+e.hash}else x=(0,s.CW)(w),_=x;return{publicHref:_,href:x,pathname:g,search:m,searchStr:v,state:b,hash:y??"",external:R,unmaskOnReload:e.unmaskOnReload}},o=(o={},r)=>{const i=e(o);let a=r?e(r):void 0;if(!a){const o=Object.create(null);if(this.options.routeMasks){const c=(0,n.iR)(i.pathname,this.processedTree);if(c){Object.assign(o,c.rawParams);const{from:n,params:i,...l}=c.route,u=!1===i||null===i?Object.create(null):!0===(i??!0)?o:Object.assign(o,(0,s.Zw)(i,o));r={from:t.from,...l,params:u},a=e(r)}}}return a&&(i.maskedLocation=a),i};return t.mask?o(t,{from:t.from,...t.mask}):o(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:e,...o})=>{const r=(0,i.gx)(this.latestLocation.href)===(0,i.gx)(o.href);let n=this.commitLocationPromise;if(this.commitLocationPromise=(0,s.Su)(()=>{n?.resolve(),n=void 0}),r&&(()=>{const t=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];t.forEach(t=>{o.state[t]=this.latestLocation.state[t]});const e=(0,s.bD)(o.state,this.latestLocation.state);return t.forEach(t=>{delete o.state[t]}),e})())this.load();else{let{maskedLocation:s,hashScrollIntoView:r,...n}=o;s&&(n={...s,state:{...s.state,__tempKey:void 0,__tempLocation:{...n,search:n.searchStr,state:{...n.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(n.unmaskOnReload??this.options.unmaskOnReload)&&(n.state.__tempKey=this.tempLocationKey)),n.state.__hashScrollIntoViewOptions=r??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[o.replace?"replace":"push"](n.publicHref,n.state,{ignoreBlocker:e})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:e,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:r,href:n,...i}={})=>{if(n){const e=this.history.location.state.__TSR_index,o=(0,K.dy)(n,{__TSR_index:t?e:e+1}),s=new URL(o.pathname,this.origin);i.to=U(this.rewrite,s).pathname,i.search=this.options.parseSearch(o.search),i.hash=o.hash.slice(1)}const a=this.buildLocation({...i,_includeValidateSearch:!0});this.pendingBuiltLocation=a;const c=this.commitLocation({...a,viewTransition:s,replace:t,resetScroll:e,hashScrollIntoView:o,ignoreBlocker:r});return Promise.resolve().then(()=>{this.pendingBuiltLocation===a&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:t,reloadDocument:e,href:o,publicHref:r,...n})=>{let i=!1;if(o)try{new URL(`${o}`),i=!0}catch{}if(i&&!e&&(e=!0),e){if(void 0!==t||!o){const e=this.buildLocation({to:t,...n});o=o??e.publicHref,r=r??e.publicHref}const e=!i&&r?r:o;if((0,s.Rp)(e,this.protocolAllowlist))return Promise.resolve();if(!n.ignoreBlocker){const t=this.history.getBlockers?.()??[];for(const e of t)if(e?.blockerFn&&await e.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return n.replace?window.location.replace(e):window.location.href=e,Promise.resolve()}return this.buildAndCommitLocation({...n,href:o,to:t,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),c.S??this.isServer){const t=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==t.publicHref){const e=this.getParsedLocationHref(t);throw t.external?(0,b.V2)({href:e}):(0,b.V2)({href:e,_builtLocation:t})}}const t=this.matchRoutes(this.latestLocation),e=this.stores.cachedMatches.get().filter(e=>!t.some(t=>t.id===e.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(t),this.stores.setCached(e)})},this.load=async t=>{let e,o,s;const r=this.stores.resolvedLocation.get()??this.stores.location.get();for(s=new Promise(n=>{this.startTransition(async()=>{try{this.beforeLoad();const e=this.latestLocation,o=z(e,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...o}),this.emit({type:"onBeforeLoad",...o}),await O({router:this,sync:t?.sync,forceStaleReload:r.href===e.href,matches:this.stores.pendingMatches.get(),location:e,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let t=null,e=null,o=null,s=null;this.batch(()=>{const r=this.stores.pendingMatches.get(),n=r.length,i=this.stores.matches.get();t=n?i.filter(t=>!this.stores.pendingMatchStores.has(t.id)):null;const a=new Set;for(const t of this.stores.pendingMatchStores.values())t.routeId&&a.add(t.routeId);const c=new Set;for(const t of this.stores.matchStores.values())t.routeId&&c.add(t.routeId);e=n?i.filter(t=>!a.has(t.routeId)):null,o=n?r.filter(t=>!c.has(t.routeId)):null,s=n?r.filter(t=>c.has(t.routeId)):i,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),n&&(this.stores.setMatches(r),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...t.filter(t=>"error"!==t.status&&"notFound"!==t.status&&"redirected"!==t.status)]),this.clearExpiredCache())});for(const[t,r]of[[e,"onLeave"],[o,"onEnter"],[s,"onStay"]])if(t)for(const e of t)this.looseRoutesById[e.routeId].options[r]?.(e)})})}})}catch(t){(0,b.N6)(t)?(e=t,(c.S??this.isServer)||this.navigate({...e.options,replace:!0,ignoreBlocker:!0})):(0,a.c)(t)&&(o=t);const s=e?e.status:o?404:this.stores.matches.get().some(t=>"error"===t.status)?500:200;this.batch(()=>{this.stores.statusCode.set(s),this.stores.redirect.set(e)})}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),n()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let n;this.hasNotFoundMatch()?n=404:this.stores.matches.get().some(t=>"error"===t.status)&&(n=500),void 0!==n&&this.stores.statusCode.set(n)},this.startViewTransition=t=>{const e=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,e&&"undefined"!=typeof document&&"startViewTransition"in document&&"function"==typeof document.startViewTransition){let o;if("object"==typeof e&&this.isViewTransitionTypesSupported){const s=this.latestLocation,r=this.stores.resolvedLocation.get(),n="function"==typeof e.types?e.types(z(s,r)):e.types;if(!1===n)return void t();o={update:t,types:n}}else o=t;document.startViewTransition(o)}else t()},this.updateMatch=(t,e)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(t);if(o)return void o.set(e);const s=this.stores.matchStores.get(t);if(s)return void s.set(e);const r=this.stores.cachedMatchStores.get(t);if(r){const o=e(r.get());"redirected"===o.status?this.stores.cachedMatchStores.delete(t)&&this.stores.cachedIds.set(e=>e.filter(e=>e!==t)):r.set(o)}})},this.getMatch=t=>this.stores.cachedMatchStores.get(t)?.get()??this.stores.pendingMatchStores.get(t)?.get()??this.stores.matchStores.get(t)?.get(),this.invalidate=t=>{const e=e=>t?.filter?.(e)??1?{...e,invalid:!0,...t?.forcePending||"error"===e.status||"notFound"===e.status?{status:"pending",error:void 0}:void 0}:e;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(e)),this.stores.setCached(this.stores.cachedMatches.get().map(e)),this.stores.setPending(this.stores.pendingMatches.get().map(e))}),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const e=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const e=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(e);t.options.href=o,t.headers.set("Location",o)}else if(e)try{const o=new URL(e);if(this.origin&&o.origin===this.origin){const e=o.pathname+o.search+o.hash;t.options.href=e,t.headers.set("Location",e)}}catch{}if(t.options.href&&!t.options._builtLocation&&(0,s.Rp)(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const e=t?.filter;void 0!==e?this.stores.setCached(this.stores.cachedMatches.get().filter(t=>!e(t))):this.stores.setCached([])},this.clearExpiredCache=()=>{const t=Date.now();this.clearCache({filter:e=>{const o=this.looseRoutesById[e.routeId];if(!o.options.loader)return!0;const s=(e.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??3e5;return"error"===e.status||t-e.updatedAt>=s}})},this.loadRouteChunk=D,this.preloadRoute=async t=>{const e=t._builtLocation??this.buildLocation(t);let o=this.matchRoutes(e,{throwOnError:!0,preload:!0,dest:t});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),r=new Set([...s,...this.stores.cachedIds.get()]),n=o.filter(t=>!r.has(t.id));if(n.length){const t=this.stores.cachedMatches.get();this.stores.setCached([...t,...n])}try{return o=await O({router:this,matches:o,location:e,preload:!0,updateMatch:(t,e)=>{s.has(t)?o=o.map(o=>o.id===t?e(o):o):this.updateMatch(t,e)}}),o}catch(t){if((0,b.N6)(t)){if(t.options.reloadDocument)return;return await this.preloadRoute({...t.options,_fromLocation:e})}return void((0,a.c)(t)||console.error(t))}},this.matchRoute=(t,e)=>{const o={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(o);if(e?.pending&&"pending"!==this.stores.status.get())return!1;const i=(void 0===e?.pending?!this.stores.isLoading.get():e.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=(0,n.nk)(r.pathname,e?.caseSensitive??!1,e?.fuzzy??!1,i.pathname,this.processedTree);return!!a&&!(t.params&&!(0,s.bD)(a.rawParams,t.params,{partial:!0}))&&(e?.includeSearch??1?!!(0,s.bD)(i.search,r.search,{partial:!0})&&a.rawParams:a.rawParams)},this.hasNotFoundMatch=()=>this.stores.matches.get().some(t=>"notFound"===t.status||t.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??y,parseSearch:t.parseSearch??m,protocolAllowlist:t.protocolAllowlist??s.lI}),"undefined"!=typeof document&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:o}){this.routesById=t,this.routesByPath=e,this.processedTree=o;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=(0,n.AH)(t),this.routeBranchCache.set(t,e)),e}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:n}=o;let{matchedRoutes:l}=o,u=!1;(r?"/"!==r.path&&n["**"]:(0,i.gx)(t.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?function(t,e){if("root"!==t)for(let t=e.length-1;t>=0;t--){const o=e[t];if(o.children)return o.id}return S.n}(this.options.notFoundMode,l):void 0,h=new Array(l.length),f=new Map;for(const t of this.stores.matchStores.values())t.routeId&&f.set(t.routeId,t.get());for(let o=0;othis.navigate({...e,_fromLocation:t}),buildLocation:this.buildLocation,cause:o.cause,abortController:o.abortController,preload:!!o.preload,matches:h,routeId:r.id};o.__routeContext=r.options.context(e)??void 0}o.context={...n,...o.__routeContext,...o.__beforeLoadContext}}}return h}matchRoutesLightweight(t){const{matchedRoutes:e,routeParams:o}=this.getMatchedRoutes(t.pathname),r=(0,s.HV)(e),n={...t.search};for(const t of e)try{Object.assign(n,J(t.options.validateSearch,n))}catch{}const i=(0,s.HV)(this.stores.matchesId.get()),a=i&&this.stores.matchStores.get(i)?.get();let c;if(a&&a.routeId===r.id&&a.pathname===t.pathname)c=a.params;else{const t=Object.assign(Object.create(null),o);for(const o of e)try{Y(o,t)}catch{}c=t}return{matchedRoutes:e,fullPath:r.fullPath,search:n,params:c}}},G=class extends Error{},q=class extends Error{};function J(t,e){if(null==t)return{};if("~standard"in t){const o=t["~standard"].validate(e);if(o instanceof Promise)throw new G("Async validation not supported");if(o.issues)throw new G(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):"function"==typeof t?t(e):{}}function Y(t,e){const o=t.options.params?.parse??t.options.parseParams;if(o){const t=o(e);if(!1===t)throw new Error("Route params.parse returned false for a matched route");Object.assign(e,t)}}},18(t,e,o){o.d(e,{c7:()=>n,en:()=>i,qD:()=>a});var s=o(9239),r=o(4076);function n(t){let e=t;return{get:()=>e,set(t){e=(0,s.Zw)(t,e)}}}function i(t){return{get:()=>t()}}function a(t,e){const{createMutableStore:o,createReadonlyStore:s,batch:n,init:i}=e,a=new Map,u=new Map,d=new Map,h=o(t.status),f=o(t.loadedAt),p=o(t.isLoading),g=o(t.isTransitioning),m=o(t.location),v=o(t.resolvedLocation),y=o(t.statusCode),S=o(t.redirect),b=o([]),w=o([]),x=o([]),_=s(()=>c(a,b.get())),R=s(()=>c(u,w.get())),P=s(()=>c(d,x.get())),L=s(()=>b.get()[0]),C=s(()=>b.get().some(t=>"pending"===a.get(t)?.get().status)),I=s(()=>({locationHref:m.get().href,resolvedLocationHref:v.get()?.href,status:h.get()})),k=s(()=>({status:h.get(),loadedAt:f.get(),isLoading:p.get(),isTransitioning:g.get(),matches:_.get(),location:m.get(),resolvedLocation:v.get(),statusCode:y.get(),redirect:S.get()})),M=(0,r.s)(64),T={status:h,loadedAt:f,isLoading:p,isTransitioning:g,location:m,resolvedLocation:v,statusCode:y,redirect:S,matchesId:b,pendingIds:w,cachedIds:x,matches:_,pendingMatches:R,cachedMatches:P,firstId:L,hasPending:C,matchRouteDeps:I,matchStores:a,pendingMatchStores:u,cachedMatchStores:d,__store:k,getRouteMatchStore:function(t){let e=M.get(t);return e||(e=s(()=>{const e=b.get();for(const o of e){const e=a.get(o);if(e&&e.routeId===t)return e.get()}}),M.set(t,e)),e},setMatches:j,setPending:function(t){l(t,u,w,o,n)},setCached:function(t){l(t,d,x,o,n)}};function j(t){l(t,a,b,o,n)}return j(t.matches),i?.(T),T}function c(t,e){const o=[];for(const s of e){const e=t.get(s);e&&o.push(e.get())}return o}function l(t,e,o,r,n){const i=t.map(t=>t.id),a=new Set(i);n(()=>{for(const t of e.keys())a.has(t)||e.delete(t);for(const o of t){const t=e.get(o.id);if(!t){const t=r(o);t.routeId=o.routeId,e.set(o.id,t);continue}t.routeId=o.routeId,t.get()!==o&&t.set(o)}(0,s.r1)(o.get(),i)||o.set(i)})}},9239(t,e,o){o.d(e,{BH:()=>d,CW:()=>_,Ey:()=>u,HV:()=>r,Qd:()=>f,Rp:()=>w,Su:()=>v,Zw:()=>n,bD:()=>m,lI:()=>b,q0:()=>x,r1:()=>R,xV:()=>c,yL:()=>y});var s=o(969);function r(t){return t[t.length-1]}function n(t,e){return"function"==typeof t?t(e):t}const i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function c(t){for(const e in t)if(i.call(t,e))return!0;return!1}const l=()=>Object.create(null),u=(t,e)=>d(t,e,l);function d(t,e,o=()=>({}),r=0){if(s.S)return e;if(t===e)return t;if(r>500)return e;const n=e,a=g(t)&&g(n);if(!(a||f(t)&&f(n)))return n;const c=a?t:h(t);if(!c)return n;const l=a?n:h(n);if(!l)return n;const u=c.length,p=l.length,m=a?new Array(p):o();let v=0;for(let e=0;er||!m(t[i],e[i],o)))return!1;return r===n}return!1}function v(t){let e,o;const s=new Promise((t,s)=>{e=t,o=s});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,e(o),t?.(o)},s.reject=t=>{s.status="rejected",o(t)},s}function y(t){return Boolean(t&&"object"==typeof t&&"function"==typeof t.then)}function S(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return function(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}(e)}const b=["http:","https:","mailto:","tel:"];function w(t,e){if(!t)return!1;try{const o=new URL(t);return!e.has(o.protocol)}catch{return!1}}function x(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let o,s=0,r="";for(;null!==(o=e.exec(t));)r+=S(t.slice(s,o.index))+o[0],s=e.lastIndex;r+=S(s?t.slice(s):t);let n=!1;return r.startsWith("//")&&(n=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:n}}function _(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function R(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;og,MN:()=>y});var s=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(s||{});const r=[];let n=0;const{link:i,unlink:a,propagate:c,checkDirty:l,shallowPropagate:u}=function({update:t,notify:e,unwatched:o}){return{link:function(t,e,o){const s=e.depsTail;if(void 0!==s&&s.dep===t)return;const r=void 0!==s?s.nextDep:e.deps;if(void 0!==r&&r.dep===t)return r.version=o,void(e.depsTail=r);const n=t.subsTail;if(void 0!==n&&n.version===o&&n.sub===e)return;const i=e.depsTail=t.subsTail={version:o,dep:t,sub:e,prevDep:s,nextDep:r,prevSub:n,nextSub:void 0};void 0!==r&&(r.prevDep=i),void 0!==s?s.nextDep=i:e.deps=i,void 0!==n?n.nextSub=i:t.subs=i},unlink:function(t,e=t.sub){const s=t.dep,r=t.prevDep,n=t.nextDep,i=t.nextSub,a=t.prevSub;return void 0!==n?n.prevDep=r:e.depsTail=r,void 0!==r?r.nextDep=n:e.deps=n,void 0!==i?i.prevSub=a:s.subsTail=a,void 0!==a?a.nextSub=i:void 0===(s.subs=i)&&o(s),n},propagate:function(t){let o,s=t.nextSub;t:for(;;){const n=t.sub;let i=n.flags;if(60&i?12&i?4&i?48&i||!r(t,n)?i=0:(n.flags=40|i,i&=1):n.flags=-9&i|32:i=0:n.flags=32|i,2&i&&e(n),1&i){const e=n.subs;if(void 0!==e){const r=(t=e).nextSub;void 0!==r&&(o={value:s,prev:o},s=r);continue}}if(void 0===(t=s)){for(;void 0!==o;)if(t=o.value,o=o.prev,void 0!==t){s=t.nextSub;continue t}break}s=t.nextSub}},checkDirty:function(e,o){let r,n=0,i=!1;t:for(;;){const a=e.dep,c=a.flags;if(16&o.flags)i=!0;else if(17&~c){if(!(33&~c)){void 0===e.nextSub&&void 0===e.prevSub||(r={value:e,prev:r}),e=a.deps,o=a,++n;continue}}else if(t(a)){const t=a.subs;void 0!==t.nextSub&&s(t),i=!0}if(!i){const t=e.nextDep;if(void 0!==t){e=t;continue}}for(;n--;){const n=o.subs,a=void 0!==n.nextSub;if(a?(e=r.value,r=r.prev):e=n,i){if(t(o)){a&&s(n),o=e.sub;continue}i=!1}else o.flags&=-33;o=e.sub;const c=e.nextDep;if(void 0!==c){e=c;continue t}}return i}},shallowPropagate:s};function s(t){do{const o=t.sub,s=o.flags;32==(48&s)&&(o.flags=16|s,2==(6&s)&&e(o))}while(void 0!==(t=t.nextSub))}function r(t,e){let o=e.depsTail;for(;void 0!==o;){if(o===t)return!0;o=o.prevDep}return!1}}({update:t=>t._update(),notify(t){r[f++]=t,t.flags&=~s.Watching},unwatched(t){void 0!==t.depsTail&&(t.depsTail=void 0,t.flags=s.Mutable|s.Dirty,m(t))}});let d,h=0,f=0,p=0;function g(t){try{++p,t()}finally{--p||v()}}function m(t){const e=t.depsTail;let o=void 0!==e?e.nextDep:t.deps;for(;void 0!==o;)o=a(o,t)}function v(){if(!(p>0)){for(;h(void 0!==d&&i(a,d,n),a._snapshot),subscribe(t){const e=function(t){const e="object"==typeof t,o=e?t:void 0;return{next:(e?t.next:t)?.bind(o),error:(e?t.error:void 0)?.bind(o),complete:(e?t.complete:void 0)?.bind(o)}}(t),o={current:!1},r=function(){const t=()=>{const t=d;d=r,++n,r.depsTail=void 0,r.flags=s.Watching|s.RecursedCheck;try{return a.get(),void(o.current?e.next?.(a._snapshot):o.current=!0)}finally{d=t,r.flags&=~s.RecursedCheck,m(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:s.Watching|s.RecursedCheck,notify(){const e=this.flags;e&s.Dirty||e&s.Pending&&l(this.deps,this)?t():this.flags=s.Watching},stop(){this.flags=s.None,this.depsTail=void 0,m(this)}};return t(),r}();return{unsubscribe:()=>{r.stop()}}},_update(t){const i=d,c=e?.compare??Object.is;if(o)d=a,++n,a.depsTail=void 0;else if(void 0===t)return!1;o&&(a.flags=s.Mutable|s.RecursedCheck);try{const e=a._snapshot,s="function"==typeof t?t(e):void 0===t&&o?r(e):t;return!(void 0!==e&&c(e,s)||(a._snapshot=s,0))}finally{d=i,o&&(a.flags&=~s.RecursedCheck),m(a)}}};return o?(a.flags=s.Mutable|s.Dirty,a.get=function(){const t=a.flags;if(t&s.Dirty||t&s.Pending&&l(a.deps,a)){if(a._update()){const t=a.subs;void 0!==t&&u(t)}}else t&s.Pending&&(a.flags=t&~s.Pending);return void 0!==d&&i(a,d,n),a._snapshot}):a.set=function(t){if(a._update(t)){const t=a.subs;void 0!==t&&(c(t),u(t),v())}},a}}}]);