Files
boc/landvex-site/assets/useQuery-CHKCqCt4.js
T
Bernt 48ea61cdcc docs: add quixzoom-auth-core product to AAMOS
- Product documentation in docs/products/
- Updated MEMORY.md with product info
- quiXzoom Auth Core as AAMOS Identity product
2026-07-14 09:58:53 +00:00

3 lines
10 KiB
JavaScript

var bt=s=>{throw TypeError(s)};var Z=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>(Z(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>(Z(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),d=(s,t,e)=>(Z(s,t,"access private method"),e);import{a$ as Tt,bk as vt,bl as R,b0 as q,bm as W,b5 as tt,bn as et,bo as gt,bp as Mt,bq as J,br as Qt,bs as xt,bt as mt,b3 as Ct,r as C,b6 as Ot,b4 as _t}from"./index-CZD3_4lD.js";var g,n,z,v,x,U,E,w,V,D,P,_,F,T,L,a,H,st,it,rt,nt,at,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,a);p(this,g);p(this,n);p(this,z);p(this,v);p(this,x);p(this,U);p(this,E);p(this,w);p(this,V);p(this,D);p(this,P);p(this,_);p(this,F);p(this,T);p(this,L,new Set);this.options=e,u(this,g,t),u(this,w,null),u(this,E,vt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,n).addObserver(this),Rt(i(this,n),this.options)?d(this,a,H).call(this):this.updateResult(),d(this,a,nt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,n),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,n),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,d(this,a,at).call(this),d(this,a,ht).call(this),i(this,n).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,n);if(this.options=i(this,g).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof R(this.options.enabled,i(this,n))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");d(this,a,ot).call(this),i(this,n).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,g).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,n),observer:this});const h=this.hasListeners();h&&St(i(this,n),r,this.options,e)&&d(this,a,H).call(this),this.updateResult(),h&&(i(this,n)!==r||R(this.options.enabled,i(this,n))!==R(e.enabled,i(this,n))||W(this.options.staleTime,i(this,n))!==W(e.staleTime,i(this,n)))&&d(this,a,st).call(this);const o=d(this,a,it).call(this);h&&(i(this,n)!==r||R(this.options.enabled,i(this,n))!==R(e.enabled,i(this,n))||o!==i(this,T))&&d(this,a,rt).call(this,o)}getOptimisticResult(t){const e=i(this,g).getQueryCache().build(i(this,g),t),r=this.createResult(e,t);return Dt(this,r)&&(u(this,v,r),u(this,U,this.options),u(this,x,i(this,n).state)),r}getCurrentResult(){return i(this,v)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,E).status==="pending"&&i(this,E).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,L).add(t)}getCurrentQuery(){return i(this,n)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,g).defaultQueryOptions(t),r=i(this,g).getQueryCache().build(i(this,g),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return d(this,a,H).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,v)))}createResult(t,e){var ft;const r=i(this,n),h=this.options,o=i(this,v),c=i(this,x),S=i(this,U),N=t!==r?t.state:i(this,z),{state:b}=t;let l={...b},k=!1,f;if(e._optimisticResults){const m=this.hasListeners(),j=!m&&Rt(t,e),K=m&&St(t,r,e,h);(j||K)&&(l={...l,...xt(b.data,t.options)}),e._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:B,errorUpdatedAt:Q,status:y}=l;f=l.data;let O=!1;if(e.placeholderData!==void 0&&f===void 0&&y==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(S==null?void 0:S.placeholderData)?(m=o.data,O=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,P))==null?void 0:ft.state.data,i(this,P)):e.placeholderData,m!==void 0&&(y="success",f=mt(o==null?void 0:o.data,m,e),k=!0)}if(e.select&&f!==void 0&&!O)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,V))f=i(this,D);else try{u(this,V,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,w,null)}catch(m){u(this,w,m)}i(this,w)&&(B=i(this,w),f=i(this,D),Q=Date.now(),y="error");const A=l.fetchStatus==="fetching",X=y==="pending",Y=y==="error",lt=X&&A,dt=f!==void 0,I={status:y,fetchStatus:l.fetchStatus,isPending:X,isSuccess:y==="success",isError:Y,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:l.dataUpdatedAt,error:B,errorUpdatedAt:Q,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:l.dataUpdateCount>N.dataUpdateCount||l.errorUpdateCount>N.errorUpdateCount,isFetching:A,isRefetching:A&&!X,isLoadingError:Y&&!dt,isPaused:l.fetchStatus==="paused",isPlaceholderData:k,isRefetchError:Y&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,E),isEnabled:R(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,j=I.status==="error"&&!m,K=G=>{j?G.reject(I.error):m&&G.resolve(I.data)},pt=()=>{const G=u(this,E,I.promise=vt());K(G)},$=i(this,E);switch($.status){case"pending":t.queryHash===r.queryHash&&K($);break;case"fulfilled":(j||I.data!==$.value)&&pt();break;case"rejected":(!j||I.error!==$.reason)&&pt();break}}return I}updateResult(){const t=i(this,v),e=this.createResult(i(this,n),this.options);if(u(this,x,i(this,n).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,P,i(this,n)),q(e,t))return;u(this,v,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,L).size)return!0;const c=new Set(o??i(this,L));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,v)).some(S=>{const M=S;return i(this,v)[M]!==t[M]&&c.has(M)})};d(this,a,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&d(this,a,nt).call(this)}},g=new WeakMap,n=new WeakMap,z=new WeakMap,v=new WeakMap,x=new WeakMap,U=new WeakMap,E=new WeakMap,w=new WeakMap,V=new WeakMap,D=new WeakMap,P=new WeakMap,_=new WeakMap,F=new WeakMap,T=new WeakMap,L=new WeakMap,a=new WeakSet,H=function(t){d(this,a,ot).call(this);let e=i(this,n).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){d(this,a,at).call(this);const t=W(this.options.staleTime,i(this,n));if(et.isServer()||i(this,v).isStale||!gt(t))return;const r=Mt(i(this,v).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,v).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,n)):this.options.refetchInterval)??!1},rt=function(t){d(this,a,ht).call(this),u(this,T,t),!(et.isServer()||R(this.options.enabled,i(this,n))===!1||!gt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&d(this,a,H).call(this)},i(this,T)))},nt=function(){d(this,a,st).call(this),d(this,a,rt).call(this,d(this,a,it).call(this))},at=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,g).getQueryCache().build(i(this,g),this.options);if(t===i(this,n))return;const e=i(this,n);u(this,n,t),u(this,z,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,v))}),i(this,g).getQueryCache().notify({query:i(this,n),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return R(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&R(t.retryOnMount,s)===!1)}function Rt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(R(t.enabled,s)!==!1&&W(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||R(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return R(t.enabled,s)!==!1&&s.isStaleByTime(W(t.staleTime,s))}function Dt(s,t){return!q(s.getCurrentResult(),t)}var wt=C.createContext(!1),Pt=()=>C.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=C.createContext(Lt()),kt=()=>C.useContext(Nt),Bt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{C.useEffect(()=>{s.clearReset()},[s])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var f,B,Q,y;const r=Pt(),h=kt(),o=_t(),c=o.defaultQueryOptions(s);(B=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||B.call(f,c);const S=o.getQueryCache().get(c.queryHash),M=s.subscribed!==!1;c._optimisticResults=r?"isRestoring":M?"optimistic":void 0,Ht(c),Bt(c,h,S),At(h);const N=!o.getQueryCache().get(c.queryHash),[b]=C.useState(()=>new t(o,c)),l=b.getOptimisticResult(c),k=!r&&M;if(C.useSyncExternalStore(C.useCallback(O=>{const A=k?b.subscribe(Ct.batchCalls(O)):tt;return b.updateResult(),A},[b,k]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),C.useEffect(()=>{b.setOptions(c)},[c,b]),zt(c,l))throw yt(c,b,h);if(jt({result:l,errorResetBoundary:h,throwOnError:c.throwOnError,query:S,suspense:c.suspense}))throw l.error;if((y=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||y.call(Q,c,l),c.experimental_prefetchInRender&&!et.isServer()&&Wt(l,r)){const O=N?yt(c,b,h):S==null?void 0:S.promise;O==null||O.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?l:b.trackResult(l)}function Jt(s,t){return Vt(s,Ft)}export{Jt as u};
//# sourceMappingURL=useQuery-CHKCqCt4.js.map