omnigateway 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +12 -4
  2. package/bin/omni.js +37 -5
  3. package/gateway.js +618 -62
  4. package/package.json +1 -1
  5. package/public/assets/{Chip-DJkUCwNJ.js → Chip-Did4Zhvj.js} +1 -1
  6. package/public/assets/{CopyValue-CJ3ZYgvs.js → CopyValue-Cjg9QXrD.js} +1 -1
  7. package/public/assets/{Lamp-D7hJcQ90.js → Lamp-C2Q3t5Mn.js} +1 -1
  8. package/public/assets/{Rack-CaxD9IY1.js → Rack-D0_N-xsd.js} +1 -1
  9. package/public/assets/{RequestTable-bXapHDrR.js → RequestTable-i9paP_7e.js} +1 -1
  10. package/public/assets/{SummaryDeck-Dt_qbFtg.js → SummaryDeck-g4yLDeXB.js} +1 -1
  11. package/public/assets/{Toggle-C_iC6W50.js → Toggle-D-NDlneh.js} +1 -1
  12. package/public/assets/{TokenBreakdown-C96x_g6d.js → TokenBreakdown-D5ZIngM6.js} +1 -1
  13. package/public/assets/{WindowChart-D4dcv4DX.js → WindowChart-BsonO5Py.js} +1 -1
  14. package/public/assets/{_app.accounts-CGFOyYZc.js → _app.accounts-DFhyE62a.js} +1 -1
  15. package/public/assets/{_app.console-DrCT8eLd.js → _app.console-BfHcfQMp.js} +1 -1
  16. package/public/assets/{_app.database-D32je-GL.js → _app.database-Cgw9z3rK.js} +1 -1
  17. package/public/assets/{_app.index-BG6mGxkv.js → _app.index-Blw3S4-3.js} +1 -1
  18. package/public/assets/{_app.keys-C1AjjeHc.js → _app.keys-DrdfnfIk.js} +1 -1
  19. package/public/assets/{_app.logs-BDLj_H_j.js → _app.logs-DUOqlJzB.js} +1 -1
  20. package/public/assets/{_app.models-Cgg7gVSF.js → _app.models-Dm83HRaM.js} +1 -1
  21. package/public/assets/{_app.plugins._pluginId-C5FSNOfN.js → _app.plugins._pluginId-BmJGDYxw.js} +1 -1
  22. package/public/assets/{_app.settings-B7lKNDoh.js → _app.settings-66rm4vHJ.js} +1 -1
  23. package/public/assets/{_app.usage-DjqlIHDL.js → _app.usage-BCufy5XR.js} +1 -1
  24. package/public/assets/{chevron-right-DJj6SEIT.js → chevron-right-BZ4QmUDM.js} +1 -1
  25. package/public/assets/{client-Q2fvA2EK.js → client-De1_cEH5.js} +1 -1
  26. package/public/assets/{index-D1ewvjU0.js → index-PP8vsvw3.js} +3 -3
  27. package/public/assets/{login-Br_AimWR.js → login-CkZlwcdd.js} +1 -1
  28. package/public/assets/plus-D5AwIXj3.js +1 -0
  29. package/public/assets/{preload-helper-92RRH0nq.js → preload-helper-BC9bKUg1.js} +1 -1
  30. package/public/assets/{shared-Cp_kzH_a.js → shared-C47BfV_u.js} +1 -1
  31. package/public/assets/{trash-2-Chg8CwQf.js → trash-2-BLc5o7DN.js} +1 -1
  32. package/public/index.html +4 -4
  33. package/public/assets/plus-CCwmaxw3.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-CWXzHdhc.js","assets/Panel-BlNr9j6-.js","assets/client-Q2fvA2EK.js","assets/shared-Cp_kzH_a.js","assets/Lamp-D7hJcQ90.js","assets/Rack-CaxD9IY1.js","assets/chevron-right-DJj6SEIT.js","assets/Field-DcNu4yw-.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-D4dcv4DX.js","assets/RequestTable-bXapHDrR.js","assets/TokenBreakdown-C96x_g6d.js","assets/Chip-DJkUCwNJ.js","assets/SummaryDeck-Dt_qbFtg.js","assets/Readout-D8Ofl3Gz.js","assets/login-Br_AimWR.js","assets/reasons-Du1OBWAM.js","assets/_app.index-BG6mGxkv.js","assets/_app.accounts-CGFOyYZc.js","assets/CopyValue-CJ3ZYgvs.js","assets/plus-CCwmaxw3.js","assets/trash-2-Chg8CwQf.js","assets/Toggle-C_iC6W50.js","assets/_app.console-DrCT8eLd.js","assets/_app.database-D32je-GL.js","assets/_app.keys-C1AjjeHc.js","assets/_app.logs-BDLj_H_j.js","assets/_app.models-Cgg7gVSF.js","assets/_app.settings-B7lKNDoh.js","assets/_app.usage-DjqlIHDL.js","assets/_app.plugins._pluginId-C5FSNOfN.js","assets/preload-helper-92RRH0nq.js"])))=>i.map(i=>d[i]);
