zudoku 0.0.0-f3f6db5 → 0.0.0-f471fb8

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 (774) hide show
  1. package/README.md +1 -1
  2. package/cli.js +3 -0
  3. package/dist/app/entry.client.d.ts +5 -0
  4. package/dist/app/entry.client.js +1 -0
  5. package/dist/app/entry.client.js.map +1 -1
  6. package/dist/app/entry.server.d.ts +5 -4
  7. package/dist/app/entry.server.js +11 -7
  8. package/dist/app/entry.server.js.map +1 -1
  9. package/dist/app/main.js +4 -3
  10. package/dist/app/main.js.map +1 -1
  11. package/dist/app/tailwind.js +20 -0
  12. package/dist/app/tailwind.js.map +1 -1
  13. package/dist/cli/build/handler.d.ts +1 -3
  14. package/dist/cli/build/handler.js +7 -0
  15. package/dist/cli/build/handler.js.map +1 -1
  16. package/dist/cli/cli.js +5 -0
  17. package/dist/cli/cli.js.map +1 -1
  18. package/dist/cli/cmds/build.d.ts +11 -3
  19. package/dist/cli/cmds/build.js +20 -13
  20. package/dist/cli/cmds/build.js.map +1 -1
  21. package/dist/cli/cmds/dev.d.ts +1 -1
  22. package/dist/cli/cmds/dev.js +7 -1
  23. package/dist/cli/cmds/dev.js.map +1 -1
  24. package/dist/cli/cmds/preview.d.ts +16 -0
  25. package/dist/cli/cmds/preview.js +25 -0
  26. package/dist/cli/cmds/preview.js.map +1 -0
  27. package/dist/cli/common/output.js.map +1 -1
  28. package/dist/cli/common/utils/ports.d.ts +1 -1
  29. package/dist/cli/common/utils/ports.js +16 -15
  30. package/dist/cli/common/utils/ports.js.map +1 -1
  31. package/dist/cli/dev/handler.js +14 -12
  32. package/dist/cli/dev/handler.js.map +1 -1
  33. package/dist/cli/dev/pagefind-command.d.ts +3 -0
  34. package/dist/cli/dev/pagefind-command.js +59 -0
  35. package/dist/cli/dev/pagefind-command.js.map +1 -0
  36. package/dist/cli/preview/handler.d.ts +3 -0
  37. package/dist/cli/preview/handler.js +35 -0
  38. package/dist/cli/preview/handler.js.map +1 -0
  39. package/dist/config/common.d.ts +5 -3
  40. package/dist/config/config.d.ts +15 -15
  41. package/dist/config/loader.d.ts +6 -6
  42. package/dist/config/loader.js +20 -25
  43. package/dist/config/loader.js.map +1 -1
  44. package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
  45. package/dist/config/validators/InputSidebarSchema.js +10 -1
  46. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  47. package/dist/config/validators/common.d.ts +2318 -503
  48. package/dist/config/validators/common.js +94 -17
  49. package/dist/config/validators/common.js.map +1 -1
  50. package/dist/config/validators/icon-types.d.ts +1 -1
  51. package/dist/config/validators/validate.d.ts +891 -219
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.js +1 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/lib/MissingIcon.d.ts +2 -0
  56. package/dist/lib/MissingIcon.js +7 -0
  57. package/dist/lib/MissingIcon.js.map +1 -0
  58. package/dist/lib/authentication/authentication.d.ts +1 -0
  59. package/dist/lib/authentication/hook.d.ts +1 -0
  60. package/dist/lib/authentication/hook.js +11 -1
  61. package/dist/lib/authentication/hook.js.map +1 -1
  62. package/dist/lib/authentication/providers/auth0.d.ts +2 -2
  63. package/dist/lib/authentication/providers/auth0.js +1 -0
  64. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  65. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  66. package/dist/lib/authentication/providers/clerk.js +25 -6
  67. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  68. package/dist/lib/authentication/providers/openid.d.ts +5 -3
  69. package/dist/lib/authentication/providers/openid.js +24 -10
  70. package/dist/lib/authentication/providers/openid.js.map +1 -1
  71. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  72. package/dist/lib/authentication/providers/supabase.js +117 -0
  73. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  74. package/dist/lib/authentication/state.d.ts +0 -17
  75. package/dist/lib/authentication/state.js +9 -7
  76. package/dist/lib/authentication/state.js.map +1 -1
  77. package/dist/lib/components/AnchorLink.d.ts +2 -2
  78. package/dist/lib/components/AnchorLink.js +5 -4
  79. package/dist/lib/components/AnchorLink.js.map +1 -1
  80. package/dist/lib/components/Autocomplete.d.ts +4 -3
  81. package/dist/lib/components/Autocomplete.js +2 -2
  82. package/dist/lib/components/Autocomplete.js.map +1 -1
  83. package/dist/lib/components/Banner.js +1 -1
  84. package/dist/lib/components/Banner.js.map +1 -1
  85. package/dist/lib/components/Header.js +4 -4
  86. package/dist/lib/components/Header.js.map +1 -1
  87. package/dist/lib/components/Heading.d.ts +2 -2
  88. package/dist/lib/components/InlineCode.d.ts +2 -1
  89. package/dist/lib/components/InlineCode.js +2 -9
  90. package/dist/lib/components/InlineCode.js.map +1 -1
  91. package/dist/lib/components/Layout.js +7 -29
  92. package/dist/lib/components/Layout.js.map +1 -1
  93. package/dist/lib/components/Main.d.ts +2 -0
  94. package/dist/lib/components/Main.js +17 -0
  95. package/dist/lib/components/Main.js.map +1 -0
  96. package/dist/lib/components/MobileTopNavigation.js +1 -1
  97. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  98. package/dist/lib/components/Pagination.d.ts +10 -0
  99. package/dist/lib/components/Pagination.js +10 -0
  100. package/dist/lib/components/Pagination.js.map +1 -0
  101. package/dist/lib/components/PathRenderer.js +23 -20
  102. package/dist/lib/components/PathRenderer.js.map +1 -1
  103. package/dist/lib/components/ThemeSwitch.js +8 -5
  104. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  105. package/dist/lib/components/TopNavigation.d.ts +2 -2
  106. package/dist/lib/components/TopNavigation.js +28 -14
  107. package/dist/lib/components/TopNavigation.js.map +1 -1
  108. package/dist/lib/components/Zudoku.d.ts +1 -1
  109. package/dist/lib/components/Zudoku.js +12 -8
  110. package/dist/lib/components/Zudoku.js.map +1 -1
  111. package/dist/lib/components/cache.d.ts +7 -0
  112. package/dist/lib/components/cache.js +7 -0
  113. package/dist/lib/components/cache.js.map +1 -1
  114. package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
  115. package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
  116. package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
  117. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  118. package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
  119. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  120. package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
  121. package/dist/lib/components/context/ZudokuContext.js +21 -9
  122. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  123. package/dist/lib/components/index.d.ts +9 -2
  124. package/dist/lib/components/index.js +4 -0
  125. package/dist/lib/components/index.js.map +1 -1
  126. package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
  127. package/dist/lib/components/navigation/Sidebar.js +8 -5
  128. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  129. package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
  130. package/dist/lib/components/navigation/SidebarBadge.js +3 -1
  131. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
  132. package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
  133. package/dist/lib/components/navigation/SidebarCategory.js +10 -6
  134. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  135. package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
  136. package/dist/lib/components/navigation/SidebarItem.js +17 -10
  137. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  138. package/dist/lib/components/navigation/SidebarWrapper.d.ts +8 -6
  139. package/dist/lib/components/navigation/SidebarWrapper.js +1 -2
  140. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  141. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  142. package/dist/lib/components/navigation/Toc.js.map +1 -0
  143. package/dist/lib/core/RouteGuard.d.ts +1 -1
  144. package/dist/lib/core/RouteGuard.js +28 -10
  145. package/dist/lib/core/RouteGuard.js.map +1 -1
  146. package/dist/lib/core/ZudokuContext.d.ts +29 -6
  147. package/dist/lib/core/ZudokuContext.js +29 -6
  148. package/dist/lib/core/ZudokuContext.js.map +1 -1
  149. package/dist/lib/core/plugins.d.ts +17 -7
  150. package/dist/lib/core/plugins.js +3 -0
  151. package/dist/lib/core/plugins.js.map +1 -1
  152. package/dist/lib/errors/ErrorAlert.js +6 -1
  153. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  154. package/dist/lib/hooks/index.d.ts +3 -0
  155. package/dist/lib/hooks/index.js +5 -0
  156. package/dist/lib/hooks/index.js.map +1 -0
  157. package/dist/lib/hooks/useEvent.d.ts +11 -0
  158. package/dist/lib/hooks/useEvent.js +19 -0
  159. package/dist/lib/hooks/useEvent.js.map +1 -0
  160. package/dist/lib/hooks/useEvent.test.d.ts +1 -0
  161. package/dist/lib/hooks/useEvent.test.js +100 -0
  162. package/dist/lib/hooks/useEvent.test.js.map +1 -0
  163. package/dist/lib/icons.d.ts +1 -0
  164. package/dist/lib/icons.js +1 -0
  165. package/dist/lib/icons.js.map +1 -1
  166. package/dist/lib/oas/graphql/index.d.ts +24 -4
  167. package/dist/lib/oas/graphql/index.js +163 -48
  168. package/dist/lib/oas/graphql/index.js.map +1 -1
  169. package/dist/lib/oas/parser/dereference/index.js +2 -0
  170. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  171. package/dist/lib/oas/parser/index.d.ts +5 -3
  172. package/dist/lib/oas/parser/index.js +0 -22
  173. package/dist/lib/oas/parser/index.js.map +1 -1
  174. package/dist/lib/oas/parser/upgrade/index.js +2 -1
  175. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  176. package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -2
  177. package/dist/lib/plugins/api-catalog/Catalog.js +16 -26
  178. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
  179. package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
  180. package/dist/lib/plugins/api-catalog/index.js +39 -8
  181. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  182. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  183. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  184. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  185. package/dist/lib/plugins/api-keys/index.js +1 -0
  186. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  187. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
  188. package/dist/lib/plugins/markdown/MdxPage.js +3 -9
  189. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  190. package/dist/lib/plugins/markdown/resolver.d.ts +0 -6
  191. package/dist/lib/plugins/markdown/resolver.js +0 -29
  192. package/dist/lib/plugins/markdown/resolver.js.map +1 -1
  193. package/dist/lib/plugins/openapi/Endpoint.js +6 -7
  194. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  195. package/dist/lib/plugins/openapi/{OpenApiRoute.d.ts → OasProvider.d.ts} +1 -2
  196. package/dist/lib/plugins/openapi/OasProvider.js +29 -0
  197. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -0
  198. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  199. package/dist/lib/plugins/openapi/OperationList.js +71 -22
  200. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  201. package/dist/lib/plugins/openapi/OperationListItem.d.ts +3 -2
  202. package/dist/lib/plugins/openapi/OperationListItem.js +8 -13
  203. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  204. package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
  205. package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
  206. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
  207. package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
  208. package/dist/lib/plugins/openapi/ParameterList.js +3 -2
  209. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  210. package/dist/lib/plugins/openapi/ParameterListItem.js +8 -4
  211. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  212. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +1 -1
  213. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +9 -3
  214. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  215. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  216. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  217. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  218. package/dist/lib/plugins/openapi/Sidecar.js +41 -12
  219. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  220. package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
  221. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  222. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  223. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  224. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  225. package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
  226. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  227. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  228. package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
  229. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  230. package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
  231. package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
  232. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
  233. package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
  234. package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
  235. package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
  236. package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
  237. package/dist/lib/plugins/openapi/graphql/gql.js +5 -15
  238. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  239. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +110 -41
  240. package/dist/lib/plugins/openapi/graphql/graphql.js +63 -24
  241. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  242. package/dist/lib/plugins/openapi/index.d.ts +10 -7
  243. package/dist/lib/plugins/openapi/index.js +62 -119
  244. package/dist/lib/plugins/openapi/index.js.map +1 -1
  245. package/dist/lib/plugins/openapi/interfaces.d.ts +39 -11
  246. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  247. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  248. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  249. package/dist/lib/plugins/openapi/playground/Headers.d.ts +4 -4
  250. package/dist/lib/plugins/openapi/playground/Headers.js +42 -26
  251. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  252. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  253. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  254. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  255. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  256. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  257. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  258. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +4 -0
  259. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -1
  260. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  261. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
  262. package/dist/lib/plugins/openapi/playground/PathParams.js +5 -4
  263. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  264. package/dist/lib/plugins/openapi/playground/Playground.d.ts +18 -3
  265. package/dist/lib/plugins/openapi/playground/Playground.js +84 -30
  266. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  267. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  268. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  269. package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -21
  270. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  271. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  272. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  273. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  274. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  275. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  276. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  277. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +1 -1
  278. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -1
  279. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +20 -14
  280. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  281. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  282. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  283. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  284. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +10 -8
  285. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  286. package/dist/lib/plugins/openapi/schema/SchemaView.js +13 -6
  287. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  288. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  289. package/dist/lib/plugins/openapi/state.js +18 -0
  290. package/dist/lib/plugins/openapi/state.js.map +1 -0
  291. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +9 -0
  292. package/dist/lib/plugins/openapi/util/createSidebarCategory.js +23 -0
  293. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -0
  294. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +10 -0
  295. package/dist/lib/plugins/openapi/util/getRoutes.js +80 -0
  296. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -0
  297. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +2 -0
  298. package/dist/lib/plugins/openapi/util/methodColorMap.js +10 -0
  299. package/dist/lib/plugins/openapi/util/methodColorMap.js.map +1 -0
  300. package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
  301. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +75 -0
  302. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
  303. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
  304. package/dist/lib/plugins/search-pagefind/ResultList.js +38 -0
  305. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
  306. package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
  307. package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
  308. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
  309. package/dist/lib/plugins/search-pagefind/index.d.ts +8 -0
  310. package/dist/lib/plugins/search-pagefind/index.js +9 -0
  311. package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
  312. package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
  313. package/dist/lib/plugins/search-pagefind/types.js +2 -0
  314. package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
  315. package/dist/lib/ui/Badge.d.ts +1 -1
  316. package/dist/lib/ui/Button.d.ts +2 -2
  317. package/dist/lib/ui/Button.js +2 -1
  318. package/dist/lib/ui/Button.js.map +1 -1
  319. package/dist/lib/ui/Callout.d.ts +2 -1
  320. package/dist/lib/ui/Callout.js +3 -2
  321. package/dist/lib/ui/Callout.js.map +1 -1
  322. package/dist/lib/ui/Checkbox.d.ts +2 -8
  323. package/dist/lib/ui/Checkbox.js +1 -13
  324. package/dist/lib/ui/Checkbox.js.map +1 -1
  325. package/dist/lib/ui/Command.d.ts +7 -1
  326. package/dist/lib/ui/Command.js +2 -2
  327. package/dist/lib/ui/Command.js.map +1 -1
  328. package/dist/lib/ui/Input.d.ts +1 -2
  329. package/dist/lib/ui/Input.js.map +1 -1
  330. package/dist/lib/ui/Select.js +1 -1
  331. package/dist/lib/ui/Select.js.map +1 -1
  332. package/dist/lib/ui/Stepper.d.ts +3 -0
  333. package/dist/lib/ui/Stepper.js +7 -0
  334. package/dist/lib/ui/Stepper.js.map +1 -0
  335. package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
  336. package/dist/lib/ui/SyntaxHighlight.js +62 -0
  337. package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
  338. package/dist/lib/ui/util.d.ts +2 -0
  339. package/dist/lib/ui/util.js +3 -0
  340. package/dist/lib/ui/util.js.map +1 -0
  341. package/dist/lib/util/MdxComponents.d.ts +5 -2
  342. package/dist/lib/util/MdxComponents.js +6 -3
  343. package/dist/lib/util/MdxComponents.js.map +1 -1
  344. package/dist/lib/util/joinPath.d.ts +3 -0
  345. package/dist/lib/util/joinPath.js +3 -0
  346. package/dist/lib/util/joinPath.js.map +1 -1
  347. package/dist/lib/util/scrollIntoViewIfNeeded.d.ts +1 -0
  348. package/dist/lib/util/scrollIntoViewIfNeeded.js +14 -0
  349. package/dist/lib/util/scrollIntoViewIfNeeded.js.map +1 -0
  350. package/dist/lib/util/traverse.d.ts +2 -8
  351. package/dist/lib/util/traverse.js +2 -2
  352. package/dist/lib/util/traverse.js.map +1 -1
  353. package/dist/lib/util/types.d.ts +7 -0
  354. package/dist/lib/util/types.js +2 -0
  355. package/dist/lib/util/types.js.map +1 -0
  356. package/dist/lib/util/useLatest.d.ts +1 -0
  357. package/dist/lib/util/useLatest.js +15 -0
  358. package/dist/lib/util/useLatest.js.map +1 -0
  359. package/dist/lib/util/useOnScreen.d.ts +3 -2
  360. package/dist/lib/util/useOnScreen.js +3 -3
  361. package/dist/lib/util/useOnScreen.js.map +1 -1
  362. package/dist/lib/util/useScrollToAnchor.js +27 -33
  363. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  364. package/dist/lib/util/useScrollToTop.js +6 -4
  365. package/dist/lib/util/useScrollToTop.js.map +1 -1
  366. package/dist/vite/api/schema-codegen.d.ts +1 -1
  367. package/dist/vite/api/schema-codegen.js +27 -8
  368. package/dist/vite/api/schema-codegen.js.map +1 -1
  369. package/dist/vite/api/schema-codegen.test.js +66 -0
  370. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  371. package/dist/vite/build.js +35 -16
  372. package/dist/vite/build.js.map +1 -1
  373. package/dist/vite/config.d.ts +2 -5
  374. package/dist/vite/config.js +63 -71
  375. package/dist/vite/config.js.map +1 -1
  376. package/dist/vite/config.test.js +1 -1
  377. package/dist/vite/config.test.js.map +1 -1
  378. package/dist/vite/create-pagefind-index.d.ts +4 -0
  379. package/dist/vite/create-pagefind-index.js +12 -0
  380. package/dist/vite/create-pagefind-index.js.map +1 -0
  381. package/dist/vite/css/plugin.d.ts +2 -2
  382. package/dist/vite/css/plugin.js.map +1 -1
  383. package/dist/vite/dev-server.d.ts +4 -2
  384. package/dist/vite/dev-server.js +42 -12
  385. package/dist/vite/dev-server.js.map +1 -1
  386. package/dist/vite/error-handler.d.ts +1 -1
  387. package/dist/vite/error-handler.js +1 -1
  388. package/dist/vite/error-handler.js.map +1 -1
  389. package/dist/vite/output.d.ts +14 -2
  390. package/dist/vite/output.js +12 -14
  391. package/dist/vite/output.js.map +1 -1
  392. package/dist/vite/plugin-api-keys.d.ts +2 -2
  393. package/dist/vite/plugin-api-keys.js +5 -5
  394. package/dist/vite/plugin-api-keys.js.map +1 -1
  395. package/dist/vite/plugin-api.d.ts +2 -2
  396. package/dist/vite/plugin-api.js +143 -116
  397. package/dist/vite/plugin-api.js.map +1 -1
  398. package/dist/vite/plugin-auth.d.ts +2 -2
  399. package/dist/vite/plugin-auth.js +3 -3
  400. package/dist/vite/plugin-auth.js.map +1 -1
  401. package/dist/vite/plugin-component.d.ts +2 -2
  402. package/dist/vite/plugin-component.js +7 -2
  403. package/dist/vite/plugin-component.js.map +1 -1
  404. package/dist/vite/plugin-config-reload.d.ts +4 -3
  405. package/dist/vite/plugin-config-reload.js +11 -5
  406. package/dist/vite/plugin-config-reload.js.map +1 -1
  407. package/dist/vite/plugin-config.d.ts +2 -2
  408. package/dist/vite/plugin-config.js +9 -5
  409. package/dist/vite/plugin-config.js.map +1 -1
  410. package/dist/vite/plugin-custom-pages.d.ts +2 -2
  411. package/dist/vite/plugin-custom-pages.js +3 -3
  412. package/dist/vite/plugin-custom-pages.js.map +1 -1
  413. package/dist/vite/plugin-docs.d.ts +3 -3
  414. package/dist/vite/plugin-docs.js +23 -6
  415. package/dist/vite/plugin-docs.js.map +1 -1
  416. package/dist/vite/plugin-frontmatter.d.ts +2 -2
  417. package/dist/vite/plugin-frontmatter.js +5 -4
  418. package/dist/vite/plugin-frontmatter.js.map +1 -1
  419. package/dist/vite/plugin-mdx.d.ts +2 -2
  420. package/dist/vite/plugin-mdx.js +34 -23
  421. package/dist/vite/plugin-mdx.js.map +1 -1
  422. package/dist/vite/plugin-redirect.d.ts +2 -2
  423. package/dist/vite/plugin-redirect.js +3 -3
  424. package/dist/vite/plugin-redirect.js.map +1 -1
  425. package/dist/vite/plugin-search.d.ts +2 -2
  426. package/dist/vite/plugin-search.js +5 -1
  427. package/dist/vite/plugin-search.js.map +1 -1
  428. package/dist/vite/plugin-sidebar.d.ts +2 -2
  429. package/dist/vite/plugin-sidebar.js +13 -4
  430. package/dist/vite/plugin-sidebar.js.map +1 -1
  431. package/dist/vite/plugin-theme-css.d.ts +2 -2
  432. package/dist/vite/plugin-theme-css.js +7 -4
  433. package/dist/vite/plugin-theme-css.js.map +1 -1
  434. package/dist/vite/plugin.d.ts +2 -2
  435. package/dist/vite/plugin.js.map +1 -1
  436. package/dist/vite/{prerender.d.ts → prerender/FileWritingResponse.d.ts} +8 -9
  437. package/dist/vite/prerender/FileWritingResponse.js +51 -0
  438. package/dist/vite/prerender/FileWritingResponse.js.map +1 -0
  439. package/dist/vite/prerender/prerender.d.ts +14 -0
  440. package/dist/vite/prerender/prerender.js +90 -0
  441. package/dist/vite/prerender/prerender.js.map +1 -0
  442. package/dist/vite/prerender/worker.d.ts +13 -0
  443. package/dist/vite/prerender/worker.js +31 -0
  444. package/dist/vite/prerender/worker.js.map +1 -0
  445. package/dist/vite/reporter.d.ts +3 -0
  446. package/dist/vite/reporter.js +33 -0
  447. package/dist/vite/reporter.js.map +1 -0
  448. package/dist/vite/sitemap.js +2 -1
  449. package/dist/vite/sitemap.js.map +1 -1
  450. package/lib/{AuthenticationPlugin-Du8cLBSr.js → AuthenticationPlugin-foqdvvkf.js} +4 -4
  451. package/lib/{AuthenticationPlugin-Du8cLBSr.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
  452. package/lib/Button-Fp19CMUr.js +49 -0
  453. package/lib/Button-Fp19CMUr.js.map +1 -0
  454. package/lib/Callout-D5frCCJ0.js +229 -0
  455. package/lib/Callout-D5frCCJ0.js.map +1 -0
  456. package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
  457. package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
  458. package/lib/Dialog-Dv6WG8RN.js +98 -0
  459. package/lib/Dialog-Dv6WG8RN.js.map +1 -0
  460. package/lib/Drawer-kDAfOq_2.js +1133 -0
  461. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  462. package/lib/{Markdown-Cyrx_JrO.js → Markdown-aF5FdsNi.js} +8223 -6475
  463. package/lib/Markdown-aF5FdsNi.js.map +1 -0
  464. package/lib/MdxPage-ZW1StNhp.js +83 -0
  465. package/lib/MdxPage-ZW1StNhp.js.map +1 -0
  466. package/lib/OasProvider-OlYb8W57.js +34 -0
  467. package/lib/OasProvider-OlYb8W57.js.map +1 -0
  468. package/lib/OperationList-BvfIzVRx.js +5065 -0
  469. package/lib/OperationList-BvfIzVRx.js.map +1 -0
  470. package/lib/Pagination-CYB3nVYx.js +46 -0
  471. package/lib/Pagination-CYB3nVYx.js.map +1 -0
  472. package/lib/SchemaList-Bi35O4XD.js +148 -0
  473. package/lib/SchemaList-Bi35O4XD.js.map +1 -0
  474. package/lib/SchemaView-D7MC5cjz.js +356 -0
  475. package/lib/SchemaView-D7MC5cjz.js.map +1 -0
  476. package/lib/{Select-CnCZ4WhS.js → Select-DVFRKf1R.js} +71 -71
  477. package/lib/{Select-CnCZ4WhS.js.map → Select-DVFRKf1R.js.map} +1 -1
  478. package/lib/SlotletProvider-DXvc0aY6.js +338 -0
  479. package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
  480. package/lib/Spinner-CE68iCm0.js +7 -0
  481. package/lib/Spinner-CE68iCm0.js.map +1 -0
  482. package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-BEoSoPEo.js} +496 -592
  483. package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
  484. package/lib/Toc-YBsgI72s.js +92 -0
  485. package/lib/Toc-YBsgI72s.js.map +1 -0
  486. package/lib/{chunk-SYFQ2XB5-BPvC-soB.js → chunk-HA7DTUK3-C4gP41vD.js} +561 -561
  487. package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
  488. package/lib/{circular-DxaIIlWD.js → circular-ByJI6Mci.js} +5461 -4993
  489. package/lib/circular-ByJI6Mci.js.map +1 -0
  490. package/lib/context-DLCwaMXN.js +22 -0
  491. package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
  492. package/lib/{createServer-CjNktZzL.js → createServer-mMau3eV_.js} +4801 -4976
  493. package/lib/createServer-mMau3eV_.js.map +1 -0
  494. package/lib/hook-CqpVYDqN.js +1483 -0
  495. package/lib/hook-CqpVYDqN.js.map +1 -0
  496. package/lib/index-Bn6Lc9tq.js +9 -0
  497. package/lib/index-Bn6Lc9tq.js.map +1 -0
  498. package/lib/index-Bt7MKhZq.js +2514 -0
  499. package/lib/index-Bt7MKhZq.js.map +1 -0
  500. package/lib/index-CPNSgwSb.js +36 -0
  501. package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
  502. package/lib/index-CXfEwK_7.js +2226 -0
  503. package/lib/index-CXfEwK_7.js.map +1 -0
  504. package/lib/index-DwT-v3zK.js +86 -0
  505. package/lib/index-DwT-v3zK.js.map +1 -0
  506. package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
  507. package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
  508. package/lib/index-gQD2h1wX.js +447 -0
  509. package/lib/index-gQD2h1wX.js.map +1 -0
  510. package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
  511. package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
  512. package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
  513. package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
  514. package/lib/{hook-FT3SJLe_.js → mutation-8LjrN7uz.js} +43 -62
  515. package/lib/mutation-8LjrN7uz.js.map +1 -0
  516. package/lib/objectEntries-BS7aAgOm.js +12 -0
  517. package/lib/objectEntries-BS7aAgOm.js.map +1 -0
  518. package/lib/post-processors/removeExtensions.js +4 -4
  519. package/lib/post-processors/traverse.js +2 -2
  520. package/lib/post-processors/traverse.js.map +1 -1
  521. package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
  522. package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
  523. package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
  524. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  525. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  526. package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
  527. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
  528. package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
  529. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  530. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  531. package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
  532. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  533. package/lib/ui/Accordion.js +1 -1
  534. package/lib/ui/ActionButton.js +11 -10
  535. package/lib/ui/ActionButton.js.map +1 -1
  536. package/lib/ui/Alert.js +2 -2
  537. package/lib/ui/AlertDialog.js +1 -1
  538. package/lib/ui/Badge.js +2 -2
  539. package/lib/ui/Breadcrumb.js +4 -4
  540. package/lib/ui/Button.js +13 -12
  541. package/lib/ui/Button.js.map +1 -1
  542. package/lib/ui/Callout.js +39 -21
  543. package/lib/ui/Callout.js.map +1 -1
  544. package/lib/ui/Card.js +1 -1
  545. package/lib/ui/Carousel.js +1 -1
  546. package/lib/ui/Checkbox.js +16 -26
  547. package/lib/ui/Checkbox.js.map +1 -1
  548. package/lib/ui/Command.js +105 -78
  549. package/lib/ui/Command.js.map +1 -1
  550. package/lib/ui/Dialog.js +1 -1
  551. package/lib/ui/Drawer.js +14 -1151
  552. package/lib/ui/Drawer.js.map +1 -1
  553. package/lib/ui/DropdownMenu.js +1 -1
  554. package/lib/ui/Form.js +5 -5
  555. package/lib/ui/HoverCard.js +1 -1
  556. package/lib/ui/Input.js +1 -1
  557. package/lib/ui/Input.js.map +1 -1
  558. package/lib/ui/Label.js +2 -2
  559. package/lib/ui/Pagination.js +10 -10
  560. package/lib/ui/Popover.js +1 -1
  561. package/lib/ui/Progress.js +1 -1
  562. package/lib/ui/RadioGroup.js +1 -1
  563. package/lib/ui/ScrollArea.js +1 -1
  564. package/lib/ui/Select.js +2 -2
  565. package/lib/ui/Select.js.map +1 -1
  566. package/lib/ui/Skeleton.js +1 -1
  567. package/lib/ui/Slider.js +1 -1
  568. package/lib/ui/Stepper.js +6 -0
  569. package/lib/ui/Stepper.js.map +1 -0
  570. package/lib/ui/Switch.js +1 -1
  571. package/lib/ui/SyntaxHighlight.js +11 -0
  572. package/lib/ui/SyntaxHighlight.js.map +1 -0
  573. package/lib/ui/Tabs.js +1 -1
  574. package/lib/ui/Textarea.js +1 -1
  575. package/lib/ui/Toggle.js +2 -2
  576. package/lib/ui/ToggleGroup.js +1 -1
  577. package/lib/ui/Tooltip.js +1 -1
  578. package/lib/ui/util.js +6 -0
  579. package/lib/ui/util.js.map +1 -0
  580. package/lib/{useExposedProps-BLKFBylA.js → useExposedProps-B9qXJedG.js} +2 -2
  581. package/lib/{useExposedProps-BLKFBylA.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
  582. package/lib/zudoku.auth-auth0.js +15 -14
  583. package/lib/zudoku.auth-auth0.js.map +1 -1
  584. package/lib/zudoku.auth-clerk.js +67 -49
  585. package/lib/zudoku.auth-clerk.js.map +1 -1
  586. package/lib/zudoku.auth-openid.js +370 -405
  587. package/lib/zudoku.auth-openid.js.map +1 -1
  588. package/lib/zudoku.components.js +31 -1215
  589. package/lib/zudoku.components.js.map +1 -1
  590. package/lib/zudoku.hooks.js +19 -0
  591. package/lib/zudoku.hooks.js.map +1 -0
  592. package/lib/zudoku.icons.js +10 -0
  593. package/lib/zudoku.icons.js.map +1 -1
  594. package/lib/zudoku.plugin-api-catalog.js +109 -109
  595. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  596. package/lib/zudoku.plugin-api-keys.js +108 -106
  597. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  598. package/lib/zudoku.plugin-custom-pages.js +3 -3
  599. package/lib/zudoku.plugin-markdown.js +23 -44
  600. package/lib/zudoku.plugin-markdown.js.map +1 -1
  601. package/lib/zudoku.plugin-openapi.js +6 -7
  602. package/lib/zudoku.plugin-openapi.js.map +1 -1
  603. package/lib/zudoku.plugin-redirect.js +1 -1
  604. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  605. package/lib/zudoku.plugin-search-pagefind.js +238 -0
  606. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  607. package/lib/zudoku.plugins.js +14 -0
  608. package/lib/zudoku.plugins.js.map +1 -0
  609. package/package.json +83 -55
  610. package/src/app/demo-cdn.html +31 -31
  611. package/src/app/entry.client.tsx +8 -0
  612. package/src/app/entry.server.tsx +18 -11
  613. package/src/app/main.css +100 -58
  614. package/src/app/main.tsx +10 -3
  615. package/src/app/tailwind.ts +20 -0
  616. package/src/lib/MissingIcon.tsx +22 -0
  617. package/src/lib/authentication/authentication.ts +2 -0
  618. package/src/lib/authentication/hook.ts +12 -1
  619. package/src/lib/authentication/providers/auth0.tsx +3 -2
  620. package/src/lib/authentication/providers/clerk.tsx +32 -8
  621. package/src/lib/authentication/providers/openid.tsx +31 -15
  622. package/src/lib/authentication/providers/supabase.tsx +157 -0
  623. package/src/lib/authentication/state.ts +9 -19
  624. package/src/lib/components/AnchorLink.tsx +9 -7
  625. package/src/lib/components/Autocomplete.tsx +6 -4
  626. package/src/lib/components/Banner.tsx +1 -0
  627. package/src/lib/components/Header.tsx +12 -8
  628. package/src/lib/components/Heading.tsx +1 -1
  629. package/src/lib/components/InlineCode.tsx +13 -16
  630. package/src/lib/components/Layout.tsx +20 -67
  631. package/src/lib/components/Main.tsx +49 -0
  632. package/src/lib/components/MobileTopNavigation.tsx +1 -1
  633. package/src/lib/components/Pagination.tsx +47 -0
  634. package/src/lib/components/PathRenderer.tsx +6 -4
  635. package/src/lib/components/ThemeSwitch.tsx +28 -8
  636. package/src/lib/components/TopNavigation.tsx +51 -24
  637. package/src/lib/components/Zudoku.tsx +18 -7
  638. package/src/lib/components/cache.ts +8 -0
  639. package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
  640. package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
  641. package/src/lib/components/context/ZudokuContext.ts +30 -10
  642. package/src/lib/components/index.ts +4 -0
  643. package/src/lib/components/navigation/Sidebar.tsx +14 -10
  644. package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
  645. package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
  646. package/src/lib/components/navigation/SidebarItem.tsx +22 -28
  647. package/src/lib/components/navigation/SidebarWrapper.tsx +13 -15
  648. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  649. package/src/lib/core/RouteGuard.tsx +48 -9
  650. package/src/lib/core/ZudokuContext.ts +57 -12
  651. package/src/lib/core/plugins.ts +29 -7
  652. package/src/lib/errors/ErrorAlert.tsx +24 -17
  653. package/src/lib/hooks/index.ts +5 -0
  654. package/src/lib/hooks/useEvent.test.tsx +149 -0
  655. package/src/lib/hooks/useEvent.ts +41 -0
  656. package/src/lib/icons.ts +1 -0
  657. package/src/lib/oas/graphql/index.ts +223 -73
  658. package/src/lib/oas/parser/dereference/index.ts +2 -0
  659. package/src/lib/oas/parser/index.ts +7 -29
  660. package/src/lib/oas/parser/upgrade/index.ts +2 -1
  661. package/src/lib/plugins/api-catalog/Catalog.tsx +53 -100
  662. package/src/lib/plugins/api-catalog/index.tsx +66 -15
  663. package/src/lib/plugins/api-keys/CreateApiKey.tsx +7 -3
  664. package/src/lib/plugins/api-keys/index.tsx +3 -0
  665. package/src/lib/plugins/markdown/MdxPage.tsx +13 -46
  666. package/src/lib/plugins/markdown/resolver.ts +0 -33
  667. package/src/lib/plugins/openapi/Endpoint.tsx +11 -9
  668. package/src/lib/plugins/openapi/OasProvider.tsx +51 -0
  669. package/src/lib/plugins/openapi/OperationList.tsx +180 -83
  670. package/src/lib/plugins/openapi/OperationListItem.tsx +118 -104
  671. package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
  672. package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
  673. package/src/lib/plugins/openapi/ParameterListItem.tsx +33 -23
  674. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +15 -3
  675. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  676. package/src/lib/plugins/openapi/Sidecar.tsx +52 -16
  677. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
  678. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  679. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
  680. package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
  681. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
  682. package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
  683. package/src/lib/plugins/openapi/graphql/gql.ts +34 -17
  684. package/src/lib/plugins/openapi/graphql/graphql.ts +175 -65
  685. package/src/lib/plugins/openapi/index.tsx +90 -152
  686. package/src/lib/plugins/openapi/interfaces.ts +48 -24
  687. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  688. package/src/lib/plugins/openapi/playground/Headers.tsx +119 -88
  689. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  690. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  691. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +6 -1
  692. package/src/lib/plugins/openapi/playground/PathParams.tsx +16 -10
  693. package/src/lib/plugins/openapi/playground/Playground.tsx +207 -112
  694. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +5 -2
  695. package/src/lib/plugins/openapi/playground/QueryParams.tsx +87 -86
  696. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  697. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  698. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +1 -1
  699. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +25 -5
  700. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
  701. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +29 -31
  702. package/src/lib/plugins/openapi/schema/SchemaView.tsx +48 -35
  703. package/src/lib/plugins/openapi/state.ts +36 -0
  704. package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +37 -0
  705. package/src/lib/plugins/openapi/util/getRoutes.tsx +126 -0
  706. package/src/lib/plugins/openapi/util/methodColorMap.tsx +11 -0
  707. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +157 -0
  708. package/src/lib/plugins/search-pagefind/ResultList.tsx +116 -0
  709. package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
  710. package/src/lib/plugins/search-pagefind/index.tsx +21 -0
  711. package/src/lib/plugins/search-pagefind/types.ts +118 -0
  712. package/src/lib/ui/Button.tsx +4 -2
  713. package/src/lib/ui/Callout.tsx +28 -10
  714. package/src/lib/ui/Checkbox.tsx +8 -24
  715. package/src/lib/ui/Command.tsx +25 -3
  716. package/src/lib/ui/Input.tsx +1 -2
  717. package/src/lib/ui/Select.tsx +1 -1
  718. package/src/lib/ui/Stepper.tsx +8 -0
  719. package/src/lib/ui/SyntaxHighlight.tsx +186 -0
  720. package/src/lib/ui/util.tsx +3 -0
  721. package/src/lib/util/MdxComponents.tsx +7 -4
  722. package/src/lib/util/joinPath.tsx +3 -0
  723. package/src/lib/util/scrollIntoViewIfNeeded.ts +18 -0
  724. package/src/lib/util/traverse.ts +4 -8
  725. package/src/lib/util/types.ts +7 -0
  726. package/src/lib/util/useLatest.ts +18 -0
  727. package/src/lib/util/useOnScreen.ts +6 -4
  728. package/src/lib/util/useScrollToAnchor.ts +31 -39
  729. package/src/lib/util/useScrollToTop.ts +8 -3
  730. package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
  731. package/dist/lib/components/SyntaxHighlight.js +0 -53
  732. package/dist/lib/components/SyntaxHighlight.js.map +0 -1
  733. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  734. package/dist/lib/plugins/openapi/OpenApiRoute.js +0 -25
  735. package/dist/lib/plugins/openapi/OpenApiRoute.js.map +0 -1
  736. package/dist/vite/prerender.js +0 -89
  737. package/dist/vite/prerender.js.map +0 -1
  738. package/lib/Markdown-Cyrx_JrO.js.map +0 -1
  739. package/lib/MdxPage-BuG8Tuwc.js +0 -193
  740. package/lib/MdxPage-BuG8Tuwc.js.map +0 -1
  741. package/lib/OpenApiRoute-UrC_t0e5.js +0 -36
  742. package/lib/OpenApiRoute-UrC_t0e5.js.map +0 -1
  743. package/lib/OperationList-CDt1xdc4.js +0 -5169
  744. package/lib/OperationList-CDt1xdc4.js.map +0 -1
  745. package/lib/SlotletProvider-mQiPDQIH.js +0 -221
  746. package/lib/SlotletProvider-mQiPDQIH.js.map +0 -1
  747. package/lib/Spinner-BlzrEEk1.js +0 -51
  748. package/lib/Spinner-BlzrEEk1.js.map +0 -1
  749. package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
  750. package/lib/ZudokuContext-BTUJPpQl.js +0 -1229
  751. package/lib/ZudokuContext-BTUJPpQl.js.map +0 -1
  752. package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
  753. package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
  754. package/lib/chunk-SYFQ2XB5-BPvC-soB.js.map +0 -1
  755. package/lib/circular-DxaIIlWD.js.map +0 -1
  756. package/lib/context-rwLGh-6_.js +0 -22
  757. package/lib/createServer-CjNktZzL.js.map +0 -1
  758. package/lib/hook-FT3SJLe_.js.map +0 -1
  759. package/lib/index-B7mqiOei.js +0 -509
  760. package/lib/index-B7mqiOei.js.map +0 -1
  761. package/lib/index-Djenk2Hj.js +0 -36
  762. package/lib/index-Eb1oiHbM.js +0 -1997
  763. package/lib/index-Eb1oiHbM.js.map +0 -1
  764. package/lib/index.esm-9-TF9KQB.js +0 -692
  765. package/lib/index.esm-9-TF9KQB.js.map +0 -1
  766. package/lib/joinUrl-nLx9pD-Z.js +0 -20
  767. package/lib/joinUrl-nLx9pD-Z.js.map +0 -1
  768. package/lib/state-mM7uaXTW.js +0 -202
  769. package/lib/state-mM7uaXTW.js.map +0 -1
  770. package/lib/useScrollToAnchor-BZsGmBng.js +0 -284
  771. package/lib/useScrollToAnchor-BZsGmBng.js.map +0 -1
  772. package/src/lib/components/SyntaxHighlight.tsx +0 -171
  773. package/src/lib/plugins/openapi/OpenApiRoute.tsx +0 -51
  774. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
@@ -1,1997 +0,0 @@
1
- var ut = Object.defineProperty;
2
- var Ie = (t) => {
3
- throw TypeError(t);
4
- };
5
- var pt = (t, a, s) => a in t ? ut(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
6
- var X = (t, a, s) => pt(t, typeof a != "symbol" ? a + "" : a, s), ht = (t, a, s) => a.has(t) || Ie("Cannot " + s);
7
- var Y = (t, a, s) => (ht(t, a, "read from private field"), s ? s.call(t) : a.get(t)), ee = (t, a, s) => a.has(t) ? Ie("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, s);
8
- import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
9
- import { s as te } from "./index-CjJS0l4l.js";
10
- import { Circle as xt, ChevronRightIcon as z, CheckIcon as ft, DotIcon as gt, Check as yt, Search as vt, XIcon as jt, ChevronDownIcon as bt, InfoIcon as Ee, LogInIcon as Nt, CirclePlayIcon as wt } from "lucide-react";
11
- import { m as Ct, r as $t } from "./chunk-SYFQ2XB5-BPvC-soB.js";
12
- import { u as St } from "./hook-FT3SJLe_.js";
13
- import { Button as _ } from "./ui/Button.js";
14
- import { j as I } from "./joinUrl-nLx9pD-Z.js";
15
- import { Z as Tt } from "./invariant-Caa8-XvF.js";
16
- import { VisuallyHidden as Pt } from "@radix-ui/react-visually-hidden";
17
- import * as x from "react";
18
- import { Fragment as k, useRef as q, useEffect as He, useState as H, useTransition as kt } from "react";
19
- import { V as b, T as Rt, D as Ot, b as It, a as Et, c as At } from "./index-B7mqiOei.js";
20
- import { S as Be, a as Ge, b as Ue, c as Me, e as U, u as qt } from "./Select-CnCZ4WhS.js";
21
- import { b as ue, u as pe, C as R, a as Dt, F as Lt } from "./index.esm-CrSoEshU.js";
22
- import { c as he } from "./index-Djenk2Hj.js";
23
- import { c as u } from "./cn-qaFjX9_3.js";
24
- import * as _e from "@radix-ui/react-label";
25
- import * as B from "@radix-ui/react-radio-group";
26
- import { a as Vt } from "./state-mM7uaXTW.js";
27
- import { k as Ft, l as zt } from "./ZudokuContext-BTUJPpQl.js";
28
- import { Card as xe, CardHeader as Ht, CardTitle as Bt, CardContent as Gt } from "./ui/Card.js";
29
- import { Tabs as Je, TabsList as Qe, TabsTrigger as E, TabsContent as A } from "./ui/Tabs.js";
30
- import { z as Ut, S as Mt } from "./SyntaxHighlight-B0L4SC_N.js";
31
- import { B as M, S as _t } from "./Spinner-BlzrEEk1.js";
32
- import * as g from "@radix-ui/react-dropdown-menu";
33
- import * as ie from "@radix-ui/react-checkbox";
34
- import * as J from "@radix-ui/react-popover";
35
- import { PopoverAnchor as Jt } from "@radix-ui/react-popover";
36
- import { Input as fe } from "./ui/Input.js";
37
- import { Slot as Qt } from "@radix-ui/react-slot";
38
- import { Callout as Wt } from "./ui/Callout.js";
39
- import { Collapsible as Ae, CollapsibleTrigger as qe, CollapsibleContent as De } from "./ui/Collapsible.js";
40
- import * as ge from "@radix-ui/react-collapsible";
41
- let ae;
42
- const Zt = (t) => {
43
- var a;
44
- if ((a = t.errors) != null && a[0])
45
- throw new Tt(t.errors[0].message, {
46
- developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
47
- });
48
- };
49
- var W, Z;
50
- class Kt {
51
- constructor(a) {
52
- ee(this, W, async () => (ae || (ae = import("./createServer-CjNktZzL.js").then(
53
- (a) => a.createServer(this.config)
54
- )), ae));
55
- ee(this, Z, async (a) => this.config.server ? fetch(this.config.server, a) : (await Y(this, W).call(this)).fetch("http://localhost/graphql", a));
56
- X(this, "fetch", async (a, ...[s]) => {
57
- var r;
58
- const n = (r = a.match(/query (\w+)/)) == null ? void 0 : r[1], i = await Y(this, Z).call(this, {
59
- method: "POST",
60
- body: JSON.stringify({ query: a, variables: s, operationName: n }),
61
- headers: { "Content-Type": "application/json" }
62
- });
63
- if (!i.ok)
64
- throw new Error("Network response was not ok");
65
- const d = await i.json();
66
- return Zt(d), d.data;
67
- });
68
- this.config = a;
69
- }
70
- }
71
- W = new WeakMap(), Z = new WeakMap();
72
- class D extends String {
73
- constructor(s, n) {
74
- super(s);
75
- X(this, "__apiType");
76
- this.value = s, this.__meta__ = n;
77
- }
78
- toString() {
79
- return this.value;
80
- }
81
- }
82
- const Xt = new D(
83
- `
84
- fragment OperationsFragment on OperationItem {
85
- slug
86
- summary
87
- method
88
- description
89
- operationId
90
- contentTypes
91
- path
92
- parameters {
93
- name
94
- in
95
- description
96
- required
97
- schema
98
- style
99
- examples {
100
- name
101
- description
102
- externalValue
103
- value
104
- summary
105
- }
106
- }
107
- requestBody {
108
- content {
109
- mediaType
110
- encoding {
111
- name
112
- }
113
- examples {
114
- name
115
- description
116
- externalValue
117
- value
118
- summary
119
- }
120
- schema
121
- }
122
- description
123
- required
124
- }
125
- responses {
126
- statusCode
127
- links
128
- description
129
- content {
130
- examples {
131
- name
132
- description
133
- externalValue
134
- value
135
- summary
136
- }
137
- mediaType
138
- encoding {
139
- name
140
- }
141
- schema
142
- }
143
- }
144
- }
145
- `,
146
- { fragmentName: "OperationsFragment" }
147
- ), Yt = new D(`
148
- query ServersQuery($input: JSON!, $type: SchemaType!) {
149
- schema(input: $input, type: $type) {
150
- url
151
- servers {
152
- url
153
- }
154
- }
155
- }
156
- `), ea = new D(`
157
- query AllOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
158
- schema(input: $input, type: $type) {
159
- description
160
- summary
161
- title
162
- url
163
- version
164
- tags(name: $tag) {
165
- name
166
- description
167
- }
168
- operations(tag: $tag, untagged: $untagged) {
169
- slug
170
- ...OperationsFragment
171
- }
172
- }
173
- }
174
- fragment OperationsFragment on OperationItem {
175
- slug
176
- summary
177
- method
178
- description
179
- operationId
180
- contentTypes
181
- path
182
- parameters {
183
- name
184
- in
185
- description
186
- required
187
- schema
188
- style
189
- examples {
190
- name
191
- description
192
- externalValue
193
- value
194
- summary
195
- }
196
- }
197
- requestBody {
198
- content {
199
- mediaType
200
- encoding {
201
- name
202
- }
203
- examples {
204
- name
205
- description
206
- externalValue
207
- value
208
- summary
209
- }
210
- schema
211
- }
212
- description
213
- required
214
- }
215
- responses {
216
- statusCode
217
- links
218
- description
219
- content {
220
- examples {
221
- name
222
- description
223
- externalValue
224
- value
225
- summary
226
- }
227
- mediaType
228
- encoding {
229
- name
230
- }
231
- schema
232
- }
233
- }
234
- }`), ta = new D(`
235
- query getServerQuery($input: JSON!, $type: SchemaType!) {
236
- schema(input: $input, type: $type) {
237
- url
238
- servers {
239
- url
240
- }
241
- }
242
- }
243
- `), aa = new D(`
244
- query GetCategories($input: JSON!, $type: SchemaType!) {
245
- schema(input: $input, type: $type) {
246
- url
247
- tags {
248
- name
249
- }
250
- }
251
- }
252
- `), sa = new D(`
253
- query GetOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
254
- schema(input: $input, type: $type) {
255
- operations(tag: $tag, untagged: $untagged) {
256
- slug
257
- deprecated
258
- method
259
- summary
260
- operationId
261
- path
262
- }
263
- }
264
- }
265
- `), na = {
266
- "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": Yt,
267
- "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\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": Xt,
268
- "\n query AllOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags(name: $tag) {\n name\n description\n }\n operations(tag: $tag, untagged: $untagged) {\n slug\n ...OperationsFragment\n }\n }\n }\n": ea,
269
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ta,
270
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n": aa,
271
- "\n query GetOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n operations(tag: $tag, untagged: $untagged) {\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n": sa
272
- };
273
- function We(t) {
274
- return na[t] ?? {};
275
- }
276
- const ra = he(
277
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
278
- {
279
- variants: {
280
- variant: {
281
- default: "bg-background text-foreground",
282
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
283
- }
284
- },
285
- defaultVariants: {
286
- variant: "default"
287
- }
288
- }
289
- ), le = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
290
- "div",
291
- {
292
- ref: n,
293
- role: "alert",
294
- className: u(ra({ variant: a }), t),
295
- ...s
296
- }
297
- ));
298
- le.displayName = "Alert";
299
- const de = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
300
- "h5",
301
- {
302
- ref: s,
303
- className: u("mb-1 font-medium leading-none tracking-tight", t),
304
- ...a
305
- }
306
- ));
307
- de.displayName = "AlertTitle";
308
- const ce = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
309
- "div",
310
- {
311
- ref: s,
312
- className: u("text-sm [&_p]:leading-relaxed", t),
313
- ...a
314
- }
315
- ));
316
- ce.displayName = "AlertDescription";
317
- const oa = ({
318
- path: t,
319
- renderParam: a
320
- }) => t.split("/").map((s, n, i) => {
321
- const d = Array.from(s.matchAll(/{([^}]+)}/g)), r = [];
322
- let m = 0;
323
- return d.forEach((c, h) => {
324
- const [y, v] = c;
325
- if (!v) return;
326
- const p = c.index;
327
- p > m && r.push(
328
- /* @__PURE__ */ e.jsx(k, { children: s.slice(m, p) }, `text-${m}-${p}`)
329
- ), r.push(
330
- /* @__PURE__ */ e.jsx(k, { children: a({ name: v, originalValue: y, index: h }) }, `param-${v}`)
331
- ), m = p + y.length;
332
- }), m < s.length && r.push(
333
- /* @__PURE__ */ e.jsx(k, { children: s.slice(m) }, `text-${m}-${s.length}`)
334
- ), // eslint-disable-next-line react/no-array-index-key
335
- /* @__PURE__ */ e.jsxs(k, { children: [
336
- r,
337
- n < i.length - 1 && "/",
338
- /* @__PURE__ */ e.jsx("wbr", {})
339
- ] }, `${s}-${n}`);
340
- }), ia = he(
341
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
342
- ), V = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
343
- _e.Root,
344
- {
345
- ref: s,
346
- className: u(ia(), t),
347
- ...a
348
- }
349
- ));
350
- V.displayName = _e.Root.displayName;
351
- const ye = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
352
- B.Root,
353
- {
354
- className: u("grid gap-2", t),
355
- ...a,
356
- ref: s
357
- }
358
- ));
359
- ye.displayName = B.Root.displayName;
360
- const Q = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
361
- B.Item,
362
- {
363
- ref: s,
364
- className: u(
365
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
366
- t
367
- ),
368
- ...a,
369
- children: /* @__PURE__ */ e.jsx(B.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(xt, { className: "h-2.5 w-2.5 fill-current text-current" }) })
370
- }
371
- ));
372
- Q.displayName = B.Item.displayName;
373
- const Ze = x.forwardRef(
374
- ({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
375
- "textarea",
376
- {
377
- className: u(
378
- "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-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
379
- t
380
- ),
381
- ref: s,
382
- ...a
383
- }
384
- )
385
- );
386
- Ze.displayName = "Textarea";
387
- const se = (t) => Math.abs(
388
- isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
389
- ), ne = (t) => t.length > 1 ? parseInt(t.split("").reduce((a, s) => `${se(a) + se(s)}`)) : se(t), Le = (t, a = {}) => {
390
- const s = (3 * ne(t) + 2 * ne(t) + ne(t)) % 360, { saturation: n = 75, lightness: i = 60 } = a;
391
- return `${s}deg ${n}% ${i}%`;
392
- }, re = "data-linked-param", la = (t) => {
393
- const { resolvedTheme: a } = Ut();
394
- return {
395
- text: Le(
396
- t,
397
- a === "light" ? { saturation: 95, lightness: 38 } : {}
398
- ),
399
- background: Le(
400
- t,
401
- a === "light" ? { saturation: 85, lightness: 40 } : {}
402
- )
403
- };
404
- }, Ke = ({
405
- name: t,
406
- className: a,
407
- slug: s,
408
- title: n,
409
- children: i,
410
- onClick: d
411
- }) => {
412
- const r = q(null), m = s == null ? void 0 : s.replace(/[{}]/g, ""), c = t.replace(/[{}]/g, ""), { text: h, background: y } = la(c), v = `hsl(${h} / 100%)`, p = `hsl(${y} / 10%)`, l = `hsl(${y} / 50%)`;
413
- return He(() => {
414
- if (!m || !r.current) return;
415
- const f = () => {
416
- document.querySelectorAll(`[${re}="${m}"]`).forEach(($) => {
417
- $ instanceof HTMLElement && ($.dataset.active = "true");
418
- });
419
- }, C = () => {
420
- document.querySelectorAll(`[${re}="${m}"]`).forEach(($) => {
421
- $ instanceof HTMLElement && ($.dataset.active = "false");
422
- });
423
- }, N = r.current;
424
- return N.addEventListener("mouseenter", f), N.addEventListener("mouseleave", C), () => {
425
- N.removeEventListener("mouseenter", f), N.removeEventListener("mouseleave", C);
426
- };
427
- }, [m]), /* @__PURE__ */ e.jsx(
428
- "span",
429
- {
430
- [re]: m,
431
- className: u(
432
- // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
433
- "relative rounded transition-all duration-100 rounded-lg",
434
- "border border-[--border-color] p-0.5 text-[--param-color] bg-[--background-color]",
435
- "data-[active=true]:border-[--param-color] data-[active=true]:shadow data-[active=true]:bottom-px",
436
- a
437
- ),
438
- title: n,
439
- suppressHydrationWarning: !0,
440
- ref: r,
441
- onClick: d,
442
- style: {
443
- "--param-color": v,
444
- "--border-color": l,
445
- "--background-color": p
446
- },
447
- children: i ?? t
448
- }
449
- );
450
- }, da = (t, a, s) => {
451
- const n = a.replace(/(:\w+|\{\w+})/g, (d) => {
452
- var c;
453
- const r = d.replace(/[:{}]/g, "");
454
- return ((c = s.pathParams.find((h) => h.name === r)) == null ? void 0 : c.value) ?? d;
455
- }), i = new URL(
456
- n.replace(/^\//, ""),
457
- t.endsWith("/") ? t : `${t}/`
458
- );
459
- return s.queryParams.filter((d) => d.active).forEach((d) => {
460
- i.searchParams.set(d.name, d.value);
461
- }), i;
462
- }, Xe = g.Root, Ye = g.Trigger, ca = g.Group, ma = x.forwardRef(({ className: t, inset: a, children: s, ...n }, i) => /* @__PURE__ */ e.jsxs(
463
- g.SubTrigger,
464
- {
465
- ref: i,
466
- className: u(
467
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
468
- a && "pl-8",
469
- t
470
- ),
471
- ...n,
472
- children: [
473
- s,
474
- /* @__PURE__ */ e.jsx(z, { className: "ml-auto h-4 w-4" })
475
- ]
476
- }
477
- ));
478
- ma.displayName = g.SubTrigger.displayName;
479
- const ua = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
480
- g.SubContent,
481
- {
482
- ref: s,
483
- className: u(
484
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
485
- t
486
- ),
487
- ...a
488
- }
489
- ));
490
- ua.displayName = g.SubContent.displayName;
491
- const ve = x.forwardRef(({ className: t, sideOffset: a = 4, ...s }, n) => /* @__PURE__ */ e.jsx(g.Portal, { children: /* @__PURE__ */ e.jsx(
492
- g.Content,
493
- {
494
- ref: n,
495
- sideOffset: a,
496
- className: u(
497
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
498
- "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",
499
- t
500
- ),
501
- ...s
502
- }
503
- ) }));
504
- ve.displayName = g.Content.displayName;
505
- const je = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
506
- g.Item,
507
- {
508
- ref: n,
509
- className: u(
510
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
511
- a && "pl-8",
512
- t
513
- ),
514
- ...s
515
- }
516
- ));
517
- je.displayName = g.Item.displayName;
518
- const pa = x.forwardRef(({ className: t, children: a, checked: s, ...n }, i) => /* @__PURE__ */ e.jsxs(
519
- g.CheckboxItem,
520
- {
521
- ref: i,
522
- className: u(
523
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
524
- t
525
- ),
526
- checked: s,
527
- ...n,
528
- children: [
529
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(g.ItemIndicator, { children: /* @__PURE__ */ e.jsx(ft, { className: "h-4 w-4" }) }) }),
530
- a
531
- ]
532
- }
533
- ));
534
- pa.displayName = g.CheckboxItem.displayName;
535
- const ha = x.forwardRef(({ className: t, children: a, ...s }, n) => /* @__PURE__ */ e.jsxs(
536
- g.RadioItem,
537
- {
538
- ref: n,
539
- className: u(
540
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
541
- t
542
- ),
543
- ...s,
544
- children: [
545
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(g.ItemIndicator, { children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 fill-current" }) }) }),
546
- a
547
- ]
548
- }
549
- ));
550
- ha.displayName = g.RadioItem.displayName;
551
- const et = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
552
- g.Label,
553
- {
554
- ref: n,
555
- className: u(
556
- "px-2 py-1.5 text-sm font-semibold",
557
- a && "pl-8",
558
- t
559
- ),
560
- ...s
561
- }
562
- ));
563
- et.displayName = g.Label.displayName;
564
- const tt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
565
- g.Separator,
566
- {
567
- ref: s,
568
- className: u("-mx-1 my-1 h-px bg-muted", t),
569
- ...a
570
- }
571
- ));
572
- tt.displayName = g.Separator.displayName;
573
- const xa = ({
574
- examples: t,
575
- onSelect: a
576
- }) => /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 mt-2 items-end", children: /* @__PURE__ */ e.jsxs(Xe, { children: [
577
- /* @__PURE__ */ e.jsx(Ye, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "outline", children: "Use Example" }) }),
578
- /* @__PURE__ */ e.jsx(ve, { className: "w-56", children: t.map((s) => {
579
- var n;
580
- return /* @__PURE__ */ e.jsxs("div", { children: [
581
- /* @__PURE__ */ e.jsx(et, { children: s.mediaType }),
582
- /* @__PURE__ */ e.jsx(tt, {}),
583
- /* @__PURE__ */ e.jsx(ca, { children: (n = s.examples) == null ? void 0 : n.map((i) => /* @__PURE__ */ e.jsx(
584
- je,
585
- {
586
- onSelect: () => a(i),
587
- className: "line-clamp-1",
588
- children: i.summary ?? i.name
589
- },
590
- i.name
591
- )) })
592
- ] }, s.mediaType);
593
- }) })
594
- ] }) }), K = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
595
- "div",
596
- {
597
- ref: s,
598
- className: u(
599
- "rounded-xl border bg-card text-card-foreground shadow-sm",
600
- t
601
- ),
602
- ...a
603
- }
604
- ));
605
- K.displayName = "Card";
606
- const fa = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
607
- "div",
608
- {
609
- ref: s,
610
- className: u("flex flex-col space-y-1.5 p-6", t),
611
- ...a
612
- }
613
- ));
614
- fa.displayName = "CardHeader";
615
- const ga = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
616
- "h3",
617
- {
618
- ref: s,
619
- className: u("font-semibold leading-none tracking-tight", t),
620
- ...a
621
- }
622
- ));
623
- ga.displayName = "CardTitle";
624
- const ya = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
625
- "p",
626
- {
627
- ref: s,
628
- className: u("text-sm text-muted-foreground", t),
629
- ...a
630
- }
631
- ));
632
- ya.displayName = "CardDescription";
633
- const va = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx("div", { ref: s, className: u("p-6 pt-0", t), ...a }));
634
- va.displayName = "CardContent";
635
- const ja = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
636
- "div",
637
- {
638
- ref: s,
639
- className: u("flex items-center p-6 pt-0", t),
640
- ...a
641
- }
642
- ));
643
- ja.displayName = "CardFooter";
644
- const ba = he(
645
- "peer h-4 w-4 shrink-0 rounded-sm ring-offset-background focus-visible:outline-none 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",
646
- {
647
- variants: {
648
- variant: {
649
- default: "border border-primary data-[state=checked]:bg-primary",
650
- outline: "border border-input data-[state=checked]:bg-accent"
651
- }
652
- },
653
- defaultVariants: {
654
- variant: "default"
655
- }
656
- }
657
- ), be = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
658
- ie.Root,
659
- {
660
- ref: n,
661
- className: u(ba({ variant: a, className: t })),
662
- ...s,
663
- children: /* @__PURE__ */ e.jsx(
664
- ie.Indicator,
665
- {
666
- className: u("flex items-center justify-center text-current"),
667
- children: /* @__PURE__ */ e.jsx(yt, { className: "h-4 w-4" })
668
- }
669
- )
670
- }
671
- ));
672
- be.displayName = ie.Root.displayName;
673
- const at = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
674
- b,
675
- {
676
- ref: s,
677
- className: u(
678
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
679
- t
680
- ),
681
- ...a
682
- }
683
- ));
684
- at.displayName = b.displayName;
685
- const Na = x.forwardRef(({ className: t, ...a }, s) => (
686
- // eslint-disable-next-line react/no-unknown-property
687
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
688
- /* @__PURE__ */ e.jsx(vt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
689
- /* @__PURE__ */ e.jsx(
690
- b.Input,
691
- {
692
- ref: s,
693
- className: u(
694
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
695
- t
696
- ),
697
- ...a
698
- }
699
- )
700
- ] })
701
- ));
702
- Na.displayName = b.Input.displayName;
703
- const st = x.forwardRef(({ className: t, ...a }, s) => (
704
- // eslint-disable-next-line react/no-unknown-property
705
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center", "cmdk-input-wrapper": "", children: /* @__PURE__ */ e.jsx(
706
- b.Input,
707
- {
708
- ref: s,
709
- className: u(
710
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
711
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
712
- t
713
- ),
714
- ...a
715
- }
716
- ) })
717
- ));
718
- st.displayName = b.Input.displayName;
719
- const nt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
720
- b.List,
721
- {
722
- ref: s,
723
- className: u("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
724
- ...a
725
- }
726
- ));
727
- nt.displayName = b.List.displayName;
728
- const wa = x.forwardRef((t, a) => /* @__PURE__ */ e.jsx(
729
- b.Empty,
730
- {
731
- ref: a,
732
- className: "py-6 text-center text-sm",
733
- ...t
734
- }
735
- ));
736
- wa.displayName = b.Empty.displayName;
737
- const Ca = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
738
- b.Group,
739
- {
740
- ref: s,
741
- className: u(
742
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
743
- t
744
- ),
745
- ...a
746
- }
747
- ));
748
- Ca.displayName = b.Group.displayName;
749
- const $a = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
750
- b.Separator,
751
- {
752
- ref: s,
753
- className: u("-mx-1 h-px bg-border", t),
754
- ...a
755
- }
756
- ));
757
- $a.displayName = b.Separator.displayName;
758
- const rt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
759
- b.Item,
760
- {
761
- ref: s,
762
- className: u(
763
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
764
- t
765
- ),
766
- ...a
767
- }
768
- ));
769
- rt.displayName = b.Item.displayName;
770
- const Sa = J.Root, ot = x.forwardRef(({ className: t, align: a = "center", sideOffset: s = 4, ...n }, i) => /* @__PURE__ */ e.jsx(J.Portal, { children: /* @__PURE__ */ e.jsx(
771
- J.Content,
772
- {
773
- ref: i,
774
- align: a,
775
- sideOffset: s,
776
- className: u(
777
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
778
- t
779
- ),
780
- ...n
781
- }
782
- ) }));
783
- ot.displayName = J.Content.displayName;
784
- const Ta = ({
785
- value: t,
786
- options: a,
787
- onChange: s,
788
- className: n,
789
- placeholder: i = "Enter value",
790
- onEnterPress: d,
791
- ref: r
792
- }) => {
793
- const [m, c] = H(!1), [h, y] = H(!1), v = Rt((l) => l.filtered.count), p = q(null);
794
- return /* @__PURE__ */ e.jsxs(Sa, { open: m, children: [
795
- /* @__PURE__ */ e.jsx(Jt, { children: /* @__PURE__ */ e.jsx(
796
- st,
797
- {
798
- ref: (l) => {
799
- p.current = l, typeof r == "function" ? r(l) : r && (r.current = l);
800
- },
801
- value: t,
802
- placeholder: i,
803
- className: u("h-9 bg-transparent", n),
804
- onFocus: () => c(!0),
805
- onBlur: () => {
806
- h || c(!1);
807
- },
808
- onKeyDown: (l) => {
809
- var f;
810
- l.key === "Enter" && (c(!1), (f = p.current) == null || f.blur(), d == null || d(l));
811
- },
812
- onValueChange: (l) => s(l)
813
- }
814
- ) }),
815
- /* @__PURE__ */ e.jsx(
816
- ot,
817
- {
818
- onMouseEnter: () => y(!0),
819
- onMouseLeave: () => y(!1),
820
- onOpenAutoFocus: (l) => l.preventDefault(),
821
- className: u("p-0 w-[--radix-popover-trigger-width]", {
822
- "border-0": v === 0
823
- }),
824
- align: "start",
825
- side: "bottom",
826
- onWheel: (l) => {
827
- l.stopPropagation();
828
- },
829
- onTouchMove: (l) => {
830
- l.stopPropagation();
831
- },
832
- children: /* @__PURE__ */ e.jsx(nt, { className: "max-h-[140px]", children: a.map((l) => /* @__PURE__ */ e.jsx(
833
- rt,
834
- {
835
- value: l,
836
- onSelect: (f) => {
837
- s(f), c(!1);
838
- },
839
- className: "cursor-pointer",
840
- children: l
841
- },
842
- l
843
- )) })
844
- }
845
- )
846
- ] });
847
- }, me = (t) => /* @__PURE__ */ e.jsx(at, { className: "bg-transparent", children: /* @__PURE__ */ e.jsx(Ta, { ...t }) }), it = (t, a) => {
848
- const s = x.forwardRef(({ className: n, asChild: i, ...d }, r) => {
849
- const m = i ? Qt : t;
850
- return x.createElement(m, {
851
- ...d,
852
- ref: r,
853
- className: typeof a == "function" ? a({ className: n }) : u(a, n)
854
- });
855
- });
856
- return s.displayName = `VariantComponent(${t})`, s;
857
- }, Ne = it(
858
- "div",
859
- "hover:bg-accent/40 grid grid-cols-[2fr_3fr] gap-2 items-center px-3"
860
- ), Pa = Object.freeze([
861
- "Accept",
862
- "Accept-Encoding",
863
- "Accept-Language",
864
- "Authorization",
865
- "Cache-Control",
866
- "Connection",
867
- "Content-Disposition",
868
- "Content-Encoding",
869
- "Content-Language",
870
- "Content-Length",
871
- "Content-Range",
872
- "Content-Security-Policy",
873
- "Content-Type",
874
- "Cookie",
875
- "Date",
876
- "ETag",
877
- "Expires",
878
- "Host",
879
- "If-Modified-Since",
880
- "Location",
881
- "Origin",
882
- "Pragma",
883
- "Referer",
884
- "Set-Cookie",
885
- "User-Agent",
886
- "X-Requested-With"
887
- ]), ka = ({
888
- control: t,
889
- register: a
890
- }) => {
891
- const { fields: s, append: n, remove: i } = ue({
892
- control: t,
893
- name: "headers"
894
- }), { setValue: d } = pe(), r = q([]), m = q([]), c = () => {
895
- n({
896
- name: "",
897
- value: "",
898
- active: !1
899
- });
900
- }, h = (v) => {
901
- var p;
902
- (p = r.current[v]) == null || p.focus();
903
- }, y = (v) => {
904
- c(), requestAnimationFrame(() => {
905
- var p;
906
- return (p = m.current[v + 1]) == null ? void 0 : p.focus();
907
- });
908
- };
909
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
910
- /* @__PURE__ */ e.jsx(K, { className: "overflow-hidden", children: /* @__PURE__ */ e.jsx(Ne, { children: s.map((v, p) => /* @__PURE__ */ e.jsxs("div", { className: "group grid col-span-full grid-cols-subgrid", children: [
911
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 ", children: [
912
- /* @__PURE__ */ e.jsx(
913
- R,
914
- {
915
- control: t,
916
- name: `headers.${p}.active`,
917
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
918
- be,
919
- {
920
- variant: "outline",
921
- id: `headers.${p}.active`,
922
- checked: l.value,
923
- onCheckedChange: (f) => {
924
- l.onChange(f);
925
- }
926
- }
927
- )
928
- }
929
- ),
930
- /* @__PURE__ */ e.jsx(
931
- R,
932
- {
933
- control: t,
934
- name: `headers.${p}.name`,
935
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
936
- me,
937
- {
938
- ...l,
939
- placeholder: "Name",
940
- className: "border-0 shadow-none bg-transparent text-xs font-mono",
941
- options: Pa,
942
- onEnterPress: () => h(p),
943
- onChange: (f) => {
944
- l.onChange(f), d(`headers.${p}.active`, !0);
945
- },
946
- ref: (f) => {
947
- m.current[p] = f;
948
- }
949
- }
950
- )
951
- }
952
- )
953
- ] }),
954
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
955
- /* @__PURE__ */ e.jsx(
956
- R,
957
- {
958
- control: t,
959
- name: `headers.${p}.value`,
960
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
961
- fe,
962
- {
963
- placeholder: "Value",
964
- className: "w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0",
965
- ...l,
966
- ref: (f) => {
967
- r.current[p] = f;
968
- },
969
- onKeyDown: (f) => {
970
- f.key === "Enter" && f.currentTarget.value.trim() && y(p);
971
- },
972
- autoComplete: "off"
973
- }
974
- )
975
- }
976
- ),
977
- /* @__PURE__ */ e.jsx(
978
- _,
979
- {
980
- size: "icon",
981
- variant: "ghost",
982
- className: "text-muted-foreground opacity-0 group-hover:opacity-100 rounded-full w-8 h-7",
983
- onClick: () => {
984
- i(p);
985
- },
986
- type: "button",
987
- children: /* @__PURE__ */ e.jsx(jt, { size: 16 })
988
- }
989
- )
990
- ] })
991
- ] }, p)) }) }),
992
- /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
993
- _,
994
- {
995
- className: "",
996
- onClick: c,
997
- type: "button",
998
- variant: "secondary",
999
- children: "Add header"
1000
- }
1001
- ) })
1002
- ] });
1003
- }, Ra = ({
1004
- control: t
1005
- }) => {
1006
- const { fields: a } = ue({
1007
- control: t,
1008
- name: "pathParams"
1009
- });
1010
- return /* @__PURE__ */ e.jsx(K, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx(Ne, { children: a.map((s, n) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1011
- /* @__PURE__ */ e.jsx(
1012
- R,
1013
- {
1014
- control: t,
1015
- name: `pathParams.${n}.name`,
1016
- render: () => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
1017
- Ke,
1018
- {
1019
- slug: s.name,
1020
- name: s.name,
1021
- className: "font-mono text-xs px-2"
1022
- }
1023
- ) })
1024
- }
1025
- ),
1026
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1027
- R,
1028
- {
1029
- control: t,
1030
- name: `pathParams.${n}.value`,
1031
- render: ({ field: i }) => /* @__PURE__ */ e.jsx(
1032
- fe,
1033
- {
1034
- ...i,
1035
- required: !0,
1036
- placeholder: "Enter value",
1037
- className: "w-full border-0 shadow-none text-xs font-mono hover:bg-accent"
1038
- }
1039
- )
1040
- }
1041
- ) })
1042
- ] })) }) });
1043
- }, Oa = it(
1044
- "input",
1045
- "px-2 bg-transparent h-6 font-mono text-xs m-2"
1046
- ), Ia = ({
1047
- control: t,
1048
- queryParams: a
1049
- }) => {
1050
- const { fields: s } = ue({
1051
- control: t,
1052
- name: "queryParams"
1053
- }), n = pe(), i = a.map((d) => !!d.isRequired);
1054
- return /* @__PURE__ */ e.jsx(K, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx("div", { className: "w-full ", children: s.map((d, r) => {
1055
- const m = a.find(
1056
- (c) => c.name === d.name
1057
- );
1058
- return /* @__PURE__ */ e.jsxs(Ne, { children: [
1059
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1060
- /* @__PURE__ */ e.jsx(
1061
- R,
1062
- {
1063
- control: t,
1064
- name: `queryParams.${r}.active`,
1065
- render: ({ field: c }) => /* @__PURE__ */ e.jsx(
1066
- be,
1067
- {
1068
- variant: "outline",
1069
- id: `queryParams.${r}.active`,
1070
- className: "mr-2",
1071
- checked: c.value,
1072
- onCheckedChange: c.onChange
1073
- }
1074
- )
1075
- }
1076
- ),
1077
- /* @__PURE__ */ e.jsx(
1078
- R,
1079
- {
1080
- control: t,
1081
- render: ({ field: c }) => i[r] ? /* @__PURE__ */ e.jsx(Oa, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1082
- "label",
1083
- {
1084
- className: "flex items-center cursor-pointer gap-1",
1085
- htmlFor: `queryParams.${r}.active`,
1086
- title: i[r] ? "Required field" : void 0,
1087
- children: [
1088
- c.value,
1089
- i[r] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
1090
- ]
1091
- }
1092
- ) }) : /* @__PURE__ */ e.jsx(
1093
- me,
1094
- {
1095
- value: c.value,
1096
- options: a.map((h) => h.name),
1097
- onChange: (h) => {
1098
- c.onChange(h);
1099
- },
1100
- className: "border-0 font-mono text-xs bg-transparent hover:bg-transparent"
1101
- }
1102
- ),
1103
- name: `queryParams.${r}.name`
1104
- }
1105
- )
1106
- ] }),
1107
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1108
- R,
1109
- {
1110
- control: t,
1111
- render: ({ field: c }) => (m == null ? void 0 : m.enum) && m.enum.length > 0 ? /* @__PURE__ */ e.jsx(
1112
- me,
1113
- {
1114
- value: c.value,
1115
- options: m.enum ?? [],
1116
- onChange: (y) => {
1117
- c.onChange(y), n.setValue(`queryParams.${r}.active`, !0);
1118
- },
1119
- className: "font-mono text-xs border-0 ring-1 ring-ring"
1120
- }
1121
- ) : /* @__PURE__ */ e.jsx(
1122
- fe,
1123
- {
1124
- ...c,
1125
- onChange: (y) => {
1126
- c.onChange(y.target.value), y.target.value.length > 0 && n.setValue(`queryParams.${r}.active`, !0);
1127
- },
1128
- placeholder: "Enter value",
1129
- className: "w-full border-0 shadow-none text-xs font-mono"
1130
- }
1131
- ),
1132
- name: `queryParams.${r}.value`
1133
- }
1134
- ) })
1135
- ] }, d.id);
1136
- }) }) });
1137
- }, T = {
1138
- green: "text-green-600",
1139
- blue: "text-sky-600",
1140
- yellow: "text-yellow-600",
1141
- red: "text-red-600",
1142
- purple: "text-purple-600",
1143
- indigo: "text-indigo-600",
1144
- gray: "text-gray-600"
1145
- }, Ea = {
1146
- get: T.green,
1147
- post: T.blue,
1148
- put: T.yellow,
1149
- delete: T.red,
1150
- patch: T.purple,
1151
- options: T.indigo,
1152
- head: T.gray,
1153
- trace: T.gray
1154
- }, Aa = (t) => Ea[t.toLocaleLowerCase()] ?? T.gray, qa = ({
1155
- method: t,
1156
- url: a,
1157
- headers: s,
1158
- body: n
1159
- }) => /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 font-mono text-xs", children: [
1160
- /* @__PURE__ */ e.jsxs("div", { className: "gap-2 p-2 bg-muted rounded-md", children: [
1161
- /* @__PURE__ */ e.jsx("span", { className: u(Aa(t), "font-semibold"), children: t }),
1162
- " ",
1163
- /* @__PURE__ */ e.jsx("span", { className: "break-all", children: a }),
1164
- " ",
1165
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "HTTP/1.1" })
1166
- ] }),
1167
- /* @__PURE__ */ e.jsxs("div", { className: "mx-1.5 flex flex-col gap-3", children: [
1168
- /* @__PURE__ */ e.jsxs(Ae, { defaultOpen: !0, children: [
1169
- /* @__PURE__ */ e.jsxs(qe, { className: "flex items-center gap-2 hover:text-primary group", children: [
1170
- /* @__PURE__ */ e.jsx(z, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1171
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1172
- ] }),
1173
- /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2", children: s.map(([i, d]) => /* @__PURE__ */ e.jsxs(k, { children: [
1174
- /* @__PURE__ */ e.jsx("div", { className: "text-primary", children: i }),
1175
- /* @__PURE__ */ e.jsx("div", { className: "break-words", children: d })
1176
- ] }, i)) }) })
1177
- ] }),
1178
- /* @__PURE__ */ e.jsxs(Ae, { defaultOpen: !0, children: [
1179
- /* @__PURE__ */ e.jsxs(qe, { className: "flex items-center gap-2 hover:text-primary group", children: [
1180
- /* @__PURE__ */ e.jsx(z, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1181
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Body" })
1182
- ] }),
1183
- /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx("div", { className: "pl-0 pt-2", children: /* @__PURE__ */ e.jsx(
1184
- "div",
1185
- {
1186
- className: u(
1187
- "whitespace-pre-wrap break-all bg-muted p-2 rounded-md",
1188
- !n && "text-muted-foreground"
1189
- ),
1190
- children: n ?? "Empty body"
1191
- }
1192
- ) }) })
1193
- ] })
1194
- ] })
1195
- ] }), Ve = ge.Root, Fe = ge.CollapsibleTrigger, ze = ge.CollapsibleContent;
1196
- function we(t) {
1197
- if (t === null) return "null";
1198
- if (Array.isArray(t)) {
1199
- if (t.length === 0) return "any[]";
1200
- const a = t[0];
1201
- return a === void 0 ? "any[]" : `${we(a)}[]`;
1202
- }
1203
- return typeof t == "object" ? Da(t) : typeof t;
1204
- }
1205
- function Da(t, a = "") {
1206
- const s = ["{"];
1207
- for (const [n, i] of Object.entries(t)) {
1208
- const d = we(i);
1209
- s.push(` ${n}: ${d};`);
1210
- }
1211
- return s.push("}"), s.join(`
1212
- `);
1213
- }
1214
- function La(t) {
1215
- return { lines: [`type GeneratedType = ${we(t)};`] };
1216
- }
1217
- const Va = {
1218
- 200: "OK",
1219
- 201: "Created",
1220
- 202: "Accepted",
1221
- 204: "No Content",
1222
- 400: "Bad Request",
1223
- 401: "Unauthorized",
1224
- 403: "Forbidden",
1225
- 404: "Not Found",
1226
- 405: "Method Not Allowed",
1227
- 500: "Internal Server Error"
1228
- }, Fa = (t) => {
1229
- var s;
1230
- return (s = Object.entries({
1231
- "application/json": "json",
1232
- "text/json": "json",
1233
- "text/html": "html",
1234
- "text/css": "css",
1235
- "text/javascript": "javascript",
1236
- "application/xml": "xml",
1237
- "application/xhtml+xml": "xhtml"
1238
- }).find(
1239
- ([n]) => t.includes(n)
1240
- )) == null ? void 0 : s[1];
1241
- }, za = (t) => {
1242
- var s;
1243
- const a = ((s = t.find(([n, i]) => n === "Content-Type")) == null ? void 0 : s[1]) || "";
1244
- return Fa(a);
1245
- }, Ha = (t) => {
1246
- try {
1247
- return JSON.stringify(JSON.parse(t), null, 2);
1248
- } catch {
1249
- return null;
1250
- }
1251
- }, Ba = (t) => {
1252
- const a = [
1253
- "Content-Type",
1254
- "Content-Length",
1255
- "Authorization",
1256
- "X-RateLimit-Remaining",
1257
- "X-RateLimit-Limit",
1258
- "Cache-Control",
1259
- "ETag"
1260
- ].map((s) => s.toLowerCase());
1261
- return [...t].sort(([s], [n]) => {
1262
- const i = a.indexOf(s.toLowerCase()), d = a.indexOf(n.toLowerCase());
1263
- return i === d ? 0 : i === -1 ? 1 : d === -1 ? -1 : i - d;
1264
- });
1265
- }, Ga = ({
1266
- body: t = "",
1267
- headers: a,
1268
- status: s,
1269
- time: n,
1270
- size: i,
1271
- url: d
1272
- }) => {
1273
- var l;
1274
- const r = za(a), m = Ha(t), c = m || t, [h, y] = H(
1275
- m ? "formatted" : "raw"
1276
- ), v = Ft({
1277
- queryKey: ["types", c],
1278
- queryFn: async () => La(JSON.parse(c)),
1279
- enabled: h === "types"
1280
- }), p = Ba([...a]);
1281
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-y-scroll max-h-[calc(100vh-220px)] py-4", children: [
1282
- /* @__PURE__ */ e.jsxs(Ve, { defaultOpen: !0, children: [
1283
- /* @__PURE__ */ e.jsxs(Fe, { className: "flex items-center gap-2 hover:text-primary group", children: [
1284
- /* @__PURE__ */ e.jsx(z, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1285
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1286
- ] }),
1287
- /* @__PURE__ */ e.jsx(ze, { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2 font-mono text-xs", children: [
1288
- p.slice(0, 5).map(([f, C]) => /* @__PURE__ */ e.jsxs(k, { children: [
1289
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1290
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: C })
1291
- ] }, f)),
1292
- p.length > 5 && /* @__PURE__ */ e.jsxs(Ve, { className: "col-span-full grid-cols-subgrid grid", children: [
1293
- /* @__PURE__ */ e.jsxs(Fe, { className: "col-span-2 text-xs text-muted-foreground hover:text-primary flex items-center gap-1 py-1", children: [
1294
- /* @__PURE__ */ e.jsx(z, { className: "h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1295
- "Show ",
1296
- p.length - 5,
1297
- " more headers"
1298
- ] }),
1299
- /* @__PURE__ */ e.jsx(ze, { className: "col-span-full grid grid-cols-subgrid gap-x-8 gap-y-1 ", children: p.slice(5).map(([f, C]) => /* @__PURE__ */ e.jsxs(k, { children: [
1300
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1301
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: C })
1302
- ] }, f)) })
1303
- ] })
1304
- ] }) })
1305
- ] }),
1306
- /* @__PURE__ */ e.jsx(xe, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
1307
- Mt,
1308
- {
1309
- language: h === "types" ? "typescript" : h === "raw" ? m ? "plain" : r : "json",
1310
- noBackground: !0,
1311
- className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
1312
- code: (h === "raw" ? t : h === "types" ? (l = v.data) == null ? void 0 : l.lines.join(`
1313
- `) : c) ?? ""
1314
- }
1315
- ) }),
1316
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 justify-between", children: [
1317
- /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-2 border bg-muted rounded-md p-2 items-center h-8 font-mono divide-x", children: [
1318
- /* @__PURE__ */ e.jsxs("div", { children: [
1319
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Status" }),
1320
- " ",
1321
- s,
1322
- " ",
1323
- Va[s] ?? ""
1324
- ] }),
1325
- /* @__PURE__ */ e.jsxs("div", { children: [
1326
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Time" }),
1327
- " ",
1328
- n.toFixed(0),
1329
- "ms"
1330
- ] }),
1331
- /* @__PURE__ */ e.jsxs("div", { children: [
1332
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Size" }),
1333
- " ",
1334
- i,
1335
- "B"
1336
- ] })
1337
- ] }),
1338
- m && /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
1339
- Be,
1340
- {
1341
- value: h,
1342
- onValueChange: (f) => y(f),
1343
- children: [
1344
- /* @__PURE__ */ e.jsx(Ge, { className: "min-w-32", children: /* @__PURE__ */ e.jsx(Ue, { placeholder: "View" }) }),
1345
- /* @__PURE__ */ e.jsxs(Me, { children: [
1346
- /* @__PURE__ */ e.jsx(U, { value: "formatted", children: "Formatted" }),
1347
- /* @__PURE__ */ e.jsx(U, { value: "raw", children: "Raw" }),
1348
- /* @__PURE__ */ e.jsx(U, { value: "types", children: "Types" })
1349
- ] })
1350
- ]
1351
- }
1352
- ) })
1353
- ] })
1354
- ] });
1355
- }, Ua = ({
1356
- queryMutation: t,
1357
- showPathParamsWarning: a
1358
- }) => {
1359
- var n;
1360
- const s = ((((n = t.data) == null ? void 0 : n.status) ?? 0) / 100).toFixed(0);
1361
- return /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70 overflow-y-auto", children: t.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1362
- a && /* @__PURE__ */ e.jsx(Wt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1363
- /* @__PURE__ */ e.jsxs(xe, { children: [
1364
- /* @__PURE__ */ e.jsx(Ht, { children: /* @__PURE__ */ e.jsx(Bt, { children: "Request failed" }) }),
1365
- /* @__PURE__ */ e.jsxs(Gt, { children: [
1366
- "Error:",
1367
- " ",
1368
- t.error.message || String(t.error) || "Unexpected error"
1369
- ] })
1370
- ] })
1371
- ] }) : t.data ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs(Je, { defaultValue: "response", children: [
1372
- /* @__PURE__ */ e.jsxs(Qe, { children: [
1373
- /* @__PURE__ */ e.jsx(E, { value: "request", children: "Request" }),
1374
- /* @__PURE__ */ e.jsxs(E, { value: "response", children: [
1375
- "Response",
1376
- /* @__PURE__ */ e.jsxs(
1377
- "span",
1378
- {
1379
- className: u(
1380
- "text-xs font-mono ml-1",
1381
- s === "2" && "text-green-500",
1382
- s === "3" && "text-blue-500",
1383
- s === "4" && "text-yellow-500",
1384
- s === "5" && "text-red-500"
1385
- ),
1386
- children: [
1387
- "(",
1388
- t.data.status,
1389
- ")"
1390
- ]
1391
- }
1392
- )
1393
- ] })
1394
- ] }),
1395
- /* @__PURE__ */ e.jsx(A, { value: "request", children: /* @__PURE__ */ e.jsx(qa, { ...t.data.request }) }),
1396
- /* @__PURE__ */ e.jsx(A, { value: "response", children: /* @__PURE__ */ e.jsx(
1397
- Ga,
1398
- {
1399
- status: t.data.status,
1400
- time: t.data.time,
1401
- size: t.data.size,
1402
- headers: t.data.headers,
1403
- body: t.data.body,
1404
- url: t.data.request.url
1405
- }
1406
- ) })
1407
- ] }) }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: t.isPending ? /* @__PURE__ */ e.jsx(_t, {}) : "Send a request first to see the response here" }) }) });
1408
- }, Ma = ({
1409
- identities: t,
1410
- formRef: a,
1411
- disabled: s
1412
- }) => {
1413
- const { setValue: n } = pe(), [i, d] = H();
1414
- return t.length === 0 ? /* @__PURE__ */ e.jsx(M, { disabled: s, children: "Send" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex", children: [
1415
- /* @__PURE__ */ e.jsx(
1416
- M,
1417
- {
1418
- className: "rounded-r-none inset-shadow-sm",
1419
- disabled: s,
1420
- onClick: () => {
1421
- var r;
1422
- return (r = a == null ? void 0 : a.current) == null ? void 0 : r.requestSubmit();
1423
- },
1424
- children: "Send"
1425
- }
1426
- ),
1427
- /* @__PURE__ */ e.jsxs(Xe, { children: [
1428
- /* @__PURE__ */ e.jsx(Ye, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1429
- M,
1430
- {
1431
- disabled: s,
1432
- className: "rounded-l-none border-l border-border/40 inset-shadow-sm w-6",
1433
- size: "icon",
1434
- children: /* @__PURE__ */ e.jsx(bt, { className: "w-4 h-4" })
1435
- }
1436
- ) }),
1437
- /* @__PURE__ */ e.jsx(ye, { value: i, children: /* @__PURE__ */ e.jsx(ve, { className: "w-56", align: "end", alignOffset: -150, children: [{ id: F, label: "None" }, ...t].map(
1438
- (r) => /* @__PURE__ */ e.jsxs(
1439
- je,
1440
- {
1441
- onClick: () => {
1442
- var m;
1443
- d(r.id), n("identity", r.id), (m = a == null ? void 0 : a.current) == null || m.requestSubmit();
1444
- },
1445
- onMouseEnter: () => d(r.id),
1446
- onMouseLeave: () => d(void 0),
1447
- children: [
1448
- /* @__PURE__ */ e.jsx(Q, { value: r.id, className: "mr-2" }),
1449
- r.label
1450
- ]
1451
- },
1452
- r.id
1453
- )
1454
- ) }) })
1455
- ] })
1456
- ] });
1457
- }, F = "__none", _a = ({
1458
- server: t,
1459
- servers: a,
1460
- url: s,
1461
- method: n,
1462
- headers: i = [],
1463
- queryParams: d = [],
1464
- pathParams: r = [],
1465
- defaultBody: m = "",
1466
- examples: c
1467
- }) => {
1468
- var Pe, ke, Re;
1469
- const { selectedServer: h, setSelectedServer: y } = Vt(), [, v] = kt(), { register: p, control: l, handleSubmit: f, watch: C, setValue: N, ...$ } = Dt({
1470
- defaultValues: {
1471
- body: m,
1472
- queryParams: d.map((o) => ({
1473
- name: o.name,
1474
- value: o.defaultValue ?? "",
1475
- active: o.defaultActive ?? !1,
1476
- enum: o.enum ?? []
1477
- })).concat([
1478
- {
1479
- name: "",
1480
- value: "",
1481
- active: !1,
1482
- enum: []
1483
- }
1484
- ]),
1485
- pathParams: r.map((o) => ({
1486
- name: o.name,
1487
- value: o.defaultValue ?? ""
1488
- })),
1489
- headers: i.map((o) => ({
1490
- name: o.name,
1491
- value: o.defaultValue ?? "",
1492
- active: o.defaultActive ?? !1
1493
- })).concat([
1494
- {
1495
- name: "",
1496
- value: "",
1497
- active: !1
1498
- }
1499
- ]),
1500
- identity: F
1501
- }
1502
- }), S = C(), O = zt(), Ce = q(!1);
1503
- He(() => {
1504
- var P;
1505
- if (Ce.current) return;
1506
- const o = (P = O.data) == null ? void 0 : P.at(0);
1507
- o && (N("identity", o.id), Ce.current = !0);
1508
- }, [N, O.data]);
1509
- const $e = q(null), Se = qt({
1510
- mutationFn: async (o) => {
1511
- var G, L;
1512
- const P = performance.now(), w = new Request(
1513
- da(h ?? t, s, o),
1514
- {
1515
- method: n.toUpperCase(),
1516
- headers: Object.fromEntries(
1517
- o.headers.filter((j) => j.name && j.active).map((j) => [j.name, j.value])
1518
- ),
1519
- body: o.body ? o.body : void 0
1520
- }
1521
- );
1522
- o.identity !== F && ((L = (G = O.data) == null ? void 0 : G.find((j) => j.id === o.identity)) == null || L.authorizeRequest(w));
1523
- try {
1524
- const j = await fetch(w, {
1525
- signal: AbortSignal.timeout(5e3)
1526
- }), ct = performance.now() - P, Oe = await j.text(), mt = new URL(w.url);
1527
- return {
1528
- status: j.status,
1529
- headers: Array.from(j.headers.entries()),
1530
- size: Oe.length,
1531
- body: Oe,
1532
- time: ct,
1533
- request: {
1534
- method: w.method.toUpperCase(),
1535
- url: w.url,
1536
- headers: [
1537
- ["Host", mt.host],
1538
- ["User-Agent", "Zudoku Playground"],
1539
- ...Array.from(w.headers.entries())
1540
- ],
1541
- body: o.body ? o.body : void 0
1542
- }
1543
- };
1544
- } catch (j) {
1545
- throw j instanceof TypeError ? new Error(
1546
- "The request failed, possibly due to network issues or CORS policy."
1547
- ) : j;
1548
- }
1549
- }
1550
- }), lt = /* @__PURE__ */ e.jsx(
1551
- oa,
1552
- {
1553
- path: s,
1554
- renderParam: ({ name: o, originalValue: P, index: w }) => {
1555
- var L;
1556
- const G = (L = S.pathParams.find(
1557
- (j) => j.name === o
1558
- )) == null ? void 0 : L.value;
1559
- return /* @__PURE__ */ e.jsx(
1560
- Ke,
1561
- {
1562
- name: o,
1563
- backgroundOpacity: "0",
1564
- slug: o,
1565
- onClick: () => $.setFocus(`pathParams.${w}.value`),
1566
- children: G || P
1567
- }
1568
- );
1569
- }
1570
- }
1571
- ), Te = S.queryParams.filter((o) => o.active).map((o, P, w) => /* @__PURE__ */ e.jsxs(k, { children: [
1572
- o.name,
1573
- "=",
1574
- encodeURIComponent(o.value).replaceAll("%20", "+"),
1575
- P < w.length - 1 && "&",
1576
- /* @__PURE__ */ e.jsx("wbr", {})
1577
- ] }, o.name)), dt = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: a && a.length > 1 ? /* @__PURE__ */ e.jsxs(
1578
- Be,
1579
- {
1580
- onValueChange: (o) => {
1581
- v(() => y(o));
1582
- },
1583
- value: h,
1584
- defaultValue: h,
1585
- children: [
1586
- /* @__PURE__ */ e.jsx(Ge, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(Ue, {}) }),
1587
- /* @__PURE__ */ e.jsx(Me, { children: a.map((o) => /* @__PURE__ */ e.jsx(U, { value: o, children: o.replace(/^https?:\/\//, "") }, o)) })
1588
- ]
1589
- }
1590
- ) : /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) });
1591
- return /* @__PURE__ */ e.jsx(
1592
- Lt,
1593
- {
1594
- register: p,
1595
- control: l,
1596
- handleSubmit: f,
1597
- watch: C,
1598
- setValue: N,
1599
- ...$,
1600
- children: /* @__PURE__ */ e.jsx(
1601
- "form",
1602
- {
1603
- onSubmit: f((o) => Se.mutateAsync(o)),
1604
- ref: $e,
1605
- children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 text-sm h-full", children: [
1606
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-4 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
1607
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
1608
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
1609
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: n.toUpperCase() }),
1610
- /* @__PURE__ */ e.jsxs("div", { className: "items-center p-2 font-mono text-xs break-words", children: [
1611
- dt,
1612
- lt,
1613
- Te.length > 0 ? "?" : "",
1614
- Te
1615
- ] })
1616
- ] }),
1617
- /* @__PURE__ */ e.jsx(
1618
- Ma,
1619
- {
1620
- identities: O.data ?? [],
1621
- formRef: $e,
1622
- disabled: $.formState.isSubmitting
1623
- }
1624
- )
1625
- ] }),
1626
- /* @__PURE__ */ e.jsxs(Je, { defaultValue: "parameters", children: [
1627
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1 justify-between", children: /* @__PURE__ */ e.jsxs(Qe, { children: [
1628
- /* @__PURE__ */ e.jsxs(E, { value: "parameters", children: [
1629
- "Parameters",
1630
- (S.pathParams.some((o) => o.value !== "") || S.queryParams.some((o) => o.active)) && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1631
- ] }),
1632
- /* @__PURE__ */ e.jsxs(E, { value: "headers", children: [
1633
- "Headers",
1634
- S.headers.filter((o) => o.active).length > 0 && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1635
- ] }),
1636
- /* @__PURE__ */ e.jsxs(E, { value: "auth", children: [
1637
- "Auth",
1638
- S.identity !== F && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1639
- ] }),
1640
- /* @__PURE__ */ e.jsx(E, { value: "body", children: "Body" })
1641
- ] }) }),
1642
- /* @__PURE__ */ e.jsx(A, { value: "headers", children: /* @__PURE__ */ e.jsx(ka, { control: l, register: p }) }),
1643
- /* @__PURE__ */ e.jsxs(A, { value: "parameters", children: [
1644
- r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1645
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1646
- /* @__PURE__ */ e.jsx(Ra, { control: l })
1647
- ] }),
1648
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1649
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1650
- /* @__PURE__ */ e.jsx(Ia, { control: l, queryParams: d })
1651
- ] })
1652
- ] }),
1653
- /* @__PURE__ */ e.jsxs(A, { value: "body", children: [
1654
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1655
- n.toUpperCase()
1656
- ) && /* @__PURE__ */ e.jsxs(le, { className: "mb-2", children: [
1657
- /* @__PURE__ */ e.jsx(Ee, { className: "w-4 h-4" }),
1658
- /* @__PURE__ */ e.jsx(de, { children: "Body" }),
1659
- /* @__PURE__ */ e.jsx(ce, { children: "Body is only supported for POST, PUT, PATCH, and DELETE requests" })
1660
- ] }),
1661
- /* @__PURE__ */ e.jsx(
1662
- Ze,
1663
- {
1664
- ...p("body"),
1665
- className: u(
1666
- "border w-full rounded-lg p-2 bg-muted h-40 font-mono",
1667
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1668
- n.toUpperCase()
1669
- ) && "h-20"
1670
- ),
1671
- placeholder: ["POST", "PUT", "PATCH", "DELETE"].includes(
1672
- n.toUpperCase()
1673
- ) ? void 0 : "This request does not support a body",
1674
- disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
1675
- n.toUpperCase()
1676
- )
1677
- }
1678
- ),
1679
- c && /* @__PURE__ */ e.jsx(
1680
- xa,
1681
- {
1682
- examples: c,
1683
- onSelect: (o) => N("body", JSON.stringify(o.value, null, 2))
1684
- }
1685
- )
1686
- ] }),
1687
- /* @__PURE__ */ e.jsx(A, { value: "auth", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1688
- ((Pe = O.data) == null ? void 0 : Pe.length) === 0 && /* @__PURE__ */ e.jsxs(le, { children: [
1689
- /* @__PURE__ */ e.jsx(Ee, { className: "w-4 h-4" }),
1690
- /* @__PURE__ */ e.jsx(de, { children: "Authentication" }),
1691
- /* @__PURE__ */ e.jsx(ce, { children: "No identities found. Please create an identity first." })
1692
- ] }),
1693
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e.jsx(xe, { className: "w-full overflow-hidden", children: /* @__PURE__ */ e.jsxs(
1694
- ye,
1695
- {
1696
- onValueChange: (o) => N("identity", o),
1697
- value: S.identity,
1698
- defaultValue: S.identity,
1699
- className: "gap-0",
1700
- disabled: ((ke = O.data) == null ? void 0 : ke.length) === 0,
1701
- children: [
1702
- /* @__PURE__ */ e.jsxs(
1703
- V,
1704
- {
1705
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1706
- htmlFor: "none",
1707
- children: [
1708
- /* @__PURE__ */ e.jsx(Q, { value: F, id: "none", children: "None" }),
1709
- /* @__PURE__ */ e.jsx(V, { htmlFor: "none", className: "ml-2", children: "None" })
1710
- ]
1711
- }
1712
- ),
1713
- (Re = O.data) == null ? void 0 : Re.map((o) => /* @__PURE__ */ e.jsxs(
1714
- V,
1715
- {
1716
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1717
- children: [
1718
- /* @__PURE__ */ e.jsx(
1719
- Q,
1720
- {
1721
- value: o.id,
1722
- id: o.id,
1723
- children: o.label
1724
- }
1725
- ),
1726
- /* @__PURE__ */ e.jsx(V, { htmlFor: o.id, className: "ml-2", children: o.label })
1727
- ]
1728
- },
1729
- o.id
1730
- ))
1731
- ]
1732
- }
1733
- ) }) })
1734
- ] }) })
1735
- ] })
1736
- ] }),
1737
- /* @__PURE__ */ e.jsx(
1738
- Ua,
1739
- {
1740
- queryMutation: Se,
1741
- showPathParamsWarning: S.pathParams.some(
1742
- (o) => o.value === ""
1743
- )
1744
- }
1745
- )
1746
- ] })
1747
- }
1748
- )
1749
- }
1750
- );
1751
- }, Ja = ({
1752
- className: t,
1753
- size: a = 16
1754
- }) => /* @__PURE__ */ e.jsx(
1755
- "svg",
1756
- {
1757
- xmlns: "http://www.w3.org/2000/svg",
1758
- viewBox: "0 0 24 24",
1759
- fill: "currentColor",
1760
- className: t,
1761
- width: a,
1762
- height: a,
1763
- children: /* @__PURE__ */ e.jsx(
1764
- "path",
1765
- {
1766
- fillRule: "evenodd",
1767
- 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",
1768
- clipRule: "evenodd"
1769
- }
1770
- )
1771
- }
1772
- ), Qa = (t) => {
1773
- const [a, s] = H(!1);
1774
- return /* @__PURE__ */ e.jsxs(Ot, { onOpenChange: (n) => s(n), children: [
1775
- /* @__PURE__ */ e.jsx(It, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-sm hover:bg-primary/80", children: [
1776
- "Test",
1777
- /* @__PURE__ */ e.jsx(Ja, { className: "", size: 14 })
1778
- ] }) }),
1779
- /* @__PURE__ */ e.jsxs(
1780
- Et,
1781
- {
1782
- className: "max-w-screen-xl w-full h-5/6 overflow-hidden p-0",
1783
- "aria-describedby": void 0,
1784
- children: [
1785
- /* @__PURE__ */ e.jsx(Pt, { children: /* @__PURE__ */ e.jsx(At, { children: "Playground" }) }),
1786
- a && /* @__PURE__ */ e.jsx(_a, { ...t })
1787
- ]
1788
- }
1789
- )
1790
- ] });
1791
- }, Wa = We(`
1792
- query GetCategories($input: JSON!, $type: SchemaType!) {
1793
- schema(input: $input, type: $type) {
1794
- url
1795
- tags {
1796
- name
1797
- }
1798
- }
1799
- }
1800
- `), Za = We(`
1801
- query GetOperations(
1802
- $input: JSON!
1803
- $type: SchemaType!
1804
- $tag: String
1805
- $untagged: Boolean
1806
- ) {
1807
- schema(input: $input, type: $type) {
1808
- operations(tag: $tag, untagged: $untagged) {
1809
- slug
1810
- deprecated
1811
- method
1812
- summary
1813
- operationId
1814
- path
1815
- }
1816
- }
1817
- }
1818
- `), Ka = {
1819
- get: "green",
1820
- post: "blue",
1821
- put: "yellow",
1822
- delete: "red",
1823
- patch: "purple",
1824
- options: "gray",
1825
- head: "gray"
1826
- }, oe = "~endpoints", $s = (t) => {
1827
- const a = I(t.navigationId ?? "/reference"), s = t.type === "file" ? Object.keys(t.input) : [], n = new Kt(t);
1828
- return {
1829
- getHead: () => {
1830
- if (t.type === "url" && !t.skipPreload)
1831
- return /* @__PURE__ */ e.jsx(
1832
- "link",
1833
- {
1834
- rel: "preload",
1835
- href: t.input,
1836
- as: "fetch",
1837
- crossOrigin: "anonymous"
1838
- }
1839
- );
1840
- if (t.server)
1841
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1842
- },
1843
- getMdxComponents: () => ({
1844
- OpenPlaygroundButton: ({
1845
- requireAuth: i,
1846
- server: d,
1847
- method: r,
1848
- url: m,
1849
- ...c
1850
- }) => {
1851
- const h = St();
1852
- if (!d)
1853
- throw new Error("Server is required");
1854
- return i && !h.isAuthenticated ? /* @__PURE__ */ e.jsxs(
1855
- _,
1856
- {
1857
- className: "gap-2 items-center",
1858
- variant: "outline",
1859
- onClick: h.login,
1860
- children: [
1861
- "Login to open in Playground ",
1862
- /* @__PURE__ */ e.jsx(Nt, { size: 16 })
1863
- ]
1864
- }
1865
- ) : /* @__PURE__ */ e.jsx(
1866
- Qa,
1867
- {
1868
- url: m ?? "/",
1869
- method: r ?? "get",
1870
- server: d,
1871
- ...c,
1872
- children: /* @__PURE__ */ e.jsxs(_, { className: "gap-2 items-center", variant: "outline", children: [
1873
- "Open in Playground ",
1874
- /* @__PURE__ */ e.jsx(wt, { size: 16 })
1875
- ] })
1876
- }
1877
- );
1878
- }
1879
- }),
1880
- getSidebar: async (i) => {
1881
- var d;
1882
- if (!Ct({ path: a, end: !1 }, i))
1883
- return [];
1884
- try {
1885
- const r = s.find(
1886
- (l) => i.startsWith(I(a, l))
1887
- ), m = r ?? Object.keys(t.input).at(0), c = await n.fetch(Wa, {
1888
- type: t.type,
1889
- input: t.type === "file" ? t.input[m] : t.input
1890
- }), h = (d = t.tagPages) == null ? void 0 : d.find(
1891
- (l) => i.split("/").at(-1) === te(l)
1892
- ), v = (await n.fetch(Za, {
1893
- type: t.type,
1894
- input: t.type === "file" ? t.input[m] : t.input,
1895
- tag: h,
1896
- untagged: h === void 0
1897
- })).schema.operations.map((l) => ({
1898
- type: "link",
1899
- label: l.summary ?? l.path,
1900
- href: `#${l.slug}`,
1901
- badge: {
1902
- label: l.method,
1903
- color: Ka[l.method.toLowerCase()],
1904
- invert: !0
1905
- }
1906
- }));
1907
- return c.schema.tags.map((l) => {
1908
- const f = I(
1909
- a,
1910
- r,
1911
- l.name ? te(l.name) : oe
1912
- );
1913
- return {
1914
- type: "category",
1915
- label: l.name || "Other endpoints",
1916
- link: {
1917
- type: "doc",
1918
- id: f,
1919
- label: l.name
1920
- },
1921
- collapsible: !1,
1922
- collapsed: !0,
1923
- items: i === f ? v : []
1924
- };
1925
- });
1926
- } catch {
1927
- return [];
1928
- }
1929
- },
1930
- getRoutes: () => {
1931
- const i = [null, ...s], d = (t.tagPages ?? []).map((r) => ({
1932
- tag: r,
1933
- path: te(r)
1934
- }));
1935
- return i.map((r) => {
1936
- const m = I(a, r ? `/${r}` : "");
1937
- return {
1938
- path: m,
1939
- async lazy() {
1940
- const { OpenApiRoute: c } = await import("./OpenApiRoute-UrC_t0e5.js");
1941
- return {
1942
- element: /* @__PURE__ */ e.jsx(
1943
- c,
1944
- {
1945
- version: r ?? void 0,
1946
- basePath: a,
1947
- versions: s,
1948
- client: n,
1949
- config: t
1950
- }
1951
- )
1952
- };
1953
- },
1954
- children: [
1955
- {
1956
- index: !0,
1957
- loader: () => {
1958
- var c;
1959
- return $t(
1960
- I(m, ((c = d.at(0)) == null ? void 0 : c.path) ?? oe)
1961
- );
1962
- }
1963
- },
1964
- {
1965
- path: I(m, oe),
1966
- async lazy() {
1967
- const { OperationList: c } = await import("./OperationList-CDt1xdc4.js");
1968
- return { element: /* @__PURE__ */ e.jsx(c, { untagged: !0 }) };
1969
- }
1970
- },
1971
- ...d.map((c) => ({
1972
- path: I(m, c.path),
1973
- async lazy() {
1974
- const { OperationList: h } = await import("./OperationList-CDt1xdc4.js");
1975
- return {
1976
- element: /* @__PURE__ */ e.jsx(h, { tag: c.tag })
1977
- };
1978
- }
1979
- }))
1980
- ]
1981
- };
1982
- });
1983
- }
1984
- };
1985
- };
1986
- export {
1987
- Ke as C,
1988
- Qa as P,
1989
- Ve as a,
1990
- ze as b,
1991
- Fe as c,
1992
- oa as d,
1993
- We as g,
1994
- Aa as m,
1995
- $s as o
1996
- };
1997
- //# sourceMappingURL=index-Eb1oiHbM.js.map