zudoku 0.53.4 → 0.53.6

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 (233) hide show
  1. package/dist/config/validators/InputNavigationSchema.d.ts +64 -5
  2. package/dist/config/validators/InputNavigationSchema.js +0 -3
  3. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  4. package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
  5. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
  6. package/dist/config/validators/NavigationSchema.js +3 -2
  7. package/dist/config/validators/NavigationSchema.js.map +1 -1
  8. package/dist/config/validators/icon-types.d.ts +1 -1
  9. package/dist/config/validators/icon-types.js +16 -0
  10. package/dist/config/validators/icon-types.js.map +1 -1
  11. package/dist/config/validators/validate.d.ts +3 -0
  12. package/dist/config/validators/validate.js +1 -0
  13. package/dist/config/validators/validate.js.map +1 -1
  14. package/dist/flat-config.d.ts +2 -4
  15. package/dist/lib/components/Header.js +1 -1
  16. package/dist/lib/components/Header.js.map +1 -1
  17. package/dist/lib/components/Markdown.js +2 -2
  18. package/dist/lib/components/Markdown.js.map +1 -1
  19. package/dist/lib/components/NotFoundPage.js +1 -1
  20. package/dist/lib/components/NotFoundPage.js.map +1 -1
  21. package/dist/lib/components/Typography.d.ts +1 -1
  22. package/dist/lib/components/Typography.js +1 -1
  23. package/dist/lib/components/Typography.js.map +1 -1
  24. package/dist/lib/core/ZudokuContext.d.ts +1 -0
  25. package/dist/lib/core/ZudokuContext.js.map +1 -1
  26. package/dist/lib/errors/ErrorAlert.js +1 -1
  27. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  28. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  29. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  30. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  31. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  32. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  33. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  34. package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
  35. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  36. package/dist/lib/ui/CodeBlock.js +1 -1
  37. package/dist/lib/ui/CodeBlock.js.map +1 -1
  38. package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
  39. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  40. package/dist/vite/dev-server.js +9 -1
  41. package/dist/vite/dev-server.js.map +1 -1
  42. package/dist/vite/plugin-docs.js +20 -13
  43. package/dist/vite/plugin-docs.js.map +1 -1
  44. package/dist/vite/plugin-theme.js +88 -49
  45. package/dist/vite/plugin-theme.js.map +1 -1
  46. package/dist/vite/plugin-theme.test.js +25 -4
  47. package/dist/vite/plugin-theme.test.js.map +1 -1
  48. package/lib/{Alert-SijAp9LN.js → Alert-CWApD0CL.js} +3 -3
  49. package/lib/{Alert-SijAp9LN.js.map → Alert-CWApD0CL.js.map} +1 -1
  50. package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
  51. package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
  52. package/lib/CallbackHandler-Dr5Lva9x.js +38 -0
  53. package/lib/CallbackHandler-Dr5Lva9x.js.map +1 -0
  54. package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
  55. package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
  56. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  57. package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
  58. package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
  59. package/lib/{Command-xsbs2uhf.js → Command-C9AC5cf-.js} +3 -3
  60. package/lib/{Command-xsbs2uhf.js.map → Command-C9AC5cf-.js.map} +1 -1
  61. package/lib/{Dialog-CiIdyz6a.js → Dialog-DMWw1doX.js} +2 -2
  62. package/lib/{Dialog-CiIdyz6a.js.map → Dialog-DMWw1doX.js.map} +1 -1
  63. package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
  64. package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
  65. package/lib/{MdxPage-BFKqQsmK.js → MdxPage-DVI4iYgW.js} +7 -7
  66. package/lib/{MdxPage-BFKqQsmK.js.map → MdxPage-DVI4iYgW.js.map} +1 -1
  67. package/lib/{OasProvider-Bdyvd6Ic.js → OasProvider-CbwsKPNc.js} +2 -2
  68. package/lib/{OasProvider-Bdyvd6Ic.js.map → OasProvider-CbwsKPNc.js.map} +1 -1
  69. package/lib/{OperationList-YZ7k-Rkt.js → OperationList-Bn9ggxw8.js} +12 -12
  70. package/lib/OperationList-Bn9ggxw8.js.map +1 -0
  71. package/lib/{Pagination-EViy7EHt.js → Pagination-bavPec-z.js} +3 -3
  72. package/lib/{Pagination-EViy7EHt.js.map → Pagination-bavPec-z.js.map} +1 -1
  73. package/lib/{RouteGuard-CX6A77iy.js → RouteGuard-Vnlz_t51.js} +2 -2
  74. package/lib/{RouteGuard-CX6A77iy.js.map → RouteGuard-Vnlz_t51.js.map} +1 -1
  75. package/lib/{SchemaList--_f8Azv0.js → SchemaList-DETyCVqu.js} +8 -8
  76. package/lib/{SchemaList--_f8Azv0.js.map → SchemaList-DETyCVqu.js.map} +1 -1
  77. package/lib/{SchemaView-7XWvSrbX.js → SchemaView-Dvxo2RNe.js} +6 -6
  78. package/lib/{SchemaView-7XWvSrbX.js.map → SchemaView-Dvxo2RNe.js.map} +1 -1
  79. package/lib/{SignUp-CXCezG-m.js → SignUp-ClYhZq9H.js} +3 -3
  80. package/lib/{SignUp-CXCezG-m.js.map → SignUp-ClYhZq9H.js.map} +1 -1
  81. package/lib/{Slot-tFjhrd8V.js → Slot-B31yZlfB.js} +316 -336
  82. package/lib/{Slot-tFjhrd8V.js.map → Slot-B31yZlfB.js.map} +1 -1
  83. package/lib/Spinner-mNLZ6awP.js.map +1 -1
  84. package/lib/{SyntaxHighlight-Bp_UsIXG.js → SyntaxHighlight-bm761HDo.js} +3 -3
  85. package/lib/{SyntaxHighlight-Bp_UsIXG.js.map → SyntaxHighlight-bm761HDo.js.map} +1 -1
  86. package/lib/{Toc-Ck0YQtmd.js → Toc-D4oBWE8D.js} +3 -3
  87. package/lib/{Toc-Ck0YQtmd.js.map → Toc-D4oBWE8D.js.map} +1 -1
  88. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +1 -1
  89. package/lib/{circular-BtKlhs07.js → circular-CRbFI6Zl.js} +2 -2
  90. package/lib/{circular-BtKlhs07.js.map → circular-CRbFI6Zl.js.map} +1 -1
  91. package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
  92. package/lib/cn-dYga0KKN.js.map +1 -0
  93. package/lib/{createServer-Di2U1Dg0.js → createServer-DNyGJJNX.js} +3398 -3552
  94. package/lib/createServer-DNyGJJNX.js.map +1 -0
  95. package/lib/errors-C1GlNcV3.js +44 -0
  96. package/lib/errors-C1GlNcV3.js.map +1 -0
  97. package/lib/hook-CZjW2buS.js.map +1 -1
  98. package/lib/index-Bm35Tkgf.js.map +1 -1
  99. package/lib/{index-CeQqiMIG.js → index-CZTEgYDd.js} +2 -2
  100. package/lib/{index-CeQqiMIG.js.map → index-CZTEgYDd.js.map} +1 -1
  101. package/lib/{index-BTqwnlI5.js → index-C_PXQ8Bx.js} +612 -610
  102. package/lib/{index-BTqwnlI5.js.map → index-C_PXQ8Bx.js.map} +1 -1
  103. package/lib/index-CrcNWbel.js.map +1 -1
  104. package/lib/{index-DKCEJ4Kd.js → index-D09PbNex.js} +911 -911
  105. package/lib/index-D09PbNex.js.map +1 -0
  106. package/lib/index-DI5SPFK9.js.map +1 -1
  107. package/lib/index-DmNq2fbN.js.map +1 -1
  108. package/lib/index.esm-Cp4wkyud.js.map +1 -1
  109. package/lib/invariant-DAFpPywt.js.map +1 -1
  110. package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
  111. package/lib/processors/removeExtensions.js.map +1 -1
  112. package/lib/processors/removeParameters.js.map +1 -1
  113. package/lib/processors/removePaths.js.map +1 -1
  114. package/lib/processors/traverse.js.map +1 -1
  115. package/lib/ui/Accordion.js +1 -1
  116. package/lib/ui/Accordion.js.map +1 -1
  117. package/lib/ui/ActionButton.js +2 -2
  118. package/lib/ui/ActionButton.js.map +1 -1
  119. package/lib/ui/Alert.js +1 -1
  120. package/lib/ui/Alert.js.map +1 -1
  121. package/lib/ui/AlertDialog.js +1 -1
  122. package/lib/ui/AlertDialog.js.map +1 -1
  123. package/lib/ui/Badge.js +1 -1
  124. package/lib/ui/Badge.js.map +1 -1
  125. package/lib/ui/Breadcrumb.js +1 -1
  126. package/lib/ui/Breadcrumb.js.map +1 -1
  127. package/lib/ui/Button.js +1 -1
  128. package/lib/ui/Button.js.map +1 -1
  129. package/lib/ui/Callout.js +1 -1
  130. package/lib/ui/Callout.js.map +1 -1
  131. package/lib/ui/Card.js +1 -1
  132. package/lib/ui/Card.js.map +1 -1
  133. package/lib/ui/Carousel.js +1 -1
  134. package/lib/ui/Carousel.js.map +1 -1
  135. package/lib/ui/Checkbox.js +1 -1
  136. package/lib/ui/Checkbox.js.map +1 -1
  137. package/lib/ui/CodeBlock.js +2 -2
  138. package/lib/ui/Command.js +2 -2
  139. package/lib/ui/Command.js.map +1 -1
  140. package/lib/ui/Dialog.js +1 -1
  141. package/lib/ui/Dialog.js.map +1 -1
  142. package/lib/ui/Drawer.js +2 -2
  143. package/lib/ui/DropdownMenu.js +1 -1
  144. package/lib/ui/DropdownMenu.js.map +1 -1
  145. package/lib/ui/EmbeddedCodeBlock.js +2 -2
  146. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  147. package/lib/ui/Form.js +1 -1
  148. package/lib/ui/Form.js.map +1 -1
  149. package/lib/ui/HoverCard.js +1 -1
  150. package/lib/ui/HoverCard.js.map +1 -1
  151. package/lib/ui/Input.js +1 -1
  152. package/lib/ui/Input.js.map +1 -1
  153. package/lib/ui/Label.js +1 -1
  154. package/lib/ui/Label.js.map +1 -1
  155. package/lib/ui/Pagination.js +1 -1
  156. package/lib/ui/Pagination.js.map +1 -1
  157. package/lib/ui/Popover.js +1 -1
  158. package/lib/ui/Popover.js.map +1 -1
  159. package/lib/ui/Progress.js +1 -1
  160. package/lib/ui/Progress.js.map +1 -1
  161. package/lib/ui/RadioGroup.js +1 -1
  162. package/lib/ui/RadioGroup.js.map +1 -1
  163. package/lib/ui/ScrollArea.js +1 -1
  164. package/lib/ui/ScrollArea.js.map +1 -1
  165. package/lib/ui/Select.js +1 -1
  166. package/lib/ui/Select.js.map +1 -1
  167. package/lib/ui/Skeleton.js +1 -1
  168. package/lib/ui/Skeleton.js.map +1 -1
  169. package/lib/ui/Slider.js +1 -1
  170. package/lib/ui/Slider.js.map +1 -1
  171. package/lib/ui/Stepper.js.map +1 -1
  172. package/lib/ui/Switch.js +1 -1
  173. package/lib/ui/Switch.js.map +1 -1
  174. package/lib/ui/SyntaxHighlight.js +2 -2
  175. package/lib/ui/Tabs.js +1 -1
  176. package/lib/ui/Tabs.js.map +1 -1
  177. package/lib/ui/Textarea.js +1 -1
  178. package/lib/ui/Textarea.js.map +1 -1
  179. package/lib/ui/Toggle.js +1 -1
  180. package/lib/ui/Toggle.js.map +1 -1
  181. package/lib/ui/ToggleGroup.js +1 -1
  182. package/lib/ui/ToggleGroup.js.map +1 -1
  183. package/lib/ui/Tooltip.js +1 -1
  184. package/lib/ui/Tooltip.js.map +1 -1
  185. package/lib/ui/util.js +1 -1
  186. package/lib/useExposedProps-BIYjecPD.js.map +1 -1
  187. package/lib/zudoku.auth-auth0.js.map +1 -1
  188. package/lib/zudoku.auth-azureb2c.js +40 -9882
  189. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  190. package/lib/zudoku.auth-clerk.js +2 -2
  191. package/lib/zudoku.auth-clerk.js.map +1 -1
  192. package/lib/zudoku.auth-openid.js +20 -19
  193. package/lib/zudoku.auth-openid.js.map +1 -1
  194. package/lib/zudoku.auth-supabase.js +97 -0
  195. package/lib/zudoku.auth-supabase.js.map +1 -0
  196. package/lib/zudoku.components.js +3 -3
  197. package/lib/zudoku.hooks.js.map +1 -1
  198. package/lib/zudoku.icons.js.map +1 -1
  199. package/lib/zudoku.plugin-api-catalog.js +4 -4
  200. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  201. package/lib/zudoku.plugin-api-keys.js +266 -263
  202. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  203. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  204. package/lib/zudoku.plugin-markdown.js +1 -1
  205. package/lib/zudoku.plugin-markdown.js.map +1 -1
  206. package/lib/zudoku.plugin-openapi.js +1 -1
  207. package/lib/zudoku.plugin-redirect.js.map +1 -1
  208. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  209. package/lib/zudoku.plugin-search-pagefind.js +5 -5
  210. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  211. package/lib/zudoku.plugins.js.map +1 -1
  212. package/package.json +18 -18
  213. package/src/app/main.css +26 -5
  214. package/src/lib/components/Header.tsx +1 -1
  215. package/src/lib/components/Markdown.tsx +3 -3
  216. package/src/lib/components/NotFoundPage.tsx +3 -2
  217. package/src/lib/components/Typography.tsx +1 -1
  218. package/src/lib/core/ZudokuContext.ts +1 -0
  219. package/src/lib/errors/ErrorAlert.tsx +5 -7
  220. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  221. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
  222. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  223. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
  224. package/src/lib/ui/CodeBlock.tsx +1 -1
  225. package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
  226. package/lib/OperationList-YZ7k-Rkt.js.map +0 -1
  227. package/lib/clerk-BDZ31hjU.js +0 -25190
  228. package/lib/clerk-BDZ31hjU.js.map +0 -1
  229. package/lib/cn-wvCW-ho6.js.map +0 -1
  230. package/lib/createServer-Di2U1Dg0.js.map +0 -1
  231. package/lib/errors-Dv_yAK6M.js +0 -78
  232. package/lib/errors-Dv_yAK6M.js.map +0 -1
  233. package/lib/index-DKCEJ4Kd.js.map +0 -1