2
- import{$t as e,Qt as t,Sn as n,Tt as r,V as i,W as a,Xt as o,Yt as s,Zt as c,_n as l,an as u,bn as d,cn as f,dn as p,en as m,fn as h,gn as g,hn as _,in as v,ln as y,mn as b,nn as x,on as S,pn as C,qt as w,rn as T,sn as E,vn as D,wn as ee,xn as O}from"./Lamp-D7hJcQ90.js";import{a as te,c as ne,i as re,n as k,o as ie,r as A,s as ae,t as j}from"./preload-helper-92RRH0nq.js";import{A as oe,C as se,D as ce,_ as le,a as ue,k as M,l as de,s as fe,t as pe}from"./Panel-BlNr9j6-.js";import{g as me,h as he,n as ge,p as _e}from"./Rack-CaxD9IY1.js";import{MutationCache as ve,QueryCache as ye,QueryClient as be,QueryClientProvider as xe,useQueryClient as Se}from"@tanstack/react-query";import*as N from"react";import{StrictMode as Ce,createContext as we,use as Te,useEffect as Ee,useRef as De,useState as Oe,useSyncExternalStore as ke}from"react";import{Fragment as Ae,jsx as P,jsxs as F}from"react/jsx-runtime";import{createRoot as je}from"react-dom/client";import Me from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function I(e){return e?.isNotFound===!0}function Ne(){try{return sessionStorage}catch{return}}var Pe=`tsr-scroll-restoration-v1_3`,Fe=Ne();function Ie(){try{return JSON.parse(Fe?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Le(){try{Fe?.setItem(Pe,JSON.stringify(L))}catch{}}var L=Ie(),Re=`data-scroll-restoration-id`,ze=e=>e.state.__TSR_key||e.href;function Be(e){let t=e.getAttribute(Re);if(t)return`[${Re}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ve=!1,He=`window`;function Ue(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function We(e){let t=new Set;for(let n of e){if(n===He)continue;let e=Ue(n);e&&t.add(e)}return t}function Ge(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ze,a=new Set,o=e=>{let t=L[e]||={};for(let e of a)e===document?t[He]={scrollX,scrollY}:e.isConnected&&(t[Be(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Ve=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ve||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Le()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=L[d];if(e){let t=L[u];for(let n in e){if(n===He){if(s)continue}else{let e=Ue(n);if(!e||s&&o&&(l??=We(o),l.has(e)))continue}t||=L[u]={},t[n]??=e[n]}}}Ve=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=We(o));let t=e&&i&&c,s=r.restoring?L[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===He){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ue(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ve=!1}}))}function Ke(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function qe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Je(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=qe(r):Array.isArray(t)?t.push(qe(r)):n[e]=[t,qe(r)]}return n}var Ye=/^(?:\s|["[{\d-]|fa|nu|tr)/,Xe=Qe(JSON.parse),Ze=$e(JSON.stringify,JSON.parse);function Qe(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Je(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function $e(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Ye.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Ke(e,r);return t?`?${t}`:``}}function et(e){return{input:({url:t})=>{for(let n of e)t=nt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=rt(e[n],t);return t}}}function tt(e){let n=m(e.basepath),r=`/${n}`,i=e.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let n=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return n===i?t.pathname=`/`:n.startsWith(a)&&(t.pathname=t.pathname.slice(r.length)),t},output:({url:e})=>(e.pathname=t([`/`,n,e.pathname]),e)}}function nt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function rt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function it(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{h(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var R=`__TSR_index`,at=`popstate`,ot=`beforeunload`;function st(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=dt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[R];i=ct(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[R];i=ct(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[R]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ct(e,t){t||={};let n=ft();return{...t,key:n,__TSR_key:n,[R]:e}}function lt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>dt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ft();t.history.replaceState({[R]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=dt(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[R]-l.state[R],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=st({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ot,x,{capture:!0}),t.removeEventListener(at,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(ot,x,{capture:!0}),t.addEventListener(at,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function ut(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function dt(e,t){let n=ut(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ft();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[R]:0,key:a,__TSR_key:a}}}function ft(){return(Math.random()+1).toString(36).substring(7)}function pt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function mt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function ht({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function gt(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var _t=class{constructor(t,r){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=o(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:lt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=y(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=it(this.latestLocation,e),Ge(this)}let a=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==a||i!==s){this.basepath=a;let e=[],t=m(a);t&&t!==`/`&&e.push(tt({basepath:a})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:et(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=f(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&E(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let r=({pathname:e,search:r,hash:i,href:a,state:o})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let a=this.options.parseSearch(r),s=this.options.stringifySearch(a);return{href:e+s+i,publicHref:e+s+i,pathname:C(e).path,external:!1,searchStr:s,search:O(t?.search,a),hash:C(i.slice(1)).path,state:n(t?.state,o)}}let s=new URL(a,this.origin),c=nt(this.rewrite,s),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,``),publicHref:a,pathname:C(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:O(t?.search,l),hash:C(c.hash.slice(1)).path,state:n(t?.state,o)}},i=r(e),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){let e=r(a);return e.state.key=i.state.key,e.state.__TSR_key=i.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>e({base:t,to:n,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=u(x(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=dt(t.href,{});t={...t,to:nt(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=i[2],s=i[3],u=this.resolvePathWithBase(a,t.to?`${t.to}`:`.`),d=Ct(t.params,s),f=this.routesByPath[x(u)],p;if(f)p=this.getRouteBranch(f);else if(u.includes(`$`))p=[];else{let[e,t,n]=this.getMatchedRoutes(u);p=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(p=[...p,this.options.notFoundRoute])}if(p.length&&l(d))for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){d===s&&(d=Object.assign(Object.create(null),d));try{Object.assign(d,t(d))}catch{}}}let m=e.leaveParams?u:C(c({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,h=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,bt(t.options.validateSearch,{...e,...h}))}catch{}}),h=e}h=xt(h,t,p,e._includeValidateSearch),h=O(o,h);let v=this.options.stringifySearch(h),y=t.hash===!0?r.hash:t.hash?g(t.hash,r.hash):void 0,b=y?`#${y}`:``,S=t.state===!0?r.state:t.state?g(t.state,r.state):{};t.state&&(S=n(r.state,S));let w=`${m}${v}${b}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=rt(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else T=_(w),E=T;return{publicHref:E,href:T,pathname:m,search:h,searchStr:v,state:S,hash:y??``,external:D,unmaskOnReload:t.unmaskOnReload}},r=t(e);if(e.mask)r.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let n=v(r.pathname,this.processedTree);if(n){let i=Object.assign(Object.create(null),n.rawParams),{from:a,params:o,...s}=n.route,c=Ct(o,i);r.maskedLocation=t({from:e.from,...s,params:c})}}return r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=x(this.latestLocation.href)===x(n.href)&&b(ht(n.state),ht(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(D(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await rn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(mt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&pt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&D(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>an(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=S(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!b(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?b(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=r,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??Ze,parseSearch:t.parseSearch??Xe,protocolAllowlist:t.protocolAllowlist??p}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=T(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[r,i,a]=this.getMatchedRoutes(e.pathname),o=r,s=!1;(a?a.path!==`/`&&i[`**`]:x(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let l=s?St(this.options.notFoundMode,o):void 0,u=Array(o.length),d=this._committed,f=(e,t)=>{let n=d[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?d.find(t=>t.routeId===e.id):void 0},p;for(let r=0;r<o.length;r++){let a=o[r],s=u[r-1],d,m,h;{let n=s?.search??e.search,r=s?._strictSearch??void 0;try{let e=bt(a.options.validateSearch,{...n})??void 0;d={...n,...e},m={...r,...e}}catch(e){let r=e;if(e instanceof vt||(r=new vt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,m={},h=r}}let g=``,_=``;try{g=a.options.loaderDeps?.({search:d})??``,_=g&&JSON.stringify(g)||``}catch(e){if(t?.throwOnError)throw e;h??=e}let{interpolatedPath:v,usedParams:y}=c({path:a.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=a.id+v+_,x=f(a,r),S=this._cache.get(b)??(x?.id===b?x:void 0);p=S?._strictParams??Object.assign(y,p);let C;if(!S)try{wt(a,p)}catch(e){if(C=I(e)||ie(e)?e:new yt(e.message,{cause:e}),t?.throwOnError)throw C}let w=x?`stay`:`enter`,T;if(S)T={...S,cause:w,search:O(x?x.search:S.search,d),_strictSearch:m,searchError:h};else{let e=pt(a)?`pending`:`success`;T={id:b,ssr:a.options.ssr,index:r,routeId:a.id,params:x?.params??p,_strictParams:p,pathname:v,updatedAt:Date.now(),search:x?O(x.search,d):d,_strictSearch:m,searchError:h,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:x?n(x.loaderDeps,g):g,invalid:!1,preload:!1,staticData:a.options.staticData||{},fullPath:a.fullPath}}let E=l===a.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,u[r]=T}for(let e=0;e<u.length;e++){let n=u[e];n.params=n.cause===`stay`?O(n.params,p):p,t?._controller&&(n.context={})}return u}matchRoutesLightweight(e){let t=d(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=d(a),c={...e.search};for(let e of a)try{Object.assign(c,bt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{wt(t,e)}catch{}u=e}let f=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,f]),f}},vt=class extends Error{},yt=class extends Error{};function bt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new vt(`Async validation not supported`);if(n.issues)throw new vt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function xt(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=bt(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=g(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function St(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return ne}function Ct(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,g(e,n))}function wt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Tt(e,t){return e.options[t]?.preload?.()}function Et(e,t){let n=Tt(e,`component`),r=Tt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function z(e,t,n){let r=()=>t===!1?void 0:t?Tt(e,t):Et(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Dt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var B=0,V=1,Ot=2,H=3,U=[4];function kt(e){return typeof e[0]==`number`}function W(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function G(e,t){return e.routesById[t.routeId]}function At(e,t,n){return ie(e)?[H,e]:I(e)?(e.routeId||=n,[Ot,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[V,e]):[B,e]}function jt(e,t){let n=At(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=At(t,!0,e.id)}return n}function Mt(e,t,n,r,i){return i[0].signal.aborted?U:Gt(e,t,n,jt(n,r),i)}async function Nt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=G(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}if(c.aborted)return[i,U];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[i,Mt(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{It(e,r,`beforeLoad`,n[0]);let a=await W(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,U];let o=Gt(e,t,u,At(a,!1,u.id),n);if(o[0]!==B)return K(e,r),[i,o];r.context={...r.context,...a}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}finally{r.status=h,It(e,r,!1,n[0])}}i()}function Pt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function K(e,t){let n=t._flight;t._flight=void 0,Pt(e,t,n)?.abort()}function q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Pt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ft(e){for(let t of e){let e=t._flight;e&&e[2]++}}function It(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Lt(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Rt(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return U;if(!i)return[B,void 0];let l=n._flight;It(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Lt(e,t,n,r,s,a,!!o[3]))).then(e=>At(e,!1,r.id),e=>At(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?jt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Gt(e,t,r,await W(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return K(e,n),U}finally{It(e,n,!1,s)}}function zt(e,t,n){t[0]!==H&&(e.status=`success`,e.error=void 0,t[0]===B?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Bt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&K(e,r)}function Vt(e,t){return t[0]===V||t[0]===Ot?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Ht(e,t,n,r,i,a,o){let s=t[1][n],c=G(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Lt(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=U)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,K(e,s),p=Mt(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Pt(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?Rt(e,t,s,c,g,i,a):Promise.resolve([B,s.loaderData])).then(t=>(x&&(zt(s,t,l),t[0]===B&&(m&&!a[0].signal.aborted&&Bt(e,s,u),n>=o&&(s.status=`pending`))),t)),T=W(Promise.resolve().then(()=>z(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,Mt(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===B&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>Vt(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Rt(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,zt(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Vt(E,e))}async function Ut(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=G(e,t[n]);try{let e=z(i,!1);e&&await W(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Wt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Gt(e,t,n,r,i,a){for(;r[0]===H;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[H,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[V,e]:jt(n,e),a=!0}}return r}async function Kt(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ot?Ut(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=H)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=H){let n=s[1];if(n[0]!==H||n[1].options.reloadDocument||n[2])return J(e,t),n;c=!0,s=[0,[V,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=G(e,u);try{await W(i?Promise.resolve().then(()=>z(m,l===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return J(e,t),U}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,o),p()):u.status=`success`}return t}async function qt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=G(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await W(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Jt(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Ut(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||i._notFound||e.preload||a?.id!==e.id||a.status!==`success`||a._notFound)break;l++}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Ht(e,i,t,u,f,r,l)},m=await Nt(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ot){let t=await Ut(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=H&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Kt(e,i,u,r[0],Wt(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Wt(i[2],void 0,void 0,h.then(e=>kt(e)?0:Dt(n).length,()=>0))),o=await h}catch(t){if(J(e,i),t===a&&a.aborted)return U;throw t}return kt(o)?o:qt(e,o,a,r[6]===n.length?r[6]:0)}function Yt(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=G(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Yt(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Y(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Xt(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Dt(t[3]).some(e=>e.id===n[1]))return;let i;try{await W(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Zt(e,t){e._committed=t,e.stores.setMatches(t)}function Qt(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Dt(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<o||e.status===`success`)))continue;let i=G(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,Zt(e,n),q(e,[...a.values(),...i],[...n,...s.values()]),gt(e,i,n,t)}async function $t(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function en(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function tn(e,t,n,r,i){let a=n.map(e=>({...e}));Ft(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Kt(e,o,r,t[0],i)}catch(t){throw q(e,a),t}if(kt(s)){q(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await en(e,t,s);return}if(await qt(e,s,t[0].signal),e._tx!==t||e._committed!==n){q(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),K(e,n))}Zt(e,a),q(e,n,a)}async function nn(e,t,n,r,i,a){let o=await Jt(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(kt(o)){let n=o[0]===H&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Y(e,t),q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Y(e,t);return}await en(e,t,o);return}let s=o[1];if(e._tx===t&&await Xt(e,t),e._tx!==t){Y(e,t),q(e,s),J(e,o);return}let c=t[2],l=mt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Xt(e,t),e._tx!==t){Y(e,t),q(e,s),J(e,o);return}let n=await e.startTransition(()=>{Y(e,t),Qt(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){J(e,o);return}u?.length&&tn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function rn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=mt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await $t(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ft(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){q(e,m),await $t(e,n);return}e._preflight=void 0;let g,_=()=>nn(e,y,f,()=>Yt(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&It(e,t,!1)}n[0].abort(),q(e,n[3],y[3],!0)}if(e._tx!==y){q(e,y[3]),y[3]=[],g?.(),await $t(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Yt(e,y),g?.(_()),await v,await $t(e,y)}async function an(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Ft(a),o=(e._preloads??=new Map).set(i,a),s=await Jt(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),q(e,a)),i.abort()}if(!kt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){I(e)||console.error(e);return}}}var on=class extends N.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?N.createElement(this.props.errorComponent??sn,{error:e,reset:this.reset}):this.props.children}};function sn({error:e}){let[t,n]=N.useState(!1);return F(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[F(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[P(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),P(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),P(`div`,{style:{height:`.25rem`}}),t?P(`div`,{children:P(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?P(`code`,{children:e.message}):null})}):null]})}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function cn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function ln(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var un=[],dn=0,{link:fn,unlink:pn,propagate:mn,checkDirty:hn,shallowPropagate:gn}=cn({update(e){return e._update()},notify(e){un[vn++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,xn(e))}}),_n=0,vn=0,Z,yn=0;function bn(e){try{++yn,e()}finally{--yn||Sn()}}function xn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=pn(n,e)}function Sn(){if(!(yn>0)){for(;_n<vn;){let e=un[_n];un[_n++]=void 0,e.notify()}_n=0,vn=0}}function Cn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&fn(i,Z,dn),i._snapshot},subscribe(e){let t=ln(e),n={current:!1},r=wn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++dn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),xn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&hn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&gn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&fn(i,Z,dn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(mn(e),gn(e),Sn())}},i}function wn(e){let t=()=>{let t=Z;Z=n,++dn,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,xn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&hn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,xn(this)}};return t(),n}function Tn(e){let t=M(),n=`not-found-${w(t.stores.location,e=>e.pathname)}-${w(t.stores.status,e=>e)}`;return P(on,{getResetKey:()=>n,onCatch:(t,n)=>{if(I(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(I(t))return e.fallback?.(t);throw t},children:e.children})}function En(){return P(`p`,{children:`Not Found`})}function Q(e){return P(Ae,{children:e.children})}function Dn(e,t,n){return t.options.notFoundComponent?P(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?P(e.options.defaultNotFoundComponent,{...n}):P(En,{})}function On(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?P(n,{}):null}var kn=(e,t)=>e[0]===t[0]&&e[1]===t[1],An=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,jn=N.memo(function({routeId:e}){let t=M();return P(Mn,{router:t,match:w(t.stores.getMatchStore(e),e=>e)})});function Mn({router:e,match:t}){let n=e.routesById[t.routeId],r=On(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,c=t.ssr===!1||t.ssr===`data-only`,l=An(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||c))?N.Suspense:Q,u=i?on:Q,d=o?Tn:Q;return F(n.isRoot?n.options.shellComponent??Q:Q,{children:[P(te.Provider,{value:t.routeId,children:P(l,{fallback:r,children:P(u,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(I(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:P(d,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return N.createElement(o,e)},children:c?P(s,{fallback:r,children:P(Nn,{match:t})}):P(Nn,{match:t})})})})}),null]})}var Nn=N.memo(function({match:e}){let t=M(),n=e.routeId,r=t.routesById[n],i=N.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=N.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?P(e,{},i):P(Pn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!An(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return On(t,r)}if(e.status===`notFound`)return Dn(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Pn=N.memo(function(){let e=M(),t=N.useContext(te),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=w(a,e=>[!!e._notFound,e.error],kn),i=w(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Dn(e,e.routesById[t],r);if(!i)return null;let a=P(jn,{routeId:i});return t===`__root__`?P(N.Suspense,{fallback:On(e),children:a}):a});function Fn(e,t){let n=e[1];e.length=0,n?.(t)}function In({t:e}){let t=M(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Fn(n,!1),n.push(i,a),e(t),N.startTransition(r)}),ee(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(x(r.publicHref)!==x(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...mt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Ln(){let e=M(),t=e.routesById[ne],n=On(e,t),r=e.ssr?Q:N.Suspense,i=F(Ae,{children:[P(In,{t:N.useState()[1]}),P(r,{fallback:n,children:P(Rn,{})})]});return e.options.InnerWrap?P(e.options.InnerWrap,{children:i}):i}function Rn(){let e=M(),t=e._rendered,n=w(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ee(()=>{t[0]===n&&Fn(t,!0)},[t,n]);let a=i?P(jn,{routeId:i}):null;return P(te.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:P(on,{getResetKey:()=>r,onCatch:void 0,children:a})})}var zn=e=>({createMutableStore:Cn,createReadonlyStore:Cn,batch:bn}),Bn=e=>new Vn(e),Vn=class extends _t{constructor(e){super(e,zn)}};function Hn({router:e,children:t,...n}){l(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=P(oe.Provider,{value:e,children:t});return e.options.Wrap?P(e.options.Wrap,{children:r}):r}function Un({router:e,...t}){return P(Hn,{router:e,...t,children:P(Ln,{})})}var Wn=Me.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-CWXzHdhc.js","assets/Panel-BlNr9j6-.js","assets/client-De1_cEH5.js","assets/shared-C47BfV_u.js","assets/Lamp-C2Q3t5Mn.js","assets/Rack-D0_N-xsd.js","assets/chevron-right-BZ4QmUDM.js","assets/Field-DcNu4yw-.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-BsonO5Py.js","assets/RequestTable-i9paP_7e.js","assets/TokenBreakdown-D5ZIngM6.js","assets/Chip-Did4Zhvj.js","assets/SummaryDeck-g4yLDeXB.js","assets/Readout-D8Ofl3Gz.js","assets/login-CkZlwcdd.js","assets/reasons-Du1OBWAM.js","assets/_app.index-Blw3S4-3.js","assets/_app.accounts-DFhyE62a.js","assets/CopyValue-Cjg9QXrD.js","assets/plus-D5AwIXj3.js","assets/trash-2-BLc5o7DN.js","assets/Toggle-D-NDlneh.js","assets/_app.console-BfHcfQMp.js","assets/_app.database-Cgw9z3rK.js","assets/_app.keys-DrdfnfIk.js","assets/_app.logs-DUOqlJzB.js","assets/_app.models-Dm83HRaM.js","assets/_app.settings-66rm4vHJ.js","assets/_app.usage-BCufy5XR.js","assets/_app.plugins._pluginId-BmJGDYxw.js","assets/preload-helper-BC9bKUg1.js"])))=>i.map(i=>d[i]);
2
+ import{$t as e,Qt as t,Sn as n,Tt as r,V as i,W as a,Xt as o,Yt as s,Zt as c,_n as l,an as u,bn as d,cn as f,dn as p,en as m,fn as h,gn as g,hn as _,in as v,ln as y,mn as b,nn as x,on as S,pn as C,qt as w,rn as T,sn as E,vn as D,wn as ee,xn as O}from"./Lamp-C2Q3t5Mn.js";import{a as te,c as ne,i as re,n as k,o as ie,r as A,s as ae,t as j}from"./preload-helper-BC9bKUg1.js";import{A as oe,C as se,D as ce,_ as le,a as ue,k as M,l as de,s as fe,t as pe}from"./Panel-BlNr9j6-.js";import{g as me,h as he,n as ge,p as _e}from"./Rack-D0_N-xsd.js";import{MutationCache as ve,QueryCache as ye,QueryClient as be,QueryClientProvider as xe,useQueryClient as Se}from"@tanstack/react-query";import*as N from"react";import{StrictMode as Ce,createContext as we,use as Te,useEffect as Ee,useRef as De,useState as Oe,useSyncExternalStore as ke}from"react";import{Fragment as Ae,jsx as P,jsxs as F}from"react/jsx-runtime";import{createRoot as je}from"react-dom/client";import Me from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function I(e){return e?.isNotFound===!0}function Ne(){try{return sessionStorage}catch{return}}var Pe=`tsr-scroll-restoration-v1_3`,Fe=Ne();function Ie(){try{return JSON.parse(Fe?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Le(){try{Fe?.setItem(Pe,JSON.stringify(L))}catch{}}var L=Ie(),Re=`data-scroll-restoration-id`,ze=e=>e.state.__TSR_key||e.href;function Be(e){let t=e.getAttribute(Re);if(t)return`[${Re}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ve=!1,He=`window`;function Ue(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function We(e){let t=new Set;for(let n of e){if(n===He)continue;let e=Ue(n);e&&t.add(e)}return t}function Ge(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ze,a=new Set,o=e=>{let t=L[e]||={};for(let e of a)e===document?t[He]={scrollX,scrollY}:e.isConnected&&(t[Be(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Ve=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ve||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Le()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=L[d];if(e){let t=L[u];for(let n in e){if(n===He){if(s)continue}else{let e=Ue(n);if(!e||s&&o&&(l??=We(o),l.has(e)))continue}t||=L[u]={},t[n]??=e[n]}}}Ve=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=We(o));let t=e&&i&&c,s=r.restoring?L[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===He){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ue(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ve=!1}}))}function Ke(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function qe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Je(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=qe(r):Array.isArray(t)?t.push(qe(r)):n[e]=[t,qe(r)]}return n}var Ye=/^(?:\s|["[{\d-]|fa|nu|tr)/,Xe=Qe(JSON.parse),Ze=$e(JSON.stringify,JSON.parse);function Qe(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Je(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function $e(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Ye.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Ke(e,r);return t?`?${t}`:``}}function et(e){return{input:({url:t})=>{for(let n of e)t=nt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=rt(e[n],t);return t}}}function tt(e){let n=m(e.basepath),r=`/${n}`,i=e.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let n=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return n===i?t.pathname=`/`:n.startsWith(a)&&(t.pathname=t.pathname.slice(r.length)),t},output:({url:e})=>(e.pathname=t([`/`,n,e.pathname]),e)}}function nt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function rt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function it(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{h(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var R=`__TSR_index`,at=`popstate`,ot=`beforeunload`;function st(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=dt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[R];i=ct(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[R];i=ct(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[R]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ct(e,t){t||={};let n=ft();return{...t,key:n,__TSR_key:n,[R]:e}}function lt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>dt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ft();t.history.replaceState({[R]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=dt(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[R]-l.state[R],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=st({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ot,x,{capture:!0}),t.removeEventListener(at,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(ot,x,{capture:!0}),t.addEventListener(at,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function ut(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function dt(e,t){let n=ut(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ft();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[R]:0,key:a,__TSR_key:a}}}function ft(){return(Math.random()+1).toString(36).substring(7)}function pt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function mt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function ht({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function gt(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var _t=class{constructor(t,r){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=o(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:lt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=y(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=it(this.latestLocation,e),Ge(this)}let a=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==a||i!==s){this.basepath=a;let e=[],t=m(a);t&&t!==`/`&&e.push(tt({basepath:a})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:et(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=f(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&E(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let r=({pathname:e,search:r,hash:i,href:a,state:o})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let a=this.options.parseSearch(r),s=this.options.stringifySearch(a);return{href:e+s+i,publicHref:e+s+i,pathname:C(e).path,external:!1,searchStr:s,search:O(t?.search,a),hash:C(i.slice(1)).path,state:n(t?.state,o)}}let s=new URL(a,this.origin),c=nt(this.rewrite,s),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,``),publicHref:a,pathname:C(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:O(t?.search,l),hash:C(c.hash.slice(1)).path,state:n(t?.state,o)}},i=r(e),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){let e=r(a);return e.state.key=i.state.key,e.state.__TSR_key=i.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>e({base:t,to:n,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=u(x(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=dt(t.href,{});t={...t,to:nt(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=i[2],s=i[3],u=this.resolvePathWithBase(a,t.to?`${t.to}`:`.`),d=Ct(t.params,s),f=this.routesByPath[x(u)],p;if(f)p=this.getRouteBranch(f);else if(u.includes(`$`))p=[];else{let[e,t,n]=this.getMatchedRoutes(u);p=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(p=[...p,this.options.notFoundRoute])}if(p.length&&l(d))for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){d===s&&(d=Object.assign(Object.create(null),d));try{Object.assign(d,t(d))}catch{}}}let m=e.leaveParams?u:C(c({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,h=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,bt(t.options.validateSearch,{...e,...h}))}catch{}}),h=e}h=xt(h,t,p,e._includeValidateSearch),h=O(o,h);let v=this.options.stringifySearch(h),y=t.hash===!0?r.hash:t.hash?g(t.hash,r.hash):void 0,b=y?`#${y}`:``,S=t.state===!0?r.state:t.state?g(t.state,r.state):{};t.state&&(S=n(r.state,S));let w=`${m}${v}${b}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=rt(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else T=_(w),E=T;return{publicHref:E,href:T,pathname:m,search:h,searchStr:v,state:S,hash:y??``,external:D,unmaskOnReload:t.unmaskOnReload}},r=t(e);if(e.mask)r.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let n=v(r.pathname,this.processedTree);if(n){let i=Object.assign(Object.create(null),n.rawParams),{from:a,params:o,...s}=n.route,c=Ct(o,i);r.maskedLocation=t({from:e.from,...s,params:c})}}return r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=x(this.latestLocation.href)===x(n.href)&&b(ht(n.state),ht(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(D(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await rn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(mt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&pt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&D(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>an(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=S(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!b(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?b(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=r,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??Ze,parseSearch:t.parseSearch??Xe,protocolAllowlist:t.protocolAllowlist??p}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=T(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[r,i,a]=this.getMatchedRoutes(e.pathname),o=r,s=!1;(a?a.path!==`/`&&i[`**`]:x(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let l=s?St(this.options.notFoundMode,o):void 0,u=Array(o.length),d=this._committed,f=(e,t)=>{let n=d[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?d.find(t=>t.routeId===e.id):void 0},p;for(let r=0;r<o.length;r++){let a=o[r],s=u[r-1],d,m,h;{let n=s?.search??e.search,r=s?._strictSearch??void 0;try{let e=bt(a.options.validateSearch,{...n})??void 0;d={...n,...e},m={...r,...e}}catch(e){let r=e;if(e instanceof vt||(r=new vt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,m={},h=r}}let g=``,_=``;try{g=a.options.loaderDeps?.({search:d})??``,_=g&&JSON.stringify(g)||``}catch(e){if(t?.throwOnError)throw e;h??=e}let{interpolatedPath:v,usedParams:y}=c({path:a.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=a.id+v+_,x=f(a,r),S=this._cache.get(b)??(x?.id===b?x:void 0);p=S?._strictParams??Object.assign(y,p);let C;if(!S)try{wt(a,p)}catch(e){if(C=I(e)||ie(e)?e:new yt(e.message,{cause:e}),t?.throwOnError)throw C}let w=x?`stay`:`enter`,T;if(S)T={...S,cause:w,search:O(x?x.search:S.search,d),_strictSearch:m,searchError:h};else{let e=pt(a)?`pending`:`success`;T={id:b,ssr:a.options.ssr,index:r,routeId:a.id,params:x?.params??p,_strictParams:p,pathname:v,updatedAt:Date.now(),search:x?O(x.search,d):d,_strictSearch:m,searchError:h,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:x?n(x.loaderDeps,g):g,invalid:!1,preload:!1,staticData:a.options.staticData||{},fullPath:a.fullPath}}let E=l===a.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,u[r]=T}for(let e=0;e<u.length;e++){let n=u[e];n.params=n.cause===`stay`?O(n.params,p):p,t?._controller&&(n.context={})}return u}matchRoutesLightweight(e){let t=d(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=d(a),c={...e.search};for(let e of a)try{Object.assign(c,bt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{wt(t,e)}catch{}u=e}let f=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,f]),f}},vt=class extends Error{},yt=class extends Error{};function bt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new vt(`Async validation not supported`);if(n.issues)throw new vt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function xt(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=bt(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=g(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function St(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return ne}function Ct(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,g(e,n))}function wt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Tt(e,t){return e.options[t]?.preload?.()}function Et(e,t){let n=Tt(e,`component`),r=Tt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function z(e,t,n){let r=()=>t===!1?void 0:t?Tt(e,t):Et(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Dt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var B=0,V=1,Ot=2,H=3,U=[4];function kt(e){return typeof e[0]==`number`}function W(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function G(e,t){return e.routesById[t.routeId]}function At(e,t,n){return ie(e)?[H,e]:I(e)?(e.routeId||=n,[Ot,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[V,e]):[B,e]}function jt(e,t){let n=At(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=At(t,!0,e.id)}return n}function Mt(e,t,n,r,i){return i[0].signal.aborted?U:Gt(e,t,n,jt(n,r),i)}async function Nt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=G(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}if(c.aborted)return[i,U];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[i,Mt(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{It(e,r,`beforeLoad`,n[0]);let a=await W(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,U];let o=Gt(e,t,u,At(a,!1,u.id),n);if(o[0]!==B)return K(e,r),[i,o];r.context={...r.context,...a}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}finally{r.status=h,It(e,r,!1,n[0])}}i()}function Pt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function K(e,t){let n=t._flight;t._flight=void 0,Pt(e,t,n)?.abort()}function q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Pt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ft(e){for(let t of e){let e=t._flight;e&&e[2]++}}function It(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Lt(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Rt(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return U;if(!i)return[B,void 0];let l=n._flight;It(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Lt(e,t,n,r,s,a,!!o[3]))).then(e=>At(e,!1,r.id),e=>At(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?jt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Gt(e,t,r,await W(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return K(e,n),U}finally{It(e,n,!1,s)}}function zt(e,t,n){t[0]!==H&&(e.status=`success`,e.error=void 0,t[0]===B?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Bt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&K(e,r)}function Vt(e,t){return t[0]===V||t[0]===Ot?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Ht(e,t,n,r,i,a,o){let s=t[1][n],c=G(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Lt(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=U)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,K(e,s),p=Mt(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Pt(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?Rt(e,t,s,c,g,i,a):Promise.resolve([B,s.loaderData])).then(t=>(x&&(zt(s,t,l),t[0]===B&&(m&&!a[0].signal.aborted&&Bt(e,s,u),n>=o&&(s.status=`pending`))),t)),T=W(Promise.resolve().then(()=>z(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,Mt(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===B&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>Vt(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Rt(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,zt(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Vt(E,e))}async function Ut(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=G(e,t[n]);try{let e=z(i,!1);e&&await W(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Wt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Gt(e,t,n,r,i,a){for(;r[0]===H;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[H,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[V,e]:jt(n,e),a=!0}}return r}async function Kt(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ot?Ut(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=H)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=H){let n=s[1];if(n[0]!==H||n[1].options.reloadDocument||n[2])return J(e,t),n;c=!0,s=[0,[V,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=G(e,u);try{await W(i?Promise.resolve().then(()=>z(m,l===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return J(e,t),U}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,o),p()):u.status=`success`}return t}async function qt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=G(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await W(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Jt(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Ut(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||i._notFound||e.preload||a?.id!==e.id||a.status!==`success`||a._notFound)break;l++}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Ht(e,i,t,u,f,r,l)},m=await Nt(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ot){let t=await Ut(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=H&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Kt(e,i,u,r[0],Wt(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Wt(i[2],void 0,void 0,h.then(e=>kt(e)?0:Dt(n).length,()=>0))),o=await h}catch(t){if(J(e,i),t===a&&a.aborted)return U;throw t}return kt(o)?o:qt(e,o,a,r[6]===n.length?r[6]:0)}function Yt(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=G(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Yt(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Y(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Xt(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Dt(t[3]).some(e=>e.id===n[1]))return;let i;try{await W(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Zt(e,t){e._committed=t,e.stores.setMatches(t)}function Qt(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Dt(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<o||e.status===`success`)))continue;let i=G(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,Zt(e,n),q(e,[...a.values(),...i],[...n,...s.values()]),gt(e,i,n,t)}async function $t(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function en(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function tn(e,t,n,r,i){let a=n.map(e=>({...e}));Ft(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Kt(e,o,r,t[0],i)}catch(t){throw q(e,a),t}if(kt(s)){q(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await en(e,t,s);return}if(await qt(e,s,t[0].signal),e._tx!==t||e._committed!==n){q(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),K(e,n))}Zt(e,a),q(e,n,a)}async function nn(e,t,n,r,i,a){let o=await Jt(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(kt(o)){let n=o[0]===H&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Y(e,t),q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Y(e,t);return}await en(e,t,o);return}let s=o[1];if(e._tx===t&&await Xt(e,t),e._tx!==t){Y(e,t),q(e,s),J(e,o);return}let c=t[2],l=mt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Xt(e,t),e._tx!==t){Y(e,t),q(e,s),J(e,o);return}let n=await e.startTransition(()=>{Y(e,t),Qt(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){J(e,o);return}u?.length&&tn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function rn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=mt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await $t(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ft(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){q(e,m),await $t(e,n);return}e._preflight=void 0;let g,_=()=>nn(e,y,f,()=>Yt(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&It(e,t,!1)}n[0].abort(),q(e,n[3],y[3],!0)}if(e._tx!==y){q(e,y[3]),y[3]=[],g?.(),await $t(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Yt(e,y),g?.(_()),await v,await $t(e,y)}async function an(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Ft(a),o=(e._preloads??=new Map).set(i,a),s=await Jt(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),q(e,a)),i.abort()}if(!kt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){I(e)||console.error(e);return}}}var on=class extends N.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?N.createElement(this.props.errorComponent??sn,{error:e,reset:this.reset}):this.props.children}};function sn({error:e}){let[t,n]=N.useState(!1);return F(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[F(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[P(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),P(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),P(`div`,{style:{height:`.25rem`}}),t?P(`div`,{children:P(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?P(`code`,{children:e.message}):null})}):null]})}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function cn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function ln(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var un=[],dn=0,{link:fn,unlink:pn,propagate:mn,checkDirty:hn,shallowPropagate:gn}=cn({update(e){return e._update()},notify(e){un[vn++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,xn(e))}}),_n=0,vn=0,Z,yn=0;function bn(e){try{++yn,e()}finally{--yn||Sn()}}function xn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=pn(n,e)}function Sn(){if(!(yn>0)){for(;_n<vn;){let e=un[_n];un[_n++]=void 0,e.notify()}_n=0,vn=0}}function Cn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&fn(i,Z,dn),i._snapshot},subscribe(e){let t=ln(e),n={current:!1},r=wn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++dn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),xn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&hn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&gn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&fn(i,Z,dn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(mn(e),gn(e),Sn())}},i}function wn(e){let t=()=>{let t=Z;Z=n,++dn,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,xn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&hn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,xn(this)}};return t(),n}function Tn(e){let t=M(),n=`not-found-${w(t.stores.location,e=>e.pathname)}-${w(t.stores.status,e=>e)}`;return P(on,{getResetKey:()=>n,onCatch:(t,n)=>{if(I(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(I(t))return e.fallback?.(t);throw t},children:e.children})}function En(){return P(`p`,{children:`Not Found`})}function Q(e){return P(Ae,{children:e.children})}function Dn(e,t,n){return t.options.notFoundComponent?P(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?P(e.options.defaultNotFoundComponent,{...n}):P(En,{})}function On(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?P(n,{}):null}var kn=(e,t)=>e[0]===t[0]&&e[1]===t[1],An=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,jn=N.memo(function({routeId:e}){let t=M();return P(Mn,{router:t,match:w(t.stores.getMatchStore(e),e=>e)})});function Mn({router:e,match:t}){let n=e.routesById[t.routeId],r=On(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,c=t.ssr===!1||t.ssr===`data-only`,l=An(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||c))?N.Suspense:Q,u=i?on:Q,d=o?Tn:Q;return F(n.isRoot?n.options.shellComponent??Q:Q,{children:[P(te.Provider,{value:t.routeId,children:P(l,{fallback:r,children:P(u,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(I(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:P(d,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return N.createElement(o,e)},children:c?P(s,{fallback:r,children:P(Nn,{match:t})}):P(Nn,{match:t})})})})}),null]})}var Nn=N.memo(function({match:e}){let t=M(),n=e.routeId,r=t.routesById[n],i=N.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=N.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?P(e,{},i):P(Pn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!An(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return On(t,r)}if(e.status===`notFound`)return Dn(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Pn=N.memo(function(){let e=M(),t=N.useContext(te),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=w(a,e=>[!!e._notFound,e.error],kn),i=w(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Dn(e,e.routesById[t],r);if(!i)return null;let a=P(jn,{routeId:i});return t===`__root__`?P(N.Suspense,{fallback:On(e),children:a}):a});function Fn(e,t){let n=e[1];e.length=0,n?.(t)}function In({t:e}){let t=M(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Fn(n,!1),n.push(i,a),e(t),N.startTransition(r)}),ee(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(x(r.publicHref)!==x(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...mt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Ln(){let e=M(),t=e.routesById[ne],n=On(e,t),r=e.ssr?Q:N.Suspense,i=F(Ae,{children:[P(In,{t:N.useState()[1]}),P(r,{fallback:n,children:P(Rn,{})})]});return e.options.InnerWrap?P(e.options.InnerWrap,{children:i}):i}function Rn(){let e=M(),t=e._rendered,n=w(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ee(()=>{t[0]===n&&Fn(t,!0)},[t,n]);let a=i?P(jn,{routeId:i}):null;return P(te.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:P(on,{getResetKey:()=>r,onCatch:void 0,children:a})})}var zn=e=>({createMutableStore:Cn,createReadonlyStore:Cn,batch:bn}),Bn=e=>new Vn(e),Vn=class extends _t{constructor(e){super(e,zn)}};function Hn({router:e,children:t,...n}){l(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=P(oe.Provider,{value:e,children:t});return e.options.Wrap?P(e.options.Wrap,{children:r}):r}function Un({router:e,...t}){return P(Hn,{router:e,...t,children:P(Ln,{})})}var Wn=Me.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
  justify-content: center;
@@ -10,4 +10,4 @@ import{$t as e,Qt as t,Sn as n,Tt as r,V as i,W as a,Xt as o,Yt as s,Zt as c,_n
10
10
  font-size: 13px;
11
11
  color: ${({theme:e})=>e.color.inkDim};
12
12
  max-width: 48ch;
13
- `,Kn=re()({component:Pn,notFoundComponent:()=>P(Wn,{children:F(se,{$gap:3,style:{alignItems:`center`},children:[P(le,{children:`Not found`}),P(Gn,{children:`This console has no screen at that address.`}),P(ce,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),qn=`stream:console`,Jn={"res:usage":{predicate:e=>e.queryKey[0]===`usage`||e.queryKey[0]===`client`&&(e.queryKey[1]===`usage`||e.queryKey[1]===`summary`)},"res:logs":{predicate:e=>e.queryKey[0]===`logs`&&e.queryKey[1]!==`body`||e.queryKey[0]===`client`&&e.queryKey[1]===`logs`},"res:credentials":{queryKey:a.credentials},"res:keys":{queryKey:a.keys},"res:settings":{queryKey:a.settings},"res:models":{queryKey:a.models},"res:quota":{queryKey:[`quota-history`]},[qn]:{queryKey:[`console`]}},Yn=Object.keys(Jn),Xn=Yn.filter(e=>e.startsWith(`res:`)),Zn=Yn.filter(e=>e.startsWith(`stream:`));function Qn(e,t){if(t===`res:*`){er(e);return}let n=Jn[t];n!==void 0&&e.invalidateQueries(n)}function $n(e){for(let t of Yn)Qn(e,t)}function er(e){e.invalidateQueries()}var tr=4401,nr=500,rr=3e4,ir=new Set([...Xn,...Zn]),ar=3,or=6e4,sr=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)};function cr(){let{protocol:e,host:t}=window.location;return`${e===`https:`?`wss:`:`ws:`}//${t}/api/stream`}function lr(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t,{type:r,topic:i,seq:a}=n;return typeof r!=`string`||i!==void 0&&typeof i!=`string`||a!==void 0&&typeof a!=`number`?null:{type:r,...typeof i==`string`?{topic:i}:{},...typeof a==`number`?{seq:a}:{},...`payload`in n?{payload:n.payload}:{}}}function ur(e){let t=new Set,n=new Set,r=new Map,i=new Map,a=new Map,o=e=>a.has(e)||ir.has(e),s=[],c=null,l=!1,u=!1,d=!1,f=!1,p=!1,m=0,h=null,g={status:`poll`,pushed:()=>!1};function _(){let e=p?`offline`:u&&!f?`push`:`poll`,r=e===`push`;g={status:e,pushed:e=>r&&n.has(e)};for(let e of t)e()}function v(e){c?.send(JSON.stringify(e))}function y(e,t){let n=i.get(e);if(n===void 0||n.size===0)return!1;for(let e of[...n])e(t);return!0}function b(){for(let e of Xn)v({type:`subscribe`,topic:e});for(let e of Zn){let t=r.get(e);v(t===void 0?{type:`subscribe`,topic:e}:{type:`subscribe`,topic:e,sinceSeq:t})}for(let e of a.keys())v({type:`subscribe`,topic:e})}function x(){u=!0,m=0,n.clear(),d&&$n(e.client),d=!0,b(),_()}function S(t){let i=lr(t.data);if(i===null)return;let{topic:a}=i;if(i.type===`ack`){a!==void 0&&o(a)&&(n.add(a),y(a,{kind:`open`}),_());return}if(i.type===`error`){a!==void 0&&(n.delete(a)&&_(),y(a,{kind:`refused`}));return}if(a!==void 0){if(i.type===`gap`){i.seq!==void 0&&r.set(a,i.seq),y(a,{kind:`gap`}),Qn(e.client,a);return}if(i.type===`event`){if(a===`res:*`){er(e.client);return}if(i.seq!==void 0){let t=r.get(a);if(r.set(a,i.seq),t!==void 0&&i.seq>t+1){y(a,{kind:`gap`}),Qn(e.client,a);return}}i.payload!==void 0&&y(a,{kind:`frame`,payload:i.payload})||Qn(e.client,a)}}}function C(t){let r=u;u=!1,c=null,n.clear();for(let e of[...i.keys()])y(e,{kind:`closed`});if(l){if(t.code===tr){p=!0,l=!1,_(),er(e.client);return}if(!r)f=!0;else{let t=e.now();s=[...s.filter(e=>e>t-or),t],s.length>=ar&&(f=!0)}_(),w()}}function w(){let t=Math.min(rr,nr*2**m);m+=1,h=e.timer(()=>{h=null,l&&T()},t)}function T(){let t=new WebSocket(e.url());c=t,t.addEventListener(`open`,x),t.addEventListener(`message`,S),t.addEventListener(`close`,C)}function E(e,t){let n=i.get(e)??new Set;return i.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&i.delete(e)}}return{subscribe(e){return t.add(e),()=>{t.delete(e)}},snapshot:()=>g,hold(e,t){let r=E(e,t),i=(a.get(e)??0)+1;a.set(e,i),i===1&&u&&v({type:`subscribe`,topic:e}),n.has(e)&&t({kind:`open`});let o=!1;return()=>{if(o)return;o=!0,r();let t=(a.get(e)??1)-1;if(t>0){a.set(e,t);return}a.delete(e),n.delete(e)&&_(),u&&v({type:`unsubscribe`,topic:e})}},publish(e,t){return!u||!n.has(e)?!1:(v({type:`send`,topic:e,payload:t}),!0)},onStream:E,start(){return l=!0,T(),()=>{l=!1,h?.(),h=null;let e=c;c=null,u=!1,e?.close()}}}}var dr=we(null),fr=we(null),pr=we(null),mr={status:`poll`,pushed:()=>!1};function hr({children:e,enabled:t=!0,timer:n=sr,now:r=Date.now,url:i=cr}){let a=Se(),[o]=Oe(()=>ur({client:a,timer:n,now:r,url:i})),[s]=Oe(()=>({subscribe:(e,t)=>o.hold(e,e=>{if(e.kind===`gap`){t({kind:`closed`});return}t(e)}),send:o.publish}));Ee(()=>{if(t)return o.start()},[o,t]);let c=ke(o.subscribe,o.snapshot,o.snapshot);return P(dr,{value:c,children:P(fr,{value:o.onStream,children:P(pr,{value:s,children:e})})})}function gr(){return Te(dr)??mr}function _r(e,t){let n=Te(fr),r=De(t);Ee(()=>{r.current=t}),Ee(()=>{if(n!==null)return n(e,e=>r.current(e))},[n,e])}function vr(e,t){let n=Te(pr),r=De(t);Ee(()=>{r.current=t}),Ee(()=>{if(n!==null&&e!==null)return n.subscribe(e,e=>r.current(e))},[n,e])}function yr({children:e}){let t=gr(),n=Te(pr);return P(me,{connection:t,...n===null?{}:{channels:n},children:e})}async function br(e){return e.queryClient.ensureQueryData({queryKey:a.status,queryFn:()=>de(`/api/status`),revalidateIfStale:!0})}function xr(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function Sr(e,t){let n=xr(e);if(n===`/login`)throw ae({to:`/login`,search:{next:t}});if(n!==`/`)throw ae({to:n})}function Cr(e,t){let n=xr(e);if(n===`/login`)throw ae({to:`/login`,search:{next:t}});if(n!==`/client`)throw ae({to:n})}var wr=A(`/_app`)({beforeLoad:async({context:e,location:t})=>{Sr(await br(e),t.href),await e.queryClient.ensureQueryData(i)},pendingComponent:Tr,pendingMs:200,errorComponent:k(()=>j(()=>import(`./_app-CWXzHdhc.js`),__vite__mapDeps([0,1])),`errorComponent`),component:Er});function Tr(){return P(pe,{legend:`Console`,children:P(ue,{rows:6})})}function Er(){let e=r().data??[];return P(hr,{children:F(yr,{children:[P(he,{$providers:e}),P(ge,{children:P(Pn,{})})]})})}var Dr=A(`/client`)({beforeLoad:async({context:e,location:t})=>{Cr(await br(e),t.href)},component:k(()=>j(()=>import(`./client-Q2fvA2EK.js`),__vite__mapDeps([2,3,4,1,5,6,7,8,9,10,11,12,13,14,15])),`component`)}),Or=A(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:k(()=>j(()=>import(`./login-Br_AimWR.js`),__vite__mapDeps([16,4,1,7,17])),`component`)}),kr=A(`/_app/`)({component:k(()=>j(()=>import(`./_app.index-BG6mGxkv.js`),__vite__mapDeps([18,4,1,5,12,13,8,9,15])),`component`)}),Ar=A(`/_app/accounts`)({component:k(()=>j(()=>import(`./_app.accounts-CGFOyYZc.js`),__vite__mapDeps([19,4,1,5,20,6,21,22,23,13,7,8,9,10,3])),`component`)}),jr=A(`/_app/console`)({component:k(()=>j(()=>import(`./_app.console-DrCT8eLd.js`),__vite__mapDeps([24,4,1,5,7])),`component`)}),Mr=A(`/_app/database`)({component:k(()=>j(()=>import(`./_app.database-D32je-GL.js`),__vite__mapDeps([25,4,1,5,22,7,8,9,15,17])),`component`)}),Nr=A(`/_app/keys`)({component:k(()=>j(()=>import(`./_app.keys-C1AjjeHc.js`),__vite__mapDeps([26,4,1,5,20,6,21,23,13,7,8,9])),`component`)}),Pr=A(`/_app/logs`)({component:k(()=>j(()=>import(`./_app.logs-BDLj_H_j.js`),__vite__mapDeps([27,4,1,5,13,7,11,12,9])),`component`)}),Fr=A(`/_app/models`)({component:k(()=>j(()=>import(`./_app.models-Cgg7gVSF.js`),__vite__mapDeps([28,4,1,5,21,22,23,13,7,8])),`component`)}),Ir=A(`/_app/settings`)({component:k(()=>j(()=>import(`./_app.settings-B7lKNDoh.js`),__vite__mapDeps([29,4,1,5,23,7,8,17])),`component`)}),Lr=A(`/_app/usage`)({component:k(()=>j(()=>import(`./_app.usage-DjqlIHDL.js`),__vite__mapDeps([30,3,4,1,5,9,14,15])),`component`)}),Rr=A(`/_app/plugins/$pluginId`)({component:k(()=>j(()=>import(`./_app.plugins._pluginId-C5FSNOfN.js`),__vite__mapDeps([31,4,1,32,5])),`component`)}),$=wr.update({id:`/_app`,getParentRoute:()=>Kn}),zr=Dr.update({id:`/client`,path:`/client`,getParentRoute:()=>Kn}),Br=Or.update({id:`/login`,path:`/login`,getParentRoute:()=>Kn}),Vr=kr.update({id:`/`,path:`/`,getParentRoute:()=>$}),Hr={AppAccountsRoute:Ar.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:jr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:Mr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:Nr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:Pr.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:Fr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:Ir.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:Lr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:Vr,AppPluginsPluginIdRoute:Rr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},Ur={AppRoute:$._addFileChildren(Hr),ClientRoute:zr,LoginRoute:Br},Wr=Kn._addFileChildren(Ur)._addFileTypes();function Gr(e){return{isLoginRoute:()=>e().state.location.pathname===`/login`,onUnauthenticated:()=>void e().navigate({to:`/login`,search:{next:e().state.location.href}})}}function Kr(e){let t=t=>{t instanceof fe&&t.isUnauthenticated&&(e.isLoginRoute()||e.onUnauthenticated())};return new be({queryCache:new ye({onError:t}),mutationCache:new ve({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof fe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var qr,Jr=Kr(Gr(()=>qr));qr=Bn({routeTree:Wr,context:{queryClient:Jr}});var Yr=document.getElementById(`root`);if(Yr===null)throw Error(`#root is missing from index.html`);je(Yr).render(P(Ce,{children:P(_e,{children:P(xe,{client:Jr,children:P(Un,{router:qr})})})}));export{vr as a,Qn as c,yr as i,Or as n,_r as o,hr as r,qn as s,Rr as t};
13
+ `,Kn=re()({component:Pn,notFoundComponent:()=>P(Wn,{children:F(se,{$gap:3,style:{alignItems:`center`},children:[P(le,{children:`Not found`}),P(Gn,{children:`This console has no screen at that address.`}),P(ce,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),qn=`stream:console`,Jn={"res:usage":{predicate:e=>e.queryKey[0]===`usage`||e.queryKey[0]===`client`&&(e.queryKey[1]===`usage`||e.queryKey[1]===`summary`)},"res:logs":{predicate:e=>e.queryKey[0]===`logs`&&e.queryKey[1]!==`body`||e.queryKey[0]===`client`&&e.queryKey[1]===`logs`},"res:credentials":{queryKey:a.credentials},"res:keys":{queryKey:a.keys},"res:settings":{queryKey:a.settings},"res:models":{queryKey:a.models},"res:quota":{queryKey:[`quota-history`]},[qn]:{queryKey:[`console`]}},Yn=Object.keys(Jn),Xn=Yn.filter(e=>e.startsWith(`res:`)),Zn=Yn.filter(e=>e.startsWith(`stream:`));function Qn(e,t){if(t===`res:*`){er(e);return}let n=Jn[t];n!==void 0&&e.invalidateQueries(n)}function $n(e){for(let t of Yn)Qn(e,t)}function er(e){e.invalidateQueries()}var tr=4401,nr=500,rr=3e4,ir=new Set([...Xn,...Zn]),ar=3,or=6e4,sr=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)};function cr(){let{protocol:e,host:t}=window.location;return`${e===`https:`?`wss:`:`ws:`}//${t}/api/stream`}function lr(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t,{type:r,topic:i,seq:a}=n;return typeof r!=`string`||i!==void 0&&typeof i!=`string`||a!==void 0&&typeof a!=`number`?null:{type:r,...typeof i==`string`?{topic:i}:{},...typeof a==`number`?{seq:a}:{},...`payload`in n?{payload:n.payload}:{}}}function ur(e){let t=new Set,n=new Set,r=new Map,i=new Map,a=new Map,o=e=>a.has(e)||ir.has(e),s=[],c=null,l=!1,u=!1,d=!1,f=!1,p=!1,m=0,h=null,g={status:`poll`,pushed:()=>!1};function _(){let e=p?`offline`:u&&!f?`push`:`poll`,r=e===`push`;g={status:e,pushed:e=>r&&n.has(e)};for(let e of t)e()}function v(e){c?.send(JSON.stringify(e))}function y(e,t){let n=i.get(e);if(n===void 0||n.size===0)return!1;for(let e of[...n])e(t);return!0}function b(){for(let e of Xn)v({type:`subscribe`,topic:e});for(let e of Zn){let t=r.get(e);v(t===void 0?{type:`subscribe`,topic:e}:{type:`subscribe`,topic:e,sinceSeq:t})}for(let e of a.keys())v({type:`subscribe`,topic:e})}function x(){u=!0,m=0,n.clear(),d&&$n(e.client),d=!0,b(),_()}function S(t){let i=lr(t.data);if(i===null)return;let{topic:a}=i;if(i.type===`ack`){a!==void 0&&o(a)&&(n.add(a),y(a,{kind:`open`}),_());return}if(i.type===`error`){a!==void 0&&(n.delete(a)&&_(),y(a,{kind:`refused`}));return}if(a!==void 0){if(i.type===`gap`){i.seq!==void 0&&r.set(a,i.seq),y(a,{kind:`gap`}),Qn(e.client,a);return}if(i.type===`event`){if(a===`res:*`){er(e.client);return}if(i.seq!==void 0){let t=r.get(a);if(r.set(a,i.seq),t!==void 0&&i.seq>t+1){y(a,{kind:`gap`}),Qn(e.client,a);return}}i.payload!==void 0&&y(a,{kind:`frame`,payload:i.payload})||Qn(e.client,a)}}}function C(t){let r=u;u=!1,c=null,n.clear();for(let e of[...i.keys()])y(e,{kind:`closed`});if(l){if(t.code===tr){p=!0,l=!1,_(),er(e.client);return}if(!r)f=!0;else{let t=e.now();s=[...s.filter(e=>e>t-or),t],s.length>=ar&&(f=!0)}_(),w()}}function w(){let t=Math.min(rr,nr*2**m);m+=1,h=e.timer(()=>{h=null,l&&T()},t)}function T(){let t=new WebSocket(e.url());c=t,t.addEventListener(`open`,x),t.addEventListener(`message`,S),t.addEventListener(`close`,C)}function E(e,t){let n=i.get(e)??new Set;return i.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&i.delete(e)}}return{subscribe(e){return t.add(e),()=>{t.delete(e)}},snapshot:()=>g,hold(e,t){let r=E(e,t),i=(a.get(e)??0)+1;a.set(e,i),i===1&&u&&v({type:`subscribe`,topic:e}),n.has(e)&&t({kind:`open`});let o=!1;return()=>{if(o)return;o=!0,r();let t=(a.get(e)??1)-1;if(t>0){a.set(e,t);return}a.delete(e),n.delete(e)&&_(),u&&v({type:`unsubscribe`,topic:e})}},publish(e,t){return!u||!n.has(e)?!1:(v({type:`send`,topic:e,payload:t}),!0)},onStream:E,start(){return l=!0,T(),()=>{l=!1,h?.(),h=null;let e=c;c=null,u=!1,e?.close()}}}}var dr=we(null),fr=we(null),pr=we(null),mr={status:`poll`,pushed:()=>!1};function hr({children:e,enabled:t=!0,timer:n=sr,now:r=Date.now,url:i=cr}){let a=Se(),[o]=Oe(()=>ur({client:a,timer:n,now:r,url:i})),[s]=Oe(()=>({subscribe:(e,t)=>o.hold(e,e=>{if(e.kind===`gap`){t({kind:`closed`});return}t(e)}),send:o.publish}));Ee(()=>{if(t)return o.start()},[o,t]);let c=ke(o.subscribe,o.snapshot,o.snapshot);return P(dr,{value:c,children:P(fr,{value:o.onStream,children:P(pr,{value:s,children:e})})})}function gr(){return Te(dr)??mr}function _r(e,t){let n=Te(fr),r=De(t);Ee(()=>{r.current=t}),Ee(()=>{if(n!==null)return n(e,e=>r.current(e))},[n,e])}function vr(e,t){let n=Te(pr),r=De(t);Ee(()=>{r.current=t}),Ee(()=>{if(n!==null&&e!==null)return n.subscribe(e,e=>r.current(e))},[n,e])}function yr({children:e}){let t=gr(),n=Te(pr);return P(me,{connection:t,...n===null?{}:{channels:n},children:e})}async function br(e){return e.queryClient.ensureQueryData({queryKey:a.status,queryFn:()=>de(`/api/status`),revalidateIfStale:!0})}function xr(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function Sr(e,t){let n=xr(e);if(n===`/login`)throw ae({to:`/login`,search:{next:t}});if(n!==`/`)throw ae({to:n})}function Cr(e,t){let n=xr(e);if(n===`/login`)throw ae({to:`/login`,search:{next:t}});if(n!==`/client`)throw ae({to:n})}var wr=A(`/_app`)({beforeLoad:async({context:e,location:t})=>{Sr(await br(e),t.href),await e.queryClient.ensureQueryData(i)},pendingComponent:Tr,pendingMs:200,errorComponent:k(()=>j(()=>import(`./_app-CWXzHdhc.js`),__vite__mapDeps([0,1])),`errorComponent`),component:Er});function Tr(){return P(pe,{legend:`Console`,children:P(ue,{rows:6})})}function Er(){let e=r().data??[];return P(hr,{children:F(yr,{children:[P(he,{$providers:e}),P(ge,{children:P(Pn,{})})]})})}var Dr=A(`/client`)({beforeLoad:async({context:e,location:t})=>{Cr(await br(e),t.href)},component:k(()=>j(()=>import(`./client-De1_cEH5.js`),__vite__mapDeps([2,3,4,1,5,6,7,8,9,10,11,12,13,14,15])),`component`)}),Or=A(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:k(()=>j(()=>import(`./login-CkZlwcdd.js`),__vite__mapDeps([16,4,1,7,17])),`component`)}),kr=A(`/_app/`)({component:k(()=>j(()=>import(`./_app.index-Blw3S4-3.js`),__vite__mapDeps([18,4,1,5,12,13,8,9,15])),`component`)}),Ar=A(`/_app/accounts`)({component:k(()=>j(()=>import(`./_app.accounts-DFhyE62a.js`),__vite__mapDeps([19,4,1,5,20,6,21,22,23,13,7,8,9,10,3])),`component`)}),jr=A(`/_app/console`)({component:k(()=>j(()=>import(`./_app.console-BfHcfQMp.js`),__vite__mapDeps([24,4,1,5,7])),`component`)}),Mr=A(`/_app/database`)({component:k(()=>j(()=>import(`./_app.database-Cgw9z3rK.js`),__vite__mapDeps([25,4,1,5,22,7,8,9,15,17])),`component`)}),Nr=A(`/_app/keys`)({component:k(()=>j(()=>import(`./_app.keys-DrdfnfIk.js`),__vite__mapDeps([26,4,1,5,20,6,21,23,13,7,8,9])),`component`)}),Pr=A(`/_app/logs`)({component:k(()=>j(()=>import(`./_app.logs-DUOqlJzB.js`),__vite__mapDeps([27,4,1,5,13,7,11,12,9])),`component`)}),Fr=A(`/_app/models`)({component:k(()=>j(()=>import(`./_app.models-Dm83HRaM.js`),__vite__mapDeps([28,4,1,5,21,22,23,13,7,8])),`component`)}),Ir=A(`/_app/settings`)({component:k(()=>j(()=>import(`./_app.settings-66rm4vHJ.js`),__vite__mapDeps([29,4,1,5,23,7,8,17])),`component`)}),Lr=A(`/_app/usage`)({component:k(()=>j(()=>import(`./_app.usage-BCufy5XR.js`),__vite__mapDeps([30,3,4,1,5,9,14,15])),`component`)}),Rr=A(`/_app/plugins/$pluginId`)({component:k(()=>j(()=>import(`./_app.plugins._pluginId-BmJGDYxw.js`),__vite__mapDeps([31,4,1,32,5])),`component`)}),$=wr.update({id:`/_app`,getParentRoute:()=>Kn}),zr=Dr.update({id:`/client`,path:`/client`,getParentRoute:()=>Kn}),Br=Or.update({id:`/login`,path:`/login`,getParentRoute:()=>Kn}),Vr=kr.update({id:`/`,path:`/`,getParentRoute:()=>$}),Hr={AppAccountsRoute:Ar.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:jr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:Mr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:Nr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:Pr.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:Fr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:Ir.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:Lr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:Vr,AppPluginsPluginIdRoute:Rr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},Ur={AppRoute:$._addFileChildren(Hr),ClientRoute:zr,LoginRoute:Br},Wr=Kn._addFileChildren(Ur)._addFileTypes();function Gr(e){return{isLoginRoute:()=>e().state.location.pathname===`/login`,onUnauthenticated:()=>void e().navigate({to:`/login`,search:{next:e().state.location.href}})}}function Kr(e){let t=t=>{t instanceof fe&&t.isUnauthenticated&&(e.isLoginRoute()||e.onUnauthenticated())};return new be({queryCache:new ye({onError:t}),mutationCache:new ve({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof fe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var qr,Jr=Kr(Gr(()=>qr));qr=Bn({routeTree:Wr,context:{queryClient:Jr}});var Yr=document.getElementById(`root`);if(Yr===null)throw Error(`#root is missing from index.html`);je(Yr).render(P(Ce,{children:P(_e,{children:P(xe,{client:Jr,children:P(Un,{router:qr})})})}));export{vr as a,Qn as c,yr as i,Or as n,_r as o,hr as r,qn as s,Rr as t};
@@ -1,4 +1,4 @@
1
- import{Kt as e,Rt as t,Vt as n,t as r,yt as i}from"./Lamp-D7hJcQ90.js";import{C as a,D as o,E as s,_ as c,b as l,n as u,o as d}from"./Panel-BlNr9j6-.js";import{n as f}from"./index-D1ewvjU0.js";import{n as p,t as m}from"./Field-DcNu4yw-.js";import{t as h}from"./reasons-Du1OBWAM.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
1
+ import{Kt as e,Rt as t,Vt as n,t as r,yt as i}from"./Lamp-C2Q3t5Mn.js";import{C as a,D as o,E as s,_ as c,b as l,n as u,o as d}from"./Panel-BlNr9j6-.js";import{n as f}from"./index-PP8vsvw3.js";import{n as p,t as m}from"./Field-DcNu4yw-.js";import{t as h}from"./reasons-Du1OBWAM.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -0,0 +1 @@
1
+ import{b as e}from"./Rack-D0_N-xsd.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +1 @@
1
- import{Cn as e,Gt as t,Kt as n,Qt as r,Sn as i,nn as a,qt as o,tn as s,un as c,yn as l}from"./Lamp-D7hJcQ90.js";import{k as u}from"./Panel-BlNr9j6-.js";import*as d from"react";import f from"react";import{jsx as p}from"react/jsx-runtime";var m=`__root__`;function h(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function g(e){return e instanceof Response&&!!e.options}var _=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=m:this.parentRoute||c();let i=n?m:t?.path;i&&i!==`/`&&(i=s(i));let o=t?.id||i,l=n?m:r([this.parentRoute.id===`__root__`?``:this.parentRoute.id,o]);i===`__root__`&&(i=`/`),l!==`__root__`&&(l=r([`/`,l]));let u=l===`__root__`?`/`:r([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=a(u)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>h({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},v=class extends _{constructor(e){super(e)}},y=d.createContext(void 0),b=d.createContext(void 0),x={};function S(e,t){let n=d.useRef();return r=>{let a=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=i(n.current,a):a}}function C(e){let t=u(),n=d.useContext(e.from?b:y),r=e.from??n,i=t.stores.getMatchStore(r),a=S(e,t),s=o(i,e=>e?a(e):x);if(s!==x)return s;(e.shouldThrow??!0)&&c()}function w(e){return C({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function T(e){let{select:t,...n}=e;return C({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function E(e){return C({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function D(e){return C({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function O(e){return C({...e,select:t=>e.select?e.select(t.context):t.context})}var k=class extends _{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>n({from:this.fullPath}),this.Link=f.forwardRef((e,n)=>p(t,{ref:n,from:this.fullPath,...e}))}};function A(e){return new k(e)}function j(){return e=>N(e)}var M=class extends v{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>n({from:this.fullPath}),this.Link=f.forwardRef((e,n)=>p(t,{ref:n,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(e){return e=>{let t=A(e);return t.isRoot=!1,t}}function F(t,n){let r,i,a,o=()=>(r||=(a=void 0,t().then(e=>{r=void 0,s.preload=void 0,i=e[n??`default`]}).catch(e=>{r=void 0,a=e})),r),s=function(t){if(a){if(l(a)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${a.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw a}if(!i){if(e)e(o());else throw o()}return d.createElement(i,t)};return s.preload=o,s}var I=`modulepreload`,L=function(e){return`/`+e},R={},z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=L(t,n),t=s(t),t in R)return;R[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:I,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{y as a,m as c,j as i,F as n,g as o,P as r,h as s,z as t};
1
+ import{Cn as e,Gt as t,Kt as n,Qt as r,Sn as i,nn as a,qt as o,tn as s,un as c,yn as l}from"./Lamp-C2Q3t5Mn.js";import{k as u}from"./Panel-BlNr9j6-.js";import*as d from"react";import f from"react";import{jsx as p}from"react/jsx-runtime";var m=`__root__`;function h(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function g(e){return e instanceof Response&&!!e.options}var _=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=m:this.parentRoute||c();let i=n?m:t?.path;i&&i!==`/`&&(i=s(i));let o=t?.id||i,l=n?m:r([this.parentRoute.id===`__root__`?``:this.parentRoute.id,o]);i===`__root__`&&(i=`/`),l!==`__root__`&&(l=r([`/`,l]));let u=l===`__root__`?`/`:r([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=a(u)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>h({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},v=class extends _{constructor(e){super(e)}},y=d.createContext(void 0),b=d.createContext(void 0),x={};function S(e,t){let n=d.useRef();return r=>{let a=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=i(n.current,a):a}}function C(e){let t=u(),n=d.useContext(e.from?b:y),r=e.from??n,i=t.stores.getMatchStore(r),a=S(e,t),s=o(i,e=>e?a(e):x);if(s!==x)return s;(e.shouldThrow??!0)&&c()}function w(e){return C({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function T(e){let{select:t,...n}=e;return C({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function E(e){return C({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function D(e){return C({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function O(e){return C({...e,select:t=>e.select?e.select(t.context):t.context})}var k=class extends _{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>n({from:this.fullPath}),this.Link=f.forwardRef((e,n)=>p(t,{ref:n,from:this.fullPath,...e}))}};function A(e){return new k(e)}function j(){return e=>N(e)}var M=class extends v{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>n({from:this.fullPath}),this.Link=f.forwardRef((e,n)=>p(t,{ref:n,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(e){return e=>{let t=A(e);return t.isRoot=!1,t}}function F(t,n){let r,i,a,o=()=>(r||=(a=void 0,t().then(e=>{r=void 0,s.preload=void 0,i=e[n??`default`]}).catch(e=>{r=void 0,a=e})),r),s=function(t){if(a){if(l(a)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${a.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw a}if(!i){if(e)e(o());else throw o()}return d.createElement(i,t)};return s.preload=o,s}var I=`modulepreload`,L=function(e){return`/`+e},R={},z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=L(t,n),t=s(t),t in R)return;R[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:I,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{y as a,m as c,j as i,F as n,g as o,P as r,h as s,z as t};