@gen-epix/ui-client-common 4.7.0 → 4.8.0

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.
Files changed (52) hide show
  1. package/dist/_chunks/CrudPage.js +235 -234
  2. package/dist/_chunks/CrudPage.js.map +1 -1
  3. package/dist/_chunks/GeoFilter.js +1 -0
  4. package/dist/_chunks/GeoFilter.js.map +1 -1
  5. package/dist/_chunks/QueryClientProvider.js +1 -1
  6. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  7. package/dist/_chunks/QueryClientService.js +3 -3
  8. package/dist/_chunks/QueryClientService.js.map +1 -1
  9. package/dist/_chunks/Table.js +1021 -703
  10. package/dist/_chunks/Table.js.map +1 -1
  11. package/dist/_chunks/TableUtil.js +5108 -160
  12. package/dist/_chunks/TableUtil.js.map +1 -1
  13. package/dist/_chunks/TextFilter.js +10 -6
  14. package/dist/_chunks/TextFilter.js.map +1 -1
  15. package/dist/_chunks/query.js +37 -37
  16. package/dist/_chunks/query.js.map +1 -1
  17. package/dist/_chunks/tableStore.js +248 -228
  18. package/dist/_chunks/tableStore.js.map +1 -1
  19. package/dist/_chunks/useMutation.js +2 -2
  20. package/dist/_chunks/useMutation.js.map +1 -1
  21. package/dist/_chunks/useQueryMemo.js +5 -5
  22. package/dist/_chunks/useQueryMemo.js.map +1 -1
  23. package/dist/_chunks/yup.js +2 -2
  24. package/dist/_chunks/yup.js.map +1 -1
  25. package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
  26. package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
  27. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  28. package/dist/classes/filters/BooleanFilter.d.ts +1 -0
  29. package/dist/classes/filters/DateFilter.d.ts +1 -1
  30. package/dist/classes/filters/GeoFilter.d.ts +1 -0
  31. package/dist/classes/filters/MultiSelectFilter.d.ts +1 -0
  32. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
  33. package/dist/classes/filters/TextFilter.d.ts +1 -0
  34. package/dist/components/app/App/index.js +3 -2
  35. package/dist/components/app/App/index.js.map +1 -1
  36. package/dist/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
  37. package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
  38. package/dist/components/ui/Table/index.d.ts +1 -0
  39. package/dist/components/ui/Table/index.js +1 -1
  40. package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
  41. package/dist/locale/en.json +14 -0
  42. package/dist/locale/nl.json +14 -0
  43. package/dist/models/table.models.d.ts +1 -0
  44. package/dist/models/table.models.js.map +1 -1
  45. package/dist/stores/tableStore/tableStore.d.ts +3 -1
  46. package/dist/utils/TableUtil/TableUtil.d.ts +5 -0
  47. package/package.json +19 -21
  48. package/dist/_chunks/useColumnsMenu.js +0 -159
  49. package/dist/_chunks/useColumnsMenu.js.map +0 -1
  50. package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
  51. package/dist/hooks/useColumnsMenu/index.js +0 -1
  52. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
@@ -2,7 +2,7 @@ import { n as e } from "./QueryClientProvider.js";
2
2
  import { b as t, c as n, d as r, g as i, o as a, x as o } from "./query.js";
3
3
  import { n as s } from "./QueryClientService.js";
4
4
  import * as c from "react";
5
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
5
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
6
6
  var l = class extends n {
7
7
  #e;
8
8
  #t = void 0;
@@ -91,7 +91,7 @@ var l = class extends n {
91
91
  });
92
92
  }
93
93
  };
94
- // ../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js
94
+ // ../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js
95
95
  function u(t, n) {
96
96
  let r = e(n), [s] = c.useState(() => new l(r, t));
97
97
  c.useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"useMutation.js","names":["React","useQueryClient","shallowEqualObjects","Subscribable","hashKey","noop","notifyManager","shouldThrowError","getDefaultState","React$1","MutationObserver","#client","client","options","#updateResult","prevOptions","#currentMutation","#notify","action","#currentResult","#mutateOptions","variables","state","mutateOptions","onMutateResult","context","useMutation","queryClient","observer","result","onStoreChange","mutate","args"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js"],"sourcesContent":["import { hashKey, shallowEqualObjects } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { getDefaultState } from \"./mutation.js\";\n// src/mutationObserver.ts\n/**\n* Observes a single mutation and derives a `MutationObserverResult` from it.\n* A framework hook like `useMutation` creates one `MutationObserver` per hook\n* call, keeps it stable across re-renders, calls `setOptions` when the options\n* passed to the hook change, subscribes to it to re-render on updates, and\n* reads `getCurrentResult()` for the value to return. Calling `mutate()`\n* builds a new underlying `Mutation` in the `MutationCache` and executes it.\n* @example\n* ```ts\n* const observer = new MutationObserver(queryClient, {\n* mutationFn: (variables: { title: string }) => addPost(variables),\n* })\n* ```\n*/\nvar MutationObserver = class extends Subscribable {\n\t#client;\n\t#currentResult = void 0;\n\t#currentMutation;\n\t#mutateOptions;\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.#client = client;\n\t\tthis.setOptions(options);\n\t\tthis.bindMethods();\n\t\tthis.#updateResult();\n\t}\n\t/**\n\t* Binds the methods of the result (`mutate` and `reset`) to the observer, so they keep working when\n\t* destructured from it.\n\t*/\n\tbindMethods() {\n\t\tthis.mutate = this.mutate.bind(this);\n\t\tthis.reset = this.reset.bind(this);\n\t}\n\t/**\n\t* Updates the observer's options.\n\t*\n\t* If the new `mutationKey` differs from the previous one (and both were\n\t* defined), the observer is reset, detaching it from the mutation it was\n\t* observing. Otherwise, if the currently observed mutation is still\n\t* `pending`, its options are updated in place as well.\n\t* @param options - The new mutation observer options. They are defaulted with {@link\n\t* QueryClient#defaultMutationOptions} before being applied.\n\t* @example\n\t* ```ts\n\t* observer.setOptions({\n\t* mutationFn: (variables: { title: string }) => addPost(variables),\n\t* onSuccess: (data) => console.log(data),\n\t* })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tthis.options = this.#client.defaultMutationOptions(options);\n\t\tif (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tmutation: this.#currentMutation,\n\t\t\tobserver: this\n\t\t});\n\t\tif (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();\n\t\telse if (this.#currentMutation?.state.status === \"pending\") this.#currentMutation.setOptions(this.options);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1 && this.#currentMutation) {\n\t\t\tthis.#currentMutation.addObserver(this);\n\t\t\tthis.#updateResult();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.#currentMutation?.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's result when the observed mutation changes, and notifies its listeners.\n\t* @internal\n\t* @param action - The action that updated the observed mutation, passed on to the observer's\n\t* callbacks.\n\t*/\n\tonMutationUpdate(action) {\n\t\tthis.#updateResult();\n\t\tthis.#notify(action);\n\t}\n\t/**\n\t* Returns the observer's current result, derived from the observed\n\t* mutation's state (or the default, `idle` state if no mutation has been\n\t* built yet, e.g. before the first `mutate()` call or after `reset()`).\n\t* @returns The observer's latest result.\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Detaches the observer from the mutation it is currently observing (if\n\t* any) and resets the observed result back to its default, `idle` state.\n\t*\n\t* This does not cancel an in-flight mutation; the mutation itself keeps\n\t* running to completion and its own callbacks still fire, but this\n\t* observer stops reflecting its state and a subsequent `mutate()` call\n\t* will build a brand new mutation.\n\t* @see {@link MutationObserver#mutate}\n\t* @example\n\t* ```ts\n\t* observer.reset()\n\t* ```\n\t*/\n\treset() {\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = void 0;\n\t\tthis.#updateResult();\n\t\tthis.#notify();\n\t}\n\t/**\n\t* Builds a new `Mutation` in the `MutationCache` using the observer's\n\t* current options, detaches this observer from any previously observed\n\t* mutation, attaches it to the new one, and executes it with the given\n\t* variables.\n\t*\n\t* The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are\n\t* invoked once the mutation settles, in addition to any callbacks defined\n\t* on the observer's own options.\n\t* @param variables - The variables passed to the `mutationFn`.\n\t* @param options - Per-call `onSuccess`, `onError`, and `onSettled` callbacks.\n\t* @returns A promise that resolves with the mutation's data, or rejects with its error.\n\t* @example\n\t* ```ts\n\t* await observer.mutate(\n\t* { title: 'New post' },\n\t* { onSuccess: (data) => console.log(data) },\n\t* )\n\t* ```\n\t*/\n\tmutate(variables, options) {\n\t\tthis.#mutateOptions = options;\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n\t\tthis.#currentMutation.addObserver(this);\n\t\treturn this.#currentMutation.execute(variables);\n\t}\n\t#updateResult() {\n\t\tconst state = this.#currentMutation?.state ?? getDefaultState();\n\t\tthis.#currentResult = {\n\t\t\t...state,\n\t\t\tisPending: state.status === \"pending\",\n\t\t\tisSuccess: state.status === \"success\",\n\t\t\tisError: state.status === \"error\",\n\t\t\tisIdle: state.status === \"idle\",\n\t\t\tmutate: this.mutate,\n\t\t\treset: this.reset\n\t\t};\n\t}\n\t#notify(action) {\n\t\tnotifyManager.batch(() => {\n\t\t\tconst mutateOptions = this.#mutateOptions;\n\t\t\tif (mutateOptions && this.hasListeners()) {\n\t\t\t\tconst variables = this.#currentResult.variables;\n\t\t\t\tconst onMutateResult = this.#currentResult.context;\n\t\t\t\tconst context = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tmeta: this.options.meta,\n\t\t\t\t\tmutationKey: this.options.mutationKey\n\t\t\t\t};\n\t\t\t\tif (action?.type === \"success\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t} else if (action?.type === \"error\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onError?.(action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t});\n\t}\n};\nexport { MutationObserver };\n\n//# sourceMappingURL=mutationObserver.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport * as React from \"react\";\nimport { MutationObserver, noop, notifyManager, shouldThrowError } from \"@tanstack/query-core\";\n// src/useMutation.ts\n/**\n* Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.\n* `useMutation` is the hook for that.\n* @param options - The {@link UseMutationOptions} to use — everything you can pass to `useMutation`.\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns `mutate`/`mutateAsync` also accept per-call `onSuccess`/`onError`/`onSettled` callbacks as a second\n* argument, useful for triggering call-site side effects (e.g. navigation) without coupling them to the shared\n* mutation definition. Hook-level callbacks (passed to `options`) fire for every mutation; per-call callbacks\n* fire only for the latest call you've made, and only while the component is still mounted — unmounting before\n* the mutation settles removes the subscription and prevents them from firing.\n* @throws {Error} The mutation error, when `throwOnError` is `true` or returns `true` for it, so that it is\n* thrown to the nearest error boundary.\n* @see {@link mutationOptions} to share these options across multiple `useMutation` call sites, or to look\n* the mutation up elsewhere via its `mutationKey` (e.g. with `useMutationState`).\n* @example\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <button\n* onClick={() =>\n* addMutation.mutate('Item', {\n* onError: (error) => console.error('Failed to add item:', error),\n* })\n* }\n* >\n* Add\n* </button>\n* )\n* }\n* ```\n* @example\n* Rendering the mutation's own state, rather than just firing it off:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <div>\n* {addMutation.isPending ? (\n* 'Adding todo...'\n* ) : (\n* <>\n* {addMutation.isError ? (\n* <div>An error occurred: {addMutation.error.message}</div>\n* ) : null}\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* </>\n* )}\n* </div>\n* )\n* }\n* ```\n* @example\n* Optimistic update via `onMutate`, rolling back on `onError`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onMutate: async (newTodo) => {\n* await queryClient.cancelQueries({ queryKey: ['todos'] })\n* const previousTodos = queryClient.getQueryData<Array<string>>(['todos'])\n*\n* queryClient.setQueryData<Array<string>>(['todos'], (old) => [\n* ...(old ?? []),\n* newTodo,\n* ])\n*\n* // Passed to `onError` as `onMutateResult` if the mutation fails.\n* return { previousTodos }\n* },\n* onError: (_err, _newTodo, onMutateResult) => {\n* queryClient.setQueryData(['todos'], onMutateResult?.previousTodos)\n* },\n* onSettled: () => {\n* queryClient.invalidateQueries({ queryKey: ['todos'] })\n* },\n* })\n*\n* return (\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* )\n* }\n* ```\n* @example\n* Callbacks passed per call to `mutate` only fire for the last call — `mutateAsync` gives you a\n* promise per call instead, so you can wait for all of them when they succeed:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* try {\n* await Promise.all(todos.map((todo) => addMutation.mutateAsync(todo)))\n* } catch (error) {\n* console.error('Failed to add todos:', error)\n* }\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n* @example\n* If some of the mutations above can fail independently of the others, and you want to know which ones\n* did — rather than losing that information the moment the first one rejects — swap `Promise.all` for\n* `Promise.allSettled`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* const addResults = await Promise.allSettled(\n* todos.map((todo) => addMutation.mutateAsync(todo)),\n* )\n*\n* addResults.forEach((addResult, index) => {\n* if (addResult.status === 'rejected') {\n* console.error(`Failed to add \"${todos[index]}\":`, addResult.reason)\n* }\n* })\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n*/\nfunction useMutation(options, queryClient) {\n\tconst client = useQueryClient(queryClient);\n\tconst [observer] = React.useState(() => new MutationObserver(client, options));\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(options);\n\t}, [observer, options]);\n\tconst result = React.useSyncExternalStore(React.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tconst mutate = React.useCallback((...args) => {\n\t\tobserver.mutate(args[0], args[1]).catch(noop);\n\t}, [observer]);\n\tif (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;\n\treturn {\n\t\t...result,\n\t\tmutate,\n\t\tmutateAsync: result.mutate\n\t};\n}\nexport { useMutation };\n\n//# sourceMappingURL=useMutation.js.map"],"ignoreList":[0,1],"mappings":";;;;;AAmBA,IAAIU,IAAmB,cAAcP,EAAa;CACjD;CACA,KAAiB,KAAK;CACtB;CACA;CACA,YAAY,GAAQ,GAAS;EAK5B,AAJA,MAAM,GACN,KAAKQ,KAAUC,GACf,KAAK,WAAWC,CAAO,GACvB,KAAK,YAAY,GACjB,KAAKC,GAAc;CACpB;CAKA,cAAc;EAEb,AADA,KAAK,SAAS,KAAK,OAAO,KAAK,IAAI,GACnC,KAAK,QAAQ,KAAK,MAAM,KAAK,IAAI;CAClC;CAkBA,WAAW,GAAS;EACnB,IAAMC,IAAc,KAAK;EAOzB,AANA,KAAK,UAAU,KAAKJ,GAAQ,uBAAuBE,CAAO,GACrDX,EAAoB,KAAK,S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,iBAAiB,SAASA,EAAS,iBAAiB,CAAC,GACvNG,IAAS/B,EAAM,aAAa,GAAGgC,MAAS;EAC7C,EAAS,OAAOA,EAAK,IAAIA,EAAK,EAAE,CAAC,CAAC,MAAM3B,CAAI;CAC7C,GAAG,CAACuB,CAAQ,CAAC;CACb,IAAIC,EAAO,SAAStB,EAAiBqB,EAAS,QAAQ,cAAc,CAACC,EAAO,KAAK,CAAC,GAAG,MAAMA,EAAO;CAClG,OAAO;EACN,GAAGA;EACH;EACA,aAAaA,EAAO;CACrB;AACD"}
