zudoku 0.0.0-f3d517c → 0.0.0-f40ea27

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 (570) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +11 -121
  2. package/dist/app/ZuploBuildConfig.js +8 -8
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/demo.js +6 -5
  5. package/dist/app/demo.js.map +1 -1
  6. package/dist/app/entry.client.d.ts +0 -2
  7. package/dist/app/entry.client.js +0 -2
  8. package/dist/app/entry.client.js.map +1 -1
  9. package/dist/app/entry.server.d.ts +0 -2
  10. package/dist/app/entry.server.js +0 -2
  11. package/dist/app/entry.server.js.map +1 -1
  12. package/dist/app/env.d.ts +7 -7
  13. package/dist/app/env.js +8 -0
  14. package/dist/app/env.js.map +1 -1
  15. package/dist/app/main.d.ts +1 -0
  16. package/dist/app/main.js +12 -11
  17. package/dist/app/main.js.map +1 -1
  18. package/dist/app/standalone.js +7 -6
  19. package/dist/app/standalone.js.map +1 -1
  20. package/dist/config/loader.js +2 -3
  21. package/dist/config/loader.js.map +1 -1
  22. package/dist/config/validators/BuildSchema.d.ts +20 -44
  23. package/dist/config/validators/BuildSchema.js +3 -14
  24. package/dist/config/validators/BuildSchema.js.map +1 -1
  25. package/dist/config/validators/InputNavigationSchema.d.ts +7369 -0
  26. package/dist/config/validators/InputNavigationSchema.js +74 -0
  27. package/dist/config/validators/InputNavigationSchema.js.map +1 -0
  28. package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
  29. package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
  30. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
  31. package/dist/config/validators/NavigationSchema.d.ts +44 -0
  32. package/dist/config/validators/NavigationSchema.js +95 -0
  33. package/dist/config/validators/NavigationSchema.js.map +1 -0
  34. package/dist/config/validators/icon-types.d.ts +2 -1
  35. package/dist/config/validators/icon-types.js +1813 -1
  36. package/dist/config/validators/icon-types.js.map +1 -1
  37. package/dist/config/validators/validate.d.ts +471 -5556
  38. package/dist/config/validators/validate.js +80 -69
  39. package/dist/config/validators/validate.js.map +1 -1
  40. package/dist/config/validators/validate.test.js +0 -2
  41. package/dist/config/validators/validate.test.js.map +1 -1
  42. package/dist/flat-config.d.ts +325 -0
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/auth/issuer.js +4 -1
  46. package/dist/lib/auth/issuer.js.map +1 -1
  47. package/dist/lib/auth/issuer.test.js +14 -1
  48. package/dist/lib/auth/issuer.test.js.map +1 -1
  49. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  50. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  51. package/dist/lib/components/Autocomplete.js +2 -2
  52. package/dist/lib/components/Autocomplete.js.map +1 -1
  53. package/dist/lib/components/Banner.js +1 -1
  54. package/dist/lib/components/Banner.js.map +1 -1
  55. package/dist/lib/components/BuildCheck.js +1 -1
  56. package/dist/lib/components/BuildCheck.js.map +1 -1
  57. package/dist/lib/components/ErrorPage.js +2 -2
  58. package/dist/lib/components/ErrorPage.js.map +1 -1
  59. package/dist/lib/components/Footer.js +1 -1
  60. package/dist/lib/components/Footer.js.map +1 -1
  61. package/dist/lib/components/Framed.d.ts +7 -0
  62. package/dist/lib/components/Framed.js +26 -0
  63. package/dist/lib/components/Framed.js.map +1 -0
  64. package/dist/lib/components/Header.js +19 -18
  65. package/dist/lib/components/Header.js.map +1 -1
  66. package/dist/lib/components/Heading.d.ts +6 -2
  67. package/dist/lib/components/Heading.js +2 -2
  68. package/dist/lib/components/Heading.js.map +1 -1
  69. package/dist/lib/components/Main.js +4 -4
  70. package/dist/lib/components/Main.js.map +1 -1
  71. package/dist/lib/components/Markdown.d.ts +0 -1
  72. package/dist/lib/components/Markdown.js +2 -3
  73. package/dist/lib/components/Markdown.js.map +1 -1
  74. package/dist/lib/components/MobileTopNavigation.js +6 -5
  75. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  76. package/dist/lib/components/NotFoundPage.js +2 -2
  77. package/dist/lib/components/NotFoundPage.js.map +1 -1
  78. package/dist/lib/components/PageProgress.d.ts +1 -0
  79. package/dist/lib/components/PageProgress.js +20 -0
  80. package/dist/lib/components/PageProgress.js.map +1 -0
  81. package/dist/lib/components/Pagination.js +1 -1
  82. package/dist/lib/components/Pagination.js.map +1 -1
  83. package/dist/lib/components/TopNavigation.d.ts +2 -3
  84. package/dist/lib/components/TopNavigation.js +45 -44
  85. package/dist/lib/components/TopNavigation.js.map +1 -1
  86. package/dist/lib/components/Typography.d.ts +5 -0
  87. package/dist/lib/components/Typography.js +8 -0
  88. package/dist/lib/components/Typography.js.map +1 -0
  89. package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
  90. package/dist/lib/components/context/ZudokuContext.js +44 -26
  91. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  92. package/dist/lib/components/index.d.ts +4 -0
  93. package/dist/lib/components/index.js +2 -0
  94. package/dist/lib/components/index.js.map +1 -1
  95. package/dist/lib/components/navigation/Navigation.d.ts +5 -0
  96. package/dist/lib/components/navigation/Navigation.js +12 -0
  97. package/dist/lib/components/navigation/Navigation.js.map +1 -0
  98. package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
  99. package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
  100. package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
  101. package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
  102. package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
  103. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
  104. package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
  105. package/dist/lib/components/navigation/NavigationItem.js +47 -0
  106. package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
  107. package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
  108. package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +4 -4
  109. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
  110. package/dist/lib/components/navigation/utils.d.ts +7 -9
  111. package/dist/lib/components/navigation/utils.js +17 -17
  112. package/dist/lib/components/navigation/utils.js.map +1 -1
  113. package/dist/lib/core/ZudokuContext.d.ts +10 -12
  114. package/dist/lib/core/ZudokuContext.js +7 -9
  115. package/dist/lib/core/ZudokuContext.js.map +1 -1
  116. package/dist/lib/core/plugins.d.ts +2 -2
  117. package/dist/lib/errors/ErrorAlert.js +2 -3
  118. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  119. package/dist/lib/hooks/useEvent.test.js +5 -3
  120. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  121. package/dist/lib/hooks/useHotkey.d.ts +4 -0
  122. package/dist/lib/hooks/useHotkey.js +58 -0
  123. package/dist/lib/hooks/useHotkey.js.map +1 -0
  124. package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
  125. package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
  126. package/dist/lib/plugins/api-catalog/index.js +10 -10
  127. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  128. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +12 -15
  129. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  130. package/dist/lib/plugins/api-keys/index.js +24 -5
  131. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  132. package/dist/lib/plugins/custom-pages/index.d.ts +4 -6
  133. package/dist/lib/plugins/custom-pages/index.js +15 -10
  134. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  135. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -2
  136. package/dist/lib/plugins/markdown/MdxPage.js +28 -9
  137. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  138. package/dist/lib/plugins/markdown/index.d.ts +10 -2
  139. package/dist/lib/plugins/markdown/index.js +9 -26
  140. package/dist/lib/plugins/markdown/index.js.map +1 -1
  141. package/dist/lib/plugins/openapi/OperationList.js +2 -3
  142. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  143. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  144. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  145. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  146. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  147. package/dist/lib/plugins/openapi/SchemaList.js +2 -3
  148. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  149. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  150. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  151. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  152. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  153. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  154. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  155. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  156. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
  157. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
  158. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  159. package/dist/lib/plugins/openapi/index.d.ts +3 -3
  160. package/dist/lib/plugins/openapi/index.js +9 -9
  161. package/dist/lib/plugins/openapi/index.js.map +1 -1
  162. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
  163. package/dist/lib/plugins/openapi/playground/BodyPanel.d.ts +2 -2
  164. package/dist/lib/plugins/openapi/playground/BodyPanel.js +16 -12
  165. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  166. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.d.ts +8 -0
  167. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +11 -0
  168. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -0
  169. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +2 -2
  170. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  171. package/dist/lib/plugins/openapi/playground/Headers.d.ts +3 -2
  172. package/dist/lib/plugins/openapi/playground/Headers.js +52 -30
  173. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  174. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +2 -1
  175. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -1
  176. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -2
  177. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -1
  178. package/dist/lib/plugins/openapi/playground/InlineInput.js +1 -1
  179. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -1
  180. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -2
  181. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  182. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -2
  183. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  184. package/dist/lib/plugins/openapi/playground/Playground.js +47 -34
  185. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  186. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  187. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  188. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
  189. package/dist/lib/plugins/openapi/playground/QueryParams.js +38 -23
  190. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  191. package/dist/lib/plugins/openapi/playground/Spinner.d.ts +2 -0
  192. package/dist/lib/plugins/openapi/playground/Spinner.js +63 -0
  193. package/dist/lib/plugins/openapi/playground/Spinner.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.d.ts +3 -0
  195. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js +13 -0
  196. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js.map +1 -0
  197. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.d.ts +1 -0
  198. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +12 -0
  199. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -0
  200. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +12 -0
  201. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js +11 -0
  202. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js.map +1 -0
  203. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.d.ts +8 -0
  204. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +69 -0
  205. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -0
  206. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +7 -4
  207. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +25 -32
  208. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  209. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +4 -2
  210. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +8 -10
  211. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  212. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +3 -3
  213. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  214. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -3
  215. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  216. package/dist/lib/plugins/openapi/schema/SchemaView.js +5 -5
  217. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  218. package/dist/lib/plugins/openapi/schema/utils.js +3 -2
  219. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  220. package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
  221. package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
  222. package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
  223. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
  224. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  225. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
  226. package/dist/lib/ui/Alert.d.ts +5 -4
  227. package/dist/lib/ui/Alert.js +12 -10
  228. package/dist/lib/ui/Alert.js.map +1 -1
  229. package/dist/lib/ui/CodeBlock.d.ts +1 -2
  230. package/dist/lib/ui/CodeBlock.js +10 -11
  231. package/dist/lib/ui/CodeBlock.js.map +1 -1
  232. package/dist/lib/ui/Dialog.js +1 -1
  233. package/dist/lib/ui/Dialog.js.map +1 -1
  234. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +15 -0
  235. package/dist/lib/ui/EmbeddedCodeBlock.js +18 -0
  236. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  237. package/dist/lib/ui/Select.js +1 -1
  238. package/dist/lib/ui/SyntaxHighlight.d.ts +3 -1
  239. package/dist/lib/ui/SyntaxHighlight.js +3 -2
  240. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  241. package/dist/lib/util/MdxComponents.d.ts +9 -1
  242. package/dist/lib/util/MdxComponents.js +4 -2
  243. package/dist/lib/util/MdxComponents.js.map +1 -1
  244. package/dist/lib/util/os.d.ts +2 -0
  245. package/dist/lib/util/os.js +21 -0
  246. package/dist/lib/util/os.js.map +1 -0
  247. package/dist/lib/util/useCopyToClipboard.d.ts +1 -0
  248. package/dist/lib/util/useCopyToClipboard.js +11 -0
  249. package/dist/lib/util/useCopyToClipboard.js.map +1 -0
  250. package/dist/lib/util/useScrollToAnchor.js +3 -3
  251. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  252. package/dist/vite/api/SchemaManager.d.ts +4 -4
  253. package/dist/vite/api/SchemaManager.js +25 -21
  254. package/dist/vite/api/SchemaManager.js.map +1 -1
  255. package/dist/vite/api/SchemaManager.test.js +4 -4
  256. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  257. package/dist/vite/api/schema-codegen.js +42 -11
  258. package/dist/vite/api/schema-codegen.js.map +1 -1
  259. package/dist/vite/api/schema-codegen.test.js +82 -0
  260. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  261. package/dist/vite/build.js +1 -1
  262. package/dist/vite/config.js +12 -2
  263. package/dist/vite/config.js.map +1 -1
  264. package/dist/vite/css/plugin.js +11 -0
  265. package/dist/vite/css/plugin.js.map +1 -1
  266. package/dist/vite/dev-server.js +1 -1
  267. package/dist/vite/mdx/remark-last-modified.d.ts +3 -0
  268. package/dist/vite/mdx/remark-last-modified.js +56 -0
  269. package/dist/vite/mdx/remark-last-modified.js.map +1 -0
  270. package/dist/vite/mdx/utils.d.ts +2 -0
  271. package/dist/vite/mdx/utils.js +31 -0
  272. package/dist/vite/mdx/utils.js.map +1 -0
  273. package/dist/vite/plugin-api.js +8 -8
  274. package/dist/vite/plugin-api.js.map +1 -1
  275. package/dist/vite/plugin-config-reload.js +2 -0
  276. package/dist/vite/plugin-config-reload.js.map +1 -1
  277. package/dist/vite/plugin-custom-pages.js +2 -2
  278. package/dist/vite/plugin-custom-pages.js.map +1 -1
  279. package/dist/vite/plugin-docs.js +61 -59
  280. package/dist/vite/plugin-docs.js.map +1 -1
  281. package/dist/vite/plugin-frontmatter.js +6 -2
  282. package/dist/vite/plugin-frontmatter.js.map +1 -1
  283. package/dist/vite/plugin-mdx.js +15 -35
  284. package/dist/vite/plugin-mdx.js.map +1 -1
  285. package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
  286. package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
  287. package/dist/vite/plugin-navigation.js.map +1 -0
  288. package/dist/vite/plugin-theme.d.ts +8 -0
  289. package/dist/vite/plugin-theme.js +235 -0
  290. package/dist/vite/plugin-theme.js.map +1 -0
  291. package/dist/vite/plugin-theme.test.d.ts +1 -0
  292. package/dist/vite/plugin-theme.test.js +291 -0
  293. package/dist/vite/plugin-theme.test.js.map +1 -0
  294. package/dist/vite/plugin.js +4 -6
  295. package/dist/vite/plugin.js.map +1 -1
  296. package/dist/vite/shadcn-registry.d.ts +45 -0
  297. package/dist/vite/shadcn-registry.js +29 -0
  298. package/dist/vite/shadcn-registry.js.map +1 -0
  299. package/lib/Alert-CT_ViLrJ.js +161 -0
  300. package/lib/Alert-CT_ViLrJ.js.map +1 -0
  301. package/lib/CodeBlock-DAKxs_Tu.js +85 -0
  302. package/lib/CodeBlock-DAKxs_Tu.js.map +1 -0
  303. package/lib/Command-xsbs2uhf.js +140 -0
  304. package/lib/Command-xsbs2uhf.js.map +1 -0
  305. package/lib/{Dialog-BxpuVLh9.js → Dialog-CiIdyz6a.js} +5 -5
  306. package/lib/Dialog-CiIdyz6a.js.map +1 -0
  307. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  308. package/lib/MdxPage-swXPJ0gf.js +110 -0
  309. package/lib/MdxPage-swXPJ0gf.js.map +1 -0
  310. package/lib/OasProvider-CDAM3TB1.js +35 -0
  311. package/lib/OasProvider-CDAM3TB1.js.map +1 -0
  312. package/lib/{OperationList-BISd29LY.js → OperationList-C9Hb9ql8.js} +582 -569
  313. package/lib/OperationList-C9Hb9ql8.js.map +1 -0
  314. package/lib/Pagination-VGlgeCmS.js +36 -0
  315. package/lib/Pagination-VGlgeCmS.js.map +1 -0
  316. package/lib/RouteGuard-CbKd7_9h.js +737 -0
  317. package/lib/RouteGuard-CbKd7_9h.js.map +1 -0
  318. package/lib/{SchemaList-BqnRo5ov.js → SchemaList-BAbh1BXO.js} +32 -43
  319. package/lib/SchemaList-BAbh1BXO.js.map +1 -0
  320. package/lib/{SchemaView-CtYJpxQI.js → SchemaView-C2Io712T.js} +95 -104
  321. package/lib/SchemaView-C2Io712T.js.map +1 -0
  322. package/lib/{SignUp-CrjeBbqN.js → SignUp-5RUdVhnq.js} +13 -13
  323. package/lib/{SignUp-CrjeBbqN.js.map → SignUp-5RUdVhnq.js.map} +1 -1
  324. package/lib/{Markdown-BUE2ViaD.js → Slot-DwZlQ-vX.js} +3320 -2937
  325. package/lib/Slot-DwZlQ-vX.js.map +1 -0
  326. package/lib/{SyntaxHighlight-DtvR7RLF.js → SyntaxHighlight-CrjhGEwT.js} +717 -716
  327. package/lib/{SyntaxHighlight-DtvR7RLF.js.map → SyntaxHighlight-CrjhGEwT.js.map} +1 -1
  328. package/lib/{Toc-ClJBmdtI.js → Toc-WCmwFkX-.js} +2 -2
  329. package/lib/{Toc-ClJBmdtI.js.map → Toc-WCmwFkX-.js.map} +1 -1
  330. package/lib/{chunk-DQRVZFIR-BblmKnHy.js → chunk-DQRVZFIR-DHK7_Ilc.js} +7 -7
  331. package/lib/{chunk-DQRVZFIR-BblmKnHy.js.map → chunk-DQRVZFIR-DHK7_Ilc.js.map} +1 -1
  332. package/lib/{circular-pOdgLzpG.js → circular-B42RaanD.js} +2 -2
  333. package/lib/{circular-pOdgLzpG.js.map → circular-B42RaanD.js.map} +1 -1
  334. package/lib/clerk-BDZ31hjU.js +25190 -0
  335. package/lib/clerk-BDZ31hjU.js.map +1 -0
  336. package/lib/{createServer-qAtUf99r.js → createServer-BKFsRuuk.js} +6 -6
  337. package/lib/{createServer-qAtUf99r.js.map → createServer-BKFsRuuk.js.map} +1 -1
  338. package/lib/{errors-Bpodza84.js → errors-CF2X_x5o.js} +12 -12
  339. package/lib/{errors-Bpodza84.js.map → errors-CF2X_x5o.js.map} +1 -1
  340. package/lib/hook-Bd0yS8M0.js +1503 -0
  341. package/lib/hook-Bd0yS8M0.js.map +1 -0
  342. package/lib/index-B6Re5_cx.js +3469 -0
  343. package/lib/index-B6Re5_cx.js.map +1 -0
  344. package/lib/index-CLy1XyH0.js +3919 -0
  345. package/lib/index-CLy1XyH0.js.map +1 -0
  346. package/lib/{index-BvvmIczU.js → index-CcV90rin.js} +2 -2
  347. package/lib/{index-BvvmIczU.js.map → index-CcV90rin.js.map} +1 -1
  348. package/lib/index-ClhS5TxS.js +107 -0
  349. package/lib/index-ClhS5TxS.js.map +1 -0
  350. package/lib/index-CrcNWbel.js.map +1 -1
  351. package/lib/{index-zddirpDj.js → index-DmNq2fbN.js} +226 -221
  352. package/lib/index-DmNq2fbN.js.map +1 -0
  353. package/lib/ui/Alert.js +54 -38
  354. package/lib/ui/Alert.js.map +1 -1
  355. package/lib/ui/CodeBlock.js +6 -81
  356. package/lib/ui/CodeBlock.js.map +1 -1
  357. package/lib/ui/Command.js +1 -1
  358. package/lib/ui/Dialog.js +23 -23
  359. package/lib/ui/Dialog.js.map +1 -1
  360. package/lib/ui/EmbeddedCodeBlock.js +80 -0
  361. package/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  362. package/lib/ui/Select.js +1 -1
  363. package/lib/ui/Select.js.map +1 -1
  364. package/lib/ui/SyntaxHighlight.js +5 -4
  365. package/lib/ui/SyntaxHighlight.js.map +1 -1
  366. package/lib/{useExposedProps-BZQkZneR.js → useExposedProps-BIYjecPD.js} +2 -2
  367. package/lib/{useExposedProps-BZQkZneR.js.map → useExposedProps-BIYjecPD.js.map} +1 -1
  368. package/lib/zudoku.auth-auth0.js +1 -1
  369. package/lib/zudoku.auth-azureb2c.js +2 -2
  370. package/lib/zudoku.auth-clerk.js +3 -3
  371. package/lib/zudoku.auth-openid.js +2 -2
  372. package/lib/zudoku.components.js +33 -4201
  373. package/lib/zudoku.components.js.map +1 -1
  374. package/lib/zudoku.hooks.js +10 -11
  375. package/lib/zudoku.hooks.js.map +1 -1
  376. package/lib/zudoku.plugin-api-catalog.js +47 -47
  377. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  378. package/lib/zudoku.plugin-api-keys.js +292 -268
  379. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  380. package/lib/zudoku.plugin-custom-pages.js +12 -18
  381. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  382. package/lib/zudoku.plugin-markdown.js +19 -69
  383. package/lib/zudoku.plugin-markdown.js.map +1 -1
  384. package/lib/zudoku.plugin-openapi.js +6 -6
  385. package/lib/zudoku.plugin-redirect.js +1 -1
  386. package/lib/zudoku.plugin-search-pagefind.js +201 -111
  387. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  388. package/lib/zudoku.plugins.js.map +1 -1
  389. package/package.json +23 -19
  390. package/src/app/ZuploBuildConfig.ts +8 -8
  391. package/src/app/defaultTheme.css +68 -49
  392. package/src/app/demo.tsx +6 -5
  393. package/src/app/entry.client.tsx +0 -2
  394. package/src/app/entry.server.tsx +0 -2
  395. package/src/app/env.ts +8 -0
  396. package/src/app/main.css +10 -53
  397. package/src/app/main.tsx +13 -11
  398. package/src/app/standalone.tsx +7 -6
  399. package/src/lib/auth/issuer.test.ts +17 -1
  400. package/src/lib/auth/issuer.ts +4 -1
  401. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  402. package/src/lib/components/Autocomplete.tsx +2 -1
  403. package/src/lib/components/Banner.tsx +1 -1
  404. package/src/lib/components/BuildCheck.tsx +1 -1
  405. package/src/lib/components/ErrorPage.tsx +3 -3
  406. package/src/lib/components/Footer.tsx +1 -1
  407. package/src/lib/components/Framed.tsx +51 -0
  408. package/src/lib/components/Header.tsx +20 -20
  409. package/src/lib/components/Heading.tsx +7 -3
  410. package/src/lib/components/Main.tsx +9 -9
  411. package/src/lib/components/Markdown.tsx +3 -5
  412. package/src/lib/components/MobileTopNavigation.tsx +18 -13
  413. package/src/lib/components/NotFoundPage.tsx +3 -3
  414. package/src/lib/components/PageProgress.tsx +28 -0
  415. package/src/lib/components/Pagination.tsx +4 -4
  416. package/src/lib/components/TopNavigation.tsx +57 -66
  417. package/src/lib/components/Typography.tsx +14 -0
  418. package/src/lib/components/context/ZudokuContext.ts +50 -32
  419. package/src/lib/components/index.ts +2 -0
  420. package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
  421. package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
  422. package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
  423. package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
  424. package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +3 -3
  425. package/src/lib/components/navigation/utils.ts +27 -28
  426. package/src/lib/core/ZudokuContext.ts +14 -20
  427. package/src/lib/core/plugins.ts +2 -2
  428. package/src/lib/errors/ErrorAlert.tsx +3 -9
  429. package/src/lib/hooks/useEvent.test.tsx +7 -5
  430. package/src/lib/hooks/useHotkey.ts +70 -0
  431. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
  432. package/src/lib/plugins/api-catalog/index.tsx +19 -19
  433. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +41 -22
  434. package/src/lib/plugins/api-keys/index.tsx +27 -7
  435. package/src/lib/plugins/custom-pages/index.tsx +21 -16
  436. package/src/lib/plugins/markdown/MdxPage.tsx +72 -18
  437. package/src/lib/plugins/markdown/index.tsx +28 -41
  438. package/src/lib/plugins/openapi/OperationList.tsx +8 -18
  439. package/src/lib/plugins/openapi/OperationListItem.tsx +3 -3
  440. package/src/lib/plugins/openapi/ParameterListItem.tsx +6 -0
  441. package/src/lib/plugins/openapi/SchemaList.tsx +5 -11
  442. package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
  443. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -0
  444. package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
  445. package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
  446. package/src/lib/plugins/openapi/index.tsx +11 -11
  447. package/src/lib/plugins/openapi/interfaces.ts +3 -3
  448. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +40 -31
  449. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +47 -0
  450. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +7 -3
  451. package/src/lib/plugins/openapi/playground/Headers.tsx +187 -89
  452. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +3 -2
  453. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +7 -12
  454. package/src/lib/plugins/openapi/playground/InlineInput.tsx +1 -1
  455. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +2 -2
  456. package/src/lib/plugins/openapi/playground/PathParams.tsx +4 -5
  457. package/src/lib/plugins/openapi/playground/Playground.tsx +174 -125
  458. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  459. package/src/lib/plugins/openapi/playground/QueryParams.tsx +104 -58
  460. package/src/lib/plugins/openapi/playground/Spinner.tsx +87 -0
  461. package/src/lib/plugins/openapi/playground/request-panel/UrlPath.tsx +31 -0
  462. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +25 -0
  463. package/src/lib/plugins/openapi/playground/result-panel/Highlight.tsx +26 -0
  464. package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +115 -0
  465. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +103 -97
  466. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +68 -92
  467. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +3 -3
  468. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -3
  469. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -11
  470. package/src/lib/plugins/openapi/schema/utils.ts +3 -2
  471. package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
  472. package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
  473. package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
  474. package/src/lib/ui/Alert.tsx +44 -38
  475. package/src/lib/ui/CodeBlock.tsx +40 -55
  476. package/src/lib/ui/Dialog.tsx +2 -2
  477. package/src/lib/ui/EmbeddedCodeBlock.tsx +94 -0
  478. package/src/lib/ui/Select.tsx +1 -1
  479. package/src/lib/ui/SyntaxHighlight.tsx +11 -3
  480. package/src/lib/util/MdxComponents.tsx +13 -2
  481. package/src/lib/util/os.ts +18 -0
  482. package/src/lib/util/useCopyToClipboard.ts +17 -0
  483. package/src/lib/util/useScrollToAnchor.ts +3 -3
  484. package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
  485. package/dist/config/validators/InputSidebarSchema.js +0 -63
  486. package/dist/config/validators/InputSidebarSchema.js.map +0 -1
  487. package/dist/config/validators/SidebarSchema.d.ts +0 -46
  488. package/dist/config/validators/SidebarSchema.js +0 -118
  489. package/dist/config/validators/SidebarSchema.js.map +0 -1
  490. package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
  491. package/dist/lib/components/navigation/Sidebar.js +0 -10
  492. package/dist/lib/components/navigation/Sidebar.js.map +0 -1
  493. package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
  494. package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
  495. package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
  496. package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
  497. package/dist/lib/components/navigation/SidebarItem.js +0 -44
  498. package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
  499. package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
  500. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +0 -2
  501. package/dist/lib/plugins/custom-pages/CustomPage.js +0 -11
  502. package/dist/lib/plugins/custom-pages/CustomPage.js.map +0 -1
  503. package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
  504. package/dist/lib/plugins/markdown/resolver.js +0 -46
  505. package/dist/lib/plugins/markdown/resolver.js.map +0 -1
  506. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +0 -4
  507. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +0 -22
  508. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +0 -1
  509. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +0 -7
  510. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +0 -11
  511. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +0 -1
  512. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
  513. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
  514. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  515. package/dist/vite/plugin-configure-tailwind.js +0 -38
  516. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  517. package/dist/vite/plugin-sidebar.js.map +0 -1
  518. package/dist/vite/plugin-theme-css.d.ts +0 -5
  519. package/dist/vite/plugin-theme-css.js +0 -77
  520. package/dist/vite/plugin-theme-css.js.map +0 -1
  521. package/lib/Callout-CoVxYafP.js +0 -231
  522. package/lib/Callout-CoVxYafP.js.map +0 -1
  523. package/lib/CategoryHeading-Cu2RwgjC.js +0 -10
  524. package/lib/CategoryHeading-Cu2RwgjC.js.map +0 -1
  525. package/lib/Dialog-BxpuVLh9.js.map +0 -1
  526. package/lib/Markdown-BUE2ViaD.js.map +0 -1
  527. package/lib/MdxPage-By4UkRkI.js +0 -84
  528. package/lib/MdxPage-By4UkRkI.js.map +0 -1
  529. package/lib/OasProvider-C6_Kx5O7.js +0 -33
  530. package/lib/OasProvider-C6_Kx5O7.js.map +0 -1
  531. package/lib/OperationList-BISd29LY.js.map +0 -1
  532. package/lib/Pagination-CCxhL836.js +0 -36
  533. package/lib/Pagination-CCxhL836.js.map +0 -1
  534. package/lib/RouteGuard-CgmsSw7T.js +0 -55
  535. package/lib/RouteGuard-CgmsSw7T.js.map +0 -1
  536. package/lib/SchemaList-BqnRo5ov.js.map +0 -1
  537. package/lib/SchemaView-CtYJpxQI.js.map +0 -1
  538. package/lib/Slot-DANV2b7_.js +0 -160
  539. package/lib/Slot-DANV2b7_.js.map +0 -1
  540. package/lib/clerk-yAKDC3Qz.js +0 -24812
  541. package/lib/clerk-yAKDC3Qz.js.map +0 -1
  542. package/lib/hook-wIlTGE-2.js +0 -1486
  543. package/lib/hook-wIlTGE-2.js.map +0 -1
  544. package/lib/index--oeBayMa.js +0 -86
  545. package/lib/index--oeBayMa.js.map +0 -1
  546. package/lib/index-Bn6Lc9tq.js +0 -9
  547. package/lib/index-Bn6Lc9tq.js.map +0 -1
  548. package/lib/index-QzXzw_ra.js +0 -24
  549. package/lib/index-QzXzw_ra.js.map +0 -1
  550. package/lib/index-RFzRn4fM.js +0 -3226
  551. package/lib/index-RFzRn4fM.js.map +0 -1
  552. package/lib/index-zddirpDj.js.map +0 -1
  553. package/lib/index.esm-BFcSKCe-.js +0 -683
  554. package/lib/index.esm-BFcSKCe-.js.map +0 -1
  555. package/lib/joinPath-B7kNnUX4.js +0 -8
  556. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  557. package/lib/mutation-C-kdA_1r.js +0 -196
  558. package/lib/mutation-C-kdA_1r.js.map +0 -1
  559. package/lib/objectEntries-yMIkr2mI.js +0 -5
  560. package/lib/objectEntries-yMIkr2mI.js.map +0 -1
  561. package/lib/react-nprogress.esm-C2MPXjiJ.js +0 -389
  562. package/lib/react-nprogress.esm-C2MPXjiJ.js.map +0 -1
  563. package/lib/useLatest-hmRS46UF.js +0 -11
  564. package/lib/useLatest-hmRS46UF.js.map +0 -1
  565. package/lib/useMutation-3Ph3x6En.js +0 -97
  566. package/lib/useMutation-3Ph3x6En.js.map +0 -1
  567. package/src/lib/plugins/custom-pages/CustomPage.tsx +0 -18
  568. package/src/lib/plugins/markdown/resolver.ts +0 -59
  569. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +0 -32
  570. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +0 -73
