@ainyc/canonry 4.50.0 → 4.51.0

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 (29) hide show
  1. package/assets/assets/BacklinksPage-DIZCcqsP.js +1 -0
  2. package/assets/assets/ChartPrimitives-9Kx3gzQL.js +1 -0
  3. package/assets/assets/ProjectPage-R2cxJb5Y.js +6 -0
  4. package/assets/assets/RunRow-DqezNIUy.js +1 -0
  5. package/assets/assets/RunsPage-CfvTJ9Ny.js +1 -0
  6. package/assets/assets/SettingsPage-HfMGIa5v.js +1 -0
  7. package/assets/assets/TrafficPage-DV_Dvpl3.js +1 -0
  8. package/assets/assets/TrafficSourceDetailPage-lefreKBO.js +1 -0
  9. package/assets/assets/arrow-left-DpxpMUNt.js +1 -0
  10. package/assets/assets/index-DKBPD33e.js +210 -0
  11. package/assets/assets/{index-DOP3oQmw.css → index-DeGyEwik.css} +1 -1
  12. package/assets/assets/server-traffic-Bm8iKtXK.js +1 -0
  13. package/assets/assets/trash-2-CnBiLbiZ.js +1 -0
  14. package/assets/assets/{vendor-markdown-DN2199pt.js → vendor-markdown-DK7fbRNb.js} +1 -1
  15. package/assets/assets/{vendor-radix-Bvy4KXTI.js → vendor-radix-B57xfQbP.js} +1 -1
  16. package/assets/assets/{vendor-recharts-DPeiXMwW.js → vendor-recharts-DWvKDyBF.js} +1 -1
  17. package/assets/assets/vendor-tanstack-Dq7p98wZ.js +1 -0
  18. package/assets/index.html +6 -6
  19. package/dist/{chunk-QIG3TKL4.js → chunk-2ARCCG5E.js} +72 -1
  20. package/dist/{chunk-M4USKXJ4.js → chunk-DLDLDWH4.js} +128 -40
  21. package/dist/{chunk-YVP5CTSV.js → chunk-FDR3G6SB.js} +2050 -1577
  22. package/dist/{chunk-MYDJ25GO.js → chunk-GGXU5VKI.js} +111 -77
  23. package/dist/cli.js +6 -6
  24. package/dist/index.js +4 -4
  25. package/dist/{intelligence-service-TY7IPRST.js → intelligence-service-XMZEWLCW.js} +2 -2
  26. package/dist/mcp.js +2 -2
  27. package/package.json +6 -6
  28. package/assets/assets/index-DVK0M62U.js +0 -214
  29. package/assets/assets/vendor-tanstack-DPXTJtWt.js +0 -1
