dexto 1.6.2 → 1.6.4

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.
@@ -1,17 +0,0 @@
1
- function ne(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var M={exports:{}},o={};/**
2
- * @license React
3
- * react.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var z;function ee(){if(z)return o;z=1;var d=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),m=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),t=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),g=Symbol.iterator;function h(e){return e===null||typeof e!="object"?null:(e=g&&e[g]||e["@@iterator"],typeof e=="function"?e:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,I={};function O(e,r,n){this.props=e,this.context=r,this.refs=I,this.updater=n||C}O.prototype.isReactComponent={},O.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,r,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Y(){}Y.prototype=O.prototype;function N(e,r,n){this.props=e,this.context=r,this.refs=I,this.updater=n||C}var D=N.prototype=new Y;D.constructor=N,U(D,O.prototype),D.isPureReactComponent=!0;var k=Array.isArray,a={H:null,A:null,T:null,S:null,V:null},b=Object.prototype.hasOwnProperty;function H(e,r,n,u,f,l){return n=l.ref,{$$typeof:d,type:e,key:r,ref:n!==void 0?n:null,props:l}}function X(e,r){return H(e.type,r,void 0,void 0,void 0,e.props)}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===d}function Q(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return r[n]})}var q=/\/+/g;function j(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Q(""+e.key):r.toString(36)}function x(){}function Z(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(x,x):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function S(e,r,n,u,f){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(l){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case d:case R:s=!0;break;case c:return s=e._init,S(s(e._payload),r,n,u,f)}}if(s)return f=f(e),s=u===""?"."+j(e,0):u,k(f)?(n="",s!=null&&(n=s.replace(q,"$&/")+"/"),S(f,r,n,"",function(F){return F})):f!=null&&(L(f)&&(f=X(f,n+(f.key==null||e&&e.key===f.key?"":(""+f.key).replace(q,"$&/")+"/")+s)),r.push(f)),1;s=0;var E=u===""?".":u+":";if(k(e))for(var y=0;y<e.length;y++)u=e[y],l=E+j(u,y),s+=S(u,r,n,l,f);else if(y=h(e),typeof y=="function")for(e=y.call(e),y=0;!(u=e.next()).done;)u=u.value,l=E+j(u,y++),s+=S(u,r,n,l,f);else if(l==="object"){if(typeof e.then=="function")return S(Z(e),r,n,u,f);throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return s}function A(e,r,n){if(e==null)return e;var u=[],f=0;return S(e,u,"","",function(l){return r.call(n,l,f++)}),u}function J(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var G=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function V(){}return o.Children={map:A,forEach:function(e,r,n){A(e,function(){r.apply(this,arguments)},n)},count:function(e){var r=0;return A(e,function(){r++}),r},toArray:function(e){return A(e,function(r){return r})||[]},only:function(e){if(!L(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},o.Component=O,o.Fragment=v,o.Profiler=P,o.PureComponent=N,o.StrictMode=_,o.Suspense=i,o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,o.__COMPILER_RUNTIME={__proto__:null,c:function(e){return a.H.useMemoCache(e)}},o.cache=function(e){return function(){return e.apply(null,arguments)}},o.cloneElement=function(e,r,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=U({},e.props),f=e.key,l=void 0;if(r!=null)for(s in r.ref!==void 0&&(l=void 0),r.key!==void 0&&(f=""+r.key),r)!b.call(r,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&r.ref===void 0||(u[s]=r[s]);var s=arguments.length-2;if(s===1)u.children=n;else if(1<s){for(var E=Array(s),y=0;y<s;y++)E[y]=arguments[y+2];u.children=E}return H(e.type,f,void 0,void 0,l,u)},o.createContext=function(e){return e={$$typeof:m,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:w,_context:e},e},o.createElement=function(e,r,n){var u,f={},l=null;if(r!=null)for(u in r.key!==void 0&&(l=""+r.key),r)b.call(r,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(f[u]=r[u]);var s=arguments.length-2;if(s===1)f.children=n;else if(1<s){for(var E=Array(s),y=0;y<s;y++)E[y]=arguments[y+2];f.children=E}if(e&&e.defaultProps)for(u in s=e.defaultProps,s)f[u]===void 0&&(f[u]=s[u]);return H(e,l,void 0,void 0,null,f)},o.createRef=function(){return{current:null}},o.forwardRef=function(e){return{$$typeof:T,render:e}},o.isValidElement=L,o.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:J}},o.memo=function(e,r){return{$$typeof:t,type:e,compare:r===void 0?null:r}},o.startTransition=function(e){var r=a.T,n={};a.T=n;try{var u=e(),f=a.S;f!==null&&f(n,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(V,G)}catch(l){G(l)}finally{a.T=r}},o.unstable_useCacheRefresh=function(){return a.H.useCacheRefresh()},o.use=function(e){return a.H.use(e)},o.useActionState=function(e,r,n){return a.H.useActionState(e,r,n)},o.useCallback=function(e,r){return a.H.useCallback(e,r)},o.useContext=function(e){return a.H.useContext(e)},o.useDebugValue=function(){},o.useDeferredValue=function(e,r){return a.H.useDeferredValue(e,r)},o.useEffect=function(e,r,n){var u=a.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return u.useEffect(e,r)},o.useId=function(){return a.H.useId()},o.useImperativeHandle=function(e,r,n){return a.H.useImperativeHandle(e,r,n)},o.useInsertionEffect=function(e,r){return a.H.useInsertionEffect(e,r)},o.useLayoutEffect=function(e,r){return a.H.useLayoutEffect(e,r)},o.useMemo=function(e,r){return a.H.useMemo(e,r)},o.useOptimistic=function(e,r){return a.H.useOptimistic(e,r)},o.useReducer=function(e,r,n){return a.H.useReducer(e,r,n)},o.useRef=function(e){return a.H.useRef(e)},o.useState=function(e){return a.H.useState(e)},o.useSyncExternalStore=function(e,r,n){return a.H.useSyncExternalStore(e,r,n)},o.useTransition=function(){return a.H.useTransition()},o.version="19.1.1",o}var K;function te(){return K||(K=1,M.exports=ee()),M.exports}var $={exports:{}},p={};/**
10
- * @license React
11
- * react-dom.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var B;function re(){if(B)return p;B=1;var d=te();function R(i){var t="https://react.dev/errors/"+i;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)t+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(){}var _={d:{f:v,r:function(){throw Error(R(522))},D:v,C:v,L:v,m:v,X:v,S:v,M:v},p:0,findDOMNode:null},P=Symbol.for("react.portal");function w(i,t,c){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:g==null?null:""+g,children:i,containerInfo:t,implementation:c}}var m=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function T(i,t){if(i==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}return p.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,p.createPortal=function(i,t){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(R(299));return w(i,t,null,c)},p.flushSync=function(i){var t=m.T,c=_.p;try{if(m.T=null,_.p=2,i)return i()}finally{m.T=t,_.p=c,_.d.f()}},p.preconnect=function(i,t){typeof i=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,_.d.C(i,t))},p.prefetchDNS=function(i){typeof i=="string"&&_.d.D(i)},p.preinit=function(i,t){if(typeof i=="string"&&t&&typeof t.as=="string"){var c=t.as,g=T(c,t.crossOrigin),h=typeof t.integrity=="string"?t.integrity:void 0,C=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;c==="style"?_.d.S(i,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:g,integrity:h,fetchPriority:C}):c==="script"&&_.d.X(i,{crossOrigin:g,integrity:h,fetchPriority:C,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},p.preinitModule=function(i,t){if(typeof i=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var c=T(t.as,t.crossOrigin);_.d.M(i,{crossOrigin:c,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&_.d.M(i)},p.preload=function(i,t){if(typeof i=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var c=t.as,g=T(c,t.crossOrigin);_.d.L(i,c,{crossOrigin:g,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},p.preloadModule=function(i,t){if(typeof i=="string")if(t){var c=T(t.as,t.crossOrigin);_.d.m(i,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:c,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else _.d.m(i)},p.requestFormReset=function(i){_.d.r(i)},p.unstable_batchedUpdates=function(i,t){return i(t)},p.useFormState=function(i,t,c){return m.H.useFormState(i,t,c)},p.useFormStatus=function(){return m.H.useHostTransitionStatus()},p.version="19.1.1",p}var W;function ue(){if(W)return $.exports;W=1;function d(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(R){console.error(R)}}return d(),$.exports=re(),$.exports}export{ue as a,ne as g,te as r};
@@ -1,25 +0,0 @@
1
- var Bn=t=>{throw TypeError(t)};var Ms=(t,e,s)=>e.has(t)||Bn("Cannot "+s);var l=(t,e,s)=>(Ms(t,e,"read from private field"),s?s.call(t):e.get(t)),E=(t,e,s)=>e.has(t)?Bn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),x=(t,e,s,n)=>(Ms(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),k=(t,e,s)=>(Ms(t,e,"access private method"),s);var ts=(t,e,s,n)=>({set _(r){x(t,e,r,s)},get _(){return l(t,e,n)}});import{r as pn,g as Tr,a as Ri}from"./react-vendor-gH-7aFTg.js";function bi(t,e){for(var s=0;s<e.length;s++){const n=e[s];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in t)){const i=Object.getOwnPropertyDescriptor(n,r);i&&Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ls={exports:{}},Te={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Un;function wi(){if(Un)return Te;Un=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(n,r,i){var o=null;if(i!==void 0&&(o=""+i),r.key!==void 0&&(o=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:t,type:n,key:o,ref:r!==void 0?r:null,props:i}}return Te.Fragment=e,Te.jsx=s,Te.jsxs=s,Te}var Nn;function Pi(){return Nn||(Nn=1,Ls.exports=wi()),Ls.exports}var I=Pi(),T=pn();const _e=Tr(T),Aa=bi({__proto__:null,default:_e},[T]),qs=new WeakMap,_i=new WeakMap,ls={current:[]};let Es=!1,De=0;const Fe=new Set,es=new Map;function Ir(t){for(const e of t){if(ls.current.includes(e))continue;ls.current.push(e),e.recompute();const s=_i.get(e);if(s)for(const n of s){const r=qs.get(n);r!=null&&r.length&&Ir(r)}}}function xi(t){const e={prevVal:t.prevState,currentVal:t.state};for(const s of t.listeners)s(e)}function Ci(t){const e={prevVal:t.prevState,currentVal:t.state};for(const s of t.listeners)s(e)}function Or(t){if(De>0&&!es.has(t)&&es.set(t,t.prevState),Fe.add(t),!(De>0)&&!Es)try{for(Es=!0;Fe.size>0;){const e=Array.from(Fe);Fe.clear();for(const s of e){const n=es.get(s)??s.prevState;s.prevState=n,xi(s)}for(const s of e){const n=qs.get(s);n&&(ls.current.push(s),Ir(n))}for(const s of e){const n=qs.get(s);if(n)for(const r of n)Ci(r)}}}finally{Es=!1,ls.current=[],es.clear()}}function je(t){De++;try{t()}finally{if(De--,De===0){const e=Fe.values().next().value;e&&Or(e)}}}function Mi(t){return typeof t=="function"}class Li{constructor(e,s){this.listeners=new Set,this.subscribe=n=>{var r,i;this.listeners.add(n);const o=(i=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),o==null||o()}},this.prevState=e,this.state=e,this.options=s}setState(e){var s,n,r;this.prevState=this.state,(s=this.options)!=null&&s.updateFn?this.state=this.options.updateFn(this.prevState)(e):Mi(e)?this.state=e(this.prevState):this.state=e,(r=(n=this.options)==null?void 0:n.onUpdate)==null||r.call(n),Or(this)}}const jt="__TSR_index",Qn="popstate",$n="beforeunload";function Ei(t){let e=t.getLocation();const s=new Set,n=o=>{e=t.getLocation(),s.forEach(a=>a({location:e,action:o}))},r=o=>{t.notifyOnIndexChange??!0?n(o):e=t.getLocation()},i=async({task:o,navigateOpts:a,...u})=>{var f,d;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const p=((f=t.getBlockers)==null?void 0:f.call(t))??[],c=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&p.length&&c)for(const m of p){const y=hs(u.path,u.state);if(await m.blockerFn({currentLocation:e,nextLocation:y,action:u.type})){(d=t.onBlocked)==null||d.call(t);return}}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:s,subscribe:o=>(s.add(o),()=>{s.delete(o)}),push:(o,a,u)=>{const h=e.state[jt];a=qn(h+1,a),i({task:()=>{t.pushState(o,a),n({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:o,state:a})},replace:(o,a,u)=>{const h=e.state[jt];a=qn(h,a),i({task:()=>{t.replaceState(o,a),n({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{t.go(o),r({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{t.back((o==null?void 0:o.ignoreBlocker)??!1),r({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{t.forward((o==null?void 0:o.ignoreBlocker)??!1),r({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>e.state[jt]!==0,createHref:o=>t.createHref(o),block:o=>{var u;if(!t.setBlockers)return()=>{};const a=((u=t.getBlockers)==null?void 0:u.call(t))??[];return t.setBlockers([...a,o]),()=>{var p,c;const h=((p=t.getBlockers)==null?void 0:p.call(t))??[];(c=t.setBlockers)==null||c.call(t,h.filter(f=>f!==o))}},flush:()=>{var o;return(o=t.flush)==null?void 0:o.call(t)},destroy:()=>{var o;return(o=t.destroy)==null?void 0:o.call(t)},notify:n}}function qn(t,e){e||(e={});const s=mn();return{...e,key:s,__TSR_key:s,[jt]:t}}function Ti(t){var M,O;const e=typeof document<"u"?window:void 0,s=e.history.pushState,n=e.history.replaceState;let r=[];const i=()=>r,o=b=>r=b,a=(b=>b),u=(()=>hs(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!((M=e.history.state)!=null&&M.__TSR_key)&&!((O=e.history.state)!=null&&O.key)){const b=mn();e.history.replaceState({[jt]:0,key:b,__TSR_key:b},"")}let h=u(),p,c=!1,f=!1,d=!1,m=!1;const y=()=>h;let g,v;const _=()=>{g&&(P._ignoreSubscribers=!0,(g.isPush?e.history.pushState:e.history.replaceState)(g.state,"",g.href),P._ignoreSubscribers=!1,g=void 0,v=void 0,p=void 0)},w=(b,L,A)=>{const B=a(L);v||(p=h),h=hs(L,A),g={href:B,state:A,isPush:(g==null?void 0:g.isPush)||b==="push"},v||(v=Promise.resolve().then(()=>_()))},S=b=>{h=u(),P.notify({type:b})},C=async()=>{if(f){f=!1;return}const b=u(),L=b.state[jt]-h.state[jt],A=L===1,B=L===-1,lt=!A&&!B||c;c=!1;const Me=lt?"GO":B?"BACK":"FORWARD",V=lt?{type:"GO",index:L}:{type:B?"BACK":"FORWARD"};if(d)d=!1;else{const it=i();if(typeof document<"u"&&it.length){for(const ht of it)if(await ht.blockerFn({currentLocation:h,nextLocation:b,action:Me})){f=!0,e.history.go(1),P.notify(V);return}}}h=u(),P.notify(V)},R=b=>{if(m){m=!1;return}let L=!1;const A=i();if(typeof document<"u"&&A.length)for(const B of A){const lt=B.enableBeforeUnload??!0;if(lt===!0){L=!0;break}if(typeof lt=="function"&&lt()===!0){L=!0;break}}if(L)return b.preventDefault(),b.returnValue=""},P=Ei({getLocation:y,getLength:()=>e.history.length,pushState:(b,L)=>w("push",b,L),replaceState:(b,L)=>w("replace",b,L),back:b=>(b&&(d=!0),m=!0,e.history.back()),forward:b=>{b&&(d=!0),m=!0,e.history.forward()},go:b=>{c=!0,e.history.go(b)},createHref:b=>a(b),flush:_,destroy:()=>{e.history.pushState=s,e.history.replaceState=n,e.removeEventListener($n,R,{capture:!0}),e.removeEventListener(Qn,C)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return e.addEventListener($n,R,{capture:!0}),e.addEventListener(Qn,C),e.history.pushState=function(...b){const L=s.apply(e.history,b);return P._ignoreSubscribers||S("PUSH"),L},e.history.replaceState=function(...b){const L=n.apply(e.history,b);return P._ignoreSubscribers||S("REPLACE"),L},P}function hs(t,e){const s=t.indexOf("#"),n=t.indexOf("?"),r=mn();return{href:t,pathname:t.substring(0,s>0?n>0?Math.min(s,n):s:n>0?n:t.length),hash:s>-1?t.substring(s):"",search:n>-1?t.slice(n,s===-1?void 0:s):"",state:e||{[jt]:0,key:r,__TSR_key:r}}}function mn(){return(Math.random()+1).toString(36).substring(7)}function ds(t){return t[t.length-1]}function Ii(t){return typeof t=="function"}function Xt(t,e){return Ii(t)?t(e):t}const Oi=Object.prototype.hasOwnProperty;function tt(t,e){if(t===e)return t;const s=e,n=Hn(t)&&Hn(s);if(!n&&!(fs(t)&&fs(s)))return s;const r=n?t:Kn(t);if(!r)return s;const i=n?s:Kn(s);if(!i)return s;const o=r.length,a=i.length,u=n?new Array(a):{};let h=0;for(let p=0;p<a;p++){const c=n?p:i[p],f=t[c],d=s[c];if(f===d){u[c]=f,(n?p<o:Oi.call(t,c))&&h++;continue}if(f===null||d===null||typeof f!="object"||typeof d!="object"){u[c]=d;continue}const m=tt(f,d);u[c]=m,m===f&&h++}return o===a&&h===o?t:u}function Kn(t){const e=[],s=Object.getOwnPropertyNames(t);for(const r of s){if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;e.push(r)}const n=Object.getOwnPropertySymbols(t);for(const r of n){if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;e.push(r)}return e}function fs(t){if(!zn(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const s=e.prototype;return!(!zn(s)||!s.hasOwnProperty("isPrototypeOf"))}function zn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Hn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Zt(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 n=0,r=t.length;n<r;n++)if(!Zt(t[n],e[n],s))return!1;return!0}if(fs(t)&&fs(e)){const n=(s==null?void 0:s.ignoreUndefined)??!0;if(s!=null&&s.partial){for(const o in e)if((!n||e[o]!==void 0)&&!Zt(t[o],e[o],s))return!1;return!0}let r=0;if(!n)r=Object.keys(t).length;else for(const o in t)t[o]!==void 0&&r++;let i=0;for(const o in e)if((!n||e[o]!==void 0)&&(i++,i>r||!Zt(t[o],e[o],s)))return!1;return r===i}return!1}function xe(t){let e,s;const n=new Promise((r,i)=>{e=r,s=i});return n.status="pending",n.resolve=r=>{n.status="resolved",n.value=r,e(r),t==null||t(r)},n.reject=r=>{n.status="rejected",s(r)},n}function Bt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function Vn(t){try{return decodeURI(t)}catch{return t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}}function Wn(t,e){if(!t)return t;const s=/%25|%5C/gi;let n=0,r="",i;for(;(i=s.exec(t))!==null;)r+=Vn(t.slice(n,i.index))+i[0],n=s.lastIndex;return r+Vn(n?t.slice(n):t)}var ki="Invariant failed";function Pt(t,e){if(!t)throw new Error(ki)}function ps(t){const e=new Map;let s,n;const r=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,n&&(n.next=i,i.prev=n)):(i.next.prev=void 0,s=i.next,i.next=void 0,n&&(i.prev=n,n.next=i)),n=i)};return{get(i){const o=e.get(i);if(o)return r(o),o.value},set(i,o){if(e.size>=t&&s){const u=s;e.delete(u.key),u.next&&(s=u.next,u.next.prev=void 0),u===n&&(n=void 0)}const a=e.get(i);if(a)a.value=o,r(a);else{const u={key:i,value:o,prev:n};n&&(n.next=u),n=u,s||(s=u),e.set(i,u)}},clear(){e.clear(),s=void 0,n=void 0}}}const Ce=0,se=1,ne=2,Ue=3,Fi=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Ai=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Di=/^([^{]*)\{\$\}([^}]*)$/;function yn(t,e,s=new Uint16Array(6)){const n=t.indexOf("/",e),r=n===-1?t.length:n,i=t.substring(e,r);if(!i||!i.includes("$"))return s[0]=Ce,s[1]=e,s[2]=e,s[3]=r,s[4]=r,s[5]=r,s;if(i==="$"){const h=t.length;return s[0]=ne,s[1]=e,s[2]=e,s[3]=h,s[4]=h,s[5]=h,s}if(i.charCodeAt(0)===36)return s[0]=se,s[1]=e,s[2]=e+1,s[3]=r,s[4]=r,s[5]=r,s;const o=i.match(Di);if(o){const p=o[1].length;return s[0]=ne,s[1]=e+p,s[2]=e+p+1,s[3]=e+p+2,s[4]=e+p+3,s[5]=t.length,s}const a=i.match(Ai);if(a){const h=a[1],p=a[2],c=a[3],f=h.length;return s[0]=Ue,s[1]=e+f,s[2]=e+f+3,s[3]=e+f+3+p.length,s[4]=r-c.length,s[5]=r,s}const u=i.match(Fi);if(u){const h=u[1],p=u[2],c=u[3],f=h.length;return s[0]=se,s[1]=e+f,s[2]=e+f+2,s[3]=e+f+2+p.length,s[4]=r-c.length,s[5]=r,s}return s[0]=Ce,s[1]=e,s[2]=e,s[3]=r,s[4]=r,s[5]=r,s}function bs(t,e,s,n,r,i,o){var u,h,p,c,f;o==null||o(s);let a=n;{const d=s.fullPath??s.from,m=d.length,y=((u=s.options)==null?void 0:u.caseSensitive)??t;for(;a<m;){const g=yn(d,a,e);let v;const _=a,w=g[5];switch(a=w+1,i++,g[0]){case Ce:{const C=d.substring(g[2],g[3]);if(y){const R=(h=r.static)==null?void 0:h.get(C);if(R)v=R;else{r.static??(r.static=new Map);const P=Ne(s.fullPath??s.from);P.parent=r,P.depth=i,v=P,r.static.set(C,P)}}else{const R=C.toLowerCase(),P=(p=r.staticInsensitive)==null?void 0:p.get(R);if(P)v=P;else{r.staticInsensitive??(r.staticInsensitive=new Map);const M=Ne(s.fullPath??s.from);M.parent=r,M.depth=i,v=M,r.staticInsensitive.set(R,M)}}break}case se:{const C=d.substring(_,g[1]),R=d.substring(g[4],w),P=y&&!!(C||R),M=C?P?C:C.toLowerCase():void 0,O=R?P?R:R.toLowerCase():void 0,b=(c=r.dynamic)==null?void 0:c.find(L=>L.caseSensitive===P&&L.prefix===M&&L.suffix===O);if(b)v=b;else{const L=Is(se,s.fullPath??s.from,P,M,O);v=L,L.depth=i,L.parent=r,r.dynamic??(r.dynamic=[]),r.dynamic.push(L)}break}case Ue:{const C=d.substring(_,g[1]),R=d.substring(g[4],w),P=y&&!!(C||R),M=C?P?C:C.toLowerCase():void 0,O=R?P?R:R.toLowerCase():void 0,b=(f=r.optional)==null?void 0:f.find(L=>L.caseSensitive===P&&L.prefix===M&&L.suffix===O);if(b)v=b;else{const L=Is(Ue,s.fullPath??s.from,P,M,O);v=L,L.parent=r,L.depth=i,r.optional??(r.optional=[]),r.optional.push(L)}break}case ne:{const C=d.substring(_,g[1]),R=d.substring(g[4],w),P=y&&!!(C||R),M=C?P?C:C.toLowerCase():void 0,O=R?P?R:R.toLowerCase():void 0,b=Is(ne,s.fullPath??s.from,P,M,O);v=b,b.parent=r,b.depth=i,r.wildcard??(r.wildcard=[]),r.wildcard.push(b)}}r=v}if((s.path||!s.children)&&!s.isRoot){const g=d.endsWith("/");g||(r.notFound=s),(!r.route||!r.isIndex&&g)&&(r.route=s),r.isIndex||(r.isIndex=g)}}if(s.children)for(const d of s.children)bs(t,e,d,a,r,i,o)}function Ts(t,e){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 Qt(t){var e,s,n;if(t.static)for(const r of t.static.values())Qt(r);if(t.staticInsensitive)for(const r of t.staticInsensitive.values())Qt(r);if((e=t.dynamic)!=null&&e.length){t.dynamic.sort(Ts);for(const r of t.dynamic)Qt(r)}if((s=t.optional)!=null&&s.length){t.optional.sort(Ts);for(const r of t.optional)Qt(r)}if((n=t.wildcard)!=null&&n.length){t.wildcard.sort(Ts);for(const r of t.wildcard)Qt(r)}}function Ne(t){return{kind:Ce,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null}}function Is(t,e,s,n,r){return{kind:t,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null,caseSensitive:s,prefix:n,suffix:r}}function ji(t,e){const s=Ne("/"),n=new Uint16Array(6);for(const r of t)bs(!1,n,r,1,s,0);Qt(s),e.masksTree=s,e.flatCache=ps(1e3)}function Bi(t,e){t||(t="/");const s=e.flatCache.get(t);if(s)return s;const n=gn(t,e.masksTree);return e.flatCache.set(t,n),n}function Ui(t,e,s,n,r){t||(t="/"),n||(n="/");const i=e?`case\0${t}`:t;let o=r.singleCache.get(i);if(!o){o=Ne("/");const a=new Uint16Array(6);bs(e,a,{from:t},1,o,0),r.singleCache.set(i,o)}return gn(n,o,s)}function Ni(t,e,s=!1){const n=s?t:`nofuzz\0${t}`,r=e.matchCache.get(n);if(r!==void 0)return r;t||(t="/");const i=gn(t,e.segmentTree,s);return i&&(i.branch=Ki(i.route)),e.matchCache.set(n,i),i}function Qi(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function $i(t,e=!1,s){const n=Ne(t.fullPath),r=new Uint16Array(6),i={},o={};let a=0;return bs(e,r,t,1,n,0,h=>{if(s==null||s(h,a),Pt(!(h.id in i),`Duplicate routes found with id: ${String(h.id)}`),i[h.id]=h,a!==0&&h.path){const p=Qi(h.fullPath);(!o[p]||h.fullPath.endsWith("/"))&&(o[p]=h)}a++}),Qt(n),{processedTree:{segmentTree:n,singleCache:ps(1e3),matchCache:ps(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function gn(t,e,s=!1){const n=t.split("/"),r=Hi(t,n,e,s);if(!r)return null;const i=qi(t,n,r),o="**"in r;return o&&(i["**"]=r["**"]),{route:o?r.node.notFound??r.node.route:r.node.route,params:i}}function qi(t,e,s){var o,a,u,h,p,c;const n=zi(s.node);let r=null;const i={};for(let f=0,d=0,m=0;d<n.length;f++,d++,m++){const y=n[d],g=e[f],v=m;if(g&&(m+=g.length),y.kind===se){r??(r=s.node.fullPath.split("/"));const _=r[d],w=((o=y.prefix)==null?void 0:o.length)??0;if(_.charCodeAt(w)===123){const C=((a=y.suffix)==null?void 0:a.length)??0,R=_.substring(w+2,_.length-C-1),P=g.substring(w,g.length-C);i[R]=decodeURIComponent(P)}else{const C=_.substring(1);i[C]=decodeURIComponent(g)}}else if(y.kind===Ue){if(s.skipped&1<<d){f--;continue}r??(r=s.node.fullPath.split("/"));const _=r[d],w=((u=y.prefix)==null?void 0:u.length)??0,S=((h=y.suffix)==null?void 0:h.length)??0,C=_.substring(w+3,_.length-S-1),R=y.suffix||y.prefix?g.substring(w,g.length-S):g;R&&(i[C]=decodeURIComponent(R))}else if(y.kind===ne){const _=y,w=t.substring(v+(((p=_.prefix)==null?void 0:p.length)??0),t.length-(((c=_.suffix)==null?void 0:c.length)??0)),S=decodeURIComponent(w);i["*"]=S,i._splat=S;break}}return i}function Ki(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function zi(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function Hi(t,e,s,n){const r=!ds(e),i=r&&t!=="/",o=e.length-(r?1:0),a=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let u=null,h=null,p=null;for(;a.length;){const c=a.pop();let{node:f,index:d,skipped:m,depth:y,statics:g,dynamics:v,optionals:_}=c;n&&f.notFound&&Os(h,c)&&(h=c);const w=d===o;if(w){if(f.route&&(!i||f.isIndex)&&(Os(p,c)&&(p=c),g===o&&f.isIndex))return p;if(!f.optional&&!f.wildcard)continue}const S=w?void 0:e[d];let C;if(f.wildcard&&Os(u,c))for(const R of f.wildcard){const{prefix:P,suffix:M}=R;if(!(P&&(w||!(R.caseSensitive?S:C??(C=S.toLowerCase())).startsWith(P)))){if(M){if(w)continue;const O=e.slice(d).join("/").slice(-M.length);if((R.caseSensitive?O:O.toLowerCase())!==M)continue}u={node:R,index:d,skipped:m,depth:y,statics:g,dynamics:v,optionals:_};break}}if(f.optional){const R=m|1<<y,P=y+1;for(let M=f.optional.length-1;M>=0;M--){const O=f.optional[M];a.push({node:O,index:d,skipped:R,depth:P,statics:g,dynamics:v,optionals:_})}if(!w)for(let M=f.optional.length-1;M>=0;M--){const O=f.optional[M],{prefix:b,suffix:L}=O;if(b||L){const A=O.caseSensitive?S:C??(C=S.toLowerCase());if(b&&!A.startsWith(b)||L&&!A.endsWith(L))continue}a.push({node:O,index:d+1,skipped:m,depth:P,statics:g,dynamics:v,optionals:_+1})}}if(!w&&f.dynamic&&S)for(let R=f.dynamic.length-1;R>=0;R--){const P=f.dynamic[R],{prefix:M,suffix:O}=P;if(M||O){const b=P.caseSensitive?S:C??(C=S.toLowerCase());if(M&&!b.startsWith(M)||O&&!b.endsWith(O))continue}a.push({node:P,index:d+1,skipped:m,depth:y+1,statics:g,dynamics:v+1,optionals:_})}if(!w&&f.staticInsensitive){const R=f.staticInsensitive.get(C??(C=S.toLowerCase()));R&&a.push({node:R,index:d+1,skipped:m,depth:y+1,statics:g+1,dynamics:v,optionals:_})}if(!w&&f.static){const R=f.static.get(S);R&&a.push({node:R,index:d+1,skipped:m,depth:y+1,statics:g+1,dynamics:v,optionals:_})}}if(p)return p;if(u)return u;if(n&&h){let c=h.index;for(let d=0;d<h.index;d++)c+=e[d].length;const f=c===t.length?"/":t.slice(c);return{node:h.node,skipped:h.skipped,"**":decodeURIComponent(f)}}return null}function Os(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.isIndex>t.node.isIndex||e.node.isIndex===t.node.isIndex&&e.depth>t.depth))):!0}function os(t){return vn(t.filter(e=>e!==void 0).join("/"))}function vn(t){return t.replace(/\/{2,}/g,"/")}function kr(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function te(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function as(t){return te(kr(t))}function ms(t,e){return t!=null&&t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function Vi(t,e,s){return ms(t,s)===ms(e,s)}function Wi({base:t,to:e,trailingSlash:s="never",cache:n}){const r=e.startsWith("/"),i=!r&&e===".";let o;if(n){o=r?e:i?t:t+"\0"+e;const c=n.get(o);if(c)return c}let a;if(i)a=t.split("/");else if(r)a=e.split("/");else{for(a=t.split("/");a.length>1&&ds(a)==="";)a.pop();const c=e.split("/");for(let f=0,d=c.length;f<d;f++){const m=c[f];m===""?f?f===d-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ds(a)===""?s==="never"&&a.pop():s==="always"&&a.push(""));let u,h="";for(let c=0;c<a.length;c++){c>0&&(h+="/");const f=a[c];if(!f)continue;u=yn(f,0,u);const d=u[0];if(d===Ce){h+=f;continue}const m=u[5],y=f.substring(0,u[1]),g=f.substring(u[4],m),v=f.substring(u[2],u[3]);d===se?h+=y||g?`${y}{$${v}}${g}`:`$${v}`:d===ne?h+=y||g?`${y}{$}${g}`:"$":h+=`${y}{-$${v}}${g}`}h=vn(h);const p=h||"/";return o&&n&&n.set(o,p),p}function ks(t,e,s){const n=e[t];return typeof n!="string"?n:t==="_splat"?encodeURI(n):Gi(n,s)}function Fs({path:t,params:e,decodeCharMap:s}){let n=!1;const r={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:r,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:r,isMissingParams:n};const i=t.length;let o=0,a,u="";for(;o<i;){const p=o;a=yn(t,p,a);const c=a[5];if(o=c+1,p===c)continue;const f=a[0];if(f===Ce){u+="/"+t.substring(p,c);continue}if(f===ne){const d=e._splat;r._splat=d,r["*"]=d;const m=t.substring(p,a[1]),y=t.substring(a[4],c);if(!d){n=!0,(m||y)&&(u+="/"+m+y);continue}const g=ks("_splat",e,s);u+="/"+m+g+y;continue}if(f===se){const d=t.substring(a[2],a[3]);!n&&!(d in e)&&(n=!0),r[d]=e[d];const m=t.substring(p,a[1]),y=t.substring(a[4],c),g=ks(d,e,s)??"undefined";u+="/"+m+g+y;continue}if(f===Ue){const d=t.substring(a[2],a[3]),m=e[d];if(m==null)continue;r[d]=m;const y=t.substring(p,a[1]),g=t.substring(a[4],c),v=ks(d,e,s)??"";u+="/"+y+v+g;continue}}return t.endsWith("/")&&(u+="/"),{usedParams:r,interpolatedPath:u||"/",isMissingParams:n}}function Gi(t,e){let s=encodeURIComponent(t);if(e)for(const[n,r]of e)s=s.replaceAll(n,r);return s}function rt(t){return!!(t!=null&&t.isNotFound)}function Ji(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ys="tsr-scroll-restoration-v1_3",Yi=(t,e)=>{let s;return(...n)=>{s||(s=setTimeout(()=>{t(...n),s=null},e))}};function Xi(){const t=Ji();if(!t)return null;const e=t.getItem(ys);let s=e?JSON.parse(e):{};return{state:s,set:n=>(s=Xt(n,s)||s,t.setItem(ys,JSON.stringify(s)))}}const ss=Xi(),Ks=t=>t.state.__TSR_key||t.href;function Zi(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()}let gs=!1;function Fr({storageKey:t,key:e,behavior:s,shouldScrollRestoration:n,scrollToTopSelectors:r,location:i}){var h,p;let o;try{o=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(c){console.error(c);return}const a=e||((h=window.history.state)==null?void 0:h.__TSR_key),u=o[a];gs=!0;t:{if(n&&u&&Object.keys(u).length>0){for(const d in u){const m=u[d];if(d==="window")window.scrollTo({top:m.scrollY,left:m.scrollX,behavior:s});else if(d){const y=document.querySelector(d);y&&(y.scrollLeft=m.scrollX,y.scrollTop=m.scrollY)}}break t}const c=(i??window.location).hash.split("#",2)[1];if(c){const d=((p=window.history.state)==null?void 0:p.__hashScrollIntoViewOptions)??!0;if(d){const m=document.getElementById(c);m&&m.scrollIntoView(d)}break t}const f={top:0,left:0,behavior:s};if(window.scrollTo(f),r)for(const d of r){if(d==="window")continue;const m=typeof d=="function"?d():document.querySelector(d);m&&m.scrollTo(f)}}gs=!1}function to(t,e){if(!ss&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!ss))return;t.isScrollRestorationSetup=!0,gs=!1;const n=t.options.getScrollRestorationKey||Ks;window.history.scrollRestoration="manual";const r=i=>{if(gs||!t.isScrollRestoring)return;let o="";if(i.target===document||i.target===window)o="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?o=`[data-scroll-restoration-id="${u}"]`:o=Zi(i.target)}const a=n(t.state.location);ss.set(u=>{const h=u[a]||(u[a]={}),p=h[o]||(h[o]={});if(o==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(o){const c=document.querySelector(o);c&&(p.scrollX=c.scrollLeft||0,p.scrollY=c.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",Yi(r,100),!0),t.subscribe("onRendered",i=>{const o=n(i.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(Fr({storageKey:ys,key:o,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&ss.set(a=>(a[o]||(a[o]={}),a)))})}function eo(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 so(t,e=String){const s=new URLSearchParams;for(const n in t){const r=t[n];r!==void 0&&s.set(n,e(r))}return s.toString()}function As(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function no(t){const e=new URLSearchParams(t),s={};for(const[n,r]of e.entries()){const i=s[n];i==null?s[n]=As(r):Array.isArray(i)?i.push(As(r)):s[n]=[i,As(r)]}return s}const ro=oo(JSON.parse),io=ao(JSON.stringify,JSON.parse);function oo(t){return e=>{e[0]==="?"&&(e=e.substring(1));const s=no(e);for(const n in s){const r=s[n];if(typeof r=="string")try{s[n]=t(r)}catch{}}return s}}function ao(t,e){const s=typeof e=="function";function n(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(s&&typeof r=="string")try{return e(r),t(r)}catch{}return r}return r=>{const i=so(r,n);return i?`?${i}`:""}}const X="__root__";function co(t){if(t.statusCode=t.statusCode||t.code||307,!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 ut(t){return t instanceof Response&&!!t.options}const cs=t=>{var e;if(!t.rendered)return t.rendered=!0,(e=t.onReady)==null?void 0:e.call(t)},ws=(t,e)=>!!(t.preload&&!t.router.state.matches.some(s=>s.id===e)),Ar=(t,e)=>{var r;const s=t.router.routesById[e.routeId??""]??t.router.routeTree;!s.options.notFoundComponent&&((r=t.router.options)!=null&&r.defaultNotFoundComponent)&&(s.options.notFoundComponent=t.router.options.defaultNotFoundComponent),Pt(s.options.notFoundComponent);const n=t.matches.find(i=>i.routeId===s.id);Pt(n,"Could not find match for route: "+s.id),t.updateMatch(n.id,i=>({...i,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&s.parentRoute&&(e.routeId=s.parentRoute.id,Ar(t,e))},Dt=(t,e,s)=>{var n,r,i;if(!(!ut(s)&&!rt(s))){if(ut(s)&&s.redirectHandled&&!s.options.reloadDocument)throw s;if(e){(n=e._nonReactive.beforeLoadPromise)==null||n.resolve(),(r=e._nonReactive.loaderPromise)==null||r.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const o=ut(s)?"redirected":"notFound";e._nonReactive.error=s,t.updateMatch(e.id,a=>({...a,status:o,isFetching:!1,error:s})),rt(s)&&!s.routeId&&(s.routeId=e.routeId),(i=e._nonReactive.loadPromise)==null||i.resolve()}throw ut(s)?(t.rendered=!0,s.options._fromLocation=t.location,s.redirectHandled=!0,s=t.router.resolveRedirect(s),s):(Ar(t,s),s)}},Dr=(t,e)=>{const s=t.router.getMatch(e);return!!(!t.router.isServer&&s._nonReactive.dehydrated||t.router.isServer&&s.ssr===!1)},Ie=(t,e,s,n)=>{var a,u;const{id:r,routeId:i}=t.matches[e],o=t.router.looseRoutesById[i];if(s instanceof Promise)throw s;s.routerCode=n,t.firstBadMatchIndex??(t.firstBadMatchIndex=e),Dt(t,t.router.getMatch(r),s);try{(u=(a=o.options).onError)==null||u.call(a,s)}catch(h){s=h,Dt(t,t.router.getMatch(r),s)}t.updateMatch(r,h=>{var p,c;return(p=h._nonReactive.beforeLoadPromise)==null||p.resolve(),h._nonReactive.beforeLoadPromise=void 0,(c=h._nonReactive.loadPromise)==null||c.resolve(),{...h,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},uo=(t,e,s,n)=>{var d;const r=t.router.getMatch(e),i=(d=t.matches[s-1])==null?void 0:d.id,o=i?t.router.getMatch(i):void 0;if(t.router.isShell()){r.ssr=n.id===X;return}if((o==null?void 0:o.ssr)===!1){r.ssr=!1;return}const a=m=>m===!0&&(o==null?void 0:o.ssr)==="data-only"?"data-only":m,u=t.router.options.defaultSsr??!0;if(n.options.ssr===void 0){r.ssr=a(u);return}if(typeof n.options.ssr!="function"){r.ssr=a(n.options.ssr);return}const{search:h,params:p}=r,c={search:ns(h,r.searchError),params:ns(p,r.paramsError),location:t.location,matches:t.matches.map(m=>({index:m.index,pathname:m.pathname,fullPath:m.fullPath,staticData:m.staticData,id:m.id,routeId:m.routeId,search:ns(m.search,m.searchError),params:ns(m.params,m.paramsError),ssr:m.ssr}))},f=n.options.ssr(c);if(Bt(f))return f.then(m=>{r.ssr=a(m??u)});r.ssr=a(f??u)},jr=(t,e,s,n)=>{var o;if(n._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!ws(t,e)&&(s.options.loader||s.options.beforeLoad||Nr(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??((o=t.router.options)==null?void 0:o.defaultPendingComponent)))){const a=setTimeout(()=>{cs(t)},r);n._nonReactive.pendingTimeout=a}},lo=(t,e,s)=>{const n=t.router.getMatch(e);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;jr(t,e,s,n);const r=()=>{const i=t.router.getMatch(e);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Dt(t,i,i.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(r):r()},ho=(t,e,s,n)=>{var P;const r=t.router.getMatch(e),i=r._nonReactive.loadPromise;r._nonReactive.loadPromise=xe(()=>{i==null||i.resolve()});const{paramsError:o,searchError:a}=r;o&&Ie(t,s,o,"PARSE_PARAMS"),a&&Ie(t,s,a,"VALIDATE_SEARCH"),jr(t,e,n,r);const u=new AbortController,h=(P=t.matches[s-1])==null?void 0:P.id,p=h?t.router.getMatch(h):void 0,f={...(p==null?void 0:p.context)??t.router.options.context??void 0,...r.__routeContext};let d=!1;const m=()=>{d||(d=!0,t.updateMatch(e,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:u,context:f})))},y=()=>{var M;(M=r._nonReactive.beforeLoadPromise)==null||M.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,O=>({...O,isFetching:!1}))};if(!n.options.beforeLoad){je(()=>{m(),y()});return}r._nonReactive.beforeLoadPromise=xe();const{search:g,params:v,cause:_}=r,w=ws(t,e),S={search:g,abortController:u,params:v,preload:w,context:f,location:t.location,navigate:M=>t.router.navigate({...M,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:w?"preload":_,matches:t.matches,...t.router.options.additionalContext},C=M=>{if(M===void 0){je(()=>{m(),y()});return}(ut(M)||rt(M))&&(m(),Ie(t,s,M,"BEFORE_LOAD")),je(()=>{m(),t.updateMatch(e,O=>({...O,__beforeLoadContext:M,context:{...O.context,...M}})),y()})};let R;try{if(R=n.options.beforeLoad(S),Bt(R))return m(),R.catch(M=>{Ie(t,s,M,"BEFORE_LOAD")}).then(C)}catch(M){m(),Ie(t,s,M,"BEFORE_LOAD")}C(R)},fo=(t,e)=>{const{id:s,routeId:n}=t.matches[e],r=t.router.looseRoutesById[n],i=()=>{if(t.router.isServer){const u=uo(t,s,e,r);if(Bt(u))return u.then(a)}return a()},o=()=>ho(t,s,e,r),a=()=>{if(Dr(t,s))return;const u=lo(t,s,r);return Bt(u)?u.then(o):o()};return i()},Be=(t,e,s)=>{var i,o,a,u,h,p;const n=t.router.getMatch(e);if(!n||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={matches:t.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([(o=(i=s.options).head)==null?void 0:o.call(i,r),(u=(a=s.options).scripts)==null?void 0:u.call(a,r),(p=(h=s.options).headers)==null?void 0:p.call(h,r)]).then(([c,f,d])=>{const m=c==null?void 0:c.meta,y=c==null?void 0:c.links,g=c==null?void 0:c.scripts,v=c==null?void 0:c.styles;return{meta:m,links:y,headScripts:g,headers:d,scripts:f,styles:v}})},Br=(t,e,s,n)=>{const r=t.matchPromises[s-1],{params:i,loaderDeps:o,abortController:a,cause:u}=t.router.getMatch(e);let h=t.router.options.context??{};for(let c=0;c<=s;c++){const f=t.matches[c];if(!f)continue;const d=t.router.getMatch(f.id);d&&(h={...h,...d.__routeContext??{},...d.__beforeLoadContext??{}})}const p=ws(t,e);return{params:i,deps:o,preload:!!p,parentMatchPromise:r,abortController:a,context:h,location:t.location,navigate:c=>t.router.navigate({...c,_fromLocation:t.location}),cause:p?"preload":u,route:n,...t.router.options.additionalContext}},Gn=async(t,e,s,n)=>{var r,i,o,a,u,h;try{const p=t.router.getMatch(e);try{(!t.router.isServer||p.ssr===!0)&&Ur(n);const c=(i=(r=n.options).loader)==null?void 0:i.call(r,Br(t,e,s,n)),f=n.options.loader&&Bt(c);if(!!(f||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||p._nonReactive.minPendingPromise)&&t.updateMatch(e,v=>({...v,isFetching:"loader"})),n.options.loader){const v=f?await c:c;Dt(t,t.router.getMatch(e),v),v!==void 0&&t.updateMatch(e,_=>({..._,loaderData:v}))}n._lazyPromise&&await n._lazyPromise;const m=Be(t,e,n),y=m?await m:void 0,g=p._nonReactive.minPendingPromise;g&&await g,n._componentsPromise&&await n._componentsPromise,t.updateMatch(e,v=>({...v,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...y}))}catch(c){let f=c;const d=p._nonReactive.minPendingPromise;d&&await d,rt(c)&&await((a=(o=n.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Dt(t,t.router.getMatch(e),c);try{(h=(u=n.options).onError)==null||h.call(u,c)}catch(g){f=g,Dt(t,t.router.getMatch(e),g)}const m=Be(t,e,n),y=m?await m:void 0;t.updateMatch(e,g=>({...g,error:f,status:"error",isFetching:!1,...y}))}}catch(p){const c=t.router.getMatch(e);if(c){const f=Be(t,e,n);if(f){const d=await f;t.updateMatch(e,m=>({...m,...d}))}c._nonReactive.loaderPromise=void 0}Dt(t,c,p)}},po=async(t,e)=>{var h,p;const{id:s,routeId:n}=t.matches[e];let r=!1,i=!1;const o=t.router.looseRoutesById[n];if(Dr(t,s)){if(t.router.isServer){const c=Be(t,s,o);if(c){const f=await c;t.updateMatch(s,d=>({...d,...f}))}return t.router.getMatch(s)}}else{const c=t.router.getMatch(s);if(c._nonReactive.loaderPromise){if(c.status==="success"&&!t.sync&&!c.preload)return c;await c._nonReactive.loaderPromise;const f=t.router.getMatch(s),d=f._nonReactive.error||f.error;d&&Dt(t,f,d)}else{const f=Date.now()-c.updatedAt,d=ws(t,s),m=d?o.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:o.options.staleTime??t.router.options.defaultStaleTime??0,y=o.options.shouldReload,g=typeof y=="function"?y(Br(t,s,e,o)):y,v=!!d&&!t.router.state.matches.some(C=>C.id===s),_=t.router.getMatch(s);_._nonReactive.loaderPromise=xe(),v!==_.preload&&t.updateMatch(s,C=>({...C,preload:v}));const{status:w,invalid:S}=_;if(r=w==="success"&&(S||(g??f>m)),!(d&&o.options.preload===!1))if(r&&!t.sync)i=!0,(async()=>{var C,R;try{await Gn(t,s,e,o);const P=t.router.getMatch(s);(C=P._nonReactive.loaderPromise)==null||C.resolve(),(R=P._nonReactive.loadPromise)==null||R.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){ut(P)&&await t.router.navigate(P.options)}})();else if(w!=="success"||r&&t.sync)await Gn(t,s,e,o);else{const C=Be(t,s,o);if(C){const R=await C;t.updateMatch(s,P=>({...P,...R}))}}}}const a=t.router.getMatch(s);i||((h=a._nonReactive.loaderPromise)==null||h.resolve(),(p=a._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,i||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const u=i?a.isFetching:!1;return u!==a.isFetching||a.invalid!==!1?(t.updateMatch(s,c=>({...c,isFetching:u,invalid:!1})),t.router.getMatch(s)):a};async function Jn(t){const e=Object.assign(t,{matchPromises:[]});!e.router.isServer&&e.router.state.matches.some(s=>s._forcePending)&&cs(e);try{for(let r=0;r<e.matches.length;r++){const i=fo(e,r);Bt(i)&&await i}const s=e.firstBadMatchIndex??e.matches.length;for(let r=0;r<s;r++)e.matchPromises.push(po(e,r));await Promise.all(e.matchPromises);const n=cs(e);Bt(n)&&await n}catch(s){if(rt(s)&&!e.preload){const n=cs(e);throw Bt(n)&&await n,s}if(ut(s))throw s}return e.matches}async function Ur(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:s,...n}=e.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{var n;const s=[];for(const r of Qr){const i=(n=t.options[r])==null?void 0:n.preload;i&&s.push(i())}if(s.length)return Promise.all(s).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function ns(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}function Nr(t){var e;for(const s of Qr)if((e=t.options[s])!=null&&e.preload)return!0;return!1}const Qr=["component","errorComponent","pendingComponent","notFoundComponent"];function mo(t){return{input:({url:e})=>{for(const s of t)e=$r(s,e);return e},output:({url:e})=>{for(let s=t.length-1;s>=0;s--)e=qr(t[s],e);return e}}}function yo(t){const e=as(t.basepath),s=`/${e}`,n=`${s}/`,r=t.caseSensitive?s:s.toLowerCase(),i=t.caseSensitive?n:n.toLowerCase();return{input:({url:o})=>{const a=t.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===r?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(s.length)),o},output:({url:o})=>(o.pathname=os(["/",e,o.pathname]),o)}}function $r(t,e){var n;const s=(n=t==null?void 0:t.input)==null?void 0:n.call(t,{url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}function qr(t,e){var n;const s=(n=t==null?void 0:t.output)==null?void 0:n.call(t,{url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}function ee(t){const e=t.resolvedLocation,s=t.location,n=(e==null?void 0:e.pathname)!==s.pathname,r=(e==null?void 0:e.href)!==s.href,i=(e==null?void 0:e.hash)!==s.hash;return{fromLocation:e,toLocation:s,pathChanged:n,hrefChanged:r,hashChanged:i}}class go{constructor(e){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=s=>s(),this.update=s=>{var f;s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options,r=this.basepath??(n==null?void 0:n.basepath)??"/",i=this.basepath===void 0,o=n==null?void 0:n.rewrite;this.options={...n,...s},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(d=>[encodeURIComponent(d),d])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Ti())),this.origin=this.options.origin,this.origin||(!this.isServer&&(window!=null&&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,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Li(So(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),to(this));let a=!1;const u=this.options.basepath??"/",h=this.options.rewrite;if(i||r!==u||o!==h){this.basepath=u;const d=[];as(u)!==""&&d.push(yo({basepath:u})),h&&d.push(h),this.rewrite=d.length===0?void 0:d.length===1?d[0]:mo(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof((f=window.CSS)==null?void 0:f.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{routesById:s,routesByPath:n,processedTree:r}=$i(this.routeTree,this.options.caseSensitive,(o,a)=>{o.init({originalIndex:a})});this.options.routeMasks&&ji(this.options.routeMasks,r),this.routesById=s,this.routesByPath=n,this.processedTree=r;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(s,n)=>{const r={eventType:s,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=s=>{this.subscribers.forEach(n=>{n.eventType===s.type&&n.fn(s)})},this.parseLocation=(s,n)=>{const r=({href:u,state:h})=>{const p=new URL(u,this.origin),c=$r(this.rewrite,p),f=this.options.parseSearch(c.search),d=this.options.stringifySearch(f);c.search=d;const m=c.href.replace(c.origin,""),{pathname:y,hash:g}=c;return{href:m,publicHref:u,url:c.href,pathname:Wn(y),searchStr:d,search:tt(n==null?void 0:n.search,f),hash:g.split("#").reverse()[0]??"",state:tt(n==null?void 0:n.state,h)}},i=r(s),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const u=r(o);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathCache=ps(1e3),this.resolvePathWithBase=(s,n)=>Wi({base:s,to:vn(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,n,r)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:n},r):this.matchRoutesInternal(s,n),this.getMatchedRoutes=s=>Ro({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const n=this.getMatch(s);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const s=this.state.matches.filter(i=>i.status==="pending"),n=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...s,...n]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=s=>{const n=(i={})=>{var b,L;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(o,{_buildLocation:!0}),u=ds(a);i.from;const h=i.unsafeRelative==="path"?o.pathname:i.from??u.fullPath,p=this.resolvePathWithBase(h,"."),c=u.search,f={...u.params},d=i.to?this.resolvePathWithBase(p,`${i.to}`):this.resolvePathWithBase(p,"."),m=i.params===!1||i.params===null?{}:(i.params??!0)===!0?f:Object.assign(f,Xt(i.params,f)),y=Fs({path:d,params:m}).interpolatedPath,g=this.matchRoutes(y,void 0,{_buildLocation:!0}).map(A=>this.looseRoutesById[A.routeId]);if(Object.keys(m).length>0)for(const A of g){const B=((b=A.options.params)==null?void 0:b.stringify)??A.options.stringifyParams;B&&Object.assign(m,B(m))}const v=s.leaveParams?d:Wn(Fs({path:d,params:m,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let _=c;if(s._includeValidateSearch&&((L=this.options.search)!=null&&L.strict)){const A={};g.forEach(B=>{if(B.options.validateSearch)try{Object.assign(A,zs(B.options.validateSearch,{...A,..._}))}catch{}}),_=A}_=bo({search:_,dest:i,destRoutes:g,_includeValidateSearch:s._includeValidateSearch}),_=tt(c,_);const w=this.options.stringifySearch(_),S=i.hash===!0?o.hash:i.hash?Xt(i.hash,o.hash):void 0,C=S?`#${S}`:"";let R=i.state===!0?o.state:i.state?Xt(i.state,o.state):{};R=tt(o.state,R);const P=`${v}${w}${C}`,M=new URL(P,this.origin),O=qr(this.rewrite,M);return{publicHref:O.pathname+O.search+O.hash,href:P,url:O.href,pathname:v,search:_,searchStr:w,state:R,hash:S??"",unmaskOnReload:i.unmaskOnReload}},r=(i={},o)=>{const a=n(i);let u=o?n(o):void 0;if(!u){const h={};if(this.options.routeMasks){const p=Bi(a.pathname,this.processedTree);if(p){Object.assign(h,p.params);const{from:c,...f}=p.route;o={from:s.from,...f,params:h},u=n(o)}}}return u&&(a.maskedLocation=u),a};return s.mask?r(s,{from:s.from,...s.mask}):r(s)},this.commitLocation=({viewTransition:s,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(p=>{r.state[p]=this.latestLocation.state[p]});const h=Zt(r.state,this.latestLocation.state);return u.forEach(p=>{delete r.state[p]}),h},o=te(this.latestLocation.href)===te(r.href),a=this.commitLocationPromise;if(this.commitLocationPromise=xe(()=>{a==null||a.resolve()}),o&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:h,...p}=r;u&&(p={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[r.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:o,href:a,...u}={})=>{if(a){const c=this.history.location.state.__TSR_index,f=hs(a,{__TSR_index:s?c:c+1});u.to=f.pathname,u.search=this.options.parseSearch(f.search),u.hash=f.hash.slice(1)}const h=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:i,replace:s,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:s,reloadDocument:n,href:r,...i})=>{var o;if(!n&&r)try{new URL(`${r}`),n=!0}catch{}if(n){if(r||(r=this.buildLocation({to:s,...i}).url),!i.ignoreBlocker){const a=this.history,u=((o=a.getBlockers)==null?void 0:o.call(a))??[];for(const h of u)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(r):window.location.href=r,Promise.resolve()}return this.buildAndCommitLocation({...i,href:r,to:s,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const n=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),r=i=>{try{return encodeURI(decodeURI(i))}catch{return i}};if(as(r(this.latestLocation.href))!==as(r(n.href))){let i=n.url;throw this.origin&&i.startsWith(this.origin)&&(i=i.replace(this.origin,"")||"/"),co({href:i})}}const s=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:s,cachedMatches:n.cachedMatches.filter(r=>!s.some(i=>i.id===r.id))}))},this.load=async s=>{let n,r,i;for(i=new Promise(a=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const h=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ee({resolvedLocation:p,location:h})}),this.emit({type:"onBeforeLoad",...ee({resolvedLocation:p,location:h})}),await Jn({router:this,sync:s==null?void 0:s.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let c=[],f=[],d=[];je(()=>{this.__store.setState(m=>{const y=m.matches,g=m.pendingMatches||m.matches;return c=y.filter(v=>!g.some(_=>_.id===v.id)),f=g.filter(v=>!y.some(_=>_.id===v.id)),d=g.filter(v=>y.some(_=>_.id===v.id)),{...m,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...c.filter(v=>v.status!=="error"&&v.status!=="notFound")]}}),this.clearExpiredCache()}),[[c,"onLeave"],[f,"onEnter"],[d,"onStay"]].forEach(([m,y])=>{m.forEach(g=>{var v,_;(_=(v=this.looseRoutesById[g.routeId].options)[y])==null||_.call(v,g)})})})})}})}catch(h){ut(h)?(n=h,this.isServer||this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):rt(h)&&(r=h),this.__store.setState(p=>({...p,statusCode:n?n.status:r?404:p.matches.some(c=>c.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(a=>a.status==="error")&&(o=500),o!==void 0&&this.__store.setState(a=>({...a,statusCode:o}))},this.startViewTransition=s=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.state.resolvedLocation,a=typeof n.types=="function"?n.types(ee({resolvedLocation:o,location:i})):n.types;if(a===!1){s();return}r={update:s,types:a}}else r=s;document.startViewTransition(r)}else s()},this.updateMatch=(s,n)=>{this.startTransition(()=>{var i;const r=(i=this.state.pendingMatches)!=null&&i.some(o=>o.id===s)?"pendingMatches":this.state.matches.some(o=>o.id===s)?"matches":this.state.cachedMatches.some(o=>o.id===s)?"cachedMatches":"";r&&this.__store.setState(o=>{var a;return{...o,[r]:(a=o[r])==null?void 0:a.map(u=>u.id===s?n(u):u)}})})},this.getMatch=s=>{var r;const n=i=>i.id===s;return this.state.cachedMatches.find(n)??((r=this.state.pendingMatches)==null?void 0:r.find(n))??this.state.matches.find(n)},this.invalidate=s=>{const n=r=>{var i;return((i=s==null?void 0:s.filter)==null?void 0:i.call(s,r))??!0?{...r,invalid:!0,...s!=null&&s.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r};return this.__store.setState(r=>{var i;return{...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:(i=r.pendingMatches)==null?void 0:i.map(n)}}),this.shouldViewTransition=!1,this.load({sync:s==null?void 0:s.sync})},this.resolveRedirect=s=>{if(!s.options.href){const n=this.buildLocation(s.options);let r=n.url;this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),s.options.href=n.href,s.headers.set("Location",r)}return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const n=s==null?void 0:s.filter;n!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const s=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:s})},this.loadRouteChunk=Ur,this.preloadRoute=async s=>{const n=this.buildLocation(s);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:s});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),o=new Set([...i,...this.state.cachedMatches.map(a=>a.id)]);je(()=>{r.forEach(a=>{o.has(a.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,a]}))})});try{return r=await Jn({router:this,matches:r,location:n,preload:!0,updateMatch:(a,u)=>{i.has(a)?r=r.map(h=>h.id===a?u(h):h):this.updateMatch(a,u)}}),r}catch(a){if(ut(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:n});rt(a)||console.error(a);return}},this.matchRoute=(s,n)=>{const r={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},i=this.buildLocation(r);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const a=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=Ui(i.pathname,(n==null?void 0:n.caseSensitive)??!1,(n==null?void 0:n.fuzzy)??!1,a.pathname,this.processedTree);return!u||s.params&&!Zt(u.params,s.params,{partial:!0})?!1:(n==null?void 0:n.includeSearch)??!0?Zt(a.search,i.search,{partial:!0})?u.params:!1:u.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??io,parseSearch:e.parseSearch??ro}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,s){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&i["**"]:te(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const u=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let c=o.length-1;c>=0;c--){const f=o[c];if(f.children)return f.id}return X}})(),h=[],p=c=>(c==null?void 0:c.id)?c.context??this.options.context??void 0:this.options.context??void 0;return o.forEach((c,f)=>{var B,lt,Me;const d=h[f-1],[m,y,g]=(()=>{const V=(d==null?void 0:d.search)??e.search,it=(d==null?void 0:d._strictSearch)??void 0;try{const ht=zs(c.options.validateSearch,{...V})??void 0;return[{...V,...ht},{...it,...ht},void 0]}catch(ht){let Le=ht;if(ht instanceof vs||(Le=new vs(ht.message,{cause:ht})),s!=null&&s.throwOnError)throw Le;return[V,{},Le]}})(),v=((lt=(B=c.options).loaderDeps)==null?void 0:lt.call(B,{search:m}))??"",_=v?JSON.stringify(v):"",{interpolatedPath:w,usedParams:S}=Fs({path:c.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),C=c.id+w+_,R=this.getMatch(C),P=this.state.matches.find(V=>V.routeId===c.id),M=(R==null?void 0:R._strictParams)??S;let O;if(!R){const V=((Me=c.options.params)==null?void 0:Me.parse)??c.options.parseParams;if(V)try{Object.assign(M,V(M))}catch(it){if(rt(it)||ut(it)?O=it:O=new vo(it.message,{cause:it}),s!=null&&s.throwOnError)throw O}}Object.assign(i,M);const b=P?"stay":"enter";let L;if(R)L={...R,cause:b,params:P?tt(P.params,i):i,_strictParams:M,search:tt(P?P.search:R.search,m),_strictSearch:y};else{const V=c.options.loader||c.options.beforeLoad||c.lazyFn||Nr(c)?"pending":"success";L={id:C,ssr:this.isServer?void 0:c.options.ssr,index:f,routeId:c.id,params:P?tt(P.params,i):i,_strictParams:M,pathname:w,updatedAt:Date.now(),search:P?tt(P.search,m):m,_strictSearch:y,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:xe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:b,loaderDeps:P?tt(P.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:c.options.staticData||{},fullPath:c.fullPath}}s!=null&&s.preload||(L.globalNotFound=u===c.id),L.searchError=g;const A=p(d);L.context={...A,...L.__routeContext,...L.__beforeLoadContext},h.push(L)}),h.forEach((c,f)=>{const d=this.looseRoutesById[c.routeId];if(!this.getMatch(c.id)&&(s==null?void 0:s._buildLocation)!==!0){const y=h[f-1],g=p(y);if(d.options.context){const v={deps:c.loaderDeps,params:c.params,context:g??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:c.cause,abortController:c.abortController,preload:!!c.preload,matches:h};c.__routeContext=d.options.context(v)??void 0}c.context={...g,...c.__routeContext,...c.__beforeLoadContext}}}),h}}class vs extends Error{}class vo extends Error{}function So(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function zs(t,e){if(t==null)return{};if("~standard"in t){const s=t["~standard"].validate(e);if(s instanceof Promise)throw new vs("Async validation not supported");if(s.issues)throw new vs(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 Ro({pathname:t,routesById:e,processedTree:s}){const n={},r=te(t);let i;const o=Ni(r,s,!0);return o&&(i=o.route,Object.assign(n,o.params)),{matchedRoutes:(o==null?void 0:o.branch)||[e[X]],routeParams:n,foundRoute:i}}function bo({search:t,dest:e,destRoutes:s,_includeValidateSearch:n}){const r=s.reduce((a,u)=>{var p;const h=[];if("search"in u.options)(p=u.options.search)!=null&&p.middlewares&&h.push(...u.options.search.middlewares);else if(u.options.preSearchFilters||u.options.postSearchFilters){const c=({search:f,next:d})=>{let m=f;"preSearchFilters"in u.options&&u.options.preSearchFilters&&(m=u.options.preSearchFilters.reduce((g,v)=>v(g),f));const y=d(m);return"postSearchFilters"in u.options&&u.options.postSearchFilters?u.options.postSearchFilters.reduce((g,v)=>v(g),y):y};h.push(c)}if(n&&u.options.validateSearch){const c=({search:f,next:d})=>{const m=d(f);try{return{...m,...zs(u.options.validateSearch,m)??void 0}}catch{return m}};h.push(c)}return a.concat(h)},[])??[],i=({search:a})=>e.search?e.search===!0?a:Xt(e.search,a):{};r.push(i);const o=(a,u)=>{if(a>=r.length)return u;const h=r[a];return h({search:u,next:c=>o(a+1,c)})};return o(0,t)}const wo="Error preloading route! ☝️";class Kr{constructor(e){if(this.init=s=>{var h,p;this.originalIndex=s.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(p=(h=this.options).getParentRoute)==null?void 0:p.call(h),r?this._path=X:this.parentRoute||Pt(!1);let i=r?X:n==null?void 0:n.path;i&&i!=="/"&&(i=kr(i));const o=(n==null?void 0:n.id)||i;let a=r?X:os([this.parentRoute.id===X?"":this.parentRoute.id,o]);i===X&&(i="/"),a!==X&&(a=os(["/",a]));const u=a===X?"/":os([this.parentRoute.fullPath,i]);this._path=i,this._id=a,this._fullPath=u,this._to=u},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Po extends Kr{constructor(e){super(e)}}function Sn(t){const e=t.errorComponent??Ps;return I.jsx(_o,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:s,reset:n})=>s?T.createElement(e,{error:s,reset:n}):t.children})}class _o extends T.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,s){this.props.onCatch&&this.props.onCatch(e,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Ps({error:t}){const[e,s]=T.useState(!1);return I.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[I.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),I.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(n=>!n),children:e?"Hide Error":"Show Error"})]}),I.jsx("div",{style:{height:".25rem"}}),e?I.jsx("div",{children:I.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?I.jsx("code",{children:t.message}):null})}):null]})}function xo({children:t,fallback:e=null}){return Co()?I.jsx(_e.Fragment,{children:t}):I.jsx(_e.Fragment,{children:e})}function Co(){return _e.useSyncExternalStore(Mo,()=>!0,()=>!1)}function Mo(){return()=>{}}var Ds={exports:{}},js={},Bs={exports:{}},Us={};/**
10
- * @license React
11
- * use-sync-external-store-shim.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Yn;function Lo(){if(Yn)return Us;Yn=1;var t=pn();function e(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var s=typeof Object.is=="function"?Object.is:e,n=t.useState,r=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function a(c,f){var d=f(),m=n({inst:{value:d,getSnapshot:f}}),y=m[0].inst,g=m[1];return i(function(){y.value=d,y.getSnapshot=f,u(y)&&g({inst:y})},[c,d,f]),r(function(){return u(y)&&g({inst:y}),c(function(){u(y)&&g({inst:y})})},[c]),o(d),d}function u(c){var f=c.getSnapshot;c=c.value;try{var d=f();return!s(c,d)}catch{return!0}}function h(c,f){return f()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:a;return Us.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,Us}var Xn;function Eo(){return Xn||(Xn=1,Bs.exports=Lo()),Bs.exports}/**
18
- * @license React
19
- * use-sync-external-store-shim/with-selector.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Zn;function To(){if(Zn)return js;Zn=1;var t=pn(),e=Eo();function s(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:s,r=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,u=t.useDebugValue;return js.useSyncExternalStoreWithSelector=function(h,p,c,f,d){var m=i(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function v(R){if(!_){if(_=!0,w=R,R=f(R),d!==void 0&&y.hasValue){var P=y.value;if(d(P,R))return S=P}return S=R}if(P=S,n(w,R))return P;var M=f(R);return d!==void 0&&d(P,M)?(w=R,P):(w=R,S=M)}var _=!1,w,S,C=c===void 0?null:c;return[function(){return v(p())},C===null?void 0:function(){return v(C())}]},[p,c,f,d]);var g=r(h,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=g},[g]),u(g),g},js}var tr;function Io(){return tr||(tr=1,Ds.exports=To()),Ds.exports}var Oo=Io();function ko(t,e=n=>n,s={}){const n=s.equal??Fo;return Oo.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function Fo(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,r]of t)if(!e.has(n)||!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const s=er(t);if(s.length!==er(e).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(e,s[n])||!Object.is(t[s[n]],e[s[n]]))return!1;return!0}function er(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const Ns=T.createContext(null);function zr(){return typeof document>"u"?Ns:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Ns,Ns)}function Z(t){const e=T.useContext(zr());return t==null||t.warn,e}function J(t){const e=Z({warn:(t==null?void 0:t.router)===void 0}),s=(t==null?void 0:t.router)||e,n=T.useRef(void 0);return ko(s.__store,r=>{if(t!=null&&t.select){if(t.structuralSharing??s.options.defaultStructuralSharing){const i=tt(n.current,t.select(r));return n.current=i,i}return t.select(r)}return r})}const _s=T.createContext(void 0),Ao=T.createContext(void 0);function mt(t){const e=T.useContext(t.from?Ao:_s);return J({select:n=>{const r=n.matches.find(i=>t.from?t.from===i.routeId:i.id===e);if(Pt(!((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 Rn(t){return mt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function bn(t){const{select:e,...s}=t;return mt({...s,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function wn(t){return mt({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 Pn(t){return mt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}const rs=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Qs(t){const e=T.useRef({value:t,prev:null}),s=e.current.value;return t!==s&&(e.current={value:t,prev:s}),e.current.prev}function Do(t,e,s={},n={}){T.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([i])=>{e(i)},s);return r.observe(t.current),()=>{r.disconnect()}},[e,s,n.disabled,t])}function jo(t){const e=T.useRef(null);return T.useImperativeHandle(t,()=>e.current,[]),e}function _n(t){const e=Z();return T.useCallback(s=>e.navigate({...s,from:s.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}var Hr=Ri();const Da=Tr(Hr);function Bo(t,e){const s=Z(),[n,r]=T.useState(!1),i=T.useRef(!1),o=jo(e),{activeProps:a,inactiveProps:u,activeOptions:h,to:p,preload:c,preloadDelay:f,hashScrollIntoView:d,replace:m,startTransition:y,resetScroll:g,viewTransition:v,children:_,target:w,disabled:S,style:C,className:R,onClick:P,onFocus:M,onMouseEnter:O,onMouseLeave:b,onTouchStart:L,ignoreBlocker:A,params:B,search:lt,hash:Me,state:V,mask:it,reloadDocument:ht,unsafeRelative:Le,from:Ia,_fromLocation:Oa,...On}=t,pi=J({select:j=>j.location.search,structuralSharing:!0}),kn=t.from,Ee=T.useMemo(()=>({...t,from:kn}),[s,pi,kn,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),yt=T.useMemo(()=>s.buildLocation({...Ee}),[s,Ee]),_t=T.useMemo(()=>{if(S)return;let j=yt.maskedLocation?yt.maskedLocation.url:yt.url,$=!1;return s.origin&&(j.startsWith(s.origin)?j=s.history.createHref(j.replace(s.origin,""))||"/":$=!0),{href:j,external:$}},[S,yt.maskedLocation,yt.url,s.origin,s.history]),Ye=T.useMemo(()=>{if(_t!=null&&_t.external)return _t.href;try{return new URL(p),p}catch{}},[p,_t]),ae=t.reloadDocument||Ye?!1:c??s.options.defaultPreload,xs=f??s.options.defaultPreloadDelay??0,Cs=J({select:j=>{if(Ye)return!1;if(h!=null&&h.exact){if(!Vi(j.location.pathname,yt.pathname,s.basepath))return!1}else{const $=ms(j.location.pathname,s.basepath),ot=ms(yt.pathname,s.basepath);if(!($.startsWith(ot)&&($.length===ot.length||$[ot.length]==="/")))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!Zt(j.location.search,yt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?j.location.hash===yt.hash:!0}}),Nt=T.useCallback(()=>{s.preloadRoute({...Ee}).catch(j=>{console.warn(j),console.warn(wo)})},[s,Ee]),mi=T.useCallback(j=>{j!=null&&j.isIntersecting&&Nt()},[Nt]);Do(o,mi,qo,{disabled:!!S||ae!=="viewport"}),T.useEffect(()=>{i.current||!S&&ae==="render"&&(Nt(),i.current=!0)},[S,Nt,ae]);const yi=j=>{const $=j.currentTarget.getAttribute("target"),ot=w!==void 0?w:$;if(!S&&!Ko(j)&&!j.defaultPrevented&&(!ot||ot==="_self")&&j.button===0){j.preventDefault(),Hr.flushSync(()=>{r(!0)});const jn=s.subscribe("onResolved",()=>{jn(),r(!1)});s.navigate({...Ee,replace:m,resetScroll:g,hashScrollIntoView:d,startTransition:y,viewTransition:v,ignoreBlocker:A})}};if(Ye)return{...On,ref:o,href:Ye,..._&&{children:_},...w&&{target:w},...S&&{disabled:S},...C&&{style:C},...R&&{className:R},...P&&{onClick:P},...M&&{onFocus:M},...O&&{onMouseEnter:O},...b&&{onMouseLeave:b},...L&&{onTouchStart:L}};const Fn=j=>{S||ae&&Nt()},gi=Fn,vi=j=>{if(!(S||!ae))if(!xs)Nt();else{const $=j.target;if(Oe.has($))return;const ot=setTimeout(()=>{Oe.delete($),Nt()},xs);Oe.set($,ot)}},Si=j=>{if(S||!ae||!xs)return;const $=j.target,ot=Oe.get($);ot&&(clearTimeout(ot),Oe.delete($))},Xe=Cs?Xt(a,{})??Uo:$s,Ze=Cs?$s:Xt(u,{})??$s,An=[R,Xe.className,Ze.className].filter(Boolean).join(" "),Dn=(C||Xe.style||Ze.style)&&{...C,...Xe.style,...Ze.style};return{...On,...Xe,...Ze,href:_t==null?void 0:_t.href,ref:o,onClick:ke([P,yi]),onFocus:ke([M,Fn]),onMouseEnter:ke([O,vi]),onMouseLeave:ke([b,Si]),onTouchStart:ke([L,gi]),disabled:!!S,target:w,...Dn&&{style:Dn},...An&&{className:An},...S&&No,...Cs&&Qo,...n&&$o}}const $s={},Uo={className:"active"},No={role:"link","aria-disabled":!0},Qo={"data-status":"active","aria-current":"page"},$o={"data-transitioning":"transitioning"},Oe=new WeakMap,qo={rootMargin:"100px"},ke=t=>e=>{for(const s of t)if(s){if(e.defaultPrevented)return;s(e)}},Vr=T.forwardRef((t,e)=>{const{_asChild:s,...n}=t,{type:r,ref:i,...o}=Bo(n,e),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;return s===void 0&&delete o.disabled,T.createElement(s||"a",{...o,ref:i},a)});function Ko(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class zo extends Kr{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function Ho(t){return new zo(t)}class Vo extends Po{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function ja(t){return new Vo(t)}function sr(t){return typeof t=="object"?new nr(t,{silent:!0}).createRoute(t):new nr(t,{silent:!0}).createRoute}class nr{constructor(e,s){this.path=e,this.createRoute=n=>{this.silent;const r=Ho(n);return r.isRoot=!1,r},this.silent=s==null?void 0:s.silent}}class rr{constructor(e){this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.options.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({from:this.options.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>bn({...s,from:this.options.id}),this.useLoaderData=s=>Rn({...s,from:this.options.id}),this.useNavigate=()=>{const s=Z();return _n({from:s.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function ir(t){return typeof t=="object"?new rr(t):e=>new rr({id:t,...e})}function Wo(){const t=Z(),e=T.useRef({router:t,mounted:!1}),[s,n]=T.useState(!1),{hasPendingMatches:r,isLoading:i}=J({select:c=>({isLoading:c.isLoading,hasPendingMatches:c.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),o=Qs(i),a=i||s||r,u=Qs(a),h=i||r,p=Qs(h);return t.startTransition=c=>{n(!0),T.startTransition(()=>{c(),n(!1)})},T.useEffect(()=>{const c=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return te(t.latestLocation.href)!==te(f.href)&&t.commitLocation({...f,replace:!0}),()=>{c()}},[t,t.history]),rs(()=>{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(f){console.error(f)}})()},[t]),rs(()=>{o&&!i&&t.emit({type:"onLoad",...ee(t.state)})},[o,t,i]),rs(()=>{p&&!h&&t.emit({type:"onBeforeRouteMount",...ee(t.state)})},[h,p,t]),rs(()=>{if(u&&!a){const c=ee(t.state);t.emit({type:"onResolved",...c}),t.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),c.hrefChanged&&eo(t)}},[a,u,t]),null}function Go(t){const e=J({select:s=>`not-found-${s.location.pathname}-${s.status}`});return I.jsx(Sn,{getResetKey:()=>e,onCatch:(s,n)=>{var r;if(rt(s))(r=t.onCatch)==null||r.call(t,s,n);else throw s},errorComponent:({error:s})=>{var n;if(rt(s))return(n=t.fallback)==null?void 0:n.call(t,s);throw s},children:t.children})}function Jo(){return I.jsx("p",{children:"Not Found"})}function ce(t){return I.jsx(I.Fragment,{children:t.children})}function Wr(t,e,s){return e.options.notFoundComponent?I.jsx(e.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?I.jsx(t.options.defaultNotFoundComponent,{...s}):I.jsx(Jo,{})}function Yo({children:t}){var s;const e=Z();return e.isServer?I.jsx("script",{nonce:(s=e.options.ssr)==null?void 0:s.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:t+';typeof $_TSR !== "undefined" && $_TSR.c()'}}):null}function Xo(){const t=Z();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const s=(t.options.getScrollRestorationKey||Ks)(t.latestLocation),n=s!==Ks(t.latestLocation)?s:void 0,r={storageKey:ys,shouldScrollRestoration:!0};return n&&(r.key=n),I.jsx(Yo,{children:`(${Fr.toString()})(${JSON.stringify(r)})`})}const Gr=T.memo(function({matchId:e}){var v,_;const s=Z(),n=J({select:w=>{const S=w.matches.find(C=>C.id===e);return Pt(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending}},structuralSharing:!0}),r=s.routesById[n.routeId],i=r.options.pendingComponent??s.options.defaultPendingComponent,o=i?I.jsx(i,{}):null,a=r.options.errorComponent??s.options.defaultErrorComponent,u=r.options.onCatch??s.options.defaultOnCatch,h=r.isRoot?r.options.notFoundComponent??((v=s.options.notFoundRoute)==null?void 0:v.options.component):r.options.notFoundComponent,p=n.ssr===!1||n.ssr==="data-only",c=(!r.isRoot||r.options.wrapInSuspense||p)&&(r.options.wrapInSuspense??i??(((_=r.options.errorComponent)==null?void 0:_.preload)||p))?T.Suspense:ce,f=a?Sn:ce,d=h?Go:ce,m=J({select:w=>w.loadedAt}),y=J({select:w=>{var C;const S=w.matches.findIndex(R=>R.id===e);return(C=w.matches[S-1])==null?void 0:C.routeId}}),g=r.isRoot?r.options.shellComponent??ce:ce;return I.jsxs(g,{children:[I.jsx(_s.Provider,{value:e,children:I.jsx(c,{fallback:o,children:I.jsx(f,{getResetKey:()=>m,errorComponent:a||Ps,onCatch:(w,S)=>{if(rt(w))throw w;u==null||u(w,S)},children:I.jsx(d,{fallback:w=>{if(!h||w.routeId&&w.routeId!==n.routeId||!w.routeId&&!r.isRoot)throw w;return T.createElement(h,w)},children:p||n._displayPending?I.jsx(xo,{fallback:o,children:I.jsx(or,{matchId:e})}):I.jsx(or,{matchId:e})})})})}),y===X&&s.options.scrollRestoration?I.jsxs(I.Fragment,{children:[I.jsx(Zo,{}),I.jsx(Xo,{})]}):null]})});function Zo(){const t=Z(),e=T.useRef(void 0);return I.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...ee(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const or=T.memo(function({matchId:e}){var u,h,p,c;const s=Z(),{match:n,key:r,routeId:i}=J({select:f=>{const d=f.matches.find(_=>_.id===e),m=d.routeId,y=s.routesById[m].options.remountDeps??s.options.defaultRemountDeps,g=y==null?void 0:y({routeId:m,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),o=s.routesById[i],a=T.useMemo(()=>{const f=o.options.component??s.options.defaultComponent;return f?I.jsx(f,{},r):I.jsx(ta,{})},[r,o.options.component,s.options.defaultComponent]);if(n._displayPending)throw(u=s.getMatch(n.id))==null?void 0:u._nonReactive.displayPendingPromise;if(n._forcePending)throw(h=s.getMatch(n.id))==null?void 0:h._nonReactive.minPendingPromise;if(n.status==="pending"){const f=o.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const d=s.getMatch(n.id);if(d&&!d._nonReactive.minPendingPromise&&!s.isServer){const m=xe();d._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw(p=s.getMatch(n.id))==null?void 0:p._nonReactive.loadPromise}if(n.status==="notFound")return Pt(rt(n.error)),Wr(s,o,n.error);if(n.status==="redirected")throw Pt(ut(n.error)),(c=s.getMatch(n.id))==null?void 0:c._nonReactive.loadPromise;if(n.status==="error"){if(s.isServer){const f=(o.options.errorComponent??s.options.defaultErrorComponent)||Ps;return I.jsx(f,{error:n.error,reset:void 0,info:{componentStack:""}})}throw n.error}return a}),ta=T.memo(function(){const e=Z(),s=T.useContext(_s),n=J({select:h=>{var p;return(p=h.matches.find(c=>c.id===s))==null?void 0:p.routeId}}),r=e.routesById[n],i=J({select:h=>{const c=h.matches.find(f=>f.id===s);return Pt(c),c.globalNotFound}}),o=J({select:h=>{var f;const p=h.matches,c=p.findIndex(d=>d.id===s);return(f=p[c+1])==null?void 0:f.id}}),a=e.options.defaultPendingComponent?I.jsx(e.options.defaultPendingComponent,{}):null;if(i)return Wr(e,r,void 0);if(!o)return null;const u=I.jsx(Gr,{matchId:o});return n===X?I.jsx(T.Suspense,{fallback:a,children:u}):u});function ea(){const t=Z(),s=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,n=s?I.jsx(s,{}):null,r=t.isServer||typeof document<"u"&&t.ssr?ce:T.Suspense,i=I.jsxs(r,{fallback:n,children:[!t.isServer&&I.jsx(Wo,{}),I.jsx(sa,{})]});return t.options.InnerWrap?I.jsx(t.options.InnerWrap,{children:i}):i}function sa(){const t=Z(),e=J({select:r=>{var i;return(i=r.matches[0])==null?void 0:i.id}}),s=J({select:r=>r.loadedAt}),n=e?I.jsx(Gr,{matchId:e}):null;return I.jsx(_s.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:I.jsx(Sn,{getResetKey:()=>s,errorComponent:Ps,onCatch:r=>{r.message||r.toString()},children:n})})}const Ba=t=>new na(t);class na extends go{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=sr,globalThis.createLazyFileRoute=ir):typeof window<"u"&&(window.createFileRoute=sr,window.createLazyFileRoute=ir);function ra({router:t,children:e,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const n=zr(),r=I.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?I.jsx(t.options.Wrap,{children:r}):r}function Ua({router:t,...e}){return I.jsx(ra,{router:t,...e,children:I.jsx(ea,{})})}var oe=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(){}},ia={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ct,fn,vr,oa=(vr=class{constructor(){E(this,Ct,ia);E(this,fn,!1)}setTimeoutProvider(t){x(this,Ct,t)}setTimeout(t,e){return l(this,Ct).setTimeout(t,e)}clearTimeout(t){l(this,Ct).clearTimeout(t)}setInterval(t,e){return l(this,Ct).setInterval(t,e)}clearInterval(t){l(this,Ct).clearInterval(t)}},Ct=new WeakMap,fn=new WeakMap,vr),$t=new oa;function aa(t){setTimeout(t,0)}var re=typeof window>"u"||"Deno"in globalThis;function K(){}function ca(t,e){return typeof t=="function"?t(e):t}function Hs(t){return typeof t=="number"&&t>=0&&t!==1/0}function Jr(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ut(t,e){return typeof t=="function"?t(e):t}function nt(t,e){return typeof t=="function"?t(e):t}function ar(t,e){const{type:s="all",exact:n,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==xn(o,e.options))return!1}else if(!Qe(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||i&&!i(e))}function cr(t,e){const{exact:s,status:n,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(s){if(ie(e.options.mutationKey)!==ie(i))return!1}else if(!Qe(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||r&&!r(e))}function xn(t,e){return((e==null?void 0:e.queryKeyHashFn)||ie)(t)}function ie(t){return JSON.stringify(t,(e,s)=>Vs(s)?Object.keys(s).sort().reduce((n,r)=>(n[r]=s[r],n),{}):s)}function Qe(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>Qe(t[s],e[s])):!1}var ua=Object.prototype.hasOwnProperty;function Cn(t,e){if(t===e)return t;const s=ur(t)&&ur(e);if(!s&&!(Vs(t)&&Vs(e)))return e;const r=(s?t:Object.keys(t)).length,i=s?e:Object.keys(e),o=i.length,a=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const p=s?h:i[h],c=t[p],f=e[p];if(c===f){a[p]=c,(s?h<r:ua.call(t,p))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){a[p]=f;continue}const d=Cn(c,f);a[p]=d,d===c&&u++}return r===o&&u===r?t:a}function $e(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 ur(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Vs(t){if(!lr(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!lr(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function lr(t){return Object.prototype.toString.call(t)==="[object Object]"}function la(t){return new Promise(e=>{$t.setTimeout(e,t)})}function Ws(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Cn(t,e):e}function ha(t,e,s=0){const n=[...t,e];return s&&n.length>s?n.slice(1):n}function da(t,e,s=0){const n=[e,...t];return s&&n.length>s?n.slice(0,-1):n}var Mn=Symbol();function Yr(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Mn?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Xr(t,e){return typeof t=="function"?t(...e):!!t}var qt,Mt,ue,Sr,fa=(Sr=class extends oe{constructor(){super();E(this,qt);E(this,Mt);E(this,ue);x(this,ue,e=>{if(!re&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){l(this,Mt)||this.setEventListener(l(this,ue))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Mt))==null||e.call(this),x(this,Mt,void 0))}setEventListener(e){var s;x(this,ue,e),(s=l(this,Mt))==null||s.call(this),x(this,Mt,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){l(this,qt)!==e&&(x(this,qt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof l(this,qt)=="boolean"?l(this,qt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qt=new WeakMap,Mt=new WeakMap,ue=new WeakMap,Sr),Ln=new fa;function Gs(){let t,e;const s=new Promise((r,i)=>{t=r,e=i});s.status="pending",s.catch(()=>{});function n(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{n({status:"fulfilled",value:r}),t(r)},s.reject=r=>{n({status:"rejected",reason:r}),e(r)},s}var pa=aa;function ma(){let t=[],e=0,s=a=>{a()},n=a=>{a()},r=pa;const i=a=>{e?t.push(a):r(()=>{s(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{n(()=>{a.forEach(u=>{s(u)})})})};return{batch:a=>{let u;e++;try{u=a()}finally{e--,e||o()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{r=a}}}var N=ma(),le,Lt,he,Rr,ya=(Rr=class extends oe{constructor(){super();E(this,le,!0);E(this,Lt);E(this,he);x(this,he,e=>{if(!re&&window.addEventListener){const s=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}})}onSubscribe(){l(this,Lt)||this.setEventListener(l(this,he))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Lt))==null||e.call(this),x(this,Lt,void 0))}setEventListener(e){var s;x(this,he,e),(s=l(this,Lt))==null||s.call(this),x(this,Lt,e(this.setOnline.bind(this)))}setOnline(e){l(this,le)!==e&&(x(this,le,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return l(this,le)}},le=new WeakMap,Lt=new WeakMap,he=new WeakMap,Rr),Ss=new ya;function ga(t){return Math.min(1e3*2**t,3e4)}function Zr(t){return(t??"online")==="online"?Ss.isOnline():!0}var Js=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ti(t){let e=!1,s=0,n;const r=Gs(),i=()=>r.status!=="pending",o=y=>{var g;if(!i()){const v=new Js(y);f(v),(g=t.onCancel)==null||g.call(t,v)}},a=()=>{e=!0},u=()=>{e=!1},h=()=>Ln.isFocused()&&(t.networkMode==="always"||Ss.isOnline())&&t.canRun(),p=()=>Zr(t.networkMode)&&t.canRun(),c=y=>{i()||(n==null||n(),r.resolve(y))},f=y=>{i()||(n==null||n(),r.reject(y))},d=()=>new Promise(y=>{var g;n=v=>{(i()||h())&&y(v)},(g=t.onPause)==null||g.call(t)}).then(()=>{var y;n=void 0,i()||(y=t.onContinue)==null||y.call(t)}),m=()=>{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(c).catch(v=>{var R;if(i())return;const _=t.retry??(re?0:3),w=t.retryDelay??ga,S=typeof w=="function"?w(s,v):w,C=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,v);if(e||!C){f(v);return}s++,(R=t.onFail)==null||R.call(t,s,v),la(S).then(()=>h()?void 0:d()).then(()=>{e?f(v):m()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(n==null||n(),r),cancelRetry:a,continueRetry:u,canStart:p,start:()=>(p()?m():d().then(m),r)}}var Kt,br,ei=(br=class{constructor(){E(this,Kt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hs(this.gcTime)&&x(this,Kt,$t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(re?1/0:300*1e3))}clearGcTimeout(){l(this,Kt)&&($t.clearTimeout(l(this,Kt)),x(this,Kt,void 0))}},Kt=new WeakMap,br),zt,de,et,Ht,Q,qe,Vt,at,gt,wr,va=(wr=class extends ei{constructor(e){super();E(this,at);E(this,zt);E(this,de);E(this,et);E(this,Ht);E(this,Q);E(this,qe);E(this,Vt);x(this,Vt,!1),x(this,qe,e.defaultOptions),this.setOptions(e.options),this.observers=[],x(this,Ht,e.client),x(this,et,l(this,Ht).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,x(this,zt,dr(this.options)),this.state=e.state??l(this,zt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=l(this,Q))==null?void 0:e.promise}setOptions(e){if(this.options={...l(this,qe),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=dr(this.options);s.data!==void 0&&(this.setState(hr(s.data,s.dataUpdatedAt)),x(this,zt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&l(this,et).remove(this)}setData(e,s){const n=Ws(this.state.data,e,this.options);return k(this,at,gt).call(this,{data:n,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),n}setState(e,s){k(this,at,gt).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var n,r;const s=(n=l(this,Q))==null?void 0:n.promise;return(r=l(this,Q))==null||r.cancel(e),s?s.then(K).catch(K):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(l(this,zt))}isActive(){return this.observers.some(e=>nt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ut(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Jr(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}onOnline(){var s;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),l(this,et).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(l(this,Q)&&(l(this,Vt)?l(this,Q).cancel({revert:!0}):l(this,Q).cancelRetry()),this.scheduleGc()),l(this,et).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||k(this,at,gt).call(this,{type:"invalidate"})}async fetch(e,s){var u,h,p,c,f,d,m,y,g,v,_,w;if(this.state.fetchStatus!=="idle"&&((u=l(this,Q))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(l(this,Q))return l(this,Q).continueRetry(),l(this,Q).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,r=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(x(this,Vt,!0),n.signal)})},i=()=>{const S=Yr(this.options,s),R=(()=>{const P={client:l(this,Ht),queryKey:this.queryKey,meta:this.meta};return r(P),P})();return x(this,Vt,!1),this.options.persister?this.options.persister(S,R,this):S(R)},a=(()=>{const S={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:l(this,Ht),state:this.state,fetchFn:i};return r(S),S})();(h=this.options.behavior)==null||h.onFetch(a,this),x(this,de,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&k(this,at,gt).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta}),x(this,Q,ti({initialPromise:s==null?void 0:s.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof Js&&S.revert&&this.setState({...l(this,de),fetchStatus:"idle"}),n.abort()},onFail:(S,C)=>{k(this,at,gt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{k(this,at,gt).call(this,{type:"pause"})},onContinue:()=>{k(this,at,gt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await l(this,Q).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(d=(f=l(this,et).config).onSuccess)==null||d.call(f,S,this),(y=(m=l(this,et).config).onSettled)==null||y.call(m,S,this.state.error,this),S}catch(S){if(S instanceof Js){if(S.silent)return l(this,Q).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw k(this,at,gt).call(this,{type:"error",error:S}),(v=(g=l(this,et).config).onError)==null||v.call(g,S,this),(w=(_=l(this,et).config).onSettled)==null||w.call(_,this.state.data,S,this),S}finally{this.scheduleGc()}}},zt=new WeakMap,de=new WeakMap,et=new WeakMap,Ht=new WeakMap,Q=new WeakMap,qe=new WeakMap,Vt=new WeakMap,at=new WeakSet,gt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...si(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...hr(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return x(this,de,e.manual?r:void 0),r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=s(this.state),N.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),l(this,et).notify({query:this,type:"updated",action:e})})},wr);function si(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function hr(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dr(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,n=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var W,F,Ke,z,Wt,fe,vt,Et,ze,pe,me,Gt,Jt,Tt,ye,D,Ae,Ys,Xs,Zs,tn,en,sn,nn,ni,Pr,En=(Pr=class extends oe{constructor(e,s){super();E(this,D);E(this,W);E(this,F);E(this,Ke);E(this,z);E(this,Wt);E(this,fe);E(this,vt);E(this,Et);E(this,ze);E(this,pe);E(this,me);E(this,Gt);E(this,Jt);E(this,Tt);E(this,ye,new Set);this.options=s,x(this,W,e),x(this,Et,null),x(this,vt,Gs()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(l(this,F).addObserver(this),fr(l(this,F),this.options)?k(this,D,Ae).call(this):this.updateResult(),k(this,D,tn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rn(l(this,F),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rn(l(this,F),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,k(this,D,en).call(this),k(this,D,sn).call(this),l(this,F).removeObserver(this)}setOptions(e){const s=this.options,n=l(this,F);if(this.options=l(this,W).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nt(this.options.enabled,l(this,F))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");k(this,D,nn).call(this),l(this,F).setOptions(this.options),s._defaulted&&!$e(this.options,s)&&l(this,W).getQueryCache().notify({type:"observerOptionsUpdated",query:l(this,F),observer:this});const r=this.hasListeners();r&&pr(l(this,F),n,this.options,s)&&k(this,D,Ae).call(this),this.updateResult(),r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||Ut(this.options.staleTime,l(this,F))!==Ut(s.staleTime,l(this,F)))&&k(this,D,Ys).call(this);const i=k(this,D,Xs).call(this);r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||i!==l(this,Tt))&&k(this,D,Zs).call(this,i)}getOptimisticResult(e){const s=l(this,W).getQueryCache().build(l(this,W),e),n=this.createResult(s,e);return Ra(this,n)&&(x(this,z,n),x(this,fe,this.options),x(this,Wt,l(this,F).state)),n}getCurrentResult(){return l(this,z)}trackResult(e,s){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),s==null||s(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&l(this,vt).status==="pending"&&l(this,vt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){l(this,ye).add(e)}getCurrentQuery(){return l(this,F)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=l(this,W).defaultQueryOptions(e),n=l(this,W).getQueryCache().build(l(this,W),s);return n.fetch().then(()=>this.createResult(n,s))}fetch(e){return k(this,D,Ae).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),l(this,z)))}createResult(e,s){var O;const n=l(this,F),r=this.options,i=l(this,z),o=l(this,Wt),a=l(this,fe),h=e!==n?e.state:l(this,Ke),{state:p}=e;let c={...p},f=!1,d;if(s._optimisticResults){const b=this.hasListeners(),L=!b&&fr(e,s),A=b&&pr(e,n,s,r);(L||A)&&(c={...c,...si(p.data,e.options)}),s._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=c;d=c.data;let v=!1;if(s.placeholderData!==void 0&&d===void 0&&g==="pending"){let b;i!=null&&i.isPlaceholderData&&s.placeholderData===(a==null?void 0:a.placeholderData)?(b=i.data,v=!0):b=typeof s.placeholderData=="function"?s.placeholderData((O=l(this,me))==null?void 0:O.state.data,l(this,me)):s.placeholderData,b!==void 0&&(g="success",d=Ws(i==null?void 0:i.data,b,s),f=!0)}if(s.select&&d!==void 0&&!v)if(i&&d===(o==null?void 0:o.data)&&s.select===l(this,ze))d=l(this,pe);else try{x(this,ze,s.select),d=s.select(d),d=Ws(i==null?void 0:i.data,d,s),x(this,pe,d),x(this,Et,null)}catch(b){x(this,Et,b)}l(this,Et)&&(m=l(this,Et),d=l(this,pe),y=Date.now(),g="error");const _=c.fetchStatus==="fetching",w=g==="pending",S=g==="error",C=w&&_,R=d!==void 0,M={status:g,fetchStatus:c.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:C,isLoading:C,data:d,dataUpdatedAt:c.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>h.dataUpdateCount||c.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:S&&!R,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&R,isStale:Tn(e,s),refetch:this.refetch,promise:l(this,vt),isEnabled:nt(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const b=B=>{M.status==="error"?B.reject(M.error):M.data!==void 0&&B.resolve(M.data)},L=()=>{const B=x(this,vt,M.promise=Gs());b(B)},A=l(this,vt);switch(A.status){case"pending":e.queryHash===n.queryHash&&b(A);break;case"fulfilled":(M.status==="error"||M.data!==A.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==A.reason)&&L();break}}return M}updateResult(){const e=l(this,z),s=this.createResult(l(this,F),this.options);if(x(this,Wt,l(this,F).state),x(this,fe,this.options),l(this,Wt).data!==void 0&&x(this,me,l(this,F)),$e(s,e))return;x(this,z,s);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!l(this,ye).size)return!0;const o=new Set(i??l(this,ye));return this.options.throwOnError&&o.add("error"),Object.keys(l(this,z)).some(a=>{const u=a;return l(this,z)[u]!==e[u]&&o.has(u)})};k(this,D,ni).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&k(this,D,tn).call(this)}},W=new WeakMap,F=new WeakMap,Ke=new WeakMap,z=new WeakMap,Wt=new WeakMap,fe=new WeakMap,vt=new WeakMap,Et=new WeakMap,ze=new WeakMap,pe=new WeakMap,me=new WeakMap,Gt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,ye=new WeakMap,D=new WeakSet,Ae=function(e){k(this,D,nn).call(this);let s=l(this,F).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(K)),s},Ys=function(){k(this,D,en).call(this);const e=Ut(this.options.staleTime,l(this,F));if(re||l(this,z).isStale||!Hs(e))return;const n=Jr(l(this,z).dataUpdatedAt,e)+1;x(this,Gt,$t.setTimeout(()=>{l(this,z).isStale||this.updateResult()},n))},Xs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(l(this,F)):this.options.refetchInterval)??!1},Zs=function(e){k(this,D,sn).call(this),x(this,Tt,e),!(re||nt(this.options.enabled,l(this,F))===!1||!Hs(l(this,Tt))||l(this,Tt)===0)&&x(this,Jt,$t.setInterval(()=>{(this.options.refetchIntervalInBackground||Ln.isFocused())&&k(this,D,Ae).call(this)},l(this,Tt)))},tn=function(){k(this,D,Ys).call(this),k(this,D,Zs).call(this,k(this,D,Xs).call(this))},en=function(){l(this,Gt)&&($t.clearTimeout(l(this,Gt)),x(this,Gt,void 0))},sn=function(){l(this,Jt)&&($t.clearInterval(l(this,Jt)),x(this,Jt,void 0))},nn=function(){const e=l(this,W).getQueryCache().build(l(this,W),this.options);if(e===l(this,F))return;const s=l(this,F);x(this,F,e),x(this,Ke,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},ni=function(e){N.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(l(this,z))}),l(this,W).getQueryCache().notify({query:l(this,F),type:"observerResultsUpdated"})})},Pr);function Sa(t,e){return nt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function fr(t,e){return Sa(t,e)||t.state.data!==void 0&&rn(t,e,e.refetchOnMount)}function rn(t,e,s){if(nt(e.enabled,t)!==!1&&Ut(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&Tn(t,e)}return!1}function pr(t,e,s,n){return(t!==e||nt(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Tn(t,s)}function Tn(t,e){return nt(e.enabled,t)!==!1&&t.isStaleByTime(Ut(e.staleTime,t))}function Ra(t,e){return!$e(t.getCurrentResult(),e)}function mr(t){return{onFetch:(e,s)=>{var p,c,f,d,m;const n=e.options,r=(f=(c=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((d=e.state.data)==null?void 0:d.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const h=async()=>{let y=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},v=Yr(e.options,e.fetchOptions),_=async(w,S,C)=>{if(y)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const L={client:e.client,queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};return g(L),L})(),M=await v(P),{maxPages:O}=e.options,b=C?da:ha;return{pages:b(w.pages,M,O),pageParams:b(w.pageParams,S,O)}};if(r&&i.length){const w=r==="backward",S=w?ba:yr,C={pages:i,pageParams:o},R=S(n,C);a=await _(C,R,w)}else{const w=t??i.length;do{const S=u===0?o[0]??n.initialPageParam:yr(n,a);if(u>0&&S==null)break;a=await _(a,S),u++}while(u<w)}return a};e.options.persister?e.fetchFn=()=>{var y,g;return(g=(y=e.options).persister)==null?void 0:g.call(y,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=h}}}function yr(t,{pages:e,pageParams:s}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,s[n],s):void 0}function ba(t,{pages:e,pageParams:s}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,s[0],s):void 0}var He,dt,H,Yt,ft,xt,_r,wa=(_r=class extends ei{constructor(e){super();E(this,ft);E(this,He);E(this,dt);E(this,H);E(this,Yt);x(this,He,e.client),this.mutationId=e.mutationId,x(this,H,e.mutationCache),x(this,dt,[]),this.state=e.state||ri(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){l(this,dt).includes(e)||(l(this,dt).push(e),this.clearGcTimeout(),l(this,H).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){x(this,dt,l(this,dt).filter(s=>s!==e)),this.scheduleGc(),l(this,H).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){l(this,dt).length||(this.state.status==="pending"?this.scheduleGc():l(this,H).remove(this))}continue(){var e;return((e=l(this,Yt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,u,h,p,c,f,d,m,y,g,v,_,w,S,C,R,P,M,O;const s=()=>{k(this,ft,xt).call(this,{type:"continue"})},n={client:l(this,He),meta:this.options.meta,mutationKey:this.options.mutationKey};x(this,Yt,ti({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(b,L)=>{k(this,ft,xt).call(this,{type:"failed",failureCount:b,error:L})},onPause:()=>{k(this,ft,xt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>l(this,H).canRun(this)}));const r=this.state.status==="pending",i=!l(this,Yt).canStart();try{if(r)s();else{k(this,ft,xt).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=l(this,H).config).onMutate)==null?void 0:a.call(o,e,this,n));const L=await((h=(u=this.options).onMutate)==null?void 0:h.call(u,e,n));L!==this.state.context&&k(this,ft,xt).call(this,{type:"pending",context:L,variables:e,isPaused:i})}const b=await l(this,Yt).start();return await((c=(p=l(this,H).config).onSuccess)==null?void 0:c.call(p,b,e,this.state.context,this,n)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,b,e,this.state.context,n)),await((y=(m=l(this,H).config).onSettled)==null?void 0:y.call(m,b,null,this.state.variables,this.state.context,this,n)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,b,null,e,this.state.context,n)),k(this,ft,xt).call(this,{type:"success",data:b}),b}catch(b){try{throw await((w=(_=l(this,H).config).onError)==null?void 0:w.call(_,b,e,this.state.context,this,n)),await((C=(S=this.options).onError)==null?void 0:C.call(S,b,e,this.state.context,n)),await((P=(R=l(this,H).config).onSettled)==null?void 0:P.call(R,void 0,b,this.state.variables,this.state.context,this,n)),await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,b,e,this.state.context,n)),b}finally{k(this,ft,xt).call(this,{type:"error",error:b})}}finally{l(this,H).runNext(this)}}},He=new WeakMap,dt=new WeakMap,H=new WeakMap,Yt=new WeakMap,ft=new WeakSet,xt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),N.batch(()=>{l(this,dt).forEach(n=>{n.onMutationUpdate(e)}),l(this,H).notify({mutation:this,type:"updated",action:e})})},_r);function ri(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var St,ct,Ve,xr,Pa=(xr=class extends oe{constructor(e={}){super();E(this,St);E(this,ct);E(this,Ve);this.config=e,x(this,St,new Set),x(this,ct,new Map),x(this,Ve,0)}build(e,s,n){const r=new wa({client:e,mutationCache:this,mutationId:++ts(this,Ve)._,options:e.defaultMutationOptions(s),state:n});return this.add(r),r}add(e){l(this,St).add(e);const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);n?n.push(e):l(this,ct).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(l(this,St).delete(e)){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&l(this,ct).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s),r=n==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){var n;const s=is(e);if(typeof s=="string"){const r=(n=l(this,ct).get(s))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){N.batch(()=>{l(this,St).forEach(e=>{this.notify({type:"removed",mutation:e})}),l(this,St).clear(),l(this,ct).clear()})}getAll(){return Array.from(l(this,St))}find(e){const s={exact:!0,...e};return this.getAll().find(n=>cr(s,n))}findAll(e={}){return this.getAll().filter(s=>cr(e,s))}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return N.batch(()=>Promise.all(e.map(s=>s.continue().catch(K))))}},St=new WeakMap,ct=new WeakMap,Ve=new WeakMap,xr);function is(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Rt,It,G,bt,wt,us,on,Cr,_a=(Cr=class extends oe{constructor(e,s){super();E(this,wt);E(this,Rt);E(this,It);E(this,G);E(this,bt);x(this,Rt,e),this.setOptions(s),this.bindMethods(),k(this,wt,us).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var n;const s=this.options;this.options=l(this,Rt).defaultMutationOptions(e),$e(this.options,s)||l(this,Rt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:l(this,G),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&ie(s.mutationKey)!==ie(this.options.mutationKey)?this.reset():((n=l(this,G))==null?void 0:n.state.status)==="pending"&&l(this,G).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=l(this,G))==null||e.removeObserver(this)}onMutationUpdate(e){k(this,wt,us).call(this),k(this,wt,on).call(this,e)}getCurrentResult(){return l(this,It)}reset(){var e;(e=l(this,G))==null||e.removeObserver(this),x(this,G,void 0),k(this,wt,us).call(this),k(this,wt,on).call(this)}mutate(e,s){var n;return x(this,bt,s),(n=l(this,G))==null||n.removeObserver(this),x(this,G,l(this,Rt).getMutationCache().build(l(this,Rt),this.options)),l(this,G).addObserver(this),l(this,G).execute(e)}},Rt=new WeakMap,It=new WeakMap,G=new WeakMap,bt=new WeakMap,wt=new WeakSet,us=function(){var s;const e=((s=l(this,G))==null?void 0:s.state)??ri();x(this,It,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},on=function(e){N.batch(()=>{var s,n,r,i,o,a,u,h;if(l(this,bt)&&this.hasListeners()){const p=l(this,It).variables,c=l(this,It).context,f={client:l(this,Rt),meta:this.options.meta,mutationKey:this.options.mutationKey};(e==null?void 0:e.type)==="success"?((n=(s=l(this,bt)).onSuccess)==null||n.call(s,e.data,p,c,f),(i=(r=l(this,bt)).onSettled)==null||i.call(r,e.data,null,p,c,f)):(e==null?void 0:e.type)==="error"&&((a=(o=l(this,bt)).onError)==null||a.call(o,e.error,p,c,f),(h=(u=l(this,bt)).onSettled)==null||h.call(u,void 0,e.error,p,c,f))}this.listeners.forEach(p=>{p(l(this,It))})})},Cr);function gr(t,e){const s=new Set(e);return t.filter(n=>!s.has(n))}function xa(t,e,s){const n=t.slice(0);return n[e]=s,n}var ge,Y,ve,Se,st,Ot,We,Ge,Je,q,an,cn,un,ln,hn,Mr,Ca=(Mr=class extends oe{constructor(e,s,n){super();E(this,q);E(this,ge);E(this,Y);E(this,ve);E(this,Se);E(this,st);E(this,Ot);E(this,We);E(this,Ge);E(this,Je,[]);x(this,ge,e),x(this,Se,n),x(this,ve,[]),x(this,st,[]),x(this,Y,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&l(this,st).forEach(e=>{e.subscribe(s=>{k(this,q,ln).call(this,e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,st).forEach(e=>{e.destroy()})}setQueries(e,s){x(this,ve,e),x(this,Se,s),N.batch(()=>{const n=l(this,st),r=k(this,q,un).call(this,l(this,ve));x(this,Je,r),r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),a=n.length!==i.length,u=i.some((c,f)=>c!==n[f]),h=a||u,p=h?!0:o.some((c,f)=>{const d=l(this,Y)[f];return!d||!$e(c,d)});!h&&!p||(h&&x(this,st,i),x(this,Y,o),this.hasListeners()&&(h&&(gr(n,i).forEach(c=>{c.destroy()}),gr(i,n).forEach(c=>{c.subscribe(f=>{k(this,q,ln).call(this,c,f)})})),k(this,q,hn).call(this)))})}getCurrentResult(){return l(this,Y)}getQueries(){return l(this,st).map(e=>e.getCurrentQuery())}getObservers(){return l(this,st)}getOptimisticResult(e,s){const n=k(this,q,un).call(this,e),r=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[r,i=>k(this,q,cn).call(this,i??r,s),()=>k(this,q,an).call(this,r,n)]}},ge=new WeakMap,Y=new WeakMap,ve=new WeakMap,Se=new WeakMap,st=new WeakMap,Ot=new WeakMap,We=new WeakMap,Ge=new WeakMap,Je=new WeakMap,q=new WeakSet,an=function(e,s){return s.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,o=>{s.forEach(a=>{a.observer.trackProp(o)})})})},cn=function(e,s){return s?((!l(this,Ot)||l(this,Y)!==l(this,Ge)||s!==l(this,We))&&(x(this,We,s),x(this,Ge,l(this,Y)),x(this,Ot,Cn(l(this,Ot),s(e)))),l(this,Ot)):e},un=function(e){const s=new Map(l(this,st).map(r=>[r.options.queryHash,r])),n=[];return e.forEach(r=>{const i=l(this,ge).defaultQueryOptions(r),o=s.get(i.queryHash);o?n.push({defaultedQueryOptions:i,observer:o}):n.push({defaultedQueryOptions:i,observer:new En(l(this,ge),i)})}),n},ln=function(e,s){const n=l(this,st).indexOf(e);n!==-1&&(x(this,Y,xa(l(this,Y),n,s)),k(this,q,hn).call(this))},hn=function(){var e;if(this.hasListeners()){const s=l(this,Ot),n=k(this,q,an).call(this,l(this,Y),l(this,Je)),r=k(this,q,cn).call(this,n,(e=l(this,Se))==null?void 0:e.combine);s!==r&&N.batch(()=>{this.listeners.forEach(i=>{i(l(this,Y))})})}},Mr),pt,Lr,Ma=(Lr=class extends oe{constructor(e={}){super();E(this,pt);this.config=e,x(this,pt,new Map)}build(e,s,n){const r=s.queryKey,i=s.queryHash??xn(r,s);let o=this.get(i);return o||(o=new va({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(s),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){l(this,pt).has(e.queryHash)||(l(this,pt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=l(this,pt).get(e.queryHash);s&&(e.destroy(),s===e&&l(this,pt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){N.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return l(this,pt).get(e)}getAll(){return[...l(this,pt).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(n=>ar(s,n))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(n=>ar(e,n)):s}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){N.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){N.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pt=new WeakMap,Lr),U,kt,Ft,Re,be,At,we,Pe,Er,Na=(Er=class{constructor(t={}){E(this,U);E(this,kt);E(this,Ft);E(this,Re);E(this,be);E(this,At);E(this,we);E(this,Pe);x(this,U,t.queryCache||new Ma),x(this,kt,t.mutationCache||new Pa),x(this,Ft,t.defaultOptions||{}),x(this,Re,new Map),x(this,be,new Map),x(this,At,0)}mount(){ts(this,At)._++,l(this,At)===1&&(x(this,we,Ln.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onFocus())})),x(this,Pe,Ss.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onOnline())})))}unmount(){var t,e;ts(this,At)._--,l(this,At)===0&&((t=l(this,we))==null||t.call(this),x(this,we,void 0),(e=l(this,Pe))==null||e.call(this),x(this,Pe,void 0))}isFetching(t){return l(this,U).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return l(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=l(this,U).build(this,e),n=s.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Ut(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return l(this,U).findAll(t).map(({queryKey:e,state:s})=>{const n=s.data;return[e,n]})}setQueryData(t,e,s){const n=this.defaultQueryOptions({queryKey:t}),r=l(this,U).get(n.queryHash),i=r==null?void 0:r.state.data,o=ca(e,i);if(o!==void 0)return l(this,U).build(this,n).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return N.batch(()=>l(this,U).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=l(this,U);N.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=l(this,U);return N.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},n=N.batch(()=>l(this,U).findAll(t).map(r=>r.cancel(s)));return Promise.all(n).then(K).catch(K)}invalidateQueries(t,e={}){return N.batch(()=>(l(this,U).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},n=N.batch(()=>l(this,U).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,s);return s.throwOnError||(i=i.catch(K)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(K)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=l(this,U).build(this,e);return s.isStaleByTime(Ut(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(K).catch(K)}fetchInfiniteQuery(t){return t.behavior=mr(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(K).catch(K)}ensureInfiniteQueryData(t){return t.behavior=mr(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ss.isOnline()?l(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return l(this,U)}getMutationCache(){return l(this,kt)}getDefaultOptions(){return l(this,Ft)}setDefaultOptions(t){x(this,Ft,t)}setQueryDefaults(t,e){l(this,Re).set(ie(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...l(this,Re).values()],s={};return e.forEach(n=>{Qe(t,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(t,e){l(this,be).set(ie(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...l(this,be).values()],s={};return e.forEach(n=>{Qe(t,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...l(this,Ft).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=xn(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===Mn&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...l(this,Ft).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){l(this,U).clear(),l(this,kt).clear()}},U=new WeakMap,kt=new WeakMap,Ft=new WeakMap,Re=new WeakMap,be=new WeakMap,At=new WeakMap,we=new WeakMap,Pe=new WeakMap,Er),ii=T.createContext(void 0),In=t=>{const e=T.useContext(ii);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Qa=({client:t,children:e})=>(T.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(ii.Provider,{value:t,children:e})),oi=T.createContext(!1),ai=()=>T.useContext(oi);oi.Provider;function La(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ea=T.createContext(La()),ci=()=>T.useContext(Ea),ui=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},li=t=>{T.useEffect(()=>{t.clearReset()},[t])},hi=({result:t,errorResetBoundary:e,throwOnError:s,query:n,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(r&&t.data===void 0||Xr(s,[t.error,n])),di=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>s(n(...r)):s(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fi=(t,e)=>t.isLoading&&t.isFetching&&!e,dn=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Rs=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function $a({queries:t,...e},s){const n=In(),r=ai(),i=ci(),o=T.useMemo(()=>t.map(y=>{const g=n.defaultQueryOptions(y);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[t,n,r]);o.forEach(y=>{di(y),ui(y,i)}),li(i);const[a]=T.useState(()=>new Ca(n,o,e)),[u,h,p]=a.getOptimisticResult(o,e.combine),c=!r&&e.subscribed!==!1;T.useSyncExternalStore(T.useCallback(y=>c?a.subscribe(N.batchCalls(y)):K,[a,c]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),T.useEffect(()=>{a.setQueries(o,e)},[o,e,a]);const d=u.some((y,g)=>dn(o[g],y))?u.flatMap((y,g)=>{const v=o[g];if(v){const _=new En(n,v);if(dn(v,y))return Rs(v,_,i);fi(y,r)&&Rs(v,_,i)}return[]}):[];if(d.length>0)throw Promise.all(d);const m=u.find((y,g)=>{const v=o[g];return v&&hi({result:y,errorResetBoundary:i,throwOnError:v.throwOnError,query:n.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(m!=null&&m.error)throw m.error;return h(p())}function Ta(t,e,s){var c,f,d,m,y;const n=ai(),r=ci(),i=In(),o=i.defaultQueryOptions(t);(f=(c=i.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||f.call(c,o),o._optimisticResults=n?"isRestoring":"optimistic",di(o),ui(o,r),li(r);const a=!i.getQueryCache().get(o.queryHash),[u]=T.useState(()=>new e(i,o)),h=u.getOptimisticResult(o),p=!n&&t.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(g=>{const v=p?u.subscribe(N.batchCalls(g)):K;return u.updateResult(),v},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),T.useEffect(()=>{u.setOptions(o)},[o,u]),dn(o,h))throw Rs(o,u,r);if(hi({result:h,errorResetBoundary:r,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw h.error;if((m=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||m.call(d,o,h),o.experimental_prefetchInRender&&!re&&fi(h,n)){const g=a?Rs(o,u,r):(y=i.getQueryCache().get(o.queryHash))==null?void 0:y.promise;g==null||g.catch(K).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?h:u.trackResult(h)}function qa(t,e){return Ta(t,En)}function Ka(t,e){const s=In(),[n]=T.useState(()=>new _a(s,t));T.useEffect(()=>{n.setOptions(t)},[n,t]);const r=T.useSyncExternalStore(T.useCallback(o=>n.subscribe(N.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=T.useCallback((o,a)=>{n.mutate(o,a).catch(K)},[n]);if(r.error&&Xr(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}export{Vr as L,ta as O,Na as Q,_e as R,Qa as a,qa as b,Ka as c,_n as d,Hr as e,Aa as f,Da as g,$a as h,wn as i,I as j,ja as k,Ho as l,Ba as m,Ua as n,T as r,In as u};