@@ -1,50 +1,51 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { CircleSlashIcon as M, CheckIcon as W, XIcon as ae, PencilLineIcon as oe, RefreshCwIcon as le, EyeOffIcon as ce, EyeIcon as de, CopyIcon as ue, TrashIcon as he, KeyRoundIcon as fe } from "lucide-react";
3
- import { D as pe, a as B, R as me } from "./Slot-tFjhrd8V.js";
4
- import { i as D } from "./invariant-DAFpPywt.js";
5
- import { O as xe, L as J } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
6
- import { e as ye, d as ge, g as je, c as Ce } from "./hook-CZjW2buS.js";
7
- import { Button as j } from "./ui/Button.js";
8
- import { u as S, A as q, a as L } from "./Alert-SijAp9LN.js";
2
+ import { CircleSlashIcon as M, CheckIcon as W, XIcon as oe, PencilLineIcon as le, RefreshCwIcon as ce, EyeOffIcon as de, EyeIcon as ue, CopyIcon as he, TrashIcon as fe, KeyRoundIcon as pe } from "lucide-react";
3
+ import { D as me, a as B, R as xe } from "./Slot-B31yZlfB.js";
4
+ import { i as I } from "./invariant-DAFpPywt.js";
5
+ import { O as ye, L as J } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
6
+ import { e as ge, d as je, g as Ce, c as we } from "./hook-CZjW2buS.js";
7
+ import { Button as g } from "./ui/Button.js";
8
+ import { u as S, A as q, a as L } from "./Alert-CWApD0CL.js";
9
9
  import * as F from "react";
