zudoku 0.0.0-fix-firebase-export.f8270825 → 0.0.0-monetization-standalone.z07361713

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 (410) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/cli/common/version-check.js +12 -3
  3. package/dist/cli/common/version-check.js.map +1 -1
  4. package/dist/config/create-plugin.d.ts +2 -0
  5. package/dist/config/create-plugin.js +30 -0
  6. package/dist/config/create-plugin.js.map +1 -0
  7. package/dist/config/loader.js +3 -1
  8. package/dist/config/loader.js.map +1 -1
  9. package/dist/config/validators/InputNavigationSchema.d.ts +77 -75
  10. package/dist/config/validators/InputNavigationSchema.js +1 -0
  11. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  12. package/dist/config/validators/NavigationSchema.js +6 -1
  13. package/dist/config/validators/NavigationSchema.js.map +1 -1
  14. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  15. package/dist/config/validators/validate.d.ts +61 -13
  16. package/dist/config/validators/validate.js +9 -4
  17. package/dist/config/validators/validate.js.map +1 -1
  18. package/dist/flat-config.d.ts +29 -26
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.js +3 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/lib/auth/issuer.js +1 -1
  23. package/dist/lib/auth/issuer.js.map +1 -1
  24. package/dist/lib/authentication/authentication.d.ts +3 -2
  25. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  26. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  27. package/dist/lib/authentication/components/SignIn.js +4 -2
  28. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  29. package/dist/lib/authentication/components/SignUp.js +4 -2
  30. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  31. package/dist/lib/authentication/hook.d.ts +2 -0
  32. package/dist/lib/authentication/hook.js +10 -0
  33. package/dist/lib/authentication/hook.js.map +1 -1
  34. package/dist/lib/authentication/providers/auth0.js +11 -7
  35. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  36. package/dist/lib/authentication/providers/clerk.js +0 -22
  37. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  38. package/dist/lib/authentication/providers/firebase.js +67 -9
  39. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  40. package/dist/lib/authentication/providers/supabase.js +6 -15
  41. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  42. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  43. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  44. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  45. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  46. package/dist/lib/authentication/ui/ZudokuAuthUi.js +43 -11
  47. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  48. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  49. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  50. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  51. package/dist/lib/components/Bootstrap.js +1 -2
  52. package/dist/lib/components/Bootstrap.js.map +1 -1
  53. package/dist/lib/components/Pagination.js +2 -2
  54. package/dist/lib/components/Pagination.js.map +1 -1
  55. package/dist/lib/components/Zudoku.js +2 -5
  56. package/dist/lib/components/Zudoku.js.map +1 -1
  57. package/dist/lib/components/context/ZudokuContext.d.ts +2 -4
  58. package/dist/lib/components/context/ZudokuContext.js +2 -2
  59. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  60. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  61. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  62. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  63. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  64. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  65. package/dist/lib/components/index.d.ts +5 -0
  66. package/dist/lib/components/index.js +4 -0
  67. package/dist/lib/components/index.js.map +1 -1
  68. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  69. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  70. package/dist/lib/core/RouteGuard.js +12 -7
  71. package/dist/lib/core/RouteGuard.js.map +1 -1
  72. package/dist/lib/core/plugins.d.ts +11 -1
  73. package/dist/lib/core/plugins.js +1 -0
  74. package/dist/lib/core/plugins.js.map +1 -1
  75. package/dist/lib/core/react-query.d.ts +1 -0
  76. package/dist/lib/core/react-query.js +2 -0
  77. package/dist/lib/core/react-query.js.map +1 -0
  78. package/dist/lib/core/transform-config.d.ts +2 -0
  79. package/dist/lib/core/transform-config.js +22 -0
  80. package/dist/lib/core/transform-config.js.map +1 -0
  81. package/dist/lib/errors/ErrorAlert.js +1 -2
  82. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  83. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  84. package/dist/lib/errors/ErrorMessage.js +16 -0
  85. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  86. package/dist/lib/hooks/index.d.ts +2 -0
  87. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  88. package/dist/lib/oas/graphql/circular.js +32 -10
  89. package/dist/lib/oas/graphql/circular.js.map +1 -1
  90. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  91. package/dist/lib/oas/graphql/circular.test.js +152 -0
  92. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  93. package/dist/lib/oas/graphql/index.js +7 -3
  94. package/dist/lib/oas/graphql/index.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  96. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  98. package/dist/lib/plugins/api-keys/index.js +36 -22
  99. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  100. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  101. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  102. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  103. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  104. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  105. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  106. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  107. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  108. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  109. package/dist/lib/plugins/openapi/OasProvider.js +6 -2
  110. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  111. package/dist/lib/plugins/openapi/OperationList.js +4 -4
  112. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  113. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  114. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  115. package/dist/lib/plugins/openapi/Sidecar.js +3 -2
  116. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  117. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  118. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  119. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  120. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  121. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  122. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  123. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  124. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
  125. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
  126. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  127. package/dist/lib/ui/Button.js +1 -1
  128. package/dist/lib/ui/Button.js.map +1 -1
  129. package/dist/lib/ui/Command.d.ts +3 -3
  130. package/dist/lib/ui/Secret.js +2 -2
  131. package/dist/lib/ui/Secret.js.map +1 -1
  132. package/dist/lib/util/invariant.d.ts +1 -1
  133. package/dist/lib/util/invariant.js +2 -2
  134. package/dist/lib/util/invariant.js.map +1 -1
  135. package/dist/vite/api/SchemaManager.d.ts +12 -1
  136. package/dist/vite/api/SchemaManager.js +31 -14
  137. package/dist/vite/api/SchemaManager.js.map +1 -1
  138. package/dist/vite/api/SchemaManager.test.js +44 -0
  139. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  140. package/dist/vite/config.js +10 -4
  141. package/dist/vite/config.js.map +1 -1
  142. package/dist/vite/error-handler.js +1 -5
  143. package/dist/vite/error-handler.js.map +1 -1
  144. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  145. package/dist/vite/plugin-api-keys.js +5 -1
  146. package/dist/vite/plugin-api-keys.js.map +1 -1
  147. package/dist/vite/plugin-api.js +5 -3
  148. package/dist/vite/plugin-api.js.map +1 -1
  149. package/dist/vite/plugin-markdown-export.js +1 -1
  150. package/dist/vite/plugin-markdown-export.js.map +1 -1
  151. package/dist/vite/plugin-theme.js +2 -1
  152. package/dist/vite/plugin-theme.js.map +1 -1
  153. package/dist/vite/prerender/utils.js +9 -3
  154. package/dist/vite/prerender/utils.js.map +1 -1
  155. package/dist/vite/prerender/worker.js +3 -0
  156. package/dist/vite/prerender/worker.js.map +1 -1
  157. package/dist/vite/zuplo.d.ts +13 -0
  158. package/dist/vite/zuplo.js +15 -0
  159. package/dist/vite/zuplo.js.map +1 -0
  160. package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
  161. package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
  162. package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
  163. package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
  164. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  165. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  166. package/lib/{ClaudeLogo-B4Xxt-x_.js → ClaudeLogo-CUaQXKLK.js} +22 -22
  167. package/lib/ClaudeLogo-CUaQXKLK.js.map +1 -0
  168. package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
  169. package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
  170. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  171. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  172. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  173. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  174. package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
  175. package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
  176. package/lib/Frame-DKlOmSkU.js +205 -0
  177. package/lib/Frame-DKlOmSkU.js.map +1 -0
  178. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  179. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  180. package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
  181. package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
  182. package/lib/Input-Cx-GeKoF.js +22 -0
  183. package/lib/Input-Cx-GeKoF.js.map +1 -0
  184. package/lib/{MdxPage-BagO2c-n.js → MdxPage-BiAVpP8K.js} +11 -11
  185. package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-BiAVpP8K.js.map} +1 -1
  186. package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-DEztDKFw.js} +4 -4
  187. package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-DEztDKFw.js.map} +1 -1
  188. package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-DhJo-O2B.js} +15 -15
  189. package/lib/OAuthErrorPage-DhJo-O2B.js.map +1 -0
  190. package/lib/OasProvider-DFMZwyNn.js +48 -0
  191. package/lib/OasProvider-DFMZwyNn.js.map +1 -0
  192. package/lib/{OperationList-C0jiEaG5.js → OperationList-CnmLfOuu.js} +1560 -1545
  193. package/lib/{OperationList-C0jiEaG5.js.map → OperationList-CnmLfOuu.js.map} +1 -1
  194. package/lib/RouteGuard-CZuPjknT.js +77 -0
  195. package/lib/RouteGuard-CZuPjknT.js.map +1 -0
  196. package/lib/{SchemaList-BU0zCHn9.js → SchemaList-B5ikunUd.js} +9 -9
  197. package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-B5ikunUd.js.map} +1 -1
  198. package/lib/SchemaView-rjji7zMf.js +438 -0
  199. package/lib/SchemaView-rjji7zMf.js.map +1 -0
  200. package/lib/{Select-CkxXP5I7.js → Secret-BE7V0Vb5.js} +159 -139
  201. package/lib/Secret-BE7V0Vb5.js.map +1 -0
  202. package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
  203. package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
  204. package/lib/SignUp-DHWDXat-.js +50 -0
  205. package/lib/SignUp-DHWDXat-.js.map +1 -0
  206. package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-paLQ8NP8.js} +1751 -1725
  207. package/lib/SyntaxHighlight-paLQ8NP8.js.map +1 -0
  208. package/lib/{Toc-DJxFPfcS.js → Toc-vMbSQCkj.js} +3 -3
  209. package/lib/{Toc-DJxFPfcS.js.map → Toc-vMbSQCkj.js.map} +1 -1
  210. package/lib/ZudokuContext-CnEI8jPU.js +389 -0
  211. package/lib/ZudokuContext-CnEI8jPU.js.map +1 -0
  212. package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
  213. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  214. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  215. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  216. package/lib/{circular-CzWF1hj5.js → circular-CLhJAE3S.js} +771 -749
  217. package/lib/{circular-CzWF1hj5.js.map → circular-CLhJAE3S.js.map} +1 -1
  218. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  219. package/lib/cn-5-Gd1Dss.js.map +1 -0
  220. package/lib/{createServer-BIr2_tGn.js → createServer-BYtu5Pcr.js} +12 -12
  221. package/lib/{createServer-BIr2_tGn.js.map → createServer-BYtu5Pcr.js.map} +1 -1
  222. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  223. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  224. package/lib/{errors-Bs4duWDy.js → errors-DkJIl45d.js} +3 -3
  225. package/lib/{errors-Bs4duWDy.js.map → errors-DkJIl45d.js.map} +1 -1
  226. package/lib/{firebase-qUdSEL1p.js → firebase-CmsW0j7-.js} +1590 -1342
  227. package/lib/firebase-CmsW0j7-.js.map +1 -0
  228. package/lib/hook-Da8QTnPd.js +52 -0
  229. package/lib/hook-Da8QTnPd.js.map +1 -0
  230. package/lib/{index-Css56y3F.js → index-Ba6RP577.js} +4 -4
  231. package/lib/{index-Css56y3F.js.map → index-Ba6RP577.js.map} +1 -1
  232. package/lib/index-CrcNWbel.js.map +1 -1
  233. package/lib/{index-Bh-MffiL.js → index-D35F-SCL.js} +2 -2
  234. package/lib/{index-Bh-MffiL.js.map → index-D35F-SCL.js.map} +1 -1
  235. package/lib/{index-0oT9beQN.js → index-k0PVZBYl.js} +155 -151
  236. package/lib/{index-0oT9beQN.js.map → index-k0PVZBYl.js.map} +1 -1
  237. package/lib/{ErrorAlert-DrOR8w3f.js → index-ofqkdEjL.js} +5457 -4444
  238. package/lib/index-ofqkdEjL.js.map +1 -0
  239. package/lib/index.esm-BYObtETB.js.map +1 -1
  240. package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
  241. package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  242. package/lib/{index.esm-kW-Utcsi.js → index.esm-DFzsB75P.js} +16 -14
  243. package/lib/index.esm-DFzsB75P.js.map +1 -0
  244. package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
  245. package/lib/invariant-BJAl77rw.js.map +1 -0
  246. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  247. package/lib/{mutation-BoVlx8yA.js → mutation-BISOc7OM.js} +70 -44
  248. package/lib/mutation-BISOc7OM.js.map +1 -0
  249. package/lib/ui/Accordion.js +1 -1
  250. package/lib/ui/ActionButton.js +2 -2
  251. package/lib/ui/Alert.js +1 -1
  252. package/lib/ui/AlertDialog.js +1 -1
  253. package/lib/ui/Badge.js +1 -1
  254. package/lib/ui/Breadcrumb.js +1 -1
  255. package/lib/ui/Button.js +7 -6
  256. package/lib/ui/Button.js.map +1 -1
  257. package/lib/ui/ButtonGroup.js +1 -1
  258. package/lib/ui/Callout.js +1 -1
  259. package/lib/ui/Card.js +1 -1
  260. package/lib/ui/Carousel.js +1 -1
  261. package/lib/ui/Carousel.js.map +1 -1
  262. package/lib/ui/Checkbox.js +1 -1
  263. package/lib/ui/CodeBlock.js +1 -1
  264. package/lib/ui/Command.js +2 -2
  265. package/lib/ui/Dialog.js +1 -1
  266. package/lib/ui/Drawer.js +3 -3
  267. package/lib/ui/DropdownMenu.js +1 -1
  268. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  269. package/lib/ui/Form.js +1 -1
  270. package/lib/ui/Frame.js +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/Input.js +1 -1
  273. package/lib/ui/Item.js +1 -1
  274. package/lib/ui/Label.js +1 -1
  275. package/lib/ui/NativeSelect.js +1 -1
  276. package/lib/ui/Pagination.js +1 -1
  277. package/lib/ui/Popover.js +1 -1
  278. package/lib/ui/Progress.js +1 -1
  279. package/lib/ui/RadioGroup.js +1 -1
  280. package/lib/ui/ScrollArea.js +1 -1
  281. package/lib/ui/Secret.js +3 -3
  282. package/lib/ui/Secret.js.map +1 -1
  283. package/lib/ui/Separator.js +1 -1
  284. package/lib/ui/Skeleton.js +1 -1
  285. package/lib/ui/Slider.js +1 -1
  286. package/lib/ui/Switch.js +1 -1
  287. package/lib/ui/SyntaxHighlight.js +3 -3
  288. package/lib/ui/Tabs.js +1 -1
  289. package/lib/ui/Textarea.js +1 -1
  290. package/lib/ui/Toggle.js +1 -1
  291. package/lib/ui/ToggleGroup.js +1 -1
  292. package/lib/ui/Value.js +1 -1
  293. package/lib/ui/util.js +1 -1
  294. package/lib/{useMutation-C6RqWmTS.js → useMutation-CFMGlAMW.js} +39 -17
  295. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  296. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  297. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  298. package/lib/zudoku.__internal.js +826 -1325
  299. package/lib/zudoku.__internal.js.map +1 -1
  300. package/lib/zudoku.auth-auth0.js +16 -16
  301. package/lib/zudoku.auth-auth0.js.map +1 -1
  302. package/lib/zudoku.auth-azureb2c.js +4 -4
  303. package/lib/zudoku.auth-clerk.js +52 -75
  304. package/lib/zudoku.auth-clerk.js.map +1 -1
  305. package/lib/zudoku.auth-firebase.js +6 -5
  306. package/lib/zudoku.auth-firebase.js.map +1 -1
  307. package/lib/zudoku.auth-openid.js +5 -5
  308. package/lib/zudoku.auth-supabase.js +31 -40
  309. package/lib/zudoku.auth-supabase.js.map +1 -1
  310. package/lib/zudoku.components.js +23 -21
  311. package/lib/zudoku.hooks.js +3 -3
  312. package/lib/zudoku.mermaid.js +3 -3
  313. package/lib/zudoku.plugin-api-catalog.js +8 -8
  314. package/lib/zudoku.plugin-api-keys.js +607 -552
  315. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  316. package/lib/zudoku.plugin-custom-pages.js +1 -1
  317. package/lib/zudoku.plugin-markdown.js +1 -1
  318. package/lib/zudoku.plugin-openapi.js +3 -3
  319. package/lib/zudoku.plugin-redirect.js +1 -1
  320. package/lib/zudoku.plugin-search-pagefind.js +30 -29
  321. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  322. package/lib/zudoku.plugins.js +9 -8
  323. package/lib/zudoku.plugins.js.map +1 -1
  324. package/lib/zudoku.react-query.js +440 -0
  325. package/lib/zudoku.react-query.js.map +1 -0
  326. package/lib/zudoku.router.js +1130 -1404
  327. package/lib/zudoku.router.js.map +1 -1
  328. package/package.json +36 -22
  329. package/src/lib/auth/issuer.ts +1 -1
  330. package/src/lib/authentication/authentication.ts +8 -2
  331. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  332. package/src/lib/authentication/components/SignIn.tsx +5 -2
  333. package/src/lib/authentication/components/SignUp.tsx +5 -2
  334. package/src/lib/authentication/hook.ts +16 -0
  335. package/src/lib/authentication/providers/auth0.tsx +15 -9
  336. package/src/lib/authentication/providers/clerk.tsx +0 -26
  337. package/src/lib/authentication/providers/firebase.tsx +98 -6
  338. package/src/lib/authentication/providers/supabase.tsx +6 -15
  339. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  340. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +170 -38
  341. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  342. package/src/lib/components/Bootstrap.tsx +1 -4
  343. package/src/lib/components/Pagination.tsx +4 -5
  344. package/src/lib/components/Zudoku.tsx +5 -11
  345. package/src/lib/components/context/ZudokuContext.ts +2 -6
  346. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  347. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  348. package/src/lib/components/index.ts +4 -0
  349. package/src/lib/components/navigation/NavigationItem.tsx +9 -3
  350. package/src/lib/core/RouteGuard.tsx +30 -24
  351. package/src/lib/core/plugins.ts +21 -1
  352. package/src/lib/core/react-query.ts +1 -0
  353. package/src/lib/core/transform-config.ts +29 -0
  354. package/src/lib/errors/ErrorAlert.tsx +1 -6
  355. package/src/lib/errors/ErrorMessage.tsx +38 -0
  356. package/src/lib/oas/graphql/circular.test.ts +186 -0
  357. package/src/lib/oas/graphql/circular.ts +49 -10
  358. package/src/lib/oas/graphql/index.ts +7 -3
  359. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  360. package/src/lib/plugins/api-keys/index.tsx +76 -32
  361. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  362. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  363. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  364. package/src/lib/plugins/openapi/OasProvider.tsx +10 -2
  365. package/src/lib/plugins/openapi/OperationList.tsx +4 -4
  366. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  367. package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
  368. package/src/lib/plugins/openapi/interfaces.ts +6 -1
  369. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
  370. package/src/lib/plugins/openapi/schema/utils.ts +15 -4
  371. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  372. package/src/lib/plugins/openapi/util/getRoutes.tsx +4 -1
  373. package/src/lib/ui/Button.tsx +1 -0
  374. package/src/lib/ui/Secret.tsx +2 -2
  375. package/src/lib/util/invariant.ts +2 -1
  376. package/src/shiki/langs/c3.js +1 -0
  377. package/src/shiki/langs/gn.js +1 -0
  378. package/src/shiki/langs/moonbit.js +1 -0
  379. package/lib/ClaudeLogo-B4Xxt-x_.js.map +0 -1
  380. package/lib/ErrorAlert-DrOR8w3f.js.map +0 -1
  381. package/lib/OAuthErrorPage-Fq54RLgt.js.map +0 -1
  382. package/lib/OasProvider-DPH8mwDa.js +0 -40
  383. package/lib/OasProvider-DPH8mwDa.js.map +0 -1
  384. package/lib/RouteGuard-9wjejsKm.js +0 -77
  385. package/lib/RouteGuard-9wjejsKm.js.map +0 -1
  386. package/lib/RouterError-DSLXagd5.js +0 -42
  387. package/lib/RouterError-DSLXagd5.js.map +0 -1
  388. package/lib/SchemaView-DVae4RO2.js +0 -597
  389. package/lib/SchemaView-DVae4RO2.js.map +0 -1
  390. package/lib/Select-CkxXP5I7.js.map +0 -1
  391. package/lib/SignUp-BjS4ozA7.js +0 -50
  392. package/lib/SignUp-BjS4ozA7.js.map +0 -1
  393. package/lib/SyntaxHighlight-Kdyskw3C.js.map +0 -1
  394. package/lib/ZudokuContext-BXldanA8.js +0 -1508
  395. package/lib/ZudokuContext-BXldanA8.js.map +0 -1
  396. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
  397. package/lib/chunk-PVWAREVJ-dLIqswPy.js +0 -7965
  398. package/lib/chunk-PVWAREVJ-dLIqswPy.js.map +0 -1
  399. package/lib/cn-dYga0KKN.js.map +0 -1
  400. package/lib/createVariantComponent-B9_dVBvu.js +0 -35
  401. package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
  402. package/lib/firebase-qUdSEL1p.js.map +0 -1
  403. package/lib/hook-BNxidGQq.js +0 -40
  404. package/lib/hook-BNxidGQq.js.map +0 -1
  405. package/lib/index-CCmMJp02.js +0 -1059
  406. package/lib/index-CCmMJp02.js.map +0 -1
  407. package/lib/index.esm-kW-Utcsi.js.map +0 -1
  408. package/lib/invariant-CGOLuIIz.js.map +0 -1
  409. package/lib/mutation-BoVlx8yA.js.map +0 -1
  410. package/lib/useMutation-C6RqWmTS.js.map +0 -1
