zudoku 0.64.2 → 0.65.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 (279) hide show
  1. package/dist/app/main.d.ts +91 -1
  2. package/dist/app/main.js +5 -1
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/config/validators/InputNavigationSchema.d.ts +16 -16
  5. package/dist/config/validators/NavigationSchema.js +2 -4
  6. package/dist/config/validators/NavigationSchema.js.map +1 -1
  7. package/dist/config/validators/validate.d.ts +53 -1
  8. package/dist/config/validators/validate.js +7 -0
  9. package/dist/config/validators/validate.js.map +1 -1
  10. package/dist/config/validators/validate.test.js +43 -0
  11. package/dist/config/validators/validate.test.js.map +1 -1
  12. package/dist/flat-config.d.ts +6 -0
  13. package/dist/lib/authentication/providers/auth0.js +6 -1
  14. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  15. package/dist/lib/components/Autocomplete.d.ts +3 -1
  16. package/dist/lib/components/Autocomplete.js +6 -2
  17. package/dist/lib/components/Autocomplete.js.map +1 -1
  18. package/dist/lib/components/Layout.js +3 -2
  19. package/dist/lib/components/Layout.js.map +1 -1
  20. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  21. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  22. package/dist/lib/errors/ErrorAlert.js +1 -1
  23. package/dist/lib/errors/RouterError.d.ts +3 -1
  24. package/dist/lib/errors/RouterError.js +3 -2
  25. package/dist/lib/errors/RouterError.js.map +1 -1
  26. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  27. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -1
  28. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  29. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  30. package/dist/lib/plugins/openapi/OperationListItem.js +2 -1
  31. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  32. package/dist/lib/plugins/openapi/ParameterList.js +7 -4
  33. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  34. package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
  35. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  36. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +4 -1
  37. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  38. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +1 -2
  39. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +15 -6
  40. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  41. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -2
  42. package/dist/lib/plugins/openapi/Sidecar.js +39 -15
  43. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  44. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  45. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  46. package/dist/lib/plugins/openapi/SidecarExamples.js +15 -16
  47. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  48. package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
  49. package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
  50. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  51. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  52. package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
  53. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
  54. package/dist/lib/plugins/openapi/interfaces.d.ts +13 -0
  55. package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
  56. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  57. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
  58. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
  59. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
  60. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  61. package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
  62. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  63. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +8 -0
  64. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
  65. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  66. package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
  67. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  68. package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
  69. package/dist/lib/plugins/openapi/playground/Playground.js +56 -28
  70. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  71. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
  72. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  73. package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
  74. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  75. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
  76. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
  77. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
  78. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
  79. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
  80. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
  81. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
  82. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
  83. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
  84. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
  85. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
  86. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
  87. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  88. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
  89. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  90. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -7
  91. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  92. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  93. package/dist/lib/plugins/openapi/schema/SchemaView.js +20 -9
  94. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  95. package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
  96. package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
  97. package/dist/lib/ui/Badge.d.ts +3 -3
  98. package/dist/lib/ui/Badge.js +9 -7
  99. package/dist/lib/ui/Badge.js.map +1 -1
  100. package/dist/lib/ui/Button.d.ts +1 -1
  101. package/dist/lib/ui/Button.js +1 -0
  102. package/dist/lib/ui/Button.js.map +1 -1
  103. package/dist/lib/ui/Checkbox.d.ts +2 -2
  104. package/dist/lib/ui/Checkbox.js +4 -4
  105. package/dist/lib/ui/Checkbox.js.map +1 -1
  106. package/dist/lib/ui/CodeBlock.js +1 -1
  107. package/dist/lib/ui/CodeBlock.js.map +1 -1
  108. package/dist/lib/ui/Collapsible.d.ts +4 -4
  109. package/dist/lib/ui/Collapsible.js +11 -4
  110. package/dist/lib/ui/Collapsible.js.map +1 -1
  111. package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
  112. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  113. package/dist/lib/ui/Frame.d.ts +8 -0
  114. package/dist/lib/ui/Frame.js +22 -0
  115. package/dist/lib/ui/Frame.js.map +1 -0
  116. package/dist/lib/ui/Item.d.ts +23 -0
  117. package/dist/lib/ui/Item.js +67 -0
  118. package/dist/lib/ui/Item.js.map +1 -0
  119. package/dist/lib/ui/NativeSelect.d.ts +5 -0
  120. package/dist/lib/ui/NativeSelect.js +14 -0
  121. package/dist/lib/ui/NativeSelect.js.map +1 -0
  122. package/dist/lib/ui/Select.d.ts +13 -11
  123. package/dist/lib/ui/Select.js +34 -23
  124. package/dist/lib/ui/Select.js.map +1 -1
  125. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  126. package/dist/lib/util/readFrontmatter.js +12 -0
  127. package/dist/lib/util/readFrontmatter.js.map +1 -0
  128. package/dist/vite/mdx/remark-last-modified.js +57 -3
  129. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  130. package/dist/vite/plugin-api.js +2 -2
  131. package/dist/vite/plugin-api.js.map +1 -1
  132. package/dist/vite/plugin-frontmatter.js +3 -5
  133. package/dist/vite/plugin-frontmatter.js.map +1 -1
  134. package/dist/vite/plugin-markdown-export.js +3 -4
  135. package/dist/vite/plugin-markdown-export.js.map +1 -1
  136. package/lib/{Button-DmS4u8Lj.js → Button-B3ucvvQw.js} +7 -6
  137. package/lib/Button-B3ucvvQw.js.map +1 -0
  138. package/lib/{ErrorAlert--3alJ_-b.js → ErrorAlert-BOVgwTRP.js} +2555 -2609
  139. package/lib/ErrorAlert-BOVgwTRP.js.map +1 -0
  140. package/lib/{MdxPage-Bpa9tL63.js → MdxPage-CBYFyqUs.js} +6 -6
  141. package/lib/{MdxPage-Bpa9tL63.js.map → MdxPage-CBYFyqUs.js.map} +1 -1
  142. package/lib/{OAuthErrorPage-B79J86Fo.js → OAuthErrorPage-DlTYnbLO.js} +4 -4
  143. package/lib/{OAuthErrorPage-B79J86Fo.js.map → OAuthErrorPage-DlTYnbLO.js.map} +1 -1
  144. package/lib/{OasProvider-jr0oDSFy.js → OasProvider-DIPAQ79S.js} +2 -2
  145. package/lib/{OasProvider-jr0oDSFy.js.map → OasProvider-DIPAQ79S.js.map} +1 -1
  146. package/lib/{OperationList-DLEAg4qw.js → OperationList-BOTFIfda.js} +2053 -1830
  147. package/lib/OperationList-BOTFIfda.js.map +1 -0
  148. package/lib/{Pagination-H2HW9-Er.js → Pagination-BOZ9Pxcw.js} +2 -2
  149. package/lib/{Pagination-H2HW9-Er.js.map → Pagination-BOZ9Pxcw.js.map} +1 -1
  150. package/lib/{RouteGuard-CjzxosTf.js → RouteGuard-Brz95MSt.js} +2 -2
  151. package/lib/{RouteGuard-CjzxosTf.js.map → RouteGuard-Brz95MSt.js.map} +1 -1
  152. package/lib/RouterError-DQS_bMwf.js +42 -0
  153. package/lib/RouterError-DQS_bMwf.js.map +1 -0
  154. package/lib/{SchemaList-CSDSazqV.js → SchemaList-Bu95q_q2.js} +7 -7
  155. package/lib/{SchemaList-CSDSazqV.js.map → SchemaList-Bu95q_q2.js.map} +1 -1
  156. package/lib/SchemaView-CaxK_HV4.js +586 -0
  157. package/lib/SchemaView-CaxK_HV4.js.map +1 -0
  158. package/lib/Select-DFRCS31-.js +399 -0
  159. package/lib/Select-DFRCS31-.js.map +1 -0
  160. package/lib/{SignUp-Fycafbyg.js → SignUp-CfB278ao.js} +2 -2
  161. package/lib/{SignUp-Fycafbyg.js.map → SignUp-CfB278ao.js.map} +1 -1
  162. package/lib/{Toc-ChkOg2UU.js → Toc-DQIqdghO.js} +2 -2
  163. package/lib/{Toc-ChkOg2UU.js.map → Toc-DQIqdghO.js.map} +1 -1
  164. package/lib/{circular-DGfd8SGc.js → circular-B-_VyILZ.js} +6360 -5953
  165. package/lib/circular-B-_VyILZ.js.map +1 -0
  166. package/lib/{createServer-DGD8hEzT.js → createServer-C5lXk4ba.js} +770 -735
  167. package/lib/createServer-C5lXk4ba.js.map +1 -0
  168. package/lib/{errors-BTpjwHS6.js → errors-DqoyOKev.js} +2 -2
  169. package/lib/{errors-BTpjwHS6.js.map → errors-DqoyOKev.js.map} +1 -1
  170. package/lib/index-B7yD7ZUk.js +3680 -0
  171. package/lib/index-B7yD7ZUk.js.map +1 -0
  172. package/lib/{index-Bvas0H4x.js → index-BG79m3lF.js} +2 -2
  173. package/lib/{index-Bvas0H4x.js.map → index-BG79m3lF.js.map} +1 -1
  174. package/lib/{index-FNRZUtwo.js → index-DHDtI9H5.js} +3 -3
  175. package/lib/{index-FNRZUtwo.js.map → index-DHDtI9H5.js.map} +1 -1
  176. package/lib/ui/ActionButton.js +1 -1
  177. package/lib/ui/Badge.js +27 -13
  178. package/lib/ui/Badge.js.map +1 -1
  179. package/lib/ui/Button.js +6 -5
  180. package/lib/ui/Button.js.map +1 -1
  181. package/lib/ui/Checkbox.js +29 -26
  182. package/lib/ui/Checkbox.js.map +1 -1
  183. package/lib/ui/CodeBlock.js +7 -7
  184. package/lib/ui/CodeBlock.js.map +1 -1
  185. package/lib/ui/Collapsible.js +32 -5
  186. package/lib/ui/Collapsible.js.map +1 -1
  187. package/lib/ui/EmbeddedCodeBlock.js +19 -18
  188. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  189. package/lib/ui/Frame.js +81 -0
  190. package/lib/ui/Frame.js.map +1 -0
  191. package/lib/ui/Item.js +188 -0
  192. package/lib/ui/Item.js.map +1 -0
  193. package/lib/ui/NativeSelect.js +57 -0
  194. package/lib/ui/NativeSelect.js.map +1 -0
  195. package/lib/ui/Select.js +166 -116
  196. package/lib/ui/Select.js.map +1 -1
  197. package/lib/ui/Tabs.js +10 -10
  198. package/lib/zudoku.__internal.js +345 -345
  199. package/lib/zudoku.__internal.js.map +1 -1
  200. package/lib/zudoku.auth-auth0.js +7 -7
  201. package/lib/zudoku.auth-auth0.js.map +1 -1
  202. package/lib/zudoku.auth-azureb2c.js +3 -3
  203. package/lib/zudoku.auth-clerk.js +1 -1
  204. package/lib/zudoku.auth-openid.js +3 -3
  205. package/lib/zudoku.auth-supabase.js +3 -3
  206. package/lib/zudoku.components.js +2 -2
  207. package/lib/zudoku.plugin-api-catalog.js +3 -3
  208. package/lib/zudoku.plugin-api-keys.js +4 -4
  209. package/lib/zudoku.plugin-markdown.js +1 -1
  210. package/lib/zudoku.plugin-openapi.js +1 -1
  211. package/lib/zudoku.plugin-search-pagefind.js +2 -2
  212. package/package.json +4 -4
  213. package/src/app/main.tsx +5 -1
  214. package/src/lib/authentication/providers/auth0.tsx +6 -1
  215. package/src/lib/components/Autocomplete.tsx +11 -2
  216. package/src/lib/components/Layout.tsx +3 -2
  217. package/src/lib/components/navigation/NavigationItem.tsx +7 -20
  218. package/src/lib/errors/ErrorAlert.tsx +1 -1
  219. package/src/lib/errors/RouterError.tsx +7 -2
  220. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +2 -2
  221. package/src/lib/plugins/openapi/OperationList.tsx +3 -1
  222. package/src/lib/plugins/openapi/OperationListItem.tsx +7 -7
  223. package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
  224. package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
  225. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +36 -13
  226. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +67 -44
  227. package/src/lib/plugins/openapi/Sidecar.tsx +84 -41
  228. package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
  229. package/src/lib/plugins/openapi/SidecarExamples.tsx +59 -37
  230. package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
  231. package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
  232. package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
  233. package/src/lib/plugins/openapi/interfaces.ts +12 -0
  234. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
  235. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
  236. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
  237. package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
  238. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
  239. package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
  240. package/src/lib/plugins/openapi/playground/Playground.tsx +73 -35
  241. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
  242. package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
  243. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
  244. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
  245. package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
  246. package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
  247. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
  248. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
  249. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -52
  250. package/src/lib/plugins/openapi/schema/SchemaView.tsx +82 -48
  251. package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
  252. package/src/lib/ui/Badge.tsx +21 -12
  253. package/src/lib/ui/Button.tsx +1 -0
  254. package/src/lib/ui/Checkbox.tsx +23 -24
  255. package/src/lib/ui/CodeBlock.tsx +3 -3
  256. package/src/lib/ui/Collapsible.tsx +26 -4
  257. package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -18
  258. package/src/lib/ui/Frame.tsx +81 -0
  259. package/src/lib/ui/Item.tsx +192 -0
  260. package/src/lib/ui/NativeSelect.tsx +47 -0
  261. package/src/lib/ui/Select.tsx +153 -126
  262. package/src/lib/util/readFrontmatter.ts +13 -0
  263. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
  264. package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
  265. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
  266. package/lib/Button-DmS4u8Lj.js.map +0 -1
  267. package/lib/ErrorAlert--3alJ_-b.js.map +0 -1
  268. package/lib/OperationList-DLEAg4qw.js.map +0 -1
  269. package/lib/RouterError-DZS2d6Sc.js +0 -41
  270. package/lib/RouterError-DZS2d6Sc.js.map +0 -1
  271. package/lib/SchemaView-DJiBd0_5.js +0 -397
  272. package/lib/SchemaView-DJiBd0_5.js.map +0 -1
  273. package/lib/Select-C1DeCqKv.js +0 -372
  274. package/lib/Select-C1DeCqKv.js.map +0 -1
  275. package/lib/circular-DGfd8SGc.js.map +0 -1
  276. package/lib/createServer-DGD8hEzT.js.map +0 -1
  277. package/lib/index-DP1xZgfJ.js +0 -3364
  278. package/lib/index-DP1xZgfJ.js.map +0 -1
  279. package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
