zudoku 0.0.0-e101786 → 0.0.0-e20b2e4

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 (505) hide show
  1. package/dist/app/entry.server.d.ts +1 -1
  2. package/dist/app/main.d.ts +1 -1
  3. package/dist/app/main.js +18 -8
  4. package/dist/app/main.js.map +1 -1
  5. package/dist/cli/common/output.js.map +1 -1
  6. package/dist/cli/dev/handler.js +7 -2
  7. package/dist/cli/dev/handler.js.map +1 -1
  8. package/dist/config/config.d.ts +1 -0
  9. package/dist/config/loader.js +4 -1
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/validators/common.d.ts +217 -28
  12. package/dist/config/validators/common.js +15 -6
  13. package/dist/config/validators/common.js.map +1 -1
  14. package/dist/config/validators/icon-types.d.ts +1 -1
  15. package/dist/config/validators/validate.d.ts +88 -12
  16. package/dist/lib/authentication/providers/auth0.js +1 -1
  17. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  18. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  19. package/dist/lib/authentication/providers/openid.js +10 -6
  20. package/dist/lib/authentication/providers/openid.js.map +1 -1
  21. package/dist/lib/authentication/state.d.ts +9 -0
  22. package/dist/lib/authentication/state.js +11 -0
  23. package/dist/lib/authentication/state.js.map +1 -1
  24. package/dist/lib/components/AnchorLink.js +5 -2
  25. package/dist/lib/components/AnchorLink.js.map +1 -1
  26. package/dist/lib/components/Autocomplete.d.ts +13 -0
  27. package/dist/lib/components/Autocomplete.js +47 -0
  28. package/dist/lib/components/Autocomplete.js.map +1 -0
  29. package/dist/lib/components/Header.js +4 -4
  30. package/dist/lib/components/Header.js.map +1 -1
  31. package/dist/lib/components/Heading.d.ts +1 -1
  32. package/dist/lib/components/Markdown.d.ts +2 -2
  33. package/dist/lib/components/Markdown.js +3 -1
  34. package/dist/lib/components/Markdown.js.map +1 -1
  35. package/dist/lib/components/PathRenderer.d.ts +11 -0
  36. package/dist/lib/components/PathRenderer.js +28 -0
  37. package/dist/lib/components/PathRenderer.js.map +1 -0
  38. package/dist/lib/components/StatusPage.d.ts +7 -0
  39. package/dist/lib/components/StatusPage.js +71 -0
  40. package/dist/lib/components/StatusPage.js.map +1 -0
  41. package/dist/lib/components/SyntaxHighlight.d.ts +2 -1
  42. package/dist/lib/components/SyntaxHighlight.js +2 -2
  43. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  44. package/dist/lib/components/ThemeSwitch.js +2 -2
  45. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  46. package/dist/lib/components/cache.d.ts +6 -0
  47. package/dist/lib/components/cache.js +13 -0
  48. package/dist/lib/components/cache.js.map +1 -0
  49. package/dist/lib/components/context/ViewportAnchorContext.js +16 -4
  50. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  51. package/dist/lib/components/context/ZudokuContext.js +10 -3
  52. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  53. package/dist/lib/components/index.d.ts +14 -2
  54. package/dist/lib/components/index.js +10 -3
  55. package/dist/lib/components/index.js.map +1 -1
  56. package/dist/lib/components/navigation/Sidebar.js +6 -1
  57. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  58. package/dist/lib/components/navigation/SidebarCategory.js +17 -15
  59. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  60. package/dist/lib/components/navigation/SidebarItem.js +1 -0
  61. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  62. package/dist/lib/core/RouteGuard.d.ts +1 -0
  63. package/dist/lib/core/RouteGuard.js +32 -0
  64. package/dist/lib/core/RouteGuard.js.map +1 -0
  65. package/dist/lib/core/ZudokuContext.d.ts +4 -2
  66. package/dist/lib/core/ZudokuContext.js +9 -7
  67. package/dist/lib/core/ZudokuContext.js.map +1 -1
  68. package/dist/lib/oas/graphql/circular.d.ts +3 -0
  69. package/dist/lib/oas/graphql/circular.js +38 -0
  70. package/dist/lib/oas/graphql/circular.js.map +1 -0
  71. package/dist/lib/oas/graphql/index.d.ts +8 -0
  72. package/dist/lib/oas/graphql/index.js +61 -42
  73. package/dist/lib/oas/graphql/index.js.map +1 -1
  74. package/dist/lib/oas/parser/dereference/index.d.ts +0 -1
  75. package/dist/lib/oas/parser/dereference/index.js +1 -1
  76. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  77. package/dist/lib/oas/parser/upgrade/index.js +2 -1
  78. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  79. package/dist/lib/plugins/markdown/MdxPage.js +8 -2
  80. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  81. package/dist/lib/plugins/markdown/resolver.d.ts +0 -6
  82. package/dist/lib/plugins/markdown/resolver.js +0 -29
  83. package/dist/lib/plugins/markdown/resolver.js.map +1 -1
  84. package/dist/lib/plugins/openapi/ColorizedParam.js +3 -1
  85. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  86. package/dist/lib/plugins/openapi/Endpoint.js +6 -7
  87. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  88. package/dist/lib/plugins/openapi/{Route.d.ts → OpenApiRoute.d.ts} +2 -1
  89. package/dist/lib/plugins/openapi/{Route.js → OpenApiRoute.js} +3 -4
  90. package/dist/lib/plugins/openapi/OpenApiRoute.js.map +1 -0
  91. package/dist/lib/plugins/openapi/OperationList.d.ts +4 -1
  92. package/dist/lib/plugins/openapi/OperationList.js +29 -19
  93. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  94. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
  95. package/dist/lib/plugins/openapi/OperationListItem.js +3 -3
  96. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  97. package/dist/lib/plugins/openapi/ParameterListItem.js +2 -2
  98. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  99. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
  100. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +8 -3
  101. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  102. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
  103. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -0
  104. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  105. package/dist/lib/plugins/openapi/Sidecar.js +11 -16
  106. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  107. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  108. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  109. package/dist/lib/plugins/openapi/SidecarExamples.js +17 -14
  110. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  111. package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -2
  112. package/dist/lib/plugins/openapi/graphql/gql.js +3 -2
  113. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  114. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +66 -29
  115. package/dist/lib/plugins/openapi/graphql/graphql.js +33 -15
  116. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  117. package/dist/lib/plugins/openapi/index.js +126 -61
  118. package/dist/lib/plugins/openapi/index.js.map +1 -1
  119. package/dist/lib/plugins/openapi/interfaces.d.ts +12 -4
  120. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  121. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
  122. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  123. package/dist/lib/plugins/openapi/playground/Headers.d.ts +4 -4
  124. package/dist/lib/plugins/openapi/playground/Headers.js +84 -5
  125. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  126. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +9 -0
  127. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +5 -0
  128. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
  129. package/dist/lib/plugins/openapi/playground/PathParams.js +3 -11
  130. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  131. package/dist/lib/plugins/openapi/playground/Playground.d.ts +22 -1
  132. package/dist/lib/plugins/openapi/playground/Playground.js +61 -56
  133. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  134. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  135. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  136. package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -29
  137. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  138. package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
  139. package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
  140. package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
  141. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
  142. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
  143. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
  144. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
  145. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +95 -0
  146. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
  147. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +7 -0
  148. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +16 -0
  149. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
  150. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
  151. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
  152. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
  153. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
  154. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
  155. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
  156. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
  157. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
  158. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
  159. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
  160. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
  161. package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
  162. package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
  163. package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
  164. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
  165. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
  166. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
  167. package/dist/lib/plugins/openapi/schema/{SchemaComponents.js → SchemaPropertyItem.js} +10 -8
  168. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -0
  169. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  170. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  171. package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
  172. package/dist/lib/plugins/openapi/schema/utils.js +2 -0
  173. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  174. package/dist/lib/ui/Badge.d.ts +1 -1
  175. package/dist/lib/ui/Badge.js +1 -0
  176. package/dist/lib/ui/Badge.js.map +1 -1
  177. package/dist/lib/ui/Command.d.ts +9 -1
  178. package/dist/lib/ui/Command.js +5 -1
  179. package/dist/lib/ui/Command.js.map +1 -1
  180. package/dist/lib/ui/Input.d.ts +1 -2
  181. package/dist/lib/ui/Input.js.map +1 -1
  182. package/dist/lib/ui/Select.js +2 -2
  183. package/dist/lib/ui/Select.js.map +1 -1
  184. package/dist/lib/util/MdxComponents.js +2 -2
  185. package/dist/lib/util/MdxComponents.js.map +1 -1
  186. package/dist/lib/util/joinUrl.d.ts +1 -0
  187. package/dist/lib/util/joinUrl.js +40 -0
  188. package/dist/lib/util/joinUrl.js.map +1 -0
  189. package/dist/lib/util/joinUrl.test.d.ts +1 -0
  190. package/dist/lib/util/joinUrl.test.js +43 -0
  191. package/dist/lib/util/joinUrl.test.js.map +1 -0
  192. package/dist/lib/util/scrollIntoViewIfNeeded.d.ts +1 -0
  193. package/dist/lib/util/scrollIntoViewIfNeeded.js +14 -0
  194. package/dist/lib/util/scrollIntoViewIfNeeded.js.map +1 -0
  195. package/dist/lib/util/useLatest.d.ts +1 -0
  196. package/dist/lib/util/useLatest.js +15 -0
  197. package/dist/lib/util/useLatest.js.map +1 -0
  198. package/dist/lib/util/useScrollToAnchor.d.ts +1 -0
  199. package/dist/lib/util/useScrollToAnchor.js +27 -28
  200. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  201. package/dist/lib/util/useScrollToTop.js +6 -4
  202. package/dist/lib/util/useScrollToTop.js.map +1 -1
  203. package/dist/vite/build.js +15 -12
  204. package/dist/vite/build.js.map +1 -1
  205. package/dist/vite/config.js +4 -1
  206. package/dist/vite/config.js.map +1 -1
  207. package/dist/vite/config.test.js +5 -1
  208. package/dist/vite/config.test.js.map +1 -1
  209. package/dist/vite/dev-server.js +4 -1
  210. package/dist/vite/dev-server.js.map +1 -1
  211. package/dist/vite/plugin-api.d.ts +1 -1
  212. package/dist/vite/plugin-api.js +153 -98
  213. package/dist/vite/plugin-api.js.map +1 -1
  214. package/dist/vite/plugin-auth.js +4 -1
  215. package/dist/vite/plugin-auth.js.map +1 -1
  216. package/dist/vite/plugin-config.js +2 -1
  217. package/dist/vite/plugin-config.js.map +1 -1
  218. package/dist/vite/plugin-mdx.js +20 -9
  219. package/dist/vite/plugin-mdx.js.map +1 -1
  220. package/dist/vite/plugin-theme-css.js +7 -4
  221. package/dist/vite/plugin-theme-css.js.map +1 -1
  222. package/dist/vite/plugin.js.map +1 -1
  223. package/dist/vite/{prerender.d.ts → prerender/FileWritingResponse.d.ts} +0 -6
  224. package/dist/vite/prerender/FileWritingResponse.js +42 -0
  225. package/dist/vite/prerender/FileWritingResponse.js.map +1 -0
  226. package/dist/vite/prerender/prerender.d.ts +6 -0
  227. package/dist/vite/prerender/prerender.js +101 -0
  228. package/dist/vite/prerender/prerender.js.map +1 -0
  229. package/dist/vite/prerender/worker.d.ts +11 -0
  230. package/dist/vite/prerender/worker.js +21 -0
  231. package/dist/vite/prerender/worker.js.map +1 -0
  232. package/dist/vite/reporter.d.ts +3 -0
  233. package/dist/vite/reporter.js +33 -0
  234. package/dist/vite/reporter.js.map +1 -0
  235. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  236. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  237. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  238. package/dist/zuplo/env.d.ts +1 -0
  239. package/dist/zuplo/env.js +3 -0
  240. package/dist/zuplo/env.js.map +1 -1
  241. package/dist/zuplo/policy-types.d.ts +33 -0
  242. package/dist/zuplo/policy-types.js +8 -0
  243. package/dist/zuplo/policy-types.js.map +1 -0
  244. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  245. package/dist/zuplo/with-zuplo-processors.js +26 -0
  246. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  247. package/dist/zuplo/with-zuplo.d.ts +1 -1
  248. package/dist/zuplo/with-zuplo.js +7 -26
  249. package/dist/zuplo/with-zuplo.js.map +1 -1
  250. package/lib/{AuthenticationPlugin-D7G3me8L.js → AuthenticationPlugin-DjnQ5hs7.js} +4 -4
  251. package/lib/{AuthenticationPlugin-D7G3me8L.js.map → AuthenticationPlugin-DjnQ5hs7.js.map} +1 -1
  252. package/lib/{CategoryHeading-CBconmtI.js → CategoryHeading-MYL1u_6K.js} +3 -3
  253. package/lib/{CategoryHeading-CBconmtI.js.map → CategoryHeading-MYL1u_6K.js.map} +1 -1
  254. package/lib/{Markdown-CZDLNOFc.js → Markdown-8mv9nhGd.js} +3391 -3403
  255. package/lib/Markdown-8mv9nhGd.js.map +1 -0
  256. package/lib/{MdxPage-DKMbBROv.js → MdxPage-ZX2oquWw.js} +61 -56
  257. package/lib/MdxPage-ZX2oquWw.js.map +1 -0
  258. package/lib/OpenApiRoute-BP9kzG5k.js +36 -0
  259. package/lib/OpenApiRoute-BP9kzG5k.js.map +1 -0
  260. package/lib/OperationList-c72qPMtm.js +5180 -0
  261. package/lib/OperationList-c72qPMtm.js.map +1 -0
  262. package/lib/Select-NSz0gku6.js +223 -0
  263. package/lib/Select-NSz0gku6.js.map +1 -0
  264. package/lib/{SlotletProvider-pfc9oejW.js → SlotletProvider-D0mFmGJu.js} +53 -53
  265. package/lib/{SlotletProvider-pfc9oejW.js.map → SlotletProvider-D0mFmGJu.js.map} +1 -1
  266. package/lib/{Button-DeAoTouo.js → Spinner-BlzrEEk1.js} +16 -13
  267. package/lib/Spinner-BlzrEEk1.js.map +1 -0
  268. package/lib/{SyntaxHighlight-Bz-lOJtH.js → SyntaxHighlight-B0L4SC_N.js} +390 -383
  269. package/lib/SyntaxHighlight-B0L4SC_N.js.map +1 -0
  270. package/lib/{chunk-D52XG6IA-Dl7HLe6j.js → chunk-SYFQ2XB5-QijJrSf0.js} +409 -411
  271. package/lib/chunk-SYFQ2XB5-QijJrSf0.js.map +1 -0
  272. package/lib/circular-DxaIIlWD.js +15409 -0
  273. package/lib/circular-DxaIIlWD.js.map +1 -0
  274. package/lib/context-rwLGh-6_.js +22 -0
  275. package/lib/{context-h_UkBLvr.js.map → context-rwLGh-6_.js.map} +1 -1
  276. package/lib/{createServer-BznDkeSA.js → createServer-ZDNGmPfQ.js} +3611 -5736
  277. package/lib/createServer-ZDNGmPfQ.js.map +1 -0
  278. package/lib/hook-Dnj3SwPC.js +1455 -0
  279. package/lib/hook-Dnj3SwPC.js.map +1 -0
  280. package/lib/index-B7mqiOei.js +509 -0
  281. package/lib/index-B7mqiOei.js.map +1 -0
  282. package/lib/index-CZjcfK-H.js +2063 -0
  283. package/lib/index-CZjcfK-H.js.map +1 -0
  284. package/lib/{index-LNp6rxyU.js → index-CjJS0l4l.js} +2 -2
  285. package/lib/{index-LNp6rxyU.js.map → index-CjJS0l4l.js.map} +1 -1
  286. package/lib/index-Djenk2Hj.js +36 -0
  287. package/lib/{index-CPNSgwSb.js.map → index-Djenk2Hj.js.map} +1 -1
  288. package/lib/{index-CBXSgjaE.js → index-Dl3Yl0yb.js} +65 -69
  289. package/lib/index-Dl3Yl0yb.js.map +1 -0
  290. package/lib/{index.esm-BSV1C092.js → index.esm-9-TF9KQB.js} +52 -52
  291. package/lib/{index.esm-BSV1C092.js.map → index.esm-9-TF9KQB.js.map} +1 -1
  292. package/lib/index.esm-CrSoEshU.js +1207 -0
  293. package/lib/index.esm-CrSoEshU.js.map +1 -0
  294. package/lib/joinUrl-nLx9pD-Z.js +20 -0
  295. package/lib/joinUrl-nLx9pD-Z.js.map +1 -0
  296. package/lib/{jsx-runtime-Dx-03ztt.js → jsx-runtime-Bdg6XQ1m.js} +135 -135
  297. package/lib/{jsx-runtime-Dx-03ztt.js.map → jsx-runtime-Bdg6XQ1m.js.map} +1 -1
  298. package/lib/mutation-ByGtmi0-.js +208 -0
  299. package/lib/mutation-ByGtmi0-.js.map +1 -0
  300. package/lib/post-processors/removeExtensions.js +7 -7
  301. package/lib/post-processors/removeExtensions.js.map +1 -1
  302. package/lib/post-processors/removeParameters.js +48 -0
  303. package/lib/post-processors/removeParameters.js.map +1 -0
  304. package/lib/{prism-bash.min-DadFsM4Z.js → prism-bash.min-HHIMdNJ_.js} +4 -4
  305. package/lib/{prism-bash.min-DadFsM4Z.js.map → prism-bash.min-HHIMdNJ_.js.map} +1 -1
  306. package/lib/{prism-csharp.min-DUwvItt4.js → prism-csharp.min-bQAo2pmx.js} +33 -33
  307. package/lib/{prism-csharp.min-DUwvItt4.js.map → prism-csharp.min-bQAo2pmx.js.map} +1 -1
  308. package/lib/{prism-java.min-BtgBR4yd.js → prism-java.min-BpvsOuIa.js} +12 -12
  309. package/lib/{prism-java.min-BtgBR4yd.js.map → prism-java.min-BpvsOuIa.js.map} +1 -1
  310. package/lib/{prism-markdown.min-F3U-vPBi.js → prism-markdown.min-C0Qn0m-5.js} +30 -30
  311. package/lib/{prism-markdown.min-F3U-vPBi.js.map → prism-markdown.min-C0Qn0m-5.js.map} +1 -1
  312. package/lib/{prism-ruby.min-DeDXCp1r.js → prism-ruby.min-Dx9KO9ds.js} +16 -16
  313. package/lib/{prism-ruby.min-DeDXCp1r.js.map → prism-ruby.min-Dx9KO9ds.js.map} +1 -1
  314. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  315. package/lib/ui/Accordion.js +1 -1
  316. package/lib/ui/ActionButton.js +10 -11
  317. package/lib/ui/ActionButton.js.map +1 -1
  318. package/lib/ui/Alert.js +2 -2
  319. package/lib/ui/AlertDialog.js +1 -1
  320. package/lib/ui/Badge.js +3 -2
  321. package/lib/ui/Badge.js.map +1 -1
  322. package/lib/ui/Breadcrumb.js +1 -1
  323. package/lib/ui/Button.js +2 -2
  324. package/lib/ui/Callout.js +1 -1
  325. package/lib/ui/Card.js +1 -1
  326. package/lib/ui/Carousel.js +3 -3
  327. package/lib/ui/Carousel.js.map +1 -1
  328. package/lib/ui/Checkbox.js +2 -2
  329. package/lib/ui/Command.js +125 -13
  330. package/lib/ui/Command.js.map +1 -1
  331. package/lib/ui/Dialog.js +1 -1
  332. package/lib/ui/Drawer.js +520 -519
  333. package/lib/ui/Drawer.js.map +1 -1
  334. package/lib/ui/DropdownMenu.js +1 -1
  335. package/lib/ui/Form.js +2 -2
  336. package/lib/ui/HoverCard.js +1 -1
  337. package/lib/ui/Input.js +1 -1
  338. package/lib/ui/Input.js.map +1 -1
  339. package/lib/ui/Label.js +2 -2
  340. package/lib/ui/Pagination.js +7 -7
  341. package/lib/ui/Popover.js +1 -1
  342. package/lib/ui/Progress.js +1 -1
  343. package/lib/ui/RadioGroup.js +1 -1
  344. package/lib/ui/ScrollArea.js +1 -1
  345. package/lib/ui/Select.js +3 -3
  346. package/lib/ui/Select.js.map +1 -1
  347. package/lib/ui/Skeleton.js +1 -1
  348. package/lib/ui/Slider.js +1 -1
  349. package/lib/ui/Switch.js +1 -1
  350. package/lib/ui/Tabs.js +1 -1
  351. package/lib/ui/Textarea.js +1 -1
  352. package/lib/ui/Toggle.js +2 -2
  353. package/lib/ui/ToggleGroup.js +1 -1
  354. package/lib/ui/Tooltip.js +1 -1
  355. package/lib/{useExposedProps-DE9lR6MF.js → useExposedProps-Bbf99zic.js} +2 -2
  356. package/lib/{useExposedProps-DE9lR6MF.js.map → useExposedProps-Bbf99zic.js.map} +1 -1
  357. package/lib/useScrollToAnchor-DkVfWsxe.js +286 -0
  358. package/lib/useScrollToAnchor-DkVfWsxe.js.map +1 -0
  359. package/lib/zudoku.auth-auth0.js +8 -10
  360. package/lib/zudoku.auth-auth0.js.map +1 -1
  361. package/lib/zudoku.auth-clerk.js +18 -18
  362. package/lib/zudoku.auth-openid.js +224 -221
  363. package/lib/zudoku.auth-openid.js.map +1 -1
  364. package/lib/zudoku.components.js +828 -940
  365. package/lib/zudoku.components.js.map +1 -1
  366. package/lib/zudoku.plugin-api-catalog.js +18 -19
  367. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  368. package/lib/zudoku.plugin-api-keys.js +15 -16
  369. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  370. package/lib/zudoku.plugin-custom-pages.js +3 -3
  371. package/lib/zudoku.plugin-markdown.js +23 -44
  372. package/lib/zudoku.plugin-markdown.js.map +1 -1
  373. package/lib/zudoku.plugin-openapi.js +7 -6
  374. package/lib/zudoku.plugin-openapi.js.map +1 -1
  375. package/lib/zudoku.plugin-redirect.js +1 -1
  376. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  377. package/package.json +53 -49
  378. package/src/app/demo-cdn.html +31 -31
  379. package/src/app/entry.server.tsx +1 -1
  380. package/src/app/main.css +52 -51
  381. package/src/app/main.tsx +31 -8
  382. package/src/lib/authentication/providers/auth0.tsx +1 -4
  383. package/src/lib/authentication/providers/openid.tsx +12 -5
  384. package/src/lib/authentication/state.ts +18 -0
  385. package/src/lib/components/AnchorLink.tsx +5 -2
  386. package/src/lib/components/Autocomplete.tsx +113 -0
  387. package/src/lib/components/Header.tsx +4 -4
  388. package/src/lib/components/Markdown.tsx +14 -15
  389. package/src/lib/components/PathRenderer.tsx +61 -0
  390. package/src/lib/components/StatusPage.tsx +91 -0
  391. package/src/lib/components/SyntaxHighlight.tsx +14 -0
  392. package/src/lib/components/ThemeSwitch.tsx +2 -2
  393. package/src/lib/components/cache.ts +15 -0
  394. package/src/lib/components/context/ViewportAnchorContext.tsx +20 -6
  395. package/src/lib/components/context/ZudokuContext.ts +16 -3
  396. package/src/lib/components/index.ts +14 -3
  397. package/src/lib/components/navigation/Sidebar.tsx +7 -1
  398. package/src/lib/components/navigation/SidebarCategory.tsx +46 -43
  399. package/src/lib/components/navigation/SidebarItem.tsx +1 -0
  400. package/src/lib/core/RouteGuard.tsx +39 -0
  401. package/src/lib/core/ZudokuContext.ts +9 -8
  402. package/src/lib/oas/graphql/circular.ts +50 -0
  403. package/src/lib/oas/graphql/index.ts +95 -69
  404. package/src/lib/oas/parser/dereference/index.ts +1 -2
  405. package/src/lib/oas/parser/upgrade/index.ts +2 -1
  406. package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
  407. package/src/lib/plugins/markdown/resolver.ts +0 -33
  408. package/src/lib/plugins/openapi/ColorizedParam.tsx +3 -3
  409. package/src/lib/plugins/openapi/Endpoint.tsx +11 -9
  410. package/src/lib/plugins/openapi/{Route.tsx → OpenApiRoute.tsx} +3 -3
  411. package/src/lib/plugins/openapi/OperationList.tsx +47 -19
  412. package/src/lib/plugins/openapi/OperationListItem.tsx +7 -4
  413. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -6
  414. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +11 -1
  415. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -0
  416. package/src/lib/plugins/openapi/Sidecar.tsx +27 -34
  417. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  418. package/src/lib/plugins/openapi/SidecarExamples.tsx +24 -24
  419. package/src/lib/plugins/openapi/graphql/gql.ts +12 -4
  420. package/src/lib/plugins/openapi/graphql/graphql.ts +92 -45
  421. package/src/lib/plugins/openapi/index.tsx +163 -78
  422. package/src/lib/plugins/openapi/interfaces.ts +16 -12
  423. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +54 -0
  424. package/src/lib/plugins/openapi/playground/Headers.tsx +165 -36
  425. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +13 -0
  426. package/src/lib/plugins/openapi/playground/PathParams.tsx +35 -75
  427. package/src/lib/plugins/openapi/playground/Playground.tsx +251 -213
  428. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +6 -3
  429. package/src/lib/plugins/openapi/playground/QueryParams.tsx +84 -114
  430. package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
  431. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
  432. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +210 -0
  433. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +101 -0
  434. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
  435. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
  436. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
  437. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
  438. package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
  439. package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
  440. package/src/lib/plugins/openapi/schema/{SchemaComponents.tsx → SchemaPropertyItem.tsx} +11 -7
  441. package/src/lib/plugins/openapi/schema/SchemaView.tsx +4 -1
  442. package/src/lib/plugins/openapi/schema/utils.ts +4 -0
  443. package/src/lib/ui/Badge.tsx +1 -0
  444. package/src/lib/ui/Command.tsx +20 -0
  445. package/src/lib/ui/Input.tsx +1 -2
  446. package/src/lib/ui/Select.tsx +1 -1
  447. package/src/lib/util/MdxComponents.tsx +2 -1
  448. package/src/lib/util/joinUrl.test.ts +62 -0
  449. package/src/lib/util/joinUrl.ts +57 -0
  450. package/src/lib/util/scrollIntoViewIfNeeded.ts +18 -0
  451. package/src/lib/util/useLatest.ts +18 -0
  452. package/src/lib/util/useScrollToAnchor.ts +33 -34
  453. package/src/lib/util/useScrollToTop.ts +8 -3
  454. package/dist/lib/plugins/openapi/Route.js.map +0 -1
  455. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
  456. package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
  457. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
  458. package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
  459. package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
  460. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
  461. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +0 -1
  462. package/dist/vite/prerender.js +0 -89
  463. package/dist/vite/prerender.js.map +0 -1
  464. package/lib/AnchorLink-DFZZbmvr.js +0 -34
  465. package/lib/AnchorLink-DFZZbmvr.js.map +0 -1
  466. package/lib/Button-DeAoTouo.js.map +0 -1
  467. package/lib/Command-9x_kZHr4.js +0 -611
  468. package/lib/Command-9x_kZHr4.js.map +0 -1
  469. package/lib/Markdown-CZDLNOFc.js.map +0 -1
  470. package/lib/MdxPage-DKMbBROv.js.map +0 -1
  471. package/lib/OperationList-DFa3DqhW.js +0 -5143
  472. package/lib/OperationList-DFa3DqhW.js.map +0 -1
  473. package/lib/Route-DYwKZ_c_.js +0 -35
  474. package/lib/Route-DYwKZ_c_.js.map +0 -1
  475. package/lib/Select-B_IxRUUC.js +0 -223
  476. package/lib/Select-B_IxRUUC.js.map +0 -1
  477. package/lib/Spinner-DuxJLLNE.js +0 -7
  478. package/lib/Spinner-DuxJLLNE.js.map +0 -1
  479. package/lib/StaggeredRender-DgsamH_G.js +0 -17
  480. package/lib/StaggeredRender-DgsamH_G.js.map +0 -1
  481. package/lib/SyntaxHighlight-Bz-lOJtH.js.map +0 -1
  482. package/lib/ZudokuContext-hmLMUdf2.js +0 -1217
  483. package/lib/ZudokuContext-hmLMUdf2.js.map +0 -1
  484. package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
  485. package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
  486. package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +0 -1
  487. package/lib/context-h_UkBLvr.js +0 -22
  488. package/lib/createServer-BznDkeSA.js.map +0 -1
  489. package/lib/hook-CHq7pFyz.js +0 -227
  490. package/lib/hook-CHq7pFyz.js.map +0 -1
  491. package/lib/index-Bn6Lc9tq.js +0 -9
  492. package/lib/index-Bn6Lc9tq.js.map +0 -1
  493. package/lib/index-CBXSgjaE.js.map +0 -1
  494. package/lib/index-CPNSgwSb.js +0 -36
  495. package/lib/index-PqKef_jH.js +0 -1292
  496. package/lib/index-PqKef_jH.js.map +0 -1
  497. package/lib/index-TaRXY2w1.js +0 -43
  498. package/lib/index-TaRXY2w1.js.map +0 -1
  499. package/lib/index.esm-BnnBRKJX.js +0 -1214
  500. package/lib/index.esm-BnnBRKJX.js.map +0 -1
  501. package/lib/state-CFQsUZUP.js +0 -202
  502. package/lib/state-CFQsUZUP.js.map +0 -1
  503. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
  504. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
  505. /package/dist/lib/plugins/openapi/schema/{SchemaComponents.d.ts → SchemaPropertyItem.d.ts} +0 -0