10
- import we, { createContext as O, useRef as N, useLayoutEffect as ve, useEffect as X, useId as Q, useContext as H, useInsertionEffect as ke, useMemo as $, useCallback as be, Children as Ee, isValidElement as Ne, useState as P } from "react";
11
- import { C as Pe, a as De } from "./Card-DPhGbYUM.js";
12
- import { D as Y, e as G, a as V, c as Z, b as ee, d as te, f as se, g as R } from "./Dialog-CiIdyz6a.js";
13
- import { Input as Ie } from "./ui/Input.js";
14
- import { c as E } from "./cn-wvCW-ho6.js";
15
- import { u as Ke } from "./CodeBlock-DAKxs_Tu.js";
16
- const Ae = () => {
17
- const t = ye();
18
- return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(xe, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
10
+ import ve, { createContext as O, useRef as P, useLayoutEffect as ke, useEffect as X, useId as Q, useContext as H, useInsertionEffect as be, useMemo as $, useCallback as Ee, Children as Ne, isValidElement as Pe, useState as D } from "react";
11
+ import { C as De, a as Ie } from "./Card-CMDQUPM4.js";
12
+ import { D as Y, e as G, a as V, c as Z, b as ee, d as te, f as se, g as T } from "./Dialog-DMWw1doX.js";
13
+ import { Input as Ke } from "./ui/Input.js";
14
+ import { c as N } from "./cn-dYga0KKN.js";
15
+ import { u as Ae } from "./CodeBlock-B-G0eKtw.js";
16
+ const Re = () => {
17
+ const t = ge();
18
+ return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(ye, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
19
19
  "Please login first to view this page",
20
- /* @__PURE__ */ e.jsx(j, { 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(pe, { className: "max-w-[600px]", children: [
20
+ /* @__PURE__ */ e.jsx(g, { 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(me, { className: "max-w-[600px]", children: [
22
22
  "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
23
23
  /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
24
24
  "."
25
25
  ] }) });
26
- }, Re = O({});
26
+ }, Te = O({});
27
27
  function ne(t) {
28
- const i = N(null);
29
- return i.current === null && (i.current = t()), i.current;
28
+ const r = P(null);
29
+ return r.current === null && (r.current = t()), r.current;
30
30
  }
31
- const Te = typeof window < "u", ze = Te ? ve : X, ie = /* @__PURE__ */ O(null), Me = O({
32
- transformPagePoint: (t) => t,
33
- isStatic: !1,
34
- reducedMotion: "never"
35
- });
31
+ const ze = typeof window < "u", Me = ze ? ke : X, ie = /* @__PURE__ */ O(null);
36
32
  function Se(t) {
37
33
  return typeof t == "object" && t !== null;
38
34
  }
39
35
  function qe(t) {
40
36
  return Se(t) && "offsetHeight" in t;
41
37
  }
42
- class Le extends F.Component {
43
- getSnapshotBeforeUpdate(i) {
38
+ const Le = O({
39
+ transformPagePoint: (t) => t,
40
+ isStatic: !1,
41
+ reducedMotion: "never"
42
+ });
43
+ class $e extends F.Component {
44
+ getSnapshotBeforeUpdate(r) {
44
45
  const s = this.props.childRef.current;
45
- if (s && i.isPresent && !this.props.isPresent) {
46
- const n = s.offsetParent, o = qe(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;
46
+ if (s && r.isPresent && !this.props.isPresent) {
47
+ const n = s.offsetParent, o = qe(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
48
+ a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = o - a.width - a.left;
48
49
  }
49
50
  return null;
50
51
  }
@@ -57,234 +58,236 @@ class Le extends F.Component {
57
58
  return this.props.children;
58
59
  }
59
60
  }
60
- function $e({ children: t, isPresent: i, anchorX: s }) {
61
- const n = Q(), o = N(null), r = N({
61
+ function Fe({ children: t, isPresent: r, anchorX: s, root: n }) {
62
+ const o = Q(), a = P(null), u = P({
62
63
  width: 0,
63
64
  height: 0,
64
65
  top: 0,
65
66
  left: 0,
66
67
  right: 0
67
- }), { nonce: f } = H(Me);
68
- return ke(() => {
69
- const { width: x, height: u, top: h, left: d, right: l } = r.current;
70
- if (i || !o.current || !x || !u)
68
+ }), { nonce: m } = H(Le);
69
+ return be(() => {
70
+ const { width: C, height: l, top: j, left: c, right: f } = u.current;
71
+ if (r || !a.current || !C || !l)
71
72
  return;
72
- const y = s === "left" ? `left: ${d}` : `right: ${l}`;
73
- o.current.dataset.motionPopId = n;
74
- const p = document.createElement("style");
75
- return f && (p.nonce = f), document.head.appendChild(p), p.sheet && p.sheet.insertRule(`
76
- [data-motion-pop-id="${n}"] {
73
+ const x = s === "left" ? `left: ${c}` : `right: ${f}`;
74
+ a.current.dataset.motionPopId = o;
75
+ const h = document.createElement("style");
76
+ m && (h.nonce = m);
77
+ const i = n ?? document.head;
78
+ return i.appendChild(h), h.sheet && h.sheet.insertRule(`
79
+ [data-motion-pop-id="${o}"] {
77
80
  position: absolute !important;
78
- width: ${x}px !important;
79
- height: ${u}px !important;
80
- ${y}px !important;
81
- top: ${h}px !important;
81
+ width: ${C}px !important;
82
+ height: ${l}px !important;
83
+ ${x}px !important;
84
+ top: ${j}px !important;
82
85
  }
83
86
  `), () => {
84
- document.head.contains(p) && document.head.removeChild(p);
87
+ i.removeChild(h), i.contains(h) && i.removeChild(h);
85
88
  };
86
- }, [i]), e.jsx(Le, { isPresent: i, childRef: o, sizeRef: r, children: F.cloneElement(t, { ref: o }) });
89
+ }, [r]), e.jsx($e, { isPresent: r, childRef: a, sizeRef: u, children: F.cloneElement(t, { ref: a }) });
87
90
  }
88
- const Fe = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: f, anchorX: x }) => {
89
- const u = ne(Oe), h = Q();
90
- let d = !0, l = $(() => (d = !1, {
91
- id: h,
92
- initial: i,
91
+ const Oe = ({ children: t, initial: r, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: a, mode: u, anchorX: m, root: C }) => {
92
+ const l = ne(Qe), j = Q();
93
+ let c = !0, f = $(() => (c = !1, {
94
+ id: j,
95
+ initial: r,
93
96
  isPresent: s,
94
97
  custom: o,
95
- onExitComplete: (y) => {
96
- u.set(y, !0);
97
- for (const p of u.values())
98
- if (!p)
98
+ onExitComplete: (x) => {
99
+ l.set(x, !0);
100
+ for (const h of l.values())
101
+ if (!h)
99
102
  return;
100
103
  n && n();
101
104
  },
102
- register: (y) => (u.set(y, !1), () => u.delete(y))
103
- }), [s, u, n]);
104
- return r && d && (l = { ...l }), $(() => {
105
- u.forEach((y, p) => u.set(p, !1));
105
+ register: (x) => (l.set(x, !1), () => l.delete(x))
106
+ }), [s, l, n]);
107
+ return a && c && (f = { ...f }), $(() => {
108
+ l.forEach((x, h) => l.set(h, !1));
106
109
  }, [s]), F.useEffect(() => {
107
- !s && !u.size && n && n();
108
- }, [s]), f === "popLayout" && (t = e.jsx($e, { isPresent: s, anchorX: x, children: t })), e.jsx(ie.Provider, { value: l, children: t });
110
+ !s && !l.size && n && n();
111
+ }, [s]), u === "popLayout" && (t = e.jsx(Fe, { isPresent: s, anchorX: m, root: C, children: t })), e.jsx(ie.Provider, { value: f, children: t });
109
112
  };
110
- function Oe() {
113
+ function Qe() {
111
114
  return /* @__PURE__ */ new Map();
112
115
  }
113
- function Qe(t = !0) {
114
- const i = H(ie);
115
- if (i === null)
116
+ function He(t = !0) {
117
+ const r = H(ie);
118
+ if (r === null)
116
119
  return [!0, null];
117
- const { isPresent: s, onExitComplete: n, register: o } = i, r = Q();
120
+ const { isPresent: s, onExitComplete: n, register: o } = r, a = Q();
118
121
  X(() => {
119
122
  if (t)
120
- return o(r);
123
+ return o(a);
121
124
  }, [t]);
122
- const f = be(() => t && n && n(r), [r, n, t]);
123
- return !s && n ? [!1, f] : [!0];
125
+ const u = Ee(() => t && n && n(a), [a, n, t]);
126
+ return !s && n ? [!1, u] : [!0];
124
127
  }
125
- const I = (t) => t.key || "";
128
+ const K = (t) => t.key || "";
126
129
  function U(t) {
127
- const i = [];
128
- return Ee.forEach(t, (s) => {
129
- Ne(s) && i.push(s);
130
- }), i;
130
+ const r = [];
131
+ return Ne.forEach(t, (s) => {
132
+ Pe(s) && r.push(s);
133
+ }), r;
131
134
  }
132
- const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: f = !1, anchorX: x = "left" }) => {
133
- const [u, h] = Qe(f), d = $(() => U(t), [t]), l = f && !u ? [] : d.map(I), y = N(!0), p = N(d), k = ne(() => /* @__PURE__ */ new Map()), [a, c] = P(d), [m, w] = P(d);
134
- ze(() => {
135
- y.current = !1, p.current = d;
136
- for (let v = 0; v < m.length; v++) {
137
- const g = I(m[v]);
138
- l.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
135
+ const _e = ({ children: t, custom: r, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: a = "sync", propagate: u = !1, anchorX: m = "left", root: C }) => {
136
+ const [l, j] = He(u), c = $(() => U(t), [t]), f = u && !l ? [] : c.map(K), x = P(!0), h = P(c), i = ne(() => /* @__PURE__ */ new Map()), [d, w] = D(c), [p, v] = D(c);
137
+ Me(() => {
138
+ x.current = !1, h.current = c;
139
+ for (let k = 0; k < p.length; k++) {
140
+ const y = K(p[k]);
141
+ f.includes(y) ? i.delete(y) : i.get(y) !== !0 && i.set(y, !1);
139
142
  }
140
- }, [m, l.length, l.join("-")]);
141
- const C = [];
142
- if (d !== a) {
143
- let v = [...d];
144
- for (let g = 0; g < m.length; g++) {
145
- const b = m[g], z = I(b);
146
- l.includes(z) || (v.splice(g, 0, b), C.push(b));
143
+ }, [p, f.length, f.join("-")]);
144
+ const E = [];
145
+ if (c !== d) {
146
+ let k = [...c];
147
+ for (let y = 0; y < p.length; y++) {
148
+ const b = p[y], z = K(b);
149
+ f.includes(z) || (k.splice(y, 0, b), E.push(b));
147
150
  }
148
- return r === "wait" && C.length && (v = C), w(U(v)), c(d), null;
151
+ return a === "wait" && E.length && (k = E), v(U(k)), w(c), null;
149
152
  }
150
- process.env.NODE_ENV !== "production" && r === "wait" && m.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: T } = H(Re);
152
- return e.jsx(e.Fragment, { children: m.map((v) => {
153
- const g = I(v), b = f && !u ? !1 : d === m || l.includes(g), z = () => {
154
- if (k.has(g))
155
- k.set(g, !0);
153
+ process.env.NODE_ENV !== "production" && a === "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.`);
154
+ const { forceRender: re } = H(Te);
155
+ return e.jsx(e.Fragment, { children: p.map((k) => {
156
+ const y = K(k), b = u && !l ? !1 : c === p || f.includes(y), z = () => {
157
+ if (i.has(y))
158
+ i.set(y, !0);
156
159
  else
157
160
  return;
158
161
  let _ = !0;
159
- k.forEach((re) => {
160
- re || (_ = !1);
161
- }), _ && (T?.(), w(p.current), f && h?.(), n && n());
162
+ i.forEach((ae) => {
163
+ ae || (_ = !1);
164
+ }), _ && (re?.(), v(h.current), u && j?.(), n && n());
162
165
  };
163
- return e.jsx(Fe, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : z, anchorX: x, children: v }, g);
166
+ return e.jsx(Oe, { isPresent: b, initial: !x.current || s ? void 0 : !1, custom: r, presenceAffectsLayout: o, mode: a, root: C, onExitComplete: b ? void 0 : z, anchorX: m, children: k }, y);
164
167
  }) });
165
- }, _e = ({ service: t }) => {
166
- const i = ge(), s = je(), [n, o] = P(
168
+ }, Be = ({ service: t }) => {
169
+ const r = je(), s = Ce(), [n, o] = D(
167
170
  null
168
- ), [r, f] = P(""), { data: x, isFetching: u } = Ce({
169
- queryFn: () => t.getConsumers(i),
171
+ ), [a, u] = D(""), { data: m, isFetching: C } = we({
172
+ queryFn: () => t.getConsumers(r),
170
173
  queryKey: ["api-keys"],
171
174
  retry: !1
172
- }), h = S({
175
+ }), l = S({
173
176
  mutationFn: ({
174
- consumerId: a,
175
- keyId: c
177
+ consumerId: i,
178
+ keyId: d
176
179
  }) => {
177
180
  if (!t.deleteKey)
178
181
  throw new Error("deleteKey not implemented");
179
- return t.deleteKey(a, c, i);
182
+ return t.deleteKey(i, d, r);
180
183
  },
181
- onMutate: async ({ consumerId: a, keyId: c }) => {
184
+ onMutate: async ({ consumerId: i, keyId: d }) => {
182
185
  await s.cancelQueries({ queryKey: ["api-keys"] });
183
- const m = s.getQueryData([
186
+ const w = s.getQueryData([
184
187
  "api-keys"
185
188
  ]);
186
- return s.setQueryData(["api-keys"], (w) => w && w.map((C) => C.id === a ? {
187
- ...C,
188
- apiKeys: C.apiKeys.filter((T) => T.id !== c)
189
- } : C)), { previousData: m };
189
+ return s.setQueryData(["api-keys"], (p) => p && p.map((v) => v.id === i ? {
190
+ ...v,
191
+ apiKeys: v.apiKeys.filter((E) => E.id !== d)
192
+ } : v)), { previousData: w };
190
193
  },
191
- onError: (a, c, m) => {
192
- m?.previousData && s.setQueryData(["api-keys"], m.previousData);
194
+ onError: (i, d, w) => {
195
+ w?.previousData && s.setQueryData(["api-keys"], w.previousData);
193
196
  },
194
197
  onSuccess: () => {
195
198
  s.invalidateQueries({ queryKey: ["api-keys"] });
196
199
  }
197
- }), d = S({
200
+ }), j = S({
198
201
  mutationFn: ({
199
- consumerId: a,
200
- label: c
202
+ consumerId: i,
203
+ label: d
201
204
  }) => {
202
205
  if (!t.updateConsumer)
203
206
  throw new Error("updateConsumer not implemented");
204
- return t.updateConsumer({ id: a, label: c }, i);
207
+ return t.updateConsumer({ id: i, label: d }, r);
205
208
  },
206
- onMutate: async ({ consumerId: a, label: c }) => {
209
+ onMutate: async ({ consumerId: i, label: d }) => {
207
210
  await s.cancelQueries({ queryKey: ["api-keys"] });
208
- const m = s.getQueryData(["api-keys"]);
209
- return s.setQueryData(["api-keys"], (w) => w && w.map((C) => C.id === a ? {
210
- ...C,
211
- label: c
212
- } : C)), { previousData: m };
211
+ const w = s.getQueryData(["api-keys"]);
212
+ return s.setQueryData(["api-keys"], (p) => p && p.map((v) => v.id === i ? {
213
+ ...v,
214
+ label: d
215
+ } : v)), { previousData: w };
213
216
  },
214
- onError: (a, c, m) => {
215
- m?.previousData && s.setQueryData(["api-keys"], m.previousData);
217
+ onError: (i, d, w) => {
218
+ w?.previousData && s.setQueryData(["api-keys"], w.previousData);
216
219
  },
217
220
  onSuccess: () => {
218
221
  s.invalidateQueries({ queryKey: ["api-keys"] });
219
222
  }
220
- }), l = S({
221
- mutationFn: (a) => {
223
+ }), c = S({
224
+ mutationFn: (i) => {
222
225
  if (!t.rollKey)
223
226
  throw new Error("rollKey not implemented");
224
- return t.rollKey(a, i);
227
+ return t.rollKey(i, r);
225
228
  },
226
229
  onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
227
- }), y = (a, c) => {
228
- o(a), f(c);
229
- }, p = (a) => {
230
- r.trim() && d.mutate({
231
- consumerId: a,
232
- label: r.trim()
233
- }), o(null), f("");
234
- }, k = () => {
235
- o(null), f("");
230
+ }), f = (i, d) => {
231
+ o(i), u(d);
232
+ }, x = (i) => {
233
+ a.trim() && j.mutate({
234
+ consumerId: i,
235
+ label: a.trim()
236
+ }), o(null), u("");
237
+ }, h = () => {
238
+ o(null), u("");
236
239
  };
237
240
  return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
238
241
  /* @__PURE__ */ e.jsx(B.Target, { name: "api-keys-list-page" }),
239
242
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
240
243
  /* @__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(J, { to: "/settings/api-keys/new", children: "Create API Key" }) })
244
+ t.createKey && /* @__PURE__ */ e.jsx(g, { asChild: !0, children: /* @__PURE__ */ e.jsx(J, { to: "/settings/api-keys/new", children: "Create API Key" }) })
242
245
  ] }),
243
246
  /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
244
247
  /* @__PURE__ */ e.jsx(B.Target, { name: "api-keys-list-page-before-keys" }),
245
248
  /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
246
- l.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
249
+ c.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
247
250
  /* @__PURE__ */ e.jsx(M, { size: 16 }),
248
- /* @__PURE__ */ e.jsx(L, { children: l.error.message })
251
+ /* @__PURE__ */ e.jsx(L, { children: c.error.message })
249
252
  ] }),
250
- d.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
253
+ j.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
251
254
  /* @__PURE__ */ e.jsx(M, { size: 16 }),
252
- /* @__PURE__ */ e.jsx(L, { children: d.error.message })
255
+ /* @__PURE__ */ e.jsx(L, { children: j.error.message })
253
256
  ] }),
254
- h.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
257
+ l.isError && /* @__PURE__ */ e.jsxs(q, { variant: "destructive", className: "mb-4", children: [
255
258
  /* @__PURE__ */ e.jsx(M, { size: 16 }),
256
- /* @__PURE__ */ e.jsx(L, { children: h.error.message })
259
+ /* @__PURE__ */ e.jsx(L, { children: l.error.message })
257
260
  ] }),
258
- /* @__PURE__ */ e.jsx("div", { className: "", children: x.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: [
261
+ /* @__PURE__ */ e.jsx("div", { className: "", 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: [
259
262
  /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
260
263
  "You have no API keys yet.",
261
264
  /* @__PURE__ */ e.jsx("br", {}),
262
265
  t.createKey && "Get started and create your first key."
263
266
  ] }),
264
- t.createKey && /* @__PURE__ */ e.jsx(j, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(J, { to: "/settings/api-keys/new", children: "Create API Key" }) })
267
+ t.createKey && /* @__PURE__ */ e.jsx(g, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(J, { to: "/settings/api-keys/new", children: "Create API Key" }) })
265
268
  ] }) : /* @__PURE__ */ e.jsx(
266
269
  "ul",
267
270
  {
268
- className: E(
271
+ className: N(
269
272
  "grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
270
273
  ),
271
- children: x.map((a) => /* @__PURE__ */ e.jsxs(
272
- Pe,
274
+ children: m.map((i) => /* @__PURE__ */ e.jsxs(
275
+ De,
273
276
  {
274
277
  className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
275
278
  children: [
276
- /* @__PURE__ */ e.jsxs(De, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
279
+ /* @__PURE__ */ e.jsxs(Ie, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
277
280
  /* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
278
281
  /* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
279
- n === a.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
282
+ n === i.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
280
283
  /* @__PURE__ */ e.jsx(
281
- Ie,
284
+ Ke,
282
285
  {
283
286
  maxLength: 32,
284
- value: r,
285
- onChange: (c) => f(c.target.value),
286
- onKeyDown: (c) => {
287
- c.key === "Enter" ? p(a.id) : c.key === "Escape" && k();
287
+ value: a,
288
+ onChange: (d) => u(d.target.value),
289
+ onKeyDown: (d) => {
290
+ d.key === "Enter" ? x(i.id) : d.key === "Escape" && h();
288
291
  },
289
292
  className: "text-lg font-medium",
290
293
  autoFocus: !0
@@ -292,72 +295,72 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
292
295
  ),
293
296
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
294
297
  /* @__PURE__ */ e.jsx(
295
- j,
298
+ g,
296
299
  {
297
300
  size: "icon",
298
301
  variant: "ghost",
299
- onClick: () => p(a.id),
300
- disabled: !r.trim(),
302
+ onClick: () => x(i.id),
303
+ disabled: !a.trim(),
301
304
  children: /* @__PURE__ */ e.jsx(W, { size: 16 })
302
305
  }
303
306
  ),
304
307
  /* @__PURE__ */ e.jsx(
305
- j,
308
+ g,
306
309
  {
307
310
  size: "icon",
308
311
  variant: "ghost",
309
- onClick: k,
310
- children: /* @__PURE__ */ e.jsx(ae, { size: 16 })
312
+ onClick: h,
313
+ children: /* @__PURE__ */ e.jsx(oe, { size: 16 })
311
314
  }
312
315
  )
313
316
  ] })
314
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: a.label }),
315
- /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: a.createdOn })
317
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: i.label }),
318
+ /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: i.createdOn })
316
319
  ] }),
317
320
  /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
318
- a.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
321
+ i.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
319
322
  "Created on",
320
323
  " ",
321
- new Date(a.createdOn).toLocaleDateString()
324
+ new Date(i.createdOn).toLocaleDateString()
322
325
  ] }),
323
- a.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
326
+ i.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
324
327
  "Expires on",
325
328
  " ",
326
- new Date(a.expiresOn).toLocaleDateString()
329
+ new Date(i.expiresOn).toLocaleDateString()
327
330
  ] })
328
331
  ] })
329
332
  ] }),
330
333
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
331
334
  t.updateConsumer && /* @__PURE__ */ e.jsxs(
332
- j,
335
+ g,
333
336
  {
334
337
  variant: "ghost",
335
- onClick: () => y(a.id, a.label),
336
- className: E(
338
+ onClick: () => f(i.id, i.label),
339
+ className: N(
337
340
  "flex gap-2",
338
- n === a.id && "opacity-0! pointer-events-none"
341
+ n === i.id && "opacity-0! pointer-events-none"
339
342
  ),
340
- disabled: n === a.id,
343
+ disabled: n === i.id,
341
344
  children: [
342
- /* @__PURE__ */ e.jsx(oe, { size: 16 }),
345
+ /* @__PURE__ */ e.jsx(le, { size: 16 }),
343
346
  /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
344
347
  ]
345
348
  }
346
349
  ),
347
350
  t.rollKey && /* @__PURE__ */ e.jsxs(Y, { children: [
348
351
  /* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
349
- j,
352
+ g,
350
353
  {
351
354
  title: "Roll this key",
352
355
  variant: "ghost",
353
- disabled: l.isPending,
356
+ disabled: c.isPending,
354
357
  className: "flex items-center gap-2",
355
358
  children: [
356
359
  /* @__PURE__ */ e.jsx(
357
- le,
360
+ ce,
358
361
  {
359
362
  size: 16,
360
- className: l.isPending ? "animate-spin" : void 0
363
+ className: c.isPending ? "animate-spin" : void 0
361
364
  }
362
365
  ),
363
366
  /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
@@ -370,12 +373,12 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
370
373
  /* @__PURE__ */ e.jsx(te, { children: "Are you sure you want to roll this API key?" })
371
374
  ] }),
372
375
  /* @__PURE__ */ e.jsxs(se, { children: [
373
- /* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
374
- /* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(
375
- j,
376
+ /* @__PURE__ */ e.jsx(T, { asChild: !0, children: /* @__PURE__ */ e.jsx(g, { variant: "outline", children: "Cancel" }) }),
377
+ /* @__PURE__ */ e.jsx(T, { asChild: !0, children: /* @__PURE__ */ e.jsx(
378
+ g,
376
379
  {
377
380
  onClick: () => {
378
- l.mutate(a.id);
381
+ c.mutate(i.id);
379
382
  },
380
383
  children: "Roll Key"
381
384
  }
@@ -385,50 +388,50 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
385
388
  ] })
386
389
  ] })
387
390
  ] }),
