zudoku 0.54.2 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/app/main.d.ts +1 -1
  2. package/dist/app/main.js +1 -3
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/config/validators/InputNavigationSchema.d.ts +63 -63
  5. package/dist/config/validators/validate.d.ts +24 -15
  6. package/dist/config/validators/validate.js.map +1 -1
  7. package/dist/flat-config.d.ts +327 -0
  8. package/dist/lib/plugins/api-keys/CreateApiKey.js +9 -3
  9. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  10. package/dist/lib/plugins/api-keys/index.d.ts +9 -5
  11. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  12. package/dist/vite/shadcn-registry.d.ts +4 -4
  13. package/lib/{MdxPage-C6Ru5mfp.js → MdxPage-D1XC3kwu.js} +8 -8
  14. package/lib/{MdxPage-C6Ru5mfp.js.map → MdxPage-D1XC3kwu.js.map} +1 -1
  15. package/lib/{OAuthErrorPage-Dd0fl6Lh.js → OAuthErrorPage-CSYvzsNJ.js} +7 -7
  16. package/lib/{OAuthErrorPage-Dd0fl6Lh.js.map → OAuthErrorPage-CSYvzsNJ.js.map} +1 -1
  17. package/lib/{OasProvider-DNmLItHj.js → OasProvider-Ch3fGSNb.js} +3 -3
  18. package/lib/{OasProvider-DNmLItHj.js.map → OasProvider-Ch3fGSNb.js.map} +1 -1
  19. package/lib/{OperationList-BE_BNejn.js → OperationList-Boc5tg5n.js} +12 -12
  20. package/lib/{OperationList-BE_BNejn.js.map → OperationList-Boc5tg5n.js.map} +1 -1
  21. package/lib/{Pagination-29CJ3c2k.js → Pagination-DdqTabDR.js} +3 -3
  22. package/lib/{Pagination-29CJ3c2k.js.map → Pagination-DdqTabDR.js.map} +1 -1
  23. package/lib/{RouteGuard-0wPUKdxJ.js → RouteGuard-D17dUEM_.js} +4 -4
  24. package/lib/{RouteGuard-0wPUKdxJ.js.map → RouteGuard-D17dUEM_.js.map} +1 -1
  25. package/lib/{SchemaList-BTkZiol0.js → SchemaList-BbkMdqgT.js} +8 -8
  26. package/lib/{SchemaList-BTkZiol0.js.map → SchemaList-BbkMdqgT.js.map} +1 -1
  27. package/lib/{SchemaView-Bc5_uIbh.js → SchemaView-Bo48Qzuu.js} +4 -4
  28. package/lib/{SchemaView-Bc5_uIbh.js.map → SchemaView-Bo48Qzuu.js.map} +1 -1
  29. package/lib/{Select-DVKfV8Vb.js → Select-BgBGJ5cF.js} +3 -3
  30. package/lib/{Select-DVKfV8Vb.js.map → Select-BgBGJ5cF.js.map} +1 -1
  31. package/lib/{SignUp-DUmbxjcy.js → SignUp-ckLqfC6h.js} +4 -4
  32. package/lib/{SignUp-DUmbxjcy.js.map → SignUp-ckLqfC6h.js.map} +1 -1
  33. package/lib/{Slot-BahfuM5e.js → Slot-CkWazhCn.js} +6 -6
  34. package/lib/{Slot-BahfuM5e.js.map → Slot-CkWazhCn.js.map} +1 -1
  35. package/lib/{SyntaxHighlight-BaPoOBLD.js → SyntaxHighlight-DQ64ObSH.js} +2 -2
  36. package/lib/{SyntaxHighlight-BaPoOBLD.js.map → SyntaxHighlight-DQ64ObSH.js.map} +1 -1
  37. package/lib/{Toc-MF9YxB9B.js → Toc-cVDQRzE6.js} +2 -2
  38. package/lib/{Toc-MF9YxB9B.js.map → Toc-cVDQRzE6.js.map} +1 -1
  39. package/lib/{ZudokuContext-CLl5w57E.js → ZudokuContext-Coxa0DfE.js} +2 -2
  40. package/lib/{ZudokuContext-CLl5w57E.js.map → ZudokuContext-Coxa0DfE.js.map} +1 -1
  41. package/lib/{chunk-QMGIS6GS-CEOk3lro.js → chunk-QMGIS6GS-CdEm9pzB.js} +6 -6
  42. package/lib/{chunk-QMGIS6GS-CEOk3lro.js.map → chunk-QMGIS6GS-CdEm9pzB.js.map} +1 -1
  43. package/lib/{circular-Bv1c2Yd3.js → circular-CshZkiOV.js} +2 -2
  44. package/lib/{circular-Bv1c2Yd3.js.map → circular-CshZkiOV.js.map} +1 -1
  45. package/lib/{createServer-B4o75XI3.js → createServer-CHAS8ilN.js} +4 -4
  46. package/lib/{createServer-B4o75XI3.js.map → createServer-CHAS8ilN.js.map} +1 -1
  47. package/lib/{errors-7Pb4eZXa.js → errors-BQk2rSTP.js} +2 -2
  48. package/lib/{errors-7Pb4eZXa.js.map → errors-BQk2rSTP.js.map} +1 -1
  49. package/lib/{hook-DbUCLQNg.js → hook-DEPqwjke.js} +2 -2
  50. package/lib/{hook-DbUCLQNg.js.map → hook-DEPqwjke.js.map} +1 -1
  51. package/lib/{index-fHJ5WmM5.js → index-BB_X3XYb.js} +2 -2
  52. package/lib/{index-fHJ5WmM5.js.map → index-BB_X3XYb.js.map} +1 -1
  53. package/lib/{index-D_weJvKR.js → index-BIP4zJwn.js} +15 -15
  54. package/lib/{index-D_weJvKR.js.map → index-BIP4zJwn.js.map} +1 -1
  55. package/lib/{index-BqrVgyZ3.js → index-BruDSPOJ.js} +7 -7
  56. package/lib/{index-BqrVgyZ3.js.map → index-BruDSPOJ.js.map} +1 -1
  57. package/lib/ui/SyntaxHighlight.js +2 -2
  58. package/lib/useExposedProps-DUoV7MCU.js +113 -0
  59. package/lib/useExposedProps-DUoV7MCU.js.map +1 -0
  60. package/lib/zudoku.auth-auth0.js +1 -1
  61. package/lib/zudoku.auth-azureb2c.js +5 -5
  62. package/lib/zudoku.auth-clerk.js +2 -2
  63. package/lib/zudoku.auth-openid.js +5 -5
  64. package/lib/zudoku.auth-supabase.js +2 -2
  65. package/lib/zudoku.components.js +7 -7
  66. package/lib/zudoku.hooks.js +18 -19
  67. package/lib/zudoku.hooks.js.map +1 -1
  68. package/lib/zudoku.plugin-api-catalog.js +7 -7
  69. package/lib/zudoku.plugin-api-keys.js +189 -187
  70. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  71. package/lib/zudoku.plugin-custom-pages.js +1 -1
  72. package/lib/zudoku.plugin-markdown.js +1 -1
  73. package/lib/zudoku.plugin-openapi.js +4 -4
  74. package/lib/zudoku.plugin-redirect.js +1 -1
  75. package/lib/zudoku.plugin-search-pagefind.js +10 -10
  76. package/package.json +1 -1
  77. package/src/app/main.tsx +3 -6
  78. package/src/lib/plugins/api-keys/CreateApiKey.tsx +6 -3
  79. package/src/lib/plugins/api-keys/index.tsx +10 -4
  80. package/src/shiki/langs/vue-vine.js +1 -0
  81. package/lib/index-Bm35Tkgf.js +0 -107
  82. package/lib/index-Bm35Tkgf.js.map +0 -1
  83. package/lib/useExposedProps-KcgXHKeE.js +0 -9
  84. package/lib/useExposedProps-KcgXHKeE.js.map +0 -1