@@ -1,1217 +0,0 @@
1
- var _e = (t) => {
2
- throw TypeError(t);
3
- };
4
- var be = (t, e, s) => e.has(t) || _e("Cannot " + s);
5
- var i = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (t, e, s) => e.has(t) ? _e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (be(t, e, "access private method"), s);
6
- import * as T from "react";
7
- import { createContext as ft, useContext as yt } from "react";
8
- import { j as pt } from "./jsx-runtime-Dx-03ztt.js";
9
- import { u as pe, m as vt } from "./chunk-D52XG6IA-Dl7HLe6j.js";
10
- var Qe = class {
11
- constructor() {
12
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
- }
14
- subscribe(t) {
15
- return this.listeners.add(t), this.onSubscribe(), () => {
16
- this.listeners.delete(t), this.onUnsubscribe();
17
- };
18
- }
19
- hasListeners() {
20
- return this.listeners.size > 0;
21
- }
22
- onSubscribe() {
23
- }
24
- onUnsubscribe() {
25
- }
26
- }, V = typeof window > "u" || "Deno" in globalThis;
27
- function ge() {
28
- }
29
- function Zt(t, e) {
30
- return typeof t == "function" ? t(e) : t;
31
- }
32
- function Re(t) {
33
- return typeof t == "number" && t >= 0 && t !== 1 / 0;
34
- }
35
- function et(t, e) {
36
- return Math.max(t + (e || 0) - Date.now(), 0);
37
- }
38
- function fe(t, e) {
39
- return typeof t == "function" ? t(e) : t;
40
- }
41
- function x(t, e) {
42
- return typeof t == "function" ? t(e) : t;
43
- }
44
- function Wt(t, e) {
45
- const {
46
- type: s = "all",
47
- exact: r,
48
- fetchStatus: n,
49
- predicate: u,
50
- queryKey: a,
51
- stale: o
52
- } = t;
53
- if (a) {
54
- if (r) {
55
- if (e.queryHash !== bt(a, e.options))
56
- return !1;
57
- } else if (!qe(e.queryKey, a))
58
- return !1;
59
- }
60
- if (s !== "all") {
61
- const l = e.isActive();
62
- if (s === "active" && !l || s === "inactive" && l)
63
- return !1;
64
- }
65
- return !(typeof o == "boolean" && e.isStale() !== o || n && n !== e.state.fetchStatus || u && !u(e));
66
- }
67
- function Jt(t, e) {
68
- const { exact: s, status: r, predicate: n, mutationKey: u } = t;
69
- if (u) {
70
- if (!e.options.mutationKey)
71
- return !1;
72
- if (s) {
73
- if (Se(e.options.mutationKey) !== Se(u))
74
- return !1;
75
- } else if (!qe(e.options.mutationKey, u))
76
- return !1;
77
- }
78
- return !(r && e.state.status !== r || n && !n(e));
79
- }
80
- function bt(t, e) {
81
- return ((e == null ? void 0 : e.queryKeyHashFn) || Se)(t);
82
- }
83
- function Se(t) {
84
- return JSON.stringify(
85
- t,
86
- (e, s) => Ee(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
87
- );
88
- }
89
- function qe(t, e) {
90
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !qe(t[s], e[s])) : !1;
91
- }
92
- function Ce(t, e) {
93
- if (t === e)
94
- return t;
95
- const s = He(t) && He(e);
96
- if (s || Ee(t) && Ee(e)) {
97
- const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), a = u.length, o = s ? [] : {};
98
- let l = 0;
99
- for (let R = 0; R < a; R++) {
100
- const v = s ? R : u[R];
101
- (!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (o[v] = void 0, l++) : (o[v] = Ce(t[v], e[v]), o[v] === t[v] && t[v] !== void 0 && l++);
102
- }
103
- return n === a && l === n ? t : o;
104
- }
105
- return e;
106
- }
107
- function we(t, e) {
108
- if (!e || Object.keys(t).length !== Object.keys(e).length)
109
- return !1;
110
- for (const s in t)
111
- if (t[s] !== e[s])
112
- return !1;
113
- return !0;
114
- }
115
- function He(t) {
116
- return Array.isArray(t) && t.length === Object.keys(t).length;
117
- }
118
- function Ee(t) {
119
- if (!Be(t))
120
- return !1;
121
- const e = t.constructor;
122
- if (e === void 0)
123
- return !0;
124
- const s = e.prototype;
125
- return !(!Be(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
- }
127
- function Be(t) {
128
- return Object.prototype.toString.call(t) === "[object Object]";
129
- }
130
- function mt(t) {
131
- return new Promise((e) => {
132
- setTimeout(e, t);
133
- });
134
- }
135
- function Oe(t, e, s) {
136
- if (typeof s.structuralSharing == "function")
137
- return s.structuralSharing(t, e);
138
- if (s.structuralSharing !== !1) {
139
- if (process.env.NODE_ENV !== "production")
140
- try {
141
- return Ce(t, e);
142
- } catch (r) {
143
- console.error(
144
- `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}`
145
- );
146
- }
147
- return Ce(t, e);
148
- }
149
- return e;
150
- }
151
- function Xt(t, e, s = 0) {
152
- const r = [...t, e];
153
- return s && r.length > s ? r.slice(1) : r;
154
- }
155
- function Yt(t, e, s = 0) {
156
- const r = [e, ...t];
157
- return s && r.length > s ? r.slice(0, -1) : r;
158
- }
159
- var ye = Symbol();
160
- function gt(t, e) {
161
- return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error(
162
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
163
- ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
164
- }
165
- var K, q, J, Ze, Rt = (Ze = class extends Qe {
166
- constructor() {
167
- super();
168
- y(this, K);
169
- y(this, q);
170
- y(this, J);
171
- c(this, J, (e) => {
172
- if (!V && window.addEventListener) {
173
- const s = () => e();
174
- return window.addEventListener("visibilitychange", s, !1), () => {
175
- window.removeEventListener("visibilitychange", s);
176
- };
177
- }
178
- });
179
- }
180
- onSubscribe() {
181
- i(this, q) || this.setEventListener(i(this, J));
182
- }
183
- onUnsubscribe() {
184
- var e;
185
- this.hasListeners() || ((e = i(this, q)) == null || e.call(this), c(this, q, void 0));
186
- }
187
- setEventListener(e) {
188
- var s;
189
- c(this, J, e), (s = i(this, q)) == null || s.call(this), c(this, q, e((r) => {
190
- typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
191
- }));
192
- }
193
- setFocused(e) {
194
- i(this, K) !== e && (c(this, K, e), this.onFocus());
195
- }
196
- onFocus() {
197
- const e = this.isFocused();
198
- this.listeners.forEach((s) => {
199
- s(e);
200
- });
201
- }
202
- isFocused() {
203
- var e;
204
- return typeof i(this, K) == "boolean" ? i(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
205
- }
206
- }, K = new WeakMap(), q = new WeakMap(), J = new WeakMap(), Ze), tt = new Rt(), X, A, Y, We, St = (We = class extends Qe {
207
- constructor() {
208
- super();
209
- y(this, X, !0);
210
- y(this, A);
211
- y(this, Y);
212
- c(this, Y, (e) => {
213
- if (!V && window.addEventListener) {
214
- const s = () => e(!0), r = () => e(!1);
215
- return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
216
- window.removeEventListener("online", s), window.removeEventListener("offline", r);
217
- };
218
- }
219
- });
220
- }
221
- onSubscribe() {
222
- i(this, A) || this.setEventListener(i(this, Y));
223
- }
224
- onUnsubscribe() {
225
- var e;
226
- this.hasListeners() || ((e = i(this, A)) == null || e.call(this), c(this, A, void 0));
227
- }
228
- setEventListener(e) {
229
- var s;
230
- c(this, Y, e), (s = i(this, A)) == null || s.call(this), c(this, A, e(this.setOnline.bind(this)));
231
- }
232
- setOnline(e) {
233
- i(this, X) !== e && (c(this, X, e), this.listeners.forEach((r) => {
234
- r(e);
235
- }));
236
- }
237
- isOnline() {
238
- return i(this, X);
239
- }
240
- }, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), We), st = new St();
241
- function Fe() {
242
- let t, e;
243
- const s = new Promise((n, u) => {
244
- t = n, e = u;
245
- });
246
- s.status = "pending", s.catch(() => {
247
- });
248
- function r(n) {
249
- Object.assign(s, n), delete s.resolve, delete s.reject;
250
- }
251
- return s.resolve = (n) => {
252
- r({
253
- status: "fulfilled",
254
- value: n
255
- }), t(n);
256
- }, s.reject = (n) => {
257
- r({
258
- status: "rejected",
259
- reason: n
260
- }), e(n);
261
- }, s;
262
- }
263
- function Ct(t) {
264
- return Math.min(1e3 * 2 ** t, 3e4);
265
- }
266
- function rt(t) {
267
- return (t ?? "online") === "online" ? st.isOnline() : !0;
268
- }
269
- var it = class extends Error {
270
- constructor(t) {
271
- super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
272
- }
273
- };
274
- function me(t) {
275
- return t instanceof it;
276
- }
277
- function wt(t) {
278
- let e = !1, s = 0, r = !1, n;
279
- const u = Fe(), a = (f) => {
280
- var g;
281
- r || (m(new it(f)), (g = t.abort) == null || g.call(t));
282
- }, o = () => {
283
- e = !0;
284
- }, l = () => {
285
- e = !1;
286
- }, R = () => tt.isFocused() && (t.networkMode === "always" || st.isOnline()) && t.canRun(), v = () => rt(t.networkMode) && t.canRun(), h = (f) => {
287
- var g;
288
- r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(), u.resolve(f));
289
- }, m = (f) => {
290
- var g;
291
- r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(), u.reject(f));
292
- }, S = () => new Promise((f) => {
293
- var g;
294
- n = (P) => {
295
- (r || R()) && f(P);
296
- }, (g = t.onPause) == null || g.call(t);
297
- }).then(() => {
298
- var f;
299
- n = void 0, r || (f = t.onContinue) == null || f.call(t);
300
- }), w = () => {
301
- if (r)
302
- return;
303
- let f;
304
- const g = s === 0 ? t.initialPromise : void 0;
305
- try {
306
- f = g ?? t.fn();
307
- } catch (P) {
308
- f = Promise.reject(P);
309
- }
310
- Promise.resolve(f).then(h).catch((P) => {
311
- var ve;
312
- if (r)
313
- return;
314
- const U = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? Ct, ce = typeof N == "function" ? N(s, P) : N, le = U === !0 || typeof U == "number" && s < U || typeof U == "function" && U(s, P);
315
- if (e || !le) {
316
- m(P);
317
- return;
318
- }
319
- s++, (ve = t.onFail) == null || ve.call(t, s, P), mt(ce).then(() => R() ? void 0 : S()).then(() => {
320
- e ? m(P) : w();
321
- });
322
- });
323
- };
324
- return {
325
- promise: u,
326
- cancel: a,
327
- continue: () => (n == null || n(), u),
328
- cancelRetry: o,
329
- continueRetry: l,
330
- canStart: v,
331
- start: () => (v() ? w() : S().then(w), u)
332
- };
333
- }
334
- function Et() {
335
- let t = [], e = 0, s = (o) => {
336
- o();
337
- }, r = (o) => {
338
- o();
339
- }, n = (o) => setTimeout(o, 0);
340
- const u = (o) => {
341
- e ? t.push(o) : n(() => {
342
- s(o);
343
- });
344
- }, a = () => {
345
- const o = t;
346
- t = [], o.length && n(() => {
347
- r(() => {
348
- o.forEach((l) => {
349
- s(l);
350
- });
351
- });
352
- });
353
- };
354
- return {
355
- batch: (o) => {
356
- let l;
357
- e++;
358
- try {
359
- l = o();
360
- } finally {
361
- e--, e || a();
362
- }
363
- return l;
364
- },
365
- /**
366
- * All calls to the wrapped function will be batched.
367
- */
368
- batchCalls: (o) => (...l) => {
369
- u(() => {
370
- o(...l);
371
- });
372
- },
373
- schedule: u,
374
- /**
375
- * Use this method to set a custom notify function.
376
- * This can be used to for example wrap notifications with `React.act` while running tests.
377
- */
378
- setNotifyFunction: (o) => {
379
- s = o;
380
- },
381
- /**
382
- * Use this method to set a custom function to batch notifications together into a single tick.
383
- * By default React Query will use the batch function provided by ReactDOM or React Native.
384
- */
385
- setBatchNotifyFunction: (o) => {
386
- r = o;
387
- },
388
- setScheduler: (o) => {
389
- n = o;
390
- }
391
- };
392
- }
393
- var Ae = Et(), _, Je, Ot = (Je = class {
394
- constructor() {
395
- y(this, _);
396
- }
397
- destroy() {
398
- this.clearGcTimeout();
399
- }
400
- scheduleGc() {
401
- this.clearGcTimeout(), Re(this.gcTime) && c(this, _, setTimeout(() => {
402
- this.optionalRemove();
403
- }, this.gcTime));
404
- }
405
- updateGcTime(t) {
406
- this.gcTime = Math.max(
407
- this.gcTime || 0,
408
- t ?? (V ? 1 / 0 : 5 * 60 * 1e3)
409
- );
410
- }
411
- clearGcTimeout() {
412
- i(this, _) && (clearTimeout(i(this, _)), c(this, _, void 0));
413
- }
414
- }, _ = new WeakMap(), Je), ee, te, I, C, oe, H, D, Q, Xe, es = (Xe = class extends Ot {
415
- constructor(e) {
416
- super();
417
- y(this, D);
418
- y(this, ee);
419
- y(this, te);
420
- y(this, I);
421
- y(this, C);
422
- y(this, oe);
423
- y(this, H);
424
- c(this, H, !1), c(this, oe, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, I, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, ee, Ft(this.options)), this.state = e.state ?? i(this, ee), this.scheduleGc();
425
- }
426
- get meta() {
427
- return this.options.meta;
428
- }
429
- get promise() {
430
- var e;
431
- return (e = i(this, C)) == null ? void 0 : e.promise;
432
- }
433
- setOptions(e) {
434
- this.options = { ...i(this, oe), ...e }, this.updateGcTime(this.options.gcTime);
435
- }
436
- optionalRemove() {
437
- !this.observers.length && this.state.fetchStatus === "idle" && i(this, I).remove(this);
438
- }
439
- setData(e, s) {
440
- const r = Oe(this.state.data, e, this.options);
441
- return b(this, D, Q).call(this, {
442
- data: r,
443
- type: "success",
444
- dataUpdatedAt: s == null ? void 0 : s.updatedAt,
445
- manual: s == null ? void 0 : s.manual
446
- }), r;
447
- }
448
- setState(e, s) {
449
- b(this, D, Q).call(this, { type: "setState", state: e, setStateOptions: s });
450
- }
451
- cancel(e) {
452
- var r, n;
453
- const s = (r = i(this, C)) == null ? void 0 : r.promise;
454
- return (n = i(this, C)) == null || n.cancel(e), s ? s.then(ge).catch(ge) : Promise.resolve();
455
- }
456
- destroy() {
457
- super.destroy(), this.cancel({ silent: !0 });
458
- }
459
- reset() {
460
- this.destroy(), this.setState(i(this, ee));
461
- }
462
- isActive() {
463
- return this.observers.some(
464
- (e) => x(e.options.enabled, this) !== !1
465
- );
466
- }
467
- isDisabled() {
468
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ye || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
469
- }
470
- isStale() {
471
- return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
472
- (e) => e.getCurrentResult().isStale
473
- ) : this.state.data === void 0;
474
- }
475
- isStaleByTime(e = 0) {
476
- return this.state.isInvalidated || this.state.data === void 0 || !et(this.state.dataUpdatedAt, e);
477
- }
478
- onFocus() {
479
- var s;
480
- const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
481
- e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
482
- }
483
- onOnline() {
484
- var s;
485
- const e = this.observers.find((r) => r.shouldFetchOnReconnect());
486
- e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
487
- }
488
- addObserver(e) {
489
- this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, I).notify({ type: "observerAdded", query: this, observer: e }));
490
- }
491
- removeObserver(e) {
492
- this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, C) && (i(this, H) ? i(this, C).cancel({ revert: !0 }) : i(this, C).cancelRetry()), this.scheduleGc()), i(this, I).notify({ type: "observerRemoved", query: this, observer: e }));
493
- }
494
- getObserversCount() {
495
- return this.observers.length;
496
- }
497
- invalidate() {
498
- this.state.isInvalidated || b(this, D, Q).call(this, { type: "invalidate" });
499
- }
500
- fetch(e, s) {
501
- var l, R, v;
502
- if (this.state.fetchStatus !== "idle") {
503
- if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
504
- this.cancel({ silent: !0 });
505
- else if (i(this, C))
506
- return i(this, C).continueRetry(), i(this, C).promise;
507
- }
508
- if (e && this.setOptions(e), !this.options.queryFn) {
509
- const h = this.observers.find((m) => m.options.queryFn);
510
- h && this.setOptions(h.options);
511
- }
512
- process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
513
- "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']"
514
- ));
515
- const r = new AbortController(), n = (h) => {
516
- Object.defineProperty(h, "signal", {
517
- enumerable: !0,
518
- get: () => (c(this, H, !0), r.signal)
519
- });
520
- }, u = () => {
521
- const h = gt(this.options, s), m = {
522
- queryKey: this.queryKey,
523
- meta: this.meta
524
- };
525
- return n(m), c(this, H, !1), this.options.persister ? this.options.persister(
526
- h,
527
- m,
528
- this
529
- ) : h(m);
530
- }, a = {
531
- fetchOptions: s,
532
- options: this.options,
533
- queryKey: this.queryKey,
534
- state: this.state,
535
- fetchFn: u
536
- };
537
- n(a), (l = this.options.behavior) == null || l.onFetch(
538
- a,
539
- this
540
- ), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((R = a.fetchOptions) == null ? void 0 : R.meta)) && b(this, D, Q).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
541
- const o = (h) => {
542
- var m, S, w, f;
543
- me(h) && h.silent || b(this, D, Q).call(this, {
544
- type: "error",
545
- error: h
546
- }), me(h) || ((S = (m = i(this, I).config).onError) == null || S.call(
547
- m,
548
- h,
549
- this
550
- ), (f = (w = i(this, I).config).onSettled) == null || f.call(
551
- w,
552
- this.state.data,
553
- h,
554
- this
555
- )), this.scheduleGc();
556
- };
557
- return c(this, C, wt({
558
- initialPromise: s == null ? void 0 : s.initialPromise,
559
- fn: a.fetchFn,
560
- abort: r.abort.bind(r),
561
- onSuccess: (h) => {
562
- var m, S, w, f;
563
- if (h === void 0) {
564
- process.env.NODE_ENV !== "production" && console.error(
565
- `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
566
- ), o(new Error(`${this.queryHash} data is undefined`));
567
- return;
568
- }
569
- try {
570
- this.setData(h);
571
- } catch (g) {
572
- o(g);
573
- return;
574
- }
575
- (S = (m = i(this, I).config).onSuccess) == null || S.call(m, h, this), (f = (w = i(this, I).config).onSettled) == null || f.call(
576
- w,
577
- h,
578
- this.state.error,
579
- this
580
- ), this.scheduleGc();
581
- },
582
- onError: o,
583
- onFail: (h, m) => {
584
- b(this, D, Q).call(this, { type: "failed", failureCount: h, error: m });
585
- },
586
- onPause: () => {
587
- b(this, D, Q).call(this, { type: "pause" });
588
- },
589
- onContinue: () => {
590
- b(this, D, Q).call(this, { type: "continue" });
591
- },
592
- retry: a.options.retry,
593
- retryDelay: a.options.retryDelay,
594
- networkMode: a.options.networkMode,
595
- canRun: () => !0
596
- })), i(this, C).start();
597
- }
598
- }, ee = new WeakMap(), te = new WeakMap(), I = new WeakMap(), C = new WeakMap(), oe = new WeakMap(), H = new WeakMap(), D = new WeakSet(), Q = function(e) {
599
- const s = (r) => {
600
- switch (e.type) {
601
- case "failed":
602
- return {
603
- ...r,
604
- fetchFailureCount: e.failureCount,
605
- fetchFailureReason: e.error
606
- };
607
- case "pause":
608
- return {
609
- ...r,
610
- fetchStatus: "paused"
611
- };
612
- case "continue":
613
- return {
614
- ...r,
615
- fetchStatus: "fetching"
616
- };
617
- case "fetch":
618
- return {
619
- ...r,
620
- ...nt(r.data, this.options),
621
- fetchMeta: e.meta ?? null
622
- };
623
- case "success":
624
- return {
625
- ...r,
626
- data: e.data,
627
- dataUpdateCount: r.dataUpdateCount + 1,
628
- dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
629
- error: null,
630
- isInvalidated: !1,
631
- status: "success",
632
- ...!e.manual && {
633
- fetchStatus: "idle",
634
- fetchFailureCount: 0,
635
- fetchFailureReason: null
636
- }
637
- };
638
- case "error":
639
- const n = e.error;
640
- return me(n) && n.revert && i(this, te) ? { ...i(this, te), fetchStatus: "idle" } : {
641
- ...r,
642
- error: n,
643
- errorUpdateCount: r.errorUpdateCount + 1,
644
- errorUpdatedAt: Date.now(),
645
- fetchFailureCount: r.fetchFailureCount + 1,
646
- fetchFailureReason: n,
647
- fetchStatus: "idle",
648
- status: "error"
649
- };
650
- case "invalidate":
651
- return {
652
- ...r,
653
- isInvalidated: !0
654
- };
655
- case "setState":
656
- return {
657
- ...r,
658
- ...e.state
659
- };
660
- }
661
- };
662
- this.state = s(this.state), Ae.batch(() => {
663
- this.observers.forEach((r) => {
664
- r.onQueryUpdate();
665
- }), i(this, I).notify({ query: this, type: "updated", action: e });
666
- });
667
- }, Xe);
668
- function nt(t, e) {
669
- return {
670
- fetchFailureCount: 0,
671
- fetchFailureReason: null,
672
- fetchStatus: rt(e.networkMode) ? "fetching" : "paused",
673
- ...t === void 0 && {
674
- error: null,
675
- status: "pending"
676
- }
677
- };
678
- }
679
- function Ft(t) {
680
- const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
681
- return {
682
- data: e,
683
- dataUpdateCount: 0,
684
- dataUpdatedAt: s ? r ?? Date.now() : 0,
685
- error: null,
686
- errorUpdateCount: 0,
687
- errorUpdatedAt: 0,
688
- fetchFailureCount: 0,
689
- fetchFailureReason: null,
690
- fetchMeta: null,
691
- isInvalidated: !1,
692
- status: s ? "success" : "pending",
693
- fetchStatus: "idle"
694
- };
695
- }
696
- var F, d, ue, O, B, se, L, k, he, re, ie, G, z, M, ne, p, ae, Pe, Ie, Te, De, xe, je, ke, ot, Ye, at = (Ye = class extends Qe {
697
- constructor(e, s) {
698
- super();
699
- y(this, p);
700
- y(this, F);
701
- y(this, d);
702
- y(this, ue);
703
- y(this, O);
704
- y(this, B);
705
- y(this, se);
706
- y(this, L);
707
- y(this, k);
708
- y(this, he);
709
- y(this, re);
710
- // This property keeps track of the last query with defined data.
711
- // It will be used to pass the previous data and query to the placeholder function between renders.
712
- y(this, ie);
713
- y(this, G);
714
- y(this, z);
715
- y(this, M);
716
- y(this, ne, /* @__PURE__ */ new Set());
717
- this.options = s, c(this, F, e), c(this, k, null), c(this, L, Fe()), this.options.experimental_prefetchInRender || i(this, L).reject(
718
- new Error("experimental_prefetchInRender feature flag is not enabled")
719
- ), this.bindMethods(), this.setOptions(s);
720
- }
721
- bindMethods() {
722
- this.refetch = this.refetch.bind(this);
723
- }
724
- onSubscribe() {
725
- this.listeners.size === 1 && (i(this, d).addObserver(this), Ge(i(this, d), this.options) ? b(this, p, ae).call(this) : this.updateResult(), b(this, p, De).call(this));
726
- }
727
- onUnsubscribe() {
728
- this.hasListeners() || this.destroy();
729
- }
730
- shouldFetchOnReconnect() {
731
- return Ue(
732
- i(this, d),
733
- this.options,
734
- this.options.refetchOnReconnect
735
- );
736
- }
737
- shouldFetchOnWindowFocus() {
738
- return Ue(
739
- i(this, d),
740
- this.options,
741
- this.options.refetchOnWindowFocus
742
- );
743
- }
744
- destroy() {
745
- this.listeners = /* @__PURE__ */ new Set(), b(this, p, xe).call(this), b(this, p, je).call(this), i(this, d).removeObserver(this);
746
- }
747
- setOptions(e, s) {
748
- const r = this.options, n = i(this, d);
749
- if (this.options = i(this, F).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof x(this.options.enabled, i(this, d)) != "boolean")
750
- throw new Error(
751
- "Expected enabled to be a boolean or a callback that returns a boolean"
752
- );
753
- b(this, p, ke).call(this), i(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && i(this, F).getQueryCache().notify({
754
- type: "observerOptionsUpdated",
755
- query: i(this, d),
756
- observer: this
757
- });
758
- const u = this.hasListeners();
759
- u && ze(
760
- i(this, d),
761
- n,
762
- this.options,
763
- r
764
- ) && b(this, p, ae).call(this), this.updateResult(s), u && (i(this, d) !== n || x(this.options.enabled, i(this, d)) !== x(r.enabled, i(this, d)) || fe(this.options.staleTime, i(this, d)) !== fe(r.staleTime, i(this, d))) && b(this, p, Pe).call(this);
765
- const a = b(this, p, Ie).call(this);
766
- u && (i(this, d) !== n || x(this.options.enabled, i(this, d)) !== x(r.enabled, i(this, d)) || a !== i(this, M)) && b(this, p, Te).call(this, a);
767
- }
768
- getOptimisticResult(e) {
769
- const s = i(this, F).getQueryCache().build(i(this, F), e), r = this.createResult(s, e);
770
- return It(this, r) && (c(this, O, r), c(this, se, this.options), c(this, B, i(this, d).state)), r;
771
- }
772
- getCurrentResult() {
773
- return i(this, O);
774
- }
775
- trackResult(e, s) {
776
- const r = {};
777
- return Object.keys(e).forEach((n) => {
778
- Object.defineProperty(r, n, {
779
- configurable: !1,
780
- enumerable: !0,
781
- get: () => (this.trackProp(n), s == null || s(n), e[n])
782
- });
783
- }), r;
784
- }
785
- trackProp(e) {
786
- i(this, ne).add(e);
787
- }
788
- getCurrentQuery() {
789
- return i(this, d);
790
- }
791
- refetch({ ...e } = {}) {
792
- return this.fetch({
793
- ...e
794
- });
795
- }
796
- fetchOptimistic(e) {
797
- const s = i(this, F).defaultQueryOptions(e), r = i(this, F).getQueryCache().build(i(this, F), s);
798
- return r.fetch().then(() => this.createResult(r, s));
799
- }
800
- fetch(e) {
801
- return b(this, p, ae).call(this, {
802
- ...e,
803
- cancelRefetch: e.cancelRefetch ?? !0
804
- }).then(() => (this.updateResult(), i(this, O)));
805
- }
806
- createResult(e, s) {
807
- var Ke;
808
- const r = i(this, d), n = this.options, u = i(this, O), a = i(this, B), o = i(this, se), R = e !== r ? e.state : i(this, ue), { state: v } = e;
809
- let h = { ...v }, m = !1, S;
810
- if (s._optimisticResults) {
811
- const E = this.hasListeners(), Z = !E && Ge(e, s), W = E && ze(e, r, s, n);
812
- (Z || W) && (h = {
813
- ...h,
814
- ...nt(v.data, e.options)
815
- }), s._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
816
- }
817
- let { error: w, errorUpdatedAt: f, status: g } = h;
818
- if (s.select && h.data !== void 0)
819
- if (u && h.data === (a == null ? void 0 : a.data) && s.select === i(this, he))
820
- S = i(this, re);
821
- else
822
- try {
823
- c(this, he, s.select), S = s.select(h.data), S = Oe(u == null ? void 0 : u.data, S, s), c(this, re, S), c(this, k, null);
824
- } catch (E) {
825
- c(this, k, E);
826
- }
827
- else
828
- S = h.data;
829
- if (s.placeholderData !== void 0 && S === void 0 && g === "pending") {
830
- let E;
831
- if (u != null && u.isPlaceholderData && s.placeholderData === (o == null ? void 0 : o.placeholderData))
832
- E = u.data;
833
- else if (E = typeof s.placeholderData == "function" ? s.placeholderData(
834
- (Ke = i(this, ie)) == null ? void 0 : Ke.state.data,
835
- i(this, ie)
836
- ) : s.placeholderData, s.select && E !== void 0)
837
- try {
838
- E = s.select(E), c(this, k, null);
839
- } catch (Z) {
840
- c(this, k, Z);
841
- }
842
- E !== void 0 && (g = "success", S = Oe(
843
- u == null ? void 0 : u.data,
844
- E,
845
- s
846
- ), m = !0);
847
- }
848
- i(this, k) && (w = i(this, k), S = i(this, re), f = Date.now(), g = "error");
849
- const P = h.fetchStatus === "fetching", U = g === "pending", N = g === "error", ce = U && P, le = S !== void 0, j = {
850
- status: g,
851
- fetchStatus: h.fetchStatus,
852
- isPending: U,
853
- isSuccess: g === "success",
854
- isError: N,
855
- isInitialLoading: ce,
856
- isLoading: ce,
857
- data: S,
858
- dataUpdatedAt: h.dataUpdatedAt,
859
- error: w,
860
- errorUpdatedAt: f,
861
- failureCount: h.fetchFailureCount,
862
- failureReason: h.fetchFailureReason,
863
- errorUpdateCount: h.errorUpdateCount,
864
- isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
865
- isFetchedAfterMount: h.dataUpdateCount > R.dataUpdateCount || h.errorUpdateCount > R.errorUpdateCount,
866
- isFetching: P,
867
- isRefetching: P && !U,
868
- isLoadingError: N && !le,
869
- isPaused: h.fetchStatus === "paused",
870
- isPlaceholderData: m,
871
- isRefetchError: N && le,
872
- isStale: Le(e, s),
873
- refetch: this.refetch,
874
- promise: i(this, L)
875
- };
876
- if (this.options.experimental_prefetchInRender) {
877
- const E = (de) => {
878
- j.status === "error" ? de.reject(j.error) : j.data !== void 0 && de.resolve(j.data);
879
- }, Z = () => {
880
- const de = c(this, L, j.promise = Fe());
881
- E(de);
882
- }, W = i(this, L);
883
- switch (W.status) {
884
- case "pending":
885
- e.queryHash === r.queryHash && E(W);
886
- break;
887
- case "fulfilled":
888
- (j.status === "error" || j.data !== W.value) && Z();
889
- break;
890
- case "rejected":
891
- (j.status !== "error" || j.error !== W.reason) && Z();
892
- break;
893
- }
894
- }
895
- return j;
896
- }
897
- updateResult(e) {
898
- const s = i(this, O), r = this.createResult(i(this, d), this.options);
899
- if (c(this, B, i(this, d).state), c(this, se, this.options), i(this, B).data !== void 0 && c(this, ie, i(this, d)), we(r, s))
900
- return;
901
- c(this, O, r);
902
- const n = {}, u = () => {
903
- if (!s)
904
- return !0;
905
- const { notifyOnChangeProps: a } = this.options, o = typeof a == "function" ? a() : a;
906
- if (o === "all" || !o && !i(this, ne).size)
907
- return !0;
908
- const l = new Set(
909
- o ?? i(this, ne)
910
- );
911
- return this.options.throwOnError && l.add("error"), Object.keys(i(this, O)).some((R) => {
912
- const v = R;
913
- return i(this, O)[v] !== s[v] && l.has(v);
914
- });
915
- };
916
- (e == null ? void 0 : e.listeners) !== !1 && u() && (n.listeners = !0), b(this, p, ot).call(this, { ...n, ...e });
917
- }
918
- onQueryUpdate() {
919
- this.updateResult(), this.hasListeners() && b(this, p, De).call(this);
920
- }
921
- }, F = new WeakMap(), d = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), B = new WeakMap(), se = new WeakMap(), L = new WeakMap(), k = new WeakMap(), he = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), G = new WeakMap(), z = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), p = new WeakSet(), ae = function(e) {
922
- b(this, p, ke).call(this);
923
- let s = i(this, d).fetch(
924
- this.options,
925
- e
926
- );
927
- return e != null && e.throwOnError || (s = s.catch(ge)), s;
928
- }, Pe = function() {
929
- b(this, p, xe).call(this);
930
- const e = fe(
931
- this.options.staleTime,
932
- i(this, d)
933
- );
934
- if (V || i(this, O).isStale || !Re(e))
935
- return;
936
- const r = et(i(this, O).dataUpdatedAt, e) + 1;
937
- c(this, G, setTimeout(() => {
938
- i(this, O).isStale || this.updateResult();
939
- }, r));
940
- }, Ie = function() {
941
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
942
- }, Te = function(e) {
943
- b(this, p, je).call(this), c(this, M, e), !(V || x(this.options.enabled, i(this, d)) === !1 || !Re(i(this, M)) || i(this, M) === 0) && c(this, z, setInterval(() => {
944
- (this.options.refetchIntervalInBackground || tt.isFocused()) && b(this, p, ae).call(this);
945
- }, i(this, M)));
946
- }, De = function() {
947
- b(this, p, Pe).call(this), b(this, p, Te).call(this, b(this, p, Ie).call(this));
948
- }, xe = function() {
949
- i(this, G) && (clearTimeout(i(this, G)), c(this, G, void 0));
950
- }, je = function() {
951
- i(this, z) && (clearInterval(i(this, z)), c(this, z, void 0));
952
- }, ke = function() {
953
- const e = i(this, F).getQueryCache().build(i(this, F), this.options);
954
- if (e === i(this, d))
955
- return;
956
- const s = i(this, d);
957
- c(this, d, e), c(this, ue, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
958
- }, ot = function(e) {
959
- Ae.batch(() => {
960
- e.listeners && this.listeners.forEach((s) => {
961
- s(i(this, O));
962
- }), i(this, F).getQueryCache().notify({
963
- query: i(this, d),
964
- type: "observerResultsUpdated"
965
- });
966
- });
967
- }, Ye);
968
- function Pt(t, e) {
969
- return x(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
970
- }
971
- function Ge(t, e) {
972
- return Pt(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
973
- }
974
- function Ue(t, e, s) {
975
- if (x(e.enabled, t) !== !1) {
976
- const r = typeof s == "function" ? s(t) : s;
977
- return r === "always" || r !== !1 && Le(t, e);
978
- }
979
- return !1;
980
- }
981
- function ze(t, e, s, r) {
982
- return (t !== e || x(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Le(t, s);
983
- }
984
- function Le(t, e) {
985
- return x(e.enabled, t) !== !1 && t.isStaleByTime(fe(e.staleTime, t));
986
- }
987
- function It(t, e) {
988
- return !we(t.getCurrentResult(), e);
989
- }
990
- var ut = T.createContext(
991
- void 0
992
- ), Tt = (t) => {
993
- const e = T.useContext(ut);
994
- if (t)
995
- return t;
996
- if (!e)
997
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
998
- return e;
999
- }, ts = ({
1000
- client: t,
1001
- children: e
1002
- }) => (T.useEffect(() => (t.mount(), () => {
1003
- t.unmount();
1004
- }), [t]), /* @__PURE__ */ pt.jsx(ut.Provider, { value: t, children: e })), ht = T.createContext(!1), Dt = () => T.useContext(ht);
1005
- ht.Provider;
1006
- function xt() {
1007
- let t = !1;
1008
- return {
1009
- clearReset: () => {
1010
- t = !1;
1011
- },
1012
- reset: () => {
1013
- t = !0;
1014
- },
1015
- isReset: () => t
1016
- };
1017
- }
1018
- var jt = T.createContext(xt()), kt = () => T.useContext(jt);
1019
- function Ut(t, e) {
1020
- return typeof t == "function" ? t(...e) : !!t;
1021
- }
1022
- function Ve() {
1023
- }
1024
- var Qt = (t, e) => {
1025
- (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1026
- }, qt = (t) => {
1027
- T.useEffect(() => {
1028
- t.clearReset();
1029
- }, [t]);
1030
- }, At = ({
1031
- result: t,
1032
- errorResetBoundary: e,
1033
- throwOnError: s,
1034
- query: r
1035
- }) => t.isError && !e.isReset() && !t.isFetching && r && Ut(s, [t.error, r]), Lt = (t, e) => e.state.data === void 0, Mt = (t) => {
1036
- t.suspense && (t.staleTime === void 0 && (t.staleTime = 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
1037
- }, Nt = (t, e) => t.isLoading && t.isFetching && !e, Kt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, $e = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1038
- s.clearReset();
1039
- });
1040
- function ct(t, e, s) {
1041
- var v, h, m, S, w;
1042
- if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1043
- throw new Error(
1044
- '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'
1045
- );
1046
- const r = Tt(s), n = Dt(), u = kt(), a = r.defaultQueryOptions(t);
1047
- (h = (v = r.getDefaultOptions().queries) == null ? void 0 : v._experimental_beforeQuery) == null || h.call(
1048
- v,
1049
- a
1050
- ), a._optimisticResults = n ? "isRestoring" : "optimistic", Mt(a), Qt(a, u), qt(u);
1051
- const o = !r.getQueryCache().get(a.queryHash), [l] = T.useState(
1052
- () => new e(
1053
- r,
1054
- a
1055
- )
1056
- ), R = l.getOptimisticResult(a);
1057
- if (T.useSyncExternalStore(
1058
- T.useCallback(
1059
- (f) => {
1060
- const g = n ? Ve : l.subscribe(Ae.batchCalls(f));
1061
- return l.updateResult(), g;
1062
- },
1063
- [l, n]
1064
- ),
1065
- () => l.getCurrentResult(),
1066
- () => l.getCurrentResult()
1067
- ), T.useEffect(() => {
1068
- l.setOptions(a, { listeners: !1 });
1069
- }, [a, l]), Kt(a, R))
1070
- throw $e(a, l, u);
1071
- if (At({
1072
- result: R,
1073
- errorResetBoundary: u,
1074
- throwOnError: a.throwOnError,
1075
- query: r.getQueryCache().get(a.queryHash)
1076
- }))
1077
- throw R.error;
1078
- if ((S = (m = r.getDefaultOptions().queries) == null ? void 0 : m._experimental_afterQuery) == null || S.call(
1079
- m,
1080
- a,
1081
- R
1082
- ), a.experimental_prefetchInRender && !V && Nt(R, n)) {
1083
- const f = o ? (
1084
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1085
- $e(a, l, u)
1086
- ) : (
1087
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1088
- (w = r.getQueryCache().get(a.queryHash)) == null ? void 0 : w.promise
1089
- );
1090
- f == null || f.catch(Ve).finally(() => {
1091
- l.updateResult();
1092
- });
1093
- }
1094
- return a.notifyOnChangeProps ? R : l.trackResult(R);
1095
- }
1096
- function _t(t, e) {
1097
- return ct(t, at, e);
1098
- }
1099
- function Ht(t, e) {
1100
- return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error("skipToken is not allowed for useSuspenseQuery"), ct(
1101
- {
1102
- ...t,
1103
- enabled: !0,
1104
- suspense: !0,
1105
- throwOnError: Lt,
1106
- placeholderData: void 0
1107
- },
1108
- at,
1109
- e
1110
- );
1111
- }
1112
- const $ = (...t) => {
1113
- const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
1114
- return e ? `/${e}` : "/";
1115
- }, Me = (t, e) => {
1116
- for (const s of t) {
1117
- const r = Ne(s, e);
1118
- if (r !== void 0) return r;
1119
- }
1120
- }, Ne = (t, e, s = []) => {
1121
- const r = e(t, s);
1122
- if (r !== void 0) return r;
1123
- if (t.type === "category")
1124
- for (const n of t.items) {
1125
- const u = Ne(n, e, [
1126
- ...s,
1127
- t
1128
- ]);
1129
- if (u !== void 0) return u;
1130
- }
1131
- }, ss = () => {
1132
- const t = pe(), s = dt().sidebar;
1133
- return Me(s, (r) => {
1134
- if (r.type === "doc" && $(r.id) === t.pathname)
1135
- return r;
1136
- });
1137
- }, rs = (t) => {
1138
- const e = pe();
1139
- return Ne(t, (s) => {
1140
- if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
1141
- return !0;
1142
- });
1143
- }, is = () => {
1144
- const t = pe().pathname, s = dt().sidebar;
1145
- let r, n, u = !1;
1146
- return Me(s, (a) => {
1147
- const o = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
1148
- if (o) {
1149
- if (u)
1150
- return n = { label: a.label, id: o }, !0;
1151
- t === o ? u = !0 : r = { label: a.label, id: o };
1152
- }
1153
- }), { prev: r, next: n };
1154
- }, Bt = ft(
1155
- void 0
1156
- ), lt = () => {
1157
- const t = yt(Bt);
1158
- if (!t)
1159
- throw new Error("useZudoku must be used within a ZudokuProvider.");
1160
- return t;
1161
- }, ns = () => {
1162
- const { getApiIdentities: t } = lt();
1163
- return _t({
1164
- queryFn: t,
1165
- queryKey: ["api-identities"]
1166
- });
1167
- }, dt = () => {
1168
- const { getPluginSidebar: t, sidebars: e, topNavigation: s } = lt(), r = pe(), n = Object.entries(e).find(([, o]) => Me(o, (l) => {
1169
- if ((l.type === "doc" ? $(l.id) : l.type === "category" && l.link ? $(l.link.id) : void 0) === r.pathname)
1170
- return l;
1171
- })), u = s.find((o) => o.id === (n == null ? void 0 : n[0])) ?? s.find((o) => vt(o.id, r.pathname)), { data: a } = Ht({
1172
- queryFn: () => t(r.pathname),
1173
- queryKey: ["plugin-sidebar", r.pathname]
1174
- });
1175
- return {
1176
- sidebar: [...n ? n[1] : [], ...a],
1177
- topNavItem: u
1178
- };
1179
- };
1180
- export {
1181
- ye as A,
1182
- ts as B,
1183
- rs as C,
1184
- dt as D,
1185
- Me as E,
1186
- es as Q,
1187
- Ot as R,
1188
- Qe as S,
1189
- Bt as Z,
1190
- lt as a,
1191
- ss as b,
1192
- wt as c,
1193
- is as d,
1194
- Tt as e,
1195
- Ve as f,
1196
- Ut as g,
1197
- Se as h,
1198
- ns as i,
1199
- $ as j,
1200
- _t as k,
1201
- bt as l,
1202
- Wt as m,
1203
- Ae as n,
1204
- Jt as o,
1205
- ge as p,
1206
- gt as q,
1207
- Yt as r,
1208
- we as s,
1209
- Xt as t,
1210
- Ht as u,
1211
- tt as v,
1212
- st as w,
1213
- fe as x,
1214
- Zt as y,
1215
- qe as z
1216
- };
1217
- //# sourceMappingURL=ZudokuContext-hmLMUdf2.js.map