@@ -0,0 +1,3680 @@
1
+ import { j as t } from "./jsx-runtime-BzflLqGi.js";
2
+ import { ChevronsDownUpIcon as Ln, ChevronsUpDownIcon as kn, PlusCircleIcon as Qe, XIcon as Rt, CheckIcon as Et, PaperclipIcon as me, TrashIcon as Rn, FileInput as En, ScanTextIcon as gt, Grid2x2PlusIcon as xt, ChevronDownIcon as In, TableOfContentsIcon as Dn, LockIcon as Fn, CircleAlertIcon as zn, Circle as Vn, Unlink2Icon as Bn, CornerDownRightIcon as _n, MinusCircleIcon as yt, CornerDownLeftIcon as qn, SquareCodeIcon as Mn, DownloadIcon as Un, EyeOffIcon as Gn, EyeIcon as Hn, UnplugIcon as Qn, SendIcon as Jn, CopyIcon as Wn, IdCardLanyardIcon as Kn, ShapesIcon as Xn, PlayIcon as Zn, CirclePlayIcon as Yn } from "lucide-react";
3
+ import { r as es, b as ts, d as ns, N as ss, aL as rs, m as vt } from "./chunk-PVWAREVJ-BMhpCH5D.js";
4
+ import { Button as It } from "./ui/Button.js";
5
+ import { J as Ke, K as Xe, L as Dt, l as as, M as os, O as is, j as V, b as ls } from "./ZudokuContext-BUZ5hkWB.js";
6
+ import { Z as cs } from "./invariant-Bm-FVUQE.js";
7
+ import * as Q from "react";
8
+ import { createContext as Ft, use as ds, useRef as R, useEffect as G, useMemo as zt, useCallback as D, startTransition as us, useState as E, Fragment as le, useLayoutEffect as ms, useTransition as ps, useContext as hs } from "react";
9
+ import { VisuallyHidden as fs } from "@radix-ui/react-visually-hidden";
10
+ import { useAuth as gs } from "./zudoku.hooks.js";
11
+ import { B as q } from "./Button-B3ucvvQw.js";
12
+ import { D as Ze, a as Ye, c as et, d as Vt, e as Bt, g as xs } from "./Dialog-BQciPiHN.js";
13
+ import { B as he, S as ys, b as vs } from "./index-DHDtI9H5.js";
14
+ import { S as _t, c as qt, d as Mt, e as Ut, g as Te, i as bs, A as js, a as Cs, b as Ns, u as Ss } from "./Select-DFRCS31-.js";
15
+ import { u as ae, b as Gt, C as bt, a as ws, F as Ts } from "./index.esm-BYObtETB.js";
16
+ import * as tt from "@radix-ui/react-collapsible";
17
+ import { h as jt, i as Ct, j as Nt, k as As, g as $s } from "./ErrorAlert-BOVgwTRP.js";
18
+ import { c as w } from "./cn-dYga0KKN.js";
19
+ import { u as Os } from "./useCopyToClipboard-B_085nfO.js";
20
+ import { u as Ps } from "./useLatest-hmRS46UF.js";
21
+ import { D as Ht, a as Qt, b as Jt, d as Ls, e as ks, f as Rs, c as Ae } from "./DropdownMenu-BZ2NKQ3K.js";
22
+ import { Slot as Es } from "@radix-ui/react-slot";
23
+ import * as St from "@radix-ui/react-checkbox";
24
+ import * as $e from "@radix-ui/react-popover";
25
+ import { PopoverAnchor as Is } from "@radix-ui/react-popover";
26
+ import { P as Ds } from "./index-CrcNWbel.js";
27
+ import { f as Fs, g as zs, C as Vs, b as Bs } from "./Command-CUcrW3qs.js";
28
+ import { C as _s } from "./Card-KFniaZn5.js";
29
+ import * as Wt from "@radix-ui/react-label";
30
+ import { c as qs } from "./index-DI5SPFK9.js";
31
+ import * as fe from "@radix-ui/react-radio-group";
32
+ import { z as Ms } from "./useExposedProps-U3pmsHaG.js";
33
+ let _e;
34
+ const Us = (e) => {
35
+ if (e.errors?.[0])
36
+ throw new cs(e.errors[0].message, {
37
+ developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
38
+ });
39
+ };
40
+ class Gs {
41
+ constructor(n) {
42
+ this.config = n;
43
+ }
44
+ #e = async () => (_e || (_e = import("./createServer-C5lXk4ba.js").then(
45
+ (n) => n.createServer(this.config)
46
+ )), _e);
47
+ #t = async (n) => this.config.server ? fetch(this.config.server, n) : (await this.#e()).fetch("http://localhost/graphql", n);
48
+ fetch = async (n, s) => {
49
+ const a = n.match(/query (\w+)/)?.[1], r = await this.#t({
50
+ method: "POST",
51
+ body: JSON.stringify({ query: n, variables: s, operationName: a }),
52
+ headers: { "Content-Type": "application/json" }
53
+ });
54
+ if (!r.ok)
55
+ throw new Error("Network response was not ok");
56
+ const o = await r.json();
57
+ return Us(o), o.data;
58
+ };
59
+ }
60
+ function qe(e, n) {
61
+ if (!!!e)
62
+ throw new Error(n);
63
+ }
64
+ function Hs(e) {
65
+ return typeof e == "object" && e !== null;
66
+ }
67
+ function Qs(e, n) {
68
+ if (!!!e)
69
+ throw new Error(
70
+ n ?? "Unexpected invariant triggered."
71
+ );
72
+ }
73
+ const Js = /\r\n|[\n\r]/g;
74
+ function Je(e, n) {
75
+ let s = 0, a = 1;
76
+ for (const r of e.body.matchAll(Js)) {
77
+ if (typeof r.index == "number" || Qs(!1), r.index >= n)
78
+ break;
79
+ s = r.index + r[0].length, a += 1;
80
+ }
81
+ return {
82
+ line: a,
83
+ column: n + 1 - s
84
+ };
85
+ }
86
+ function Ws(e) {
87
+ return Kt(
88
+ e.source,
89
+ Je(e.source, e.start)
90
+ );
91
+ }
92
+ function Kt(e, n) {
93
+ const s = e.locationOffset.column - 1, a = "".padStart(s) + e.body, r = n.line - 1, o = e.locationOffset.line - 1, i = n.line + o, c = n.line === 1 ? s : 0, l = n.column + c, m = `${e.name}:${i}:${l}
94
+ `, d = a.split(/\r\n|[\n\r]/g), h = d[r];
95
+ if (h.length > 120) {
96
+ const x = Math.floor(l / 80), f = l % 80, b = [];
97
+ for (let u = 0; u < h.length; u += 80)
98
+ b.push(h.slice(u, u + 80));
99
+ return m + wt([
100
+ [`${i} |`, b[0]],
101
+ ...b.slice(1, x + 1).map((u) => ["|", u]),
102
+ ["|", "^".padStart(f)],
103
+ ["|", b[x + 1]]
104
+ ]);
105
+ }
106
+ return m + wt([
107
+ // Lines specified like this: ["prefix", "string"],
108
+ [`${i - 1} |`, d[r - 1]],
109
+ [`${i} |`, h],
110
+ ["|", "^".padStart(l)],
111
+ [`${i + 1} |`, d[r + 1]]
112
+ ]);
113
+ }
114
+ function wt(e) {
115
+ const n = e.filter(([a, r]) => r !== void 0), s = Math.max(...n.map(([a]) => a.length));
116
+ return n.map(([a, r]) => a.padStart(s) + (r ? " " + r : "")).join(`
117
+ `);
118
+ }
119
+ function Ks(e) {
120
+ const n = e[0];
121
+ return n == null || "kind" in n || "length" in n ? {
122
+ nodes: n,
123
+ source: e[1],
124
+ positions: e[2],
125
+ path: e[3],
126
+ originalError: e[4],
127
+ extensions: e[5]
128
+ } : n;
129
+ }
130
+ class nt extends Error {
131
+ /**
132
+ * An array of `{ line, column }` locations within the source GraphQL document
133
+ * which correspond to this error.
134
+ *
135
+ * Errors during validation often contain multiple locations, for example to
136
+ * point out two things with the same name. Errors during execution include a
137
+ * single location, the field which produced the error.
138
+ *
139
+ * Enumerable, and appears in the result of JSON.stringify().
140
+ */
141
+ /**
142
+ * An array describing the JSON-path into the execution response which
143
+ * corresponds to this error. Only included for errors during execution.
144
+ *
145
+ * Enumerable, and appears in the result of JSON.stringify().
146
+ */
147
+ /**
148
+ * An array of GraphQL AST Nodes corresponding to this error.
149
+ */
150
+ /**
151
+ * The source GraphQL document for the first location of this error.
152
+ *
153
+ * Note that if this Error represents more than one node, the source may not
154
+ * represent nodes after the first node.
155
+ */
156
+ /**
157
+ * An array of character offsets within the source GraphQL document
158
+ * which correspond to this error.
159
+ */
160
+ /**
161
+ * The original error thrown from a field resolver during execution.
162
+ */
163
+ /**
164
+ * Extension fields to add to the formatted error.
165
+ */
166
+ /**
167
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
168
+ */
169
+ constructor(n, ...s) {
170
+ var a, r, o;
171
+ const { nodes: i, source: c, positions: l, path: m, originalError: d, extensions: h } = Ks(s);
172
+ super(n), this.name = "GraphQLError", this.path = m ?? void 0, this.originalError = d ?? void 0, this.nodes = Tt(
173
+ Array.isArray(i) ? i : i ? [i] : void 0
174
+ );
175
+ const x = Tt(
176
+ (a = this.nodes) === null || a === void 0 ? void 0 : a.map((b) => b.loc).filter((b) => b != null)
177
+ );
178
+ this.source = c ?? (x == null || (r = x[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? x?.map((b) => b.start), this.locations = l && c ? l.map((b) => Je(c, b)) : x?.map((b) => Je(b.source, b.start));
179
+ const f = Hs(
180
+ d?.extensions
181
+ ) ? d?.extensions : void 0;
182
+ this.extensions = (o = h ?? f) !== null && o !== void 0 ? o : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
183
+ message: {
184
+ writable: !0,
185
+ enumerable: !0
186
+ },
187
+ name: {
188
+ enumerable: !1
189
+ },
190
+ nodes: {
191
+ enumerable: !1
192
+ },
193
+ source: {
194
+ enumerable: !1
195
+ },
196
+ positions: {
197
+ enumerable: !1
198
+ },
199
+ originalError: {
200
+ enumerable: !1
201
+ }
202
+ }), d != null && d.stack ? Object.defineProperty(this, "stack", {
203
+ value: d.stack,
204
+ writable: !0,
205
+ configurable: !0
206
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, nt) : Object.defineProperty(this, "stack", {
207
+ value: Error().stack,
208
+ writable: !0,
209
+ configurable: !0
210
+ });
211
+ }
212
+ get [Symbol.toStringTag]() {
213
+ return "GraphQLError";
214
+ }
215
+ toString() {
216
+ let n = this.message;
217
+ if (this.nodes)
218
+ for (const s of this.nodes)
219
+ s.loc && (n += `
220
+
221
+ ` + Ws(s.loc));
222
+ else if (this.source && this.locations)
223
+ for (const s of this.locations)
224
+ n += `
225
+
226
+ ` + Kt(this.source, s);
227
+ return n;
228
+ }
229
+ toJSON() {
230
+ const n = {
231
+ message: this.message
232
+ };
233
+ return this.locations != null && (n.locations = this.locations), this.path != null && (n.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (n.extensions = this.extensions), n;
234
+ }
235
+ }
236
+ function Tt(e) {
237
+ return e === void 0 || e.length === 0 ? void 0 : e;
238
+ }
239
+ function F(e, n, s) {
240
+ return new nt(`Syntax Error: ${s}`, {
241
+ source: e,
242
+ positions: [n]
243
+ });
244
+ }
245
+ class Ka {
246
+ /**
247
+ * The character offset at which this Node begins.
248
+ */
249
+ /**
250
+ * The character offset at which this Node ends.
251
+ */
252
+ /**
253
+ * The Token at which this Node begins.
254
+ */
255
+ /**
256
+ * The Token at which this Node ends.
257
+ */
258
+ /**
259
+ * The Source document the AST represents.
260
+ */
261
+ constructor(n, s, a) {
262
+ this.start = n.start, this.end = s.end, this.startToken = n, this.endToken = s, this.source = a;
263
+ }
264
+ get [Symbol.toStringTag]() {
265
+ return "Location";
266
+ }
267
+ toJSON() {
268
+ return {
269
+ start: this.start,
270
+ end: this.end
271
+ };
272
+ }
273
+ }
274
+ class Xt {
275
+ /**
276
+ * The kind of Token.
277
+ */
278
+ /**
279
+ * The character offset at which this Node begins.
280
+ */
281
+ /**
282
+ * The character offset at which this Node ends.
283
+ */
284
+ /**
285
+ * The 1-indexed line number on which this Token appears.
286
+ */
287
+ /**
288
+ * The 1-indexed column number at which this Token begins.
289
+ */
290
+ /**
291
+ * For non-punctuation tokens, represents the interpreted value of the token.
292
+ *
293
+ * Note: is undefined for punctuation tokens, but typed as string for
294
+ * convenience in the parser.
295
+ */
296
+ /**
297
+ * Tokens exist as nodes in a double-linked-list amongst all tokens
298
+ * including ignored tokens. <SOF> is always the first node and <EOF>
299
+ * the last.
300
+ */
301
+ constructor(n, s, a, r, o, i) {
302
+ this.kind = n, this.start = s, this.end = a, this.line = r, this.column = o, this.value = i, this.prev = null, this.next = null;
303
+ }
304
+ get [Symbol.toStringTag]() {
305
+ return "Token";
306
+ }
307
+ toJSON() {
308
+ return {
309
+ kind: this.kind,
310
+ value: this.value,
311
+ line: this.line,
312
+ column: this.column
313
+ };
314
+ }
315
+ }
316
+ const Xs = {
317
+ Name: [],
318
+ Document: ["definitions"],
319
+ OperationDefinition: [
320
+ "description",
321
+ "name",
322
+ "variableDefinitions",
323
+ "directives",
324
+ "selectionSet"
325
+ ],
326
+ VariableDefinition: [
327
+ "description",
328
+ "variable",
329
+ "type",
330
+ "defaultValue",
331
+ "directives"
332
+ ],
333
+ Variable: ["name"],
334
+ SelectionSet: ["selections"],
335
+ Field: ["alias", "name", "arguments", "directives", "selectionSet"],
336
+ Argument: ["name", "value"],
337
+ FragmentSpread: ["name", "directives"],
338
+ InlineFragment: ["typeCondition", "directives", "selectionSet"],
339
+ FragmentDefinition: [
340
+ "description",
341
+ "name",
342
+ // Note: fragment variable definitions are deprecated and will removed in v17.0.0
343
+ "variableDefinitions",
344
+ "typeCondition",
345
+ "directives",
346
+ "selectionSet"
347
+ ],
348
+ IntValue: [],
349
+ FloatValue: [],
350
+ StringValue: [],
351
+ BooleanValue: [],
352
+ NullValue: [],
353
+ EnumValue: [],
354
+ ListValue: ["values"],
355
+ ObjectValue: ["fields"],
356
+ ObjectField: ["name", "value"],
357
+ Directive: ["name", "arguments"],
358
+ NamedType: ["name"],
359
+ ListType: ["type"],
360
+ NonNullType: ["type"],
361
+ SchemaDefinition: ["description", "directives", "operationTypes"],
362
+ OperationTypeDefinition: ["type"],
363
+ ScalarTypeDefinition: ["description", "name", "directives"],
364
+ ObjectTypeDefinition: [
365
+ "description",
366
+ "name",
367
+ "interfaces",
368
+ "directives",
369
+ "fields"
370
+ ],
371
+ FieldDefinition: ["description", "name", "arguments", "type", "directives"],
372
+ InputValueDefinition: [
373
+ "description",
374
+ "name",
375
+ "type",
376
+ "defaultValue",
377
+ "directives"
378
+ ],
379
+ InterfaceTypeDefinition: [
380
+ "description",
381
+ "name",
382
+ "interfaces",
383
+ "directives",
384
+ "fields"
385
+ ],
386
+ UnionTypeDefinition: ["description", "name", "directives", "types"],
387
+ EnumTypeDefinition: ["description", "name", "directives", "values"],
388
+ EnumValueDefinition: ["description", "name", "directives"],
389
+ InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
390
+ DirectiveDefinition: ["description", "name", "arguments", "locations"],
391
+ SchemaExtension: ["directives", "operationTypes"],
392
+ ScalarTypeExtension: ["name", "directives"],
393
+ ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
394
+ InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
395
+ UnionTypeExtension: ["name", "directives", "types"],
396
+ EnumTypeExtension: ["name", "directives", "values"],
397
+ InputObjectTypeExtension: ["name", "directives", "fields"],
398
+ TypeCoordinate: ["name"],
399
+ MemberCoordinate: ["name", "memberName"],
400
+ ArgumentCoordinate: ["name", "fieldName", "argumentName"],
401
+ DirectiveCoordinate: ["name"],
402
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
403
+ }, Zs = new Set(Object.keys(Xs));
404
+ function Xa(e) {
405
+ const n = e?.kind;
406
+ return typeof n == "string" && Zs.has(n);
407
+ }
408
+ var At;
409
+ (function(e) {
410
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
411
+ })(At || (At = {}));
412
+ function We(e) {
413
+ return e === 9 || e === 32;
414
+ }
415
+ function ge(e) {
416
+ return e >= 48 && e <= 57;
417
+ }
418
+ function Zt(e) {
419
+ return e >= 97 && e <= 122 || // A-Z
420
+ e >= 65 && e <= 90;
421
+ }
422
+ function Yt(e) {
423
+ return Zt(e) || e === 95;
424
+ }
425
+ function Ys(e) {
426
+ return Zt(e) || ge(e) || e === 95;
427
+ }
428
+ function er(e) {
429
+ var n;
430
+ let s = Number.MAX_SAFE_INTEGER, a = null, r = -1;
431
+ for (let i = 0; i < e.length; ++i) {
432
+ var o;
433
+ const c = e[i], l = tr(c);
434
+ l !== c.length && (a = (o = a) !== null && o !== void 0 ? o : i, r = i, i !== 0 && l < s && (s = l));
435
+ }
436
+ return e.map((i, c) => c === 0 ? i : i.slice(s)).slice(
437
+ (n = a) !== null && n !== void 0 ? n : 0,
438
+ r + 1
439
+ );
440
+ }
441
+ function tr(e) {
442
+ let n = 0;
443
+ for (; n < e.length && We(e.charCodeAt(n)); )
444
+ ++n;
445
+ return n;
446
+ }
447
+ function nr(e, n) {
448
+ const s = e.replace(/"""/g, '\\"""'), a = s.split(/\r\n|[\n\r]/g), r = a.length === 1, o = a.length > 1 && a.slice(1).every((f) => f.length === 0 || We(f.charCodeAt(0))), i = s.endsWith('\\"""'), c = e.endsWith('"') && !i, l = e.endsWith("\\"), m = c || l, d = !(n != null && n.minimize) && // add leading and trailing new lines only if it improves readability
449
+ (!r || e.length > 70 || m || o || i);
450
+ let h = "";
451
+ const x = r && We(e.charCodeAt(0));
452
+ return (d && !x || o) && (h += `
453
+ `), h += s, (d || m) && (h += `
454
+ `), '"""' + h + '"""';
455
+ }
456
+ var v;
457
+ (function(e) {
458
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
459
+ })(v || (v = {}));
460
+ class sr {
461
+ /**
462
+ * The previously focused non-ignored token.
463
+ */
464
+ /**
465
+ * The currently focused non-ignored token.
466
+ */
467
+ /**
468
+ * The (1-indexed) line containing the current token.
469
+ */
470
+ /**
471
+ * The character offset at which the current line begins.
472
+ */
473
+ constructor(n) {
474
+ const s = new Xt(v.SOF, 0, 0, 0, 0);
475
+ this.source = n, this.lastToken = s, this.token = s, this.line = 1, this.lineStart = 0;
476
+ }
477
+ get [Symbol.toStringTag]() {
478
+ return "Lexer";
479
+ }
480
+ /**
481
+ * Advances the token stream to the next non-ignored token.
482
+ */
483
+ advance() {
484
+ return this.lastToken = this.token, this.token = this.lookahead();
485
+ }
486
+ /**
487
+ * Looks ahead and returns the next non-ignored token, but does not change
488
+ * the state of Lexer.
489
+ */
490
+ lookahead() {
491
+ let n = this.token;
492
+ if (n.kind !== v.EOF)
493
+ do
494
+ if (n.next)
495
+ n = n.next;
496
+ else {
497
+ const s = ar(this, n.end);
498
+ n.next = s, s.prev = n, n = s;
499
+ }
500
+ while (n.kind === v.COMMENT);
501
+ return n;
502
+ }
503
+ }
504
+ function rr(e) {
505
+ return e === v.BANG || e === v.DOLLAR || e === v.AMP || e === v.PAREN_L || e === v.PAREN_R || e === v.DOT || e === v.SPREAD || e === v.COLON || e === v.EQUALS || e === v.AT || e === v.BRACKET_L || e === v.BRACKET_R || e === v.BRACE_L || e === v.PIPE || e === v.BRACE_R;
506
+ }
507
+ function oe(e) {
508
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
509
+ }
510
+ function Pe(e, n) {
511
+ return en(e.charCodeAt(n)) && tn(e.charCodeAt(n + 1));
512
+ }
513
+ function en(e) {
514
+ return e >= 55296 && e <= 56319;
515
+ }
516
+ function tn(e) {
517
+ return e >= 56320 && e <= 57343;
518
+ }
519
+ function X(e, n) {
520
+ const s = e.source.body.codePointAt(n);
521
+ if (s === void 0)
522
+ return v.EOF;
523
+ if (s >= 32 && s <= 126) {
524
+ const a = String.fromCodePoint(s);
525
+ return a === '"' ? `'"'` : `"${a}"`;
526
+ }
527
+ return "U+" + s.toString(16).toUpperCase().padStart(4, "0");
528
+ }
529
+ function O(e, n, s, a, r) {
530
+ const o = e.line, i = 1 + s - e.lineStart;
531
+ return new Xt(n, s, a, o, i, r);
532
+ }
533
+ function ar(e, n) {
534
+ const s = e.source.body, a = s.length;
535
+ let r = n;
536
+ for (; r < a; ) {
537
+ const o = s.charCodeAt(r);
538
+ switch (o) {
539
+ // Ignored ::
540
+ // - UnicodeBOM
541
+ // - WhiteSpace
542
+ // - LineTerminator
543
+ // - Comment
544
+ // - Comma
545
+ //
546
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
547
+ //
548
+ // WhiteSpace ::
549
+ // - "Horizontal Tab (U+0009)"
550
+ // - "Space (U+0020)"
551
+ //
552
+ // Comma :: ,
553
+ case 65279:
554
+ // <BOM>
555
+ case 9:
556
+ // \t
557
+ case 32:
558
+ // <space>
559
+ case 44:
560
+ ++r;
561
+ continue;
562
+ // LineTerminator ::
563
+ // - "New Line (U+000A)"
564
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
565
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
566
+ case 10:
567
+ ++r, ++e.line, e.lineStart = r;
568
+ continue;
569
+ case 13:
570
+ s.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
571
+ continue;
572
+ // Comment
573
+ case 35:
574
+ return or(e, r);
575
+ // Token ::
576
+ // - Punctuator
577
+ // - Name
578
+ // - IntValue
579
+ // - FloatValue
580
+ // - StringValue
581
+ //
582
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
583
+ case 33:
584
+ return O(e, v.BANG, r, r + 1);
585
+ case 36:
586
+ return O(e, v.DOLLAR, r, r + 1);
587
+ case 38:
588
+ return O(e, v.AMP, r, r + 1);
589
+ case 40:
590
+ return O(e, v.PAREN_L, r, r + 1);
591
+ case 41:
592
+ return O(e, v.PAREN_R, r, r + 1);
593
+ case 46:
594
+ if (s.charCodeAt(r + 1) === 46 && s.charCodeAt(r + 2) === 46)
595
+ return O(e, v.SPREAD, r, r + 3);
596
+ break;
597
+ case 58:
598
+ return O(e, v.COLON, r, r + 1);
599
+ case 61:
600
+ return O(e, v.EQUALS, r, r + 1);
601
+ case 64:
602
+ return O(e, v.AT, r, r + 1);
603
+ case 91:
604
+ return O(e, v.BRACKET_L, r, r + 1);
605
+ case 93:
606
+ return O(e, v.BRACKET_R, r, r + 1);
607
+ case 123:
608
+ return O(e, v.BRACE_L, r, r + 1);
609
+ case 124:
610
+ return O(e, v.PIPE, r, r + 1);
611
+ case 125:
612
+ return O(e, v.BRACE_R, r, r + 1);
613
+ // StringValue
614
+ case 34:
615
+ return s.charCodeAt(r + 1) === 34 && s.charCodeAt(r + 2) === 34 ? mr(e, r) : lr(e, r);
616
+ }
617
+ if (ge(o) || o === 45)
618
+ return ir(e, r, o);
619
+ if (Yt(o))
620
+ return pr(e, r);
621
+ throw F(
622
+ e.source,
623
+ r,
624
+ o === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : oe(o) || Pe(s, r) ? `Unexpected character: ${X(e, r)}.` : `Invalid character: ${X(e, r)}.`
625
+ );
626
+ }
627
+ return O(e, v.EOF, a, a);
628
+ }
629
+ function or(e, n) {
630
+ const s = e.source.body, a = s.length;
631
+ let r = n + 1;
632
+ for (; r < a; ) {
633
+ const o = s.charCodeAt(r);
634
+ if (o === 10 || o === 13)
635
+ break;
636
+ if (oe(o))
637
+ ++r;
638
+ else if (Pe(s, r))
639
+ r += 2;
640
+ else
641
+ break;
642
+ }
643
+ return O(
644
+ e,
645
+ v.COMMENT,
646
+ n,
647
+ r,
648
+ s.slice(n + 1, r)
649
+ );
650
+ }
651
+ function ir(e, n, s) {
652
+ const a = e.source.body;
653
+ let r = n, o = s, i = !1;
654
+ if (o === 45 && (o = a.charCodeAt(++r)), o === 48) {
655
+ if (o = a.charCodeAt(++r), ge(o))
656
+ throw F(
657
+ e.source,
658
+ r,
659
+ `Invalid number, unexpected digit after 0: ${X(
660
+ e,
661
+ r
662
+ )}.`
663
+ );
664
+ } else
665
+ r = Me(e, r, o), o = a.charCodeAt(r);
666
+ if (o === 46 && (i = !0, o = a.charCodeAt(++r), r = Me(e, r, o), o = a.charCodeAt(r)), (o === 69 || o === 101) && (i = !0, o = a.charCodeAt(++r), (o === 43 || o === 45) && (o = a.charCodeAt(++r)), r = Me(e, r, o), o = a.charCodeAt(r)), o === 46 || Yt(o))
667
+ throw F(
668
+ e.source,
669
+ r,
670
+ `Invalid number, expected digit but got: ${X(
671
+ e,
672
+ r
673
+ )}.`
674
+ );
675
+ return O(
676
+ e,
677
+ i ? v.FLOAT : v.INT,
678
+ n,
679
+ r,
680
+ a.slice(n, r)
681
+ );
682
+ }
683
+ function Me(e, n, s) {
684
+ if (!ge(s))
685
+ throw F(
686
+ e.source,
687
+ n,
688
+ `Invalid number, expected digit but got: ${X(
689
+ e,
690
+ n
691
+ )}.`
692
+ );
693
+ const a = e.source.body;
694
+ let r = n + 1;
695
+ for (; ge(a.charCodeAt(r)); )
696
+ ++r;
697
+ return r;
698
+ }
699
+ function lr(e, n) {
700
+ const s = e.source.body, a = s.length;
701
+ let r = n + 1, o = r, i = "";
702
+ for (; r < a; ) {
703
+ const c = s.charCodeAt(r);
704
+ if (c === 34)
705
+ return i += s.slice(o, r), O(e, v.STRING, n, r + 1, i);
706
+ if (c === 92) {
707
+ i += s.slice(o, r);
708
+ const l = s.charCodeAt(r + 1) === 117 ? s.charCodeAt(r + 2) === 123 ? cr(e, r) : dr(e, r) : ur(e, r);
709
+ i += l.value, r += l.size, o = r;
710
+ continue;
711
+ }
712
+ if (c === 10 || c === 13)
713
+ break;
714
+ if (oe(c))
715
+ ++r;
716
+ else if (Pe(s, r))
717
+ r += 2;
718
+ else
719
+ throw F(
720
+ e.source,
721
+ r,
722
+ `Invalid character within String: ${X(
723
+ e,
724
+ r
725
+ )}.`
726
+ );
727
+ }
728
+ throw F(e.source, r, "Unterminated string.");
729
+ }
730
+ function cr(e, n) {
731
+ const s = e.source.body;
732
+ let a = 0, r = 3;
733
+ for (; r < 12; ) {
734
+ const o = s.charCodeAt(n + r++);
735
+ if (o === 125) {
736
+ if (r < 5 || !oe(a))
737
+ break;
738
+ return {
739
+ value: String.fromCodePoint(a),
740
+ size: r
741
+ };
742
+ }
743
+ if (a = a << 4 | ce(o), a < 0)
744
+ break;
745
+ }
746
+ throw F(
747
+ e.source,
748
+ n,
749
+ `Invalid Unicode escape sequence: "${s.slice(
750
+ n,
751
+ n + r
752
+ )}".`
753
+ );
754
+ }
755
+ function dr(e, n) {
756
+ const s = e.source.body, a = $t(s, n + 2);
757
+ if (oe(a))
758
+ return {
759
+ value: String.fromCodePoint(a),
760
+ size: 6
761
+ };
762
+ if (en(a) && s.charCodeAt(n + 6) === 92 && s.charCodeAt(n + 7) === 117) {
763
+ const r = $t(s, n + 8);
764
+ if (tn(r))
765
+ return {
766
+ value: String.fromCodePoint(a, r),
767
+ size: 12
768
+ };
769
+ }
770
+ throw F(
771
+ e.source,
772
+ n,
773
+ `Invalid Unicode escape sequence: "${s.slice(n, n + 6)}".`
774
+ );
775
+ }
776
+ function $t(e, n) {
777
+ return ce(e.charCodeAt(n)) << 12 | ce(e.charCodeAt(n + 1)) << 8 | ce(e.charCodeAt(n + 2)) << 4 | ce(e.charCodeAt(n + 3));
778
+ }
779
+ function ce(e) {
780
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
781
+ }
782
+ function ur(e, n) {
783
+ const s = e.source.body;
784
+ switch (s.charCodeAt(n + 1)) {
785
+ case 34:
786
+ return {
787
+ value: '"',
788
+ size: 2
789
+ };
790
+ case 92:
791
+ return {
792
+ value: "\\",
793
+ size: 2
794
+ };
795
+ case 47:
796
+ return {
797
+ value: "/",
798
+ size: 2
799
+ };
800
+ case 98:
801
+ return {
802
+ value: "\b",
803
+ size: 2
804
+ };
805
+ case 102:
806
+ return {
807
+ value: "\f",
808
+ size: 2
809
+ };
810
+ case 110:
811
+ return {
812
+ value: `
813
+ `,
814
+ size: 2
815
+ };
816
+ case 114:
817
+ return {
818
+ value: "\r",
819
+ size: 2
820
+ };
821
+ case 116:
822
+ return {
823
+ value: " ",
824
+ size: 2
825
+ };
826
+ }
827
+ throw F(
828
+ e.source,
829
+ n,
830
+ `Invalid character escape sequence: "${s.slice(
831
+ n,
832
+ n + 2
833
+ )}".`
834
+ );
835
+ }
836
+ function mr(e, n) {
837
+ const s = e.source.body, a = s.length;
838
+ let r = e.lineStart, o = n + 3, i = o, c = "";
839
+ const l = [];
840
+ for (; o < a; ) {
841
+ const m = s.charCodeAt(o);
842
+ if (m === 34 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34) {
843
+ c += s.slice(i, o), l.push(c);
844
+ const d = O(
845
+ e,
846
+ v.BLOCK_STRING,
847
+ n,
848
+ o + 3,
849
+ // Return a string of the lines joined with U+000A.
850
+ er(l).join(`
851
+ `)
852
+ );
853
+ return e.line += l.length - 1, e.lineStart = r, d;
854
+ }
855
+ if (m === 92 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34 && s.charCodeAt(o + 3) === 34) {
856
+ c += s.slice(i, o), i = o + 1, o += 4;
857
+ continue;
858
+ }
859
+ if (m === 10 || m === 13) {
860
+ c += s.slice(i, o), l.push(c), m === 13 && s.charCodeAt(o + 1) === 10 ? o += 2 : ++o, c = "", i = o, r = o;
861
+ continue;
862
+ }
863
+ if (oe(m))
864
+ ++o;
865
+ else if (Pe(s, o))
866
+ o += 2;
867
+ else
868
+ throw F(
869
+ e.source,
870
+ o,
871
+ `Invalid character within String: ${X(
872
+ e,
873
+ o
874
+ )}.`
875
+ );
876
+ }
877
+ throw F(e.source, o, "Unterminated string.");
878
+ }
879
+ function pr(e, n) {
880
+ const s = e.source.body, a = s.length;
881
+ let r = n + 1;
882
+ for (; r < a; ) {
883
+ const o = s.charCodeAt(r);
884
+ if (Ys(o))
885
+ ++r;
886
+ else
887
+ break;
888
+ }
889
+ return O(
890
+ e,
891
+ v.NAME,
892
+ n,
893
+ r,
894
+ s.slice(n, r)
895
+ );
896
+ }
897
+ const hr = 10, nn = 2;
898
+ function sn(e) {
899
+ return Le(e, []);
900
+ }
901
+ function Le(e, n) {
902
+ switch (typeof e) {
903
+ case "string":
904
+ return JSON.stringify(e);
905
+ case "function":
906
+ return e.name ? `[function ${e.name}]` : "[function]";
907
+ case "object":
908
+ return fr(e, n);
909
+ default:
910
+ return String(e);
911
+ }
912
+ }
913
+ function fr(e, n) {
914
+ if (e === null)
915
+ return "null";
916
+ if (n.includes(e))
917
+ return "[Circular]";
918
+ const s = [...n, e];
919
+ if (gr(e)) {
920
+ const a = e.toJSON();
921
+ if (a !== e)
922
+ return typeof a == "string" ? a : Le(a, s);
923
+ } else if (Array.isArray(e))
924
+ return yr(e, s);
925
+ return xr(e, s);
926
+ }
927
+ function gr(e) {
928
+ return typeof e.toJSON == "function";
929
+ }
930
+ function xr(e, n) {
931
+ const s = Object.entries(e);
932
+ return s.length === 0 ? "{}" : n.length > nn ? "[" + vr(e) + "]" : "{ " + s.map(
933
+ ([r, o]) => r + ": " + Le(o, n)
934
+ ).join(", ") + " }";
935
+ }
936
+ function yr(e, n) {
937
+ if (e.length === 0)
938
+ return "[]";
939
+ if (n.length > nn)
940
+ return "[Array]";
941
+ const s = Math.min(hr, e.length), a = e.length - s, r = [];
942
+ for (let o = 0; o < s; ++o)
943
+ r.push(Le(e[o], n));
944
+ return a === 1 ? r.push("... 1 more item") : a > 1 && r.push(`... ${a} more items`), "[" + r.join(", ") + "]";
945
+ }
946
+ function vr(e) {
947
+ const n = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
948
+ if (n === "Object" && typeof e.constructor == "function") {
949
+ const s = e.constructor.name;
950
+ if (typeof s == "string" && s !== "")
951
+ return s;
952
+ }
953
+ return n;
954
+ }
955
+ const br = globalThis.process && // eslint-disable-next-line no-undef
956
+ process.env.NODE_ENV === "production", jr = (
957
+ /* c8 ignore next 6 */
958
+ // FIXME: https://github.com/graphql/graphql-js/issues/2317
959
+ br ? function(n, s) {
960
+ return n instanceof s;
961
+ } : function(n, s) {
962
+ if (n instanceof s)
963
+ return !0;
964
+ if (typeof n == "object" && n !== null) {
965
+ var a;
966
+ const r = s.prototype[Symbol.toStringTag], o = (
967
+ // We still need to support constructor's name to detect conflicts with older versions of this library.
968
+ Symbol.toStringTag in n ? n[Symbol.toStringTag] : (a = n.constructor) === null || a === void 0 ? void 0 : a.name
969
+ );
970
+ if (r === o) {
971
+ const i = sn(n);
972
+ throw new Error(`Cannot use ${r} "${i}" from another module or realm.
973
+
974
+ Ensure that there is only one instance of "graphql" in the node_modules
975
+ directory. If different versions of "graphql" are the dependencies of other
976
+ relied on modules, use "resolutions" to ensure only one version is installed.
977
+
978
+ https://yarnpkg.com/en/docs/selective-version-resolutions
979
+
980
+ Duplicate "graphql" modules cannot be used at the same time since different
981
+ versions may have different capabilities and behavior. The data from one
982
+ version used in the function from another could produce confusing and
983
+ spurious results.`);
984
+ }
985
+ }
986
+ return !1;
987
+ }
988
+ );
989
+ class rn {
990
+ constructor(n, s = "GraphQL request", a = {
991
+ line: 1,
992
+ column: 1
993
+ }) {
994
+ typeof n == "string" || qe(!1, `Body must be a string. Received: ${sn(n)}.`), this.body = n, this.name = s, this.locationOffset = a, this.locationOffset.line > 0 || qe(
995
+ !1,
996
+ "line in locationOffset is 1-indexed and must be positive."
997
+ ), this.locationOffset.column > 0 || qe(
998
+ !1,
999
+ "column in locationOffset is 1-indexed and must be positive."
1000
+ );
1001
+ }
1002
+ get [Symbol.toStringTag]() {
1003
+ return "Source";
1004
+ }
1005
+ }
1006
+ function Cr(e) {
1007
+ return jr(e, rn);
1008
+ }
1009
+ function Nr(e) {
1010
+ const n = Cr(e) ? e : new rn(e), s = n.body, a = new sr(n);
1011
+ let r = "", o = !1;
1012
+ for (; a.advance().kind !== v.EOF; ) {
1013
+ const i = a.token, c = i.kind, l = !rr(i.kind);
1014
+ o && (l || i.kind === v.SPREAD) && (r += " ");
1015
+ const m = s.slice(i.start, i.end);
1016
+ c === v.BLOCK_STRING ? r += nr(i.value, {
1017
+ minimize: !0
1018
+ }) : r += m, o = l;
1019
+ }
1020
+ return r;
1021
+ }
1022
+ const an = Ft(
1023
+ void 0
1024
+ ), Za = ({
1025
+ children: e,
1026
+ client: n
1027
+ }) => /* @__PURE__ */ t.jsx(an.Provider, { value: n, children: e }), on = (e, n, ...[s]) => ({
1028
+ queryFn: () => e.fetch(n, s),
1029
+ queryKey: [Nr(n.toString()), s]
1030
+ }), Sr = (e, ...[n]) => {
1031
+ const s = ds(an);
1032
+ if (s === void 0)
1033
+ throw new Error("useGraphQL must be used within a GraphQLProvider");
1034
+ return on(s, e, ...n === void 0 ? [] : [n]);
1035
+ };
1036
+ class Y extends String {
1037
+ __apiType;
1038
+ value;
1039
+ __meta__;
1040
+ constructor(n, s) {
1041
+ super(n), this.value = n, this.__meta__ = s;
1042
+ }
1043
+ toString() {
1044
+ return this.value;
1045
+ }
1046
+ }
1047
+ const wr = new Y(
1048
+ `
1049
+ fragment OperationsFragment on OperationItem {
1050
+ slug
1051
+ summary
1052
+ method
1053
+ description
1054
+ operationId
1055
+ contentTypes
1056
+ path
1057
+ deprecated
1058
+ extensions
1059
+ servers {
1060
+ url
1061
+ description
1062
+ }
1063
+ parameters {
1064
+ name
1065
+ in
1066
+ description
1067
+ required
1068
+ schema
1069
+ style
1070
+ explode
1071
+ examples {
1072
+ name
1073
+ description
1074
+ externalValue
1075
+ value
1076
+ summary
1077
+ }
1078
+ }
1079
+ requestBody {
1080
+ content {
1081
+ mediaType
1082
+ encoding {
1083
+ name
1084
+ }
1085
+ examples {
1086
+ name
1087
+ description
1088
+ externalValue
1089
+ value
1090
+ summary
1091
+ }
1092
+ schema
1093
+ }
1094
+ description
1095
+ required
1096
+ }
1097
+ responses {
1098
+ statusCode
1099
+ links
1100
+ description
1101
+ content {
1102
+ examples {
1103
+ name
1104
+ description
1105
+ externalValue
1106
+ value
1107
+ summary
1108
+ }
1109
+ mediaType
1110
+ encoding {
1111
+ name
1112
+ }
1113
+ schema
1114
+ }
1115
+ }
1116
+ }
1117
+ `,
1118
+ { fragmentName: "OperationsFragment" }
1119
+ ), Tr = new Y(`
1120
+ query ServersQuery($input: JSON!, $type: SchemaType!) {
1121
+ schema(input: $input, type: $type) {
1122
+ url
1123
+ servers {
1124
+ url
1125
+ }
1126
+ }
1127
+ }
1128
+ `), Ar = new Y(`
1129
+ query SchemaWarmup($input: JSON!, $type: SchemaType!) {
1130
+ schema(input: $input, type: $type) {
1131
+ openapi
1132
+ }
1133
+ }
1134
+ `), $r = new Y(`
1135
+ query OperationsForTag($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
1136
+ schema(input: $input, type: $type) {
1137
+ servers {
1138
+ url
1139
+ }
1140
+ description
1141
+ summary
1142
+ title
1143
+ url
1144
+ version
1145
+ tag(slug: $tag, untagged: $untagged) {
1146
+ name
1147
+ description
1148
+ operations {
1149
+ slug
1150
+ ...OperationsFragment
1151
+ }
1152
+ extensions
1153
+ next {
1154
+ name
1155
+ slug
1156
+ extensions
1157
+ }
1158
+ prev {
1159
+ name
1160
+ slug
1161
+ extensions
1162
+ }
1163
+ }
1164
+ }
1165
+ }
1166
+ fragment OperationsFragment on OperationItem {
1167
+ slug
1168
+ summary
1169
+ method
1170
+ description
1171
+ operationId
1172
+ contentTypes
1173
+ path
1174
+ deprecated
1175
+ extensions
1176
+ servers {
1177
+ url
1178
+ description
1179
+ }
1180
+ parameters {
1181
+ name
1182
+ in
1183
+ description
1184
+ required
1185
+ schema
1186
+ style
1187
+ explode
1188
+ examples {
1189
+ name
1190
+ description
1191
+ externalValue
1192
+ value
1193
+ summary
1194
+ }
1195
+ }
1196
+ requestBody {
1197
+ content {
1198
+ mediaType
1199
+ encoding {
1200
+ name
1201
+ }
1202
+ examples {
1203
+ name
1204
+ description
1205
+ externalValue
1206
+ value
1207
+ summary
1208
+ }
1209
+ schema
1210
+ }
1211
+ description
1212
+ required
1213
+ }
1214
+ responses {
1215
+ statusCode
1216
+ links
1217
+ description
1218
+ content {
1219
+ examples {
1220
+ name
1221
+ description
1222
+ externalValue
1223
+ value
1224
+ summary
1225
+ }
1226
+ mediaType
1227
+ encoding {
1228
+ name
1229
+ }
1230
+ schema
1231
+ }
1232
+ }
1233
+ }`), Or = new Y(`
1234
+ query GetSchemas($input: JSON!, $type: SchemaType!) {
1235
+ schema(input: $input, type: $type) {
1236
+ title
1237
+ description
1238
+ summary
1239
+ components {
1240
+ schemas {
1241
+ name
1242
+ schema
1243
+ extensions
1244
+ }
1245
+ }
1246
+ }
1247
+ }
1248
+ `), Pr = new Y(`
1249
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
1250
+ schema(input: $input, type: $type) {
1251
+ url
1252
+ servers {
1253
+ url
1254
+ }
1255
+ }
1256
+ }
1257
+ `), Lr = new Y(`
1258
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
1259
+ schema(input: $input, type: $type) {
1260
+ extensions
1261
+ tags {
1262
+ slug
1263
+ name
1264
+ extensions
1265
+ operations {
1266
+ summary
1267
+ slug
1268
+ method
1269
+ operationId
1270
+ path
1271
+ }
1272
+ }
1273
+ components {
1274
+ schemas {
1275
+ __typename
1276
+ }
1277
+ }
1278
+ }
1279
+ }
1280
+ `), kr = {
1281
+ "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": Tr,
1282
+ "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n deprecated\n extensions\n servers {\n url\n description\n }\n parameters {\n name\n in\n description\n required\n schema\n style\n explode\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": wr,
1283
+ "\n query SchemaWarmup($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n openapi\n }\n }\n": Ar,
1284
+ "\n query OperationsForTag(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n servers {\n url\n }\n description\n summary\n title\n url\n version\n tag(slug: $tag, untagged: $untagged) {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n extensions\n next {\n name\n slug\n extensions\n }\n prev {\n name\n slug\n extensions\n }\n }\n }\n }\n": $r,
1285
+ "\n query GetSchemas($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n title\n description\n summary\n components {\n schemas {\n name\n schema\n extensions\n }\n }\n }\n }\n": Or,
1286
+ "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": Pr,
1287
+ "\n query GetNavigationOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n extensions\n tags {\n slug\n name\n extensions\n operations {\n summary\n slug\n method\n operationId\n path\n }\n }\n components {\n schemas {\n __typename\n }\n }\n }\n }\n": Lr
1288
+ };
1289
+ function Rr(e) {
1290
+ return kr[e] ?? {};
1291
+ }
1292
+ function B({
1293
+ ...e
1294
+ }) {
1295
+ return /* @__PURE__ */ t.jsx(tt.Root, { "data-slot": "collapsible", ...e });
1296
+ }
1297
+ function de({
1298
+ ...e
1299
+ }) {
1300
+ return /* @__PURE__ */ t.jsx(
1301
+ tt.CollapsibleTrigger,
1302
+ {
1303
+ "data-slot": "collapsible-trigger",
1304
+ ...e
1305
+ }
1306
+ );
1307
+ }
1308
+ function _({
1309
+ ...e
1310
+ }) {
1311
+ return /* @__PURE__ */ t.jsx(
1312
+ tt.CollapsibleContent,
1313
+ {
1314
+ "data-slot": "collapsible-content",
1315
+ ...e
1316
+ }
1317
+ );
1318
+ }
1319
+ function Er() {
1320
+ const n = navigator.userAgent.toLowerCase();
1321
+ if (n.indexOf("win") !== -1)
1322
+ return "windows";
1323
+ if (n.indexOf("mac") !== -1)
1324
+ return "apple";
1325
+ if (n.indexOf("linux") !== -1)
1326
+ return "linux";
1327
+ if (n.indexOf("x11") !== -1)
1328
+ return "unix";
1329
+ }
1330
+ function Ir() {
1331
+ return Er() === "apple";
1332
+ }
1333
+ const Dr = {
1334
+ other: {
1335
+ alt: "Alt",
1336
+ meta: "Ctrl",
1337
+ ctrl: "Ctrl",
1338
+ shift: "⇧",
1339
+ option: "Alt"
1340
+ },
1341
+ apple: {
1342
+ alt: "⌥",
1343
+ meta: "⌘",
1344
+ ctrl: "Ctrl",
1345
+ shift: "⇧",
1346
+ option: "⌥"
1347
+ }
1348
+ }, Fr = (e, n) => {
1349
+ const s = e.toLowerCase().split("+"), a = s.includes("meta"), r = s.includes("shift"), o = s.includes("option") || s.includes("alt"), i = s.includes("ctrl"), c = e.split("+").pop(), l = R(n);
1350
+ return G(() => {
1351
+ l.current = n;
1352
+ }, [n]), G(() => {
1353
+ const m = (d) => {
1354
+ (d.code === `Key${c?.toUpperCase()}` || d.code.toLowerCase() === c?.toLowerCase()) && d.metaKey === a && d.shiftKey === r && d.altKey === o && d.ctrlKey === i && (d.preventDefault(), l.current());
1355
+ };
1356
+ return window.addEventListener("keydown", m), () => {
1357
+ window.removeEventListener("keydown", m);
1358
+ };
1359
+ }, [c, a, r, o, i]), {
1360
+ trigger: () => l.current(),
1361
+ label: s.map(
1362
+ (m) => m === "meta" || m === "ctrl" || m === "alt" || m === "shift" || m === "option" ? Dr[Ir() ? "apple" : "other"][m] : m
1363
+ )
1364
+ };
1365
+ }, zr = Ke()(
1366
+ Xe(
1367
+ (e) => ({
1368
+ selectedServer: void 0,
1369
+ setSelectedServer: (n) => e({ selectedServer: n })
1370
+ }),
1371
+ { name: "zudoku-selected-server" }
1372
+ )
1373
+ ), Vr = (e) => {
1374
+ const { selectedServer: n, setSelectedServer: s } = zr();
1375
+ return { selectedServer: zt(
1376
+ () => n && e.some((r) => r.url === n) ? n : e.at(0)?.url ?? "",
1377
+ [n, e]
1378
+ ), setSelectedServer: s };
1379
+ }, ln = Q.forwardRef(
1380
+ ({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
1381
+ "textarea",
1382
+ {
1383
+ className: w(
1384
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1385
+ e
1386
+ ),
1387
+ ref: s,
1388
+ ...n
1389
+ }
1390
+ )
1391
+ );
1392
+ ln.displayName = "Textarea";
1393
+ const ke = (e = 0) => {
1394
+ if (e === 0)
1395
+ return "0 B";
1396
+ const n = Math.floor(Math.log(e) / Math.log(1e3));
1397
+ return `${(e / 1e3 ** n).toFixed(n ? 2 : 0)} ${n ? `${"kMGTPEZY"[n - 1]}B` : "B"}`;
1398
+ }, Z = ({
1399
+ children: e,
1400
+ className: n
1401
+ }) => /* @__PURE__ */ t.jsxs(
1402
+ "div",
1403
+ {
1404
+ className: w(
1405
+ "grid grid-cols-[max-content_1fr_max-content] items-center gap-2 group bg-muted w-full h-10 ps-4 pe-2 border-b",
1406
+ n
1407
+ ),
1408
+ children: [
1409
+ e,
1410
+ /* @__PURE__ */ t.jsxs(
1411
+ de,
1412
+ {
1413
+ className: w(
1414
+ "flex items-center gap-4 group bg-muted w-full p-2 hover:bg-accent hover:brightness-95 opacity-75 rounded-md",
1415
+ n
1416
+ ),
1417
+ children: [
1418
+ /* @__PURE__ */ t.jsx(
1419
+ Ln,
1420
+ {
1421
+ className: "group-data-[state=closed]:hidden shrink-0",
1422
+ size: 14
1423
+ }
1424
+ ),
1425
+ /* @__PURE__ */ t.jsx(
1426
+ kn,
1427
+ {
1428
+ className: "group-data-[state=open]:hidden shrink-0",
1429
+ size: 14
1430
+ }
1431
+ )
1432
+ ]
1433
+ }
1434
+ )
1435
+ ]
1436
+ }
1437
+ ), H = ({
1438
+ children: e,
1439
+ className: n
1440
+ }) => /* @__PURE__ */ t.jsx("span", { className: w("font-semibold w-full text-start", n), children: e }), Br = ({
1441
+ examples: e,
1442
+ onSelect: n
1443
+ }) => /* @__PURE__ */ t.jsxs(Ht, { children: [
1444
+ /* @__PURE__ */ t.jsx(Qt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
1445
+ q,
1446
+ {
1447
+ variant: "ghost",
1448
+ size: "sm",
1449
+ className: "hover:bg-accent hover:brightness-95 gap-2",
1450
+ children: [
1451
+ "Use Example",
1452
+ /* @__PURE__ */ t.jsx(Qe, { size: 14 })
1453
+ ]
1454
+ }
1455
+ ) }),
1456
+ /* @__PURE__ */ t.jsx(Jt, { className: "max-w-72", children: e.map((s) => /* @__PURE__ */ t.jsxs("div", { children: [
1457
+ /* @__PURE__ */ t.jsx(Ls, { children: s.mediaType }),
1458
+ /* @__PURE__ */ t.jsx(ks, {}),
1459
+ /* @__PURE__ */ t.jsx(Rs, { children: s.examples?.map((a) => /* @__PURE__ */ t.jsx(
1460
+ Ae,
1461
+ {
1462
+ onSelect: () => n(a, s.mediaType),
1463
+ children: /* @__PURE__ */ t.jsx(
1464
+ "span",
1465
+ {
1466
+ className: "line-clamp-1",
1467
+ title: a.summary ?? a.name,
1468
+ children: a.summary ?? a.name
1469
+ }
1470
+ )
1471
+ },
1472
+ a.name
1473
+ )) })
1474
+ ] }, s.mediaType)) })
1475
+ ] }), cn = Q.forwardRef(
1476
+ ({ className: e, type: n, ...s }, a) => /* @__PURE__ */ t.jsx(
1477
+ "input",
1478
+ {
1479
+ type: n,
1480
+ className: w(
1481
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1482
+ e
1483
+ ),
1484
+ ref: a,
1485
+ ...s
1486
+ }
1487
+ )
1488
+ );
1489
+ cn.displayName = "Input";
1490
+ const ye = (e, n) => {
1491
+ const s = Q.forwardRef(({ className: a, asChild: r, ...o }, i) => {
1492
+ const c = r ? Es : e;
1493
+ return Q.createElement(c, {
1494
+ ...o,
1495
+ ref: i,
1496
+ className: typeof n == "function" ? n({ className: a }) : w(n, a)
1497
+ });
1498
+ });
1499
+ return s.displayName = typeof e == "string" ? `VariantComponent(${e})` : `VariantComponent(${e.displayName || e.name || "Component"})`, s;
1500
+ }, Re = ye(
1501
+ "div",
1502
+ "grid grid-cols-[min-content_2fr_3fr] items-center gap-x-5 [&>*:last-child_[data-slot=remove-button]]:invisible"
1503
+ ), xe = ye(
1504
+ "div",
1505
+ "group h-9 hover:bg-accent/75 ps-4 pe-2 grid col-span-full grid-cols-subgrid items-center border-b"
1506
+ ), I = ye(
1507
+ cn,
1508
+ "w-full truncate border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono"
1509
+ ), st = ({
1510
+ onClick: e,
1511
+ className: n
1512
+ }) => /* @__PURE__ */ t.jsx(
1513
+ he,
1514
+ {
1515
+ size: "icon-xs",
1516
+ variant: "ghost",
1517
+ className: w(
1518
+ "text-muted-foreground opacity-0 group-hover:brightness-95 focus-visible:opacity-100 group-hover:opacity-100",
1519
+ n
1520
+ ),
1521
+ onClick: e,
1522
+ type: "button",
1523
+ "data-slot": "remove-button",
1524
+ children: /* @__PURE__ */ t.jsx(Rt, { size: 14 })
1525
+ }
1526
+ );
1527
+ function ve({
1528
+ className: e,
1529
+ ...n
1530
+ }) {
1531
+ return /* @__PURE__ */ t.jsx(
1532
+ St.Root,
1533
+ {
1534
+ "data-slot": "checkbox",
1535
+ className: w(
1536
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1537
+ e
1538
+ ),
1539
+ ...n,
1540
+ children: /* @__PURE__ */ t.jsx(
1541
+ St.Indicator,
1542
+ {
1543
+ "data-slot": "checkbox-indicator",
1544
+ className: "grid place-content-center text-current transition-none",
1545
+ children: /* @__PURE__ */ t.jsx(Et, { className: "size-3.5" })
1546
+ }
1547
+ )
1548
+ }
1549
+ );
1550
+ }
1551
+ const _r = ({ index: e, manager: n }) => {
1552
+ const s = R(null), a = n.getValue(e, "value");
1553
+ return /* @__PURE__ */ t.jsxs(xe, { children: [
1554
+ /* @__PURE__ */ t.jsx(
1555
+ ve,
1556
+ {
1557
+ ...n.getCheckboxProps(e),
1558
+ disabled: !n.getValue(e, "name")
1559
+ }
1560
+ ),
1561
+ /* @__PURE__ */ t.jsx(
1562
+ I,
1563
+ {
1564
+ ...n.getNameInputProps(e),
1565
+ placeholder: "Key"
1566
+ }
1567
+ ),
1568
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 flex-1", children: [
1569
+ a instanceof File ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [
1570
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 border-b cursor-default", children: [
1571
+ /* @__PURE__ */ t.jsx(me, { size: 12, className: "text-muted-foreground" }),
1572
+ /* @__PURE__ */ t.jsx(
1573
+ "span",
1574
+ {
1575
+ className: "text-xs truncate",
1576
+ title: `${a.name} (${ke(a.size)})`,
1577
+ children: a.name
1578
+ }
1579
+ )
1580
+ ] }),
1581
+ /* @__PURE__ */ t.jsx(
1582
+ he,
1583
+ {
1584
+ type: "button",
1585
+ variant: "ghost",
1586
+ size: "icon-xs",
1587
+ className: "opacity-50 hover:opacity-100 hover:brightness-95 transition-opacity",
1588
+ onClick: () => n.setValue(e, "value", ""),
1589
+ children: /* @__PURE__ */ t.jsx(Rn, { size: 13 })
1590
+ }
1591
+ )
1592
+ ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1593
+ /* @__PURE__ */ t.jsx(
1594
+ I,
1595
+ {
1596
+ ...n.getValueInputProps(e),
1597
+ placeholder: "Value"
1598
+ }
1599
+ ),
1600
+ /* @__PURE__ */ t.jsx(
1601
+ "input",
1602
+ {
1603
+ ref: s,
1604
+ type: "file",
1605
+ className: "hidden",
1606
+ onChange: (r) => {
1607
+ const o = r.target.files?.[0];
1608
+ o && (n.setValue(e, "value", o), n.setValue(e, "active", !0));
1609
+ }
1610
+ }
1611
+ ),
1612
+ /* @__PURE__ */ t.jsx(
1613
+ he,
1614
+ {
1615
+ type: "button",
1616
+ variant: "ghost",
1617
+ size: "icon-xs",
1618
+ onClick: () => s.current?.click(),
1619
+ title: "Attach file",
1620
+ className: "opacity-0 focus-visible:opacity-100 group-hover:opacity-100 group-hover:brightness-95 transition-opacity",
1621
+ children: /* @__PURE__ */ t.jsx(me, { size: 14 })
1622
+ }
1623
+ )
1624
+ ] }),
1625
+ /* @__PURE__ */ t.jsx(st, { ...n.getRemoveButtonProps(e) })
1626
+ ] })
1627
+ ] });
1628
+ }, rt = (e) => {
1629
+ const {
1630
+ control: n,
1631
+ name: s,
1632
+ defaultValue: a,
1633
+ isEmpty: r,
1634
+ shouldSetActive: o
1635
+ } = e, {
1636
+ setValue: i,
1637
+ watch: c,
1638
+ setFocus: l,
1639
+ register: m
1640
+ } = ae(), { fields: d, append: h, remove: x } = Gt({ control: n, name: s }), f = c(s), b = R(-1), u = R(-1), y = D(
1641
+ (g, C, T, A) => {
1642
+ (C === "value" || C === "name") && (b.current = g), i(`${s}.${g}.${C}`, T), A?.focus === "next" ? l(
1643
+ C === "name" ? `${s}.${g}.value` : `${s}.${g + 1}.name`
1644
+ ) : A?.focus === "previous" && l(
1645
+ C === "name" ? `${s}.${g - 1}.value` : `${s}.${g}.name`
1646
+ );
1647
+ },
1648
+ [s, i, l]
1649
+ ), S = D(
1650
+ (g) => r ? r(g) : !g.name && !g.value,
1651
+ [r]
1652
+ ), N = D(
1653
+ (g) => o ? o(g) : !!(g.name || g.value),
1654
+ [o]
1655
+ );
1656
+ G(() => {
1657
+ if (!f) return;
1658
+ if (u.current === -1) {
1659
+ u.current = f.length, f.length === 0 && h(a, {
1660
+ shouldFocus: !1
1661
+ });
1662
+ return;
1663
+ }
1664
+ if (u.current = f.length, f.length === 0) {
1665
+ h(a, {
1666
+ shouldFocus: !1
1667
+ });
1668
+ return;
1669
+ }
1670
+ if (f.length > 1) {
1671
+ const C = [];
1672
+ for (let T = 0; T < f.length - 1; T++) {
1673
+ const A = f[T];
1674
+ A && S(A) && !N(A) && C.push(T);
1675
+ }
1676
+ if (C.length > 0) {
1677
+ const T = C[0];
1678
+ if (T === void 0) return;
1679
+ for (let A = C.length - 1; A >= 0; A--) {
1680
+ const M = C[A];
1681
+ M !== void 0 && x(M);
1682
+ }
1683
+ if (b.current === T) {
1684
+ const A = f.length - C.length;
1685
+ T < A ? l(`${s}.${T}.name`) : T > 0 ? l(`${s}.${T - 1}.name`) : l(`${s}.0.name`);
1686
+ }
1687
+ b.current = -1;
1688
+ }
1689
+ }
1690
+ const g = f[f.length - 1];
1691
+ g && !S(g) && h(a, {
1692
+ shouldFocus: !1
1693
+ });
1694
+ }, [
1695
+ f,
1696
+ h,
1697
+ x,
1698
+ a,
1699
+ S,
1700
+ s,
1701
+ l,
1702
+ N
1703
+ ]), G(() => {
1704
+ if (!f) return;
1705
+ const g = [];
1706
+ for (let C = 0; C < f.length; C++) {
1707
+ const T = f[C];
1708
+ if (!T) continue;
1709
+ const A = N(T);
1710
+ T.active !== A && g.push(() => y(C, "active", A));
1711
+ }
1712
+ g.length !== 0 && us(() => g.forEach((C) => C()));
1713
+ }, [f, N, y]);
1714
+ const k = D(
1715
+ (g) => {
1716
+ const C = f?.[g];
1717
+ return C ? S(C) : !0;
1718
+ },
1719
+ [f, S]
1720
+ ), j = D(
1721
+ (g, C) => {
1722
+ const T = C === "name" ? `${s}.${g}.value` : `${s}.${g + 1}.name`, A = C === "name" ? `${s}.${g - 1}.value` : `${s}.${g}.name`, M = C === "value" || g > 0;
1723
+ return (L) => {
1724
+ if (!(L.target instanceof HTMLInputElement)) return;
1725
+ const De = L.target.selectionStart === 0, te = L.target.selectionStart === L.target.value.length, je = !L.target.value;
1726
+ L.key === "Enter" ? l(T) : L.key === "Backspace" && je && M || L.key === "ArrowLeft" && De && M ? (L.preventDefault(), l(A)) : L.key === "ArrowRight" && te && (L.preventDefault(), l(T));
1727
+ };
1728
+ },
1729
+ [s, l]
1730
+ ), P = D(
1731
+ (g) => ({
1732
+ ...m(`${s}.${g}.name`),
1733
+ onChange: (C) => y(g, "name", C.target.value),
1734
+ onKeyDown: j(g, "name")
1735
+ }),
1736
+ [m, s, y, j]
1737
+ ), ie = D(
1738
+ (g) => ({
1739
+ ...m(`${s}.${g}.value`),
1740
+ onChange: (C) => y(g, "value", C.target.value),
1741
+ onKeyDown: j(g, "value")
1742
+ }),
1743
+ [m, s, y, j]
1744
+ ), be = D(
1745
+ (g) => ({
1746
+ ...m(`${s}.${g}.active`),
1747
+ checked: c(`${s}.${g}.active`) ?? !1,
1748
+ disabled: k(g),
1749
+ onCheckedChange: (C) => {
1750
+ y(g, "active", C === !0);
1751
+ }
1752
+ }),
1753
+ [s, m, k, c, y]
1754
+ ), Ie = D(
1755
+ (g, C) => f?.[g]?.[C],
1756
+ [f]
1757
+ ), ee = D(
1758
+ (g) => ({
1759
+ onClick: () => x(g),
1760
+ disabled: g === d.length - 1
1761
+ }),
1762
+ [x, d.length]
1763
+ );
1764
+ return {
1765
+ fields: d,
1766
+ getNameInputProps: P,
1767
+ getValueInputProps: ie,
1768
+ getCheckboxProps: be,
1769
+ getRemoveButtonProps: ee,
1770
+ setValue: y,
1771
+ getValue: Ie
1772
+ };
1773
+ }, qr = ({ content: e }) => {
1774
+ const { register: n, setValue: s, watch: a, control: r } = ae(), o = (e ?? []).flatMap((j) => j.examples), [i, c, l, m, d] = a([
1775
+ "headers",
1776
+ "file",
1777
+ "bodyMode",
1778
+ "body",
1779
+ "multipartFormFields"
1780
+ ]), h = R(null), [x, f] = E(!1), b = (j) => {
1781
+ s("file", j), j && s(
1782
+ "headers",
1783
+ i.filter(
1784
+ (P) => P.name.toLowerCase() !== "content-type" || !P.active
1785
+ )
1786
+ );
1787
+ }, u = (j) => {
1788
+ const P = j.target.files?.[0] ?? null;
1789
+ b(P);
1790
+ }, y = (j) => {
1791
+ j.preventDefault(), j.stopPropagation(), f(!0);
1792
+ }, S = (j) => {
1793
+ j.preventDefault(), j.stopPropagation(), f(!1);
1794
+ }, N = (j) => {
1795
+ j.preventDefault(), j.stopPropagation(), f(!1);
1796
+ const P = j.dataTransfer.files?.[0] ?? null;
1797
+ b(P);
1798
+ }, k = rt({
1799
+ control: r,
1800
+ name: "multipartFormFields",
1801
+ defaultValue: { name: "", value: "", active: !1 },
1802
+ isEmpty: (j) => j.value instanceof File ? !1 : !j.name && !j.value
1803
+ });
1804
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
1805
+ /* @__PURE__ */ t.jsxs(Z, { className: "items-center", children: [
1806
+ /* @__PURE__ */ t.jsx(En, { size: 16 }),
1807
+ /* @__PURE__ */ t.jsxs(H, { className: "flex items-center justify-between", children: [
1808
+ "Body",
1809
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1810
+ /* @__PURE__ */ t.jsxs(Ht, { children: [
1811
+ /* @__PURE__ */ t.jsx(Qt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
1812
+ he,
1813
+ {
1814
+ variant: "ghost",
1815
+ size: "sm",
1816
+ className: "hover:bg-accent hover:brightness-95 gap-2",
1817
+ children: [
1818
+ l === "text" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1819
+ /* @__PURE__ */ t.jsx(gt, { size: 14 }),
1820
+ "Text"
1821
+ ] }) : l === "file" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1822
+ /* @__PURE__ */ t.jsx(me, { size: 14 }),
1823
+ "File"
1824
+ ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1825
+ /* @__PURE__ */ t.jsx(xt, { size: 14 }),
1826
+ "Multipart"
1827
+ ] }),
1828
+ /* @__PURE__ */ t.jsx(In, { size: 14 })
1829
+ ]
1830
+ }
1831
+ ) }),
1832
+ /* @__PURE__ */ t.jsxs(Jt, { className: "min-w-40", children: [
1833
+ /* @__PURE__ */ t.jsxs(
1834
+ Ae,
1835
+ {
1836
+ onSelect: () => s("bodyMode", "text"),
1837
+ className: "gap-2",
1838
+ children: [
1839
+ /* @__PURE__ */ t.jsx(gt, { size: 14 }),
1840
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "Text" }),
1841
+ /* @__PURE__ */ t.jsx("span", { children: m.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1842
+ ]
1843
+ }
1844
+ ),
1845
+ /* @__PURE__ */ t.jsxs(
1846
+ Ae,
1847
+ {
1848
+ onSelect: () => s("bodyMode", "file"),
1849
+ className: "gap-2",
1850
+ children: [
1851
+ /* @__PURE__ */ t.jsx(me, { size: 14 }),
1852
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "File" }),
1853
+ /* @__PURE__ */ t.jsx("span", { children: c && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1854
+ ]
1855
+ }
1856
+ ),
1857
+ /* @__PURE__ */ t.jsxs(
1858
+ Ae,
1859
+ {
1860
+ onSelect: () => s("bodyMode", "multipart"),
1861
+ className: "gap-2",
1862
+ children: [
1863
+ /* @__PURE__ */ t.jsx(xt, { size: 14, strokeWidth: 1.5 }),
1864
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "Multipart" }),
1865
+ /* @__PURE__ */ t.jsx("span", { children: d?.some((j) => j.active) && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1866
+ ]
1867
+ }
1868
+ )
1869
+ ] })
1870
+ ] }),
1871
+ /* @__PURE__ */ t.jsx(
1872
+ "input",
1873
+ {
1874
+ ref: h,
1875
+ type: "file",
1876
+ className: "hidden",
1877
+ onChange: u
1878
+ }
1879
+ ),
1880
+ /* @__PURE__ */ t.jsx("div", { className: "w-px mx-1 h-5 bg-border" }),
1881
+ e && o.length > 0 ? /* @__PURE__ */ t.jsx(
1882
+ Br,
1883
+ {
1884
+ examples: e,
1885
+ onSelect: (j, P) => {
1886
+ s("body", JSON.stringify(j.value, null, 2)), s("headers", [
1887
+ ...i.filter((ie) => ie.name !== "Content-Type"),
1888
+ {
1889
+ name: "Content-Type",
1890
+ value: P,
1891
+ active: !0
1892
+ }
1893
+ ]);
1894
+ }
1895
+ }
1896
+ ) : /* @__PURE__ */ t.jsx("div", {})
1897
+ ] })
1898
+ ] })
1899
+ ] }),
1900
+ /* @__PURE__ */ t.jsxs(_, { className: "CollapsibleContent flex flex-col gap-2", children: [
1901
+ l === "text" && /* @__PURE__ */ t.jsx(
1902
+ ln,
1903
+ {
1904
+ ...n("body"),
1905
+ className: w(
1906
+ "w-full px-4 py-2.5 h-64 font-mono md:text-xs border-none rounded-none focus-visible:ring-0 transition-colors"
1907
+ ),
1908
+ placeholder: "Body content"
1909
+ }
1910
+ ),
1911
+ l === "file" && /* @__PURE__ */ t.jsxs(
1912
+ "div",
1913
+ {
1914
+ role: "region",
1915
+ "aria-label": "File upload drop zone",
1916
+ className: w(
1917
+ "flex flex-col items-center justify-center gap-4 min-h-[300px]"
1918
+ ),
1919
+ onDragOver: y,
1920
+ onDragLeave: S,
1921
+ onDrop: N,
1922
+ children: [
1923
+ /* @__PURE__ */ t.jsx(
1924
+ "button",
1925
+ {
1926
+ type: "button",
1927
+ onClick: () => h.current?.click(),
1928
+ className: w(
1929
+ "flex items-center justify-center gap-2 rounded-full size-20 p-0 border border-dashed border-muted-foreground/50 hover:bg-accent/75 transition-colors",
1930
+ (c || x) && "border-solid",
1931
+ x && "bg-accent border-primary"
1932
+ ),
1933
+ children: /* @__PURE__ */ t.jsx(
1934
+ me,
1935
+ {
1936
+ className: w(
1937
+ "text-muted-foreground",
1938
+ x && "text-primary"
1939
+ ),
1940
+ size: 30
1941
+ }
1942
+ )
1943
+ }
1944
+ ),
1945
+ c ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-2 px-2 py-1.5 rounded-md border", children: [
1946
+ /* @__PURE__ */ t.jsxs("span", { className: "text-sm truncate", title: c.name, children: [
1947
+ c.name,
1948
+ " ",
1949
+ /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
1950
+ "(",
1951
+ ke(c.size),
1952
+ ")"
1953
+ ] })
1954
+ ] }),
1955
+ /* @__PURE__ */ t.jsx(
1956
+ he,
1957
+ {
1958
+ type: "button",
1959
+ variant: "ghost",
1960
+ size: "icon-xxs",
1961
+ onClick: () => b(null),
1962
+ children: /* @__PURE__ */ t.jsx(Rt, { size: 14 })
1963
+ }
1964
+ )
1965
+ ] }) : /* @__PURE__ */ t.jsx("span", { className: "text-lg font-semibold text-muted-foreground", children: "Select or drop a file" })
1966
+ ]
1967
+ }
1968
+ ),
1969
+ l === "multipart" && /* @__PURE__ */ t.jsx(Re, { children: k.fields.map((j, P) => /* @__PURE__ */ t.jsx(_r, { index: P, manager: k }, j.id)) })
1970
+ ] })
1971
+ ] });
1972
+ }, Ot = (e, n, s) => {
1973
+ const a = n.replace(/(:\w+|\{\w+})/g, (o) => {
1974
+ const i = o.replace(/[:{}]/g, "");
1975
+ return s.pathParams.find((l) => l.name === i)?.value ?? o;
1976
+ }), r = new URL(
1977
+ a.replace(/^\//, ""),
1978
+ e.endsWith("/") ? e : `${e}/`
1979
+ );
1980
+ return s.queryParams.filter((o) => o.active).forEach((o) => {
1981
+ r.searchParams.set(o.name, o.value);
1982
+ }), r;
1983
+ };
1984
+ function Mr(e) {
1985
+ return /^(application\/octet-stream|image\/|audio\/|video\/|font\/|application\/pdf|application\/zip|application\/x-protobuf|application\/x-binary)/i.test(
1986
+ e
1987
+ );
1988
+ }
1989
+ const Ur = (e, n) => {
1990
+ const s = e.find(
1991
+ ([a]) => a.toLowerCase() === "content-disposition"
1992
+ )?.[1];
1993
+ if (s) {
1994
+ const a = s.match(
1995
+ /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
1996
+ );
1997
+ if (a?.[1])
1998
+ return a[1].replace(/['"]/g, "");
1999
+ }
2000
+ try {
2001
+ const r = new URL(n).pathname.split("/").pop() || "download";
2002
+ return r.includes(".") ? r : "download";
2003
+ } catch {
2004
+ return "download";
2005
+ }
2006
+ }, Gr = $e.Root, dn = Q.forwardRef(({ className: e, align: n = "center", sideOffset: s = 4, ...a }, r) => /* @__PURE__ */ t.jsx($e.Portal, { children: /* @__PURE__ */ t.jsx(
2007
+ $e.Content,
2008
+ {
2009
+ ref: r,
2010
+ align: n,
2011
+ sideOffset: s,
2012
+ className: w(
2013
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2014
+ e
2015
+ ),
2016
+ ...a
2017
+ }
2018
+ ) }));
2019
+ dn.displayName = $e.Content.displayName;
2020
+ const Hr = ({
2021
+ value: e,
2022
+ options: n,
2023
+ onChange: s,
2024
+ className: a,
2025
+ placeholder: r = "Value",
2026
+ onEnterPress: o,
2027
+ onKeyDown: i,
2028
+ ref: c,
2029
+ onSelect: l
2030
+ }) => {
2031
+ const [m, d] = E(!1), [h, x] = E(!1), f = Ds((u) => u.filtered.count), b = R(null);
2032
+ return /* @__PURE__ */ t.jsxs(Gr, { open: m, children: [
2033
+ /* @__PURE__ */ t.jsx(Is, { children: /* @__PURE__ */ t.jsx(
2034
+ zs,
2035
+ {
2036
+ autoComplete: "off",
2037
+ ref: (u) => {
2038
+ b.current = u, typeof c == "function" ? c(u) : c && (c.current = u);
2039
+ },
2040
+ value: e ? String(e) : void 0,
2041
+ placeholder: r,
2042
+ className: w("h-9 bg-transparent", a),
2043
+ onFocus: () => d(!0),
2044
+ onBlur: () => {
2045
+ h || d(!1);
2046
+ },
2047
+ onKeyDown: (u) => {
2048
+ i?.(u), !u.defaultPrevented && u.key === "Enter" && (d(!1), b.current?.blur(), o?.(u));
2049
+ },
2050
+ onValueChange: (u) => s(u)
2051
+ }
2052
+ ) }),
2053
+ /* @__PURE__ */ t.jsx(
2054
+ dn,
2055
+ {
2056
+ onMouseEnter: () => x(!0),
2057
+ onMouseLeave: () => x(!1),
2058
+ onOpenAutoFocus: (u) => u.preventDefault(),
2059
+ className: w("p-0 w-(--radix-popover-trigger-width)", {
2060
+ "border-0": f === 0
2061
+ }),
2062
+ align: "start",
2063
+ side: "bottom",
2064
+ onWheel: (u) => {
2065
+ u.stopPropagation();
2066
+ },
2067
+ onTouchMove: (u) => {
2068
+ u.stopPropagation();
2069
+ },
2070
+ children: /* @__PURE__ */ t.jsx(Vs, { className: "max-h-[140px]", children: n.map((u) => /* @__PURE__ */ t.jsx(
2071
+ Bs,
2072
+ {
2073
+ value: u,
2074
+ onSelect: (y) => {
2075
+ l?.(y), s(y), d(!1);
2076
+ },
2077
+ className: "cursor-pointer",
2078
+ children: u
2079
+ },
2080
+ u
2081
+ )) })
2082
+ }
2083
+ )
2084
+ ] });
2085
+ }, Oe = ({ shouldFilter: e, ...n }) => /* @__PURE__ */ t.jsx(Fs, { className: "bg-transparent", shouldFilter: e, children: /* @__PURE__ */ t.jsx(Hr, { ...n }) }), Qr = Object.freeze([
2086
+ "Accept",
2087
+ "Accept-Encoding",
2088
+ "Accept-Language",
2089
+ "Authorization",
2090
+ "Cache-Control",
2091
+ "Connection",
2092
+ "Content-Disposition",
2093
+ "Content-Encoding",
2094
+ "Content-Language",
2095
+ "Content-Length",
2096
+ "Content-Range",
2097
+ "Content-Security-Policy",
2098
+ "Content-Type",
2099
+ "Cookie",
2100
+ "Date",
2101
+ "ETag",
2102
+ "Expires",
2103
+ "Host",
2104
+ "If-Modified-Since",
2105
+ "Location",
2106
+ "Origin",
2107
+ "Pragma",
2108
+ "Referer",
2109
+ "Set-Cookie",
2110
+ "User-Agent",
2111
+ "X-Requested-With"
2112
+ ]), Jr = ({
2113
+ control: e,
2114
+ schemaHeaders: n,
2115
+ lockedHeaders: s
2116
+ }) => {
2117
+ const { watch: a, formState: r } = ae(), o = a("headers"), i = rt({
2118
+ control: e,
2119
+ name: "headers",
2120
+ defaultValue: { name: "", value: "", active: !1 }
2121
+ }), c = n.filter((d) => !o.some((h) => h.name === d.name)).map(({ name: d }) => d), l = i.fields.flatMap((d, h) => !s?.map((f) => f.toLowerCase()).includes(d.name.toLowerCase()) ? [] : [h]), m = s?.map((d) => ({
2122
+ name: d,
2123
+ id: `locked-${d}`,
2124
+ value: "••••••••••",
2125
+ active: !0,
2126
+ locked: !0
2127
+ })) ?? [];
2128
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2129
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2130
+ /* @__PURE__ */ t.jsx(Dn, { size: 14 }),
2131
+ /* @__PURE__ */ t.jsx(H, { children: "Headers" })
2132
+ ] }),
2133
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ t.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ t.jsxs(Re, { children: [
2134
+ m.map((d) => /* @__PURE__ */ t.jsxs(jt, { children: [
2135
+ /* @__PURE__ */ t.jsx(Ct, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
2136
+ xe,
2137
+ {
2138
+ className: "opacity-50 cursor-not-allowed font-mono text-xs min-h-10",
2139
+ children: [
2140
+ /* @__PURE__ */ t.jsx(Fn, { size: 16 }),
2141
+ /* @__PURE__ */ t.jsx(I, { value: d.name, disabled: !0 }),
2142
+ /* @__PURE__ */ t.jsx("div", { children: d.value })
2143
+ ]
2144
+ },
2145
+ d.id
2146
+ ) }),
2147
+ /* @__PURE__ */ t.jsx(Nt, { alignOffset: 10, side: "bottom", align: "start", children: /* @__PURE__ */ t.jsx("p", { children: "This header is set by the selected authentication." }) })
2148
+ ] }, d.id)),
2149
+ i.fields.map((d, h) => {
2150
+ const x = n.find(
2151
+ (S) => S.name === o.at(h)?.name
2152
+ ), f = x?.enum && x.enum.length > 0, b = l.includes(h), u = i.getNameInputProps(h), y = i.getValueInputProps(h);
2153
+ return /* @__PURE__ */ t.jsxs(
2154
+ xe,
2155
+ {
2156
+ className: w(
2157
+ b && "text-amber-600",
2158
+ b && !r.dirtyFields.headers?.[h]?.value && "hidden"
2159
+ ),
2160
+ children: [
2161
+ /* @__PURE__ */ t.jsx(
2162
+ ve,
2163
+ {
2164
+ className: w(b && "hidden"),
2165
+ ...i.getCheckboxProps(h)
2166
+ }
2167
+ ),
2168
+ /* @__PURE__ */ t.jsxs(jt, { children: [
2169
+ /* @__PURE__ */ t.jsx(Ct, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2170
+ zn,
2171
+ {
2172
+ className: w(
2173
+ "text-amber-600",
2174
+ !b && "hidden"
2175
+ ),
2176
+ size: 16
2177
+ }
2178
+ ) }),
2179
+ /* @__PURE__ */ t.jsx(
2180
+ Nt,
2181
+ {
2182
+ alignOffset: 10,
2183
+ side: "bottom",
2184
+ align: "start",
2185
+ children: /* @__PURE__ */ t.jsx("p", { children: "This header will be overwritten by the selected authentication." })
2186
+ }
2187
+ )
2188
+ ] }),
2189
+ /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2190
+ Oe,
2191
+ {
2192
+ ...u,
2193
+ value: String(i.getValue(h, "name")),
2194
+ placeholder: "Name",
2195
+ options: [...c, ...Qr],
2196
+ onChange: (S) => i.setValue(h, "name", S),
2197
+ onSelect: (S) => i.setValue(h, "name", S, { focus: "next" })
2198
+ }
2199
+ ) }),
2200
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2201
+ f ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2202
+ Oe,
2203
+ {
2204
+ ...y,
2205
+ value: String(i.getValue(h, "value")),
2206
+ shouldFilter: !1,
2207
+ options: x.enum ?? [],
2208
+ onChange: (S) => i.setValue(h, "value", S),
2209
+ onSelect: (S) => i.setValue(h, "value", S, { focus: "next" })
2210
+ }
2211
+ ) }) : /* @__PURE__ */ t.jsx(
2212
+ I,
2213
+ {
2214
+ placeholder: "Value",
2215
+ autoComplete: "off",
2216
+ ...y
2217
+ }
2218
+ ),
2219
+ /* @__PURE__ */ t.jsx(
2220
+ st,
2221
+ {
2222
+ ...i.getRemoveButtonProps(h)
2223
+ }
2224
+ )
2225
+ ] })
2226
+ ]
2227
+ },
2228
+ d.id
2229
+ );
2230
+ })
2231
+ ] }) }) }) })
2232
+ ] });
2233
+ }, Wr = qs(
2234
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
2235
+ ), Ee = Q.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2236
+ Wt.Root,
2237
+ {
2238
+ ref: s,
2239
+ className: w(Wr(), e),
2240
+ ...n
2241
+ }
2242
+ ));
2243
+ Ee.displayName = Wt.Root.displayName;
2244
+ const un = Q.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2245
+ fe.Root,
2246
+ {
2247
+ className: w("grid gap-2", e),
2248
+ ...n,
2249
+ ref: s
2250
+ }
2251
+ ));
2252
+ un.displayName = fe.Root.displayName;
2253
+ const mn = Q.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2254
+ fe.Item,
2255
+ {
2256
+ ref: s,
2257
+ className: w(
2258
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2259
+ e
2260
+ ),
2261
+ ...n,
2262
+ children: /* @__PURE__ */ t.jsx(fe.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(Vn, { className: "h-2.5 w-2.5 fill-current text-current" }) })
2263
+ }
2264
+ ));
2265
+ mn.displayName = fe.Item.displayName;
2266
+ const pn = ({
2267
+ identities: e,
2268
+ setValue: n,
2269
+ value: s
2270
+ }) => /* @__PURE__ */ t.jsx("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ t.jsx(
2271
+ un,
2272
+ {
2273
+ onValueChange: (a) => n(a),
2274
+ value: s,
2275
+ defaultValue: pe,
2276
+ className: "gap-0",
2277
+ disabled: e?.length === 0,
2278
+ children: [{ id: pe, label: "None" }, ...e ?? []].map(
2279
+ (a) => /* @__PURE__ */ t.jsxs(
2280
+ Ee,
2281
+ {
2282
+ className: "h-10 items-center border-b font-normal flex gap-4 p-4 cursor-pointer hover:bg-accent/75",
2283
+ children: [
2284
+ /* @__PURE__ */ t.jsx(mn, { value: a.id, id: a.id }),
2285
+ /* @__PURE__ */ t.jsx("span", { children: a.label })
2286
+ ]
2287
+ },
2288
+ a.id
2289
+ )
2290
+ )
2291
+ }
2292
+ ) }), Kr = ({
2293
+ onSubmit: e,
2294
+ identities: n,
2295
+ open: s,
2296
+ onOpenChange: a
2297
+ }) => {
2298
+ const [r, o] = E(void 0), [i, c] = E(!1);
2299
+ return /* @__PURE__ */ t.jsx(Ze, { open: s, onOpenChange: a, children: /* @__PURE__ */ t.jsxs(Ye, { children: [
2300
+ /* @__PURE__ */ t.jsx(et, { children: "Select an auth identity" }),
2301
+ /* @__PURE__ */ t.jsx(Vt, { children: "Please select an identity for this request." }),
2302
+ /* @__PURE__ */ t.jsx(_s, { className: "max-h-80 overflow-auto", children: /* @__PURE__ */ t.jsx(
2303
+ pn,
2304
+ {
2305
+ identities: n,
2306
+ setValue: o,
2307
+ value: r
2308
+ }
2309
+ ) }),
2310
+ /* @__PURE__ */ t.jsxs(Bt, { className: "flex flex-col gap-2", children: [
2311
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2312
+ /* @__PURE__ */ t.jsx(
2313
+ ve,
2314
+ {
2315
+ id: "remember",
2316
+ checked: i,
2317
+ onCheckedChange: (l) => c(
2318
+ l === "indeterminate" ? !1 : !!l
2319
+ )
2320
+ }
2321
+ ),
2322
+ /* @__PURE__ */ t.jsx(Ee, { htmlFor: "remember", children: "Remember my choice" })
2323
+ ] }),
2324
+ /* @__PURE__ */ t.jsx(
2325
+ q,
2326
+ {
2327
+ onClick: () => e({ identity: r, rememberedIdentity: i }),
2328
+ children: "Send"
2329
+ }
2330
+ )
2331
+ ] })
2332
+ ] }) });
2333
+ }, Ue = (e) => Math.abs(
2334
+ Number.isNaN(Number(e)) ? e.toLowerCase().charCodeAt(0) - 96 : Number.isNaN(Number(e)) ? 0 : Number(e)
2335
+ ), Ge = (e) => e.length > 1 ? Number(e.split("").reduce((n, s) => `${Ue(n) + Ue(s)}`)) : Ue(e), Pt = (e, n = {}) => {
2336
+ const s = (3 * Ge(e) + 2 * Ge(e) + Ge(e)) % 360, { saturation: a = 75, lightness: r = 60 } = n;
2337
+ return `${s}deg ${a}% ${r}%`;
2338
+ }, He = "data-linked-param", Xr = (e) => {
2339
+ const { resolvedTheme: n } = Ms();
2340
+ return {
2341
+ text: Pt(
2342
+ e,
2343
+ n === "light" ? { saturation: 95, lightness: 38 } : {}
2344
+ ),
2345
+ background: Pt(
2346
+ e,
2347
+ n === "light" ? { saturation: 85, lightness: 40 } : {}
2348
+ )
2349
+ };
2350
+ }, hn = ({
2351
+ name: e,
2352
+ className: n,
2353
+ slug: s,
2354
+ title: a,
2355
+ children: r,
2356
+ onClick: o
2357
+ }) => {
2358
+ const i = R(null), c = s?.replace(/[{}]/g, ""), l = e.replace(/[{}]/g, ""), { text: m, background: d } = Xr(l), h = `hsl(${m} / 100%)`, x = `hsl(${d} / 10%)`, f = `hsl(${d} / 50%)`;
2359
+ return G(() => {
2360
+ if (!c || !i.current) return;
2361
+ const b = () => {
2362
+ document.querySelectorAll(`[${He}="${c}"]`).forEach((S) => {
2363
+ S instanceof HTMLElement && (S.dataset.active = "true");
2364
+ });
2365
+ }, u = () => {
2366
+ document.querySelectorAll(`[${He}="${c}"]`).forEach((S) => {
2367
+ S instanceof HTMLElement && (S.dataset.active = "false");
2368
+ });
2369
+ }, y = i.current;
2370
+ return y.addEventListener("mouseenter", b), y.addEventListener("mouseleave", u), () => {
2371
+ y.removeEventListener("mouseenter", b), y.removeEventListener("mouseleave", u);
2372
+ };
2373
+ }, [c]), // biome-ignore lint/a11y/noStaticElementInteractions: Just passing props through
2374
+ // biome-ignore lint/a11y/useKeyWithClickEvents: Just passing props through
2375
+ /* @__PURE__ */ t.jsx(
2376
+ "span",
2377
+ {
2378
+ [He]: c,
2379
+ className: w(
2380
+ // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
2381
+ "relative transition-all duration-100 rounded-lg",
2382
+ "border border-(--border-color) p-0.5 text-(--param-color) bg-(--background-color)",
2383
+ "data-[active=true]:border-(--param-color) data-[active=true]:shadow-sm data-[active=true]:bottom-px",
2384
+ n
2385
+ ),
2386
+ title: a,
2387
+ suppressHydrationWarning: !0,
2388
+ ref: i,
2389
+ onClick: o,
2390
+ style: {
2391
+ "--param-color": h,
2392
+ "--border-color": f,
2393
+ "--background-color": x
2394
+ },
2395
+ children: r ?? e
2396
+ }
2397
+ );
2398
+ }, Zr = ({
2399
+ control: e,
2400
+ url: n
2401
+ }) => {
2402
+ const { fields: s } = Gt({
2403
+ control: e,
2404
+ name: "pathParams"
2405
+ }), a = [...s].sort(
2406
+ (r, o) => n.indexOf(`{${r.name}}`) - n.indexOf(`{${o.name}}`)
2407
+ );
2408
+ return /* @__PURE__ */ t.jsx(Re, { children: a.map((r, o) => /* @__PURE__ */ t.jsxs(xe, { children: [
2409
+ /* @__PURE__ */ t.jsx(
2410
+ bt,
2411
+ {
2412
+ control: e,
2413
+ name: `pathParams.${o}.name`,
2414
+ render: () => /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ t.jsx(
2415
+ hn,
2416
+ {
2417
+ slug: r.name,
2418
+ name: r.name,
2419
+ className: "font-mono text-xs px-2"
2420
+ }
2421
+ ) })
2422
+ }
2423
+ ),
2424
+ /* @__PURE__ */ t.jsx("div", { className: "flex justify-between items-center col-span-2", children: /* @__PURE__ */ t.jsx(
2425
+ bt,
2426
+ {
2427
+ control: e,
2428
+ name: `pathParams.${o}.value`,
2429
+ render: ({ field: i }) => /* @__PURE__ */ t.jsx(I, { ...i, required: !0, placeholder: "Value" })
2430
+ }
2431
+ ) })
2432
+ ] }, r.id)) });
2433
+ }, Yr = ({
2434
+ control: e,
2435
+ schemaQueryParams: n
2436
+ }) => {
2437
+ const { watch: s } = ae(), a = s("queryParams"), r = rt({
2438
+ control: e,
2439
+ name: "queryParams",
2440
+ defaultValue: { name: "", value: "", active: !1 }
2441
+ }), o = n.map(
2442
+ (c) => !!c.isRequired
2443
+ ), i = n.length > 0;
2444
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2445
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2446
+ /* @__PURE__ */ t.jsx(Bn, { size: 16 }),
2447
+ /* @__PURE__ */ t.jsx(H, { children: "Query Parameters" })
2448
+ ] }),
2449
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(Re, { children: r.fields.map((c, l) => {
2450
+ const m = n.find(
2451
+ (f) => f.name === a.at(l)?.name
2452
+ ), d = m?.enum && m.enum.length > 0, h = r.getNameInputProps(l), x = r.getValueInputProps(l);
2453
+ return /* @__PURE__ */ t.jsxs(xe, { children: [
2454
+ /* @__PURE__ */ t.jsx(ve, { ...r.getCheckboxProps(l) }),
2455
+ o[l] ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
2456
+ "label",
2457
+ {
2458
+ className: "flex items-center cursor-pointer gap-1",
2459
+ htmlFor: `queryParams.${l}.active`,
2460
+ title: o[l] ? "Required field" : void 0,
2461
+ children: [
2462
+ a[l]?.name,
2463
+ o[l] && /* @__PURE__ */ t.jsx("sup", { children: " *" })
2464
+ ]
2465
+ }
2466
+ ) }) : i ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2467
+ Oe,
2468
+ {
2469
+ ...h,
2470
+ value: String(r.getValue(l, "name")),
2471
+ placeholder: "Name",
2472
+ options: n.map((f) => f.name),
2473
+ onChange: (f) => r.setValue(l, "name", f),
2474
+ onSelect: (f) => r.setValue(l, "name", f, { focus: "next" })
2475
+ }
2476
+ ) }) : /* @__PURE__ */ t.jsx(I, { ...h, placeholder: "Name" }),
2477
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
2478
+ d ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2479
+ Oe,
2480
+ {
2481
+ ...x,
2482
+ value: String(r.getValue(l, "value")),
2483
+ shouldFilter: !1,
2484
+ options: m.enum ?? [],
2485
+ onChange: (f) => r.setValue(l, "value", f),
2486
+ onSelect: (f) => r.setValue(l, "value", f, { focus: "next" })
2487
+ }
2488
+ ) }) : /* @__PURE__ */ t.jsx(
2489
+ I,
2490
+ {
2491
+ placeholder: "Value",
2492
+ "aria-label": "Query parameter value",
2493
+ ...x
2494
+ }
2495
+ ),
2496
+ /* @__PURE__ */ t.jsx(
2497
+ st,
2498
+ {
2499
+ ...r.getRemoveButtonProps(l)
2500
+ }
2501
+ )
2502
+ ] })
2503
+ ] }, c.id);
2504
+ }) }) })
2505
+ ] });
2506
+ }, ea = ({
2507
+ open: e,
2508
+ setOpen: n,
2509
+ onSignUp: s,
2510
+ onLogin: a,
2511
+ onSkip: r
2512
+ }) => {
2513
+ const [o, i] = E(!1), c = () => {
2514
+ r?.(o), n(!1);
2515
+ };
2516
+ return /* @__PURE__ */ t.jsx(Ze, { open: e, onOpenChange: n, children: /* @__PURE__ */ t.jsxs(Ye, { children: [
2517
+ /* @__PURE__ */ t.jsx(et, { children: "Welcome to the Playground!" }),
2518
+ /* @__PURE__ */ t.jsx(Vt, { children: "The Playground is a tool for developers to test and explore our APIs. To use the Playground, you need to login." }),
2519
+ /* @__PURE__ */ t.jsxs(Ee, { className: "flex items-center gap-2 font-normal", children: [
2520
+ /* @__PURE__ */ t.jsx(
2521
+ ve,
2522
+ {
2523
+ checked: o,
2524
+ onCheckedChange: (l) => i(l === !0)
2525
+ }
2526
+ ),
2527
+ "Don't show this again"
2528
+ ] }),
2529
+ /* @__PURE__ */ t.jsxs(Bt, { className: "flex gap-2 sm:justify-between", children: [
2530
+ /* @__PURE__ */ t.jsx(q, { type: "button", variant: "outline", onClick: c, children: "Skip" }),
2531
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
2532
+ s && /* @__PURE__ */ t.jsx(q, { type: "button", variant: "outline", onClick: s, children: "Sign Up" }),
2533
+ a && /* @__PURE__ */ t.jsx(q, { type: "button", variant: "default", onClick: a, children: "Login" })
2534
+ ] })
2535
+ ] })
2536
+ ] }) });
2537
+ }, ta = Ke()(
2538
+ Xe(
2539
+ (e, n) => ({
2540
+ rememberedIdentity: null,
2541
+ setRememberedIdentity: (s) => e({ rememberedIdentity: s }),
2542
+ getRememberedIdentity: (s) => s.find(
2543
+ (a) => a === n().rememberedIdentity
2544
+ )
2545
+ }),
2546
+ {
2547
+ name: "identity-storage",
2548
+ storage: Dt(() => sessionStorage)
2549
+ }
2550
+ )
2551
+ ), na = ({
2552
+ path: e,
2553
+ renderParam: n
2554
+ }) => {
2555
+ let s = 0;
2556
+ return e.split("/").map((a, r, o) => {
2557
+ const i = Array.from(a.matchAll(/{([^}]+)}/g)), c = [];
2558
+ let l = 0;
2559
+ return i.forEach((m) => {
2560
+ const [d, h] = m;
2561
+ if (!h) return;
2562
+ const x = m.index;
2563
+ x > l && c.push(
2564
+ /* @__PURE__ */ t.jsx(le, { children: a.slice(l, x) }, `text-${l}-${x}`)
2565
+ ), c.push(
2566
+ /* @__PURE__ */ t.jsx(le, { children: n({ name: h, originalValue: d, index: s++ }) }, `param-${h}`)
2567
+ ), l = x + d.length;
2568
+ }), l < a.length && c.push(
2569
+ /* @__PURE__ */ t.jsx(le, { children: a.slice(l) }, `text-${l}-${a.length}`)
2570
+ ), // biome-ignore lint/suspicious/noArrayIndexKey: index should be stable
2571
+ /* @__PURE__ */ t.jsxs(le, { children: [
2572
+ c,
2573
+ r < o.length - 1 && "/",
2574
+ /* @__PURE__ */ t.jsx("wbr", {})
2575
+ ] }, `${a}-${r}`);
2576
+ });
2577
+ }, sa = ({ url: e }) => {
2578
+ const { watch: n, setFocus: s } = ae(), [a] = n(["pathParams"]);
2579
+ return /* @__PURE__ */ t.jsx(
2580
+ na,
2581
+ {
2582
+ path: e,
2583
+ renderParam: ({ name: r, originalValue: o, index: i }) => {
2584
+ const c = a.find(
2585
+ (l) => l.name === r
2586
+ )?.value;
2587
+ return /* @__PURE__ */ t.jsx(
2588
+ hn,
2589
+ {
2590
+ name: r,
2591
+ backgroundOpacity: "0",
2592
+ slug: r,
2593
+ onClick: () => s(`pathParams.${i}.value`),
2594
+ children: c || o
2595
+ }
2596
+ );
2597
+ }
2598
+ }
2599
+ );
2600
+ }, ra = () => {
2601
+ const { watch: e } = ae(), s = e("queryParams").filter((a) => a.active && a.name).map((a, r, o) => /* @__PURE__ */ t.jsxs(le, { children: [
2602
+ a.name,
2603
+ "=",
2604
+ encodeURIComponent(a.value).replaceAll("%20", "+"),
2605
+ r < o.length - 1 && "&",
2606
+ /* @__PURE__ */ t.jsx("wbr", {})
2607
+ ] }, `${r}-${a.name}`));
2608
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2609
+ s.length > 0 ? "?" : "",
2610
+ s
2611
+ ] });
2612
+ }, aa = ({ status: e }) => {
2613
+ if (!e) return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2614
+ switch (Number(e.toString().slice(0, 1))) {
2615
+ case 2:
2616
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-green-500" });
2617
+ case 4:
2618
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-yellow-400" });
2619
+ case 5:
2620
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-red-500" });
2621
+ default:
2622
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2623
+ }
2624
+ }, oa = () => {
2625
+ const e = R(null), n = R(null), s = R(Date.now()), a = R(null), r = D(() => {
2626
+ if (n.current) {
2627
+ const o = Date.now() - s.current;
2628
+ n.current.nodeValue = o.toFixed();
2629
+ }
2630
+ a.current = requestAnimationFrame(r);
2631
+ }, []);
2632
+ return ms(() => {
2633
+ const o = e.current;
2634
+ if (!o) return;
2635
+ const i = document.createTextNode("0");
2636
+ return o.appendChild(i), n.current = i, s.current = Date.now(), a.current = requestAnimationFrame(r), () => {
2637
+ a.current && cancelAnimationFrame(a.current), n.current && o.contains(i) && o.removeChild(i);
2638
+ };
2639
+ }, [r]), /* @__PURE__ */ t.jsx("span", { className: "inline-block text-end w-[3ch]", ref: e });
2640
+ }, ia = ({
2641
+ status: e,
2642
+ time: n,
2643
+ size: s,
2644
+ isFinished: a,
2645
+ progress: r
2646
+ }) => {
2647
+ const o = {
2648
+ 200: "OK",
2649
+ 201: "Created",
2650
+ 202: "Accepted",
2651
+ 204: "No Content",
2652
+ 400: "Bad Request",
2653
+ 401: "Unauthorized",
2654
+ 403: "Forbidden",
2655
+ 404: "Not Found",
2656
+ 405: "Method Not Allowed",
2657
+ 500: "Internal Server Error"
2658
+ };
2659
+ return /* @__PURE__ */ t.jsxs("div", { className: "relative shrink-0 flex h-10 text-xs gap-4 px-4 items-center justify-between font-mono border-b", children: [
2660
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2661
+ /* @__PURE__ */ t.jsx(aa, { status: e }),
2662
+ " ",
2663
+ e ?? "Sending Request...",
2664
+ e ? ` ${o[e]}` : ""
2665
+ ] }),
2666
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
2667
+ /* @__PURE__ */ t.jsxs("div", { children: [
2668
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Size" }),
2669
+ " ",
2670
+ /* @__PURE__ */ t.jsx("span", { className: "inline-block text-end min-w-[5ch]", children: s ? ke(s) : "- B" })
2671
+ ] }),
2672
+ /* @__PURE__ */ t.jsxs("div", { children: [
2673
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Time" }),
2674
+ " ",
2675
+ n !== void 0 ? `${n.toFixed(0)}` : /* @__PURE__ */ t.jsx(oa, {}),
2676
+ "ms"
2677
+ ] })
2678
+ ] }),
2679
+ /* @__PURE__ */ t.jsx(
2680
+ "div",
2681
+ {
2682
+ className: "h-full bg-neutral-500/10 absolute left-0 bottom-0 z-10 transition-all duration-200 ease-in-out",
2683
+ style: {
2684
+ opacity: a ? 0 : 1,
2685
+ width: a ? 0 : `${r * 100}%`
2686
+ }
2687
+ }
2688
+ )
2689
+ ] });
2690
+ };
2691
+ function at(e) {
2692
+ if (e === null) return "null";
2693
+ if (Array.isArray(e)) {
2694
+ if (e.length === 0) return "any[]";
2695
+ const n = e[0];
2696
+ return n === void 0 ? "any[]" : `${at(n)}[]`;
2697
+ }
2698
+ return typeof e == "object" ? la(e) : typeof e;
2699
+ }
2700
+ function la(e, n = "") {
2701
+ const s = ["{"];
2702
+ for (const [a, r] of Object.entries(e)) {
2703
+ const o = at(r);
2704
+ s.push(` ${a}: ${o};`);
2705
+ }
2706
+ return s.push("}"), s.join(`
2707
+ `);
2708
+ }
2709
+ function ca(e) {
2710
+ return { lines: [`type GeneratedType = ${at(e)};`] };
2711
+ }
2712
+ const da = (e) => Object.entries({
2713
+ "application/json": "json",
2714
+ "text/json": "json",
2715
+ "text/html": "html",
2716
+ "text/css": "css",
2717
+ "text/javascript": "javascript",
2718
+ "application/xml": "xml",
2719
+ "application/xhtml+xml": "xhtml"
2720
+ }).find(
2721
+ ([s]) => e.includes(s)
2722
+ )?.[1], ua = (e) => {
2723
+ const n = e.find(([s]) => s.toLowerCase() === "content-type")?.[1] || "";
2724
+ return da(n);
2725
+ }, ma = (e) => {
2726
+ try {
2727
+ return JSON.stringify(JSON.parse(e), null, 2);
2728
+ } catch {
2729
+ return null;
2730
+ }
2731
+ }, pa = (e) => {
2732
+ const n = [
2733
+ "Content-Type",
2734
+ "Content-Length",
2735
+ "Authorization",
2736
+ "X-RateLimit-Remaining",
2737
+ "X-RateLimit-Limit",
2738
+ "Cache-Control",
2739
+ "ETag"
2740
+ ].map((s) => s.toLowerCase());
2741
+ return [...e].sort(([s], [a]) => {
2742
+ const r = n.indexOf(s.toLowerCase()), o = n.indexOf(a.toLowerCase());
2743
+ return r === o ? 0 : r === -1 ? 1 : o === -1 ? -1 : r - o;
2744
+ });
2745
+ }, z = 3, Se = ye(
2746
+ "div",
2747
+ "grid-cols-subgrid grid border-b col-span-full px-4 py-1.5 font-mono text-xs"
2748
+ ), ue = ye("div", "py-1 break-words"), we = ({ value: e, header: n }) => {
2749
+ const a = ["authorization", "key", "secret", "token"].includes(n.toLowerCase()), [r, o] = E(!a);
2750
+ return /* @__PURE__ */ t.jsx(
2751
+ ue,
2752
+ {
2753
+ className: w(
2754
+ "max-h-28 overflow-auto",
2755
+ a && "cursor-pointer flex group"
2756
+ ),
2757
+ onClick: () => {
2758
+ a && o((i) => !i);
2759
+ },
2760
+ children: a ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2761
+ /* @__PURE__ */ t.jsx(bs, { secret: e, previewChars: 0, revealed: r }),
2762
+ r ? /* @__PURE__ */ t.jsx(Gn, { size: 14, className: w("hidden group-hover:block") }) : /* @__PURE__ */ t.jsx(Hn, { size: 14, className: w("hidden group-hover:block") })
2763
+ ] }) : e
2764
+ }
2765
+ );
2766
+ }, ha = ({
2767
+ body: e = "",
2768
+ headers: n,
2769
+ request: s,
2770
+ size: a,
2771
+ isBinary: r = !1,
2772
+ fileName: o,
2773
+ blob: i
2774
+ }) => {
2775
+ const c = ua(n), l = ma(e), m = l || e, [d, h] = E(
2776
+ l ? "formatted" : "raw"
2777
+ ), x = as({
2778
+ queryKey: ["types", m],
2779
+ queryFn: async () => ca(JSON.parse(m)),
2780
+ enabled: d === "types" && !r
2781
+ }), f = () => {
2782
+ if (i && o) {
2783
+ const u = URL.createObjectURL(i), y = document.createElement("a");
2784
+ y.href = u, y.download = o, document.body.appendChild(y), y.click(), document.body.removeChild(y), URL.revokeObjectURL(u);
2785
+ }
2786
+ }, b = pa([...n]);
2787
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2788
+ /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2789
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2790
+ /* @__PURE__ */ t.jsx(_n, { size: 14 }),
2791
+ /* @__PURE__ */ t.jsx(H, { children: "Request Headers" })
2792
+ ] }),
2793
+ /* @__PURE__ */ t.jsx(_, { children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[2fr_3fr] gap-x-6 text-sm", children: [
2794
+ s.headers.slice(0, z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2795
+ /* @__PURE__ */ t.jsx(ue, { children: u }),
2796
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2797
+ ] }, u)),
2798
+ s.headers.length > z && /* @__PURE__ */ t.jsxs(B, { className: "col-span-full grid-cols-subgrid grid group", children: [
2799
+ /* @__PURE__ */ t.jsxs(de, { className: "data-[state=open]:hidden justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2800
+ "Show ",
2801
+ s.headers.length - z,
2802
+ " more headers",
2803
+ /* @__PURE__ */ t.jsx(Qe, { size: 12, className: "text-muted-foreground" })
2804
+ ] }),
2805
+ /* @__PURE__ */ t.jsxs(_, { className: "col-span-full grid grid-cols-subgrid", children: [
2806
+ s.headers.slice(z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2807
+ /* @__PURE__ */ t.jsx(ue, { children: u }),
2808
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2809
+ ] }, u)),
2810
+ /* @__PURE__ */ t.jsxs(de, { className: "justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2811
+ "Hide ",
2812
+ s.headers.length - z,
2813
+ " headers",
2814
+ /* @__PURE__ */ t.jsx(
2815
+ yt,
2816
+ {
2817
+ size: 12,
2818
+ className: "text-muted-foreground"
2819
+ }
2820
+ )
2821
+ ] })
2822
+ ] })
2823
+ ] })
2824
+ ] }) })
2825
+ ] }),
2826
+ /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2827
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2828
+ /* @__PURE__ */ t.jsx(qn, { size: 14 }),
2829
+ /* @__PURE__ */ t.jsx(H, { children: "Response Headers" })
2830
+ ] }),
2831
+ /* @__PURE__ */ t.jsx(_, { children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[2fr_3fr] gap-x-6 text-sm", children: [
2832
+ b.slice(0, z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2833
+ /* @__PURE__ */ t.jsx(ue, { children: u }),
2834
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2835
+ ] }, u)),
2836
+ b.length > z && /* @__PURE__ */ t.jsxs(B, { className: "col-span-full grid-cols-subgrid grid group", children: [
2837
+ /* @__PURE__ */ t.jsxs(de, { className: "data-[state=open]:hidden justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2838
+ "Show ",
2839
+ b.length - z,
2840
+ " more headers",
2841
+ /* @__PURE__ */ t.jsx(Qe, { size: 12, className: "text-muted-foreground" })
2842
+ ] }),
2843
+ /* @__PURE__ */ t.jsxs(_, { className: "col-span-full grid grid-cols-subgrid", children: [
2844
+ b.slice(z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2845
+ /* @__PURE__ */ t.jsx(ue, { children: u }),
2846
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2847
+ ] }, u)),
2848
+ /* @__PURE__ */ t.jsxs(de, { className: "justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2849
+ "Hide ",
2850
+ b.length - z,
2851
+ " headers",
2852
+ /* @__PURE__ */ t.jsx(
2853
+ yt,
2854
+ {
2855
+ size: 12,
2856
+ className: "text-muted-foreground"
2857
+ }
2858
+ )
2859
+ ] })
2860
+ ] })
2861
+ ] })
2862
+ ] }) })
2863
+ ] }),
2864
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 justify-between items-center border-b px-2 flex-0", children: [
2865
+ /* @__PURE__ */ t.jsxs(H, { className: "flex items-center gap-2", children: [
2866
+ /* @__PURE__ */ t.jsx(Mn, { size: 14 }),
2867
+ "Response body"
2868
+ ] }),
2869
+ l && !r && /* @__PURE__ */ t.jsxs(
2870
+ _t,
2871
+ {
2872
+ value: d,
2873
+ onValueChange: (u) => h(u),
2874
+ children: [
2875
+ /* @__PURE__ */ t.jsx(qt, { className: "max-w-32 border-0 bg-transparent", children: /* @__PURE__ */ t.jsx(Mt, { placeholder: "View" }) }),
2876
+ /* @__PURE__ */ t.jsxs(Ut, { children: [
2877
+ /* @__PURE__ */ t.jsx(Te, { value: "formatted", children: "Formatted" }),
2878
+ /* @__PURE__ */ t.jsx(Te, { value: "raw", children: "Raw" }),
2879
+ /* @__PURE__ */ t.jsx(Te, { value: "types", children: "Types" })
2880
+ ] })
2881
+ ]
2882
+ }
2883
+ )
2884
+ ] }),
2885
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1", children: r ? /* @__PURE__ */ t.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
2886
+ /* @__PURE__ */ t.jsx("div", { className: "text-lg font-semibold", children: "Binary Content" }),
2887
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground", children: "This response contains binary data that cannot be displayed as text." }),
2888
+ /* @__PURE__ */ t.jsxs(
2889
+ q,
2890
+ {
2891
+ onClick: f,
2892
+ className: "flex items-center gap-2",
2893
+ disabled: !i,
2894
+ children: [
2895
+ /* @__PURE__ */ t.jsx(Un, { className: "h-4 w-4" }),
2896
+ "Download ",
2897
+ o || "file",
2898
+ " (",
2899
+ ke(a),
2900
+ ")"
2901
+ ]
2902
+ }
2903
+ )
2904
+ ] }) }) : /* @__PURE__ */ t.jsx(
2905
+ As,
2906
+ {
2907
+ className: "text-xs flex-1",
2908
+ embedded: !0,
2909
+ fullHeight: !0,
2910
+ language: d === "types" ? "typescript" : d === "raw" ? l ? "plain" : c : "json",
2911
+ code: (d === "raw" ? e : d === "types" ? x.data?.lines.join(`
2912
+ `) : m) ?? ""
2913
+ }
2914
+ ) })
2915
+ ] });
2916
+ }, fa = ({
2917
+ queryMutation: e,
2918
+ showLongRunningWarning: n,
2919
+ onCancel: s,
2920
+ tip: a,
2921
+ isFinished: r,
2922
+ progress: o
2923
+ }) => /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col overflow-y-auto h-[80vh] bg-muted/50", children: [
2924
+ (e.isPending || e.data) && /* @__PURE__ */ t.jsx(
2925
+ ia,
2926
+ {
2927
+ status: e.data?.status,
2928
+ time: e.data?.time,
2929
+ size: e.data?.size,
2930
+ isFinished: r,
2931
+ progress: o
2932
+ }
2933
+ ),
2934
+ e.error ? /* @__PURE__ */ t.jsx("div", { className: "max-w-2/3 mx-auto mt-20", children: /* @__PURE__ */ t.jsxs(js, { children: [
2935
+ /* @__PURE__ */ t.jsx(Qn, { size: 24, strokeWidth: 1.5, className: "me-5" }),
2936
+ /* @__PURE__ */ t.jsx(Cs, { children: "Request failed" }),
2937
+ /* @__PURE__ */ t.jsx(Ns, { children: e.error.message || String(e.error) || "Unexpected error" })
2938
+ ] }) }) : e.data ? /* @__PURE__ */ t.jsx(
2939
+ ha,
2940
+ {
2941
+ request: e.data.request,
2942
+ size: e.data.size,
2943
+ headers: e.data.headers,
2944
+ body: e.data.body,
2945
+ isBinary: e.data.isBinary,
2946
+ fileName: e.data.fileName,
2947
+ blob: e.data.blob
2948
+ }
2949
+ ) : e.isPending ? /* @__PURE__ */ t.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 items-center mt-20", children: [
2950
+ /* @__PURE__ */ t.jsx(ys, {}),
2951
+ /* @__PURE__ */ t.jsxs(
2952
+ "div",
2953
+ {
2954
+ className: w(
2955
+ "opacity-0 pointer-events-none transition-opacity h-20 text-sm text-muted-foreground duration-300 flex flex-col gap-2 items-center",
2956
+ n && "opacity-100 pointer-events-auto"
2957
+ ),
2958
+ children: [
2959
+ "Looks like the request is taking longer than expected.",
2960
+ /* @__PURE__ */ t.jsx(
2961
+ It,
2962
+ {
2963
+ type: "button",
2964
+ onClick: s,
2965
+ size: "sm",
2966
+ className: "w-fit",
2967
+ variant: "outline",
2968
+ children: "Cancel"
2969
+ }
2970
+ )
2971
+ ]
2972
+ }
2973
+ )
2974
+ ] }) }) : /* @__PURE__ */ t.jsx("div", { className: "h-full grid place-items-center", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 items-center", children: [
2975
+ /* @__PURE__ */ t.jsx(
2976
+ Jn,
2977
+ {
2978
+ size: 64,
2979
+ className: "text-muted-foreground",
2980
+ strokeWidth: 1.2
2981
+ }
2982
+ ),
2983
+ /* @__PURE__ */ t.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: "Send your first request" }),
2984
+ a
2985
+ ] }) })
2986
+ ] }), fn = Ke()(
2987
+ Xe(
2988
+ (e) => ({
2989
+ skipLogin: !1,
2990
+ setSkipLogin: (n) => e({ skipLogin: n })
2991
+ }),
2992
+ {
2993
+ name: "remember-skip-login",
2994
+ storage: Dt(() => sessionStorage)
2995
+ }
2996
+ )
2997
+ );
2998
+ os(fn);
2999
+ const pe = "__none", ga = ({
3000
+ server: e,
3001
+ servers: n = [],
3002
+ url: s,
3003
+ method: a,
3004
+ headers: r = [],
3005
+ queryParams: o = [],
3006
+ pathParams: i = [],
3007
+ defaultBody: c = "",
3008
+ examples: l,
3009
+ requiresLogin: m = !1,
3010
+ onLogin: d,
3011
+ onSignUp: h
3012
+ }) => {
3013
+ const { selectedServer: x, setSelectedServer: f } = Vr(
3014
+ n.map((p) => ({ url: p }))
3015
+ ), [b, u] = E(!1), y = is(), { setRememberedIdentity: S, getRememberedIdentity: N } = ta(), [, k] = ps(), { skipLogin: j, setSkipLogin: P } = fn(), [ie, be] = E(!1), [Ie, ee] = E(!1), g = R(void 0), C = Ps(S), T = R(null), { label: A } = Fr("meta+enter", () => {
3016
+ T.current?.requestSubmit();
3017
+ }), M = s.match(/\{([^}]+)\}/g)?.map((p) => p.slice(1, -1)) ?? [], L = [...i].sort(
3018
+ (p, se) => M.indexOf(p.name) - M.indexOf(se.name)
3019
+ ), { register: De, control: te, handleSubmit: je, watch: it, setValue: Fe, ...ze } = ws({
3020
+ defaultValues: {
3021
+ body: c,
3022
+ bodyMode: "text",
3023
+ file: null,
3024
+ multipartFormFields: [],
3025
+ queryParams: o.length > 0 ? o.map((p) => ({
3026
+ name: p.name,
3027
+ value: p.defaultValue ?? "",
3028
+ active: p.defaultActive ?? !1,
3029
+ enum: p.enum ?? []
3030
+ })) : [{ name: "", value: "", active: !1, enum: [] }],
3031
+ pathParams: L.map((p) => ({
3032
+ name: p.name,
3033
+ value: p.defaultValue ?? ""
3034
+ })),
3035
+ headers: r.length > 0 ? r.map((p) => ({
3036
+ name: p.name,
3037
+ value: p.defaultValue ?? "",
3038
+ active: p.defaultActive ?? !1
3039
+ })) : [{ name: "", value: "", active: !1 }],
3040
+ identity: N([
3041
+ pe,
3042
+ ...y.data?.map((p) => p.id) ?? []
3043
+ ])
3044
+ }
3045
+ }), ne = it("identity"), jn = zt(
3046
+ () => y.data?.find((p) => p.id === ne)?.authorizationFields,
3047
+ [y.data, ne]
3048
+ );
3049
+ G(() => {
3050
+ ne && C.current(ne);
3051
+ }, [C, ne]);
3052
+ const J = Ss({
3053
+ gcTime: 0,
3054
+ mutationFn: async (p) => {
3055
+ const se = performance.now(), Ve = new window.Headers(
3056
+ p.headers.filter(($) => $.name && $.active).map(($) => [$.name, $.value])
3057
+ );
3058
+ let Ce;
3059
+ switch (p.bodyMode) {
3060
+ case "file":
3061
+ Ce = p.file ?? void 0, Ve.delete("Content-Type");
3062
+ break;
3063
+ case "multipart": {
3064
+ const $ = new FormData();
3065
+ p.multipartFormFields?.filter((K) => K.name && K.active).forEach((K) => $.append(K.name, K.value)), Ce = $, Ve.delete("Content-Type");
3066
+ break;
3067
+ }
3068
+ default:
3069
+ Ce = p.body ?? void 0;
3070
+ break;
3071
+ }
3072
+ const W = new Request(
3073
+ Ot(e ?? x, s, p),
3074
+ { method: a, headers: Ve, body: Ce }
3075
+ );
3076
+ p.identity !== pe && await y.data?.find(($) => $.id === p.identity)?.authorizeRequest(W);
3077
+ const Be = setTimeout(
3078
+ () => ee(!0),
3079
+ 3210
3080
+ );
3081
+ g.current = new AbortController(), g.current.signal.addEventListener("abort", () => {
3082
+ clearTimeout(Be);
3083
+ });
3084
+ try {
3085
+ const $ = await fetch(W, {
3086
+ cache: "no-store",
3087
+ signal: g.current.signal
3088
+ });
3089
+ clearTimeout(Be), ee(!1);
3090
+ const K = performance.now() - se, Pn = new URL(W.url), dt = Array.from($.headers.entries()), ut = $.headers.get("content-type") || "", mt = Mr(ut);
3091
+ let Ne = "", pt, ht;
3092
+ mt ? (pt = await $.blob(), ht = Ur(dt, W.url), Ne = `Binary content (${ut})`) : Ne = await $.text();
3093
+ const ft = $.headers.get("content-length");
3094
+ let re = "";
3095
+ switch (p.bodyMode) {
3096
+ case "text":
3097
+ re = p.body;
3098
+ break;
3099
+ case "file":
3100
+ re = `[File: ${p.file?.name ?? "Unknown"}]`;
3101
+ break;
3102
+ case "multipart":
3103
+ re = `[Multipart Form Data]
3104
+ `, re += p.multipartFormFields?.filter((U) => U.name && U.active).map(
3105
+ (U) => U.value instanceof File ? `${U.name}: [File: ${U.value.name}]` : `${U.name}: ${U.value}`
3106
+ ).join(`
3107
+ `);
3108
+ break;
3109
+ default:
3110
+ re = p.body;
3111
+ break;
3112
+ }
3113
+ return {
3114
+ status: $.status,
3115
+ headers: dt,
3116
+ size: ft ? Number(ft) : Ne.length,
3117
+ body: Ne,
3118
+ time: K,
3119
+ isBinary: mt,
3120
+ fileName: ht,
3121
+ blob: pt,
3122
+ request: {
3123
+ method: W.method.toUpperCase(),
3124
+ url: W.url,
3125
+ headers: [
3126
+ ["Host", Pn.host],
3127
+ ["User-Agent", "Zudoku Playground"],
3128
+ ...Array.from(W.headers.entries())
3129
+ ],
3130
+ body: re
3131
+ }
3132
+ };
3133
+ } catch ($) {
3134
+ throw clearTimeout(Be), ee(!1), $ instanceof TypeError ? new Error(
3135
+ "The request failed, possibly due to network issues or CORS policy."
3136
+ ) : $;
3137
+ }
3138
+ }
3139
+ }), lt = J.isPending, [Cn, Nn] = E(!1);
3140
+ G(() => {
3141
+ const p = setTimeout(() => Nn(lt), 100);
3142
+ return () => clearTimeout(p);
3143
+ }, [lt]);
3144
+ const { isFinished: Sn, progress: wn } = vs({ isAnimating: Cn });
3145
+ G(() => () => {
3146
+ g.current?.abort();
3147
+ }, []);
3148
+ const Tn = /* @__PURE__ */ t.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: e ? /* @__PURE__ */ t.jsx("span", { children: e.replace(/^https?:\/\//, "").replace(/\/$/, "") }) : n.length > 1 && /* @__PURE__ */ t.jsxs(
3149
+ _t,
3150
+ {
3151
+ onValueChange: (p) => {
3152
+ k(() => f(p));
3153
+ },
3154
+ value: x,
3155
+ defaultValue: x,
3156
+ children: [
3157
+ /* @__PURE__ */ t.jsx(qt, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto translate-y-[4px]", children: /* @__PURE__ */ t.jsx(Mt, {}) }),
3158
+ /* @__PURE__ */ t.jsx(Ut, { children: n.map((p) => /* @__PURE__ */ t.jsx(Te, { value: p, children: p.replace(/^https?:\/\//, "").replace(/\/$/, "") }, p)) })
3159
+ ]
3160
+ }
3161
+ ) }), An = m && !j && !ie, $n = ["POST", "PUT", "PATCH", "DELETE"].includes(
3162
+ a.toUpperCase()
3163
+ ), [ct, On] = Os();
3164
+ return /* @__PURE__ */ t.jsx(
3165
+ Ts,
3166
+ {
3167
+ register: De,
3168
+ control: te,
3169
+ handleSubmit: je,
3170
+ watch: it,
3171
+ setValue: Fe,
3172
+ ...ze,
3173
+ children: /* @__PURE__ */ t.jsx($s, { delayDuration: 150, children: /* @__PURE__ */ t.jsxs(
3174
+ "form",
3175
+ {
3176
+ ref: T,
3177
+ onKeyDown: (p) => {
3178
+ p.key === "Enter" && p.target instanceof HTMLInputElement && p.preventDefault();
3179
+ },
3180
+ onSubmit: je((p) => {
3181
+ y.data?.length === 0 || p.identity ? J.mutate(p) : u(!0);
3182
+ }),
3183
+ className: "relative",
3184
+ children: [
3185
+ /* @__PURE__ */ t.jsx(
3186
+ Kr,
3187
+ {
3188
+ identities: y.data ?? [],
3189
+ open: b,
3190
+ onOpenChange: u,
3191
+ onSubmit: ({ rememberedIdentity: p, identity: se }) => {
3192
+ p && Fe("identity", se ?? pe), u(!1), J.mutate({ ...ze.getValues(), identity: se });
3193
+ }
3194
+ }
3195
+ ),
3196
+ /* @__PURE__ */ t.jsx(
3197
+ ea,
3198
+ {
3199
+ open: An,
3200
+ setOpen: (p) => {
3201
+ p || be(!0);
3202
+ },
3203
+ onSkip: (p) => {
3204
+ be(!0), p && P(!0);
3205
+ },
3206
+ onSignUp: h,
3207
+ onLogin: d
3208
+ }
3209
+ ),
3210
+ /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[1fr_1px_1fr] text-sm", children: [
3211
+ /* @__PURE__ */ t.jsxs("div", { className: "col-span-3 p-4 border-b flex gap-2 items-stretch", children: [
3212
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md relative overflow-hidden", children: [
3213
+ /* @__PURE__ */ t.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: a.toUpperCase() }),
3214
+ /* @__PURE__ */ t.jsx("div", { className: "items-center px-2 font-mono text-xs break-all leading-6 relative h-full w-full", children: /* @__PURE__ */ t.jsxs("div", { className: "h-full py-1.5", children: [
3215
+ Tn,
3216
+ /* @__PURE__ */ t.jsx(sa, { url: s }),
3217
+ /* @__PURE__ */ t.jsx(ra, {})
3218
+ ] }) }),
3219
+ /* @__PURE__ */ t.jsx("div", { className: "px-1", children: /* @__PURE__ */ t.jsx(
3220
+ q,
3221
+ {
3222
+ type: "button",
3223
+ onClick: () => {
3224
+ On(
3225
+ Ot(
3226
+ e ?? x,
3227
+ s,
3228
+ ze.getValues()
3229
+ ).toString()
3230
+ );
3231
+ },
3232
+ variant: "ghost",
3233
+ size: "icon-xs",
3234
+ className: w(
3235
+ "hover:opacity-100 transition",
3236
+ ct ? "text-emerald-600 opacity-100" : "opacity-50"
3237
+ ),
3238
+ children: ct ? /* @__PURE__ */ t.jsx(Et, { className: "text-green-500", size: 14 }) : /* @__PURE__ */ t.jsx(Wn, { size: 14 })
3239
+ }
3240
+ ) })
3241
+ ] }),
3242
+ /* @__PURE__ */ t.jsx(
3243
+ q,
3244
+ {
3245
+ type: "submit",
3246
+ variant: J.isPending ? "destructive" : "default",
3247
+ onClick: (p) => {
3248
+ J.isPending && (g.current?.abort(
3249
+ "Request cancelled by user"
3250
+ ), p.preventDefault());
3251
+ },
3252
+ className: "w-18",
3253
+ children: J.isPending ? "Cancel" : "Send"
3254
+ }
3255
+ )
3256
+ ] }),
3257
+ /* @__PURE__ */ t.jsxs("div", { className: "relative overflow-y-auto h-[80vh]", children: [
3258
+ y.data?.length !== 0 && /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
3259
+ /* @__PURE__ */ t.jsxs(Z, { children: [
3260
+ /* @__PURE__ */ t.jsx(Kn, { size: 16 }),
3261
+ /* @__PURE__ */ t.jsx(H, { children: "Authentication" })
3262
+ ] }),
3263
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(
3264
+ pn,
3265
+ {
3266
+ value: ne,
3267
+ identities: y.data ?? [],
3268
+ setValue: (p) => Fe("identity", p)
3269
+ }
3270
+ ) })
3271
+ ] }),
3272
+ L.length > 0 && /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
3273
+ /* @__PURE__ */ t.jsxs(Z, { children: [
3274
+ /* @__PURE__ */ t.jsx(Xn, { size: 16 }),
3275
+ /* @__PURE__ */ t.jsx(H, { children: "Path Parameters" })
3276
+ ] }),
3277
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(Zr, { url: s, control: te }) })
3278
+ ] }),
3279
+ /* @__PURE__ */ t.jsx(Yr, { control: te, schemaQueryParams: o }),
3280
+ /* @__PURE__ */ t.jsx(
3281
+ Jr,
3282
+ {
3283
+ control: te,
3284
+ schemaHeaders: r,
3285
+ lockedHeaders: jn?.headers
3286
+ }
3287
+ ),
3288
+ $n && /* @__PURE__ */ t.jsx(qr, { content: l })
3289
+ ] }),
3290
+ /* @__PURE__ */ t.jsx("div", { className: "w-full bg-muted-foreground/20" }),
3291
+ /* @__PURE__ */ t.jsx(
3292
+ fa,
3293
+ {
3294
+ queryMutation: J,
3295
+ showLongRunningWarning: Ie,
3296
+ isFinished: Sn,
3297
+ progress: wn,
3298
+ tip: /* @__PURE__ */ t.jsx("div", { className: "text-xs w-full", children: /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
3299
+ "Press",
3300
+ " ",
3301
+ /* @__PURE__ */ t.jsx("kbd", { className: "text-foreground border rounded m-0.5 px-1 py-0.5 capitalize", children: A.join(" + ") }),
3302
+ " ",
3303
+ "to send a request"
3304
+ ] }) }),
3305
+ onCancel: () => {
3306
+ g.current?.abort(
3307
+ "Request cancelled by the user"
3308
+ ), ee(!1);
3309
+ }
3310
+ }
3311
+ )
3312
+ ] })
3313
+ ]
3314
+ }
3315
+ ) })
3316
+ }
3317
+ );
3318
+ }, xa = (e) => {
3319
+ const [n, s] = E(!1), { isAuthEnabled: a, login: r, signup: o, isPending: i, isAuthenticated: c } = gs();
3320
+ return /* @__PURE__ */ t.jsxs(Ze, { onOpenChange: (l) => s(l), children: [
3321
+ /* @__PURE__ */ t.jsx(xs, { asChild: !0, children: e.children ?? /* @__PURE__ */ t.jsx(q, { variant: "ghost", size: "icon-xs", className: "group", children: /* @__PURE__ */ t.jsx(
3322
+ Zn,
3323
+ {
3324
+ className: "fill-muted-foreground group-hover:fill-foreground transition",
3325
+ size: 16,
3326
+ strokeWidth: 1.5
3327
+ }
3328
+ ) }) }),
3329
+ /* @__PURE__ */ t.jsxs(
3330
+ Ye,
3331
+ {
3332
+ className: "max-w-screen-xl! w-full overflow-hidden p-0",
3333
+ "aria-describedby": void 0,
3334
+ showCloseButton: !0,
3335
+ children: [
3336
+ /* @__PURE__ */ t.jsx(fs, { children: /* @__PURE__ */ t.jsx(et, { children: "Playground" }) }),
3337
+ n && /* @__PURE__ */ t.jsx(
3338
+ ga,
3339
+ {
3340
+ requiresLogin: a && !c && !i,
3341
+ onLogin: () => r(),
3342
+ onSignUp: () => o(),
3343
+ ...e
3344
+ }
3345
+ )
3346
+ ]
3347
+ }
3348
+ )
3349
+ ] });
3350
+ }, ya = {
3351
+ get: "green",
3352
+ post: "blue",
3353
+ put: "yellow",
3354
+ delete: "red",
3355
+ patch: "purple",
3356
+ options: "gray",
3357
+ head: "gray"
3358
+ }, Lt = ({
3359
+ label: e,
3360
+ path: n,
3361
+ operations: s,
3362
+ collapsible: a,
3363
+ collapsed: r
3364
+ }) => ({
3365
+ type: "category",
3366
+ label: e,
3367
+ link: {
3368
+ type: "doc",
3369
+ path: n,
3370
+ file: n,
3371
+ label: e
3372
+ },
3373
+ collapsible: a,
3374
+ collapsed: r,
3375
+ items: s.map((o) => ({
3376
+ type: "link",
3377
+ label: o.summary ?? o.path,
3378
+ to: `${n}#${o.slug}`,
3379
+ badge: {
3380
+ label: o.method,
3381
+ // biome-ignore lint/style/noNonNullAssertion: is guaranteed to be defined
3382
+ color: ya[o.method.toLowerCase()],
3383
+ invert: !0
3384
+ }
3385
+ }))
3386
+ }), gn = Ft(
3387
+ void 0
3388
+ ), Ya = gn.Provider, va = () => {
3389
+ const e = hs(gn);
3390
+ if (!e)
3391
+ throw new Error("useOasConfig must be used within a OasConfigProvider");
3392
+ return e.config;
3393
+ }, kt = (e) => ({
3394
+ path: e.routePath,
3395
+ async lazy() {
3396
+ const { OasProvider: n } = await import("./OasProvider-DIPAQ79S.js");
3397
+ return {
3398
+ element: /* @__PURE__ */ t.jsx(
3399
+ n,
3400
+ {
3401
+ basePath: e.basePath,
3402
+ version: e.version,
3403
+ client: e.client,
3404
+ config: e.config
3405
+ }
3406
+ )
3407
+ };
3408
+ },
3409
+ children: e.routes
3410
+ }), xn = ({
3411
+ path: e,
3412
+ tag: n,
3413
+ untagged: s
3414
+ }) => ({
3415
+ path: e,
3416
+ async lazy() {
3417
+ const { OperationList: a } = await import("./OperationList-BOTFIfda.js");
3418
+ return { element: /* @__PURE__ */ t.jsx(a, { tag: n, untagged: s }) };
3419
+ }
3420
+ }), ba = ({
3421
+ render: e,
3422
+ path: n
3423
+ }) => {
3424
+ const { type: s, input: a } = va(), { tag: r } = ts(), o = ns(), i = Sr(bn, { type: s, input: a }), {
3425
+ data: { schema: c }
3426
+ } = ls(i), l = c.tags.at(0);
3427
+ return !r && l?.slug ? /* @__PURE__ */ t.jsx(
3428
+ ss,
3429
+ {
3430
+ to: {
3431
+ pathname: rs(n, { tag: l.slug }),
3432
+ search: o.search
3433
+ }
3434
+ }
3435
+ ) : r && c.tags.some((m) => m.slug === r) ? e(r) : null;
3436
+ }, ja = ({ path: e }) => ({
3437
+ path: e,
3438
+ async lazy() {
3439
+ const { OperationList: n } = await import("./OperationList-BOTFIfda.js");
3440
+ return {
3441
+ element: /* @__PURE__ */ t.jsx(
3442
+ ba,
3443
+ {
3444
+ path: e,
3445
+ render: (s) => /* @__PURE__ */ t.jsx(n, { tag: s })
3446
+ }
3447
+ )
3448
+ };
3449
+ }
3450
+ }), yn = (e) => [
3451
+ // Category without tagged operations
3452
+ xn({
3453
+ path: V(e, ot),
3454
+ untagged: !0
3455
+ }),
3456
+ // Schema list route
3457
+ {
3458
+ path: V(e, "~schemas"),
3459
+ lazy: async () => {
3460
+ const { SchemaList: n } = await import("./SchemaList-Bu95q_q2.js");
3461
+ return { element: /* @__PURE__ */ t.jsx(n, {}) };
3462
+ }
3463
+ }
3464
+ ], Ca = (e, n) => {
3465
+ const s = V(e, n.at(0) ?? ot);
3466
+ return [
3467
+ // Redirect to first tag on the index route
3468
+ { index: !0, loader: () => es(s) },
3469
+ // Create routes for each tag
3470
+ ...n.map(
3471
+ (a) => xn({
3472
+ path: V(e, a),
3473
+ tag: a
3474
+ })
3475
+ ),
3476
+ ...yn(e)
3477
+ ];
3478
+ }, vn = (e) => e.type === "file" ? Object.keys(e.input) : [], Na = ({
3479
+ basePath: e,
3480
+ config: n,
3481
+ client: s
3482
+ }) => {
3483
+ const a = n.tagPages;
3484
+ if (!a)
3485
+ return [
3486
+ kt({
3487
+ basePath: e,
3488
+ routePath: e,
3489
+ routes: [
3490
+ ja({ path: `${e}/:tag?` }),
3491
+ ...yn(e)
3492
+ ],
3493
+ client: s,
3494
+ config: n
3495
+ })
3496
+ ];
3497
+ const r = vn(n);
3498
+ return (r.length > 1 ? [void 0, ...r] : [void 0]).map((i) => {
3499
+ const c = V(e, i);
3500
+ return kt({
3501
+ basePath: e,
3502
+ version: i,
3503
+ routePath: c,
3504
+ routes: Ca(c, a),
3505
+ client: s,
3506
+ config: n
3507
+ });
3508
+ });
3509
+ }, bn = Rr(`
3510
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
3511
+ schema(input: $input, type: $type) {
3512
+ extensions
3513
+ tags {
3514
+ slug
3515
+ name
3516
+ extensions
3517
+ operations {
3518
+ summary
3519
+ slug
3520
+ method
3521
+ operationId
3522
+ path
3523
+ }
3524
+ }
3525
+ components {
3526
+ schemas {
3527
+ __typename
3528
+ }
3529
+ }
3530
+ }
3531
+ }
3532
+ `), ot = "~endpoints", eo = (e) => {
3533
+ const n = V(e.path), s = new Gs(e);
3534
+ return {
3535
+ getHead: () => {
3536
+ if (e.type === "url" && !e.skipPreload)
3537
+ return /* @__PURE__ */ t.jsx(
3538
+ "link",
3539
+ {
3540
+ rel: "preload",
3541
+ href: e.input,
3542
+ as: "fetch",
3543
+ crossOrigin: "anonymous"
3544
+ }
3545
+ );
3546
+ if (e.server)
3547
+ return /* @__PURE__ */ t.jsx("link", { rel: "preconnect", href: e.server });
3548
+ },
3549
+ getMdxComponents: () => ({
3550
+ OpenPlaygroundButton: ({
3551
+ server: a,
3552
+ method: r = "get",
3553
+ url: o = "/",
3554
+ children: i,
3555
+ ...c
3556
+ }) => {
3557
+ if (!a)
3558
+ throw new Error("Server is required");
3559
+ return /* @__PURE__ */ t.jsx(
3560
+ xa,
3561
+ {
3562
+ url: o,
3563
+ method: r,
3564
+ server: a,
3565
+ ...c,
3566
+ children: /* @__PURE__ */ t.jsx(It, { className: "gap-2 items-center", variant: "outline", children: i ?? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
3567
+ "Open in Playground",
3568
+ /* @__PURE__ */ t.jsx(Yn, { size: 16 })
3569
+ ] }) })
3570
+ }
3571
+ );
3572
+ }
3573
+ }),
3574
+ getNavigation: async (a, r) => {
3575
+ if (!vt({ path: n, end: !1 }, a))
3576
+ return [];
3577
+ const o = vt(
3578
+ { path: `${n}/:version?/:tag`, end: !0 },
3579
+ a
3580
+ );
3581
+ try {
3582
+ const i = o?.params.version, c = i ?? vn(e).at(0), { type: l } = e, m = l === "file" ? e.input[c] : e.input, d = on(s, bn, {
3583
+ type: l,
3584
+ input: m
3585
+ }), h = await r.queryClient.ensureQueryData(d), x = new Map(
3586
+ h.schema.tags.filter((N) => N.name && N.operations.length > 0).map((N) => {
3587
+ if (!N.name)
3588
+ throw new Error(`Tag ${N.slug} has no name`);
3589
+ const k = V(n, i, N.slug), j = N.extensions?.["x-zudoku-collapsed"] ?? !e.options?.expandAllTags, P = N.extensions?.["x-zudoku-collapsible"] ?? !0;
3590
+ return [
3591
+ N.name,
3592
+ Lt({
3593
+ label: N.extensions?.["x-displayName"] ?? N.name,
3594
+ path: k,
3595
+ operations: N.operations,
3596
+ collapsed: j,
3597
+ collapsible: P
3598
+ })
3599
+ ];
3600
+ })
3601
+ ), f = h.schema.extensions?.["x-tagGroups"] ?? [], b = new Set(
3602
+ f.flatMap(
3603
+ (N) => N.tags.filter((k) => x.has(k))
3604
+ )
3605
+ ), y = [
3606
+ ...f.flatMap(
3607
+ (N) => {
3608
+ const k = N.tags.map((j) => x.get(j)).filter(Boolean);
3609
+ return k.length === 0 ? [] : [
3610
+ {
3611
+ type: "category",
3612
+ label: N.name,
3613
+ items: k,
3614
+ collapsible: !0,
3615
+ collapsed: !e.options?.expandAllTags
3616
+ }
3617
+ ];
3618
+ }
3619
+ ),
3620
+ ...Array.from(x.entries()).filter(([N]) => !b.has(N)).map(([, N]) => N)
3621
+ ], S = h.schema.tags.find(
3622
+ (N) => !N.name
3623
+ )?.operations;
3624
+ return S && S.length > 0 && y.push(
3625
+ Lt({
3626
+ label: y.length === 0 ? "Endpoints" : "Other endpoints",
3627
+ path: V(n, i, ot),
3628
+ operations: S,
3629
+ collapsed: !e.options?.expandAllTags
3630
+ })
3631
+ ), h.schema.components?.schemas?.length && y.push({
3632
+ type: "link",
3633
+ label: "Schemas",
3634
+ to: V(n, i, "~schemas")
3635
+ }), y;
3636
+ } catch {
3637
+ return [];
3638
+ }
3639
+ },
3640
+ getRoutes: () => Na({ basePath: n, config: e, client: s })
3641
+ };
3642
+ };
3643
+ export {
3644
+ B as C,
3645
+ Za as G,
3646
+ sr as L,
3647
+ Ya as O,
3648
+ xa as P,
3649
+ Xs as Q,
3650
+ rn as S,
3651
+ v as T,
3652
+ ot as U,
3653
+ Sr as a,
3654
+ de as b,
3655
+ _ as c,
3656
+ vn as d,
3657
+ Vr as e,
3658
+ hn as f,
3659
+ Rr as g,
3660
+ na as h,
3661
+ Cr as i,
3662
+ At as j,
3663
+ Ka as k,
3664
+ rr as l,
3665
+ nt as m,
3666
+ sn as n,
3667
+ Hs as o,
3668
+ jr as p,
3669
+ qe as q,
3670
+ Qs as r,
3671
+ F as s,
3672
+ Xa as t,
3673
+ va as u,
3674
+ nr as v,
3675
+ Ys as w,
3676
+ Yt as x,
3677
+ bn as y,
3678
+ eo as z
3679
+ };
3680
+ //# sourceMappingURL=index-B7yD7ZUk.js.map