zudoku 0.41.5 → 0.42.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 (529) hide show
  1. package/dist/app/main.js +6 -0
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/config/validators/common.d.ts +420 -288
  4. package/dist/config/validators/common.js +10 -0
  5. package/dist/config/validators/common.js.map +1 -1
  6. package/dist/config/validators/validate.d.ts +161 -108
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/components/BuildCheck.js +3 -2
  11. package/dist/lib/components/BuildCheck.js.map +1 -1
  12. package/dist/lib/components/Markdown.d.ts +3 -1
  13. package/dist/lib/components/Markdown.js +8 -14
  14. package/dist/lib/components/Markdown.js.map +1 -1
  15. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  16. package/dist/lib/components/index.d.ts +2 -1
  17. package/dist/lib/core/ZudokuContext.d.ts +7 -0
  18. package/dist/lib/core/ZudokuContext.js.map +1 -1
  19. package/dist/lib/errors/ErrorAlert.js +1 -1
  20. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  21. package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
  22. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  23. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  24. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  25. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  26. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  27. package/dist/lib/shiki.d.ts +35 -0
  28. package/dist/lib/shiki.js +103 -0
  29. package/dist/lib/shiki.js.map +1 -0
  30. package/dist/lib/ui/Callout.js +1 -1
  31. package/dist/lib/ui/Callout.js.map +1 -1
  32. package/dist/lib/ui/CodeBlock.d.ts +16 -0
  33. package/dist/lib/ui/CodeBlock.js +18 -0
  34. package/dist/lib/ui/CodeBlock.js.map +1 -0
  35. package/dist/lib/ui/SyntaxHighlight.d.ts +10 -15
  36. package/dist/lib/ui/SyntaxHighlight.js +10 -60
  37. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  38. package/dist/lib/util/MdxComponents.d.ts +9 -3
  39. package/dist/lib/util/MdxComponents.js +9 -10
  40. package/dist/lib/util/MdxComponents.js.map +1 -1
  41. package/dist/vite/config.js +34 -0
  42. package/dist/vite/config.js.map +1 -1
  43. package/dist/vite/plugin-mdx.js +4 -11
  44. package/dist/vite/plugin-mdx.js.map +1 -1
  45. package/dist/vite/plugin-shiki-register.d.ts +3 -0
  46. package/dist/vite/plugin-shiki-register.js +38 -0
  47. package/dist/vite/plugin-shiki-register.js.map +1 -0
  48. package/dist/vite/plugin.js +2 -0
  49. package/dist/vite/plugin.js.map +1 -1
  50. package/lib/AuthenticationPlugin-EeQpQI3D.js +55 -0
  51. package/lib/{AuthenticationPlugin-DPCuR3xm.js.map → AuthenticationPlugin-EeQpQI3D.js.map} +1 -1
  52. package/lib/{Button-BBNrKpQd.js → Button-Bdk_Ij3U.js} +3 -3
  53. package/lib/{Button-BBNrKpQd.js.map → Button-Bdk_Ij3U.js.map} +1 -1
  54. package/lib/{Callout-D3Ja4OPX.js → Callout-XadUe37J.js} +12 -12
  55. package/lib/{Callout-D3Ja4OPX.js.map → Callout-XadUe37J.js.map} +1 -1
  56. package/lib/{CategoryHeading-D06WK_Wo.js → CategoryHeading-DZi-Szor.js} +2 -2
  57. package/lib/{CategoryHeading-D06WK_Wo.js.map → CategoryHeading-DZi-Szor.js.map} +1 -1
  58. package/lib/{Dialog-ByYz4ABw.js → Dialog-CNf2oWXG.js} +2 -2
  59. package/lib/{Dialog-ByYz4ABw.js.map → Dialog-CNf2oWXG.js.map} +1 -1
  60. package/lib/{Drawer-CEwbkLDb.js → Drawer-BPBxzel2.js} +25 -25
  61. package/lib/{Drawer-CEwbkLDb.js.map → Drawer-BPBxzel2.js.map} +1 -1
  62. package/lib/Markdown-1l-DtDbF.js +7688 -0
  63. package/lib/Markdown-1l-DtDbF.js.map +1 -0
  64. package/lib/MdxPage-Dxbq6lFr.js +84 -0
  65. package/lib/{MdxPage-CH19q_hk.js.map → MdxPage-Dxbq6lFr.js.map} +1 -1
  66. package/lib/{OasProvider-n805wUHH.js → OasProvider-DKpTJMH2.js} +4 -4
  67. package/lib/{OasProvider-n805wUHH.js.map → OasProvider-DKpTJMH2.js.map} +1 -1
  68. package/lib/{OperationList-BAhWsh8C.js → OperationList-DVOyNeno.js} +1385 -1417
  69. package/lib/{OperationList-BAhWsh8C.js.map → OperationList-DVOyNeno.js.map} +1 -1
  70. package/lib/{Pagination-DAjXddnj.js → Pagination-COMmV-g9.js} +4 -4
  71. package/lib/{Pagination-DAjXddnj.js.map → Pagination-COMmV-g9.js.map} +1 -1
  72. package/lib/RouteGuard-CGqivwrh.js +733 -0
  73. package/lib/{RouteGuard-DRtEu9nh.js.map → RouteGuard-CGqivwrh.js.map} +1 -1
  74. package/lib/{SchemaList-BJ0GDIcI.js → SchemaList-BTWzXyYQ.js} +43 -44
  75. package/lib/{SchemaList-BJ0GDIcI.js.map → SchemaList-BTWzXyYQ.js.map} +1 -1
  76. package/lib/{SchemaView-J7Srn-Iy.js → SchemaView-DNKKW3nB.js} +7 -11
  77. package/lib/{SchemaView-J7Srn-Iy.js.map → SchemaView-DNKKW3nB.js.map} +1 -1
  78. package/lib/Select-m-ITdvFa.js +211 -0
  79. package/lib/{Select-CT64Ou40.js.map → Select-m-ITdvFa.js.map} +1 -1
  80. package/lib/SlotletProvider-DhK1Fmm9.js +254 -0
  81. package/lib/SlotletProvider-DhK1Fmm9.js.map +1 -0
  82. package/lib/SyntaxHighlight-CJ6FoYvt.js +9104 -0
  83. package/lib/SyntaxHighlight-CJ6FoYvt.js.map +1 -0
  84. package/lib/{Toc-D_tV8_Ri.js → Toc-CzMOgcPS.js} +3 -3
  85. package/lib/{Toc-D_tV8_Ri.js.map → Toc-CzMOgcPS.js.map} +1 -1
  86. package/lib/{chunk-BAXFHI7N-BVBOl9s0.js → chunk-BAXFHI7N-CFrZQ7Oh.js} +257 -264
  87. package/lib/{chunk-BAXFHI7N-BVBOl9s0.js.map → chunk-BAXFHI7N-CFrZQ7Oh.js.map} +1 -1
  88. package/lib/{circular-ByJI6Mci.js → circular-D__GEK2G.js} +47 -47
  89. package/lib/{circular-ByJI6Mci.js.map → circular-D__GEK2G.js.map} +1 -1
  90. package/lib/{cn-qaFjX9_3.js → cn-CwJPJKOE.js} +28 -29
  91. package/lib/{cn-qaFjX9_3.js.map → cn-CwJPJKOE.js.map} +1 -1
  92. package/lib/{createServer-IW7v5hWm.js → createServer-B4l2NSkt.js} +3724 -3868
  93. package/lib/{createServer-IW7v5hWm.js.map → createServer-B4l2NSkt.js.map} +1 -1
  94. package/lib/hook-CyNmcNr8.js +1443 -0
  95. package/lib/{hook-CldJlP5c.js.map → hook-CyNmcNr8.js.map} +1 -1
  96. package/lib/{index-DwT-v3zK.js → index--oeBayMa.js} +2 -2
  97. package/lib/{index-DwT-v3zK.js.map → index--oeBayMa.js.map} +1 -1
  98. package/lib/index-BcMPFdRU.js +4975 -0
  99. package/lib/index-BcMPFdRU.js.map +1 -0
  100. package/lib/{index-LNp6rxyU.js → index-BvvmIczU.js} +2 -2
  101. package/lib/{index-LNp6rxyU.js.map → index-BvvmIczU.js.map} +1 -1
  102. package/lib/{index-Dbvpddzr.js → index-CCS3ifKs.js} +690 -733
  103. package/lib/{index-Dbvpddzr.js.map → index-CCS3ifKs.js.map} +1 -1
  104. package/lib/{index-CuBIgTKC.js → index-CrcNWbel.js} +9 -9
  105. package/lib/{index-CuBIgTKC.js.map → index-CrcNWbel.js.map} +1 -1
  106. package/lib/{index-CPNSgwSb.js → index-Z13x6tPX.js} +5 -5
  107. package/lib/{index-CPNSgwSb.js.map → index-Z13x6tPX.js.map} +1 -1
  108. package/lib/{index-DcHeSvkE.js → index-zddirpDj.js} +581 -609
  109. package/lib/{index-DcHeSvkE.js.map → index-zddirpDj.js.map} +1 -1
  110. package/lib/invariant-D3QcI9fa.js +22 -0
  111. package/lib/{invariant-Caa8-XvF.js.map → invariant-D3QcI9fa.js.map} +1 -1
  112. package/lib/mutation-narTVsCe.js +196 -0
  113. package/lib/{mutation-DBQh7AOZ.js.map → mutation-narTVsCe.js.map} +1 -1
  114. package/lib/processors/removeParameters.js +27 -28
  115. package/lib/processors/removeParameters.js.map +1 -1
  116. package/lib/processors/removePaths.js +17 -17
  117. package/lib/processors/removePaths.js.map +1 -1
  118. package/lib/ui/Accordion.js +1 -1
  119. package/lib/ui/ActionButton.js +2 -2
  120. package/lib/ui/Alert.js +2 -2
  121. package/lib/ui/AlertDialog.js +1 -1
  122. package/lib/ui/Badge.js +2 -2
  123. package/lib/ui/Breadcrumb.js +1 -1
  124. package/lib/ui/Button.js +2 -2
  125. package/lib/ui/Callout.js +7 -7
  126. package/lib/ui/Callout.js.map +1 -1
  127. package/lib/ui/Card.js +1 -1
  128. package/lib/ui/Carousel.js +175 -175
  129. package/lib/ui/Carousel.js.map +1 -1
  130. package/lib/ui/Checkbox.js +1 -1
  131. package/lib/ui/CodeBlock.js +83 -0
  132. package/lib/ui/CodeBlock.js.map +1 -0
  133. package/lib/ui/Command.js +58 -58
  134. package/lib/ui/Command.js.map +1 -1
  135. package/lib/ui/Dialog.js +1 -1
  136. package/lib/ui/Drawer.js +2 -2
  137. package/lib/ui/DropdownMenu.js +1 -1
  138. package/lib/ui/Form.js +1 -1
  139. package/lib/ui/HoverCard.js +1 -1
  140. package/lib/ui/Input.js +1 -1
  141. package/lib/ui/Label.js +2 -2
  142. package/lib/ui/Pagination.js +1 -1
  143. package/lib/ui/Popover.js +1 -1
  144. package/lib/ui/Progress.js +1 -1
  145. package/lib/ui/RadioGroup.js +1 -1
  146. package/lib/ui/ScrollArea.js +1 -1
  147. package/lib/ui/Select.js +1 -1
  148. package/lib/ui/Skeleton.js +1 -1
  149. package/lib/ui/Slider.js +1 -1
  150. package/lib/ui/Switch.js +1 -1
  151. package/lib/ui/SyntaxHighlight.js +4 -6
  152. package/lib/ui/SyntaxHighlight.js.map +1 -1
  153. package/lib/ui/Tabs.js +1 -1
  154. package/lib/ui/Textarea.js +1 -1
  155. package/lib/ui/Toggle.js +2 -2
  156. package/lib/ui/ToggleGroup.js +1 -1
  157. package/lib/ui/Tooltip.js +1 -1
  158. package/lib/ui/util.js +1 -1
  159. package/lib/{useExposedProps-DbIZXspi.js → useExposedProps-n1u49409.js} +2 -2
  160. package/lib/{useExposedProps-DbIZXspi.js.map → useExposedProps-n1u49409.js.map} +1 -1
  161. package/lib/zudoku.auth-auth0.js +28 -31
  162. package/lib/zudoku.auth-auth0.js.map +1 -1
  163. package/lib/zudoku.auth-clerk.js +62 -68
  164. package/lib/zudoku.auth-clerk.js.map +1 -1
  165. package/lib/zudoku.auth-openid.js +475 -483
  166. package/lib/zudoku.auth-openid.js.map +1 -1
  167. package/lib/zudoku.components.js +7 -7
  168. package/lib/zudoku.hooks.js +2 -2
  169. package/lib/zudoku.plugin-api-catalog.js +45 -45
  170. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  171. package/lib/zudoku.plugin-api-keys.js +6 -6
  172. package/lib/zudoku.plugin-custom-pages.js +3 -3
  173. package/lib/zudoku.plugin-markdown.js +25 -28
  174. package/lib/zudoku.plugin-markdown.js.map +1 -1
  175. package/lib/zudoku.plugin-openapi.js +3 -3
  176. package/lib/zudoku.plugin-redirect.js +1 -1
  177. package/lib/zudoku.plugin-search-inkeep.js +26 -27
  178. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  179. package/lib/zudoku.plugin-search-pagefind.js +107 -110
  180. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  181. package/package.json +16 -6
  182. package/src/app/main.css +53 -3
  183. package/src/app/main.tsx +7 -0
  184. package/src/lib/components/BuildCheck.tsx +4 -2
  185. package/src/lib/components/Markdown.tsx +29 -24
  186. package/src/lib/core/ZudokuContext.ts +4 -0
  187. package/src/lib/errors/ErrorAlert.tsx +1 -1
  188. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -2
  189. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  190. package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
  191. package/src/lib/shiki.ts +129 -0
  192. package/src/lib/ui/Callout.tsx +1 -1
  193. package/src/lib/ui/CodeBlock.tsx +102 -0
  194. package/src/lib/ui/SyntaxHighlight.tsx +18 -182
  195. package/src/lib/util/MdxComponents.tsx +27 -14
  196. package/src/shiki/langs/abap.js +1 -0
  197. package/src/shiki/langs/actionscript-3.js +1 -0
  198. package/src/shiki/langs/ada.js +1 -0
  199. package/src/shiki/langs/angular-expression.js +1 -0
  200. package/src/shiki/langs/angular-html.js +1 -0
  201. package/src/shiki/langs/angular-inline-style.js +1 -0
  202. package/src/shiki/langs/angular-inline-template.js +1 -0
  203. package/src/shiki/langs/angular-let-declaration.js +1 -0
  204. package/src/shiki/langs/angular-template-blocks.js +1 -0
  205. package/src/shiki/langs/angular-template.js +1 -0
  206. package/src/shiki/langs/angular-ts.js +1 -0
  207. package/src/shiki/langs/apache.js +1 -0
  208. package/src/shiki/langs/apex.js +1 -0
  209. package/src/shiki/langs/apl.js +1 -0
  210. package/src/shiki/langs/applescript.js +1 -0
  211. package/src/shiki/langs/ara.js +1 -0
  212. package/src/shiki/langs/asciidoc.js +1 -0
  213. package/src/shiki/langs/asm.js +1 -0
  214. package/src/shiki/langs/astro.js +1 -0
  215. package/src/shiki/langs/awk.js +1 -0
  216. package/src/shiki/langs/ballerina.js +1 -0
  217. package/src/shiki/langs/bat.js +1 -0
  218. package/src/shiki/langs/beancount.js +1 -0
  219. package/src/shiki/langs/berry.js +1 -0
  220. package/src/shiki/langs/bibtex.js +1 -0
  221. package/src/shiki/langs/bicep.js +1 -0
  222. package/src/shiki/langs/blade.js +1 -0
  223. package/src/shiki/langs/bsl.js +1 -0
  224. package/src/shiki/langs/c.js +1 -0
  225. package/src/shiki/langs/cadence.js +1 -0
  226. package/src/shiki/langs/cairo.js +1 -0
  227. package/src/shiki/langs/clarity.js +1 -0
  228. package/src/shiki/langs/clojure.js +1 -0
  229. package/src/shiki/langs/cmake.js +1 -0
  230. package/src/shiki/langs/cobol.js +1 -0
  231. package/src/shiki/langs/codeowners.js +1 -0
  232. package/src/shiki/langs/codeql.js +1 -0
  233. package/src/shiki/langs/coffee.js +1 -0
  234. package/src/shiki/langs/common-lisp.js +1 -0
  235. package/src/shiki/langs/coq.js +1 -0
  236. package/src/shiki/langs/cpp-macro.js +1 -0
  237. package/src/shiki/langs/cpp.js +1 -0
  238. package/src/shiki/langs/crystal.js +1 -0
  239. package/src/shiki/langs/csharp.js +1 -0
  240. package/src/shiki/langs/css.js +1 -0
  241. package/src/shiki/langs/csv.js +1 -0
  242. package/src/shiki/langs/cue.js +1 -0
  243. package/src/shiki/langs/cypher.js +1 -0
  244. package/src/shiki/langs/d.js +1 -0
  245. package/src/shiki/langs/dart.js +1 -0
  246. package/src/shiki/langs/dax.js +1 -0
  247. package/src/shiki/langs/desktop.js +1 -0
  248. package/src/shiki/langs/diff.js +1 -0
  249. package/src/shiki/langs/docker.js +1 -0
  250. package/src/shiki/langs/dotenv.js +1 -0
  251. package/src/shiki/langs/dream-maker.js +1 -0
  252. package/src/shiki/langs/edge.js +1 -0
  253. package/src/shiki/langs/elixir.js +1 -0
  254. package/src/shiki/langs/elm.js +1 -0
  255. package/src/shiki/langs/emacs-lisp.js +1 -0
  256. package/src/shiki/langs/erb.js +1 -0
  257. package/src/shiki/langs/erlang.js +1 -0
  258. package/src/shiki/langs/es-tag-css.js +1 -0
  259. package/src/shiki/langs/es-tag-glsl.js +1 -0
  260. package/src/shiki/langs/es-tag-html.js +1 -0
  261. package/src/shiki/langs/es-tag-sql.js +1 -0
  262. package/src/shiki/langs/es-tag-xml.js +1 -0
  263. package/src/shiki/langs/fennel.js +1 -0
  264. package/src/shiki/langs/fish.js +1 -0
  265. package/src/shiki/langs/fluent.js +1 -0
  266. package/src/shiki/langs/fortran-fixed-form.js +1 -0
  267. package/src/shiki/langs/fortran-free-form.js +1 -0
  268. package/src/shiki/langs/fsharp.js +1 -0
  269. package/src/shiki/langs/gdresource.js +1 -0
  270. package/src/shiki/langs/gdscript.js +1 -0
  271. package/src/shiki/langs/gdshader.js +1 -0
  272. package/src/shiki/langs/genie.js +1 -0
  273. package/src/shiki/langs/gherkin.js +1 -0
  274. package/src/shiki/langs/git-commit.js +1 -0
  275. package/src/shiki/langs/git-rebase.js +1 -0
  276. package/src/shiki/langs/gleam.js +1 -0
  277. package/src/shiki/langs/glimmer-js.js +1 -0
  278. package/src/shiki/langs/glimmer-ts.js +1 -0
  279. package/src/shiki/langs/glsl.js +1 -0
  280. package/src/shiki/langs/gnuplot.js +1 -0
  281. package/src/shiki/langs/go.js +1 -0
  282. package/src/shiki/langs/graphql.js +1 -0
  283. package/src/shiki/langs/groovy.js +1 -0
  284. package/src/shiki/langs/hack.js +1 -0
  285. package/src/shiki/langs/haml.js +1 -0
  286. package/src/shiki/langs/handlebars.js +1 -0
  287. package/src/shiki/langs/haskell.js +1 -0
  288. package/src/shiki/langs/haxe.js +1 -0
  289. package/src/shiki/langs/hcl.js +1 -0
  290. package/src/shiki/langs/hjson.js +1 -0
  291. package/src/shiki/langs/hlsl.js +1 -0
  292. package/src/shiki/langs/html-derivative.js +1 -0
  293. package/src/shiki/langs/html.js +1 -0
  294. package/src/shiki/langs/http.js +1 -0
  295. package/src/shiki/langs/hxml.js +1 -0
  296. package/src/shiki/langs/hy.js +1 -0
  297. package/src/shiki/langs/imba.js +1 -0
  298. package/src/shiki/langs/ini.js +1 -0
  299. package/src/shiki/langs/java.js +1 -0
  300. package/src/shiki/langs/javascript.js +1 -0
  301. package/src/shiki/langs/jinja-html.js +1 -0
  302. package/src/shiki/langs/jinja.js +1 -0
  303. package/src/shiki/langs/jison.js +1 -0
  304. package/src/shiki/langs/json.js +1 -0
  305. package/src/shiki/langs/json5.js +1 -0
  306. package/src/shiki/langs/jsonc.js +1 -0
  307. package/src/shiki/langs/jsonl.js +1 -0
  308. package/src/shiki/langs/jsonnet.js +1 -0
  309. package/src/shiki/langs/jssm.js +1 -0
  310. package/src/shiki/langs/jsx.js +1 -0
  311. package/src/shiki/langs/julia.js +1 -0
  312. package/src/shiki/langs/kotlin.js +1 -0
  313. package/src/shiki/langs/kusto.js +1 -0
  314. package/src/shiki/langs/latex.js +1 -0
  315. package/src/shiki/langs/lean.js +1 -0
  316. package/src/shiki/langs/less.js +1 -0
  317. package/src/shiki/langs/liquid.js +1 -0
  318. package/src/shiki/langs/llvm.js +1 -0
  319. package/src/shiki/langs/log.js +1 -0
  320. package/src/shiki/langs/logo.js +1 -0
  321. package/src/shiki/langs/lua.js +1 -0
  322. package/src/shiki/langs/luau.js +1 -0
  323. package/src/shiki/langs/make.js +1 -0
  324. package/src/shiki/langs/markdown-vue.js +1 -0
  325. package/src/shiki/langs/markdown.js +1 -0
  326. package/src/shiki/langs/marko.js +1 -0
  327. package/src/shiki/langs/matlab.js +1 -0
  328. package/src/shiki/langs/mdc.js +1 -0
  329. package/src/shiki/langs/mdx.js +1 -0
  330. package/src/shiki/langs/mermaid.js +1 -0
  331. package/src/shiki/langs/mipsasm.js +1 -0
  332. package/src/shiki/langs/mojo.js +1 -0
  333. package/src/shiki/langs/move.js +1 -0
  334. package/src/shiki/langs/narrat.js +1 -0
  335. package/src/shiki/langs/nextflow.js +1 -0
  336. package/src/shiki/langs/nginx.js +1 -0
  337. package/src/shiki/langs/nim.js +1 -0
  338. package/src/shiki/langs/nix.js +1 -0
  339. package/src/shiki/langs/nushell.js +1 -0
  340. package/src/shiki/langs/objective-c.js +1 -0
  341. package/src/shiki/langs/objective-cpp.js +1 -0
  342. package/src/shiki/langs/ocaml.js +1 -0
  343. package/src/shiki/langs/pascal.js +1 -0
  344. package/src/shiki/langs/perl.js +1 -0
  345. package/src/shiki/langs/php.js +1 -0
  346. package/src/shiki/langs/plsql.js +1 -0
  347. package/src/shiki/langs/po.js +1 -0
  348. package/src/shiki/langs/polar.js +1 -0
  349. package/src/shiki/langs/postcss.js +1 -0
  350. package/src/shiki/langs/powerquery.js +1 -0
  351. package/src/shiki/langs/powershell.js +1 -0
  352. package/src/shiki/langs/prisma.js +1 -0
  353. package/src/shiki/langs/prolog.js +1 -0
  354. package/src/shiki/langs/proto.js +1 -0
  355. package/src/shiki/langs/pug.js +1 -0
  356. package/src/shiki/langs/puppet.js +1 -0
  357. package/src/shiki/langs/purescript.js +1 -0
  358. package/src/shiki/langs/python.js +1 -0
  359. package/src/shiki/langs/qml.js +1 -0
  360. package/src/shiki/langs/qmldir.js +1 -0
  361. package/src/shiki/langs/qss.js +1 -0
  362. package/src/shiki/langs/r.js +1 -0
  363. package/src/shiki/langs/racket.js +1 -0
  364. package/src/shiki/langs/raku.js +1 -0
  365. package/src/shiki/langs/razor.js +1 -0
  366. package/src/shiki/langs/reg.js +1 -0
  367. package/src/shiki/langs/regexp.js +1 -0
  368. package/src/shiki/langs/rel.js +1 -0
  369. package/src/shiki/langs/riscv.js +1 -0
  370. package/src/shiki/langs/rst.js +1 -0
  371. package/src/shiki/langs/ruby.js +1 -0
  372. package/src/shiki/langs/rust.js +1 -0
  373. package/src/shiki/langs/sas.js +1 -0
  374. package/src/shiki/langs/sass.js +1 -0
  375. package/src/shiki/langs/scala.js +1 -0
  376. package/src/shiki/langs/scheme.js +1 -0
  377. package/src/shiki/langs/scss.js +1 -0
  378. package/src/shiki/langs/sdbl.js +1 -0
  379. package/src/shiki/langs/shaderlab.js +1 -0
  380. package/src/shiki/langs/shellscript.js +1 -0
  381. package/src/shiki/langs/shellsession.js +1 -0
  382. package/src/shiki/langs/smalltalk.js +1 -0
  383. package/src/shiki/langs/solidity.js +1 -0
  384. package/src/shiki/langs/soy.js +1 -0
  385. package/src/shiki/langs/sparql.js +1 -0
  386. package/src/shiki/langs/splunk.js +1 -0
  387. package/src/shiki/langs/sql.js +1 -0
  388. package/src/shiki/langs/ssh-config.js +1 -0
  389. package/src/shiki/langs/stata.js +1 -0
  390. package/src/shiki/langs/stylus.js +1 -0
  391. package/src/shiki/langs/svelte.js +1 -0
  392. package/src/shiki/langs/swift.js +1 -0
  393. package/src/shiki/langs/system-verilog.js +1 -0
  394. package/src/shiki/langs/systemd.js +1 -0
  395. package/src/shiki/langs/talonscript.js +1 -0
  396. package/src/shiki/langs/tasl.js +1 -0
  397. package/src/shiki/langs/tcl.js +1 -0
  398. package/src/shiki/langs/templ.js +1 -0
  399. package/src/shiki/langs/terraform.js +1 -0
  400. package/src/shiki/langs/tex.js +1 -0
  401. package/src/shiki/langs/toml.js +1 -0
  402. package/src/shiki/langs/ts-tags.js +1 -0
  403. package/src/shiki/langs/tsv.js +1 -0
  404. package/src/shiki/langs/tsx.js +1 -0
  405. package/src/shiki/langs/turtle.js +1 -0
  406. package/src/shiki/langs/twig.js +1 -0
  407. package/src/shiki/langs/typescript.js +1 -0
  408. package/src/shiki/langs/typespec.js +1 -0
  409. package/src/shiki/langs/typst.js +1 -0
  410. package/src/shiki/langs/v.js +1 -0
  411. package/src/shiki/langs/vala.js +1 -0
  412. package/src/shiki/langs/vb.js +1 -0
  413. package/src/shiki/langs/verilog.js +1 -0
  414. package/src/shiki/langs/vhdl.js +1 -0
  415. package/src/shiki/langs/viml.js +1 -0
  416. package/src/shiki/langs/vue-directives.js +1 -0
  417. package/src/shiki/langs/vue-html.js +1 -0
  418. package/src/shiki/langs/vue-interpolations.js +1 -0
  419. package/src/shiki/langs/vue-sfc-style-variable-injection.js +1 -0
  420. package/src/shiki/langs/vue.js +1 -0
  421. package/src/shiki/langs/vyper.js +1 -0
  422. package/src/shiki/langs/wasm.js +1 -0
  423. package/src/shiki/langs/wenyan.js +1 -0
  424. package/src/shiki/langs/wgsl.js +1 -0
  425. package/src/shiki/langs/wikitext.js +1 -0
  426. package/src/shiki/langs/wit.js +1 -0
  427. package/src/shiki/langs/wolfram.js +1 -0
  428. package/src/shiki/langs/xml.js +1 -0
  429. package/src/shiki/langs/xsl.js +1 -0
  430. package/src/shiki/langs/yaml.js +1 -0
  431. package/src/shiki/langs/zenscript.js +1 -0
  432. package/src/shiki/langs/zig.js +1 -0
  433. package/src/shiki/themes/andromeeda.js +1 -0
  434. package/src/shiki/themes/aurora-x.js +1 -0
  435. package/src/shiki/themes/ayu-dark.js +1 -0
  436. package/src/shiki/themes/catppuccin-frappe.js +1 -0
  437. package/src/shiki/themes/catppuccin-latte.js +1 -0
  438. package/src/shiki/themes/catppuccin-macchiato.js +1 -0
  439. package/src/shiki/themes/catppuccin-mocha.js +1 -0
  440. package/src/shiki/themes/dark-plus.js +1 -0
  441. package/src/shiki/themes/dracula-soft.js +1 -0
  442. package/src/shiki/themes/dracula.js +1 -0
  443. package/src/shiki/themes/everforest-dark.js +1 -0
  444. package/src/shiki/themes/everforest-light.js +1 -0
  445. package/src/shiki/themes/github-dark-default.js +1 -0
  446. package/src/shiki/themes/github-dark-dimmed.js +1 -0
  447. package/src/shiki/themes/github-dark-high-contrast.js +1 -0
  448. package/src/shiki/themes/github-dark.js +1 -0
  449. package/src/shiki/themes/github-light-default.js +1 -0
  450. package/src/shiki/themes/github-light-high-contrast.js +1 -0
  451. package/src/shiki/themes/github-light.js +1 -0
  452. package/src/shiki/themes/gruvbox-dark-hard.js +1 -0
  453. package/src/shiki/themes/gruvbox-dark-medium.js +1 -0
  454. package/src/shiki/themes/gruvbox-dark-soft.js +1 -0
  455. package/src/shiki/themes/gruvbox-light-hard.js +1 -0
  456. package/src/shiki/themes/gruvbox-light-medium.js +1 -0
  457. package/src/shiki/themes/gruvbox-light-soft.js +1 -0
  458. package/src/shiki/themes/houston.js +1 -0
  459. package/src/shiki/themes/kanagawa-dragon.js +1 -0
  460. package/src/shiki/themes/kanagawa-lotus.js +1 -0
  461. package/src/shiki/themes/kanagawa-wave.js +1 -0
  462. package/src/shiki/themes/laserwave.js +1 -0
  463. package/src/shiki/themes/light-plus.js +1 -0
  464. package/src/shiki/themes/material-theme-darker.js +1 -0
  465. package/src/shiki/themes/material-theme-lighter.js +1 -0
  466. package/src/shiki/themes/material-theme-ocean.js +1 -0
  467. package/src/shiki/themes/material-theme-palenight.js +1 -0
  468. package/src/shiki/themes/material-theme.js +1 -0
  469. package/src/shiki/themes/min-dark.js +1 -0
  470. package/src/shiki/themes/min-light.js +1 -0
  471. package/src/shiki/themes/monokai.js +1 -0
  472. package/src/shiki/themes/night-owl.js +1 -0
  473. package/src/shiki/themes/nord.js +1 -0
  474. package/src/shiki/themes/one-dark-pro.js +1 -0
  475. package/src/shiki/themes/one-light.js +1 -0
  476. package/src/shiki/themes/plastic.js +1 -0
  477. package/src/shiki/themes/poimandres.js +1 -0
  478. package/src/shiki/themes/red.js +1 -0
  479. package/src/shiki/themes/rose-pine-dawn.js +1 -0
  480. package/src/shiki/themes/rose-pine-moon.js +1 -0
  481. package/src/shiki/themes/rose-pine.js +1 -0
  482. package/src/shiki/themes/slack-dark.js +1 -0
  483. package/src/shiki/themes/slack-ochin.js +1 -0
  484. package/src/shiki/themes/snazzy-light.js +1 -0
  485. package/src/shiki/themes/solarized-dark.js +1 -0
  486. package/src/shiki/themes/solarized-light.js +1 -0
  487. package/src/shiki/themes/synthwave-84.js +1 -0
  488. package/src/shiki/themes/tokyo-night.js +1 -0
  489. package/src/shiki/themes/vesper.js +1 -0
  490. package/src/shiki/themes/vitesse-black.js +1 -0
  491. package/src/shiki/themes/vitesse-dark.js +1 -0
  492. package/src/shiki/themes/vitesse-light.js +1 -0
  493. package/lib/AuthenticationPlugin-DPCuR3xm.js +0 -58
  494. package/lib/Markdown-mFpg_n9p.js +0 -17125
  495. package/lib/Markdown-mFpg_n9p.js.map +0 -1
  496. package/lib/MdxPage-CH19q_hk.js +0 -85
  497. package/lib/RouteGuard-DRtEu9nh.js +0 -744
  498. package/lib/Select-CT64Ou40.js +0 -223
  499. package/lib/SlotletProvider-CS_nO-XT.js +0 -340
  500. package/lib/SlotletProvider-CS_nO-XT.js.map +0 -1
  501. package/lib/SyntaxHighlight-CxhyyMkF.js +0 -2890
  502. package/lib/SyntaxHighlight-CxhyyMkF.js.map +0 -1
  503. package/lib/hook-CldJlP5c.js +0 -1478
  504. package/lib/index-BeYI7Btu.js +0 -5031
  505. package/lib/index-BeYI7Btu.js.map +0 -1
  506. package/lib/invariant-Caa8-XvF.js +0 -26
  507. package/lib/mutation-DBQh7AOZ.js +0 -211
  508. package/lib/prism-bash.min-HHIMdNJ_.js +0 -7
  509. package/lib/prism-bash.min-HHIMdNJ_.js.map +0 -1
  510. package/lib/prism-csharp.min-C43x1RY2.js +0 -63
  511. package/lib/prism-csharp.min-C43x1RY2.js.map +0 -1
  512. package/lib/prism-java.min-CQzr40NQ.js +0 -35
  513. package/lib/prism-java.min-CQzr40NQ.js.map +0 -1
  514. package/lib/prism-javascript.min-CEqHqgbm.js +0 -9
  515. package/lib/prism-javascript.min-CEqHqgbm.js.map +0 -1
  516. package/lib/prism-json.min-B1GJqK1k.js +0 -2
  517. package/lib/prism-json.min-B1GJqK1k.js.map +0 -1
  518. package/lib/prism-jsstacktrace.min-BfobCF2F.js +0 -2
  519. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +0 -1
  520. package/lib/prism-markdown.min-C0Qn0m-5.js +0 -61
  521. package/lib/prism-markdown.min-C0Qn0m-5.js.map +0 -1
  522. package/lib/prism-markup-BNGj0Tvm.js +0 -174
  523. package/lib/prism-markup-BNGj0Tvm.js.map +0 -1
  524. package/lib/prism-objectivec.min-BXSWqpJJ.js +0 -2
  525. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +0 -1
  526. package/lib/prism-ruby.min-L9OdQ6tU.js +0 -38
  527. package/lib/prism-ruby.min-L9OdQ6tU.js.map +0 -1
  528. package/lib/prism-typescript.min-qTySPvCh.js +0 -34
  529. package/lib/prism-typescript.min-qTySPvCh.js.map +0 -1
