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,WAAjB/F,EAAiB+F,UAAY3E,EAAM,KAAnC,IAEDZ,OAAO6B,IACNoF,EAAmBT,aACnB,MAAAhH,EAAiBuF,SAAjBvF,EAAiBuF,QAAUlD,GAC3B,MAAArC,EAAiB+F,WAAjB/F,EAAiB+F,eAAY1H,EAAWgE,EAAxC,ICqEC,SAAA6F,EAAAC,EAAAC,EAAAC,GAaL,OC1HK,SAAA3N,EAAA4N,G,mSA8CLC,EAAAvI,EAAAyH,G,KAIA,MAAAxK,GAAAmK,EAAAA,UAAA,QAAAkB,EAAAE,EAAAxI,KAQA/B,EAAAhB,EAAAc,oBAAAiC,G,GAEA6G,EAAAO,EAAAA,aAAAqB,IAGM,MAAAC,EAAAV,EAAA,OAAA/K,EAAA0L,UAAAnD,EAAAA,EAAAoD,WAAAH,IAQA,OAFAxL,EAAAO,eAEAkL,CAAA,GACD,CAAAzL,EAAA+K,KAAA,IAAA/K,EAAAuB,qBAAA,IAAAvB,EAAAuB,qB,kBAUHvB,EAAAhC,WAAA+E,EAAA,CAAwC1E,WAAA,G,GACzC,CAAA0E,EAAA/C,I,SAIC,MAAA8C,EAAAC,EAAA/C,EAAAwK,GAIF,GAAAE,EAAA,C,4GAYA,OAAA3H,EAAA2E,oBAAA1G,EAAAhB,EAAA6B,YAAAb,EAGD,CDgBC4K,E,eAAAvO,EACD,C","sources":["../node_modules/@tanstack/query-core/src/queryObserver.ts","../node_modules/@tanstack/react-query/src/useSyncExternalStore.ts","../node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx","../node_modules/@tanstack/react-query/src/isRestoring.tsx","../node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts","../node_modules/@tanstack/react-query/src/utils.ts","../node_modules/@tanstack/react-query/src/suspense.ts","../node_modules/@tanstack/react-query/src/useQuery.ts","../node_modules/@tanstack/react-query/src/useBaseQuery.ts"],"sourcesContent":["import {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { focusManager } from './focusManager'\nimport { Subscribable } from './subscribable'\nimport { canFetch, isCancelledError } from './retryer'\nimport type {\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n QueryOptions,\n RefetchOptions,\n} from './types'\nimport type { Action, FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { DefaultedQueryObserverOptions, RefetchPageFilters } from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\nexport interface NotifyOptions {\n cache?: boolean\n listeners?: boolean\n onError?: boolean\n onSuccess?: boolean\n}\n\nexport interface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n\n private client: QueryClient\n private currentQuery!: Query\n private currentQueryInitialState!: QueryState\n private currentResult!: QueryObserverResult\n private currentResultState?: QueryState\n private currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n private previousQueryResult?: QueryObserverResult\n private selectError: TError | null\n private selectFn?: (data: TQueryData) => TData\n private selectResult?: TData\n private staleTimeoutId?: ReturnType\n private refetchIntervalId?: ReturnType\n private currentRefetchInterval?: number | false\n private trackedProps!: Set\n\n constructor(\n client: QueryClient,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.client = client\n this.options = options\n this.trackedProps = new Set()\n this.selectError = null\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.remove = this.remove.bind(this)\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.currentQuery, this.options)) {\n this.executeFetch()\n }\n\n this.updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.clearStaleTimeout()\n this.clearRefetchInterval()\n this.currentQuery.removeObserver(this)\n }\n\n setOptions(\n options?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.currentQuery\n\n this.options = this.client.defaultQueryOptions(options)\n\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof options?.isDataEqual !== 'undefined'\n ) {\n this.client\n .getLogger()\n .error(\n `The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option`,\n )\n }\n\n if (!shallowEqualObjects(prevOptions, this.options)) {\n this.client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.currentQuery,\n observer: this,\n })\n }\n\n if (\n typeof this.options.enabled !== 'undefined' &&\n typeof this.options.enabled !== 'boolean'\n ) {\n throw new Error('Expected enabled to be a boolean')\n }\n\n // Keep previous query key if the user does not supply one\n if (!this.options.queryKey) {\n this.options.queryKey = prevOptions.queryKey\n }\n\n this.updateQuery()\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.executeFetch()\n }\n\n // Update result\n this.updateResult(notifyOptions)\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.currentQuery !== prevQuery ||\n this.options.enabled !== prevOptions.enabled ||\n this.options.staleTime !== prevOptions.staleTime)\n ) {\n this.updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.currentQuery !== prevQuery ||\n this.options.enabled !== prevOptions.enabled ||\n nextRefetchInterval !== this.currentRefetchInterval)\n ) {\n this.updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.client.getQueryCache().build(this.client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result, options)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult everytime\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.currentResult = result\n this.currentResultOptions = this.options\n this.currentResultState = this.currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n ): QueryObserverResult {\n const trackedResult = {} as QueryObserverResult\n\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackedProps.add(key as keyof QueryObserverResult)\n return result[key as keyof QueryObserverResult]\n },\n })\n })\n\n return trackedResult\n }\n\n getCurrentQuery(): Query {\n return this.currentQuery\n }\n\n remove(): void {\n this.client.getQueryCache().remove(this.currentQuery)\n }\n\n refetch({\n refetchPage,\n ...options\n }: RefetchOptions & RefetchPageFilters = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n meta: { refetchPage },\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.client.defaultQueryOptions(options)\n\n const query = this.client\n .getQueryCache()\n .build(this.client, defaultedOptions)\n query.isFetchingOptimistic = true\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.currentResult\n })\n }\n\n private executeFetch(\n fetchOptions?: ObserverFetchOptions,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.updateQuery()\n\n // Fetch\n let promise: Promise = this.currentQuery.fetch(\n this.options as QueryOptions,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n private updateStaleTimeout(): void {\n this.clearStaleTimeout()\n\n if (\n isServer ||\n this.currentResult.isStale ||\n !isValidTimeout(this.options.staleTime)\n ) {\n return\n }\n\n const time = timeUntilStale(\n this.currentResult.dataUpdatedAt,\n this.options.staleTime,\n )\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.staleTimeoutId = setTimeout(() => {\n if (!this.currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n private computeRefetchInterval() {\n return typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.currentResult.data, this.currentQuery)\n : this.options.refetchInterval ?? false\n }\n\n private updateRefetchInterval(nextInterval: number | false): void {\n this.clearRefetchInterval()\n\n this.currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n this.options.enabled === false ||\n !isValidTimeout(this.currentRefetchInterval) ||\n this.currentRefetchInterval === 0\n ) {\n return\n }\n\n this.refetchIntervalId = setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.executeFetch()\n }\n }, this.currentRefetchInterval)\n }\n\n private updateTimers(): void {\n this.updateStaleTimeout()\n this.updateRefetchInterval(this.computeRefetchInterval())\n }\n\n private clearStaleTimeout(): void {\n if (this.staleTimeoutId) {\n clearTimeout(this.staleTimeoutId)\n this.staleTimeoutId = undefined\n }\n }\n\n private clearRefetchInterval(): void {\n if (this.refetchIntervalId) {\n clearInterval(this.refetchIntervalId)\n this.refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.currentQuery\n const prevOptions = this.options\n const prevResult = this.currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.currentResultState\n const prevResultOptions = this.currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.currentQueryInitialState\n const prevQueryResult = queryChange\n ? this.currentResult\n : this.previousQueryResult\n\n const { state } = query\n let { dataUpdatedAt, error, errorUpdatedAt, fetchStatus, status } = state\n let isPreviousData = false\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n fetchStatus = canFetch(query.options.networkMode)\n ? 'fetching'\n : 'paused'\n if (!dataUpdatedAt) {\n status = 'loading'\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n fetchStatus = 'idle'\n }\n }\n\n // Keep previous data if needed\n if (\n options.keepPreviousData &&\n !state.dataUpdatedAt &&\n prevQueryResult?.isSuccess &&\n status !== 'error'\n ) {\n data = prevQueryResult.data\n dataUpdatedAt = prevQueryResult.dataUpdatedAt\n status = prevQueryResult.status\n isPreviousData = true\n }\n // Select data if needed\n else if (options.select && typeof state.data !== 'undefined') {\n // Memoize select result\n if (\n prevResult &&\n state.data === prevResultState?.data &&\n options.select === this.selectFn\n ) {\n data = this.selectResult\n } else {\n try {\n this.selectFn = options.select\n data = options.select(state.data)\n data = replaceData(prevResult?.data, data, options)\n this.selectResult = data\n this.selectError = null\n } catch (selectError) {\n if (process.env.NODE_ENV !== 'production') {\n this.client.getLogger().error(selectError)\n }\n this.selectError = selectError as TError\n }\n }\n }\n // Use query data\n else {\n data = state.data as unknown as TData\n }\n\n // Show placeholder data if needed\n if (\n typeof options.placeholderData !== 'undefined' &&\n typeof data === 'undefined' &&\n status === 'loading'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n } else {\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (options.placeholderData as PlaceholderDataFunction)()\n : options.placeholderData\n if (options.select && typeof placeholderData !== 'undefined') {\n try {\n placeholderData = options.select(placeholderData)\n this.selectError = null\n } catch (selectError) {\n if (process.env.NODE_ENV !== 'production') {\n this.client.getLogger().error(selectError)\n }\n this.selectError = selectError as TError\n }\n }\n }\n\n if (typeof placeholderData !== 'undefined') {\n status = 'success'\n data = replaceData(prevResult?.data, placeholderData, options) as TData\n isPlaceholderData = true\n }\n }\n\n if (this.selectError) {\n error = this.selectError as any\n data = this.selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = fetchStatus === 'fetching'\n const isLoading = status === 'loading'\n const isError = status === 'error'\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus,\n isLoading,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading && isFetching,\n data,\n dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: state.fetchFailureCount,\n failureReason: state.fetchFailureReason,\n errorUpdateCount: state.errorUpdateCount,\n isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,\n isFetchedAfterMount:\n state.dataUpdateCount > queryInitialState.dataUpdateCount ||\n state.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isLoading,\n isLoadingError: isError && state.dataUpdatedAt === 0,\n isPaused: fetchStatus === 'paused',\n isPlaceholderData,\n isPreviousData,\n isRefetchError: isError && state.dataUpdatedAt !== 0,\n isStale: isStale(query, options),\n refetch: this.refetch,\n remove: this.remove,\n }\n\n return result as QueryObserverResult\n }\n\n updateResult(notifyOptions?: NotifyOptions): void {\n const prevResult = this.currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.currentQuery, this.options)\n this.currentResultState = this.currentQuery.state\n this.currentResultOptions = this.options\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.currentResult = nextResult\n\n // Determine which callbacks to trigger\n const defaultNotifyOptions: NotifyOptions = { cache: true }\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.trackedProps,\n )\n\n if (this.options.useErrorBoundary) {\n includedProps.add('error')\n }\n\n return Object.keys(this.currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.currentResult[typedKey] !== prevResult[typedKey]\n return changed && includedProps.has(typedKey)\n })\n }\n\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true\n }\n\n this.notify({ ...defaultNotifyOptions, ...notifyOptions })\n }\n\n private updateQuery(): void {\n const query = this.client.getQueryCache().build(this.client, this.options)\n\n if (query === this.currentQuery) {\n return\n }\n\n const prevQuery = this.currentQuery as\n | Query\n | undefined\n this.currentQuery = query\n this.currentQueryInitialState = query.state\n this.previousQueryResult = this.currentResult\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(action: Action): void {\n const notifyOptions: NotifyOptions = {}\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = !action.manual\n } else if (action.type === 'error' && !isCancelledError(action.error)) {\n notifyOptions.onError = true\n }\n\n this.updateResult(notifyOptions)\n\n if (this.hasListeners()) {\n this.updateTimers()\n }\n }\n\n private notify(notifyOptions: NotifyOptions): void {\n notifyManager.batch(() => {\n // First trigger the configuration callbacks\n if (notifyOptions.onSuccess) {\n this.options.onSuccess?.(this.currentResult.data!)\n this.options.onSettled?.(this.currentResult.data!, null)\n } else if (notifyOptions.onError) {\n this.options.onError?.(this.currentResult.error!)\n this.options.onSettled?.(undefined, this.currentResult.error!)\n }\n\n // Then trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach(({ listener }) => {\n listener(this.currentResult)\n })\n }\n\n // Then the cache listeners\n if (notifyOptions.cache) {\n this.client.getQueryCache().notify({\n query: this.currentQuery,\n type: 'observerResultsUpdated',\n })\n }\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n options.enabled !== false &&\n !query.state.dataUpdatedAt &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.dataUpdatedAt > 0 &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: typeof options['refetchOnMount'] &\n typeof options['refetchOnWindowFocus'] &\n typeof options['refetchOnReconnect'],\n) {\n if (options.enabled !== false) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n options.enabled !== false &&\n (query !== prevQuery || prevOptions.enabled === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return query.isStaleByTime(options.staleTime)\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n) {\n // it is important to keep this condition like this for three reasons:\n // 1. It will get removed in the v5\n // 2. it reads: don't update the properties if we want to keep the previous\n // data.\n // 3. The opposite condition (!options.keepPreviousData) would fallthrough\n // and will result in a bad decision\n if (options.keepPreviousData) {\n return false\n }\n\n // this means we want to put some placeholder data when pending and queryKey\n // changed.\n if (options.placeholderData !== undefined) {\n // re-assign properties only if current data is placeholder data\n // which means that data did not arrive yet, so, if there is some cached data\n // we need to \"prepare\" to receive it\n return optimisticResult.isPlaceholderData\n }\n\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n","'use client'\n// Temporary workaround due to an issue with react-native uSES - https://github.com/TanStack/query/pull/3601\nimport { useSyncExternalStore as uSES } from 'use-sync-external-store/shim/index.js'\n\nexport const useSyncExternalStore = uSES\n","'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n \n )\n}\n","'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n","'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n UseErrorBoundary,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.useErrorBoundary) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n useErrorBoundary,\n query,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n useErrorBoundary: UseErrorBoundary<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >\n query: Query\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(useErrorBoundary, [result.error, query])\n )\n}\n","export function shouldThrowError boolean>(\n _useErrorBoundary: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n if (typeof _useErrorBoundary === 'function') {\n return _useErrorBoundary(...params)\n }\n\n return !!_useErrorBoundary\n}\n","import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n","'use client'\nimport { QueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { QueryFunction, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\n\n// HOOK\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: Omit<\n UseQueryOptions,\n 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: Omit<\n UseQueryOptions,\n 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions,\n 'queryKey' | 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions,\n 'queryKey' | 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseQueryOptions,\n 'queryKey'\n >,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: Omit<\n UseQueryOptions,\n 'queryKey' | 'queryFn' | 'initialData'\n > & { initialData?: () => undefined },\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: Omit<\n UseQueryOptions,\n 'queryKey' | 'queryFn' | 'initialData'\n > & { initialData: TQueryFnData | (() => TQueryFnData) },\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: Omit<\n UseQueryOptions,\n 'queryKey' | 'queryFn'\n >,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1: TQueryKey | UseQueryOptions,\n arg2?:\n | QueryFunction\n | UseQueryOptions,\n arg3?: UseQueryOptions,\n): UseQueryResult {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(parsedOptions, QueryObserver)\n}\n","'use client'\nimport * as React from 'react'\n\nimport { notifyManager } from '@tanstack/query-core'\nimport { useSyncExternalStore } from './useSyncExternalStore'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './isRestoring'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { ensureStaleTime, fetchOptimistic, shouldSuspend } from './suspense'\nimport type { QueryKey, QueryObserver } from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n) {\n const queryClient = useQueryClient({ context: options.context })\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const defaultedOptions = queryClient.defaultQueryOptions(options)\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n // Include callbacks in batch renders\n if (defaultedOptions.onError) {\n defaultedOptions.onError = notifyManager.batchCalls(\n defaultedOptions.onError,\n )\n }\n\n if (defaultedOptions.onSuccess) {\n defaultedOptions.onSuccess = notifyManager.batchCalls(\n defaultedOptions.onSuccess,\n )\n }\n\n if (defaultedOptions.onSettled) {\n defaultedOptions.onSettled = notifyManager.batchCalls(\n defaultedOptions.onSettled,\n )\n }\n\n ensureStaleTime(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary)\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n queryClient,\n defaultedOptions,\n ),\n )\n\n const result = observer.getOptimisticResult(defaultedOptions)\n\n useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring\n ? () => undefined\n : observer.subscribe(notifyManager.batchCalls(onStoreChange))\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setOptions(defaultedOptions, { listeners: false })\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result, isRestoring)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n useErrorBoundary: defaultedOptions.useErrorBoundary,\n query: observer.getCurrentQuery(),\n })\n ) {\n throw result.error\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"names":["QueryObserver","Subscribable","constructor","client","options","super","this","trackedProps","Set","selectError","bindMethods","setOptions","remove","bind","refetch","onSubscribe","listeners","size","currentQuery","addObserver","shouldFetchOnMount","executeFetch","updateTimers","onUnsubscribe","hasListeners","destroy","shouldFetchOnReconnect","shouldFetchOn","refetchOnReconnect","shouldFetchOnWindowFocus","refetchOnWindowFocus","clearStaleTimeout","clearRefetchInterval","removeObserver","notifyOptions","prevOptions","prevQuery","defaultQueryOptions","shallowEqualObjects","getQueryCache","notify","type","query","observer","enabled","Error","queryKey","updateQuery","mounted","shouldFetchOptionally","updateResult","staleTime","updateStaleTimeout","nextRefetchInterval","computeRefetchInterval","currentRefetchInterval","updateRefetchInterval","getOptimisticResult","build","result","createResult","optimisticResult","keepPreviousData","undefined","placeholderData","isPlaceholderData","getCurrentResult","shouldAssignObserverCurrentProperties","currentResult","currentResultOptions","currentResultState","state","trackResult","trackedResult","Object","keys","forEach","key","defineProperty","configurable","enumerable","get","add","getCurrentQuery","refetchPage","arguments","length","fetch","meta","fetchOptimistic","defaultedOptions","isFetchingOptimistic","then","fetchOptions","_fetchOptions$cancelR","cancelRefetch","promise","throwOnError","catch","noop","isServer","isStale","isValidTimeout","timeout","timeUntilStale","dataUpdatedAt","staleTimeoutId","setTimeout","_this$options$refetch","refetchInterval","data","nextInterval","refetchIntervalId","setInterval","refetchIntervalInBackground","focusManager","isFocused","clearTimeout","clearInterval","prevResult","prevResultState","prevResultOptions","queryChange","queryInitialState","currentQueryInitialState","prevQueryResult","previousQueryResult","error","errorUpdatedAt","fetchStatus","status","isPreviousData","_optimisticResults","fetchOnMount","fetchOptionally","canFetch","networkMode","isSuccess","select","selectFn","selectResult","replaceData","process","Date","now","isFetching","isLoading","isError","isInitialLoading","failureCount","fetchFailureCount","failureReason","fetchFailureReason","errorUpdateCount","isFetched","dataUpdateCount","isFetchedAfterMount","isRefetching","isLoadingError","isPaused","isRefetchError","nextResult","defaultNotifyOptions","cache","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","useErrorBoundary","some","typedKey","has","onQueryUpdate","action","onSuccess","manual","isCancelledError","onError","notifyManager","batch","_this$options$onSucce","_this$options","_this$options$onSettl","_this$options2","call","onSettled","_this$options$onError","_this$options3","_this$options$onSettl2","_this$options4","_ref","listener","retryOnMount","shouldLoadOnMount","refetchOnMount","field","value","suspense","isStaleByTime","useSyncExternalStore","useSyncExternalStore$1","createValue","clearReset","isReset","reset","QueryErrorResetBoundaryContext","React","useQueryErrorResetBoundary","IsRestoringContext","useIsRestoring","Provider","errorResetBoundary","useClearResetErrorBoundary","getHasError","_useErrorBoundary","params","ensureStaleTime","shouldSuspend","isRestoring","willFetch","useQuery","arg1","arg2","arg3","Observer","ensurePreventErrorBoundaryRetry","queryClient","onStoreChange","unsubscribe","subscribe","batchCalls","useBaseQuery"],"sourceRoot":""}