芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/elementor/assets/js/packages/query/query.min.js
/*! For license information please see query.min.js.LICENSE.txt */ !function(){"use strict";var t={5251:function(t,e,s){var i=s(2403),r=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};e.jsx=function(t,e,s){var i,u={},c=null,h=null;for(i in void 0!==s&&(c=""+s),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(h=e.ref),e)n.call(e,i)&&!o.hasOwnProperty(i)&&(u[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===u[i]&&(u[i]=e[i]);return{$$typeof:r,type:t,key:c,ref:h,props:u,_owner:a.current}}},5893:function(t,e,s){t.exports=s(5251)},2403:function(t){t.exports=window.React}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,s),n.exports}s.d=function(t,e){for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};!function(){s.r(i),s.d(i,{QueryClient:function(){return G},QueryClientProvider:function(){return V},createQueryClient:function(){return gt},useInfiniteQuery:function(){return yt},useMutation:function(){return vt},useQuery:function(){return bt},useQueryClient:function(){return z}});var t="undefined"==typeof window||"Deno"in globalThis;function e(){}function r(t){return"number"==typeof t&&t>=0&&t!==1/0}function n(t,e){return Math.max(t+(e||0)-Date.now(),0)}function a(t,e){return"function"==typeof t?t(e):t}function o(t,e){return"function"==typeof t?t(e):t}function u(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:o}=t;if(a)if(i){if(e.queryHash!==h(a,e.options))return!1}else if(!d(e.queryKey,a))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return!("boolean"==typeof o&&e.isStale()!==o||r&&r!==e.state.fetchStatus||n&&!n(e))}function c(t,e){const{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(l(e.options.mutationKey)!==l(n))return!1}else if(!d(e.options.mutationKey,n))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function h(t,e){return(e?.queryKeyHashFn||l)(t)}function l(t){return JSON.stringify(t,((t,e)=>m(e)?Object.keys(e).sort().reduce(((t,s)=>(t[s]=e[s],t)),{}):e))}function d(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&!Object.keys(e).some((s=>!d(t[s],e[s])))}function f(t,e){if(t===e)return t;const s=y(t)&&y(e);if(s||m(t)&&m(e)){const i=s?t:Object.keys(t),r=i.length,n=s?e:Object.keys(e),a=n.length,o=s?[]:{};let u=0;for(let r=0;r
s?i.slice(1):i}function O(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var R=Symbol(),C=(t,e)=>!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==R?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)),w=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},r=t=>setTimeout(t,0);const n=i=>{e?t.push(i):r((()=>{s(i)}))};return{batch:n=>{let a;e++;try{a=n()}finally{e--,e||(()=>{const e=t;t=[],e.length&&r((()=>{i((()=>{e.forEach((t=>{s(t)}))}))}))})()}return a},batchCalls:t=>(...e)=>{n((()=>{t(...e)}))},schedule:n,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}(),P=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},S=new class extends P{#t;#e;#s;constructor(){super(),this.#s=e=>{if(!t&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t((t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach((e=>{e(t)}))}isFocused(){return"boolean"==typeof this.#t?this.#t:"hidden"!==globalThis.document?.visibilityState}},Q=new class extends P{#i=!0;#e;#s;constructor(){super(),this.#s=e=>{if(!t&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#i!==t&&(this.#i=t,this.listeners.forEach((e=>{e(t)})))}isOnline(){return this.#i}};function q(t){return Math.min(1e3*2**t,3e4)}function F(t){return"online"!==(t??"online")||Q.isOnline()}var E=class{constructor(t){this.revert=t?.revert,this.silent=t?.silent}};function M(t){return t instanceof E}function x(e){let s,i,r,n=!1,a=0,o=!1;const u=new Promise(((t,e)=>{i=t,r=e})),c=()=>S.isFocused()&&("always"===e.networkMode||Q.isOnline())&&e.canRun(),h=()=>F(e.networkMode)&&e.canRun(),l=t=>{o||(o=!0,e.onSuccess?.(t),s?.(),i(t))},d=t=>{o||(o=!0,e.onError?.(t),s?.(),r(t))},f=()=>new Promise((t=>{s=e=>{(o||c())&&t(e)},e.onPause?.()})).then((()=>{s=void 0,o||e.onContinue?.()})),p=()=>{if(o)return;let s;const i=0===a?e.initialPromise:void 0;try{s=i??e.fn()}catch(t){s=Promise.reject(t)}Promise.resolve(s).then(l).catch((s=>{if(o)return;const i=e.retry??(t?0:3),r=e.retryDelay??q,u="function"==typeof r?r(a,s):r,h=!0===i||"number"==typeof i&&a
{setTimeout(t,l)}))).then((()=>c()?void 0:f())).then((()=>{n?d(s):p()}))):d(s)}))};return{promise:u,cancel:t=>{o||(d(new E(t)),e.abort?.())},continue:()=>(s?.(),u),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:h,start:()=>(h()?p():f().then(p),u)}}var D=class{#r;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),r(this.gcTime)&&(this.#r=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t?1/0:3e5))}clearGcTimeout(){this.#r&&(clearTimeout(this.#r),this.#r=void 0)}},I=class extends D{#n;#a;#o;#u;#c;#h;constructor(t){super(),this.#h=!1,this.#c=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#n=t.state||function(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#u?.promise}setOptions(t){this.options={...this.#c,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(t,e){const s=b(this.state.data,t,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#l({type:"setState",state:t,setStateOptions:e})}cancel(t){const s=this.#u?.promise;return this.#u?.cancel(t),s?s.then(e).catch(e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some((t=>!1!==o(t.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((t=>t.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(t=0){return this.state.isInvalidated||void 0===this.state.data||!n(this.state.dataUpdatedAt,t)}onFocus(){const t=this.observers.find((t=>t.shouldFetchOnWindowFocus()));t?.refetch({cancelRefetch:!1}),this.#u?.continue()}onOnline(){const t=this.observers.find((t=>t.shouldFetchOnReconnect()));t?.refetch({cancelRefetch:!1}),this.#u?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter((e=>e!==t)),this.observers.length||(this.#u&&(this.#h?this.#u.cancel({revert:!0}):this.#u.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#u)return this.#u.continueRetry(),this.#u.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find((t=>t.options.queryFn));t&&this.setOptions(t.options)}const s=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#h=!0,s.signal)})},r={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const t=C(this.options,e),s={queryKey:this.queryKey,meta:this.meta};return i(s),this.#h=!1,this.options.persister?this.options.persister(t,s,this):t(s)}};i(r),this.options.behavior?.onFetch(r,this),this.#a=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===r.fetchOptions?.meta||this.#l({type:"fetch",meta:r.fetchOptions?.meta});const n=t=>{M(t)&&t.silent||this.#l({type:"error",error:t}),M(t)||(this.#o.config.onError?.(t,this),this.#o.config.onSettled?.(this.state.data,t,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#u=x({initialPromise:e?.initialPromise,fn:r.fetchFn,abort:s.abort.bind(s),onSuccess:t=>{void 0!==t?(this.setData(t),this.#o.config.onSuccess?.(t,this),this.#o.config.onSettled?.(t,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):n(new Error(`${this.queryHash} data is undefined`))},onError:n,onFail:(t,e)=>{this.#l({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0}),this.#u.start()}#l(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...T(e.data,this.options),fetchMeta:t.meta??null};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return M(s)&&s.revert&&this.#a?{...this.#a,fetchStatus:"idle"}:{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),w.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate()})),this.#o.notify({query:this,type:"updated",action:t})}))}};function T(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:F(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}var A=class extends P{constructor(t={}){super(),this.config=t,this.#d=new Map}#d;build(t,e,s){const i=e.queryKey,r=e.queryHash??h(i,e);let n=this.get(r);return n||(n=new I({cache:this,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(n)),n}add(t){this.#d.has(t.queryHash)||(this.#d.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#d.get(t.queryHash);e&&(t.destroy(),e===t&&this.#d.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){w.batch((()=>{this.getAll().forEach((t=>{this.remove(t)}))}))}get(t){return this.#d.get(t)}getAll(){return[...this.#d.values()]}find(t){const e={exact:!0,...t};return this.getAll().find((t=>u(e,t)))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter((e=>u(t,e))):e}notify(t){w.batch((()=>{this.listeners.forEach((e=>{e(t)}))}))}onFocus(){w.batch((()=>{this.getAll().forEach((t=>{t.onFocus()}))}))}onOnline(){w.batch((()=>{this.getAll().forEach((t=>{t.onOnline()}))}))}},U=class extends D{#f;#p;#u;constructor(t){super(),this.mutationId=t.mutationId,this.#p=t.mutationCache,this.#f=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#f.includes(t)||(this.#f.push(t),this.clearGcTimeout(),this.#p.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#f=this.#f.filter((e=>e!==t)),this.scheduleGc(),this.#p.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#f.length||("pending"===this.state.status?this.scheduleGc():this.#p.remove(this))}continue(){return this.#u?.continue()??this.execute(this.state.variables)}async execute(t){this.#u=x({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#l({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#p.canRun(this)});const e="pending"===this.state.status,s=!this.#u.canStart();try{if(!e){this.#l({type:"pending",variables:t,isPaused:s}),await(this.#p.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#l({type:"pending",context:e,variables:t,isPaused:s})}const i=await this.#u.start();return await(this.#p.config.onSuccess?.(i,t,this.state.context,this)),await(this.options.onSuccess?.(i,t,this.state.context)),await(this.#p.config.onSettled?.(i,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(i,null,t,this.state.context)),this.#l({type:"success",data:i}),i}catch(e){try{throw await(this.#p.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#p.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#l({type:"error",error:e})}}finally{this.#p.runNext(this)}}#l(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,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{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),w.batch((()=>{this.#f.forEach((e=>{e.onMutationUpdate(t)})),this.#p.notify({mutation:this,type:"updated",action:t})}))}},k=class extends P{constructor(t={}){super(),this.config=t,this.#y=new Map,this.#m=Date.now()}#y;#m;build(t,e,s){const i=new U({mutationCache:this,mutationId:++this.#m,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){const e=K(t),s=this.#y.get(e)??[];s.push(t),this.#y.set(e,s),this.notify({type:"added",mutation:t})}remove(t){const e=K(t);if(this.#y.has(e)){const s=this.#y.get(e)?.filter((e=>e!==t));s&&(0===s.length?this.#y.delete(e):this.#y.set(e,s))}this.notify({type:"removed",mutation:t})}canRun(t){const e=this.#y.get(K(t))?.find((t=>"pending"===t.state.status));return!e||e===t}runNext(t){const e=this.#y.get(K(t))?.find((e=>e!==t&&e.state.isPaused));return e?.continue()??Promise.resolve()}clear(){w.batch((()=>{this.getAll().forEach((t=>{this.remove(t)}))}))}getAll(){return[...this.#y.values()].flat()}find(t){const e={exact:!0,...t};return this.getAll().find((t=>c(e,t)))}findAll(t={}){return this.getAll().filter((e=>c(t,e)))}notify(t){w.batch((()=>{this.listeners.forEach((e=>{e(t)}))}))}resumePausedMutations(){const t=this.getAll().filter((t=>t.state.isPaused));return w.batch((()=>Promise.all(t.map((t=>t.continue().catch(e))))))}};function K(t){return t.options.scope?.id??String(t.mutationId)}function j(t){return{onFetch:(e,s)=>{const i=async()=>{const s=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],n=e.state.data?.pageParams||[],a={pages:[],pageParams:[]};let o=!1;const u=C(e.options,e.fetchOptions),c=async(t,s,i)=>{if(o)return Promise.reject();if(null==s&&t.pages.length)return Promise.resolve(t);const r={queryKey:e.queryKey,pageParam:s,direction:i?"backward":"forward",meta:e.options.meta};var n;n=r,Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(e.signal.aborted?o=!0:e.signal.addEventListener("abort",(()=>{o=!0})),e.signal)});const a=await u(r),{maxPages:c}=e.options,h=i?O:g;return{pages:h(t.pages,a,c),pageParams:h(t.pageParams,s,c)}};let h;if(i&&r.length){const t="backward"===i,e={pages:r,pageParams:n},a=(t?L:_)(s,e);h=await c(e,a,t)}else{h=await c(a,n[0]??s.initialPageParam);const e=t??r.length;for(let t=1;t
e.options.persister?.(i,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=i}}}function _(t,{pages:e,pageParams:s}){const i=e.length-1;return t.getNextPageParam(e[i],e,s[i],s)}function L(t,{pages:e,pageParams:s}){return t.getPreviousPageParam?.(e[0],e,s[0],s)}function N(t,e){return!!e&&null!=_(t,e)}function H(t,e){return!(!e||!t.getPreviousPageParam)&&null!=L(t,e)}var G=class{#v;#p;#c;#b;#g;#O;#R;#C;constructor(t={}){this.#v=t.queryCache||new A,this.#p=t.mutationCache||new k,this.#c=t.defaultOptions||{},this.#b=new Map,this.#g=new Map,this.#O=0}mount(){this.#O++,1===this.#O&&(this.#R=S.subscribe((async t=>{t&&(await this.resumePausedMutations(),this.#v.onFocus())})),this.#C=Q.subscribe((async t=>{t&&(await this.resumePausedMutations(),this.#v.onOnline())})))}unmount(){this.#O--,0===this.#O&&(this.#R?.(),this.#R=void 0,this.#C?.(),this.#C=void 0)}isFetching(t){return this.#v.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#p.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#v.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(void 0===e)return this.fetchQuery(t);{const s=this.defaultQueryOptions(t),i=this.#v.build(this,s);return t.revalidateIfStale&&i.isStaleByTime(a(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(e)}}getQueriesData(t){return this.#v.findAll(t).map((({queryKey:t,state:e})=>[t,e.data]))}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),r=this.#v.get(i.queryHash),n=r?.state.data,a=function(t,e){return"function"==typeof t?t(e):t}(e,n);if(void 0!==a)return this.#v.build(this,i).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return w.batch((()=>this.#v.findAll(t).map((({queryKey:t})=>[t,this.setQueryData(t,e,s)]))))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#v.get(e.queryHash)?.state}removeQueries(t){const e=this.#v;w.batch((()=>{e.findAll(t).forEach((t=>{e.remove(t)}))}))}resetQueries(t,e){const s=this.#v,i={type:"active",...t};return w.batch((()=>(s.findAll(t).forEach((t=>{t.reset()})),this.refetchQueries(i,e))))}cancelQueries(t={},s={}){const i={revert:!0,...s},r=w.batch((()=>this.#v.findAll(t).map((t=>t.cancel(i)))));return Promise.all(r).then(e).catch(e)}invalidateQueries(t={},e={}){return w.batch((()=>{if(this.#v.findAll(t).forEach((t=>{t.invalidate()})),"none"===t.refetchType)return Promise.resolve();const s={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(s,e)}))}refetchQueries(t={},s){const i={...s,cancelRefetch:s?.cancelRefetch??!0},r=w.batch((()=>this.#v.findAll(t).filter((t=>!t.isDisabled())).map((t=>{let s=t.fetch(void 0,i);return i.throwOnError||(s=s.catch(e)),"paused"===t.state.fetchStatus?Promise.resolve():s}))));return Promise.all(r).then(e)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#v.build(this,e);return s.isStaleByTime(a(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(e).catch(e)}fetchInfiniteQuery(t){return t.behavior=j(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(e).catch(e)}resumePausedMutations(){return Q.isOnline()?this.#p.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#v}getMutationCache(){return this.#p}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#b.set(l(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#b.values()];let s={};return e.forEach((e=>{d(t,e.queryKey)&&(s={...s,...e.defaultOptions})})),s}setMutationDefaults(t,e){this.#g.set(l(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#g.values()];let s={};return e.forEach((e=>{d(t,e.mutationKey)&&(s={...s,...e.defaultOptions})})),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=h(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),!0!==e.enabled&&e.queryFn===R&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#v.clear(),this.#p.clear()}},B=s(2403),W=s(5893),$=B.createContext(void 0),z=t=>{const e=B.useContext($);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},V=({client:t,children:e})=>(B.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),(0,W.jsx)($.Provider,{value:t,children:e})),J=class extends P{constructor(t,e){super(),this.options=e,this.#w=t,this.#P=null,this.bindMethods(),this.setOptions(e)}#w;#S=void 0;#Q=void 0;#q=void 0;#F;#E;#P;#M;#x;#D;#I;#T;#A;#U=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#S.addObserver(this),Y(this.#S,this.options)?this.#k():this.updateResult(),this.#K())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return X(this.#S,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return X(this.#S,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#_(),this.#S.removeObserver(this)}setOptions(t,e){const s=this.options,i=this.#S;if(this.options=this.#w.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof o(this.options.enabled,this.#S))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#L(),this.#S.setOptions(this.options),s._defaulted&&!p(this.options,s)&&this.#w.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#S,observer:this});const r=this.hasListeners();r&&Z(this.#S,i,this.options,s)&&this.#k(),this.updateResult(e),!r||this.#S===i&&o(this.options.enabled,this.#S)===o(s.enabled,this.#S)&&a(this.options.staleTime,this.#S)===a(s.staleTime,this.#S)||this.#N();const n=this.#H();!r||this.#S===i&&o(this.options.enabled,this.#S)===o(s.enabled,this.#S)&&n===this.#A||this.#G(n)}getOptimisticResult(t){const e=this.#w.getQueryCache().build(this.#w,t),s=this.createResult(e,t);return i=s,!p(this.getCurrentResult(),i)&&(this.#q=s,this.#E=this.options,this.#F=this.#S.state),s;var i}getCurrentResult(){return this.#q}trackResult(t,e){const s={};return Object.keys(t).forEach((i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})})),s}trackProp(t){this.#U.add(t)}getCurrentQuery(){return this.#S}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#w.defaultQueryOptions(t),s=this.#w.getQueryCache().build(this.#w,e);return s.isFetchingOptimistic=!0,s.fetch().then((()=>this.createResult(s,e)))}fetch(t){return this.#k({...t,cancelRefetch:t.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#q)))}#k(t){this.#L();let s=this.#S.fetch(this.options,t);return t?.throwOnError||(s=s.catch(e)),s}#N(){this.#j();const e=a(this.options.staleTime,this.#S);if(t||this.#q.isStale||!r(e))return;const s=n(this.#q.dataUpdatedAt,e)+1;this.#I=setTimeout((()=>{this.#q.isStale||this.updateResult()}),s)}#H(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#S):this.options.refetchInterval)??!1}#G(e){this.#_(),this.#A=e,!t&&!1!==o(this.options.enabled,this.#S)&&r(this.#A)&&0!==this.#A&&(this.#T=setInterval((()=>{(this.options.refetchIntervalInBackground||S.isFocused())&&this.#k()}),this.#A))}#K(){this.#N(),this.#G(this.#H())}#j(){this.#I&&(clearTimeout(this.#I),this.#I=void 0)}#_(){this.#T&&(clearInterval(this.#T),this.#T=void 0)}createResult(t,e){const s=this.#S,i=this.options,r=this.#q,n=this.#F,a=this.#E,o=t!==s?t.state:this.#Q,{state:u}=t;let c,h={...u},l=!1;if(e._optimisticResults){const r=this.hasListeners(),n=!r&&Y(t,e),a=r&&Z(t,s,e,i);(n||a)&&(h={...h,...T(u.data,t.options)}),"isRestoring"===e._optimisticResults&&(h.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=h;if(e.select&&void 0!==h.data)if(r&&h.data===n?.data&&e.select===this.#M)c=this.#x;else try{this.#M=e.select,c=e.select(h.data),c=b(r?.data,c,e),this.#x=c,this.#P=null}catch(t){this.#P=t}else c=h.data;if(void 0!==e.placeholderData&&void 0===c&&"pending"===p){let t;if(r?.isPlaceholderData&&e.placeholderData===a?.placeholderData)t=r.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#D?.state.data,this.#D):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#P=null}catch(t){this.#P=t}void 0!==t&&(p="success",c=b(r?.data,t,e),l=!0)}this.#P&&(d=this.#P,c=this.#x,f=Date.now(),p="error");const y="fetching"===h.fetchStatus,m="pending"===p,v="error"===p,g=m&&y,O=void 0!==c;return{status:p,fetchStatus:h.fetchStatus,isPending:m,isSuccess:"success"===p,isError:v,isInitialLoading:g,isLoading:g,data:c,dataUpdatedAt:h.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>o.dataUpdateCount||h.errorUpdateCount>o.errorUpdateCount,isFetching:y,isRefetching:y&&!m,isLoadingError:v&&!O,isPaused:"paused"===h.fetchStatus,isPlaceholderData:l,isRefetchError:v&&O,isStale:tt(t,e),refetch:this.refetch}}updateResult(t){const e=this.#q,s=this.createResult(this.#S,this.options);if(this.#F=this.#S.state,this.#E=this.options,void 0!==this.#F.data&&(this.#D=this.#S),p(s,e))return;this.#q=s;const i={};!1!==t?.listeners&&(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#U.size)return!0;const i=new Set(s??this.#U);return this.options.throwOnError&&i.add("error"),Object.keys(this.#q).some((t=>{const s=t;return this.#q[s]!==e[s]&&i.has(s)}))})()&&(i.listeners=!0),this.#B({...i,...t})}#L(){const t=this.#w.getQueryCache().build(this.#w,this.options);if(t===this.#S)return;const e=this.#S;this.#S=t,this.#Q=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#K()}#B(t){w.batch((()=>{t.listeners&&this.listeners.forEach((t=>{t(this.#q)})),this.#w.getQueryCache().notify({query:this.#S,type:"observerResultsUpdated"})}))}};function Y(t,e){return function(t,e){return!1!==o(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&X(t,e,e.refetchOnMount)}function X(t,e,s){if(!1!==o(e.enabled,t)){const i="function"==typeof s?s(t):s;return"always"===i||!1!==i&&tt(t,e)}return!1}function Z(t,e,s,i){return(t!==e||!1===o(i.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&tt(t,s)}function tt(t,e){return!1!==o(e.enabled,t)&&t.isStaleByTime(a(e.staleTime,t))}var et=class extends J{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:j()},e)}getOptimisticResult(t){return t.behavior=j(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:s}=t,i=super.createResult(t,e),{isFetching:r,isRefetching:n,isError:a,isRefetchError:o}=i,u=s.fetchMeta?.fetchMore?.direction,c=a&&"forward"===u,h=r&&"forward"===u,l=a&&"backward"===u,d=r&&"backward"===u;return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:N(e,s.data),hasPreviousPage:H(e,s.data),isFetchNextPageError:c,isFetchingNextPage:h,isFetchPreviousPageError:l,isFetchingPreviousPage:d,isRefetchError:o&&!c&&!l,isRefetching:n&&!h&&!d}}};var st=B.createContext(function(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}()),it=()=>B.useContext(st),rt=B.createContext(!1),nt=()=>B.useContext(rt);function at(t,e){return"function"==typeof t?t(...e):!!t}function ot(){}rt.Provider;var ut=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},ct=t=>{B.useEffect((()=>{t.clearReset()}),[t])},ht=({result:t,errorResetBoundary:e,throwOnError:s,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&at(s,[t.error,i]),lt=t=>{t.suspense&&"number"!=typeof t.staleTime&&(t.staleTime=1e3)},dt=(t,e)=>t?.suspense&&e.isPending,ft=(t,e,s)=>e.fetchOptimistic(t).catch((()=>{s.clearReset()}));function pt(t,e,s){const i=z(s),r=nt(),n=it(),a=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",lt(a),ut(a,n),ct(n);const[o]=B.useState((()=>new e(i,a))),u=o.getOptimisticResult(a);if(B.useSyncExternalStore(B.useCallback((t=>{const e=r?()=>{}:o.subscribe(w.batchCalls(t));return o.updateResult(),e}),[o,r]),(()=>o.getCurrentResult()),(()=>o.getCurrentResult())),B.useEffect((()=>{o.setOptions(a,{listeners:!1})}),[a,o]),dt(a,u))throw ft(a,o,n);if(ht({result:u,errorResetBoundary:n,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash)}))throw u.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(a,u),a.notifyOnChangeProps?u:o.trackResult(u)}function yt(t,e){return pt(t,et,e)}var mt=class extends P{#w;#q=void 0;#W;#$;constructor(t,e){super(),this.#w=t,this.setOptions(e),this.bindMethods(),this.#z()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#w.defaultMutationOptions(t),p(this.options,e)||this.#w.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#W,observer:this}),e?.mutationKey&&this.options.mutationKey&&l(e.mutationKey)!==l(this.options.mutationKey)?this.reset():"pending"===this.#W?.state.status&&this.#W.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#W?.removeObserver(this)}onMutationUpdate(t){this.#z(),this.#B(t)}getCurrentResult(){return this.#q}reset(){this.#W?.removeObserver(this),this.#W=void 0,this.#z(),this.#B()}mutate(t,e){return this.#$=e,this.#W?.removeObserver(this),this.#W=this.#w.getMutationCache().build(this.#w,this.options),this.#W.addObserver(this),this.#W.execute(t)}#z(){const t=this.#W?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#q={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#B(t){w.batch((()=>{if(this.#$&&this.hasListeners()){const e=this.#q.variables,s=this.#q.context;"success"===t?.type?(this.#$.onSuccess?.(t.data,e,s),this.#$.onSettled?.(t.data,null,e,s)):"error"===t?.type&&(this.#$.onError?.(t.error,e,s),this.#$.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach((t=>{t(this.#q)}))}))}};function vt(t,e){const s=z(e),[i]=B.useState((()=>new mt(s,t)));B.useEffect((()=>{i.setOptions(t)}),[i,t]);const r=B.useSyncExternalStore(B.useCallback((t=>i.subscribe(w.batchCalls(t))),[i]),(()=>i.getCurrentResult()),(()=>i.getCurrentResult())),n=B.useCallback(((t,e)=>{i.mutate(t,e).catch(ot)}),[i]);if(r.error&&at(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}function bt(t,e){return pt(t,J,e)}function gt(){return new G({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1}}})}}(),(window.elementorV2=window.elementorV2||{}).query=i}();