@oj-module/cli 0.2.63 → 0.2.66

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 (206) hide show
  1. package/devkit/README.md +9 -3
  2. package/devkit/SKILL.md +5 -2
  3. package/devkit/framework-dev.md +12 -7
  4. package/devkit/manual.md +123 -56
  5. package/devkit/menu-rules.md +4 -1
  6. package/package.json +3 -2
  7. package/shell-dist/assets/ahooks.2l850ymmh0.js +18 -0
  8. package/shell-dist/assets/antd-es-locale-zh_CN.1gjjsvxbf0.js +1 -0
  9. package/shell-dist/assets/antd-img-crop.196rkty480.js +99 -0
  10. package/shell-dist/assets/antd-locale-en_US.561tozx860.js +1 -0
  11. package/shell-dist/assets/antd-locale-zh_CN.1cmpmgzh70.js +1 -0
  12. package/shell-dist/assets/antd.uw1coq15l0.js +348 -0
  13. package/shell-dist/assets/clsx.jotilrt2e0.js +1 -0
  14. package/shell-dist/assets/contract-errors.2o17vz9u50.js +1 -0
  15. package/shell-dist/assets/contract.3h327o3mj0.js +57 -0
  16. package/shell-dist/assets/cssinjs.atgmhan7m0.js +3 -0
  17. package/shell-dist/assets/dayjs-plugin-advancedFormat.3vsyd2eis0.js +1 -0
  18. package/shell-dist/assets/dayjs-plugin-customParseFormat.13xhghv1d0.js +1 -0
  19. package/shell-dist/assets/dayjs-plugin-isoWeek.1fn1tw82p0.js +1 -0
  20. package/shell-dist/assets/dayjs-plugin-localeData.2rwbjp9nk0.js +1 -0
  21. package/shell-dist/assets/dayjs-plugin-quarterOfYear.2oqo1lcx80.js +1 -0
  22. package/shell-dist/assets/dayjs-plugin-relativeTime.2pqs3et4y0.js +1 -0
  23. package/shell-dist/assets/dayjs-plugin-weekOfYear.gvn9iph080.js +1 -0
  24. package/shell-dist/assets/dayjs-plugin-weekYear.2u78l3ex10.js +1 -0
  25. package/shell-dist/assets/dayjs-plugin-weekday.2d56a4tml0.js +1 -0
  26. package/shell-dist/assets/dayjs.pa60l6wjo0.js +1 -0
  27. package/shell-dist/assets/dnd-kit-core.1xyreig6r0.js +5 -0
  28. package/shell-dist/assets/dnd-kit-sortable.s94qciuft0.js +1 -0
  29. package/shell-dist/assets/dnd-kit-utilities.1umw4xphb0.js +1 -0
  30. package/shell-dist/assets/i18next.33zqofapj0.js +1 -0
  31. package/shell-dist/assets/icons-es-components-Context.365qmflwg0.js +1 -0
  32. package/shell-dist/assets/icons.159wjwals0.js +57 -0
  33. package/shell-dist/assets/{index-BKtXxIXz.js → index.i0kqbxp050.js} +11 -6
  34. package/shell-dist/assets/jsx-dev-runtime.3uibuc82f0.js +14 -0
  35. package/shell-dist/assets/jsx-runtime.h40xu4o5b0.js +14 -0
  36. package/shell-dist/assets/keepalive-for-react.xenu5vam70.js +1 -0
  37. package/shell-dist/assets/kit.37kr8ui390.js +1 -0
  38. package/shell-dist/assets/ky.1cgch7gu60.js +6 -0
  39. package/shell-dist/assets/motion-react.pjsxytvjs0.js +12 -0
  40. package/shell-dist/assets/motion.21tciqutg0.js +4 -0
  41. package/shell-dist/assets/nprogress.2nz76n9ny0.js +7 -0
  42. package/shell-dist/assets/ojm-dayjs-locale-zh-cn.3vr3beiyp0.js +9 -0
  43. package/shell-dist/assets/pinyin-pro.3v0mnxczn0.js +1 -0
  44. package/shell-dist/assets/pro-components.2kyot1vcl0.js +83 -0
  45. package/shell-dist/assets/react-countup.2x8idnr8y0.js +10 -0
  46. package/shell-dist/assets/react-dom-client.ick0v05ob0.js +43 -0
  47. package/shell-dist/assets/react-dom.2so9uxg3f0.js +22 -0
  48. package/shell-dist/assets/react-error-boundary.2dncdfj3b0.js +1 -0
  49. package/shell-dist/assets/react-i18next.auhvjhqv00.js +1 -0
  50. package/shell-dist/assets/react-jss.1ei6dr9e00.js +29 -0
  51. package/shell-dist/assets/react-query.3rln45ow00.js +1 -0
  52. package/shell-dist/assets/react-router-dom.3c6zld8h40.js +44 -0
  53. package/shell-dist/assets/react-router.2h9rebcv50.js +56 -0
  54. package/shell-dist/assets/react.1ew63mwts0.js +14 -0
  55. package/shell-dist/assets/runtime.1xfsxcajj0.js +21702 -0
  56. package/shell-dist/assets/simplebar-react.2g739uvai0.js +1 -0
  57. package/shell-dist/assets/spin-delay.yjeyj6iwp0.js +9 -0
  58. package/shell-dist/assets/tailwind-merge.125ehiqjw0.js +1 -0
  59. package/shell-dist/assets/use-sync-external-store-shim.1nz1pi9bb0.js +22 -0
  60. package/shell-dist/assets/zustand-middleware.1xaxjueme0.js +6 -0
  61. package/shell-dist/assets/zustand-react-shallow.pybayv1hx0.js +1 -0
  62. package/shell-dist/assets/zustand-react.9fsl9brxy0.js +1 -0
  63. package/shell-dist/assets/zustand-shallow.6cz0yyv9x0.js +1 -0
  64. package/shell-dist/assets/zustand-vanilla-shallow.3424monv50.js +1 -0
  65. package/shell-dist/assets/zustand-vanilla.1mo3ka3g30.js +1 -0
  66. package/shell-dist/assets/zustand.3gjgzlnqo0.js +1 -0
  67. package/shell-dist/index.html +67 -118
  68. package/shell-dist/versions.json +3 -3
  69. package/src/build/module-def.ts +1 -0
  70. package/src/esm-exports.ts +152 -70
  71. package/src/market/__tests__/bootstrap.test.ts +36 -1
  72. package/src/shared-deps.ts +69 -19
  73. package/src/site-base.ts +4 -0
  74. package/templates/src/app/web/home/pages/components/bar-chart.tsx +5 -3
  75. package/templates/src/app/web/home/pages/components/echarts-setup.ts +30 -0
  76. package/templates/src/app/web/home/pages/components/line-chart.tsx +5 -3
  77. package/templates/src/app/web/home/pages/components/pie-chart.tsx +6 -3
  78. package/templates/src/app/web/home/pages/index.tsx +3 -2
  79. package/templates/src/app/web/home/routes.ts +3 -2
  80. package/templates/src/app/web/personal-center/locales/en-US.json +15 -0
  81. package/templates/src/app/web/personal-center/locales/zh-CN.json +15 -0
  82. package/templates/src/app/web/personal-center/pages/my-profile/index.tsx +15 -13
  83. package/templates/src/app/web/system/locales/en-US.json +24 -3
  84. package/templates/src/app/web/system/locales/zh-CN.json +24 -3
  85. package/templates/src/app/web/system/pages/roles/index.tsx +13 -6
  86. package/templates/src/app/web/system/pages/settings/index.tsx +1 -1
  87. package/templates/src/app/web/system/pages/users/index.tsx +3 -3
  88. package/templates/src/app/web/system/pages/users/roles.tsx +1 -1
  89. package/templates/src/oj-market/web/locales/en-US.json +14 -1
  90. package/templates/src/oj-market/web/locales/zh-CN.json +14 -1
  91. package/vendor/host-versions.json +3 -3
  92. package/shell-dist/assets/ahooks.js +0 -6909
  93. package/shell-dist/assets/antd-es-locale-zh_CN.js +0 -257
  94. package/shell-dist/assets/antd-img-crop.js +0 -1495
  95. package/shell-dist/assets/antd-locale-en_US.js +0 -374
  96. package/shell-dist/assets/antd-locale-zh_CN.js +0 -379
  97. package/shell-dist/assets/antd.js +0 -106874
  98. package/shell-dist/assets/clsx.js +0 -33
  99. package/shell-dist/assets/contract-errors.js +0 -30
  100. package/shell-dist/assets/contract.js +0 -18900
  101. package/shell-dist/assets/cssinjs.js +0 -2595
  102. package/shell-dist/assets/dayjs-plugin-advancedFormat.js +0 -98
  103. package/shell-dist/assets/dayjs-plugin-customParseFormat.js +0 -173
  104. package/shell-dist/assets/dayjs-plugin-isoWeek.js +0 -77
  105. package/shell-dist/assets/dayjs-plugin-localeData.js +0 -126
  106. package/shell-dist/assets/dayjs-plugin-quarterOfYear.js +0 -77
  107. package/shell-dist/assets/dayjs-plugin-relativeTime.js +0 -92
  108. package/shell-dist/assets/dayjs-plugin-weekOfYear.js +0 -73
  109. package/shell-dist/assets/dayjs-plugin-weekYear.js +0 -63
  110. package/shell-dist/assets/dayjs-plugin-weekday.js +0 -63
  111. package/shell-dist/assets/dayjs.js +0 -326
  112. package/shell-dist/assets/dnd-kit-core.js +0 -3601
  113. package/shell-dist/assets/dnd-kit-sortable.js +0 -717
  114. package/shell-dist/assets/dnd-kit-utilities.js +0 -340
  115. package/shell-dist/assets/i18next.js +0 -2321
  116. package/shell-dist/assets/icons-es-components-Context.js +0 -20
  117. package/shell-dist/assets/icons.js +0 -34961
  118. package/shell-dist/assets/jsx-dev-runtime.js +0 -75
  119. package/shell-dist/assets/jsx-runtime.js +0 -97
  120. package/shell-dist/assets/keepalive-for-react.js +0 -283
  121. package/shell-dist/assets/kit.js +0 -151
  122. package/shell-dist/assets/ky.js +0 -1427
  123. package/shell-dist/assets/motion-react.js +0 -13589
  124. package/shell-dist/assets/motion.js +0 -9959
  125. package/shell-dist/assets/nprogress.js +0 -314
  126. package/shell-dist/assets/ojm--ant-design-icons-es-icons-BarsOutlined.js +0 -7
  127. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CalendarOutlined.js +0 -7
  128. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownFilled.js +0 -7
  129. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownOutlined.js +0 -7
  130. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretUpOutlined.js +0 -7
  131. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckCircleFilled.js +0 -7
  132. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckOutlined.js +0 -7
  133. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ClockCircleOutlined.js +0 -7
  134. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseCircleFilled.js +0 -7
  135. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseOutlined.js +0 -7
  136. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CopyOutlined.js +0 -7
  137. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DeleteOutlined.js +0 -7
  138. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleLeftOutlined.js +0 -7
  139. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleRightOutlined.js +0 -7
  140. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownOutlined.js +0 -7
  141. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownloadOutlined.js +0 -7
  142. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EditOutlined.js +0 -7
  143. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EllipsisOutlined.js +0 -7
  144. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EnterOutlined.js +0 -7
  145. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ExclamationCircleFilled.js +0 -7
  146. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeInvisibleOutlined.js +0 -7
  147. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeOutlined.js +0 -7
  148. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileOutlined.js +0 -7
  149. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileTextOutlined.js +0 -7
  150. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FilterFilled.js +0 -7
  151. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOpenOutlined.js +0 -7
  152. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOutlined.js +0 -7
  153. package/shell-dist/assets/ojm--ant-design-icons-es-icons-HolderOutlined.js +0 -7
  154. package/shell-dist/assets/ojm--ant-design-icons-es-icons-InfoCircleFilled.js +0 -7
  155. package/shell-dist/assets/ojm--ant-design-icons-es-icons-LeftOutlined.js +0 -7
  156. package/shell-dist/assets/ojm--ant-design-icons-es-icons-LoadingOutlined.js +0 -7
  157. package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusOutlined.js +0 -7
  158. package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusSquareOutlined.js +0 -7
  159. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PaperClipOutlined.js +0 -7
  160. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PictureOutlined.js +0 -7
  161. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusOutlined.js +0 -7
  162. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusSquareOutlined.js +0 -7
  163. package/shell-dist/assets/ojm--ant-design-icons-es-icons-QuestionCircleOutlined.js +0 -7
  164. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ReloadOutlined.js +0 -7
  165. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RightOutlined.js +0 -7
  166. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateLeftOutlined.js +0 -7
  167. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateRightOutlined.js +0 -7
  168. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SearchOutlined.js +0 -7
  169. package/shell-dist/assets/ojm--ant-design-icons-es-icons-StarFilled.js +0 -7
  170. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapOutlined.js +0 -7
  171. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapRightOutlined.js +0 -7
  172. package/shell-dist/assets/ojm--ant-design-icons-es-icons-UpOutlined.js +0 -7
  173. package/shell-dist/assets/ojm--ant-design-icons-es-icons-VerticalAlignTopOutlined.js +0 -7
  174. package/shell-dist/assets/ojm--ant-design-icons-es-icons-WarningFilled.js +0 -7
  175. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomInOutlined.js +0 -7
  176. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomOutOutlined.js +0 -7
  177. package/shell-dist/assets/ojm-dayjs-locale-zh-cn.js +0 -81
  178. package/shell-dist/assets/pinyin-pro.js +0 -25175
  179. package/shell-dist/assets/pro-components.js +0 -44627
  180. package/shell-dist/assets/react-countup.js +0 -525
  181. package/shell-dist/assets/react-dom-client.js +0 -12134
  182. package/shell-dist/assets/react-dom.js +0 -266
  183. package/shell-dist/assets/react-error-boundary.js +0 -141
  184. package/shell-dist/assets/react-i18next.js +0 -1773
  185. package/shell-dist/assets/react-jss.js +0 -4089
  186. package/shell-dist/assets/react-query.js +0 -3072
  187. package/shell-dist/assets/react-router-dom.js +0 -9927
  188. package/shell-dist/assets/react-router.js +0 -14584
  189. package/shell-dist/assets/react.js +0 -590
  190. package/shell-dist/assets/runtime.js +0 -28294
  191. package/shell-dist/assets/simplebar-react.js +0 -1119
  192. package/shell-dist/assets/spin-delay.js +0 -111
  193. package/shell-dist/assets/tailwind-merge.js +0 -3364
  194. package/shell-dist/assets/use-sync-external-store-shim.js +0 -130
  195. package/shell-dist/assets/zustand-middleware.js +0 -513
  196. package/shell-dist/assets/zustand-react-shallow.js +0 -27
  197. package/shell-dist/assets/zustand-react.js +0 -39
  198. package/shell-dist/assets/zustand-shallow.js +0 -22
  199. package/shell-dist/assets/zustand-vanilla-shallow.js +0 -71
  200. package/shell-dist/assets/zustand-vanilla.js +0 -40
  201. package/shell-dist/assets/zustand.js +0 -32
  202. /package/shell-dist/assets/{nprogress-css.js → nprogress-css.1cq2pzkre0.js} +0 -0
  203. /package/shell-dist/assets/{ojm-antd-es-button.js → ojm-antd-es-button.2uriphio50.js} +0 -0
  204. /package/shell-dist/assets/{ojm-antd-es-modal.js → ojm-antd-es-modal.bf3tgdh8v0.js} +0 -0
  205. /package/shell-dist/assets/{ojm-antd-es-slider.js → ojm-antd-es-slider.xyvptuhid0.js} +0 -0
  206. /package/shell-dist/assets/{ojm-antd-es-upload.js → ojm-antd-es-upload.13gx45e0g0.js} +0 -0
