@airporting/integrations-app 0.4.31 → 0.4.32
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/README.md +74 -2
- package/dist/mf/{18.js → 1018.js} +3 -3
- package/dist/mf/{235.js → 1330.js} +2 -2
- package/dist/mf/1600.js +1 -0
- package/dist/mf/1857.js +1 -0
- package/dist/mf/{70.js → 2070.js} +3 -3
- package/dist/mf/3.js +1 -0
- package/dist/mf/{134.js → 3134.js} +2 -2
- package/dist/mf/{330.js → 3235.js} +2 -2
- package/dist/mf/{473.js → 3711.js} +2 -2
- package/dist/mf/4447.js +1 -0
- package/dist/mf/{756.js → 4756.js} +4 -4
- package/dist/mf/4810.js +1 -0
- package/dist/mf/5475.js +1 -0
- package/dist/mf/{616.js → 5616.js} +2 -2
- package/dist/mf/5625.js +1 -0
- package/dist/mf/5741.js +1 -0
- package/dist/mf/6082.js +1 -0
- package/dist/mf/6092.js +10 -0
- package/dist/mf/6124.js +1 -0
- package/dist/mf/6702.js +1 -0
- package/dist/mf/7285.js +1 -0
- package/dist/mf/{286.js → 7286.js} +3 -3
- package/dist/mf/7476.js +1 -0
- package/dist/mf/7493.js +6 -0
- package/dist/mf/7493.js.LICENSE.txt +13 -0
- package/dist/mf/8170.js +18 -0
- package/dist/mf/8473.js +10 -0
- package/dist/mf/{637.js → 8637.js} +3 -3
- package/dist/mf/8949.js +10 -0
- package/dist/mf/8978.js +33 -0
- package/dist/mf/{37.js → 9037.js} +3 -3
- package/dist/mf/9110.js +1 -0
- package/dist/mf/{755.js → 9430.js} +2 -2
- package/dist/mf/9666.js +10 -0
- package/dist/mf/9666.js.LICENSE.txt +9 -0
- package/dist/mf/9758.js +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorAddMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorCatalogQuery.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorDeleteMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroDetailQuery.d.ts +2 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobConfigQuery.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobRunMutation.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobSaveMutation.d.ts +5 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroListQuery.d.ts +2 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroRunMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroScheduleMutations.d.ts +21 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroSpreadsheetsQuery.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroToggleMutation.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/types.d.ts +67 -0
- package/dist/mf/@mf-types/compiled-types/api/useApiSynchro.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/InlineLoader.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/connector-menu.component.d.ts +7 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/delete-active-connector-modal.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/is-delete-confirm-input.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/list.catalog.component.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputDateBoundary.d.ts +12 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputGsheetsSelector.d.ts +11 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.dynamic-form.d.ts +29 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.functions.d.ts +7 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.history.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.job-config-modal.d.ts +9 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.list.d.ts +8 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.schedule.d.ts +8 -0
- package/dist/mf/@mf-types/compiled-types/gen/IntegrationsApi.d.ts +120 -4
- package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigConnectorSingle.d.ts +1 -1
- package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigSynchro.d.ts +9 -0
- package/dist/mf/@mf-types/compiled-types/providersSynchro.d.ts +15 -0
- package/dist/mf/@mf-types/compiled-types/synchro.app.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/synchro.d.ts +2 -0
- package/dist/mf/__federation_expose_connectors.js +2 -2
- package/dist/mf/__federation_expose_single_connector.js +2 -2
- package/dist/mf/__federation_expose_synchronisation.js +10 -0
- package/dist/mf/__federation_expose_synchronisation.js.LICENSE.txt +9 -0
- package/dist/mf/index.js +4 -5
- package/dist/mf/integrations_app.js +4 -5
- package/dist/mf/mf-manifest.json +133 -30
- package/dist/mf/mf-stats.json +188 -40
- package/package.json +7 -6
- package/dist/mf/124.js +0 -1
- package/dist/mf/170.js +0 -18
- package/dist/mf/285.js +0 -1
- package/dist/mf/447.js +0 -1
- package/dist/mf/475.js +0 -1
- package/dist/mf/476.js +0 -1
- package/dist/mf/600.js +0 -1
- package/dist/mf/625.js +0 -1
- package/dist/mf/666.js +0 -10
- package/dist/mf/702.js +0 -1
- package/dist/mf/711.js +0 -10
- package/dist/mf/741.js +0 -1
- package/dist/mf/857.js +0 -1
- package/dist/mf/949.js +0 -10
- package/dist/mf/978.js +0 -33
- package/dist/mf/@mf-types/connectors.d.ts +0 -2
- package/dist/mf/@mf-types/single-connector.d.ts +0 -2
- package/dist/mf/@mf-types.d.ts +0 -3
- package/dist/mf/@mf-types.zip +0 -0
- /package/dist/mf/{18.js.LICENSE.txt → 1018.js.LICENSE.txt} +0 -0
- /package/dist/mf/{235.js.LICENSE.txt → 1330.js.LICENSE.txt} +0 -0
- /package/dist/mf/{70.css → 2070.css} +0 -0
- /package/dist/mf/{70.js.LICENSE.txt → 2070.js.LICENSE.txt} +0 -0
- /package/dist/mf/{134.js.LICENSE.txt → 3134.js.LICENSE.txt} +0 -0
- /package/dist/mf/{330.js.LICENSE.txt → 3235.js.LICENSE.txt} +0 -0
- /package/dist/mf/{473.js.LICENSE.txt → 3711.js.LICENSE.txt} +0 -0
- /package/dist/mf/{756.js.LICENSE.txt → 4756.js.LICENSE.txt} +0 -0
- /package/dist/mf/{616.js.LICENSE.txt → 5616.js.LICENSE.txt} +0 -0
- /package/dist/mf/{666.js.LICENSE.txt → 6092.js.LICENSE.txt} +0 -0
- /package/dist/mf/{286.js.LICENSE.txt → 7286.js.LICENSE.txt} +0 -0
- /package/dist/mf/{170.js.LICENSE.txt → 8170.js.LICENSE.txt} +0 -0
- /package/dist/mf/{711.js.LICENSE.txt → 8473.js.LICENSE.txt} +0 -0
- /package/dist/mf/{637.js.LICENSE.txt → 8637.js.LICENSE.txt} +0 -0
- /package/dist/mf/{949.js.LICENSE.txt → 8949.js.LICENSE.txt} +0 -0
- /package/dist/mf/{978.js.LICENSE.txt → 8978.js.LICENSE.txt} +0 -0
- /package/dist/mf/{37.js.LICENSE.txt → 9037.js.LICENSE.txt} +0 -0
package/dist/mf/4810.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["4810"],{9937:function(module){!function(t,e){module.exports=e()}(0,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return({M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f})[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return this.$d.toString()!==l},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach(function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O})}}]);
|
package/dist/mf/5475.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["5475"],{5166:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{unsetMarker:()=>unsetMarker,Mutation:()=>Mutation,useIsMutating:()=>useIsMutating,notifyManager:()=>notifyManager,useIsRestoring:()=>useIsRestoring,isCancelledError:()=>isCancelledError,QueryCache:()=>QueryCache,MutationCache:()=>MutationCache,useSuspenseQuery:()=>useSuspenseQuery,matchQuery:()=>matchQuery,CancelledError:()=>CancelledError,partialMatchKey:()=>partialMatchKey,shouldThrowError:()=>shouldThrowError,defaultShouldDehydrateMutation:()=>defaultShouldDehydrateMutation,replaceEqualDeep:()=>replaceEqualDeep,useMutationState:()=>useMutationState,dataTagErrorSymbol:()=>dataTagErrorSymbol,matchMutation:()=>matchMutation,defaultShouldDehydrateQuery:()=>defaultShouldDehydrateQuery,QueryObserver:()=>QueryObserver,usePrefetchInfiniteQuery:()=>usePrefetchInfiniteQuery,QueryClient:()=>QueryClient,mutationOptions:()=>mutationOptions_mutationOptions,queryOptions:()=>queryOptions,dataTagSymbol:()=>dataTagSymbol,useQueryClient:()=>useQueryClient,QueryClientProvider:()=>QueryClientProvider,infiniteQueryOptions:()=>infiniteQueryOptions,IsRestoringProvider:()=>IsRestoringProvider,skipToken:()=>skipToken,timeoutManager:()=>timeoutManager,useSuspenseInfiniteQuery:()=>useSuspenseInfiniteQuery,Query:()=>Query,useInfiniteQuery:()=>useInfiniteQuery,useQueries:()=>useQueries,useQueryErrorResetBoundary:()=>useQueryErrorResetBoundary,defaultScheduler:()=>defaultScheduler,keepPreviousData:()=>keepPreviousData,useIsFetching:()=>useIsFetching,hashKey:()=>hashKey,InfiniteQueryObserver:()=>InfiniteQueryObserver,isServer:()=>isServer,hydrate:()=>hydrate,onlineManager:()=>onlineManager,useSuspenseQueries:()=>useSuspenseQueries,QueriesObserver:()=>QueriesObserver,HydrationBoundary:()=>HydrationBoundary,focusManager:()=>focusManager,usePrefetchQuery:()=>usePrefetchQuery,useQuery:()=>useQuery,experimental_streamedQuery:()=>streamedQuery,QueryErrorResetBoundary:()=>QueryErrorResetBoundary,useMutation:()=>useMutation,QueryClientContext:()=>QueryClientContext,MutationObserver:()=>MutationObserver,dehydrate:()=>dehydrate,noop:()=>noop});var Subscribable=class{constructor(){this.listeners=/* @__PURE__ */new Set;this.subscribe=this.subscribe.bind(this)}subscribe(listener){this.listeners.add(listener);this.onSubscribe();return()=>{this.listeners.delete(listener);this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var defaultTimeoutProvider={setTimeout:(callback,delay)=>setTimeout(callback,delay),clearTimeout:timeoutId=>clearTimeout(timeoutId),setInterval:(callback,delay)=>setInterval(callback,delay),clearInterval:intervalId=>clearInterval(intervalId)};var TimeoutManager=class{#provider=defaultTimeoutProvider;#providerCalled=false;setTimeoutProvider(provider){this.#provider=provider}setTimeout(callback,delay){return this.#provider.setTimeout(callback,delay)}clearTimeout(timeoutId){this.#provider.clearTimeout(timeoutId)}setInterval(callback,delay){return this.#provider.setInterval(callback,delay)}clearInterval(intervalId){this.#provider.clearInterval(intervalId)}};var timeoutManager=new TimeoutManager;function systemSetTimeoutZero(callback){setTimeout(callback,0)}var isServer="undefined"==typeof window||"Deno"in globalThis;function noop(){}function functionalUpdate(updater,input){return"function"==typeof updater?updater(input):updater}function isValidTimeout(value){return"number"==typeof value&&value>=0&&value!==1/0}function timeUntilStale(updatedAt,staleTime){return Math.max(updatedAt+(staleTime||0)-Date.now(),0)}function resolveStaleTime(staleTime,query){return"function"==typeof staleTime?staleTime(query):staleTime}function resolveEnabled(enabled,query){return"function"==typeof enabled?enabled(query):enabled}function matchQuery(filters,query){const{type="all",exact,fetchStatus,predicate,queryKey,stale}=filters;if(queryKey){if(exact){if(query.queryHash!==hashQueryKeyByOptions(queryKey,query.options))return false}else if(!partialMatchKey(query.queryKey,queryKey))return false}if("all"!==type){const isActive=query.isActive();if("active"===type&&!isActive)return false;if("inactive"===type&&isActive)return false}if("boolean"==typeof stale&&query.isStale()!==stale)return false;if(fetchStatus&&fetchStatus!==query.state.fetchStatus)return false;if(predicate&&!predicate(query))return false;return true}function matchMutation(filters,mutation){const{exact,status,predicate,mutationKey}=filters;if(mutationKey){if(!mutation.options.mutationKey)return false;if(exact){if(hashKey(mutation.options.mutationKey)!==hashKey(mutationKey))return false}else if(!partialMatchKey(mutation.options.mutationKey,mutationKey))return false}if(status&&mutation.state.status!==status)return false;if(predicate&&!predicate(mutation))return false;return true}function hashQueryKeyByOptions(queryKey,options){const hashFn=options?.queryKeyHashFn||hashKey;return hashFn(queryKey)}function hashKey(queryKey){return JSON.stringify(queryKey,(_,val)=>isPlainObject(val)?Object.keys(val).sort().reduce((result,key)=>{result[key]=val[key];return result},{}):val)}function partialMatchKey(a,b){if(a===b)return true;if(typeof a!==typeof b)return false;if(a&&b&&"object"==typeof a&&"object"==typeof b)return Object.keys(b).every(key=>partialMatchKey(a[key],b[key]));return false}var hasOwn=Object.prototype.hasOwnProperty;function replaceEqualDeep(a,b){if(a===b)return a;const array=isPlainArray(a)&&isPlainArray(b);if(!array&&!(isPlainObject(a)&&isPlainObject(b)))return b;const aItems=array?a:Object.keys(a);const aSize=aItems.length;const bItems=array?b:Object.keys(b);const bSize=bItems.length;const copy=array?new Array(bSize):{};let equalItems=0;for(let i=0;i<bSize;i++){const key=array?i:bItems[i];const aItem=a[key];const bItem=b[key];if(aItem===bItem){copy[key]=aItem;if(array?i<aSize:hasOwn.call(a,key))equalItems++;continue}if(null===aItem||null===bItem||"object"!=typeof aItem||"object"!=typeof bItem){copy[key]=bItem;continue}const v=replaceEqualDeep(aItem,bItem);copy[key]=v;if(v===aItem)equalItems++}return aSize===bSize&&equalItems===aSize?a:copy}function shallowEqualObjects(a,b){if(!b||Object.keys(a).length!==Object.keys(b).length)return false;for(const key in a)if(a[key]!==b[key])return false;return true}function isPlainArray(value){return Array.isArray(value)&&value.length===Object.keys(value).length}function isPlainObject(o){if(!hasObjectPrototype(o))return false;const ctor=o.constructor;if(void 0===ctor)return true;const prot=ctor.prototype;if(!hasObjectPrototype(prot))return false;if(!prot.hasOwnProperty("isPrototypeOf"))return false;if(Object.getPrototypeOf(o)!==Object.prototype)return false;return true}function hasObjectPrototype(o){return"[object Object]"===Object.prototype.toString.call(o)}function sleep(timeout){return new Promise(resolve=>{timeoutManager.setTimeout(resolve,timeout)})}function replaceData(prevData,data,options){if("function"==typeof options.structuralSharing)return options.structuralSharing(prevData,data);if(false!==options.structuralSharing)return replaceEqualDeep(prevData,data);return data}function keepPreviousData(previousData){return previousData}function addToEnd(items,item,max=0){const newItems=[...items,item];return max&&newItems.length>max?newItems.slice(1):newItems}function addToStart(items,item,max=0){const newItems=[item,...items];return max&&newItems.length>max?newItems.slice(0,-1):newItems}var skipToken=Symbol();function ensureQueryFn(options,fetchOptions){if(!options.queryFn&&fetchOptions?.initialPromise)return()=>fetchOptions.initialPromise;if(!options.queryFn||options.queryFn===skipToken)return()=>Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));return options.queryFn}function shouldThrowError(throwOnError,params){if("function"==typeof throwOnError)return throwOnError(...params);return!!throwOnError}var FocusManager=class extends Subscribable{#focused;#cleanup;#setup;constructor(){super();this.#setup=onFocus=>{if(!isServer&&window.addEventListener){const listener=()=>onFocus();window.addEventListener("visibilitychange",listener,false);return()=>{window.removeEventListener("visibilitychange",listener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(focused=>{if("boolean"==typeof focused)this.setFocused(focused);else this.onFocus()})}setFocused(focused){const changed=this.#focused!==focused;if(changed){this.#focused=focused;this.onFocus()}}onFocus(){const isFocused=this.isFocused();this.listeners.forEach(listener=>{listener(isFocused)})}isFocused(){if("boolean"==typeof this.#focused)return this.#focused;return globalThis.document?.visibilityState!=="hidden"}};var focusManager=new FocusManager;function pendingThenable(){let resolve;let reject;const thenable=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject});thenable.status="pending";thenable.catch(()=>{});function finalize(data){Object.assign(thenable,data);delete thenable.resolve;delete thenable.reject}thenable.resolve=value=>{finalize({status:"fulfilled",value});resolve(value)};thenable.reject=reason=>{finalize({status:"rejected",reason});reject(reason)};return thenable}function tryResolveSync(promise){let data;promise.then(result=>{data=result;return result},noop)?.catch(noop);if(void 0!==data)return{data}}function defaultTransformerFn(data){return data}function dehydrateMutation(mutation){return{mutationKey:mutation.options.mutationKey,state:mutation.state,...mutation.options.scope&&{scope:mutation.options.scope},...mutation.meta&&{meta:mutation.meta}}}function dehydrateQuery(query,serializeData,shouldRedactErrors){const promise=query.promise?.then(serializeData).catch(error=>{if(!shouldRedactErrors(error))return Promise.reject(error);return Promise.reject(new Error("redacted"))});promise?.catch(noop);return{dehydratedAt:Date.now(),state:{...query.state,...void 0!==query.state.data&&{data:serializeData(query.state.data)}},queryKey:query.queryKey,queryHash:query.queryHash,..."pending"===query.state.status&&{promise},...query.meta&&{meta:query.meta}}}function defaultShouldDehydrateMutation(mutation){return mutation.state.isPaused}function defaultShouldDehydrateQuery(query){return"success"===query.state.status}function defaultShouldRedactErrors(_){return true}function dehydrate(client,options={}){const filterMutation=options.shouldDehydrateMutation??client.getDefaultOptions().dehydrate?.shouldDehydrateMutation??defaultShouldDehydrateMutation;const mutations=client.getMutationCache().getAll().flatMap(mutation=>filterMutation(mutation)?[dehydrateMutation(mutation)]:[]);const filterQuery=options.shouldDehydrateQuery??client.getDefaultOptions().dehydrate?.shouldDehydrateQuery??defaultShouldDehydrateQuery;const shouldRedactErrors=options.shouldRedactErrors??client.getDefaultOptions().dehydrate?.shouldRedactErrors??defaultShouldRedactErrors;const serializeData=options.serializeData??client.getDefaultOptions().dehydrate?.serializeData??defaultTransformerFn;const queries=client.getQueryCache().getAll().flatMap(query=>filterQuery(query)?[dehydrateQuery(query,serializeData,shouldRedactErrors)]:[]);return{mutations,queries}}function hydrate(client,dehydratedState,options){if("object"!=typeof dehydratedState||null===dehydratedState)return;const mutationCache=client.getMutationCache();const queryCache=client.getQueryCache();const deserializeData=options?.defaultOptions?.deserializeData??client.getDefaultOptions().hydrate?.deserializeData??defaultTransformerFn;const mutations=dehydratedState.mutations||[];const queries=dehydratedState.queries||[];mutations.forEach(({state,...mutationOptions})=>{mutationCache.build(client,{...client.getDefaultOptions().hydrate?.mutations,...options?.defaultOptions?.mutations,...mutationOptions},state)});queries.forEach(({queryKey,state,queryHash,meta,promise,dehydratedAt})=>{const syncData=promise?tryResolveSync(promise):void 0;const rawData=void 0===state.data?syncData?.data:state.data;const data=void 0===rawData?rawData:deserializeData(rawData);let query=queryCache.get(queryHash);const existingQueryIsPending=query?.state.status==="pending";const existingQueryIsFetching=query?.state.fetchStatus==="fetching";if(query){const hasNewerSyncData=syncData&&void 0!==dehydratedAt&&dehydratedAt>query.state.dataUpdatedAt;if(state.dataUpdatedAt>query.state.dataUpdatedAt||hasNewerSyncData){const{fetchStatus:_ignored,...serializedState}=state;query.setState({...serializedState,data})}}else query=queryCache.build(client,{...client.getDefaultOptions().hydrate?.queries,...options?.defaultOptions?.queries,queryKey,queryHash,meta},{...state,data,fetchStatus:"idle",status:void 0!==data?"success":state.status});if(promise&&!existingQueryIsPending&&!existingQueryIsFetching&&(void 0===dehydratedAt||dehydratedAt>query.state.dataUpdatedAt))query.fetch(void 0,{initialPromise:Promise.resolve(promise).then(deserializeData)}).catch(noop)})}var defaultScheduler=systemSetTimeoutZero;function createNotifyManager(){let queue=[];let transactions=0;let notifyFn=callback=>{callback()};let batchNotifyFn=callback=>{callback()};let scheduleFn=defaultScheduler;const schedule=callback=>{if(transactions)queue.push(callback);else scheduleFn(()=>{notifyFn(callback)})};const flush=()=>{const originalQueue=queue;queue=[];if(originalQueue.length)scheduleFn(()=>{batchNotifyFn(()=>{originalQueue.forEach(callback=>{notifyFn(callback)})})})};return{batch:callback=>{let result;transactions++;try{result=callback()}finally{transactions--;if(!transactions)flush()}return result},batchCalls:callback=>(...args)=>{schedule(()=>{callback(...args)})},schedule,setNotifyFunction:fn=>{notifyFn=fn},setBatchNotifyFunction:fn=>{batchNotifyFn=fn},setScheduler:fn=>{scheduleFn=fn}}}var notifyManager=createNotifyManager();var OnlineManager=class extends Subscribable{#online=true;#cleanup;#setup;constructor(){super();this.#setup=onOnline=>{if(!isServer&&window.addEventListener){const onlineListener=()=>onOnline(true);const offlineListener=()=>onOnline(false);window.addEventListener("online",onlineListener,false);window.addEventListener("offline",offlineListener,false);return()=>{window.removeEventListener("online",onlineListener);window.removeEventListener("offline",offlineListener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(this.setOnline.bind(this))}setOnline(online){const changed=this.#online!==online;if(changed){this.#online=online;this.listeners.forEach(listener=>{listener(online)})}}isOnline(){return this.#online}};var onlineManager=new OnlineManager;function defaultRetryDelay(failureCount){return Math.min(1e3*2**failureCount,3e4)}function canFetch(networkMode){return(networkMode??"online")==="online"?onlineManager.isOnline():true}var CancelledError=class extends Error{constructor(options){super("CancelledError");this.revert=options?.revert;this.silent=options?.silent}};function isCancelledError(value){return value instanceof CancelledError}function createRetryer(config){let isRetryCancelled=false;let failureCount=0;let continueFn;const thenable=pendingThenable();const isResolved=()=>"pending"!==thenable.status;const cancel=cancelOptions=>{if(!isResolved()){const error=new CancelledError(cancelOptions);reject(error);config.onCancel?.(error)}};const cancelRetry=()=>{isRetryCancelled=true};const continueRetry=()=>{isRetryCancelled=false};const canContinue=()=>focusManager.isFocused()&&("always"===config.networkMode||onlineManager.isOnline())&&config.canRun();const canStart=()=>canFetch(config.networkMode)&&config.canRun();const resolve=value=>{if(!isResolved()){continueFn?.();thenable.resolve(value)}};const reject=value=>{if(!isResolved()){continueFn?.();thenable.reject(value)}};const pause=()=>new Promise(continueResolve=>{continueFn=value=>{if(isResolved()||canContinue())continueResolve(value)};config.onPause?.()}).then(()=>{continueFn=void 0;if(!isResolved())config.onContinue?.()});const run=()=>{if(isResolved())return;let promiseOrValue;const initialPromise=0===failureCount?config.initialPromise:void 0;try{promiseOrValue=initialPromise??config.fn()}catch(error){promiseOrValue=Promise.reject(error)}Promise.resolve(promiseOrValue).then(resolve).catch(error=>{if(isResolved())return;const retry=config.retry??(isServer?0:3);const retryDelay=config.retryDelay??defaultRetryDelay;const delay="function"==typeof retryDelay?retryDelay(failureCount,error):retryDelay;const shouldRetry=true===retry||"number"==typeof retry&&failureCount<retry||"function"==typeof retry&&retry(failureCount,error);if(isRetryCancelled||!shouldRetry)return void reject(error);failureCount++;config.onFail?.(failureCount,error);sleep(delay).then(()=>canContinue()?void 0:pause()).then(()=>{if(isRetryCancelled)reject(error);else run()})})};return{promise:thenable,status:()=>thenable.status,cancel,continue:()=>{continueFn?.();return thenable},cancelRetry,continueRetry,canStart,start:()=>{if(canStart())run();else pause().then(run);return thenable}}}var Removable=class{#gcTimeout;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout();if(isValidTimeout(this.gcTime))this.#gcTimeout=timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(newGcTime){this.gcTime=Math.max(this.gcTime||0,newGcTime??(isServer?1/0:3e5))}clearGcTimeout(){if(this.#gcTimeout){timeoutManager.clearTimeout(this.#gcTimeout);this.#gcTimeout=void 0}}};var Query=class extends Removable{#initialState;#revertState;#cache;#client;#retryer;#defaultOptions;#abortSignalConsumed;constructor(config){super();this.#abortSignalConsumed=false;this.#defaultOptions=config.defaultOptions;this.setOptions(config.options);this.observers=[];this.#client=config.client;this.#cache=this.#client.getQueryCache();this.queryKey=config.queryKey;this.queryHash=config.queryHash;this.#initialState=getDefaultState(this.options);this.state=config.state??this.#initialState;this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#retryer?.promise}setOptions(options){this.options={...this.#defaultOptions,...options};this.updateGcTime(this.options.gcTime);if(this.state&&void 0===this.state.data){const defaultState=getDefaultState(this.options);if(void 0!==defaultState.data){this.setData(defaultState.data,{updatedAt:defaultState.dataUpdatedAt,manual:true});this.#initialState=defaultState}}}optionalRemove(){if(!this.observers.length&&"idle"===this.state.fetchStatus)this.#cache.remove(this)}setData(newData,options){const data=replaceData(this.state.data,newData,this.options);this.#dispatch({data,type:"success",dataUpdatedAt:options?.updatedAt,manual:options?.manual});return data}setState(state,setStateOptions){this.#dispatch({type:"setState",state,setStateOptions})}cancel(options){const promise=this.#retryer?.promise;this.#retryer?.cancel(options);return promise?promise.then(noop).catch(noop):Promise.resolve()}destroy(){super.destroy();this.cancel({silent:true})}reset(){this.destroy();this.setState(this.#initialState)}isActive(){return this.observers.some(observer=>false!==resolveEnabled(observer.options.enabled,this))}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(observer=>"static"===resolveStaleTime(observer.options.staleTime,this));return false}isStale(){if(this.getObserversCount()>0)return this.observers.some(observer=>observer.getCurrentResult().isStale);return void 0===this.state.data||this.state.isInvalidated}isStaleByTime(staleTime=0){if(void 0===this.state.data)return true;if("static"===staleTime)return false;if(this.state.isInvalidated)return true;return!timeUntilStale(this.state.dataUpdatedAt,staleTime)}onFocus(){const observer=this.observers.find(x=>x.shouldFetchOnWindowFocus());observer?.refetch({cancelRefetch:false});this.#retryer?.continue()}onOnline(){const observer=this.observers.find(x=>x.shouldFetchOnReconnect());observer?.refetch({cancelRefetch:false});this.#retryer?.continue()}addObserver(observer){if(!this.observers.includes(observer)){this.observers.push(observer);this.clearGcTimeout();this.#cache.notify({type:"observerAdded",query:this,observer})}}removeObserver(observer){if(this.observers.includes(observer)){this.observers=this.observers.filter(x=>x!==observer);if(!this.observers.length){if(this.#retryer)if(this.#abortSignalConsumed)this.#retryer.cancel({revert:true});else this.#retryer.cancelRetry();this.scheduleGc()}this.#cache.notify({type:"observerRemoved",query:this,observer})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#dispatch({type:"invalidate"})}async fetch(options,fetchOptions){if("idle"!==this.state.fetchStatus&&this.#retryer?.status()!=="rejected"){if(void 0!==this.state.data&&fetchOptions?.cancelRefetch)this.cancel({silent:true});else if(this.#retryer){this.#retryer.continueRetry();return this.#retryer.promise}}if(options)this.setOptions(options);if(!this.options.queryFn){const observer=this.observers.find(x=>x.options.queryFn);if(observer)this.setOptions(observer.options)}const abortController=new AbortController;const addSignalProperty=object=>{Object.defineProperty(object,"signal",{enumerable:true,get:()=>{this.#abortSignalConsumed=true;return abortController.signal}})};const fetchFn=()=>{const queryFn=ensureQueryFn(this.options,fetchOptions);const createQueryFnContext=()=>{const queryFnContext2={client:this.#client,queryKey:this.queryKey,meta:this.meta};addSignalProperty(queryFnContext2);return queryFnContext2};const queryFnContext=createQueryFnContext();this.#abortSignalConsumed=false;if(this.options.persister)return this.options.persister(queryFn,queryFnContext,this);return queryFn(queryFnContext)};const createFetchContext=()=>{const context2={fetchOptions,options:this.options,queryKey:this.queryKey,client:this.#client,state:this.state,fetchFn};addSignalProperty(context2);return context2};const context=createFetchContext();this.options.behavior?.onFetch(context,this);this.#revertState=this.state;if("idle"===this.state.fetchStatus||this.state.fetchMeta!==context.fetchOptions?.meta)this.#dispatch({type:"fetch",meta:context.fetchOptions?.meta});this.#retryer=createRetryer({initialPromise:fetchOptions?.initialPromise,fn:context.fetchFn,onCancel:error=>{if(error instanceof CancelledError&&error.revert)this.setState({...this.#revertState,fetchStatus:"idle"});abortController.abort()},onFail:(failureCount,error)=>{this.#dispatch({type:"failed",failureCount,error})},onPause:()=>{this.#dispatch({type:"pause"})},onContinue:()=>{this.#dispatch({type:"continue"})},retry:context.options.retry,retryDelay:context.options.retryDelay,networkMode:context.options.networkMode,canRun:()=>true});try{const data=await this.#retryer.start();if(void 0===data)throw new Error(`${this.queryHash} data is undefined`);this.setData(data);this.#cache.config.onSuccess?.(data,this);this.#cache.config.onSettled?.(data,this.state.error,this);return data}catch(error){if(error instanceof CancelledError){if(error.silent)return this.#retryer.promise;else if(error.revert){if(void 0===this.state.data)throw error;return this.state.data}}this.#dispatch({type:"error",error});this.#cache.config.onError?.(error,this);this.#cache.config.onSettled?.(this.state.data,error,this);throw error}finally{this.scheduleGc()}}#dispatch(action){const reducer=state=>{switch(action.type){case"failed":return{...state,fetchFailureCount:action.failureCount,fetchFailureReason:action.error};case"pause":return{...state,fetchStatus:"paused"};case"continue":return{...state,fetchStatus:"fetching"};case"fetch":return{...state,...fetchState(state.data,this.options),fetchMeta:action.meta??null};case"success":const newState={...state,data:action.data,dataUpdateCount:state.dataUpdateCount+1,dataUpdatedAt:action.dataUpdatedAt??Date.now(),error:null,isInvalidated:false,status:"success",...!action.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};this.#revertState=action.manual?newState:void 0;return newState;case"error":const error=action.error;return{...state,error,errorUpdateCount:state.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:state.fetchFailureCount+1,fetchFailureReason:error,fetchStatus:"idle",status:"error"};case"invalidate":return{...state,isInvalidated:true};case"setState":return{...state,...action.state}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.observers.forEach(observer=>{observer.onQueryUpdate()});this.#cache.notify({query:this,type:"updated",action})})}};function fetchState(data,options){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(options.networkMode)?"fetching":"paused",...void 0===data&&{error:null,status:"pending"}}}function getDefaultState(options){const data="function"==typeof options.initialData?options.initialData():options.initialData;const hasData=void 0!==data;const initialDataUpdatedAt=hasData?"function"==typeof options.initialDataUpdatedAt?options.initialDataUpdatedAt():options.initialDataUpdatedAt:0;return{data,dataUpdateCount:0,dataUpdatedAt:hasData?initialDataUpdatedAt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:false,status:hasData?"success":"pending",fetchStatus:"idle"}}var QueryObserver=class extends Subscribable{constructor(client,options){super();this.options=options;this.#client=client;this.#selectError=null;this.#currentThenable=pendingThenable();this.bindMethods();this.setOptions(options)}#client;#currentQuery=void 0;#currentQueryInitialState=void 0;#currentResult=void 0;#currentResultState;#currentResultOptions;#currentThenable;#selectError;#selectFn;#selectResult;#lastQueryWithDefinedData;#staleTimeoutId;#refetchIntervalId;#currentRefetchInterval;#trackedProps=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(1===this.listeners.size){this.#currentQuery.addObserver(this);if(shouldFetchOnMount(this.#currentQuery,this.options))this.#executeFetch();else this.updateResult();this.#updateTimers()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set;this.#clearStaleTimeout();this.#clearRefetchInterval();this.#currentQuery.removeObserver(this)}setOptions(options){const prevOptions=this.options;const prevQuery=this.#currentQuery;this.options=this.#client.defaultQueryOptions(options);if(void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof resolveEnabled(this.options.enabled,this.#currentQuery))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#updateQuery();this.#currentQuery.setOptions(this.options);if(prevOptions._defaulted&&!shallowEqualObjects(this.options,prevOptions))this.#client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#currentQuery,observer:this});const mounted=this.hasListeners();if(mounted&&shouldFetchOptionally(this.#currentQuery,prevQuery,this.options,prevOptions))this.#executeFetch();this.updateResult();if(mounted&&(this.#currentQuery!==prevQuery||resolveEnabled(this.options.enabled,this.#currentQuery)!==resolveEnabled(prevOptions.enabled,this.#currentQuery)||resolveStaleTime(this.options.staleTime,this.#currentQuery)!==resolveStaleTime(prevOptions.staleTime,this.#currentQuery)))this.#updateStaleTimeout();const nextRefetchInterval=this.#computeRefetchInterval();if(mounted&&(this.#currentQuery!==prevQuery||resolveEnabled(this.options.enabled,this.#currentQuery)!==resolveEnabled(prevOptions.enabled,this.#currentQuery)||nextRefetchInterval!==this.#currentRefetchInterval))this.#updateRefetchInterval(nextRefetchInterval)}getOptimisticResult(options){const query=this.#client.getQueryCache().build(this.#client,options);const result=this.createResult(query,options);if(shouldAssignObserverCurrentProperties(this,result)){this.#currentResult=result;this.#currentResultOptions=this.options;this.#currentResultState=this.#currentQuery.state}return result}getCurrentResult(){return this.#currentResult}trackResult(result,onPropTracked){return new Proxy(result,{get:(target,key)=>{this.trackProp(key);onPropTracked?.(key);if("promise"===key){this.trackProp("data");if(!this.options.experimental_prefetchInRender&&"pending"===this.#currentThenable.status)this.#currentThenable.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(target,key)}})}trackProp(key){this.#trackedProps.add(key)}getCurrentQuery(){return this.#currentQuery}refetch({...options}={}){return this.fetch({...options})}fetchOptimistic(options){const defaultedOptions=this.#client.defaultQueryOptions(options);const query=this.#client.getQueryCache().build(this.#client,defaultedOptions);return query.fetch().then(()=>this.createResult(query,defaultedOptions))}fetch(fetchOptions){return this.#executeFetch({...fetchOptions,cancelRefetch:fetchOptions.cancelRefetch??true}).then(()=>{this.updateResult();return this.#currentResult})}#executeFetch(fetchOptions){this.#updateQuery();let promise=this.#currentQuery.fetch(this.options,fetchOptions);if(!fetchOptions?.throwOnError)promise=promise.catch(noop);return promise}#updateStaleTimeout(){this.#clearStaleTimeout();const staleTime=resolveStaleTime(this.options.staleTime,this.#currentQuery);if(isServer||this.#currentResult.isStale||!isValidTimeout(staleTime))return;const time=timeUntilStale(this.#currentResult.dataUpdatedAt,staleTime);const timeout=time+1;this.#staleTimeoutId=timeoutManager.setTimeout(()=>{if(!this.#currentResult.isStale)this.updateResult()},timeout)}#computeRefetchInterval(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#currentQuery):this.options.refetchInterval)??false}#updateRefetchInterval(nextInterval){this.#clearRefetchInterval();this.#currentRefetchInterval=nextInterval;if(isServer||false===resolveEnabled(this.options.enabled,this.#currentQuery)||!isValidTimeout(this.#currentRefetchInterval)||0===this.#currentRefetchInterval)return;this.#refetchIntervalId=timeoutManager.setInterval(()=>{if(this.options.refetchIntervalInBackground||focusManager.isFocused())this.#executeFetch()},this.#currentRefetchInterval)}#updateTimers(){this.#updateStaleTimeout();this.#updateRefetchInterval(this.#computeRefetchInterval())}#clearStaleTimeout(){if(this.#staleTimeoutId){timeoutManager.clearTimeout(this.#staleTimeoutId);this.#staleTimeoutId=void 0}}#clearRefetchInterval(){if(this.#refetchIntervalId){timeoutManager.clearInterval(this.#refetchIntervalId);this.#refetchIntervalId=void 0}}createResult(query,options){const prevQuery=this.#currentQuery;const prevOptions=this.options;const prevResult=this.#currentResult;const prevResultState=this.#currentResultState;const prevResultOptions=this.#currentResultOptions;const queryChange=query!==prevQuery;const queryInitialState=queryChange?query.state:this.#currentQueryInitialState;const{state}=query;let newState={...state};let isPlaceholderData=false;let data;if(options._optimisticResults){const mounted=this.hasListeners();const fetchOnMount=!mounted&&shouldFetchOnMount(query,options);const fetchOptionally=mounted&&shouldFetchOptionally(query,prevQuery,options,prevOptions);if(fetchOnMount||fetchOptionally)newState={...newState,...fetchState(state.data,query.options)};if("isRestoring"===options._optimisticResults)newState.fetchStatus="idle"}let{error,errorUpdatedAt,status}=newState;data=newState.data;let skipSelect=false;if(void 0!==options.placeholderData&&void 0===data&&"pending"===status){let placeholderData;if(prevResult?.isPlaceholderData&&options.placeholderData===prevResultOptions?.placeholderData){placeholderData=prevResult.data;skipSelect=true}else placeholderData="function"==typeof options.placeholderData?options.placeholderData(this.#lastQueryWithDefinedData?.state.data,this.#lastQueryWithDefinedData):options.placeholderData;if(void 0!==placeholderData){status="success";data=replaceData(prevResult?.data,placeholderData,options);isPlaceholderData=true}}if(options.select&&void 0!==data&&!skipSelect)if(prevResult&&data===prevResultState?.data&&options.select===this.#selectFn)data=this.#selectResult;else try{this.#selectFn=options.select;data=options.select(data);data=replaceData(prevResult?.data,data,options);this.#selectResult=data;this.#selectError=null}catch(selectError){this.#selectError=selectError}if(this.#selectError){error=this.#selectError;data=this.#selectResult;errorUpdatedAt=Date.now();status="error"}const isFetching="fetching"===newState.fetchStatus;const isPending="pending"===status;const isError="error"===status;const isLoading=isPending&&isFetching;const hasData=void 0!==data;const result={status,fetchStatus:newState.fetchStatus,isPending,isSuccess:"success"===status,isError,isInitialLoading:isLoading,isLoading,data,dataUpdatedAt:newState.dataUpdatedAt,error,errorUpdatedAt,failureCount:newState.fetchFailureCount,failureReason:newState.fetchFailureReason,errorUpdateCount:newState.errorUpdateCount,isFetched:newState.dataUpdateCount>0||newState.errorUpdateCount>0,isFetchedAfterMount:newState.dataUpdateCount>queryInitialState.dataUpdateCount||newState.errorUpdateCount>queryInitialState.errorUpdateCount,isFetching,isRefetching:isFetching&&!isPending,isLoadingError:isError&&!hasData,isPaused:"paused"===newState.fetchStatus,isPlaceholderData,isRefetchError:isError&&hasData,isStale:isStale(query,options),refetch:this.refetch,promise:this.#currentThenable,isEnabled:false!==resolveEnabled(options.enabled,query)};const nextResult=result;if(this.options.experimental_prefetchInRender){const finalizeThenableIfPossible=thenable=>{if("error"===nextResult.status)thenable.reject(nextResult.error);else if(void 0!==nextResult.data)thenable.resolve(nextResult.data)};const recreateThenable=()=>{const pending=this.#currentThenable=nextResult.promise=pendingThenable();finalizeThenableIfPossible(pending)};const prevThenable=this.#currentThenable;switch(prevThenable.status){case"pending":if(query.queryHash===prevQuery.queryHash)finalizeThenableIfPossible(prevThenable);break;case"fulfilled":if("error"===nextResult.status||nextResult.data!==prevThenable.value)recreateThenable();break;case"rejected":if("error"!==nextResult.status||nextResult.error!==prevThenable.reason)recreateThenable();break}}return nextResult}updateResult(){const prevResult=this.#currentResult;const nextResult=this.createResult(this.#currentQuery,this.options);this.#currentResultState=this.#currentQuery.state;this.#currentResultOptions=this.options;if(void 0!==this.#currentResultState.data)this.#lastQueryWithDefinedData=this.#currentQuery;if(shallowEqualObjects(nextResult,prevResult))return;this.#currentResult=nextResult;const shouldNotifyListeners=()=>{if(!prevResult)return true;const{notifyOnChangeProps}=this.options;const notifyOnChangePropsValue="function"==typeof notifyOnChangeProps?notifyOnChangeProps():notifyOnChangeProps;if("all"===notifyOnChangePropsValue||!notifyOnChangePropsValue&&!this.#trackedProps.size)return true;const includedProps=new Set(notifyOnChangePropsValue??this.#trackedProps);if(this.options.throwOnError)includedProps.add("error");return Object.keys(this.#currentResult).some(key=>{const typedKey=key;const changed=this.#currentResult[typedKey]!==prevResult[typedKey];return changed&&includedProps.has(typedKey)})};this.#notify({listeners:shouldNotifyListeners()})}#updateQuery(){const query=this.#client.getQueryCache().build(this.#client,this.options);if(query===this.#currentQuery)return;const prevQuery=this.#currentQuery;this.#currentQuery=query;this.#currentQueryInitialState=query.state;if(this.hasListeners()){prevQuery?.removeObserver(this);query.addObserver(this)}}onQueryUpdate(){this.updateResult();if(this.hasListeners())this.#updateTimers()}#notify(notifyOptions){notifyManager.batch(()=>{if(notifyOptions.listeners)this.listeners.forEach(listener=>{listener(this.#currentResult)});this.#client.getQueryCache().notify({query:this.#currentQuery,type:"observerResultsUpdated"})})}};function shouldLoadOnMount(query,options){return false!==resolveEnabled(options.enabled,query)&&void 0===query.state.data&&!("error"===query.state.status&&false===options.retryOnMount)}function shouldFetchOnMount(query,options){return shouldLoadOnMount(query,options)||void 0!==query.state.data&&shouldFetchOn(query,options,options.refetchOnMount)}function shouldFetchOn(query,options,field){if(false!==resolveEnabled(options.enabled,query)&&"static"!==resolveStaleTime(options.staleTime,query)){const value="function"==typeof field?field(query):field;return"always"===value||false!==value&&isStale(query,options)}return false}function shouldFetchOptionally(query,prevQuery,options,prevOptions){return(query!==prevQuery||false===resolveEnabled(prevOptions.enabled,query))&&(!options.suspense||"error"!==query.state.status)&&isStale(query,options)}function isStale(query,options){return false!==resolveEnabled(options.enabled,query)&&query.isStaleByTime(resolveStaleTime(options.staleTime,query))}function shouldAssignObserverCurrentProperties(observer,optimisticResult){if(!shallowEqualObjects(observer.getCurrentResult(),optimisticResult))return true;return false}function infiniteQueryBehavior(pages){return{onFetch:(context,query)=>{const options=context.options;const direction=context.fetchOptions?.meta?.fetchMore?.direction;const oldPages=context.state.data?.pages||[];const oldPageParams=context.state.data?.pageParams||[];let result={pages:[],pageParams:[]};let currentPage=0;const fetchFn=async()=>{let cancelled=false;const addSignalProperty=object=>{Object.defineProperty(object,"signal",{enumerable:true,get:()=>{if(context.signal.aborted)cancelled=true;else context.signal.addEventListener("abort",()=>{cancelled=true});return context.signal}})};const queryFn=ensureQueryFn(context.options,context.fetchOptions);const fetchPage=async(data,param,previous)=>{if(cancelled)return Promise.reject();if(null==param&&data.pages.length)return Promise.resolve(data);const createQueryFnContext=()=>{const queryFnContext2={client:context.client,queryKey:context.queryKey,pageParam:param,direction:previous?"backward":"forward",meta:context.options.meta};addSignalProperty(queryFnContext2);return queryFnContext2};const queryFnContext=createQueryFnContext();const page=await queryFn(queryFnContext);const{maxPages}=context.options;const addTo=previous?addToStart:addToEnd;return{pages:addTo(data.pages,page,maxPages),pageParams:addTo(data.pageParams,param,maxPages)}};if(direction&&oldPages.length){const previous="backward"===direction;const pageParamFn=previous?getPreviousPageParam:getNextPageParam;const oldData={pages:oldPages,pageParams:oldPageParams};const param=pageParamFn(options,oldData);result=await fetchPage(oldData,param,previous)}else{const remainingPages=pages??oldPages.length;do{const param=0===currentPage?oldPageParams[0]??options.initialPageParam:getNextPageParam(options,result);if(currentPage>0&&null==param)break;result=await fetchPage(result,param);currentPage++}while(currentPage<remainingPages)}return result};if(context.options.persister)context.fetchFn=()=>context.options.persister?.(fetchFn,{client:context.client,queryKey:context.queryKey,meta:context.options.meta,signal:context.signal},query);else context.fetchFn=fetchFn}}}function getNextPageParam(options,{pages,pageParams}){const lastIndex=pages.length-1;return pages.length>0?options.getNextPageParam(pages[lastIndex],pages,pageParams[lastIndex],pageParams):void 0}function getPreviousPageParam(options,{pages,pageParams}){return pages.length>0?options.getPreviousPageParam?.(pages[0],pages,pageParams[0],pageParams):void 0}function hasNextPage(options,data){if(!data)return false;return null!=getNextPageParam(options,data)}function hasPreviousPage(options,data){if(!data||!options.getPreviousPageParam)return false;return null!=getPreviousPageParam(options,data)}var InfiniteQueryObserver=class extends QueryObserver{constructor(client,options){super(client,options)}bindMethods(){super.bindMethods();this.fetchNextPage=this.fetchNextPage.bind(this);this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(options){super.setOptions({...options,behavior:infiniteQueryBehavior()})}getOptimisticResult(options){options.behavior=infiniteQueryBehavior();return super.getOptimisticResult(options)}fetchNextPage(options){return this.fetch({...options,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(options){return this.fetch({...options,meta:{fetchMore:{direction:"backward"}}})}createResult(query,options){const{state}=query;const parentResult=super.createResult(query,options);const{isFetching,isRefetching,isError,isRefetchError}=parentResult;const fetchDirection=state.fetchMeta?.fetchMore?.direction;const isFetchNextPageError=isError&&"forward"===fetchDirection;const isFetchingNextPage=isFetching&&"forward"===fetchDirection;const isFetchPreviousPageError=isError&&"backward"===fetchDirection;const isFetchingPreviousPage=isFetching&&"backward"===fetchDirection;const result={...parentResult,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(options,state.data),hasPreviousPage:hasPreviousPage(options,state.data),isFetchNextPageError,isFetchingNextPage,isFetchPreviousPageError,isFetchingPreviousPage,isRefetchError:isRefetchError&&!isFetchNextPageError&&!isFetchPreviousPageError,isRefetching:isRefetching&&!isFetchingNextPage&&!isFetchingPreviousPage};return result}};var Mutation=class extends Removable{#client;#observers;#mutationCache;#retryer;constructor(config){super();this.#client=config.client;this.mutationId=config.mutationId;this.#mutationCache=config.mutationCache;this.#observers=[];this.state=config.state||mutation_getDefaultState();this.setOptions(config.options);this.scheduleGc()}setOptions(options){this.options=options;this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(observer){if(!this.#observers.includes(observer)){this.#observers.push(observer);this.clearGcTimeout();this.#mutationCache.notify({type:"observerAdded",mutation:this,observer})}}removeObserver(observer){this.#observers=this.#observers.filter(x=>x!==observer);this.scheduleGc();this.#mutationCache.notify({type:"observerRemoved",mutation:this,observer})}optionalRemove(){if(!this.#observers.length)if("pending"===this.state.status)this.scheduleGc();else this.#mutationCache.remove(this)}continue(){return this.#retryer?.continue()??this.execute(this.state.variables)}async execute(variables){const onContinue=()=>{this.#dispatch({type:"continue"})};const mutationFnContext={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#retryer=createRetryer({fn:()=>{if(!this.options.mutationFn)return Promise.reject(new Error("No mutationFn found"));return this.options.mutationFn(variables,mutationFnContext)},onFail:(failureCount,error)=>{this.#dispatch({type:"failed",failureCount,error})},onPause:()=>{this.#dispatch({type:"pause"})},onContinue,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#mutationCache.canRun(this)});const restored="pending"===this.state.status;const isPaused=!this.#retryer.canStart();try{if(restored)onContinue();else{this.#dispatch({type:"pending",variables,isPaused});await this.#mutationCache.config.onMutate?.(variables,this,mutationFnContext);const context=await this.options.onMutate?.(variables,mutationFnContext);if(context!==this.state.context)this.#dispatch({type:"pending",context,variables,isPaused})}const data=await this.#retryer.start();await this.#mutationCache.config.onSuccess?.(data,variables,this.state.context,this,mutationFnContext);await this.options.onSuccess?.(data,variables,this.state.context,mutationFnContext);await this.#mutationCache.config.onSettled?.(data,null,this.state.variables,this.state.context,this,mutationFnContext);await this.options.onSettled?.(data,null,variables,this.state.context,mutationFnContext);this.#dispatch({type:"success",data});return data}catch(error){try{await this.#mutationCache.config.onError?.(error,variables,this.state.context,this,mutationFnContext);await this.options.onError?.(error,variables,this.state.context,mutationFnContext);await this.#mutationCache.config.onSettled?.(void 0,error,this.state.variables,this.state.context,this,mutationFnContext);await this.options.onSettled?.(void 0,error,variables,this.state.context,mutationFnContext);throw error}finally{this.#dispatch({type:"error",error})}}finally{this.#mutationCache.runNext(this)}}#dispatch(action){const reducer=state=>{switch(action.type){case"failed":return{...state,failureCount:action.failureCount,failureReason:action.error};case"pause":return{...state,isPaused:true};case"continue":return{...state,isPaused:false};case"pending":return{...state,context:action.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:action.isPaused,status:"pending",variables:action.variables,submittedAt:Date.now()};case"success":return{...state,data:action.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:false};case"error":return{...state,data:void 0,error:action.error,failureCount:state.failureCount+1,failureReason:action.error,isPaused:false,status:"error"}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.#observers.forEach(observer=>{observer.onMutationUpdate(action)});this.#mutationCache.notify({mutation:this,type:"updated",action})})}};function mutation_getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:false,status:"idle",variables:void 0,submittedAt:0}}var MutationCache=class extends Subscribable{constructor(config={}){super();this.config=config;this.#mutations=/* @__PURE__ */new Set;this.#scopes=/* @__PURE__ */new Map;this.#mutationId=0}#mutations;#scopes;#mutationId;build(client,options,state){const mutation=new Mutation({client,mutationCache:this,mutationId:++this.#mutationId,options:client.defaultMutationOptions(options),state});this.add(mutation);return mutation}add(mutation){this.#mutations.add(mutation);const scope=scopeFor(mutation);if("string"==typeof scope){const scopedMutations=this.#scopes.get(scope);if(scopedMutations)scopedMutations.push(mutation);else this.#scopes.set(scope,[mutation])}this.notify({type:"added",mutation})}remove(mutation){if(this.#mutations.delete(mutation)){const scope=scopeFor(mutation);if("string"==typeof scope){const scopedMutations=this.#scopes.get(scope);if(scopedMutations){if(scopedMutations.length>1){const index=scopedMutations.indexOf(mutation);if(-1!==index)scopedMutations.splice(index,1)}else if(scopedMutations[0]===mutation)this.#scopes.delete(scope)}}}this.notify({type:"removed",mutation})}canRun(mutation){const scope=scopeFor(mutation);if("string"!=typeof scope)return true;{const mutationsWithSameScope=this.#scopes.get(scope);const firstPendingMutation=mutationsWithSameScope?.find(m=>"pending"===m.state.status);return!firstPendingMutation||firstPendingMutation===mutation}}runNext(mutation){const scope=scopeFor(mutation);if("string"!=typeof scope)return Promise.resolve();{const foundMutation=this.#scopes.get(scope)?.find(m=>m!==mutation&&m.state.isPaused);return foundMutation?.continue()??Promise.resolve()}}clear(){notifyManager.batch(()=>{this.#mutations.forEach(mutation=>{this.notify({type:"removed",mutation})});this.#mutations.clear();this.#scopes.clear()})}getAll(){return Array.from(this.#mutations)}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(mutation=>matchMutation(defaultedFilters,mutation))}findAll(filters={}){return this.getAll().filter(mutation=>matchMutation(filters,mutation))}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}resumePausedMutations(){const pausedMutations=this.getAll().filter(x=>x.state.isPaused);return notifyManager.batch(()=>Promise.all(pausedMutations.map(mutation=>mutation.continue().catch(noop))))}};function scopeFor(mutation){return mutation.options.scope?.id}var MutationObserver=class extends Subscribable{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super();this.#client=client;this.setOptions(options);this.bindMethods();this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this);this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options);if(!shallowEqualObjects(this.options,prevOptions))this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this});if(prevOptions?.mutationKey&&this.options.mutationKey&&hashKey(prevOptions.mutationKey)!==hashKey(this.options.mutationKey))this.reset();else if(this.#currentMutation?.state.status==="pending")this.#currentMutation.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult();this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this);this.#currentMutation=void 0;this.#updateResult();this.#notify()}mutate(variables,options){this.#mutateOptions=options;this.#currentMutation?.removeObserver(this);this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options);this.#currentMutation.addObserver(this);return this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??mutation_getDefaultState();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.batch(()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables;const onMutateResult=this.#currentResult.context;const context={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};if(action?.type==="success"){this.#mutateOptions.onSuccess?.(action.data,variables,onMutateResult,context);this.#mutateOptions.onSettled?.(action.data,null,variables,onMutateResult,context)}else if(action?.type==="error"){this.#mutateOptions.onError?.(action.error,variables,onMutateResult,context);this.#mutateOptions.onSettled?.(void 0,action.error,variables,onMutateResult,context)}}this.listeners.forEach(listener=>{listener(this.#currentResult)})})}};function difference(array1,array2){const excludeSet=new Set(array2);return array1.filter(x=>!excludeSet.has(x))}function replaceAt(array,index,value){const copy=array.slice(0);copy[index]=value;return copy}var QueriesObserver=class extends Subscribable{#client;#result;#queries;#options;#observers;#combinedResult;#lastCombine;#lastResult;#observerMatches=[];constructor(client,queries,options){super();this.#client=client;this.#options=options;this.#queries=[];this.#observers=[];this.#result=[];this.setQueries(queries)}onSubscribe(){if(1===this.listeners.size)this.#observers.forEach(observer=>{observer.subscribe(result=>{this.#onUpdate(observer,result)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=/* @__PURE__ */new Set;this.#observers.forEach(observer=>{observer.destroy()})}setQueries(queries,options){this.#queries=queries;this.#options=options;notifyManager.batch(()=>{const prevObservers=this.#observers;const newObserverMatches=this.#findMatchingObservers(this.#queries);this.#observerMatches=newObserverMatches;newObserverMatches.forEach(match=>match.observer.setOptions(match.defaultedQueryOptions));const newObservers=newObserverMatches.map(match=>match.observer);const newResult=newObservers.map(observer=>observer.getCurrentResult());const hasLengthChange=prevObservers.length!==newObservers.length;const hasIndexChange=newObservers.some((observer,index)=>observer!==prevObservers[index]);const hasStructuralChange=hasLengthChange||hasIndexChange;const hasResultChange=hasStructuralChange?true:newResult.some((result,index)=>{const prev=this.#result[index];return!prev||!shallowEqualObjects(result,prev)});if(!hasStructuralChange&&!hasResultChange)return;if(hasStructuralChange)this.#observers=newObservers;this.#result=newResult;if(!this.hasListeners())return;if(hasStructuralChange){difference(prevObservers,newObservers).forEach(observer=>{observer.destroy()});difference(newObservers,prevObservers).forEach(observer=>{observer.subscribe(result=>{this.#onUpdate(observer,result)})})}this.#notify()})}getCurrentResult(){return this.#result}getQueries(){return this.#observers.map(observer=>observer.getCurrentQuery())}getObservers(){return this.#observers}getOptimisticResult(queries,combine){const matches=this.#findMatchingObservers(queries);const result=matches.map(match=>match.observer.getOptimisticResult(match.defaultedQueryOptions));return[result,r=>this.#combineResult(r??result,combine),()=>this.#trackResult(result,matches)]}#trackResult(result,matches){return matches.map((match,index)=>{const observerResult=result[index];return match.defaultedQueryOptions.notifyOnChangeProps?observerResult:match.observer.trackResult(observerResult,accessedProp=>{matches.forEach(m=>{m.observer.trackProp(accessedProp)})})})}#combineResult(input,combine){if(combine){if(!this.#combinedResult||this.#result!==this.#lastResult||combine!==this.#lastCombine){this.#lastCombine=combine;this.#lastResult=this.#result;this.#combinedResult=replaceEqualDeep(this.#combinedResult,combine(input))}return this.#combinedResult}return input}#findMatchingObservers(queries){const prevObserversMap=new Map(this.#observers.map(observer=>[observer.options.queryHash,observer]));const observers=[];queries.forEach(options=>{const defaultedOptions=this.#client.defaultQueryOptions(options);const match=prevObserversMap.get(defaultedOptions.queryHash);if(match)observers.push({defaultedQueryOptions:defaultedOptions,observer:match});else observers.push({defaultedQueryOptions:defaultedOptions,observer:new QueryObserver(this.#client,defaultedOptions)})});return observers}#onUpdate(observer,result){const index=this.#observers.indexOf(observer);if(-1!==index){this.#result=replaceAt(this.#result,index,result);this.#notify()}}#notify(){if(this.hasListeners()){const previousResult=this.#combinedResult;const newTracked=this.#trackResult(this.#result,this.#observerMatches);const newResult=this.#combineResult(newTracked,this.#options?.combine);if(previousResult!==newResult)notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(this.#result)})})}}};var QueryCache=class extends Subscribable{constructor(config={}){super();this.config=config;this.#queries=/* @__PURE__ */new Map}#queries;build(client,options,state){const queryKey=options.queryKey;const queryHash=options.queryHash??hashQueryKeyByOptions(queryKey,options);let query=this.get(queryHash);if(!query){query=new Query({client,queryKey,queryHash,options:client.defaultQueryOptions(options),state,defaultOptions:client.getQueryDefaults(queryKey)});this.add(query)}return query}add(query){if(!this.#queries.has(query.queryHash)){this.#queries.set(query.queryHash,query);this.notify({type:"added",query})}}remove(query){const queryInMap=this.#queries.get(query.queryHash);if(queryInMap){query.destroy();if(queryInMap===query)this.#queries.delete(query.queryHash);this.notify({type:"removed",query})}}clear(){notifyManager.batch(()=>{this.getAll().forEach(query=>{this.remove(query)})})}get(queryHash){return this.#queries.get(queryHash)}getAll(){return[...this.#queries.values()]}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(query=>matchQuery(defaultedFilters,query))}findAll(filters={}){const queries=this.getAll();return Object.keys(filters).length>0?queries.filter(query=>matchQuery(filters,query)):queries}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onOnline()})})}};var QueryClient=class{#queryCache;#mutationCache;#defaultOptions;#queryDefaults;#mutationDefaults;#mountCount;#unsubscribeFocus;#unsubscribeOnline;constructor(config={}){this.#queryCache=config.queryCache||new QueryCache;this.#mutationCache=config.mutationCache||new MutationCache;this.#defaultOptions=config.defaultOptions||{};this.#queryDefaults=/* @__PURE__ */new Map;this.#mutationDefaults=/* @__PURE__ */new Map;this.#mountCount=0}mount(){this.#mountCount++;if(1!==this.#mountCount)return;this.#unsubscribeFocus=focusManager.subscribe(async focused=>{if(focused){await this.resumePausedMutations();this.#queryCache.onFocus()}});this.#unsubscribeOnline=onlineManager.subscribe(async online=>{if(online){await this.resumePausedMutations();this.#queryCache.onOnline()}})}unmount(){this.#mountCount--;if(0!==this.#mountCount)return;this.#unsubscribeFocus?.();this.#unsubscribeFocus=void 0;this.#unsubscribeOnline?.();this.#unsubscribeOnline=void 0}isFetching(filters){return this.#queryCache.findAll({...filters,fetchStatus:"fetching"}).length}isMutating(filters){return this.#mutationCache.findAll({...filters,status:"pending"}).length}getQueryData(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state.data}ensureQueryData(options){const defaultedOptions=this.defaultQueryOptions(options);const query=this.#queryCache.build(this,defaultedOptions);const cachedData=query.state.data;if(void 0===cachedData)return this.fetchQuery(options);if(options.revalidateIfStale&&query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime,query)))this.prefetchQuery(defaultedOptions);return Promise.resolve(cachedData)}getQueriesData(filters){return this.#queryCache.findAll(filters).map(({queryKey,state})=>{const data=state.data;return[queryKey,data]})}setQueryData(queryKey,updater,options){const defaultedOptions=this.defaultQueryOptions({queryKey});const query=this.#queryCache.get(defaultedOptions.queryHash);const prevData=query?.state.data;const data=functionalUpdate(updater,prevData);if(void 0===data)return;return this.#queryCache.build(this,defaultedOptions).setData(data,{...options,manual:true})}setQueriesData(filters,updater,options){return notifyManager.batch(()=>this.#queryCache.findAll(filters).map(({queryKey})=>[queryKey,this.setQueryData(queryKey,updater,options)]))}getQueryState(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state}removeQueries(filters){const queryCache=this.#queryCache;notifyManager.batch(()=>{queryCache.findAll(filters).forEach(query=>{queryCache.remove(query)})})}resetQueries(filters,options){const queryCache=this.#queryCache;return notifyManager.batch(()=>{queryCache.findAll(filters).forEach(query=>{query.reset()});return this.refetchQueries({type:"active",...filters},options)})}cancelQueries(filters,cancelOptions={}){const defaultedCancelOptions={revert:true,...cancelOptions};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).map(query=>query.cancel(defaultedCancelOptions)));return Promise.all(promises).then(noop).catch(noop)}invalidateQueries(filters,options={}){return notifyManager.batch(()=>{this.#queryCache.findAll(filters).forEach(query=>{query.invalidate()});if(filters?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...filters,type:filters?.refetchType??filters?.type??"active"},options)})}refetchQueries(filters,options={}){const fetchOptions={...options,cancelRefetch:options.cancelRefetch??true};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).filter(query=>!query.isDisabled()&&!query.isStatic()).map(query=>{let promise=query.fetch(void 0,fetchOptions);if(!fetchOptions.throwOnError)promise=promise.catch(noop);return"paused"===query.state.fetchStatus?Promise.resolve():promise}));return Promise.all(promises).then(noop)}fetchQuery(options){const defaultedOptions=this.defaultQueryOptions(options);if(void 0===defaultedOptions.retry)defaultedOptions.retry=false;const query=this.#queryCache.build(this,defaultedOptions);return query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime,query))?query.fetch(defaultedOptions):Promise.resolve(query.state.data)}prefetchQuery(options){return this.fetchQuery(options).then(noop).catch(noop)}fetchInfiniteQuery(options){options.behavior=infiniteQueryBehavior(options.pages);return this.fetchQuery(options)}prefetchInfiniteQuery(options){return this.fetchInfiniteQuery(options).then(noop).catch(noop)}ensureInfiniteQueryData(options){options.behavior=infiniteQueryBehavior(options.pages);return this.ensureQueryData(options)}resumePausedMutations(){if(onlineManager.isOnline())return this.#mutationCache.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#queryCache}getMutationCache(){return this.#mutationCache}getDefaultOptions(){return this.#defaultOptions}setDefaultOptions(options){this.#defaultOptions=options}setQueryDefaults(queryKey,options){this.#queryDefaults.set(hashKey(queryKey),{queryKey,defaultOptions:options})}getQueryDefaults(queryKey){const defaults=[...this.#queryDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(queryKey,queryDefault.queryKey))Object.assign(result,queryDefault.defaultOptions)});return result}setMutationDefaults(mutationKey,options){this.#mutationDefaults.set(hashKey(mutationKey),{mutationKey,defaultOptions:options})}getMutationDefaults(mutationKey){const defaults=[...this.#mutationDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(mutationKey,queryDefault.mutationKey))Object.assign(result,queryDefault.defaultOptions)});return result}defaultQueryOptions(options){if(options._defaulted)return options;const defaultedOptions={...this.#defaultOptions.queries,...this.getQueryDefaults(options.queryKey),...options,_defaulted:true};if(!defaultedOptions.queryHash)defaultedOptions.queryHash=hashQueryKeyByOptions(defaultedOptions.queryKey,defaultedOptions);if(void 0===defaultedOptions.refetchOnReconnect)defaultedOptions.refetchOnReconnect="always"!==defaultedOptions.networkMode;if(void 0===defaultedOptions.throwOnError)defaultedOptions.throwOnError=!!defaultedOptions.suspense;if(!defaultedOptions.networkMode&&defaultedOptions.persister)defaultedOptions.networkMode="offlineFirst";if(defaultedOptions.queryFn===skipToken)defaultedOptions.enabled=false;return defaultedOptions}defaultMutationOptions(options){if(options?._defaulted)return options;return{...this.#defaultOptions.mutations,...options?.mutationKey&&this.getMutationDefaults(options.mutationKey),...options,_defaulted:true}}clear(){this.#queryCache.clear();this.#mutationCache.clear()}};function streamedQuery({streamFn,refetchMode="reset",reducer=(items,chunk)=>addToEnd(items,chunk),initialValue=[]}){return async context=>{const query=context.client.getQueryCache().find({queryKey:context.queryKey,exact:true});const isRefetch=!!query&&void 0!==query.state.data;if(isRefetch&&"reset"===refetchMode)query.setState({status:"pending",data:void 0,error:null,fetchStatus:"fetching"});let result=initialValue;const stream=await streamFn(context);for await(const chunk of stream){if(context.signal.aborted)break;if(!isRefetch||"replace"!==refetchMode)context.client.setQueryData(context.queryKey,prev=>reducer(void 0===prev?initialValue:prev,chunk));result=reducer(result,chunk)}if(isRefetch&&"replace"===refetchMode&&!context.signal.aborted)context.client.setQueryData(context.queryKey,result);return context.client.getQueryData(context.queryKey)}}var dataTagSymbol=Symbol("dataTagSymbol");var dataTagErrorSymbol=Symbol("dataTagErrorSymbol");var unsetMarker=Symbol("unsetMarker");var index_js_=__webpack_require__(8556);var jsx_runtime=__webpack_require__(4848);"use client";var QueryClientContext=index_js_.createContext(void 0);var useQueryClient=queryClient=>{const client=index_js_.useContext(QueryClientContext);if(queryClient)return queryClient;if(!client)throw new Error("No QueryClient set, use QueryClientProvider to set one");return client};var QueryClientProvider=({client,children})=>{index_js_.useEffect(()=>{client.mount();return()=>{client.unmount()}},[client]);return/* @__PURE__ */(0,jsx_runtime.jsx)(QueryClientContext.Provider,{value:client,children})};"use client";var IsRestoringContext=index_js_.createContext(false);var useIsRestoring=()=>index_js_.useContext(IsRestoringContext);var IsRestoringProvider=IsRestoringContext.Provider;"use client";function createValue(){let isReset=false;return{clearReset:()=>{isReset=false},reset:()=>{isReset=true},isReset:()=>isReset}}var QueryErrorResetBoundaryContext=index_js_.createContext(createValue());var useQueryErrorResetBoundary=()=>index_js_.useContext(QueryErrorResetBoundaryContext);var QueryErrorResetBoundary=({children})=>{const[value]=index_js_.useState(()=>createValue());return/* @__PURE__ */(0,jsx_runtime.jsx)(QueryErrorResetBoundaryContext.Provider,{value,children:"function"==typeof children?children(value):children})};"use client";var ensurePreventErrorBoundaryRetry=(options,errorResetBoundary)=>{if(options.suspense||options.throwOnError||options.experimental_prefetchInRender){if(!errorResetBoundary.isReset())options.retryOnMount=false}};var useClearResetErrorBoundary=errorResetBoundary=>{index_js_.useEffect(()=>{errorResetBoundary.clearReset()},[errorResetBoundary])};var getHasError=({result,errorResetBoundary,throwOnError,query,suspense})=>result.isError&&!errorResetBoundary.isReset()&&!result.isFetching&&query&&(suspense&&void 0===result.data||shouldThrowError(throwOnError,[result.error,query]));var defaultThrowOnError=(_error,query)=>void 0===query.state.data;var ensureSuspenseTimers=defaultedOptions=>{if(defaultedOptions.suspense){const MIN_SUSPENSE_TIME_MS=1e3;const clamp=value=>"static"===value?value:Math.max(value??MIN_SUSPENSE_TIME_MS,MIN_SUSPENSE_TIME_MS);const originalStaleTime=defaultedOptions.staleTime;defaultedOptions.staleTime="function"==typeof originalStaleTime?(...args)=>clamp(originalStaleTime(...args)):clamp(originalStaleTime);if("number"==typeof defaultedOptions.gcTime)defaultedOptions.gcTime=Math.max(defaultedOptions.gcTime,MIN_SUSPENSE_TIME_MS)}};var willFetch=(result,isRestoring)=>result.isLoading&&result.isFetching&&!isRestoring;var shouldSuspend=(defaultedOptions,result)=>defaultedOptions?.suspense&&result.isPending;var fetchOptimistic=(defaultedOptions,observer,errorResetBoundary)=>observer.fetchOptimistic(defaultedOptions).catch(()=>{errorResetBoundary.clearReset()});"use client";function useQueries({queries,...options},queryClient){const client=useQueryClient(queryClient);const isRestoring=useIsRestoring();const errorResetBoundary=useQueryErrorResetBoundary();const defaultedQueries=index_js_.useMemo(()=>queries.map(opts=>{const defaultedOptions=client.defaultQueryOptions(opts);defaultedOptions._optimisticResults=isRestoring?"isRestoring":"optimistic";return defaultedOptions}),[queries,client,isRestoring]);defaultedQueries.forEach(query=>{ensureSuspenseTimers(query);ensurePreventErrorBoundaryRetry(query,errorResetBoundary)});useClearResetErrorBoundary(errorResetBoundary);const[observer]=index_js_.useState(()=>new QueriesObserver(client,defaultedQueries,options));const[optimisticResult,getCombinedResult,trackResult]=observer.getOptimisticResult(defaultedQueries,options.combine);const shouldSubscribe=!isRestoring&&false!==options.subscribed;index_js_.useSyncExternalStore(index_js_.useCallback(onStoreChange=>shouldSubscribe?observer.subscribe(notifyManager.batchCalls(onStoreChange)):noop,[observer,shouldSubscribe]),()=>observer.getCurrentResult(),()=>observer.getCurrentResult());index_js_.useEffect(()=>{observer.setQueries(defaultedQueries,options)},[defaultedQueries,options,observer]);const shouldAtLeastOneSuspend=optimisticResult.some((result,index)=>shouldSuspend(defaultedQueries[index],result));const suspensePromises=shouldAtLeastOneSuspend?optimisticResult.flatMap((result,index)=>{const opts=defaultedQueries[index];if(opts){const queryObserver=new QueryObserver(client,opts);if(shouldSuspend(opts,result))return fetchOptimistic(opts,queryObserver,errorResetBoundary);if(willFetch(result,isRestoring))fetchOptimistic(opts,queryObserver,errorResetBoundary)}return[]}):[];if(suspensePromises.length>0)throw Promise.all(suspensePromises);const firstSingleResultWhichShouldThrow=optimisticResult.find((result,index)=>{const query=defaultedQueries[index];return query&&getHasError({result,errorResetBoundary,throwOnError:query.throwOnError,query:client.getQueryCache().get(query.queryHash),suspense:query.suspense})});if(firstSingleResultWhichShouldThrow?.error)throw firstSingleResultWhichShouldThrow.error;return getCombinedResult(trackResult())}"use client";function useBaseQuery(options,Observer,queryClient){const isRestoring=useIsRestoring();const errorResetBoundary=useQueryErrorResetBoundary();const client=useQueryClient(queryClient);const defaultedOptions=client.defaultQueryOptions(options);client.getDefaultOptions().queries?._experimental_beforeQuery?.(defaultedOptions);defaultedOptions._optimisticResults=isRestoring?"isRestoring":"optimistic";ensureSuspenseTimers(defaultedOptions);ensurePreventErrorBoundaryRetry(defaultedOptions,errorResetBoundary);useClearResetErrorBoundary(errorResetBoundary);const isNewCacheEntry=!client.getQueryCache().get(defaultedOptions.queryHash);const[observer]=index_js_.useState(()=>new Observer(client,defaultedOptions));const result=observer.getOptimisticResult(defaultedOptions);const shouldSubscribe=!isRestoring&&false!==options.subscribed;index_js_.useSyncExternalStore(index_js_.useCallback(onStoreChange=>{const unsubscribe=shouldSubscribe?observer.subscribe(notifyManager.batchCalls(onStoreChange)):noop;observer.updateResult();return unsubscribe},[observer,shouldSubscribe]),()=>observer.getCurrentResult(),()=>observer.getCurrentResult());index_js_.useEffect(()=>{observer.setOptions(defaultedOptions)},[defaultedOptions,observer]);if(shouldSuspend(defaultedOptions,result))throw fetchOptimistic(defaultedOptions,observer,errorResetBoundary);if(getHasError({result,errorResetBoundary,throwOnError:defaultedOptions.throwOnError,query:client.getQueryCache().get(defaultedOptions.queryHash),suspense:defaultedOptions.suspense}))throw result.error;client.getDefaultOptions().queries?._experimental_afterQuery?.(defaultedOptions,result);if(defaultedOptions.experimental_prefetchInRender&&!isServer&&willFetch(result,isRestoring)){const promise=isNewCacheEntry?fetchOptimistic(defaultedOptions,observer,errorResetBoundary):client.getQueryCache().get(defaultedOptions.queryHash)?.promise;promise?.catch(noop).finally(()=>{observer.updateResult()})}return defaultedOptions.notifyOnChangeProps?result:observer.trackResult(result)}"use client";function useQuery(options,queryClient){return useBaseQuery(options,QueryObserver,queryClient)}"use client";function useSuspenseQuery(options,queryClient){return useBaseQuery({...options,enabled:true,suspense:true,throwOnError:defaultThrowOnError,placeholderData:void 0},QueryObserver,queryClient)}"use client";function useSuspenseInfiniteQuery(options,queryClient){return useBaseQuery({...options,enabled:true,suspense:true,throwOnError:defaultThrowOnError},InfiniteQueryObserver,queryClient)}"use client";function useSuspenseQueries(options,queryClient){return useQueries({...options,queries:options.queries.map(query=>({...query,suspense:true,throwOnError:defaultThrowOnError,enabled:true,placeholderData:void 0}))},queryClient)}function usePrefetchQuery(options,queryClient){const client=useQueryClient(queryClient);if(!client.getQueryState(options.queryKey))client.prefetchQuery(options)}function usePrefetchInfiniteQuery(options,queryClient){const client=useQueryClient(queryClient);if(!client.getQueryState(options.queryKey))client.prefetchInfiniteQuery(options)}function queryOptions(options){return options}function infiniteQueryOptions(options){return options}"use client";var HydrationBoundary=({children,options={},state,queryClient})=>{const client=useQueryClient(queryClient);const optionsRef=index_js_.useRef(options);index_js_.useEffect(()=>{optionsRef.current=options});const hydrationQueue=index_js_.useMemo(()=>{if(state){if("object"!=typeof state)return;const queryCache=client.getQueryCache();const queries=state.queries||[];const newQueries=[];const existingQueries=[];for(const dehydratedQuery of queries){const existingQuery=queryCache.get(dehydratedQuery.queryHash);if(existingQuery){const hydrationIsNewer=dehydratedQuery.state.dataUpdatedAt>existingQuery.state.dataUpdatedAt||dehydratedQuery.promise&&"pending"!==existingQuery.state.status&&"fetching"!==existingQuery.state.fetchStatus&&void 0!==dehydratedQuery.dehydratedAt&&dehydratedQuery.dehydratedAt>existingQuery.state.dataUpdatedAt;if(hydrationIsNewer)existingQueries.push(dehydratedQuery)}else newQueries.push(dehydratedQuery)}if(newQueries.length>0)hydrate(client,{queries:newQueries},optionsRef.current);if(existingQueries.length>0)return existingQueries}},[client,state]);index_js_.useEffect(()=>{if(hydrationQueue)hydrate(client,{queries:hydrationQueue},optionsRef.current)},[client,hydrationQueue]);return children};"use client";function useIsFetching(filters,queryClient){const client=useQueryClient(queryClient);const queryCache=client.getQueryCache();return index_js_.useSyncExternalStore(index_js_.useCallback(onStoreChange=>queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),[queryCache]),()=>client.isFetching(filters),()=>client.isFetching(filters))}"use client";function useIsMutating(filters,queryClient){const client=useQueryClient(queryClient);return useMutationState({filters:{...filters,status:"pending"}},client).length}function getResult(mutationCache,options){return mutationCache.findAll(options.filters).map(mutation=>options.select?options.select(mutation):mutation.state)}function useMutationState(options={},queryClient){const mutationCache=useQueryClient(queryClient).getMutationCache();const optionsRef=index_js_.useRef(options);const result=index_js_.useRef(null);if(null===result.current)result.current=getResult(mutationCache,options);index_js_.useEffect(()=>{optionsRef.current=options});return index_js_.useSyncExternalStore(index_js_.useCallback(onStoreChange=>mutationCache.subscribe(()=>{const nextResult=replaceEqualDeep(result.current,getResult(mutationCache,optionsRef.current));if(result.current!==nextResult){result.current=nextResult;notifyManager.schedule(onStoreChange)}}),[mutationCache]),()=>result.current,()=>result.current)}"use client";function useMutation(options,queryClient){const client=useQueryClient(queryClient);const[observer]=index_js_.useState(()=>new MutationObserver(client,options));index_js_.useEffect(()=>{observer.setOptions(options)},[observer,options]);const result=index_js_.useSyncExternalStore(index_js_.useCallback(onStoreChange=>observer.subscribe(notifyManager.batchCalls(onStoreChange)),[observer]),()=>observer.getCurrentResult(),()=>observer.getCurrentResult());const mutate=index_js_.useCallback((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(noop)},[observer]);if(result.error&&shouldThrowError(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}function mutationOptions_mutationOptions(options){return options}"use client";function useInfiniteQuery(options,queryClient){return useBaseQuery(options,InfiniteQueryObserver,queryClient)}}}]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! For license information please see
|
|
2
|
-
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["
|
|
1
|
+
/*! For license information please see 5616.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["5616"],{9698:function(__unused_webpack_module,exports){/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
package/dist/mf/5625.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["5625"],{7216:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{useOrientation:()=>useOrientation,clamp:()=>clamp,useDebouncedValue:()=>useDebouncedValue,useMutationObserver:()=>useMutationObserver,useResizeObserver:()=>useResizeObserver,useSet:()=>useSet,randomId:()=>randomId,useShallowEffect:()=>useShallowEffect,useThrottledState:()=>useThrottledState,mergeRefs:()=>mergeRefs,usePrevious:()=>usePrevious,useLongPress:()=>useLongPress,useReducedMotion:()=>useReducedMotion,useSetState:()=>useSetState,readLocalStorageValue:()=>readLocalStorageValue,useCounter:()=>useCounter,useValidatedState:()=>useValidatedState,useDebouncedState:()=>useDebouncedState,useMove:()=>useMove,useFileDialog:()=>useFileDialog,useClipboard:()=>useClipboard,useIsomorphicEffect:()=>useIsomorphicEffect,useLogger:()=>useLogger,useIdle:()=>useIdle,useElementSize:()=>useElementSize,useClickOutside:()=>useClickOutside,shallowEqual:()=>shallowEqual,useNetwork:()=>useNetwork,useEyeDropper:()=>useEyeDropper,useId:()=>useId,range:()=>range,useMediaQuery:()=>useMediaQuery,useRadialMove:()=>useRadialMove,useHotkeys:()=>useHotkeys,useSelection:()=>useSelection,useWindowEvent:()=>useWindowEvent,useInterval:()=>useInterval,useHeadroom:()=>useHeadroom,useSessionStorage:()=>useSessionStorage,useDebouncedCallback:()=>useDebouncedCallback,useDocumentTitle:()=>useDocumentTitle,useFocusTrap:()=>useFocusTrap,useHash:()=>useHash,upperFirst:()=>upperFirst,useThrottledValue:()=>useThrottledValue,useOs:()=>useOs,normalizeRadialValue:()=>normalizeRadialValue,useDocumentVisibility:()=>useDocumentVisibility,useHover:()=>useHover,useMap:()=>useMap,useScrollIntoView:()=>useScrollIntoView,useFocusReturn:()=>useFocusReturn,usePageLeave:()=>usePageLeave,useMergedRef:()=>useMergedRef,useDidUpdate:()=>useDidUpdate,useInViewport:()=>useInViewport,useIsFirstRender:()=>useIsFirstRender,usePagination:()=>usePagination,useMouse:()=>useMouse,useFavicon:()=>useFavicon,useQueue:()=>useQueue,useTimeout:()=>useTimeout,useToggle:()=>useToggle,useColorScheme:()=>useColorScheme,useEventListener:()=>useEventListener,useFullscreen:()=>useFullscreen,useIntersection:()=>useIntersection,useLocalStorage:()=>useLocalStorage,useFocusWithin:()=>useFocusWithin,useMounted:()=>useMounted,assignRef:()=>assignRef,useThrottledCallback:()=>useThrottledCallback,useStateHistory:()=>useStateHistory,useViewportSize:()=>useViewportSize,getHotkeyHandler:()=>getHotkeyHandler,useCallbackRef:()=>useCallbackRef,useTextSelection:()=>useTextSelection,useWindowScroll:()=>useWindowScroll,useDisclosure:()=>useDisclosure,readSessionStorageValue:()=>readSessionStorageValue,clampUseMovePosition:()=>clampUseMovePosition,useInputState:()=>useInputState,useForceUpdate:()=>useForceUpdate,useFetch:()=>useFetch,useListState:()=>useListState,lowerFirst:()=>lowerFirst,useScrollSpy:()=>useScrollSpy,useUncontrolled:()=>useUncontrolled});"use client";function clamp(value,min,max){if(void 0===min&&void 0===max)return value;if(void 0!==min&&void 0===max)return Math.max(value,min);if(void 0===min&&void 0!==max)return Math.min(value,max);return Math.min(Math.max(value,min),max)}"use client";function lowerFirst(value){return"string"!=typeof value?"":value.charAt(0).toLowerCase()+value.slice(1)}"use client";function randomId(prefix="mantine-"){return`${prefix}${Math.random().toString(36).slice(2,11)}`}"use client";function range(start,end){const length=Math.abs(end-start)+1;const reversed=start>end;if(!reversed)return Array.from({length},(_,index)=>index+start);return Array.from({length},(_,index)=>start-index)}"use client";function shallowEqual(a,b){if(a===b)return true;if(Number.isNaN(a)&&Number.isNaN(b))return true;if(!(a instanceof Object)||!(b instanceof Object))return false;const keys=Object.keys(a);const{length}=keys;if(length!==Object.keys(b).length)return false;for(let i=0;i<length;i+=1){const key=keys[i];if(!(key in b))return false;if(a[key]!==b[key]&&!(Number.isNaN(a[key])&&Number.isNaN(b[key])))return false}return true}"use client";function upperFirst(value){return"string"!=typeof value?"":value.charAt(0).toUpperCase()+value.slice(1)}var index_js_=__webpack_require__(8556);"use client";function useCallbackRef(callback){const callbackRef=(0,index_js_.useRef)(callback);(0,index_js_.useEffect)(()=>{callbackRef.current=callback});return(0,index_js_.useMemo)(()=>(...args)=>callbackRef.current?.(...args),[])}"use client";function useDebouncedCallback(callback,options){const{delay,flushOnUnmount,leading}="number"==typeof options?{delay:options,flushOnUnmount:false,leading:false}:options;const handleCallback=useCallbackRef(callback);const debounceTimerRef=(0,index_js_.useRef)(0);const lastCallback=(0,index_js_.useMemo)(()=>{const currentCallback=Object.assign((...args)=>{window.clearTimeout(debounceTimerRef.current);const isFirstCall=currentCallback._isFirstCall;currentCallback._isFirstCall=false;function clearTimeoutAndLeadingRef(){window.clearTimeout(debounceTimerRef.current);debounceTimerRef.current=0;currentCallback._isFirstCall=true}if(leading&&isFirstCall){handleCallback(...args);const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}if(leading&&!isFirstCall){const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}const flush=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush;currentCallback.cancel=cancel;debounceTimerRef.current=window.setTimeout(flush,delay)},{flush:()=>{},cancel:()=>{},_isFirstCall:true});return currentCallback},[handleCallback,delay,leading]);(0,index_js_.useEffect)(()=>()=>{if(flushOnUnmount)lastCallback.flush();else lastCallback.cancel()},[lastCallback,flushOnUnmount]);return lastCallback}"use client";const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(callback,events,nodes){const ref=(0,index_js_.useRef)(null);const eventsList=events||DEFAULT_EVENTS;(0,index_js_.useEffect)(()=>{const listener=event=>{const{target}=event??{};if(Array.isArray(nodes)){const shouldIgnore=!document.body.contains(target)&&target?.tagName!=="HTML";const shouldTrigger=nodes.every(node=>!!node&&!event.composedPath().includes(node));shouldTrigger&&!shouldIgnore&&callback(event)}else if(ref.current&&!ref.current.contains(target))callback(event)};eventsList.forEach(fn=>document.addEventListener(fn,listener));return()=>{eventsList.forEach(fn=>document.removeEventListener(fn,listener))}},[ref,callback,nodes]);return ref}"use client";function useClipboard(options={timeout:2e3}){const[error,setError]=(0,index_js_.useState)(null);const[copied,setCopied]=(0,index_js_.useState)(false);const[copyTimeout,setCopyTimeout]=(0,index_js_.useState)(null);const handleCopyResult=value=>{window.clearTimeout(copyTimeout);setCopyTimeout(window.setTimeout(()=>setCopied(false),options.timeout));setCopied(value)};const copy=value=>{if("clipboard"in navigator)navigator.clipboard.writeText(value).then(()=>handleCopyResult(true)).catch(err=>setError(err));else setError(new Error("useClipboard: navigator.clipboard is not supported"))};const reset=()=>{setCopied(false);setError(null);window.clearTimeout(copyTimeout)};return{copy,reset,error,copied}}"use client";function attachMediaListener(query,callback){try{query.addEventListener("change",callback);return()=>query.removeEventListener("change",callback)}catch(e){query.addListener(callback);return()=>query.removeListener(callback)}}function getInitialValue(query,initialValue){if("undefined"!=typeof window&&"matchMedia"in window)return window.matchMedia(query).matches;return false}function useMediaQuery(query,initialValue,{getInitialValueInEffect}={getInitialValueInEffect:true}){const[matches,setMatches]=(0,index_js_.useState)(getInitialValueInEffect?initialValue:getInitialValue(query));(0,index_js_.useEffect)(()=>{try{const mediaQuery=window.matchMedia(query);setMatches(mediaQuery.matches);return attachMediaListener(mediaQuery,event=>setMatches(event.matches))}catch(e){return}},[query]);return matches||false}"use client";function useColorScheme(initialValue,options){return useMediaQuery("(prefers-color-scheme: dark)","dark"===initialValue,options)?"dark":"light"}"use client";const DEFAULT_OPTIONS={min:-1/0,max:1/0};function useCounter(initialValue=0,options){const{min,max}={...DEFAULT_OPTIONS,...options};const[count,setCount]=(0,index_js_.useState)(clamp(initialValue,min,max));const increment=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current+1,min,max)),[min,max]);const decrement=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current-1,min,max)),[min,max]);const set=(0,index_js_.useCallback)(value=>setCount(clamp(value,min,max)),[min,max]);const reset=(0,index_js_.useCallback)(()=>setCount(clamp(initialValue,min,max)),[initialValue,min,max]);return[count,{increment,decrement,set,reset}]}"use client";function useDebouncedState(defaultValue,wait,options={leading:false}){const[value,setValue]=(0,index_js_.useState)(defaultValue);const timeoutRef=(0,index_js_.useRef)(null);const leadingRef=(0,index_js_.useRef)(true);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);(0,index_js_.useEffect)(()=>clearTimeout1,[]);const debouncedSetValue=(0,index_js_.useCallback)(newValue=>{clearTimeout1();if(leadingRef.current&&options.leading)setValue(newValue);else timeoutRef.current=window.setTimeout(()=>{leadingRef.current=true;setValue(newValue)},wait);leadingRef.current=false},[options.leading]);return[value,debouncedSetValue]}"use client";function useDebouncedValue(value,wait,options={leading:false}){const[_value,setValue]=(0,index_js_.useState)(value);const mountedRef=(0,index_js_.useRef)(false);const timeoutRef=(0,index_js_.useRef)(null);const cooldownRef=(0,index_js_.useRef)(false);const cancel=(0,index_js_.useCallback)(()=>window.clearTimeout(timeoutRef.current),[]);(0,index_js_.useEffect)(()=>{if(mountedRef.current)if(!cooldownRef.current&&options.leading){cooldownRef.current=true;setValue(value)}else{cancel();timeoutRef.current=window.setTimeout(()=>{cooldownRef.current=false;setValue(value)},wait)}},[value,options.leading,wait]);(0,index_js_.useEffect)(()=>{mountedRef.current=true;return cancel},[]);return[_value,cancel]}"use client";const useIsomorphicEffect="undefined"!=typeof document?index_js_.useLayoutEffect:index_js_.useEffect;"use client";function useDocumentTitle(title){useIsomorphicEffect(()=>{if("string"==typeof title&&title.trim().length>0)document.title=title.trim()},[title])}"use client";function useDocumentVisibility(){const[documentVisibility,setDocumentVisibility]=(0,index_js_.useState)("visible");(0,index_js_.useEffect)(()=>{setDocumentVisibility(document.visibilityState);const listener=()=>setDocumentVisibility(document.visibilityState);document.addEventListener("visibilitychange",listener);return()=>document.removeEventListener("visibilitychange",listener)},[]);return documentVisibility}"use client";function useDidUpdate(fn,dependencies){const mounted=(0,index_js_.useRef)(false);(0,index_js_.useEffect)(()=>()=>{mounted.current=false},[]);(0,index_js_.useEffect)(()=>{if(mounted.current)return fn();mounted.current=true},dependencies)}"use client";function useFocusReturn({opened,shouldReturnFocus=true}){const lastActiveElement=(0,index_js_.useRef)(null);const returnFocus=()=>{if(lastActiveElement.current&&"focus"in lastActiveElement.current&&"function"==typeof lastActiveElement.current.focus)lastActiveElement.current?.focus({preventScroll:true})};useDidUpdate(()=>{let timeout=-1;const clearFocusTimeout=event=>{if("Tab"===event.key)window.clearTimeout(timeout)};document.addEventListener("keydown",clearFocusTimeout);if(opened)lastActiveElement.current=document.activeElement;else if(shouldReturnFocus)timeout=window.setTimeout(returnFocus,10);return()=>{window.clearTimeout(timeout);document.removeEventListener("keydown",clearFocusTimeout)}},[opened,shouldReturnFocus]);return returnFocus}"use client";const TABBABLE_NODES=/input|select|textarea|button|object/;const FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function tabbable_hidden(element){return"none"===element.style.display}function visible(element){const isHidden=element.getAttribute("aria-hidden")||element.getAttribute("hidden")||"hidden"===element.getAttribute("type");if(isHidden)return false;let parentElement=element;while(parentElement){if(parentElement===document.body||11===parentElement.nodeType)break;if(tabbable_hidden(parentElement))return false;parentElement=parentElement.parentNode}return true}function getElementTabIndex(element){let tabIndex=element.getAttribute("tabindex");if(null===tabIndex)tabIndex=void 0;return parseInt(tabIndex,10)}function focusable(element){const nodeName=element.nodeName.toLowerCase();const isTabIndexNotNaN=!Number.isNaN(getElementTabIndex(element));const res=TABBABLE_NODES.test(nodeName)&&!element.disabled||(element instanceof HTMLAnchorElement?element.href||isTabIndexNotNaN:isTabIndexNotNaN);return res&&visible(element)}function tabbable_tabbable(element){const tabIndex=getElementTabIndex(element);const isTabIndexNaN=Number.isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element)}function findTabbableDescendants(element){return Array.from(element.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable_tabbable)}"use client";function scopeTab(node,event){const tabbable=findTabbableDescendants(node);if(!tabbable.length)return void event.preventDefault();const finalTabbable=tabbable[event.shiftKey?0:tabbable.length-1];const root=node.getRootNode();let leavingFinalTabbable=finalTabbable===root.activeElement||node===root.activeElement;const activeElement=root.activeElement;const activeElementIsRadio="INPUT"===activeElement.tagName&&"radio"===activeElement.getAttribute("type");if(activeElementIsRadio){const activeRadioGroup=tabbable.filter(element=>"radio"===element.getAttribute("type")&&element.getAttribute("name")===activeElement.getAttribute("name"));leavingFinalTabbable=activeRadioGroup.includes(finalTabbable)}if(!leavingFinalTabbable)return;event.preventDefault();const target=tabbable[event.shiftKey?tabbable.length-1:0];if(target)target.focus()}"use client";function useFocusTrap(active=true){const ref=(0,index_js_.useRef)(null);const focusNode=node=>{let focusElement=node.querySelector("[data-autofocus]");if(!focusElement){const children=Array.from(node.querySelectorAll(FOCUS_SELECTOR));focusElement=children.find(tabbable_tabbable)||children.find(focusable)||null;if(!focusElement&&focusable(node))focusElement=node}if(focusElement)focusElement.focus({preventScroll:true})};const setRef=(0,index_js_.useCallback)(node=>{if(!active)return;if(null===node)return;if(ref.current===node)return;if(node){setTimeout(()=>{if(node.getRootNode())focusNode(node)});ref.current=node}else ref.current=null},[active]);(0,index_js_.useEffect)(()=>{if(!active)return;ref.current&&setTimeout(()=>focusNode(ref.current));const handleKeyDown=event=>{if("Tab"===event.key&&ref.current)scopeTab(ref.current,event)};document.addEventListener("keydown",handleKeyDown);return()=>document.removeEventListener("keydown",handleKeyDown)},[active]);return setRef}"use client";const reducer=value=>(value+1)%1e6;function useForceUpdate(){const[,update]=(0,index_js_.useReducer)(reducer,0);return update}"use client";const __useId=index_js_["useId".toString()]||(()=>void 0);function useReactId(){const id=__useId();return id?`mantine-${id.replace(/:/g,"")}`:""}"use client";function useId(staticId){const reactId=useReactId();const[uuid,setUuid]=(0,index_js_.useState)(reactId);useIsomorphicEffect(()=>{setUuid(randomId())},[]);if("string"==typeof staticId)return staticId;if("undefined"==typeof window)return reactId;return uuid}"use client";const use_idle_DEFAULT_OPTIONS={events:["keydown","mousemove","touchmove","click","scroll","wheel"],initialState:true};function useIdle(timeout,options){const{events,initialState}={...use_idle_DEFAULT_OPTIONS,...options};const[idle,setIdle]=(0,index_js_.useState)(initialState);const timer=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>{const handleEvents=()=>{setIdle(false);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>{setIdle(true)},timeout)};events.forEach(event=>document.addEventListener(event,handleEvents));timer.current=window.setTimeout(()=>{setIdle(true)},timeout);return()=>{events.forEach(event=>document.removeEventListener(event,handleEvents));window.clearTimeout(timer.current);timer.current=-1}},[timeout]);return idle}"use client";function useInterval(fn,interval,{autoInvoke=false}={}){const[active,setActive]=(0,index_js_.useState)(false);const intervalRef=(0,index_js_.useRef)(null);const fnRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)(()=>{setActive(old=>{if(!old&&(!intervalRef.current||-1===intervalRef.current))intervalRef.current=window.setInterval(fnRef.current,interval);return true})},[]);const stop=(0,index_js_.useCallback)(()=>{setActive(false);window.clearInterval(intervalRef.current||-1);intervalRef.current=-1},[]);const toggle=(0,index_js_.useCallback)(()=>{if(active)stop();else start()},[active]);(0,index_js_.useEffect)(()=>{fnRef.current=fn;active&&start();return stop},[fn,active,interval]);(0,index_js_.useEffect)(()=>{if(autoInvoke)start()},[]);return{start,stop,toggle,active}}"use client";function useListState(initialValue=[]){const[state,setState]=(0,index_js_.useState)(initialValue);const append=(...items)=>setState(current=>[...current,...items]);const prepend=(...items)=>setState(current=>[...items,...current]);const insert=(index,...items)=>setState(current=>[...current.slice(0,index),...items,...current.slice(index)]);const apply=fn=>setState(current=>current.map((item,index)=>fn(item,index)));const remove=(...indices)=>setState(current=>current.filter((_,index)=>!indices.includes(index)));const pop=()=>setState(current=>{const cloned=[...current];cloned.pop();return cloned});const shift=()=>setState(current=>{const cloned=[...current];cloned.shift();return cloned});const reorder=({from,to})=>setState(current=>{const cloned=[...current];const item=current[from];cloned.splice(from,1);cloned.splice(to,0,item);return cloned});const swap=({from,to})=>setState(current=>{const cloned=[...current];const fromItem=cloned[from];const toItem=cloned[to];cloned.splice(to,1,fromItem);cloned.splice(from,1,toItem);return cloned});const setItem=(index,item)=>setState(current=>{const cloned=[...current];cloned[index]=item;return cloned});const setItemProp=(index,prop,value)=>setState(current=>{const cloned=[...current];cloned[index]={...cloned[index],[prop]:value};return cloned});const applyWhere=(condition,fn)=>setState(current=>current.map((item,index)=>condition(item,index)?fn(item,index):item));const filter=fn=>{setState(current=>current.filter(fn))};return[state,{setState,append,prepend,insert,pop,shift,apply,applyWhere,remove,reorder,swap,setItem,setItemProp,filter}]}"use client";function useWindowEvent(type,listener,options){(0,index_js_.useEffect)(()=>{window.addEventListener(type,listener,options);return()=>window.removeEventListener(type,listener,options)},[type,listener])}"use client";function serializeJSON(value,hookName="use-local-storage"){try{return JSON.stringify(value)}catch(error){throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`)}}function deserializeJSON(value){try{return value&&JSON.parse(value)}catch{return value}}function createStorageHandler(type){const getItem=key=>{try{return window[type].getItem(key)}catch(error){console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked");return null}};const setItem=(key,value)=>{try{window[type].setItem(key,value)}catch(error){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}};const removeItem=key=>{try{window[type].removeItem(key)}catch(error){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}};return{getItem,setItem,removeItem}}function createStorage(type,hookName){const eventName="localStorage"===type?"mantine-local-storage":"mantine-session-storage";const{getItem,setItem,removeItem}=createStorageHandler(type);return function({key,defaultValue,getInitialValueInEffect=true,sync=true,deserialize=deserializeJSON,serialize=value=>serializeJSON(value,hookName)}){const readStorageValue=(0,index_js_.useCallback)(skipStorage=>{let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]||!!skipStorage}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue},[key,defaultValue]);const[value,setValue]=(0,index_js_.useState)(readStorageValue(getInitialValueInEffect));const setStorageValue=(0,index_js_.useCallback)(val=>{if(val instanceof Function)setValue(current=>{const result=val(current);setItem(key,serialize(result));queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val(current)}}))});return result});else{setItem(key,serialize(val));window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val}}));setValue(val)}},[key]);const removeStorageValue=(0,index_js_.useCallback)(()=>{removeItem(key);setValue(defaultValue);window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:defaultValue}}))},[key,defaultValue]);useWindowEvent("storage",event=>{if(sync){if(event.storageArea===window[type]&&event.key===key)setValue(deserialize(event.newValue??void 0))}});useWindowEvent(eventName,event=>{if(sync){if(event.detail.key===key)setValue(event.detail.value)}});(0,index_js_.useEffect)(()=>{if(void 0!==defaultValue&&void 0===value)setStorageValue(defaultValue)},[defaultValue,value,setStorageValue]);(0,index_js_.useEffect)(()=>{const val=readStorageValue();void 0!==val&&setStorageValue(val)},[key]);return[void 0===value?defaultValue:value,setStorageValue,removeStorageValue]}}function readValue(type){const{getItem}=createStorageHandler(type);return function({key,defaultValue,deserialize=deserializeJSON}){let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue}}"use client";function useLocalStorage(props){return createStorage("localStorage","use-local-storage")(props)}const readLocalStorageValue=readValue("localStorage");"use client";function useSessionStorage(props){return createStorage("sessionStorage","use-session-storage")(props)}const readSessionStorageValue=readValue("sessionStorage");"use client";function assignRef(ref,value){if("function"==typeof ref)return ref(value);if("object"==typeof ref&&null!==ref&&"current"in ref)ref.current=value}function mergeRefs(...refs){const cleanupMap=/* @__PURE__ */new Map;return node=>{refs.forEach(ref=>{const cleanup=assignRef(ref,node);if(cleanup)cleanupMap.set(ref,cleanup)});if(cleanupMap.size>0)return()=>{refs.forEach(ref=>{const cleanup=cleanupMap.get(ref);if(cleanup&&"function"==typeof cleanup)cleanup();else assignRef(ref,null)});cleanupMap.clear()}}}function useMergedRef(...refs){return(0,index_js_.useCallback)(mergeRefs(...refs),refs)}"use client";function useMouse(options={resetOnExit:false}){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});const ref=(0,index_js_.useRef)(null);const setMousePosition=event=>{if(ref.current){const rect=event.currentTarget.getBoundingClientRect();const x=Math.max(0,Math.round(event.pageX-rect.left-(window.scrollX||window.scrollX)));const y=Math.max(0,Math.round(event.pageY-rect.top-(window.scrollY||window.scrollY)));setPosition({x,y})}else setPosition({x:event.clientX,y:event.clientY})};const resetMousePosition=()=>setPosition({x:0,y:0});(0,index_js_.useEffect)(()=>{const element=ref?.current?ref.current:document;element.addEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.addEventListener("mouseleave",resetMousePosition);return()=>{element.removeEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.removeEventListener("mouseleave",resetMousePosition)}},[ref.current]);return{ref,...position}}"use client";function clampUseMovePosition(position){return{x:clamp(position.x,0,1),y:clamp(position.y,0,1)}}function useMove(onChange,handlers,dir="ltr"){const mounted=(0,index_js_.useRef)(false);const isSliding=(0,index_js_.useRef)(false);const frame=(0,index_js_.useRef)(0);const[active,setActive]=(0,index_js_.useState)(false);const cleanupRef=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{if(cleanupRef.current){cleanupRef.current();cleanupRef.current=null}if(!node)return;const onScrub=({x,y})=>{cancelAnimationFrame(frame.current);frame.current=requestAnimationFrame(()=>{if(mounted.current&&node){node.style.userSelect="none";const rect=node.getBoundingClientRect();if(rect.width&&rect.height){const _x=clamp((x-rect.left)/rect.width,0,1);onChange({x:"ltr"===dir?_x:1-_x,y:clamp((y-rect.top)/rect.height,0,1)})}}})};const bindEvents=()=>{document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",stopScrubbing);document.addEventListener("touchmove",onTouchMove,{passive:false});document.addEventListener("touchend",stopScrubbing)};const unbindEvents=()=>{document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",stopScrubbing);document.removeEventListener("touchmove",onTouchMove);document.removeEventListener("touchend",stopScrubbing)};const startScrubbing=()=>{if(!isSliding.current&&mounted.current){isSliding.current=true;"function"==typeof handlers?.onScrubStart&&handlers.onScrubStart();setActive(true);bindEvents()}};const stopScrubbing=()=>{if(isSliding.current&&mounted.current){isSliding.current=false;setActive(false);unbindEvents();setTimeout(()=>{"function"==typeof handlers?.onScrubEnd&&handlers.onScrubEnd()},0)}};const onMouseDown=event=>{startScrubbing();event.preventDefault();onMouseMove(event)};const onMouseMove=event=>onScrub({x:event.clientX,y:event.clientY});const onTouchStart=event=>{if(event.cancelable)event.preventDefault();startScrubbing();onTouchMove(event)};const onTouchMove=event=>{if(event.cancelable)event.preventDefault();onScrub({x:event.changedTouches[0].clientX,y:event.changedTouches[0].clientY})};node.addEventListener("mousedown",onMouseDown);node.addEventListener("touchstart",onTouchStart,{passive:false});cleanupRef.current=()=>{node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",onTouchStart)}},[dir,onChange]);return{ref:refCallback,active}}"use client";function useUncontrolled({value,defaultValue,finalValue,onChange=()=>{}}){const[uncontrolledValue,setUncontrolledValue]=(0,index_js_.useState)(void 0!==defaultValue?defaultValue:finalValue);const handleUncontrolledChange=(val,...payload)=>{setUncontrolledValue(val);onChange?.(val,...payload)};if(void 0!==value)return[value,onChange,true];return[uncontrolledValue,handleUncontrolledChange,false]}"use client";function use_pagination_range(start,end){const length=end-start+1;return Array.from({length},(_,index)=>index+start)}const DOTS="dots";function usePagination({total,siblings=1,boundaries=1,page,initialPage=1,onChange}){const _total=Math.max(Math.trunc(total),0);const[activePage,setActivePage]=useUncontrolled({value:page,onChange,defaultValue:initialPage,finalValue:initialPage});const setPage=pageNumber=>{if(pageNumber<=0)setActivePage(1);else pageNumber>_total?setActivePage(_total):setActivePage(pageNumber)};const next=()=>setPage(activePage+1);const previous=()=>setPage(activePage-1);const first=()=>setPage(1);const last=()=>setPage(_total);const paginationRange=(0,index_js_.useMemo)(()=>{const totalPageNumbers=2*siblings+3+2*boundaries;if(totalPageNumbers>=_total)return use_pagination_range(1,_total);const leftSiblingIndex=Math.max(activePage-siblings,boundaries);const rightSiblingIndex=Math.min(activePage+siblings,_total-boundaries);const shouldShowLeftDots=leftSiblingIndex>boundaries+2;const shouldShowRightDots=rightSiblingIndex<_total-(boundaries+1);if(!shouldShowLeftDots&&shouldShowRightDots){const leftItemCount=2*siblings+boundaries+2;return[...use_pagination_range(1,leftItemCount),DOTS,...use_pagination_range(_total-(boundaries-1),_total)]}if(shouldShowLeftDots&&!shouldShowRightDots){const rightItemCount=boundaries+1+2*siblings;return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(_total-rightItemCount,_total)]}return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(leftSiblingIndex,rightSiblingIndex),DOTS,...use_pagination_range(_total-boundaries+1,_total)]},[_total,siblings,activePage]);return{range:paginationRange,active:activePage,setPage,next,previous,first,last}}"use client";function useQueue({initialValues=[],limit}){const[state,setState]=(0,index_js_.useState)({state:initialValues.slice(0,limit),queue:initialValues.slice(limit)});const add=(...items)=>setState(current=>{const results=[...current.state,...current.queue,...items];return{state:results.slice(0,limit),queue:results.slice(limit)}});const update=fn=>setState(current=>{const results=fn([...current.state,...current.queue]);return{state:results.slice(0,limit),queue:results.slice(limit)}});const cleanQueue=()=>setState(current=>({state:current.state,queue:[]}));return{state:state.state,queue:state.queue,add,update,cleanQueue}}"use client";function usePageLeave(onPageLeave){(0,index_js_.useEffect)(()=>{document.documentElement.addEventListener("mouseleave",onPageLeave);return()=>document.documentElement.removeEventListener("mouseleave",onPageLeave)},[])}"use client";function useReducedMotion(initialValue,options){return useMediaQuery("(prefers-reduced-motion: reduce)",initialValue,options)}"use client";function useScrollIntoView({duration=1250,axis="y",onScrollFinish,easing=easeInOutQuad,offset=0,cancelable=true,isList=false}={}){const frameID=(0,index_js_.useRef)(0);const startTime=(0,index_js_.useRef)(0);const shouldStop=(0,index_js_.useRef)(false);const scrollableRef=(0,index_js_.useRef)(null);const targetRef=(0,index_js_.useRef)(null);const reducedMotion=useReducedMotion();const cancel=()=>{if(frameID.current)cancelAnimationFrame(frameID.current)};const scrollIntoView=(0,index_js_.useCallback)(({alignment="start"}={})=>{shouldStop.current=false;if(frameID.current)cancel();const start=getScrollStart({parent:scrollableRef.current,axis})??0;const change=getRelativePosition({parent:scrollableRef.current,target:targetRef.current,axis,alignment,offset,isList})-(scrollableRef.current?0:start);function animateScroll(){if(0===startTime.current)startTime.current=performance.now();const now=performance.now();const elapsed=now-startTime.current;const t=reducedMotion||0===duration?1:elapsed/duration;const distance=start+change*easing(t);setScrollParam({parent:scrollableRef.current,axis,distance});if(!shouldStop.current&&t<1)frameID.current=requestAnimationFrame(animateScroll);else{"function"==typeof onScrollFinish&&onScrollFinish();startTime.current=0;frameID.current=0;cancel()}}animateScroll()},[axis,duration,easing,isList,offset,onScrollFinish,reducedMotion]);const handleStop=()=>{if(cancelable)shouldStop.current=true};useWindowEvent("wheel",handleStop,{passive:true});useWindowEvent("touchmove",handleStop,{passive:true});(0,index_js_.useEffect)(()=>cancel,[]);return{scrollableRef,targetRef,scrollIntoView,cancel}}function easeInOutQuad(t){return t<.5?2*t*t:-1+(4-2*t)*t}function getRelativePosition({axis,target,parent,alignment,offset,isList}){if(!target||!parent&&"undefined"==typeof document)return 0;const isCustomParent=!!parent;const parentElement=parent||document.body;const parentPosition=parentElement.getBoundingClientRect();const targetPosition=target.getBoundingClientRect();const getDiff=property=>targetPosition[property]-parentPosition[property];if("y"===axis){const diff=getDiff("top");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}const parentHeight=isCustomParent?parentPosition.height:window.innerHeight;if("end"===alignment){const distance=diff+offset-parentHeight+targetPosition.height;const shouldScroll=distance>=-targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentHeight/2+targetPosition.height/2;return 0}if("x"===axis){const diff=getDiff("left");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.width||!isList;return shouldScroll?distance:0}const parentWidth=isCustomParent?parentPosition.width:window.innerWidth;if("end"===alignment){const distance=diff+offset-parentWidth+targetPosition.width;const shouldScroll=distance>=-targetPosition.width||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentWidth/2+targetPosition.width/2}return 0}function getScrollStart({axis,parent}){if(!parent&&"undefined"==typeof document)return 0;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)return parent[method];const{body,documentElement}=document;return body[method]+documentElement[method]}function setScrollParam({axis,parent,distance}){if(!parent&&"undefined"==typeof document)return;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)parent[method]=distance;else{const{body,documentElement}=document;body[method]=distance;documentElement[method]=distance}}"use client";const defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useResizeObserver(options){const frameID=(0,index_js_.useRef)(0);const ref=(0,index_js_.useRef)(null);const[rect,setRect]=(0,index_js_.useState)(defaultState);const observer=(0,index_js_.useMemo)(()=>"undefined"!=typeof window?new ResizeObserver(entries=>{const entry=entries[0];if(entry){cancelAnimationFrame(frameID.current);frameID.current=requestAnimationFrame(()=>{if(ref.current){const boxSize=entry.borderBoxSize?.[0]||entry.contentBoxSize?.[0];if(boxSize){const width=boxSize.inlineSize;const height=boxSize.blockSize;setRect({width,height,x:entry.contentRect.x,y:entry.contentRect.y,top:entry.contentRect.top,left:entry.contentRect.left,bottom:entry.contentRect.bottom,right:entry.contentRect.right})}else setRect(entry.contentRect)}})}}):null,[]);(0,index_js_.useEffect)(()=>{if(ref.current)observer?.observe(ref.current,options);return()=>{observer?.disconnect();if(frameID.current)cancelAnimationFrame(frameID.current)}},[ref.current]);return[ref,rect]}function useElementSize(options){const[ref,{width,height}]=useResizeObserver(options);return{ref,width,height}}"use client";function shallowCompare(prevValue,currValue){if(!prevValue||!currValue)return false;if(prevValue===currValue)return true;if(prevValue.length!==currValue.length)return false;for(let i=0;i<prevValue.length;i+=1)if(!shallowEqual(prevValue[i],currValue[i]))return false;return true}function useShallowCompare(dependencies){const ref=(0,index_js_.useRef)([]);const updateRef=(0,index_js_.useRef)(0);if(!shallowCompare(ref.current,dependencies)){ref.current=dependencies;updateRef.current+=1}return[updateRef.current]}function useShallowEffect(cb,dependencies){(0,index_js_.useEffect)(cb,useShallowCompare(dependencies))}"use client";function useToggle(options=[false,true]){const[[option],toggle]=(0,index_js_.useReducer)((state,action)=>{const value=action instanceof Function?action(state[0]):action;const index=Math.abs(state.indexOf(value));return state.slice(index).concat(state.slice(0,index))},options);return[option,toggle]}"use client";const eventListerOptions={passive:true};function useViewportSize(){const[windowSize,setWindowSize]=(0,index_js_.useState)({width:0,height:0});const setSize=(0,index_js_.useCallback)(()=>{setWindowSize({width:window.innerWidth||0,height:window.innerHeight||0})},[]);useWindowEvent("resize",setSize,eventListerOptions);useWindowEvent("orientationchange",setSize,eventListerOptions);(0,index_js_.useEffect)(setSize,[]);return windowSize}"use client";function getScrollPosition(){return"undefined"!=typeof window?{x:window.scrollX,y:window.scrollY}:{x:0,y:0}}function scrollTo({x,y}){if("undefined"!=typeof window){const scrollOptions={behavior:"smooth"};if("number"==typeof x)scrollOptions.left=x;if("number"==typeof y)scrollOptions.top=y;window.scrollTo(scrollOptions)}}function useWindowScroll(){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});useWindowEvent("scroll",()=>setPosition(getScrollPosition()));useWindowEvent("resize",()=>setPosition(getScrollPosition()));(0,index_js_.useEffect)(()=>{setPosition(getScrollPosition())},[]);return[position,scrollTo]}"use client";function useIntersection(options){const[entry,setEntry]=(0,index_js_.useState)(null);const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useCallback)(element=>{if(observer.current){observer.current.disconnect();observer.current=null}if(null===element)return void setEntry(null);observer.current=new IntersectionObserver(([_entry])=>{setEntry(_entry)},options);observer.current.observe(element)},[options?.rootMargin,options?.root,options?.threshold]);return{ref,entry}}"use client";function useHash({getInitialValueInEffect=true}={}){const[hash,setHash]=(0,index_js_.useState)(getInitialValueInEffect?"":window.location.hash||"");const setHashHandler=value=>{const valueWithHash=value.startsWith("#")?value:`#${value}`;window.location.hash=valueWithHash;setHash(valueWithHash)};useWindowEvent("hashchange",()=>{const newHash=window.location.hash;if(hash!==newHash)setHash(newHash)});(0,index_js_.useEffect)(()=>{if(getInitialValueInEffect)setHash(window.location.hash)},[]);return[hash,setHashHandler]}"use client";const keyNameMap={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function normalizeKey(key){const lowerKey=key.replace("Key","").toLowerCase();return keyNameMap[key]||lowerKey}function parseHotkey(hotkey){const keys=hotkey.toLowerCase().split("+").map(part=>part.trim());const modifiers={alt:keys.includes("alt"),ctrl:keys.includes("ctrl"),meta:keys.includes("meta"),mod:keys.includes("mod"),shift:keys.includes("shift"),plus:keys.includes("[plus]")};const reservedKeys=["alt","ctrl","meta","shift","mod"];const freeKey=keys.find(key=>!reservedKeys.includes(key));return{...modifiers,key:"[plus]"===freeKey?"+":freeKey}}function isExactHotkey(hotkey,event,usePhysicalKeys){const{alt,ctrl,meta,mod,shift,key}=hotkey;const{altKey,ctrlKey,metaKey,shiftKey,key:pressedKey,code:pressedCode}=event;if(alt!==altKey)return false;if(mod){if(!ctrlKey&&!metaKey)return false}else{if(ctrl!==ctrlKey)return false;if(meta!==metaKey)return false}if(shift!==shiftKey)return false;if(key&&(usePhysicalKeys?normalizeKey(pressedCode)===normalizeKey(key):normalizeKey(pressedKey??pressedCode)===normalizeKey(key)))return true;return false}function getHotkeyMatcher(hotkey,usePhysicalKeys){return event=>isExactHotkey(parseHotkey(hotkey),event,usePhysicalKeys)}function getHotkeyHandler(hotkeys){return event=>{const _event="nativeEvent"in event?event.nativeEvent:event;hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(_event)){if(options.preventDefault)event.preventDefault();handler(_event)}})}}"use client";function shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable=false){if(event.target instanceof HTMLElement){if(triggerOnContentEditable)return!tagsToIgnore.includes(event.target.tagName);return!event.target.isContentEditable&&!tagsToIgnore.includes(event.target.tagName)}return true}function useHotkeys(hotkeys,tagsToIgnore=["INPUT","TEXTAREA","SELECT"],triggerOnContentEditable=false){(0,index_js_.useEffect)(()=>{const keydownListener=event=>{hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(event)&&shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable)){if(options.preventDefault)event.preventDefault();handler(event)}})};document.documentElement.addEventListener("keydown",keydownListener);return()=>document.documentElement.removeEventListener("keydown",keydownListener)},[hotkeys])}"use client";function getFullscreenElement(){const _document=window.document;const fullscreenElement=_document.fullscreenElement||_document.webkitFullscreenElement||_document.mozFullScreenElement||_document.msFullscreenElement;return fullscreenElement}function exitFullscreen(){const _document=window.document;if("function"==typeof _document.exitFullscreen)return _document.exitFullscreen();if("function"==typeof _document.msExitFullscreen)return _document.msExitFullscreen();if("function"==typeof _document.webkitExitFullscreen)return _document.webkitExitFullscreen();if("function"==typeof _document.mozCancelFullScreen)return _document.mozCancelFullScreen();return null}function enterFullScreen(element){const _element=element;return _element.requestFullscreen?.()||_element.msRequestFullscreen?.()||_element.webkitEnterFullscreen?.()||_element.webkitRequestFullscreen?.()||_element.mozRequestFullscreen?.()}const prefixes=["","webkit","moz","ms"];function addEvents(element,{onFullScreen,onError}){prefixes.forEach(prefix=>{element.addEventListener(`${prefix}fullscreenchange`,onFullScreen);element.addEventListener(`${prefix}fullscreenerror`,onError)});return()=>{prefixes.forEach(prefix=>{element.removeEventListener(`${prefix}fullscreenchange`,onFullScreen);element.removeEventListener(`${prefix}fullscreenerror`,onError)})}}function useFullscreen(){const[fullscreen,setFullscreen]=(0,index_js_.useState)(false);const _ref=(0,index_js_.useRef)(null);const handleFullscreenChange=(0,index_js_.useCallback)(event=>{setFullscreen(event.target===getFullscreenElement())},[setFullscreen]);const handleFullscreenError=(0,index_js_.useCallback)(event=>{setFullscreen(false);console.error(`[@mantine/hooks] use-fullscreen: Error attempting full-screen mode method: ${event} (${event.target})`)},[setFullscreen]);const toggle=(0,index_js_.useCallback)(async()=>{if(getFullscreenElement())await exitFullscreen();else await enterFullScreen(_ref.current)},[]);const ref=(0,index_js_.useCallback)(element=>{if(null===element)_ref.current=window.document.documentElement;else _ref.current=element},[]);(0,index_js_.useEffect)(()=>{if(!_ref.current&&window.document){_ref.current=window.document.documentElement;return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})}if(_ref.current)return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})},[_ref.current]);return{ref,toggle,fullscreen}}"use client";function useLogger(componentName,props){(0,index_js_.useEffect)(()=>{console.log(`${componentName} mounted`,...props);return()=>console.log(`${componentName} unmounted`)},[]);useDidUpdate(()=>{console.log(`${componentName} updated`,...props)},props);return null}"use client";function useHover(){const[hovered,setHovered]=(0,index_js_.useState)(false);const previousNode=(0,index_js_.useRef)(null);const handleMouseEnter=(0,index_js_.useCallback)(()=>{setHovered(true)},[]);const handleMouseLeave=(0,index_js_.useCallback)(()=>{setHovered(false)},[]);const ref=(0,index_js_.useCallback)(node=>{if(previousNode.current){previousNode.current.removeEventListener("mouseenter",handleMouseEnter);previousNode.current.removeEventListener("mouseleave",handleMouseLeave)}if(node){node.addEventListener("mouseenter",handleMouseEnter);node.addEventListener("mouseleave",handleMouseLeave)}previousNode.current=node},[handleMouseEnter,handleMouseLeave]);return{ref,hovered}}"use client";function useValidatedState(initialValue,validate,initialValidationState){const[value,setValue]=(0,index_js_.useState)(initialValue);const[lastValidValue,setLastValidValue]=(0,index_js_.useState)(validate(initialValue)?initialValue:void 0);const[valid,setValid]=(0,index_js_.useState)("boolean"==typeof initialValidationState?initialValidationState:validate(initialValue));const onChange=val=>{if(validate(val)){setLastValidValue(val);setValid(true)}else setValid(false);setValue(val)};return[{value,lastValidValue,valid},onChange]}"use client";function isMacOS(userAgent){const macosPattern=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i;return macosPattern.test(userAgent)}function isIOS(userAgent){const iosPattern=/(iPhone)|(iPad)|(iPod)/i;return iosPattern.test(userAgent)}function isWindows(userAgent){const windowsPattern=/(Win32)|(Win64)|(Windows)|(WinCE)/i;return windowsPattern.test(userAgent)}function isAndroid(userAgent){const androidPattern=/Android/i;return androidPattern.test(userAgent)}function isLinux(userAgent){const linuxPattern=/Linux/i;return linuxPattern.test(userAgent)}function isChromeOS(userAgent){const chromePattern=/CrOS/i;return chromePattern.test(userAgent)}function getOS(){if("undefined"==typeof window)return"undetermined";const{userAgent}=window.navigator;if(isIOS(userAgent)||isMacOS(userAgent)&&"ontouchend"in document)return"ios";if(isMacOS(userAgent))return"macos";if(isWindows(userAgent))return"windows";if(isAndroid(userAgent))return"android";if(isLinux(userAgent))return"linux";if(isChromeOS(userAgent))return"chromeos";return"undetermined"}function useOs(options={getValueInEffect:true}){const[value,setValue]=(0,index_js_.useState)(options.getValueInEffect?"undetermined":getOS());useIsomorphicEffect(()=>{if(options.getValueInEffect)setValue(getOS)},[]);return value}"use client";function useSetState(initialState){const[state,setState]=(0,index_js_.useState)(initialState);const _setState=(0,index_js_.useCallback)(statePartial=>setState(current=>({...current,..."function"==typeof statePartial?statePartial(current):statePartial})),[]);return[state,_setState]}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value)}else setValue(val);else setValue(val)}}function useInputState(initialState){const[value,setValue]=(0,index_js_.useState)(initialState);return[value,getInputOnChange(setValue)]}"use client";function useEventListener(type,listener,options){const previousListener=(0,index_js_.useRef)(null);const previousNode=(0,index_js_.useRef)(null);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options);node.addEventListener(type,listener,options);previousNode.current=node;previousListener.current=listener},[type,listener,options]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options)},[type,options]);return callbackRef}"use client";function useDisclosure(initialState=false,options={}){const[opened,setOpened]=(0,index_js_.useState)(initialState);const open=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(!isOpened){options.onOpen?.();return true}return isOpened})},[options.onOpen]);const close=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(isOpened){options.onClose?.();return false}return isOpened})},[options.onClose]);const toggle=(0,index_js_.useCallback)(()=>{opened?close():open()},[close,open,opened]);return[opened,{open,close,toggle}]}"use client";function containsRelatedTarget(event){if(event.currentTarget instanceof HTMLElement&&event.relatedTarget instanceof HTMLElement)return event.currentTarget.contains(event.relatedTarget);return false}function useFocusWithin({onBlur,onFocus}={}){const[focused,setFocused]=(0,index_js_.useState)(false);const focusedRef=(0,index_js_.useRef)(false);const previousNode=(0,index_js_.useRef)(null);const _setFocused=(0,index_js_.useCallback)(value=>{setFocused(value);focusedRef.current=value},[]);const handleFocusIn=(0,index_js_.useCallback)(event=>{if(!focusedRef.current){_setFocused(true);onFocus?.(event)}},[onFocus]);const handleFocusOut=(0,index_js_.useCallback)(event=>{if(focusedRef.current&&!containsRelatedTarget(event)){_setFocused(false);onBlur?.(event)}},[onBlur]);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}node.addEventListener("focusin",handleFocusIn);node.addEventListener("focusout",handleFocusOut)},[handleFocusIn,handleFocusOut]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}},[]);return{ref:callbackRef,focused}}"use client";function getConnection(){if("undefined"==typeof navigator)return{};const _navigator=navigator;const connection=_navigator.connection||_navigator.mozConnection||_navigator.webkitConnection;if(!connection)return{};return{downlink:connection?.downlink,downlinkMax:connection?.downlinkMax,effectiveType:connection?.effectiveType,rtt:connection?.rtt,saveData:connection?.saveData,type:connection?.type}}function useNetwork(){const[status,setStatus]=(0,index_js_.useState)({online:true});const handleConnectionChange=(0,index_js_.useCallback)(()=>setStatus(current=>({...current,...getConnection()})),[]);useWindowEvent("online",()=>setStatus({online:true,...getConnection()}));useWindowEvent("offline",()=>setStatus({online:false,...getConnection()}));(0,index_js_.useEffect)(()=>{const _navigator=navigator;if(_navigator.connection){setStatus({online:_navigator.onLine,...getConnection()});_navigator.connection.addEventListener("change",handleConnectionChange);return()=>_navigator.connection.removeEventListener("change",handleConnectionChange)}if("boolean"==typeof _navigator.onLine)setStatus(current=>({...current,online:_navigator.onLine}))},[]);return status}"use client";function useTimeout(callback,delay,options={autoInvoke:false}){const timeoutRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)((...args)=>{if(!timeoutRef.current)timeoutRef.current=window.setTimeout(()=>{callback(args);timeoutRef.current=null},delay)},[delay]);const clear=(0,index_js_.useCallback)(()=>{if(timeoutRef.current){window.clearTimeout(timeoutRef.current);timeoutRef.current=null}},[]);(0,index_js_.useEffect)(()=>{if(options.autoInvoke)start();return clear},[clear,start]);return{start,clear}}"use client";function useTextSelection(){const forceUpdate=useForceUpdate();const[selection,setSelection]=(0,index_js_.useState)(null);const handleSelectionChange=()=>{setSelection(document.getSelection());forceUpdate()};(0,index_js_.useEffect)(()=>{setSelection(document.getSelection());document.addEventListener("selectionchange",handleSelectionChange);return()=>document.removeEventListener("selectionchange",handleSelectionChange)},[]);return selection}"use client";function usePrevious(value){const ref=(0,index_js_.useRef)(void 0);(0,index_js_.useEffect)(()=>{ref.current=value},[value]);return ref.current}"use client";const MIME_TYPES={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function useFavicon(url){const link=(0,index_js_.useRef)(null);useIsomorphicEffect(()=>{if(!url)return;if(!link.current){const existingElements=document.querySelectorAll('link[rel*="icon"]');existingElements.forEach(element2=>document.head.removeChild(element2));const element=document.createElement("link");element.rel="shortcut icon";link.current=element;document.querySelector("head").appendChild(element)}const splittedUrl=url.split(".");link.current.setAttribute("type",MIME_TYPES[splittedUrl[splittedUrl.length-1].toLowerCase()]);link.current.setAttribute("href",url)},[url])}"use client";const isFixed=(current,fixedAt)=>current<=fixedAt;const isPinnedOrReleased=(current,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)=>{const isInFixedPosition=isFixed(current,fixedAt);if(isInFixedPosition&&!isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=true;onPin?.()}else if(isInFixedPosition||!isScrollingUp||isCurrentlyPinnedRef.current){if(!isInFixedPosition&&isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=false;onRelease?.()}}else{isCurrentlyPinnedRef.current=true;onPin?.()}};const useScrollDirection=()=>{const[lastScrollTop,setLastScrollTop]=(0,index_js_.useState)(0);const[isScrollingUp,setIsScrollingUp]=(0,index_js_.useState)(false);const[isResizing,setIsResizing]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{let resizeTimer;const onResize=()=>{setIsResizing(true);clearTimeout(resizeTimer);resizeTimer=setTimeout(()=>{setIsResizing(false)},300)};const onScroll=()=>{if(isResizing)return;const currentScrollTop=window.scrollY||document.documentElement.scrollTop;setIsScrollingUp(currentScrollTop<lastScrollTop);setLastScrollTop(currentScrollTop)};window.addEventListener("scroll",onScroll);window.addEventListener("resize",onResize);return()=>{window.removeEventListener("scroll",onScroll);window.removeEventListener("resize",onResize)}},[lastScrollTop,isResizing]);return isScrollingUp};function useHeadroom({fixedAt=0,onPin,onFix,onRelease}={}){const isCurrentlyPinnedRef=(0,index_js_.useRef)(false);const isScrollingUp=useScrollDirection();const[{y:scrollPosition}]=useWindowScroll();useIsomorphicEffect(()=>{isPinnedOrReleased(scrollPosition,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)},[scrollPosition]);useIsomorphicEffect(()=>{if(isFixed(scrollPosition,fixedAt))onFix?.()},[scrollPosition,fixedAt,onFix]);if(isFixed(scrollPosition,fixedAt)||isScrollingUp)return true;return false}"use client";function useEyeDropper(){const[supported,setSupported]=(0,index_js_.useState)(false);useIsomorphicEffect(()=>{setSupported("undefined"!=typeof window&&!isOpera()&&"EyeDropper"in window)},[]);const open=(0,index_js_.useCallback)((options={})=>{if(supported){const eyeDropper=new window.EyeDropper;return eyeDropper.open(options)}return Promise.resolve(void 0)},[supported]);return{supported,open}}function isOpera(){return navigator.userAgent.includes("OPR")}"use client";function useInViewport(){const observer=(0,index_js_.useRef)(null);const[inViewport,setInViewport]=(0,index_js_.useState)(false);const ref=(0,index_js_.useCallback)(node=>{if("undefined"!=typeof IntersectionObserver){if(node&&!observer.current)observer.current=new IntersectionObserver(entries=>setInViewport(entries.some(entry=>entry.isIntersecting)));else observer.current?.disconnect();if(node)observer.current?.observe(node);else setInViewport(false)}},[]);return{ref,inViewport}}"use client";function useMutationObserver(callback,options,target){const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{const targetElement="function"==typeof target?target():target;if(targetElement||ref.current){observer.current=new MutationObserver(callback);observer.current.observe(targetElement||ref.current,options)}return()=>{observer.current?.disconnect()}},[callback,options]);return ref}"use client";function useMounted(){const[mounted,setMounted]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>setMounted(true),[]);return mounted}"use client";function useStateHistory(initialValue){const[state,setState]=(0,index_js_.useState)({history:[initialValue],current:0});const set=(0,index_js_.useCallback)(val=>setState(currentState=>{const nextState=[...currentState.history.slice(0,currentState.current+1),val];return{history:nextState,current:nextState.length-1}}),[]);const back=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.max(0,currentState.current-steps)})),[]);const forward=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.min(currentState.history.length-1,currentState.current+steps)})),[]);const reset=(0,index_js_.useCallback)(()=>{setState({history:[initialValue],current:0})},[initialValue]);const handlers=(0,index_js_.useMemo)(()=>({back,forward,reset,set}),[back,forward,reset,set]);return[state.history[state.current],handlers,state]}"use client";function useMap(initialState){const mapRef=(0,index_js_.useRef)(new Map(initialState));const forceUpdate=useForceUpdate();mapRef.current.set=(...args)=>{Map.prototype.set.apply(mapRef.current,args);forceUpdate();return mapRef.current};mapRef.current.clear=(...args)=>{Map.prototype.clear.apply(mapRef.current,args);forceUpdate()};mapRef.current.delete=(...args)=>{const res=Map.prototype.delete.apply(mapRef.current,args);forceUpdate();return res};return mapRef.current}"use client";function readonlySetLikeToSet(input){if(input instanceof Set)return input;const result=/* @__PURE__ */new Set;for(const item of input)result.add(item);return result}function useSet(values){const setRef=(0,index_js_.useRef)(new Set(values));const forceUpdate=useForceUpdate();setRef.current.add=(...args)=>{const res=Set.prototype.add.apply(setRef.current,args);forceUpdate();return res};setRef.current.clear=(...args)=>{Set.prototype.clear.apply(setRef.current,args);forceUpdate()};setRef.current.delete=(...args)=>{const res=Set.prototype.delete.apply(setRef.current,args);forceUpdate();return res};setRef.current.union=other=>{const result=new Set(setRef.current);readonlySetLikeToSet(other).forEach(item=>result.add(item));return result};setRef.current.intersection=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(otherSet.has(item))result.add(item)});return result};setRef.current.difference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});return result};setRef.current.symmetricDifference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});otherSet.forEach(item=>{if(!setRef.current.has(item))result.add(item)});return result};return setRef.current}"use client";function useThrottledCallbackWithClearTimeout(callback,wait){const handleCallback=useCallbackRef(callback);const latestInArgsRef=(0,index_js_.useRef)(null);const latestOutArgsRef=(0,index_js_.useRef)(null);const active=(0,index_js_.useRef)(true);const waitRef=(0,index_js_.useRef)(wait);const timeoutRef=(0,index_js_.useRef)(-1);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);const callThrottledCallback=(0,index_js_.useCallback)((...args)=>{handleCallback(...args);latestInArgsRef.current=args;latestOutArgsRef.current=args;active.current=false},[handleCallback]);const timerCallback=(0,index_js_.useCallback)(()=>{if(latestInArgsRef.current&&latestInArgsRef.current!==latestOutArgsRef.current){callThrottledCallback(...latestInArgsRef.current);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else active.current=true},[callThrottledCallback]);const throttled=(0,index_js_.useCallback)((...args)=>{if(active.current){callThrottledCallback(...args);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else latestInArgsRef.current=args},[callThrottledCallback,timerCallback]);(0,index_js_.useEffect)(()=>{waitRef.current=wait},[wait]);return[throttled,clearTimeout1]}function useThrottledCallback(callback,wait){return useThrottledCallbackWithClearTimeout(callback,wait)[0]}"use client";function useThrottledState(defaultValue,wait){const[value,setValue]=(0,index_js_.useState)(defaultValue);const[setThrottledValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setValue,wait);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return[value,setThrottledValue]}"use client";function useThrottledValue(value,wait){const[throttledValue,setThrottledValue]=(0,index_js_.useState)(value);const valueRef=(0,index_js_.useRef)(value);const[throttledSetValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setThrottledValue,wait);(0,index_js_.useEffect)(()=>{if(value!==valueRef.current){valueRef.current=value;throttledSetValue(value)}},[throttledSetValue,value]);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return throttledValue}"use client";function useIsFirstRender(){const renderRef=(0,index_js_.useRef)(true);if(true===renderRef.current){renderRef.current=false;return true}return renderRef.current}"use client";function use_orientation_getInitialValue(initialValue,getInitialValueInEffect){if(getInitialValueInEffect)return initialValue;if("undefined"!=typeof window&&"screen"in window)return{angle:window.screen.orientation?.angle??initialValue.angle,type:window.screen.orientation?.type??initialValue.type};return initialValue}function useOrientation({defaultAngle=0,defaultType="landscape-primary",getInitialValueInEffect=true}={}){const[orientation,setOrientation]=(0,index_js_.useState)(use_orientation_getInitialValue({angle:defaultAngle,type:defaultType},getInitialValueInEffect));const handleOrientationChange=event=>{const target=event.currentTarget;setOrientation({angle:target?.angle||0,type:target?.type||"landscape-primary"})};useIsomorphicEffect(()=>{window.screen.orientation?.addEventListener("change",handleOrientationChange);return()=>window.screen.orientation?.removeEventListener("change",handleOrientationChange)},[]);return orientation}"use client";function useFetch(url,{autoInvoke=true,...options}={}){const[data,setData]=(0,index_js_.useState)(null);const[loading,setLoading]=(0,index_js_.useState)(false);const[error,setError]=(0,index_js_.useState)(null);const controller=(0,index_js_.useRef)(null);const refetch=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current.abort();controller.current=new AbortController;setLoading(true);return fetch(url,{signal:controller.current.signal,...options}).then(res=>res.json()).then(res=>{setData(res);setLoading(false);return res}).catch(err=>{setLoading(false);if("AbortError"!==err.name)setError(err);return err})},[url]);const abort=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current?.abort("")},[]);(0,index_js_.useEffect)(()=>{if(autoInvoke)refetch();return()=>{if(controller.current)controller.current.abort("")}},[refetch,autoInvoke]);return{data,loading,error,refetch,abort}}"use client";function radiansToDegrees(radians){return 180/Math.PI*radians}function getElementCenter(element){const rect=element.getBoundingClientRect();return[rect.left+rect.width/2,rect.top+rect.height/2]}function getAngle(coordinates,element){const center=getElementCenter(element);const x=coordinates[0]-center[0];const y=coordinates[1]-center[1];const deg=radiansToDegrees(Math.atan2(x,y))+180;return 360-deg}function toFixed(value,digits){return parseFloat(value.toFixed(digits))}function getDigitsAfterDot(value){return value.toString().split(".")[1]?.length||0}function normalizeRadialValue(degree,step){const clamped=clamp(degree,0,360);const high=Math.ceil(clamped/step);const low=Math.round(clamped/step);return toFixed(high>=clamped/step?high*step===360?0:high*step:low*step,getDigitsAfterDot(step))}function useRadialMove(onChange,{step=.01,onChangeEnd,onScrubStart,onScrubEnd}={}){const mounted=(0,index_js_.useRef)(false);const[active,setActive]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{const update=(event,done=false)=>{if(node){node.style.userSelect="none";const deg=getAngle([event.clientX,event.clientY],node);const newValue=normalizeRadialValue(deg,step||1);onChange(newValue);done&&onChangeEnd?.(newValue)}};const beginTracking=()=>{onScrubStart?.();setActive(true);document.addEventListener("mousemove",handleMouseMove,false);document.addEventListener("mouseup",handleMouseUp,false);document.addEventListener("touchmove",handleTouchMove,{passive:false});document.addEventListener("touchend",handleTouchEnd,false)};const endTracking=()=>{onScrubEnd?.();setActive(false);document.removeEventListener("mousemove",handleMouseMove,false);document.removeEventListener("mouseup",handleMouseUp,false);document.removeEventListener("touchmove",handleTouchMove,false);document.removeEventListener("touchend",handleTouchEnd,false)};const onMouseDown=event=>{beginTracking();update(event)};const handleMouseMove=event=>{update(event)};const handleMouseUp=event=>{update(event,true);endTracking()};const handleTouchMove=event=>{event.preventDefault();update(event.touches[0])};const handleTouchEnd=event=>{update(event.changedTouches[0],true);endTracking()};const handleTouchStart=event=>{event.preventDefault();beginTracking();update(event.touches[0])};node?.addEventListener("mousedown",onMouseDown);node?.addEventListener("touchstart",handleTouchStart,{passive:false});return()=>{if(node){node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",handleTouchStart)}}},[onChange]);return{ref:refCallback,active}}"use client";function getHeadingsData(headings,getDepth,getValue){const result=[];for(let i=0;i<headings.length;i+=1){const heading=headings[i];result.push({depth:getDepth(heading),value:getValue(heading),id:heading.id||randomId(),getNode:()=>heading.id?document.getElementById(heading.id):heading})}return result}function getActiveElement(rects,offset=0){if(0===rects.length)return -1;const closest=rects.reduce((acc,item,index)=>{if(Math.abs(acc.position-offset)<Math.abs(item.y-offset))return acc;return{index,position:item.y}},{index:0,position:rects[0].y});return closest.index}function getDefaultDepth(element){return Number(element.tagName[1])}function getDefaultValue(element){return element.textContent||""}function useScrollSpy({selector="h1, h2, h3, h4, h5, h6",getDepth=getDefaultDepth,getValue=getDefaultValue,offset=0,scrollHost}={}){const[active,setActive]=(0,index_js_.useState)(-1);const[initialized,setInitialized]=(0,index_js_.useState)(false);const[data,setData]=(0,index_js_.useState)([]);const headingsRef=(0,index_js_.useRef)([]);const handleScroll=()=>{setActive(getActiveElement(headingsRef.current.map(d=>d.getNode().getBoundingClientRect()),offset))};const initialize=()=>{const headings=getHeadingsData(Array.from(document.querySelectorAll(selector)),getDepth,getValue);headingsRef.current=headings;setInitialized(true);setData(headings);setActive(getActiveElement(headings.map(d=>d.getNode().getBoundingClientRect()),offset))};(0,index_js_.useEffect)(()=>{initialize();const _scrollHost=scrollHost||window;_scrollHost.addEventListener("scroll",handleScroll);return()=>_scrollHost.removeEventListener("scroll",handleScroll)},[scrollHost]);return{reinitialize:initialize,active,initialized,data}}"use client";const defaultOptions={multiple:true,accept:"*"};function getInitialFilesList(files){if(!files)return null;if(files instanceof FileList)return files;const result=new DataTransfer;for(const file of files)result.items.add(file);return result.files}function createInput(options){if("undefined"==typeof document)return null;const input=document.createElement("input");input.type="file";if(options.accept)input.accept=options.accept;if(options.multiple)input.multiple=options.multiple;if(options.capture)input.capture=options.capture;if(options.directory)input.webkitdirectory=options.directory;input.style.display="none";return input}function useFileDialog(input={}){const options={...defaultOptions,...input};const[files,setFiles]=(0,index_js_.useState)(getInitialFilesList(options.initialFiles));const inputRef=(0,index_js_.useRef)(null);const handleChange=(0,index_js_.useCallback)(event=>{const target=event.target;if(target?.files){setFiles(target.files);options.onChange?.(target.files)}},[options.onChange]);const createAndSetupInput=(0,index_js_.useCallback)(()=>{inputRef.current?.remove();inputRef.current=createInput(options);if(inputRef.current){inputRef.current.addEventListener("change",handleChange,{once:true});document.body.appendChild(inputRef.current)}},[options,handleChange]);useIsomorphicEffect(()=>{createAndSetupInput();return()=>inputRef.current?.remove()},[]);const reset=(0,index_js_.useCallback)(()=>{setFiles(null);options.onChange?.(null)},[options.onChange]);const open=(0,index_js_.useCallback)(()=>{if(options.resetOnOpen)reset();createAndSetupInput();inputRef.current?.click()},[options.resetOnOpen,reset,createAndSetupInput]);return{files,open,reset}}"use client";function useLongPress(onLongPress,options={}){const{threshold=400,onStart,onFinish,onCancel}=options;const isLongPressActive=(0,index_js_.useRef)(false);const isPressed=(0,index_js_.useRef)(false);const timeout=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>()=>window.clearTimeout(timeout.current),[]);return(0,index_js_.useMemo)(()=>{if("function"!=typeof onLongPress)return{};const start=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(onStart)onStart(event);isPressed.current=true;timeout.current=window.setTimeout(()=>{onLongPress(event);isLongPressActive.current=true},threshold)};const cancel=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(isLongPressActive.current){if(onFinish)onFinish(event)}else if(isPressed.current){if(onCancel)onCancel(event)}isLongPressActive.current=false;isPressed.current=false;if(timeout.current)window.clearTimeout(timeout.current)};return{onMouseDown:start,onMouseUp:cancel,onMouseLeave:cancel,onTouchStart:start,onTouchEnd:cancel}},[onLongPress,threshold,onCancel,onFinish,onStart])}function isTouchEvent(event){return window.TouchEvent?event.nativeEvent instanceof TouchEvent:"touches"in event.nativeEvent}function isMouseEvent(event){return event.nativeEvent instanceof MouseEvent}"use client";function useSelection(input){const[selectionSet,setSelectionSet]=(0,index_js_.useState)(new Set(input.defaultSelection||[]));useDidUpdate(()=>{if(input.resetSelectionOnDataChange)setSelectionSet(/* @__PURE__ */new Set)},[input.data,input.resetSelectionOnDataChange]);const select=(0,index_js_.useCallback)(selected=>{setSelectionSet(state=>{if(!state.has(selected)){const newSet=new Set(state);newSet.add(selected);return newSet}return state})},[]);const deselect=(0,index_js_.useCallback)(deselected=>{setSelectionSet(state=>{if(state.has(deselected)){const newSet=new Set(state);newSet.delete(deselected);return newSet}return state})},[]);const toggle=(0,index_js_.useCallback)(toggled=>{setSelectionSet(state=>{const newSet=new Set(state);if(state.has(toggled))newSet.delete(toggled);else newSet.add(toggled);return newSet})},[]);const resetSelection=(0,index_js_.useCallback)(()=>{setSelectionSet(/* @__PURE__ */new Set)},[]);const setSelection=(0,index_js_.useCallback)(selection=>{setSelectionSet(new Set(selection))},[]);const isAllSelected=(0,index_js_.useCallback)(()=>{if(0===input.data.length)return false;return input.data.every(item=>selectionSet.has(item))},[selectionSet,input.data]);const isSomeSelected=(0,index_js_.useCallback)(()=>input.data.some(item=>selectionSet.has(item)),[selectionSet,input.data]);return[Array.from(selectionSet),{select,deselect,toggle,isAllSelected,isSomeSelected,setSelection,resetSelection}]}}}]);
|