{"version":3,"file":"static/chunks/527-d72b8e640634a30b.js","mappings":"uIA8DA,MA3DA,cAAiC,GAAY,CAC7C,EACA,KACA,eACA,CACA,QACA,YACA,IAAW,IAAQ,2BACnB,cAEA,OADA,iDACA,KACA,gDACA,CACA,CAEA,CACA,CACA,cACA,SACA,8BAEA,CACA,gBACA,sBACA,YACA,eAEA,CACA,oBACA,UACA,YACA,cACA,oBACA,mBAEA,cAEA,CAAK,CACL,CACA,cACA,cAEA,UACA,eAEA,CACA,UACA,uBACA,2BACA,IACA,CAAK,CACL,CACA,kBACA,0BACA,QAEA,+CACA,CACA,oCCgBA,MA5EA,WACA,SACA,IACA,MACA,GACA,EACA,MACA,GACA,EACA,qBACA,MACA,EACA,UAEA,OACA,IACA,CAAO,CAEP,EACA,OACA,QACA,KACA,UACA,OACA,OACA,cACA,IACA,CAAW,CACX,CAAS,CACT,CAAO,CAEP,EACA,OACA,UACA,KACA,KACA,IACA,KACA,EAAQ,SAER,GACA,GAEA,CACA,QACA,CAAK,CAIL,cACA,SACA,OACA,OACA,CAAS,CACT,EAEA,WAKA,sBACA,GACA,CAAK,CAKL,2BACA,GACA,CAAK,CACL,iBACA,GACA,CACA,CACA,gECxBA,MAjDA,cAAkC,GAAY,CAC9C,OACA,GACA,eACA,CACA,QACA,YACA,IAAW,IAAQ,2BACnB,gBACA,YAGA,OAFA,uCACA,wCACA,KACA,uCACA,uCACA,CACA,CAEA,CACA,CACA,cACA,SACA,8BAEA,CACA,gBACA,sBACA,YACA,eAEA,CACA,oBACA,UACA,YACA,oCACA,CACA,aACA,cAEA,UACA,2BACA,IACA,CAAO,EAEP,CACA,WACA,eAEA,2FCvCA,gBAA0B,GAAS,CACnC,IACA,GACA,GACA,CACA,GACA,gBACA,GACA,QACA,WACA,yBACA,2BACA,kBACA,gBACA,yBACA,2BACA,QA2UA,YACA,qEACA,aACA,gGACA,OACA,OACA,kBACA,gCACA,WACA,mBACA,iBACA,oBACA,wBACA,eACA,iBACA,6BACA,kBACA,CACA,EA7VA,cACA,4BACA,iBACA,CACA,WACA,yBAEA,cACA,uBACA,CACA,cACA,cAAqB,iBACrB,sCACA,CACA,iBACA,wDACA,oBAEA,CACA,aACA,MAAiB,QAAW,iCAO5B,OANA,SACA,OACA,eACA,2BACA,gBACA,CAAK,EACL,CACA,CACA,cACA,SAAqB,0CAA0C,CAC/D,CACA,UACA,uBAEA,OADA,mBACA,SAAkC,IAAI,QAAQ,IAAI,mBAClD,CACA,UACA,gBACA,aAAkB,UAAc,CAChC,CACA,QACA,eACA,sBACA,CACA,WACA,2BACA,GAAkC,KAAd,QAAc,yBAElC,CACA,oBACA,2BACA,iBAEA,uBAAoC,IAAS,4DAC7C,CACA,gBACA,6BAGA,2BACA,oBACA,iCAGA,yBACA,CACA,mBACA,4DAAsE,QAAc,4BACpF,CACA,UACA,2DACA,YAAwB,iBAAsB,EAC9C,mBACA,CACA,WACA,yDACA,YAAwB,iBAAsB,EAC9C,mBACA,CACA,eACA,6BACA,uBACA,sBACA,gBAA2B,2CAA8C,EAEzE,CACA,kBACA,6BACA,+CACA,wBACA,UACA,QACA,gBAAmC,UAAc,EAEjD,uBAGA,mBAEA,gBAA2B,6CAAgD,EAE3E,CACA,oBACA,6BAEA,aACA,0BACA,SAAuB,kBAAoB,CAE3C,CACA,WACA,oCACA,8CACA,aAAsB,UAAc,OAC5B,WAER,OADA,wBACA,gBAMA,GAHA,GACA,mBAEA,uBACA,gDACA,GACA,0BAEA,CAQA,0BACA,MACA,kCACA,cACA,SACA,WACA,SAEA,CAAO,CACP,EAkBA,GACA,eACA,qBACA,uBACA,iBACA,QAtBA,KACA,MAAsB,QAAa,iBACnC,GACA,uBACA,sBAIA,CAFA,KACA,WACA,wBACA,uBACA,EACA,EACA,MAGA,IACA,CAOA,EACA,KACA,+BACA,EACA,MAEA,mBACA,gFACA,SAAuB,uCAAiD,EAExE,UACY,QAAgB,eAC5B,SACA,aACA,OACA,CAAS,EAEE,QAAgB,MAC3B,yBACA,EACA,MAEA,2BACA,gBACA,EACA,OAGA,iBACA,EA4CA,OA3CA,QAAoB,QAAa,EACjC,iCACA,aACA,sBACA,cACA,eAMA,WAA+B,gBAAgB,qBAC/C,MACA,CACA,IACA,eACA,CAAU,SACV,KACA,MACA,CACA,mCACA,2BACA,EACA,iBACA,MAEA,iBACA,CAAO,CACP,UACA,eACA,SAAyB,qCAAqC,CAC9D,CAAO,CACP,aACA,SAAyB,aAAe,CACxC,CAAO,CACP,gBACA,SAAyB,gBAAkB,CAC3C,CAAO,CACP,sBACA,gCACA,kCACA,aACA,CAAK,EACL,eACA,CACA,MAmEA,YAlEA,IACA,eACA,aACA,OACA,KACA,iCACA,2BAEA,aACA,OACA,KACA,oBACA,CACA,gBACA,OACA,KACA,sBACA,CACA,aACA,OACA,KACA,0BACA,sBACA,CACA,eACA,OACA,KACA,YACA,oCACA,0CACA,WACA,iBACA,iBACA,eACA,mBACA,oBACA,uBACA,EAEA,aACA,cACA,GAAc,QAAgB,uBAC9B,OAAqB,+BAErB,OACA,KACA,QACA,sCACA,0BACA,wCACA,qBACA,mBACA,cACA,CACA,kBACA,OACA,KACA,gBACA,CACA,gBACA,OACA,KACA,WAEA,CACA,GACA,YACI,GAAa,YACjB,2BACA,iBACA,CAAO,EACP,gBAA2B,mCAAsC,CACjE,CAAK,CACL,CACA,EACA,gBACA,OACA,oBACA,wBACA,YAAiB,QAAQ,oCACzB,gBACA,WACA,gBACA,EAEA,kDCpWA,QACA,GACA,UACA,qBACA,CACA,aACA,sBACQ,QAAc,eACtB,yBACA,qBACA,CAAO,cAEP,CACA,gBACA,qBACA,eACA,IAAoB,IAAQ,UAE5B,CACA,iBACA,UACA,sBACA,eAEA,CACA,uGCtBA,cACA,6BACA,CACA,cACA,gCAAkD,GAAa,WAC/D,CACA,0BACA,eACA,wBACA,sBACA,qBACA,CACA,EACA,cACA,qBACA,CACA,cACA,IAGA,EAHA,KACA,IACA,KAEA,EAAmB,OAAe,GAalC,MAA4B,GAAY,yCAAoD,GAAa,yBACzG,mCACA,MACA,IACA,KACA,iBACA,MACA,aAEA,EACA,MACA,IACA,KACA,eACA,MACA,YAEA,EACA,MACA,gBACA,MACA,UACA,IAEA,EACA,aACA,CAAK,YACL,SACA,GACA,gBAEA,CAAK,EAEL,WAIA,EAHA,KACA,OAGA,oCACA,IACA,WACA,CAAM,SACN,mBACA,CACA,qCACA,KACA,OAEA,gBAAqC,IAAQ,MAC7C,kBACA,gCACA,gEACA,UACA,KACA,MACA,CACA,IACA,gBACM,QAAK,aACX,gBACO,UACP,EACA,KAEA,GAEA,CAAO,CACP,CAAK,CACL,EACA,OACA,UACA,OAnFA,IACA,IACA,YACA,YAEA,EA+EA,cACA,MACA,GAEA,YAlFA,KACA,IACA,EAiFA,cAhFA,KACA,IACA,EA+EA,WACA,WACA,IACA,IAEA,YAEA,EAEA,CACA,oCC9HA,YACA,cACA,uBACA,wCACA,CACA,aAGA,OAFA,sBACA,mBACA,KACA,yBACA,oBACA,CACA,CACA,eACA,4BACA,CACA,cACA,CACA,gBACA,CACA,oCCpBA,iBACA,EACA,EACA,0BACA,IACA,GACA,CAAG,EAIH,cACA,mBACA,iBACA,gBAgBA,OAtBA,mBACA,aACA,CAAG,EAMH,cACA,GACA,mBACA,OACA,CAAK,EACL,IACA,EACA,aACA,GACA,kBACA,QACA,CAAK,EACL,IACA,EACA,CACA,uMC9BA,sDACA,aACA,CACA,gBACA,iCACA,CACA,cACA,uCACA,CACA,gBACA,sCACA,CACA,gBACA,iCACA,CACA,gBACA,iCACA,CACA,gBACA,IACA,aACA,QACA,cACA,YACA,WACA,QACA,CAAI,EACJ,MACA,KACA,iCACA,QACA,MACM,oBACN,SAGA,cACA,mBACA,qBAGA,kBAFA,QAKA,OACA,wCAGA,+BAGA,YAIA,CACA,gBACA,UAAU,sCAAwC,EAClD,MACA,0BACA,SAEA,KACA,oCACA,QACA,MACM,+BACN,QAEA,OACA,0BAGA,YAIA,CACA,gBAEA,MADA,uBACA,EACA,CACA,cACA,sBACA,EACA,iDACA,UACA,GACK,EAAI,IAET,CACA,uBACA,OAGA,oBAGA,kDACA,sCAGA,CA6BA,gBACA,qDACA,SAEA,eACA,eACA,SAGA,QACA,CACA,cACA,0DAEA,cACA,SACA,SAEA,oBACA,cACA,SAEA,2BACA,MAGA,oCAGA,4CAKA,cACA,2DACA,CACA,cACA,uBACA,eACA,CAAG,CACH,CACA,wBACA,uCACA,yBACI,yBAUJ,SAnFA,OACA,SACA,SAEA,iBACA,kBACA,yBACA,WACA,qBACA,WACA,UACA,IACA,YAAoB,IAAW,KAC/B,cACA,uDACA,YACA,MAEA,kBACA,4BACA,IAGA,CACA,uBACA,CACA,QACA,EAwDA,KAEA,CACA,CAIA,oBACA,eACA,iCACA,CACA,oBACA,eACA,oCACA,CACA,eACA,sBAQA,8BACA,qBAEA,yBAGA,UAFA,8CAA+D,YAAkB,IAGjF,wECrNa,EAA2B,gBACtC,QAGW,EAAiB,IAC5B,IAAM,EAAe,aAAW,GAEhC,GAAI,EACF,OAAO,EAGT,CANkD,CAEjC,CAIb,CAAC,EACH,MADW,MACK,wDAAwD,EAG1E,OAAO,CACT,EAOa,EAAsB,OAAC,QAClC,WACA,EACF,GAAmD,OAC3C,YAAU,KACd,EAAO,MAAM,EACN,KACL,EAAO,QAAQ,CACjB,GACC,CAAC,EAAO,EAGT,EAHQ,CAGR,OAAC,EAAmB,SAAnB,CAA4B,MAAO,WACjC,EACH,CAEJ","sources":["webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/focusManager.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/notifyManager.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/onlineManager.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/query.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/removable.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/retryer.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/subscribable.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/thenable.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/utils.js","webpack://_N_E/../QueryClientProvider.tsx"],"sourcesContent":["// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n return {\n batch: (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn) => {\n notifyFn = fn;\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = getDefaultState(this.options);\n this.state = config.state ?? this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext);\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n this.scheduleGc();\n };\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n try {\n this.setData(data);\n } catch (error) {\n onError(error);\n return;\n }\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n this.scheduleGc();\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true\n });\n return this.#retryer.start();\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class extends Error {\n constructor(options) {\n super(\"CancelledError\");\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n const thenable = pendingThenable();\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n const canStart = () => canFetch(config.networkMode) && config.canRun();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n thenable.resolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n thenable.reject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value);\n }\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n const initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n try {\n promiseOrValue = initialPromise ?? config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n return canContinue() ? void 0 : pause();\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.();\n return thenable;\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n if (canStart()) {\n run();\n } else {\n pause().then(run);\n }\n return thenable;\n }\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/thenable.ts\nfunction pendingThenable() {\n let resolve;\n let reject;\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n thenable.status = \"pending\";\n thenable.catch(() => {\n });\n function finalize(data) {\n Object.assign(thenable, data);\n delete thenable.resolve;\n delete thenable.reject;\n }\n thenable.resolve = (value) => {\n finalize({\n status: \"fulfilled\",\n value\n });\n resolve(value);\n };\n thenable.reject = (reason) => {\n finalize({\n status: \"rejected\",\n reason\n });\n reject(reason);\n };\n return thenable;\n}\nexport {\n pendingThenable\n};\n//# sourceMappingURL=thenable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n return replaceEqualDeep(prevData, data);\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n );\n }\n }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n );\n }\n }\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nexport {\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8]}