@@ -0,0 +1 @@
1
+ function Zr(t,e){for(var s=0;s<e.length;s++){const r=e[s];if(typeof r!="string"&&!Array.isArray(r)){for(const n in r)if(n!=="default"&&!(n in t)){const i=Object.getOwnPropertyDescriptor(r,n);i&&Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se={exports:{}},At={};var Rs;function tn(){if(Rs)return At;Rs=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(r,n,i){var a=null;if(i!==void 0&&(a=""+i),n.key!==void 0&&(a=""+n.key),"key"in n){i={};for(var c in n)c!=="key"&&(i[c]=n[c])}else i=n;return n=i.ref,{$$typeof:t,type:r,key:a,ref:n!==void 0?n:null,props:i}}return At.Fragment=e,At.jsx=s,At.jsxs=s,At}var Ps;function en(){return Ps||(Ps=1,Se.exports=tn()),Se.exports}var O=en(),be={exports:{}},A={};var ws;function sn(){if(ws)return A;ws=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),o=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),h=Symbol.iterator;function d(m){return m===null||typeof m!="object"?null:(m=h&&m[h]||m["@@iterator"],typeof m=="function"?m:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,g={};function v(m,b,I){this.props=m,this.context=b,this.refs=g,this.updater=I||p}v.prototype.isReactComponent={},v.prototype.setState=function(m,b){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,b,"setState")},v.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function R(){}R.prototype=v.prototype;function _(m,b,I){this.props=m,this.context=b,this.refs=g,this.updater=I||p}var w=_.prototype=new R;w.constructor=_,y(w,v.prototype),w.isPureReactComponent=!0;var M=Array.isArray;function E(){}var S={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function P(m,b,I){var L=I.ref;return{$$typeof:t,type:m,key:b,ref:L!==void 0?L:null,props:I}}function T(m,b){return P(m.type,b,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===t}function B(m){var b={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(I){return b[I]})}var D=/\/+/g;function X(m,b){return typeof m=="object"&&m!==null&&m.key!=null?B(""+m.key):b.toString(36)}function q(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(E,E):(m.status="pending",m.then(function(b){m.status==="pending"&&(m.status="fulfilled",m.value=b)},function(b){m.status==="pending"&&(m.status="rejected",m.reason=b)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function Z(m,b,I,L,k){var j=typeof m;(j==="undefined"||j==="boolean")&&(m=null);var N=!1;if(m===null)N=!0;else switch(j){case"bigint":case"string":case"number":N=!0;break;case"object":switch(m.$$typeof){case t:case e:N=!0;break;case l:return N=m._init,Z(N(m._payload),b,I,L,k)}}if(N)return k=k(m),N=L===""?"."+X(m,0):L,M(k)?(I="",N!=null&&(I=N.replace(D,"$&/")+"/"),Z(k,b,I,"",function(kt){return kt})):k!=null&&(F(k)&&(k=T(k,I+(k.key==null||m&&m.key===k.key?"":(""+k.key).replace(D,"$&/")+"/")+N)),b.push(k)),1;N=0;var K=L===""?".":L+":";if(M(m))for(var H=0;H<m.length;H++)L=m[H],j=K+X(L,H),N+=Z(L,b,I,j,k);else if(H=d(m),typeof H=="function")for(m=H.call(m),H=0;!(L=m.next()).done;)L=L.value,j=K+X(L,H++),N+=Z(L,b,I,j,k);else if(j==="object"){if(typeof m.then=="function")return Z(q(m),b,I,L,k);throw b=String(m),Error("Objects are not valid as a React child (found: "+(b==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.")}return N}function It(m,b,I){if(m==null)return m;var L=[],k=0;return Z(m,L,"","",function(j){return b.call(I,j,k++)}),L}function ps(m){if(m._status===-1){var b=m._result;b=b(),b.then(function(I){(m._status===0||m._status===-1)&&(m._status=1,m._result=I)},function(I){(m._status===0||m._status===-1)&&(m._status=2,m._result=I)}),m._status===-1&&(m._status=0,m._result=b)}if(m._status===1)return m._result.default;throw m._result}var ge=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var b=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(b))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},Wt={map:It,forEach:function(m,b,I){It(m,function(){b.apply(this,arguments)},I)},count:function(m){var b=0;return It(m,function(){b++}),b},toArray:function(m){return It(m,function(b){return b})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return A.Activity=f,A.Children=Wt,A.Component=v,A.Fragment=s,A.Profiler=n,A.PureComponent=_,A.StrictMode=r,A.Suspense=u,A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,A.__COMPILER_RUNTIME={__proto__:null,c:function(m){return S.H.useMemoCache(m)}},A.cache=function(m){return function(){return m.apply(null,arguments)}},A.cacheSignal=function(){return null},A.cloneElement=function(m,b,I){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var L=y({},m.props),k=m.key;if(b!=null)for(j in b.key!==void 0&&(k=""+b.key),b)!x.call(b,j)||j==="key"||j==="__self"||j==="__source"||j==="ref"&&b.ref===void 0||(L[j]=b[j]);var j=arguments.length-2;if(j===1)L.children=I;else if(1<j){for(var N=Array(j),K=0;K<j;K++)N[K]=arguments[K+2];L.children=N}return P(m.type,k,L)},A.createContext=function(m){return m={$$typeof:a,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:i,_context:m},m},A.createElement=function(m,b,I){var L,k={},j=null;if(b!=null)for(L in b.key!==void 0&&(j=""+b.key),b)x.call(b,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(k[L]=b[L]);var N=arguments.length-2;if(N===1)k.children=I;else if(1<N){for(var K=Array(N),H=0;H<N;H++)K[H]=arguments[H+2];k.children=K}if(m&&m.defaultProps)for(L in N=m.defaultProps,N)k[L]===void 0&&(k[L]=N[L]);return P(m,j,k)},A.createRef=function(){return{current:null}},A.forwardRef=function(m){return{$$typeof:c,render:m}},A.isValidElement=F,A.lazy=function(m){return{$$typeof:l,_payload:{_status:-1,_result:m},_init:ps}},A.memo=function(m,b){return{$$typeof:o,type:m,compare:b===void 0?null:b}},A.startTransition=function(m){var b=S.T,I={};S.T=I;try{var L=m(),k=S.S;k!==null&&k(I,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(E,ge)}catch(j){ge(j)}finally{b!==null&&I.types!==null&&(b.types=I.types),S.T=b}},A.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},A.use=function(m){return S.H.use(m)},A.useActionState=function(m,b,I){return S.H.useActionState(m,b,I)},A.useCallback=function(m,b){return S.H.useCallback(m,b)},A.useContext=function(m){return S.H.useContext(m)},A.useDebugValue=function(){},A.useDeferredValue=function(m,b){return S.H.useDeferredValue(m,b)},A.useEffect=function(m,b){return S.H.useEffect(m,b)},A.useEffectEvent=function(m){return S.H.useEffectEvent(m)},A.useId=function(){return S.H.useId()},A.useImperativeHandle=function(m,b,I){return S.H.useImperativeHandle(m,b,I)},A.useInsertionEffect=function(m,b){return S.H.useInsertionEffect(m,b)},A.useLayoutEffect=function(m,b){return S.H.useLayoutEffect(m,b)},A.useMemo=function(m,b){return S.H.useMemo(m,b)},A.useOptimistic=function(m,b){return S.H.useOptimistic(m,b)},A.useReducer=function(m,b,I){return S.H.useReducer(m,b,I)},A.useRef=function(m){return S.H.useRef(m)},A.useState=function(m){return S.H.useState(m)},A.useSyncExternalStore=function(m,b,I){return S.H.useSyncExternalStore(m,b,I)},A.useTransition=function(){return S.H.useTransition()},A.version="19.2.4",A}var _s;function fe(){return _s||(_s=1,be.exports=sn()),be.exports}var C=fe();const Mt=fr(C),Do=Zr({__proto__:null,default:Mt},[C]);var Re={exports:{}},W={};var xs;function rn(){if(xs)return W;xs=1;var t=fe();function e(u){var o="https://react.dev/errors/"+u;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+u+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(e(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},n=Symbol.for("react.portal");function i(u,o,l){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:n,key:f==null?null:""+f,children:u,containerInfo:o,implementation:l}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,o){if(u==="font")return"";if(typeof o=="string")return o==="use-credentials"?o:""}return W.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,W.createPortal=function(u,o){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)throw Error(e(299));return i(u,o,null,l)},W.flushSync=function(u){var o=a.T,l=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=o,r.p=l,r.d.f()}},W.preconnect=function(u,o){typeof u=="string"&&(o?(o=o.crossOrigin,o=typeof o=="string"?o==="use-credentials"?o:"":void 0):o=null,r.d.C(u,o))},W.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},W.preinit=function(u,o){if(typeof u=="string"&&o&&typeof o.as=="string"){var l=o.as,f=c(l,o.crossOrigin),h=typeof o.integrity=="string"?o.integrity:void 0,d=typeof o.fetchPriority=="string"?o.fetchPriority:void 0;l==="style"?r.d.S(u,typeof o.precedence=="string"?o.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:d}):l==="script"&&r.d.X(u,{crossOrigin:f,integrity:h,fetchPriority:d,nonce:typeof o.nonce=="string"?o.nonce:void 0})}},W.preinitModule=function(u,o){if(typeof u=="string")if(typeof o=="object"&&o!==null){if(o.as==null||o.as==="script"){var l=c(o.as,o.crossOrigin);r.d.M(u,{crossOrigin:l,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0})}}else o==null&&r.d.M(u)},W.preload=function(u,o){if(typeof u=="string"&&typeof o=="object"&&o!==null&&typeof o.as=="string"){var l=o.as,f=c(l,o.crossOrigin);r.d.L(u,l,{crossOrigin:f,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0,type:typeof o.type=="string"?o.type:void 0,fetchPriority:typeof o.fetchPriority=="string"?o.fetchPriority:void 0,referrerPolicy:typeof o.referrerPolicy=="string"?o.referrerPolicy:void 0,imageSrcSet:typeof o.imageSrcSet=="string"?o.imageSrcSet:void 0,imageSizes:typeof o.imageSizes=="string"?o.imageSizes:void 0,media:typeof o.media=="string"?o.media:void 0})}},W.preloadModule=function(u,o){if(typeof u=="string")if(o){var l=c(o.as,o.crossOrigin);r.d.m(u,{as:typeof o.as=="string"&&o.as!=="script"?o.as:void 0,crossOrigin:l,integrity:typeof o.integrity=="string"?o.integrity:void 0})}else r.d.m(u)},W.requestFormReset=function(u){r.d.r(u)},W.unstable_batchedUpdates=function(u,o){return u(o)},W.useFormState=function(u,o,l){return a.H.useFormState(u,o,l)},W.useFormStatus=function(){return a.H.useHostTransitionStatus()},W.version="19.2.4",W}var Cs;function nn(){if(Cs)return Re.exports;Cs=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Re.exports=rn(),Re.exports}var Ct=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},on={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},an=class{#e=on;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},yt=new an;function cn(t){setTimeout(t,0)}var _t=typeof window>"u"||"Deno"in globalThis;function z(){}function un(t,e){return typeof t=="function"?t(e):t}function ke(t){return typeof t=="number"&&t>=0&&t!==1/0}function dr(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ct(t,e){return typeof t=="function"?t(e):t}function tt(t,e){return typeof t=="function"?t(e):t}function Es(t,e){const{type:s="all",exact:r,fetchStatus:n,predicate:i,queryKey:a,stale:c}=t;if(a){if(r){if(e.queryHash!==We(a,e.options))return!1}else if(!Qt(e.queryKey,a))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||n&&n!==e.state.fetchStatus||i&&!i(e))}function Os(t,e){const{exact:s,status:r,predicate:n,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(s){if(xt(e.options.mutationKey)!==xt(i))return!1}else if(!Qt(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||n&&!n(e))}function We(t,e){return(e?.queryKeyHashFn||xt)(t)}function xt(t){return JSON.stringify(t,(e,s)=>Ae(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function Qt(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>Qt(t[s],e[s])):!1}var ln=Object.prototype.hasOwnProperty;function ze(t,e,s=0){if(t===e)return t;if(s>500)return e;const r=Ls(t)&&Ls(e);if(!r&&!(Ae(t)&&Ae(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),c=a.length,u=r?new Array(c):{};let o=0;for(let l=0;l<c;l++){const f=r?l:a[l],h=t[f],d=e[f];if(h===d){u[f]=h,(r?l<i:ln.call(t,f))&&o++;continue}if(h===null||d===null||typeof h!="object"||typeof d!="object"){u[f]=d;continue}const p=ze(h,d,s+1);u[f]=p,p===h&&o++}return i===c&&o===i?t:u}function $t(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Ls(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ae(t){if(!Ms(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!Ms(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ms(t){return Object.prototype.toString.call(t)==="[object Object]"}function hn(t){return new Promise(e=>{yt.setTimeout(e,t)})}function Fe(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?ze(t,e):e}function fn(t,e,s=0){const r=[...t,e];return s&&r.length>s?r.slice(1):r}function dn(t,e,s=0){const r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var Ve=Symbol();function pr(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Ve?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Ge(t,e){return typeof t=="function"?t(...e):!!t}function pn(t,e,s){let r=!1,n;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(n??=e(),r||(r=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),t}var mn=class extends Ct{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!_t&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ye=new mn;function De(){let t,e;const s=new Promise((n,i)=>{t=n,e=i});s.status="pending",s.catch(()=>{});function r(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{r({status:"fulfilled",value:n}),t(n)},s.reject=n=>{r({status:"rejected",reason:n}),e(n)},s}var yn=cn;function gn(){let t=[],e=0,s=c=>{c()},r=c=>{c()},n=yn;const i=c=>{e?t.push(c):n(()=>{s(c)})},a=()=>{const c=t;t=[],c.length&&n(()=>{r(()=>{c.forEach(u=>{s(u)})})})};return{batch:c=>{let u;e++;try{u=c()}finally{e--,e||a()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{n=c}}}var $=gn(),vn=class extends Ct{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!_t&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},re=new vn;function Sn(t){return Math.min(1e3*2**t,3e4)}function mr(t){return(t??"online")==="online"?re.isOnline():!0}var je=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function yr(t){let e=!1,s=0,r;const n=De(),i=()=>n.status!=="pending",a=y=>{if(!i()){const g=new je(y);h(g),t.onCancel?.(g)}},c=()=>{e=!0},u=()=>{e=!1},o=()=>Ye.isFocused()&&(t.networkMode==="always"||re.isOnline())&&t.canRun(),l=()=>mr(t.networkMode)&&t.canRun(),f=y=>{i()||(r?.(),n.resolve(y))},h=y=>{i()||(r?.(),n.reject(y))},d=()=>new Promise(y=>{r=g=>{(i()||o())&&y(g)},t.onPause?.()}).then(()=>{r=void 0,i()||t.onContinue?.()}),p=()=>{if(i())return;let y;const g=s===0?t.initialPromise:void 0;try{y=g??t.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(f).catch(v=>{if(i())return;const R=t.retry??(_t?0:3),_=t.retryDelay??Sn,w=typeof _=="function"?_(s,v):_,M=R===!0||typeof R=="number"&&s<R||typeof R=="function"&&R(s,v);if(e||!M){h(v);return}s++,t.onFail?.(s,v),hn(w).then(()=>o()?void 0:d()).then(()=>{e?h(v):p()})})};return{promise:n,status:()=>n.status,cancel:a,continue:()=>(r?.(),n),cancelRetry:c,continueRetry:u,canStart:l,start:()=>(l()?p():d().then(p),n)}}var gr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ke(this.gcTime)&&(this.#e=yt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(_t?1/0:300*1e3))}clearGcTimeout(){this.#e&&(yt.clearTimeout(this.#e),this.#e=void 0)}},bn=class extends gr{#e;#t;#s;#n;#r;#i;#a;constructor(t){super(),this.#a=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#n=t.client,this.#s=this.#n.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=Is(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#i,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=Is(this.options);e.data!==void 0&&(this.setState(Ts(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=Fe(this.state.data,t,this.options);return this.#o({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(z).catch(z):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>tt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ve||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ct(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!dr(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const s=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},n=()=>{const c=pr(this.options,e),o=(()=>{const l={client:this.#n,queryKey:this.queryKey,meta:this.meta};return r(l),l})();return this.#a=!1,this.options.persister?this.options.persister(c,o,this):c(o)},a=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:n};return r(c),c})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=yr({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof je&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(c,u)=>{this.#o({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#s.config.onSuccess?.(c,this),this.#s.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof je){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#o({type:"error",error:c}),this.#s.config.onError?.(c,this),this.#s.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#o(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...vr(s.data,this.options),fetchMeta:t.meta??null};case"success":const r={...s,...Ts(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?r:void 0,r;case"error":const n=t.error;return{...s,error:n,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),$.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function vr(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Ts(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Is(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,r=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Je=class extends Ct{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#a=De(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#n=void 0;#r;#i;#a;#o;#p;#h;#f;#u;#l;#c;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ks(this.#t,this.options)?this.#m():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Be(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Be(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#R(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),e._defaulted&&!$t(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&As(this.#t,s,this.options,e)&&this.#m(),this.updateResult(),r&&(this.#t!==s||tt(this.options.enabled,this.#t)!==tt(e.enabled,this.#t)||ct(this.options.staleTime,this.#t)!==ct(e.staleTime,this.#t))&&this.#y();const n=this.#g();r&&(this.#t!==s||tt(this.options.enabled,this.#t)!==tt(e.enabled,this.#t)||n!==this.#c)&&this.#v(n)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return Pn(this,s)&&(this.#n=s,this.#i=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#m({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#m(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(z)),e}#y(){this.#b();const t=ct(this.options.staleTime,this.#t);if(_t||this.#n.isStale||!ke(t))return;const s=dr(this.#n.dataUpdatedAt,t)+1;this.#u=yt.setTimeout(()=>{this.#n.isStale||this.updateResult()},s)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#R(),this.#c=t,!(_t||tt(this.options.enabled,this.#t)===!1||!ke(this.#c)||this.#c===0)&&(this.#l=yt.setInterval(()=>{(this.options.refetchIntervalInBackground||Ye.isFocused())&&this.#m()},this.#c))}#S(){this.#y(),this.#v(this.#g())}#b(){this.#u&&(yt.clearTimeout(this.#u),this.#u=void 0)}#R(){this.#l&&(yt.clearInterval(this.#l),this.#l=void 0)}createResult(t,e){const s=this.#t,r=this.options,n=this.#n,i=this.#r,a=this.#i,u=t!==s?t.state:this.#s,{state:o}=t;let l={...o},f=!1,h;if(e._optimisticResults){const x=this.hasListeners(),P=!x&&ks(t,e),T=x&&As(t,s,e,r);(P||T)&&(l={...l,...vr(o.data,t.options)}),e._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:y}=l;h=l.data;let g=!1;if(e.placeholderData!==void 0&&h===void 0&&y==="pending"){let x;n?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(x=n.data,g=!0):x=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,x!==void 0&&(y="success",h=Fe(n?.data,x,e),f=!0)}if(e.select&&h!==void 0&&!g)if(n&&h===i?.data&&e.select===this.#p)h=this.#h;else try{this.#p=e.select,h=e.select(h),h=Fe(n?.data,h,e),this.#h=h,this.#o=null}catch(x){this.#o=x}this.#o&&(d=this.#o,h=this.#h,p=Date.now(),y="error");const v=l.fetchStatus==="fetching",R=y==="pending",_=y==="error",w=R&&v,M=h!==void 0,S={status:y,fetchStatus:l.fetchStatus,isPending:R,isSuccess:y==="success",isError:_,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:l.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!R,isLoadingError:_&&!M,isPaused:l.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:_&&M,isStale:Xe(t,e),refetch:this.refetch,promise:this.#a,isEnabled:tt(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=S.data!==void 0,P=S.status==="error"&&!x,T=D=>{P?D.reject(S.error):x&&D.resolve(S.data)},F=()=>{const D=this.#a=S.promise=De();T(D)},B=this.#a;switch(B.status){case"pending":t.queryHash===s.queryHash&&T(B);break;case"fulfilled":(P||S.data!==B.value)&&F();break;case"rejected":(!P||S.error!==B.reason)&&F();break}}return S}updateResult(){const t=this.#n,e=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#f=this.#t),$t(e,t))return;this.#n=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!this.#d.size)return!0;const i=new Set(n??this.#d);return this.options.throwOnError&&i.add("error"),Object.keys(this.#n).some(a=>{const c=a;return this.#n[c]!==t[c]&&i.has(c)})};this.#w({listeners:s()})}#P(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}#w(t){$.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Rn(t,e){return tt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function ks(t,e){return Rn(t,e)||t.state.data!==void 0&&Be(t,e,e.refetchOnMount)}function Be(t,e,s){if(tt(e.enabled,t)!==!1&&ct(e.staleTime,t)!=="static"){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&Xe(t,e)}return!1}function As(t,e,s,r){return(t!==e||tt(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Xe(t,s)}function Xe(t,e){return tt(e.enabled,t)!==!1&&t.isStaleByTime(ct(e.staleTime,t))}function Pn(t,e){return!$t(t.getCurrentResult(),e)}function Fs(t){return{onFetch:(e,s)=>{const r=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,i=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},u=0;const o=async()=>{let l=!1;const f=p=>{pn(p,()=>e.signal,()=>l=!0)},h=pr(e.options,e.fetchOptions),d=async(p,y,g)=>{if(l)return Promise.reject();if(y==null&&p.pages.length)return Promise.resolve(p);const R=(()=>{const E={client:e.client,queryKey:e.queryKey,pageParam:y,direction:g?"backward":"forward",meta:e.options.meta};return f(E),E})(),_=await h(R),{maxPages:w}=e.options,M=g?dn:fn;return{pages:M(p.pages,_,w),pageParams:M(p.pageParams,y,w)}};if(n&&i.length){const p=n==="backward",y=p?wn:Ds,g={pages:i,pageParams:a},v=y(r,g);c=await d(g,v,p)}else{const p=t??i.length;do{const y=u===0?a[0]??r.initialPageParam:Ds(r,c);if(u>0&&y==null)break;c=await d(c,y),u++}while(u<p)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(o,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=o}}}function Ds(t,{pages:e,pageParams:s}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function wn(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var _n=class extends gr{#e;#t;#s;#n;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#t=[],this.state=t.state||Sr(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=yr({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#r({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const r=this.state.status==="pending",n=!this.#n.canStart();try{if(r)e();else{this.#r({type:"pending",variables:t,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const a=await this.options.onMutate?.(t,s);a!==this.state.context&&this.#r({type:"pending",context:a,variables:t,isPaused:n})}const i=await this.#n.start();return await this.#s.config.onSuccess?.(i,t,this.state.context,this,s),await this.options.onSuccess?.(i,t,this.state.context,s),await this.#s.config.onSettled?.(i,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(i,null,t,this.state.context,s),this.#r({type:"success",data:i}),i}catch(i){try{await this.#s.config.onError?.(i,t,this.state.context,this,s)}catch(a){Promise.reject(a)}try{await this.options.onError?.(i,t,this.state.context,s)}catch(a){Promise.reject(a)}try{await this.#s.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,s)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,i,t,this.state.context,s)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:i}),i}finally{this.#s.runNext(this)}}#r(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),$.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function Sr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xn=class extends Ct{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(t,e,s){const r=new _n({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(r),r}add(t){this.#e.add(t);const e=Gt(t);if(typeof e=="string"){const s=this.#t.get(e);s?s.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Gt(t);if(typeof e=="string"){const s=this.#t.get(e);if(s)if(s.length>1){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}else s[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Gt(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(n=>n.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=Gt(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){$.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>Os(e,s))}findAll(t={}){return this.getAll().filter(e=>Os(t,e))}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return $.batch(()=>Promise.all(t.map(e=>e.continue().catch(z))))}};function Gt(t){return t.options.scope?.id}var Cn=class extends Ct{#e;#t=void 0;#s;#n;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),$t(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&xt(e.mutationKey)!==xt(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#i()}mutate(t,e){return this.#n=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#r(){const t=this.#s?.state??Sr();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){$.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#n.onSuccess?.(t.data,e,s,r)}catch(n){Promise.reject(n)}try{this.#n.onSettled?.(t.data,null,e,s,r)}catch(n){Promise.reject(n)}}else if(t?.type==="error"){try{this.#n.onError?.(t.error,e,s,r)}catch(n){Promise.reject(n)}try{this.#n.onSettled?.(void 0,t.error,e,s,r)}catch(n){Promise.reject(n)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function js(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function En(t,e,s){const r=t.slice(0);return r[e]=s,r}var On=class extends Ct{#e;#t;#s;#n;#r;#i;#a;#o;#p;#h=[];constructor(t,e,s){super(),this.#e=t,this.#n=s,this.#s=[],this.#r=[],this.#t=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(t=>{t.subscribe(e=>{this.#c(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(t=>{t.destroy()})}setQueries(t,e){this.#s=t,this.#n=e,$.batch(()=>{const s=this.#r,r=this.#l(this.#s);r.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const n=r.map(l=>l.observer),i=n.map(l=>l.getCurrentResult()),a=s.length!==n.length,c=n.some((l,f)=>l!==s[f]),u=a||c,o=u?!0:i.some((l,f)=>{const h=this.#t[f];return!h||!$t(l,h)});!u&&!o||(u&&(this.#h=r,this.#r=n),this.#t=i,this.hasListeners()&&(u&&(js(s,n).forEach(l=>{l.destroy()}),js(n,s).forEach(l=>{l.subscribe(f=>{this.#c(l,f)})})),this.#d()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(t=>t.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(t,e){const s=this.#l(t),r=s.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),n=s.map(i=>i.defaultedQueryOptions.queryHash);return[r,i=>this.#u(i??r,e,n),()=>this.#f(r,s)]}#f(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,i=>{e.forEach(a=>{a.observer.trackProp(i)})})})}#u(t,e,s){if(e){const r=this.#p,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((i,a)=>i!==r[a]));return(!this.#i||this.#t!==this.#o||n||e!==this.#a)&&(this.#a=e,this.#o=this.#t,s!==void 0&&(this.#p=s),this.#i=ze(this.#i,e(t))),this.#i}return t}#l(t){const e=new Map;this.#r.forEach(r=>{const n=r.options.queryHash;if(!n)return;const i=e.get(n);i?i.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#e.defaultQueryOptions(r),a=e.get(n.queryHash)?.shift()??new Je(this.#e,n);s.push({defaultedQueryOptions:n,observer:a})}),s}#c(t,e){const s=this.#r.indexOf(t);s!==-1&&(this.#t=En(this.#t,s,e),this.#d())}#d(){if(this.hasListeners()){const t=this.#i,e=this.#f(this.#t,this.#h),s=this.#u(e,this.#n?.combine);t!==s&&$.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}},Ln=class extends Ct{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,s){const r=e.queryKey,n=e.queryHash??We(r,e);let i=this.get(n);return i||(i=new bn({client:t,queryKey:r,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(i)),i}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>Es(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>Es(t,s)):e}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){$.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jo=class{#e;#t;#s;#n;#r;#i;#a;#o;constructor(t={}){this.#e=t.queryCache||new Ln,this.#t=t.mutationCache||new xn,this.#s=t.defaultOptions||{},this.#n=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Ye.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=re.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#e.build(this,e),r=s.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(ct(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:s})=>{const r=s.data;return[e,r]})}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),i=this.#e.get(r.queryHash)?.state.data,a=un(e,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return $.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;$.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#e;return $.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},r=$.batch(()=>this.#e.findAll(t).map(n=>n.cancel(s)));return Promise.all(r).then(z).catch(z)}invalidateQueries(t,e={}){return $.batch(()=>(this.#e.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},r=$.batch(()=>this.#e.findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,s);return s.throwOnError||(i=i.catch(z)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(z)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#e.build(this,e);return s.isStaleByTime(ct(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(z).catch(z)}fetchInfiniteQuery(t){return t.behavior=Fs(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(z).catch(z)}ensureInfiniteQueryData(t){return t.behavior=Fs(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return re.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#n.set(xt(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#n.values()],s={};return e.forEach(r=>{Qt(t,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(t,e){this.#r.set(xt(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],s={};return e.forEach(r=>{Qt(t,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=We(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ve&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},br=C.createContext(void 0),Ze=t=>{const e=C.useContext(br);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Bo=({client:t,children:e})=>(C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),O.jsx(br.Provider,{value:t,children:e})),Rr=C.createContext(!1),Pr=()=>C.useContext(Rr);Rr.Provider;function Mn(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Tn=C.createContext(Mn()),wr=()=>C.useContext(Tn),_r=(t,e,s)=>{const r=s?.state.error&&typeof t.throwOnError=="function"?Ge(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},xr=t=>{C.useEffect(()=>{t.clearReset()},[t])},Cr=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(n&&t.data===void 0||Ge(s,[t.error,r])),Er=t=>{if(t.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...n)=>s(r(...n)):s(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},In=(t,e)=>t.isLoading&&t.isFetching&&!e,Ne=(t,e)=>t?.suspense&&e.isPending,Ue=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function No({queries:t,...e},s){const r=Ze(),n=Pr(),i=wr(),a=C.useMemo(()=>t.map(y=>{const g=r.defaultQueryOptions(y);return g._optimisticResults=n?"isRestoring":"optimistic",g}),[t,r,n]);a.forEach(y=>{Er(y);const g=r.getQueryCache().get(y.queryHash);_r(y,i,g)}),xr(i);const[c]=C.useState(()=>new On(r,a,e)),[u,o,l]=c.getOptimisticResult(a,e.combine),f=!n&&e.subscribed!==!1;C.useSyncExternalStore(C.useCallback(y=>f?c.subscribe($.batchCalls(y)):z,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setQueries(a,e)},[a,e,c]);const d=u.some((y,g)=>Ne(a[g],y))?u.flatMap((y,g)=>{const v=a[g];if(v&&Ne(v,y)){const R=new Je(r,v);return Ue(v,R,i)}return[]}):[];if(d.length>0)throw Promise.all(d);const p=u.find((y,g)=>{const v=a[g];return v&&Cr({result:y,errorResetBoundary:i,throwOnError:v.throwOnError,query:r.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(p?.error)throw p.error;return o(l())}function kn(t,e,s){const r=Pr(),n=wr(),i=Ze(),a=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const c=i.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",Er(a),_r(a,n,c),xr(n);const u=!i.getQueryCache().get(a.queryHash),[o]=C.useState(()=>new e(i,a)),l=o.getOptimisticResult(a),f=!r&&t.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(h=>{const d=f?o.subscribe($.batchCalls(h)):z;return o.updateResult(),d},[o,f]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),C.useEffect(()=>{o.setOptions(a)},[a,o]),Ne(a,l))throw Ue(a,o,n);if(Cr({result:l,errorResetBoundary:n,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!_t&&In(l,r)&&(u?Ue(a,o,n):c?.promise)?.catch(z).finally(()=>{o.updateResult()}),a.notifyOnChangeProps?l:o.trackResult(l)}function Uo(t,e){return kn(t,Je)}function Qo(t){return t}function $o(t,e){const s=Ze(),[r]=C.useState(()=>new Cn(s,t));C.useEffect(()=>{r.setOptions(t)},[r,t]);const n=C.useSyncExternalStore(C.useCallback(a=>r.subscribe($.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=C.useCallback((a,c)=>{r.mutate(a,c).catch(z)},[r]);if(n.error&&Ge(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:i,mutateAsync:n.mutate}}var Bs=C.use,Yt=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Pe(t){const e=C.useRef({value:t,prev:null}),s=e.current.value;return t!==s&&(e.current={value:t,prev:s}),e.current.prev}function An(t,e,s={},r={}){C.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([i])=>{e(i)},s);return n.observe(t.current),()=>{n.disconnect()}},[e,s,r.disabled,t])}function Fn(t){const e=C.useRef(null);return C.useImperativeHandle(t,()=>e.current,[]),e}var Dn=!1;function Ht(t){return t[t.length-1]}function jn(t){return typeof t=="function"}function ot(t,e){return jn(t)?t(e):t}var Bn=Object.prototype.hasOwnProperty,Ns=Object.prototype.propertyIsEnumerable,Nn=()=>Object.create(null),pt=(t,e)=>gt(t,e,Nn);function gt(t,e,s=()=>({}),r=0){if(t===e)return t;if(r>500)return e;const n=e,i=$s(t)&&$s(n);if(!i&&!(ne(t)&&ne(n)))return n;const a=i?t:Us(t);if(!a)return n;const c=i?n:Us(n);if(!c)return n;const u=a.length,o=c.length,l=i?new Array(o):s();let f=0;for(let h=0;h<o;h++){const d=i?h:c[h],p=t[d],y=n[d];if(p===y){l[d]=p,(i?h<u:Bn.call(t,d))&&f++;continue}if(p===null||y===null||typeof p!="object"||typeof y!="object"){l[d]=y;continue}const g=gt(p,y,s,r+1);l[d]=g,g===p&&f++}return u===o&&f===u?t:l}function Us(t){const e=Object.getOwnPropertyNames(t);for(const n of e)if(!Ns.call(t,n))return!1;const s=Object.getOwnPropertySymbols(t);if(s.length===0)return e;const r=e;for(const n of s){if(!Ns.call(t,n))return!1;r.push(n)}return r}function ne(t){if(!Qs(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const s=e.prototype;return!(!Qs(s)||!s.hasOwnProperty("isPrototypeOf"))}function Qs(t){return Object.prototype.toString.call(t)==="[object Object]"}function $s(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function bt(t,e,s){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,n=t.length;r<n;r++)if(!bt(t[r],e[r],s))return!1;return!0}if(ne(t)&&ne(e)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const a in e)if((!r||e[a]!==void 0)&&!bt(t[a],e[a],s))return!1;return!0}let n=0;if(!r)n=Object.keys(t).length;else for(const a in t)t[a]!==void 0&&n++;let i=0;for(const a in e)if((!r||e[a]!==void 0)&&(i++,i>n||!bt(t[a],e[a],s)))return!1;return n===i}return!1}function Tt(t){let e,s;const r=new Promise((n,i)=>{e=n,s=i});return r.status="pending",r.resolve=n=>{r.status="resolved",r.value=n,e(n),t?.(n)},r.reject=n=>{r.status="rejected",s(n)},r}function Un(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function qt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function Qn(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function Hs(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return Qn(e)}var $n=["http:","https:","mailto:","tel:"];function ie(t,e){if(!t)return!1;try{const s=new URL(t);return!e.has(s.protocol)}catch{return!1}}function Ft(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let s=0,r="",n;for(;(n=e.exec(t))!==null;)r+=Hs(t.slice(s,n.index))+n[0],s=e.lastIndex;r=r+Hs(s?t.slice(s):t);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function Hn(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function oe(t){const e=new Map;let s,r;const n=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,s=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=e.get(i);if(a)return n(a),a.value},set(i,a){if(e.size>=t&&s){const u=s;e.delete(u.key),u.next&&(s=u.next,u.next.prev=void 0),u===r&&(r=void 0)}const c=e.get(i);if(c)c.value=a,n(c);else{const u={key:i,value:a,prev:r};r&&(r.next=u),r=u,s||(s=u),e.set(i,u)}},clear(){e.clear(),s=void 0,r=void 0}}}var qn="Invariant failed";function ht(t,e){if(!t)throw new Error(qn)}var vt=4,Or=5;function Kn(t){const e=t.indexOf("{");if(e===-1)return null;const s=t.indexOf("}",e);return s===-1||e+1>=t.length?null:[e,s]}function ts(t,e,s=new Uint16Array(6)){const r=t.indexOf("/",e),n=r===-1?t.length:r,i=t.substring(e,n);if(!i||!i.includes("$"))return s[0]=0,s[1]=e,s[2]=e,s[3]=n,s[4]=n,s[5]=n,s;if(i==="$"){const c=t.length;return s[0]=2,s[1]=e,s[2]=e,s[3]=c,s[4]=c,s[5]=c,s}if(i.charCodeAt(0)===36)return s[0]=1,s[1]=e,s[2]=e+1,s[3]=n,s[4]=n,s[5]=n,s;const a=Kn(i);if(a){const[c,u]=a,o=i.charCodeAt(c+1);if(o===45){if(c+2<i.length&&i.charCodeAt(c+2)===36){const l=c+3,f=u;if(l<f)return s[0]=3,s[1]=e+c,s[2]=e+l,s[3]=e+f,s[4]=e+u+1,s[5]=n,s}}else if(o===36){const l=c+1,f=c+2;return f===u?(s[0]=2,s[1]=e+c,s[2]=e+l,s[3]=e+f,s[4]=e+u+1,s[5]=t.length,s):(s[0]=1,s[1]=e+c,s[2]=e+f,s[3]=e+u,s[4]=e+u+1,s[5]=n,s)}}return s[0]=0,s[1]=e,s[2]=e,s[3]=n,s[4]=n,s[5]=n,s}function de(t,e,s,r,n,i,a){a?.(s);let c=r;{const u=s.fullPath??s.from,o=u.length,l=s.options?.caseSensitive??t,f=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;c<o;){const d=ts(u,c,e);let p;const y=c,g=d[5];switch(c=g+1,i++,d[0]){case 0:{const v=u.substring(d[2],d[3]);if(l){const R=n.static?.get(v);if(R)p=R;else{n.static??=new Map;const _=St(s.fullPath??s.from);_.parent=n,_.depth=i,p=_,n.static.set(v,_)}}else{const R=v.toLowerCase(),_=n.staticInsensitive?.get(R);if(_)p=_;else{n.staticInsensitive??=new Map;const w=St(s.fullPath??s.from);w.parent=n,w.depth=i,p=w,n.staticInsensitive.set(R,w)}}break}case 1:{const v=u.substring(y,d[1]),R=u.substring(d[4],g),_=l&&!!(v||R),w=v?_?v:v.toLowerCase():void 0,M=R?_?R:R.toLowerCase():void 0,E=!f&&n.dynamic?.find(S=>!S.skipOnParamError&&S.caseSensitive===_&&S.prefix===w&&S.suffix===M);if(E)p=E;else{const S=_e(1,s.fullPath??s.from,_,w,M);p=S,S.depth=i,S.parent=n,n.dynamic??=[],n.dynamic.push(S)}break}case 3:{const v=u.substring(y,d[1]),R=u.substring(d[4],g),_=l&&!!(v||R),w=v?_?v:v.toLowerCase():void 0,M=R?_?R:R.toLowerCase():void 0,E=!f&&n.optional?.find(S=>!S.skipOnParamError&&S.caseSensitive===_&&S.prefix===w&&S.suffix===M);if(E)p=E;else{const S=_e(3,s.fullPath??s.from,_,w,M);p=S,S.parent=n,S.depth=i,n.optional??=[],n.optional.push(S)}break}case 2:{const v=u.substring(y,d[1]),R=u.substring(d[4],g),_=l&&!!(v||R),w=v?_?v:v.toLowerCase():void 0,M=R?_?R:R.toLowerCase():void 0,E=_e(2,s.fullPath??s.from,_,w,M);p=E,E.parent=n,E.depth=i,n.wildcard??=[],n.wildcard.push(E)}}n=p}if(f&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const d=St(s.fullPath??s.from);d.kind=Or,d.parent=n,i++,d.depth=i,n.pathless??=[],n.pathless.push(d),n=d}const h=(s.path||!s.children)&&!s.isRoot;if(h&&u.endsWith("/")){const d=St(s.fullPath??s.from);d.kind=vt,d.parent=n,i++,d.depth=i,n.index=d,n=d}n.parse=s.options?.params?.parse??null,n.skipOnParamError=f,n.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,h&&!n.route&&(n.route=s,n.fullPath=s.fullPath??s.from)}if(s.children)for(const u of s.children)de(t,e,u,c,n,i,a)}function we(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function it(t){if(t.pathless)for(const e of t.pathless)it(e);if(t.static)for(const e of t.static.values())it(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())it(e);if(t.dynamic?.length){t.dynamic.sort(we);for(const e of t.dynamic)it(e)}if(t.optional?.length){t.optional.sort(we);for(const e of t.optional)it(e)}if(t.wildcard?.length){t.wildcard.sort(we);for(const e of t.wildcard)it(e)}}function St(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _e(t,e,s,r,n){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:r,suffix:n}}function Wn(t,e){const s=St("/"),r=new Uint16Array(6);for(const n of t)de(!1,r,n,1,s,0);it(s),e.masksTree=s,e.flatCache=oe(1e3)}function zn(t,e){t||="/";const s=e.flatCache.get(t);if(s)return s;const r=es(t,e.masksTree);return e.flatCache.set(t,r),r}function Vn(t,e,s,r,n){t||="/",r||="/";const i=e?`case\0${t}`:t;let a=n.singleCache.get(i);return a||(a=St("/"),de(e,new Uint16Array(6),{from:t},1,a,0),n.singleCache.set(i,a)),es(r,a,s)}function Gn(t,e,s=!1){const r=s?t:`nofuzz\0${t}`,n=e.matchCache.get(r);if(n!==void 0)return n;t||="/";let i;try{i=es(t,e.segmentTree,s)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=Xn(i.route)),e.matchCache.set(r,i),i}function Yn(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Jn(t,e=!1,s){const r=St(t.fullPath),n=new Uint16Array(6),i={},a={};let c=0;return de(e,n,t,1,r,0,u=>{if(s?.(u,c),ht(!(u.id in i),`Duplicate routes found with id: ${String(u.id)}`),i[u.id]=u,c!==0&&u.path){const o=Yn(u.fullPath);(!a[o]||u.fullPath.endsWith("/"))&&(a[o]=u)}c++}),it(r),{processedTree:{segmentTree:r,singleCache:oe(1e3),matchCache:oe(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function es(t,e,s=!1){const r=t.split("/"),n=ti(t,r,e,s);if(!n)return null;const[i]=Lr(t,r,n);return{route:n.node.route,rawParams:i,parsedParams:n.parsedParams}}function Lr(t,e,s){const r=Zn(s.node);let n=null;const i=Object.create(null);let a=s.extract?.part??0,c=s.extract?.node??0,u=s.extract?.path??0,o=s.extract?.segment??0;for(;c<r.length;a++,c++,u++,o++){const l=r[c];if(l.kind===vt)break;if(l.kind===Or){o--,a--,u--;continue}const f=e[a],h=u;if(f&&(u+=f.length),l.kind===1){n??=s.node.fullPath.split("/");const d=n[o],p=l.prefix?.length??0;if(d.charCodeAt(p)===123){const y=l.suffix?.length??0,g=d.substring(p+2,d.length-y-1),v=f.substring(p,f.length-y);i[g]=decodeURIComponent(v)}else{const y=d.substring(1);i[y]=decodeURIComponent(f)}}else if(l.kind===3){if(s.skipped&1<<c){a--,u=h-1;continue}n??=s.node.fullPath.split("/");const d=n[o],p=l.prefix?.length??0,y=l.suffix?.length??0,g=d.substring(p+3,d.length-y-1),v=l.suffix||l.prefix?f.substring(p,f.length-y):f;v&&(i[g]=decodeURIComponent(v))}else if(l.kind===2){const d=l,p=t.substring(h+(d.prefix?.length??0),t.length-(d.suffix?.length??0)),y=decodeURIComponent(p);i["*"]=y,i._splat=y;break}}return s.rawParams&&Object.assign(i,s.rawParams),[i,{part:a,node:c,path:u,segment:o}]}function Xn(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function Zn(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function ti(t,e,s,r){if(t==="/"&&s.index)return{node:s.index,skipped:0};const n=!Ht(e),i=n&&t!=="/",a=e.length-(n?1:0),c=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let u=null,o=null,l=null;for(;c.length;){const f=c.pop(),{node:h,index:d,skipped:p,depth:y,statics:g,dynamics:v,optionals:R}=f;let{extract:_,rawParams:w,parsedParams:M}=f;if(h.skipOnParamError){if(!xe(t,e,f))continue;w=f.rawParams,_=f.extract,M=f.parsedParams}r&&h.route&&h.kind!==vt&&Dt(o,f)&&(o=f);const E=d===a;if(E&&(h.route&&!i&&Dt(l,f)&&(l=f),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const S=E?void 0:e[d];let x;if(E&&h.index){const P={node:h.index,index:d,skipped:p,depth:y+1,statics:g,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M};let T=!0;if(h.index.skipOnParamError&&(xe(t,e,P)||(T=!1)),T){if(g===a&&!v&&!R&&!p)return P;Dt(l,P)&&(l=P)}}if(h.wildcard&&Dt(u,f))for(const P of h.wildcard){const{prefix:T,suffix:F}=P;if(T&&(E||!(P.caseSensitive?S:x??=S.toLowerCase()).startsWith(T)))continue;if(F){if(E)continue;const D=e.slice(d).join("/").slice(-F.length);if((P.caseSensitive?D:D.toLowerCase())!==F)continue}const B={node:P,index:a,skipped:p,depth:y,statics:g,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M};if(!(P.skipOnParamError&&!xe(t,e,B))){u=B;break}}if(h.optional){const P=p|1<<y,T=y+1;for(let F=h.optional.length-1;F>=0;F--){const B=h.optional[F];c.push({node:B,index:d,skipped:P,depth:T,statics:g,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M})}if(!E)for(let F=h.optional.length-1;F>=0;F--){const B=h.optional[F],{prefix:D,suffix:X}=B;if(D||X){const q=B.caseSensitive?S:x??=S.toLowerCase();if(D&&!q.startsWith(D)||X&&!q.endsWith(X))continue}c.push({node:B,index:d+1,skipped:p,depth:T,statics:g,dynamics:v,optionals:R+1,extract:_,rawParams:w,parsedParams:M})}}if(!E&&h.dynamic&&S)for(let P=h.dynamic.length-1;P>=0;P--){const T=h.dynamic[P],{prefix:F,suffix:B}=T;if(F||B){const D=T.caseSensitive?S:x??=S.toLowerCase();if(F&&!D.startsWith(F)||B&&!D.endsWith(B))continue}c.push({node:T,index:d+1,skipped:p,depth:y+1,statics:g,dynamics:v+1,optionals:R,extract:_,rawParams:w,parsedParams:M})}if(!E&&h.staticInsensitive){const P=h.staticInsensitive.get(x??=S.toLowerCase());P&&c.push({node:P,index:d+1,skipped:p,depth:y+1,statics:g+1,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M})}if(!E&&h.static){const P=h.static.get(S);P&&c.push({node:P,index:d+1,skipped:p,depth:y+1,statics:g+1,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M})}if(h.pathless){const P=y+1;for(let T=h.pathless.length-1;T>=0;T--){const F=h.pathless[T];c.push({node:F,index:d,skipped:p,depth:P,statics:g,dynamics:v,optionals:R,extract:_,rawParams:w,parsedParams:M})}}}if(l&&u)return Dt(u,l)?l:u;if(l)return l;if(u)return u;if(r&&o){let f=o.index;for(let d=0;d<o.index;d++)f+=e[d].length;const h=f===t.length?"/":t.slice(f);return o.rawParams??=Object.create(null),o.rawParams["**"]=decodeURIComponent(h),o}return null}function xe(t,e,s){try{const[r,n]=Lr(t,e,s);s.rawParams=r,s.extract=n;const i=s.node.parse(r);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,i),!0}catch{return null}}function Dt(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===vt)>(t.node.kind===vt)||e.node.kind===vt==(t.node.kind===vt)&&e.depth>t.depth))):!0}function Zt(t){return ss(t.filter(e=>e!==void 0).join("/"))}function ss(t){return t.replace(/\/{2,}/g,"/")}function Mr(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function ut(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function Tr(t){return ut(Mr(t))}function ae(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function ei(t,e,s){return ae(t,s)===ae(e,s)}function si({base:t,to:e,trailingSlash:s="never",cache:r}){const n=e.startsWith("/"),i=!n&&e===".";let a;if(r){a=n?e:i?t:t+"\0"+e;const f=r.get(a);if(f)return f}let c;if(i)c=t.split("/");else if(n)c=e.split("/");else{for(c=t.split("/");c.length>1&&Ht(c)==="";)c.pop();const f=e.split("/");for(let h=0,d=f.length;h<d;h++){const p=f[h];p===""?h?h===d-1&&c.push(p):c=[p]:p===".."?c.pop():p==="."||c.push(p)}}c.length>1&&(Ht(c)===""?s==="never"&&c.pop():s==="always"&&c.push(""));let u,o="";for(let f=0;f<c.length;f++){f>0&&(o+="/");const h=c[f];if(!h)continue;u=ts(h,0,u);const d=u[0];if(d===0){o+=h;continue}const p=u[5],y=h.substring(0,u[1]),g=h.substring(u[4],p),v=h.substring(u[2],u[3]);d===1?o+=y||g?`${y}{$${v}}${g}`:`$${v}`:d===2?o+=y||g?`${y}{$}${g}`:"$":o+=`${y}{-$${v}}${g}`}o=ss(o);const l=o||"/";return a&&r&&r.set(a,l),l}function ri(t){const e=new Map(t.map(n=>[encodeURIComponent(n),n])),s=Array.from(e.keys()).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return n=>n.replace(r,i=>e.get(i)??i)}function Ce(t,e,s){const r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(n=>Ks(n,s)).join("/"):Ks(r,s)}function qs({path:t,params:e,decoder:s,...r}){let n=!1;const i=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:i,isMissingParams:n};const a=t.length;let c=0,u,o="";for(;c<a;){const l=c;u=ts(t,l,u);const f=u[5];if(c=f+1,l===f)continue;const h=u[0];if(h===0){o+="/"+t.substring(l,f);continue}if(h===2){const d=e._splat;i._splat=d,i["*"]=d;const p=t.substring(l,u[1]),y=t.substring(u[4],f);if(!d){n=!0,(p||y)&&(o+="/"+p+y);continue}const g=Ce("_splat",e,s);o+="/"+p+g+y;continue}if(h===1){const d=t.substring(u[2],u[3]);!n&&!(d in e)&&(n=!0),i[d]=e[d];const p=t.substring(l,u[1]),y=t.substring(u[4],f),g=Ce(d,e,s)??"undefined";o+="/"+p+g+y;continue}if(h===3){const d=t.substring(u[2],u[3]),p=e[d];if(p==null)continue;i[d]=p;const y=t.substring(l,u[1]),g=t.substring(u[4],f),v=Ce(d,e,s)??"";o+="/"+y+v+g;continue}}return t.endsWith("/")&&(o+="/"),{usedParams:i,interpolatedPath:o||"/",isMissingParams:n}}function Ks(t,e){const s=encodeURIComponent(t);return e?.(s)??s}function G(t){return!!t?.isNotFound}function ni(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Qe="tsr-scroll-restoration-v1_3",ii=(t,e)=>{let s;return(...r)=>{s||(s=setTimeout(()=>{t(...r),s=null},e))}};function oi(){const t=ni();if(!t)return null;const e=t.getItem(Qe);let s=e?JSON.parse(e):{};return{state:s,set:r=>{s=ot(r,s)||s;try{t.setItem(Qe,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Jt=oi(),ai=t=>t.state.__TSR_key||t.href;function ci(t){const e=[];let s;for(;s=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,t)+1})`),t=s;return`${e.reverse().join(" > ")}`.toLowerCase()}var ce=!1;function ui({storageKey:t,key:e,behavior:s,shouldScrollRestoration:r,scrollToTopSelectors:n,location:i}){let a;try{a=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(o){console.error(o);return}const c=e||window.history.state?.__TSR_key,u=a[c];ce=!0;t:{if(r&&u&&Object.keys(u).length>0){for(const f in u){const h=u[f];if(f==="window")window.scrollTo({top:h.scrollY,left:h.scrollX,behavior:s});else if(f){const d=document.querySelector(f);d&&(d.scrollLeft=h.scrollX,d.scrollTop=h.scrollY)}}break t}const o=(i??window.location).hash.split("#",2)[1];if(o){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const h=document.getElementById(o);h&&h.scrollIntoView(f)}break t}const l={top:0,left:0,behavior:s};if(window.scrollTo(l),n)for(const f of n){if(f==="window")continue;const h=typeof f=="function"?f():document.querySelector(f);h&&h.scrollTo(l)}}ce=!1}function li(t,e){if(!Jt||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!Jt))return;t.isScrollRestorationSetup=!0,ce=!1;const s=t.options.getScrollRestorationKey||ai;window.history.scrollRestoration="manual";const r=n=>{if(ce||!t.isScrollRestoring)return;let i="";if(n.target===document||n.target===window)i="window";else{const c=n.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=ci(n.target)}const a=s(t.state.location);Jt.set(c=>{const u=c[a]||={},o=u[i]||={};if(i==="window")o.scrollX=window.scrollX||0,o.scrollY=window.scrollY||0;else if(i){const l=document.querySelector(i);l&&(o.scrollX=l.scrollLeft||0,o.scrollY=l.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",ii(r,100),!0),t.subscribe("onRendered",n=>{const i=s(n.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(ui({storageKey:Qe,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Jt.set(a=>(a[i]||={},a)))})}function hi(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const s=document.getElementById(t.state.location.hash);s&&s.scrollIntoView(e)}}}function fi(t,e=String){const s=new URLSearchParams;for(const r in t){const n=t[r];n!==void 0&&s.set(r,e(n))}return s.toString()}function Ee(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function di(t){const e=new URLSearchParams(t),s=Object.create(null);for(const[r,n]of e.entries()){const i=s[r];i==null?s[r]=Ee(n):Array.isArray(i)?i.push(Ee(n)):s[r]=[i,Ee(n)]}return s}var pi=yi(JSON.parse),mi=gi(JSON.stringify,JSON.parse);function yi(t){return e=>{e[0]==="?"&&(e=e.substring(1));const s=di(e);for(const r in s){const n=s[r];if(typeof n=="string")try{s[r]=t(n)}catch{}}return s}}function gi(t,e){const s=typeof e=="function";function r(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(s&&typeof n=="string")try{return e(n),t(n)}catch{}return n}return n=>{const i=fi(n,r);return i?`?${i}`:""}}var Rt="__root__";function vi(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const s=new Response(null,{status:t.statusCode,headers:e});if(s.options=t,t.throw)throw s;return s}function Y(t){return t instanceof Response&&!!t.options}function Si(t){return{input:({url:e})=>{for(const s of t)e=$e(s,e);return e},output:({url:e})=>{for(let s=t.length-1;s>=0;s--)e=Ir(t[s],e);return e}}}function bi(t){const e=Tr(t.basepath),s=`/${e}`,r=`${s}/`,n=t.caseSensitive?s:s.toLowerCase(),i=t.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const c=t.caseSensitive?a.pathname:a.pathname.toLowerCase();return c===n?a.pathname="/":c.startsWith(i)&&(a.pathname=a.pathname.slice(s.length)),a},output:({url:a})=>(a.pathname=Zt(["/",e,a.pathname]),a)}}function $e(t,e){const s=t?.input?.({url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}function Ir(t,e){const s=t?.output?.({url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}var U=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(U||{});function kr({update:t,notify:e,unwatched:s}){return{link:r,unlink:n,propagate:i,checkDirty:a,shallowPropagate:c};function r(o,l,f){const h=l.depsTail;if(h!==void 0&&h.dep===o)return;const d=h!==void 0?h.nextDep:l.deps;if(d!==void 0&&d.dep===o){d.version=f,l.depsTail=d;return}const p=o.subsTail;if(p!==void 0&&p.version===f&&p.sub===l)return;const y=l.depsTail=o.subsTail={version:f,dep:o,sub:l,prevDep:h,nextDep:d,prevSub:p,nextSub:void 0};d!==void 0&&(d.prevDep=y),h!==void 0?h.nextDep=y:l.deps=y,p!==void 0?p.nextSub=y:o.subs=y}function n(o,l=o.sub){const f=o.dep,h=o.prevDep,d=o.nextDep,p=o.nextSub,y=o.prevSub;return d!==void 0?d.prevDep=h:l.depsTail=h,h!==void 0?h.nextDep=d:l.deps=d,p!==void 0?p.prevSub=y:f.subsTail=y,y!==void 0?y.nextSub=p:(f.subs=p)===void 0&&s(f),d}function i(o){let l=o.nextSub,f;t:do{const h=o.sub;let d=h.flags;if(d&60?d&12?d&4?!(d&48)&&u(o,h)?(h.flags=d|40,d&=1):d=0:h.flags=d&-9|32:d=0:h.flags=d|32,d&2&&e(h),d&1){const p=h.subs;if(p!==void 0){const y=(o=p).nextSub;y!==void 0&&(f={value:l,prev:f},l=y);continue}}if((o=l)!==void 0){l=o.nextSub;continue}for(;f!==void 0;)if(o=f.value,f=f.prev,o!==void 0){l=o.nextSub;continue t}break}while(!0)}function a(o,l){let f,h=0,d=!1;t:do{const p=o.dep,y=p.flags;if(l.flags&16)d=!0;else if((y&17)===17){if(t(p)){const g=p.subs;g.nextSub!==void 0&&c(g),d=!0}}else if((y&33)===33){(o.nextSub!==void 0||o.prevSub!==void 0)&&(f={value:o,prev:f}),o=p.deps,l=p,++h;continue}if(!d){const g=o.nextDep;if(g!==void 0){o=g;continue}}for(;h--;){const g=l.subs,v=g.nextSub!==void 0;if(v?(o=f.value,f=f.prev):o=g,d){if(t(l)){v&&c(g),l=o.sub;continue}d=!1}else l.flags&=-33;l=o.sub;const R=o.nextDep;if(R!==void 0){o=R;continue t}}return d}while(!0)}function c(o){do{const l=o.sub,f=l.flags;(f&48)===32&&(l.flags=f|16,(f&6)===2&&e(l))}while((o=o.nextSub)!==void 0)}function u(o,l){let f=l.depsTail;for(;f!==void 0;){if(f===o)return!0;f=f.prevDep}return!1}}let rs=0,mt=0,Nt=0;const nt=[],{link:Ho,unlink:Ar,propagate:qo,checkDirty:Ri,shallowPropagate:Ko}=kr({update(t){return t.depsTail!==void 0?xi(t):Ci(t)},notify(t){let e=Nt,s=e;do if(nt[e++]=t,t.flags&=-3,t=t.subs?.sub,t===void 0||!(t.flags&2))break;while(!0);for(Nt=e;s<--e;){const r=nt[s];nt[s++]=nt[e],nt[e]=r}},unwatched(t){t.flags&1?t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,pe(t)):Li.call(t)}});function Pi(){return rs}function wi(){++rs}function _i(){--rs||Oi()}function xi(t){t.depsTail=void 0,t.flags=5;try{const e=t.value;return e!==(t.value=t.getter(e))}finally{t.flags&=-5,pe(t)}}function Ci(t){return t.flags=1,t.currentValue!==(t.currentValue=t.pendingValue)}function Ei(t){const e=t.flags;if(e&16||e&32&&Ri(t.deps,t)){t.depsTail=void 0,t.flags=6;try{t.fn()}finally{t.flags&=-5,pe(t)}}else t.flags=2}function Oi(){try{for(;mt<Nt;){const t=nt[mt];nt[mt++]=void 0,Ei(t)}}finally{for(;mt<Nt;){const t=nt[mt];nt[mt++]=void 0,t.flags|=10}mt=0,Nt=0}}function Li(){this.depsTail=void 0,this.flags=0,pe(this);const t=this.subs;t!==void 0&&Ar(t)}function pe(t){const e=t.depsTail;let s=e!==void 0?e.nextDep:t.deps;for(;s!==void 0;)s=Ar(s,t)}function ns(t,e,s){const r=typeof t=="object",n=r?t:void 0;return{next:(r?t.next:t)?.bind(n),error:(r?t.error:e)?.bind(n),complete:(r?t.complete:s)?.bind(n)}}const He=[];let te=0;const{link:Ws,unlink:Mi,propagate:Ti,checkDirty:Fr,shallowPropagate:zs}=kr({update(t){return t._update()},notify(t){He[qe++]=t,t.flags&=~U.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=U.Mutable|U.Dirty,ue(t))}});let Xt=0,qe=0,rt;function ue(t){const e=t.depsTail;let s=e!==void 0?e.nextDep:t.deps;for(;s!==void 0;)s=Mi(s,t)}function Dr(){if(!(Pi()>0)){for(;Xt<qe;){const t=He[Xt];He[Xt++]=void 0,t.notify()}Xt=0,qe=0}}function jr(t,e){const s=typeof t=="function",r=t,n={_snapshot:s?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?U.None:U.Mutable,get(){return rt!==void 0&&Ws(n,rt,te),n._snapshot},subscribe(i){const a=ns(i),c={current:!1},u=Ii(()=>{n.get(),c.current?a.next?.(n._snapshot):c.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(i){const a=rt,c=Object.is;if(s)rt=n,++te,n.depsTail=void 0;else if(i===void 0)return!1;s&&(n.flags=U.Mutable|U.RecursedCheck);try{const u=n._snapshot,o=typeof i=="function"?i(u):i===void 0&&s?r(u):i;return u===void 0||!c(u,o)?(n._snapshot=o,!0):!1}finally{rt=a,s&&(n.flags&=~U.RecursedCheck),ue(n)}}};return s?(n.flags=U.Mutable|U.Dirty,n.get=function(){const i=n.flags;if(i&U.Dirty||i&U.Pending&&Fr(n.deps,n)){if(n._update()){const a=n.subs;a!==void 0&&zs(a)}}else i&U.Pending&&(n.flags=i&~U.Pending);return rt!==void 0&&Ws(n,rt,te),n._snapshot}):n.set=function(i){if(n._update(i)){const a=n.subs;a!==void 0&&(Ti(a),zs(a),Dr())}},n}function Ii(t){const e=()=>{const r=rt;rt=s,++te,s.depsTail=void 0,s.flags=U.Watching|U.RecursedCheck;try{return t()}finally{rt=r,s.flags&=~U.RecursedCheck,ue(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:U.Watching|U.RecursedCheck,notify(){const r=this.flags;r&U.Dirty||r&U.Pending&&Fr(this.deps,this)?e():this.flags=U.Watching},stop(){this.flags=U.None,this.depsTail=void 0,ue(this)}};return e(),s}class ki{constructor(e){this.atom=jr(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(ns(e))}}class Ai{constructor(e){this.atom=jr(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(ns(e))}}function Fi(t){return typeof t=="function"?new Ai(t):new ki(t)}function Di(t){try{wi(),t()}finally{_i(),Dr()}}function Ut(t){let e;return Di(()=>{e=t()}),e}var Ke=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},me=(t,e)=>!!(t.preload&&!t.router.state.matches.some(s=>s.id===e)),Pt=(t,e,s=!0)=>{const r={...t.router.options.context??{}},n=s?e:e-1;for(let i=0;i<=n;i++){const a=t.matches[i];if(!a)continue;const c=t.router.getMatch(a.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},Vs=(t,e)=>{if(!t.matches.length)return;const s=e.routeId,r=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),n=r>=0?r:0;let i=s?t.matches.findIndex(a=>a.routeId===s):t.firstBadMatchIndex??t.matches.length-1;i<0&&(i=n);for(let a=i;a>=0;a--){const c=t.matches[a];if(t.router.looseRoutesById[c.routeId].options.notFoundComponent)return a}return s?i:n},at=(t,e,s)=>{if(!(!Y(s)&&!G(s)))throw Y(s)&&s.redirectHandled&&!s.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=s,t.updateMatch(e.id,r=>({...r,status:Y(s)?"redirected":r.status==="pending"?"success":r.status,context:Pt(t,e.index),isFetching:!1,error:s})),G(s)&&!s.routeId&&(s.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),Y(s)&&(t.rendered=!0,s.options._fromLocation=t.location,s.redirectHandled=!0,s=t.router.resolveRedirect(s))),s},Br=(t,e)=>{const s=t.router.getMatch(e);return!!(!s||s._nonReactive.dehydrated)},Gs=(t,e,s)=>{const r=Pt(t,s);t.updateMatch(e,n=>({...n,context:r}))},jt=(t,e,s,r)=>{const{id:n,routeId:i}=t.matches[e],a=t.router.looseRoutesById[i];if(s instanceof Promise)throw s;s.routerCode=r,t.firstBadMatchIndex??=e,at(t,t.router.getMatch(n),s);try{a.options.onError?.(s)}catch(c){s=c,at(t,t.router.getMatch(n),s)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!Y(s)&&!G(s)&&(t.serialError??=s)},Nr=(t,e,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const n=s.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!me(t,e)&&(s.options.loader||s.options.beforeLoad||Qr(s))&&typeof n=="number"&&n!==1/0&&(s.options.pendingComponent??t.router.options?.defaultPendingComponent)){const i=setTimeout(()=>{Ke(t)},n);r._nonReactive.pendingTimeout=i}},ji=(t,e,s)=>{const r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Nr(t,e,s,r);const n=()=>{const i=t.router.getMatch(e);i.preload&&(i.status==="redirected"||i.status==="notFound")&&at(t,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(n):n()},Bi=(t,e,s,r)=>{const n=t.router.getMatch(e);let i=n._nonReactive.loadPromise;n._nonReactive.loadPromise=Tt(()=>{i?.resolve(),i=void 0});const{paramsError:a,searchError:c}=n;a&&jt(t,s,a,"PARSE_PARAMS"),c&&jt(t,s,c,"VALIDATE_SEARCH"),Nr(t,e,r,n);const u=new AbortController;let o=!1;const l=()=>{o||(o=!0,t.updateMatch(e,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:u})))},f=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){Ut(()=>{l(),f()});return}n._nonReactive.beforeLoadPromise=Tt();const h={...Pt(t,s,!1),...n.__routeContext},{search:d,params:p,cause:y}=n,g=me(t,e),v={search:d,abortController:u,params:p,preload:g,context:h,location:t.location,navigate:w=>t.router.navigate({...w,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:g?"preload":y,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},R=w=>{if(w===void 0){Ut(()=>{l(),f()});return}(Y(w)||G(w))&&(l(),jt(t,s,w,"BEFORE_LOAD")),Ut(()=>{l(),t.updateMatch(e,M=>({...M,__beforeLoadContext:w})),f()})};let _;try{if(_=r.options.beforeLoad(v),qt(_))return l(),_.catch(w=>{jt(t,s,w,"BEFORE_LOAD")}).then(R)}catch(w){l(),jt(t,s,w,"BEFORE_LOAD")}R(_)},Ni=(t,e)=>{const{id:s,routeId:r}=t.matches[e],n=t.router.looseRoutesById[r],i=()=>c(),a=()=>Bi(t,s,e,n),c=()=>{if(Br(t,s))return;const u=ji(t,s,n);return qt(u)?u.then(a):a()};return i()},Ui=(t,e,s)=>{const r=t.router.getMatch(e);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const n={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(n),s.options.scripts?.(n),s.options.headers?.(n)]).then(([i,a,c])=>({meta:i?.meta,links:i?.links,headScripts:i?.scripts,headers:c,scripts:a,styles:i?.styles}))},Ur=(t,e,s,r,n)=>{const i=e[r-1],{params:a,loaderDeps:c,abortController:u,cause:o}=t.router.getMatch(s),l=Pt(t,r),f=me(t,s);return{params:a,deps:c,preload:!!f,parentMatchPromise:i,abortController:u,context:l,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:f?"preload":o,route:n,...t.router.options.additionalContext}},Ys=async(t,e,s,r,n)=>{try{const i=t.router.getMatch(s);try{(!(Dn??t.router.isServer)||i.ssr===!0)&&Kt(n);const a=n.options.loader,c=typeof a=="function"?a:a?.handler,u=c?.(Ur(t,e,s,r,n)),o=!!c&&qt(u);if((o||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||i._nonReactive.minPendingPromise)&&t.updateMatch(s,f=>({...f,isFetching:"loader"})),c){const f=o?await u:u;at(t,t.router.getMatch(s),f),f!==void 0&&t.updateMatch(s,h=>({...h,loaderData:f}))}n._lazyPromise&&await n._lazyPromise;const l=i._nonReactive.minPendingPromise;l&&await l,n._componentsPromise&&await n._componentsPromise,t.updateMatch(s,f=>({...f,error:void 0,context:Pt(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let c=a;if(c?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}t.updateMatch(s,o=>({...o,status:o.status==="pending"?"success":o.status,isFetching:!1,context:Pt(t,r)}));return}const u=i._nonReactive.minPendingPromise;u&&await u,G(a)&&await n.options.notFoundComponent?.preload?.(),at(t,t.router.getMatch(s),a);try{n.options.onError?.(a)}catch(o){c=o,at(t,t.router.getMatch(s),o)}!Y(c)&&!G(c)&&await Kt(n,["errorComponent"]),t.updateMatch(s,o=>({...o,error:c,context:Pt(t,r),status:"error",isFetching:!1}))}}catch(i){const a=t.router.getMatch(s);a&&(a._nonReactive.loaderPromise=void 0),at(t,a,i)}},Qi=async(t,e,s)=>{async function r(d,p,y,g,v){const R=Date.now()-p.updatedAt,_=d?v.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??t.router.options.defaultStaleTime??0,w=v.options.shouldReload,M=typeof w=="function"?w(Ur(t,e,n,s,v)):w,{status:E,invalid:S}=g,x=R>_&&(!!t.forceStaleReload||g.cause==="enter"||y!==void 0&&y!==g.id);a=E==="success"&&(S||(M??x)),d&&v.options.preload===!1||(a&&!t.sync&&l?(c=!0,(async()=>{try{await Ys(t,e,n,s,v);const P=t.router.getMatch(n);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Y(P)&&await t.router.navigate(P.options)}})()):E!=="success"||a?await Ys(t,e,n,s,v):Gs(t,n,s))}const{id:n,routeId:i}=t.matches[s];let a=!1,c=!1;const u=t.router.looseRoutesById[i],o=u.options.loader,l=((typeof o=="function"?void 0:o?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Br(t,n)){if(!t.router.getMatch(n))return t.matches[s];Gs(t,n,s)}else{const d=t.router.getMatch(n),p=t.router.state.matches[s]?.routeId===i?t.router.state.matches[s].id:t.router.state.matches.find(g=>g.routeId===i)?.id,y=me(t,n);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!t.sync&&!d.preload&&l)return d;await d._nonReactive.loaderPromise;const g=t.router.getMatch(n),v=g._nonReactive.error||g.error;v&&at(t,g,v),g.status==="pending"&&await r(y,d,p,g,u)}else{const g=y&&!t.router.state.matches.some(R=>R.id===n),v=t.router.getMatch(n);v._nonReactive.loaderPromise=Tt(),g!==v.preload&&t.updateMatch(n,R=>({...R,preload:g})),await r(y,d,p,v,u)}}const f=t.router.getMatch(n);c||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,c||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=c?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(t.updateMatch(n,d=>({...d,isFetching:h,invalid:!1})),t.router.getMatch(n)):f};async function Js(t){const e=t,s=[];e.router.state.matches.some(h=>h._forcePending)&&Ke(e);let r;for(let h=0;h<e.matches.length;h++){try{const d=Ni(e,h);qt(d)&&await d}catch(d){if(Y(d))throw d;if(G(d))r=d;else if(!e.preload)throw d;break}if(e.serialError)break}const n=e.firstBadMatchIndex??e.matches.length,i=r&&!e.preload?Vs(e,r):void 0,a=r&&e.preload?0:i!==void 0?Math.min(i+1,n):n;let c,u;for(let h=0;h<a;h++)s.push(Qi(e,s,h));try{await Promise.all(s)}catch{const h=await Promise.allSettled(s);for(const d of h){if(d.status!=="rejected")continue;const p=d.reason;if(Y(p))throw p;G(p)?c??=p:u??=p}if(u!==void 0)throw u}const o=c??(r&&!e.preload?r:void 0);let l=e.serialError?e.firstBadMatchIndex??0:e.matches.length-1;if(!o&&r&&e.preload)return e.matches;if(o){const h=Vs(e,o);ht(h!==void 0);const d=e.matches[h],p=e.router.looseRoutesById[d.routeId],y=e.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&y&&(p.options.notFoundComponent=y),o.routeId=d.routeId;const g=d.routeId===e.router.routeTree.id;e.updateMatch(d.id,v=>({...v,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:o},isFetching:!1})),l=h,await Kt(p,["notFoundComponent"])}else if(!e.preload){const h=e.matches[0];h.globalNotFound||e.router.getMatch(h.id)?.globalNotFound&&e.updateMatch(h.id,d=>({...d,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){const h=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await Kt(h,["errorComponent"])}for(let h=0;h<=l;h++){const{id:d,routeId:p}=e.matches[h],y=e.router.looseRoutesById[p];try{const g=Ui(e,d,y);if(g){const v=await g;e.updateMatch(d,R=>({...R,...v}))}}catch(g){console.error(`Error executing head for route ${p}:`,g)}}const f=Ke(e);if(qt(f)&&await f,o)throw o;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}function Xs(t,e){const s=e.map(r=>t.options[r]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Kt(t,e=ee){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(r=>{const{id:n,...i}=r.options;Object.assign(t.options,i),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const s=()=>t._componentsLoaded?void 0:e===ee?(()=>{if(t._componentsPromise===void 0){const r=Xs(t,ee);r?t._componentsPromise=r.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():Xs(t,e);return t._lazyPromise?t._lazyPromise.then(s):s()}function Qr(t){for(const e of ee)if(t.options[e]?.preload)return!0;return!1}var ee=["component","errorComponent","pendingComponent","notFoundComponent"],lt="__TSR_index",Zs="popstate",tr="beforeunload";function $i(t){let e=t.getLocation();const s=new Set,r=a=>{e=t.getLocation(),s.forEach(c=>c({location:e,action:a}))},n=a=>{t.notifyOnIndexChange??!0?r(a):e=t.getLocation()},i=async({task:a,navigateOpts:c,...u})=>{if(c?.ignoreBlocker??!1){a();return}const o=t.getBlockers?.()??[],l=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&o.length&&l)for(const f of o){const h=le(u.path,u.state);if(await f.blockerFn({currentLocation:e,nextLocation:h,action:u.type})){t.onBlocked?.();return}}a()};return{get location(){return e},get length(){return t.getLength()},subscribers:s,subscribe:a=>(s.add(a),()=>{s.delete(a)}),push:(a,c,u)=>{const o=e.state[lt];c=er(o+1,c),i({task:()=>{t.pushState(a,c),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:a,state:c})},replace:(a,c,u)=>{const o=e.state[lt];c=er(o,c),i({task:()=>{t.replaceState(a,c),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:a,state:c})},go:(a,c)=>{i({task:()=>{t.go(a),n({type:"GO",index:a})},navigateOpts:c,type:"GO"})},back:a=>{i({task:()=>{t.back(a?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{t.forward(a?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>e.state[lt]!==0,createHref:a=>t.createHref(a),block:a=>{if(!t.setBlockers)return()=>{};const c=t.getBlockers?.()??[];return t.setBlockers([...c,a]),()=>{const u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(o=>o!==a))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function er(t,e){e||(e={});const s=is();return{...e,key:s,__TSR_key:s,[lt]:t}}function Hi(t){const e=typeof document<"u"?window:void 0,s=e.history.pushState,r=e.history.replaceState;let n=[];const i=()=>n,a=x=>n=x,c=(x=>x),u=(()=>le(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const x=is();e.history.replaceState({[lt]:0,key:x,__TSR_key:x},"")}let o=u(),l,f=!1,h=!1,d=!1,p=!1;const y=()=>o;let g,v;const R=()=>{g&&(S._ignoreSubscribers=!0,(g.isPush?e.history.pushState:e.history.replaceState)(g.state,"",g.href),S._ignoreSubscribers=!1,g=void 0,v=void 0,l=void 0)},_=(x,P,T)=>{const F=c(P);v||(l=o),o=le(P,T),g={href:F,state:T,isPush:g?.isPush||x==="push"},v||(v=Promise.resolve().then(()=>R()))},w=x=>{o=u(),S.notify({type:x})},M=async()=>{if(h){h=!1;return}const x=u(),P=x.state[lt]-o.state[lt],T=P===1,F=P===-1,B=!T&&!F||f;f=!1;const D=B?"GO":F?"BACK":"FORWARD",X=B?{type:"GO",index:P}:{type:F?"BACK":"FORWARD"};if(d)d=!1;else{const q=i();if(typeof document<"u"&&q.length){for(const Z of q)if(await Z.blockerFn({currentLocation:o,nextLocation:x,action:D})){h=!0,e.history.go(1),S.notify(X);return}}}o=u(),S.notify(X)},E=x=>{if(p){p=!1;return}let P=!1;const T=i();if(typeof document<"u"&&T.length)for(const F of T){const B=F.enableBeforeUnload??!0;if(B===!0){P=!0;break}if(typeof B=="function"&&B()===!0){P=!0;break}}if(P)return x.preventDefault(),x.returnValue=""},S=$i({getLocation:y,getLength:()=>e.history.length,pushState:(x,P)=>_("push",x,P),replaceState:(x,P)=>_("replace",x,P),back:x=>(x&&(d=!0),p=!0,e.history.back()),forward:x=>{x&&(d=!0),p=!0,e.history.forward()},go:x=>{f=!0,e.history.go(x)},createHref:x=>c(x),flush:R,destroy:()=>{e.history.pushState=s,e.history.replaceState=r,e.removeEventListener(tr,E,{capture:!0}),e.removeEventListener(Zs,M)},onBlocked:()=>{l&&o!==l&&(o=l)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return e.addEventListener(tr,E,{capture:!0}),e.addEventListener(Zs,M),e.history.pushState=function(...x){const P=s.apply(e.history,x);return S._ignoreSubscribers||w("PUSH"),P},e.history.replaceState=function(...x){const P=r.apply(e.history,x);return S._ignoreSubscribers||w("REPLACE"),P},S}function qi(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function le(t,e){const s=qi(t),r=s.indexOf("#"),n=s.indexOf("?"),i=is();return{href:s,pathname:s.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:s.length),hash:r>-1?s.substring(r):"",search:n>-1?s.slice(n,r===-1?void 0:r):"",state:e||{[lt]:0,key:i,__TSR_key:i}}}function is(){return(Math.random()+1).toString(36).substring(7)}function wt(t){const e=t.resolvedLocation,s=t.location;return{fromLocation:e,toLocation:s,pathChanged:e?.pathname!==s.pathname,hrefChanged:e?.href!==s.href,hashChanged:e?.hash!==s.hash}}function Ki(t){const e=t.filter(s=>s.status!=="redirected");return e.length===t.length?t:e}var Wi=class{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{const s=this.options,r=this.basepath??s?.basepath??"/",n=this.basepath===void 0,i=s?.rewrite;if(this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ri(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Hi()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let o;this.resolvePathCache=oe(1e3),o=this.buildRouteTree(),this.setRoutes(o)}!this.__store&&this.latestLocation&&(this.__store=Fi(Vi(this.latestLocation)),li(this));let a=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(n||r!==c||i!==u){this.basepath=c;const o=[],l=Tr(c);l&&l!=="/"&&o.push(bi({basepath:c})),u&&o.push(u),this.rewrite=o.length===0?void 0:o.length===1?o[0]:Si(o),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(o=>({...o,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const e=Jn(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&Wn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,s)=>{const r={eventType:e,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const r=({pathname:c,search:u,hash:o,href:l,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const g=this.options.parseSearch(u),v=this.options.stringifySearch(g);return{href:c+v+o,publicHref:l,pathname:Ft(c).path,external:!1,searchStr:v,search:pt(s?.search,g),hash:Ft(o.slice(1)).path,state:gt(s?.state,f)}}const h=new URL(l,this.origin),d=$e(this.rewrite,h),p=this.options.parseSearch(d.search),y=this.options.stringifySearch(p);return d.search=y,{href:d.href.replace(d.origin,""),publicHref:l,pathname:Ft(d.pathname).path,external:!!this.rewrite&&d.origin!==this.origin,searchStr:y,search:pt(s?.search,p),hash:Ft(d.hash.slice(1)).path,state:gt(s?.state,f)}},n=r(e),{__tempLocation:i,__tempKey:a}=n.state;if(i&&(!a||a===this.tempLocationKey)){const c=r(i);return c.state.key=n.state.key,c.state.__TSR_key=n.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:n}}return n},this.resolvePathWithBase=(e,s)=>si({base:e,to:ss(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,s,r)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},r):this.matchRoutesInternal(e,s),this.getMatchedRoutes=e=>Gi({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(n={})=>{const i=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);n.from;const c=n.unsafeRelative==="path"?i.pathname:n.from??a.fullPath,u=this.resolvePathWithBase(c,"."),o=a.search,l=Object.assign(Object.create(null),a.params),f=n.to?this.resolvePathWithBase(u,`${n.to}`):this.resolvePathWithBase(u,"."),h=n.params===!1||n.params===null?Object.create(null):(n.params??!0)===!0?l:Object.assign(l,ot(n.params,l)),d=this.getMatchedRoutes(f);let p=d.matchedRoutes;if((!d.foundRoute||d.foundRoute.path!=="/"&&d.routeParams["**"])&&this.options.notFoundRoute&&(p=[...p,this.options.notFoundRoute]),Object.keys(h).length>0)for(const P of p){const T=P.options.params?.stringify??P.options.stringifyParams;if(T)try{Object.assign(h,T(h))}catch{}}const y=e.leaveParams?f:Ft(qs({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=o;if(e._includeValidateSearch&&this.options.search?.strict){const P={};p.forEach(T=>{if(T.options.validateSearch)try{Object.assign(P,se(T.options.validateSearch,{...P,...g}))}catch{}}),g=P}g=Yi({search:g,dest:n,destRoutes:p,_includeValidateSearch:e._includeValidateSearch}),g=pt(o,g);const v=this.options.stringifySearch(g),R=n.hash===!0?i.hash:n.hash?ot(n.hash,i.hash):void 0,_=R?`#${R}`:"";let w=n.state===!0?i.state:n.state?ot(n.state,i.state):{};w=gt(i.state,w);const M=`${y}${v}${_}`;let E,S,x=!1;if(this.rewrite){const P=new URL(M,this.origin),T=Ir(this.rewrite,P);E=P.href.replace(P.origin,""),T.origin!==this.origin?(S=T.href,x=!0):S=T.pathname+T.search+T.hash}else E=Hn(M),S=E;return{publicHref:S,href:E,pathname:y,search:g,searchStr:v,state:w,hash:R??"",external:x,unmaskOnReload:n.unmaskOnReload}},r=(n={},i)=>{const a=s(n);let c=i?s(i):void 0;if(!c){const u=Object.create(null);if(this.options.routeMasks){const o=zn(a.pathname,this.processedTree);if(o){Object.assign(u,o.rawParams);const{from:l,params:f,...h}=o.route,d=f===!1||f===null?Object.create(null):(f??!0)===!0?u:Object.assign(u,ot(f,u));i={from:e.from,...h,params:d},c=s(i)}}}return c&&(a.maskedLocation=c),a};return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:s,...r})=>{const n=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(o=>{r.state[o]=this.latestLocation.state[o]});const u=bt(r.state,this.latestLocation.state);return c.forEach(o=>{delete r.state[o]}),u},i=ut(this.latestLocation.href)===ut(r.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Tt(()=>{a?.resolve(),a=void 0}),i&&n())this.load();else{let{maskedLocation:c,hashScrollIntoView:u,...o}=r;c&&(o={...c,state:{...c.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=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[r.replace?"replace":"push"](o.publicHref,o.state,{ignoreBlocker:s})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:r,viewTransition:n,ignoreBlocker:i,href:a,...c}={})=>{if(a){const l=this.history.location.state.__TSR_index,f=le(a,{__TSR_index:e?l:l+1}),h=new URL(f.pathname,this.origin);c.to=$e(this.rewrite,h).pathname,c.search=this.options.parseSearch(f.search),c.hash=f.hash.slice(1)}const u=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const o=this.commitLocation({...u,viewTransition:n,replace:e,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),o},this.navigate=async({to:e,reloadDocument:s,href:r,publicHref:n,...i})=>{let a=!1;if(r)try{new URL(`${r}`),a=!0}catch{}if(a&&!s&&(s=!0),s){if(e!==void 0||!r){const u=this.buildLocation({to:e,...i});r=r??u.publicHref,n=n??u.publicHref}const c=!a&&n?n:r;if(ie(c,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const o of u)if(o?.blockerFn&&await o.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:r,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(r=>!e.some(n=>n.id===r.id))}))},this.load=async e=>{let s,r,n;const i=this.state.resolvedLocation??this.state.location;for(n=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const u=this.latestLocation,o=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...wt({resolvedLocation:o,location:u})}),this.emit({type:"onBeforeLoad",...wt({resolvedLocation:o,location:u})}),await Js({router:this,sync:e?.sync,forceStaleReload:i.href===u.href,matches:this.state.pendingMatches,location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let l=[],f=[],h=[],d=[];Ut(()=>{this.__store.setState(p=>{const y=p.matches,g=p.pendingMatches||p.matches;return l=y.filter(v=>!g.some(R=>R.id===v.id)),f=y.filter(v=>!g.some(R=>R.routeId===v.routeId)),h=g.filter(v=>!y.some(R=>R.routeId===v.routeId)),d=g.filter(v=>y.some(R=>R.routeId===v.routeId)),{...p,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...p.cachedMatches,...l.filter(v=>v.status!=="error"&&v.status!=="notFound"&&v.status!=="redirected")]}}),this.clearExpiredCache()}),[[f,"onLeave"],[h,"onEnter"],[d,"onStay"]].forEach(([p,y])=>{p.forEach(g=>{this.looseRoutesById[g.routeId].options[y]?.(g)})})})})}})}catch(u){Y(u)?(s=u,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):G(u)&&(r=u),this.__store.setState(o=>({...o,statusCode:s?s.status:r?404:o.matches.some(l=>l.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===n&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=n,await n;this.latestLoadPromise&&n!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(c=>c.status==="error")&&(a=500),a!==void 0&&this.__store.setState(c=>({...c,statusCode:a}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const n=this.latestLocation,i=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(wt({resolvedLocation:i,location:n})):s.types;if(a===!1){e();return}r={update:e,types:a}}else r=e;document.startViewTransition(r)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(n=>n.id===e)?"pendingMatches":this.state.matches.some(n=>n.id===e)?"matches":this.state.cachedMatches.some(n=>n.id===e)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(n=>({...n,cachedMatches:Ki(n.cachedMatches.map(i=>i.id===e?s(i):i))})):this.__store.setState(n=>({...n,[r]:n[r]?.map(i=>i.id===e?s(i):i)})))})},this.getMatch=e=>{const s=r=>r.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=r=>e?.filter?.(r)??!0?{...r,invalid:!0,...e?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(s),cachedMatches:r.cachedMatches.map(s),pendingMatches:r.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{const s=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){const r=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(r);e.options.href=n,e.headers.set("Location",n)}else if(s)try{const r=new URL(s);if(this.origin&&r.origin===this.origin){const n=r.pathname+r.search+r.hash;e.options.href=n,e.headers.set("Location",n)}}catch{}if(e.options.href&&!e.options._builtLocation&&ie(e.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(n=>!s(n))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const r=this.looseRoutesById[s.routeId];if(!r.options.loader)return!0;const n=(s.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=n};this.clearCache({filter:e})},this.loadRouteChunk=Kt,this.preloadRoute=async e=>{const s=e._builtLocation??this.buildLocation(e);let r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const n=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...n,...this.state.cachedMatches.map(a=>a.id)]);Ut(()=>{r.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return r=await Js({router:this,matches:r,location:s,preload:!0,updateMatch:(a,c)=>{n.has(a)?r=r.map(u=>u.id===a?c(u):u):this.updateMatch(a,c)}}),r}catch(a){if(Y(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});G(a)||console.error(a);return}},this.matchRoute=(e,s)=>{const r={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},n=this.buildLocation(r);if(s?.pending&&this.state.status!=="pending")return!1;const i=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Vn(n.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!bt(a.rawParams,e.params,{partial:!0})?!1:s?.includeSearch??!0?bt(i.search,n.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??mi,parseSearch:t.parseSearch??pi,protocolAllowlist:t.protocolAllowlist??$n}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:e,processedTree:s}){this.routesById=t,this.routesByPath=e,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const s=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:n,parsedParams:i}=s;let{matchedRoutes:a}=s,c=!1;(r?r.path!=="/"&&n["**"]:ut(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const u=c?Xi(this.options.notFoundMode,a):void 0,o=new Array(a.length),l=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<a.length;f++){const h=a[f],d=o[f-1];let p,y,g;{const D=d?.search??t.search,X=d?._strictSearch??void 0;try{const q=se(h.options.validateSearch,{...D})??void 0;p={...D,...q},y={...X,...q},g=void 0}catch(q){let Z=q;if(q instanceof he||(Z=new he(q.message,{cause:q})),e?.throwOnError)throw Z;p=D,y={},g=Z}}const v=h.options.loaderDeps?.({search:p})??"",R=v?JSON.stringify(v):"",{interpolatedPath:_,usedParams:w}=qs({path:h.fullPath,params:n,decoder:this.pathParamsDecoder,server:this.isServer}),M=h.id+_+R,E=this.getMatch(M),S=l.get(h.id),x=E?._strictParams??w;let P;if(!E)try{sr(h,w,i,x)}catch(D){if(G(D)||Y(D)?P=D:P=new zi(D.message,{cause:D}),e?.throwOnError)throw P}Object.assign(n,x);const T=S?"stay":"enter";let F;if(E)F={...E,cause:T,params:S?.params??n,_strictParams:x,search:pt(S?S.search:E.search,p),_strictSearch:y};else{const D=h.options.loader||h.options.beforeLoad||h.lazyFn||Qr(h)?"pending":"success";F={id:M,ssr:h.options.ssr,index:f,routeId:h.id,params:S?.params??n,_strictParams:x,pathname:_,updatedAt:Date.now(),search:S?pt(S.search,p):p,_strictSearch:y,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Tt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:T,loaderDeps:S?gt(S.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}e?.preload||(F.globalNotFound=u===h.id),F.searchError=g;const B=this.getParentContext(d);F.context={...B,...F.__routeContext,...F.__beforeLoadContext},o[f]=F}for(let f=0;f<o.length;f++){const h=o[f],d=this.looseRoutesById[h.routeId],p=this.getMatch(h.id),y=l.get(h.routeId);if(h.params=y?pt(y.params,n):n,!p){const g=o[f-1],v=this.getParentContext(g);if(d.options.context){const R={deps:h.loaderDeps,params:h.params,context:v??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:o,routeId:d.id};h.__routeContext=d.options.context(R)??void 0}h.context={...v,...h.__routeContext,...h.__beforeLoadContext}}}return o}matchRoutesLightweight(t){const{matchedRoutes:e,routeParams:s,parsedParams:r}=this.getMatchedRoutes(t.pathname),n=Ht(e),i={...t.search};for(const o of e)try{Object.assign(i,se(o.options.validateSearch,i))}catch{}const a=Ht(this.state.matches),c=a&&a.routeId===n.id&&t.pathname===this.state.location.pathname;let u;if(c)u=a.params;else{const o=Object.assign(Object.create(null),s);for(const l of e)try{sr(l,s,r??{},o)}catch{}u=o}return{matchedRoutes:e,fullPath:n.fullPath,search:i,params:u}}},he=class extends Error{},zi=class extends Error{};function Vi(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function se(t,e){if(t==null)return{};if("~standard"in t){const s=t["~standard"].validate(e);if(s instanceof Promise)throw new he("Async validation not supported");if(s.issues)throw new he(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function Gi({pathname:t,routesById:e,processedTree:s}){const r=Object.create(null),n=ut(t);let i,a;const c=Gn(n,s,!0);return c&&(i=c.route,Object.assign(r,c.rawParams),a=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[e.__root__],routeParams:r,foundRoute:i,parsedParams:a}}function Yi({search:t,dest:e,destRoutes:s,_includeValidateSearch:r}){return Ji(s)(t,e,r??!1)}function Ji(t){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const n of t){if("search"in n.options)n.options.search?.middlewares&&e.middlewares.push(...n.options.search.middlewares);else if(n.options.preSearchFilters||n.options.postSearchFilters){const i=({search:a,next:c})=>{let u=a;"preSearchFilters"in n.options&&n.options.preSearchFilters&&(u=n.options.preSearchFilters.reduce((l,f)=>f(l),a));const o=c(u);return"postSearchFilters"in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((l,f)=>f(l),o):o};e.middlewares.push(i)}if(n.options.validateSearch){const i=({search:a,next:c})=>{const u=c(a);if(!e._includeValidateSearch)return u;try{return{...u,...se(n.options.validateSearch,u)??void 0}}catch{return u}};e.middlewares.push(i)}}const s=({search:n})=>{const i=e.dest;return i.search?i.search===!0?n:ot(i.search,n):{}};e.middlewares.push(s);const r=(n,i,a)=>{if(n>=a.length)return i;const c=a[n];return c({search:i,next:o=>r(n+1,o,a)})};return function(i,a,c){return e.dest=a,e._includeValidateSearch=c,r(0,i,e.middlewares)}}function Xi(t,e){if(t!=="root")for(let s=e.length-1;s>=0;s--){const r=e[s];if(r.children)return r.id}return Rt}function sr(t,e,s,r){const n=t.options.params?.parse??t.options.parseParams;if(n)if(t.options.skipRouteOnParseError)for(const i in e)i in s&&(r[i]=s[i]);else{const i=n(r);Object.assign(r,i)}}var Zi="Error preloading route! ☝️",$r=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Rt:this.parentRoute||ht(!1);let n=r?Rt:s?.path;n&&n!=="/"&&(n=Mr(n));const i=s?.id||n;let a=r?Rt:Zt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);n==="__root__"&&(n="/"),a!=="__root__"&&(a=Zt(["/",a]));const c=a==="__root__"?"/":Zt([this.parentRoute.fullPath,n]);this._path=n,this._id=a,this._fullPath=c,this._to=ut(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(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=>vi({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},to=class extends $r{constructor(t){super(t)}};function os(t){const e=t.errorComponent??as;return O.jsx(eo,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:s,reset:r})=>s?C.createElement(e,{error:s,reset:r}):t.children})}var eo=class extends C.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function as({error:t}){const[e,s]=C.useState(!1);return O.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[O.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[O.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),O.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:e?"Hide Error":"Show Error"})]}),O.jsx("div",{style:{height:".25rem"}}),e?O.jsx("div",{children:O.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?O.jsx("code",{children:t.message}):null})}):null]})}function so({children:t,fallback:e=null}){return Hr()?O.jsx(Mt.Fragment,{children:t}):O.jsx(Mt.Fragment,{children:e})}function Hr(){return Mt.useSyncExternalStore(ro,()=>!0,()=>!1)}function ro(){return()=>{}}var qr=C.createContext(null);function et(t){const e=C.useContext(qr);return t?.warn,e}var Oe={exports:{}},Le={},Me={exports:{}},Te={};var rr;function no(){if(rr)return Te;rr=1;var t=fe();function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var s=typeof Object.is=="function"?Object.is:e,r=t.useState,n=t.useEffect,i=t.useLayoutEffect,a=t.useDebugValue;function c(f,h){var d=h(),p=r({inst:{value:d,getSnapshot:h}}),y=p[0].inst,g=p[1];return i(function(){y.value=d,y.getSnapshot=h,u(y)&&g({inst:y})},[f,d,h]),n(function(){return u(y)&&g({inst:y}),f(function(){u(y)&&g({inst:y})})},[f]),a(d),d}function u(f){var h=f.getSnapshot;f=f.value;try{var d=h();return!s(f,d)}catch{return!0}}function o(f,h){return h()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:c;return Te.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:l,Te}var nr;function io(){return nr||(nr=1,Me.exports=no()),Me.exports}var ir;function oo(){if(ir)return Le;ir=1;var t=fe(),e=io();function s(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var r=typeof Object.is=="function"?Object.is:s,n=e.useSyncExternalStore,i=t.useRef,a=t.useEffect,c=t.useMemo,u=t.useDebugValue;return Le.useSyncExternalStoreWithSelector=function(o,l,f,h,d){var p=i(null);if(p.current===null){var y={hasValue:!1,value:null};p.current=y}else y=p.current;p=c(function(){function v(E){if(!R){if(R=!0,_=E,E=h(E),d!==void 0&&y.hasValue){var S=y.value;if(d(S,E))return w=S}return w=E}if(S=w,r(_,E))return S;var x=h(E);return d!==void 0&&d(S,x)?(_=E,S):(_=E,w=x)}var R=!1,_,w,M=f===void 0?null:f;return[function(){return v(l())},M===null?void 0:function(){return v(M())}]},[l,f,h,d]);var g=n(o,p[0],p[1]);return a(function(){y.hasValue=!0,y.value=g},[g]),u(g),g},Le}var or;function ao(){return or||(or=1,Oe.exports=oo()),Oe.exports}var co=ao();function uo(t,e){return t===e}function lo(t,e,s=uo){const r=C.useCallback(a=>{if(!t)return()=>{};const{unsubscribe:c}=t.subscribe(a);return c},[t]),n=C.useCallback(()=>t?.get(),[t]);return co.useSyncExternalStoreWithSelector(r,n,n,e,s)}function J(t){const e=et({warn:t?.router===void 0}),s=t?.router||e,r=C.useRef(void 0);return lo(s.__store,n=>{if(t?.select){if(t.structuralSharing??s.options.defaultStructuralSharing){const i=gt(r.current,t.select(n));return r.current=i,i}return t.select(n)}return n})}var ye=C.createContext(void 0),ho=C.createContext(void 0);function ft(t){const e=C.useContext(t.from?ho:ye);return J({select:s=>{const r=s.matches.find(n=>t.from?t.from===n.routeId:n.id===e);if(ht(!((t.shouldThrow??!0)&&!r),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),r!==void 0)return t.select?t.select(r):r},structuralSharing:t.structuralSharing})}function cs(t){return ft({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function us(t){const{select:e,...s}=t;return ft({...s,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function ls(t){return ft({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const s=t.strict===!1?e.params:e._strictParams;return t.select?t.select(s):s}})}function hs(t){return ft({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function fs(t){const e=et();return C.useCallback(s=>e.navigate({...s,from:s.from??t?.from}),[t?.from,e])}function ds(t){return ft({...t,select:e=>t.select?t.select(e.context):e.context})}var Kr=nn();const Wo=fr(Kr);function fo(t,e){const s=et(),r=Fn(e),{activeProps:n,inactiveProps:i,activeOptions:a,to:c,preload:u,preloadDelay:o,hashScrollIntoView:l,replace:f,startTransition:h,resetScroll:d,viewTransition:p,children:y,target:g,disabled:v,style:R,className:_,onClick:w,onBlur:M,onFocus:E,onMouseEnter:S,onMouseLeave:x,onTouchStart:P,ignoreBlocker:T,params:F,search:B,hash:D,state:X,mask:q,reloadDocument:Z,unsafeRelative:It,from:ps,_fromLocation:ge,...Wt}=t,m=Hr(),b=J({select:Q=>{const V=Q.matches[Q.matches.length-1];return{search:V?.search,hash:Q.location.hash,path:V?.pathname}},structuralSharing:!0}),I=t.from,L=C.useMemo(()=>({...t,from:I}),[s,b,I,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),k=C.useMemo(()=>s.buildLocation({...L}),[s,L]),j=k.maskedLocation?k.maskedLocation.publicHref:k.publicHref,N=k.maskedLocation?k.maskedLocation.external:k.external,K=C.useMemo(()=>So(j,N,s.history,v),[v,N,j,s.history]),H=C.useMemo(()=>{if(K?.external)return ie(K.href,s.protocolAllowlist)?void 0:K.href;if(!bo(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),ie(c,s.protocolAllowlist)?void 0:c}catch{}},[c,K,s.protocolAllowlist]),kt=J({select:Q=>{if(H)return!1;if(a?.exact){if(!ei(Q.location.pathname,k.pathname,s.basepath))return!1}else{const V=ae(Q.location.pathname,s.basepath),st=ae(k.pathname,s.basepath);if(!(V.startsWith(st)&&(V.length===st.length||V[st.length]==="/")))return!1}return(a?.includeSearch??!0)&&!bt(Q.location.search,k.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?m&&Q.location.hash===k.hash:!0}}),zt=kt?ot(n,{})??po:Ie,Vt=kt?Ie:ot(i,{})??Ie,ms=[_,zt.className,Vt.className].filter(Boolean).join(" "),ys=(R||zt.style||Vt.style)&&{...R,...zt.style,...Vt.style},[Gr,gs]=C.useState(!1),vs=C.useRef(!1),Et=t.reloadDocument||H?!1:u??s.options.defaultPreload,ve=o??s.options.defaultPreloadDelay??0,dt=C.useCallback(()=>{s.preloadRoute({...L,_builtLocation:k}).catch(Q=>{console.warn(Q),console.warn(Zi)})},[s,L,k]);An(r,C.useCallback(Q=>{Q?.isIntersecting&&dt()},[dt]),vo,{disabled:!!v||Et!=="viewport"}),C.useEffect(()=>{vs.current||!v&&Et==="render"&&(dt(),vs.current=!0)},[v,dt,Et]);const Yr=Q=>{const V=Q.currentTarget.getAttribute("target"),st=g!==void 0?g:V;if(!v&&!Ro(Q)&&!Q.defaultPrevented&&(!st||st==="_self")&&Q.button===0){Q.preventDefault(),Kr.flushSync(()=>{gs(!0)});const Xr=s.subscribe("onResolved",()=>{Xr(),gs(!1)});s.navigate({...L,replace:f,resetScroll:d,hashScrollIntoView:l,startTransition:h,viewTransition:p,ignoreBlocker:T})}};if(H)return{...Wt,ref:r,href:H,...y&&{children:y},...g&&{target:g},...v&&{disabled:v},...R&&{style:R},..._&&{className:_},...w&&{onClick:w},...M&&{onBlur:M},...E&&{onFocus:E},...S&&{onMouseEnter:S},...x&&{onMouseLeave:x},...P&&{onTouchStart:P}};const Ss=Q=>{if(v||Et!=="intent")return;if(!ve){dt();return}const V=Q.currentTarget;if(Bt.has(V))return;const st=setTimeout(()=>{Bt.delete(V),dt()},ve);Bt.set(V,st)},Jr=Q=>{v||Et!=="intent"||dt()},bs=Q=>{if(v||!Et||!ve)return;const V=Q.currentTarget,st=Bt.get(V);st&&(clearTimeout(st),Bt.delete(V))};return{...Wt,...zt,...Vt,href:K?.href,ref:r,onClick:Ot([w,Yr]),onBlur:Ot([M,bs]),onFocus:Ot([E,Ss]),onMouseEnter:Ot([S,Ss]),onMouseLeave:Ot([x,bs]),onTouchStart:Ot([P,Jr]),disabled:!!v,target:g,...ys&&{style:ys},...ms&&{className:ms},...v&&mo,...kt&&yo,...m&&Gr&&go}}var Ie={},po={className:"active"},mo={role:"link","aria-disabled":!0},yo={"data-status":"active","aria-current":"page"},go={"data-transitioning":"transitioning"},Bt=new WeakMap,vo={rootMargin:"100px"},Ot=t=>e=>{for(const s of t)if(s){if(e.defaultPrevented)return;s(e)}};function So(t,e,s,r){if(!r)return e?{href:t,external:!0}:{href:s.createHref(t)||"/",external:!1}}function bo(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}var Wr=C.forwardRef((t,e)=>{const{_asChild:s,...r}=t,{type:n,...i}=fo(r,e),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!s){const{disabled:c,...u}=i;return C.createElement("a",u,a)}return C.createElement(s,i,a)});function Ro(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var Po=class extends $r{constructor(t){super(t),this.useMatch=e=>ft({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ds({...e,from:this.id}),this.useSearch=e=>hs({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ls({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>us({...e,from:this.id}),this.useLoaderData=e=>cs({...e,from:this.id}),this.useNavigate=()=>fs({from:this.fullPath}),this.Link=Mt.forwardRef((e,s)=>O.jsx(Wr,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}};function wo(t){return new Po(t)}function zo(){return t=>xo(t)}var _o=class extends to{constructor(t){super(t),this.useMatch=e=>ft({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ds({...e,from:this.id}),this.useSearch=e=>hs({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ls({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>us({...e,from:this.id}),this.useLoaderData=e=>cs({...e,from:this.id}),this.useNavigate=()=>fs({from:this.fullPath}),this.Link=Mt.forwardRef((e,s)=>O.jsx(Wr,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}};function xo(t){return new _o(t)}function ar(t){return typeof t=="object"?new cr(t,{silent:!0}).createRoute(t):new cr(t,{silent:!0}).createRoute}var cr=class{constructor(t,e){this.path=t,this.createRoute=s=>{const r=wo(s);return r.isRoot=!1,r},this.silent=e?.silent}},ur=class{constructor(t){this.useMatch=e=>ft({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ds({...e,from:this.options.id}),this.useSearch=e=>hs({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ls({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>us({...e,from:this.options.id}),this.useLoaderData=e=>cs({...e,from:this.options.id}),this.useNavigate=()=>fs({from:et().routesById[this.options.id].fullPath}),this.options=t,this.$$typeof=Symbol.for("react.memo")}};function lr(t){return typeof t=="object"?new ur(t):e=>new ur({id:t,...e})}function Vo(t,e){let s,r,n,i;const a=()=>(s||(s=t().then(u=>{s=void 0,r=u[e??"default"]}).catch(u=>{if(n=u,Un(n)&&n instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const o=`tanstack_router_reload:${n.message}`;sessionStorage.getItem(o)||(sessionStorage.setItem(o,"1"),i=!0)}})),s),c=function(o){if(i)throw window.location.reload(),new Promise(()=>{});if(n)throw n;if(!r)if(Bs)Bs(a());else throw a();return C.createElement(r,o)};return c.preload=a,c}function Co(t){const e=J({select:s=>`not-found-${s.location.pathname}-${s.status}`});return O.jsx(os,{getResetKey:()=>e,onCatch:(s,r)=>{if(G(s))t.onCatch?.(s,r);else throw s},errorComponent:({error:s})=>{if(G(s))return t.fallback?.(s);throw s},children:t.children})}function Eo(){return O.jsx("p",{children:"Not Found"})}function Lt(t){return O.jsx(O.Fragment,{children:t.children})}function zr(t,e,s){return e.options.notFoundComponent?O.jsx(e.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?O.jsx(t.options.defaultNotFoundComponent,{...s}):O.jsx(Eo,{})}function Oo(){return et().isScrollRestoring,null}var Vr=C.memo(function({matchId:e}){const s=et(),r=J({select:p=>{const y=p.matches.findIndex(v=>v.id===e),g=p.matches[y];return ht(g),{routeId:g.routeId,ssr:g.ssr,_displayPending:g._displayPending,resetKey:p.loadedAt,parentRouteId:p.matches[y-1]?.routeId}},structuralSharing:!0}),n=s.routesById[r.routeId],i=n.options.pendingComponent??s.options.defaultPendingComponent,a=i?O.jsx(i,{}):null,c=n.options.errorComponent??s.options.defaultErrorComponent,u=n.options.onCatch??s.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??s.options.notFoundRoute?.options.component:n.options.notFoundComponent,l=r.ssr===!1||r.ssr==="data-only",f=(!n.isRoot||n.options.wrapInSuspense||l)&&(n.options.wrapInSuspense??i??(n.options.errorComponent?.preload||l))?C.Suspense:Lt,h=c?os:Lt,d=o?Co:Lt;return O.jsxs(n.isRoot?n.options.shellComponent??Lt:Lt,{children:[O.jsx(ye.Provider,{value:e,children:O.jsx(f,{fallback:a,children:O.jsx(h,{getResetKey:()=>r.resetKey,errorComponent:c||as,onCatch:(p,y)=>{if(G(p))throw p;u?.(p,y)},children:O.jsx(d,{fallback:p=>{if(!o||p.routeId&&p.routeId!==r.routeId||!p.routeId&&!n.isRoot)throw p;return C.createElement(o,p)},children:l||r._displayPending?O.jsx(so,{fallback:a,children:O.jsx(hr,{matchId:e})}):O.jsx(hr,{matchId:e})})})})}),r.parentRouteId===Rt&&s.options.scrollRestoration?O.jsxs(O.Fragment,{children:[O.jsx(Lo,{}),O.jsx(Oo,{})]}):null]})});function Lo(){const t=et(),e=C.useRef(void 0);return O.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...wt(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}var hr=C.memo(function({matchId:e}){const s=et(),{match:r,key:n,routeId:i}=J({select:u=>{const o=u.matches.find(h=>h.id===e),l=o.routeId,f=(s.routesById[l].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:l,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:l,match:{id:o.id,status:o.status,error:o.error,_forcePending:o._forcePending,_displayPending:o._displayPending}}},structuralSharing:!0}),a=s.routesById[i],c=C.useMemo(()=>{const u=a.options.component??s.options.defaultComponent;return u?O.jsx(u,{},n):O.jsx(Mo,{})},[n,a.options.component,s.options.defaultComponent]);if(r._displayPending)throw s.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw s.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const u=a.options.pendingMinMs??s.options.defaultPendingMinMs;if(u){const o=s.getMatch(r.id);if(o&&!o._nonReactive.minPendingPromise){const l=Tt();o._nonReactive.minPendingPromise=l,setTimeout(()=>{l.resolve(),o._nonReactive.minPendingPromise=void 0},u)}}throw s.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return ht(G(r.error)),zr(s,a,r.error);if(r.status==="redirected")throw ht(Y(r.error)),s.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),Mo=C.memo(function(){const e=et(),s=C.useContext(ye),r=J({select:o=>o.matches.find(l=>l.id===s)?.routeId}),n=e.routesById[r],i=J({select:o=>{const l=o.matches.find(f=>f.id===s);return ht(l),l.globalNotFound}}),a=J({select:o=>{const l=o.matches;return l[l.findIndex(f=>f.id===s)+1]?.id}}),c=e.options.defaultPendingComponent?O.jsx(e.options.defaultPendingComponent,{}):null;if(i)return zr(e,n,void 0);if(!a)return null;const u=O.jsx(Vr,{matchId:a});return r===Rt?O.jsx(C.Suspense,{fallback:c,children:u}):u});function To(){const t=et(),e=C.useRef({router:t,mounted:!1}),[s,r]=C.useState(!1),{hasPendingMatches:n,isLoading:i}=J({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(h=>h.status==="pending")}),structuralSharing:!0}),a=Pe(i),c=i||s||n,u=Pe(c),o=i||n,l=Pe(o);return t.startTransition=f=>{r(!0),C.startTransition(()=>{f(),r(!1)})},C.useEffect(()=>{const f=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ut(t.latestLocation.publicHref)!==ut(h.publicHref)&&t.commitLocation({...h,replace:!0}),()=>{f()}},[t,t.history]),Yt(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(h){console.error(h)}})()},[t]),Yt(()=>{a&&!i&&t.emit({type:"onLoad",...wt(t.state)})},[a,t,i]),Yt(()=>{l&&!o&&t.emit({type:"onBeforeRouteMount",...wt(t.state)})},[o,l,t]),Yt(()=>{if(u&&!c){const f=wt(t.state);t.emit({type:"onResolved",...f}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),f.hrefChanged&&hi(t)}},[c,u,t]),null}function Io(){const t=et(),e=t.routesById[Rt].options.pendingComponent??t.options.defaultPendingComponent,s=e?O.jsx(e,{}):null,r=O.jsxs(typeof document<"u"&&t.ssr?Lt:C.Suspense,{fallback:s,children:[O.jsx(To,{}),O.jsx(ko,{})]});return t.options.InnerWrap?O.jsx(t.options.InnerWrap,{children:r}):r}function ko(){const t=et(),e=J({select:n=>n.matches[0]?.id}),s=J({select:n=>n.loadedAt}),r=e?O.jsx(Vr,{matchId:e}):null;return O.jsx(ye.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:O.jsx(os,{getResetKey:()=>s,errorComponent:as,onCatch:void 0,children:r})})}var Go=t=>new Ao(t),Ao=class extends Wi{constructor(t){super(t)}};typeof globalThis<"u"?(globalThis.createFileRoute=ar,globalThis.createLazyFileRoute=lr):typeof window<"u"&&(window.createFileRoute=ar,window.createLazyFileRoute=lr);function Fo({router:t,children:e,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const r=O.jsx(qr.Provider,{value:t,children:e});return t.options.Wrap?O.jsx(t.options.Wrap,{children:r}):r}function Yo({router:t,...e}){return O.jsx(Fo,{router:t,...e,children:O.jsx(Io,{})})}function Jo(t){return J({select:e=>e.location})}function Xo(){return J({select:t=>t.location.state.__TSR_index!==0})}export{ls as A,Xo as B,Wr as L,xn as M,Mo as O,jo as Q,Do as R,Kr as a,Wo as b,fe as c,nn as d,Mt as e,No as f,fr as g,fs as h,ht as i,O as j,hs as k,J as l,Jo as m,Ze as n,$o as o,zo as p,Qo as q,C as r,wo as s,vi as t,Uo as u,Vo as v,co as w,Go as x,Bo as y,Yo as z};
package/assets/index.html CHANGED
@@ -12,12 +12,12 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-DVK0M62U.js"></script>
16
- <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-DPXTJtWt.js">
17
- <link rel="modulepreload" crossorigin href="./assets/vendor-radix-Bvy4KXTI.js">
18
- <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-DPeiXMwW.js">
19
- <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-DN2199pt.js">
20
- <link rel="stylesheet" crossorigin href="./assets/index-DOP3oQmw.css">
15
+ <script type="module" crossorigin src="./assets/index-DKBPD33e.js"></script>
16
+ <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Dq7p98wZ.js">
17
+ <link rel="modulepreload" crossorigin href="./assets/vendor-radix-B57xfQbP.js">
18
+ <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-DWvKDyBF.js">
19
+ <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-DK7fbRNb.js">
20
+ <link rel="stylesheet" crossorigin href="./assets/index-DeGyEwik.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -1097,6 +1097,12 @@ var AGENT_PROVIDER_IDS = Object.values(AgentProviderIds);
1097
1097
  function isAgentProviderId(value) {
1098
1098
  return AGENT_PROVIDER_IDS.includes(value);
1099
1099
  }
1100
+ var LlmCapabilities = {
1101
+ agent: "agent",
1102
+ analyze: "analyze",
1103
+ classify: "classify"
1104
+ };
1105
+ var LLM_CAPABILITIES = Object.values(LlmCapabilities);
1100
1106
 
1101
1107
  // ../contracts/src/settings.ts
1102
1108
  import { z as z10 } from "zod";
@@ -1999,6 +2005,54 @@ var contentTargetsResponseDtoSchema = z18.object({
1999
2005
  runTimestamp: z18.string()
2000
2006
  })
2001
2007
  });
2008
+ var contentTargetDismissalDtoSchema = z18.object({
2009
+ targetRef: z18.string(),
2010
+ addressedUrl: z18.string().nullable(),
2011
+ note: z18.string().nullable(),
2012
+ dismissedAt: z18.string()
2013
+ });
2014
+ var contentTargetDismissalsResponseDtoSchema = z18.object({
2015
+ dismissals: z18.array(contentTargetDismissalDtoSchema)
2016
+ });
2017
+ var contentTargetDismissRequestSchema = z18.object({
2018
+ targetRef: z18.string().min(1),
2019
+ /** URL of the page the user wrote that addresses this recommendation. Stored verbatim for the audit trail; not currently used to suppress the slug-token matcher. */
2020
+ addressedUrl: z18.string().url().optional(),
2021
+ /** Free-form note (e.g. "covered in our Q1 content sprint"). 500 char cap is the API surface limit; the DB column is unbounded. */
2022
+ note: z18.string().max(500).optional()
2023
+ });
2024
+ var recommendationExplanationDtoSchema = z18.object({
2025
+ targetRef: z18.string(),
2026
+ /** Version of the prompt template used. Bumping the version invalidates the cache forward without touching the table. */
2027
+ promptVersion: z18.string(),
2028
+ /** Provider that produced the explanation (e.g. "claude", "gemini"). */
2029
+ provider: z18.string(),
2030
+ /** Model id within that provider (e.g. "claude-sonnet-4-6"). */
2031
+ model: z18.string(),
2032
+ /** Markdown-formatted rationale + recommended next steps. */
2033
+ responseText: z18.string(),
2034
+ /** Estimated cost in millicents (1/100 of a cent). 0 when unknown. */
2035
+ costMillicents: z18.number().int().nonnegative(),
2036
+ generatedAt: z18.string()
2037
+ });
2038
+ var recommendationExplainRequestSchema = z18.object({
2039
+ /**
2040
+ * Optional provider override (e.g. "claude" to force Claude even if
2041
+ * the project's default is Gemini). Falls through to project default
2042
+ * → auto-detect when omitted.
2043
+ */
2044
+ provider: z18.string().optional(),
2045
+ /**
2046
+ * Optional model override within the chosen provider. Falls through to
2047
+ * the `analyze`-tier default model when omitted.
2048
+ */
2049
+ model: z18.string().optional(),
2050
+ /**
2051
+ * Force a fresh LLM call even if a cached explanation exists for the
2052
+ * current prompt version. Use sparingly — defeats the cache.
2053
+ */
2054
+ forceRefresh: z18.boolean().optional()
2055
+ });
2002
2056
  var contentGroundingSourceSchema = z18.object({
2003
2057
  uri: z18.string(),
2004
2058
  title: z18.string(),
@@ -2809,7 +2863,17 @@ var reportActionPlanItemSchema = z21.object({
2809
2863
  /** What should move if the action worked. */
2810
2864
  successMetric: z21.string(),
2811
2865
  /** Confidence in the recommendation based on the available evidence. */
2812
- confidence: reportActionConfidenceSchema
2866
+ confidence: reportActionConfidenceSchema,
2867
+ /**
2868
+ * Stable hash from the underlying content opportunity, present only when
2869
+ * the action was derived from `contentOpportunities` (the
2870
+ * `ContentTargetRowDto.targetRef` value). UI surfaces a "Mark addressed"
2871
+ * button on actions that carry one — clicking it persists a dismissal in
2872
+ * `content_target_dismissals` and the action drops off the next report
2873
+ * load. Actions sourced from other signals (competitor gaps, indexing
2874
+ * issues, etc.) omit this and use their own dismiss flows.
2875
+ */
2876
+ targetRef: z21.string().optional()
2813
2877
  });
2814
2878
  var reportClientSummarySchema = z21.object({
2815
2879
  headline: z21.string(),
@@ -3576,6 +3640,8 @@ export {
3576
3640
  AgentProviderIds,
3577
3641
  AGENT_PROVIDER_IDS,
3578
3642
  isAgentProviderId,
3643
+ LlmCapabilities,
3644
+ LLM_CAPABILITIES,
3579
3645
  settingsDtoSchema,
3580
3646
  RunStatuses,
3581
3647
  RunKinds,
@@ -3634,6 +3700,11 @@ export {
3634
3700
  contentActionLabel,
3635
3701
  actionConfidenceLabel,
3636
3702
  contentTargetsResponseDtoSchema,
3703
+ contentTargetDismissalDtoSchema,
3704
+ contentTargetDismissalsResponseDtoSchema,
3705
+ contentTargetDismissRequestSchema,
3706
+ recommendationExplanationDtoSchema,
3707
+ recommendationExplainRequestSchema,
3637
3708
  contentSourcesResponseDtoSchema,
3638
3709
  contentGapsResponseDtoSchema,
3639
3710
  CheckStatuses,