zudoku 0.0.0-fix-downgrade-openapi-parser.aac00796 → 0.0.0-fix-firebase-export.2e421fda

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