@@ -0,0 +1,1443 @@
1
+ import * as S from "react";
2
+ import Y, { createContext as Oe, useContext as Ee } from "react";
3
+ import { j as Ce } from "./jsx-runtime-C5mzlN2N.js";
4
+ import { u as A, m as X } from "./chunk-BAXFHI7N-CFrZQ7Oh.js";
5
+ var $ = class {
6
+ constructor() {
7
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
8
+ }
9
+ subscribe(e) {
10
+ return this.listeners.add(e), this.onSubscribe(), () => {
11
+ this.listeners.delete(e), this.onUnsubscribe();
12
+ };
13
+ }
14
+ hasListeners() {
15
+ return this.listeners.size > 0;
16
+ }
17
+ onSubscribe() {
18
+ }
19
+ onUnsubscribe() {
20
+ }
21
+ }, C = typeof window > "u" || "Deno" in globalThis;
22
+ function q() {
23
+ }
24
+ function mt(e, t) {
25
+ return typeof e == "function" ? e(t) : e;
26
+ }
27
+ function U(e) {
28
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
29
+ }
30
+ function ue(e, t) {
31
+ return Math.max(e + (t || 0) - Date.now(), 0);
32
+ }
33
+ function k(e, t) {
34
+ return typeof e == "function" ? e(t) : e;
35
+ }
36
+ function w(e, t) {
37
+ return typeof e == "function" ? e(t) : e;
38
+ }
39
+ function gt(e, t) {
40
+ const {
41
+ type: s = "all",
42
+ exact: r,
43
+ fetchStatus: n,
44
+ predicate: o,
45
+ queryKey: a,
46
+ stale: i
47
+ } = e;
48
+ if (a) {
49
+ if (r) {
50
+ if (t.queryHash !== Fe(a, t.options))
51
+ return !1;
52
+ } else if (!G(t.queryKey, a))
53
+ return !1;
54
+ }
55
+ if (s !== "all") {
56
+ const u = t.isActive();
57
+ if (s === "active" && !u || s === "inactive" && u)
58
+ return !1;
59
+ }
60
+ return !(typeof i == "boolean" && t.isStale() !== i || n && n !== t.state.fetchStatus || o && !o(t));
61
+ }
62
+ function St(e, t) {
63
+ const { exact: s, status: r, predicate: n, mutationKey: o } = e;
64
+ if (o) {
65
+ if (!t.options.mutationKey)
66
+ return !1;
67
+ if (s) {
68
+ if (Q(t.options.mutationKey) !== Q(o))
69
+ return !1;
70
+ } else if (!G(t.options.mutationKey, o))
71
+ return !1;
72
+ }
73
+ return !(r && t.state.status !== r || n && !n(t));
74
+ }
75
+ function Fe(e, t) {
76
+ return (t?.queryKeyHashFn || Q)(e);
77
+ }
78
+ function Q(e) {
79
+ return JSON.stringify(
80
+ e,
81
+ (t, s) => M(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
82
+ );
83
+ }
84
+ function G(e, t) {
85
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => G(e[s], t[s])) : !1;
86
+ }
87
+ function N(e, t) {
88
+ if (e === t)
89
+ return e;
90
+ const s = ee(e) && ee(t);
91
+ if (s || M(e) && M(t)) {
92
+ const r = s ? e : Object.keys(e), n = r.length, o = s ? t : Object.keys(t), a = o.length, i = s ? [] : {};
93
+ let u = 0;
94
+ for (let l = 0; l < a; l++) {
95
+ const h = s ? l : o[l];
96
+ (!s && r.includes(h) || s) && e[h] === void 0 && t[h] === void 0 ? (i[h] = void 0, u++) : (i[h] = N(e[h], t[h]), i[h] === e[h] && e[h] !== void 0 && u++);
97
+ }
98
+ return n === a && u === n ? e : i;
99
+ }
100
+ return t;
101
+ }
102
+ function L(e, t) {
103
+ if (!t || Object.keys(e).length !== Object.keys(t).length)
104
+ return !1;
105
+ for (const s in e)
106
+ if (e[s] !== t[s])
107
+ return !1;
108
+ return !0;
109
+ }
110
+ function ee(e) {
111
+ return Array.isArray(e) && e.length === Object.keys(e).length;
112
+ }
113
+ function M(e) {
114
+ if (!te(e))
115
+ return !1;
116
+ const t = e.constructor;
117
+ if (t === void 0)
118
+ return !0;
119
+ const s = t.prototype;
120
+ return !(!te(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
121
+ }
122
+ function te(e) {
123
+ return Object.prototype.toString.call(e) === "[object Object]";
124
+ }
125
+ function Ie(e) {
126
+ return new Promise((t) => {
127
+ setTimeout(t, e);
128
+ });
129
+ }
130
+ function _(e, t, s) {
131
+ if (typeof s.structuralSharing == "function")
132
+ return s.structuralSharing(e, t);
133
+ if (s.structuralSharing !== !1) {
134
+ if (process.env.NODE_ENV !== "production")
135
+ try {
136
+ return N(e, t);
137
+ } catch (r) {
138
+ throw console.error(
139
+ `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}`
140
+ ), r;
141
+ }
142
+ return N(e, t);
143
+ }
144
+ return t;
145
+ }
146
+ function wt(e) {
147
+ return e;
148
+ }
149
+ function Rt(e, t, s = 0) {
150
+ const r = [...e, t];
151
+ return s && r.length > s ? r.slice(1) : r;
152
+ }
153
+ function Ot(e, t, s = 0) {
154
+ const r = [t, ...e];
155
+ return s && r.length > s ? r.slice(0, -1) : r;
156
+ }
157
+ var j = Symbol();
158
+ function Pe(e, t) {
159
+ return process.env.NODE_ENV !== "production" && e.queryFn === j && console.error(
160
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
161
+ ), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === j ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
162
+ }
163
+ var Te = class extends $ {
164
+ #t;
165
+ #e;
166
+ #s;
167
+ constructor() {
168
+ super(), this.#s = (e) => {
169
+ if (!C && window.addEventListener) {
170
+ const t = () => e();
171
+ return window.addEventListener("visibilitychange", t, !1), () => {
172
+ window.removeEventListener("visibilitychange", t);
173
+ };
174
+ }
175
+ };
176
+ }
177
+ onSubscribe() {
178
+ this.#e || this.setEventListener(this.#s);
179
+ }
180
+ onUnsubscribe() {
181
+ this.hasListeners() || (this.#e?.(), this.#e = void 0);
182
+ }
183
+ setEventListener(e) {
184
+ this.#s = e, this.#e?.(), this.#e = e((t) => {
185
+ typeof t == "boolean" ? this.setFocused(t) : this.onFocus();
186
+ });
187
+ }
188
+ setFocused(e) {
189
+ this.#t !== e && (this.#t = e, this.onFocus());
190
+ }
191
+ onFocus() {
192
+ const e = this.isFocused();
193
+ this.listeners.forEach((t) => {
194
+ t(e);
195
+ });
196
+ }
197
+ isFocused() {
198
+ return typeof this.#t == "boolean" ? this.#t : globalThis.document?.visibilityState !== "hidden";
199
+ }
200
+ }, ce = new Te(), De = class extends $ {
201
+ #t = !0;
202
+ #e;
203
+ #s;
204
+ constructor() {
205
+ super(), this.#s = (e) => {
206
+ if (!C && window.addEventListener) {
207
+ const t = () => e(!0), s = () => e(!1);
208
+ return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
209
+ window.removeEventListener("online", t), window.removeEventListener("offline", s);
210
+ };
211
+ }
212
+ };
213
+ }
214
+ onSubscribe() {
215
+ this.#e || this.setEventListener(this.#s);
216
+ }
217
+ onUnsubscribe() {
218
+ this.hasListeners() || (this.#e?.(), this.#e = void 0);
219
+ }
220
+ setEventListener(e) {
221
+ this.#s = e, this.#e?.(), this.#e = e(this.setOnline.bind(this));
222
+ }
223
+ setOnline(e) {
224
+ this.#t !== e && (this.#t = e, this.listeners.forEach((s) => {
225
+ s(e);
226
+ }));
227
+ }
228
+ isOnline() {
229
+ return this.#t;
230
+ }
231
+ }, he = new De();
232
+ function H() {
233
+ let e, t;
234
+ const s = new Promise((n, o) => {
235
+ e = n, t = o;
236
+ });
237
+ s.status = "pending", s.catch(() => {
238
+ });
239
+ function r(n) {
240
+ Object.assign(s, n), delete s.resolve, delete s.reject;
241
+ }
242
+ return s.resolve = (n) => {
243
+ r({
244
+ status: "fulfilled",
245
+ value: n
246
+ }), e(n);
247
+ }, s.reject = (n) => {
248
+ r({
249
+ status: "rejected",
250
+ reason: n
251
+ }), t(n);
252
+ }, s;
253
+ }
254
+ function ke(e) {
255
+ return Math.min(1e3 * 2 ** e, 3e4);
256
+ }
257
+ function le(e) {
258
+ return (e ?? "online") === "online" ? he.isOnline() : !0;
259
+ }
260
+ var de = class extends Error {
261
+ constructor(e) {
262
+ super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
263
+ }
264
+ };
265
+ function x(e) {
266
+ return e instanceof de;
267
+ }
268
+ function je(e) {
269
+ let t = !1, s = 0, r = !1, n;
270
+ const o = H(), a = (c) => {
271
+ r || (d(new de(c)), e.abort?.());
272
+ }, i = () => {
273
+ t = !0;
274
+ }, u = () => {
275
+ t = !1;
276
+ }, l = () => ce.isFocused() && (e.networkMode === "always" || he.isOnline()) && e.canRun(), h = () => le(e.networkMode) && e.canRun(), p = (c) => {
277
+ r || (r = !0, e.onSuccess?.(c), n?.(), o.resolve(c));
278
+ }, d = (c) => {
279
+ r || (r = !0, e.onError?.(c), n?.(), o.reject(c));
280
+ }, b = () => new Promise((c) => {
281
+ n = (m) => {
282
+ (r || l()) && c(m);
283
+ }, e.onPause?.();
284
+ }).then(() => {
285
+ n = void 0, r || e.onContinue?.();
286
+ }), O = () => {
287
+ if (r)
288
+ return;
289
+ let c;
290
+ const m = s === 0 ? e.initialPromise : void 0;
291
+ try {
292
+ c = m ?? e.fn();
293
+ } catch (v) {
294
+ c = Promise.reject(v);
295
+ }
296
+ Promise.resolve(c).then(p).catch((v) => {
297
+ if (r)
298
+ return;
299
+ const f = e.retry ?? (C ? 0 : 3), y = e.retryDelay ?? ke, E = typeof y == "function" ? y(s, v) : y, F = f === !0 || typeof f == "number" && s < f || typeof f == "function" && f(s, v);
300
+ if (t || !F) {
301
+ d(v);
302
+ return;
303
+ }
304
+ s++, e.onFail?.(s, v), Ie(E).then(() => l() ? void 0 : b()).then(() => {
305
+ t ? d(v) : O();
306
+ });
307
+ });
308
+ };
309
+ return {
310
+ promise: o,
311
+ cancel: a,
312
+ continue: () => (n?.(), o),
313
+ cancelRetry: i,
314
+ continueRetry: u,
315
+ canStart: h,
316
+ start: () => (h() ? O() : b().then(O), o)
317
+ };
318
+ }
319
+ var Ae = (e) => setTimeout(e, 0);
320
+ function xe() {
321
+ let e = [], t = 0, s = (i) => {
322
+ i();
323
+ }, r = (i) => {
324
+ i();
325
+ }, n = Ae;
326
+ const o = (i) => {
327
+ t ? e.push(i) : n(() => {
328
+ s(i);
329
+ });
330
+ }, a = () => {
331
+ const i = e;
332
+ e = [], i.length && n(() => {
333
+ r(() => {
334
+ i.forEach((u) => {
335
+ s(u);
336
+ });
337
+ });
338
+ });
339
+ };
340
+ return {
341
+ batch: (i) => {
342
+ let u;
343
+ t++;
344
+ try {
345
+ u = i();
346
+ } finally {
347
+ t--, t || a();
348
+ }
349
+ return u;
350
+ },
351
+ /**
352
+ * All calls to the wrapped function will be batched.
353
+ */
354
+ batchCalls: (i) => (...u) => {
355
+ o(() => {
356
+ i(...u);
357
+ });
358
+ },
359
+ schedule: o,
360
+ /**
361
+ * Use this method to set a custom notify function.
362
+ * This can be used to for example wrap notifications with `React.act` while running tests.
363
+ */
364
+ setNotifyFunction: (i) => {
365
+ s = i;
366
+ },
367
+ /**
368
+ * Use this method to set a custom function to batch notifications together into a single tick.
369
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
370
+ */
371
+ setBatchNotifyFunction: (i) => {
372
+ r = i;
373
+ },
374
+ setScheduler: (i) => {
375
+ n = i;
376
+ }
377
+ };
378
+ }
379
+ var z = xe(), qe = class {
380
+ #t;
381
+ destroy() {
382
+ this.clearGcTimeout();
383
+ }
384
+ scheduleGc() {
385
+ this.clearGcTimeout(), U(this.gcTime) && (this.#t = setTimeout(() => {
386
+ this.optionalRemove();
387
+ }, this.gcTime));
388
+ }
389
+ updateGcTime(e) {
390
+ this.gcTime = Math.max(
391
+ this.gcTime || 0,
392
+ e ?? (C ? 1 / 0 : 5 * 60 * 1e3)
393
+ );
394
+ }
395
+ clearGcTimeout() {
396
+ this.#t && (clearTimeout(this.#t), this.#t = void 0);
397
+ }
398
+ }, Et = class extends qe {
399
+ #t;
400
+ #e;
401
+ #s;
402
+ #n;
403
+ #r;
404
+ #a;
405
+ #o;
406
+ constructor(e) {
407
+ super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#n = e.client, this.#s = this.#n.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = Ue(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
408
+ }
409
+ get meta() {
410
+ return this.options.meta;
411
+ }
412
+ get promise() {
413
+ return this.#r?.promise;
414
+ }
415
+ setOptions(e) {
416
+ this.options = { ...this.#a, ...e }, this.updateGcTime(this.options.gcTime);
417
+ }
418
+ optionalRemove() {
419
+ !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
420
+ }
421
+ setData(e, t) {
422
+ const s = _(this.state.data, e, this.options);
423
+ return this.#i({
424
+ data: s,
425
+ type: "success",
426
+ dataUpdatedAt: t?.updatedAt,
427
+ manual: t?.manual
428
+ }), s;
429
+ }
430
+ setState(e, t) {
431
+ this.#i({ type: "setState", state: e, setStateOptions: t });
432
+ }
433
+ cancel(e) {
434
+ const t = this.#r?.promise;
435
+ return this.#r?.cancel(e), t ? t.then(q).catch(q) : Promise.resolve();
436
+ }
437
+ destroy() {
438
+ super.destroy(), this.cancel({ silent: !0 });
439
+ }
440
+ reset() {
441
+ this.destroy(), this.setState(this.#t);
442
+ }
443
+ isActive() {
444
+ return this.observers.some(
445
+ (e) => w(e.options.enabled, this) !== !1
446
+ );
447
+ }
448
+ isDisabled() {
449
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === j || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
450
+ }
451
+ isStale() {
452
+ return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
453
+ (e) => e.getCurrentResult().isStale
454
+ ) : this.state.data === void 0;
455
+ }
456
+ isStaleByTime(e = 0) {
457
+ return this.state.isInvalidated || this.state.data === void 0 || !ue(this.state.dataUpdatedAt, e);
458
+ }
459
+ onFocus() {
460
+ this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
461
+ }
462
+ onOnline() {
463
+ this.observers.find((t) => t.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
464
+ }
465
+ addObserver(e) {
466
+ this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: e }));
467
+ }
468
+ removeObserver(e) {
469
+ this.observers.includes(e) && (this.observers = this.observers.filter((t) => t !== e), this.observers.length || (this.#r && (this.#o ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: e }));
470
+ }
471
+ getObserversCount() {
472
+ return this.observers.length;
473
+ }
474
+ invalidate() {
475
+ this.state.isInvalidated || this.#i({ type: "invalidate" });
476
+ }
477
+ fetch(e, t) {
478
+ if (this.state.fetchStatus !== "idle") {
479
+ if (this.state.data !== void 0 && t?.cancelRefetch)
480
+ this.cancel({ silent: !0 });
481
+ else if (this.#r)
482
+ return this.#r.continueRetry(), this.#r.promise;
483
+ }
484
+ if (e && this.setOptions(e), !this.options.queryFn) {
485
+ const i = this.observers.find((u) => u.options.queryFn);
486
+ i && this.setOptions(i.options);
487
+ }
488
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
489
+ "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']"
490
+ ));
491
+ const s = new AbortController(), r = (i) => {
492
+ Object.defineProperty(i, "signal", {
493
+ enumerable: !0,
494
+ get: () => (this.#o = !0, s.signal)
495
+ });
496
+ }, n = () => {
497
+ const i = Pe(this.options, t), u = {
498
+ client: this.#n,
499
+ queryKey: this.queryKey,
500
+ meta: this.meta
501
+ };
502
+ return r(u), this.#o = !1, this.options.persister ? this.options.persister(
503
+ i,
504
+ u,
505
+ this
506
+ ) : i(u);
507
+ }, o = {
508
+ fetchOptions: t,
509
+ options: this.options,
510
+ queryKey: this.queryKey,
511
+ client: this.#n,
512
+ state: this.state,
513
+ fetchFn: n
514
+ };
515
+ r(o), this.options.behavior?.onFetch(
516
+ o,
517
+ this
518
+ ), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta });
519
+ const a = (i) => {
520
+ x(i) && i.silent || this.#i({
521
+ type: "error",
522
+ error: i
523
+ }), x(i) || (this.#s.config.onError?.(
524
+ i,
525
+ this
526
+ ), this.#s.config.onSettled?.(
527
+ this.state.data,
528
+ i,
529
+ this
530
+ )), this.scheduleGc();
531
+ };
532
+ return this.#r = je({
533
+ initialPromise: t?.initialPromise,
534
+ fn: o.fetchFn,
535
+ abort: s.abort.bind(s),
536
+ onSuccess: (i) => {
537
+ if (i === void 0) {
538
+ process.env.NODE_ENV !== "production" && console.error(
539
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
540
+ ), a(new Error(`${this.queryHash} data is undefined`));
541
+ return;
542
+ }
543
+ try {
544
+ this.setData(i);
545
+ } catch (u) {
546
+ a(u);
547
+ return;
548
+ }
549
+ this.#s.config.onSuccess?.(i, this), this.#s.config.onSettled?.(
550
+ i,
551
+ this.state.error,
552
+ this
553
+ ), this.scheduleGc();
554
+ },
555
+ onError: a,
556
+ onFail: (i, u) => {
557
+ this.#i({ type: "failed", failureCount: i, error: u });
558
+ },
559
+ onPause: () => {
560
+ this.#i({ type: "pause" });
561
+ },
562
+ onContinue: () => {
563
+ this.#i({ type: "continue" });
564
+ },
565
+ retry: o.options.retry,
566
+ retryDelay: o.options.retryDelay,
567
+ networkMode: o.options.networkMode,
568
+ canRun: () => !0
569
+ }), this.#r.start();
570
+ }
571
+ #i(e) {
572
+ const t = (s) => {
573
+ switch (e.type) {
574
+ case "failed":
575
+ return {
576
+ ...s,
577
+ fetchFailureCount: e.failureCount,
578
+ fetchFailureReason: e.error
579
+ };
580
+ case "pause":
581
+ return {
582
+ ...s,
583
+ fetchStatus: "paused"
584
+ };
585
+ case "continue":
586
+ return {
587
+ ...s,
588
+ fetchStatus: "fetching"
589
+ };
590
+ case "fetch":
591
+ return {
592
+ ...s,
593
+ ...fe(s.data, this.options),
594
+ fetchMeta: e.meta ?? null
595
+ };
596
+ case "success":
597
+ return {
598
+ ...s,
599
+ data: e.data,
600
+ dataUpdateCount: s.dataUpdateCount + 1,
601
+ dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
602
+ error: null,
603
+ isInvalidated: !1,
604
+ status: "success",
605
+ ...!e.manual && {
606
+ fetchStatus: "idle",
607
+ fetchFailureCount: 0,
608
+ fetchFailureReason: null
609
+ }
610
+ };
611
+ case "error":
612
+ const r = e.error;
613
+ return x(r) && r.revert && this.#e ? { ...this.#e, fetchStatus: "idle" } : {
614
+ ...s,
615
+ error: r,
616
+ errorUpdateCount: s.errorUpdateCount + 1,
617
+ errorUpdatedAt: Date.now(),
618
+ fetchFailureCount: s.fetchFailureCount + 1,
619
+ fetchFailureReason: r,
620
+ fetchStatus: "idle",
621
+ status: "error"
622
+ };
623
+ case "invalidate":
624
+ return {
625
+ ...s,
626
+ isInvalidated: !0
627
+ };
628
+ case "setState":
629
+ return {
630
+ ...s,
631
+ ...e.state
632
+ };
633
+ }
634
+ };
635
+ this.state = t(this.state), z.batch(() => {
636
+ this.observers.forEach((s) => {
637
+ s.onQueryUpdate();
638
+ }), this.#s.notify({ query: this, type: "updated", action: e });
639
+ });
640
+ }
641
+ };
642
+ function fe(e, t) {
643
+ return {
644
+ fetchFailureCount: 0,
645
+ fetchFailureReason: null,
646
+ fetchStatus: le(t.networkMode) ? "fetching" : "paused",
647
+ ...e === void 0 && {
648
+ error: null,
649
+ status: "pending"
650
+ }
651
+ };
652
+ }
653
+ function Ue(e) {
654
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
655
+ return {
656
+ data: t,
657
+ dataUpdateCount: 0,
658
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
659
+ error: null,
660
+ errorUpdateCount: 0,
661
+ errorUpdatedAt: 0,
662
+ fetchFailureCount: 0,
663
+ fetchFailureReason: null,
664
+ fetchMeta: null,
665
+ isInvalidated: !1,
666
+ status: s ? "success" : "pending",
667
+ fetchStatus: "idle"
668
+ };
669
+ }
670
+ var pe = class extends $ {
671
+ constructor(e, t) {
672
+ super(), this.options = t, this.#t = e, this.#i = null, this.#o = H(), this.options.experimental_prefetchInRender || this.#o.reject(
673
+ new Error("experimental_prefetchInRender feature flag is not enabled")
674
+ ), this.bindMethods(), this.setOptions(t);
675
+ }
676
+ #t;
677
+ #e = void 0;
678
+ #s = void 0;
679
+ #n = void 0;
680
+ #r;
681
+ #a;
682
+ #o;
683
+ #i;
684
+ #y;
685
+ #d;
686
+ // This property keeps track of the last query with defined data.
687
+ // It will be used to pass the previous data and query to the placeholder function between renders.
688
+ #f;
689
+ #c;
690
+ #h;
691
+ #u;
692
+ #p = /* @__PURE__ */ new Set();
693
+ bindMethods() {
694
+ this.refetch = this.refetch.bind(this);
695
+ }
696
+ onSubscribe() {
697
+ this.listeners.size === 1 && (this.#e.addObserver(this), se(this.#e, this.options) ? this.#l() : this.updateResult(), this.#g());
698
+ }
699
+ onUnsubscribe() {
700
+ this.hasListeners() || this.destroy();
701
+ }
702
+ shouldFetchOnReconnect() {
703
+ return K(
704
+ this.#e,
705
+ this.options,
706
+ this.options.refetchOnReconnect
707
+ );
708
+ }
709
+ shouldFetchOnWindowFocus() {
710
+ return K(
711
+ this.#e,
712
+ this.options,
713
+ this.options.refetchOnWindowFocus
714
+ );
715
+ }
716
+ destroy() {
717
+ this.listeners = /* @__PURE__ */ new Set(), this.#S(), this.#w(), this.#e.removeObserver(this);
718
+ }
719
+ setOptions(e) {
720
+ const t = this.options, s = this.#e;
721
+ if (this.options = this.#t.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof w(this.options.enabled, this.#e) != "boolean")
722
+ throw new Error(
723
+ "Expected enabled to be a boolean or a callback that returns a boolean"
724
+ );
725
+ this.#R(), this.#e.setOptions(this.options), t._defaulted && !L(this.options, t) && this.#t.getQueryCache().notify({
726
+ type: "observerOptionsUpdated",
727
+ query: this.#e,
728
+ observer: this
729
+ });
730
+ const r = this.hasListeners();
731
+ r && re(
732
+ this.#e,
733
+ s,
734
+ this.options,
735
+ t
736
+ ) && this.#l(), this.updateResult(), r && (this.#e !== s || w(this.options.enabled, this.#e) !== w(t.enabled, this.#e) || k(this.options.staleTime, this.#e) !== k(t.staleTime, this.#e)) && this.#v();
737
+ const n = this.#b();
738
+ r && (this.#e !== s || w(this.options.enabled, this.#e) !== w(t.enabled, this.#e) || n !== this.#u) && this.#m(n);
739
+ }
740
+ getOptimisticResult(e) {
741
+ const t = this.#t.getQueryCache().build(this.#t, e), s = this.createResult(t, e);
742
+ return Ne(this, s) && (this.#n = s, this.#a = this.options, this.#r = this.#e.state), s;
743
+ }
744
+ getCurrentResult() {
745
+ return this.#n;
746
+ }
747
+ trackResult(e, t) {
748
+ const s = {};
749
+ return Object.keys(e).forEach((r) => {
750
+ Object.defineProperty(s, r, {
751
+ configurable: !1,
752
+ enumerable: !0,
753
+ get: () => (this.trackProp(r), t?.(r), e[r])
754
+ });
755
+ }), s;
756
+ }
757
+ trackProp(e) {
758
+ this.#p.add(e);
759
+ }
760
+ getCurrentQuery() {
761
+ return this.#e;
762
+ }
763
+ refetch({ ...e } = {}) {
764
+ return this.fetch({
765
+ ...e
766
+ });
767
+ }
768
+ fetchOptimistic(e) {
769
+ const t = this.#t.defaultQueryOptions(e), s = this.#t.getQueryCache().build(this.#t, t);
770
+ return s.fetch().then(() => this.createResult(s, t));
771
+ }
772
+ fetch(e) {
773
+ return this.#l({
774
+ ...e,
775
+ cancelRefetch: e.cancelRefetch ?? !0
776
+ }).then(() => (this.updateResult(), this.#n));
777
+ }
778
+ #l(e) {
779
+ this.#R();
780
+ let t = this.#e.fetch(
781
+ this.options,
782
+ e
783
+ );
784
+ return e?.throwOnError || (t = t.catch(q)), t;
785
+ }
786
+ #v() {
787
+ this.#S();
788
+ const e = k(
789
+ this.options.staleTime,
790
+ this.#e
791
+ );
792
+ if (C || this.#n.isStale || !U(e))
793
+ return;
794
+ const s = ue(this.#n.dataUpdatedAt, e) + 1;
795
+ this.#c = setTimeout(() => {
796
+ this.#n.isStale || this.updateResult();
797
+ }, s);
798
+ }
799
+ #b() {
800
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
801
+ }
802
+ #m(e) {
803
+ this.#w(), this.#u = e, !(C || w(this.options.enabled, this.#e) === !1 || !U(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
804
+ (this.options.refetchIntervalInBackground || ce.isFocused()) && this.#l();
805
+ }, this.#u));
806
+ }
807
+ #g() {
808
+ this.#v(), this.#m(this.#b());
809
+ }
810
+ #S() {
811
+ this.#c && (clearTimeout(this.#c), this.#c = void 0);
812
+ }
813
+ #w() {
814
+ this.#h && (clearInterval(this.#h), this.#h = void 0);
815
+ }
816
+ createResult(e, t) {
817
+ const s = this.#e, r = this.options, n = this.#n, o = this.#r, a = this.#a, u = e !== s ? e.state : this.#s, { state: l } = e;
818
+ let h = { ...l }, p = !1, d;
819
+ if (t._optimisticResults) {
820
+ const g = this.hasListeners(), T = !g && se(e, t), I = g && re(e, s, t, r);
821
+ (T || I) && (h = {
822
+ ...h,
823
+ ...fe(l.data, e.options)
824
+ }), t._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
825
+ }
826
+ let { error: b, errorUpdatedAt: O, status: c } = h;
827
+ d = h.data;
828
+ let m = !1;
829
+ if (t.placeholderData !== void 0 && d === void 0 && c === "pending") {
830
+ let g;
831
+ n?.isPlaceholderData && t.placeholderData === a?.placeholderData ? (g = n.data, m = !0) : g = typeof t.placeholderData == "function" ? t.placeholderData(
832
+ this.#f?.state.data,
833
+ this.#f
834
+ ) : t.placeholderData, g !== void 0 && (c = "success", d = _(
835
+ n?.data,
836
+ g,
837
+ t
838
+ ), p = !0);
839
+ }
840
+ if (t.select && d !== void 0 && !m)
841
+ if (n && d === o?.data && t.select === this.#y)
842
+ d = this.#d;
843
+ else
844
+ try {
845
+ this.#y = t.select, d = t.select(d), d = _(n?.data, d, t), this.#d = d, this.#i = null;
846
+ } catch (g) {
847
+ this.#i = g;
848
+ }
849
+ this.#i && (b = this.#i, d = this.#d, O = Date.now(), c = "error");
850
+ const v = h.fetchStatus === "fetching", f = c === "pending", y = c === "error", E = f && v, F = d !== void 0, R = {
851
+ status: c,
852
+ fetchStatus: h.fetchStatus,
853
+ isPending: f,
854
+ isSuccess: c === "success",
855
+ isError: y,
856
+ isInitialLoading: E,
857
+ isLoading: E,
858
+ data: d,
859
+ dataUpdatedAt: h.dataUpdatedAt,
860
+ error: b,
861
+ errorUpdatedAt: O,
862
+ failureCount: h.fetchFailureCount,
863
+ failureReason: h.fetchFailureReason,
864
+ errorUpdateCount: h.errorUpdateCount,
865
+ isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
866
+ isFetchedAfterMount: h.dataUpdateCount > u.dataUpdateCount || h.errorUpdateCount > u.errorUpdateCount,
867
+ isFetching: v,
868
+ isRefetching: v && !f,
869
+ isLoadingError: y && !F,
870
+ isPaused: h.fetchStatus === "paused",
871
+ isPlaceholderData: p,
872
+ isRefetchError: y && F,
873
+ isStale: V(e, t),
874
+ refetch: this.refetch,
875
+ promise: this.#o
876
+ };
877
+ if (this.options.experimental_prefetchInRender) {
878
+ const g = (D) => {
879
+ R.status === "error" ? D.reject(R.error) : R.data !== void 0 && D.resolve(R.data);
880
+ }, T = () => {
881
+ const D = this.#o = R.promise = H();
882
+ g(D);
883
+ }, I = this.#o;
884
+ switch (I.status) {
885
+ case "pending":
886
+ e.queryHash === s.queryHash && g(I);
887
+ break;
888
+ case "fulfilled":
889
+ (R.status === "error" || R.data !== I.value) && T();
890
+ break;
891
+ case "rejected":
892
+ (R.status !== "error" || R.error !== I.reason) && T();
893
+ break;
894
+ }
895
+ }
896
+ return R;
897
+ }
898
+ updateResult() {
899
+ const e = this.#n, t = this.createResult(this.#e, this.options);
900
+ if (this.#r = this.#e.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#e), L(t, e))
901
+ return;
902
+ this.#n = t;
903
+ const s = () => {
904
+ if (!e)
905
+ return !0;
906
+ const { notifyOnChangeProps: r } = this.options, n = typeof r == "function" ? r() : r;
907
+ if (n === "all" || !n && !this.#p.size)
908
+ return !0;
909
+ const o = new Set(
910
+ n ?? this.#p
911
+ );
912
+ return this.options.throwOnError && o.add("error"), Object.keys(this.#n).some((a) => {
913
+ const i = a;
914
+ return this.#n[i] !== e[i] && o.has(i);
915
+ });
916
+ };
917
+ this.#O({ listeners: s() });
918
+ }
919
+ #R() {
920
+ const e = this.#t.getQueryCache().build(this.#t, this.options);
921
+ if (e === this.#e)
922
+ return;
923
+ const t = this.#e;
924
+ this.#e = e, this.#s = e.state, this.hasListeners() && (t?.removeObserver(this), e.addObserver(this));
925
+ }
926
+ onQueryUpdate() {
927
+ this.updateResult(), this.hasListeners() && this.#g();
928
+ }
929
+ #O(e) {
930
+ z.batch(() => {
931
+ e.listeners && this.listeners.forEach((t) => {
932
+ t(this.#n);
933
+ }), this.#t.getQueryCache().notify({
934
+ query: this.#e,
935
+ type: "observerResultsUpdated"
936
+ });
937
+ });
938
+ }
939
+ };
940
+ function Qe(e, t) {
941
+ return w(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
942
+ }
943
+ function se(e, t) {
944
+ return Qe(e, t) || e.state.data !== void 0 && K(e, t, t.refetchOnMount);
945
+ }
946
+ function K(e, t, s) {
947
+ if (w(t.enabled, e) !== !1) {
948
+ const r = typeof s == "function" ? s(e) : s;
949
+ return r === "always" || r !== !1 && V(e, t);
950
+ }
951
+ return !1;
952
+ }
953
+ function re(e, t, s, r) {
954
+ return (e !== t || w(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && V(e, s);
955
+ }
956
+ function V(e, t) {
957
+ return w(t.enabled, e) !== !1 && e.isStaleByTime(k(t.staleTime, e));
958
+ }
959
+ function Ne(e, t) {
960
+ return !L(e.getCurrentResult(), t);
961
+ }
962
+ var ye = S.createContext(
963
+ void 0
964
+ ), ve = (e) => {
965
+ const t = S.useContext(ye);
966
+ if (e)
967
+ return e;
968
+ if (!t)
969
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
970
+ return t;
971
+ }, Ct = ({
972
+ client: e,
973
+ children: t
974
+ }) => (S.useEffect(() => (e.mount(), () => {
975
+ e.unmount();
976
+ }), [e]), /* @__PURE__ */ Ce.jsx(ye.Provider, { value: e, children: t })), be = S.createContext(!1), Le = () => S.useContext(be);
977
+ be.Provider;
978
+ function Me() {
979
+ let e = !1;
980
+ return {
981
+ clearReset: () => {
982
+ e = !1;
983
+ },
984
+ reset: () => {
985
+ e = !0;
986
+ },
987
+ isReset: () => e
988
+ };
989
+ }
990
+ var _e = S.createContext(Me()), He = () => S.useContext(_e);
991
+ function Ke(e, t) {
992
+ return typeof e == "function" ? e(...t) : !!e;
993
+ }
994
+ function ne() {
995
+ }
996
+ var Be = (e, t) => {
997
+ (e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
998
+ }, $e = (e) => {
999
+ S.useEffect(() => {
1000
+ e.clearReset();
1001
+ }, [e]);
1002
+ }, Ge = ({
1003
+ result: e,
1004
+ errorResetBoundary: t,
1005
+ throwOnError: s,
1006
+ query: r,
1007
+ suspense: n
1008
+ }) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || Ke(s, [e.error, r])), ze = (e, t) => t.state.data === void 0, Ve = (e) => {
1009
+ const t = e.staleTime;
1010
+ e.suspense && (e.staleTime = typeof t == "function" ? (...s) => Math.max(t(...s), 1e3) : Math.max(t ?? 1e3, 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
1011
+ }, Je = (e, t) => e.isLoading && e.isFetching && !t, Ze = (e, t) => e?.suspense && t.isPending, ie = (e, t, s) => t.fetchOptimistic(e).catch(() => {
1012
+ s.clearReset();
1013
+ });
1014
+ function me(e, t, s) {
1015
+ if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
1016
+ throw new Error(
1017
+ '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'
1018
+ );
1019
+ const r = ve(s), n = Le(), o = He(), a = r.defaultQueryOptions(e);
1020
+ r.getDefaultOptions().queries?._experimental_beforeQuery?.(
1021
+ a
1022
+ ), process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
1023
+ `[${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`
1024
+ )), a._optimisticResults = n ? "isRestoring" : "optimistic", Ve(a), Be(a, o), $e(o);
1025
+ const i = !r.getQueryCache().get(a.queryHash), [u] = S.useState(
1026
+ () => new t(
1027
+ r,
1028
+ a
1029
+ )
1030
+ ), l = u.getOptimisticResult(a), h = !n && e.subscribed !== !1;
1031
+ if (S.useSyncExternalStore(
1032
+ S.useCallback(
1033
+ (p) => {
1034
+ const d = h ? u.subscribe(z.batchCalls(p)) : ne;
1035
+ return u.updateResult(), d;
1036
+ },
1037
+ [u, h]
1038
+ ),
1039
+ () => u.getCurrentResult(),
1040
+ () => u.getCurrentResult()
1041
+ ), S.useEffect(() => {
1042
+ u.setOptions(a);
1043
+ }, [a, u]), Ze(a, l))
1044
+ throw ie(a, u, o);
1045
+ if (Ge({
1046
+ result: l,
1047
+ errorResetBoundary: o,
1048
+ throwOnError: a.throwOnError,
1049
+ query: r.getQueryCache().get(a.queryHash),
1050
+ suspense: a.suspense
1051
+ }))
1052
+ throw l.error;
1053
+ return r.getDefaultOptions().queries?._experimental_afterQuery?.(
1054
+ a,
1055
+ l
1056
+ ), a.experimental_prefetchInRender && !C && Je(l, n) && (i ? (
1057
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1058
+ ie(a, u, o)
1059
+ ) : (
1060
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1061
+ r.getQueryCache().get(a.queryHash)?.promise
1062
+ ))?.catch(ne).finally(() => {
1063
+ u.updateResult();
1064
+ }), a.notifyOnChangeProps ? l : u.trackResult(l);
1065
+ }
1066
+ function We(e, t) {
1067
+ return me(e, pe, t);
1068
+ }
1069
+ function Ye(e, t) {
1070
+ return process.env.NODE_ENV !== "production" && e.queryFn === j && console.error("skipToken is not allowed for useSuspenseQuery"), me(
1071
+ {
1072
+ ...e,
1073
+ enabled: !0,
1074
+ suspense: !0,
1075
+ throwOnError: ze,
1076
+ placeholderData: void 0
1077
+ },
1078
+ pe,
1079
+ t
1080
+ );
1081
+ }
1082
+ const Xe = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, et = (e) => e.filter(
1083
+ (t) => t != null && t !== !1 && (typeof t == "string" || typeof t == "number")
1084
+ ).map((t) => `${t}`).filter((t) => t), tt = (e) => {
1085
+ const t = e.join("/"), [, s = "", r = ""] = t.match(Xe) ?? [];
1086
+ return {
1087
+ prefix: s,
1088
+ pathname: r.split("/").filter((n) => n !== "")
1089
+ };
1090
+ }, st = (e) => {
1091
+ const { prefix: t, pathname: s } = e;
1092
+ let r = t;
1093
+ return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
1094
+ }, oe = (...e) => {
1095
+ const t = et(e), s = tt(t);
1096
+ return st(s);
1097
+ }, ge = Object.freeze({
1098
+ API_IDENTITIES: ["api-identities"]
1099
+ }), Ft = () => {
1100
+ const e = ve();
1101
+ return {
1102
+ invalidateCache: async (t) => {
1103
+ await e.invalidateQueries({ queryKey: ge[t] });
1104
+ }
1105
+ };
1106
+ }, rt = "no-dehydrate", P = (...e) => {
1107
+ const t = e.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
1108
+ return t ? `/${t}` : "/";
1109
+ }, J = (e, t) => {
1110
+ for (const s of e) {
1111
+ const r = Z(s, t);
1112
+ if (r !== void 0) return r;
1113
+ }
1114
+ }, Z = (e, t, s = []) => {
1115
+ const r = t(e, s);
1116
+ if (r !== void 0) return r;
1117
+ if (e.type === "category")
1118
+ for (const n of e.items) {
1119
+ const o = Z(n, t, [
1120
+ ...s,
1121
+ e
1122
+ ]);
1123
+ if (o !== void 0) return o;
1124
+ }
1125
+ }, It = () => {
1126
+ const e = A(), s = Se().sidebar;
1127
+ return J(s, (r) => {
1128
+ if (r.type === "doc" && P(r.id) === e.pathname)
1129
+ return r;
1130
+ });
1131
+ }, Pt = (e) => {
1132
+ const t = A();
1133
+ return Z(e, (s) => {
1134
+ if (s.type === "category" && s.link && P(s.link.id) === t.pathname || s.type === "doc" && P(s.id) === t.pathname)
1135
+ return !0;
1136
+ });
1137
+ }, Tt = () => {
1138
+ const e = A().pathname, s = Se().sidebar;
1139
+ let r, n, o = !1;
1140
+ return J(s, (a) => {
1141
+ const i = a.type === "doc" ? P(a.id) : a.type === "category" && a.link ? P(a.link.id) : void 0;
1142
+ if (i) {
1143
+ if (o)
1144
+ return n = { label: a.label, id: i }, !0;
1145
+ e === i ? o = !0 : r = { label: a.label, id: i };
1146
+ }
1147
+ }), { prev: r, next: n };
1148
+ }, nt = Oe(
1149
+ void 0
1150
+ ), W = () => {
1151
+ const e = Ee(nt);
1152
+ if (!e)
1153
+ throw new Error("useZudoku must be used within a ZudokuProvider.");
1154
+ return e;
1155
+ }, Dt = () => {
1156
+ const { getApiIdentities: e } = W();
1157
+ return We({
1158
+ queryFn: e,
1159
+ queryKey: ge.API_IDENTITIES
1160
+ });
1161
+ }, Se = () => {
1162
+ const { getPluginSidebar: e, sidebars: t, topNavigation: s, options: r } = W(), n = A(), o = ft(), a = r.protectedRoutes?.some(
1163
+ (p) => X(p, n.pathname)
1164
+ );
1165
+ let i = Object.entries(t).find(([, p]) => J(p, (d) => {
1166
+ if ((d.type === "doc" ? oe(d.id) : d.type === "category" && d.link ? oe(d.link.id) : void 0) === n.pathname)
1167
+ return d;
1168
+ }));
1169
+ const u = s.find((p) => p.id === i?.[0]) ?? s.find((p) => X(p.id, n.pathname));
1170
+ u && !i && u.id in t && (i = ["", t[u.id]]);
1171
+ const { data: l } = Ye({
1172
+ queryFn: () => e(n.pathname),
1173
+ // We just want to suspend here and don't store in SSR dehydrated state
1174
+ queryKey: ["plugin-sidebar", rt, n.pathname]
1175
+ });
1176
+ return {
1177
+ sidebar: o.isAuthEnabled && !o.isAuthenticated && a ? [] : [...i ? i[1] : [], ...l],
1178
+ topNavItem: u
1179
+ };
1180
+ }, ae = (e) => {
1181
+ let t;
1182
+ const s = /* @__PURE__ */ new Set(), r = (l, h) => {
1183
+ const p = typeof l == "function" ? l(t) : l;
1184
+ if (!Object.is(p, t)) {
1185
+ const d = t;
1186
+ t = h ?? (typeof p != "object" || p === null) ? p : Object.assign({}, t, p), s.forEach((b) => b(t, d));
1187
+ }
1188
+ }, n = () => t, i = { setState: r, getState: n, getInitialState: () => u, subscribe: (l) => (s.add(l), () => s.delete(l)) }, u = t = e(r, n, i);
1189
+ return i;
1190
+ }, it = (e) => e ? ae(e) : ae, ot = (e) => e;
1191
+ function at(e, t = ot) {
1192
+ const s = Y.useSyncExternalStore(
1193
+ e.subscribe,
1194
+ () => t(e.getState()),
1195
+ () => t(e.getInitialState())
1196
+ );
1197
+ return Y.useDebugValue(s), s;
1198
+ }
1199
+ const ut = (e) => {
1200
+ const t = it(e), s = (r) => at(t, r);
1201
+ return Object.assign(s, t), s;
1202
+ }, ct = (e) => ut;
1203
+ function we(e, t) {
1204
+ let s;
1205
+ try {
1206
+ s = e();
1207
+ } catch {
1208
+ return;
1209
+ }
1210
+ return {
1211
+ getItem: (n) => {
1212
+ var o;
1213
+ const a = (u) => u === null ? null : JSON.parse(u, void 0), i = (o = s.getItem(n)) != null ? o : null;
1214
+ return i instanceof Promise ? i.then(a) : a(i);
1215
+ },
1216
+ setItem: (n, o) => s.setItem(
1217
+ n,
1218
+ JSON.stringify(o, void 0)
1219
+ ),
1220
+ removeItem: (n) => s.removeItem(n)
1221
+ };
1222
+ }
1223
+ const B = (e) => (t) => {
1224
+ try {
1225
+ const s = e(t);
1226
+ return s instanceof Promise ? s : {
1227
+ then(r) {
1228
+ return B(r)(s);
1229
+ },
1230
+ catch(r) {
1231
+ return this;
1232
+ }
1233
+ };
1234
+ } catch (s) {
1235
+ return {
1236
+ then(r) {
1237
+ return this;
1238
+ },
1239
+ catch(r) {
1240
+ return B(r)(s);
1241
+ }
1242
+ };
1243
+ }
1244
+ }, ht = (e, t) => (s, r, n) => {
1245
+ let o = {
1246
+ storage: we(() => localStorage),
1247
+ partialize: (c) => c,
1248
+ version: 0,
1249
+ merge: (c, m) => ({
1250
+ ...m,
1251
+ ...c
1252
+ }),
1253
+ ...t
1254
+ }, a = !1;
1255
+ const i = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
1256
+ let l = o.storage;
1257
+ if (!l)
1258
+ return e(
1259
+ (...c) => {
1260
+ console.warn(
1261
+ `[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`
1262
+ ), s(...c);
1263
+ },
1264
+ r,
1265
+ n
1266
+ );
1267
+ const h = () => {
1268
+ const c = o.partialize({ ...r() });
1269
+ return l.setItem(o.name, {
1270
+ state: c,
1271
+ version: o.version
1272
+ });
1273
+ }, p = n.setState;
1274
+ n.setState = (c, m) => {
1275
+ p(c, m), h();
1276
+ };
1277
+ const d = e(
1278
+ (...c) => {
1279
+ s(...c), h();
1280
+ },
1281
+ r,
1282
+ n
1283
+ );
1284
+ n.getInitialState = () => d;
1285
+ let b;
1286
+ const O = () => {
1287
+ var c, m;
1288
+ if (!l) return;
1289
+ a = !1, i.forEach((f) => {
1290
+ var y;
1291
+ return f((y = r()) != null ? y : d);
1292
+ });
1293
+ const v = ((m = o.onRehydrateStorage) == null ? void 0 : m.call(o, (c = r()) != null ? c : d)) || void 0;
1294
+ return B(l.getItem.bind(l))(o.name).then((f) => {
1295
+ if (f)
1296
+ if (typeof f.version == "number" && f.version !== o.version) {
1297
+ if (o.migrate) {
1298
+ const y = o.migrate(
1299
+ f.state,
1300
+ f.version
1301
+ );
1302
+ return y instanceof Promise ? y.then((E) => [!0, E]) : [!0, y];
1303
+ }
1304
+ console.error(
1305
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
1306
+ );
1307
+ } else
1308
+ return [!1, f.state];
1309
+ return [!1, void 0];
1310
+ }).then((f) => {
1311
+ var y;
1312
+ const [E, F] = f;
1313
+ if (b = o.merge(
1314
+ F,
1315
+ (y = r()) != null ? y : d
1316
+ ), s(b, !0), E)
1317
+ return h();
1318
+ }).then(() => {
1319
+ v?.(b, void 0), b = r(), a = !0, u.forEach((f) => f(b));
1320
+ }).catch((f) => {
1321
+ v?.(void 0, f);
1322
+ });
1323
+ };
1324
+ return n.persist = {
1325
+ setOptions: (c) => {
1326
+ o = {
1327
+ ...o,
1328
+ ...c
1329
+ }, c.storage && (l = c.storage);
1330
+ },
1331
+ clearStorage: () => {
1332
+ l?.removeItem(o.name);
1333
+ },
1334
+ getOptions: () => o,
1335
+ rehydrate: () => O(),
1336
+ hasHydrated: () => a,
1337
+ onHydrate: (c) => (i.add(c), () => {
1338
+ i.delete(c);
1339
+ }),
1340
+ onFinishHydration: (c) => (u.add(c), () => {
1341
+ u.delete(c);
1342
+ })
1343
+ }, o.skipHydration || O(), b || d;
1344
+ }, lt = ht, dt = (e) => {
1345
+ const t = (s) => {
1346
+ s.key === e.persist.getOptions().name && s.newValue && e.persist.rehydrate();
1347
+ };
1348
+ return window.addEventListener("storage", t), () => {
1349
+ window.removeEventListener("storage", t);
1350
+ };
1351
+ }, Re = ct()(
1352
+ lt(
1353
+ (e) => ({
1354
+ isAuthenticated: !1,
1355
+ isPending: !0,
1356
+ profile: null,
1357
+ providerData: null
1358
+ }),
1359
+ {
1360
+ merge: (e, t) => ({
1361
+ ...t,
1362
+ isPending: !1,
1363
+ ...typeof e == "object" ? e : {}
1364
+ }),
1365
+ name: "auth-state",
1366
+ storage: we(() => localStorage)
1367
+ }
1368
+ )
1369
+ );
1370
+ typeof window < "u" && dt(Re);
1371
+ const ft = () => {
1372
+ const { authentication: e } = W(), t = Re(), s = typeof e < "u";
1373
+ return {
1374
+ isAuthEnabled: s,
1375
+ ...t,
1376
+ login: async () => {
1377
+ if (!s)
1378
+ throw new Error("Authentication is not enabled.");
1379
+ await e.signIn({
1380
+ redirectTo: window.location.href
1381
+ });
1382
+ },
1383
+ logout: async () => {
1384
+ if (!s)
1385
+ throw new Error("Authentication is not enabled.");
1386
+ await e.signOut(), window.location.href = "/";
1387
+ },
1388
+ signup: async () => {
1389
+ if (!s)
1390
+ throw new Error("Authentication is not enabled.");
1391
+ await e.signUp({
1392
+ redirectTo: window.location.href
1393
+ });
1394
+ }
1395
+ };
1396
+ };
1397
+ export {
1398
+ Ot as A,
1399
+ Rt as B,
1400
+ ce as C,
1401
+ he as D,
1402
+ k as E,
1403
+ mt as F,
1404
+ G,
1405
+ j as H,
1406
+ Ct as I,
1407
+ Se as J,
1408
+ J as K,
1409
+ Ft as L,
1410
+ ge as M,
1411
+ Pt as N,
1412
+ Et as Q,
1413
+ qe as R,
1414
+ $ as S,
1415
+ nt as Z,
1416
+ It as a,
1417
+ Tt as b,
1418
+ je as c,
1419
+ Ye as d,
1420
+ W as e,
1421
+ oe as f,
1422
+ ve as g,
1423
+ Q as h,
1424
+ ne as i,
1425
+ P as j,
1426
+ Ke as k,
1427
+ ft as l,
1428
+ We as m,
1429
+ z as n,
1430
+ wt as o,
1431
+ ct as p,
1432
+ lt as q,
1433
+ we as r,
1434
+ L as s,
1435
+ Dt as t,
1436
+ Re as u,
1437
+ Fe as v,
1438
+ gt as w,
1439
+ St as x,
1440
+ q as y,
1441
+ Pe as z
1442
+ };
1443
+ //# sourceMappingURL=hook-CyNmcNr8.js.map