@@ -1,54 +1,55 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { CircleSlashIcon as F, CheckIcon as te, XIcon as ue, PencilLineIcon as he, RefreshCwIcon as fe, EyeOffIcon as pe, EyeIcon as me, CopyIcon as xe, TrashIcon as ye, KeyRoundIcon as ge } from "lucide-react";
3
- import { D as je, a as Y, R as Ce } from "./Slot-BahfuM5e.js";
4
- import { i as A } from "./invariant-Bm-FVUQE.js";
5
- import { O as ve, a as we, L as be } from "./chunk-QMGIS6GS-CEOk3lro.js";
6
- import { a as ke } from "./hook-DbUCLQNg.js";
7
- import { Button as x } from "./ui/Button.js";
8
- import { c as se, e as ne, b as Ne } from "./ZudokuContext-CLl5w57E.js";
9
- import { u as z, A as O, a as M, b as Ee, S as Ke, c as De, d as Ie, e as Pe, f as Ae, g as Z } from "./Select-DVKfV8Vb.js";
2
+ import { CircleSlashIcon as $, CheckIcon as te, XIcon as ue, PencilLineIcon as he, RefreshCwIcon as fe, EyeOffIcon as pe, EyeIcon as me, CopyIcon as xe, TrashIcon as ye, KeyRoundIcon as ge } from "lucide-react";
3
+ import { D as je, a as Y, R as Ce } from "./Slot-CkWazhCn.js";
4
+ import { i as P } from "./invariant-Bm-FVUQE.js";
5
+ import { O as ve, b as we, L as be } from "./chunk-QMGIS6GS-CdEm9pzB.js";
6
+ import { a as ke } from "./hook-DEPqwjke.js";
7
+ import { Button as y } from "./ui/Button.js";
8
+ import { c as se, e as ne, b as Ne } from "./ZudokuContext-Coxa0DfE.js";
9
+ import { u as z, A as O, a as M, b as Ee, S as Ke, c as De, d as Ie, e as Ae, f as Pe, g as Z } from "./Select-BgBGJ5cF.js";
10
10
  import * as _ from "react";
11
- import Re, { createContext as G, useRef as D, useLayoutEffect as Se, useEffect as ie, useId as J, useContext as U, useInsertionEffect as Te, useMemo as L, useCallback as ze, Children as Oe, isValidElement as Me, useState as K, forwardRef as qe } from "react";
12
- import { C as Fe, a as Le } from "./Card-CMDQUPM4.js";
13
- import { e as W, f as I, D as $, g as Q, a as B, c as H, b as V, d as re } from "./Dialog-u9Uz9sTt.js";
11
+ import Re, { createContext as G, useRef as D, useLayoutEffect as Se, useEffect as ie, useId as J, useContext as U, useInsertionEffect as Te, useMemo as F, useCallback as ze, Children as Oe, isValidElement as Me, useState as K, forwardRef as qe } from "react";
12
+ import { C as $e, a as Fe } from "./Card-CMDQUPM4.js";
13
+ import { e as W, f as I, D as L, g as Q, a as B, c as H, b as V, d as re } from "./Dialog-u9Uz9sTt.js";
14
14
  import { Input as ae } from "./ui/Input.js";
15
15
  import { c as N } from "./cn-dYga0KKN.js";
16
- import { u as $e } from "./CodeBlock-NFCmSWOK.js";
16
+ import { u as Le } from "./CodeBlock-NFCmSWOK.js";
17
17
  import { a as Qe } from "./index.esm-CdzlRw50.js";
