zudoku 0.61.5 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/cli.d.ts +9 -0
  3. package/dist/cli/cli.js +4 -10
  4. package/dist/cli/cli.js.map +1 -1
  5. package/dist/cli/common/version-check.d.ts +2 -0
  6. package/dist/cli/common/version-check.js +58 -0
  7. package/dist/cli/common/version-check.js.map +1 -0
  8. package/dist/config/config.d.ts +3 -0
  9. package/dist/config/validators/InputNavigationSchema.d.ts +64 -4
  10. package/dist/config/validators/icon-types.d.ts +1 -1
  11. package/dist/config/validators/icon-types.js +15 -0
  12. package/dist/config/validators/icon-types.js.map +1 -1
  13. package/dist/config/validators/validate.d.ts +39 -9
  14. package/dist/config/validators/validate.js +23 -0
  15. package/dist/config/validators/validate.js.map +1 -1
  16. package/dist/flat-config.d.ts +22 -2
  17. package/dist/lib/assets/language-icons/c.d.ts +3 -0
  18. package/dist/lib/assets/language-icons/c.js +4 -0
  19. package/dist/lib/assets/language-icons/c.js.map +1 -0
  20. package/dist/lib/assets/language-icons/commonlisp.d.ts +3 -0
  21. package/dist/lib/assets/language-icons/commonlisp.js +4 -0
  22. package/dist/lib/assets/language-icons/commonlisp.js.map +1 -0
  23. package/dist/lib/assets/language-icons/cpp.d.ts +3 -0
  24. package/dist/lib/assets/language-icons/cpp.js +4 -0
  25. package/dist/lib/assets/language-icons/cpp.js.map +1 -0
  26. package/dist/lib/assets/language-icons/dart.d.ts +3 -0
  27. package/dist/lib/assets/language-icons/dart.js +4 -0
  28. package/dist/lib/assets/language-icons/dart.js.map +1 -0
  29. package/dist/lib/assets/language-icons/elixir.d.ts +3 -0
  30. package/dist/lib/assets/language-icons/elixir.js +4 -0
  31. package/dist/lib/assets/language-icons/elixir.js.map +1 -0
  32. package/dist/lib/assets/language-icons/ocaml.d.ts +3 -0
  33. package/dist/lib/assets/language-icons/ocaml.js +4 -0
  34. package/dist/lib/assets/language-icons/ocaml.js.map +1 -0
  35. package/dist/lib/assets/language-icons/powershell.d.ts +3 -0
  36. package/dist/lib/assets/language-icons/powershell.js +4 -0
  37. package/dist/lib/assets/language-icons/powershell.js.map +1 -0
  38. package/dist/lib/assets/language-icons/scala.d.ts +3 -0
  39. package/dist/lib/assets/language-icons/scala.js +4 -0
  40. package/dist/lib/assets/language-icons/scala.js.map +1 -0
  41. package/dist/lib/assets/language-icons/zig.d.ts +3 -0
  42. package/dist/lib/assets/language-icons/zig.js +4 -0
  43. package/dist/lib/assets/language-icons/zig.js.map +1 -0
  44. package/dist/lib/authentication/providers/auth0.js +7 -3
  45. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  46. package/dist/lib/components/BuildCheck.js +2 -2
  47. package/dist/lib/components/BuildCheck.js.map +1 -1
  48. package/dist/lib/components/Heading.js +1 -5
  49. package/dist/lib/components/Heading.js.map +1 -1
  50. package/dist/lib/components/LanguageIcon.js +45 -0
  51. package/dist/lib/components/LanguageIcon.js.map +1 -1
  52. package/dist/lib/components/Main.js +1 -1
  53. package/dist/lib/components/Main.js.map +1 -1
  54. package/dist/lib/components/cache.d.ts +3 -1
  55. package/dist/lib/components/cache.js +3 -5
  56. package/dist/lib/components/cache.js.map +1 -1
  57. package/dist/lib/components/context/ZudokuContext.js +10 -2
  58. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  59. package/dist/lib/components/index.d.ts +1 -2
  60. package/dist/lib/hooks/index.d.ts +1 -1
  61. package/dist/lib/oas/graphql/index.js +17 -0
  62. package/dist/lib/oas/graphql/index.js.map +1 -1
  63. package/dist/lib/plugins/markdown/MdxPage.js +26 -3
  64. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  65. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.d.ts +2 -0
  66. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js +3 -0
  67. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js.map +1 -0
  68. package/dist/lib/plugins/markdown/assets/ClaudeLogo.d.ts +2 -0
  69. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js +3 -0
  70. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js.map +1 -0
  71. package/dist/lib/plugins/markdown/index.d.ts +2 -1
  72. package/dist/lib/plugins/markdown/index.js.map +1 -1
  73. package/dist/lib/plugins/openapi/MCPEndpoint.js +9 -18
  74. package/dist/lib/plugins/openapi/MCPEndpoint.js.map +1 -1
  75. package/dist/lib/plugins/openapi/OperationList.js +8 -3
  76. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  77. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -2
  78. package/dist/lib/plugins/openapi/OperationListItem.js +6 -3
  79. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  80. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -1
  81. package/dist/lib/plugins/openapi/Sidecar.js +6 -9
  82. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  83. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  84. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  85. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  86. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  87. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +8 -2
  88. package/dist/lib/plugins/openapi/graphql/graphql.js +8 -0
  89. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  90. package/dist/lib/plugins/openapi/index.js +1 -1
  91. package/dist/lib/plugins/openapi/index.js.map +1 -1
  92. package/dist/lib/plugins/openapi/interfaces.d.ts +1 -0
  93. package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
  94. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  95. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  96. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  97. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +15 -3
  98. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  99. package/dist/lib/shiki.js +9 -0
  100. package/dist/lib/shiki.js.map +1 -1
  101. package/dist/lib/ui/Carousel.js.map +1 -1
  102. package/dist/lib/ui/Dialog.d.ts +12 -18
  103. package/dist/lib/ui/Dialog.js +30 -17
  104. package/dist/lib/ui/Dialog.js.map +1 -1
  105. package/dist/lib/ui/Secret.d.ts +6 -0
  106. package/dist/lib/ui/Secret.js +7 -4
  107. package/dist/lib/ui/Secret.js.map +1 -1
  108. package/dist/lib/util/pastellize.js +4 -4
  109. package/dist/lib/util/pastellize.js.map +1 -1
  110. package/dist/vite/api/SchemaManager.js.map +1 -1
  111. package/dist/vite/llms.d.ts +12 -0
  112. package/dist/vite/llms.js +66 -0
  113. package/dist/vite/llms.js.map +1 -0
  114. package/dist/vite/plugin-api.js +1 -1
  115. package/dist/vite/plugin-api.js.map +1 -1
  116. package/dist/vite/plugin-docs.d.ts +9 -0
  117. package/dist/vite/plugin-docs.js +67 -48
  118. package/dist/vite/plugin-docs.js.map +1 -1
  119. package/dist/vite/plugin-markdown-export.d.ts +21 -0
  120. package/dist/vite/plugin-markdown-export.js +139 -0
  121. package/dist/vite/plugin-markdown-export.js.map +1 -0
  122. package/dist/vite/plugin-mdx.d.ts +1 -1
  123. package/dist/vite/plugin-mdx.js +5 -1
  124. package/dist/vite/plugin-mdx.js.map +1 -1
  125. package/dist/vite/plugin-navigation.js +4 -0
  126. package/dist/vite/plugin-navigation.js.map +1 -1
  127. package/dist/vite/plugin.js +2 -0
  128. package/dist/vite/plugin.js.map +1 -1
  129. package/dist/vite/prerender/prerender.js +30 -0
  130. package/dist/vite/prerender/prerender.js.map +1 -1
  131. package/lib/{Button-DTDRi4CT.js → Button-DmS4u8Lj.js} +2 -2
  132. package/lib/{Button-DTDRi4CT.js.map → Button-DmS4u8Lj.js.map} +1 -1
  133. package/lib/{Card-hTy9PAnh.js → Card-KFniaZn5.js} +2 -2
  134. package/lib/{Card-hTy9PAnh.js.map → Card-KFniaZn5.js.map} +1 -1
  135. package/lib/{CategoryHeading-BGCNu3VK.js → CategoryHeading-DhmodDcq.js} +2 -2
  136. package/lib/{CategoryHeading-BGCNu3VK.js.map → CategoryHeading-DhmodDcq.js.map} +1 -1
  137. package/lib/CodeBlock-CanTUJLl.js +221 -0
  138. package/lib/CodeBlock-CanTUJLl.js.map +1 -0
  139. package/lib/{Command-TEBTONf1.js → Command-CUcrW3qs.js} +3 -3
  140. package/lib/{Command-TEBTONf1.js.map → Command-CUcrW3qs.js.map} +1 -1
  141. package/lib/Dialog-BQciPiHN.js +144 -0
  142. package/lib/Dialog-BQciPiHN.js.map +1 -0
  143. package/lib/{Drawer-DM9wJUC6.js → Drawer-Ci7XwhqT.js} +2 -2
  144. package/lib/Drawer-Ci7XwhqT.js.map +1 -0
  145. package/lib/DropdownMenu-BZ2NKQ3K.js +126 -0
  146. package/lib/DropdownMenu-BZ2NKQ3K.js.map +1 -0
  147. package/lib/{ErrorAlert-xpVkFS_n.js → ErrorAlert-VBJ8aHH7.js} +100 -103
  148. package/lib/ErrorAlert-VBJ8aHH7.js.map +1 -0
  149. package/lib/MdxPage-DFRNwSsc.js +239 -0
  150. package/lib/MdxPage-DFRNwSsc.js.map +1 -0
  151. package/lib/{OAuthErrorPage-DCjFngGS.js → OAuthErrorPage-DJUOdr6Q.js} +7 -7
  152. package/lib/{OAuthErrorPage-DCjFngGS.js.map → OAuthErrorPage-DJUOdr6Q.js.map} +1 -1
  153. package/lib/{OasProvider-DH82Y-KM.js → OasProvider-D2NYAaBN.js} +3 -3
  154. package/lib/{OasProvider-DH82Y-KM.js.map → OasProvider-D2NYAaBN.js.map} +1 -1
  155. package/lib/{OperationList-Dr87uHqG.js → OperationList-DmXCI4NU.js} +1848 -1853
  156. package/lib/OperationList-DmXCI4NU.js.map +1 -0
  157. package/lib/{Pagination-Cdi_qiXc.js → Pagination-CT4VUR6u.js} +3 -3
  158. package/lib/{Pagination-Cdi_qiXc.js.map → Pagination-CT4VUR6u.js.map} +1 -1
  159. package/lib/{RouteGuard-dji1UEYe.js → RouteGuard-Bg0Lu0OU.js} +5 -5
  160. package/lib/{RouteGuard-dji1UEYe.js.map → RouteGuard-Bg0Lu0OU.js.map} +1 -1
  161. package/lib/{RouterError-D1I15Qyy.js → RouterError-fm21cqlj.js} +4 -4
  162. package/lib/{RouterError-D1I15Qyy.js.map → RouterError-fm21cqlj.js.map} +1 -1
  163. package/lib/{SchemaList-07lprC0m.js → SchemaList-uElsscMN.js} +10 -10
  164. package/lib/{SchemaList-07lprC0m.js.map → SchemaList-uElsscMN.js.map} +1 -1
  165. package/lib/{SchemaView-m0NDK2i0.js → SchemaView-CNQ3VAbI.js} +5 -5
  166. package/lib/{SchemaView-m0NDK2i0.js.map → SchemaView-CNQ3VAbI.js.map} +1 -1
  167. package/lib/Select-CPoGZU_V.js +372 -0
  168. package/lib/Select-CPoGZU_V.js.map +1 -0
  169. package/lib/{SignUp-C-YP_Rxi.js → SignUp-BraHuRN_.js} +9 -9
  170. package/lib/{SignUp-C-YP_Rxi.js.map → SignUp-BraHuRN_.js.map} +1 -1
  171. package/lib/{Spinner-Cf6E803I.js → Spinner-CI6bRyZw.js} +2 -2
  172. package/lib/{Spinner-Cf6E803I.js.map → Spinner-CI6bRyZw.js.map} +1 -1
  173. package/lib/{SyntaxHighlight-CPF64UHi.js → SyntaxHighlight-B0laqAqK.js} +6 -6
  174. package/lib/{SyntaxHighlight-CPF64UHi.js.map → SyntaxHighlight-B0laqAqK.js.map} +1 -1
  175. package/lib/{Toc-Cf5UojVb.js → Toc-KzXCRqrX.js} +3 -3
  176. package/lib/{Toc-Cf5UojVb.js.map → Toc-KzXCRqrX.js.map} +1 -1
  177. package/lib/ZudokuContext-BXTZApgy.js +1506 -0
  178. package/lib/ZudokuContext-BXTZApgy.js.map +1 -0
  179. package/lib/c-B-NUhs61.js +46 -0
  180. package/lib/c-B-NUhs61.js.map +1 -0
  181. package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +1 -1
  182. package/lib/{circular-ga83n0Za.js → circular-BWT7_Ahq.js} +30 -30
  183. package/lib/{circular-ga83n0Za.js.map → circular-BWT7_Ahq.js.map} +1 -1
  184. package/lib/commonlisp-De080z23.js +28 -0
  185. package/lib/commonlisp-De080z23.js.map +1 -0
  186. package/lib/cpp-79Paht7T.js +53 -0
  187. package/lib/cpp-79Paht7T.js.map +1 -0
  188. package/lib/{createServer-DL1AYSpR.js → createServer-zhJZSgor.js} +3225 -3165
  189. package/lib/createServer-zhJZSgor.js.map +1 -0
  190. package/lib/{csharp-rrJEDRrV.js → csharp-D8MIL50B.js} +2 -2
  191. package/lib/{csharp-rrJEDRrV.js.map → csharp-D8MIL50B.js.map} +1 -1
  192. package/lib/{css-Dpk9bCql.js → css-Bt6hr1td.js} +2 -2
  193. package/lib/{css-Dpk9bCql.js.map → css-Bt6hr1td.js.map} +1 -1
  194. package/lib/dart-B0vy1jWB.js +60 -0
  195. package/lib/dart-B0vy1jWB.js.map +1 -0
  196. package/lib/elixir-Ds8r0sF8.js +25 -0
  197. package/lib/elixir-Ds8r0sF8.js.map +1 -0
  198. package/lib/{errors-ouIp07AW.js → errors-XqO6MsfU.js} +3 -3
  199. package/lib/{errors-ouIp07AW.js.map → errors-XqO6MsfU.js.map} +1 -1
  200. package/lib/{go-D8SJIQ0Z.js → go-D2VsmIOS.js} +2 -2
  201. package/lib/{go-D8SJIQ0Z.js.map → go-D2VsmIOS.js.map} +1 -1
  202. package/lib/{graphql-aeVKJNa2.js → graphql-BtA6M4m5.js} +2 -2
  203. package/lib/{graphql-aeVKJNa2.js.map → graphql-BtA6M4m5.js.map} +1 -1
  204. package/lib/hook-CAebs2rv.js +31 -0
  205. package/lib/hook-CAebs2rv.js.map +1 -0
  206. package/lib/{html-D_7om-nA.js → html-MGnI2uzP.js} +2 -2
  207. package/lib/{html-D_7om-nA.js.map → html-MGnI2uzP.js.map} +1 -1
  208. package/lib/{index-CVfG8Pb4.js → index-BPSpOxTK.js} +26 -26
  209. package/lib/index-BPSpOxTK.js.map +1 -0
  210. package/lib/{index-DhL3LhWV.js → index-C5L4favO.js} +166 -50
  211. package/lib/index-C5L4favO.js.map +1 -0
  212. package/lib/index-CrcNWbel.js.map +1 -1
  213. package/lib/{index-DQ8kWcE8.js → index-D8Btv4uT.js} +723 -811
  214. package/lib/index-D8Btv4uT.js.map +1 -0
  215. package/lib/index.esm-BYObtETB.js +1294 -0
  216. package/lib/index.esm-BYObtETB.js.map +1 -0
  217. package/lib/index.esm-BnYHxCYC.js.map +1 -1
  218. package/lib/{java-DUh-EL8n.js → java-CVLzHfb1.js} +2 -2
  219. package/lib/{java-DUh-EL8n.js.map → java-CVLzHfb1.js.map} +1 -1
  220. package/lib/{javascript-CrY8dcGu.js → javascript-CcmIpL4G.js} +2 -2
  221. package/lib/{javascript-CrY8dcGu.js.map → javascript-CcmIpL4G.js.map} +1 -1
  222. package/lib/{json-DLK2_sdf.js → json-4AyP4uiY.js} +2 -2
  223. package/lib/{json-DLK2_sdf.js.map → json-4AyP4uiY.js.map} +1 -1
  224. package/lib/{jsx-runtime-DywqP_6a.js → jsx-runtime-BzflLqGi.js} +109 -111
  225. package/lib/jsx-runtime-BzflLqGi.js.map +1 -0
  226. package/lib/{kotlin-rJMOGl7D.js → kotlin-v2plddBQ.js} +2 -2
  227. package/lib/{kotlin-rJMOGl7D.js.map → kotlin-v2plddBQ.js.map} +1 -1
  228. package/lib/{markdown-BD9bIU5J.js → markdown-DYGWCmGQ.js} +2 -2
  229. package/lib/{markdown-BD9bIU5J.js.map → markdown-DYGWCmGQ.js.map} +1 -1
  230. package/lib/{mdx-G25UCvf3.js → mdx-CHwYvXd4.js} +2 -2
  231. package/lib/{mdx-G25UCvf3.js.map → mdx-CHwYvXd4.js.map} +1 -1
  232. package/lib/{mutation-De-1gXxl.js → mutation-CdGPxHNX.js} +2 -2
  233. package/lib/{mutation-De-1gXxl.js.map → mutation-CdGPxHNX.js.map} +1 -1
  234. package/lib/{objectivec-DDpj0aWX.js → objectivec-HZY8shkd.js} +2 -2
  235. package/lib/{objectivec-DDpj0aWX.js.map → objectivec-HZY8shkd.js.map} +1 -1
  236. package/lib/ocaml-DqsdDdwb.js +52 -0
  237. package/lib/ocaml-DqsdDdwb.js.map +1 -0
  238. package/lib/{php-BeG18bSy.js → php-rQXzo7K_.js} +2 -2
  239. package/lib/{php-BeG18bSy.js.map → php-rQXzo7K_.js.map} +1 -1
  240. package/lib/powershell-CQje9pm1.js +39 -0
  241. package/lib/powershell-CQje9pm1.js.map +1 -0
  242. package/lib/{python-BaF2byD-.js → python-QIQAE5Ei.js} +2 -2
  243. package/lib/{python-BaF2byD-.js.map → python-QIQAE5Ei.js.map} +1 -1
  244. package/lib/{react-CQvDN20M.js → react-DHpVpxRv.js} +2 -2
  245. package/lib/{react-CQvDN20M.js.map → react-DHpVpxRv.js.map} +1 -1
  246. package/lib/{ruby-CmxRVHMR.js → ruby-B2dU8Ny5.js} +2 -2
  247. package/lib/{ruby-CmxRVHMR.js.map → ruby-B2dU8Ny5.js.map} +1 -1
  248. package/lib/{rust-IfSC62c5.js → rust-DYnLHAi2.js} +2 -2
  249. package/lib/{rust-IfSC62c5.js.map → rust-DYnLHAi2.js.map} +1 -1
  250. package/lib/scala-CeKInBR8.js +25 -0
  251. package/lib/scala-CeKInBR8.js.map +1 -0
  252. package/lib/{shell-BFu0M6m4.js → shell-HUv9oVtp.js} +2 -2
  253. package/lib/{shell-BFu0M6m4.js.map → shell-HUv9oVtp.js.map} +1 -1
  254. package/lib/{swift-DckbsN4v.js → swift-B4z6ig1Z.js} +2 -2
  255. package/lib/{swift-DckbsN4v.js.map → swift-B4z6ig1Z.js.map} +1 -1
  256. package/lib/{toml-BJsCc8TC.js → toml-Co9mpdct.js} +2 -2
  257. package/lib/{toml-BJsCc8TC.js.map → toml-Co9mpdct.js.map} +1 -1
  258. package/lib/{typescript-7qOVMjOC.js → typescript-C26xdBDC.js} +2 -2
  259. package/lib/{typescript-7qOVMjOC.js.map → typescript-C26xdBDC.js.map} +1 -1
  260. package/lib/ui/Accordion.js +1 -1
  261. package/lib/ui/ActionButton.js +3 -3
  262. package/lib/ui/Alert.js +1 -1
  263. package/lib/ui/AlertDialog.js +1 -1
  264. package/lib/ui/Badge.js +1 -1
  265. package/lib/ui/Breadcrumb.js +1 -1
  266. package/lib/ui/Button.js +1 -1
  267. package/lib/ui/Callout.js +1 -1
  268. package/lib/ui/Card.js +1 -1
  269. package/lib/ui/Carousel.js +1 -1
  270. package/lib/ui/Carousel.js.map +1 -1
  271. package/lib/ui/Checkbox.js +1 -1
  272. package/lib/ui/CodeBlock.js +2 -2
  273. package/lib/ui/Command.js +2 -2
  274. package/lib/ui/Dialog.js +135 -105
  275. package/lib/ui/Dialog.js.map +1 -1
  276. package/lib/ui/Drawer.js +2 -2
  277. package/lib/ui/DropdownMenu.js +1 -1
  278. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  279. package/lib/ui/Form.js +2 -2
  280. package/lib/ui/HoverCard.js +1 -1
  281. package/lib/ui/Input.js +1 -1
  282. package/lib/ui/Label.js +1 -1
  283. package/lib/ui/Pagination.js +1 -1
  284. package/lib/ui/Popover.js +1 -1
  285. package/lib/ui/Progress.js +1 -1
  286. package/lib/ui/RadioGroup.js +1 -1
  287. package/lib/ui/ReactComponentDoc.js +1 -1
  288. package/lib/ui/ScrollArea.js +1 -1
  289. package/lib/ui/Secret.js +64 -54
  290. package/lib/ui/Secret.js.map +1 -1
  291. package/lib/ui/Select.js +1 -1
  292. package/lib/ui/Skeleton.js +1 -1
  293. package/lib/ui/Slider.js +1 -1
  294. package/lib/ui/Stepper.js +1 -1
  295. package/lib/ui/Switch.js +1 -1
  296. package/lib/ui/SyntaxHighlight.js +4 -4
  297. package/lib/ui/Tabs.js +1 -1
  298. package/lib/ui/Textarea.js +1 -1
  299. package/lib/ui/Toggle.js +1 -1
  300. package/lib/ui/ToggleGroup.js +1 -1
  301. package/lib/ui/Tooltip.js +1 -1
  302. package/lib/ui/Value.js +1 -1
  303. package/lib/{useExposedProps-B8NHdNRq.js → useExposedProps-Cd7Yg_uG.js} +3 -3
  304. package/lib/useExposedProps-Cd7Yg_uG.js.map +1 -0
  305. package/lib/{xml-DAaTIkBX.js → xml-BQOOC04j.js} +2 -2
  306. package/lib/{xml-DAaTIkBX.js.map → xml-BQOOC04j.js.map} +1 -1
  307. package/lib/{yaml-DUi-dbfu.js → yaml-BGsJItKv.js} +2 -2
  308. package/lib/{yaml-DUi-dbfu.js.map → yaml-BGsJItKv.js.map} +1 -1
  309. package/lib/zig-CUV2sTct.js +35 -0
  310. package/lib/zig-CUV2sTct.js.map +1 -0
  311. package/lib/zudoku.__internal.js +1041 -938
  312. package/lib/zudoku.__internal.js.map +1 -1
  313. package/lib/zudoku.auth-auth0.js +22 -21
  314. package/lib/zudoku.auth-auth0.js.map +1 -1
  315. package/lib/zudoku.auth-azureb2c.js +14 -15
  316. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  317. package/lib/zudoku.auth-clerk.js +3 -3
  318. package/lib/zudoku.auth-openid.js +57 -58
  319. package/lib/zudoku.auth-openid.js.map +1 -1
  320. package/lib/zudoku.auth-supabase.js +2 -2
  321. package/lib/zudoku.components.js +6 -6
  322. package/lib/zudoku.hooks.js +6 -6
  323. package/lib/zudoku.hooks.js.map +1 -1
  324. package/lib/zudoku.icons.js +1 -1
  325. package/lib/zudoku.plugin-api-catalog.js +27 -28
  326. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  327. package/lib/zudoku.plugin-api-keys.js +215 -301
  328. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  329. package/lib/zudoku.plugin-custom-pages.js +1 -1
  330. package/lib/zudoku.plugin-markdown.js +2 -2
  331. package/lib/zudoku.plugin-markdown.js.map +1 -1
  332. package/lib/zudoku.plugin-openapi.js +4 -4
  333. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  334. package/lib/zudoku.plugin-search-pagefind.js +27 -28
  335. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  336. package/lib/zudoku.router.js +1 -1
  337. package/lib/zudoku.router.js.map +1 -1
  338. package/package.json +39 -39
  339. package/src/lib/assets/language-icons/c.tsx +31 -0
  340. package/src/lib/assets/language-icons/commonlisp.tsx +22 -0
  341. package/src/lib/assets/language-icons/cpp.tsx +35 -0
  342. package/src/lib/assets/language-icons/dart.tsx +39 -0
  343. package/src/lib/assets/language-icons/elixir.tsx +19 -0
  344. package/src/lib/assets/language-icons/ocaml.tsx +34 -0
  345. package/src/lib/assets/language-icons/powershell.tsx +27 -0
  346. package/src/lib/assets/language-icons/scala.tsx +19 -0
  347. package/src/lib/assets/language-icons/zig.tsx +32 -0
  348. package/src/lib/authentication/providers/auth0.tsx +7 -3
  349. package/src/lib/components/BuildCheck.tsx +12 -10
  350. package/src/lib/components/Heading.tsx +2 -6
  351. package/src/lib/components/LanguageIcon.tsx +45 -0
  352. package/src/lib/components/Main.tsx +1 -1
  353. package/src/lib/components/cache.ts +9 -5
  354. package/src/lib/components/context/ZudokuContext.ts +11 -2
  355. package/src/lib/oas/graphql/index.ts +19 -0
  356. package/src/lib/plugins/markdown/MdxPage.tsx +122 -8
  357. package/src/lib/plugins/markdown/assets/ChatGPTLogo.tsx +11 -0
  358. package/src/lib/plugins/markdown/assets/ClaudeLogo.tsx +19 -0
  359. package/src/lib/plugins/markdown/index.tsx +3 -7
  360. package/src/lib/plugins/openapi/MCPEndpoint.tsx +8 -28
  361. package/src/lib/plugins/openapi/OperationList.tsx +14 -3
  362. package/src/lib/plugins/openapi/OperationListItem.tsx +10 -5
  363. package/src/lib/plugins/openapi/Sidecar.tsx +8 -8
  364. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +1 -0
  365. package/src/lib/plugins/openapi/graphql/gql.ts +4 -3
  366. package/src/lib/plugins/openapi/graphql/graphql.ts +20 -3
  367. package/src/lib/plugins/openapi/index.tsx +1 -1
  368. package/src/lib/plugins/openapi/interfaces.ts +1 -0
  369. package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
  370. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  371. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +31 -3
  372. package/src/lib/shiki.ts +9 -0
  373. package/src/lib/ui/Carousel.tsx +0 -1
  374. package/src/lib/ui/Dialog.tsx +112 -106
  375. package/src/lib/ui/Secret.tsx +44 -27
  376. package/src/lib/util/pastellize.ts +4 -4
  377. package/src/shiki/langs/hurl.js +1 -0
  378. package/src/shiki/langs/kdl.js +1 -0
  379. package/src/shiki/langs/pkl.js +1 -0
  380. package/src/shiki/langs/rosmsg.js +1 -0
  381. package/lib/CodeBlock-i0BM_QFf.js +0 -176
  382. package/lib/CodeBlock-i0BM_QFf.js.map +0 -1
  383. package/lib/Dialog-VIMic7xI.js +0 -114
  384. package/lib/Dialog-VIMic7xI.js.map +0 -1
  385. package/lib/Drawer-DM9wJUC6.js.map +0 -1
  386. package/lib/ErrorAlert-xpVkFS_n.js.map +0 -1
  387. package/lib/MdxPage-Ud1w_GV-.js +0 -111
  388. package/lib/MdxPage-Ud1w_GV-.js.map +0 -1
  389. package/lib/OperationList-Dr87uHqG.js.map +0 -1
  390. package/lib/Select-BiBMWiLv.js +0 -273
  391. package/lib/Select-BiBMWiLv.js.map +0 -1
  392. package/lib/ZudokuContext-BcqSiygJ.js +0 -1294
  393. package/lib/ZudokuContext-BcqSiygJ.js.map +0 -1
  394. package/lib/createServer-DL1AYSpR.js.map +0 -1
  395. package/lib/hook-BkLXq8pm.js +0 -243
  396. package/lib/hook-BkLXq8pm.js.map +0 -1
  397. package/lib/index-CVfG8Pb4.js.map +0 -1
  398. package/lib/index-DQ8kWcE8.js.map +0 -1
  399. package/lib/index-DhL3LhWV.js.map +0 -1
  400. package/lib/index.esm-DpgNxKa2.js +0 -1267
  401. package/lib/index.esm-DpgNxKa2.js.map +0 -1
  402. package/lib/jsx-runtime-DywqP_6a.js.map +0 -1
  403. package/lib/useExposedProps-B8NHdNRq.js.map +0 -1
