var du=t=>{throw TypeError(t)};var Rs=(t,e,r)=>e.has(t)||du("Cannot "+r);var $=(t,e,r)=>(Rs(t,e,"read from private field"),r?r.call(t):e.get(t)),me=(t,e,r)=>e.has(t)?du("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),oe=(t,e,r,n)=>(Rs(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),fe=(t,e,r)=>(Rs(t,e,"access private method"),r);import{a as I,g as Do,c as W,j as w,d as Ef,E as sg,r as Cf,e as Bt}from"./index-Cf5smBgf.js";import{S as ag,q as fu,t as Qe,v as Pa,r as Si,b as og,w as Aa,x as pu,y as lg,g as ug,z as cg,A as hu,n as Pf,u as dg,k as fg}from"./cjs-v3n-_9h9.js";var Me,J,kn,Ee,Gt,wr,Ct,Ke,In,xr,Sr,Yt,Xt,Pt,Tr,ee,Kr,Ma,ka,Ia,Oa,La,_a,ja,Af,Tf,pg=(Tf=class extends ag{constructor(e,r){super();me(this,ee);me(this,Me);me(this,J);me(this,kn);me(this,Ee);me(this,Gt);me(this,wr);me(this,Ct);me(this,Ke);me(this,In);me(this,xr);me(this,Sr);me(this,Yt);me(this,Xt);me(this,Pt);me(this,Tr,new Set);this.options=r,oe(this,Me,e),oe(this,Ke,null),oe(this,Ct,fu()),this.options.experimental_prefetchInRender||$(this,Ct).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,J).addObserver(this),mu($(this,J),this.options)?fe(this,ee,Kr).call(this):this.updateResult(),fe(this,ee,Oa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Na($(this,J),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Na($(this,J),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,fe(this,ee,La).call(this),fe(this,ee,_a).call(this),$(this,J).removeObserver(this)}setOptions(e,r){const n=this.options,i=$(this,J);if(this.options=$(this,Me).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qe(this.options.enabled,$(this,J))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");fe(this,ee,ja).call(this),$(this,J).setOptions(this.options),n._defaulted&&!Pa(this.options,n)&&$(this,Me).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,J),observer:this});const s=this.hasListeners();s&&gu($(this,J),i,this.options,n)&&fe(this,ee,Kr).call(this),this.updateResult(r),s&&($(this,J)!==i||Qe(this.options.enabled,$(this,J))!==Qe(n.enabled,$(this,J))||Si(this.options.staleTime,$(this,J))!==Si(n.staleTime,$(this,J)))&&fe(this,ee,Ma).call(this);const a=fe(this,ee,ka).call(this);s&&($(this,J)!==i||Qe(this.options.enabled,$(this,J))!==Qe(n.enabled,$(this,J))||a!==$(this,Pt))&&fe(this,ee,Ia).call(this,a)}getOptimisticResult(e){const r=$(this,Me).getQueryCache().build($(this,Me),e),n=this.createResult(r,e);return mg(this,n)&&(oe(this,Ee,n),oe(this,wr,this.options),oe(this,Gt,$(this,J).state)),n}getCurrentResult(){return $(this,Ee)}trackResult(e,r){const n={};return Object.keys(e).forEach(i=>{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),r==null||r(i),e[i])})}),n}trackProp(e){$(this,Tr).add(e)}getCurrentQuery(){return $(this,J)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=$(this,Me).defaultQueryOptions(e),n=$(this,Me).getQueryCache().build($(this,Me),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return fe(this,ee,Kr).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Ee)))}createResult(e,r){var E;const n=$(this,J),i=this.options,s=$(this,Ee),a=$(this,Gt),o=$(this,wr),u=e!==n?e.state:$(this,kn),{state:d}=e;let f={...d},c=!1,p;if(r._optimisticResults){const T=this.hasListeners(),_=!T&&mu(e,r),P=T&&gu(e,n,r,i);(_||P)&&(f={...f,...cg(d.data,e.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:h,status:g}=f;if(r.select&&f.data!==void 0)if(s&&f.data===(a==null?void 0:a.data)&&r.select===$(this,In))p=$(this,xr);else try{oe(this,In,r.select),p=r.select(f.data),p=hu(s==null?void 0:s.data,p,r),oe(this,xr,p),oe(this,Ke,null)}catch(T){oe(this,Ke,T)}else p=f.data;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let T;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))T=s.data;else if(T=typeof r.placeholderData=="function"?r.placeholderData((E=$(this,Sr))==null?void 0:E.state.data,$(this,Sr)):r.placeholderData,r.select&&T!==void 0)try{T=r.select(T),oe(this,Ke,null)}catch(_){oe(this,Ke,_)}T!==void 0&&(g="success",p=hu(s==null?void 0:s.data,T,r),c=!0)}$(this,Ke)&&(m=$(this,Ke),p=$(this,xr),h=Date.now(),g="error");const b=f.fetchStatus==="fetching",y=g==="pending",v=g==="error",x=y&&b,A=p!==void 0,M={status:g,fetchStatus:f.fetchStatus,isPending:y,isSuccess:g==="success",isError:v,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:v&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:c,isRefetchError:v&&A,isStale:Fo(e,r),refetch:this.refetch,promise:$(this,Ct)};if(this.options.experimental_prefetchInRender){const T=O=>{M.status==="error"?O.reject(M.error):M.data!==void 0&&O.resolve(M.data)},_=()=>{const O=oe(this,Ct,M.promise=fu());T(O)},P=$(this,Ct);switch(P.status){case"pending":e.queryHash===n.queryHash&&T(P);break;case"fulfilled":(M.status==="error"||M.data!==P.value)&&_();break;case"rejected":(M.status!=="error"||M.error!==P.reason)&&_();break}}return M}updateResult(e){const r=$(this,Ee),n=this.createResult($(this,J),this.options);if(oe(this,Gt,$(this,J).state),oe(this,wr,this.options),$(this,Gt).data!==void 0&&oe(this,Sr,$(this,J)),Pa(n,r))return;oe(this,Ee,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!$(this,Tr).size)return!0;const l=new Set(o??$(this,Tr));return this.options.throwOnError&&l.add("error"),Object.keys($(this,Ee)).some(u=>{const d=u;return $(this,Ee)[d]!==r[d]&&l.has(d)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),fe(this,ee,Af).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&fe(this,ee,Oa).call(this)}},Me=new WeakMap,J=new WeakMap,kn=new WeakMap,Ee=new WeakMap,Gt=new WeakMap,wr=new WeakMap,Ct=new WeakMap,Ke=new WeakMap,In=new WeakMap,xr=new WeakMap,Sr=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,Pt=new WeakMap,Tr=new WeakMap,ee=new WeakSet,Kr=function(e){fe(this,ee,ja).call(this);let r=$(this,J).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(og)),r},Ma=function(){fe(this,ee,La).call(this);const e=Si(this.options.staleTime,$(this,J));if(Aa||$(this,Ee).isStale||!pu(e))return;const n=lg($(this,Ee).dataUpdatedAt,e)+1;oe(this,Yt,setTimeout(()=>{$(this,Ee).isStale||this.updateResult()},n))},ka=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,J)):this.options.refetchInterval)??!1},Ia=function(e){fe(this,ee,_a).call(this),oe(this,Pt,e),!(Aa||Qe(this.options.enabled,$(this,J))===!1||!pu($(this,Pt))||$(this,Pt)===0)&&oe(this,Xt,setInterval(()=>{(this.options.refetchIntervalInBackground||ug.isFocused())&&fe(this,ee,Kr).call(this)},$(this,Pt)))},Oa=function(){fe(this,ee,Ma).call(this),fe(this,ee,Ia).call(this,fe(this,ee,ka).call(this))},La=function(){$(this,Yt)&&(clearTimeout($(this,Yt)),oe(this,Yt,void 0))},_a=function(){$(this,Xt)&&(clearInterval($(this,Xt)),oe(this,Xt,void 0))},ja=function(){const e=$(this,Me).getQueryCache().build($(this,Me),this.options);if(e===$(this,J))return;const r=$(this,J);oe(this,J,e),oe(this,kn,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},Af=function(e){Pf.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r($(this,Ee))}),$(this,Me).getQueryCache().notify({query:$(this,J),type:"observerResultsUpdated"})})},Tf);function hg(t,e){return Qe(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function mu(t,e){return hg(t,e)||t.state.data!==void 0&&Na(t,e,e.refetchOnMount)}function Na(t,e,r){if(Qe(e.enabled,t)!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Fo(t,e)}return!1}function gu(t,e,r,n){return(t!==e||Qe(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Fo(t,r)}function Fo(t,e){return Qe(e.enabled,t)!==!1&&t.isStaleByTime(Si(e.staleTime,t))}function mg(t,e){return!Pa(t.getCurrentResult(),e)}var Mf=I.createContext(!1),gg=()=>I.useContext(Mf);Mf.Provider;function bg(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var yg=I.createContext(bg()),vg=()=>I.useContext(yg);function wg(t,e){return typeof t=="function"?t(...e):!!t}function xg(){}var Sg=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},Tg=t=>{I.useEffect(()=>{t.clearReset()},[t])},Eg=({result:t,errorResetBoundary:e,throwOnError:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&wg(r,[t.error,n]),Cg=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Pg=(t,e)=>t.isLoading&&t.isFetching&&!e,Ag=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,bu=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Mg(t,e,r){var d,f,c,p,m;const n=dg(r),i=gg(),s=vg(),a=n.defaultQueryOptions(t);(f=(d=n.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,a),a._optimisticResults=i?"isRestoring":"optimistic",Cg(a),Sg(a,s),Tg(s);const o=!n.getQueryCache().get(a.queryHash),[l]=I.useState(()=>new e(n,a)),u=l.getOptimisticResult(a);if(I.useSyncExternalStore(I.useCallback(h=>{const g=i?()=>{}:l.subscribe(Pf.batchCalls(h));return l.updateResult(),g},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),I.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),Ag(a,u))throw bu(a,l,s);if(Eg({result:u,errorResetBoundary:s,throwOnError:a.throwOnError,query:n.getQueryCache().get(a.queryHash)}))throw u.error;if((p=(c=n.getDefaultOptions().queries)==null?void 0:c._experimental_afterQuery)==null||p.call(c,a,u),a.experimental_prefetchInRender&&!Aa&&Pg(u,i)){const h=o?bu(a,l,s):(m=n.getQueryCache().get(a.queryHash))==null?void 0:m.promise;h==null||h.catch(xg).finally(()=>{l.hasListeners()||l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function rt(t,e){return Mg(t,pg,e)}function kg(){return()=>{}}function Ig(){return I.useSyncExternalStore(kg,()=>!0,()=>!1)}function kf({children:t,fallback:e=null}){return Ig()?I.createElement(I.Fragment,null,t()):I.createElement(I.Fragment,null,e)}var _r={},it={};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ra=function(t,e){return Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ra(t,e)};function Og(t,e){Ra(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Da=function(){return Da=Object.assign||function(e){for(var r,n=1,i=arguments.length;n