18
18
  import { B as Be } from "./Button-B3o-2Xdf.js";
19
19
  import { S as He } from "./Spinner-mNLZ6awP.js";
20
- const Ve = () => {
20
+ import { useAuth as Ve } from "./zudoku.hooks.js";
21
+ const _e = () => {
21
22
  const t = ke();
22
23
  return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(ve, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
23
24
  "Please login first to view this page",
24
- /* @__PURE__ */ e.jsx(x, { onClick: () => t.login(), children: "Login" })
25
+ /* @__PURE__ */ e.jsx(y, { onClick: () => t.login(), children: "Login" })
25
26
  ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(je, { className: "max-w-[600px]", children: [
26
27
  "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
27
28
  /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
28
29
  "."
29
30
  ] }) });
30
- }, _e = G({});
31
+ }, Ge = G({});
31
32
  function oe(t) {
32
33
  const i = D(null);
33
34
  return i.current === null && (i.current = t()), i.current;
34
35
  }
35
- const Ge = typeof window < "u", Je = Ge ? Se : ie, le = /* @__PURE__ */ G(null);
36
- function Ue(t) {
36
+ const Je = typeof window < "u", Ue = Je ? Se : ie, le = /* @__PURE__ */ G(null);
37
+ function We(t) {
37
38
  return typeof t == "object" && t !== null;
38
39
  }
39
- function We(t) {
40
- return Ue(t) && "offsetHeight" in t;
40
+ function Xe(t) {
41
+ return We(t) && "offsetHeight" in t;
41
42
  }
42
- const Xe = G({
43
+ const Ye = G({
43
44
  transformPagePoint: (t) => t,
44
45
  isStatic: !1,
45
46
  reducedMotion: "never"
46
47
  });
47
- class Ye extends _.Component {
48
+ class Ze extends _.Component {
48
49
  getSnapshotBeforeUpdate(i) {
49
50
  const s = this.props.childRef.current;
50
51
  if (s && i.isPresent && !this.props.isPresent) {
51
- const n = s.offsetParent, r = We(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
52
+ const n = s.offsetParent, r = Xe(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
52
53
  a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = r - a.width - a.left;
53
54
  }
54
55
  return null;
@@ -62,62 +63,62 @@ class Ye extends _.Component {
62
63
  return this.props.children;
63
64
  }
64
65
  }
65
- function Ze({ children: t, isPresent: i, anchorX: s, root: n }) {
66
- const r = J(), a = D(null), l = D({
66
+ function et({ children: t, isPresent: i, anchorX: s, root: n }) {
67
+ const r = J(), a = D(null), c = D({
67
68
  width: 0,
68
69
  height: 0,
69
70
  top: 0,
70
71
  left: 0,
71
72
  right: 0
72
- }), { nonce: h } = U(Xe);
73
+ }), { nonce: f } = U(Ye);
73
74
  return Te(() => {
74
- const { width: y, height: d, top: C, left: u, right: f } = l.current;
75
- if (i || !a.current || !y || !d)
75
+ const { width: h, height: d, top: g, left: u, right: p } = c.current;
76
+ if (i || !a.current || !h || !d)
76
77
  return;
77
- const p = s === "left" ? `left: ${u}` : `right: ${f}`;
78
+ const m = s === "left" ? `left: ${u}` : `right: ${p}`;
78
79
  a.current.dataset.motionPopId = r;
79
- const m = document.createElement("style");
80
- h && (m.nonce = h);
81
- const g = n ?? document.head;
82
- return g.appendChild(m), m.sheet && m.sheet.insertRule(`
80
+ const x = document.createElement("style");
81
+ f && (x.nonce = f);
82
+ const j = n ?? document.head;
83
+ return j.appendChild(x), x.sheet && x.sheet.insertRule(`
83
84
  [data-motion-pop-id="${r}"] {
84
85
  position: absolute !important;
85
- width: ${y}px !important;
86
+ width: ${h}px !important;
86
87
  height: ${d}px !important;
87
- ${p}px !important;
88
- top: ${C}px !important;
88
+ ${m}px !important;
89
+ top: ${g}px !important;
89
90
  }
90
91
  `), () => {
91
- g.removeChild(m), g.contains(m) && g.removeChild(m);
92
+ j.removeChild(x), j.contains(x) && j.removeChild(x);
92
93
  };
93
- }, [i]), e.jsx(Ye, { isPresent: i, childRef: a, sizeRef: l, children: _.cloneElement(t, { ref: a }) });
94
+ }, [i]), e.jsx(Ze, { isPresent: i, childRef: a, sizeRef: c, children: _.cloneElement(t, { ref: a }) });
94
95
  }
95
- const et = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: l, anchorX: h, root: y }) => {
96
- const d = oe(tt), C = J();
97
- let u = !0, f = L(() => (u = !1, {
98
- id: C,
96
+ const tt = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: c, anchorX: f, root: h }) => {
97
+ const d = oe(st), g = J();
98
+ let u = !0, p = F(() => (u = !1, {
99
+ id: g,
99
100
  initial: i,
100
101
  isPresent: s,
101
102
  custom: r,
102
- onExitComplete: (p) => {
103
- d.set(p, !0);
104
- for (const m of d.values())
105
- if (!m)
103
+ onExitComplete: (m) => {
104
+ d.set(m, !0);
105
+ for (const x of d.values())
106
+ if (!x)
106
107
  return;
107
108
  n && n();
108
109
  },
109
- register: (p) => (d.set(p, !1), () => d.delete(p))
110
+ register: (m) => (d.set(m, !1), () => d.delete(m))
110
111
  }), [s, d, n]);
111
- return a && u && (f = { ...f }), L(() => {
112
- d.forEach((p, m) => d.set(m, !1));
112
+ return a && u && (p = { ...p }), F(() => {
113
+ d.forEach((m, x) => d.set(x, !1));
113
114
  }, [s]), _.useEffect(() => {
114
115
  !s && !d.size && n && n();
115
- }, [s]), l === "popLayout" && (t = e.jsx(Ze, { isPresent: s, anchorX: h, root: y, children: t })), e.jsx(le.Provider, { value: f, children: t });
116
+ }, [s]), c === "popLayout" && (t = e.jsx(et, { isPresent: s, anchorX: f, root: h, children: t })), e.jsx(le.Provider, { value: p, children: t });
116
117
  };
117
- function tt() {
118
+ function st() {
118
119
  return /* @__PURE__ */ new Map();
119
120
  }
120
- function st(t = !0) {
121
+ function nt(t = !0) {
121
122
  const i = U(le);
122
123
  if (i === null)
123
124
  return [!0, null];
@@ -126,8 +127,8 @@ function st(t = !0) {
126
127
  if (t)
127
128
  return r(a);
128
129
  }, [t]);
129
- const l = ze(() => t && n && n(a), [a, n, t]);
130
- return !s && n ? [!1, l] : [!0];
130
+ const c = ze(() => t && n && n(a), [a, n, t]);
131
+ return !s && n ? [!1, c] : [!0];
131
132
  }
132
133
  const R = (t) => t.key || "";
133
134
  function ee(t) {
@@ -136,38 +137,38 @@ function ee(t) {
136
137
  Me(s) && i.push(s);
137
138
  }), i;
138
139
  }
139
- const nt = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: l = !1, anchorX: h = "left", root: y }) => {
140
- const [d, C] = st(l), u = L(() => ee(t), [t]), f = l && !d ? [] : u.map(R), p = D(!0), m = D(u), g = oe(() => /* @__PURE__ */ new Map()), [P, o] = K(u), [c, v] = K(u);
141
- Je(() => {
142
- p.current = !1, m.current = u;
143
- for (let w = 0; w < c.length; w++) {
144
- const j = R(c[w]);
145
- f.includes(j) ? g.delete(j) : g.get(j) !== !0 && g.set(j, !1);
140
+ const it = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: c = !1, anchorX: f = "left", root: h }) => {
141
+ const [d, g] = nt(c), u = F(() => ee(t), [t]), p = c && !d ? [] : u.map(R), m = D(!0), x = D(u), j = oe(() => /* @__PURE__ */ new Map()), [A, o] = K(u), [l, v] = K(u);
142
+ Ue(() => {
143
+ m.current = !1, x.current = u;
144
+ for (let w = 0; w < l.length; w++) {
145
+ const C = R(l[w]);
146
+ p.includes(C) ? j.delete(C) : j.get(C) !== !0 && j.set(C, !1);
146
147
  }
147
- }, [c, f.length, f.join("-")]);
148
+ }, [l, p.length, p.join("-")]);
148
149
  const b = [];
149
- if (u !== P) {
150
+ if (u !== A) {
150
151
  let w = [...u];
151
- for (let j = 0; j < c.length; j++) {
152
- const E = c[j], q = R(E);
153
- f.includes(q) || (w.splice(j, 0, E), b.push(E));
152
+ for (let C = 0; C < l.length; C++) {
153
+ const E = l[C], q = R(E);
154
+ p.includes(q) || (w.splice(C, 0, E), b.push(E));
154
155
  }
155
156
  return a === "wait" && b.length && (w = b), v(ee(w)), o(u), null;
156
157
  }
157
- process.env.NODE_ENV !== "production" && a === "wait" && c.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.`);
158
- const { forceRender: k } = U(_e);
159
- return e.jsx(e.Fragment, { children: c.map((w) => {
160
- const j = R(w), E = l && !d ? !1 : u === c || f.includes(j), q = () => {
161
- if (g.has(j))
162
- g.set(j, !0);
158
+ process.env.NODE_ENV !== "production" && a === "wait" && l.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.`);
159
+ const { forceRender: k } = U(Ge);
160
+ return e.jsx(e.Fragment, { children: l.map((w) => {
161
+ const C = R(w), E = c && !d ? !1 : u === l || p.includes(C), q = () => {
162
+ if (j.has(C))
163
+ j.set(C, !0);
163
164
  else
164
165
  return;
165
166
  let X = !0;
166
- g.forEach((de) => {
167
+ j.forEach((de) => {
167
168
  de || (X = !1);
168
- }), X && (k?.(), v(m.current), l && C?.(), n && n());
169
+ }), X && (k?.(), v(x.current), c && g?.(), n && n());
169
170
  };
170
- return e.jsx(et, { isPresent: E, initial: !p.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: y, onExitComplete: E ? void 0 : q, anchorX: h, children: w }, j);
171
+ return e.jsx(tt, { isPresent: E, initial: !m.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: h, onExitComplete: E ? void 0 : q, anchorX: f, children: w }, C);
171
172
  }) });
172
173
  }, ce = qe(
173
174
  ({ isPending: t, children: i, className: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
@@ -185,7 +186,7 @@ const nt = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
185
186
  )
186
187
  );
187
188
  ce.displayName = "ActionButton";
188
- const it = ({
189
+ const rt = ({
189
190
  service: t,
190
191
  onOpenChange: i
191
192
  }) => {
@@ -193,18 +194,19 @@ const it = ({
193
194
  defaultValues: {
194
195
  expiresOn: "30"
195
196
  }
196
- }), l = z({
197
- mutationFn: ({ description: h, expiresOn: y }) => {
197
+ }), c = Ve(), f = z({
198
+ mutationFn: ({ description: h, expiresOn: d }) => {
198
199
  if (!t.createKey)
199
200
  throw new Error("createKey not implemented");
200
- const d = y !== "never" ? rt(Number(y)) : void 0;
201
- return t.createKey(
202
- {
201
+ const g = d !== "never" ? at(Number(d)) : void 0;
202
+ return t.createKey({
203
+ apiKey: {
203
204
  description: h || "Secret Key",
204
- expiresOn: d
205
+ expiresOn: g
205
206
  },
206
- s
207
- );
207
+ context: s,
208
+ auth: c
209
+ });
208
210
  },
209
211
  onSuccess: async () => {
210
212
  await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
@@ -214,7 +216,7 @@ const it = ({
214
216
  "form",
215
217
  {
216
218
  onSubmit: a.handleSubmit(
217
- (h) => l.mutate(
219
+ (h) => f.mutate(
218
220
  { ...h },
219
221
  {
220
222
  onSuccess: () => i(!1)
@@ -222,9 +224,9 @@ const it = ({
222
224
  )
223
225
  ),
224
226
  children: [
225
- l.error && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
227
+ f.error && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
226
228
  /* @__PURE__ */ e.jsx(M, { children: "Error" }),
227
- /* @__PURE__ */ e.jsx(Ee, { children: l.error.message })
229
+ /* @__PURE__ */ e.jsx(Ee, { children: f.error.message })
228
230
  ] }),
229
231
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
230
232
  "Name",
@@ -237,7 +239,7 @@ const it = ({
237
239
  defaultValue: a.getValues("expiresOn"),
238
240
  children: [
239
241
  /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(Ie, {}) }),
240
- /* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsxs(Ae, { children: [
242
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Pe, { children: [
241
243
  [7, 30, 60, 90].map((h) => /* @__PURE__ */ e.jsxs(Z, { value: String(h), children: [
242
244
  h,
243
245
  " days"
@@ -248,87 +250,87 @@ const it = ({
248
250
  }
249
251
  ),
250
252
  /* @__PURE__ */ e.jsxs(W, { children: [
251
- /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
252
- /* @__PURE__ */ e.jsx(ce, { isPending: l.isPending, children: "Generate Key" })
253
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
254
+ /* @__PURE__ */ e.jsx(ce, { isPending: f.isPending, children: "Generate Key" })
253
255
  ] })
254
256
  ] })
255
257
  ]
256
258
  }
257
259
  ) : null;
258
- }, rt = (t) => {
260
+ }, at = (t) => {
259
261
  const i = /* @__PURE__ */ new Date();
260
262
  return i.setDate(i.getDate() + t), i.toISOString();
261
- }, at = ({ service: t }) => {
263
+ }, ot = ({ service: t }) => {
262
264
  const i = se(), s = ne(), [n, r] = K(
263
265
  null
264
- ), [a, l] = K(""), { data: h, isFetching: y } = Ne({
266
+ ), [a, c] = K(""), { data: f, isFetching: h } = Ne({
265
267
  queryFn: () => t.getConsumers(i),
266
268
  queryKey: ["api-keys"],
267
269
  retry: !1
268
- }), [d, C] = K(!1), u = z({
270
+ }), [d, g] = K(!1), u = z({
269
271
  mutationFn: ({
270
272
  consumerId: o,
271
- keyId: c
273
+ keyId: l
272
274
  }) => {
273
275
  if (!t.deleteKey)
274
276
  throw new Error("deleteKey not implemented");
275
- return t.deleteKey(o, c, i);
277
+ return t.deleteKey(o, l, i);
276
278
  },
277
- onMutate: async ({ consumerId: o, keyId: c }) => {
279
+ onMutate: async ({ consumerId: o, keyId: l }) => {
278
280
  await s.cancelQueries({ queryKey: ["api-keys"] });
279
281
  const v = s.getQueryData([
280
282
  "api-keys"
281
283
  ]);
282
284
  return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
283
285
  ...k,
284
- apiKeys: k.apiKeys.filter((w) => w.id !== c)
286
+ apiKeys: k.apiKeys.filter((w) => w.id !== l)
285
287
  } : k)), { previousData: v };
286
288
  },
287
- onError: (o, c, v) => {
289
+ onError: (o, l, v) => {
288
290
  v?.previousData && s.setQueryData(["api-keys"], v.previousData);
289
291
  },
290
292
  onSuccess: () => {
291
293
  s.invalidateQueries({ queryKey: ["api-keys"] });
292
294
  }
293
- }), f = z({
295
+ }), p = z({
294
296
  mutationFn: ({
295
297
  consumerId: o,
296
- label: c
298
+ label: l
297
299
  }) => {
298
300
  if (!t.updateConsumer)
299
301
  throw new Error("updateConsumer not implemented");
300
- return t.updateConsumer({ id: o, label: c }, i);
302
+ return t.updateConsumer({ id: o, label: l }, i);
301
303
  },
302
- onMutate: async ({ consumerId: o, label: c }) => {
304
+ onMutate: async ({ consumerId: o, label: l }) => {
303
305
  await s.cancelQueries({ queryKey: ["api-keys"] });
304
306
  const v = s.getQueryData(["api-keys"]);
305
307
  return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
306
308
  ...k,
307
- label: c
309
+ label: l
308
310
  } : k)), { previousData: v };
309
311
  },
310
- onError: (o, c, v) => {
312
+ onError: (o, l, v) => {
311
313
  v?.previousData && s.setQueryData(["api-keys"], v.previousData);
312
314
  },
313
315
  onSuccess: () => {
314
316
  s.invalidateQueries({ queryKey: ["api-keys"] });
315
317
  }
316
- }), p = z({
318
+ }), m = z({
317
319
  mutationFn: (o) => {
318
320
  if (!t.rollKey)
319
321
  throw new Error("rollKey not implemented");
320
322
  return t.rollKey(o, i);
321
323
  },
322
324
  onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
323
- }), m = (o, c) => {
324
- r(o), l(c);
325
- }, g = (o) => {
326
- a.trim() && f.mutate({
325
+ }), x = (o, l) => {
326
+ r(o), c(l);
327
+ }, j = (o) => {
328
+ a.trim() && p.mutate({
327
329
  consumerId: o,
328
330
  label: a.trim()
329
- }), r(null), l("");
330
- }, P = () => {
331
- r(null), l("");
331
+ }), r(null), c("");
332
+ }, A = () => {
333
+ r(null), c("");
332
334
  };
333
335
  return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
334
336
  /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page" }),
@@ -338,19 +340,19 @@ const it = ({
338
340
  typeof t.createKey
339
341
  ] }),
340
342
  t.createKey && /* @__PURE__ */ e.jsxs(
341
- $,
343
+ L,
342
344
  {
343
345
  open: d,
344
- onOpenChange: C,
346
+ onOpenChange: g,
345
347
  children: [
346
- /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Create API Key" }) }),
348
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Create API Key" }) }),
347
349
  /* @__PURE__ */ e.jsxs(B, { children: [
348
350
  /* @__PURE__ */ e.jsx(H, { children: /* @__PURE__ */ e.jsx(V, { children: "Create API Key" }) }),
349
351
  /* @__PURE__ */ e.jsx(
350
- it,
352
+ rt,
351
353
  {
352
354
  service: t,
353
- onOpenChange: C
355
+ onOpenChange: g
354
356
  }
355
357
  )
356
358
  ] })
@@ -361,37 +363,37 @@ const it = ({
361
363
  /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
362
364
  /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
363
365
  /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
366
+ m.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
367
+ /* @__PURE__ */ e.jsx($, { size: 16 }),
368
+ /* @__PURE__ */ e.jsx(M, { children: m.error.message })
369
+ ] }),
364
370
  p.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
365
- /* @__PURE__ */ e.jsx(F, { size: 16 }),
371
+ /* @__PURE__ */ e.jsx($, { size: 16 }),
366
372
  /* @__PURE__ */ e.jsx(M, { children: p.error.message })
367
373
  ] }),
368
- f.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
369
- /* @__PURE__ */ e.jsx(F, { size: 16 }),
370
- /* @__PURE__ */ e.jsx(M, { children: f.error.message })
371
- ] }),
372
374
  u.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
373
- /* @__PURE__ */ e.jsx(F, { size: 16 }),
375
+ /* @__PURE__ */ e.jsx($, { size: 16 }),
374
376
  /* @__PURE__ */ e.jsx(M, { children: u.error.message })
375
377
  ] }),
376
- /* @__PURE__ */ e.jsx("div", { className: "", children: h.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: [
378
+ /* @__PURE__ */ e.jsx("div", { className: "", children: f.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: [
377
379
  /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
378
380
  "You have no API keys yet.",
379
381
  /* @__PURE__ */ e.jsx("br", {}),
380
382
  t.createKey && "Get started and create your first key."
381
383
  ] }),
382
- t.createKey && /* @__PURE__ */ e.jsx(x, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(be, { to: "/settings/api-keys/new", children: "Create API Key" }) })
384
+ t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(be, { to: "/settings/api-keys/new", children: "Create API Key" }) })
383
385
  ] }) : /* @__PURE__ */ e.jsx(
384
386
  "ul",
385
387
  {
386
388
  className: N(
387
389
  "grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
388
390
  ),
389
- children: h.map((o) => /* @__PURE__ */ e.jsxs(
390
- Fe,
391
+ children: f.map((o) => /* @__PURE__ */ e.jsxs(
392
+ $e,
391
393
  {
392
394
  className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
393
395
  children: [
394
- /* @__PURE__ */ e.jsxs(Le, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
396
+ /* @__PURE__ */ e.jsxs(Fe, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
395
397
  /* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
396
398
  /* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
397
399
  n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
@@ -400,9 +402,9 @@ const it = ({
400
402
  {
401
403
  maxLength: 32,
402
404
  value: a,
403
- onChange: (c) => l(c.target.value),
404
- onKeyDown: (c) => {
405
- c.key === "Enter" ? g(o.id) : c.key === "Escape" && P();
405
+ onChange: (l) => c(l.target.value),
406
+ onKeyDown: (l) => {
407
+ l.key === "Enter" ? j(o.id) : l.key === "Escape" && A();
406
408
  },
407
409
  className: "text-lg font-medium",
408
410
  autoFocus: !0
@@ -410,21 +412,21 @@ const it = ({
410
412
  ),
411
413
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
412
414
  /* @__PURE__ */ e.jsx(
413
- x,
415
+ y,
414
416
  {
415
417
  size: "icon",
416
418
  variant: "ghost",
417
- onClick: () => g(o.id),
419
+ onClick: () => j(o.id),
418
420
  disabled: !a.trim(),
419
421
  children: /* @__PURE__ */ e.jsx(te, { size: 16 })
420
422
  }
421
423
  ),
422
424
  /* @__PURE__ */ e.jsx(
423
- x,
425
+ y,
424
426
  {
425
427
  size: "icon",
426
428
  variant: "ghost",
427
- onClick: P,
429
+ onClick: A,
428
430
  children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
429
431
  }
430
432
  )
@@ -447,10 +449,10 @@ const it = ({
447
449
  ] }),
448
450
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
449
451
  t.updateConsumer && /* @__PURE__ */ e.jsxs(
450
- x,
452
+ y,
451
453
  {
452
454
  variant: "ghost",
453
- onClick: () => m(o.id, o.label),
455
+ onClick: () => x(o.id, o.label),
454
456
  className: N(
455
457
  "flex gap-2",
456
458
  n === o.id && "opacity-0! pointer-events-none"
@@ -462,20 +464,20 @@ const it = ({
462
464
  ]
463
465
  }
464
466
  ),
465
- t.rollKey && /* @__PURE__ */ e.jsxs($, { children: [
467
+ t.rollKey && /* @__PURE__ */ e.jsxs(L, { children: [
466
468
  /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
467
- x,
469
+ y,
468
470
  {
469
471
  title: "Roll this key",
470
472
  variant: "ghost",
471
- disabled: p.isPending,
473
+ disabled: m.isPending,
472
474
  className: "flex items-center gap-2",
473
475
  children: [
474
476
  /* @__PURE__ */ e.jsx(
475
477
  fe,
476
478
  {
477
479
  size: 16,
478
- className: p.isPending ? "animate-spin" : void 0
480
+ className: m.isPending ? "animate-spin" : void 0
479
481
  }
480
482
  ),
481
483
  /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
@@ -488,12 +490,12 @@ const it = ({
488
490
  /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to roll this API key?" })
489
491
  ] }),
490
492
  /* @__PURE__ */ e.jsxs(W, { children: [
491
- /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
493
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
492
494
  /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
493
- x,
495
+ y,
494
496
  {
495
497
  onClick: () => {
496
- p.mutate(o.id);
498
+ m.mutate(o.id);
497
499
  },
498
500
  children: "Roll Key"
499
501
  }
@@ -503,22 +505,22 @@ const it = ({
503
505
  ] })
504
506
  ] })
505
507
  ] }),
506
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(nt, { children: o.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(Re.Fragment, { children: [
508
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(it, { children: o.apiKeys.map((l) => /* @__PURE__ */ e.jsxs(Re.Fragment, { children: [
507
509
  /* @__PURE__ */ e.jsx(
508
- lt,
510
+ ct,
509
511
  {
510
- apiKey: c,
512
+ apiKey: l,
511
513
  onDeleteKey: () => {
512
514
  u.mutate({
513
515
  consumerId: o.id,
514
- keyId: c.id
516
+ keyId: l.id
515
517
  });
516
518
  },
517
- className: u.variables?.keyId === c.id && (u.isPending || y) ? "opacity-10!" : void 0
519
+ className: u.variables?.keyId === l.id && (u.isPending || h) ? "opacity-10!" : void 0
518
520
  }
519
521
  ),
520
522
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
521
- ] }, c.id)) }) })
523
+ ] }, l.id)) }) })
522
524
  ]
523
525
  },
524
526
  o.id
@@ -526,17 +528,17 @@ const it = ({
526
528
  }
527
529
  ) })
528
530
  ] });
529
- }, ot = (t) => {
531
+ }, lt = (t) => {
530
532
  const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
531
533
  return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
532
- }, lt = ({
534
+ }, ct = ({
533
535
  apiKey: t,
534
536
  onDeleteKey: i,
535
537
  className: s
536
538
  }) => {
537
- const [n, r] = K(!1), [a, l] = $e(), { key: h, createdOn: y, expiresOn: d } = t, C = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
539
+ const [n, r] = K(!1), [a, c] = Le(), { key: f, createdOn: h, expiresOn: d } = t, g = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
538
540
  (new Date(d).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
539
- ) : 1 / 0, f = u <= 7 && !C;
541
+ ) : 1 / 0, p = u <= 7 && !g;
540
542
  return /* @__PURE__ */ e.jsxs("div", { className: N("grid col-span-full grid-cols-subgrid p-6", s), children: [
541
543
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
542
544
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1", children: [
@@ -546,7 +548,7 @@ const it = ({
546
548
  {
547
549
  className: N(
548
550
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
549
- (f || C) && "bg-neutral-200"
551
+ (p || g) && "bg-neutral-200"
550
552
  )
551
553
  }
552
554
  ),
@@ -558,63 +560,63 @@ const it = ({
558
560
  "w-40 inline-block md:w-full truncate",
559
561
  n ? "" : "opacity-20"
560
562
  ),
561
- children: n ? h.slice(0, -5) : "**** ".repeat(h.slice(0, -5).length / 5) + "*".repeat(h.slice(0, -5).length % 5)
563
+ children: n ? f.slice(0, -5) : "**** ".repeat(f.slice(0, -5).length / 5) + "*".repeat(f.slice(0, -5).length % 5)
562
564
  }
563
565
  ),
564
- /* @__PURE__ */ e.jsx("span", { children: h.slice(-5) })
566
+ /* @__PURE__ */ e.jsx("span", { children: f.slice(-5) })
565
567
  ] })
566
568
  ] }),
567
569
  /* @__PURE__ */ e.jsx(
568
- x,
570
+ y,
569
571
  {
570
572
  variant: "ghost",
571
- onClick: () => r((p) => !p),
573
+ onClick: () => r((m) => !m),
572
574
  size: "icon",
573
575
  children: n ? /* @__PURE__ */ e.jsx(pe, { size: 16 }) : /* @__PURE__ */ e.jsx(me, { size: 16 })
574
576
  }
575
577
  ),
576
578
  /* @__PURE__ */ e.jsx(
577
- x,
579
+ y,
578
580
  {
579
581
  variant: "ghost",
580
- onClick: () => l(h),
582
+ onClick: () => c(f),
581
583
  size: "icon",
582
584
  children: a ? /* @__PURE__ */ e.jsx(te, { size: 16 }) : /* @__PURE__ */ e.jsx(xe, { size: 16 })
583
585
  }
584
586
  )
585
587
  ] }),
586
588
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
587
- y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
589
+ h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
588
590
  "Created ",
589
- ot(y),
591
+ lt(h),
590
592
  "."
591
593
  ] }),
592
594
  " ",
593
- d && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
595
+ d && p && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
594
596
  "Expires in ",
595
597
  u,
596
598
  " ",
597
599
  u === 1 ? "day" : "days",
598
600
  "."
599
601
  ] }),
600
- d && C && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
602
+ d && g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
601
603
  "Expired",
602
604
  " ",
603
605
  u === 0 ? "today." : `${u * -1} days ago.`
604
606
  ] })
605
607
  ] })
606
608
  ] }),
607
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs($, { children: [
608
- /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(ye, { size: 16 }) }) }),
609
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs(L, { children: [
610
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(ye, { size: 16 }) }) }),
609
611
  /* @__PURE__ */ e.jsxs(B, { children: [
610
612
  /* @__PURE__ */ e.jsxs(H, { children: [
611
613
  /* @__PURE__ */ e.jsx(V, { children: "Delete API Key" }),
612
614
  /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to delete this API key?" })
613
615
  ] }),
614
616
  /* @__PURE__ */ e.jsxs(W, { children: [
615
- /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
617
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
616
618
  /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
617
- x,
619
+ y,
618
620
  {
619
621
  onClick: () => {
620
622
  i();
@@ -626,7 +628,7 @@ const it = ({
626
628
  ] })
627
629
  ] }) })
628
630
  ] });
629
- }, S = "https://api.zuploedge.com/v2/client", ct = async (t) => {
631
+ }, S = "https://api.zuploedge.com/v2/client", dt = async (t) => {
630
632
  try {
631
633
  return await t.json();
632
634
  } catch {
@@ -635,11 +637,11 @@ const it = ({
635
637
  }, T = async (t) => {
636
638
  const i = t.headers.get("content-type");
637
639
  if (!t.ok && i?.includes("application/problem+json")) {
638
- const s = await ct(t);
640
+ const s = await dt(t);
639
641
  if (s.type && s.title)
640
642
  throw new Error(s.detail ?? s.title);
641
643
  }
642
- }, dt = (t, i) => ({
644
+ }, ut = (t, i) => ({
643
645
  deleteKey: async (s, n, r) => {
644
646
  const a = new Request(
645
647
  S + `/${t}/consumers/${s}/keys/${n}`,
@@ -648,8 +650,8 @@ const it = ({
648
650
  }
649
651
  );
650
652
  await r.signRequest(a);
651
- const l = await fetch(a);
652
- await T(l), A(l.ok, "Failed to delete API key");
653
+ const c = await fetch(a);
654
+ await T(c), P(c.ok, "Failed to delete API key");
653
655
  },
654
656
  updateConsumer: async (s, n) => {
655
657
  const r = await fetch(
@@ -668,7 +670,7 @@ const it = ({
668
670
  )
669
671
  )
670
672
  );
671
- await T(r), A(r.ok, "Failed to update API key description");
673
+ await T(r), P(r.ok, "Failed to update API key description");
672
674
  },
673
675
  rollKey: async (s, n) => {
674
676
  const r = await fetch(
@@ -685,7 +687,7 @@ const it = ({
685
687
  )
686
688
  )
687
689
  );
688
- await T(r), A(r.ok, "Failed to delete API key");
690
+ await T(r), P(r.ok, "Failed to delete API key");
689
691
  },
690
692
  getConsumers: async (s) => {
691
693
  const n = new Request(
@@ -693,16 +695,16 @@ const it = ({
693
695
  );
694
696
  await s.signRequest(n);
695
697
  const r = await fetch(n);
696
- return await T(r), A(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((l) => ({
697
- id: l.id,
698
- label: l.label || l.subject || "API Key",
699
- apiKeys: l.apiKeys.data,
700
- key: l.apiKeys.data.at(0)
698
+ return await T(r), P(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((c) => ({
699
+ id: c.id,
700
+ label: c.label || c.subject || "API Key",
701
+ apiKeys: c.apiKeys.data,
702
+ key: c.apiKeys.data.at(0)
701
703
  }));
702
704
  },
703
705
  ...i
704
- }), It = (t) => t, Pt = (t) => {
705
- const i = "deploymentName" in t ? dt(t.deploymentName, t) : t;
706
+ }), Pt = (t) => t, Rt = (t) => {
707
+ const i = "deploymentName" in t ? ut(t.deploymentName, t) : t;
706
708
  return {
707
709
  getProfileMenuItems: () => [
708
710
  {
@@ -728,12 +730,12 @@ const it = ({
728
730
  },
729
731
  getRoutes: () => [
730
732
  {
731
- element: /* @__PURE__ */ e.jsx(Ve, {}),
733
+ element: /* @__PURE__ */ e.jsx(_e, {}),
732
734
  errorElement: /* @__PURE__ */ e.jsx(Ce, {}),
733
735
  children: [
734
736
  {
735
737
  path: "/settings/api-keys",
736
- element: /* @__PURE__ */ e.jsx(at, { service: i })
738
+ element: /* @__PURE__ */ e.jsx(ot, { service: i })
737
739
  }
738
740
  ]
739
741
  }
@@ -741,7 +743,7 @@ const it = ({
741
743
  };
742
744
  };
743
745
  export {
744
- Pt as apiKeyPlugin,
745
- It as createApiKeyService
746
+ Rt as apiKeyPlugin,
747
+ Pt as createApiKeyService
746
748
  };
747
749
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map