388
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(He, { children: a.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(we.Fragment, { children: [
391
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(_e, { children: i.apiKeys.map((d) => /* @__PURE__ */ e.jsxs(ve.Fragment, { children: [
389
392
  /* @__PURE__ */ e.jsx(
390
- Je,
393
+ Ue,
391
394
  {
392
- apiKey: c,
395
+ apiKey: d,
393
396
  onDeleteKey: () => {
394
- h.mutate({
395
- consumerId: a.id,
396
- keyId: c.id
397
+ l.mutate({
398
+ consumerId: i.id,
399
+ keyId: d.id
397
400
  });
398
401
  },
399
- className: h.variables?.keyId === c.id && (h.isPending || u) ? "opacity-10!" : void 0
402
+ className: l.variables?.keyId === d.id && (l.isPending || C) ? "opacity-10!" : void 0
400
403
  }
401
404
  ),
402
405
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
403
- ] }, c.id)) }) })
406
+ ] }, d.id)) }) })
404
407
  ]
405
408
  },
406
- a.id
409
+ i.id
407
410
  ))
408
411
  }
409
412
  ) })
410
413
  ] });
411
- }, Be = (t) => {
412
- const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), o = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
414
+ }, Je = (t) => {
415
+ const r = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((r.getTime() - s.getTime()) / 1e3), o = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
413
416
  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");
414
- }, Je = ({
417
+ }, Ue = ({
415
418
  apiKey: t,
416
- onDeleteKey: i,
419
+ onDeleteKey: r,
417
420
  className: s
418
421
  }) => {
419
- const [n, o] = P(!1), [r, f] = Ke(), { key: x, createdOn: u, expiresOn: h } = t, d = h && new Date(h) < /* @__PURE__ */ new Date(), l = h ? Math.ceil(
420
- (new Date(h).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
421
- ) : 1 / 0, y = l <= 7 && !d;
422
- return /* @__PURE__ */ e.jsxs("div", { className: E("grid col-span-full grid-cols-subgrid p-6", s), children: [
422
+ const [n, o] = D(!1), [a, u] = Ae(), { key: m, createdOn: C, expiresOn: l } = t, j = l && new Date(l) < /* @__PURE__ */ new Date(), c = l ? Math.ceil(
423
+ (new Date(l).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
424
+ ) : 1 / 0, f = c <= 7 && !j;
425
+ return /* @__PURE__ */ e.jsxs("div", { className: N("grid col-span-full grid-cols-subgrid p-6", s), children: [
423
426
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
424
427
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1", children: [
425
428
  /* @__PURE__ */ e.jsxs("div", { className: "font-mono w-full h-9 items-center flex px-2 text-xs gap-2", children: [
426
429
  /* @__PURE__ */ e.jsx(
427
430
  "div",
428
431
  {
429
- className: E(
432
+ className: N(
430
433
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
431
- (y || d) && "bg-neutral-200"
434
+ (f || j) && "bg-neutral-200"
432
435
  )
433
436
  }
434
437
  ),
@@ -436,70 +439,70 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
436
439
  /* @__PURE__ */ e.jsx(
437
440
  "div",
438
441
  {
439
- className: E(
442
+ className: N(
440
443
  "w-40 inline-block md:w-full truncate",
441
444
  n ? "" : "opacity-20"
442
445
  ),
443
- children: n ? x.slice(0, -5) : "**** ".repeat(x.slice(0, -5).length / 5) + "*".repeat(x.slice(0, -5).length % 5)
446
+ children: n ? m.slice(0, -5) : "**** ".repeat(m.slice(0, -5).length / 5) + "*".repeat(m.slice(0, -5).length % 5)
444
447
  }
445
448
  ),
446
- /* @__PURE__ */ e.jsx("span", { children: x.slice(-5) })
449
+ /* @__PURE__ */ e.jsx("span", { children: m.slice(-5) })
447
450
  ] })
448
451
  ] }),
449
452
  /* @__PURE__ */ e.jsx(
450
- j,
453
+ g,
451
454
  {
452
455
  variant: "ghost",
453
- onClick: () => o((p) => !p),
456
+ onClick: () => o((x) => !x),
454
457
  size: "icon",
455
- children: n ? /* @__PURE__ */ e.jsx(ce, { size: 16 }) : /* @__PURE__ */ e.jsx(de, { size: 16 })
458
+ children: n ? /* @__PURE__ */ e.jsx(de, { size: 16 }) : /* @__PURE__ */ e.jsx(ue, { size: 16 })
456
459
  }
457
460
  ),
458
461
  /* @__PURE__ */ e.jsx(
459
- j,
462
+ g,
460
463
  {
461
464
  variant: "ghost",
462
- onClick: () => f(x),
465
+ onClick: () => u(m),
463
466
  size: "icon",
464
- children: r ? /* @__PURE__ */ e.jsx(W, { size: 16 }) : /* @__PURE__ */ e.jsx(ue, { size: 16 })
467
+ children: a ? /* @__PURE__ */ e.jsx(W, { size: 16 }) : /* @__PURE__ */ e.jsx(he, { size: 16 })
465
468
  }
466
469
  )
467
470
  ] }),
468
471
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
469
- u && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
472
+ C && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
470
473
  "Created ",
471
- Be(u),
474
+ Je(C),
472
475
  "."
473
476
  ] }),
474
477
  " ",
475
- h && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
478
+ l && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
476
479
  "Expires in ",
477
- l,
480
+ c,
478
481
  " ",
479
- l === 1 ? "day" : "days",
482
+ c === 1 ? "day" : "days",
480
483
  "."
481
484
  ] }),