@@ -1,1294 +0,0 @@
1
- import * as v from "react";
2
- import { createContext as vt, useContext as mt } from "react";
3
- import { j as bt } from "./jsx-runtime-DywqP_6a.js";
4
- import { c as A, m as J } from "./chunk-PVWAREVJ-BO6B-RAk.js";
5
- import { c as gt } from "./index-DI5SPFK9.js";
6
- var z = class {
7
- constructor() {
8
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
9
- }
10
- subscribe(t) {
11
- return this.listeners.add(t), this.onSubscribe(), () => {
12
- this.listeners.delete(t), this.onUnsubscribe();
13
- };
14
- }
15
- hasListeners() {
16
- return this.listeners.size > 0;
17
- }
18
- onSubscribe() {
19
- }
20
- onUnsubscribe() {
21
- }
22
- }, w = typeof window > "u" || "Deno" in globalThis;
23
- function C() {
24
- }
25
- function ie(t, e) {
26
- return typeof t == "function" ? t(e) : t;
27
- }
28
- function Q(t) {
29
- return typeof t == "number" && t >= 0 && t !== 1 / 0;
30
- }
31
- function st(t, e) {
32
- return Math.max(t + (e || 0) - Date.now(), 0);
33
- }
34
- function I(t, e) {
35
- return typeof t == "function" ? t(e) : t;
36
- }
37
- function y(t, e) {
38
- return typeof t == "function" ? t(e) : t;
39
- }
40
- function ne(t, e) {
41
- const {
42
- type: s = "all",
43
- exact: r,
44
- fetchStatus: i,
45
- predicate: o,
46
- queryKey: a,
47
- stale: n
48
- } = t;
49
- if (a) {
50
- if (r) {
51
- if (e.queryHash !== Rt(a, e.options))
52
- return !1;
53
- } else if (!B(e.queryKey, a))
54
- return !1;
55
- }
56
- if (s !== "all") {
57
- const u = e.isActive();
58
- if (s === "active" && !u || s === "inactive" && u)
59
- return !1;
60
- }
61
- return !(typeof n == "boolean" && e.isStale() !== n || i && i !== e.state.fetchStatus || o && !o(e));
62
- }
63
- function ae(t, e) {
64
- const { exact: s, status: r, predicate: i, mutationKey: o } = t;
65
- if (o) {
66
- if (!e.options.mutationKey)
67
- return !1;
68
- if (s) {
69
- if (U(e.options.mutationKey) !== U(o))
70
- return !1;
71
- } else if (!B(e.options.mutationKey, o))
72
- return !1;
73
- }
74
- return !(r && e.state.status !== r || i && !i(e));
75
- }
76
- function Rt(t, e) {
77
- return (e?.queryKeyHashFn || U)(t);
78
- }
79
- function U(t) {
80
- return JSON.stringify(
81
- t,
82
- (e, s) => N(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
83
- );
84
- }
85
- function B(t, e) {
86
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => B(t[s], e[s])) : !1;
87
- }
88
- function j(t, e) {
89
- if (t === e)
90
- return t;
91
- const s = W(t) && W(e);
92
- if (s || N(t) && N(e)) {
93
- const r = s ? t : Object.keys(t), i = r.length, o = s ? e : Object.keys(e), a = o.length, n = s ? [] : {}, u = new Set(r);
94
- let h = 0;
95
- for (let c = 0; c < a; c++) {
96
- const d = s ? c : o[c];
97
- (!s && u.has(d) || s) && t[d] === void 0 && e[d] === void 0 ? (n[d] = void 0, h++) : (n[d] = j(t[d], e[d]), n[d] === t[d] && t[d] !== void 0 && h++);
98
- }
99
- return i === a && h === i ? t : n;
100
- }
101
- return e;
102
- }
103
- function M(t, e) {
104
- if (!e || Object.keys(t).length !== Object.keys(e).length)
105
- return !1;
106
- for (const s in t)
107
- if (t[s] !== e[s])
108
- return !1;
109
- return !0;
110
- }
111
- function W(t) {
112
- return Array.isArray(t) && t.length === Object.keys(t).length;
113
- }
114
- function N(t) {
115
- if (!Y(t))
116
- return !1;
117
- const e = t.constructor;
118
- if (e === void 0)
119
- return !0;
120
- const s = e.prototype;
121
- return !(!Y(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
122
- }
123
- function Y(t) {
124
- return Object.prototype.toString.call(t) === "[object Object]";
125
- }
126
- function St(t) {
127
- return new Promise((e) => {
128
- setTimeout(e, t);
129
- });
130
- }
131
- function L(t, e, s) {
132
- if (typeof s.structuralSharing == "function")
133
- return s.structuralSharing(t, e);
134
- if (s.structuralSharing !== !1) {
135
- if (process.env.NODE_ENV !== "production")
136
- try {
137
- return j(t, e);
138
- } catch (r) {
139
- throw console.error(
140
- `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}`
141
- ), r;
142
- }
143
- return j(t, e);
144
- }
145
- return e;
146
- }
147
- function oe(t) {
148
- return t;
149
- }
150
- function ue(t, e, s = 0) {
151
- const r = [...t, e];
152
- return s && r.length > s ? r.slice(1) : r;
153
- }
154
- function ce(t, e, s = 0) {
155
- const r = [e, ...t];
156
- return s && r.length > s ? r.slice(0, -1) : r;
157
- }
158
- var k = Symbol();
159
- function wt(t, e) {
160
- return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error(
161
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
162
- ), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === k ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
163
- }
164
- function Ct(t, e) {
165
- return typeof t == "function" ? t(...e) : !!t;
166
- }
167
- var Ot = class extends z {
168
- #e;
169
- #t;
170
- #s;
171
- constructor() {
172
- super(), this.#s = (t) => {
173
- if (!w && window.addEventListener) {
174
- const e = () => t();
175
- return window.addEventListener("visibilitychange", e, !1), () => {
176
- window.removeEventListener("visibilitychange", e);
177
- };
178
- }
179
- };
180
- }
181
- onSubscribe() {
182
- this.#t || this.setEventListener(this.#s);
183
- }
184
- onUnsubscribe() {
185
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
186
- }
187
- setEventListener(t) {
188
- this.#s = t, this.#t?.(), this.#t = t((e) => {
189
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
190
- });
191
- }
192
- setFocused(t) {
193
- this.#e !== t && (this.#e = t, this.onFocus());
194
- }
195
- onFocus() {
196
- const t = this.isFocused();
197
- this.listeners.forEach((e) => {
198
- e(t);
199
- });
200
- }
201
- isFocused() {
202
- return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
203
- }
204
- }, rt = new Ot(), Ft = class extends z {
205
- #e = !0;
206
- #t;
207
- #s;
208
- constructor() {
209
- super(), this.#s = (t) => {
210
- if (!w && window.addEventListener) {
211
- const e = () => t(!0), s = () => t(!1);
212
- return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
213
- window.removeEventListener("online", e), window.removeEventListener("offline", s);
214
- };
215
- }
216
- };
217
- }
218
- onSubscribe() {
219
- this.#t || this.setEventListener(this.#s);
220
- }
221
- onUnsubscribe() {
222
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
223
- }
224
- setEventListener(t) {
225
- this.#s = t, this.#t?.(), this.#t = t(this.setOnline.bind(this));
226
- }
227
- setOnline(t) {
228
- this.#e !== t && (this.#e = t, this.listeners.forEach((s) => {
229
- s(t);
230
- }));
231
- }
232
- isOnline() {
233
- return this.#e;
234
- }
235
- }, it = new Ft();
236
- function _() {
237
- let t, e;
238
- const s = new Promise((i, o) => {
239
- t = i, e = o;
240
- });
241
- s.status = "pending", s.catch(() => {
242
- });
243
- function r(i) {
244
- Object.assign(s, i), delete s.resolve, delete s.reject;
245
- }
246
- return s.resolve = (i) => {
247
- r({
248
- status: "fulfilled",
249
- value: i
250
- }), t(i);
251
- }, s.reject = (i) => {
252
- r({
253
- status: "rejected",
254
- reason: i
255
- }), e(i);
256
- }, s;
257
- }
258
- function he(t) {
259
- let e;
260
- if (t.then((s) => (e = s, s), C)?.catch(C), e !== void 0)
261
- return { data: e };
262
- }
263
- function Et(t) {
264
- return Math.min(1e3 * 2 ** t, 3e4);
265
- }
266
- function nt(t) {
267
- return (t ?? "online") === "online" ? it.isOnline() : !0;
268
- }
269
- var at = class extends Error {
270
- constructor(t) {
271
- super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
272
- }
273
- };
274
- function It(t) {
275
- let e = !1, s = 0, r;
276
- const i = _(), o = () => i.status !== "pending", a = (f) => {
277
- o() || (l(new at(f)), t.abort?.());
278
- }, n = () => {
279
- e = !0;
280
- }, u = () => {
281
- e = !1;
282
- }, h = () => rt.isFocused() && (t.networkMode === "always" || it.isOnline()) && t.canRun(), c = () => nt(t.networkMode) && t.canRun(), d = (f) => {
283
- o() || (r?.(), i.resolve(f));
284
- }, l = (f) => {
285
- o() || (r?.(), i.reject(f));
286
- }, P = () => new Promise((f) => {
287
- r = (F) => {
288
- (o() || h()) && f(F);
289
- }, t.onPause?.();
290
- }).then(() => {
291
- r = void 0, o() || t.onContinue?.();
292
- }), O = () => {
293
- if (o())
294
- return;
295
- let f;
296
- const F = s === 0 ? t.initialPromise : void 0;
297
- try {
298
- f = F ?? t.fn();
299
- } catch (m) {
300
- f = Promise.reject(m);
301
- }
302
- Promise.resolve(f).then(d).catch((m) => {
303
- if (o())
304
- return;
305
- const g = t.retry ?? (w ? 0 : 3), S = t.retryDelay ?? Et, x = typeof S == "function" ? S(s, m) : S, T = g === !0 || typeof g == "number" && s < g || typeof g == "function" && g(s, m);
306
- if (e || !T) {
307
- l(m);
308
- return;
309
- }
310
- s++, t.onFail?.(s, m), St(x).then(() => h() ? void 0 : P()).then(() => {
311
- e ? l(m) : O();
312
- });
313
- });
314
- };
315
- return {
316
- promise: i,
317
- status: () => i.status,
318
- cancel: a,
319
- continue: () => (r?.(), i),
320
- cancelRetry: n,
321
- continueRetry: u,
322
- canStart: c,
323
- start: () => (c() ? O() : P().then(O), i)
324
- };
325
- }
326
- var Pt = (t) => setTimeout(t, 0);
327
- function xt() {
328
- let t = [], e = 0, s = (n) => {
329
- n();
330
- }, r = (n) => {
331
- n();
332
- }, i = Pt;
333
- const o = (n) => {
334
- e ? t.push(n) : i(() => {
335
- s(n);
336
- });
337
- }, a = () => {
338
- const n = t;
339
- t = [], n.length && i(() => {
340
- r(() => {
341
- n.forEach((u) => {
342
- s(u);
343
- });
344
- });
345
- });
346
- };
347
- return {
348
- batch: (n) => {
349
- let u;
350
- e++;
351
- try {
352
- u = n();
353
- } finally {
354
- e--, e || a();
355
- }
356
- return u;
357
- },
358
- /**
359
- * All calls to the wrapped function will be batched.
360
- */
361
- batchCalls: (n) => (...u) => {
362
- o(() => {
363
- n(...u);
364
- });
365
- },
366
- schedule: o,
367
- /**
368
- * Use this method to set a custom notify function.
369
- * This can be used to for example wrap notifications with `React.act` while running tests.
370
- */
371
- setNotifyFunction: (n) => {
372
- s = n;
373
- },
374
- /**
375
- * Use this method to set a custom function to batch notifications together into a single tick.
376
- * By default React Query will use the batch function provided by ReactDOM or React Native.
377
- */
378
- setBatchNotifyFunction: (n) => {
379
- r = n;
380
- },
381
- setScheduler: (n) => {
382
- i = n;
383
- }
384
- };
385
- }
386
- var V = xt(), Tt = class {
387
- #e;
388
- destroy() {
389
- this.clearGcTimeout();
390
- }
391
- scheduleGc() {
392
- this.clearGcTimeout(), Q(this.gcTime) && (this.#e = setTimeout(() => {
393
- this.optionalRemove();
394
- }, this.gcTime));
395
- }
396
- updateGcTime(t) {
397
- this.gcTime = Math.max(
398
- this.gcTime || 0,
399
- t ?? (w ? 1 / 0 : 300 * 1e3)
400
- );
401
- }
402
- clearGcTimeout() {
403
- this.#e && (clearTimeout(this.#e), this.#e = void 0);
404
- }
405
- }, le = class extends Tt {
406
- #e;
407
- #t;
408
- #s;
409
- #i;
410
- #r;
411
- #o;
412
- #a;
413
- constructor(t) {
414
- super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#i = t.client, this.#s = this.#i.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = Dt(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
415
- }
416
- get meta() {
417
- return this.options.meta;
418
- }
419
- get promise() {
420
- return this.#r?.promise;
421
- }
422
- setOptions(t) {
423
- this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime);
424
- }
425
- optionalRemove() {
426
- !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
427
- }
428
- setData(t, e) {
429
- const s = L(this.state.data, t, this.options);
430
- return this.#n({
431
- data: s,
432
- type: "success",
433
- dataUpdatedAt: e?.updatedAt,
434
- manual: e?.manual
435
- }), s;
436
- }
437
- setState(t, e) {
438
- this.#n({ type: "setState", state: t, setStateOptions: e });
439
- }
440
- cancel(t) {
441
- const e = this.#r?.promise;
442
- return this.#r?.cancel(t), e ? e.then(C).catch(C) : Promise.resolve();
443
- }
444
- destroy() {
445
- super.destroy(), this.cancel({ silent: !0 });
446
- }
447
- reset() {
448
- this.destroy(), this.setState(this.#e);
449
- }
450
- isActive() {
451
- return this.observers.some(
452
- (t) => y(t.options.enabled, this) !== !1
453
- );
454
- }
455
- isDisabled() {
456
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === k || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
457
- }
458
- isStatic() {
459
- return this.getObserversCount() > 0 ? this.observers.some(
460
- (t) => I(t.options.staleTime, this) === "static"
461
- ) : !1;
462
- }
463
- isStale() {
464
- return this.getObserversCount() > 0 ? this.observers.some(
465
- (t) => t.getCurrentResult().isStale
466
- ) : this.state.data === void 0 || this.state.isInvalidated;
467
- }
468
- isStaleByTime(t = 0) {
469
- return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !st(this.state.dataUpdatedAt, t);
470
- }
471
- onFocus() {
472
- this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
473
- }
474
- onOnline() {
475
- this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
476
- }
477
- addObserver(t) {
478
- this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: t }));
479
- }
480
- removeObserver(t) {
481
- this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), 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: t }));
482
- }
483
- getObserversCount() {
484
- return this.observers.length;
485
- }
486
- invalidate() {
487
- this.state.isInvalidated || this.#n({ type: "invalidate" });
488
- }
489
- async fetch(t, e) {
490
- if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
491
- // re-start the fetch; there is a chance that the query is still in a
492
- // pending state when that happens
493
- this.#r?.status() !== "rejected") {
494
- if (this.state.data !== void 0 && e?.cancelRefetch)
495
- this.cancel({ silent: !0 });
496
- else if (this.#r)
497
- return this.#r.continueRetry(), this.#r.promise;
498
- }
499
- if (t && this.setOptions(t), !this.options.queryFn) {
500
- const n = this.observers.find((u) => u.options.queryFn);
501
- n && this.setOptions(n.options);
502
- }
503
- process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
504
- "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']"
505
- ));
506
- const s = new AbortController(), r = (n) => {
507
- Object.defineProperty(n, "signal", {
508
- enumerable: !0,
509
- get: () => (this.#a = !0, s.signal)
510
- });
511
- }, i = () => {
512
- const n = wt(this.options, e), h = (() => {
513
- const c = {
514
- client: this.#i,
515
- queryKey: this.queryKey,
516
- meta: this.meta
517
- };
518
- return r(c), c;
519
- })();
520
- return this.#a = !1, this.options.persister ? this.options.persister(
521
- n,
522
- h,
523
- this
524
- ) : n(h);
525
- }, a = (() => {
526
- const n = {
527
- fetchOptions: e,
528
- options: this.options,
529
- queryKey: this.queryKey,
530
- client: this.#i,
531
- state: this.state,
532
- fetchFn: i
533
- };
534
- return r(n), n;
535
- })();
536
- this.options.behavior?.onFetch(a, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#n({ type: "fetch", meta: a.fetchOptions?.meta }), this.#r = It({
537
- initialPromise: e?.initialPromise,
538
- fn: a.fetchFn,
539
- abort: s.abort.bind(s),
540
- onFail: (n, u) => {
541
- this.#n({ type: "failed", failureCount: n, error: u });
542
- },
543
- onPause: () => {
544
- this.#n({ type: "pause" });
545
- },
546
- onContinue: () => {
547
- this.#n({ type: "continue" });
548
- },
549
- retry: a.options.retry,
550
- retryDelay: a.options.retryDelay,
551
- networkMode: a.options.networkMode,
552
- canRun: () => !0
553
- });
554
- try {
555
- const n = await this.#r.start();
556
- if (n === void 0)
557
- throw process.env.NODE_ENV !== "production" && console.error(
558
- `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
559
- ), new Error(`${this.queryHash} data is undefined`);
560
- return this.setData(n), this.#s.config.onSuccess?.(n, this), this.#s.config.onSettled?.(
561
- n,
562
- this.state.error,
563
- this
564
- ), n;
565
- } catch (n) {
566
- if (n instanceof at) {
567
- if (n.silent)
568
- return this.#r.promise;
569
- if (n.revert) {
570
- if (this.setState({
571
- ...this.#t,
572
- fetchStatus: "idle"
573
- }), this.state.data === void 0)
574
- throw n;
575
- return this.state.data;
576
- }
577
- }
578
- throw this.#n({
579
- type: "error",
580
- error: n
581
- }), this.#s.config.onError?.(
582
- n,
583
- this
584
- ), this.#s.config.onSettled?.(
585
- this.state.data,
586
- n,
587
- this
588
- ), n;
589
- } finally {
590
- this.scheduleGc();
591
- }
592
- }
593
- #n(t) {
594
- const e = (s) => {
595
- switch (t.type) {
596
- case "failed":
597
- return {
598
- ...s,
599
- fetchFailureCount: t.failureCount,
600
- fetchFailureReason: t.error
601
- };
602
- case "pause":
603
- return {
604
- ...s,
605
- fetchStatus: "paused"
606
- };
607
- case "continue":
608
- return {
609
- ...s,
610
- fetchStatus: "fetching"
611
- };
612
- case "fetch":
613
- return {
614
- ...s,
615
- ...ot(s.data, this.options),
616
- fetchMeta: t.meta ?? null
617
- };
618
- case "success":
619
- const r = {
620
- ...s,
621
- data: t.data,
622
- dataUpdateCount: s.dataUpdateCount + 1,
623
- dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
624
- error: null,
625
- isInvalidated: !1,
626
- status: "success",
627
- ...!t.manual && {
628
- fetchStatus: "idle",
629
- fetchFailureCount: 0,
630
- fetchFailureReason: null
631
- }
632
- };
633
- return this.#t = t.manual ? r : void 0, r;
634
- case "error":
635
- const i = t.error;
636
- return {
637
- ...s,
638
- error: i,
639
- errorUpdateCount: s.errorUpdateCount + 1,
640
- errorUpdatedAt: Date.now(),
641
- fetchFailureCount: s.fetchFailureCount + 1,
642
- fetchFailureReason: i,
643
- fetchStatus: "idle",
644
- status: "error"
645
- };
646
- case "invalidate":
647
- return {
648
- ...s,
649
- isInvalidated: !0
650
- };
651
- case "setState":
652
- return {
653
- ...s,
654
- ...t.state
655
- };
656
- }
657
- };
658
- this.state = e(this.state), V.batch(() => {
659
- this.observers.forEach((s) => {
660
- s.onQueryUpdate();
661
- }), this.#s.notify({ query: this, type: "updated", action: t });
662
- });
663
- }
664
- };
665
- function ot(t, e) {
666
- return {
667
- fetchFailureCount: 0,
668
- fetchFailureReason: null,
669
- fetchStatus: nt(e.networkMode) ? "fetching" : "paused",
670
- ...t === void 0 && {
671
- error: null,
672
- status: "pending"
673
- }
674
- };
675
- }
676
- function Dt(t) {
677
- 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;
678
- return {
679
- data: e,
680
- dataUpdateCount: 0,
681
- dataUpdatedAt: s ? r ?? Date.now() : 0,
682
- error: null,
683
- errorUpdateCount: 0,
684
- errorUpdatedAt: 0,
685
- fetchFailureCount: 0,
686
- fetchFailureReason: null,
687
- fetchMeta: null,
688
- isInvalidated: !1,
689
- status: s ? "success" : "pending",
690
- fetchStatus: "idle"
691
- };
692
- }
693
- var ut = class extends z {
694
- constructor(t, e) {
695
- super(), this.options = e, this.#e = t, this.#n = null, this.#a = _(), this.bindMethods(), this.setOptions(e);
696
- }
697
- #e;
698
- #t = void 0;
699
- #s = void 0;
700
- #i = void 0;
701
- #r;
702
- #o;
703
- #a;
704
- #n;
705
- #y;
706
- #f;
707
- // This property keeps track of the last query with defined data.
708
- // It will be used to pass the previous data and query to the placeholder function between renders.
709
- #d;
710
- #c;
711
- #h;
712
- #u;
713
- #p = /* @__PURE__ */ new Set();
714
- bindMethods() {
715
- this.refetch = this.refetch.bind(this);
716
- }
717
- onSubscribe() {
718
- this.listeners.size === 1 && (this.#t.addObserver(this), X(this.#t, this.options) ? this.#l() : this.updateResult(), this.#g());
719
- }
720
- onUnsubscribe() {
721
- this.hasListeners() || this.destroy();
722
- }
723
- shouldFetchOnReconnect() {
724
- return K(
725
- this.#t,
726
- this.options,
727
- this.options.refetchOnReconnect
728
- );
729
- }
730
- shouldFetchOnWindowFocus() {
731
- return K(
732
- this.#t,
733
- this.options,
734
- this.options.refetchOnWindowFocus
735
- );
736
- }
737
- destroy() {
738
- this.listeners = /* @__PURE__ */ new Set(), this.#R(), this.#S(), this.#t.removeObserver(this);
739
- }
740
- setOptions(t) {
741
- const e = this.options, s = this.#t;
742
- if (this.options = this.#e.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof y(this.options.enabled, this.#t) != "boolean")
743
- throw new Error(
744
- "Expected enabled to be a boolean or a callback that returns a boolean"
745
- );
746
- this.#w(), this.#t.setOptions(this.options), e._defaulted && !M(this.options, e) && this.#e.getQueryCache().notify({
747
- type: "observerOptionsUpdated",
748
- query: this.#t,
749
- observer: this
750
- });
751
- const r = this.hasListeners();
752
- r && tt(
753
- this.#t,
754
- s,
755
- this.options,
756
- e
757
- ) && this.#l(), this.updateResult(), r && (this.#t !== s || y(this.options.enabled, this.#t) !== y(e.enabled, this.#t) || I(this.options.staleTime, this.#t) !== I(e.staleTime, this.#t)) && this.#v();
758
- const i = this.#m();
759
- r && (this.#t !== s || y(this.options.enabled, this.#t) !== y(e.enabled, this.#t) || i !== this.#u) && this.#b(i);
760
- }
761
- getOptimisticResult(t) {
762
- const e = this.#e.getQueryCache().build(this.#e, t), s = this.createResult(e, t);
763
- return kt(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#t.state), s;
764
- }
765
- getCurrentResult() {
766
- return this.#i;
767
- }
768
- trackResult(t, e) {
769
- return new Proxy(t, {
770
- get: (s, r) => (this.trackProp(r), e?.(r), r === "promise" && !this.options.experimental_prefetchInRender && this.#a.status === "pending" && this.#a.reject(
771
- new Error(
772
- "experimental_prefetchInRender feature flag is not enabled"
773
- )
774
- ), Reflect.get(s, r))
775
- });
776
- }
777
- trackProp(t) {
778
- this.#p.add(t);
779
- }
780
- getCurrentQuery() {
781
- return this.#t;
782
- }
783
- refetch({ ...t } = {}) {
784
- return this.fetch({
785
- ...t
786
- });
787
- }
788
- fetchOptimistic(t) {
789
- const e = this.#e.defaultQueryOptions(t), s = this.#e.getQueryCache().build(this.#e, e);
790
- return s.fetch().then(() => this.createResult(s, e));
791
- }
792
- fetch(t) {
793
- return this.#l({
794
- ...t,
795
- cancelRefetch: t.cancelRefetch ?? !0
796
- }).then(() => (this.updateResult(), this.#i));
797
- }
798
- #l(t) {
799
- this.#w();
800
- let e = this.#t.fetch(
801
- this.options,
802
- t
803
- );
804
- return t?.throwOnError || (e = e.catch(C)), e;
805
- }
806
- #v() {
807
- this.#R();
808
- const t = I(
809
- this.options.staleTime,
810
- this.#t
811
- );
812
- if (w || this.#i.isStale || !Q(t))
813
- return;
814
- const s = st(this.#i.dataUpdatedAt, t) + 1;
815
- this.#c = setTimeout(() => {
816
- this.#i.isStale || this.updateResult();
817
- }, s);
818
- }
819
- #m() {
820
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
821
- }
822
- #b(t) {
823
- this.#S(), this.#u = t, !(w || y(this.options.enabled, this.#t) === !1 || !Q(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
824
- (this.options.refetchIntervalInBackground || rt.isFocused()) && this.#l();
825
- }, this.#u));
826
- }
827
- #g() {
828
- this.#v(), this.#b(this.#m());
829
- }
830
- #R() {
831
- this.#c && (clearTimeout(this.#c), this.#c = void 0);
832
- }
833
- #S() {
834
- this.#h && (clearInterval(this.#h), this.#h = void 0);
835
- }
836
- createResult(t, e) {
837
- const s = this.#t, r = this.options, i = this.#i, o = this.#r, a = this.#o, u = t !== s ? t.state : this.#s, { state: h } = t;
838
- let c = { ...h }, d = !1, l;
839
- if (e._optimisticResults) {
840
- const p = this.hasListeners(), D = !p && X(t, e), E = p && tt(t, s, e, r);
841
- (D || E) && (c = {
842
- ...c,
843
- ...ot(h.data, t.options)
844
- }), e._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
845
- }
846
- let { error: P, errorUpdatedAt: O, status: f } = c;
847
- l = c.data;
848
- let F = !1;
849
- if (e.placeholderData !== void 0 && l === void 0 && f === "pending") {
850
- let p;
851
- i?.isPlaceholderData && e.placeholderData === a?.placeholderData ? (p = i.data, F = !0) : p = typeof e.placeholderData == "function" ? e.placeholderData(
852
- this.#d?.state.data,
853
- this.#d
854
- ) : e.placeholderData, p !== void 0 && (f = "success", l = L(
855
- i?.data,
856
- p,
857
- e
858
- ), d = !0);
859
- }
860
- if (e.select && l !== void 0 && !F)
861
- if (i && l === o?.data && e.select === this.#y)
862
- l = this.#f;
863
- else
864
- try {
865
- this.#y = e.select, l = e.select(l), l = L(i?.data, l, e), this.#f = l, this.#n = null;
866
- } catch (p) {
867
- this.#n = p;
868
- }
869
- this.#n && (P = this.#n, l = this.#f, O = Date.now(), f = "error");
870
- const m = c.fetchStatus === "fetching", g = f === "pending", S = f === "error", x = g && m, T = l !== void 0, b = {
871
- status: f,
872
- fetchStatus: c.fetchStatus,
873
- isPending: g,
874
- isSuccess: f === "success",
875
- isError: S,
876
- isInitialLoading: x,
877
- isLoading: x,
878
- data: l,
879
- dataUpdatedAt: c.dataUpdatedAt,
880
- error: P,
881
- errorUpdatedAt: O,
882
- failureCount: c.fetchFailureCount,
883
- failureReason: c.fetchFailureReason,
884
- errorUpdateCount: c.errorUpdateCount,
885
- isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
886
- isFetchedAfterMount: c.dataUpdateCount > u.dataUpdateCount || c.errorUpdateCount > u.errorUpdateCount,
887
- isFetching: m,
888
- isRefetching: m && !g,
889
- isLoadingError: S && !T,
890
- isPaused: c.fetchStatus === "paused",
891
- isPlaceholderData: d,
892
- isRefetchError: S && T,
893
- isStale: G(t, e),
894
- refetch: this.refetch,
895
- promise: this.#a,
896
- isEnabled: y(e.enabled, t) !== !1
897
- };
898
- if (this.options.experimental_prefetchInRender) {
899
- const p = (q) => {
900
- b.status === "error" ? q.reject(b.error) : b.data !== void 0 && q.resolve(b.data);
901
- }, D = () => {
902
- const q = this.#a = b.promise = _();
903
- p(q);
904
- }, E = this.#a;
905
- switch (E.status) {
906
- case "pending":
907
- t.queryHash === s.queryHash && p(E);
908
- break;
909
- case "fulfilled":
910
- (b.status === "error" || b.data !== E.value) && D();
911
- break;
912
- case "rejected":
913
- (b.status !== "error" || b.error !== E.reason) && D();
914
- break;
915
- }
916
- }
917
- return b;
918
- }
919
- updateResult() {
920
- const t = this.#i, e = this.createResult(this.#t, this.options);
921
- if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), M(e, t))
922
- return;
923
- this.#i = e;
924
- const s = () => {
925
- if (!t)
926
- return !0;
927
- const { notifyOnChangeProps: r } = this.options, i = typeof r == "function" ? r() : r;
928
- if (i === "all" || !i && !this.#p.size)
929
- return !0;
930
- const o = new Set(
931
- i ?? this.#p
932
- );
933
- return this.options.throwOnError && o.add("error"), Object.keys(this.#i).some((a) => {
934
- const n = a;
935
- return this.#i[n] !== t[n] && o.has(n);
936
- });
937
- };
938
- this.#C({ listeners: s() });
939
- }
940
- #w() {
941
- const t = this.#e.getQueryCache().build(this.#e, this.options);
942
- if (t === this.#t)
943
- return;
944
- const e = this.#t;
945
- this.#t = t, this.#s = t.state, this.hasListeners() && (e?.removeObserver(this), t.addObserver(this));
946
- }
947
- onQueryUpdate() {
948
- this.updateResult(), this.hasListeners() && this.#g();
949
- }
950
- #C(t) {
951
- V.batch(() => {
952
- t.listeners && this.listeners.forEach((e) => {
953
- e(this.#i);
954
- }), this.#e.getQueryCache().notify({
955
- query: this.#t,
956
- type: "observerResultsUpdated"
957
- });
958
- });
959
- }
960
- };
961
- function qt(t, e) {
962
- return y(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
963
- }
964
- function X(t, e) {
965
- return qt(t, e) || t.state.data !== void 0 && K(t, e, e.refetchOnMount);
966
- }
967
- function K(t, e, s) {
968
- if (y(e.enabled, t) !== !1 && I(e.staleTime, t) !== "static") {
969
- const r = typeof s == "function" ? s(t) : s;
970
- return r === "always" || r !== !1 && G(t, e);
971
- }
972
- return !1;
973
- }
974
- function tt(t, e, s, r) {
975
- return (t !== e || y(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && G(t, s);
976
- }
977
- function G(t, e) {
978
- return y(e.enabled, t) !== !1 && t.isStaleByTime(I(e.staleTime, t));
979
- }
980
- function kt(t, e) {
981
- return !M(t.getCurrentResult(), e);
982
- }
983
- var ct = v.createContext(
984
- void 0
985
- ), ht = (t) => {
986
- const e = v.useContext(ct);
987
- if (t)
988
- return t;
989
- if (!e)
990
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
991
- return e;
992
- }, fe = ({
993
- client: t,
994
- children: e
995
- }) => (v.useEffect(() => (t.mount(), () => {
996
- t.unmount();
997
- }), [t]), /* @__PURE__ */ bt.jsx(ct.Provider, { value: t, children: e })), lt = v.createContext(!1), At = () => v.useContext(lt);
998
- lt.Provider;
999
- function Qt() {
1000
- let t = !1;
1001
- return {
1002
- clearReset: () => {
1003
- t = !1;
1004
- },
1005
- reset: () => {
1006
- t = !0;
1007
- },
1008
- isReset: () => t
1009
- };
1010
- }
1011
- var Ut = v.createContext(Qt()), jt = () => v.useContext(Ut), Mt = (t, e) => {
1012
- (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1013
- }, Nt = (t) => {
1014
- v.useEffect(() => {
1015
- t.clearReset();
1016
- }, [t]);
1017
- }, Lt = ({
1018
- result: t,
1019
- errorResetBoundary: e,
1020
- throwOnError: s,
1021
- query: r,
1022
- suspense: i
1023
- }) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || Ct(s, [t.error, r])), _t = (t, e) => e.state.data === void 0, Kt = (t) => {
1024
- if (t.suspense) {
1025
- const e = (r) => r === "static" ? r : Math.max(r ?? 1e3, 1e3), s = t.staleTime;
1026
- t.staleTime = typeof s == "function" ? (...r) => e(s(...r)) : e(s), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3));
1027
- }
1028
- }, Ht = (t, e) => t.isLoading && t.isFetching && !e, zt = (t, e) => t?.suspense && e.isPending, et = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1029
- s.clearReset();
1030
- });
1031
- function ft(t, e, s) {
1032
- if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1033
- throw new Error(
1034
- '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'
1035
- );
1036
- const r = At(), i = jt(), o = ht(s), a = o.defaultQueryOptions(t);
1037
- o.getDefaultOptions().queries?._experimental_beforeQuery?.(
1038
- a
1039
- ), process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
1040
- `[${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`
1041
- )), a._optimisticResults = r ? "isRestoring" : "optimistic", Kt(a), Mt(a, i), Nt(i);
1042
- const n = !o.getQueryCache().get(a.queryHash), [u] = v.useState(
1043
- () => new e(
1044
- o,
1045
- a
1046
- )
1047
- ), h = u.getOptimisticResult(a), c = !r && t.subscribed !== !1;
1048
- if (v.useSyncExternalStore(
1049
- v.useCallback(
1050
- (d) => {
1051
- const l = c ? u.subscribe(V.batchCalls(d)) : C;
1052
- return u.updateResult(), l;
1053
- },
1054
- [u, c]
1055
- ),
1056
- () => u.getCurrentResult(),
1057
- () => u.getCurrentResult()
1058
- ), v.useEffect(() => {
1059
- u.setOptions(a);
1060
- }, [a, u]), zt(a, h))
1061
- throw et(a, u, i);
1062
- if (Lt({
1063
- result: h,
1064
- errorResetBoundary: i,
1065
- throwOnError: a.throwOnError,
1066
- query: o.getQueryCache().get(a.queryHash),
1067
- suspense: a.suspense
1068
- }))
1069
- throw h.error;
1070
- return o.getDefaultOptions().queries?._experimental_afterQuery?.(
1071
- a,
1072
- h
1073
- ), a.experimental_prefetchInRender && !w && Ht(h, r) && (n ? (
1074
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1075
- et(a, u, i)
1076
- ) : (
1077
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1078
- o.getQueryCache().get(a.queryHash)?.promise
1079
- ))?.catch(C).finally(() => {
1080
- u.updateResult();
1081
- }), a.notifyOnChangeProps ? h : u.trackResult(h);
1082
- }
1083
- function Bt(t, e) {
1084
- return ft(t, ut, e);
1085
- }
1086
- function Vt(t, e) {
1087
- return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error("skipToken is not allowed for useSuspenseQuery"), ft(
1088
- {
1089
- ...t,
1090
- enabled: !0,
1091
- suspense: !0,
1092
- throwOnError: _t,
1093
- placeholderData: void 0
1094
- },
1095
- ut,
1096
- e
1097
- );
1098
- }
1099
- const Gt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, $t = (t) => t.filter(
1100
- (e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
1101
- ).map((e) => `${e}`).filter((e) => e), Zt = (t) => {
1102
- const e = t.join("/"), [, s = "", r = ""] = e.match(Gt) ?? [];
1103
- return {
1104
- prefix: s,
1105
- pathname: r.split("/").filter((i) => i !== "")
1106
- };
1107
- }, Jt = (t) => {
1108
- const { prefix: e, pathname: s } = t;
1109
- let r = e;
1110
- return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
1111
- }, R = (...t) => {
1112
- const e = $t(t), s = Zt(e);
1113
- return Jt(s);
1114
- }, dt = Object.freeze({
1115
- API_IDENTITIES: ["api-identities"]
1116
- }), de = () => {
1117
- const t = ht();
1118
- return {
1119
- invalidateCache: async (e) => {
1120
- await t.invalidateQueries({ queryKey: dt[e] });
1121
- }
1122
- };
1123
- }, pe = "no-dehydrate", $ = (t, e) => {
1124
- for (const s of t) {
1125
- const r = Z(s, e);
1126
- if (r !== void 0) return r;
1127
- }
1128
- }, Z = (t, e, s = []) => {
1129
- const r = e(t, s);
1130
- if (r !== void 0) return r;
1131
- if (t.type === "category")
1132
- for (const i of t.items) {
1133
- const o = Z(i, e, [
1134
- ...s,
1135
- t
1136
- ]);
1137
- if (o !== void 0) return o;
1138
- }
1139
- }, ye = () => {
1140
- const t = A(), { navigation: e } = yt();
1141
- return $(e, (s) => {
1142
- if (s.type === "doc" && R(s.path) === t.pathname)
1143
- return s;
1144
- });
1145
- }, ve = (t) => {
1146
- const e = A();
1147
- return Z(t, (s) => {
1148
- switch (s.type) {
1149
- case "category":
1150
- return s.link && R(s.link.path) === e.pathname ? !0 : void 0;
1151
- case "custom-page":
1152
- case "doc":
1153
- return R(s.path) === e.pathname ? !0 : void 0;
1154
- default:
1155
- return;
1156
- }
1157
- });
1158
- }, me = () => {
1159
- const t = A().pathname, { navigation: e } = yt();
1160
- let s, r, i = !1;
1161
- return $(e, (o) => {
1162
- const a = o.type === "doc" ? R(o.path) : o.type === "category" && o.link ? R(o.link.path) : void 0;
1163
- if (a) {
1164
- if (i)
1165
- return r = { label: o.label, id: a }, !0;
1166
- t === a ? i = !0 : s = { label: o.label, id: a };
1167
- }
1168
- }), { prev: s, next: r };
1169
- }, be = gt(
1170
- "relative flex items-center gap-2 px-(--padding-nav-item) my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
1171
- {
1172
- variants: {
1173
- isActive: {
1174
- true: "bg-accent font-medium",
1175
- false: "text-foreground/80"
1176
- },
1177
- isMuted: {
1178
- true: "text-foreground/30",
1179
- false: ""
1180
- },
1181
- isPending: {
1182
- true: "bg-accent animate-pulse",
1183
- false: ""
1184
- }
1185
- },
1186
- defaultVariants: {
1187
- isActive: !1
1188
- }
1189
- }
1190
- ), ge = (t, e) => (s) => typeof s.display == "function" ? s.display({ context: e, auth: t }) : s.display === "hide" || !s.label ? !1 : s.display === "auth" && t.isAuthenticated || s.display === "anon" && !t.isAuthenticated || !s.display || s.display === "always", Wt = vt(
1191
- void 0
1192
- ), pt = () => {
1193
- const t = mt(Wt);
1194
- if (!t)
1195
- throw new Error("useZudoku must be used within a ZudokuProvider.");
1196
- return t;
1197
- }, Re = () => {
1198
- const { getApiIdentities: t } = pt();
1199
- return Bt({
1200
- queryFn: t,
1201
- queryKey: dt.API_IDENTITIES
1202
- });
1203
- }, H = (t) => {
1204
- switch (t.type) {
1205
- case "doc":
1206
- return R(t.path);
1207
- case "category":
1208
- return t.link ? R(t.link.path) : void 0;
1209
- case "link":
1210
- return t.to;
1211
- case "custom-page":
1212
- return R(t.path);
1213
- default:
1214
- return;
1215
- }
1216
- }, Yt = (t) => {
1217
- const e = /* @__PURE__ */ new Set(), s = (r) => {
1218
- for (const i of r) {
1219
- const o = H(i)?.split("?").at(0)?.split("#").at(0);
1220
- o && e.add(o), i.type === "category" && s(i.items);
1221
- }
1222
- };
1223
- return s(t), [...e];
1224
- }, yt = () => {
1225
- const { getPluginNavigation: t, navigation: e } = pt(), s = A(), r = $(e, (a, n) => {
1226
- if (H(a) === s.pathname)
1227
- return n.at(0) ?? a;
1228
- }), { data: i } = Vt({
1229
- queryFn: () => t(s.pathname),
1230
- queryKey: ["plugin-navigation", s.pathname]
1231
- });
1232
- let o = r;
1233
- if (!r && i.length > 0) {
1234
- const a = Yt(i);
1235
- o = e.flatMap((n) => {
1236
- const u = H(n);
1237
- return u ? [{ item: n, path: u }] : [];
1238
- }).sort((n, u) => u.path.length - n.path.length).find(({ path: n }) => a.some(
1239
- (u) => J({ path: n, end: !1 }, u) ?? J({ path: u, end: !1 }, n)
1240
- ))?.item;
1241
- }
1242
- return {
1243
- navigation: [
1244
- ...r?.type === "category" ? r.items : [],
1245
- ...i
1246
- ],
1247
- topNavItem: o
1248
- };
1249
- };
1250
- export {
1251
- it as A,
1252
- I as B,
1253
- dt as C,
1254
- ie as D,
1255
- B as E,
1256
- k as F,
1257
- he as G,
1258
- fe as H,
1259
- Re as I,
1260
- ve as J,
1261
- be as K,
1262
- pe as N,
1263
- le as Q,
1264
- Tt as R,
1265
- z as S,
1266
- Wt as Z,
1267
- me as a,
1268
- Vt as b,
1269
- It as c,
1270
- pt as d,
1271
- de as e,
1272
- Bt as f,
1273
- ht as g,
1274
- U as h,
1275
- C as i,
1276
- R as j,
1277
- Ct as k,
1278
- oe as l,
1279
- ge as m,
1280
- V as n,
1281
- yt as o,
1282
- Z as p,
1283
- Rt as q,
1284
- ne as r,
1285
- M as s,
1286
- $ as t,
1287
- ye as u,
1288
- ae as v,
1289
- wt as w,
1290
- ce as x,
1291
- ue as y,
1292
- rt as z
1293
- };
1294
- //# sourceMappingURL=ZudokuContext-BcqSiygJ.js.map