blokctl 0.2.11 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create/project.js +63 -3
- package/dist/commands/create/utils/Examples.d.ts +3 -3
- package/dist/commands/create/utils/Examples.js +109 -13
- package/dist/commands/dev/index.js +50 -13
- package/dist/commands/generate/validators/WorkflowValidator.js +1 -1
- package/dist/commands/migrate/index.js +22 -0
- package/dist/commands/migrate/paths.d.ts +2 -0
- package/dist/commands/migrate/paths.js +267 -0
- package/dist/commands/migrate/workflows.d.ts +3 -0
- package/dist/commands/migrate/workflows.js +333 -0
- package/dist/commands/trace/index.js +6 -2
- package/dist/commands/trace/startStudio.d.ts +2 -0
- package/dist/commands/trace/startStudio.js +76 -11
- package/dist/index.js +1 -0
- package/dist/services/health-probe.d.ts +5 -0
- package/dist/services/health-probe.js +35 -0
- package/dist/services/runtime-detector.d.ts +3 -0
- package/dist/services/runtime-detector.js +21 -2
- package/dist/services/runtime-setup.d.ts +3 -0
- package/dist/services/runtime-setup.js +11 -2
- package/dist/studio-dist/assets/charts-Dh48HebV.js +68 -0
- package/dist/studio-dist/assets/graph-DWteCadQ.js +7 -0
- package/dist/studio-dist/assets/{icons-zP8LLgPh.js → icons-N5J4OhGx.js} +66 -51
- package/dist/studio-dist/assets/index-D6hOoOID.css +1 -0
- package/dist/studio-dist/assets/index-D_CdNmTc.js +42 -0
- package/dist/studio-dist/assets/react-vendor-l0sNRNKZ.js +1 -0
- package/dist/studio-dist/assets/tanstack-query-Day3Mt-4.js +17 -0
- package/dist/studio-dist/assets/tanstack-router-BB95iErN.js +25 -0
- package/dist/studio-dist/assets/{tanstack-table-DhwRvuH2.js → tanstack-table-Biem1hxK.js} +1 -1
- package/dist/studio-dist/favicon.svg +7 -4
- package/dist/studio-dist/index.html +19 -10
- package/package.json +15 -12
- package/dist/studio-dist/assets/charts-Dso0hPUR.js +0 -68
- package/dist/studio-dist/assets/graph-CsV2nWGn.js +0 -23
- package/dist/studio-dist/assets/index-CLyEkXMx.css +0 -1
- package/dist/studio-dist/assets/index-CNXFX_ar.js +0 -27
- package/dist/studio-dist/assets/react-vendor--Eh9ivFN.js +0 -17
- package/dist/studio-dist/assets/tanstack-query-CiM1U6F5.js +0 -1
- package/dist/studio-dist/assets/tanstack-router-Btjy0MKq.js +0 -25
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var Ue=e=>{throw TypeError(e)};var de=(e,t,s)=>t.has(e)||Ue("Cannot "+s);var i=(e,t,s)=>(de(e,t,"read from private field"),s?s.call(e):t.get(e)),f=(e,t,s)=>t.has(e)?Ue("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),c=(e,t,s,r)=>(de(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),b=(e,t,s)=>(de(e,t,"access private method"),s);var ue=(e,t,s,r)=>({set _(a){c(e,t,a,s)},get _(){return i(e,t,r)}});var fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Os(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pe={exports:{}},Xt={};/**
|
|
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 qe;function Ps(){if(qe)return Xt;qe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var h in a)h!=="key"&&(o[h]=a[h])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Xt.Fragment=t,Xt.jsx=s,Xt.jsxs=s,Xt}var ke;function Ts(){return ke||(ke=1,pe.exports=Ps()),pe.exports}var _s=Ts(),Zt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ms={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pt,Ae,Xe,As=(Xe=class{constructor(){f(this,pt,Ms);f(this,Ae,!1)}setTimeoutProvider(e){c(this,pt,e)}setTimeout(e,t){return i(this,pt).setTimeout(e,t)}clearTimeout(e){i(this,pt).clearTimeout(e)}setInterval(e,t){return i(this,pt).setInterval(e,t)}clearInterval(e){i(this,pt).clearInterval(e)}},pt=new WeakMap,Ae=new WeakMap,Xe),St=new As;function Fs(e){setTimeout(e,0)}var Qt=typeof window>"u"||"Deno"in globalThis;function B(){}function xs(e,t){return typeof e=="function"?e(t):e}function ve(e){return typeof e=="number"&&e>=0&&e!==1/0}function hs(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wt(e,t){return typeof e=="function"?e(t):e}function X(e,t){return typeof e=="function"?e(t):e}function He(e,t){const{type:s="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:h}=e;if(l){if(r){if(t.queryHash!==Fe(l,t.options))return!1}else if(!ee(t.queryKey,l))return!1}if(s!=="all"){const E=t.isActive();if(s==="active"&&!E||s==="inactive"&&E)return!1}return!(typeof h=="boolean"&&t.isStale()!==h||a&&a!==t.state.fetchStatus||o&&!o(t))}function Le(e,t){const{exact:s,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(s){if(jt(t.options.mutationKey)!==jt(o))return!1}else if(!ee(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Fe(e,t){return((t==null?void 0:t.queryKeyHashFn)||jt)(e)}function jt(e){return JSON.stringify(e,(t,s)=>me(s)?Object.keys(s).sort().reduce((r,a)=>(r[a]=s[a],r),{}):s)}function ee(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>ee(e[s],t[s])):!1}var Is=Object.prototype.hasOwnProperty;function ls(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=Ne(e)&&Ne(t);if(!r&&!(me(e)&&me(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),h=l.length,E=r?new Array(h):{};let C=0;for(let R=0;R<h;R++){const y=r?R:l[R],w=e[y],p=t[y];if(w===p){E[y]=w,(r?R<o:Is.call(e,y))&&C++;continue}if(w===null||p===null||typeof w!="object"||typeof p!="object"){E[y]=p;continue}const Q=ls(w,p,s+1);E[y]=Q,Q===w&&C++}return o===h&&C===o?e:E}function le(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function me(e){if(!Ke(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Ke(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ke(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qs(e){return new Promise(t=>{St.setTimeout(t,e)})}function ge(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?ls(e,t):t}function js(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Ds(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var xe=Symbol();function fs(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ie(e,t){return typeof e=="function"?e(...t):!!e}function Us(e,t,s){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?s():a.addEventListener("abort",s,{once:!0})),a)}),e}var Ot,yt,kt,ts,qs=(ts=class extends Zt{constructor(){super();f(this,Ot);f(this,yt);f(this,kt);c(this,kt,t=>{if(!Qt&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,yt)||this.setEventListener(i(this,kt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,yt))==null||t.call(this),c(this,yt,void 0))}setEventListener(t){var s;c(this,kt,t),(s=i(this,yt))==null||s.call(this),c(this,yt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){i(this,Ot)!==t&&(c(this,Ot,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof i(this,Ot)=="boolean"?i(this,Ot):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ot=new WeakMap,yt=new WeakMap,kt=new WeakMap,ts),Qe=new qs;function be(){let e,t;const s=new Promise((a,o)=>{e=a,t=o});s.status="pending",s.catch(()=>{});function r(a){Object.assign(s,a),delete s.resolve,delete s.reject}return s.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},s.reject=a=>{r({status:"rejected",reason:a}),t(a)},s}var ks=Fs;function Hs(){let e=[],t=0,s=h=>{h()},r=h=>{h()},a=ks;const o=h=>{t?e.push(h):a(()=>{s(h)})},l=()=>{const h=e;e=[],h.length&&a(()=>{r(()=>{h.forEach(E=>{s(E)})})})};return{batch:h=>{let E;t++;try{E=h()}finally{t--,t||l()}return E},batchCalls:h=>(...E)=>{o(()=>{h(...E)})},schedule:o,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{a=h}}}var H=Hs(),Ht,vt,Lt,es,Ls=(es=class extends Zt{constructor(){super();f(this,Ht,!0);f(this,vt);f(this,Lt);c(this,Lt,t=>{if(!Qt&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,vt)||this.setEventListener(i(this,Lt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,vt))==null||t.call(this),c(this,vt,void 0))}setEventListener(t){var s;c(this,Lt,t),(s=i(this,vt))==null||s.call(this),c(this,vt,t(this.setOnline.bind(this)))}setOnline(t){i(this,Ht)!==t&&(c(this,Ht,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return i(this,Ht)}},Ht=new WeakMap,vt=new WeakMap,Lt=new WeakMap,es),fe=new Ls;function Ns(e){return Math.min(1e3*2**e,3e4)}function ds(e){return(e??"online")==="online"?fe.isOnline():!0}var Ee=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ps(e){let t=!1,s=0,r;const a=be(),o=()=>a.status!=="pending",l=S=>{var O;if(!o()){const _=new Ee(S);w(_),(O=e.onCancel)==null||O.call(e,_)}},h=()=>{t=!0},E=()=>{t=!1},C=()=>Qe.isFocused()&&(e.networkMode==="always"||fe.isOnline())&&e.canRun(),R=()=>ds(e.networkMode)&&e.canRun(),y=S=>{o()||(r==null||r(),a.resolve(S))},w=S=>{o()||(r==null||r(),a.reject(S))},p=()=>new Promise(S=>{var O;r=_=>{(o()||C())&&S(_)},(O=e.onPause)==null||O.call(e)}).then(()=>{var S;r=void 0,o()||(S=e.onContinue)==null||S.call(e)}),Q=()=>{if(o())return;let S;const O=s===0?e.initialPromise:void 0;try{S=O??e.fn()}catch(_){S=Promise.reject(_)}Promise.resolve(S).then(y).catch(_=>{var L;if(o())return;const q=e.retry??(Qt?0:3),F=e.retryDelay??Ns,d=typeof F=="function"?F(s,_):F,k=q===!0||typeof q=="number"&&s<q||typeof q=="function"&&q(s,_);if(t||!k){w(_);return}s++,(L=e.onFail)==null||L.call(e,s,_),Qs(d).then(()=>C()?void 0:p()).then(()=>{t?w(_):Q()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:h,continueRetry:E,canStart:R,start:()=>(R()?Q():p().then(Q),a)}}var Pt,ss,ys=(ss=class{constructor(){f(this,Pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ve(this.gcTime)&&c(this,Pt,St.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qt?1/0:300*1e3))}clearGcTimeout(){i(this,Pt)&&(St.clearTimeout(i(this,Pt)),c(this,Pt,void 0))}},Pt=new WeakMap,ss),Tt,Nt,V,_t,N,se,Mt,tt,at,rs,Ks=(rs=class extends ys{constructor(t){super();f(this,tt);f(this,Tt);f(this,Nt);f(this,V);f(this,_t);f(this,N);f(this,se);f(this,Mt);c(this,Mt,!1),c(this,se,t.defaultOptions),this.setOptions(t.options),this.observers=[],c(this,_t,t.client),c(this,V,i(this,_t).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,c(this,Tt,Ge(this.options)),this.state=t.state??i(this,Tt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=i(this,N))==null?void 0:t.promise}setOptions(t){if(this.options={...i(this,se),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Ge(this.options);s.data!==void 0&&(this.setState($e(s.data,s.dataUpdatedAt)),c(this,Tt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,V).remove(this)}setData(t,s){const r=ge(this.state.data,t,this.options);return b(this,tt,at).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t,s){b(this,tt,at).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var r,a;const s=(r=i(this,N))==null?void 0:r.promise;return(a=i(this,N))==null||a.cancel(t),s?s.then(B).catch(B):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(i(this,Tt))}isActive(){return this.observers.some(t=>X(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hs(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,N))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,N))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),i(this,V).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(i(this,N)&&(i(this,Mt)?i(this,N).cancel({revert:!0}):i(this,N).cancelRetry()),this.scheduleGc()),i(this,V).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||b(this,tt,at).call(this,{type:"invalidate"})}async fetch(t,s){var E,C,R,y,w,p,Q,S,O,_,q,F;if(this.state.fetchStatus!=="idle"&&((E=i(this,N))==null?void 0:E.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(i(this,N))return i(this,N).continueRetry(),i(this,N).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(k=>k.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,a=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(c(this,Mt,!0),r.signal)})},o=()=>{const d=fs(this.options,s),L=(()=>{const T={client:i(this,_t),queryKey:this.queryKey,meta:this.meta};return a(T),T})();return c(this,Mt,!1),this.options.persister?this.options.persister(d,L,this):d(L)},h=(()=>{const d={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:i(this,_t),state:this.state,fetchFn:o};return a(d),d})();(C=this.options.behavior)==null||C.onFetch(h,this),c(this,Nt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((R=h.fetchOptions)==null?void 0:R.meta))&&b(this,tt,at).call(this,{type:"fetch",meta:(y=h.fetchOptions)==null?void 0:y.meta}),c(this,N,ps({initialPromise:s==null?void 0:s.initialPromise,fn:h.fetchFn,onCancel:d=>{d instanceof Ee&&d.revert&&this.setState({...i(this,Nt),fetchStatus:"idle"}),r.abort()},onFail:(d,k)=>{b(this,tt,at).call(this,{type:"failed",failureCount:d,error:k})},onPause:()=>{b(this,tt,at).call(this,{type:"pause"})},onContinue:()=>{b(this,tt,at).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const d=await i(this,N).start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),(p=(w=i(this,V).config).onSuccess)==null||p.call(w,d,this),(S=(Q=i(this,V).config).onSettled)==null||S.call(Q,d,this.state.error,this),d}catch(d){if(d instanceof Ee){if(d.silent)return i(this,N).promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw b(this,tt,at).call(this,{type:"error",error:d}),(_=(O=i(this,V).config).onError)==null||_.call(O,d,this),(F=(q=i(this,V).config).onSettled)==null||F.call(q,this.state.data,d,this),d}finally{this.scheduleGc()}}},Tt=new WeakMap,Nt=new WeakMap,V=new WeakMap,_t=new WeakMap,N=new WeakMap,se=new WeakMap,Mt=new WeakMap,tt=new WeakSet,at=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...vs(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...$e(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return c(this,Nt,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),H.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,V).notify({query:this,type:"updated",action:t})})},rs);function vs(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ds(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $e(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ge(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var J,P,re,Y,At,Kt,ot,mt,ie,$t,Gt,Ft,xt,gt,Yt,A,te,Re,Ce,we,Se,Oe,Pe,Te,ms,is,$s=(is=class extends Zt{constructor(t,s){super();f(this,A);f(this,J);f(this,P);f(this,re);f(this,Y);f(this,At);f(this,Kt);f(this,ot);f(this,mt);f(this,ie);f(this,$t);f(this,Gt);f(this,Ft);f(this,xt);f(this,gt);f(this,Yt,new Set);this.options=s,c(this,J,t),c(this,mt,null),c(this,ot,be()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,P).addObserver(this),Ye(i(this,P),this.options)?b(this,A,te).call(this):this.updateResult(),b(this,A,Se).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _e(i(this,P),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _e(i(this,P),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,b(this,A,Oe).call(this),b(this,A,Pe).call(this),i(this,P).removeObserver(this)}setOptions(t){const s=this.options,r=i(this,P);if(this.options=i(this,J).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof X(this.options.enabled,i(this,P))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");b(this,A,Te).call(this),i(this,P).setOptions(this.options),s._defaulted&&!le(this.options,s)&&i(this,J).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,P),observer:this});const a=this.hasListeners();a&&Be(i(this,P),r,this.options,s)&&b(this,A,te).call(this),this.updateResult(),a&&(i(this,P)!==r||X(this.options.enabled,i(this,P))!==X(s.enabled,i(this,P))||wt(this.options.staleTime,i(this,P))!==wt(s.staleTime,i(this,P)))&&b(this,A,Re).call(this);const o=b(this,A,Ce).call(this);a&&(i(this,P)!==r||X(this.options.enabled,i(this,P))!==X(s.enabled,i(this,P))||o!==i(this,gt))&&b(this,A,we).call(this,o)}getOptimisticResult(t){const s=i(this,J).getQueryCache().build(i(this,J),t),r=this.createResult(s,t);return Ys(this,r)&&(c(this,Y,r),c(this,Kt,this.options),c(this,At,i(this,P).state)),r}getCurrentResult(){return i(this,Y)}trackResult(t,s){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),s==null||s(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,ot).status==="pending"&&i(this,ot).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){i(this,Yt).add(t)}getCurrentQuery(){return i(this,P)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,J).defaultQueryOptions(t),r=i(this,J).getQueryCache().build(i(this,J),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return b(this,A,te).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,Y)))}createResult(t,s){var D;const r=i(this,P),a=this.options,o=i(this,Y),l=i(this,At),h=i(this,Kt),C=t!==r?t.state:i(this,re),{state:R}=t;let y={...R},w=!1,p;if(s._optimisticResults){const $=this.hasListeners(),Z=!$&&Ye(t,s),Dt=$&&Be(t,r,s,a);(Z||Dt)&&(y={...y,...vs(R.data,t.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:Q,errorUpdatedAt:S,status:O}=y;p=y.data;let _=!1;if(s.placeholderData!==void 0&&p===void 0&&O==="pending"){let $;o!=null&&o.isPlaceholderData&&s.placeholderData===(h==null?void 0:h.placeholderData)?($=o.data,_=!0):$=typeof s.placeholderData=="function"?s.placeholderData((D=i(this,Gt))==null?void 0:D.state.data,i(this,Gt)):s.placeholderData,$!==void 0&&(O="success",p=ge(o==null?void 0:o.data,$,s),w=!0)}if(s.select&&p!==void 0&&!_)if(o&&p===(l==null?void 0:l.data)&&s.select===i(this,ie))p=i(this,$t);else try{c(this,ie,s.select),p=s.select(p),p=ge(o==null?void 0:o.data,p,s),c(this,$t,p),c(this,mt,null)}catch($){c(this,mt,$)}i(this,mt)&&(Q=i(this,mt),p=i(this,$t),S=Date.now(),O="error");const q=y.fetchStatus==="fetching",F=O==="pending",d=O==="error",k=F&&q,L=p!==void 0,x={status:O,fetchStatus:y.fetchStatus,isPending:F,isSuccess:O==="success",isError:d,isInitialLoading:k,isLoading:k,data:p,dataUpdatedAt:y.dataUpdatedAt,error:Q,errorUpdatedAt:S,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>C.dataUpdateCount||y.errorUpdateCount>C.errorUpdateCount,isFetching:q,isRefetching:q&&!F,isLoadingError:d&&!L,isPaused:y.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:d&&L,isStale:je(t,s),refetch:this.refetch,promise:i(this,ot),isEnabled:X(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=x.data!==void 0,Z=x.status==="error"&&!$,Dt=Ut=>{Z?Ut.reject(x.error):$&&Ut.resolve(x.data)},Vt=()=>{const Ut=c(this,ot,x.promise=be());Dt(Ut)},ft=i(this,ot);switch(ft.status){case"pending":t.queryHash===r.queryHash&&Dt(ft);break;case"fulfilled":(Z||x.data!==ft.value)&&Vt();break;case"rejected":(!Z||x.error!==ft.reason)&&Vt();break}}return x}updateResult(){const t=i(this,Y),s=this.createResult(i(this,P),this.options);if(c(this,At,i(this,P).state),c(this,Kt,this.options),i(this,At).data!==void 0&&c(this,Gt,i(this,P)),le(s,t))return;c(this,Y,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!i(this,Yt).size)return!0;const l=new Set(o??i(this,Yt));return this.options.throwOnError&&l.add("error"),Object.keys(i(this,Y)).some(h=>{const E=h;return i(this,Y)[E]!==t[E]&&l.has(E)})};b(this,A,ms).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&b(this,A,Se).call(this)}},J=new WeakMap,P=new WeakMap,re=new WeakMap,Y=new WeakMap,At=new WeakMap,Kt=new WeakMap,ot=new WeakMap,mt=new WeakMap,ie=new WeakMap,$t=new WeakMap,Gt=new WeakMap,Ft=new WeakMap,xt=new WeakMap,gt=new WeakMap,Yt=new WeakMap,A=new WeakSet,te=function(t){b(this,A,Te).call(this);let s=i(this,P).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(B)),s},Re=function(){b(this,A,Oe).call(this);const t=wt(this.options.staleTime,i(this,P));if(Qt||i(this,Y).isStale||!ve(t))return;const r=hs(i(this,Y).dataUpdatedAt,t)+1;c(this,Ft,St.setTimeout(()=>{i(this,Y).isStale||this.updateResult()},r))},Ce=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,P)):this.options.refetchInterval)??!1},we=function(t){b(this,A,Pe).call(this),c(this,gt,t),!(Qt||X(this.options.enabled,i(this,P))===!1||!ve(i(this,gt))||i(this,gt)===0)&&c(this,xt,St.setInterval(()=>{(this.options.refetchIntervalInBackground||Qe.isFocused())&&b(this,A,te).call(this)},i(this,gt)))},Se=function(){b(this,A,Re).call(this),b(this,A,we).call(this,b(this,A,Ce).call(this))},Oe=function(){i(this,Ft)&&(St.clearTimeout(i(this,Ft)),c(this,Ft,void 0))},Pe=function(){i(this,xt)&&(St.clearInterval(i(this,xt)),c(this,xt,void 0))},Te=function(){const t=i(this,J).getQueryCache().build(i(this,J),this.options);if(t===i(this,P))return;const s=i(this,P);c(this,P,t),c(this,re,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},ms=function(t){H.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,Y))}),i(this,J).getQueryCache().notify({query:i(this,P),type:"observerResultsUpdated"})})},is);function Gs(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ye(e,t){return Gs(e,t)||e.state.data!==void 0&&_e(e,t,t.refetchOnMount)}function _e(e,t,s){if(X(t.enabled,e)!==!1&&wt(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&je(e,t)}return!1}function Be(e,t,s,r){return(e!==t||X(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&je(e,s)}function je(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(wt(t.staleTime,e))}function Ys(e,t){return!le(e.getCurrentResult(),t)}function ze(e){return{onFetch:(t,s)=>{var R,y,w,p,Q;const r=t.options,a=(w=(y=(R=t.fetchOptions)==null?void 0:R.meta)==null?void 0:y.fetchMore)==null?void 0:w.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],l=((Q=t.state.data)==null?void 0:Q.pageParams)||[];let h={pages:[],pageParams:[]},E=0;const C=async()=>{let S=!1;const O=F=>{Us(F,()=>t.signal,()=>S=!0)},_=fs(t.options,t.fetchOptions),q=async(F,d,k)=>{if(S)return Promise.reject();if(d==null&&F.pages.length)return Promise.resolve(F);const T=(()=>{const Z={client:t.client,queryKey:t.queryKey,pageParam:d,direction:k?"backward":"forward",meta:t.options.meta};return O(Z),Z})(),x=await _(T),{maxPages:D}=t.options,$=k?Ds:js;return{pages:$(F.pages,x,D),pageParams:$(F.pageParams,d,D)}};if(a&&o.length){const F=a==="backward",d=F?Bs:Je,k={pages:o,pageParams:l},L=d(r,k);h=await q(k,L,F)}else{const F=e??o.length;do{const d=E===0?l[0]??r.initialPageParam:Je(r,h);if(E>0&&d==null)break;h=await q(h,d),E++}while(E<F)}return h};t.options.persister?t.fetchFn=()=>{var S,O;return(O=(S=t.options).persister)==null?void 0:O.call(S,C,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=C}}}function Je(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function Bs(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}var ne,rt,G,It,it,dt,ns,zs=(ns=class extends ys{constructor(t){super();f(this,it);f(this,ne);f(this,rt);f(this,G);f(this,It);c(this,ne,t.client),this.mutationId=t.mutationId,c(this,G,t.mutationCache),c(this,rt,[]),this.state=t.state||gs(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){i(this,rt).includes(t)||(i(this,rt).push(t),this.clearGcTimeout(),i(this,G).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){c(this,rt,i(this,rt).filter(s=>s!==t)),this.scheduleGc(),i(this,G).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){i(this,rt).length||(this.state.status==="pending"?this.scheduleGc():i(this,G).remove(this))}continue(){var t;return((t=i(this,It))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,h,E,C,R,y,w,p,Q,S,O,_,q,F,d,k,L,T;const s=()=>{b(this,it,dt).call(this,{type:"continue"})},r={client:i(this,ne),meta:this.options.meta,mutationKey:this.options.mutationKey};c(this,It,ps({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(x,D)=>{b(this,it,dt).call(this,{type:"failed",failureCount:x,error:D})},onPause:()=>{b(this,it,dt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,G).canRun(this)}));const a=this.state.status==="pending",o=!i(this,It).canStart();try{if(a)s();else{b(this,it,dt).call(this,{type:"pending",variables:t,isPaused:o}),i(this,G).config.onMutate&&await i(this,G).config.onMutate(t,this,r);const D=await((h=(l=this.options).onMutate)==null?void 0:h.call(l,t,r));D!==this.state.context&&b(this,it,dt).call(this,{type:"pending",context:D,variables:t,isPaused:o})}const x=await i(this,It).start();return await((C=(E=i(this,G).config).onSuccess)==null?void 0:C.call(E,x,t,this.state.context,this,r)),await((y=(R=this.options).onSuccess)==null?void 0:y.call(R,x,t,this.state.context,r)),await((p=(w=i(this,G).config).onSettled)==null?void 0:p.call(w,x,null,this.state.variables,this.state.context,this,r)),await((S=(Q=this.options).onSettled)==null?void 0:S.call(Q,x,null,t,this.state.context,r)),b(this,it,dt).call(this,{type:"success",data:x}),x}catch(x){try{await((_=(O=i(this,G).config).onError)==null?void 0:_.call(O,x,t,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((F=(q=this.options).onError)==null?void 0:F.call(q,x,t,this.state.context,r))}catch(D){Promise.reject(D)}try{await((k=(d=i(this,G).config).onSettled)==null?void 0:k.call(d,void 0,x,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((T=(L=this.options).onSettled)==null?void 0:T.call(L,void 0,x,t,this.state.context,r))}catch(D){Promise.reject(D)}throw b(this,it,dt).call(this,{type:"error",error:x}),x}finally{i(this,G).runNext(this)}}},ne=new WeakMap,rt=new WeakMap,G=new WeakMap,It=new WeakMap,it=new WeakSet,dt=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),H.batch(()=>{i(this,rt).forEach(r=>{r.onMutationUpdate(t)}),i(this,G).notify({mutation:this,type:"updated",action:t})})},ns);function gs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ut,et,ae,as,Js=(as=class extends Zt{constructor(t={}){super();f(this,ut);f(this,et);f(this,ae);this.config=t,c(this,ut,new Set),c(this,et,new Map),c(this,ae,0)}build(t,s,r){const a=new zs({client:t,mutationCache:this,mutationId:++ue(this,ae)._,options:t.defaultMutationOptions(s),state:r});return this.add(a),a}add(t){i(this,ut).add(t);const s=ce(t);if(typeof s=="string"){const r=i(this,et).get(s);r?r.push(t):i(this,et).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(i(this,ut).delete(t)){const s=ce(t);if(typeof s=="string"){const r=i(this,et).get(s);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&i(this,et).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=ce(t);if(typeof s=="string"){const r=i(this,et).get(s),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const s=ce(t);if(typeof s=="string"){const a=(r=i(this,et).get(s))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){H.batch(()=>{i(this,ut).forEach(t=>{this.notify({type:"removed",mutation:t})}),i(this,ut).clear(),i(this,et).clear()})}getAll(){return Array.from(i(this,ut))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Le(s,r))}findAll(t={}){return this.getAll().filter(s=>Le(t,s))}notify(t){H.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return H.batch(()=>Promise.all(t.map(s=>s.continue().catch(B))))}},ut=new WeakMap,et=new WeakMap,ae=new WeakMap,as);function ce(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ct,bt,W,ht,lt,he,Me,os,Ws=(os=class extends Zt{constructor(t,s){super();f(this,lt);f(this,ct);f(this,bt);f(this,W);f(this,ht);c(this,ct,t),this.setOptions(s),this.bindMethods(),b(this,lt,he).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=i(this,ct).defaultMutationOptions(t),le(this.options,s)||i(this,ct).getMutationCache().notify({type:"observerOptionsUpdated",mutation:i(this,W),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&jt(s.mutationKey)!==jt(this.options.mutationKey)?this.reset():((r=i(this,W))==null?void 0:r.state.status)==="pending"&&i(this,W).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=i(this,W))==null||t.removeObserver(this)}onMutationUpdate(t){b(this,lt,he).call(this),b(this,lt,Me).call(this,t)}getCurrentResult(){return i(this,bt)}reset(){var t;(t=i(this,W))==null||t.removeObserver(this),c(this,W,void 0),b(this,lt,he).call(this),b(this,lt,Me).call(this)}mutate(t,s){var r;return c(this,ht,s),(r=i(this,W))==null||r.removeObserver(this),c(this,W,i(this,ct).getMutationCache().build(i(this,ct),this.options)),i(this,W).addObserver(this),i(this,W).execute(t)}},ct=new WeakMap,bt=new WeakMap,W=new WeakMap,ht=new WeakMap,lt=new WeakSet,he=function(){var s;const t=((s=i(this,W))==null?void 0:s.state)??gs();c(this,bt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Me=function(t){H.batch(()=>{var s,r,a,o,l,h,E,C;if(i(this,ht)&&this.hasListeners()){const R=i(this,bt).variables,y=i(this,bt).context,w={client:i(this,ct),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=i(this,ht)).onSuccess)==null||r.call(s,t.data,R,y,w)}catch(p){Promise.reject(p)}try{(o=(a=i(this,ht)).onSettled)==null||o.call(a,t.data,null,R,y,w)}catch(p){Promise.reject(p)}}else if((t==null?void 0:t.type)==="error"){try{(h=(l=i(this,ht)).onError)==null||h.call(l,t.error,R,y,w)}catch(p){Promise.reject(p)}try{(C=(E=i(this,ht)).onSettled)==null||C.call(E,void 0,t.error,R,y,w)}catch(p){Promise.reject(p)}}}this.listeners.forEach(R=>{R(i(this,bt))})})},os),nt,us,Zs=(us=class extends Zt{constructor(t={}){super();f(this,nt);this.config=t,c(this,nt,new Map)}build(t,s,r){const a=s.queryKey,o=s.queryHash??Fe(a,s);let l=this.get(o);return l||(l=new Ks({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){i(this,nt).has(t.queryHash)||(i(this,nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=i(this,nt).get(t.queryHash);s&&(t.destroy(),s===t&&i(this,nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){H.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return i(this,nt).get(t)}getAll(){return[...i(this,nt).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>He(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>He(t,r)):s}notify(t){H.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){H.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){H.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},nt=new WeakMap,us),U,Et,Rt,Bt,zt,Ct,Jt,Wt,cs,dr=(cs=class{constructor(e={}){f(this,U);f(this,Et);f(this,Rt);f(this,Bt);f(this,zt);f(this,Ct);f(this,Jt);f(this,Wt);c(this,U,e.queryCache||new Zs),c(this,Et,e.mutationCache||new Js),c(this,Rt,e.defaultOptions||{}),c(this,Bt,new Map),c(this,zt,new Map),c(this,Ct,0)}mount(){ue(this,Ct)._++,i(this,Ct)===1&&(c(this,Jt,Qe.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,U).onFocus())})),c(this,Wt,fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,U).onOnline())})))}unmount(){var e,t;ue(this,Ct)._--,i(this,Ct)===0&&((e=i(this,Jt))==null||e.call(this),c(this,Jt,void 0),(t=i(this,Wt))==null||t.call(this),c(this,Wt,void 0))}isFetching(e){return i(this,U).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return i(this,Et).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,U).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=i(this,U).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(wt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return i(this,U).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),a=i(this,U).get(r.queryHash),o=a==null?void 0:a.state.data,l=xs(t,o);if(l!==void 0)return i(this,U).build(this,r).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return H.batch(()=>i(this,U).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,U).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=i(this,U);H.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=i(this,U);return H.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=H.batch(()=>i(this,U).findAll(e).map(a=>a.cancel(s)));return Promise.all(r).then(B).catch(B)}invalidateQueries(e,t={}){return H.batch(()=>(i(this,U).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=H.batch(()=>i(this,U).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,s);return s.throwOnError||(o=o.catch(B)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(B)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=i(this,U).build(this,t);return s.isStaleByTime(wt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(B).catch(B)}fetchInfiniteQuery(e){return e.behavior=ze(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(B).catch(B)}ensureInfiniteQueryData(e){return e.behavior=ze(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fe.isOnline()?i(this,Et).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,U)}getMutationCache(){return i(this,Et)}getDefaultOptions(){return i(this,Rt)}setDefaultOptions(e){c(this,Rt,e)}setQueryDefaults(e,t){i(this,Bt).set(jt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...i(this,Bt).values()],s={};return t.forEach(r=>{ee(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){i(this,zt).set(jt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...i(this,zt).values()],s={};return t.forEach(r=>{ee(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...i(this,Rt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xe&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...i(this,Rt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){i(this,U).clear(),i(this,Et).clear()}},U=new WeakMap,Et=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ct=new WeakMap,Jt=new WeakMap,Wt=new WeakMap,cs),ye={exports:{}},v={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.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 We;function Vs(){if(We)return v;We=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),C=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function p(n){return n===null||typeof n!="object"?null:(n=w&&n[w]||n["@@iterator"],typeof n=="function"?n:null)}var Q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,O={};function _(n,u,g){this.props=n,this.context=u,this.refs=O,this.updater=g||Q}_.prototype.isReactComponent={},_.prototype.setState=function(n,u){if(typeof n!="object"&&typeof n!="function"&&n!=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,n,u,"setState")},_.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function q(){}q.prototype=_.prototype;function F(n,u,g){this.props=n,this.context=u,this.refs=O,this.updater=g||Q}var d=F.prototype=new q;d.constructor=F,S(d,_.prototype),d.isPureReactComponent=!0;var k=Array.isArray;function L(){}var T={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function D(n,u,g){var m=g.ref;return{$$typeof:e,type:n,key:u,ref:m!==void 0?m:null,props:g}}function $(n,u){return D(n.type,u,n.props)}function Z(n){return typeof n=="object"&&n!==null&&n.$$typeof===e}function Dt(n){var u={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(g){return u[g]})}var Vt=/\/+/g;function ft(n,u){return typeof n=="object"&&n!==null&&n.key!=null?Dt(""+n.key):u.toString(36)}function Ut(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(L,L):(n.status="pending",n.then(function(u){n.status==="pending"&&(n.status="fulfilled",n.value=u)},function(u){n.status==="pending"&&(n.status="rejected",n.reason=u)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function qt(n,u,g,m,M){var I=typeof n;(I==="undefined"||I==="boolean")&&(n=null);var j=!1;if(n===null)j=!0;else switch(I){case"bigint":case"string":case"number":j=!0;break;case"object":switch(n.$$typeof){case e:case t:j=!0;break;case R:return j=n._init,qt(j(n._payload),u,g,m,M)}}if(j)return M=M(n),j=m===""?"."+ft(n,0):m,k(M)?(g="",j!=null&&(g=j.replace(Vt,"$&/")+"/"),qt(M,u,g,"",function(Ss){return Ss})):M!=null&&(Z(M)&&(M=$(M,g+(M.key==null||n&&n.key===M.key?"":(""+M.key).replace(Vt,"$&/")+"/")+j)),u.push(M)),1;j=0;var st=m===""?".":m+":";if(k(n))for(var z=0;z<n.length;z++)m=n[z],I=st+ft(m,z),j+=qt(m,u,g,I,M);else if(z=p(n),typeof z=="function")for(n=z.call(n),z=0;!(m=n.next()).done;)m=m.value,I=st+ft(m,z++),j+=qt(m,u,g,I,M);else if(I==="object"){if(typeof n.then=="function")return qt(Ut(n),u,g,m,M);throw u=String(n),Error("Objects are not valid as a React child (found: "+(u==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":u)+"). If you meant to render a collection of children, use an array instead.")}return j}function oe(n,u,g){if(n==null)return n;var m=[],M=0;return qt(n,m,"","",function(I){return u.call(g,I,M++)}),m}function Cs(n){if(n._status===-1){var u=n._result;u=u(),u.then(function(g){(n._status===0||n._status===-1)&&(n._status=1,n._result=g)},function(g){(n._status===0||n._status===-1)&&(n._status=2,n._result=g)}),n._status===-1&&(n._status=0,n._result=u)}if(n._status===1)return n._result.default;throw n._result}var De=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},ws={map:oe,forEach:function(n,u,g){oe(n,function(){u.apply(this,arguments)},g)},count:function(n){var u=0;return oe(n,function(){u++}),u},toArray:function(n){return oe(n,function(u){return u})||[]},only:function(n){if(!Z(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};return v.Activity=y,v.Children=ws,v.Component=_,v.Fragment=s,v.Profiler=a,v.PureComponent=F,v.StrictMode=r,v.Suspense=E,v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,v.__COMPILER_RUNTIME={__proto__:null,c:function(n){return T.H.useMemoCache(n)}},v.cache=function(n){return function(){return n.apply(null,arguments)}},v.cacheSignal=function(){return null},v.cloneElement=function(n,u,g){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var m=S({},n.props),M=n.key;if(u!=null)for(I in u.key!==void 0&&(M=""+u.key),u)!x.call(u,I)||I==="key"||I==="__self"||I==="__source"||I==="ref"&&u.ref===void 0||(m[I]=u[I]);var I=arguments.length-2;if(I===1)m.children=g;else if(1<I){for(var j=Array(I),st=0;st<I;st++)j[st]=arguments[st+2];m.children=j}return D(n.type,M,m)},v.createContext=function(n){return n={$$typeof:l,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:o,_context:n},n},v.createElement=function(n,u,g){var m,M={},I=null;if(u!=null)for(m in u.key!==void 0&&(I=""+u.key),u)x.call(u,m)&&m!=="key"&&m!=="__self"&&m!=="__source"&&(M[m]=u[m]);var j=arguments.length-2;if(j===1)M.children=g;else if(1<j){for(var st=Array(j),z=0;z<j;z++)st[z]=arguments[z+2];M.children=st}if(n&&n.defaultProps)for(m in j=n.defaultProps,j)M[m]===void 0&&(M[m]=j[m]);return D(n,I,M)},v.createRef=function(){return{current:null}},v.forwardRef=function(n){return{$$typeof:h,render:n}},v.isValidElement=Z,v.lazy=function(n){return{$$typeof:R,_payload:{_status:-1,_result:n},_init:Cs}},v.memo=function(n,u){return{$$typeof:C,type:n,compare:u===void 0?null:u}},v.startTransition=function(n){var u=T.T,g={};T.T=g;try{var m=n(),M=T.S;M!==null&&M(g,m),typeof m=="object"&&m!==null&&typeof m.then=="function"&&m.then(L,De)}catch(I){De(I)}finally{u!==null&&g.types!==null&&(u.types=g.types),T.T=u}},v.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},v.use=function(n){return T.H.use(n)},v.useActionState=function(n,u,g){return T.H.useActionState(n,u,g)},v.useCallback=function(n,u){return T.H.useCallback(n,u)},v.useContext=function(n){return T.H.useContext(n)},v.useDebugValue=function(){},v.useDeferredValue=function(n,u){return T.H.useDeferredValue(n,u)},v.useEffect=function(n,u){return T.H.useEffect(n,u)},v.useEffectEvent=function(n){return T.H.useEffectEvent(n)},v.useId=function(){return T.H.useId()},v.useImperativeHandle=function(n,u,g){return T.H.useImperativeHandle(n,u,g)},v.useInsertionEffect=function(n,u){return T.H.useInsertionEffect(n,u)},v.useLayoutEffect=function(n,u){return T.H.useLayoutEffect(n,u)},v.useMemo=function(n,u){return T.H.useMemo(n,u)},v.useOptimistic=function(n,u){return T.H.useOptimistic(n,u)},v.useReducer=function(n,u,g){return T.H.useReducer(n,u,g)},v.useRef=function(n){return T.H.useRef(n)},v.useState=function(n){return T.H.useState(n)},v.useSyncExternalStore=function(n,u,g){return T.H.useSyncExternalStore(n,u,g)},v.useTransition=function(){return T.H.useTransition()},v.version="19.2.4",v}var Ze;function Xs(){return Ze||(Ze=1,ye.exports=Vs()),ye.exports}var K=Xs();const pr=Os(K);var bs=K.createContext(void 0),Es=e=>{const t=K.useContext(bs);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yr=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_s.jsx(bs.Provider,{value:e,children:t})),Rs=K.createContext(!1),tr=()=>K.useContext(Rs);Rs.Provider;function er(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sr=K.createContext(er()),rr=()=>K.useContext(sr),ir=(e,t,s)=>{const r=s!=null&&s.state.error&&typeof e.throwOnError=="function"?Ie(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nr=e=>{K.useEffect(()=>{e.clearReset()},[e])},ar=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Ie(s,[e.error,r])),or=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>s(r(...a)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ur=(e,t)=>e.isLoading&&e.isFetching&&!t,cr=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ve=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function hr(e,t,s){var w,p,Q,S;const r=tr(),a=rr(),o=Es(),l=o.defaultQueryOptions(e);(p=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||p.call(w,l);const h=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",or(l),ir(l,a,h),nr(a);const E=!o.getQueryCache().get(l.queryHash),[C]=K.useState(()=>new t(o,l)),R=C.getOptimisticResult(l),y=!r&&e.subscribed!==!1;if(K.useSyncExternalStore(K.useCallback(O=>{const _=y?C.subscribe(H.batchCalls(O)):B;return C.updateResult(),_},[C,y]),()=>C.getCurrentResult(),()=>C.getCurrentResult()),K.useEffect(()=>{C.setOptions(l)},[l,C]),cr(l,R))throw Ve(l,C,a);if(ar({result:R,errorResetBoundary:a,throwOnError:l.throwOnError,query:h,suspense:l.suspense}))throw R.error;if((S=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||S.call(Q,l,R),l.experimental_prefetchInRender&&!Qt&&ur(R,r)){const O=E?Ve(l,C,a):h==null?void 0:h.promise;O==null||O.catch(B).finally(()=>{C.updateResult()})}return l.notifyOnChangeProps?R:C.trackResult(R)}function vr(e,t){return hr(e,$s)}function mr(e,t){const s=Es(),[r]=K.useState(()=>new Ws(s,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);const a=K.useSyncExternalStore(K.useCallback(l=>r.subscribe(H.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=K.useCallback((l,h)=>{r.mutate(l,h).catch(B)},[r]);if(a.error&&Ie(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}export{dr as Q,pr as R,Xs as a,Es as b,fr as c,mr as d,yr as e,Os as g,_s as j,K as r,vr as u};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{r as E,j as x,R as Ce,a as pt,g as Dn}from"./tanstack-query-Day3Mt-4.js";const dt=new WeakMap,Bn=new WeakMap,je={current:[]};let Ze=!1,Le=0;const xe=new Set,Oe=new Map;function cn(e){for(const n of e){if(je.current.includes(n))continue;je.current.push(n),n.recompute();const t=Bn.get(n);if(t)for(const r of t){const s=dt.get(r);s!=null&&s.length&&cn(s)}}}function Nn(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function jn(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function ln(e){if(Le>0&&!Oe.has(e)&&Oe.set(e,e.prevState),xe.add(e),!(Le>0)&&!Ze)try{for(Ze=!0;xe.size>0;){const n=Array.from(xe);xe.clear();for(const t of n){const r=Oe.get(t)??t.prevState;t.prevState=r,Nn(t)}for(const t of n){const r=dt.get(t);r&&(je.current.push(t),cn(r))}for(const t of n){const r=dt.get(t);if(r)for(const s of r)jn(s)}}}finally{Ze=!1,je.current=[],Oe.clear()}}function Un(e){Le++;try{e()}finally{if(Le--,Le===0){const n=xe.values().next().value;n&&ln(n)}}}function Vn(e){return typeof e=="function"}class $n{constructor(n,t){this.listeners=new Set,this.subscribe=r=>{var s,o;this.listeners.add(r);const i=(o=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:o.call(s,r,this);return()=>{this.listeners.delete(r),i==null||i()}},this.prevState=n,this.state=n,this.options=t}setState(n){var t,r,s;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(n):Vn(n)?this.state=n(this.prevState):this.state=n,(s=(r=this.options)==null?void 0:r.onUpdate)==null||s.call(r),ln(this)}}const se="__TSR_index",Bt="popstate",Nt="beforeunload";function Hn(e){let n=e.getLocation();const t=new Set,r=i=>{n=e.getLocation(),t.forEach(a=>a({location:n,action:i}))},s=i=>{e.notifyOnIndexChange??!0?r(i):n=e.getLocation()},o=async({task:i,navigateOpts:a,...l})=>{var u,d;if((a==null?void 0:a.ignoreBlocker)??!1){i();return}const h=((u=e.getBlockers)==null?void 0:u.call(e))??[],f=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&h.length&&f)for(const m of h){const g=Ue(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:g,action:l.type})){(d=e.onBlocked)==null||d.call(e);return}}i()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:i=>(t.add(i),()=>{t.delete(i)}),push:(i,a,l)=>{const c=n.state[se];a=jt(c+1,a),o({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:i,state:a})},replace:(i,a,l)=>{const c=n.state[se];a=jt(c,a),o({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:i,state:a})},go:(i,a)=>{o({task:()=>{e.go(i),s({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{o({task:()=>{e.back((i==null?void 0:i.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{o({task:()=>{e.forward((i==null?void 0:i.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>n.state[se]!==0,createHref:i=>e.createHref(i),block:i=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,i]),()=>{var h,f;const c=((h=e.getBlockers)==null?void 0:h.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(u=>u!==i))}},flush:()=>{var i;return(i=e.flush)==null?void 0:i.call(e)},destroy:()=>{var i;return(i=e.destroy)==null?void 0:i.call(e)},notify:r}}function jt(e,n){n||(n={});const t=yt();return{...n,key:t,__TSR_key:t,[se]:e}}function Wn(e){var k,C;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const o=()=>s,i=y=>s=y,a=(y=>y),l=(()=>Ue(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((k=n.history.state)!=null&&k.__TSR_key)&&!((C=n.history.state)!=null&&C.key)){const y=yt();n.history.replaceState({[se]:0,key:y,__TSR_key:y},"")}let c=l(),h,f=!1,u=!1,d=!1,m=!1;const g=()=>c;let p,S;const P=()=>{p&&(_._ignoreSubscribers=!0,(p.isPush?n.history.pushState:n.history.replaceState)(p.state,"",p.href),_._ignoreSubscribers=!1,p=void 0,S=void 0,h=void 0)},L=(y,R,T)=>{const O=a(R);S||(h=c),c=Ue(R,T),p={href:O,state:T,isPush:(p==null?void 0:p.isPush)||y==="push"},S||(S=Promise.resolve().then(()=>P()))},v=y=>{c=l(),_.notify({type:y})},w=async()=>{if(u){u=!1;return}const y=l(),R=y.state[se]-c.state[se],T=R===1,O=R===-1,N=!T&&!O||f;f=!1;const I=N?"GO":O?"BACK":"FORWARD",b=N?{type:"GO",index:R}:{type:O?"BACK":"FORWARD"};if(d)d=!1;else{const F=o();if(typeof document<"u"&&F.length){for(const D of F)if(await D.blockerFn({currentLocation:c,nextLocation:y,action:I})){u=!0,n.history.go(1),_.notify(b);return}}}c=l(),_.notify(b)},M=y=>{if(m){m=!1;return}let R=!1;const T=o();if(typeof document<"u"&&T.length)for(const O of T){const N=O.enableBeforeUnload??!0;if(N===!0){R=!0;break}if(typeof N=="function"&&N()===!0){R=!0;break}}if(R)return y.preventDefault(),y.returnValue=""},_=Hn({getLocation:g,getLength:()=>n.history.length,pushState:(y,R)=>L("push",y,R),replaceState:(y,R)=>L("replace",y,R),back:y=>(y&&(d=!0),m=!0,n.history.back()),forward:y=>{y&&(d=!0),m=!0,n.history.forward()},go:y=>{f=!0,n.history.go(y)},createHref:y=>a(y),flush:P,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(Nt,M,{capture:!0}),n.removeEventListener(Bt,w)},onBlocked:()=>{h&&c!==h&&(c=h)},getBlockers:o,setBlockers:i,notifyOnIndexChange:!1});return n.addEventListener(Nt,M,{capture:!0}),n.addEventListener(Bt,w),n.history.pushState=function(...y){const R=t.apply(n.history,y);return _._ignoreSubscribers||v("PUSH"),R},n.history.replaceState=function(...y){const R=r.apply(n.history,y);return _._ignoreSubscribers||v("REPLACE"),R},_}function zn(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Ue(e,n){const t=zn(e),r=t.indexOf("#"),s=t.indexOf("?"),o=yt();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[se]:0,key:o,__TSR_key:o}}}function yt(){return(Math.random()+1).toString(36).substring(7)}const Kn=!1;function be(e){let n;return Un(()=>{n=e()}),n}function ke(e){return e[e.length-1]}function Gn(e){return typeof e=="function"}function ne(e,n){return Gn(e)?e(n):e}const qn=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable;function $(e,n,t=0){if(e===n)return e;if(t>500)return n;const r=n,s=Ht(e)&&Ht(r);if(!s&&!(Ve(e)&&Ve(r)))return r;const o=s?e:Vt(e);if(!o)return r;const i=s?r:Vt(r);if(!i)return r;const a=o.length,l=i.length,c=s?new Array(l):{};let h=0;for(let f=0;f<l;f++){const u=s?f:i[f],d=e[u],m=r[u];if(d===m){c[u]=d,(s?f<a:qn.call(e,u))&&h++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){c[u]=m;continue}const g=$(d,m,t+1);c[u]=g,g===d&&h++}return a===l&&h===a?e:c}function Vt(e){const n=Object.getOwnPropertyNames(e);for(const s of n)if(!Ut.call(e,s))return!1;const t=Object.getOwnPropertySymbols(e);if(t.length===0)return n;const r=n;for(const s of t){if(!Ut.call(e,s))return!1;r.push(s)}return r}function Ve(e){if(!$t(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const t=n.prototype;return!(!$t(t)||!t.hasOwnProperty("isPrototypeOf"))}function $t(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ht(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ce(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!ce(e[r],n[r],t))return!1;return!0}if(Ve(e)&&Ve(n)){const r=(t==null?void 0:t.ignoreUndefined)??!0;if(t!=null&&t.partial){for(const i in n)if((!r||n[i]!==void 0)&&!ce(e[i],n[i],t))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&s++;let o=0;for(const i in n)if((!r||n[i]!==void 0)&&(o++,o>s||!ce(e[i],n[i],t)))return!1;return s===o}return!1}function pe(e){let n,t;const r=new Promise((s,o)=>{n=s,t=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,n(s),e==null||e(s)},r.reject=s=>{r.status="rejected",t(s)},r}function me(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Yn(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Wt(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return Yn(n)}const un=["http:","https:","mailto:","tel:"];function $e(e){if(!e)return!1;try{const n=new URL(e);return!un.includes(n.protocol)}catch{return!1}}function ve(e,n){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const t=/%25|%5C/gi;let r=0,s="",o;for(;(o=t.exec(e))!==null;)s+=Wt(e.slice(r,o.index))+o[0],r=t.lastIndex;return s=s+Wt(r?e.slice(r):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function Jn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Xn="Invariant failed";function ee(e,n){if(!e)throw new Error(Xn)}function He(e){const n=new Map;let t,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,t=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const i=n.get(o);if(i)return s(i),i.value},set(o,i){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=n.get(o);if(a)a.value=i,s(a);else{const l={key:o,value:i,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(o,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const ye=0,ue=1,fe=2,Ee=3,ie=4,fn=5;function Zn(e){const n=e.indexOf("{");if(n===-1)return null;const t=e.indexOf("}",n);return t===-1||n+1>=e.length?null:[n,t]}function St(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,o=e.substring(n,s);if(!o||!o.includes("$"))return t[0]=ye,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(o==="$"){const a=e.length;return t[0]=fe,t[1]=n,t[2]=n,t[3]=a,t[4]=a,t[5]=a,t}if(o.charCodeAt(0)===36)return t[0]=ue,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const i=Zn(o);if(i){const[a,l]=i,c=o.charCodeAt(a+1);if(c===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const h=a+3,f=l;if(h<f)return t[0]=Ee,t[1]=n+a,t[2]=n+h,t[3]=n+f,t[4]=n+l+1,t[5]=s,t}}else if(c===36){const h=a+1,f=a+2;return f===l?(t[0]=fe,t[1]=n+a,t[2]=n+h,t[3]=n+f,t[4]=n+l+1,t[5]=e.length,t):(t[0]=ue,t[1]=n+a,t[2]=n+f,t[3]=n+l,t[4]=n+l+1,t[5]=s,t)}}return t[0]=ye,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t}function Ge(e,n,t,r,s,o,i){var l,c,h,f,u,d,m,g,p,S,P,L,v;i==null||i(t);let a=r;{const w=t.fullPath??t.from,M=w.length,_=((l=t.options)==null?void 0:l.caseSensitive)??e,k=!!((h=(c=t.options)==null?void 0:c.params)!=null&&h.parse&&((u=(f=t.options)==null?void 0:f.skipRouteOnParseError)!=null&&u.params));for(;a<M;){const y=St(w,a,n);let R;const T=a,O=y[5];switch(a=O+1,o++,y[0]){case ye:{const I=w.substring(y[2],y[3]);if(_){const b=(d=s.static)==null?void 0:d.get(I);if(b)R=b;else{s.static??(s.static=new Map);const F=ae(t.fullPath??t.from);F.parent=s,F.depth=o,R=F,s.static.set(I,F)}}else{const b=I.toLowerCase(),F=(m=s.staticInsensitive)==null?void 0:m.get(b);if(F)R=F;else{s.staticInsensitive??(s.staticInsensitive=new Map);const D=ae(t.fullPath??t.from);D.parent=s,D.depth=o,R=D,s.staticInsensitive.set(b,D)}}break}case ue:{const I=w.substring(T,y[1]),b=w.substring(y[4],O),F=_&&!!(I||b),D=I?F?I:I.toLowerCase():void 0,U=b?F?b:b.toLowerCase():void 0,H=!k&&((g=s.dynamic)==null?void 0:g.find(B=>!B.skipOnParamError&&B.caseSensitive===F&&B.prefix===D&&B.suffix===U));if(H)R=H;else{const B=et(ue,t.fullPath??t.from,F,D,U);R=B,B.depth=o,B.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(B)}break}case Ee:{const I=w.substring(T,y[1]),b=w.substring(y[4],O),F=_&&!!(I||b),D=I?F?I:I.toLowerCase():void 0,U=b?F?b:b.toLowerCase():void 0,H=!k&&((p=s.optional)==null?void 0:p.find(B=>!B.skipOnParamError&&B.caseSensitive===F&&B.prefix===D&&B.suffix===U));if(H)R=H;else{const B=et(Ee,t.fullPath??t.from,F,D,U);R=B,B.parent=s,B.depth=o,s.optional??(s.optional=[]),s.optional.push(B)}break}case fe:{const I=w.substring(T,y[1]),b=w.substring(y[4],O),F=_&&!!(I||b),D=I?F?I:I.toLowerCase():void 0,U=b?F?b:b.toLowerCase():void 0,H=et(fe,t.fullPath??t.from,F,D,U);R=H,H.parent=s,H.depth=o,s.wildcard??(s.wildcard=[]),s.wildcard.push(H)}}s=R}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const y=ae(t.fullPath??t.from);y.kind=fn,y.parent=s,o++,y.depth=o,s.pathless??(s.pathless=[]),s.pathless.push(y),s=y}const C=(t.path||!t.children)&&!t.isRoot;if(C&&w.endsWith("/")){const y=ae(t.fullPath??t.from);y.kind=ie,y.parent=s,o++,y.depth=o,s.index=y,s=y}s.parse=((P=(S=t.options)==null?void 0:S.params)==null?void 0:P.parse)??null,s.skipOnParamError=k,s.parsingPriority=((v=(L=t.options)==null?void 0:L.skipRouteOnParseError)==null?void 0:v.priority)??0,C&&!s.route&&(s.route=t,s.fullPath=t.fullPath??t.from)}if(t.children)for(const w of t.children)Ge(e,n,w,a,s,o,i)}function Qe(e,n){if(e.skipOnParamError&&!n.skipOnParamError)return-1;if(!e.skipOnParamError&&n.skipOnParamError)return 1;if(e.skipOnParamError&&n.skipOnParamError&&(e.parsingPriority||n.parsingPriority))return n.parsingPriority-e.parsingPriority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function te(e){var n,t,r;if(e.pathless)for(const s of e.pathless)te(s);if(e.static)for(const s of e.static.values())te(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())te(s);if((n=e.dynamic)!=null&&n.length){e.dynamic.sort(Qe);for(const s of e.dynamic)te(s)}if((t=e.optional)!=null&&t.length){e.optional.sort(Qe);for(const s of e.optional)te(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(Qe);for(const s of e.wildcard)te(s)}}function ae(e){return{kind:ye,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function et(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:t,prefix:r,suffix:s}}function Qn(e,n){const t=ae("/"),r=new Uint16Array(6);for(const s of e)Ge(!1,r,s,1,t,0);te(t),n.masksTree=t,n.flatCache=He(1e3)}function er(e,n){e||(e="/");const t=n.flatCache.get(e);if(t)return t;const r=vt(e,n.masksTree);return n.flatCache.set(e,r),r}function tr(e,n,t,r,s){e||(e="/"),r||(r="/");const o=n?`case\0${e}`:e;let i=s.singleCache.get(o);if(!i){i=ae("/");const a=new Uint16Array(6);Ge(n,a,{from:e},1,i,0),s.singleCache.set(o,i)}return vt(r,i,t)}function nr(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let o;try{o=vt(e,n.segmentTree,t)}catch(i){if(i instanceof URIError)o=null;else throw i}return o&&(o.branch=or(o.route)),n.matchCache.set(r,o),o}function rr(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function sr(e,n=!1,t){const r=ae(e.fullPath),s=new Uint16Array(6),o={},i={};let a=0;return Ge(n,s,e,1,r,0,c=>{if(t==null||t(c,a),ee(!(c.id in o),`Duplicate routes found with id: ${String(c.id)}`),o[c.id]=c,a!==0&&c.path){const h=rr(c.fullPath);(!i[h]||c.fullPath.endsWith("/"))&&(i[h]=c)}a++}),te(r),{processedTree:{segmentTree:r,singleCache:He(1e3),matchCache:He(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:i}}function vt(e,n,t=!1){const r=e.split("/"),s=ar(e,r,n,t);if(!s)return null;const[o]=hn(e,r,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function hn(e,n,t){var h,f,u,d,m,g,p,S,P,L;const r=ir(t.node);let s=null;const o={};let i=((h=t.extract)==null?void 0:h.part)??0,a=((f=t.extract)==null?void 0:f.node)??0,l=((u=t.extract)==null?void 0:u.path)??0,c=((d=t.extract)==null?void 0:d.segment)??0;for(;a<r.length;i++,a++,l++,c++){const v=r[a];if(v.kind===ie)break;if(v.kind===fn){c--,i--,l--;continue}const w=n[i],M=l;if(w&&(l+=w.length),v.kind===ue){s??(s=t.node.fullPath.split("/"));const _=s[c],k=((m=v.prefix)==null?void 0:m.length)??0;if(_.charCodeAt(k)===123){const y=((g=v.suffix)==null?void 0:g.length)??0,R=_.substring(k+2,_.length-y-1),T=w.substring(k,w.length-y);o[R]=decodeURIComponent(T)}else{const y=_.substring(1);o[y]=decodeURIComponent(w)}}else if(v.kind===Ee){if(t.skipped&1<<a){i--,l=M-1;continue}s??(s=t.node.fullPath.split("/"));const _=s[c],k=((p=v.prefix)==null?void 0:p.length)??0,C=((S=v.suffix)==null?void 0:S.length)??0,y=_.substring(k+3,_.length-C-1),R=v.suffix||v.prefix?w.substring(k,w.length-C):w;R&&(o[y]=decodeURIComponent(R))}else if(v.kind===fe){const _=v,k=e.substring(M+(((P=_.prefix)==null?void 0:P.length)??0),e.length-(((L=_.suffix)==null?void 0:L.length)??0)),C=decodeURIComponent(k);o["*"]=C,o._splat=C;break}}return t.rawParams&&Object.assign(o,t.rawParams),[o,{part:i,node:a,path:l,segment:c}]}function or(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function ir(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function ar(e,n,t,r){if(e==="/"&&t.index)return{node:t.index,skipped:0};const s=!ke(n),o=s&&e!=="/",i=n.length-(s?1:0),a=[{node:t,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,c=null,h=null;for(;a.length;){const f=a.pop(),{node:u,index:d,skipped:m,depth:g,statics:p,dynamics:S,optionals:P}=f;let{extract:L,rawParams:v,parsedParams:w}=f;if(u.skipOnParamError){if(!tt(e,n,f))continue;v=f.rawParams,L=f.extract,w=f.parsedParams}r&&u.route&&u.kind!==ie&&Pe(c,f)&&(c=f);const M=d===i;if(M&&(u.route&&!o&&Pe(h,f)&&(h=f),!u.optional&&!u.wildcard&&!u.index&&!u.pathless))continue;const _=M?void 0:n[d];let k;if(M&&u.index){const C={node:u.index,index:d,skipped:m,depth:g+1,statics:p,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w};let y=!0;if(u.index.skipOnParamError&&(tt(e,n,C)||(y=!1)),y){if(p===i&&!S&&!P&&!m)return C;Pe(h,C)&&(h=C)}}if(u.wildcard&&Pe(l,f))for(const C of u.wildcard){const{prefix:y,suffix:R}=C;if(y&&(M||!(C.caseSensitive?_:k??(k=_.toLowerCase())).startsWith(y)))continue;if(R){if(M)continue;const O=n.slice(d).join("/").slice(-R.length);if((C.caseSensitive?O:O.toLowerCase())!==R)continue}const T={node:C,index:i,skipped:m,depth:g,statics:p,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w};if(!(C.skipOnParamError&&!tt(e,n,T))){l=T;break}}if(u.optional){const C=m|1<<g,y=g+1;for(let R=u.optional.length-1;R>=0;R--){const T=u.optional[R];a.push({node:T,index:d,skipped:C,depth:y,statics:p,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w})}if(!M)for(let R=u.optional.length-1;R>=0;R--){const T=u.optional[R],{prefix:O,suffix:N}=T;if(O||N){const I=T.caseSensitive?_:k??(k=_.toLowerCase());if(O&&!I.startsWith(O)||N&&!I.endsWith(N))continue}a.push({node:T,index:d+1,skipped:m,depth:y,statics:p,dynamics:S,optionals:P+1,extract:L,rawParams:v,parsedParams:w})}}if(!M&&u.dynamic&&_)for(let C=u.dynamic.length-1;C>=0;C--){const y=u.dynamic[C],{prefix:R,suffix:T}=y;if(R||T){const O=y.caseSensitive?_:k??(k=_.toLowerCase());if(R&&!O.startsWith(R)||T&&!O.endsWith(T))continue}a.push({node:y,index:d+1,skipped:m,depth:g+1,statics:p,dynamics:S+1,optionals:P,extract:L,rawParams:v,parsedParams:w})}if(!M&&u.staticInsensitive){const C=u.staticInsensitive.get(k??(k=_.toLowerCase()));C&&a.push({node:C,index:d+1,skipped:m,depth:g+1,statics:p+1,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w})}if(!M&&u.static){const C=u.static.get(_);C&&a.push({node:C,index:d+1,skipped:m,depth:g+1,statics:p+1,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w})}if(u.pathless){const C=g+1;for(let y=u.pathless.length-1;y>=0;y--){const R=u.pathless[y];a.push({node:R,index:d,skipped:m,depth:C,statics:p,dynamics:S,optionals:P,extract:L,rawParams:v,parsedParams:w})}}}if(h&&l)return Pe(l,h)?h:l;if(h)return h;if(l)return l;if(r&&c){let f=c.index;for(let d=0;d<c.index;d++)f+=n[d].length;const u=f===e.length?"/":e.slice(f);return c.rawParams??(c.rawParams={}),c.rawParams["**"]=decodeURIComponent(u),c}return null}function tt(e,n,t){try{const[r,s]=hn(e,n,t);t.rawParams=r,t.extract=s;const o=t.node.parse(r);return t.parsedParams=Object.assign({},t.parsedParams,o),!0}catch{return null}}function Pe(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===ie)>(e.node.kind===ie)||n.node.kind===ie==(e.node.kind===ie)&&n.depth>e.depth))):!0}function De(e){return Pt(e.filter(n=>n!==void 0).join("/"))}function Pt(e){return e.replace(/\/{2,}/g,"/")}function dn(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Q(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function mn(e){return Q(dn(e))}function We(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function cr(e,n,t){return We(e,t)===We(n,t)}function lr({base:e,to:n,trailingSlash:t="never",cache:r}){const s=n.startsWith("/"),o=!s&&n===".";let i;if(r){i=s?n:o?e:e+"\0"+n;const f=r.get(i);if(f)return f}let a;if(o)a=e.split("/");else if(s)a=n.split("/");else{for(a=e.split("/");a.length>1&&ke(a)==="";)a.pop();const f=n.split("/");for(let u=0,d=f.length;u<d;u++){const m=f[u];m===""?u?u===d-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ke(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const u=a[f];if(!u)continue;l=St(u,0,l);const d=l[0];if(d===ye){c+=u;continue}const m=l[5],g=u.substring(0,l[1]),p=u.substring(l[4],m),S=u.substring(l[2],l[3]);d===ue?c+=g||p?`${g}{$${S}}${p}`:`$${S}`:d===fe?c+=g||p?`${g}{$}${p}`:"$":c+=`${g}{-$${S}}${p}`}c=Pt(c);const h=c||"/";return i&&r&&r.set(i,h),h}function ur(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,o=>n.get(o)??o)}function nt(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>zt(s,t)).join("/"):zt(r,t)}function rt({path:e,params:n,decoder:t,server:r}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let a=0,l,c="";for(;a<i;){const f=a;l=St(e,f,l);const u=l[5];if(a=u+1,f===u)continue;const d=l[0];if(d===ye){c+="/"+e.substring(f,u);continue}if(d===fe){const m=n._splat;o._splat=m,o["*"]=m;const g=e.substring(f,l[1]),p=e.substring(l[4],u);if(!m){s=!0,(g||p)&&(c+="/"+g+p);continue}const S=nt("_splat",n,t);c+="/"+g+S+p;continue}if(d===ue){const m=e.substring(l[2],l[3]);!s&&!(m in n)&&(s=!0),o[m]=n[m];const g=e.substring(f,l[1]),p=e.substring(l[4],u),S=nt(m,n,t)??"undefined";c+="/"+g+S+p;continue}if(d===Ee){const m=e.substring(l[2],l[3]),g=n[m];if(g==null)continue;o[m]=g;const p=e.substring(f,l[1]),S=e.substring(l[4],u),P=nt(m,n,t)??"";c+="/"+p+P+S;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:o,interpolatedPath:c||"/",isMissingParams:s}}function zt(e,n){const t=encodeURIComponent(e);return(n==null?void 0:n(t))??t}function W(e){return!!(e!=null&&e.isNotFound)}function fr(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const mt="tsr-scroll-restoration-v1_3",hr=(e,n)=>{let t;return(...r)=>{t||(t=setTimeout(()=>{e(...r),t=null},n))}};function dr(){const e=fr();if(!e)return null;const n=e.getItem(mt);let t=n?JSON.parse(n):{};return{state:t,set:r=>{t=ne(r,t)||t;try{e.setItem(mt,JSON.stringify(t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Fe=dr(),mr=e=>e.state.__TSR_key||e.href;function gr(e){const n=[];let t;for(;t=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(t.children,e)+1})`),e=t;return`${n.reverse().join(" > ")}`.toLowerCase()}let ze=!1;function pr({storageKey:e,key:n,behavior:t,shouldScrollRestoration:r,scrollToTopSelectors:s,location:o}){var c,h;let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const a=n||((c=window.history.state)==null?void 0:c.__TSR_key),l=i[a];ze=!0;e:{if(r&&l&&Object.keys(l).length>0){for(const d in l){const m=l[d];if(d==="window")window.scrollTo({top:m.scrollY,left:m.scrollX,behavior:t});else if(d){const g=document.querySelector(d);g&&(g.scrollLeft=m.scrollX,g.scrollTop=m.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const d=((h=window.history.state)==null?void 0:h.__hashScrollIntoViewOptions)??!0;if(d){const m=document.getElementById(f);m&&m.scrollIntoView(d)}break e}const u={top:0,left:0,behavior:t};if(window.scrollTo(u),s)for(const d of s){if(d==="window")continue;const m=typeof d=="function"?d():document.querySelector(d);m&&m.scrollTo(u)}}ze=!1}function yr(e,n){if(!Fe||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Fe))return;e.isScrollRestorationSetup=!0,ze=!1;const r=e.options.getScrollRestorationKey||mr;window.history.scrollRestoration="manual";const s=o=>{if(ze||!e.isScrollRestoring)return;let i="";if(o.target===document||o.target===window)i="window";else{const l=o.target.getAttribute("data-scroll-restoration-id");l?i=`[data-scroll-restoration-id="${l}"]`:i=gr(o.target)}const a=r(e.state.location);Fe.set(l=>{const c=l[a]||(l[a]={}),h=c[i]||(c[i]={});if(i==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(i){const f=document.querySelector(i);f&&(h.scrollX=f.scrollLeft||0,h.scrollY=f.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",hr(s,100),!0),e.subscribe("onRendered",o=>{const i=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(pr({storageKey:mt,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Fe.set(a=>(a[i]||(a[i]={}),a)))})}function Sr(e){if(typeof document<"u"&&document.querySelector){const n=e.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&e.state.location.hash!==""){const t=document.getElementById(e.state.location.hash);t&&t.scrollIntoView(n)}}}function vr(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function st(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Pr(e){const n=new URLSearchParams(e),t={};for(const[r,s]of n.entries()){const o=t[r];o==null?t[r]=st(s):Array.isArray(o)?o.push(st(s)):t[r]=[o,st(s)]}return t}const _r=wr(JSON.parse),Rr=xr(JSON.stringify,JSON.parse);function wr(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=Pr(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function xr(e,n){const t=typeof n=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(t&&typeof s=="string")try{return n(s),e(s)}catch{}return s}return s=>{const o=vr(s,r);return o?`?${o}`:""}}const G="__root__";function Lr(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&$e(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${un.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function q(e){return e instanceof Response&&!!e.options}const Be=e=>{var n;if(!e.rendered)return e.rendered=!0,(n=e.onReady)==null?void 0:n.call(e)},qe=(e,n)=>!!(e.preload&&!e.router.state.matches.some(t=>t.id===n)),ge=(e,n,t=!0)=>{const r={...e.router.options.context??{}},s=t?n:n-1;for(let o=0;o<=s;o++){const i=e.matches[o];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},gn=(e,n)=>{var s;const t=e.router.routesById[n.routeId??""]??e.router.routeTree;!t.options.notFoundComponent&&((s=e.router.options)!=null&&s.defaultNotFoundComponent)&&(t.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ee(t.options.notFoundComponent);const r=e.matches.find(o=>o.routeId===t.id);ee(r,"Could not find match for route: "+t.id),e.updateMatch(r.id,o=>({...o,status:"notFound",error:n,isFetching:!1})),n.routerCode==="BEFORE_LOAD"&&t.parentRoute&&(n.routeId=t.parentRoute.id,gn(e,n))},re=(e,n,t)=>{var r,s,o;if(!(!q(t)&&!W(t))){if(q(t)&&t.redirectHandled&&!t.options.reloadDocument)throw t;if(n){(r=n._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=n._nonReactive.loaderPromise)==null||s.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const i=q(t)?"redirected":"notFound";n._nonReactive.error=t,e.updateMatch(n.id,a=>({...a,status:i,context:ge(e,n.index),isFetching:!1,error:t})),W(t)&&!t.routeId&&(t.routeId=n.routeId),(o=n._nonReactive.loadPromise)==null||o.resolve()}throw q(t)?(e.rendered=!0,t.options._fromLocation=e.location,t.redirectHandled=!0,t=e.router.resolveRedirect(t),t):(gn(e,t),t)}},pn=(e,n)=>!!e.router.getMatch(n)._nonReactive.dehydrated,_e=(e,n,t,r)=>{var a,l;const{id:s,routeId:o}=e.matches[n],i=e.router.looseRoutesById[o];if(t instanceof Promise)throw t;t.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=n),re(e,e.router.getMatch(s),t);try{(l=(a=i.options).onError)==null||l.call(a,t)}catch(c){t=c,re(e,e.router.getMatch(s),t)}e.updateMatch(s,c=>{var h,f;return(h=c._nonReactive.beforeLoadPromise)==null||h.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},yn=(e,n,t,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=t.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!qe(e,n)&&(t.options.loader||t.options.beforeLoad||Pn(t))&&typeof s=="number"&&s!==1/0&&(t.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent)))){const a=setTimeout(()=>{Be(e)},s);r._nonReactive.pendingTimeout=a}},br=(e,n,t)=>{const r=e.router.getMatch(n);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;yn(e,n,t,r);const s=()=>{const o=e.router.getMatch(n);o.preload&&(o.status==="redirected"||o.status==="notFound")&&re(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},Cr=(e,n,t,r)=>{const s=e.router.getMatch(n),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=pe(()=>{o==null||o.resolve()});const{paramsError:i,searchError:a}=s;i&&_e(e,t,i,"PARSE_PARAMS"),a&&_e(e,t,a,"VALIDATE_SEARCH"),yn(e,n,r,s);const l=new AbortController;let c=!1;const h=()=>{c||(c=!0,e.updateMatch(n,v=>({...v,isFetching:"beforeLoad",fetchCount:v.fetchCount+1,abortController:l})))},f=()=>{var v;(v=s._nonReactive.beforeLoadPromise)==null||v.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){be(()=>{h(),f()});return}s._nonReactive.beforeLoadPromise=pe();const u={...ge(e,t,!1),...s.__routeContext},{search:d,params:m,cause:g}=s,p=qe(e,n),S={search:d,abortController:l,params:m,preload:p,context:u,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:p?"preload":g,matches:e.matches,...e.router.options.additionalContext},P=v=>{if(v===void 0){be(()=>{h(),f()});return}(q(v)||W(v))&&(h(),_e(e,t,v,"BEFORE_LOAD")),be(()=>{h(),e.updateMatch(n,w=>({...w,__beforeLoadContext:v})),f()})};let L;try{if(L=r.options.beforeLoad(S),me(L))return h(),L.catch(v=>{_e(e,t,v,"BEFORE_LOAD")}).then(P)}catch(v){h(),_e(e,t,v,"BEFORE_LOAD")}P(L)},kr=(e,n)=>{const{id:t,routeId:r}=e.matches[n],s=e.router.looseRoutesById[r],o=()=>a(),i=()=>Cr(e,t,n,s),a=()=>{if(pn(e,t))return;const l=br(e,t,s);return me(l)?l.then(i):i()};return o()},Er=(e,n,t)=>{var o,i,a,l,c,h;const r=e.router.getMatch(n);if(!r||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(i=(o=t.options).head)==null?void 0:i.call(o,s),(l=(a=t.options).scripts)==null?void 0:l.call(a,s),(h=(c=t.options).headers)==null?void 0:h.call(c,s)]).then(([f,u,d])=>{const m=f==null?void 0:f.meta,g=f==null?void 0:f.links,p=f==null?void 0:f.scripts,S=f==null?void 0:f.styles;return{meta:m,links:g,headScripts:p,headers:d,scripts:u,styles:S}})},Sn=(e,n,t,r)=>{const s=e.matchPromises[t-1],{params:o,loaderDeps:i,abortController:a,cause:l}=e.router.getMatch(n),c=ge(e,t),h=qe(e,n);return{params:o,deps:i,preload:!!h,parentMatchPromise:s,abortController:a,context:c,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":l,route:r,...e.router.options.additionalContext}},Kt=async(e,n,t,r)=>{var s,o,i,a,l,c;try{const h=e.router.getMatch(n);try{(!(Kn??e.router.isServer)||h.ssr===!0)&&vn(r);const f=(o=(s=r.options).loader)==null?void 0:o.call(s,Sn(e,n,t,r)),u=r.options.loader&&me(f);if(!!(u||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||h._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),r.options.loader){const g=u?await f:f;re(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,p=>({...p,loaderData:g}))}r._lazyPromise&&await r._lazyPromise;const m=h._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:ge(e,t),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let u=f;if((u==null?void 0:u.name)==="AbortError"){e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:ge(e,t)}));return}const d=h._nonReactive.minPendingPromise;d&&await d,W(f)&&await((a=(i=r.options.notFoundComponent)==null?void 0:i.preload)==null?void 0:a.call(i)),re(e,e.router.getMatch(n),f);try{(c=(l=r.options).onError)==null||c.call(l,f)}catch(m){u=m,re(e,e.router.getMatch(n),m)}e.updateMatch(n,m=>({...m,error:u,context:ge(e,t),status:"error",isFetching:!1}))}}catch(h){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),re(e,f,h)}},Mr=async(e,n)=>{var c,h;const{id:t,routeId:r}=e.matches[n];let s=!1,o=!1;const i=e.router.looseRoutesById[r];if(!pn(e,t)){const f=e.router.getMatch(t);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const u=e.router.getMatch(t),d=u._nonReactive.error||u.error;d&&re(e,u,d)}else{const u=Date.now()-f.updatedAt,d=qe(e,t),m=d?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,g=i.options.shouldReload,p=typeof g=="function"?g(Sn(e,t,n,i)):g,S=!!d&&!e.router.state.matches.some(w=>w.id===t),P=e.router.getMatch(t);P._nonReactive.loaderPromise=pe(),S!==P.preload&&e.updateMatch(t,w=>({...w,preload:S}));const{status:L,invalid:v}=P;s=L==="success"&&(v||(p??u>m)),d&&i.options.preload===!1||(s&&!e.sync?(o=!0,(async()=>{var w,M;try{await Kt(e,t,n,i);const _=e.router.getMatch(t);(w=_._nonReactive.loaderPromise)==null||w.resolve(),(M=_._nonReactive.loadPromise)==null||M.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){q(_)&&await e.router.navigate(_.options)}})()):(L!=="success"||s&&e.sync)&&await Kt(e,t,n,i))}}const a=e.router.getMatch(t);o||((c=a._nonReactive.loaderPromise)==null||c.resolve(),(h=a._nonReactive.loadPromise)==null||h.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,o||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const l=o?a.isFetching:!1;return l!==a.isFetching||a.invalid!==!1?(e.updateMatch(t,f=>({...f,isFetching:l,invalid:!1})),e.router.getMatch(t)):a};async function Gt(e){const n=Object.assign(e,{matchPromises:[]});n.router.state.matches.some(t=>t._forcePending)&&Be(n);try{for(let a=0;a<n.matches.length;a++){const l=kr(n,a);me(l)&&await l}const t=n.firstBadMatchIndex??n.matches.length;for(let a=0;a<t;a++)n.matchPromises.push(Mr(n,a));const s=(await Promise.allSettled(n.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let o;for(const a of s){if(q(a))throw a;!o&&W(a)&&(o=a)}for(const a of n.matches){const{id:l,routeId:c}=a,h=n.router.looseRoutesById[c];try{const f=Er(n,l,h);if(f){const u=await f;n.updateMatch(l,d=>({...d,...u}))}}catch(f){console.error(`Error executing head for route ${c}:`,f)}}if(o)throw o;const i=Be(n);me(i)&&await i}catch(t){if(W(t)&&!n.preload){const r=Be(n);throw me(r)&&await r,t}if(q(t))throw t}return n.matches}async function vn(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(n=>{const{id:t,...r}=n.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const n=()=>{var r;const t=[];for(const s of _n){const o=(r=e.options[s])==null?void 0:r.preload;o&&t.push(o())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(n):n()}return e._componentsPromise}function Pn(e){var n;for(const t of _n)if((n=e.options[t])!=null&&n.preload)return!0;return!1}const _n=["component","errorComponent","pendingComponent","notFoundComponent"];function Tr(e){return{input:({url:n})=>{for(const t of e)n=gt(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=Rn(e[t],n);return n}}}function Ir(e){const n=mn(e.basepath),t=`/${n}`,r=`${t}/`,s=e.caseSensitive?t:t.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===s?i.pathname="/":a.startsWith(o)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=De(["/",n,i.pathname]),i)}}function gt(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function Rn(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function le(e){const n=e.resolvedLocation,t=e.location,r=(n==null?void 0:n.pathname)!==t.pathname,s=(n==null?void 0:n.href)!==t.href,o=(n==null?void 0:n.hash)!==t.hash;return{fromLocation:n,toLocation:t,pathChanged:r,hrefChanged:s,hashChanged:o}}class Or{constructor(n){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=t=>t(),this.update=t=>{var u;t.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 r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",o=this.basepath===void 0,i=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ur(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Wn()),this.origin=this.options.origin,this.origin||(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;let d;this.resolvePathCache=He(1e3),d=this.buildRouteTree(),this.setRoutes(d)}!this.__store&&this.latestLocation&&(this.__store=new $n(Ar(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),yr(this));let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(o||s!==l||i!==c){this.basepath=l;const d=[],m=mn(l);m&&m!=="/"&&d.push(Ir({basepath:l})),c&&d.push(c),this.rewrite=d.length===0?void 0:d.length===1?d[0]:Tr(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((u=window.CSS)==null?void 0:u.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 t=sr(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&Qn(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{this.subscribers.forEach(r=>{r.eventType===t.type&&r.fn(t)})},this.parseLocation=(t,r)=>{const s=({pathname:l,search:c,hash:h,href:f,state:u})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const P=this.options.parseSearch(c),L=this.options.stringifySearch(P);return{href:l+L+h,publicHref:f,pathname:ve(l),external:!1,searchStr:L,search:$(r==null?void 0:r.search,P),hash:ve(h.slice(1)),state:$(r==null?void 0:r.state,u)}}const d=new URL(f,this.origin),m=gt(this.rewrite,d),g=this.options.parseSearch(m.search),p=this.options.stringifySearch(g);return m.search=p,{href:m.href.replace(m.origin,""),publicHref:f,pathname:ve(m.pathname),external:!!this.rewrite&&m.origin!==this.origin,searchStr:p,search:$(r==null?void 0:r.search,g),hash:ve(m.hash.slice(1)),state:$(r==null?void 0:r.state,u)}},o=s(t),{__tempLocation:i,__tempKey:a}=o.state;if(i&&(!a||a===this.tempLocationKey)){const l=s(i);return l.state.key=o.state.key,l.state.__TSR_key=o.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:o}}return o},this.resolvePathWithBase=(t,r)=>lr({base:t,to:Pt(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>Dr({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const r=this.getMatch(t);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=t=>{const r=(o={})=>{var O,N;const i=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);o.from;const l=o.unsafeRelative==="path"?i.pathname:o.from??a.fullPath,c=this.resolvePathWithBase(l,"."),h=a.search,f={...a.params},u=o.to?this.resolvePathWithBase(c,`${o.to}`):this.resolvePathWithBase(c,"."),d=o.params===!1||o.params===null?{}:(o.params??!0)===!0?f:Object.assign(f,ne(o.params,f)),m=rt({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,g=this.getMatchedRoutes(m);let p=g.matchedRoutes;(g.foundRoute?g.foundRoute.path!=="/"&&g.routeParams["**"]:Q(m))&&this.options.notFoundRoute&&(p=[...p,this.options.notFoundRoute]);let P=!1;if(Object.keys(d).length>0)for(const I of p){const b=((O=I.options.params)==null?void 0:O.stringify)??I.options.stringifyParams;b&&(P=!0,Object.assign(d,b(d)))}const L=t.leaveParams?u:ve(P?rt({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:m);let v=h;if(t._includeValidateSearch&&((N=this.options.search)!=null&&N.strict)){const I={};p.forEach(b=>{if(b.options.validateSearch)try{Object.assign(I,Ne(b.options.validateSearch,{...I,...v}))}catch{}}),v=I}v=Br({search:v,dest:o,destRoutes:p,_includeValidateSearch:t._includeValidateSearch}),v=$(h,v);const w=this.options.stringifySearch(v),M=o.hash===!0?i.hash:o.hash?ne(o.hash,i.hash):void 0,_=M?`#${M}`:"";let k=o.state===!0?i.state:o.state?ne(o.state,i.state):{};k=$(i.state,k);const C=`${L}${w}${_}`;let y,R,T=!1;if(this.rewrite){const I=new URL(C,this.origin),b=Rn(this.rewrite,I);y=I.href.replace(I.origin,""),b.origin!==this.origin?(R=b.href,T=!0):R=b.pathname+b.search+b.hash}else y=Jn(C),R=y;return{publicHref:R,href:y,pathname:L,search:v,searchStr:w,state:k,hash:M??"",external:T,unmaskOnReload:o.unmaskOnReload}},s=(o={},i)=>{const a=r(o);let l=i?r(i):void 0;if(!l){const c={};if(this.options.routeMasks){const h=er(a.pathname,this.processedTree);if(h){Object.assign(c,h.rawParams);const{from:f,params:u,...d}=h.route,m=u===!1||u===null?{}:(u??!0)===!0?c:Object.assign(c,ne(u,c));i={from:t.from,...d,params:m},l=r(i)}}}return l&&(a.maskedLocation=l),a};return t.mask?s(t,{from:t.from,...t.mask}):s(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{const o=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(h=>{s.state[h]=this.latestLocation.state[h]});const c=ce(s.state,this.latestLocation.state);return l.forEach(h=>{delete s.state[h]}),c},i=Q(this.latestLocation.href)===Q(s.href),a=this.commitLocationPromise;if(this.commitLocationPromise=pe(()=>{a==null||a.resolve()}),i&&o())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...h}=s;l&&(h={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[s.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:i,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,u=Ue(a,{__TSR_index:t?f:f+1}),d=new URL(u.pathname,this.origin),m=gt(this.rewrite,d);l.to=m.pathname,l.search=this.options.parseSearch(u.search),l.hash=u.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const h=this.commitLocation({...c,viewTransition:o,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:o,...i})=>{var l;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(t!==void 0||!s){const h=this.buildLocation({to:t,...i});s=s??h.publicHref,o=o??h.publicHref}const c=!a&&o?o:s;if($e(c))return Promise.resolve();if(!i.ignoreBlocker){const h=this.history,f=((l=h.getBlockers)==null?void 0:l.call(h))??[];for(const u of f)if(u!=null&&u.blockerFn&&await u.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:s,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:r.cachedMatches.filter(s=>!t.some(o=>o.id===s.id))}))},this.load=async t=>{let r,s,o;for(o=new Promise(a=>{this.startTransition(async()=>{var l;try{this.beforeLoad();const c=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...le({resolvedLocation:h,location:c})}),this.emit({type:"onBeforeLoad",...le({resolvedLocation:h,location:c})}),await Gt({router:this,sync:t==null?void 0:t.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],u=[],d=[];be(()=>{this.__store.setState(m=>{const g=m.matches,p=m.pendingMatches||m.matches;return f=g.filter(S=>!p.some(P=>P.id===S.id)),u=p.filter(S=>!g.some(P=>P.id===S.id)),d=p.filter(S=>g.some(P=>P.id===S.id)),{...m,isLoading:!1,loadedAt:Date.now(),matches:p,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...f.filter(S=>S.status!=="error"&&S.status!=="notFound")]}}),this.clearExpiredCache()}),[[f,"onLeave"],[u,"onEnter"],[d,"onStay"]].forEach(([m,g])=>{m.forEach(p=>{var S,P;(P=(S=this.looseRoutesById[p.routeId].options)[g])==null||P.call(S,p)})})})})}})}catch(c){q(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):W(c)&&(s=c),this.__store.setState(h=>({...h,statusCode:r?r.status:s?404:h.matches.some(f=>f.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&((l=this.commitLocationPromise)==null||l.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=t=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(le({resolvedLocation:i,location:o})):r.types;if(a===!1){t();return}s={update:t,types:a}}else s=t;document.startViewTransition(s)}else t()},this.updateMatch=(t,r)=>{this.startTransition(()=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";s&&this.__store.setState(i=>{var a;return{...i,[s]:(a=i[s])==null?void 0:a.map(l=>l.id===t?r(l):l)}})})},this.getMatch=t=>{var s;const r=o=>o.id===t;return this.state.cachedMatches.find(r)??((s=this.state.pendingMatches)==null?void 0:s.find(r))??this.state.matches.find(r)},this.invalidate=t=>{const r=s=>{var o;return((o=t==null?void 0:t.filter)==null?void 0:o.call(t,s))??!0?{...s,invalid:!0,...t!=null&&t.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var o;return{...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:(o=s.pendingMatches)==null?void 0:o.map(r)}}),this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const r=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const s=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(s);t.options.href=o,t.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;t.options.href=o,t.headers.set("Location",o)}}catch{}return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const r=t==null?void 0:t.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!r(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const o=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:t})},this.loadRouteChunk=vn,this.preloadRoute=async t=>{const r=this.buildLocation(t);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:t});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...o,...this.state.cachedMatches.map(a=>a.id)]);be(()=>{s.forEach(a=>{i.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return s=await Gt({router:this,matches:s,location:r,preload:!0,updateMatch:(a,l)=>{o.has(a)?s=s.map(c=>c.id===a?l(c):c):this.updateMatch(a,l)}}),s}catch(a){if(q(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});W(a)||console.error(a);return}},this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},o=this.buildLocation(s);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const a=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=tr(o.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,a.pathname,this.processedTree);return!l||t.params&&!ce(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ce(a.search,o.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??"fuzzy",stringifySearch:n.stringifySearch??Rr,parseSearch:n.parseSearch??_r}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:n,routesByPath:t,processedTree:r}){this.routesById=n,this.routesByPath=t,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}matchRoutesInternal(n,t){const r=this.getMatchedRoutes(n.pathname),{foundRoute:s,routeParams:o,parsedParams:i}=r;let{matchedRoutes:a}=r,l=!1;(s?s.path!=="/"&&o["**"]:Q(n.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?jr(this.options.notFoundMode,a):void 0,h=[],f=u=>(u==null?void 0:u.id)?u.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((u,d)=>{var N,I;const m=h[d-1],[g,p,S]=(()=>{const b=(m==null?void 0:m.search)??n.search,F=(m==null?void 0:m._strictSearch)??void 0;try{const D=Ne(u.options.validateSearch,{...b})??void 0;return[{...b,...D},{...F,...D},void 0]}catch(D){let U=D;if(D instanceof Ke||(U=new Ke(D.message,{cause:D})),t!=null&&t.throwOnError)throw U;return[b,{},U]}})(),P=((I=(N=u.options).loaderDeps)==null?void 0:I.call(N,{search:g}))??"",L=P?JSON.stringify(P):"",{interpolatedPath:v,usedParams:w}=rt({path:u.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),M=u.id+v+L,_=this.getMatch(M),k=this.state.matches.find(b=>b.routeId===u.id),C=(_==null?void 0:_._strictParams)??w;let y;if(!_)try{qt(u,w,i,C)}catch(b){if(W(b)||q(b)?y=b:y=new Fr(b.message,{cause:b}),t!=null&&t.throwOnError)throw y}Object.assign(o,C);const R=k?"stay":"enter";let T;if(_)T={..._,cause:R,params:k?$(k.params,o):o,_strictParams:C,search:$(k?k.search:_.search,g),_strictSearch:p};else{const b=u.options.loader||u.options.beforeLoad||u.lazyFn||Pn(u)?"pending":"success";T={id:M,ssr:u.options.ssr,index:d,routeId:u.id,params:k?$(k.params,o):o,_strictParams:C,pathname:v,updatedAt:Date.now(),search:k?$(k.search,g):g,_strictSearch:p,searchError:void 0,status:b,isFetching:!1,error:void 0,paramsError:y,__routeContext:void 0,_nonReactive:{loadPromise:pe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:R,loaderDeps:k?$(k.loaderDeps,P):P,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}t!=null&&t.preload||(T.globalNotFound=c===u.id),T.searchError=S;const O=f(m);T.context={...O,...T.__routeContext,...T.__beforeLoadContext},h.push(T)}),h.forEach((u,d)=>{const m=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)){const p=h[d-1],S=f(p);if(m.options.context){const P={deps:u.loaderDeps,params:u.params,context:S??{},location:n,navigate:L=>this.navigate({...L,_fromLocation:n}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:h};u.__routeContext=m.options.context(P)??void 0}u.context={...S,...u.__routeContext,...u.__beforeLoadContext}}}),h}matchRoutesLightweight(n){const{matchedRoutes:t,routeParams:r,parsedParams:s}=this.getMatchedRoutes(n.pathname),o=ke(t),i={...n.search};for(const h of t)try{Object.assign(i,Ne(h.options.validateSearch,i))}catch{}const a=ke(this.state.matches),l=a&&a.routeId===o.id&&n.pathname===this.state.location.pathname;let c;if(l)c=a.params;else{const h={...r};for(const f of t)try{qt(f,r,s??{},h)}catch{}c=h}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:c}}}class Ke extends Error{}class Fr extends Error{}function Ar(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ne(e,n){if(e==null)return{};if("~standard"in e){const t=e["~standard"].validate(n);if(t instanceof Promise)throw new Ke("Async validation not supported");if(t.issues)throw new Ke(JSON.stringify(t.issues,void 0,2),{cause:t});return t.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function Dr({pathname:e,routesById:n,processedTree:t}){const r={},s=Q(e);let o,i;const a=nr(s,t,!0);return a&&(o=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[n[G]],routeParams:r,foundRoute:o,parsedParams:i}}function Br({search:e,dest:n,destRoutes:t,_includeValidateSearch:r}){return Nr(t)(e,n,r??!1)}function Nr(e){var s;const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(s=o.options.search)!=null&&s.middlewares&&n.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const i=({search:a,next:l})=>{let c=a;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((f,u)=>u(f),a));const h=l(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,u)=>u(f),h):h};n.middlewares.push(i)}if(o.options.validateSearch){const i=({search:a,next:l})=>{const c=l(a);if(!n._includeValidateSearch)return c;try{return{...c,...Ne(o.options.validateSearch,c)??void 0}}catch{return c}};n.middlewares.push(i)}}const t=({search:o})=>{const i=n.dest;return i.search?i.search===!0?o:ne(i.search,o):{}};n.middlewares.push(t);const r=(o,i,a)=>{if(o>=a.length)return i;const l=a[o];return l({search:i,next:h=>r(o+1,h,a)})};return function(i,a,l){return n.dest=a,n._includeValidateSearch=l,r(0,i,n.middlewares)}}function jr(e,n){if(e!=="root")for(let t=n.length-1;t>=0;t--){const r=n[t];if(r.children)return r.id}return G}function qt(e,n,t,r){var o;const s=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const i in n)i in t&&(r[i]=t[i]);else{const i=s(r);Object.assign(r,i)}}const Ur="Error preloading route! ☝️";class wn{constructor(n){if(this.init=t=>{var c,h;this.originalIndex=t.originalIndex;const r=this.options,s=!(r!=null&&r.path)&&!(r!=null&&r.id);this.parentRoute=(h=(c=this.options).getParentRoute)==null?void 0:h.call(c),s?this._path=G:this.parentRoute||ee(!1);let o=s?G:r==null?void 0:r.path;o&&o!=="/"&&(o=dn(o));const i=(r==null?void 0:r.id)||o;let a=s?G:De([this.parentRoute.id===G?"":this.parentRoute.id,i]);o===G&&(o="/"),a!==G&&(a=De(["/",a]));const l=a===G?"/":De([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=l,this._to=Q(l)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Lr({from:this.fullPath,...t}),this.options=n||{},this.isRoot=!(n!=null&&n.getParentRoute),n!=null&&n.id&&(n!=null&&n.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 Vr extends wn{constructor(n){super(n)}}const Ae=typeof window<"u"?E.useLayoutEffect:E.useEffect;function ot(e){const n=E.useRef({value:e,prev:null}),t=n.current.value;return e!==t&&(n.current={value:e,prev:t}),n.current.prev}function $r(e,n,t={},r={}){E.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{n(o)},t);return s.observe(e.current),()=>{s.disconnect()}},[n,t,r.disabled,e])}function Hr(e){const n=E.useRef(null);return E.useImperativeHandle(e,()=>n.current,[]),n}function _t(e){const n=e.errorComponent??Rt;return x.jsx(Wr,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:r})=>t?E.createElement(n,{error:t,reset:r}):e.children})}class Wr extends E.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(n){return{resetKey:n.getResetKey()}}static getDerivedStateFromError(n){return{error:n}}reset(){this.setState({error:null})}componentDidUpdate(n,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(n,t){this.props.onCatch&&this.props.onCatch(n,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Rt({error:e}){const[n,t]=E.useState(!1);return x.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[x.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),x.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),x.jsx("div",{style:{height:".25rem"}}),n?x.jsx("div",{children:x.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?x.jsx("code",{children:e.message}):null})}):null]})}function zr({children:e,fallback:n=null}){return xn()?x.jsx(Ce.Fragment,{children:e}):x.jsx(Ce.Fragment,{children:n})}function xn(){return Ce.useSyncExternalStore(Kr,()=>!0,()=>!1)}function Kr(){return()=>{}}var it={exports:{}},at={},ct={exports:{}},lt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.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 Yt;function Gr(){if(Yt)return lt;Yt=1;var e=pt();function n(f,u){return f===u&&(f!==0||1/f===1/u)||f!==f&&u!==u}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(f,u){var d=u(),m=r({inst:{value:d,getSnapshot:u}}),g=m[0].inst,p=m[1];return o(function(){g.value=d,g.getSnapshot=u,l(g)&&p({inst:g})},[f,d,u]),s(function(){return l(g)&&p({inst:g}),f(function(){l(g)&&p({inst:g})})},[f]),i(d),d}function l(f){var u=f.getSnapshot;f=f.value;try{var d=u();return!t(f,d)}catch{return!0}}function c(f,u){return u()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return lt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,lt}var Jt;function qr(){return Jt||(Jt=1,ct.exports=Gr()),ct.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim/with-selector.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 Xt;function Yr(){if(Xt)return at;Xt=1;var e=pt(),n=qr();function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return at.useSyncExternalStoreWithSelector=function(c,h,f,u,d){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function S(M){if(!P){if(P=!0,L=M,M=u(M),d!==void 0&&g.hasValue){var _=g.value;if(d(_,M))return v=_}return v=M}if(_=v,r(L,M))return _;var k=u(M);return d!==void 0&&d(_,k)?(L=M,_):(L=M,v=k)}var P=!1,L,v,w=f===void 0?null:f;return[function(){return S(h())},w===null?void 0:function(){return S(w())}]},[h,f,u,d]);var p=s(c,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=p},[p]),l(p),p},at}var Zt;function Jr(){return Zt||(Zt=1,it.exports=Yr()),it.exports}var Ln=Jr();const Cs=Dn(Ln);function Xr(e,n=r=>r,t={}){const r=t.equal??Zr;return Ln.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,n,r)}function Zr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!n.has(r)||!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();const t=Qt(e);if(t.length!==Qt(n).length)return!1;for(let r=0;r<t.length;r++)if(!Object.prototype.hasOwnProperty.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0}function Qt(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ut=E.createContext(null);function bn(){return typeof document>"u"?ut:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ut,ut)}function K(e){const n=E.useContext(bn());return e==null||e.warn,n}function z(e){const n=K({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n,r=E.useRef(void 0);return Xr(t.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??t.options.defaultStructuralSharing){const o=$(r.current,e.select(s));return r.current=o,o}return e.select(s)}return s})}const Ye=E.createContext(void 0),Qr=E.createContext(void 0);function X(e){const n=E.useContext(e.from?Qr:Ye);return z({select:r=>{const s=r.matches.find(o=>e.from?e.from===o.routeId:o.id===n);if(ee(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function wt(e){return X({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function xt(e){const{select:n,...t}=e;return X({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function Lt(e){return X({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function bt(e){return X({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Ct(e){const n=K();return E.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}var ft={exports:{}},j={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom.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 en;function es(){if(en)return j;en=1;var e=pt();function n(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var r={d:{f:t,r:function(){throw Error(n(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(l,c,h){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:l,containerInfo:c,implementation:h}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return j.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,j.createPortal=function(l,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(n(299));return o(l,c,null,h)},j.flushSync=function(l){var c=i.T,h=r.p;try{if(i.T=null,r.p=2,l)return l()}finally{i.T=c,r.p=h,r.d.f()}},j.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(l,c))},j.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},j.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var h=c.as,f=a(h,c.crossOrigin),u=typeof c.integrity=="string"?c.integrity:void 0,d=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?r.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:f,integrity:u,fetchPriority:d}):h==="script"&&r.d.X(l,{crossOrigin:f,integrity:u,fetchPriority:d,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},j.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=a(c.as,c.crossOrigin);r.d.M(l,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(l)},j.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,f=a(h,c.crossOrigin);r.d.L(l,h,{crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},j.preloadModule=function(l,c){if(typeof l=="string")if(c){var h=a(c.as,c.crossOrigin);r.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(l)},j.requestFormReset=function(l){r.d.r(l)},j.unstable_batchedUpdates=function(l,c){return l(c)},j.useFormState=function(l,c,h){return i.H.useFormState(l,c,h)},j.useFormStatus=function(){return i.H.useHostTransitionStatus()},j.version="19.2.4",j}var tn;function ts(){if(tn)return ft.exports;tn=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),ft.exports=es(),ft.exports}var ns=ts();function rs(e,n){const t=K(),r=Hr(n),{activeProps:s,inactiveProps:o,activeOptions:i,to:a,preload:l,preloadDelay:c,hashScrollIntoView:h,replace:f,startTransition:u,resetScroll:d,viewTransition:m,children:g,target:p,disabled:S,style:P,className:L,onClick:v,onFocus:w,onMouseEnter:M,onMouseLeave:_,onTouchStart:k,ignoreBlocker:C,params:y,search:R,hash:T,state:O,mask:N,reloadDocument:I,unsafeRelative:b,from:F,_fromLocation:D,...U}=e,H=xn(),B=z({select:A=>A.location.search,structuralSharing:!0}),kt=e.from,Se=E.useMemo(()=>({...e,from:kt}),[t,B,kt,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=E.useMemo(()=>t.buildLocation({...Se}),[t,Se]),Et=J.maskedLocation?J.maskedLocation.publicHref:J.publicHref,Mt=J.maskedLocation?J.maskedLocation.external:J.external,Z=E.useMemo(()=>ls(Et,Mt,t.history,S),[S,Mt,Et,t.history]),Me=E.useMemo(()=>{if(Z!=null&&Z.external)return $e(Z.href)?void 0:Z.href;if(!us(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),$e(a)?void 0:a}catch{}},[a,Z]),Je=z({select:A=>{if(Me)return!1;if(i!=null&&i.exact){if(!cr(A.location.pathname,J.pathname,t.basepath))return!1}else{const V=We(A.location.pathname,t.basepath),Y=We(J.pathname,t.basepath);if(!(V.startsWith(Y)&&(V.length===Y.length||V[Y.length]==="/")))return!1}return((i==null?void 0:i.includeSearch)??!0)&&!ce(A.location.search,J.search,{partial:!(i!=null&&i.exact),ignoreUndefined:!(i!=null&&i.explicitUndefined)})?!1:i!=null&&i.includeHash?H&&A.location.hash===J.hash:!0}}),Te=Je?ne(s,{})??ss:ht,Ie=Je?ht:ne(o,{})??ht,Tt=[L,Te.className,Ie.className].filter(Boolean).join(" "),It=(P||Te.style||Ie.style)&&{...P,...Te.style,...Ie.style},[Mn,Ot]=E.useState(!1),Ft=E.useRef(!1),he=e.reloadDocument||Me?!1:l??t.options.defaultPreload,Xe=c??t.options.defaultPreloadDelay??0,oe=E.useCallback(()=>{t.preloadRoute({...Se}).catch(A=>{console.warn(A),console.warn(Ur)})},[t,Se]),Tn=E.useCallback(A=>{A!=null&&A.isIntersecting&&oe()},[oe]);$r(r,Tn,cs,{disabled:!!S||he!=="viewport"}),E.useEffect(()=>{Ft.current||!S&&he==="render"&&(oe(),Ft.current=!0)},[S,oe,he]);const In=A=>{const V=A.currentTarget.getAttribute("target"),Y=p!==void 0?p:V;if(!S&&!fs(A)&&!A.defaultPrevented&&(!Y||Y==="_self")&&A.button===0){A.preventDefault(),ns.flushSync(()=>{Ot(!0)});const Dt=t.subscribe("onResolved",()=>{Dt(),Ot(!1)});t.navigate({...Se,replace:f,resetScroll:d,hashScrollIntoView:h,startTransition:u,viewTransition:m,ignoreBlocker:C})}};if(Me)return{...U,ref:r,href:Me,...g&&{children:g},...p&&{target:p},...S&&{disabled:S},...P&&{style:P},...L&&{className:L},...v&&{onClick:v},...w&&{onFocus:w},...M&&{onMouseEnter:M},..._&&{onMouseLeave:_},...k&&{onTouchStart:k}};const At=A=>{S||he&&oe()},On=At,Fn=A=>{if(!(S||!he))if(!Xe)oe();else{const V=A.target;if(Re.has(V))return;const Y=setTimeout(()=>{Re.delete(V),oe()},Xe);Re.set(V,Y)}},An=A=>{if(S||!he||!Xe)return;const V=A.target,Y=Re.get(V);Y&&(clearTimeout(Y),Re.delete(V))};return{...U,...Te,...Ie,href:Z==null?void 0:Z.href,ref:r,onClick:we([v,In]),onFocus:we([w,At]),onMouseEnter:we([M,Fn]),onMouseLeave:we([_,An]),onTouchStart:we([k,On]),disabled:!!S,target:p,...It&&{style:It},...Tt&&{className:Tt},...S&&os,...Je&&is,...H&&Mn&&as}}const ht={},ss={className:"active"},os={role:"link","aria-disabled":!0},is={"data-status":"active","aria-current":"page"},as={"data-transitioning":"transitioning"},Re=new WeakMap,cs={rootMargin:"100px"},we=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function ls(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function us(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}const Cn=E.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...o}=rs(r,n),i=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!t){const{disabled:a,...l}=o;return E.createElement("a",l,i)}return E.createElement(t,o,i)});function fs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class hs extends wn{constructor(n){super(n),this.useMatch=t=>X({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X({...t,from:this.id,select:r=>t!=null&&t.select?t.select(r.context):r.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>xt({...t,from:this.id}),this.useLoaderData=t=>wt({...t,from:this.id}),this.useNavigate=()=>Ct({from:this.fullPath}),this.Link=Ce.forwardRef((t,r)=>x.jsx(Cn,{ref:r,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function ds(e){return new hs(e)}function ks(){return e=>gs(e)}class ms extends Vr{constructor(n){super(n),this.useMatch=t=>X({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X({...t,from:this.id,select:r=>t!=null&&t.select?t.select(r.context):r.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>xt({...t,from:this.id}),this.useLoaderData=t=>wt({...t,from:this.id}),this.useNavigate=()=>Ct({from:this.fullPath}),this.Link=Ce.forwardRef((t,r)=>x.jsx(Cn,{ref:r,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function gs(e){return new ms(e)}function nn(e){return typeof e=="object"?new rn(e,{silent:!0}).createRoute(e):new rn(e,{silent:!0}).createRoute}class rn{constructor(n,t){this.path=n,this.createRoute=r=>{this.silent;const s=ds(r);return s.isRoot=!1,s},this.silent=t==null?void 0:t.silent}}class sn{constructor(n){this.useMatch=t=>X({select:t==null?void 0:t.select,from:this.options.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X({from:this.options.id,select:r=>t!=null&&t.select?t.select(r.context):r.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.options.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>xt({...t,from:this.options.id}),this.useLoaderData=t=>wt({...t,from:this.options.id}),this.useNavigate=()=>{const t=K();return Ct({from:t.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function on(e){return typeof e=="object"?new sn(e):n=>new sn({id:e,...n})}function ps(){const e=K(),n=E.useRef({router:e,mounted:!1}),[t,r]=E.useState(!1),{hasPendingMatches:s,isLoading:o}=z({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(u=>u.status==="pending")}),structuralSharing:!0}),i=ot(o),a=o||t||s,l=ot(a),c=o||s,h=ot(c);return e.startTransition=f=>{r(!0),E.startTransition(()=>{f(),r(!1)})},E.useEffect(()=>{const f=e.history.subscribe(e.load),u=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Q(e.latestLocation.publicHref)!==Q(u.publicHref)&&e.commitLocation({...u,replace:!0}),()=>{f()}},[e,e.history]),Ae(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(u){console.error(u)}})()},[e]),Ae(()=>{i&&!o&&e.emit({type:"onLoad",...le(e.state)})},[i,e,o]),Ae(()=>{h&&!c&&e.emit({type:"onBeforeRouteMount",...le(e.state)})},[c,h,e]),Ae(()=>{if(l&&!a){const f=le(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(u=>({...u,status:"idle",resolvedLocation:u.location})),f.hrefChanged&&Sr(e)}},[a,l,e]),null}function ys(e){const n=z({select:t=>`not-found-${t.location.pathname}-${t.status}`});return x.jsx(_t,{getResetKey:()=>n,onCatch:(t,r)=>{var s;if(W(t))(s=e.onCatch)==null||s.call(e,t,r);else throw t},errorComponent:({error:t})=>{var r;if(W(t))return(r=e.fallback)==null?void 0:r.call(e,t);throw t},children:e.children})}function Ss(){return x.jsx("p",{children:"Not Found"})}function de(e){return x.jsx(x.Fragment,{children:e.children})}function kn(e,n,t){return n.options.notFoundComponent?x.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...t}):x.jsx(Ss,{})}function vs(){return K().isScrollRestoring,null}const En=E.memo(function({matchId:n}){var g,p;const t=K(),r=z({select:S=>{var v;const P=S.matches.findIndex(w=>w.id===n),L=S.matches[P];return ee(L),{routeId:L.routeId,ssr:L.ssr,_displayPending:L._displayPending,resetKey:S.loadedAt,parentRouteId:(v=S.matches[P-1])==null?void 0:v.routeId}},structuralSharing:!0}),s=t.routesById[r.routeId],o=s.options.pendingComponent??t.options.defaultPendingComponent,i=o?x.jsx(o,{}):null,a=s.options.errorComponent??t.options.defaultErrorComponent,l=s.options.onCatch??t.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((g=t.options.notFoundRoute)==null?void 0:g.options.component):s.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||h)&&(s.options.wrapInSuspense??o??(((p=s.options.errorComponent)==null?void 0:p.preload)||h))?E.Suspense:de,u=a?_t:de,d=c?ys:de,m=s.isRoot?s.options.shellComponent??de:de;return x.jsxs(m,{children:[x.jsx(Ye.Provider,{value:n,children:x.jsx(f,{fallback:i,children:x.jsx(u,{getResetKey:()=>r.resetKey,errorComponent:a||Rt,onCatch:(S,P)=>{if(W(S))throw S;l==null||l(S,P)},children:x.jsx(d,{fallback:S=>{if(!c||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!s.isRoot)throw S;return E.createElement(c,S)},children:h||r._displayPending?x.jsx(zr,{fallback:i,children:x.jsx(an,{matchId:n})}):x.jsx(an,{matchId:n})})})})}),r.parentRouteId===G&&t.options.scrollRestoration?x.jsxs(x.Fragment,{children:[x.jsx(Ps,{}),x.jsx(vs,{})]}):null]})});function Ps(){const e=K(),n=E.useRef(void 0);return x.jsx("script",{suppressHydrationWarning:!0,ref:t=>{t&&(n.current===void 0||n.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...le(e.state)}),n.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const an=E.memo(function({matchId:n}){var l,c,h,f;const t=K(),{match:r,key:s,routeId:o}=z({select:u=>{const d=u.matches.find(P=>P.id===n),m=d.routeId,g=t.routesById[m].options.remountDeps??t.options.defaultRemountDeps,p=g==null?void 0:g({routeId:m,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:p?JSON.stringify(p):void 0,routeId:m,match:{id:d.id,status:d.status,error:d.error,invalid:d.invalid,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),i=t.routesById[o],a=E.useMemo(()=>{const u=i.options.component??t.options.defaultComponent;return u?x.jsx(u,{},s):x.jsx(_s,{})},[s,i.options.component,t.options.defaultComponent]);if(r._displayPending)throw(l=t.getMatch(r.id))==null?void 0:l._nonReactive.displayPendingPromise;if(r._forcePending)throw(c=t.getMatch(r.id))==null?void 0:c._nonReactive.minPendingPromise;if(r.status==="pending"){const u=i.options.pendingMinMs??t.options.defaultPendingMinMs;if(u){const d=t.getMatch(r.id);if(d&&!d._nonReactive.minPendingPromise){const m=pe();d._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),d._nonReactive.minPendingPromise=void 0},u)}}throw(h=t.getMatch(r.id))==null?void 0:h._nonReactive.loadPromise}if(r.status==="notFound")return ee(W(r.error)),kn(t,i,r.error);if(r.status==="redirected")throw ee(q(r.error)),(f=t.getMatch(r.id))==null?void 0:f._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),_s=E.memo(function(){const n=K(),t=E.useContext(Ye),r=z({select:c=>{var h;return(h=c.matches.find(f=>f.id===t))==null?void 0:h.routeId}}),s=n.routesById[r],o=z({select:c=>{const f=c.matches.find(u=>u.id===t);return ee(f),f.globalNotFound}}),i=z({select:c=>{var u;const h=c.matches,f=h.findIndex(d=>d.id===t);return(u=h[f+1])==null?void 0:u.id}}),a=n.options.defaultPendingComponent?x.jsx(n.options.defaultPendingComponent,{}):null;if(o)return kn(n,s,void 0);if(!i)return null;const l=x.jsx(En,{matchId:i});return r===G?x.jsx(E.Suspense,{fallback:a,children:l}):l});function Rs(){const e=K(),t=e.routesById[G].options.pendingComponent??e.options.defaultPendingComponent,r=t?x.jsx(t,{}):null,s=typeof document<"u"&&e.ssr?de:E.Suspense,o=x.jsxs(s,{fallback:r,children:[x.jsx(ps,{}),x.jsx(ws,{})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:o}):o}function ws(){const e=K(),n=z({select:s=>{var o;return(o=s.matches[0])==null?void 0:o.id}}),t=z({select:s=>s.loadedAt}),r=n?x.jsx(En,{matchId:n}):null;return x.jsx(Ye.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?r:x.jsx(_t,{getResetKey:()=>t,errorComponent:Rt,onCatch:s=>{s.message||s.toString()},children:r})})}function Es(){const e=K();return z({select:n=>{var t;return[n.location.href,(t=n.resolvedLocation)==null?void 0:t.href,n.status]},structuralSharing:!0}),E.useCallback(n=>{const{pending:t,caseSensitive:r,fuzzy:s,includeSearch:o,...i}=n;return e.matchRoute(i,{pending:t,caseSensitive:r,fuzzy:s,includeSearch:o})},[e])}const Ms=e=>new xs(e);class xs extends Or{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=nn,globalThis.createLazyFileRoute=on):typeof window<"u"&&(window.createFileRoute=nn,window.createLazyFileRoute=on);function Ls({router:e,children:n,...t}){Object.keys(t).length>0&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=bn(),s=x.jsx(r.Provider,{value:e,children:n});return e.options.Wrap?x.jsx(e.options.Wrap,{children:s}):s}function Ts({router:e,...n}){return x.jsx(Ls,{router:e,...n,children:x.jsx(Rs,{})})}export{Cn as L,_s as O,Ts as R,Es as a,Ct as b,ks as c,nn as d,ns as e,Ms as f,ee as i,ts as r,Cs as u};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 32" width="32" height="32" fill="none">
|
|
2
|
+
<!-- Real Blok mark — sliced from docs/assets/logo/dark.svg paths 1-3.
|
|
3
|
+
Three rotated rhombus glyphs in brand green #2BCD71, no background.
|
|
4
|
+
Replaces the foreign zinc/blue placeholder previously shipped here. -->
|
|
5
|
+
<path d="M4.58288 11.1045C4.86346 10.823 5.31836 10.823 5.59894 11.1045L9.97138 15.4904C10.252 15.7718 10.252 16.2282 9.97139 16.5096L5.59894 20.8955C5.31836 21.177 4.86346 21.177 4.58288 20.8955L0.210434 16.5096C-0.0701446 16.2282 -0.0701449 15.7718 0.210434 15.4904L4.58288 11.1045Z" fill="#2BCD71"/>
|
|
6
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.7107 11.1972C20.2692 10.9492 19.7308 10.9492 19.2893 11.1972L15.9966 13.0468C15.5373 13.3048 15.2528 13.7917 15.2528 14.3198V17.6802C15.2528 18.2083 15.5373 18.6952 15.9966 18.9532L19.2893 20.8028C19.7308 21.0508 20.2692 21.0508 20.7107 20.8028L24.0034 18.9532C24.4627 18.6952 24.7472 18.2083 24.7472 17.6802V14.3198C24.7472 13.7917 24.4627 13.3048 24.0034 13.0468L20.7107 11.1972ZM29.0909 11.7486C29.0909 11.2205 28.8064 10.7336 28.3471 10.4756L20.7107 6.18602C20.2692 5.93799 19.7308 5.93799 19.2893 6.18602L11.6529 10.4756C11.1936 10.7336 10.9091 11.2205 10.9091 11.7486V20.2514C10.9091 20.7795 11.1936 21.2664 11.6529 21.5244L19.2893 25.814C19.7308 26.062 20.2692 26.062 20.7107 25.814L28.3471 21.5244C28.8064 21.2664 29.0909 20.7795 29.0909 20.2514V11.7486Z" fill="#2BCD71"/>
|
|
7
|
+
<path d="M34.4011 11.1045C34.6816 10.823 35.1365 10.823 35.4171 11.1045L39.7896 15.4904C40.0701 15.7718 40.0701 16.2282 39.7896 16.5096L35.4171 20.8955C35.1365 21.177 34.6816 21.177 34.4011 20.8955L30.0286 16.5096C29.748 16.2282 29.748 15.7718 30.0286 15.4904L34.4011 11.1045Z" fill="#2BCD71"/>
|
|
5
8
|
</svg>
|
|
@@ -4,18 +4,27 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<meta name="theme-color" content="#0b0b0d" />
|
|
7
8
|
<title>Blok Studio</title>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<link rel="
|
|
12
|
-
<link rel="
|
|
13
|
-
<link
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
<!-- Newsreader is reserved for hero numerals (durations, large
|
|
10
|
+
metrics) per brand-spec.md. Italic 400 only — never bold,
|
|
11
|
+
never roman. JetBrains Mono is the IDs-and-durations face. -->
|
|
12
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
13
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
14
|
+
<link
|
|
15
|
+
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Newsreader:ital,wght@1,400;1,500&display=swap"
|
|
16
|
+
rel="stylesheet"
|
|
17
|
+
/>
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-D_CdNmTc.js"></script>
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-query-Day3Mt-4.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-router-BB95iErN.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/charts-Dh48HebV.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-N5J4OhGx.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-table-Biem1hxK.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/graph-DWteCadQ.js">
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D6hOoOID.css">
|
|
17
26
|
</head>
|
|
18
|
-
<body class="bg-
|
|
27
|
+
<body class="bg-canvas text-zinc-50 antialiased">
|
|
19
28
|
<div id="root"></div>
|
|
20
29
|
</body>
|
|
21
30
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blokctl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"author": "Deskree Technologies Inc.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "cli for blok",
|
|
@@ -29,36 +29,39 @@
|
|
|
29
29
|
},
|
|
30
30
|
"keywords": ["blokctl", "cli", "blok", "blok"],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@
|
|
32
|
+
"@ai-sdk/openai": "^1.3.22",
|
|
33
|
+
"@blokjs/runner": "^0.4.0",
|
|
33
34
|
"@clack/prompts": "^1.0.0",
|
|
35
|
+
"ai": "^4.3.16",
|
|
36
|
+
"better-sqlite3": "^12.6.2",
|
|
34
37
|
"chalk": "^5.6.2",
|
|
35
38
|
"commander": "^14.0.3",
|
|
39
|
+
"express": "^4.21.2",
|
|
40
|
+
"fast-glob": "^3.3.3",
|
|
36
41
|
"figlet": "^1.10.0",
|
|
37
42
|
"fs-extra": "^11.3.3",
|
|
38
43
|
"ink": "^5.2.1",
|
|
44
|
+
"open": "^11.0.0",
|
|
39
45
|
"picocolors": "^1.1.1",
|
|
46
|
+
"pluralize": "^8.0.0",
|
|
40
47
|
"posthog-node": "^4.6.0",
|
|
41
48
|
"react": "^18.3.0",
|
|
49
|
+
"serve-handler": "^6.1.6",
|
|
42
50
|
"simple-git": "^3.30.0",
|
|
43
51
|
"type-fest": "^4.34.1",
|
|
52
|
+
"typescript": "^5.8.3",
|
|
44
53
|
"yocto-spinner": "^1.0.0",
|
|
45
|
-
"zod": "^3.24.2"
|
|
46
|
-
"open": "^11.0.0",
|
|
47
|
-
"serve-handler": "^6.1.6",
|
|
48
|
-
"ai": "^4.3.16",
|
|
49
|
-
"@ai-sdk/openai": "^1.3.22",
|
|
50
|
-
"fast-glob": "^3.3.3",
|
|
51
|
-
"pluralize": "^8.0.0",
|
|
52
|
-
"typescript": "^5.8.3"
|
|
54
|
+
"zod": "^3.24.2"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
57
|
+
"@types/express": "^4.17.21",
|
|
55
58
|
"@types/figlet": "^1.7.0",
|
|
56
59
|
"@types/fs-extra": "^11.0.4",
|
|
57
60
|
"@types/node": "^22.15.21",
|
|
61
|
+
"@types/pluralize": "^0.0.33",
|
|
58
62
|
"@types/react": "^19.2.10",
|
|
59
63
|
"rimraf": "^6.1.2",
|
|
60
|
-
"vitest": "^4.0.18"
|
|
61
|
-
"@types/pluralize": "^0.0.33"
|
|
64
|
+
"vitest": "^4.0.18"
|
|
62
65
|
},
|
|
63
66
|
"private": false,
|
|
64
67
|
"publishConfig": {
|