@@ -1,50 +1,49 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RotateCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
3
- import { D as ce, S as F, R as ue } from "./Slot-DANV2b7_.js";
4
- import { i as P } from "./invariant-DAFpPywt.js";
5
- import { O as he, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
6
- import { i as fe, k as pe, e as xe, d as me } from "./hook-wIlTGE-2.js";
7
- import { Button as j } from "./ui/Button.js";
8
- import { u as z } from "./useMutation-3Ph3x6En.js";
9
- import * as S from "react";
10
- import ye, { createContext as q, useRef as D, useLayoutEffect as ge, useEffect as B, useId as L, useContext as O, useInsertionEffect as je, useMemo as M, useCallback as Ce, Children as ve, isValidElement as we, useState as E } from "react";
11
- import { C as ke, a as be } from "./Card-DPhGbYUM.js";
12
- import { D as U, e as W, a as X, b as Y, c as G, d as J, f as V, g as K } from "./Dialog-BxpuVLh9.js";
13
- import { Input as Ee } from "./ui/Input.js";
14
- import { c as R } from "./cn-wvCW-ho6.js";
15
- const De = () => {
16
- const t = fe();
2
+ import { CircleSlashIcon as R, CheckIcon as _, XIcon as se, PencilLineIcon as ne, RefreshCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as ce } from "lucide-react";
3
+ import { D as de, a as F, R as ue } from "./Slot-DwZlQ-vX.js";
4
+ import { i as E } from "./invariant-DAFpPywt.js";
5
+ import { O as he, L as $ } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
6
+ import { e as pe, d as fe, g as me, c as xe } from "./hook-Bd0yS8M0.js";
7
+ import { Button as y } from "./ui/Button.js";
8
+ import { u as z, A as T, a as M } from "./Alert-CT_ViLrJ.js";
9
+ import * as q from "react";
10
+ import ye, { createContext as L, useLayoutEffect as ge, useEffect as je, useRef as k, useId as H, useContext as B, useInsertionEffect as Ce, useCallback as ve, useMemo as S, Children as we, isValidElement as ke, useState as b } from "react";
11
+ import { C as be, a as Ee } from "./Card-DPhGbYUM.js";
12
+ import { D as J, e as U, a as V, c as Y, b as G, d as Z, f as W, g as K } from "./Dialog-CiIdyz6a.js";
13
+ import { Input as Ne } from "./ui/Input.js";
14
+ import { c as P } from "./cn-wvCW-ho6.js";
15
+ import { u as De } from "./CodeBlock-DAKxs_Tu.js";
16
+ const Ie = () => {
17
+ const t = pe();
17
18
  return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(he, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
18
19
  "Please login first to view this page",
19
- /* @__PURE__ */ e.jsx(j, { onClick: () => t.login(), children: "Login" })
20
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ce, { className: "max-w-[600px]", children: [
20
+ /* @__PURE__ */ e.jsx(y, { onClick: () => t.login(), children: "Login" })
21
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(de, { className: "max-w-[600px]", children: [
21
22
  "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
22
23
  /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
23
24
  "."
24
25
  ] }) });
25
- }, Pe = q({});
26
- function Z(t) {
27
- const i = D(null);
28
- return i.current === null && (i.current = t()), i.current;
29
- }
30
- const Ie = typeof window < "u", Ne = Ie ? ge : B, ee = /* @__PURE__ */ q(null);
31
- function Ke(t) {
32
- return typeof t == "object" && t !== null;
33
- }
34
- function Re(t) {
35
- return Ke(t) && "offsetHeight" in t;
36
- }
37
- const Ae = q({
26
+ }, Ke = (t) => t;
27
+ let X = Ke;
28
+ process.env.NODE_ENV !== "production" && (X = (t, i) => {
29
+ if (!t)
30
+ throw new Error(i);
31
+ });
32
+ const Pe = L(null), Ae = L({}), Re = L({
38
33
  transformPagePoint: (t) => t,
39
34
  isStatic: !1,
40
35
  reducedMotion: "never"
41
- });
42
- class Te extends S.Component {
36
+ }), ze = typeof window < "u", Te = ze ? ge : je;
37
+ function ee(t) {
38
+ const i = k(null);
39
+ return i.current === null && (i.current = t()), i.current;
40
+ }
41
+ class Me extends q.Component {
43
42
  getSnapshotBeforeUpdate(i) {
44
43
  const s = this.props.childRef.current;
45
44
  if (s && i.isPresent && !this.props.isPresent) {
46
- const n = s.offsetParent, o = Re(n) && n.offsetWidth || 0, r = this.props.sizeRef.current;
47
- r.height = s.offsetHeight || 0, r.width = s.offsetWidth || 0, r.top = s.offsetTop, r.left = s.offsetLeft, r.right = o - r.width - r.left;
45
+ const n = this.props.sizeRef.current;
46
+ n.height = s.offsetHeight || 0, n.width = s.offsetWidth || 0, n.top = s.offsetTop, n.left = s.offsetLeft;
48
47
  }
49
48
  return null;
50
49
  }
@@ -57,223 +56,230 @@ class Te extends S.Component {
57
56
  return this.props.children;
58
57
  }
59
58
  }
60
- function ze({ children: t, isPresent: i, anchorX: s }) {
61
- const n = L(), o = D(null), r = D({
59
+ function Se({ children: t, isPresent: i }) {
60
+ const s = H(), n = k(null), o = k({
62
61
  width: 0,
63
62
  height: 0,
64
63
  top: 0,
65
- left: 0,
66
- right: 0
67
- }), { nonce: u } = O(Ae);
68
- return je(() => {
69
- const { width: m, height: h, top: x, left: d, right: c } = r.current;
70
- if (i || !o.current || !m || !h)
64
+ left: 0
65
+ }), { nonce: l } = B(Re);
66
+ return Ce(() => {
67
+ const { width: m, height: a, top: x, left: h } = o.current;
68
+ if (i || !n.current || !m || !a)
71
69
  return;
72
- const y = s === "left" ? `left: ${d}` : `right: ${c}`;
73
- o.current.dataset.motionPopId = n;
74
- const f = document.createElement("style");
75
- return u && (f.nonce = u), document.head.appendChild(f), f.sheet && f.sheet.insertRule(`
76
- [data-motion-pop-id="${n}"] {
70
+ n.current.dataset.motionPopId = s;
71
+ const p = document.createElement("style");
72
+ return l && (p.nonce = l), document.head.appendChild(p), p.sheet && p.sheet.insertRule(`
73
+ [data-motion-pop-id="${s}"] {
77
74
  position: absolute !important;
78
75
  width: ${m}px !important;
79
- height: ${h}px !important;
80
- ${y}px !important;
76
+ height: ${a}px !important;
81
77
  top: ${x}px !important;
78
+ left: ${h}px !important;
82
79
  }
83
80
  `), () => {
84
- document.head.contains(f) && document.head.removeChild(f);
81
+ document.head.removeChild(p);
85
82
  };
86
- }, [i]), e.jsx(Te, { isPresent: i, childRef: o, sizeRef: r, children: S.cloneElement(t, { ref: o }) });
83
+ }, [i]), e.jsx(Me, { isPresent: i, childRef: n, sizeRef: o, children: q.cloneElement(t, { ref: n }) });
87
84
  }
88
- const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: u, anchorX: m }) => {
89
- const h = Z(Se), x = L();
90
- let d = !0, c = M(() => (d = !1, {
91
- id: x,
92
- initial: i,
93
- isPresent: s,
94
- custom: o,
95
- onExitComplete: (y) => {
96
- h.set(y, !0);
97
- for (const f of h.values())
98
- if (!f)
99
- return;
100
- n && n();
101
- },
102
- register: (y) => (h.set(y, !1), () => h.delete(y))
103
- }), [s, h, n]);
104
- return r && d && (c = { ...c }), M(() => {
105
- h.forEach((y, f) => h.set(f, !1));
106
- }, [s]), S.useEffect(() => {
107
- !s && !h.size && n && n();
108
- }, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: c, children: t });
85
+ const qe = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: l, mode: m }) => {
86
+ const a = ee(Le), x = H(), h = ve((d) => {
87
+ a.set(d, !0);
88
+ for (const C of a.values())
89
+ if (!C)
90
+ return;
91
+ n && n();
92
+ }, [a, n]), p = S(
93
+ () => ({
94
+ id: x,
95
+ initial: i,
96
+ isPresent: s,
97
+ custom: o,
98
+ onExitComplete: h,
99
+ register: (d) => (a.set(d, !1), () => a.delete(d))
100
+ }),
101
+ /**
102
+ * If the presence of a child affects the layout of the components around it,
103
+ * we want to make a new context value to ensure they get re-rendered
104
+ * so they can detect that layout change.
105
+ */
106
+ l ? [Math.random(), h] : [s, h]
107
+ );
108
+ return S(() => {
109
+ a.forEach((d, C) => a.set(C, !1));
110
+ }, [s]), q.useEffect(() => {
111
+ !s && !a.size && n && n();
112
+ }, [s]), m === "popLayout" && (t = e.jsx(Se, { isPresent: s, children: t })), e.jsx(Pe.Provider, { value: p, children: t });
109
113
  };
110
- function Se() {
114
+ function Le() {
111
115
  return /* @__PURE__ */ new Map();
112
116
  }
113
- function qe(t = !0) {
114
- const i = O(ee);
115
- if (i === null)
116
- return [!0, null];
117
- const { isPresent: s, onExitComplete: n, register: o } = i, r = L();
118
- B(() => {
119
- if (t)
120
- return o(r);
121
- }, [t]);
122
- const u = Ce(() => t && n && n(r), [r, n, t]);
123
- return !s && n ? [!1, u] : [!0];
124
- }
125
- const I = (t) => t.key || "";
126
- function H(t) {
117
+ const N = (t) => t.key || "";
118
+ function Q(t) {
127
119
  const i = [];
128
- return ve.forEach(t, (s) => {
129
- we(s) && i.push(s);
120
+ return we.forEach(t, (s) => {
121
+ ke(s) && i.push(s);
130
122
  }), i;
131
123
  }
132
- const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: u = !1, anchorX: m = "left" }) => {
133
- const [h, x] = qe(u), d = M(() => H(t), [t]), c = u && !h ? [] : d.map(I), y = D(!0), f = D(d), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(d), [p, v] = E(d);
134
- Ne(() => {
135
- y.current = !1, f.current = d;
136
- for (let w = 0; w < p.length; w++) {
137
- const g = I(p[w]);
138
- c.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
124
+ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExitComplete: o, presenceAffectsLayout: l = !0, mode: m = "sync" }) => {
125
+ X(!i, "Replace exitBeforeEnter with mode='wait'");
126
+ const a = S(() => Q(t), [t]), x = a.map(N), h = k(!0), p = k(a), d = ee(() => /* @__PURE__ */ new Map()), [C, w] = b(a), [j, r] = b(a);
127
+ Te(() => {
128
+ h.current = !1, p.current = a;
129
+ for (let f = 0; f < j.length; f++) {
130
+ const u = N(j[f]);
131
+ x.includes(u) ? d.delete(u) : d.get(u) !== !0 && d.set(u, !1);
139
132
  }
140
- }, [p, c.length, c.join("-")]);
141
- const C = [];
142
- if (d !== a) {
143
- let w = [...d];
144
- for (let g = 0; g < p.length; g++) {
145
- const b = p[g], T = I(b);
146
- c.includes(T) || (w.splice(g, 0, b), C.push(b));
133
+ }, [j, x.length, x.join("-")]);
134
+ const c = [];
135
+ if (a !== C) {
136
+ let f = [...a];
137
+ for (let u = 0; u < j.length; u++) {
138
+ const v = j[u], A = N(v);
139
+ x.includes(A) || (f.splice(u, 0, v), c.push(v));
147
140
  }
148
- return r === "wait" && C.length && (w = C), v(H(w)), l(d), null;
141
+ m === "wait" && c.length && (f = c), r(Q(f)), w(a);
142
+ return;
149
143
  }
150
- process.env.NODE_ENV !== "production" && r === "wait" && p.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
151
- const { forceRender: A } = O(Pe);
152
- return e.jsx(e.Fragment, { children: p.map((w) => {
153
- const g = I(w), b = u && !h ? !1 : d === p || c.includes(g), T = () => {
154
- if (k.has(g))
155
- k.set(g, !0);
144
+ process.env.NODE_ENV !== "production" && m === "wait" && j.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
145
+ const { forceRender: g } = B(Ae);
146
+ return e.jsx(e.Fragment, { children: j.map((f) => {
147
+ const u = N(f), v = a === j || x.includes(u), A = () => {
148
+ if (d.has(u))
149
+ d.set(u, !0);
156
150
  else
157
151
  return;
158
- let $ = !0;
159
- k.forEach((te) => {
160
- te || ($ = !1);
161
- }), $ && (A?.(), v(f.current), u && x?.(), n && n());
152
+ let O = !0;
153
+ d.forEach((te) => {
154
+ te || (O = !1);
155
+ }), O && (g?.(), r(p.current), o && o());
162
156
  };
163
- return e.jsx(Me, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : T, anchorX: m, children: w }, g);
157
+ return e.jsx(qe, { isPresent: v, initial: !h.current || n ? void 0 : !1, custom: v ? void 0 : s, presenceAffectsLayout: l, mode: m, onExitComplete: v ? void 0 : A, children: f }, u);
164
158
  }) });
165
- }, Oe = ({ service: t }) => {
166
- const i = pe(), s = xe(), [n, o] = E(
159
+ }, Fe = ({ service: t }) => {
160
+ const i = fe(), s = me(), [n, o] = b(
167
161
  null
168
- ), [r, u] = E(""), { data: m, isFetching: h } = me({
162
+ ), [l, m] = b(""), { data: a, isFetching: x } = xe({
169
163
  queryFn: () => t.getConsumers(i),
170
164
  queryKey: ["api-keys"],
171
165
  retry: !1
172
- }), x = z({
166
+ }), h = z({
173
167
  mutationFn: ({
174
- consumerId: a,
175
- keyId: l
168
+ consumerId: r,
169
+ keyId: c
176
170
  }) => {
177
171
  if (!t.deleteKey)
178
172
  throw new Error("deleteKey not implemented");
179
- return t.deleteKey(a, l, i);
173
+ return t.deleteKey(r, c, i);
180
174
  },
181
- onMutate: async ({ consumerId: a, keyId: l }) => {
175
+ onMutate: async ({ consumerId: r, keyId: c }) => {
182
176
  await s.cancelQueries({ queryKey: ["api-keys"] });
183
- const p = s.getQueryData([
177
+ const g = s.getQueryData([
184
178
  "api-keys"
185
179
  ]);
186
- return s.setQueryData(["api-keys"], (v) => v && v.map((C) => C.id === a ? {
187
- ...C,
188
- apiKeys: C.apiKeys.filter((A) => A.id !== l)
189
- } : C)), { previousData: p };
180
+ return s.setQueryData(["api-keys"], (f) => f && f.map((u) => u.id === r ? {
181
+ ...u,
182
+ apiKeys: u.apiKeys.filter((v) => v.id !== c)
183
+ } : u)), { previousData: g };
190
184
  },
191
- onError: (a, l, p) => {
192
- p?.previousData && s.setQueryData(["api-keys"], p.previousData);
185
+ onError: (r, c, g) => {
186
+ g?.previousData && s.setQueryData(["api-keys"], g.previousData);
193
187
  },
194
188
  onSuccess: () => {
195
189
  s.invalidateQueries({ queryKey: ["api-keys"] });
196
190
  }
197
- }), d = z({
191
+ }), p = z({
198
192
  mutationFn: ({
199
- consumerId: a,
200
- label: l
193
+ consumerId: r,
194
+ label: c
201
195
  }) => {
202
196
  if (!t.updateConsumer)
203
197
  throw new Error("updateConsumer not implemented");
204
- return t.updateConsumer({ id: a, label: l }, i);
198
+ return t.updateConsumer({ id: r, label: c }, i);
205
199
  },
206
- onMutate: async ({ consumerId: a, label: l }) => {
200
+ onMutate: async ({ consumerId: r, label: c }) => {
207
201
  await s.cancelQueries({ queryKey: ["api-keys"] });
208
- const p = s.getQueryData(["api-keys"]);
209
- return s.setQueryData(["api-keys"], (v) => v && v.map((C) => C.id === a ? {
210
- ...C,
211
- label: l
212
- } : C)), { previousData: p };
202
+ const g = s.getQueryData(["api-keys"]);
203
+ return s.setQueryData(["api-keys"], (f) => f && f.map((u) => u.id === r ? {
204
+ ...u,
205
+ label: c
206
+ } : u)), { previousData: g };
213
207
  },
214
- onError: (a, l, p) => {
215
- p?.previousData && s.setQueryData(["api-keys"], p.previousData);
208
+ onError: (r, c, g) => {
209
+ g?.previousData && s.setQueryData(["api-keys"], g.previousData);
216
210
  },
217
211
  onSuccess: () => {
218
212
  s.invalidateQueries({ queryKey: ["api-keys"] });
219
213
  }
220
- }), c = z({
221
- mutationFn: (a) => {
214
+ }), d = z({
215
+ mutationFn: (r) => {
222
216
  if (!t.rollKey)
223
217
  throw new Error("rollKey not implemented");
224
- return t.rollKey(a, i);
218
+ return t.rollKey(r, i);
225
219
  },
226
220
  onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
227
- }), y = (a, l) => {
228
- o(a), u(l);
229
- }, f = (a) => {
230
- r.trim() && d.mutate({
231
- consumerId: a,
232
- label: r.trim()
233
- }), o(null), u("");
234
- }, k = () => {
235
- o(null), u("");
221
+ }), C = (r, c) => {
222
+ o(r), m(c);
223
+ }, w = (r) => {
224
+ l.trim() && p.mutate({
225
+ consumerId: r,
226
+ label: l.trim()
227
+ }), o(null), m("");
228
+ }, j = () => {
229
+ o(null), m("");
236
230
  };
237
- return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
231
+ return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
238
232
  /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page" }),
239
233
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
240
234
  /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
241
- t.createKey && /* @__PURE__ */ e.jsx(j, { asChild: !0, children: /* @__PURE__ */ e.jsx(Q, { to: "/settings/api-keys/new", children: "Create API Key" }) })
235
+ t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, children: /* @__PURE__ */ e.jsx($, { to: "/settings/api-keys/new", children: "Create API Key" }) })
242
236
  ] }),
243
237
  /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
244
238
  /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page-before-keys" }),
245
239
  /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
246
- /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-8", children: m.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
240
+ d.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
241
+ /* @__PURE__ */ e.jsx(R, { size: 16 }),
242
+ /* @__PURE__ */ e.jsx(M, { children: d.error.message })
243
+ ] }),
244
+ p.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
245
+ /* @__PURE__ */ e.jsx(R, { size: 16 }),
246
+ /* @__PURE__ */ e.jsx(M, { children: p.error.message })
247
+ ] }),
248
+ h.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
249
+ /* @__PURE__ */ e.jsx(R, { size: 16 }),
250
+ /* @__PURE__ */ e.jsx(M, { children: h.error.message })
251
+ ] }),
252
+ /* @__PURE__ */ e.jsx("div", { className: "", children: a.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
247
253
  /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
248
254
  "You have no API keys yet.",
249
255
  /* @__PURE__ */ e.jsx("br", {}),
250
256
  t.createKey && "Get started and create your first key."
251
257
  ] }),
252
- t.createKey && /* @__PURE__ */ e.jsx(j, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(Q, { to: "/settings/api-keys/new", children: "Create API Key" }) })
258
+ t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx($, { to: "/settings/api-keys/new", children: "Create API Key" }) })
253
259
  ] }) : /* @__PURE__ */ e.jsx(
254
260
  "ul",
255
261
  {
256
- className: R(
262
+ className: P(
257
263
  "grid grid-cols-1 divide-y divide-border col-span-6",
258
264
  "lg:grid-cols-[1fr_min-content]"
259
265
  ),
260
- children: m.map((a) => /* @__PURE__ */ e.jsxs(
261
- ke,
266
+ children: a.map((r) => /* @__PURE__ */ e.jsxs(
267
+ be,
262
268
  {
263
269
  className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
264
270
  children: [
265
- /* @__PURE__ */ e.jsxs(be, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
271
+ /* @__PURE__ */ e.jsxs(Ee, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
266
272
  /* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
267
273
  /* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
268
- n === a.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
274
+ n === r.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
269
275
  /* @__PURE__ */ e.jsx(
270
- Ee,
276
+ Ne,
271
277
  {
272
278
  maxLength: 32,
273
- value: r,
274
- onChange: (l) => u(l.target.value),
275
- onKeyDown: (l) => {
276
- l.key === "Enter" ? f(a.id) : l.key === "Escape" && k();
279
+ value: l,
280
+ onChange: (c) => m(c.target.value),
281
+ onKeyDown: (c) => {
282
+ c.key === "Enter" ? w(r.id) : c.key === "Escape" && j();
277
283
  },
278
284
  className: "text-lg font-medium",
279
285
  autoFocus: !0
@@ -281,79 +287,90 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
281
287
  ),
282
288
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
283
289
  /* @__PURE__ */ e.jsx(
284
- j,
290
+ y,
285
291
  {
286
292
  size: "icon",
287
293
  variant: "ghost",
288
- onClick: () => f(a.id),
289
- disabled: !r.trim(),
294
+ onClick: () => w(r.id),
295
+ disabled: !l.trim(),
290
296
  children: /* @__PURE__ */ e.jsx(_, { size: 16 })
291
297
  }
292
298
  ),
293
299
  /* @__PURE__ */ e.jsx(
294
- j,
300
+ y,
295
301
  {
296
302
  size: "icon",
297
303
  variant: "ghost",
298
- onClick: k,
304
+ onClick: j,
299
305
  children: /* @__PURE__ */ e.jsx(se, { size: 16 })
300
306
  }
301
307
  )
302
308
  ] })
303
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: a.label }),
304
- /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: a.createdOn })
309
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: r.label }),
310
+ /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: r.createdOn })
305
311
  ] }),
306
312
  /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
307
- a.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
313
+ r.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
308
314
  "Created on",
309
315
  " ",
310
- new Date(a.createdOn).toLocaleDateString()
316
+ new Date(r.createdOn).toLocaleDateString()
311
317
  ] }),
312
- a.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
318
+ r.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
313
319
  "Expires on",
314
320
  " ",
315
- new Date(a.expiresOn).toLocaleDateString()
321
+ new Date(r.expiresOn).toLocaleDateString()
316
322
  ] })
317
323
  ] })
318
324
  ] }),
319
325
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
320
- t.updateConsumer && /* @__PURE__ */ e.jsx(
321
- j,
326
+ t.updateConsumer && /* @__PURE__ */ e.jsxs(
327
+ y,
322
328
  {
323
- size: "icon",
324
329
  variant: "ghost",
325
- onClick: () => y(a.id, a.label),
326
- className: R(
327
- n === a.id && "opacity-0! pointer-events-none"
330
+ onClick: () => C(r.id, r.label),
331
+ className: P(
332
+ "flex gap-2",
333
+ n === r.id && "opacity-0! pointer-events-none"
328
334
  ),
329
- disabled: n === a.id,
330
- children: /* @__PURE__ */ e.jsx(ne, { size: 16 })
335
+ disabled: n === r.id,
336
+ children: [
337
+ /* @__PURE__ */ e.jsx(ne, { size: 16 }),
338
+ "Edit label"
339
+ ]
331
340
  }
332
341
  ),
333
- t.rollKey && /* @__PURE__ */ e.jsxs(U, { children: [
334
- /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
335
- j,
342
+ t.rollKey && /* @__PURE__ */ e.jsxs(J, { children: [
343
+ /* @__PURE__ */ e.jsx(U, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
344
+ y,
336
345
  {
337
- size: "icon",
338
346
  title: "Roll this key",
339
347
  variant: "ghost",
340
- disabled: c.isPending,
341
- className: c.isPending ? "animate-spin" : void 0,
342
- children: /* @__PURE__ */ e.jsx(ie, { size: 16 })
348
+ disabled: d.isPending,
349
+ className: "flex items-center gap-2",
350
+ children: [
351
+ /* @__PURE__ */ e.jsx(
352
+ ie,
353
+ {
354
+ size: 16,
355
+ className: d.isPending ? "animate-spin" : void 0
356
+ }
357
+ ),
358
+ "Roll key"
359
+ ]
343
360
  }
344
361
  ) }),
345
- /* @__PURE__ */ e.jsxs(X, { children: [
362
+ /* @__PURE__ */ e.jsxs(V, { children: [
346
363
  /* @__PURE__ */ e.jsxs(Y, { children: [
347
364
  /* @__PURE__ */ e.jsx(G, { children: "Roll API Key" }),
348
- /* @__PURE__ */ e.jsx(J, { children: "Are you sure you want to roll this API key?" })
365
+ /* @__PURE__ */ e.jsx(Z, { children: "Are you sure you want to roll this API key?" })
349
366
  ] }),
350
- /* @__PURE__ */ e.jsxs(V, { children: [
351
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
367
+ /* @__PURE__ */ e.jsxs(W, { children: [
368
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
352
369
  /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
353
- j,
370
+ y,
354
371
  {
355
372
  onClick: () => {
356
- c.mutate(a.id);
373
+ d.mutate(r.id);
357
374
  },
358
375
  children: "Roll Key"
359
376
  }
@@ -363,25 +380,25 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
363
380
  ] })
364
381
  ] })
365
382
  ] }),
366
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(Le, { children: a.apiKeys.map((l) => /* @__PURE__ */ e.jsxs(ye.Fragment, { children: [
383
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(Oe, { children: r.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(ye.Fragment, { children: [
367
384
  /* @__PURE__ */ e.jsx(
368
- Fe,
385
+ Qe,
369
386
  {
370
- apiKey: l,
387
+ apiKey: c,
371
388
  onDeleteKey: () => {
372
- x.mutate({
373
- consumerId: a.id,
374
- keyId: l.id
389
+ h.mutate({
390
+ consumerId: r.id,
391
+ keyId: c.id
375
392
  });
376
393
  },
377
- className: x.variables?.keyId === l.id && (x.isPending || h) ? "opacity-10!" : void 0
394
+ className: h.variables?.keyId === c.id && (h.isPending || x) ? "opacity-10!" : void 0
378
395
  }
379
396
  ),
380
397
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
381
- ] }, l.id)) }) })
398
+ ] }, c.id)) }) })
382
399
  ]
383
400
  },
384
- a.id
401
+ r.id
385
402
  ))
386
403
  }
387
404
  ) })
@@ -389,87 +406,83 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
389
406
  }, $e = (t) => {
390
407
  const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), o = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
391
408
  return n < 60 ? o.format(-n, "second") : n < 3600 ? o.format(-Math.floor(n / 60), "minute") : n < 86400 ? o.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? o.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? o.format(-Math.floor(n / 2592e3), "month") : o.format(-Math.floor(n / 31536e3), "year");
392
- }, Fe = ({
409
+ }, Qe = ({
393
410
  apiKey: t,
394
411
  onDeleteKey: i,
395
412
  className: s
396
413
  }) => {
397
- const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t, d = x && new Date(x) < /* @__PURE__ */ new Date(), c = x ? Math.ceil(
398
- (new Date(x).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
399
- ) : 1 / 0, y = c <= 7 && !d;
400
- return /* @__PURE__ */ e.jsxs("div", { className: R("grid col-span-full grid-cols-subgrid p-6", s), children: [
414
+ const [n, o] = b(!1), [l, m] = De(), { key: a, createdOn: x, expiresOn: h } = t, p = h && new Date(h) < /* @__PURE__ */ new Date(), d = h ? Math.ceil(
415
+ (new Date(h).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
416
+ ) : 1 / 0, C = d <= 7 && !p;
417
+ return /* @__PURE__ */ e.jsxs("div", { className: P("grid col-span-full grid-cols-subgrid p-6", s), children: [
401
418
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
402
419
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
403
420
  /* @__PURE__ */ e.jsxs("div", { className: "font-mono truncate h-9 items-center flex px-2 text-xs gap-2", children: [
404
421
  /* @__PURE__ */ e.jsx(
405
422
  "div",
406
423
  {
407
- className: R(
424
+ className: P(
408
425
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
409
- (y || d) && "bg-neutral-200"
426
+ (C || p) && "bg-neutral-200"
410
427
  )
411
428
  }
412
429
  ),
413
430
  /* @__PURE__ */ e.jsxs("span", { children: [
414
- /* @__PURE__ */ e.jsx("span", { className: n ? "" : "opacity-20", children: n ? m.slice(0, -5) : "**** ".repeat(m.slice(0, -5).length / 5) + "*".repeat(m.slice(0, -5).length % 5) }),
415
- /* @__PURE__ */ e.jsx("span", { children: m.slice(-5) })
431
+ /* @__PURE__ */ e.jsx("span", { className: n ? "" : "opacity-20", children: n ? a.slice(0, -5) : "**** ".repeat(a.slice(0, -5).length / 5) + "*".repeat(a.slice(0, -5).length % 5) }),
432
+ /* @__PURE__ */ e.jsx("span", { children: a.slice(-5) })
416
433
  ] })
417
434
  ] }),
418
435
  /* @__PURE__ */ e.jsx(
419
- j,
436
+ y,
420
437
  {
421
438
  variant: "ghost",
422
- onClick: () => o((f) => !f),
439
+ onClick: () => o((w) => !w),
423
440
  size: "icon",
424
441
  children: n ? /* @__PURE__ */ e.jsx(re, { size: 16 }) : /* @__PURE__ */ e.jsx(ae, { size: 16 })
425
442
  }
426
443
  ),
427
444
  /* @__PURE__ */ e.jsx(
428
- j,
445
+ y,
429
446
  {
430
447
  variant: "ghost",
431
- onClick: () => {
432
- navigator.clipboard.writeText(m).then(() => {
433
- u(!0), setTimeout(() => u(!1), 2e3);
434
- });
435
- },
448
+ onClick: () => m(a),
436
449
  size: "icon",
437
- children: r ? /* @__PURE__ */ e.jsx(_, { size: 16 }) : /* @__PURE__ */ e.jsx(oe, { size: 16 })
450
+ children: l ? /* @__PURE__ */ e.jsx(_, { size: 16 }) : /* @__PURE__ */ e.jsx(oe, { size: 16 })
438
451
  }
439
452
  )
440
453
  ] }),
441
454
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
442
- h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
455
+ x && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
443
456
  "Created ",
444
- $e(h),
457
+ $e(x),
445
458
  "."
446
459
  ] }),
447
460
  " ",
448
- x && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
461
+ h && C && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
449
462
  "Expires in ",
450
- c,
463
+ d,
451
464
  " ",
452
- c === 1 ? "day" : "days",
465
+ d === 1 ? "day" : "days",
453
466
  "."
454
467
  ] }),
455
- x && d && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
468
+ h && p && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
456
469
  "Expired",
457
470
  " ",
458
- c === 0 ? "today." : `${c * -1} days ago.`
471
+ d === 0 ? "today." : `${d * -1} days ago.`
459
472
  ] })
460
473
  ] })
461
474
  ] }),
462
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs(U, { children: [
463
- /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
464
- /* @__PURE__ */ e.jsxs(X, { children: [
475
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: h && i && /* @__PURE__ */ e.jsxs(J, { children: [
476
+ /* @__PURE__ */ e.jsx(U, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
477
+ /* @__PURE__ */ e.jsxs(V, { children: [
465
478
  /* @__PURE__ */ e.jsxs(Y, { children: [
466
479
  /* @__PURE__ */ e.jsx(G, { children: "Delete API Key" }),
467
- /* @__PURE__ */ e.jsx(J, { children: "Are you sure you want to delete this API key?" })
480
+ /* @__PURE__ */ e.jsx(Z, { children: "Are you sure you want to delete this API key?" })
468
481
  ] }),
469
- /* @__PURE__ */ e.jsxs(V, { children: [
470
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
482
+ /* @__PURE__ */ e.jsxs(W, { children: [
483
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
471
484
  /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
472
- j,
485
+ y,
473
486
  {
474
487
  onClick: () => {
475
488
  i();
@@ -481,23 +494,36 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
481
494
  ] })
482
495
  ] }) })
483
496
  ] });
484
- }, N = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
497
+ }, D = "https://api.zuploedge.com/v2/client", _e = async (t) => {
498
+ try {
499
+ return await t.json();
500
+ } catch {
501
+ return;
502
+ }
503
+ }, I = async (t) => {
504
+ const i = t.headers.get("content-type");
505
+ if (!t.ok && i?.includes("application/problem+json")) {
506
+ const s = await _e(t);
507
+ if (s.type && s.title)
508
+ throw new Error(s.detail ?? s.title);
509
+ }
510
+ }, He = (t) => ({
485
511
  deleteKey: async (i, s, n) => {
486
512
  const o = new Request(
487
- N + `/${t}/consumers/${i}/keys/${s}`,
513
+ D + `/${t}/consumers/${i}/keys/${s}`,
488
514
  {
489
515
  method: "DELETE"
490
516
  }
491
517
  );
492
518
  await n.signRequest(o);
493
- const r = await fetch(o);
494
- P(r.ok, "Failed to delete API key");
519
+ const l = await fetch(o);
520
+ await I(l), E(l.ok, "Failed to delete API key");
495
521
  },
496
522
  updateConsumer: async (i, s) => {
497
523
  const n = await fetch(
498
524
  await s.signRequest(
499
525
  new Request(
500
- N + `/${t}/consumers/${i.id}`,
526
+ D + `/${t}/consumers/${i.id}`,
501
527
  {
502
528
  method: "PATCH",
503
529
  headers: {
@@ -510,60 +536,58 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
510
536
  )
511
537
  )
512
538
  );
513
- P(n.ok, "Failed to update API key description");
539
+ await I(n), E(n.ok, "Failed to update API key description");
514
540
  },
515
541
  rollKey: async (i, s) => {
516
542
  const n = await fetch(
517
543
  await s.signRequest(
518
544
  new Request(
519
- N + `/${t}/consumers/${i}/roll-key`,
545
+ D + `/${t}/consumers/${i}/roll-key`,
520
546
  {
521
547
  method: "POST",
522
548
  headers: {
523
549
  "Content-Type": "application/json"
524
550
  },
525
- body: JSON.stringify({
526
- expiresOn: /* @__PURE__ */ new Date()
527
- })
551
+ body: JSON.stringify({})
528
552
  }
529
553
  )
530
554
  )
531
555
  );
532
- P(n.ok, "Failed to delete API key");
556
+ await I(n), E(n.ok, "Failed to delete API key");
533
557
  },
534
558
  getConsumers: async (i) => {
535
559
  const s = new Request(
536
- N + `/${t}/consumers`
560
+ D + `/${t}/consumers`
537
561
  );
538
562
  await i.signRequest(s);
539
563
  const n = await fetch(s);
540
- return P(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((r) => ({
541
- id: r.id,
542
- label: r.label || "API Key",
543
- apiKeys: r.apiKeys.data,
544
- key: r.apiKeys.data.at(0)
564
+ return await I(n), E(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((l) => ({
565
+ id: l.id,
566
+ label: l.label ?? l.subject ?? "API Key",
567
+ apiKeys: l.apiKeys.data,
568
+ key: l.apiKeys.data.at(0)
545
569
  }));
546
570
  }
547
- }), st = (t) => t, nt = (t) => {
548
- const i = "deploymentName" in t ? Qe(t.deploymentName) : t;
571
+ }), rt = (t) => t, at = (t) => {
572
+ const i = "deploymentName" in t ? He(t.deploymentName) : t;
549
573
  return {
550
574
  getProfileMenuItems: () => [
551
575
  {
552
576
  label: "API Keys",
553
577
  path: "/settings/api-keys",
554
578
  category: "middle",
555
- icon: de
579
+ icon: ce
556
580
  }
557
581
  ],
558
582
  getIdentities: async (s) => {
559
583
  try {
560
584
  return (await i.getConsumers(s)).map((o) => ({
561
- authorizeRequest: (r) => (r.headers.set(
585
+ authorizeRequest: (l) => (l.headers.set(
562
586
  "Authorization",
563
587
  `Bearer ${o.apiKeys.at(0)?.key}`
564
- ), r),
588
+ ), l),
565
589
  id: o.id,
566
- label: o.description ?? o.id
590
+ label: o.label
567
591
  }));
568
592
  } catch {
569
593
  return [];
@@ -571,12 +595,12 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
571
595
  },
572
596
  getRoutes: () => [
573
597
  {
574
- element: /* @__PURE__ */ e.jsx(De, {}),
598
+ element: /* @__PURE__ */ e.jsx(Ie, {}),
575
599
  errorElement: /* @__PURE__ */ e.jsx(ue, {}),
576
600
  children: [
577
601
  {
578
602
  path: "/settings/api-keys",
579
- element: /* @__PURE__ */ e.jsx(Oe, { service: i })
603
+ element: /* @__PURE__ */ e.jsx(Fe, { service: i })
580
604
  }
581
605
  // {
582
606
  // path: "/settings/api-keys/new",
@@ -588,7 +612,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
588
612
  };
589
613
  };
590
614
  export {
591
- nt as apiKeyPlugin,
592
- st as createApiKeyService
615
+ at as apiKeyPlugin,
616
+ rt as createApiKeyService
593
617
  };
594
618
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map