@@ -0,0 +1,1226 @@
1
+ import * as p from "react";
2
+ import { j as ee } from "./jsx-runtime-BzflLqGi.js";
3
+ var H = class {
4
+ constructor() {
5
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
6
+ }
7
+ subscribe(e) {
8
+ return this.listeners.add(e), this.onSubscribe(), () => {
9
+ this.listeners.delete(e), this.onUnsubscribe();
10
+ };
11
+ }
12
+ hasListeners() {
13
+ return this.listeners.size > 0;
14
+ }
15
+ onSubscribe() {
16
+ }
17
+ onUnsubscribe() {
18
+ }
19
+ }, fe = {
20
+ // We need the wrapper function syntax below instead of direct references to
21
+ // global setTimeout etc.
22
+ //
23
+ // BAD: `setTimeout: setTimeout`
24
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
25
+ //
26
+ // If we use direct references here, then anything that wants to spy on or
27
+ // replace the global setTimeout (like tests) won't work since we'll already
28
+ // have a hard reference to the original implementation at the time when this
29
+ // file was imported.
30
+ setTimeout: (e, t) => setTimeout(e, t),
31
+ clearTimeout: (e) => clearTimeout(e),
32
+ setInterval: (e, t) => setInterval(e, t),
33
+ clearInterval: (e) => clearInterval(e)
34
+ }, de = class {
35
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
36
+ // type at app boot; and if we leave that type, then any new timer provider
37
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
38
+ //
39
+ // We settle for type safety for the TimeoutProvider type, and accept that
40
+ // this class is unsafe internally to allow for extension.
41
+ #t = fe;
42
+ #e = !1;
43
+ setTimeoutProvider(e) {
44
+ process.env.NODE_ENV !== "production" && this.#e && e !== this.#t && console.error(
45
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
46
+ { previous: this.#t, provider: e }
47
+ ), this.#t = e, process.env.NODE_ENV !== "production" && (this.#e = !1);
48
+ }
49
+ setTimeout(e, t) {
50
+ return process.env.NODE_ENV !== "production" && (this.#e = !0), this.#t.setTimeout(e, t);
51
+ }
52
+ clearTimeout(e) {
53
+ this.#t.clearTimeout(e);
54
+ }
55
+ setInterval(e, t) {
56
+ return process.env.NODE_ENV !== "production" && (this.#e = !0), this.#t.setInterval(e, t);
57
+ }
58
+ clearInterval(e) {
59
+ this.#t.clearInterval(e);
60
+ }
61
+ }, w = new de();
62
+ function pe(e) {
63
+ setTimeout(e, 0);
64
+ }
65
+ var E = typeof window > "u" || "Deno" in globalThis;
66
+ function C() {
67
+ }
68
+ function Le(e, t) {
69
+ return typeof e == "function" ? e(t) : e;
70
+ }
71
+ function j(e) {
72
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
73
+ }
74
+ function te(e, t) {
75
+ return Math.max(e + (t || 0) - Date.now(), 0);
76
+ }
77
+ function I(e, t) {
78
+ return typeof e == "function" ? e(t) : e;
79
+ }
80
+ function v(e, t) {
81
+ return typeof e == "function" ? e(t) : e;
82
+ }
83
+ function Ke(e, t) {
84
+ const {
85
+ type: s = "all",
86
+ exact: r,
87
+ fetchStatus: n,
88
+ predicate: u,
89
+ queryKey: a,
90
+ stale: i
91
+ } = e;
92
+ if (a) {
93
+ if (r) {
94
+ if (t.queryHash !== ye(a, t.options))
95
+ return !1;
96
+ } else if (!V(t.queryKey, a))
97
+ return !1;
98
+ }
99
+ if (s !== "all") {
100
+ const o = t.isActive();
101
+ if (s === "active" && !o || s === "inactive" && o)
102
+ return !1;
103
+ }
104
+ return !(typeof i == "boolean" && t.isStale() !== i || n && n !== t.state.fetchStatus || u && !u(t));
105
+ }
106
+ function He(e, t) {
107
+ const { exact: s, status: r, predicate: n, mutationKey: u } = e;
108
+ if (u) {
109
+ if (!t.options.mutationKey)
110
+ return !1;
111
+ if (s) {
112
+ if (q(t.options.mutationKey) !== q(u))
113
+ return !1;
114
+ } else if (!V(t.options.mutationKey, u))
115
+ return !1;
116
+ }
117
+ return !(r && t.state.status !== r || n && !n(t));
118
+ }
119
+ function ye(e, t) {
120
+ return (t?.queryKeyHashFn || q)(e);
121
+ }
122
+ function q(e) {
123
+ return JSON.stringify(
124
+ e,
125
+ (t, s) => A(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
126
+ );
127
+ }
128
+ function V(e, t) {
129
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => V(e[s], t[s])) : !1;
130
+ }
131
+ var ve = Object.prototype.hasOwnProperty;
132
+ function N(e, t) {
133
+ if (e === t)
134
+ return e;
135
+ const s = z(e) && z(t);
136
+ if (!s && !(A(e) && A(t))) return t;
137
+ const n = (s ? e : Object.keys(e)).length, u = s ? t : Object.keys(t), a = u.length, i = s ? new Array(a) : {};
138
+ let o = 0;
139
+ for (let l = 0; l < a; l++) {
140
+ const c = s ? l : u[l], d = e[c], h = t[c];
141
+ if (d === h) {
142
+ i[c] = d, (s ? l < n : ve.call(e, c)) && o++;
143
+ continue;
144
+ }
145
+ if (d === null || h === null || typeof d != "object" || typeof h != "object") {
146
+ i[c] = h;
147
+ continue;
148
+ }
149
+ const R = N(d, h);
150
+ i[c] = R, R === d && o++;
151
+ }
152
+ return n === a && o === n ? e : i;
153
+ }
154
+ function k(e, t) {
155
+ if (!t || Object.keys(e).length !== Object.keys(t).length)
156
+ return !1;
157
+ for (const s in e)
158
+ if (e[s] !== t[s])
159
+ return !1;
160
+ return !0;
161
+ }
162
+ function z(e) {
163
+ return Array.isArray(e) && e.length === Object.keys(e).length;
164
+ }
165
+ function A(e) {
166
+ if (!$(e))
167
+ return !1;
168
+ const t = e.constructor;
169
+ if (t === void 0)
170
+ return !0;
171
+ const s = t.prototype;
172
+ return !(!$(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
173
+ }
174
+ function $(e) {
175
+ return Object.prototype.toString.call(e) === "[object Object]";
176
+ }
177
+ function me(e) {
178
+ return new Promise((t) => {
179
+ w.setTimeout(t, e);
180
+ });
181
+ }
182
+ function _(e, t, s) {
183
+ if (typeof s.structuralSharing == "function")
184
+ return s.structuralSharing(e, t);
185
+ if (s.structuralSharing !== !1) {
186
+ if (process.env.NODE_ENV !== "production")
187
+ try {
188
+ return N(e, t);
189
+ } catch (r) {
190
+ throw console.error(
191
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
192
+ ), r;
193
+ }
194
+ return N(e, t);
195
+ }
196
+ return t;
197
+ }
198
+ function Ve(e) {
199
+ return e;
200
+ }
201
+ function Be(e, t, s = 0) {
202
+ const r = [...e, t];
203
+ return s && r.length > s ? r.slice(1) : r;
204
+ }
205
+ function Ge(e, t, s = 0) {
206
+ const r = [t, ...e];
207
+ return s && r.length > s ? r.slice(0, -1) : r;
208
+ }
209
+ var U = Symbol();
210
+ function be(e, t) {
211
+ return process.env.NODE_ENV !== "production" && e.queryFn === U && console.error(
212
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
213
+ ), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === U ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
214
+ }
215
+ function ge(e, t) {
216
+ return typeof e == "function" ? e(...t) : !!e;
217
+ }
218
+ var Se = class extends H {
219
+ #t;
220
+ #e;
221
+ #s;
222
+ constructor() {
223
+ super(), this.#s = (e) => {
224
+ if (!E && window.addEventListener) {
225
+ const t = () => e();
226
+ return window.addEventListener("visibilitychange", t, !1), () => {
227
+ window.removeEventListener("visibilitychange", t);
228
+ };
229
+ }
230
+ };
231
+ }
232
+ onSubscribe() {
233
+ this.#e || this.setEventListener(this.#s);
234
+ }
235
+ onUnsubscribe() {
236
+ this.hasListeners() || (this.#e?.(), this.#e = void 0);
237
+ }
238
+ setEventListener(e) {
239
+ this.#s = e, this.#e?.(), this.#e = e((t) => {
240
+ typeof t == "boolean" ? this.setFocused(t) : this.onFocus();
241
+ });
242
+ }
243
+ setFocused(e) {
244
+ this.#t !== e && (this.#t = e, this.onFocus());
245
+ }
246
+ onFocus() {
247
+ const e = this.isFocused();
248
+ this.listeners.forEach((t) => {
249
+ t(e);
250
+ });
251
+ }
252
+ isFocused() {
253
+ return typeof this.#t == "boolean" ? this.#t : globalThis.document?.visibilityState !== "hidden";
254
+ }
255
+ }, se = new Se();
256
+ function L() {
257
+ let e, t;
258
+ const s = new Promise((n, u) => {
259
+ e = n, t = u;
260
+ });
261
+ s.status = "pending", s.catch(() => {
262
+ });
263
+ function r(n) {
264
+ Object.assign(s, n), delete s.resolve, delete s.reject;
265
+ }
266
+ return s.resolve = (n) => {
267
+ r({
268
+ status: "fulfilled",
269
+ value: n
270
+ }), e(n);
271
+ }, s.reject = (n) => {
272
+ r({
273
+ status: "rejected",
274
+ reason: n
275
+ }), t(n);
276
+ }, s;
277
+ }
278
+ function ze(e) {
279
+ let t;
280
+ if (e.then((s) => (t = s, s), C)?.catch(C), t !== void 0)
281
+ return { data: t };
282
+ }
283
+ var Re = pe;
284
+ function Oe() {
285
+ let e = [], t = 0, s = (i) => {
286
+ i();
287
+ }, r = (i) => {
288
+ i();
289
+ }, n = Re;
290
+ const u = (i) => {
291
+ t ? e.push(i) : n(() => {
292
+ s(i);
293
+ });
294
+ }, a = () => {
295
+ const i = e;
296
+ e = [], i.length && n(() => {
297
+ r(() => {
298
+ i.forEach((o) => {
299
+ s(o);
300
+ });
301
+ });
302
+ });
303
+ };
304
+ return {
305
+ batch: (i) => {
306
+ let o;
307
+ t++;
308
+ try {
309
+ o = i();
310
+ } finally {
311
+ t--, t || a();
312
+ }
313
+ return o;
314
+ },
315
+ /**
316
+ * All calls to the wrapped function will be batched.
317
+ */
318
+ batchCalls: (i) => (...o) => {
319
+ u(() => {
320
+ i(...o);
321
+ });
322
+ },
323
+ schedule: u,
324
+ /**
325
+ * Use this method to set a custom notify function.
326
+ * This can be used to for example wrap notifications with `React.act` while running tests.
327
+ */
328
+ setNotifyFunction: (i) => {
329
+ s = i;
330
+ },
331
+ /**
332
+ * Use this method to set a custom function to batch notifications together into a single tick.
333
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
334
+ */
335
+ setBatchNotifyFunction: (i) => {
336
+ r = i;
337
+ },
338
+ setScheduler: (i) => {
339
+ n = i;
340
+ }
341
+ };
342
+ }
343
+ var B = Oe(), we = class extends H {
344
+ #t = !0;
345
+ #e;
346
+ #s;
347
+ constructor() {
348
+ super(), this.#s = (e) => {
349
+ if (!E && window.addEventListener) {
350
+ const t = () => e(!0), s = () => e(!1);
351
+ return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
352
+ window.removeEventListener("online", t), window.removeEventListener("offline", s);
353
+ };
354
+ }
355
+ };
356
+ }
357
+ onSubscribe() {
358
+ this.#e || this.setEventListener(this.#s);
359
+ }
360
+ onUnsubscribe() {
361
+ this.hasListeners() || (this.#e?.(), this.#e = void 0);
362
+ }
363
+ setEventListener(e) {
364
+ this.#s = e, this.#e?.(), this.#e = e(this.setOnline.bind(this));
365
+ }
366
+ setOnline(e) {
367
+ this.#t !== e && (this.#t = e, this.listeners.forEach((s) => {
368
+ s(e);
369
+ }));
370
+ }
371
+ isOnline() {
372
+ return this.#t;
373
+ }
374
+ }, re = new we();
375
+ function Ee(e) {
376
+ return Math.min(1e3 * 2 ** e, 3e4);
377
+ }
378
+ function ie(e) {
379
+ return (e ?? "online") === "online" ? re.isOnline() : !0;
380
+ }
381
+ var Q = class extends Error {
382
+ constructor(e) {
383
+ super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
384
+ }
385
+ };
386
+ function $e(e) {
387
+ return e instanceof Q;
388
+ }
389
+ function Ce(e) {
390
+ let t = !1, s = 0, r;
391
+ const n = L(), u = () => n.status !== "pending", a = (f) => {
392
+ if (!u()) {
393
+ const g = new Q(f);
394
+ h(g), e.onCancel?.(g);
395
+ }
396
+ }, i = () => {
397
+ t = !0;
398
+ }, o = () => {
399
+ t = !1;
400
+ }, l = () => se.isFocused() && (e.networkMode === "always" || re.isOnline()) && e.canRun(), c = () => ie(e.networkMode) && e.canRun(), d = (f) => {
401
+ u() || (r?.(), n.resolve(f));
402
+ }, h = (f) => {
403
+ u() || (r?.(), n.reject(f));
404
+ }, R = () => new Promise((f) => {
405
+ r = (g) => {
406
+ (u() || l()) && f(g);
407
+ }, e.onPause?.();
408
+ }).then(() => {
409
+ r = void 0, u() || e.onContinue?.();
410
+ }), F = () => {
411
+ if (u())
412
+ return;
413
+ let f;
414
+ const g = s === 0 ? e.initialPromise : void 0;
415
+ try {
416
+ f = g ?? e.fn();
417
+ } catch (m) {
418
+ f = Promise.reject(m);
419
+ }
420
+ Promise.resolve(f).then(d).catch((m) => {
421
+ if (u())
422
+ return;
423
+ const S = e.retry ?? (E ? 0 : 3), O = e.retryDelay ?? Ee, P = typeof O == "function" ? O(s, m) : O, D = S === !0 || typeof S == "number" && s < S || typeof S == "function" && S(s, m);
424
+ if (t || !D) {
425
+ h(m);
426
+ return;
427
+ }
428
+ s++, e.onFail?.(s, m), me(P).then(() => l() ? void 0 : R()).then(() => {
429
+ t ? h(m) : F();
430
+ });
431
+ });
432
+ };
433
+ return {
434
+ promise: n,
435
+ status: () => n.status,
436
+ cancel: a,
437
+ continue: () => (r?.(), n),
438
+ cancelRetry: i,
439
+ continueRetry: o,
440
+ canStart: c,
441
+ start: () => (c() ? F() : R().then(F), n)
442
+ };
443
+ }
444
+ var Fe = class {
445
+ #t;
446
+ destroy() {
447
+ this.clearGcTimeout();
448
+ }
449
+ scheduleGc() {
450
+ this.clearGcTimeout(), j(this.gcTime) && (this.#t = w.setTimeout(() => {
451
+ this.optionalRemove();
452
+ }, this.gcTime));
453
+ }
454
+ updateGcTime(e) {
455
+ this.gcTime = Math.max(
456
+ this.gcTime || 0,
457
+ e ?? (E ? 1 / 0 : 300 * 1e3)
458
+ );
459
+ }
460
+ clearGcTimeout() {
461
+ this.#t && (w.clearTimeout(this.#t), this.#t = void 0);
462
+ }
463
+ }, Je = class extends Fe {
464
+ #t;
465
+ #e;
466
+ #s;
467
+ #i;
468
+ #r;
469
+ #o;
470
+ #a;
471
+ constructor(e) {
472
+ super(), this.#a = !1, this.#o = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#s = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = W(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
473
+ }
474
+ get meta() {
475
+ return this.options.meta;
476
+ }
477
+ get promise() {
478
+ return this.#r?.promise;
479
+ }
480
+ setOptions(e) {
481
+ if (this.options = { ...this.#o, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
482
+ const t = W(this.options);
483
+ t.data !== void 0 && (this.setState(
484
+ J(t.data, t.dataUpdatedAt)
485
+ ), this.#t = t);
486
+ }
487
+ }
488
+ optionalRemove() {
489
+ !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
490
+ }
491
+ setData(e, t) {
492
+ const s = _(this.state.data, e, this.options);
493
+ return this.#n({
494
+ data: s,
495
+ type: "success",
496
+ dataUpdatedAt: t?.updatedAt,
497
+ manual: t?.manual
498
+ }), s;
499
+ }
500
+ setState(e, t) {
501
+ this.#n({ type: "setState", state: e, setStateOptions: t });
502
+ }
503
+ cancel(e) {
504
+ const t = this.#r?.promise;
505
+ return this.#r?.cancel(e), t ? t.then(C).catch(C) : Promise.resolve();
506
+ }
507
+ destroy() {
508
+ super.destroy(), this.cancel({ silent: !0 });
509
+ }
510
+ reset() {
511
+ this.destroy(), this.setState(this.#t);
512
+ }
513
+ isActive() {
514
+ return this.observers.some(
515
+ (e) => v(e.options.enabled, this) !== !1
516
+ );
517
+ }
518
+ isDisabled() {
519
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === U || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
520
+ }
521
+ isStatic() {
522
+ return this.getObserversCount() > 0 ? this.observers.some(
523
+ (e) => I(e.options.staleTime, this) === "static"
524
+ ) : !1;
525
+ }
526
+ isStale() {
527
+ return this.getObserversCount() > 0 ? this.observers.some(
528
+ (e) => e.getCurrentResult().isStale
529
+ ) : this.state.data === void 0 || this.state.isInvalidated;
530
+ }
531
+ isStaleByTime(e = 0) {
532
+ return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !te(this.state.dataUpdatedAt, e);
533
+ }
534
+ onFocus() {
535
+ this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
536
+ }
537
+ onOnline() {
538
+ this.observers.find((t) => t.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
539
+ }
540
+ addObserver(e) {
541
+ this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: e }));
542
+ }
543
+ removeObserver(e) {
544
+ this.observers.includes(e) && (this.observers = this.observers.filter((t) => t !== e), this.observers.length || (this.#r && (this.#a ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: e }));
545
+ }
546
+ getObserversCount() {
547
+ return this.observers.length;
548
+ }
549
+ invalidate() {
550
+ this.state.isInvalidated || this.#n({ type: "invalidate" });
551
+ }
552
+ async fetch(e, t) {
553
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
554
+ // re-start the fetch; there is a chance that the query is still in a
555
+ // pending state when that happens
556
+ this.#r?.status() !== "rejected") {
557
+ if (this.state.data !== void 0 && t?.cancelRefetch)
558
+ this.cancel({ silent: !0 });
559
+ else if (this.#r)
560
+ return this.#r.continueRetry(), this.#r.promise;
561
+ }
562
+ if (e && this.setOptions(e), !this.options.queryFn) {
563
+ const i = this.observers.find((o) => o.options.queryFn);
564
+ i && this.setOptions(i.options);
565
+ }
566
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
567
+ "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']"
568
+ ));
569
+ const s = new AbortController(), r = (i) => {
570
+ Object.defineProperty(i, "signal", {
571
+ enumerable: !0,
572
+ get: () => (this.#a = !0, s.signal)
573
+ });
574
+ }, n = () => {
575
+ const i = be(this.options, t), l = (() => {
576
+ const c = {
577
+ client: this.#i,
578
+ queryKey: this.queryKey,
579
+ meta: this.meta
580
+ };
581
+ return r(c), c;
582
+ })();
583
+ return this.#a = !1, this.options.persister ? this.options.persister(
584
+ i,
585
+ l,
586
+ this
587
+ ) : i(l);
588
+ }, a = (() => {
589
+ const i = {
590
+ fetchOptions: t,
591
+ options: this.options,
592
+ queryKey: this.queryKey,
593
+ client: this.#i,
594
+ state: this.state,
595
+ fetchFn: n
596
+ };
597
+ return r(i), i;
598
+ })();
599
+ this.options.behavior?.onFetch(a, this), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#n({ type: "fetch", meta: a.fetchOptions?.meta }), this.#r = Ce({
600
+ initialPromise: t?.initialPromise,
601
+ fn: a.fetchFn,
602
+ onCancel: (i) => {
603
+ i instanceof Q && i.revert && this.setState({
604
+ ...this.#e,
605
+ fetchStatus: "idle"
606
+ }), s.abort();
607
+ },
608
+ onFail: (i, o) => {
609
+ this.#n({ type: "failed", failureCount: i, error: o });
610
+ },
611
+ onPause: () => {
612
+ this.#n({ type: "pause" });
613
+ },
614
+ onContinue: () => {
615
+ this.#n({ type: "continue" });
616
+ },
617
+ retry: a.options.retry,
618
+ retryDelay: a.options.retryDelay,
619
+ networkMode: a.options.networkMode,
620
+ canRun: () => !0
621
+ });
622
+ try {
623
+ const i = await this.#r.start();
624
+ if (i === void 0)
625
+ throw process.env.NODE_ENV !== "production" && console.error(
626
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
627
+ ), new Error(`${this.queryHash} data is undefined`);
628
+ return this.setData(i), this.#s.config.onSuccess?.(i, this), this.#s.config.onSettled?.(
629
+ i,
630
+ this.state.error,
631
+ this
632
+ ), i;
633
+ } catch (i) {
634
+ if (i instanceof Q) {
635
+ if (i.silent)
636
+ return this.#r.promise;
637
+ if (i.revert) {
638
+ if (this.state.data === void 0)
639
+ throw i;
640
+ return this.state.data;
641
+ }
642
+ }
643
+ throw this.#n({
644
+ type: "error",
645
+ error: i
646
+ }), this.#s.config.onError?.(
647
+ i,
648
+ this
649
+ ), this.#s.config.onSettled?.(
650
+ this.state.data,
651
+ i,
652
+ this
653
+ ), i;
654
+ } finally {
655
+ this.scheduleGc();
656
+ }
657
+ }
658
+ #n(e) {
659
+ const t = (s) => {
660
+ switch (e.type) {
661
+ case "failed":
662
+ return {
663
+ ...s,
664
+ fetchFailureCount: e.failureCount,
665
+ fetchFailureReason: e.error
666
+ };
667
+ case "pause":
668
+ return {
669
+ ...s,
670
+ fetchStatus: "paused"
671
+ };
672
+ case "continue":
673
+ return {
674
+ ...s,
675
+ fetchStatus: "fetching"
676
+ };
677
+ case "fetch":
678
+ return {
679
+ ...s,
680
+ ...ne(s.data, this.options),
681
+ fetchMeta: e.meta ?? null
682
+ };
683
+ case "success":
684
+ const r = {
685
+ ...s,
686
+ ...J(e.data, e.dataUpdatedAt),
687
+ dataUpdateCount: s.dataUpdateCount + 1,
688
+ ...!e.manual && {
689
+ fetchStatus: "idle",
690
+ fetchFailureCount: 0,
691
+ fetchFailureReason: null
692
+ }
693
+ };
694
+ return this.#e = e.manual ? r : void 0, r;
695
+ case "error":
696
+ const n = e.error;
697
+ return {
698
+ ...s,
699
+ error: n,
700
+ errorUpdateCount: s.errorUpdateCount + 1,
701
+ errorUpdatedAt: Date.now(),
702
+ fetchFailureCount: s.fetchFailureCount + 1,
703
+ fetchFailureReason: n,
704
+ fetchStatus: "idle",
705
+ status: "error"
706
+ };
707
+ case "invalidate":
708
+ return {
709
+ ...s,
710
+ isInvalidated: !0
711
+ };
712
+ case "setState":
713
+ return {
714
+ ...s,
715
+ ...e.state
716
+ };
717
+ }
718
+ };
719
+ this.state = t(this.state), B.batch(() => {
720
+ this.observers.forEach((s) => {
721
+ s.onQueryUpdate();
722
+ }), this.#s.notify({ query: this, type: "updated", action: e });
723
+ });
724
+ }
725
+ };
726
+ function ne(e, t) {
727
+ return {
728
+ fetchFailureCount: 0,
729
+ fetchFailureReason: null,
730
+ fetchStatus: ie(t.networkMode) ? "fetching" : "paused",
731
+ ...e === void 0 && {
732
+ error: null,
733
+ status: "pending"
734
+ }
735
+ };
736
+ }
737
+ function J(e, t) {
738
+ return {
739
+ data: e,
740
+ dataUpdatedAt: t ?? Date.now(),
741
+ error: null,
742
+ isInvalidated: !1,
743
+ status: "success"
744
+ };
745
+ }
746
+ function W(e) {
747
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
748
+ return {
749
+ data: t,
750
+ dataUpdateCount: 0,
751
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
752
+ error: null,
753
+ errorUpdateCount: 0,
754
+ errorUpdatedAt: 0,
755
+ fetchFailureCount: 0,
756
+ fetchFailureReason: null,
757
+ fetchMeta: null,
758
+ isInvalidated: !1,
759
+ status: s ? "success" : "pending",
760
+ fetchStatus: "idle"
761
+ };
762
+ }
763
+ var ae = class extends H {
764
+ constructor(e, t) {
765
+ super(), this.options = t, this.#t = e, this.#n = null, this.#a = L(), this.bindMethods(), this.setOptions(t);
766
+ }
767
+ #t;
768
+ #e = void 0;
769
+ #s = void 0;
770
+ #i = void 0;
771
+ #r;
772
+ #o;
773
+ #a;
774
+ #n;
775
+ #y;
776
+ #f;
777
+ // This property keeps track of the last query with defined data.
778
+ // It will be used to pass the previous data and query to the placeholder function between renders.
779
+ #d;
780
+ #c;
781
+ #h;
782
+ #u;
783
+ #p = /* @__PURE__ */ new Set();
784
+ bindMethods() {
785
+ this.refetch = this.refetch.bind(this);
786
+ }
787
+ onSubscribe() {
788
+ this.listeners.size === 1 && (this.#e.addObserver(this), Z(this.#e, this.options) ? this.#l() : this.updateResult(), this.#g());
789
+ }
790
+ onUnsubscribe() {
791
+ this.hasListeners() || this.destroy();
792
+ }
793
+ shouldFetchOnReconnect() {
794
+ return K(
795
+ this.#e,
796
+ this.options,
797
+ this.options.refetchOnReconnect
798
+ );
799
+ }
800
+ shouldFetchOnWindowFocus() {
801
+ return K(
802
+ this.#e,
803
+ this.options,
804
+ this.options.refetchOnWindowFocus
805
+ );
806
+ }
807
+ destroy() {
808
+ this.listeners = /* @__PURE__ */ new Set(), this.#S(), this.#R(), this.#e.removeObserver(this);
809
+ }
810
+ setOptions(e) {
811
+ const t = this.options, s = this.#e;
812
+ if (this.options = this.#t.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof v(this.options.enabled, this.#e) != "boolean")
813
+ throw new Error(
814
+ "Expected enabled to be a boolean or a callback that returns a boolean"
815
+ );
816
+ this.#O(), this.#e.setOptions(this.options), t._defaulted && !k(this.options, t) && this.#t.getQueryCache().notify({
817
+ type: "observerOptionsUpdated",
818
+ query: this.#e,
819
+ observer: this
820
+ });
821
+ const r = this.hasListeners();
822
+ r && X(
823
+ this.#e,
824
+ s,
825
+ this.options,
826
+ t
827
+ ) && this.#l(), this.updateResult(), r && (this.#e !== s || v(this.options.enabled, this.#e) !== v(t.enabled, this.#e) || I(this.options.staleTime, this.#e) !== I(t.staleTime, this.#e)) && this.#v();
828
+ const n = this.#m();
829
+ r && (this.#e !== s || v(this.options.enabled, this.#e) !== v(t.enabled, this.#e) || n !== this.#u) && this.#b(n);
830
+ }
831
+ getOptimisticResult(e) {
832
+ const t = this.#t.getQueryCache().build(this.#t, e), s = this.createResult(t, e);
833
+ return Ie(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#e.state), s;
834
+ }
835
+ getCurrentResult() {
836
+ return this.#i;
837
+ }
838
+ trackResult(e, t) {
839
+ return new Proxy(e, {
840
+ get: (s, r) => (this.trackProp(r), t?.(r), r === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && this.#a.status === "pending" && this.#a.reject(
841
+ new Error(
842
+ "experimental_prefetchInRender feature flag is not enabled"
843
+ )
844
+ )), Reflect.get(s, r))
845
+ });
846
+ }
847
+ trackProp(e) {
848
+ this.#p.add(e);
849
+ }
850
+ getCurrentQuery() {
851
+ return this.#e;
852
+ }
853
+ refetch({ ...e } = {}) {
854
+ return this.fetch({
855
+ ...e
856
+ });
857
+ }
858
+ fetchOptimistic(e) {
859
+ const t = this.#t.defaultQueryOptions(e), s = this.#t.getQueryCache().build(this.#t, t);
860
+ return s.fetch().then(() => this.createResult(s, t));
861
+ }
862
+ fetch(e) {
863
+ return this.#l({
864
+ ...e,
865
+ cancelRefetch: e.cancelRefetch ?? !0
866
+ }).then(() => (this.updateResult(), this.#i));
867
+ }
868
+ #l(e) {
869
+ this.#O();
870
+ let t = this.#e.fetch(
871
+ this.options,
872
+ e
873
+ );
874
+ return e?.throwOnError || (t = t.catch(C)), t;
875
+ }
876
+ #v() {
877
+ this.#S();
878
+ const e = I(
879
+ this.options.staleTime,
880
+ this.#e
881
+ );
882
+ if (E || this.#i.isStale || !j(e))
883
+ return;
884
+ const s = te(this.#i.dataUpdatedAt, e) + 1;
885
+ this.#c = w.setTimeout(() => {
886
+ this.#i.isStale || this.updateResult();
887
+ }, s);
888
+ }
889
+ #m() {
890
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
891
+ }
892
+ #b(e) {
893
+ this.#R(), this.#u = e, !(E || v(this.options.enabled, this.#e) === !1 || !j(this.#u) || this.#u === 0) && (this.#h = w.setInterval(() => {
894
+ (this.options.refetchIntervalInBackground || se.isFocused()) && this.#l();
895
+ }, this.#u));
896
+ }
897
+ #g() {
898
+ this.#v(), this.#b(this.#m());
899
+ }
900
+ #S() {
901
+ this.#c && (w.clearTimeout(this.#c), this.#c = void 0);
902
+ }
903
+ #R() {
904
+ this.#h && (w.clearInterval(this.#h), this.#h = void 0);
905
+ }
906
+ createResult(e, t) {
907
+ const s = this.#e, r = this.options, n = this.#i, u = this.#r, a = this.#o, o = e !== s ? e.state : this.#s, { state: l } = e;
908
+ let c = { ...l }, d = !1, h;
909
+ if (t._optimisticResults) {
910
+ const y = this.hasListeners(), M = !y && Z(e, t), T = y && X(e, s, t, r);
911
+ (M || T) && (c = {
912
+ ...c,
913
+ ...ne(l.data, e.options)
914
+ }), t._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
915
+ }
916
+ let { error: R, errorUpdatedAt: F, status: f } = c;
917
+ h = c.data;
918
+ let g = !1;
919
+ if (t.placeholderData !== void 0 && h === void 0 && f === "pending") {
920
+ let y;
921
+ n?.isPlaceholderData && t.placeholderData === a?.placeholderData ? (y = n.data, g = !0) : y = typeof t.placeholderData == "function" ? t.placeholderData(
922
+ this.#d?.state.data,
923
+ this.#d
924
+ ) : t.placeholderData, y !== void 0 && (f = "success", h = _(
925
+ n?.data,
926
+ y,
927
+ t
928
+ ), d = !0);
929
+ }
930
+ if (t.select && h !== void 0 && !g)
931
+ if (n && h === u?.data && t.select === this.#y)
932
+ h = this.#f;
933
+ else
934
+ try {
935
+ this.#y = t.select, h = t.select(h), h = _(n?.data, h, t), this.#f = h, this.#n = null;
936
+ } catch (y) {
937
+ this.#n = y;
938
+ }
939
+ this.#n && (R = this.#n, h = this.#f, F = Date.now(), f = "error");
940
+ const m = c.fetchStatus === "fetching", S = f === "pending", O = f === "error", P = S && m, D = h !== void 0, b = {
941
+ status: f,
942
+ fetchStatus: c.fetchStatus,
943
+ isPending: S,
944
+ isSuccess: f === "success",
945
+ isError: O,
946
+ isInitialLoading: P,
947
+ isLoading: P,
948
+ data: h,
949
+ dataUpdatedAt: c.dataUpdatedAt,
950
+ error: R,
951
+ errorUpdatedAt: F,
952
+ failureCount: c.fetchFailureCount,
953
+ failureReason: c.fetchFailureReason,
954
+ errorUpdateCount: c.errorUpdateCount,
955
+ isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
956
+ isFetchedAfterMount: c.dataUpdateCount > o.dataUpdateCount || c.errorUpdateCount > o.errorUpdateCount,
957
+ isFetching: m,
958
+ isRefetching: m && !S,
959
+ isLoadingError: O && !D,
960
+ isPaused: c.fetchStatus === "paused",
961
+ isPlaceholderData: d,
962
+ isRefetchError: O && D,
963
+ isStale: G(e, t),
964
+ refetch: this.refetch,
965
+ promise: this.#a,
966
+ isEnabled: v(t.enabled, e) !== !1
967
+ };
968
+ if (this.options.experimental_prefetchInRender) {
969
+ const y = (x) => {
970
+ b.status === "error" ? x.reject(b.error) : b.data !== void 0 && x.resolve(b.data);
971
+ }, M = () => {
972
+ const x = this.#a = b.promise = L();
973
+ y(x);
974
+ }, T = this.#a;
975
+ switch (T.status) {
976
+ case "pending":
977
+ e.queryHash === s.queryHash && y(T);
978
+ break;
979
+ case "fulfilled":
980
+ (b.status === "error" || b.data !== T.value) && M();
981
+ break;
982
+ case "rejected":
983
+ (b.status !== "error" || b.error !== T.reason) && M();
984
+ break;
985
+ }
986
+ }
987
+ return b;
988
+ }
989
+ updateResult() {
990
+ const e = this.#i, t = this.createResult(this.#e, this.options);
991
+ if (this.#r = this.#e.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#e), k(t, e))
992
+ return;
993
+ this.#i = t;
994
+ const s = () => {
995
+ if (!e)
996
+ return !0;
997
+ const { notifyOnChangeProps: r } = this.options, n = typeof r == "function" ? r() : r;
998
+ if (n === "all" || !n && !this.#p.size)
999
+ return !0;
1000
+ const u = new Set(
1001
+ n ?? this.#p
1002
+ );
1003
+ return this.options.throwOnError && u.add("error"), Object.keys(this.#i).some((a) => {
1004
+ const i = a;
1005
+ return this.#i[i] !== e[i] && u.has(i);
1006
+ });
1007
+ };
1008
+ this.#w({ listeners: s() });
1009
+ }
1010
+ #O() {
1011
+ const e = this.#t.getQueryCache().build(this.#t, this.options);
1012
+ if (e === this.#e)
1013
+ return;
1014
+ const t = this.#e;
1015
+ this.#e = e, this.#s = e.state, this.hasListeners() && (t?.removeObserver(this), e.addObserver(this));
1016
+ }
1017
+ onQueryUpdate() {
1018
+ this.updateResult(), this.hasListeners() && this.#g();
1019
+ }
1020
+ #w(e) {
1021
+ B.batch(() => {
1022
+ e.listeners && this.listeners.forEach((t) => {
1023
+ t(this.#i);
1024
+ }), this.#t.getQueryCache().notify({
1025
+ query: this.#e,
1026
+ type: "observerResultsUpdated"
1027
+ });
1028
+ });
1029
+ }
1030
+ };
1031
+ function Te(e, t) {
1032
+ return v(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
1033
+ }
1034
+ function Z(e, t) {
1035
+ return Te(e, t) || e.state.data !== void 0 && K(e, t, t.refetchOnMount);
1036
+ }
1037
+ function K(e, t, s) {
1038
+ if (v(t.enabled, e) !== !1 && I(t.staleTime, e) !== "static") {
1039
+ const r = typeof s == "function" ? s(e) : s;
1040
+ return r === "always" || r !== !1 && G(e, t);
1041
+ }
1042
+ return !1;
1043
+ }
1044
+ function X(e, t, s, r) {
1045
+ return (e !== t || v(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && G(e, s);
1046
+ }
1047
+ function G(e, t) {
1048
+ return v(t.enabled, e) !== !1 && e.isStaleByTime(I(t.staleTime, e));
1049
+ }
1050
+ function Ie(e, t) {
1051
+ return !k(e.getCurrentResult(), t);
1052
+ }
1053
+ var oe = p.createContext(
1054
+ void 0
1055
+ ), Pe = (e) => {
1056
+ const t = p.useContext(oe);
1057
+ if (e)
1058
+ return e;
1059
+ if (!t)
1060
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1061
+ return t;
1062
+ }, We = ({
1063
+ client: e,
1064
+ children: t
1065
+ }) => (p.useEffect(() => (e.mount(), () => {
1066
+ e.unmount();
1067
+ }), [e]), /* @__PURE__ */ ee.jsx(oe.Provider, { value: e, children: t })), ue = p.createContext(!1), De = () => p.useContext(ue), Ze = ue.Provider;
1068
+ function ce() {
1069
+ let e = !1;
1070
+ return {
1071
+ clearReset: () => {
1072
+ e = !1;
1073
+ },
1074
+ reset: () => {
1075
+ e = !0;
1076
+ },
1077
+ isReset: () => e
1078
+ };
1079
+ }
1080
+ var he = p.createContext(ce()), Me = () => p.useContext(he), Xe = ({
1081
+ children: e
1082
+ }) => {
1083
+ const [t] = p.useState(() => ce());
1084
+ return /* @__PURE__ */ ee.jsx(he.Provider, { value: t, children: typeof e == "function" ? e(t) : e });
1085
+ }, xe = (e, t) => {
1086
+ (e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
1087
+ }, Ue = (e) => {
1088
+ p.useEffect(() => {
1089
+ e.clearReset();
1090
+ }, [e]);
1091
+ }, Qe = ({
1092
+ result: e,
1093
+ errorResetBoundary: t,
1094
+ throwOnError: s,
1095
+ query: r,
1096
+ suspense: n
1097
+ }) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || ge(s, [e.error, r])), je = (e, t) => t.state.data === void 0, qe = (e) => {
1098
+ if (e.suspense) {
1099
+ const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = e.staleTime;
1100
+ e.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(
1101
+ e.gcTime,
1102
+ 1e3
1103
+ ));
1104
+ }
1105
+ }, Ne = (e, t) => e.isLoading && e.isFetching && !t, ke = (e, t) => e?.suspense && t.isPending, Y = (e, t, s) => t.fetchOptimistic(e).catch(() => {
1106
+ s.clearReset();
1107
+ });
1108
+ function le(e, t, s) {
1109
+ if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
1110
+ throw new Error(
1111
+ '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'
1112
+ );
1113
+ const r = De(), n = Me(), u = Pe(s), a = u.defaultQueryOptions(e);
1114
+ u.getDefaultOptions().queries?._experimental_beforeQuery?.(
1115
+ a
1116
+ ), process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
1117
+ `[${a.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`
1118
+ )), a._optimisticResults = r ? "isRestoring" : "optimistic", qe(a), xe(a, n), Ue(n);
1119
+ const i = !u.getQueryCache().get(a.queryHash), [o] = p.useState(
1120
+ () => new t(
1121
+ u,
1122
+ a
1123
+ )
1124
+ ), l = o.getOptimisticResult(a), c = !r && e.subscribed !== !1;
1125
+ if (p.useSyncExternalStore(
1126
+ p.useCallback(
1127
+ (d) => {
1128
+ const h = c ? o.subscribe(B.batchCalls(d)) : C;
1129
+ return o.updateResult(), h;
1130
+ },
1131
+ [o, c]
1132
+ ),
1133
+ () => o.getCurrentResult(),
1134
+ () => o.getCurrentResult()
1135
+ ), p.useEffect(() => {
1136
+ o.setOptions(a);
1137
+ }, [a, o]), ke(a, l))
1138
+ throw Y(a, o, n);
1139
+ if (Qe({
1140
+ result: l,
1141
+ errorResetBoundary: n,
1142
+ throwOnError: a.throwOnError,
1143
+ query: u.getQueryCache().get(a.queryHash),
1144
+ suspense: a.suspense
1145
+ }))
1146
+ throw l.error;
1147
+ return u.getDefaultOptions().queries?._experimental_afterQuery?.(
1148
+ a,
1149
+ l
1150
+ ), a.experimental_prefetchInRender && !E && Ne(l, r) && (i ? (
1151
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1152
+ Y(a, o, n)
1153
+ ) : (
1154
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1155
+ u.getQueryCache().get(a.queryHash)?.promise
1156
+ ))?.catch(C).finally(() => {
1157
+ o.updateResult();
1158
+ }), a.notifyOnChangeProps ? l : o.trackResult(l);
1159
+ }
1160
+ function Ye(e, t) {
1161
+ return le(e, ae, t);
1162
+ }
1163
+ function et(e, t) {
1164
+ return process.env.NODE_ENV !== "production" && e.queryFn === U && console.error("skipToken is not allowed for useSuspenseQuery"), le(
1165
+ {
1166
+ ...e,
1167
+ enabled: !0,
1168
+ suspense: !0,
1169
+ throwOnError: je,
1170
+ placeholderData: void 0
1171
+ },
1172
+ ae,
1173
+ t
1174
+ );
1175
+ }
1176
+ export {
1177
+ Me as A,
1178
+ qe as B,
1179
+ xe as C,
1180
+ Ue as D,
1181
+ ke as E,
1182
+ Y as F,
1183
+ Ne as G,
1184
+ Qe as H,
1185
+ le as I,
1186
+ je as J,
1187
+ Ze as K,
1188
+ oe as L,
1189
+ We as M,
1190
+ Xe as N,
1191
+ Q as O,
1192
+ Re as P,
1193
+ Je as Q,
1194
+ Fe as R,
1195
+ H as S,
1196
+ $e as T,
1197
+ E as U,
1198
+ w as V,
1199
+ Pe as a,
1200
+ C as b,
1201
+ Ce as c,
1202
+ ge as d,
1203
+ Ye as e,
1204
+ be as f,
1205
+ Ge as g,
1206
+ q as h,
1207
+ Be as i,
1208
+ ye as j,
1209
+ Ve as k,
1210
+ Ke as l,
1211
+ He as m,
1212
+ B as n,
1213
+ se as o,
1214
+ re as p,
1215
+ Le as q,
1216
+ I as r,
1217
+ k as s,
1218
+ ze as t,
1219
+ et as u,
1220
+ V as v,
1221
+ U as w,
1222
+ ae as x,
1223
+ N as y,
1224
+ De as z
1225
+ };
1226
+ //# sourceMappingURL=useSuspenseQuery-CSB_rVek.js.map