482
- h && d && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
485
+ l && j && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
483
486
  "Expired",
484
487
  " ",
485
- l === 0 ? "today." : `${l * -1} days ago.`
488
+ c === 0 ? "today." : `${c * -1} days ago.`
486
489
  ] })
487
490
  ] })
488
491
  ] }),
489
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: h && i && /* @__PURE__ */ e.jsxs(Y, { children: [
490
- /* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(he, { size: 16 }) }) }),
492
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: l && r && /* @__PURE__ */ e.jsxs(Y, { children: [
493
+ /* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(g, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(fe, { size: 16 }) }) }),
491
494
  /* @__PURE__ */ e.jsxs(V, { children: [
492
495
  /* @__PURE__ */ e.jsxs(Z, { children: [
493
496
  /* @__PURE__ */ e.jsx(ee, { children: "Delete API Key" }),
494
497
  /* @__PURE__ */ e.jsx(te, { children: "Are you sure you want to delete this API key?" })
495
498
  ] }),
496
499
  /* @__PURE__ */ e.jsxs(se, { children: [
497
- /* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
498
- /* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(
499
- j,
500
+ /* @__PURE__ */ e.jsx(T, { asChild: !0, children: /* @__PURE__ */ e.jsx(g, { variant: "outline", children: "Cancel" }) }),
501
+ /* @__PURE__ */ e.jsx(T, { asChild: !0, children: /* @__PURE__ */ e.jsx(
502
+ g,
500
503
  {
501
504
  onClick: () => {
502
- i();
505
+ r();
503
506
  },
504
507
  children: "Delete"
505
508
  }
@@ -508,55 +511,55 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
508
511
  ] })
509
512
  ] }) })
510
513
  ] });
511
- }, K = "https://api.zuploedge.com/v2/client", Ue = async (t) => {
514
+ }, A = "https://api.zuploedge.com/v2/client", We = async (t) => {
512
515
  try {
513
516
  return await t.json();
514
517
  } catch {
515
518
  return;
516
519
  }
517
- }, A = async (t) => {
518
- const i = t.headers.get("content-type");
519
- if (!t.ok && i?.includes("application/problem+json")) {
520
- const s = await Ue(t);
520
+ }, R = async (t) => {
521
+ const r = t.headers.get("content-type");
522
+ if (!t.ok && r?.includes("application/problem+json")) {
523
+ const s = await We(t);
521
524
  if (s.type && s.title)
522
525
  throw new Error(s.detail ?? s.title);
523
526
  }
524
- }, We = (t) => ({
525
- deleteKey: async (i, s, n) => {
527
+ }, Xe = (t) => ({
528
+ deleteKey: async (r, s, n) => {
526
529
  const o = new Request(
527
- K + `/${t}/consumers/${i}/keys/${s}`,
530
+ A + `/${t}/consumers/${r}/keys/${s}`,
528
531
  {
529
532
  method: "DELETE"
530
533
  }
531
534
  );
532
535
  await n.signRequest(o);
533
- const r = await fetch(o);
534
- await A(r), D(r.ok, "Failed to delete API key");
536
+ const a = await fetch(o);
537
+ await R(a), I(a.ok, "Failed to delete API key");
535
538
  },
536
- updateConsumer: async (i, s) => {
539
+ updateConsumer: async (r, s) => {
537
540
  const n = await fetch(
538
541
  await s.signRequest(
539
542
  new Request(
540
- K + `/${t}/consumers/${i.id}`,
543
+ A + `/${t}/consumers/${r.id}`,
541
544
  {
542
545
  method: "PATCH",
543
546
  headers: {
544
547
  "Content-Type": "application/json"
545
548
  },
546
549
  body: JSON.stringify({
547
- label: i.label
550
+ label: r.label
548
551
  })
549
552
  }
550
553
  )
551
554
  )
552
555
  );
553
- await A(n), D(n.ok, "Failed to update API key description");
556
+ await R(n), I(n.ok, "Failed to update API key description");
554
557
  },
555
- rollKey: async (i, s) => {
558
+ rollKey: async (r, s) => {
556
559
  const n = await fetch(
557
560
  await s.signRequest(
558
561
  new Request(
559
- K + `/${t}/consumers/${i}/roll-key`,
562
+ A + `/${t}/consumers/${r}/roll-key`,
560
563
  {
561
564
  method: "POST",
562
565
  headers: {
@@ -567,39 +570,39 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
567
570
  )
568
571
  )
569
572
  );
570
- await A(n), D(n.ok, "Failed to delete API key");
573
+ await R(n), I(n.ok, "Failed to delete API key");
571
574
  },
572
- getConsumers: async (i) => {
575
+ getConsumers: async (r) => {
573
576
  const s = new Request(
574
- K + `/${t}/consumers`
577
+ A + `/${t}/consumers`
575
578
  );
576
- await i.signRequest(s);
579
+ await r.signRequest(s);
577
580
  const n = await fetch(s);
578
- return await A(n), D(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((r) => ({
579
- id: r.id,
580
- label: r.label || r.subject || "API Key",
581
- apiKeys: r.apiKeys.data,
582
- key: r.apiKeys.data.at(0)
581
+ return await R(n), I(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((a) => ({
582
+ id: a.id,
583
+ label: a.label || a.subject || "API Key",
584
+ apiKeys: a.apiKeys.data,
585
+ key: a.apiKeys.data.at(0)
583
586
  }));
584
587
  }
585
- }), ct = (t) => t, dt = (t) => {
586
- const i = "deploymentName" in t ? We(t.deploymentName) : t;
588
+ }), dt = (t) => t, ut = (t) => {
589
+ const r = "deploymentName" in t ? Xe(t.deploymentName) : t;
587
590
  return {
588
591
  getProfileMenuItems: () => [
589
592
  {
590
593
  label: "API Keys",
591
594
  path: "/settings/api-keys",
592
595
  category: "middle",
593
- icon: fe
596
+ icon: pe
594
597
  }
595
598
  ],
596
599
  getIdentities: async (s) => {
597
600
  try {
598
- return (await i.getConsumers(s)).map((o) => ({
599
- authorizeRequest: (r) => (r.headers.set(
601
+ return (await r.getConsumers(s)).map((o) => ({
602
+ authorizeRequest: (a) => (a.headers.set(
600
603
  "Authorization",
601
604
  `Bearer ${o.apiKeys.at(0)?.key}`
602
- ), r),
605
+ ), a),
603
606
  id: o.id,
604
607
  label: o.label
605
608
  }));
@@ -609,12 +612,12 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
609
612
  },
610
613
  getRoutes: () => [
611
614
  {
612
- element: /* @__PURE__ */ e.jsx(Ae, {}),
613
- errorElement: /* @__PURE__ */ e.jsx(me, {}),
615
+ element: /* @__PURE__ */ e.jsx(Re, {}),
616
+ errorElement: /* @__PURE__ */ e.jsx(xe, {}),
614
617
  children: [
615
618
  {
616
619
  path: "/settings/api-keys",
617
- element: /* @__PURE__ */ e.jsx(_e, { service: i })
620
+ element: /* @__PURE__ */ e.jsx(Be, { service: r })
618
621
  }
619
622
  // {
620
623
  // path: "/settings/api-keys/new",
@@ -626,7 +629,7 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
626
629
  };
627
630
  };
628
631
  export {
629
- dt as apiKeyPlugin,
630
- ct as createApiKeyService
632
+ ut as apiKeyPlugin,
633
+ dt as createApiKeyService
631
634
  };
632
635
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map