1
+ {"version":3,"file":"useMutation.js","names":["React","useQueryClient","shallowEqualObjects","Subscribable","hashKey","noop","notifyManager","shouldThrowError","getDefaultState","React$1","MutationObserver","#client","client","options","#updateResult","prevOptions","#currentMutation","#notify","action","#currentResult","#mutateOptions","variables","state","mutateOptions","onMutateResult","context","useMutation","queryClient","observer","result","onStoreChange","mutate","args"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js"],"sourcesContent":["import { hashKey, shallowEqualObjects } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { getDefaultState } from \"./mutation.js\";\n// src/mutationObserver.ts\n/**\n* Observes a single mutation and derives a `MutationObserverResult` from it.\n* A framework hook like `useMutation` creates one `MutationObserver` per hook\n* call, keeps it stable across re-renders, calls `setOptions` when the options\n* passed to the hook change, subscribes to it to re-render on updates, and\n* reads `getCurrentResult()` for the value to return. Calling `mutate()`\n* builds a new underlying `Mutation` in the `MutationCache` and executes it.\n* @example\n* ```ts\n* const observer = new MutationObserver(queryClient, {\n* mutationFn: (variables: { title: string }) => addPost(variables),\n* })\n* ```\n*/\nvar MutationObserver = class extends Subscribable {\n\t#client;\n\t#currentResult = void 0;\n\t#currentMutation;\n\t#mutateOptions;\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.#client = client;\n\t\tthis.setOptions(options);\n\t\tthis.bindMethods();\n\t\tthis.#updateResult();\n\t}\n\t/**\n\t* Binds the methods of the result (`mutate` and `reset`) to the observer, so they keep working when\n\t* destructured from it.\n\t*/\n\tbindMethods() {\n\t\tthis.mutate = this.mutate.bind(this);\n\t\tthis.reset = this.reset.bind(this);\n\t}\n\t/**\n\t* Updates the observer's options.\n\t*\n\t* If the new `mutationKey` differs from the previous one (and both were\n\t* defined), the observer is reset, detaching it from the mutation it was\n\t* observing. Otherwise, if the currently observed mutation is still\n\t* `pending`, its options are updated in place as well.\n\t* @param options - The new mutation observer options. They are defaulted with {@link\n\t* QueryClient#defaultMutationOptions} before being applied.\n\t* @example\n\t* ```ts\n\t* observer.setOptions({\n\t* mutationFn: (variables: { title: string }) => addPost(variables),\n\t* onSuccess: (data) => console.log(data),\n\t* })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tthis.options = this.#client.defaultMutationOptions(options);\n\t\tif (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tmutation: this.#currentMutation,\n\t\t\tobserver: this\n\t\t});\n\t\tif (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();\n\t\telse if (this.#currentMutation?.state.status === \"pending\") this.#currentMutation.setOptions(this.options);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1 && this.#currentMutation) {\n\t\t\tthis.#currentMutation.addObserver(this);\n\t\t\tthis.#updateResult();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.#currentMutation?.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's result when the observed mutation changes, and notifies its listeners.\n\t* @internal\n\t* @param action - The action that updated the observed mutation, passed on to the observer's\n\t* callbacks.\n\t*/\n\tonMutationUpdate(action) {\n\t\tthis.#updateResult();\n\t\tthis.#notify(action);\n\t}\n\t/**\n\t* Returns the observer's current result, derived from the observed\n\t* mutation's state (or the default, `idle` state if no mutation has been\n\t* built yet, e.g. before the first `mutate()` call or after `reset()`).\n\t* @returns The observer's latest result.\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Detaches the observer from the mutation it is currently observing (if\n\t* any) and resets the observed result back to its default, `idle` state.\n\t*\n\t* This does not cancel an in-flight mutation; the mutation itself keeps\n\t* running to completion and its own callbacks still fire, but this\n\t* observer stops reflecting its state and a subsequent `mutate()` call\n\t* will build a brand new mutation.\n\t* @see {@link MutationObserver#mutate}\n\t* @example\n\t* ```ts\n\t* observer.reset()\n\t* ```\n\t*/\n\treset() {\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = void 0;\n\t\tthis.#updateResult();\n\t\tthis.#notify();\n\t}\n\t/**\n\t* Builds a new `Mutation` in the `MutationCache` using the observer's\n\t* current options, detaches this observer from any previously observed\n\t* mutation, attaches it to the new one, and executes it with the given\n\t* variables.\n\t*\n\t* The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are\n\t* invoked once the mutation settles, in addition to any callbacks defined\n\t* on the observer's own options.\n\t* @param variables - The variables passed to the `mutationFn`.\n\t* @param options - Per-call `onSuccess`, `onError`, and `onSettled` callbacks.\n\t* @returns A promise that resolves with the mutation's data, or rejects with its error.\n\t* @example\n\t* ```ts\n\t* await observer.mutate(\n\t* { title: 'New post' },\n\t* { onSuccess: (data) => console.log(data) },\n\t* )\n\t* ```\n\t*/\n\tmutate(variables, options) {\n\t\tthis.#mutateOptions = options;\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n\t\tthis.#currentMutation.addObserver(this);\n\t\treturn this.#currentMutation.execute(variables);\n\t}\n\t#updateResult() {\n\t\tconst state = this.#currentMutation?.state ?? getDefaultState();\n\t\tthis.#currentResult = {\n\t\t\t...state,\n\t\t\tisPending: state.status === \"pending\",\n\t\t\tisSuccess: state.status === \"success\",\n\t\t\tisError: state.status === \"error\",\n\t\t\tisIdle: state.status === \"idle\",\n\t\t\tmutate: this.mutate,\n\t\t\treset: this.reset\n\t\t};\n\t}\n\t#notify(action) {\n\t\tnotifyManager.batch(() => {\n\t\t\tconst mutateOptions = this.#mutateOptions;\n\t\t\tif (mutateOptions && this.hasListeners()) {\n\t\t\t\tconst variables = this.#currentResult.variables;\n\t\t\t\tconst onMutateResult = this.#currentResult.context;\n\t\t\t\tconst context = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tmeta: this.options.meta,\n\t\t\t\t\tmutationKey: this.options.mutationKey\n\t\t\t\t};\n\t\t\t\tif (action?.type === \"success\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t} else if (action?.type === \"error\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onError?.(action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t});\n\t}\n};\nexport { MutationObserver };\n\n//# sourceMappingURL=mutationObserver.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { MutationObserver, noop, notifyManager, shouldThrowError } from \"@tanstack/query-core\";\nimport * as React from \"react\";\n// src/useMutation.ts\n/**\n* Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.\n* `useMutation` is the hook for that.\n* @param options - The {@link UseMutationOptions} to use — everything you can pass to `useMutation`.\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns `mutate`/`mutateAsync` also accept per-call `onSuccess`/`onError`/`onSettled` callbacks as a second\n* argument, useful for triggering call-site side effects (e.g. navigation) without coupling them to the shared\n* mutation definition. Hook-level callbacks (passed to `options`) fire for every mutation; per-call callbacks\n* fire only for the latest call you've made, and only while the component is still mounted — unmounting before\n* the mutation settles removes the subscription and prevents them from firing.\n* @throws {Error} The mutation error, when `throwOnError` is `true` or returns `true` for it, so that it is\n* thrown to the nearest error boundary.\n* @see {@link mutationOptions} to share these options across multiple `useMutation` call sites, or to look\n* the mutation up elsewhere via its `mutationKey` (e.g. with `useMutationState`).\n* @example\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <button\n* onClick={() =>\n* addMutation.mutate('Item', {\n* onError: (error) => console.error('Failed to add item:', error),\n* })\n* }\n* >\n* Add\n* </button>\n* )\n* }\n* ```\n* @example\n* Rendering the mutation's own state, rather than just firing it off:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <div>\n* {addMutation.isPending ? (\n* 'Adding todo...'\n* ) : (\n* <>\n* {addMutation.isError ? (\n* <div>An error occurred: {addMutation.error.message}</div>\n* ) : null}\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* </>\n* )}\n* </div>\n* )\n* }\n* ```\n* @example\n* Optimistic update via `onMutate`, rolling back on `onError`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onMutate: async (newTodo) => {\n* await queryClient.cancelQueries({ queryKey: ['todos'] })\n* const previousTodos = queryClient.getQueryData<Array<string>>(['todos'])\n*\n* queryClient.setQueryData<Array<string>>(['todos'], (old) => [\n* ...(old ?? []),\n* newTodo,\n* ])\n*\n* // Passed to `onError` as `onMutateResult` if the mutation fails.\n* return { previousTodos }\n* },\n* onError: (_err, _newTodo, onMutateResult) => {\n* queryClient.setQueryData(['todos'], onMutateResult?.previousTodos)\n* },\n* onSettled: () => {\n* queryClient.invalidateQueries({ queryKey: ['todos'] })\n* },\n* })\n*\n* return (\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* )\n* }\n* ```\n* @example\n* Callbacks passed per call to `mutate` only fire for the last call — `mutateAsync` gives you a\n* promise per call instead, so you can wait for all of them when they succeed:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* try {\n* await Promise.all(todos.map((todo) => addMutation.mutateAsync(todo)))\n* } catch (error) {\n* console.error('Failed to add todos:', error)\n* }\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n* @example\n* If some of the mutations above can fail independently of the others, and you want to know which ones\n* did — rather than losing that information the moment the first one rejects — swap `Promise.all` for\n* `Promise.allSettled`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* const addResults = await Promise.allSettled(\n* todos.map((todo) => addMutation.mutateAsync(todo)),\n* )\n*\n* addResults.forEach((addResult, index) => {\n* if (addResult.status === 'rejected') {\n* console.error(`Failed to add \"${todos[index]}\":`, addResult.reason)\n* }\n* })\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n*/\nfunction useMutation(options, queryClient) {\n\tconst client = useQueryClient(queryClient);\n\tconst [observer] = React.useState(() => new MutationObserver(client, options));\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(options);\n\t}, [observer, options]);\n\tconst result = React.useSyncExternalStore(React.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tconst mutate = React.useCallback((...args) => {\n\t\tobserver.mutate(args[0], args[1]).catch(noop);\n\t}, [observer]);\n\tif (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;\n\treturn {\n\t\t...result,\n\t\tmutate,\n\t\tmutateAsync: result.mutate\n\t};\n}\nexport { useMutation };\n\n//# sourceMappingURL=useMutation.js.map"],"ignoreList":[0,1],"mappings":";;;;;AAmBA,IAAIU,IAAmB,cAAcP,EAAa;CACjD;CACA,KAAiB,KAAK;CACtB;CACA;CACA,YAAY,GAAQ,GAAS;EAK5B,AAJA,MAAM,GACN,KAAKQ,KAAUC,GACf,KAAK,WAAWC,CAAO,GACvB,KAAK,YAAY,GACjB,KAAKC,GAAc;CACpB;CAKA,c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CAC7E,EAAM,gBAAgB;EACrB,EAAS,WAAWA,CAAO;CAC5B,GAAG,CAACe,GAAUf,CAAO,CAAC;CACtB,IAAMgB,IAAS7B,EAAM,qBAAqBA,EAAM,aAAa,MAAkB4B,EAAS,UAAUtB,EAAc,WAAWwB,CAAa,CAAC,GAAG,CAACF,CAAQ,CAAC,SAASA,EAAS,iBAAiB,SAASA,EAAS,iBAAiB,CAAC,GACvNG,IAAS/B,EAAM,aAAa,GAAGgC,MAAS;EAC7C,EAAS,OAAOA,EAAK,IAAIA,EAAK,EAAE,CAAC,CAAC,MAAM3B,CAAI;CAC7C,GAAG,CAACuB,CAAQ,CAAC;CACb,IAAIC,EAAO,SAAStB,EAAiBqB,EAAS,QAAQ,cAAc,CAACC,EAAO,KAAK,CAAC,GAAG,MAAMA,EAAO;CAClG,OAAO;EACN,GAAGA;EACH;EACA,aAAaA,EAAO;CACrB;AACD"}
@@ -3,7 +3,7 @@ import { C as t, b as n, c as r, g as i, l as a, n as o, o as s, p as c, s as l,
3
3
  import * as m from "react";
4
4
  import { useMemo as h } from "react";
5
5
  import "react/jsx-runtime";
6
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/queryObserver.js
6
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/queryObserver.js
7
7
  var g = class extends r {
8
8
  #e;
9
9
  #t = void 0;
@@ -228,10 +228,10 @@ function b(e, t, n, r) {
228
228
  function x(e, t) {
229
229
  return p(t.enabled, e) !== !1 && e.isStaleByTime(p(t.staleTime, e));
230
230
  }
231
- // ../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
231
+ // ../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
232
232
  var S = m.createContext(!1), C = () => m.useContext(S);
233
233
  S.Provider;
234
- // ../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
234
+ // ../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
235
235
  function w() {
236
236
  let e = !1;
237
237
  return {
@@ -259,7 +259,7 @@ var T = m.createContext(w()), E = () => m.useContext(T), D = (e, t, n) => {
259
259
  }, j = (e, t) => e?.suspense && t.isPending, M = (e, t, n) => t.fetchOptimistic(e).catch(() => {
260
260
  n.clearReset();
261
261
  });
262
- // ../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
262
+ // ../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
263
263
  function N(t, n, r) {
264
264
  if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
265
265
  let a = C(), o = E(), c = e(r), l = c.defaultQueryOptions(t), u = c.getQueryCache().get(l.queryHash);
@@ -284,7 +284,7 @@ function N(t, n, r) {
284
284
  })) throw p.error;
285
285
  return l.notifyOnChangeProps ? p : f.trackResult(p);
286
286
  }
287
- // ../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js
287
+ // ../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js
288
288
  function P(e, t) {
289
289
  return N(e, g, t);
290
290
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useQueryMemo.js","names":["React","React","React","useQueryClient","timeUntilStale","shallowEqualObjects","Subscribable","noop","isServer","fetchState","notifyManager","isValidTimeout","focusManager","replaceData","timeoutManager","shouldThrowError","resolveQueryValue","React$1","QueryObserver","options","#client","client","#selectError","#currentQuery","shouldFetchOnMount","#executeFetch","#updateTimers","shouldFetchOn","#clearStaleTimeout","#clearRefetchInterval","prevOptions","prevQuery","#updateQuery","mounted","shouldFetchOptionally","#updateStaleTimeout","nextRefetchInterval","#computeRefetchInterval","#currentRefetchInterval","#updateRefetchInterval","query","result","#currentResult","#currentResultOptions","#currentResultState","key","onPropTracked","target","#trackedProps","defaultedOptions","unsubscribe","resolveEarly","cachePromise","resolve","event","fetchOptions","promise","timeout","staleTime","#shouldScheduleTimer","#staleTimeoutId","nextInterval","#refetchIntervalId","prevResult","prevResultState","prevResultOptions","queryInitialState","#currentQueryInitialState","newState","state","isPlaceholderData","data","fetchOnMount","fetchOptionally","skipSelect","status","placeholderData","#lastQueryWithDefinedData","#selectFn","#selectResult","selectError","error","isFetching","isPending","isError","isLoading","hasData","isStale","nextResult","notifyListeners","notifyOnChangePropsValue","notifyOnChangeProps","shouldLoadOnMount","value","field","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","ensurePreventErrorBoundaryRetry","throwOnError","errorResetBoundary","useClearResetErrorBoundary","getHasError","suspense","ensureSuspenseTimers","MIN_SUSPENSE_TIME_MS","clamp","originalStaleTime","args","shouldSuspend","fetchOptimistic","observer","useBaseQuery","isRestoring","queryClient","subscribed","Observer","shouldSubscribe","onStoreChange","useQuery","useQueryMemo","useMemo"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/suspense.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.1_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js","../../src/hooks/useQueryMemo/useQueryMemo.ts"],"sourcesContent":["import { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout, noop, replaceData, resolveQueryValue, shallowEqualObjects, timeUntilStale } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\n// src/queryObserver.ts\n/**\n* A `QueryObserver` watches a single query in the `QueryCache` and computes a\n* `QueryObserverResult` from its state, recomputing and notifying subscribers\n* whenever the underlying query (or the observer's options) changes. It is\n* the primitive that framework adapters (e.g. `useQuery`) build their hooks\n* on top of, but it can also be used directly to observe and switch between\n* queries outside of any framework.\n* @example\n* ```ts\n* const observer = new QueryObserver(queryClient, {\n* queryKey: ['posts'],\n* queryFn: fetchPosts,\n* })\n*\n* const unsubscribe = observer.subscribe((result) => {\n* console.log(result.data)\n* })\n* ```\n*/\nvar QueryObserver = class extends Subscribable {\n\t#client;\n\t#currentQuery = void 0;\n\t#currentQueryInitialState = void 0;\n\t#currentResult = void 0;\n\t#currentResultState;\n\t#currentResultOptions;\n\t#selectError;\n\t#selectFn;\n\t#selectResult;\n\t#lastQueryWithDefinedData;\n\t#staleTimeoutId;\n\t#refetchIntervalId;\n\t#currentRefetchInterval;\n\t#trackedProps = /* @__PURE__ */ new Set();\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.#client = client;\n\t\tthis.#selectError = null;\n\t\tthis.bindMethods();\n\t\tthis.setOptions(options);\n\t}\n\t/**\n\t* Binds the methods of the result (`refetch`) to the observer, so they keep working when destructured\n\t* from it. Subclasses override it to bind their own result methods as well.\n\t*/\n\tbindMethods() {\n\t\tthis.refetch = this.refetch.bind(this);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1) {\n\t\t\tthis.#currentQuery.addObserver(this);\n\t\t\tif (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();\n\t\t\telse this.updateResult();\n\t\t\tthis.#updateTimers();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.destroy();\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnReconnect` option) to refetch when the network\n\t* reconnects.\n\t* @returns `true` if the observer should refetch the query on reconnect.\n\t*/\n\tshouldFetchOnReconnect() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnWindowFocus` option) to refetch when the window\n\t* regains focus.\n\t* @returns `true` if the observer should refetch the query on window focus.\n\t*/\n\tshouldFetchOnWindowFocus() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);\n\t}\n\t/**\n\t* Stops observing the current query: clears all listeners, cancels the\n\t* stale and refetch-interval timers, and removes this observer from the\n\t* query it was observing.\n\t*/\n\tdestroy() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.#clearStaleTimeout();\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentQuery.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's options. This will re-resolve the query being\n\t* observed (switching to a different query if the `queryKey` changed),\n\t* trigger a fetch if the new options require one and the observer has\n\t* subscribers, recompute the current result, and reschedule the stale and\n\t* refetch-interval timers as needed.\n\t* @param options - The new observer options. They are defaulted with {@link\n\t* QueryClient#defaultQueryOptions} before being applied.\n\t* @throws {Error} If `enabled` is neither a boolean nor a function.\n\t* @example\n\t* ```ts\n\t* observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) })\n\t* // later: switch to a different query, reusing the same observer\n\t* observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.options = this.#client.defaultQueryOptions(options);\n\t\tif (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveQueryValue(this.options.enabled, this.#currentQuery) !== \"boolean\") throw new Error(\"Expected enabled to be a boolean or a callback that returns a boolean\");\n\t\tthis.#updateQuery();\n\t\tthis.#currentQuery.setOptions(this.options);\n\t\tif (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tquery: this.#currentQuery,\n\t\t\tobserver: this\n\t\t});\n\t\tconst mounted = this.hasListeners();\n\t\tif (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();\n\t\tthis.updateResult();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || resolveQueryValue(this.options.staleTime, this.#currentQuery) !== resolveQueryValue(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();\n\t\tconst nextRefetchInterval = this.#computeRefetchInterval();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);\n\t}\n\t/**\n\t* Computes the result the observer would produce for the given (already-defaulted) options\n\t* right now, building the underlying `Query` if it doesn't exist yet, without waiting for a\n\t* subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the\n\t* returned value is available synchronously, ahead of `setOptions` triggering an actual fetch.\n\t* @param options - The defaulted observer options to compute the result for.\n\t* @returns The result for the given options.\n\t*/\n\tgetOptimisticResult(options) {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, options);\n\t\tconst result = this.createResult(query, options);\n\t\tif (!shallowEqualObjects(this.getCurrentResult(), result)) {\n\t\t\tthis.#currentResult = result;\n\t\t\tthis.#currentResultOptions = this.options;\n\t\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Returns the most recently computed `QueryObserverResult` for the\n\t* observed query. This is a point-in-time read; to be notified of updates\n\t* as they happen, subscribe to the observer instead (its inherited\n\t* `subscribe` method).\n\t* @returns The observer's latest result.\n\t* @example\n\t* ```ts\n\t* const result = observer.getCurrentResult()\n\t* console.log(result.status, result.data)\n\t* ```\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via\n\t* {@link QueryObserver#trackProp} (and an optional `onPropTracked` callback). Used by framework\n\t* adapters when `notifyOnChangeProps` is not set, to implement its default \"only re-render on\n\t* properties you actually read\" behavior.\n\t* @param result - The result to wrap.\n\t* @param onPropTracked - Called with the name of each property that is read.\n\t* @returns A proxy of `result` that tracks property reads.\n\t*/\n\ttrackResult(result, onPropTracked) {\n\t\treturn new Proxy(result, { get: (target, key) => {\n\t\t\tthis.trackProp(key);\n\t\t\tonPropTracked?.(key);\n\t\t\treturn Reflect.get(target, key);\n\t\t} });\n\t}\n\t/**\n\t* Records that the given `QueryObserverResult` property was read, so a subsequent update only\n\t* notifies this observer if a tracked property actually changed. Normally called indirectly via\n\t* {@link QueryObserver#trackResult}'s proxy; exposed directly for adapters that track property\n\t* access themselves (e.g. through their own reactivity system) instead of via the proxy.\n\t* @param key - The name of the property that was read.\n\t*/\n\ttrackProp(key) {\n\t\tthis.#trackedProps.add(key);\n\t}\n\t/**\n\t* Returns the `Query` instance this observer is currently observing.\n\t* @returns The observed query.\n\t*/\n\tgetCurrentQuery() {\n\t\treturn this.#currentQuery;\n\t}\n\t/**\n\t* Refetches the observed query and returns a promise that resolves with\n\t* the resulting `QueryObserverResult`.\n\t* @param options - Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling\n\t* it, and `throwOnError` to `true` to reject when the refetch fails.\n\t* @returns A promise that resolves with the result after the refetch.\n\t* @example\n\t* ```ts\n\t* const result = await observer.refetch({ cancelRefetch: false })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\trefetch({ ...options } = {}) {\n\t\treturn this.fetch({ ...options });\n\t}\n\t/**\n\t* Fetches a query defined by the given options without affecting this\n\t* observer's own tracked query or result, and returns a promise that\n\t* resolves with the `QueryObserverResult` for that fetch. This is useful\n\t* for prefetching data that another observer (e.g. a query about to be\n\t* navigated to) will need, ahead of time.\n\t* @param options - The observer options of the query to fetch.\n\t* @returns A promise that resolves with the result for the fetched query.\n\t* @example\n\t* ```ts\n\t* const result = await observer.fetchOptimistic({\n\t* queryKey: ['posts', 2],\n\t* queryFn: () => fetchPost(2),\n\t* })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\tfetchOptimistic(options) {\n\t\tconst defaultedOptions = this.#client.defaultQueryOptions(options);\n\t\tconst query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n\t\tlet unsubscribe = () => {};\n\t\tlet resolveEarly;\n\t\tconst cachePromise = new Promise((resolve) => {\n\t\t\tresolveEarly = resolve;\n\t\t\tunsubscribe = this.#client.getQueryCache().subscribe((event) => {\n\t\t\t\tif (event.type === \"updated\" && event.query.queryHash === query.queryHash && query.state.data !== void 0) {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve(this.createResult(query, defaultedOptions));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn Promise.race([query.fetch(defaultedOptions).then(() => {\n\t\t\tconst result = this.createResult(query, defaultedOptions);\n\t\t\tresolveEarly?.(result);\n\t\t\treturn result;\n\t\t}).finally(() => {\n\t\t\tunsubscribe();\n\t\t}), cachePromise]);\n\t}\n\t/**\n\t* Fetches the observed query and updates the result once the fetch settles. Used by `refetch` and,\n\t* in `InfiniteQueryObserver`, to fetch more pages.\n\t* @param fetchOptions - Options for this fetch. `cancelRefetch` defaults to `true`.\n\t* @returns A promise that resolves with the updated result.\n\t*/\n\tfetch(fetchOptions) {\n\t\treturn this.#executeFetch({\n\t\t\t...fetchOptions,\n\t\t\tcancelRefetch: fetchOptions.cancelRefetch ?? true\n\t\t}).then(() => {\n\t\t\tthis.updateResult();\n\t\t\treturn this.#currentResult;\n\t\t});\n\t}\n\t#executeFetch(fetchOptions) {\n\t\tthis.#updateQuery();\n\t\tlet promise = this.#currentQuery.fetch(this.options, fetchOptions);\n\t\tif (!fetchOptions?.throwOnError) promise = promise.catch(noop);\n\t\treturn promise;\n\t}\n\t#shouldScheduleTimer(timeout) {\n\t\treturn !isServer() && resolveQueryValue(this.options.enabled, this.#currentQuery) !== false && isValidTimeout(timeout);\n\t}\n\t#updateStaleTimeout() {\n\t\tthis.#clearStaleTimeout();\n\t\tconst staleTime = resolveQueryValue(this.options.staleTime, this.#currentQuery);\n\t\tif (this.#currentResult.isStale || !this.#shouldScheduleTimer(staleTime)) return;\n\t\tconst timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;\n\t\tthis.#staleTimeoutId = timeoutManager.setTimeout(() => {\n\t\t\tif (!this.#currentResult.isStale) this.updateResult();\n\t\t}, timeout);\n\t}\n\t#computeRefetchInterval() {\n\t\treturn resolveQueryValue(this.options.refetchInterval, this.#currentQuery) ?? false;\n\t}\n\t#updateRefetchInterval(nextInterval) {\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentRefetchInterval = nextInterval;\n\t\tif (this.#currentRefetchInterval === 0 || !this.#shouldScheduleTimer(this.#currentRefetchInterval)) return;\n\t\tthis.#refetchIntervalId = timeoutManager.setInterval(() => {\n\t\t\tif (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();\n\t\t}, this.#currentRefetchInterval);\n\t}\n\t#updateTimers() {\n\t\tthis.#updateStaleTimeout();\n\t\tthis.#updateRefetchInterval(this.#computeRefetchInterval());\n\t}\n\t#clearStaleTimeout() {\n\t\tif (this.#staleTimeoutId !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#staleTimeoutId);\n\t\t\tthis.#staleTimeoutId = void 0;\n\t\t}\n\t}\n\t#clearRefetchInterval() {\n\t\tif (this.#refetchIntervalId !== void 0) {\n\t\t\ttimeoutManager.clearInterval(this.#refetchIntervalId);\n\t\t\tthis.#refetchIntervalId = void 0;\n\t\t}\n\t}\n\t/**\n\t* Computes the result for a query and options from the query's state, applying `select`,\n\t* `placeholderData`, and the derived flags. Subclasses override it to add their own fields.\n\t* @param query - The query to compute the result for.\n\t* @param options - The observer options to compute the result with.\n\t* @returns The computed result.\n\t*/\n\tcreateResult(query, options) {\n\t\tconst prevQuery = this.#currentQuery;\n\t\tconst prevOptions = this.options;\n\t\tconst prevResult = this.#currentResult;\n\t\tconst prevResultState = this.#currentResultState;\n\t\tconst prevResultOptions = this.#currentResultOptions;\n\t\tconst queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;\n\t\tconst { state } = query;\n\t\tlet newState = { ...state };\n\t\tlet isPlaceholderData = false;\n\t\tlet data;\n\t\tif (options._optimisticResults) {\n\t\t\tconst mounted = this.hasListeners();\n\t\t\tconst fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n\t\t\tconst fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\t\t\tif (fetchOnMount || fetchOptionally) newState = {\n\t\t\t\t...newState,\n\t\t\t\t...fetchState(state.data, query.options)\n\t\t\t};\n\t\t\tif (options._optimisticResults === \"isRestoring\") newState.fetchStatus = \"idle\";\n\t\t}\n\t\tlet { error, errorUpdatedAt, status } = newState;\n\t\tdata = newState.data;\n\t\tlet skipSelect = false;\n\t\tif (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n\t\t\tlet placeholderData;\n\t\t\tif (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n\t\t\t\tplaceholderData = prevResult.data;\n\t\t\t\tskipSelect = true;\n\t\t\t} else placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;\n\t\t\tif (placeholderData !== void 0) {\n\t\t\t\tstatus = \"success\";\n\t\t\t\tdata = replaceData(prevResult?.data, placeholderData, options);\n\t\t\t\tisPlaceholderData = true;\n\t\t\t}\n\t\t}\n\t\tif (options.select && data !== void 0 && !skipSelect) {\n\t\t\tif (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;\n\t\t\telse try {\n\t\t\t\tthis.#selectFn = options.select;\n\t\t\t\tdata = options.select(data);\n\t\t\t\tdata = replaceData(prevResult?.data, data, options);\n\t\t\t\tthis.#selectResult = data;\n\t\t\t\tthis.#selectError = null;\n\t\t\t} catch (selectError) {\n\t\t\t\tthis.#selectError = selectError;\n\t\t\t}\n\t\t} else if (data === void 0) this.#selectError = null;\n\t\tif (this.#selectError) {\n\t\t\terror = this.#selectError;\n\t\t\tdata = this.#selectResult;\n\t\t\terrorUpdatedAt = prevResult?.error === error ? prevResult.errorUpdatedAt : Date.now();\n\t\t\tstatus = \"error\";\n\t\t\tisPlaceholderData = false;\n\t\t}\n\t\tconst isFetching = newState.fetchStatus === \"fetching\";\n\t\tconst isPending = status === \"pending\";\n\t\tconst isError = status === \"error\";\n\t\tconst isLoading = isPending && isFetching;\n\t\tconst hasData = data !== void 0;\n\t\treturn {\n\t\t\tstatus,\n\t\t\tfetchStatus: newState.fetchStatus,\n\t\t\tisPending,\n\t\t\tisSuccess: status === \"success\",\n\t\t\tisError,\n\t\t\tisInitialLoading: isLoading,\n\t\t\tisLoading,\n\t\t\tdata,\n\t\t\tdataUpdatedAt: newState.dataUpdatedAt,\n\t\t\terror,\n\t\t\terrorUpdatedAt,\n\t\t\tfailureCount: newState.fetchFailureCount,\n\t\t\tfailureReason: newState.fetchFailureReason,\n\t\t\terrorUpdateCount: newState.errorUpdateCount,\n\t\t\tisFetched: query.isFetched(),\n\t\t\tisFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n\t\t\tisFetching,\n\t\t\tisRefetching: isFetching && !isPending,\n\t\t\tisLoadingError: isError && !hasData,\n\t\t\tisPaused: newState.fetchStatus === \"paused\",\n\t\t\tisPlaceholderData,\n\t\t\tisRefetchError: isError && hasData,\n\t\t\tisStale: isStale(query, options),\n\t\t\trefetch: this.refetch,\n\t\t\tisEnabled: resolveQueryValue(options.enabled, query) !== false\n\t\t};\n\t}\n\t/**\n\t* Recomputes and stores the current result from the current query/options, notifying listeners\n\t* if it changed. Framework adapters call this right after subscribing to make sure no query\n\t* update was missed in the gap between creating the observer and subscribing to it.\n\t*/\n\tupdateResult() {\n\t\tconst prevResult = this.#currentResult;\n\t\tconst nextResult = this.createResult(this.#currentQuery, this.options);\n\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\tthis.#currentResultOptions = this.options;\n\t\tif (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;\n\t\tif (shallowEqualObjects(nextResult, prevResult)) return;\n\t\tthis.#currentResult = nextResult;\n\t\tconst shouldNotifyListeners = () => {\n\t\t\tif (!prevResult) return true;\n\t\t\tconst { notifyOnChangeProps } = this.options;\n\t\t\tconst notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n\t\t\tif (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;\n\t\t\tif (this.options.throwOnError && this.#currentResult.error !== prevResult.error) return true;\n\t\t\tfor (const key of notifyOnChangePropsValue ?? this.#trackedProps) if (this.#currentResult[key] !== prevResult[key]) return true;\n\t\t\treturn false;\n\t\t};\n\t\tconst notifyListeners = shouldNotifyListeners();\n\t\tnotifyManager.batch(() => {\n\t\t\tif (notifyListeners) this.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t\tthis.#client.getQueryCache().notify({\n\t\t\t\tquery: this.#currentQuery,\n\t\t\t\ttype: \"observerResultsUpdated\"\n\t\t\t});\n\t\t});\n\t}\n\t#updateQuery() {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, this.options);\n\t\tif (query === this.#currentQuery) return;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.#currentQuery = query;\n\t\tthis.#currentQueryInitialState = query.state;\n\t\tif (this.hasListeners()) {\n\t\t\tprevQuery?.removeObserver(this);\n\t\t\tquery.addObserver(this);\n\t\t}\n\t}\n\t/**\n\t* Updates the observer's result when the observed query changes, and reschedules its timers if it\n\t* has listeners.\n\t* @internal\n\t*/\n\tonQueryUpdate() {\n\t\tthis.updateResult();\n\t\tif (this.hasListeners()) this.#updateTimers();\n\t}\n};\n/**\n* Checks whether a query has no data yet and should do its initial load when an observer mounts.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query is enabled, has no data, and isn't in an error state with\n* `retryOnMount: false`.\n*/\nfunction shouldLoadOnMount(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && resolveQueryValue(options.retryOnMount, query) === false);\n}\n/**\n* Checks whether a query should fetch when an observer mounts: either for its initial load, or\n* because it has data and `refetchOnMount` asks for a refetch.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query should fetch on mount.\n*/\nfunction shouldFetchOnMount(query, options) {\n\treturn shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n/**\n* Checks whether a query should fetch for a `refetchOnMount`, `refetchOnWindowFocus`, or\n* `refetchOnReconnect` option.\n* @param query - The query to check.\n* @param options - The observer options.\n* @param field - The value of the option to check.\n* @returns `true` if the query is enabled, not static, and the option is `'always'`, or is not\n* `false` and the query is stale.\n*/\nfunction shouldFetchOn(query, options, field) {\n\tif (resolveQueryValue(options.enabled, query) !== false && resolveQueryValue(options.staleTime, query) !== \"static\") {\n\t\tconst value = resolveQueryValue(field, query);\n\t\treturn value === \"always\" || value !== false && isStale(query, options);\n\t}\n\treturn false;\n}\n/**\n* Checks whether a query should fetch after the observer's options change.\n* @param query - The query observed with the new options.\n* @param prevQuery - The query observed with the previous options.\n* @param options - The new observer options.\n* @param prevOptions - The previous observer options.\n* @returns `true` if the query changed or was disabled before, it isn't a suspense query in an\n* error state, and it is stale.\n*/\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n\treturn (query !== prevQuery || resolveQueryValue(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\n/**\n* Checks whether a query is stale for the given observer options.\n* @param query - The query to check.\n* @param options - The observer options, whose `enabled` and `staleTime` are used.\n* @returns `true` if the query is enabled and its data is stale for `staleTime`.\n*/\nfunction isStale(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.isStaleByTime(resolveQueryValue(options.staleTime, query));\n}\nexport { QueryObserver };\n\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\nimport * as React from \"react\";\n// src/IsRestoringProvider.ts\nconst IsRestoringContext = React.createContext(false);\n/**\n* If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to\n* check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid\n* race conditions between the restore and mounting queries.\n* @returns `true` while a persisted client is being restored, `false` otherwise.\n*/\nconst useIsRestoring = () => React.useContext(IsRestoringContext);\n/**\n* The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently\n* being restored, read by `useIsRestoring`.\n*/\nconst IsRestoringProvider = IsRestoringContext.Provider;\nexport { IsRestoringProvider, useIsRestoring };\n\n//# sourceMappingURL=IsRestoringProvider.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// src/QueryErrorResetBoundary.tsx\n/**\n* Creates the value shared through the boundary's context, which tracks whether a reset was\n* requested.\n* @returns The `clearReset`, `isReset`, and `reset` functions of the boundary.\n*/\nfunction createValue() {\n\tlet isReset = false;\n\treturn {\n\t\t/**\n\t\t* Clears the reset state, so queries know not to try again until the boundary is reset again.\n\t\t*/\n\t\tclearReset: () => {\n\t\t\tisReset = false;\n\t\t},\n\t\t/**\n\t\t* Resets any query errors within the boundary, so queries know they can try again.\n\t\t*/\n\t\treset: () => {\n\t\t\tisReset = true;\n\t\t},\n\t\t/**\n\t\t* Returns whether the boundary has been reset and not yet cleared.\n\t\t* @returns `true` if the boundary has been reset and not yet cleared.\n\t\t*/\n\t\tisReset: () => {\n\t\t\treturn isReset;\n\t\t}\n\t};\n}\nconst QueryErrorResetBoundaryContext = React.createContext(createValue());\n/**\n* This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary\n* defined it will reset them globally.\n* @returns The boundary's {@link QueryErrorResetBoundaryValue}.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { useQueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App({ children }: { children: React.ReactNode }) {\n* const { reset } = useQueryErrorResetBoundary()\n*\n* return (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* {children}\n* </ErrorBoundary>\n* )\n* }\n* ```\n*/\nconst useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\n/**\n* When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to\n* try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can\n* reset any query errors within the boundaries of the component.\n* @param props - The `children` to render.\n* @returns The `children`, rendered as-is, or called with the boundary's {@link QueryErrorResetBoundaryValue}\n* if `children` is a function.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { QueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App() {\n* return (\n* <QueryErrorResetBoundary>\n* {({ reset }) => (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* <Page />\n* </ErrorBoundary>\n* )}\n* </QueryErrorResetBoundary>\n* )\n* }\n* ```\n*/\nconst QueryErrorResetBoundary = ({ children }) => {\n\tconst [value] = React.useState(() => createValue());\n\treturn /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, {\n\t\tvalue,\n\t\tchildren: typeof children === \"function\" ? children(value) : children\n\t});\n};\nexport { QueryErrorResetBoundary, useQueryErrorResetBoundary };\n\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","\"use client\";\nimport * as React from \"react\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\n// src/errorBoundaryUtils.ts\n/**\n* Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n* unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n* user resets the boundary. Mutates the options.\n* @param options - The defaulted query options to adjust.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @param query - The query, used to evaluate a `throwOnError` function against its error.\n*/\nconst ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n\tconst throwOnError = query?.state.status === \"error\" && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n\tif (options.suspense || throwOnError) {\n\t\tif (!errorResetBoundary.isReset()) options.retryOnMount = false;\n\t}\n};\n/**\n* Clears the reset state of the error boundary after the component mounts, so later errors are\n* thrown to the boundary again.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n*/\nconst useClearResetErrorBoundary = (errorResetBoundary) => {\n\tReact.useEffect(() => {\n\t\terrorResetBoundary.clearReset();\n\t}, [errorResetBoundary]);\n};\n/**\n* Checks whether the query error should be thrown to the nearest error boundary: the query errored\n* and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n* or `throwOnError` says so.\n* @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n* `query`, and the `suspense` option.\n* @returns `true` if the error should be thrown.\n*/\nconst getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {\n\treturn result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };\n\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\n/**\n* The default `throwOnError` of the suspense hooks: throws the error to the nearest error boundary\n* only if the query has no data to show.\n* @param _error - The error of the query. Unused.\n* @param query - The query that errored.\n* @returns `true` if the query has no data.\n*/\nconst defaultThrowOnError = (_error, query) => query.state.data === void 0;\n/**\n* Raises `staleTime` and a numeric `gcTime` to at least 1000ms when `suspense` is enabled, so a\n* component that remounts after suspending doesn't refetch right away or find the query garbage\n* collected. A `'static'` `staleTime` is kept as is. Mutates the options.\n* @param defaultedOptions - The defaulted query options to adjust.\n*/\nconst ensureSuspenseTimers = (defaultedOptions) => {\n\tif (defaultedOptions.suspense) {\n\t\tconst MIN_SUSPENSE_TIME_MS = 1e3;\n\t\tconst clamp = (value) => value === \"static\" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);\n\t\tconst originalStaleTime = defaultedOptions.staleTime;\n\t\tdefaultedOptions.staleTime = typeof originalStaleTime === \"function\" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);\n\t\tif (typeof defaultedOptions.gcTime === \"number\") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);\n\t}\n};\n/**\n* Checks whether a query should suspend: `suspense` is enabled and the result is still `pending`.\n* @param defaultedOptions - The defaulted query options, if any.\n* @param result - The current result of the observer.\n* @returns `true` if the component should suspend.\n*/\nconst shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\n/**\n* Fetches the query for a suspending component, without affecting the observer's own result. If\n* the fetch fails, the reset state of the error boundary is cleared, so the error is thrown to it.\n* @param defaultedOptions - The defaulted query options to fetch with.\n* @param observer - The observer of the query.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @returns A promise that resolves once the fetch settles. It never rejects.\n*/\nconst fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n\terrorResetBoundary.clearReset();\n});\nexport { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };\n\n//# sourceMappingURL=suspense.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary } from \"./errorBoundaryUtils.js\";\nimport { ensureSuspenseTimers, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nimport * as React from \"react\";\nimport { noop, notifyManager } from \"@tanstack/query-core\";\n// src/useBaseQuery.ts\n/**\n* Base implementation shared by `useQuery`, `useInfiniteQuery`, `useSuspenseQuery`, and\n* `useSuspenseInfiniteQuery`.\n* @param options - The options passed to the calling hook.\n* @param Observer - The observer class from query-core (`QueryObserver` or\n* `InfiniteQueryObserver`).\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest\n* context will be used.\n* @returns The query result, tracking which properties are read unless `notifyOnChangeProps` is\n* set.\n* @throws {Error} If `options` is not an object (outside production), or the query error when it should be\n* thrown to the nearest error boundary (see `throwOnError`). While suspending, it throws a promise instead.\n*/\nfunction useBaseQuery(options, Observer, queryClient) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) throw new Error(\"Bad argument type. Starting with v5, only the \\\"Object\\\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object\");\n\t}\n\tconst isRestoring = useIsRestoring();\n\tconst errorResetBoundary = useQueryErrorResetBoundary();\n\tconst client = useQueryClient(queryClient);\n\tconst defaultedOptions = client.defaultQueryOptions(options);\n\tconst query = client.getQueryCache().get(defaultedOptions.queryHash);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);\n\t}\n\tconst subscribed = options.subscribed !== false;\n\tdefaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : subscribed ? \"optimistic\" : void 0;\n\tensureSuspenseTimers(defaultedOptions);\n\tensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n\tuseClearResetErrorBoundary(errorResetBoundary);\n\tconst [observer] = React.useState(() => new Observer(client, defaultedOptions));\n\tconst result = observer.getOptimisticResult(defaultedOptions);\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(defaultedOptions);\n\t}, [defaultedOptions, observer]);\n\tconst shouldSubscribe = !isRestoring && subscribed;\n\tReact.useSyncExternalStore(React.useCallback((onStoreChange) => {\n\t\tconst unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n\t\tobserver.updateResult();\n\t\treturn unsubscribe;\n\t}, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tif (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n\tif (getHasError({\n\t\tresult,\n\t\terrorResetBoundary,\n\t\tthrowOnError: defaultedOptions.throwOnError,\n\t\tquery,\n\t\tsuspense: defaultedOptions.suspense\n\t})) throw result.error;\n\treturn !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport { useBaseQuery };\n\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nimport { QueryObserver } from \"@tanstack/query-core\";\n// src/useQuery.ts\nfunction useQuery(options, queryClient) {\n\treturn useBaseQuery(options, QueryObserver, queryClient);\n}\nexport { useQuery };\n\n//# sourceMappingURL=useQuery.js.map","import type {\n DefaultError,\n QueryClient,\n QueryKey,\n UseQueryOptions,\n UseQueryResult,\n} from '@tanstack/react-query';\nimport { useQuery } from '@tanstack/react-query';\nimport { useMemo } from 'react';\n\n\nexport const useQueryMemo = <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<NoInfer<TData>, TError> => {\n const query = useQuery(options, queryClient);\n\n return useMemo(() => {\n return query;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n query.data,\n query.dataUpdatedAt,\n query.error,\n query.errorUpdatedAt,\n query.failureCount,\n query.failureReason,\n query.fetchStatus,\n query.isEnabled,\n query.isError,\n query.isFetched,\n query.isFetchedAfterMount,\n query.isFetching,\n query.isLoading,\n query.isLoadingError,\n query.isPaused,\n query.isPending,\n query.isPlaceholderData,\n query.isRefetchError,\n query.isRefetching,\n query.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AAahG,GAASD,GAAemG,CAAW;AACxD;;ACKA,IAAaM,KAA4H,GAAkE,MAAsE;CAC/Q,IAAMnF,IAAQkF,EAASvG,GAASkG,CAAW;CAE3C,OAAOO,QACEpF,GAEN;EACDA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;CACR,CAAC;AACH"}
1
+ {"version":3,"file":"useQueryMemo.js","names":["React","React","React","useQueryClient","timeUntilStale","shallowEqualObjects","Subscribable","noop","isServer","fetchState","notifyManager","isValidTimeout","focusManager","replaceData","timeoutManager","shouldThrowError","resolveQueryValue","React$1","QueryObserver","options","#client","client","#selectError","#currentQuery","shouldFetchOnMount","#executeFetch","#updateTimers","shouldFetchOn","#clearStaleTimeout","#clearRefetchInterval","prevOptions","prevQuery","#updateQuery","mounted","shouldFetchOptionally","#updateStaleTimeout","nextRefetchInterval","#computeRefetchInterval","#currentRefetchInterval","#updateRefetchInterval","query","result","#currentResult","#currentResultOptions","#currentResultState","key","onPropTracked","target","#trackedProps","defaultedOptions","unsubscribe","resolveEarly","cachePromise","resolve","event","fetchOptions","promise","timeout","staleTime","#shouldScheduleTimer","#staleTimeoutId","nextInterval","#refetchIntervalId","prevResult","prevResultState","prevResultOptions","queryInitialState","#currentQueryInitialState","newState","state","isPlaceholderData","data","fetchOnMount","fetchOptionally","skipSelect","status","placeholderData","#lastQueryWithDefinedData","#selectFn","#selectResult","selectError","error","isFetching","isPending","isError","isLoading","hasData","isStale","nextResult","notifyListeners","notifyOnChangePropsValue","notifyOnChangeProps","shouldLoadOnMount","value","field","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","ensurePreventErrorBoundaryRetry","throwOnError","errorResetBoundary","useClearResetErrorBoundary","getHasError","suspense","ensureSuspenseTimers","MIN_SUSPENSE_TIME_MS","clamp","originalStaleTime","args","shouldSuspend","fetchOptimistic","observer","useBaseQuery","isRestoring","queryClient","subscribed","Observer","shouldSubscribe","onStoreChange","useQuery","useQueryMemo","useMemo"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/suspense.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.107.2_@types+react@19.3.0_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js","../../src/hooks/useQueryMemo/useQueryMemo.ts"],"sourcesContent":["import { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout, noop, replaceData, resolveQueryValue, shallowEqualObjects, timeUntilStale } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\n// src/queryObserver.ts\n/**\n* A `QueryObserver` watches a single query in the `QueryCache` and computes a\n* `QueryObserverResult` from its state, recomputing and notifying subscribers\n* whenever the underlying query (or the observer's options) changes. It is\n* the primitive that framework adapters (e.g. `useQuery`) build their hooks\n* on top of, but it can also be used directly to observe and switch between\n* queries outside of any framework.\n* @example\n* ```ts\n* const observer = new QueryObserver(queryClient, {\n* queryKey: ['posts'],\n* queryFn: fetchPosts,\n* })\n*\n* const unsubscribe = observer.subscribe((result) => {\n* console.log(result.data)\n* })\n* ```\n*/\nvar QueryObserver = class extends Subscribable {\n\t#client;\n\t#currentQuery = void 0;\n\t#currentQueryInitialState = void 0;\n\t#currentResult = void 0;\n\t#currentResultState;\n\t#currentResultOptions;\n\t#selectError;\n\t#selectFn;\n\t#selectResult;\n\t#lastQueryWithDefinedData;\n\t#staleTimeoutId;\n\t#refetchIntervalId;\n\t#currentRefetchInterval;\n\t#trackedProps = /* @__PURE__ */ new Set();\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.#client = client;\n\t\tthis.#selectError = null;\n\t\tthis.bindMethods();\n\t\tthis.setOptions(options);\n\t}\n\t/**\n\t* Binds the methods of the result (`refetch`) to the observer, so they keep working when destructured\n\t* from it. Subclasses override it to bind their own result methods as well.\n\t*/\n\tbindMethods() {\n\t\tthis.refetch = this.refetch.bind(this);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1) {\n\t\t\tthis.#currentQuery.addObserver(this);\n\t\t\tif (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();\n\t\t\telse this.updateResult();\n\t\t\tthis.#updateTimers();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.destroy();\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnReconnect` option) to refetch when the network\n\t* reconnects.\n\t* @returns `true` if the observer should refetch the query on reconnect.\n\t*/\n\tshouldFetchOnReconnect() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnWindowFocus` option) to refetch when the window\n\t* regains focus.\n\t* @returns `true` if the observer should refetch the query on window focus.\n\t*/\n\tshouldFetchOnWindowFocus() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);\n\t}\n\t/**\n\t* Stops observing the current query: clears all listeners, cancels the\n\t* stale and refetch-interval timers, and removes this observer from the\n\t* query it was observing.\n\t*/\n\tdestroy() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.#clearStaleTimeout();\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentQuery.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's options. This will re-resolve the query being\n\t* observed (switching to a different query if the `queryKey` changed),\n\t* trigger a fetch if the new options require one and the observer has\n\t* subscribers, recompute the current result, and reschedule the stale and\n\t* refetch-interval timers as needed.\n\t* @param options - The new observer options. They are defaulted with {@link\n\t* QueryClient#defaultQueryOptions} before being applied.\n\t* @throws {Error} If `enabled` is neither a boolean nor a function.\n\t* @example\n\t* ```ts\n\t* observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) })\n\t* // later: switch to a different query, reusing the same observer\n\t* observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.options = this.#client.defaultQueryOptions(options);\n\t\tif (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveQueryValue(this.options.enabled, this.#currentQuery) !== \"boolean\") throw new Error(\"Expected enabled to be a boolean or a callback that returns a boolean\");\n\t\tthis.#updateQuery();\n\t\tthis.#currentQuery.setOptions(this.options);\n\t\tif (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tquery: this.#currentQuery,\n\t\t\tobserver: this\n\t\t});\n\t\tconst mounted = this.hasListeners();\n\t\tif (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();\n\t\tthis.updateResult();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || resolveQueryValue(this.options.staleTime, this.#currentQuery) !== resolveQueryValue(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();\n\t\tconst nextRefetchInterval = this.#computeRefetchInterval();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);\n\t}\n\t/**\n\t* Computes the result the observer would produce for the given (already-defaulted) options\n\t* right now, building the underlying `Query` if it doesn't exist yet, without waiting for a\n\t* subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the\n\t* returned value is available synchronously, ahead of `setOptions` triggering an actual fetch.\n\t* @param options - The defaulted observer options to compute the result for.\n\t* @returns The result for the given options.\n\t*/\n\tgetOptimisticResult(options) {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, options);\n\t\tconst result = this.createResult(query, options);\n\t\tif (!shallowEqualObjects(this.getCurrentResult(), result)) {\n\t\t\tthis.#currentResult = result;\n\t\t\tthis.#currentResultOptions = this.options;\n\t\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Returns the most recently computed `QueryObserverResult` for the\n\t* observed query. This is a point-in-time read; to be notified of updates\n\t* as they happen, subscribe to the observer instead (its inherited\n\t* `subscribe` method).\n\t* @returns The observer's latest result.\n\t* @example\n\t* ```ts\n\t* const result = observer.getCurrentResult()\n\t* console.log(result.status, result.data)\n\t* ```\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via\n\t* {@link QueryObserver#trackProp} (and an optional `onPropTracked` callback). Used by framework\n\t* adapters when `notifyOnChangeProps` is not set, to implement its default \"only re-render on\n\t* properties you actually read\" behavior.\n\t* @param result - The result to wrap.\n\t* @param onPropTracked - Called with the name of each property that is read.\n\t* @returns A proxy of `result` that tracks property reads.\n\t*/\n\ttrackResult(result, onPropTracked) {\n\t\treturn new Proxy(result, { get: (target, key) => {\n\t\t\tthis.trackProp(key);\n\t\t\tonPropTracked?.(key);\n\t\t\treturn Reflect.get(target, key);\n\t\t} });\n\t}\n\t/**\n\t* Records that the given `QueryObserverResult` property was read, so a subsequent update only\n\t* notifies this observer if a tracked property actually changed. Normally called indirectly via\n\t* {@link QueryObserver#trackResult}'s proxy; exposed directly for adapters that track property\n\t* access themselves (e.g. through their own reactivity system) instead of via the proxy.\n\t* @param key - The name of the property that was read.\n\t*/\n\ttrackProp(key) {\n\t\tthis.#trackedProps.add(key);\n\t}\n\t/**\n\t* Returns the `Query` instance this observer is currently observing.\n\t* @returns The observed query.\n\t*/\n\tgetCurrentQuery() {\n\t\treturn this.#currentQuery;\n\t}\n\t/**\n\t* Refetches the observed query and returns a promise that resolves with\n\t* the resulting `QueryObserverResult`.\n\t* @param options - Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling\n\t* it, and `throwOnError` to `true` to reject when the refetch fails.\n\t* @returns A promise that resolves with the result after the refetch.\n\t* @example\n\t* ```ts\n\t* const result = await observer.refetch({ cancelRefetch: false })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\trefetch({ ...options } = {}) {\n\t\treturn this.fetch({ ...options });\n\t}\n\t/**\n\t* Fetches a query defined by the given options without affecting this\n\t* observer's own tracked query or result, and returns a promise that\n\t* resolves with the `QueryObserverResult` for that fetch. This is useful\n\t* for prefetching data that another observer (e.g. a query about to be\n\t* navigated to) will need, ahead of time.\n\t* @param options - The observer options of the query to fetch.\n\t* @returns A promise that resolves with the result for the fetched query.\n\t* @example\n\t* ```ts\n\t* const result = await observer.fetchOptimistic({\n\t* queryKey: ['posts', 2],\n\t* queryFn: () => fetchPost(2),\n\t* })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\tfetchOptimistic(options) {\n\t\tconst defaultedOptions = this.#client.defaultQueryOptions(options);\n\t\tconst query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n\t\tlet unsubscribe = () => {};\n\t\tlet resolveEarly;\n\t\tconst cachePromise = new Promise((resolve) => {\n\t\t\tresolveEarly = resolve;\n\t\t\tunsubscribe = this.#client.getQueryCache().subscribe((event) => {\n\t\t\t\tif (event.type === \"updated\" && event.query.queryHash === query.queryHash && query.state.data !== void 0) {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve(this.createResult(query, defaultedOptions));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn Promise.race([query.fetch(defaultedOptions).then(() => {\n\t\t\tconst result = this.createResult(query, defaultedOptions);\n\t\t\tresolveEarly?.(result);\n\t\t\treturn result;\n\t\t}).finally(() => {\n\t\t\tunsubscribe();\n\t\t}), cachePromise]);\n\t}\n\t/**\n\t* Fetches the observed query and updates the result once the fetch settles. Used by `refetch` and,\n\t* in `InfiniteQueryObserver`, to fetch more pages.\n\t* @param fetchOptions - Options for this fetch. `cancelRefetch` defaults to `true`.\n\t* @returns A promise that resolves with the updated result.\n\t*/\n\tfetch(fetchOptions) {\n\t\treturn this.#executeFetch({\n\t\t\t...fetchOptions,\n\t\t\tcancelRefetch: fetchOptions.cancelRefetch ?? true\n\t\t}).then(() => {\n\t\t\tthis.updateResult();\n\t\t\treturn this.#currentResult;\n\t\t});\n\t}\n\t#executeFetch(fetchOptions) {\n\t\tthis.#updateQuery();\n\t\tlet promise = this.#currentQuery.fetch(this.options, fetchOptions);\n\t\tif (!fetchOptions?.throwOnError) promise = promise.catch(noop);\n\t\treturn promise;\n\t}\n\t#shouldScheduleTimer(timeout) {\n\t\treturn !isServer() && resolveQueryValue(this.options.enabled, this.#currentQuery) !== false && isValidTimeout(timeout);\n\t}\n\t#updateStaleTimeout() {\n\t\tthis.#clearStaleTimeout();\n\t\tconst staleTime = resolveQueryValue(this.options.staleTime, this.#currentQuery);\n\t\tif (this.#currentResult.isStale || !this.#shouldScheduleTimer(staleTime)) return;\n\t\tconst timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;\n\t\tthis.#staleTimeoutId = timeoutManager.setTimeout(() => {\n\t\t\tif (!this.#currentResult.isStale) this.updateResult();\n\t\t}, timeout);\n\t}\n\t#computeRefetchInterval() {\n\t\treturn resolveQueryValue(this.options.refetchInterval, this.#currentQuery) ?? false;\n\t}\n\t#updateRefetchInterval(nextInterval) {\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentRefetchInterval = nextInterval;\n\t\tif (this.#currentRefetchInterval === 0 || !this.#shouldScheduleTimer(this.#currentRefetchInterval)) return;\n\t\tthis.#refetchIntervalId = timeoutManager.setInterval(() => {\n\t\t\tif (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();\n\t\t}, this.#currentRefetchInterval);\n\t}\n\t#updateTimers() {\n\t\tthis.#updateStaleTimeout();\n\t\tthis.#updateRefetchInterval(this.#computeRefetchInterval());\n\t}\n\t#clearStaleTimeout() {\n\t\tif (this.#staleTimeoutId !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#staleTimeoutId);\n\t\t\tthis.#staleTimeoutId = void 0;\n\t\t}\n\t}\n\t#clearRefetchInterval() {\n\t\tif (this.#refetchIntervalId !== void 0) {\n\t\t\ttimeoutManager.clearInterval(this.#refetchIntervalId);\n\t\t\tthis.#refetchIntervalId = void 0;\n\t\t}\n\t}\n\t/**\n\t* Computes the result for a query and options from the query's state, applying `select`,\n\t* `placeholderData`, and the derived flags. Subclasses override it to add their own fields.\n\t* @param query - The query to compute the result for.\n\t* @param options - The observer options to compute the result with.\n\t* @returns The computed result.\n\t*/\n\tcreateResult(query, options) {\n\t\tconst prevQuery = this.#currentQuery;\n\t\tconst prevOptions = this.options;\n\t\tconst prevResult = this.#currentResult;\n\t\tconst prevResultState = this.#currentResultState;\n\t\tconst prevResultOptions = this.#currentResultOptions;\n\t\tconst queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;\n\t\tconst { state } = query;\n\t\tlet newState = { ...state };\n\t\tlet isPlaceholderData = false;\n\t\tlet data;\n\t\tif (options._optimisticResults) {\n\t\t\tconst mounted = this.hasListeners();\n\t\t\tconst fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n\t\t\tconst fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\t\t\tif (fetchOnMount || fetchOptionally) newState = {\n\t\t\t\t...newState,\n\t\t\t\t...fetchState(state.data, query.options)\n\t\t\t};\n\t\t\tif (options._optimisticResults === \"isRestoring\") newState.fetchStatus = \"idle\";\n\t\t}\n\t\tlet { error, errorUpdatedAt, status } = newState;\n\t\tdata = newState.data;\n\t\tlet skipSelect = false;\n\t\tif (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n\t\t\tlet placeholderData;\n\t\t\tif (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n\t\t\t\tplaceholderData = prevResult.data;\n\t\t\t\tskipSelect = true;\n\t\t\t} else placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;\n\t\t\tif (placeholderData !== void 0) {\n\t\t\t\tstatus = \"success\";\n\t\t\t\tdata = replaceData(prevResult?.data, placeholderData, options);\n\t\t\t\tisPlaceholderData = true;\n\t\t\t}\n\t\t}\n\t\tif (options.select && data !== void 0 && !skipSelect) {\n\t\t\tif (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;\n\t\t\telse try {\n\t\t\t\tthis.#selectFn = options.select;\n\t\t\t\tdata = options.select(data);\n\t\t\t\tdata = replaceData(prevResult?.data, data, options);\n\t\t\t\tthis.#selectResult = data;\n\t\t\t\tthis.#selectError = null;\n\t\t\t} catch (selectError) {\n\t\t\t\tthis.#selectError = selectError;\n\t\t\t}\n\t\t} else if (data === void 0) this.#selectError = null;\n\t\tif (this.#selectError) {\n\t\t\terror = this.#selectError;\n\t\t\tdata = this.#selectResult;\n\t\t\terrorUpdatedAt = prevResult?.error === error ? prevResult.errorUpdatedAt : Date.now();\n\t\t\tstatus = \"error\";\n\t\t\tisPlaceholderData = false;\n\t\t}\n\t\tconst isFetching = newState.fetchStatus === \"fetching\";\n\t\tconst isPending = status === \"pending\";\n\t\tconst isError = status === \"error\";\n\t\tconst isLoading = isPending && isFetching;\n\t\tconst hasData = data !== void 0;\n\t\treturn {\n\t\t\tstatus,\n\t\t\tfetchStatus: newState.fetchStatus,\n\t\t\tisPending,\n\t\t\tisSuccess: status === \"success\",\n\t\t\tisError,\n\t\t\tisInitialLoading: isLoading,\n\t\t\tisLoading,\n\t\t\tdata,\n\t\t\tdataUpdatedAt: newState.dataUpdatedAt,\n\t\t\terror,\n\t\t\terrorUpdatedAt,\n\t\t\tfailureCount: newState.fetchFailureCount,\n\t\t\tfailureReason: newState.fetchFailureReason,\n\t\t\terrorUpdateCount: newState.errorUpdateCount,\n\t\t\tisFetched: query.isFetched(),\n\t\t\tisFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n\t\t\tisFetching,\n\t\t\tisRefetching: isFetching && !isPending,\n\t\t\tisLoadingError: isError && !hasData,\n\t\t\tisPaused: newState.fetchStatus === \"paused\",\n\t\t\tisPlaceholderData,\n\t\t\tisRefetchError: isError && hasData,\n\t\t\tisStale: isStale(query, options),\n\t\t\trefetch: this.refetch,\n\t\t\tisEnabled: resolveQueryValue(options.enabled, query) !== false\n\t\t};\n\t}\n\t/**\n\t* Recomputes and stores the current result from the current query/options, notifying listeners\n\t* if it changed. Framework adapters call this right after subscribing to make sure no query\n\t* update was missed in the gap between creating the observer and subscribing to it.\n\t*/\n\tupdateResult() {\n\t\tconst prevResult = this.#currentResult;\n\t\tconst nextResult = this.createResult(this.#currentQuery, this.options);\n\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\tthis.#currentResultOptions = this.options;\n\t\tif (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;\n\t\tif (shallowEqualObjects(nextResult, prevResult)) return;\n\t\tthis.#currentResult = nextResult;\n\t\tconst shouldNotifyListeners = () => {\n\t\t\tif (!prevResult) return true;\n\t\t\tconst { notifyOnChangeProps } = this.options;\n\t\t\tconst notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n\t\t\tif (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;\n\t\t\tif (this.options.throwOnError && this.#currentResult.error !== prevResult.error) return true;\n\t\t\tfor (const key of notifyOnChangePropsValue ?? this.#trackedProps) if (this.#currentResult[key] !== prevResult[key]) return true;\n\t\t\treturn false;\n\t\t};\n\t\tconst notifyListeners = shouldNotifyListeners();\n\t\tnotifyManager.batch(() => {\n\t\t\tif (notifyListeners) this.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t\tthis.#client.getQueryCache().notify({\n\t\t\t\tquery: this.#currentQuery,\n\t\t\t\ttype: \"observerResultsUpdated\"\n\t\t\t});\n\t\t});\n\t}\n\t#updateQuery() {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, this.options);\n\t\tif (query === this.#currentQuery) return;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.#currentQuery = query;\n\t\tthis.#currentQueryInitialState = query.state;\n\t\tif (this.hasListeners()) {\n\t\t\tprevQuery?.removeObserver(this);\n\t\t\tquery.addObserver(this);\n\t\t}\n\t}\n\t/**\n\t* Updates the observer's result when the observed query changes, and reschedules its timers if it\n\t* has listeners.\n\t* @internal\n\t*/\n\tonQueryUpdate() {\n\t\tthis.updateResult();\n\t\tif (this.hasListeners()) this.#updateTimers();\n\t}\n};\n/**\n* Checks whether a query has no data yet and should do its initial load when an observer mounts.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query is enabled, has no data, and isn't in an error state with\n* `retryOnMount: false`.\n*/\nfunction shouldLoadOnMount(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && resolveQueryValue(options.retryOnMount, query) === false);\n}\n/**\n* Checks whether a query should fetch when an observer mounts: either for its initial load, or\n* because it has data and `refetchOnMount` asks for a refetch.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query should fetch on mount.\n*/\nfunction shouldFetchOnMount(query, options) {\n\treturn shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n/**\n* Checks whether a query should fetch for a `refetchOnMount`, `refetchOnWindowFocus`, or\n* `refetchOnReconnect` option.\n* @param query - The query to check.\n* @param options - The observer options.\n* @param field - The value of the option to check.\n* @returns `true` if the query is enabled, not static, and the option is `'always'`, or is not\n* `false` and the query is stale.\n*/\nfunction shouldFetchOn(query, options, field) {\n\tif (resolveQueryValue(options.enabled, query) !== false && resolveQueryValue(options.staleTime, query) !== \"static\") {\n\t\tconst value = resolveQueryValue(field, query);\n\t\treturn value === \"always\" || value !== false && isStale(query, options);\n\t}\n\treturn false;\n}\n/**\n* Checks whether a query should fetch after the observer's options change.\n* @param query - The query observed with the new options.\n* @param prevQuery - The query observed with the previous options.\n* @param options - The new observer options.\n* @param prevOptions - The previous observer options.\n* @returns `true` if the query changed or was disabled before, it isn't a suspense query in an\n* error state, and it is stale.\n*/\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n\treturn (query !== prevQuery || resolveQueryValue(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\n/**\n* Checks whether a query is stale for the given observer options.\n* @param query - The query to check.\n* @param options - The observer options, whose `enabled` and `staleTime` are used.\n* @returns `true` if the query is enabled and its data is stale for `staleTime`.\n*/\nfunction isStale(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.isStaleByTime(resolveQueryValue(options.staleTime, query));\n}\nexport { QueryObserver };\n\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\nimport * as React from \"react\";\n// src/IsRestoringProvider.ts\nconst IsRestoringContext = React.createContext(false);\n/**\n* If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to\n* check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid\n* race conditions between the restore and mounting queries.\n* @returns `true` while a persisted client is being restored, `false` otherwise.\n*/\nconst useIsRestoring = () => React.useContext(IsRestoringContext);\n/**\n* The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently\n* being restored, read by `useIsRestoring`.\n*/\nconst IsRestoringProvider = IsRestoringContext.Provider;\nexport { IsRestoringProvider, useIsRestoring };\n\n//# sourceMappingURL=IsRestoringProvider.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// src/QueryErrorResetBoundary.tsx\n/**\n* Creates the value shared through the boundary's context, which tracks whether a reset was\n* requested.\n* @returns The `clearReset`, `isReset`, and `reset` functions of the boundary.\n*/\nfunction createValue() {\n\tlet isReset = false;\n\treturn {\n\t\t/**\n\t\t* Clears the reset state, so queries know not to try again until the boundary is reset again.\n\t\t*/\n\t\tclearReset: () => {\n\t\t\tisReset = false;\n\t\t},\n\t\t/**\n\t\t* Resets any query errors within the boundary, so queries know they can try again.\n\t\t*/\n\t\treset: () => {\n\t\t\tisReset = true;\n\t\t},\n\t\t/**\n\t\t* Returns whether the boundary has been reset and not yet cleared.\n\t\t* @returns `true` if the boundary has been reset and not yet cleared.\n\t\t*/\n\t\tisReset: () => {\n\t\t\treturn isReset;\n\t\t}\n\t};\n}\nconst QueryErrorResetBoundaryContext = React.createContext(createValue());\n/**\n* This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary\n* defined it will reset them globally.\n* @returns The boundary's {@link QueryErrorResetBoundaryValue}.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { useQueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App({ children }: { children: React.ReactNode }) {\n* const { reset } = useQueryErrorResetBoundary()\n*\n* return (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* {children}\n* </ErrorBoundary>\n* )\n* }\n* ```\n*/\nconst useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\n/**\n* When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to\n* try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can\n* reset any query errors within the boundaries of the component.\n* @param props - The `children` to render.\n* @returns The `children`, rendered as-is, or called with the boundary's {@link QueryErrorResetBoundaryValue}\n* if `children` is a function.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { QueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App() {\n* return (\n* <QueryErrorResetBoundary>\n* {({ reset }) => (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* <Page />\n* </ErrorBoundary>\n* )}\n* </QueryErrorResetBoundary>\n* )\n* }\n* ```\n*/\nconst QueryErrorResetBoundary = ({ children }) => {\n\tconst [value] = React.useState(() => createValue());\n\treturn /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, {\n\t\tvalue,\n\t\tchildren: typeof children === \"function\" ? children(value) : children\n\t});\n};\nexport { QueryErrorResetBoundary, useQueryErrorResetBoundary };\n\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","\"use client\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\nimport * as React from \"react\";\n// src/errorBoundaryUtils.ts\n/**\n* Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n* unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n* user resets the boundary. Mutates the options.\n* @param options - The defaulted query options to adjust.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @param query - The query, used to evaluate a `throwOnError` function against its error.\n*/\nconst ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n\tconst throwOnError = query?.state.status === \"error\" && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n\tif (options.suspense || throwOnError) {\n\t\tif (!errorResetBoundary.isReset()) options.retryOnMount = false;\n\t}\n};\n/**\n* Clears the reset state of the error boundary after the component mounts, so later errors are\n* thrown to the boundary again.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n*/\nconst useClearResetErrorBoundary = (errorResetBoundary) => {\n\tReact.useEffect(() => {\n\t\terrorResetBoundary.clearReset();\n\t}, [errorResetBoundary]);\n};\n/**\n* Checks whether the query error should be thrown to the nearest error boundary: the query errored\n* and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n* or `throwOnError` says so.\n* @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n* `query`, and the `suspense` option.\n* @returns `true` if the error should be thrown.\n*/\nconst getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {\n\treturn result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };\n\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\n/**\n* The default `throwOnError` of the suspense hooks: throws the error to the nearest error boundary\n* only if the query has no data to show.\n* @param _error - The error of the query. Unused.\n* @param query - The query that errored.\n* @returns `true` if the query has no data.\n*/\nconst defaultThrowOnError = (_error, query) => query.state.data === void 0;\n/**\n* Raises `staleTime` and a numeric `gcTime` to at least 1000ms when `suspense` is enabled, so a\n* component that remounts after suspending doesn't refetch right away or find the query garbage\n* collected. A `'static'` `staleTime` is kept as is. Mutates the options.\n* @param defaultedOptions - The defaulted query options to adjust.\n*/\nconst ensureSuspenseTimers = (defaultedOptions) => {\n\tif (defaultedOptions.suspense) {\n\t\tconst MIN_SUSPENSE_TIME_MS = 1e3;\n\t\tconst clamp = (value) => value === \"static\" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);\n\t\tconst originalStaleTime = defaultedOptions.staleTime;\n\t\tdefaultedOptions.staleTime = typeof originalStaleTime === \"function\" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);\n\t\tif (typeof defaultedOptions.gcTime === \"number\") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);\n\t}\n};\n/**\n* Checks whether a query should suspend: `suspense` is enabled and the result is still `pending`.\n* @param defaultedOptions - The defaulted query options, if any.\n* @param result - The current result of the observer.\n* @returns `true` if the component should suspend.\n*/\nconst shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\n/**\n* Fetches the query for a suspending component, without affecting the observer's own result. If\n* the fetch fails, the reset state of the error boundary is cleared, so the error is thrown to it.\n* @param defaultedOptions - The defaulted query options to fetch with.\n* @param observer - The observer of the query.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @returns A promise that resolves once the fetch settles. It never rejects.\n*/\nconst fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n\terrorResetBoundary.clearReset();\n});\nexport { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };\n\n//# sourceMappingURL=suspense.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary } from \"./errorBoundaryUtils.js\";\nimport { ensureSuspenseTimers, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nimport { noop, notifyManager } from \"@tanstack/query-core\";\nimport * as React from \"react\";\n// src/useBaseQuery.ts\n/**\n* Base implementation shared by `useQuery`, `useInfiniteQuery`, `useSuspenseQuery`, and\n* `useSuspenseInfiniteQuery`.\n* @param options - The options passed to the calling hook.\n* @param Observer - The observer class from query-core (`QueryObserver` or\n* `InfiniteQueryObserver`).\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest\n* context will be used.\n* @returns The query result, tracking which properties are read unless `notifyOnChangeProps` is\n* set.\n* @throws {Error} If `options` is not an object (outside production), or the query error when it should be\n* thrown to the nearest error boundary (see `throwOnError`). While suspending, it throws a promise instead.\n*/\nfunction useBaseQuery(options, Observer, queryClient) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) throw new Error(\"Bad argument type. Starting with v5, only the \\\"Object\\\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object\");\n\t}\n\tconst isRestoring = useIsRestoring();\n\tconst errorResetBoundary = useQueryErrorResetBoundary();\n\tconst client = useQueryClient(queryClient);\n\tconst defaultedOptions = client.defaultQueryOptions(options);\n\tconst query = client.getQueryCache().get(defaultedOptions.queryHash);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);\n\t}\n\tconst subscribed = options.subscribed !== false;\n\tdefaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : subscribed ? \"optimistic\" : void 0;\n\tensureSuspenseTimers(defaultedOptions);\n\tensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n\tuseClearResetErrorBoundary(errorResetBoundary);\n\tconst [observer] = React.useState(() => new Observer(client, defaultedOptions));\n\tconst result = observer.getOptimisticResult(defaultedOptions);\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(defaultedOptions);\n\t}, [defaultedOptions, observer]);\n\tconst shouldSubscribe = !isRestoring && subscribed;\n\tReact.useSyncExternalStore(React.useCallback((onStoreChange) => {\n\t\tconst unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n\t\tobserver.updateResult();\n\t\treturn unsubscribe;\n\t}, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tif (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n\tif (getHasError({\n\t\tresult,\n\t\terrorResetBoundary,\n\t\tthrowOnError: defaultedOptions.throwOnError,\n\t\tquery,\n\t\tsuspense: defaultedOptions.suspense\n\t})) throw result.error;\n\treturn !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport { useBaseQuery };\n\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nimport { QueryObserver } from \"@tanstack/query-core\";\n// src/useQuery.ts\nfunction useQuery(options, queryClient) {\n\treturn useBaseQuery(options, QueryObserver, queryClient);\n}\nexport { useQuery };\n\n//# sourceMappingURL=useQuery.js.map","import type {\n DefaultError,\n QueryClient,\n QueryKey,\n UseQueryOptions,\n UseQueryResult,\n} from '@tanstack/react-query';\nimport { useQuery } from '@tanstack/react-query';\nimport { useMemo } from 'react';\n\n\nexport const useQueryMemo = <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<NoInfer<TData>, TError> => {\n const query = useQuery(options, queryClient);\n\n return useMemo(() => {\n return query;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n query.data,\n query.dataUpdatedAt,\n query.error,\n query.errorUpdatedAt,\n query.failureCount,\n query.failureReason,\n query.fetchStatus,\n query.isEnabled,\n query.isError,\n query.isFetched,\n query.isFetchedAfterMount,\n query.isFetching,\n query.isLoading,\n query.isLoadingError,\n query.isPaused,\n query.isPending,\n query.isPlaceholderData,\n query.isRefetchError,\n query.isRefetching,\n query.isStale,\n query.isSuccess,\n query.refetch,\n query.status,\n ]);\n};\n"],"ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;AA2BA,IAAIkB,IAAgB,cAAcZ,EAAa;CAC9C;CACA,KAAgB,KAAK;CACrB,KAA4B,KAAK;CACjC,KAAiB,KAAK;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,qBAAgC,IAAI,IAAI;CACxC,YAAY,GAAQ,GAAS;EAM5B,AALA,MAAM,GACN,KAAK,UAAUa,GACf,KAAKC,KAAUC,GACf,KAAKC,KAAe,MACpB,KAAK,YAAY,GACjB,KAAK,WAAWH,CAAO;CACxB;CAKA,cAAc;EACb,KAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;CACtC;CACA,cAAc;EACb,AAAI,KAAK,UAAU,SAAS,MAC3B,KAAKI,GAAc,YAAY,IAAI,GAC/BC,EAAmB,KAAKD,IAAe,KAAK,OAAO,IAAG,KAAKE,GAAc,IACxE,KAAK,aAAa,GACvB,KAAKC,GAAc;CAErB;CACA,gBAAgB;EACf,AAAK,KAAK,aAAa,KAAG,KAAK,QAAQ;CACxC;CAOA,yBAAyB;EACxB,OAAOC,EAAc,KAAKJ,IAAe,KAAK,SAAS,KAAK,QAAQ,kBAAkB;CACvF;CAOA,2BAA2B;EAC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;EAEpG,OADA2G,EAAS,aAAa,GACfhE;CACR,GAAG,CAACgE,GAAUM,CAAe,CAAC,SAASN,EAAS,iBAAiB,SAASA,EAAS,iBAAiB,CAAC,GACjGF,EAAc/D,GAAkBR,CAAM,GAAG,MAAMwE,EAAgBhE,GAAkBiE,GAAUX,CAAkB;CACjH,IAAIE,EAAY;EACf;EACA;EACA,cAAcxD,EAAiB;EAC/B;EACA,UAAUA,EAAiB;CAC5B,CAAC,GAAG,MAAMR,EAAO;CACjB,OAAQQ,EAAiB,sBAAqDR,IAA/ByE,EAAS,YAAYzE,CAAM;AAC3E;;ACvDA,SAASiF,EAAS,GAAS,GAAa;CACvC,OAAOP,EAAahG,GAASD,GAAemG,CAAW;AACxD;;ACKA,IAAaM,KAA4H,GAAkE,MAAsE;CAC/Q,IAAMnF,IAAQkF,EAASvG,GAASkG,CAAW;CAE3C,OAAOO,QACEpF,GAEN;EACDA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;EACNA,EAAM;CACR,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
1
  import { appendErrors as e, get as t, set as n } from "react-hook-form";
2
- // ../../node_modules/.pnpm/@hookform+resolvers@7.0.6_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_49dd6b95b92efe675aca5cb0d3bcbd6a/node_modules/@hookform/resolvers/dist/resolvers.mjs
2
+ // ../../node_modules/.pnpm/@hookform+resolvers@7.0.7_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_633461ceca70bca6835133d2627ec508/node_modules/@hookform/resolvers/dist/resolvers.mjs
3
3
  var r = (e, n, r) => {
4
4
  if (e && "reportValidity" in e) {
5
5
  let i = t(r, n);
@@ -28,7 +28,7 @@ var r = (e, n, r) => {
28
28
  function s(e) {
29
29
  return e.replace(/\[(\d+)]/g, ".$1").replace(/[[\]]/g, "");
30
30
  }
31
- // ../../node_modules/.pnpm/@hookform+resolvers@7.0.6_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_49dd6b95b92efe675aca5cb0d3bcbd6a/node_modules/@hookform/resolvers/yup/dist/yup.mjs
31
+ // ../../node_modules/.pnpm/@hookform+resolvers@7.0.7_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_633461ceca70bca6835133d2627ec508/node_modules/@hookform/resolvers/yup/dist/yup.mjs
32
32
  function c(t, n, r) {
33
33
  return r === void 0 && (r = {}), function(o, s, c) {
34
34
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"yup.js","names":["e","o","r","s","e","t","r","t","r","o","get","s","o$1","n","f","i","set","a","u","s$1","e","appendErrors"],"sources":["../../../../node_modules/.pnpm/@hookform+resolvers@7.0.6_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_49dd6b95b92efe675aca5cb0d3bcbd6a/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../node_modules/.pnpm/@hookform+resolvers@7.0.6_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_49dd6b95b92efe675aca5cb0d3bcbd6a/node_modules/@hookform/resolvers/yup/dist/yup.mjs"],"sourcesContent":["import{get as e,set as r}from\"react-hook-form\";const t=(r,t,s)=>{if(r&&\"reportValidity\"in r){const o=e(s,t);r.setCustomValidity(o&&o.message||\"\"),r.reportValidity()}},s=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&\"reportValidity\"in o.ref?t(o.ref,s,e):o&&o.refs&&o.refs.forEach(r=>t(r,s,e))}},o=(t,o)=>{o.shouldUseNativeValidation&&s(t,o);const n={};for(const s in t){const f=e(o.fields,s),c=Object.assign(t[s]||{},{ref:f&&f.refs?f.refs[0]:f&&f.ref});if(i(o.names||Object.keys(t),s)){const t=Object.assign({},e(n,s));r(t,\"root\",c),r(n,s,t)}else r(n,s,c)}return n},i=(e,r)=>{const t=n(r).replace(/[.*+?^${}()|\\\\]/g,\"\\\\$&\");return e.some(e=>n(e).match(`^${t}\\\\.\\\\d+`))};function n(e){return e.replace(/\\[(\\d+)]/g,\".$1\").replace(/[[\\]]/g,\"\")}export{o as toNestErrors,s as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?Object.assign({},s):t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},Object.create(null))),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n"],"ignoreList":[0,1],"mappings":";;AAA+C,IAAMO,KAAG,GAAE,GAAE,MAAI;CAAC,IAAGC,KAAG,oBAAmBA,GAAE;EAAC,IAAMC,IAAET,EAAEW,GAAEJ,CAAC;EAAE,EAAE,kBAAkBE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OAAO,GAAEA,EAAE,OAAO,IAAEA,EAAE,OAAO;MAAC;MAAC,OAAOa;KAAC,GAAE,OAAO,OAAO,IAAI,CAAC,IAAG,CAAC;IAAC;QAAMX,GAAEI;GAAC,CAAC,CAAC;EAAC,SAAO,GAAE;GAAC,OAAO,QAAQ,OAAO,CAAC;EAAC;CAAC;AAAC"}
1
+ {"version":3,"file":"yup.js","names":["e","o","r","s","e","t","r","t","r","o","get","s","o$1","n","f","i","set","a","u","s$1","e","appendErrors"],"sources":["../../../../node_modules/.pnpm/@hookform+resolvers@7.0.7_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_633461ceca70bca6835133d2627ec508/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../node_modules/.pnpm/@hookform+resolvers@7.0.7_ajv-formats@3.0.1_ajv@8.20.0__ajv@8.20.0_react-hook-form@7.92_633461ceca70bca6835133d2627ec508/node_modules/@hookform/resolvers/yup/dist/yup.mjs"],"sourcesContent":["import{get as e,set as r}from\"react-hook-form\";const t=(r,t,s)=>{if(r&&\"reportValidity\"in r){const o=e(s,t);r.setCustomValidity(o&&o.message||\"\"),r.reportValidity()}},s=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&\"reportValidity\"in o.ref?t(o.ref,s,e):o&&o.refs&&o.refs.forEach(r=>t(r,s,e))}},o=(t,o)=>{o.shouldUseNativeValidation&&s(t,o);const n={};for(const s in t){const f=e(o.fields,s),c=Object.assign(t[s]||{},{ref:f&&f.refs?f.refs[0]:f&&f.ref});if(i(o.names||Object.keys(t),s)){const t=Object.assign({},e(n,s));r(t,\"root\",c),r(n,s,t)}else r(n,s,c)}return n},i=(e,r)=>{const t=n(r).replace(/[.*+?^${}()|\\\\]/g,\"\\\\$&\");return e.some(e=>n(e).match(`^${t}\\\\.\\\\d+`))};function n(e){return e.replace(/\\[(\\d+)]/g,\".$1\").replace(/[[\\]]/g,\"\")}export{o as toNestErrors,s as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?Object.assign({},s):t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},Object.create(null))),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n"],"ignoreList":[0,1],"mappings":";;AAA+C,IAAMO,KAAG,GAAE,GAAE,MAAI;CAAC,IAAGC,KAAG,oBAAmBA,GAAE;EAAC,IAAMC,IAAET,EAAEW,GAAEJ,CAAC;EAAE,EAAE,kBAAkBE,KAAGA,EAAE,WAAS,EAAE,GAAED,EAAE,eAAe;CAAC;AAAC,GAAEG,KAAG,GAAE,MAAI;CAAC,KAAI,IAAMA,KAAKH,EAAE,QAAO;EAAC,IAAMC,IAAED,EAAE,OAAOG;EAAG,KAAGF,EAAE,OAAK,oBAAmBA,EAAE,MAAIF,EAAEE,EAAE,KAAIE,GAAE,CAAC,IAAEF,KAAGA,EAAE,QAAMA,EAAE,KAAK,SAAQ,MAAGF,EAAEC,GAAEG,GAAE,CAAC,CAAC;CAAC;AAAC,GAAEV,KAAG,GAAE,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
@@ -16,12 +17,22 @@ export declare abstract class FilterAbstract<TFilterValue> {
16
17
  filterPriority: string;
17
18
  filterValue: TFilterValue;
18
19
  id: string;
20
+ includeMissingValues: boolean;
19
21
  initialFilterValue: TFilterValue;
20
22
  label: string;
21
23
  showInSidebar: boolean;
24
+ supportsMissingValuesFilter: boolean;
25
+ get includeMissingValuesFormFieldName(): string;
22
26
  constructor(kwArgs: FilterAbstractKwArgs);
27
+ static isMissingValue(value: unknown): boolean;
28
+ private static isFilterURLSearchParameterState;
23
29
  fromURLSearchParameterValue(searchParameterValue: string): TFilterValue;
30
+ isFilterActive(value?: unknown, includeMissingValues?: boolean): boolean;
24
31
  isInitialFilterValue(value?: unknown): boolean;
32
+ matchRowValueIncludingMissingValues(rowValue: unknown, matchRowValue: (value: unknown) => boolean): boolean;
25
33
  setFilterValue(value: unknown): void;
34
+ setIncludeMissingValues(includeMissingValues: boolean): void;
35
+ toBackendFilterWithMissingValues(valueFilter?: CommonDbFiltersInner): CommonDbFiltersInner | undefined;
26
36
  toURLSearchParameterValue(): string;
37
+ protected parseFilterValueFromURLSearchParameterValue(searchParameterValue: string): unknown;
27
38
  }
@@ -1,36 +1,81 @@
1
1
  // src/classes/abstracts/FilterAbstract/FilterAbstract.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.BACKEND = "BACKEND", e.FRONTEND = "FRONTEND", e;
4
- }({}), t = "DEFAULT", n = class {
4
+ }({}), t = "DEFAULT", n = class e {
5
5
  filterDimensionId;
6
6
  filterMode;
7
7
  filterPriority;
8
8
  filterValue;
9
9
  id;
10
+ includeMissingValues = !1;
10
11
  initialFilterValue;
11
12
  label;
12
13
  showInSidebar = !0;
14
+ supportsMissingValuesFilter = !1;
15
+ get includeMissingValuesFormFieldName() {
16
+ return `__includeMissingValues_${encodeURIComponent(this.id).replace(/\./g, "%2E")}`;
17
+ }
13
18
  constructor(e) {
14
19
  this.id = e.id, this.label = e.label, this.filterMode = e.filterMode, this.filterPriority = e.filterPriority, this.filterDimensionId = e.filterDimensionId ?? null;
15
20
  }
21
+ static isMissingValue(e) {
22
+ return e == null || e === "" || Array.isArray(e) && e.length === 0;
23
+ }
24
+ static isFilterURLSearchParameterState(e) {
25
+ return typeof e == "object" && !!e && !Array.isArray(e) && "genEpixFilterState" in e && e.genEpixFilterState === 1 && "genEpixFilterValue" in e && "includeMissingValues" in e && e.includeMissingValues === !0;
26
+ }
16
27
  fromURLSearchParameterValue(e) {
17
28
  try {
18
- return JSON.parse(e);
29
+ return this.parseFilterValueFromURLSearchParameterValue(e);
19
30
  } catch (e) {
20
31
  return console.error("Error parsing search parameter value:", e), null;
21
32
  }
22
33
  }
34
+ isFilterActive(e, t = this.includeMissingValues) {
35
+ return t || !this.isInitialFilterValue(e);
36
+ }
23
37
  isInitialFilterValue(e) {
24
38
  let t = e === void 0 ? this.filterValue : e;
25
39
  return JSON.stringify(t) === JSON.stringify(this.initialFilterValue);
26
40
  }
41
+ matchRowValueIncludingMissingValues(t, n) {
42
+ return this.includeMissingValues ? this.isInitialFilterValue() ? e.isMissingValue(t) : e.isMissingValue(t) ? !0 : n(t) : n(t);
43
+ }
27
44
  setFilterValue(e) {
28
45
  this.filterValue = e;
29
46
  }
47
+ setIncludeMissingValues(e) {
48
+ this.includeMissingValues = e;
49
+ }
50
+ toBackendFilterWithMissingValues(e) {
51
+ if (!this.includeMissingValues) return e;
52
+ let t = {
53
+ invert: !0,
54
+ key: this.id,
55
+ type: "EXISTS"
56
+ };
57
+ return e ? {
58
+ filters: [e, t],
59
+ operator: "OR",
60
+ type: "COMPOSITE"
61
+ } : t;
62
+ }
30
63
  toURLSearchParameterValue() {
31
64
  let e = JSON.stringify(this.filterValue);
32
65
  if (e === void 0) throw TypeError("Filter value cannot be serialized as JSON.");
33
- return e;
66
+ if (!this.includeMissingValues) return e;
67
+ let t = JSON.stringify({
68
+ genEpixFilterState: 1,
69
+ genEpixFilterValue: this.filterValue,
70
+ includeMissingValues: !0
71
+ });
72
+ if (t === void 0) throw TypeError("Filter value cannot be serialized as JSON.");
73
+ return t;
74
+ }
75
+ parseFilterValueFromURLSearchParameterValue(t) {
76
+ this.includeMissingValues = !1;
77
+ let n = JSON.parse(t);
78
+ return e.isFilterURLSearchParameterState(n) ? (this.includeMissingValues = n.includeMissingValues, n.genEpixFilterValue) : n;
34
79
  }
35
80
  };
36
81
  export { t as DEFAULT_FILTER_GROUP, e as FILTER_MODE, n as FilterAbstract };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FILTER_MODE","\"BACKEND\"","\"FRONTEND\"","DEFAULT_FILTER_GROUP","FilterAbstract","kwArgs","searchParameterValue","error","usedValue","value"],"sources":["../../../../src/classes/abstracts/FilterAbstract/FilterAbstract.ts"],"sourcesContent":["export enum FILTER_MODE {\n BACKEND = 'BACKEND',\n FRONTEND = 'FRONTEND',\n}\n\nexport const DEFAULT_FILTER_GROUP = 'DEFAULT';\n\nexport interface FilterAbstractKwArgs {\n filterDimensionId?: string;\n filterMode: FILTER_MODE;\n filterPriority: string;\n id: string;\n label: string;\n}\n\nexport abstract class FilterAbstract<TFilterValue> {\n public filterDimensionId: string;\n public filterMode: FILTER_MODE;\n public filterPriority: string;\n public filterValue: TFilterValue;\n public id: string;\n public initialFilterValue: TFilterValue;\n public label: string;\n public showInSidebar: boolean = true;\n\n public constructor(kwArgs: FilterAbstractKwArgs) {\n this.id = kwArgs.id;\n this.label = kwArgs.label;\n this.filterMode = kwArgs.filterMode;\n this.filterPriority = kwArgs.filterPriority;\n this.filterDimensionId = kwArgs.filterDimensionId ?? null;\n }\n\n public fromURLSearchParameterValue(searchParameterValue: string): TFilterValue {\n try {\n return JSON.parse(searchParameterValue) as TFilterValue;\n } catch (error) {\n console.error('Error parsing search parameter value:', error);\n return null;\n }\n }\n\n public isInitialFilterValue(value?: unknown): boolean {\n const usedValue = value !== undefined ? value : this.filterValue;\n return JSON.stringify(usedValue) === JSON.stringify(this.initialFilterValue);\n }\n\n public setFilterValue(value: unknown): void {\n this.filterValue = value as TFilterValue;\n }\n\n public toURLSearchParameterValue(): string {\n const searchParameterValue = JSON.stringify(this.filterValue);\n if (searchParameterValue === undefined) {\n throw new TypeError('Filter value cannot be serialized as JSON.');\n }\n return searchParameterValue;\n }\n}\n"],"mappings":";AAAA,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,UAAA,WACA,EAAAC,WAAA,Y;AACF,EAAA,CAAA,CAAA,GAEaC,IAAuB,WAUdC,IAAtB,MAAmD;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA,gBAAgC;CAEhC,YAAmB,GAA8B;EAK/C,AAJA,KAAK,KAAKC,EAAO,IACjB,KAAK,QAAQA,EAAO,OACpB,KAAK,aAAaA,EAAO,YACzB,KAAK,iBAAiBA,EAAO,gBAC7B,KAAK,oBAAoBA,EAAO,qBAAqB;CACvD;CAEA,4BAAmC,GAA4C;EAC7E,IAAI;GACF,OAAO,KAAK,MAAMC,CAAoB;EACxC,SAASC,GAAO;GAEd,OADA,QAAQ,MAAM,yCAAyCA,CAAK,GACrD;EACT;CACF;CAEA,qBAA4B,GAA0B;EACpD,IAAMC,IAAYC,MAAU,KAAA,IAAoB,KAAK,cAAbA;EACxC,OAAO,KAAK,UAAUD,CAAS,MAAM,KAAK,UAAU,KAAK,kBAAkB;CAC7E;CAEA,eAAsB,GAAsB;EAC1C,KAAK,cAAcC;CACrB;CAEA,4BAA2C;EACzC,IAAMH,IAAuB,KAAK,UAAU,KAAK,WAAW;EAC5D,IAAIA,MAAyB,KAAA,GAC3B,MAAU,UAAU,4CAA4C;EAElE,OAAOA;CACT;AACF"}
1
+ {"version":3,"file":"index.js","names":["FILTER_MODE","\"BACKEND\"","\"FRONTEND\"","DEFAULT_FILTER_GROUP","FilterAbstract","kwArgs","value","searchParameterValue","error","includeMissingValues","usedValue","rowValue","matchRowValue","valueFilter","missingValuesFilter","serializedFilterValue","parsedValue"],"sources":["../../../../src/classes/abstracts/FilterAbstract/FilterAbstract.ts"],"sourcesContent":["import type {\n CommonDbCompositeFilter,\n CommonDbExistsFilter,\n CommonDbFiltersInner,\n} from '@gen-epix/api-commondb';\n\nexport enum FILTER_MODE {\n BACKEND = 'BACKEND',\n FRONTEND = 'FRONTEND',\n}\n\nexport const DEFAULT_FILTER_GROUP = 'DEFAULT';\n\nexport interface FilterAbstractKwArgs {\n filterDimensionId?: string;\n filterMode: FILTER_MODE;\n filterPriority: string;\n id: string;\n label: string;\n}\n\ninterface FilterURLSearchParameterState {\n genEpixFilterState: 1;\n genEpixFilterValue: unknown;\n includeMissingValues: true;\n}\n\nexport abstract class FilterAbstract<TFilterValue> {\n public filterDimensionId: string;\n public filterMode: FILTER_MODE;\n public filterPriority: string;\n public filterValue: TFilterValue;\n public id: string;\n public includeMissingValues: boolean = false;\n public initialFilterValue: TFilterValue;\n public label: string;\n public showInSidebar: boolean = true;\n public supportsMissingValuesFilter: boolean = false;\n\n public get includeMissingValuesFormFieldName(): string {\n const encodedId = encodeURIComponent(this.id).replace(/\\./g, '%2E');\n return `__includeMissingValues_${encodedId}`;\n }\n\n public constructor(kwArgs: FilterAbstractKwArgs) {\n this.id = kwArgs.id;\n this.label = kwArgs.label;\n this.filterMode = kwArgs.filterMode;\n this.filterPriority = kwArgs.filterPriority;\n this.filterDimensionId = kwArgs.filterDimensionId ?? null;\n }\n\n public static isMissingValue(value: unknown): boolean {\n return value === null\n || value === undefined\n || value === ''\n || (Array.isArray(value) && value.length === 0);\n }\n\n private static isFilterURLSearchParameterState(value: unknown): value is FilterURLSearchParameterState {\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && 'genEpixFilterState' in value\n && value.genEpixFilterState === 1\n && 'genEpixFilterValue' in value\n && 'includeMissingValues' in value\n && value.includeMissingValues === true;\n }\n\n public fromURLSearchParameterValue(searchParameterValue: string): TFilterValue {\n try {\n return this.parseFilterValueFromURLSearchParameterValue(searchParameterValue) as TFilterValue;\n } catch (error) {\n console.error('Error parsing search parameter value:', error);\n return null;\n }\n }\n\n public isFilterActive(value?: unknown, includeMissingValues: boolean = this.includeMissingValues): boolean {\n return includeMissingValues || !this.isInitialFilterValue(value);\n }\n\n public isInitialFilterValue(value?: unknown): boolean {\n const usedValue = value !== undefined ? value : this.filterValue;\n return JSON.stringify(usedValue) === JSON.stringify(this.initialFilterValue);\n }\n\n public matchRowValueIncludingMissingValues(\n rowValue: unknown,\n matchRowValue: (value: unknown) => boolean,\n ): boolean {\n if (!this.includeMissingValues) {\n return matchRowValue(rowValue);\n }\n\n if (this.isInitialFilterValue()) {\n return FilterAbstract.isMissingValue(rowValue);\n }\n\n if (FilterAbstract.isMissingValue(rowValue)) {\n return true;\n }\n\n return matchRowValue(rowValue);\n }\n\n public setFilterValue(value: unknown): void {\n this.filterValue = value as TFilterValue;\n }\n\n public setIncludeMissingValues(includeMissingValues: boolean): void {\n this.includeMissingValues = includeMissingValues;\n }\n\n public toBackendFilterWithMissingValues(valueFilter?: CommonDbFiltersInner): CommonDbFiltersInner | undefined {\n if (!this.includeMissingValues) {\n return valueFilter;\n }\n\n const missingValuesFilter: CommonDbExistsFilter = {\n invert: true,\n key: this.id,\n type: 'EXISTS',\n };\n\n if (!valueFilter) {\n return missingValuesFilter;\n }\n\n const compositeFilter: CommonDbCompositeFilter = {\n filters: [valueFilter, missingValuesFilter],\n operator: 'OR',\n type: 'COMPOSITE',\n };\n\n return compositeFilter;\n }\n\n public toURLSearchParameterValue(): string {\n const serializedFilterValue = JSON.stringify(this.filterValue);\n if (serializedFilterValue === undefined) {\n throw new TypeError('Filter value cannot be serialized as JSON.');\n }\n if (!this.includeMissingValues) {\n return serializedFilterValue;\n }\n\n const searchParameterValue = JSON.stringify({\n genEpixFilterState: 1,\n genEpixFilterValue: this.filterValue,\n includeMissingValues: true,\n });\n if (searchParameterValue === undefined) {\n throw new TypeError('Filter value cannot be serialized as JSON.');\n }\n return searchParameterValue;\n }\n\n protected parseFilterValueFromURLSearchParameterValue(searchParameterValue: string): unknown {\n this.includeMissingValues = false;\n const parsedValue: unknown = JSON.parse(searchParameterValue);\n\n if (!FilterAbstract.isFilterURLSearchParameterState(parsedValue)) {\n return parsedValue;\n }\n\n this.includeMissingValues = parsedValue.includeMissingValues;\n return parsedValue.genEpixFilterValue;\n }\n}\n"],"mappings":";AAMA,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,UAAA,WACA,EAAAC,WAAA,Y;AACF,EAAA,CAAA,CAAA,GAEaC,IAAuB,WAgBdC,IAAtB,MAAsBA,EAA6B;CACjD;CACA;CACA;CACA;CACA;CACA,uBAAuC;CACvC;CACA;CACA,gBAAgC;CAChC,8BAA8C;CAE9C,IAAW,oCAA4C;EAErD,OAAO,0BADW,mBAAmB,KAAK,EAAE,CAAC,CAAC,QAAQ,OAAO,KAC5B;CACnC;CAEA,YAAmB,GAA8B;EAK/C,AAJA,KAAK,KAAKC,EAAO,IACjB,KAAK,QAAQA,EAAO,OACpB,KAAK,aAAaA,EAAO,YACzB,KAAK,iBAAiBA,EAAO,gBAC7B,KAAK,oBAAoBA,EAAO,qBAAqB;CACvD;CAEA,OAAc,eAAe,GAAyB;EACpD,OAAOC,KAAU,QAEZA,MAAU,MACT,MAAM,QAAQA,CAAK,KAAKA,EAAM,WAAW;CACjD;CAEA,OAAe,gCAAgC,GAAwD;EACrG,OAAO,OAAOA,KAAU,cACnBA,KACA,CAAC,MAAM,QAAQA,CAAK,KACpB,wBAAwBA,KACxBA,EAAM,uBAAuB,KAC7B,wBAAwBA,KACxB,0BAA0BA,KAC1BA,EAAM,yBAAyB;CACtC;CAEA,4BAAmC,GAA4C;EAC7E,IAAI;GACF,OAAO,KAAK,4CAA4CC,CAAoB;EAC9E,SAASC,GAAO;GAEd,OADA,QAAQ,MAAM,yCAAyCA,CAAK,GACrD;EACT;CACF;CAEA,eAAsB,GAAiB,IAAgC,KAAK,sBAA+B;EACzG,OAAOC,KAAwB,CAAC,KAAK,qBAAqBH,CAAK;CACjE;CAEA,qBAA4B,GAA0B;EACpD,IAAMI,IAAYJ,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