@@ -1,3072 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __typeError = (msg) => {
3
- throw TypeError(msg);
4
- };
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
10
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
11
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
12
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
13
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
14
- var __privateWrapper = (obj, member, setter, getter) => ({
15
- set _(value) {
16
- __privateSet(obj, member, value, setter);
17
- },
18
- get _() {
19
- return __privateGet(obj, member, getter);
20
- }
21
- });
22
-
23
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/index.js
24
- var modern_exports = {};
25
- __export(modern_exports, {
26
- CancelledError: () => CancelledError,
27
- HydrationBoundary: () => HydrationBoundary,
28
- InfiniteQueryObserver: () => InfiniteQueryObserver,
29
- IsRestoringProvider: () => IsRestoringProvider,
30
- Mutation: () => Mutation,
31
- MutationCache: () => MutationCache,
32
- MutationObserver: () => MutationObserver,
33
- QueriesObserver: () => QueriesObserver,
34
- Query: () => Query,
35
- QueryCache: () => QueryCache,
36
- QueryClient: () => QueryClient,
37
- QueryClientContext: () => QueryClientContext,
38
- QueryClientProvider: () => QueryClientProvider,
39
- QueryErrorResetBoundary: () => QueryErrorResetBoundary,
40
- QueryObserver: () => QueryObserver,
41
- dataTagErrorSymbol: () => dataTagErrorSymbol,
42
- dataTagSymbol: () => dataTagSymbol,
43
- defaultScheduler: () => defaultScheduler,
44
- defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation,
45
- defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery,
46
- dehydrate: () => dehydrate,
47
- dehydrateQuery: () => dehydrateQuery,
48
- environmentManager: () => environmentManager,
49
- experimental_streamedQuery: () => streamedQuery,
50
- focusManager: () => focusManager,
51
- hashKey: () => hashKey,
52
- hydrate: () => hydrate,
53
- infiniteQueryOptions: () => infiniteQueryOptions,
54
- isCancelledError: () => isCancelledError,
55
- isServer: () => isServer,
56
- keepPreviousData: () => keepPreviousData,
57
- matchMutation: () => matchMutation,
58
- matchQuery: () => matchQuery,
59
- mutationOptions: () => mutationOptions,
60
- noop: () => noop,
61
- notifyManager: () => notifyManager,
62
- onlineManager: () => onlineManager,
63
- partialMatchKey: () => partialMatchKey,
64
- queryOptions: () => queryOptions,
65
- replaceEqualDeep: () => replaceEqualDeep,
66
- shouldThrowError: () => shouldThrowError,
67
- skipToken: () => skipToken,
68
- timeoutManager: () => timeoutManager,
69
- unsetMarker: () => unsetMarker,
70
- useInfiniteQuery: () => useInfiniteQuery,
71
- useIsFetching: () => useIsFetching,
72
- useIsMutating: () => useIsMutating,
73
- useIsRestoring: () => useIsRestoring,
74
- useMutation: () => useMutation,
75
- useMutationState: () => useMutationState,
76
- usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery,
77
- usePrefetchQuery: () => usePrefetchQuery,
78
- useQueries: () => useQueries,
79
- useQuery: () => useQuery,
80
- useQueryClient: () => useQueryClient,
81
- useQueryErrorResetBoundary: () => useQueryErrorResetBoundary,
82
- useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery,
83
- useSuspenseQueries: () => useSuspenseQueries,
84
- useSuspenseQuery: () => useSuspenseQuery
85
- });
86
-
87
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
88
- import * as React from "react";
89
- import { jsx } from "react/jsx-runtime";
90
- var QueryClientContext = React.createContext(void 0);
91
- var useQueryClient = (queryClient) => {
92
- const client = React.useContext(QueryClientContext);
93
- if (queryClient) return queryClient;
94
- if (!client) throw new Error("No QueryClient set, use QueryClientProvider to set one");
95
- return client;
96
- };
97
- var QueryClientProvider = ({ client, children }) => {
98
- React.useEffect(() => {
99
- client.mount();
100
- return () => {
101
- client.unmount();
102
- };
103
- }, [client]);
104
- return /* @__PURE__ */ jsx(QueryClientContext.Provider, {
105
- value: client,
106
- children
107
- });
108
- };
109
-
110
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js
111
- import * as React2 from "react";
112
-
113
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
114
- var defaultTimeoutProvider = {
115
- setTimeout: (callback, delay) => setTimeout(callback, delay),
116
- clearTimeout: (timeoutId) => clearTimeout(timeoutId),
117
- setInterval: (callback, delay) => setInterval(callback, delay),
118
- clearInterval: (intervalId) => clearInterval(intervalId)
119
- };
120
- var _provider, _providerCalled, _a;
121
- var TimeoutManager = (_a = class {
122
- constructor() {
123
- __privateAdd(this, _provider, defaultTimeoutProvider);
124
- __privateAdd(this, _providerCalled, false);
125
- }
126
- setTimeoutProvider(provider) {
127
- if (false) {
128
- if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {
129
- previous: __privateGet(this, _provider),
130
- provider
131
- });
132
- }
133
- __privateSet(this, _provider, provider);
134
- if (false) __privateSet(this, _providerCalled, false);
135
- }
136
- setTimeout(callback, delay) {
137
- if (false) __privateSet(this, _providerCalled, true);
138
- return __privateGet(this, _provider).setTimeout(callback, delay);
139
- }
140
- clearTimeout(timeoutId) {
141
- __privateGet(this, _provider).clearTimeout(timeoutId);
142
- }
143
- setInterval(callback, delay) {
144
- if (false) __privateSet(this, _providerCalled, true);
145
- return __privateGet(this, _provider).setInterval(callback, delay);
146
- }
147
- clearInterval(intervalId) {
148
- __privateGet(this, _provider).clearInterval(intervalId);
149
- }
150
- }, _provider = new WeakMap(), _providerCalled = new WeakMap(), _a);
151
- var timeoutManager = new TimeoutManager();
152
- function systemSetTimeoutZero(callback) {
153
- setTimeout(callback, 0);
154
- }
155
-
156
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/utils.js
157
- var isServer = typeof window === "undefined" || "Deno" in globalThis;
158
- function noop() {
159
- }
160
- function functionalUpdate(updater, input) {
161
- return typeof updater === "function" ? updater(input) : updater;
162
- }
163
- function isValidTimeout(value) {
164
- return typeof value === "number" && value >= 0 && value !== Infinity;
165
- }
166
- function timeUntilStale(updatedAt, staleTime) {
167
- return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
168
- }
169
- function resolveQueryValue(value, query) {
170
- return typeof value === "function" ? value(query) : value;
171
- }
172
- function matchQuery(filters, query) {
173
- const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters;
174
- if (queryKey) {
175
- if (exact) {
176
- if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;
177
- } else if (!partialMatchKey(query.queryKey, queryKey)) return false;
178
- }
179
- if (type !== "all") {
180
- const isActive = query.isActive();
181
- if (type === "active" && !isActive) return false;
182
- if (type === "inactive" && isActive) return false;
183
- }
184
- if (typeof stale === "boolean" && query.isStale() !== stale) return false;
185
- if (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;
186
- if (predicate && !predicate(query)) return false;
187
- return true;
188
- }
189
- function matchMutation(filters, mutation) {
190
- const { exact, status, predicate, mutationKey } = filters;
191
- if (mutationKey) {
192
- if (!mutation.options.mutationKey) return false;
193
- if (exact) {
194
- if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;
195
- } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;
196
- }
197
- if (status && mutation.state.status !== status) return false;
198
- if (predicate && !predicate(mutation)) return false;
199
- return true;
200
- }
201
- function hashQueryKeyByOptions(queryKey, options) {
202
- return (options?.queryKeyHashFn || hashKey)(queryKey);
203
- }
204
- function hashKey(queryKey) {
205
- return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
206
- result[key] = val[key];
207
- return result;
208
- }, {}) : val);
209
- }
210
- function partialMatchKey(a, b) {
211
- if (a === b) return true;
212
- if (typeof a !== typeof b) return false;
213
- if (a && b && typeof a === "object" && typeof b === "object") {
214
- if (Array.isArray(a) && Array.isArray(b)) {
215
- for (let i = 0; i < b.length; i++) if (!partialMatchKey(a[i], b[i])) return false;
216
- return true;
217
- }
218
- const bKeys = Object.keys(b);
219
- for (const key of bKeys) if (!partialMatchKey(a[key], b[key])) return false;
220
- return true;
221
- }
222
- return false;
223
- }
224
- var hasOwn = Object.prototype.hasOwnProperty;
225
- function replaceEqualDeep(a, b, depth = 0) {
226
- if (a === b) return a;
227
- if (depth > 500) return b;
228
- const array = isPlainArray(a) && isPlainArray(b);
229
- if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
230
- const aSize = (array ? a : Object.keys(a)).length;
231
- const bItems = array ? b : Object.keys(b);
232
- const bSize = bItems.length;
233
- const copy = array ? new Array(bSize) : {};
234
- let equalItems = 0;
235
- for (let i = 0; i < bSize; i++) {
236
- const key = array ? i : bItems[i];
237
- const aItem = a[key];
238
- const bItem = b[key];
239
- if (aItem === bItem) {
240
- copy[key] = aItem;
241
- if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
242
- continue;
243
- }
244
- if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
245
- copy[key] = bItem;
246
- continue;
247
- }
248
- const v = replaceEqualDeep(aItem, bItem, depth + 1);
249
- copy[key] = v;
250
- if (v === aItem) equalItems++;
251
- }
252
- return aSize === bSize && equalItems === aSize ? a : copy;
253
- }
254
- function shallowEqualObjects(a, b) {
255
- if (!b || Object.keys(a).length !== Object.keys(b).length) return false;
256
- for (const key in a) if (a[key] !== b[key]) return false;
257
- return true;
258
- }
259
- function isPlainArray(value) {
260
- return Array.isArray(value) && value.length === Object.keys(value).length;
261
- }
262
- function isPlainObject(o) {
263
- if (!hasObjectPrototype(o)) return false;
264
- const ctor = o.constructor;
265
- if (ctor === void 0) return true;
266
- const prot = ctor.prototype;
267
- if (!hasObjectPrototype(prot)) return false;
268
- if (!prot.hasOwnProperty("isPrototypeOf")) return false;
269
- if (Object.getPrototypeOf(o) !== Object.prototype) return false;
270
- return true;
271
- }
272
- function hasObjectPrototype(o) {
273
- return Object.prototype.toString.call(o) === "[object Object]";
274
- }
275
- function sleep(timeout) {
276
- return new Promise((resolve) => {
277
- timeoutManager.setTimeout(resolve, timeout);
278
- });
279
- }
280
- function replaceData(prevData, data, options) {
281
- if (typeof options.structuralSharing === "function") return options.structuralSharing(prevData, data);
282
- else if (options.structuralSharing !== false) {
283
- if (false) try {
284
- return replaceEqualDeep(prevData, data);
285
- } catch (error) {
286
- console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`);
287
- throw error;
288
- }
289
- return replaceEqualDeep(prevData, data);
290
- }
291
- return data;
292
- }
293
- function keepPreviousData(previousData) {
294
- return previousData;
295
- }
296
- function addToEnd(items, item, max = 0) {
297
- const newItems = [...items, item];
298
- return max && newItems.length > max ? newItems.slice(1) : newItems;
299
- }
300
- function addToStart(items, item, max = 0) {
301
- const newItems = [item, ...items];
302
- return max && newItems.length > max ? newItems.slice(0, -1) : newItems;
303
- }
304
- var skipToken = /* @__PURE__ */ Symbol();
305
- function ensureQueryFn(options, fetchOptions) {
306
- if (false) {
307
- if (options.queryFn === skipToken) console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`);
308
- }
309
- if (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;
310
- if (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));
311
- return options.queryFn;
312
- }
313
- function shouldThrowError(throwOnError, params) {
314
- if (typeof throwOnError === "function") return throwOnError(...params);
315
- return !!throwOnError;
316
- }
317
- function addConsumeAwareSignal(object, getSignal, onCancelled) {
318
- let consumed = false;
319
- let signal;
320
- Object.defineProperty(object, "signal", {
321
- enumerable: true,
322
- get: () => {
323
- signal ?? (signal = getSignal());
324
- if (consumed) return signal;
325
- consumed = true;
326
- if (signal.aborted) onCancelled();
327
- else signal.addEventListener("abort", onCancelled, { once: true });
328
- return signal;
329
- }
330
- });
331
- return object;
332
- }
333
-
334
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/environmentManager.js
335
- var isServerFn = () => isServer;
336
- var isServer2 = () => isServerFn();
337
- var environmentManager = {
338
- isServer: isServer2,
339
- /**
340
- * Overrides the server check globally.
341
- */
342
- setIsServer(isServerValue) {
343
- isServerFn = isServerValue;
344
- }
345
- };
346
-
347
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/subscribable.js
348
- var Subscribable = class {
349
- constructor() {
350
- this.listeners = /* @__PURE__ */ new Set();
351
- this.subscribe = this.subscribe.bind(this);
352
- }
353
- subscribe(listener) {
354
- this.listeners.add(listener);
355
- this.onSubscribe();
356
- return () => {
357
- this.listeners.delete(listener);
358
- this.onUnsubscribe();
359
- };
360
- }
361
- hasListeners() {
362
- return this.listeners.size > 0;
363
- }
364
- onSubscribe() {
365
- }
366
- onUnsubscribe() {
367
- }
368
- };
369
-
370
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/focusManager.js
371
- var _focused, _cleanup, _setup, _a2;
372
- var FocusManager = (_a2 = class extends Subscribable {
373
- constructor() {
374
- super();
375
- __privateAdd(this, _focused);
376
- __privateAdd(this, _cleanup);
377
- __privateAdd(this, _setup);
378
- __privateSet(this, _setup, (onFocus) => {
379
- if (typeof window !== "undefined" && window.addEventListener) {
380
- const listener = () => onFocus();
381
- window.addEventListener("visibilitychange", listener, false);
382
- return () => {
383
- window.removeEventListener("visibilitychange", listener);
384
- };
385
- }
386
- });
387
- }
388
- onSubscribe() {
389
- if (!__privateGet(this, _cleanup)) this.setEventListener(__privateGet(this, _setup));
390
- }
391
- onUnsubscribe() {
392
- var _a13;
393
- if (!this.hasListeners()) {
394
- (_a13 = __privateGet(this, _cleanup)) == null ? void 0 : _a13.call(this);
395
- __privateSet(this, _cleanup, void 0);
396
- }
397
- }
398
- setEventListener(setup) {
399
- var _a13;
400
- __privateSet(this, _setup, setup);
401
- (_a13 = __privateGet(this, _cleanup)) == null ? void 0 : _a13.call(this);
402
- __privateSet(this, _cleanup, setup((focused) => {
403
- if (typeof focused === "boolean") this.setFocused(focused);
404
- else this.onFocus();
405
- }));
406
- }
407
- setFocused(focused) {
408
- if (__privateGet(this, _focused) !== focused) {
409
- __privateSet(this, _focused, focused);
410
- this.onFocus();
411
- }
412
- }
413
- onFocus() {
414
- const isFocused = this.isFocused();
415
- this.listeners.forEach((listener) => {
416
- listener(isFocused);
417
- });
418
- }
419
- isFocused() {
420
- if (typeof __privateGet(this, _focused) === "boolean") return __privateGet(this, _focused);
421
- return globalThis.document?.visibilityState !== "hidden";
422
- }
423
- }, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a2);
424
- var focusManager = new FocusManager();
425
-
426
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/hydration.js
427
- function tryResolveSync(promise) {
428
- let data;
429
- promise.then((result) => {
430
- data = result;
431
- return result;
432
- }, noop)?.catch?.(noop);
433
- if (data !== void 0) return { data };
434
- }
435
- function dehydrateMutation(mutation) {
436
- return {
437
- mutationKey: mutation.options.mutationKey,
438
- state: mutation.state,
439
- ...mutation.options.scope && { scope: mutation.options.scope },
440
- ...mutation.meta && { meta: mutation.meta }
441
- };
442
- }
443
- function dehydratePromise(query, serializeData, shouldRedactErrors) {
444
- const promise = query.promise?.then(serializeData).catch((error) => {
445
- if (shouldRedactErrors?.(error) === false) return Promise.reject(error);
446
- if (false) console.error(`A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`);
447
- return Promise.reject(/* @__PURE__ */ new Error("redacted"));
448
- });
449
- promise?.catch(noop);
450
- return promise;
451
- }
452
- function dehydrateQuery(query, serializeData, shouldRedactErrors) {
453
- return {
454
- dehydratedAt: Date.now(),
455
- state: {
456
- ...query.state,
457
- ...query.state.data !== void 0 && { data: serializeData ? serializeData(query.state.data) : query.state.data }
458
- },
459
- queryKey: query.queryKey,
460
- queryHash: query.queryHash,
461
- ...query.state.status === "pending" && { promise: dehydratePromise(query, serializeData, shouldRedactErrors) },
462
- ...query.meta && { meta: query.meta },
463
- ...query.queryType && { queryType: query.queryType }
464
- };
465
- }
466
- function defaultShouldDehydrateMutation(mutation) {
467
- return mutation.state.isPaused;
468
- }
469
- function defaultShouldDehydrateQuery(query) {
470
- return query.state.status === "success";
471
- }
472
- function dehydrate(client, options = {}) {
473
- const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation;
474
- const mutations = client.getMutationCache().getAll().flatMap((mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : []);
475
- const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery;
476
- const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors;
477
- const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData;
478
- return {
479
- mutations,
480
- queries: client.getQueryCache().getAll().flatMap((query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [])
481
- };
482
- }
483
- function hydrate(client, dehydratedState, options) {
484
- const mutationCache = client.getMutationCache();
485
- const queryCache = client.getQueryCache();
486
- const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData;
487
- dehydratedState.mutations?.forEach(({ state, ...mutationOptions2 }) => {
488
- mutationCache.build(client, {
489
- ...client.getDefaultOptions().hydrate?.mutations,
490
- ...options?.defaultOptions?.mutations,
491
- ...mutationOptions2
492
- }, state);
493
- });
494
- dehydratedState.queries?.forEach(({ queryKey, state, queryHash, meta, promise, dehydratedAt, queryType }) => {
495
- const syncData = promise ? tryResolveSync(promise) : void 0;
496
- const rawData = state.data === void 0 ? syncData?.data : state.data;
497
- const data = rawData === void 0 ? rawData : deserializeData ? deserializeData(rawData) : rawData;
498
- let query = queryCache.get(queryHash);
499
- const existingQueryIsPending = query?.state.status === "pending";
500
- const existingQueryIsFetching = query?.state.fetchStatus === "fetching";
501
- if (query) {
502
- const hasNewerSyncData = syncData && dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt;
503
- if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) {
504
- const { fetchStatus: _ignored, ...serializedState } = state;
505
- query.setState({
506
- ...serializedState,
507
- data,
508
- ...state.status === "pending" && data !== void 0 && {
509
- status: "success",
510
- dataUpdatedAt: dehydratedAt ?? Date.now(),
511
- ...!existingQueryIsFetching && { fetchStatus: "idle" }
512
- }
513
- });
514
- }
515
- } else query = queryCache.build(client, {
516
- ...client.getDefaultOptions().hydrate?.queries,
517
- ...options?.defaultOptions?.queries,
518
- queryKey,
519
- queryHash,
520
- meta,
521
- _type: queryType
522
- }, {
523
- ...state,
524
- data,
525
- fetchStatus: "idle",
526
- status: state.status === "pending" && data !== void 0 ? "success" : state.status,
527
- ...state.status === "pending" && data !== void 0 && { dataUpdatedAt: dehydratedAt ?? Date.now() }
528
- });
529
- if (promise && !syncData && !existingQueryIsPending && !existingQueryIsFetching && (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) query.fetch(void 0, { initialPromise: Promise.resolve(promise).then(deserializeData) }).catch(noop);
530
- });
531
- }
532
-
533
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/notifyManager.js
534
- var defaultScheduler = systemSetTimeoutZero;
535
- function createNotifyManager() {
536
- let queue = [];
537
- let transactions = 0;
538
- let notifyFn = (callback) => {
539
- callback();
540
- };
541
- let batchNotifyFn = (callback) => {
542
- callback();
543
- };
544
- let scheduleFn = defaultScheduler;
545
- const schedule = (callback) => {
546
- if (transactions) queue.push(callback);
547
- else scheduleFn(() => {
548
- notifyFn(callback);
549
- });
550
- };
551
- const flush = () => {
552
- const originalQueue = queue;
553
- queue = [];
554
- if (originalQueue.length) scheduleFn(() => {
555
- batchNotifyFn(() => {
556
- originalQueue.forEach((callback) => {
557
- notifyFn(callback);
558
- });
559
- });
560
- });
561
- };
562
- return {
563
- batch: (callback) => {
564
- let result;
565
- transactions++;
566
- try {
567
- result = callback();
568
- } finally {
569
- transactions--;
570
- if (!transactions) flush();
571
- }
572
- return result;
573
- },
574
- /**
575
- * All calls to the wrapped function will be batched.
576
- */
577
- batchCalls: (callback) => {
578
- return (...args) => {
579
- schedule(() => {
580
- callback(...args);
581
- });
582
- };
583
- },
584
- schedule,
585
- /**
586
- * Use this method to set a custom notify function.
587
- * This can be used to for example wrap notifications with `React.act` while running tests.
588
- */
589
- setNotifyFunction: (fn) => {
590
- notifyFn = fn;
591
- },
592
- /**
593
- * Use this method to set a custom function to batch notifications together into a single tick.
594
- * By default React Query will use the batch function provided by ReactDOM or React Native.
595
- */
596
- setBatchNotifyFunction: (fn) => {
597
- batchNotifyFn = fn;
598
- },
599
- setScheduler: (fn) => {
600
- scheduleFn = fn;
601
- }
602
- };
603
- }
604
- var notifyManager = createNotifyManager();
605
-
606
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/onlineManager.js
607
- var _online, _cleanup2, _setup2, _a3;
608
- var OnlineManager = (_a3 = class extends Subscribable {
609
- constructor() {
610
- super();
611
- __privateAdd(this, _online, true);
612
- __privateAdd(this, _cleanup2);
613
- __privateAdd(this, _setup2);
614
- __privateSet(this, _setup2, (onOnline) => {
615
- if (typeof window !== "undefined" && window.addEventListener) {
616
- const onlineListener = () => onOnline(true);
617
- const offlineListener = () => onOnline(false);
618
- window.addEventListener("online", onlineListener, false);
619
- window.addEventListener("offline", offlineListener, false);
620
- return () => {
621
- window.removeEventListener("online", onlineListener);
622
- window.removeEventListener("offline", offlineListener);
623
- };
624
- }
625
- });
626
- }
627
- onSubscribe() {
628
- if (!__privateGet(this, _cleanup2)) this.setEventListener(__privateGet(this, _setup2));
629
- }
630
- onUnsubscribe() {
631
- var _a13;
632
- if (!this.hasListeners()) {
633
- (_a13 = __privateGet(this, _cleanup2)) == null ? void 0 : _a13.call(this);
634
- __privateSet(this, _cleanup2, void 0);
635
- }
636
- }
637
- setEventListener(setup) {
638
- var _a13;
639
- __privateSet(this, _setup2, setup);
640
- (_a13 = __privateGet(this, _cleanup2)) == null ? void 0 : _a13.call(this);
641
- __privateSet(this, _cleanup2, setup(this.setOnline.bind(this)));
642
- }
643
- setOnline(online) {
644
- if (__privateGet(this, _online) !== online) {
645
- __privateSet(this, _online, online);
646
- this.listeners.forEach((listener) => {
647
- listener(online);
648
- });
649
- }
650
- }
651
- isOnline() {
652
- return __privateGet(this, _online);
653
- }
654
- }, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _a3);
655
- var onlineManager = new OnlineManager();
656
-
657
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/retryer.js
658
- function defaultRetryDelay(failureCount) {
659
- return Math.min(1e3 * 2 ** failureCount, 3e4);
660
- }
661
- function canFetch(networkMode) {
662
- return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
663
- }
664
- var CancelledError = class extends Error {
665
- constructor(options) {
666
- super("CancelledError");
667
- this.revert = options?.revert;
668
- this.silent = options?.silent;
669
- }
670
- };
671
- function isCancelledError(value) {
672
- return value instanceof CancelledError;
673
- }
674
- function createRetryer(config) {
675
- let isRetryCancelled = false;
676
- let failureCount = 0;
677
- let continueFn;
678
- let status = "pending";
679
- let promiseResolve;
680
- let promiseReject;
681
- const promise = new Promise((resolve2, reject2) => {
682
- promiseResolve = resolve2;
683
- promiseReject = reject2;
684
- });
685
- promise.catch(noop);
686
- const isResolved = () => status !== "pending";
687
- const cancel = (cancelOptions) => {
688
- if (!isResolved()) {
689
- const error = new CancelledError(cancelOptions);
690
- reject(error);
691
- config.onCancel?.(error);
692
- }
693
- };
694
- const cancelRetry = () => {
695
- isRetryCancelled = true;
696
- };
697
- const continueRetry = () => {
698
- isRetryCancelled = false;
699
- };
700
- const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun();
701
- const canStart = () => canFetch(config.networkMode) && config.canRun();
702
- const resolve = (value) => {
703
- if (!isResolved()) {
704
- continueFn?.();
705
- status = "resolved";
706
- promiseResolve(value);
707
- }
708
- };
709
- const reject = (value) => {
710
- if (!isResolved()) {
711
- continueFn?.();
712
- status = "rejected";
713
- promiseReject(value);
714
- }
715
- };
716
- const pause = () => {
717
- return new Promise((continueResolve) => {
718
- continueFn = (value) => {
719
- if (isResolved() || canContinue()) continueResolve(value);
720
- };
721
- config.onPause?.();
722
- }).then(() => {
723
- continueFn = void 0;
724
- if (!isResolved()) config.onContinue?.();
725
- });
726
- };
727
- const run = () => {
728
- if (isResolved()) return;
729
- let promiseOrValue;
730
- const initialPromise = failureCount === 0 ? config.initialPromise : void 0;
731
- try {
732
- promiseOrValue = initialPromise ?? config.fn();
733
- } catch (error) {
734
- promiseOrValue = Promise.reject(error);
735
- }
736
- Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
737
- if (isResolved()) return;
738
- const retry = config.retry ?? (isServer2() ? 0 : 3);
739
- const retryDelay = config.retryDelay ?? defaultRetryDelay;
740
- const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
741
- const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
742
- if (isRetryCancelled || !shouldRetry) {
743
- reject(error);
744
- return;
745
- }
746
- failureCount++;
747
- config.onFail?.(failureCount, error);
748
- sleep(delay).then(() => {
749
- return canContinue() ? void 0 : pause();
750
- }).then(() => {
751
- if (isRetryCancelled) reject(error);
752
- else run();
753
- });
754
- });
755
- };
756
- return {
757
- promise,
758
- status: () => status,
759
- cancel,
760
- continue: () => {
761
- continueFn?.();
762
- return promise;
763
- },
764
- cancelRetry,
765
- continueRetry,
766
- canStart,
767
- start: () => {
768
- if (canStart()) run();
769
- else pause().then(run);
770
- return promise;
771
- }
772
- };
773
- }
774
-
775
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/removable.js
776
- var _gcTimeout, _a4;
777
- var Removable = (_a4 = class {
778
- constructor() {
779
- __privateAdd(this, _gcTimeout);
780
- }
781
- destroy() {
782
- this.clearGcTimeout();
783
- }
784
- scheduleGc() {
785
- this.clearGcTimeout();
786
- if (isValidTimeout(this.gcTime)) __privateSet(this, _gcTimeout, timeoutManager.setTimeout(() => {
787
- this.optionalRemove();
788
- }, this.gcTime));
789
- }
790
- updateGcTime(newGcTime) {
791
- this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer2() ? Infinity : 3e5));
792
- }
793
- clearGcTimeout() {
794
- if (__privateGet(this, _gcTimeout) !== void 0) {
795
- timeoutManager.clearTimeout(__privateGet(this, _gcTimeout));
796
- __privateSet(this, _gcTimeout, void 0);
797
- }
798
- }
799
- }, _gcTimeout = new WeakMap(), _a4);
800
-
801
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
802
- function infiniteQueryBehavior(pages) {
803
- return { onFetch: (context, query) => {
804
- const options = context.options;
805
- const direction = context.fetchOptions?.meta?.fetchMore?.direction;
806
- const oldPages = context.state.data?.pages || [];
807
- const oldPageParams = context.state.data?.pageParams || [];
808
- let result = {
809
- pages: [],
810
- pageParams: []
811
- };
812
- let currentPage = 0;
813
- const fetchFn = async () => {
814
- let cancelled = false;
815
- const addSignalProperty = (object) => {
816
- addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
817
- };
818
- const queryFn = ensureQueryFn(context.options, context.fetchOptions);
819
- const fetchPage = async (data, param, previous) => {
820
- if (cancelled) return Promise.reject(context.signal.reason);
821
- if (param == null && data.pages.length) return Promise.resolve(data);
822
- const createQueryFnContext = () => {
823
- const queryFnContext2 = {
824
- client: context.client,
825
- queryKey: context.queryKey,
826
- pageParam: param,
827
- direction: previous ? "backward" : "forward",
828
- meta: context.options.meta
829
- };
830
- addSignalProperty(queryFnContext2);
831
- return queryFnContext2;
832
- };
833
- const queryFnContext = createQueryFnContext();
834
- const page = await queryFn(queryFnContext);
835
- const { maxPages } = context.options;
836
- const addTo = previous ? addToStart : addToEnd;
837
- return {
838
- pages: addTo(data.pages, page, maxPages),
839
- pageParams: addTo(data.pageParams, param, maxPages)
840
- };
841
- };
842
- if (direction && oldPages.length) {
843
- const previous = direction === "backward";
844
- const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
845
- const oldData = {
846
- pages: oldPages,
847
- pageParams: oldPageParams
848
- };
849
- result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
850
- } else {
851
- const remainingPages = pages ?? oldPages.length;
852
- do {
853
- const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
854
- if (currentPage > 0 && param == null) break;
855
- result = await fetchPage(result, param);
856
- currentPage++;
857
- } while (currentPage < remainingPages);
858
- }
859
- return result;
860
- };
861
- if (context.options.persister) context.fetchFn = () => {
862
- return context.options.persister?.(fetchFn, {
863
- client: context.client,
864
- queryKey: context.queryKey,
865
- meta: context.options.meta,
866
- signal: context.signal
867
- }, query);
868
- };
869
- else context.fetchFn = fetchFn;
870
- } };
871
- }
872
- function getNextPageParam(options, { pages, pageParams }) {
873
- const lastIndex = pages.length - 1;
874
- return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
875
- }
876
- function getPreviousPageParam(options, { pages, pageParams }) {
877
- return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
878
- }
879
- function hasNextPage(options, data) {
880
- if (!data) return false;
881
- return getNextPageParam(options, data) != null;
882
- }
883
- function hasPreviousPage(options, data) {
884
- if (!data || !options.getPreviousPageParam) return false;
885
- return getPreviousPageParam(options, data) != null;
886
- }
887
-
888
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/query.js
889
- var _queryType, _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _a5;
890
- var Query = (_a5 = class extends Removable {
891
- constructor(config) {
892
- super();
893
- __privateAdd(this, _Query_instances);
894
- __privateAdd(this, _queryType);
895
- __privateAdd(this, _initialState);
896
- __privateAdd(this, _revertState);
897
- __privateAdd(this, _cache);
898
- __privateAdd(this, _client);
899
- __privateAdd(this, _retryer);
900
- __privateAdd(this, _defaultOptions);
901
- __privateAdd(this, _abortSignalConsumed);
902
- __privateSet(this, _abortSignalConsumed, false);
903
- __privateSet(this, _defaultOptions, config.defaultOptions);
904
- this.setOptions(config.options);
905
- this.observers = [];
906
- __privateSet(this, _client, config.client);
907
- __privateSet(this, _cache, __privateGet(this, _client).getQueryCache());
908
- this.queryKey = config.queryKey;
909
- this.queryHash = config.queryHash;
910
- __privateSet(this, _initialState, getDefaultState(this.options));
911
- this.state = config.state ?? __privateGet(this, _initialState);
912
- this.scheduleGc();
913
- }
914
- get meta() {
915
- return this.options.meta;
916
- }
917
- get queryType() {
918
- return __privateGet(this, _queryType);
919
- }
920
- get promise() {
921
- return __privateGet(this, _retryer)?.promise;
922
- }
923
- setOptions(options) {
924
- this.options = {
925
- ...__privateGet(this, _defaultOptions),
926
- ...options
927
- };
928
- if (options?._type) __privateSet(this, _queryType, options._type);
929
- this.updateGcTime(this.options.gcTime);
930
- if (this.state && this.state.data === void 0) {
931
- const defaultState = getDefaultState(this.options);
932
- if (defaultState.data !== void 0) {
933
- this.setState(successState(defaultState.data, defaultState.dataUpdatedAt));
934
- __privateSet(this, _initialState, defaultState);
935
- }
936
- }
937
- }
938
- optionalRemove() {
939
- if (!this.observers.length && this.state.fetchStatus === "idle") __privateGet(this, _cache).remove(this);
940
- }
941
- setData(newData, options) {
942
- const data = replaceData(this.state.data, newData, this.options);
943
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, {
944
- data,
945
- type: "success",
946
- dataUpdatedAt: options?.updatedAt,
947
- manual: options?.manual
948
- });
949
- return data;
950
- }
951
- setState(state) {
952
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, {
953
- type: "setState",
954
- state
955
- });
956
- }
957
- cancel(options) {
958
- const promise = __privateGet(this, _retryer)?.promise;
959
- __privateGet(this, _retryer)?.cancel(options);
960
- return promise ? promise.then(noop).catch(noop) : Promise.resolve();
961
- }
962
- destroy() {
963
- super.destroy();
964
- this.cancel({ silent: true });
965
- }
966
- get resetState() {
967
- return __privateGet(this, _initialState);
968
- }
969
- reset() {
970
- this.destroy();
971
- this.setState(this.resetState);
972
- }
973
- isActive() {
974
- return this.observers.some((observer) => resolveQueryValue(observer.options.enabled, this) !== false);
975
- }
976
- isDisabled() {
977
- if (this.getObserversCount() > 0) return !this.isActive();
978
- return this.options.queryFn === skipToken || !this.isFetched();
979
- }
980
- isFetched() {
981
- return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
982
- }
983
- isStatic() {
984
- if (this.getObserversCount() > 0) return this.observers.some((observer) => resolveQueryValue(observer.options.staleTime, this) === "static");
985
- return false;
986
- }
987
- isStale() {
988
- if (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);
989
- return this.state.data === void 0 || this.state.isInvalidated;
990
- }
991
- isStaleByTime(staleTime = 0) {
992
- if (this.state.data === void 0) return true;
993
- if (staleTime === "static") return false;
994
- if (this.state.isInvalidated) return true;
995
- return !timeUntilStale(this.state.dataUpdatedAt, staleTime);
996
- }
997
- onFocus() {
998
- this.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });
999
- __privateGet(this, _retryer)?.continue();
1000
- }
1001
- onOnline() {
1002
- this.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });
1003
- __privateGet(this, _retryer)?.continue();
1004
- }
1005
- addObserver(observer) {
1006
- if (!this.observers.includes(observer)) {
1007
- this.observers.push(observer);
1008
- this.clearGcTimeout();
1009
- __privateGet(this, _cache).notify({
1010
- type: "observerAdded",
1011
- query: this,
1012
- observer
1013
- });
1014
- }
1015
- }
1016
- removeObserver(observer) {
1017
- const index = this.observers.indexOf(observer);
1018
- if (index !== -1) {
1019
- this.observers.splice(index, 1);
1020
- if (!this.observers.length) {
1021
- if (__privateGet(this, _retryer)) {
1022
- if (__privateGet(this, _abortSignalConsumed) || this.state.fetchStatus === "paused" && this.state.status === "pending") __privateGet(this, _retryer).cancel({ revert: true });
1023
- else __privateGet(this, _retryer).cancelRetry();
1024
- }
1025
- this.scheduleGc();
1026
- }
1027
- __privateGet(this, _cache).notify({
1028
- type: "observerRemoved",
1029
- query: this,
1030
- observer
1031
- });
1032
- }
1033
- }
1034
- getObserversCount() {
1035
- return this.observers.length;
1036
- }
1037
- invalidate() {
1038
- if (!this.state.isInvalidated) __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" });
1039
- }
1040
- async fetch(options, fetchOptions) {
1041
- if (this.state.fetchStatus !== "idle" && __privateGet(this, _retryer)?.status() !== "rejected") {
1042
- if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
1043
- else if (__privateGet(this, _retryer)) {
1044
- __privateGet(this, _retryer).continueRetry();
1045
- return __privateGet(this, _retryer).promise;
1046
- }
1047
- }
1048
- if (options) this.setOptions(options);
1049
- if (!this.options.queryFn) {
1050
- const observer = this.observers.find((x) => x.options.queryFn);
1051
- if (observer) this.setOptions(observer.options);
1052
- }
1053
- if (false) {
1054
- if (!Array.isArray(this.options.queryKey)) console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);
1055
- }
1056
- const abortController = new AbortController();
1057
- const addSignalProperty = (object) => {
1058
- Object.defineProperty(object, "signal", {
1059
- enumerable: true,
1060
- get: () => {
1061
- __privateSet(this, _abortSignalConsumed, true);
1062
- return abortController.signal;
1063
- }
1064
- });
1065
- };
1066
- const fetchFn = () => {
1067
- const queryFn = ensureQueryFn(this.options, fetchOptions);
1068
- const createQueryFnContext = () => {
1069
- const queryFnContext2 = {
1070
- client: __privateGet(this, _client),
1071
- queryKey: this.queryKey,
1072
- meta: this.meta
1073
- };
1074
- addSignalProperty(queryFnContext2);
1075
- return queryFnContext2;
1076
- };
1077
- const queryFnContext = createQueryFnContext();
1078
- __privateSet(this, _abortSignalConsumed, false);
1079
- if (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);
1080
- return queryFn(queryFnContext);
1081
- };
1082
- const createFetchContext = () => {
1083
- const context2 = {
1084
- fetchOptions,
1085
- options: this.options,
1086
- queryKey: this.queryKey,
1087
- client: __privateGet(this, _client),
1088
- state: this.state,
1089
- fetchFn
1090
- };
1091
- addSignalProperty(context2);
1092
- return context2;
1093
- };
1094
- const context = createFetchContext();
1095
- (__privateGet(this, _queryType) === "infinite" ? infiniteQueryBehavior(this.options.pages) : this.options.behavior)?.onFetch(context, this);
1096
- __privateSet(this, _revertState, this.state);
1097
- if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) __privateMethod(this, _Query_instances, dispatch_fn).call(this, {
1098
- type: "fetch",
1099
- meta: context.fetchOptions?.meta
1100
- });
1101
- const retryer = __privateSet(this, _retryer, createRetryer({
1102
- initialPromise: fetchOptions?.initialPromise,
1103
- fn: context.fetchFn,
1104
- onCancel: (error) => {
1105
- if (error instanceof CancelledError && error.revert) this.setState({
1106
- ...__privateGet(this, _revertState),
1107
- fetchStatus: "idle"
1108
- });
1109
- abortController.abort();
1110
- },
1111
- onFail: (failureCount, error) => {
1112
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, {
1113
- type: "failed",
1114
- failureCount,
1115
- error
1116
- });
1117
- },
1118
- onPause: () => {
1119
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" });
1120
- },
1121
- onContinue: () => {
1122
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" });
1123
- },
1124
- retry: context.options.retry,
1125
- retryDelay: context.options.retryDelay,
1126
- networkMode: context.options.networkMode,
1127
- canRun: () => true
1128
- }));
1129
- try {
1130
- const data = await retryer.start();
1131
- if (data === void 0) {
1132
- if (false) console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
1133
- throw new Error(`${this.queryHash} data is undefined`);
1134
- }
1135
- this.setData(data);
1136
- __privateGet(this, _cache).config.onSuccess?.(data, this);
1137
- __privateGet(this, _cache).config.onSettled?.(data, this.state.error, this);
1138
- return data;
1139
- } catch (error) {
1140
- if (error instanceof CancelledError) {
1141
- if (error.silent) return __privateGet(this, _retryer).promise;
1142
- else if (error.revert) {
1143
- if (this.state.data === void 0) throw error;
1144
- return this.state.data;
1145
- }
1146
- }
1147
- __privateMethod(this, _Query_instances, dispatch_fn).call(this, {
1148
- type: "error",
1149
- error
1150
- });
1151
- __privateGet(this, _cache).config.onError?.(error, this);
1152
- __privateGet(this, _cache).config.onSettled?.(this.state.data, error, this);
1153
- throw error;
1154
- } finally {
1155
- if (__privateGet(this, _retryer) === retryer) __privateSet(this, _retryer, void 0);
1156
- this.scheduleGc();
1157
- }
1158
- }
1159
- }, _queryType = new WeakMap(), _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _client = new WeakMap(), _retryer = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _Query_instances = new WeakSet(), dispatch_fn = function(action) {
1160
- const reducer = (state) => {
1161
- switch (action.type) {
1162
- case "failed":
1163
- return {
1164
- ...state,
1165
- fetchFailureCount: action.failureCount,
1166
- fetchFailureReason: action.error
1167
- };
1168
- case "pause":
1169
- return {
1170
- ...state,
1171
- fetchStatus: "paused"
1172
- };
1173
- case "continue":
1174
- return {
1175
- ...state,
1176
- fetchStatus: "fetching"
1177
- };
1178
- case "fetch":
1179
- return {
1180
- ...state,
1181
- ...fetchState(state.data, this.options),
1182
- fetchMeta: action.meta ?? null
1183
- };
1184
- case "success":
1185
- const newState = {
1186
- ...state,
1187
- ...successState(action.data, action.dataUpdatedAt),
1188
- dataUpdateCount: state.dataUpdateCount + 1,
1189
- ...!action.manual && {
1190
- fetchStatus: "idle",
1191
- fetchFailureCount: 0,
1192
- fetchFailureReason: null
1193
- }
1194
- };
1195
- __privateSet(this, _revertState, action.manual ? newState : void 0);
1196
- return newState;
1197
- case "error":
1198
- const error = action.error;
1199
- return {
1200
- ...state,
1201
- error,
1202
- errorUpdateCount: state.errorUpdateCount + 1,
1203
- errorUpdatedAt: Date.now(),
1204
- fetchFailureCount: state.fetchFailureCount + 1,
1205
- fetchFailureReason: error,
1206
- fetchStatus: "idle",
1207
- status: "error",
1208
- isInvalidated: true
1209
- };
1210
- case "invalidate":
1211
- return {
1212
- ...state,
1213
- isInvalidated: true
1214
- };
1215
- case "setState":
1216
- return {
1217
- ...state,
1218
- ...action.state
1219
- };
1220
- }
1221
- };
1222
- this.state = reducer(this.state);
1223
- notifyManager.batch(() => {
1224
- this.observers.slice().forEach((observer) => {
1225
- observer.onQueryUpdate();
1226
- });
1227
- __privateGet(this, _cache).notify({
1228
- query: this,
1229
- type: "updated",
1230
- action
1231
- });
1232
- });
1233
- }, _a5);
1234
- function fetchState(data, options) {
1235
- return {
1236
- fetchFailureCount: 0,
1237
- fetchFailureReason: null,
1238
- fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
1239
- ...data === void 0 && {
1240
- error: null,
1241
- status: "pending"
1242
- }
1243
- };
1244
- }
1245
- function successState(data, dataUpdatedAt) {
1246
- return {
1247
- data,
1248
- dataUpdatedAt: dataUpdatedAt ?? Date.now(),
1249
- error: null,
1250
- isInvalidated: false,
1251
- status: "success"
1252
- };
1253
- }
1254
- function getDefaultState(options) {
1255
- const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
1256
- const hasData = data !== void 0;
1257
- const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
1258
- return {
1259
- data,
1260
- dataUpdateCount: 0,
1261
- dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,
1262
- error: null,
1263
- errorUpdateCount: 0,
1264
- errorUpdatedAt: 0,
1265
- fetchFailureCount: 0,
1266
- fetchFailureReason: null,
1267
- fetchMeta: null,
1268
- isInvalidated: false,
1269
- status: hasData ? "success" : "pending",
1270
- fetchStatus: "idle"
1271
- };
1272
- }
1273
-
1274
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/queryObserver.js
1275
- var _client2, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, shouldScheduleTimer_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, _a6;
1276
- var QueryObserver = (_a6 = class extends Subscribable {
1277
- constructor(client, options) {
1278
- super();
1279
- __privateAdd(this, _QueryObserver_instances);
1280
- __privateAdd(this, _client2);
1281
- __privateAdd(this, _currentQuery);
1282
- __privateAdd(this, _currentQueryInitialState);
1283
- __privateAdd(this, _currentResult);
1284
- __privateAdd(this, _currentResultState);
1285
- __privateAdd(this, _currentResultOptions);
1286
- __privateAdd(this, _selectError);
1287
- __privateAdd(this, _selectFn);
1288
- __privateAdd(this, _selectResult);
1289
- __privateAdd(this, _lastQueryWithDefinedData);
1290
- __privateAdd(this, _staleTimeoutId);
1291
- __privateAdd(this, _refetchIntervalId);
1292
- __privateAdd(this, _currentRefetchInterval);
1293
- __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set());
1294
- this.options = options;
1295
- __privateSet(this, _client2, client);
1296
- __privateSet(this, _selectError, null);
1297
- this.bindMethods();
1298
- this.setOptions(options);
1299
- }
1300
- bindMethods() {
1301
- this.refetch = this.refetch.bind(this);
1302
- }
1303
- onSubscribe() {
1304
- if (this.listeners.size === 1) {
1305
- __privateGet(this, _currentQuery).addObserver(this);
1306
- if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
1307
- else this.updateResult();
1308
- __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this);
1309
- }
1310
- }
1311
- onUnsubscribe() {
1312
- if (!this.hasListeners()) this.destroy();
1313
- }
1314
- shouldFetchOnReconnect() {
1315
- return shouldFetchOn(__privateGet(this, _currentQuery), this.options, this.options.refetchOnReconnect);
1316
- }
1317
- shouldFetchOnWindowFocus() {
1318
- return shouldFetchOn(__privateGet(this, _currentQuery), this.options, this.options.refetchOnWindowFocus);
1319
- }
1320
- destroy() {
1321
- this.listeners = /* @__PURE__ */ new Set();
1322
- __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this);
1323
- __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this);
1324
- __privateGet(this, _currentQuery).removeObserver(this);
1325
- }
1326
- setOptions(options) {
1327
- const prevOptions = this.options;
1328
- const prevQuery = __privateGet(this, _currentQuery);
1329
- this.options = __privateGet(this, _client2).defaultQueryOptions(options);
1330
- if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveQueryValue(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
1331
- __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this);
1332
- __privateGet(this, _currentQuery).setOptions(this.options);
1333
- if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) __privateGet(this, _client2).getQueryCache().notify({
1334
- type: "observerOptionsUpdated",
1335
- query: __privateGet(this, _currentQuery),
1336
- observer: this
1337
- });
1338
- const mounted = this.hasListeners();
1339
- if (mounted && shouldFetchOptionally(__privateGet(this, _currentQuery), prevQuery, this.options, prevOptions)) __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
1340
- this.updateResult();
1341
- if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveQueryValue(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveQueryValue(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveQueryValue(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveQueryValue(prevOptions.staleTime, __privateGet(this, _currentQuery)))) __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this);
1342
- const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this);
1343
- if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveQueryValue(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveQueryValue(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval);
1344
- }
1345
- getOptimisticResult(options) {
1346
- const query = __privateGet(this, _client2).getQueryCache().build(__privateGet(this, _client2), options);
1347
- const result = this.createResult(query, options);
1348
- if (!shallowEqualObjects(this.getCurrentResult(), result)) {
1349
- __privateSet(this, _currentResult, result);
1350
- __privateSet(this, _currentResultOptions, this.options);
1351
- __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
1352
- }
1353
- return result;
1354
- }
1355
- getCurrentResult() {
1356
- return __privateGet(this, _currentResult);
1357
- }
1358
- trackResult(result, onPropTracked) {
1359
- return new Proxy(result, { get: (target, key) => {
1360
- this.trackProp(key);
1361
- onPropTracked?.(key);
1362
- return Reflect.get(target, key);
1363
- } });
1364
- }
1365
- trackProp(key) {
1366
- __privateGet(this, _trackedProps).add(key);
1367
- }
1368
- getCurrentQuery() {
1369
- return __privateGet(this, _currentQuery);
1370
- }
1371
- refetch({ ...options } = {}) {
1372
- return this.fetch({ ...options });
1373
- }
1374
- fetchOptimistic(options) {
1375
- const defaultedOptions = __privateGet(this, _client2).defaultQueryOptions(options);
1376
- const query = __privateGet(this, _client2).getQueryCache().build(__privateGet(this, _client2), defaultedOptions);
1377
- let unsubscribe = () => {
1378
- };
1379
- let resolveEarly;
1380
- const cachePromise = new Promise((resolve) => {
1381
- resolveEarly = resolve;
1382
- unsubscribe = __privateGet(this, _client2).getQueryCache().subscribe((event) => {
1383
- if (event.type === "updated" && event.query.queryHash === query.queryHash && query.state.data !== void 0) {
1384
- unsubscribe();
1385
- resolve(this.createResult(query, defaultedOptions));
1386
- }
1387
- });
1388
- });
1389
- return Promise.race([query.fetch().then(() => {
1390
- const result = this.createResult(query, defaultedOptions);
1391
- resolveEarly?.(result);
1392
- return result;
1393
- }).finally(() => {
1394
- unsubscribe();
1395
- }), cachePromise]);
1396
- }
1397
- fetch(fetchOptions) {
1398
- return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, {
1399
- ...fetchOptions,
1400
- cancelRefetch: fetchOptions.cancelRefetch ?? true
1401
- }).then(() => {
1402
- this.updateResult();
1403
- return __privateGet(this, _currentResult);
1404
- });
1405
- }
1406
- createResult(query, options) {
1407
- const prevQuery = __privateGet(this, _currentQuery);
1408
- const prevOptions = this.options;
1409
- const prevResult = __privateGet(this, _currentResult);
1410
- const prevResultState = __privateGet(this, _currentResultState);
1411
- const prevResultOptions = __privateGet(this, _currentResultOptions);
1412
- const queryInitialState = query !== prevQuery ? query.state : __privateGet(this, _currentQueryInitialState);
1413
- const { state } = query;
1414
- let newState = { ...state };
1415
- let isPlaceholderData = false;
1416
- let data;
1417
- if (options._optimisticResults) {
1418
- const mounted = this.hasListeners();
1419
- const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
1420
- const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
1421
- if (fetchOnMount || fetchOptionally) newState = {
1422
- ...newState,
1423
- ...fetchState(state.data, query.options)
1424
- };
1425
- if (options._optimisticResults === "isRestoring") newState.fetchStatus = "idle";
1426
- }
1427
- let { error, errorUpdatedAt, status } = newState;
1428
- data = newState.data;
1429
- let skipSelect = false;
1430
- if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
1431
- let placeholderData;
1432
- if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
1433
- placeholderData = prevResult.data;
1434
- skipSelect = true;
1435
- } else placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(__privateGet(this, _lastQueryWithDefinedData)?.state.data, __privateGet(this, _lastQueryWithDefinedData)) : options.placeholderData;
1436
- if (placeholderData !== void 0) {
1437
- status = "success";
1438
- data = replaceData(prevResult?.data, placeholderData, options);
1439
- isPlaceholderData = true;
1440
- }
1441
- }
1442
- if (options.select && data !== void 0 && !skipSelect) {
1443
- if (prevResult && data === prevResultState?.data && options.select === __privateGet(this, _selectFn)) data = __privateGet(this, _selectResult);
1444
- else try {
1445
- __privateSet(this, _selectFn, options.select);
1446
- data = options.select(data);
1447
- data = replaceData(prevResult?.data, data, options);
1448
- __privateSet(this, _selectResult, data);
1449
- __privateSet(this, _selectError, null);
1450
- } catch (selectError) {
1451
- __privateSet(this, _selectError, selectError);
1452
- }
1453
- } else if (data === void 0) __privateSet(this, _selectError, null);
1454
- if (__privateGet(this, _selectError)) {
1455
- error = __privateGet(this, _selectError);
1456
- data = __privateGet(this, _selectResult);
1457
- errorUpdatedAt = Date.now();
1458
- status = "error";
1459
- isPlaceholderData = false;
1460
- }
1461
- const isFetching = newState.fetchStatus === "fetching";
1462
- const isPending = status === "pending";
1463
- const isError = status === "error";
1464
- const isLoading = isPending && isFetching;
1465
- const hasData = data !== void 0;
1466
- return {
1467
- status,
1468
- fetchStatus: newState.fetchStatus,
1469
- isPending,
1470
- isSuccess: status === "success",
1471
- isError,
1472
- isInitialLoading: isLoading,
1473
- isLoading,
1474
- data,
1475
- dataUpdatedAt: newState.dataUpdatedAt,
1476
- error,
1477
- errorUpdatedAt,
1478
- failureCount: newState.fetchFailureCount,
1479
- failureReason: newState.fetchFailureReason,
1480
- errorUpdateCount: newState.errorUpdateCount,
1481
- isFetched: query.isFetched(),
1482
- isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
1483
- isFetching,
1484
- isRefetching: isFetching && !isPending,
1485
- isLoadingError: isError && !hasData,
1486
- isPaused: newState.fetchStatus === "paused",
1487
- isPlaceholderData,
1488
- isRefetchError: isError && hasData,
1489
- isStale: isStale(query, options),
1490
- refetch: this.refetch,
1491
- isEnabled: resolveQueryValue(options.enabled, query) !== false
1492
- };
1493
- }
1494
- updateResult() {
1495
- const prevResult = __privateGet(this, _currentResult);
1496
- const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options);
1497
- __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
1498
- __privateSet(this, _currentResultOptions, this.options);
1499
- if (__privateGet(this, _currentResultState).data !== void 0) __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery));
1500
- if (shallowEqualObjects(nextResult, prevResult)) return;
1501
- __privateSet(this, _currentResult, nextResult);
1502
- const shouldNotifyListeners = () => {
1503
- if (!prevResult) return true;
1504
- const { notifyOnChangeProps } = this.options;
1505
- const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
1506
- if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) return true;
1507
- const includedProps = new Set(notifyOnChangePropsValue ?? __privateGet(this, _trackedProps));
1508
- if (this.options.throwOnError) includedProps.add("error");
1509
- return Object.keys(__privateGet(this, _currentResult)).some((key) => {
1510
- const typedKey = key;
1511
- return __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey] && includedProps.has(typedKey);
1512
- });
1513
- };
1514
- const notifyListeners = shouldNotifyListeners();
1515
- notifyManager.batch(() => {
1516
- if (notifyListeners) this.listeners.forEach((listener) => {
1517
- listener(__privateGet(this, _currentResult));
1518
- });
1519
- __privateGet(this, _client2).getQueryCache().notify({
1520
- query: __privateGet(this, _currentQuery),
1521
- type: "observerResultsUpdated"
1522
- });
1523
- });
1524
- }
1525
- onQueryUpdate() {
1526
- this.updateResult();
1527
- if (this.hasListeners()) __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this);
1528
- }
1529
- }, _client2 = new WeakMap(), _currentQuery = new WeakMap(), _currentQueryInitialState = new WeakMap(), _currentResult = new WeakMap(), _currentResultState = new WeakMap(), _currentResultOptions = new WeakMap(), _selectError = new WeakMap(), _selectFn = new WeakMap(), _selectResult = new WeakMap(), _lastQueryWithDefinedData = new WeakMap(), _staleTimeoutId = new WeakMap(), _refetchIntervalId = new WeakMap(), _currentRefetchInterval = new WeakMap(), _trackedProps = new WeakMap(), _QueryObserver_instances = new WeakSet(), executeFetch_fn = function(fetchOptions) {
1530
- __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this);
1531
- let promise = __privateGet(this, _currentQuery).fetch(this.options, fetchOptions);
1532
- if (!fetchOptions?.throwOnError) promise = promise.catch(noop);
1533
- return promise;
1534
- }, shouldScheduleTimer_fn = function(timeout) {
1535
- return !isServer2() && resolveQueryValue(this.options.enabled, __privateGet(this, _currentQuery)) !== false && isValidTimeout(timeout);
1536
- }, updateStaleTimeout_fn = function() {
1537
- __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this);
1538
- const staleTime = resolveQueryValue(this.options.staleTime, __privateGet(this, _currentQuery));
1539
- if (__privateGet(this, _currentResult).isStale || !__privateMethod(this, _QueryObserver_instances, shouldScheduleTimer_fn).call(this, staleTime)) return;
1540
- const timeout = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime) + 1;
1541
- __privateSet(this, _staleTimeoutId, timeoutManager.setTimeout(() => {
1542
- if (!__privateGet(this, _currentResult).isStale) this.updateResult();
1543
- }, timeout));
1544
- }, computeRefetchInterval_fn = function() {
1545
- return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false;
1546
- }, updateRefetchInterval_fn = function(nextInterval) {
1547
- __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this);
1548
- __privateSet(this, _currentRefetchInterval, nextInterval);
1549
- if (__privateGet(this, _currentRefetchInterval) === 0 || !__privateMethod(this, _QueryObserver_instances, shouldScheduleTimer_fn).call(this, __privateGet(this, _currentRefetchInterval))) return;
1550
- __privateSet(this, _refetchIntervalId, timeoutManager.setInterval(() => {
1551
- if (this.options.refetchIntervalInBackground || focusManager.isFocused()) __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
1552
- }, __privateGet(this, _currentRefetchInterval)));
1553
- }, updateTimers_fn = function() {
1554
- __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this);
1555
- __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this));
1556
- }, clearStaleTimeout_fn = function() {
1557
- if (__privateGet(this, _staleTimeoutId) !== void 0) {
1558
- timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId));
1559
- __privateSet(this, _staleTimeoutId, void 0);
1560
- }
1561
- }, clearRefetchInterval_fn = function() {
1562
- if (__privateGet(this, _refetchIntervalId) !== void 0) {
1563
- timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId));
1564
- __privateSet(this, _refetchIntervalId, void 0);
1565
- }
1566
- }, updateQuery_fn = function() {
1567
- const query = __privateGet(this, _client2).getQueryCache().build(__privateGet(this, _client2), this.options);
1568
- if (query === __privateGet(this, _currentQuery)) return;
1569
- const prevQuery = __privateGet(this, _currentQuery);
1570
- __privateSet(this, _currentQuery, query);
1571
- __privateSet(this, _currentQueryInitialState, query.state);
1572
- if (this.hasListeners()) {
1573
- prevQuery?.removeObserver(this);
1574
- query.addObserver(this);
1575
- }
1576
- }, _a6);
1577
- function shouldLoadOnMount(query, options) {
1578
- return resolveQueryValue(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && resolveQueryValue(options.retryOnMount, query) === false);
1579
- }
1580
- function shouldFetchOnMount(query, options) {
1581
- return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
1582
- }
1583
- function shouldFetchOn(query, options, field) {
1584
- if (resolveQueryValue(options.enabled, query) !== false && resolveQueryValue(options.staleTime, query) !== "static") {
1585
- const value = typeof field === "function" ? field(query) : field;
1586
- return value === "always" || value !== false && isStale(query, options);
1587
- }
1588
- return false;
1589
- }
1590
- function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
1591
- return (query !== prevQuery || resolveQueryValue(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
1592
- }
1593
- function isStale(query, options) {
1594
- return resolveQueryValue(options.enabled, query) !== false && query.isStaleByTime(resolveQueryValue(options.staleTime, query));
1595
- }
1596
-
1597
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js
1598
- var InfiniteQueryObserver = class extends QueryObserver {
1599
- constructor(client, options) {
1600
- super(client, options);
1601
- }
1602
- bindMethods() {
1603
- super.bindMethods();
1604
- this.fetchNextPage = this.fetchNextPage.bind(this);
1605
- this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
1606
- }
1607
- setOptions(options) {
1608
- options._type = "infinite";
1609
- super.setOptions(options);
1610
- }
1611
- getOptimisticResult(options) {
1612
- options._type = "infinite";
1613
- return super.getOptimisticResult(options);
1614
- }
1615
- fetchNextPage(options) {
1616
- return this.fetch({
1617
- ...options,
1618
- meta: { fetchMore: { direction: "forward" } }
1619
- });
1620
- }
1621
- fetchPreviousPage(options) {
1622
- return this.fetch({
1623
- ...options,
1624
- meta: { fetchMore: { direction: "backward" } }
1625
- });
1626
- }
1627
- createResult(query, options) {
1628
- const { state } = query;
1629
- const parentResult = super.createResult(query, options);
1630
- const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
1631
- const fetchDirection = state.fetchMeta?.fetchMore?.direction;
1632
- const isFetchNextPageError = isError && fetchDirection === "forward";
1633
- const isFetchingNextPage = isFetching && fetchDirection === "forward";
1634
- const isFetchPreviousPageError = isError && fetchDirection === "backward";
1635
- const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
1636
- return {
1637
- ...parentResult,
1638
- fetchNextPage: this.fetchNextPage,
1639
- fetchPreviousPage: this.fetchPreviousPage,
1640
- hasNextPage: hasNextPage(options, state.data),
1641
- hasPreviousPage: hasPreviousPage(options, state.data),
1642
- isFetchNextPageError,
1643
- isFetchingNextPage,
1644
- isFetchPreviousPageError,
1645
- isFetchingPreviousPage,
1646
- isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
1647
- isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
1648
- };
1649
- }
1650
- };
1651
-
1652
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/mutation.js
1653
- var _client3, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _a7;
1654
- var Mutation = (_a7 = class extends Removable {
1655
- constructor(config) {
1656
- super();
1657
- __privateAdd(this, _Mutation_instances);
1658
- __privateAdd(this, _client3);
1659
- __privateAdd(this, _observers);
1660
- __privateAdd(this, _mutationCache);
1661
- __privateAdd(this, _retryer2);
1662
- __privateSet(this, _client3, config.client);
1663
- this.mutationId = config.mutationId;
1664
- __privateSet(this, _mutationCache, config.mutationCache);
1665
- __privateSet(this, _observers, []);
1666
- this.state = config.state || getDefaultState2();
1667
- this.setOptions(config.options);
1668
- this.scheduleGc();
1669
- }
1670
- setOptions(options) {
1671
- this.options = options;
1672
- this.updateGcTime(this.options.gcTime);
1673
- }
1674
- get meta() {
1675
- return this.options.meta;
1676
- }
1677
- addObserver(observer) {
1678
- if (!__privateGet(this, _observers).includes(observer)) {
1679
- __privateGet(this, _observers).push(observer);
1680
- this.clearGcTimeout();
1681
- __privateGet(this, _mutationCache).notify({
1682
- type: "observerAdded",
1683
- mutation: this,
1684
- observer
1685
- });
1686
- }
1687
- }
1688
- removeObserver(observer) {
1689
- __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer));
1690
- this.scheduleGc();
1691
- __privateGet(this, _mutationCache).notify({
1692
- type: "observerRemoved",
1693
- mutation: this,
1694
- observer
1695
- });
1696
- }
1697
- optionalRemove() {
1698
- if (!__privateGet(this, _observers).length) {
1699
- if (this.state.status === "pending") this.scheduleGc();
1700
- else __privateGet(this, _mutationCache).remove(this);
1701
- }
1702
- }
1703
- continue() {
1704
- return __privateGet(this, _retryer2)?.continue() ?? (this.state.status === "pending" ? this.execute(this.state.variables) : Promise.resolve());
1705
- }
1706
- async execute(variables) {
1707
- const onContinue = () => {
1708
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "continue" });
1709
- };
1710
- const mutationFnContext = {
1711
- client: __privateGet(this, _client3),
1712
- meta: this.options.meta,
1713
- mutationKey: this.options.mutationKey
1714
- };
1715
- const retryer = __privateSet(this, _retryer2, createRetryer({
1716
- fn: () => {
1717
- if (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error("No mutationFn found"));
1718
- return this.options.mutationFn(variables, mutationFnContext);
1719
- },
1720
- onFail: (failureCount, error) => {
1721
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, {
1722
- type: "failed",
1723
- failureCount,
1724
- error
1725
- });
1726
- },
1727
- onPause: () => {
1728
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pause" });
1729
- },
1730
- onContinue,
1731
- retry: this.options.retry ?? 0,
1732
- retryDelay: this.options.retryDelay,
1733
- networkMode: this.options.networkMode,
1734
- canRun: () => __privateGet(this, _mutationCache).canRun(this)
1735
- }));
1736
- const restored = this.state.status === "pending";
1737
- const isPaused = !retryer.canStart();
1738
- try {
1739
- if (restored) onContinue();
1740
- else {
1741
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, {
1742
- type: "pending",
1743
- variables,
1744
- isPaused
1745
- });
1746
- if (__privateGet(this, _mutationCache).config.onMutate) await __privateGet(this, _mutationCache).config.onMutate(variables, this, mutationFnContext);
1747
- const context = await this.options.onMutate?.(variables, mutationFnContext);
1748
- if (context !== this.state.context) __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, {
1749
- type: "pending",
1750
- context,
1751
- variables,
1752
- isPaused
1753
- });
1754
- }
1755
- const data = await retryer.start();
1756
- await __privateGet(this, _mutationCache).config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);
1757
- await this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);
1758
- await __privateGet(this, _mutationCache).config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);
1759
- await this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);
1760
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, {
1761
- type: "success",
1762
- data
1763
- });
1764
- return data;
1765
- } catch (error) {
1766
- try {
1767
- await __privateGet(this, _mutationCache).config.onError?.(error, variables, this.state.context, this, mutationFnContext);
1768
- } catch (e) {
1769
- Promise.reject(e);
1770
- }
1771
- try {
1772
- await this.options.onError?.(error, variables, this.state.context, mutationFnContext);
1773
- } catch (e) {
1774
- Promise.reject(e);
1775
- }
1776
- try {
1777
- await __privateGet(this, _mutationCache).config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);
1778
- } catch (e) {
1779
- Promise.reject(e);
1780
- }
1781
- try {
1782
- await this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);
1783
- } catch (e) {
1784
- Promise.reject(e);
1785
- }
1786
- __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, {
1787
- type: "error",
1788
- error
1789
- });
1790
- throw error;
1791
- } finally {
1792
- if (__privateGet(this, _retryer2) === retryer) __privateSet(this, _retryer2, void 0);
1793
- __privateGet(this, _mutationCache).runNext(this);
1794
- }
1795
- }
1796
- }, _client3 = new WeakMap(), _observers = new WeakMap(), _mutationCache = new WeakMap(), _retryer2 = new WeakMap(), _Mutation_instances = new WeakSet(), dispatch_fn2 = function(action) {
1797
- const reducer = (state) => {
1798
- switch (action.type) {
1799
- case "failed":
1800
- return {
1801
- ...state,
1802
- failureCount: action.failureCount,
1803
- failureReason: action.error
1804
- };
1805
- case "pause":
1806
- return {
1807
- ...state,
1808
- isPaused: true
1809
- };
1810
- case "continue":
1811
- return {
1812
- ...state,
1813
- isPaused: false
1814
- };
1815
- case "pending":
1816
- return {
1817
- ...state,
1818
- context: action.context,
1819
- data: void 0,
1820
- failureCount: 0,
1821
- failureReason: null,
1822
- error: null,
1823
- isPaused: action.isPaused,
1824
- status: "pending",
1825
- variables: action.variables,
1826
- submittedAt: Date.now()
1827
- };
1828
- case "success":
1829
- return {
1830
- ...state,
1831
- data: action.data,
1832
- failureCount: 0,
1833
- failureReason: null,
1834
- error: null,
1835
- status: "success",
1836
- isPaused: false
1837
- };
1838
- case "error":
1839
- return {
1840
- ...state,
1841
- data: void 0,
1842
- error: action.error,
1843
- failureCount: state.failureCount + 1,
1844
- failureReason: action.error,
1845
- isPaused: false,
1846
- status: "error"
1847
- };
1848
- }
1849
- };
1850
- this.state = reducer(this.state);
1851
- notifyManager.batch(() => {
1852
- __privateGet(this, _observers).forEach((observer) => {
1853
- observer.onMutationUpdate(action);
1854
- });
1855
- __privateGet(this, _mutationCache).notify({
1856
- mutation: this,
1857
- type: "updated",
1858
- action
1859
- });
1860
- });
1861
- }, _a7);
1862
- function getDefaultState2() {
1863
- return {
1864
- context: void 0,
1865
- data: void 0,
1866
- error: null,
1867
- failureCount: 0,
1868
- failureReason: null,
1869
- isPaused: false,
1870
- status: "idle",
1871
- variables: void 0,
1872
- submittedAt: 0
1873
- };
1874
- }
1875
-
1876
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/mutationCache.js
1877
- var _mutations, _scopes, _mutationId, _a8;
1878
- var MutationCache = (_a8 = class extends Subscribable {
1879
- constructor(config = {}) {
1880
- super();
1881
- __privateAdd(this, _mutations);
1882
- __privateAdd(this, _scopes);
1883
- __privateAdd(this, _mutationId);
1884
- this.config = config;
1885
- __privateSet(this, _mutations, /* @__PURE__ */ new Set());
1886
- __privateSet(this, _scopes, /* @__PURE__ */ new Map());
1887
- __privateSet(this, _mutationId, 0);
1888
- }
1889
- build(client, options, state) {
1890
- const mutation = new Mutation({
1891
- client,
1892
- mutationCache: this,
1893
- mutationId: ++__privateWrapper(this, _mutationId)._,
1894
- options: client.defaultMutationOptions(options),
1895
- state
1896
- });
1897
- this.add(mutation);
1898
- return mutation;
1899
- }
1900
- add(mutation) {
1901
- __privateGet(this, _mutations).add(mutation);
1902
- const scope = scopeFor(mutation);
1903
- if (typeof scope === "string") {
1904
- const scopedMutations = __privateGet(this, _scopes).get(scope);
1905
- if (scopedMutations) scopedMutations.push(mutation);
1906
- else __privateGet(this, _scopes).set(scope, [mutation]);
1907
- }
1908
- this.notify({
1909
- type: "added",
1910
- mutation
1911
- });
1912
- }
1913
- remove(mutation) {
1914
- if (__privateGet(this, _mutations).delete(mutation)) {
1915
- const scope = scopeFor(mutation);
1916
- if (typeof scope === "string") {
1917
- const scopedMutations = __privateGet(this, _scopes).get(scope);
1918
- if (scopedMutations) {
1919
- if (scopedMutations.length > 1) {
1920
- const index = scopedMutations.indexOf(mutation);
1921
- if (index !== -1) scopedMutations.splice(index, 1);
1922
- } else if (scopedMutations[0] === mutation) __privateGet(this, _scopes).delete(scope);
1923
- }
1924
- }
1925
- }
1926
- this.notify({
1927
- type: "removed",
1928
- mutation
1929
- });
1930
- }
1931
- canRun(mutation) {
1932
- const scope = scopeFor(mutation);
1933
- if (typeof scope === "string") {
1934
- const firstPendingMutation = __privateGet(this, _scopes).get(scope)?.find((m) => m.state.status === "pending");
1935
- return !firstPendingMutation || firstPendingMutation === mutation;
1936
- } else return true;
1937
- }
1938
- runNext(mutation) {
1939
- const scope = scopeFor(mutation);
1940
- if (typeof scope === "string") return __privateGet(this, _scopes).get(scope)?.find((m) => m !== mutation && m.state.isPaused)?.continue() ?? Promise.resolve();
1941
- else return Promise.resolve();
1942
- }
1943
- clear() {
1944
- notifyManager.batch(() => {
1945
- __privateGet(this, _mutations).forEach((mutation) => {
1946
- this.notify({
1947
- type: "removed",
1948
- mutation
1949
- });
1950
- });
1951
- __privateGet(this, _mutations).clear();
1952
- __privateGet(this, _scopes).clear();
1953
- });
1954
- }
1955
- getAll() {
1956
- return Array.from(__privateGet(this, _mutations));
1957
- }
1958
- find(filters) {
1959
- const defaultedFilters = {
1960
- exact: true,
1961
- ...filters
1962
- };
1963
- return this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));
1964
- }
1965
- findAll(filters = {}) {
1966
- return this.getAll().filter((mutation) => matchMutation(filters, mutation));
1967
- }
1968
- notify(event) {
1969
- notifyManager.batch(() => {
1970
- this.listeners.forEach((listener) => {
1971
- listener(event);
1972
- });
1973
- });
1974
- }
1975
- resumePausedMutations() {
1976
- const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
1977
- return notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));
1978
- }
1979
- }, _mutations = new WeakMap(), _scopes = new WeakMap(), _mutationId = new WeakMap(), _a8);
1980
- function scopeFor(mutation) {
1981
- return mutation.options.scope?.id;
1982
- }
1983
-
1984
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
1985
- var _client4, _currentResult2, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn, _a9;
1986
- var MutationObserver = (_a9 = class extends Subscribable {
1987
- constructor(client, options) {
1988
- super();
1989
- __privateAdd(this, _MutationObserver_instances);
1990
- __privateAdd(this, _client4);
1991
- __privateAdd(this, _currentResult2);
1992
- __privateAdd(this, _currentMutation);
1993
- __privateAdd(this, _mutateOptions);
1994
- __privateSet(this, _client4, client);
1995
- this.setOptions(options);
1996
- this.bindMethods();
1997
- __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
1998
- }
1999
- bindMethods() {
2000
- this.mutate = this.mutate.bind(this);
2001
- this.reset = this.reset.bind(this);
2002
- }
2003
- setOptions(options) {
2004
- const prevOptions = this.options;
2005
- this.options = __privateGet(this, _client4).defaultMutationOptions(options);
2006
- if (!shallowEqualObjects(this.options, prevOptions)) __privateGet(this, _client4).getMutationCache().notify({
2007
- type: "observerOptionsUpdated",
2008
- mutation: __privateGet(this, _currentMutation),
2009
- observer: this
2010
- });
2011
- if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();
2012
- else if (__privateGet(this, _currentMutation)?.state.status === "pending") __privateGet(this, _currentMutation).setOptions(this.options);
2013
- }
2014
- onSubscribe() {
2015
- if (this.listeners.size === 1 && __privateGet(this, _currentMutation)) {
2016
- __privateGet(this, _currentMutation).addObserver(this);
2017
- __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
2018
- }
2019
- }
2020
- onUnsubscribe() {
2021
- if (!this.hasListeners()) __privateGet(this, _currentMutation)?.removeObserver(this);
2022
- }
2023
- onMutationUpdate(action) {
2024
- __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
2025
- __privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action);
2026
- }
2027
- getCurrentResult() {
2028
- return __privateGet(this, _currentResult2);
2029
- }
2030
- reset() {
2031
- __privateGet(this, _currentMutation)?.removeObserver(this);
2032
- __privateSet(this, _currentMutation, void 0);
2033
- __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
2034
- __privateMethod(this, _MutationObserver_instances, notify_fn).call(this);
2035
- }
2036
- mutate(variables, options) {
2037
- __privateSet(this, _mutateOptions, options);
2038
- __privateGet(this, _currentMutation)?.removeObserver(this);
2039
- __privateSet(this, _currentMutation, __privateGet(this, _client4).getMutationCache().build(__privateGet(this, _client4), this.options));
2040
- __privateGet(this, _currentMutation).addObserver(this);
2041
- return __privateGet(this, _currentMutation).execute(variables);
2042
- }
2043
- }, _client4 = new WeakMap(), _currentResult2 = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _MutationObserver_instances = new WeakSet(), updateResult_fn = function() {
2044
- const state = __privateGet(this, _currentMutation)?.state ?? getDefaultState2();
2045
- __privateSet(this, _currentResult2, {
2046
- ...state,
2047
- isPending: state.status === "pending",
2048
- isSuccess: state.status === "success",
2049
- isError: state.status === "error",
2050
- isIdle: state.status === "idle",
2051
- mutate: this.mutate,
2052
- reset: this.reset
2053
- });
2054
- }, notify_fn = function(action) {
2055
- notifyManager.batch(() => {
2056
- if (__privateGet(this, _mutateOptions) && this.hasListeners()) {
2057
- const variables = __privateGet(this, _currentResult2).variables;
2058
- const onMutateResult = __privateGet(this, _currentResult2).context;
2059
- const context = {
2060
- client: __privateGet(this, _client4),
2061
- meta: this.options.meta,
2062
- mutationKey: this.options.mutationKey
2063
- };
2064
- if (action?.type === "success") {
2065
- try {
2066
- __privateGet(this, _mutateOptions).onSuccess?.(action.data, variables, onMutateResult, context);
2067
- } catch (e) {
2068
- Promise.reject(e);
2069
- }
2070
- try {
2071
- __privateGet(this, _mutateOptions).onSettled?.(action.data, null, variables, onMutateResult, context);
2072
- } catch (e) {
2073
- Promise.reject(e);
2074
- }
2075
- } else if (action?.type === "error") {
2076
- try {
2077
- __privateGet(this, _mutateOptions).onError?.(action.error, variables, onMutateResult, context);
2078
- } catch (e) {
2079
- Promise.reject(e);
2080
- }
2081
- try {
2082
- __privateGet(this, _mutateOptions).onSettled?.(void 0, action.error, variables, onMutateResult, context);
2083
- } catch (e) {
2084
- Promise.reject(e);
2085
- }
2086
- }
2087
- }
2088
- this.listeners.forEach((listener) => {
2089
- listener(__privateGet(this, _currentResult2));
2090
- });
2091
- });
2092
- }, _a9);
2093
-
2094
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/queriesObserver.js
2095
- function difference(array1, array2) {
2096
- const excludeSet = new Set(array2);
2097
- return array1.filter((x) => !excludeSet.has(x));
2098
- }
2099
- var _client5, _result, _queries, _options, _observers2, _combinedResult, _lastCombine, _lastResult, _lastQueryHashes, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, shouldSkipCombine_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn2, _a10;
2100
- var QueriesObserver = (_a10 = class extends Subscribable {
2101
- constructor(client, queries, options) {
2102
- super();
2103
- __privateAdd(this, _QueriesObserver_instances);
2104
- __privateAdd(this, _client5);
2105
- __privateAdd(this, _result);
2106
- __privateAdd(this, _queries);
2107
- __privateAdd(this, _options);
2108
- __privateAdd(this, _observers2);
2109
- __privateAdd(this, _combinedResult);
2110
- __privateAdd(this, _lastCombine);
2111
- __privateAdd(this, _lastResult);
2112
- __privateAdd(this, _lastQueryHashes);
2113
- __privateAdd(this, _observerMatches, []);
2114
- __privateSet(this, _client5, client);
2115
- __privateSet(this, _options, options);
2116
- __privateSet(this, _queries, []);
2117
- __privateSet(this, _observers2, []);
2118
- __privateSet(this, _result, []);
2119
- this.setQueries(queries);
2120
- }
2121
- onSubscribe() {
2122
- if (this.listeners.size === 1) __privateGet(this, _observers2).forEach((observer) => {
2123
- observer.subscribe((result) => {
2124
- __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result);
2125
- });
2126
- });
2127
- }
2128
- onUnsubscribe() {
2129
- if (!this.listeners.size) this.destroy();
2130
- }
2131
- destroy() {
2132
- this.listeners = /* @__PURE__ */ new Set();
2133
- __privateGet(this, _observers2).forEach((observer) => {
2134
- observer.destroy();
2135
- });
2136
- }
2137
- setQueries(queries, options) {
2138
- __privateSet(this, _queries, queries);
2139
- __privateSet(this, _options, options);
2140
- if (false) {
2141
- const queryHashes = queries.map((query) => __privateGet(this, _client5).defaultQueryOptions(query).queryHash);
2142
- if (new Set(queryHashes).size !== queryHashes.length) console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.");
2143
- }
2144
- notifyManager.batch(() => {
2145
- const prevObservers = __privateGet(this, _observers2);
2146
- const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries));
2147
- newObserverMatches.forEach((match) => match.observer.setOptions(match.defaultedQueryOptions));
2148
- const newObservers = newObserverMatches.map((match) => match.observer);
2149
- const newResult = newObservers.map((observer) => observer.getCurrentResult());
2150
- const hasLengthChange = prevObservers.length !== newObservers.length;
2151
- const hasIndexChange = newObservers.some((observer, index) => observer !== prevObservers[index]);
2152
- const hasStructuralChange = hasLengthChange || hasIndexChange;
2153
- const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => {
2154
- const prev = __privateGet(this, _result)[index];
2155
- return !prev || !shallowEqualObjects(result, prev);
2156
- });
2157
- if (!hasStructuralChange && !hasResultChange) return;
2158
- if (hasStructuralChange) {
2159
- __privateSet(this, _observerMatches, newObserverMatches);
2160
- __privateSet(this, _observers2, newObservers);
2161
- }
2162
- __privateSet(this, _result, newResult);
2163
- if (!this.hasListeners()) return;
2164
- if (hasStructuralChange) {
2165
- difference(prevObservers, newObservers).forEach((observer) => {
2166
- observer.destroy();
2167
- });
2168
- difference(newObservers, prevObservers).forEach((observer) => {
2169
- observer.subscribe((result) => {
2170
- __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result);
2171
- });
2172
- });
2173
- }
2174
- __privateMethod(this, _QueriesObserver_instances, notify_fn2).call(this);
2175
- });
2176
- }
2177
- getCurrentResult() {
2178
- return __privateGet(this, _result);
2179
- }
2180
- getQueries() {
2181
- return __privateGet(this, _observers2).map((observer) => observer.getCurrentQuery());
2182
- }
2183
- getObservers() {
2184
- return __privateGet(this, _observers2);
2185
- }
2186
- getOptimisticResult(queries, combine) {
2187
- const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries);
2188
- const result = matches.map((match) => match.observer.getOptimisticResult(match.defaultedQueryOptions));
2189
- const queryHashes = matches.map((match) => match.defaultedQueryOptions.queryHash);
2190
- return [
2191
- result,
2192
- (r) => {
2193
- return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine, queryHashes);
2194
- },
2195
- () => {
2196
- return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches);
2197
- }
2198
- ];
2199
- }
2200
- }, _client5 = new WeakMap(), _result = new WeakMap(), _queries = new WeakMap(), _options = new WeakMap(), _observers2 = new WeakMap(), _combinedResult = new WeakMap(), _lastCombine = new WeakMap(), _lastResult = new WeakMap(), _lastQueryHashes = new WeakMap(), _observerMatches = new WeakMap(), _QueriesObserver_instances = new WeakSet(), trackResult_fn = function(result, matches) {
2201
- const trackedProps = /* @__PURE__ */ new Set();
2202
- return matches.map((match, index) => {
2203
- const observerResult = result[index];
2204
- return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => {
2205
- if (!trackedProps.has(accessedProp)) {
2206
- trackedProps.add(accessedProp);
2207
- matches.forEach((m) => {
2208
- m.observer.trackProp(accessedProp);
2209
- });
2210
- }
2211
- }) : observerResult;
2212
- });
2213
- }, combineResult_fn = function(input, combine, queryHashes) {
2214
- if (combine) {
2215
- const lastHashes = __privateGet(this, _lastQueryHashes);
2216
- const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i]));
2217
- if (__privateGet(this, _result) !== __privateGet(this, _lastResult) || queryHashesChanged || combine !== __privateGet(this, _lastCombine)) {
2218
- __privateSet(this, _lastCombine, combine);
2219
- __privateSet(this, _lastResult, __privateGet(this, _result));
2220
- if (queryHashes !== void 0) __privateSet(this, _lastQueryHashes, queryHashes);
2221
- __privateSet(this, _combinedResult, replaceEqualDeep(__privateGet(this, _combinedResult), combine(input)));
2222
- }
2223
- return __privateGet(this, _combinedResult);
2224
- }
2225
- return input;
2226
- }, shouldSkipCombine_fn = function() {
2227
- return !__privateGet(this, _options)?.combine || __privateGet(this, _observers2).some((observer, index) => {
2228
- return observer.options.suspense && __privateGet(this, _result)[index]?.data === void 0;
2229
- });
2230
- }, findMatchingObservers_fn = function(queries) {
2231
- const prevObserversMap = /* @__PURE__ */ new Map();
2232
- __privateGet(this, _observers2).forEach((observer) => {
2233
- const key = observer.options.queryHash;
2234
- if (!key) return;
2235
- const previousObservers = prevObserversMap.get(key);
2236
- if (previousObservers) previousObservers.push(observer);
2237
- else prevObserversMap.set(key, [observer]);
2238
- });
2239
- const observers = [];
2240
- queries.forEach((options) => {
2241
- const defaultedOptions = __privateGet(this, _client5).defaultQueryOptions(options);
2242
- const observer = prevObserversMap.get(defaultedOptions.queryHash)?.shift() ?? new QueryObserver(__privateGet(this, _client5), defaultedOptions);
2243
- observers.push({
2244
- defaultedQueryOptions: defaultedOptions,
2245
- observer
2246
- });
2247
- });
2248
- return observers;
2249
- }, onUpdate_fn = function(observer, result) {
2250
- const index = __privateGet(this, _observers2).indexOf(observer);
2251
- if (index !== -1) {
2252
- __privateSet(this, _result, __privateGet(this, _result).slice());
2253
- __privateGet(this, _result)[index] = result;
2254
- __privateMethod(this, _QueriesObserver_instances, notify_fn2).call(this);
2255
- }
2256
- }, notify_fn2 = function() {
2257
- if (this.hasListeners()) {
2258
- const shouldSkipCombine = __privateMethod(this, _QueriesObserver_instances, shouldSkipCombine_fn).call(this);
2259
- const previousResult = __privateGet(this, _combinedResult);
2260
- const newResult = shouldSkipCombine ? previousResult : __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches)), __privateGet(this, _options)?.combine);
2261
- if (shouldSkipCombine || previousResult !== newResult) notifyManager.batch(() => {
2262
- this.listeners.forEach((listener) => {
2263
- listener(__privateGet(this, _result));
2264
- });
2265
- });
2266
- }
2267
- }, _a10);
2268
-
2269
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/queryCache.js
2270
- var _queries2, _a11;
2271
- var QueryCache = (_a11 = class extends Subscribable {
2272
- constructor(config = {}) {
2273
- super();
2274
- __privateAdd(this, _queries2);
2275
- this.config = config;
2276
- __privateSet(this, _queries2, /* @__PURE__ */ new Map());
2277
- }
2278
- build(client, options, state) {
2279
- const queryKey = options.queryKey;
2280
- const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
2281
- let query = this.get(queryHash);
2282
- if (!query) {
2283
- query = new Query({
2284
- client,
2285
- queryKey,
2286
- queryHash,
2287
- options: client.defaultQueryOptions(options),
2288
- state,
2289
- defaultOptions: client.getQueryDefaults(queryKey)
2290
- });
2291
- this.add(query);
2292
- }
2293
- return query;
2294
- }
2295
- add(query) {
2296
- if (!__privateGet(this, _queries2).has(query.queryHash)) {
2297
- __privateGet(this, _queries2).set(query.queryHash, query);
2298
- this.notify({
2299
- type: "added",
2300
- query
2301
- });
2302
- }
2303
- }
2304
- remove(query) {
2305
- const queryInMap = __privateGet(this, _queries2).get(query.queryHash);
2306
- if (queryInMap) {
2307
- query.destroy();
2308
- if (queryInMap === query) __privateGet(this, _queries2).delete(query.queryHash);
2309
- this.notify({
2310
- type: "removed",
2311
- query
2312
- });
2313
- }
2314
- }
2315
- clear() {
2316
- notifyManager.batch(() => {
2317
- this.getAll().forEach((query) => {
2318
- this.remove(query);
2319
- });
2320
- });
2321
- }
2322
- get(queryHash) {
2323
- return __privateGet(this, _queries2).get(queryHash);
2324
- }
2325
- getAll() {
2326
- return [...__privateGet(this, _queries2).values()];
2327
- }
2328
- find(filters) {
2329
- const defaultedFilters = {
2330
- exact: true,
2331
- ...filters
2332
- };
2333
- return this.getAll().find((query) => matchQuery(defaultedFilters, query));
2334
- }
2335
- findAll(filters = {}) {
2336
- const queries = this.getAll();
2337
- return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
2338
- }
2339
- notify(event) {
2340
- notifyManager.batch(() => {
2341
- this.listeners.forEach((listener) => {
2342
- listener(event);
2343
- });
2344
- });
2345
- }
2346
- onFocus() {
2347
- notifyManager.batch(() => {
2348
- this.getAll().forEach((query) => {
2349
- query.onFocus();
2350
- });
2351
- });
2352
- }
2353
- onOnline() {
2354
- notifyManager.batch(() => {
2355
- this.getAll().forEach((query) => {
2356
- query.onOnline();
2357
- });
2358
- });
2359
- }
2360
- }, _queries2 = new WeakMap(), _a11);
2361
-
2362
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/queryClient.js
2363
- var _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _a12;
2364
- var QueryClient = (_a12 = class {
2365
- constructor(config = {}) {
2366
- __privateAdd(this, _queryCache);
2367
- __privateAdd(this, _mutationCache2);
2368
- __privateAdd(this, _defaultOptions2);
2369
- __privateAdd(this, _queryDefaults);
2370
- __privateAdd(this, _mutationDefaults);
2371
- __privateAdd(this, _mountCount);
2372
- __privateAdd(this, _unsubscribeFocus);
2373
- __privateAdd(this, _unsubscribeOnline);
2374
- __privateSet(this, _queryCache, config.queryCache || new QueryCache());
2375
- __privateSet(this, _mutationCache2, config.mutationCache || new MutationCache());
2376
- __privateSet(this, _defaultOptions2, config.defaultOptions || {});
2377
- __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map());
2378
- __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map());
2379
- __privateSet(this, _mountCount, 0);
2380
- }
2381
- mount() {
2382
- __privateWrapper(this, _mountCount)._++;
2383
- if (__privateGet(this, _mountCount) !== 1) return;
2384
- __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => {
2385
- if (focused) {
2386
- await this.resumePausedMutations();
2387
- __privateGet(this, _queryCache).onFocus();
2388
- }
2389
- }));
2390
- __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => {
2391
- if (online) {
2392
- await this.resumePausedMutations();
2393
- __privateGet(this, _queryCache).onOnline();
2394
- }
2395
- }));
2396
- }
2397
- unmount() {
2398
- var _a13, _b;
2399
- __privateWrapper(this, _mountCount)._--;
2400
- if (__privateGet(this, _mountCount) !== 0) return;
2401
- (_a13 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a13.call(this);
2402
- __privateSet(this, _unsubscribeFocus, void 0);
2403
- (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this);
2404
- __privateSet(this, _unsubscribeOnline, void 0);
2405
- }
2406
- isFetching(filters) {
2407
- return __privateGet(this, _queryCache).findAll({
2408
- ...filters,
2409
- fetchStatus: "fetching"
2410
- }).length;
2411
- }
2412
- isMutating(filters) {
2413
- return __privateGet(this, _mutationCache2).findAll({
2414
- ...filters,
2415
- status: "pending"
2416
- }).length;
2417
- }
2418
- /**
2419
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
2420
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
2421
- *
2422
- * Hint: Do not use this function inside a component, because it won't receive updates.
2423
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
2424
- */
2425
- getQueryData(queryKey) {
2426
- const options = this.defaultQueryOptions({ queryKey });
2427
- return __privateGet(this, _queryCache).get(options.queryHash)?.state.data;
2428
- }
2429
- /**
2430
- * @deprecated Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.
2431
- */
2432
- ensureQueryData(options) {
2433
- const defaultedOptions = this.defaultQueryOptions(options);
2434
- const query = __privateGet(this, _queryCache).build(this, defaultedOptions);
2435
- const cachedData = query.state.data;
2436
- if (cachedData === void 0) return this.fetchQuery(options);
2437
- if (options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);
2438
- return Promise.resolve(cachedData);
2439
- }
2440
- getQueriesData(filters) {
2441
- return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => {
2442
- return [queryKey, state.data];
2443
- });
2444
- }
2445
- setQueryData(queryKey, updater, options) {
2446
- const defaultedOptions = this.defaultQueryOptions({ queryKey });
2447
- const prevData = __privateGet(this, _queryCache).get(defaultedOptions.queryHash)?.state.data;
2448
- const data = functionalUpdate(updater, prevData);
2449
- if (data === void 0) return;
2450
- return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, {
2451
- ...options,
2452
- manual: true
2453
- });
2454
- }
2455
- setQueriesData(filters, updater, options) {
2456
- return notifyManager.batch(() => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));
2457
- }
2458
- getQueryState(queryKey) {
2459
- const options = this.defaultQueryOptions({ queryKey });
2460
- return __privateGet(this, _queryCache).get(options.queryHash)?.state;
2461
- }
2462
- removeQueries(filters) {
2463
- const queryCache = __privateGet(this, _queryCache);
2464
- notifyManager.batch(() => {
2465
- queryCache.findAll(filters).forEach((query) => {
2466
- queryCache.remove(query);
2467
- });
2468
- });
2469
- }
2470
- resetQueries(filters, options) {
2471
- const queryCache = __privateGet(this, _queryCache);
2472
- return notifyManager.batch(() => {
2473
- const matched = queryCache.findAll(filters);
2474
- const queriesToRefetch = new Set(matched);
2475
- matched.forEach((query) => {
2476
- query.reset();
2477
- });
2478
- return this.refetchQueries({
2479
- type: "active",
2480
- predicate: (query) => queriesToRefetch.has(query)
2481
- }, options);
2482
- });
2483
- }
2484
- cancelQueries(filters, cancelOptions = {}) {
2485
- const defaultedCancelOptions = {
2486
- revert: true,
2487
- ...cancelOptions
2488
- };
2489
- const promises = notifyManager.batch(() => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));
2490
- return Promise.all(promises).then(noop).catch(noop);
2491
- }
2492
- invalidateQueries(filters, options = {}) {
2493
- return notifyManager.batch(() => {
2494
- __privateGet(this, _queryCache).findAll(filters).forEach((query) => {
2495
- query.invalidate();
2496
- });
2497
- if (filters?.refetchType === "none") return Promise.resolve();
2498
- return this.refetchQueries({
2499
- ...filters,
2500
- type: filters?.refetchType ?? filters?.type ?? "active"
2501
- }, options);
2502
- });
2503
- }
2504
- refetchQueries(filters, options = {}) {
2505
- const fetchOptions = {
2506
- ...options,
2507
- cancelRefetch: options.cancelRefetch ?? true
2508
- };
2509
- const promises = notifyManager.batch(() => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
2510
- let promise = query.fetch(void 0, fetchOptions);
2511
- if (!fetchOptions.throwOnError) promise = promise.catch(noop);
2512
- return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
2513
- }));
2514
- return Promise.all(promises).then(noop);
2515
- }
2516
- async query(options) {
2517
- const defaultedOptions = this.defaultQueryOptions(options);
2518
- if (defaultedOptions.retry === void 0) defaultedOptions.retry = false;
2519
- const query = __privateGet(this, _queryCache).build(this, defaultedOptions);
2520
- const queryData = query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? await query.fetch(defaultedOptions) : query.state.data;
2521
- const select = defaultedOptions.select;
2522
- if (select) return select(queryData);
2523
- return queryData;
2524
- }
2525
- /**
2526
- * @deprecated Use queryClient.query(options) instead. This method will be removed in the next major version.
2527
- */
2528
- fetchQuery(options) {
2529
- const defaultedOptions = this.defaultQueryOptions(options);
2530
- if (defaultedOptions.retry === void 0) defaultedOptions.retry = false;
2531
- const query = __privateGet(this, _queryCache).build(this, defaultedOptions);
2532
- return query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
2533
- }
2534
- /**
2535
- * @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
2536
- */
2537
- prefetchQuery(options) {
2538
- return this.fetchQuery(options).then(noop).catch(noop);
2539
- }
2540
- infiniteQuery(options) {
2541
- options._type = "infinite";
2542
- return this.query(options);
2543
- }
2544
- /**
2545
- * @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.
2546
- */
2547
- fetchInfiniteQuery(options) {
2548
- options._type = "infinite";
2549
- return this.fetchQuery(options);
2550
- }
2551
- /**
2552
- * @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
2553
- */
2554
- prefetchInfiniteQuery(options) {
2555
- return this.fetchInfiniteQuery(options).then(noop).catch(noop);
2556
- }
2557
- /**
2558
- * @deprecated Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.
2559
- */
2560
- ensureInfiniteQueryData(options) {
2561
- options._type = "infinite";
2562
- return this.ensureQueryData(options);
2563
- }
2564
- resumePausedMutations() {
2565
- if (onlineManager.isOnline()) return __privateGet(this, _mutationCache2).resumePausedMutations();
2566
- return Promise.resolve();
2567
- }
2568
- getQueryCache() {
2569
- return __privateGet(this, _queryCache);
2570
- }
2571
- getMutationCache() {
2572
- return __privateGet(this, _mutationCache2);
2573
- }
2574
- getDefaultOptions() {
2575
- return __privateGet(this, _defaultOptions2);
2576
- }
2577
- setDefaultOptions(options) {
2578
- __privateSet(this, _defaultOptions2, options);
2579
- }
2580
- setQueryDefaults(queryKey, options) {
2581
- __privateGet(this, _queryDefaults).set(hashKey(queryKey), {
2582
- queryKey,
2583
- defaultOptions: options
2584
- });
2585
- }
2586
- getQueryDefaults(queryKey) {
2587
- const defaults = [...__privateGet(this, _queryDefaults).values()];
2588
- const result = {};
2589
- defaults.forEach((queryDefault) => {
2590
- if (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);
2591
- });
2592
- return result;
2593
- }
2594
- setMutationDefaults(mutationKey, options) {
2595
- __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), {
2596
- mutationKey,
2597
- defaultOptions: options
2598
- });
2599
- }
2600
- getMutationDefaults(mutationKey) {
2601
- const defaults = [...__privateGet(this, _mutationDefaults).values()];
2602
- const result = {};
2603
- defaults.forEach((queryDefault) => {
2604
- if (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);
2605
- });
2606
- return result;
2607
- }
2608
- defaultQueryOptions(options) {
2609
- if (options._defaulted) return options;
2610
- const defaultedOptions = {
2611
- ...__privateGet(this, _defaultOptions2).queries,
2612
- ...this.getQueryDefaults(options.queryKey),
2613
- ...options,
2614
- _defaulted: true
2615
- };
2616
- if (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);
2617
- if (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
2618
- if (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;
2619
- if (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = "offlineFirst";
2620
- if (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;
2621
- return defaultedOptions;
2622
- }
2623
- defaultMutationOptions(options) {
2624
- if (options?._defaulted) return options;
2625
- return {
2626
- ...__privateGet(this, _defaultOptions2).mutations,
2627
- ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
2628
- ...options,
2629
- _defaulted: true
2630
- };
2631
- }
2632
- clear() {
2633
- __privateGet(this, _queryCache).clear();
2634
- __privateGet(this, _mutationCache2).clear();
2635
- }
2636
- }, _queryCache = new WeakMap(), _mutationCache2 = new WeakMap(), _defaultOptions2 = new WeakMap(), _queryDefaults = new WeakMap(), _mutationDefaults = new WeakMap(), _mountCount = new WeakMap(), _unsubscribeFocus = new WeakMap(), _unsubscribeOnline = new WeakMap(), _a12);
2637
-
2638
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/streamedQuery.js
2639
- function streamedQuery({ streamFn, refetchMode = "reset", reducer = (items, chunk) => addToEnd(items, chunk), initialValue = [] }) {
2640
- return async (context) => {
2641
- const query = context.client.getQueryCache().find({
2642
- queryKey: context.queryKey,
2643
- exact: true
2644
- });
2645
- const isRefetch = !!query && query.isFetched();
2646
- if (isRefetch && refetchMode === "reset") query.setState({
2647
- ...query.resetState,
2648
- fetchStatus: "fetching"
2649
- });
2650
- let result = initialValue;
2651
- let cancelled = false;
2652
- const stream = await streamFn(addConsumeAwareSignal({
2653
- client: context.client,
2654
- meta: context.meta,
2655
- queryKey: context.queryKey,
2656
- pageParam: context.pageParam,
2657
- direction: context.direction
2658
- }, () => context.signal, () => cancelled = true));
2659
- const isReplaceRefetch = isRefetch && refetchMode === "replace";
2660
- for await (const chunk of stream) {
2661
- if (cancelled) break;
2662
- if (isReplaceRefetch) result = reducer(result, chunk);
2663
- else context.client.setQueryData(context.queryKey, (prev) => reducer(prev === void 0 ? initialValue : prev, chunk));
2664
- }
2665
- if (isReplaceRefetch && !cancelled) context.client.setQueryData(context.queryKey, result);
2666
- return context.client.getQueryData(context.queryKey) ?? initialValue;
2667
- };
2668
- }
2669
-
2670
- // ../../node_modules/.pnpm/@tanstack+query-core@5.102.8/node_modules/@tanstack/query-core/build/modern/types.js
2671
- var dataTagSymbol = /* @__PURE__ */ Symbol();
2672
- var dataTagErrorSymbol = /* @__PURE__ */ Symbol();
2673
- var unsetMarker = /* @__PURE__ */ Symbol();
2674
-
2675
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js
2676
- var HydrationBoundary = ({ children, options = {}, state, queryClient }) => {
2677
- const client = useQueryClient(queryClient);
2678
- const optionsRef = React2.useRef(options);
2679
- React2.useEffect(() => {
2680
- optionsRef.current = options;
2681
- });
2682
- const hydrationQueue = React2.useMemo(() => {
2683
- if (state) {
2684
- if (typeof state !== "object") return;
2685
- const queryCache = client.getQueryCache();
2686
- const queries = state.queries || [];
2687
- const newQueries = [];
2688
- const existingQueries = [];
2689
- for (const dehydratedQuery of queries) {
2690
- const existingQuery = queryCache.get(dehydratedQuery.queryHash);
2691
- if (!existingQuery) newQueries.push(dehydratedQuery);
2692
- else if (dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt) existingQueries.push(dehydratedQuery);
2693
- }
2694
- if (newQueries.length > 0) hydrate(client, { queries: newQueries }, optionsRef.current);
2695
- if (existingQueries.length > 0) return existingQueries;
2696
- }
2697
- }, [client, state]);
2698
- React2.useEffect(() => {
2699
- if (hydrationQueue) hydrate(client, { queries: hydrationQueue }, optionsRef.current);
2700
- }, [client, hydrationQueue]);
2701
- return children;
2702
- };
2703
-
2704
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
2705
- import * as React3 from "react";
2706
- var IsRestoringContext = React3.createContext(false);
2707
- var useIsRestoring = () => React3.useContext(IsRestoringContext);
2708
- var IsRestoringProvider = IsRestoringContext.Provider;
2709
-
2710
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
2711
- import * as React4 from "react";
2712
- import { jsx as jsx2 } from "react/jsx-runtime";
2713
- function createValue() {
2714
- let isReset = false;
2715
- return {
2716
- clearReset: () => {
2717
- isReset = false;
2718
- },
2719
- reset: () => {
2720
- isReset = true;
2721
- },
2722
- isReset: () => {
2723
- return isReset;
2724
- }
2725
- };
2726
- }
2727
- var QueryErrorResetBoundaryContext = React4.createContext(createValue());
2728
- var useQueryErrorResetBoundary = () => React4.useContext(QueryErrorResetBoundaryContext);
2729
- var QueryErrorResetBoundary = ({ children }) => {
2730
- const [value] = React4.useState(() => createValue());
2731
- return /* @__PURE__ */ jsx2(QueryErrorResetBoundaryContext.Provider, {
2732
- value,
2733
- children: typeof children === "function" ? children(value) : children
2734
- });
2735
- };
2736
-
2737
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js
2738
- import * as React5 from "react";
2739
- var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
2740
- const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
2741
- if (options.suspense || throwOnError) {
2742
- if (!errorResetBoundary.isReset()) options.retryOnMount = false;
2743
- }
2744
- };
2745
- var useClearResetErrorBoundary = (errorResetBoundary) => {
2746
- React5.useEffect(() => {
2747
- errorResetBoundary.clearReset();
2748
- }, [errorResetBoundary]);
2749
- };
2750
- var getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {
2751
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
2752
- };
2753
-
2754
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/suspense.js
2755
- var defaultThrowOnError = (_error, query) => query.state.data === void 0;
2756
- var ensureSuspenseTimers = (defaultedOptions) => {
2757
- if (defaultedOptions.suspense) {
2758
- const MIN_SUSPENSE_TIME_MS = 1e3;
2759
- const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
2760
- const originalStaleTime = defaultedOptions.staleTime;
2761
- defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
2762
- if (typeof defaultedOptions.gcTime === "number") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);
2763
- }
2764
- };
2765
- var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
2766
- var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
2767
- errorResetBoundary.clearReset();
2768
- });
2769
-
2770
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useQueries.js
2771
- import * as React6 from "react";
2772
- function useQueries({ queries, ...options }, queryClient) {
2773
- const client = useQueryClient(queryClient);
2774
- const isRestoring = useIsRestoring();
2775
- const errorResetBoundary = useQueryErrorResetBoundary();
2776
- const subscribed = options.subscribed !== false;
2777
- const defaultedQueries = React6.useMemo(() => queries.map((opts) => {
2778
- const defaultedOptions = client.defaultQueryOptions(opts);
2779
- defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : subscribed ? "optimistic" : void 0;
2780
- return defaultedOptions;
2781
- }), [
2782
- queries,
2783
- client,
2784
- isRestoring,
2785
- subscribed
2786
- ]);
2787
- defaultedQueries.forEach((queryOptions2) => {
2788
- ensureSuspenseTimers(queryOptions2);
2789
- const query = client.getQueryCache().get(queryOptions2.queryHash);
2790
- ensurePreventErrorBoundaryRetry(queryOptions2, errorResetBoundary, query);
2791
- });
2792
- useClearResetErrorBoundary(errorResetBoundary);
2793
- const [observer] = React6.useState(() => new QueriesObserver(client, defaultedQueries, options));
2794
- const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult(defaultedQueries, options.combine);
2795
- const shouldSubscribe = !isRestoring && subscribed;
2796
- React6.useSyncExternalStore(React6.useCallback((onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
2797
- React6.useEffect(() => {
2798
- observer.setQueries(defaultedQueries, options);
2799
- }, [
2800
- defaultedQueries,
2801
- options,
2802
- observer
2803
- ]);
2804
- const suspensePromises = optimisticResult.some((result, index) => shouldSuspend(defaultedQueries[index], result)) ? optimisticResult.flatMap((result, index) => {
2805
- const opts = defaultedQueries[index];
2806
- if (opts && shouldSuspend(opts, result)) {
2807
- const queryObserver = new QueryObserver(client, opts);
2808
- return fetchOptimistic(opts, queryObserver, errorResetBoundary);
2809
- }
2810
- return [];
2811
- }) : [];
2812
- if (suspensePromises.length > 0) throw Promise.all(suspensePromises);
2813
- const firstSingleResultWhichShouldThrow = optimisticResult.find((result, index) => {
2814
- const query = defaultedQueries[index];
2815
- return query && getHasError({
2816
- result,
2817
- errorResetBoundary,
2818
- throwOnError: query.throwOnError,
2819
- query: client.getQueryCache().get(query.queryHash),
2820
- suspense: query.suspense
2821
- });
2822
- });
2823
- if (firstSingleResultWhichShouldThrow) throw firstSingleResultWhichShouldThrow.error;
2824
- return getCombinedResult(trackResult());
2825
- }
2826
-
2827
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
2828
- import * as React7 from "react";
2829
- function useBaseQuery(options, Observer, queryClient) {
2830
- if (false) {
2831
- if (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');
2832
- }
2833
- const isRestoring = useIsRestoring();
2834
- const errorResetBoundary = useQueryErrorResetBoundary();
2835
- const client = useQueryClient(queryClient);
2836
- const defaultedOptions = client.defaultQueryOptions(options);
2837
- const query = client.getQueryCache().get(defaultedOptions.queryHash);
2838
- if (false) {
2839
- if (!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`);
2840
- }
2841
- const subscribed = options.subscribed !== false;
2842
- defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : subscribed ? "optimistic" : void 0;
2843
- ensureSuspenseTimers(defaultedOptions);
2844
- ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
2845
- useClearResetErrorBoundary(errorResetBoundary);
2846
- const [observer] = React7.useState(() => new Observer(client, defaultedOptions));
2847
- const result = observer.getOptimisticResult(defaultedOptions);
2848
- const shouldSubscribe = !isRestoring && subscribed;
2849
- React7.useSyncExternalStore(React7.useCallback((onStoreChange) => {
2850
- const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
2851
- observer.updateResult();
2852
- return unsubscribe;
2853
- }, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
2854
- React7.useEffect(() => {
2855
- observer.setOptions(defaultedOptions);
2856
- }, [defaultedOptions, observer]);
2857
- if (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
2858
- if (getHasError({
2859
- result,
2860
- errorResetBoundary,
2861
- throwOnError: defaultedOptions.throwOnError,
2862
- query,
2863
- suspense: defaultedOptions.suspense
2864
- })) throw result.error;
2865
- return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
2866
- }
2867
-
2868
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useQuery.js
2869
- function useQuery(options, queryClient) {
2870
- return useBaseQuery(options, QueryObserver, queryClient);
2871
- }
2872
-
2873
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js
2874
- function useSuspenseQuery(options, queryClient) {
2875
- if (false) {
2876
- if (options.queryFn === skipToken) console.error("skipToken is not allowed for useSuspenseQuery");
2877
- }
2878
- return useBaseQuery({
2879
- ...options,
2880
- enabled: true,
2881
- suspense: true,
2882
- throwOnError: defaultThrowOnError,
2883
- placeholderData: void 0
2884
- }, QueryObserver, queryClient);
2885
- }
2886
-
2887
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js
2888
- function useSuspenseInfiniteQuery(options, queryClient) {
2889
- if (false) {
2890
- if (options.queryFn === skipToken) console.error("skipToken is not allowed for useSuspenseInfiniteQuery");
2891
- }
2892
- return useBaseQuery({
2893
- ...options,
2894
- enabled: true,
2895
- suspense: true,
2896
- throwOnError: defaultThrowOnError,
2897
- placeholderData: void 0
2898
- }, InfiniteQueryObserver, queryClient);
2899
- }
2900
-
2901
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js
2902
- function useSuspenseQueries(options, queryClient) {
2903
- return useQueries({
2904
- ...options,
2905
- queries: options.queries.map((query) => {
2906
- if (false) {
2907
- if (query.queryFn === skipToken) console.error("skipToken is not allowed for useSuspenseQueries");
2908
- }
2909
- return {
2910
- ...query,
2911
- suspense: true,
2912
- throwOnError: defaultThrowOnError,
2913
- enabled: true,
2914
- placeholderData: void 0
2915
- };
2916
- })
2917
- }, queryClient);
2918
- }
2919
-
2920
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js
2921
- function usePrefetchQuery(options, queryClient) {
2922
- const client = useQueryClient(queryClient);
2923
- if (!client.getQueryState(options.queryKey)) client.query(options).catch(noop);
2924
- }
2925
-
2926
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js
2927
- function usePrefetchInfiniteQuery(options, queryClient) {
2928
- const client = useQueryClient(queryClient);
2929
- if (!client.getQueryState(options.queryKey)) client.infiniteQuery(options).catch(noop);
2930
- }
2931
-
2932
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/queryOptions.js
2933
- function queryOptions(options) {
2934
- return options;
2935
- }
2936
-
2937
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js
2938
- function infiniteQueryOptions(options) {
2939
- return options;
2940
- }
2941
-
2942
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useIsFetching.js
2943
- import * as React8 from "react";
2944
- function useIsFetching(filters, queryClient) {
2945
- const client = useQueryClient(queryClient);
2946
- const queryCache = client.getQueryCache();
2947
- return React8.useSyncExternalStore(React8.useCallback((onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), [queryCache]), () => client.isFetching(filters), () => client.isFetching(filters));
2948
- }
2949
-
2950
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useMutationState.js
2951
- import * as React9 from "react";
2952
- function useIsMutating(filters, queryClient) {
2953
- const client = useQueryClient(queryClient);
2954
- return useMutationState({ filters: {
2955
- ...filters,
2956
- status: "pending"
2957
- } }, client).length;
2958
- }
2959
- function getResult(mutationCache, options) {
2960
- return mutationCache.findAll(options.filters).map((mutation) => options.select ? options.select(mutation) : mutation.state);
2961
- }
2962
- function useMutationState(options = {}, queryClient) {
2963
- const mutationCache = useQueryClient(queryClient).getMutationCache();
2964
- const optionsRef = React9.useRef(options);
2965
- const result = React9.useRef(null);
2966
- if (result.current === null) result.current = getResult(mutationCache, options);
2967
- React9.useEffect(() => {
2968
- optionsRef.current = options;
2969
- });
2970
- return React9.useSyncExternalStore(React9.useCallback((onStoreChange) => mutationCache.subscribe(() => {
2971
- const nextResult = replaceEqualDeep(result.current, getResult(mutationCache, optionsRef.current));
2972
- if (result.current !== nextResult) {
2973
- result.current = nextResult;
2974
- notifyManager.schedule(onStoreChange);
2975
- }
2976
- }), [mutationCache]), () => result.current, () => result.current);
2977
- }
2978
-
2979
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useMutation.js
2980
- import * as React10 from "react";
2981
- function useMutation(options, queryClient) {
2982
- const client = useQueryClient(queryClient);
2983
- const [observer] = React10.useState(() => new MutationObserver(client, options));
2984
- React10.useEffect(() => {
2985
- observer.setOptions(options);
2986
- }, [observer, options]);
2987
- const result = React10.useSyncExternalStore(React10.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
2988
- const mutate = React10.useCallback((...args) => {
2989
- observer.mutate(args[0], args[1]).catch(noop);
2990
- }, [observer]);
2991
- if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;
2992
- return {
2993
- ...result,
2994
- mutate,
2995
- mutateAsync: result.mutate
2996
- };
2997
- }
2998
-
2999
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/mutationOptions.js
3000
- function mutationOptions(options) {
3001
- return options;
3002
- }
3003
-
3004
- // ../../node_modules/.pnpm/@tanstack+react-query@5.102.8_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js
3005
- function useInfiniteQuery(options, queryClient) {
3006
- return useBaseQuery(options, InfiniteQueryObserver, queryClient);
3007
- }
3008
-
3009
- // shell/.ojm-shim-react-query.mjs
3010
- var ojm_shim_react_query_default = void 0 ?? modern_exports;
3011
- export {
3012
- CancelledError,
3013
- HydrationBoundary,
3014
- InfiniteQueryObserver,
3015
- IsRestoringProvider,
3016
- Mutation,
3017
- MutationCache,
3018
- MutationObserver,
3019
- QueriesObserver,
3020
- Query,
3021
- QueryCache,
3022
- QueryClient,
3023
- QueryClientContext,
3024
- QueryClientProvider,
3025
- QueryErrorResetBoundary,
3026
- QueryObserver,
3027
- dataTagErrorSymbol,
3028
- dataTagSymbol,
3029
- ojm_shim_react_query_default as default,
3030
- defaultScheduler,
3031
- defaultShouldDehydrateMutation,
3032
- defaultShouldDehydrateQuery,
3033
- dehydrate,
3034
- dehydrateQuery,
3035
- environmentManager,
3036
- streamedQuery as experimental_streamedQuery,
3037
- focusManager,
3038
- hashKey,
3039
- hydrate,
3040
- infiniteQueryOptions,
3041
- isCancelledError,
3042
- isServer,
3043
- keepPreviousData,
3044
- matchMutation,
3045
- matchQuery,
3046
- mutationOptions,
3047
- noop,
3048
- notifyManager,
3049
- onlineManager,
3050
- partialMatchKey,
3051
- queryOptions,
3052
- replaceEqualDeep,
3053
- shouldThrowError,
3054
- skipToken,
3055
- timeoutManager,
3056
- unsetMarker,
3057
- useInfiniteQuery,
3058
- useIsFetching,
3059
- useIsMutating,
3060
- useIsRestoring,
3061
- useMutation,
3062
- useMutationState,
3063
- usePrefetchInfiniteQuery,
3064
- usePrefetchQuery,
3065
- useQueries,
3066
- useQuery,
3067
- useQueryClient,
3068
- useQueryErrorResetBoundary,
3069
- useSuspenseInfiniteQuery,
3070
- useSuspenseQueries,
3071
- useSuspenseQuery
3072
- };