zudoku 0.47.0 → 0.47.2

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 (140) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +21 -21
  2. package/dist/app/ZuploBuildConfig.js +7 -7
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/entry.client.d.ts +0 -2
  5. package/dist/app/entry.client.js +0 -2
  6. package/dist/app/entry.client.js.map +1 -1
  7. package/dist/app/entry.server.d.ts +0 -2
  8. package/dist/app/entry.server.js +0 -2
  9. package/dist/app/entry.server.js.map +1 -1
  10. package/dist/app/env.d.ts +7 -7
  11. package/dist/app/env.js +8 -0
  12. package/dist/app/env.js.map +1 -1
  13. package/dist/app/main.d.ts +1 -0
  14. package/dist/app/main.js +3 -2
  15. package/dist/app/main.js.map +1 -1
  16. package/dist/config/validators/validate.d.ts +319 -76
  17. package/dist/config/validators/validate.js +33 -11
  18. package/dist/config/validators/validate.js.map +1 -1
  19. package/dist/lib/auth/issuer.js +4 -1
  20. package/dist/lib/auth/issuer.js.map +1 -1
  21. package/dist/lib/auth/issuer.test.js +14 -1
  22. package/dist/lib/auth/issuer.test.js.map +1 -1
  23. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  24. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  25. package/dist/lib/components/Framed.d.ts +7 -0
  26. package/dist/lib/components/Framed.js +26 -0
  27. package/dist/lib/components/Framed.js.map +1 -0
  28. package/dist/lib/components/MobileTopNavigation.js +2 -1
  29. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  30. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +4 -4
  31. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  32. package/dist/lib/plugins/api-keys/index.js +1 -3
  33. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  34. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  35. package/dist/lib/plugins/openapi/schema/SchemaView.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/util/MdxComponents.d.ts +6 -0
  39. package/dist/lib/util/MdxComponents.js +4 -2
  40. package/dist/lib/util/MdxComponents.js.map +1 -1
  41. package/dist/vite/css/plugin.js +11 -0
  42. package/dist/vite/css/plugin.js.map +1 -1
  43. package/dist/vite/plugin-mdx.js +4 -2
  44. package/dist/vite/plugin-mdx.js.map +1 -1
  45. package/dist/vite/plugin-theme.d.ts +8 -0
  46. package/dist/vite/plugin-theme.js +223 -0
  47. package/dist/vite/plugin-theme.js.map +1 -0
  48. package/dist/vite/plugin-theme.test.d.ts +1 -0
  49. package/dist/vite/plugin-theme.test.js +270 -0
  50. package/dist/vite/plugin-theme.test.js.map +1 -0
  51. package/dist/vite/plugin.js +2 -4
  52. package/dist/vite/plugin.js.map +1 -1
  53. package/dist/vite/shadcn-registry.d.ts +45 -0
  54. package/dist/vite/shadcn-registry.js +29 -0
  55. package/dist/vite/shadcn-registry.js.map +1 -0
  56. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  57. package/lib/{Markdown-BUE2ViaD.js → Markdown-C5j8kKSX.js} +444 -404
  58. package/lib/Markdown-C5j8kKSX.js.map +1 -0
  59. package/lib/{MdxPage-By4UkRkI.js → MdxPage-CKTMf1cR.js} +4 -4
  60. package/lib/{MdxPage-By4UkRkI.js.map → MdxPage-CKTMf1cR.js.map} +1 -1
  61. package/lib/{OasProvider-C6_Kx5O7.js → OasProvider-_GzmsbMg.js} +2 -2
  62. package/lib/{OasProvider-C6_Kx5O7.js.map → OasProvider-_GzmsbMg.js.map} +1 -1
  63. package/lib/{OperationList-BISd29LY.js → OperationList-BJAKaG5p.js} +6 -6
  64. package/lib/{OperationList-BISd29LY.js.map → OperationList-BJAKaG5p.js.map} +1 -1
  65. package/lib/{RouteGuard-CgmsSw7T.js → RouteGuard-B7GVW4oL.js} +2 -2
  66. package/lib/{RouteGuard-CgmsSw7T.js.map → RouteGuard-B7GVW4oL.js.map} +1 -1
  67. package/lib/{SchemaList-BqnRo5ov.js → SchemaList-Dgc0A8x5.js} +6 -6
  68. package/lib/{SchemaList-BqnRo5ov.js.map → SchemaList-Dgc0A8x5.js.map} +1 -1
  69. package/lib/{SchemaView-CtYJpxQI.js → SchemaView-DVx-jFN4.js} +13 -13
  70. package/lib/{SchemaView-CtYJpxQI.js.map → SchemaView-DVx-jFN4.js.map} +1 -1
  71. package/lib/{SignUp-CrjeBbqN.js → SignUp-CRIKdWt9.js} +2 -2
  72. package/lib/{SignUp-CrjeBbqN.js.map → SignUp-CRIKdWt9.js.map} +1 -1
  73. package/lib/{Slot-DANV2b7_.js → Slot-ITby_hMb.js} +4 -4
  74. package/lib/{Slot-DANV2b7_.js.map → Slot-ITby_hMb.js.map} +1 -1
  75. package/lib/{SyntaxHighlight-DtvR7RLF.js → SyntaxHighlight-CqKHkyEy.js} +2 -2
  76. package/lib/{SyntaxHighlight-DtvR7RLF.js.map → SyntaxHighlight-CqKHkyEy.js.map} +1 -1
  77. package/lib/{Toc-ClJBmdtI.js → Toc-Csq3UNtW.js} +2 -2
  78. package/lib/{Toc-ClJBmdtI.js.map → Toc-Csq3UNtW.js.map} +1 -1
  79. package/lib/{circular-pOdgLzpG.js → circular-BP4OrHFK.js} +2 -2
  80. package/lib/{circular-pOdgLzpG.js.map → circular-BP4OrHFK.js.map} +1 -1
  81. package/lib/clerk-yAKDC3Qz.js.map +1 -1
  82. package/lib/{createServer-qAtUf99r.js → createServer-zu4cDiPe.js} +5 -5
  83. package/lib/{createServer-qAtUf99r.js.map → createServer-zu4cDiPe.js.map} +1 -1
  84. package/lib/{errors-Bpodza84.js → errors-CPPSp5F4.js} +10 -10
  85. package/lib/{errors-Bpodza84.js.map → errors-CPPSp5F4.js.map} +1 -1
  86. package/lib/{hook-wIlTGE-2.js → hook-7wZANGJP.js} +2 -5
  87. package/lib/{hook-wIlTGE-2.js.map → hook-7wZANGJP.js.map} +1 -1
  88. package/lib/index-CrcNWbel.js.map +1 -1
  89. package/lib/{index-zddirpDj.js → index-DmNq2fbN.js} +226 -221
  90. package/lib/index-DmNq2fbN.js.map +1 -0
  91. package/lib/index-QzXzw_ra.js.map +1 -1
  92. package/lib/{index-RFzRn4fM.js → index-jWXxqkni.js} +9 -9
  93. package/lib/{index-RFzRn4fM.js.map → index-jWXxqkni.js.map} +1 -1
  94. package/lib/{mutation-C-kdA_1r.js → mutation-C1XCQTQL.js} +2 -2
  95. package/lib/{mutation-C-kdA_1r.js.map → mutation-C1XCQTQL.js.map} +1 -1
  96. package/lib/ui/CodeBlock.js +7 -7
  97. package/lib/ui/CodeBlock.js.map +1 -1
  98. package/lib/ui/SyntaxHighlight.js +2 -2
  99. package/lib/{useMutation-3Ph3x6En.js → useMutation-BKvPttRn.js} +3 -3
  100. package/lib/{useMutation-3Ph3x6En.js.map → useMutation-BKvPttRn.js.map} +1 -1
  101. package/lib/zudoku.auth-auth0.js +1 -1
  102. package/lib/zudoku.auth-azureb2c.js +2 -2
  103. package/lib/zudoku.auth-clerk.js +2 -2
  104. package/lib/zudoku.auth-openid.js +2 -2
  105. package/lib/zudoku.components.js +28 -27
  106. package/lib/zudoku.components.js.map +1 -1
  107. package/lib/zudoku.hooks.js +2 -2
  108. package/lib/zudoku.plugin-api-catalog.js +2 -2
  109. package/lib/zudoku.plugin-api-keys.js +68 -62
  110. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  111. package/lib/zudoku.plugin-custom-pages.js +1 -1
  112. package/lib/zudoku.plugin-markdown.js +1 -1
  113. package/lib/zudoku.plugin-openapi.js +2 -2
  114. package/lib/zudoku.plugin-search-pagefind.js +2 -2
  115. package/package.json +8 -8
  116. package/src/app/ZuploBuildConfig.ts +7 -7
  117. package/src/app/defaultTheme.css +68 -49
  118. package/src/app/entry.client.tsx +0 -2
  119. package/src/app/entry.server.tsx +0 -2
  120. package/src/app/env.ts +8 -0
  121. package/src/app/main.css +1 -52
  122. package/src/app/main.tsx +3 -2
  123. package/src/lib/auth/issuer.test.ts +17 -1
  124. package/src/lib/auth/issuer.ts +4 -1
  125. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  126. package/src/lib/components/Framed.tsx +51 -0
  127. package/src/lib/components/MobileTopNavigation.tsx +4 -0
  128. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +11 -8
  129. package/src/lib/plugins/api-keys/index.tsx +1 -3
  130. package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
  131. package/src/lib/ui/CodeBlock.tsx +1 -1
  132. package/src/lib/util/MdxComponents.tsx +13 -2
  133. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  134. package/dist/vite/plugin-configure-tailwind.js +0 -38
  135. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  136. package/dist/vite/plugin-theme-css.d.ts +0 -5
  137. package/dist/vite/plugin-theme-css.js +0 -77
  138. package/dist/vite/plugin-theme-css.js.map +0 -1
  139. package/lib/Markdown-BUE2ViaD.js.map +0 -1
  140. package/lib/index-zddirpDj.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { z as p } from "./index--oeBayMa.js";
2
- import { k as n, i as a, m as c } from "./hook-wIlTGE-2.js";
3
- import { C as H } from "./hook-wIlTGE-2.js";
2
+ import { k as n, i as a, m as c } from "./hook-7wZANGJP.js";
3
+ import { C as H } from "./hook-7wZANGJP.js";
4
4
  import { u as f } from "./useExposedProps-BZQkZneR.js";
5
5
  import { useState as i, useEffect as E } from "react";
6
6
  import { u as d } from "./index-QzXzw_ra.js";
@@ -1,10 +1,10 @@
1
1
  import { j as t } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { s as f } from "./index-BvvmIczU.js";
3
3
  import { d as b, m as j } from "./chunk-DQRVZFIR-BblmKnHy.js";
4
- import { u as x, d as y, j as m } from "./hook-wIlTGE-2.js";
4
+ import { u as x, d as y, j as m } from "./hook-7wZANGJP.js";
5
5
  import { H as v } from "./index.esm-BFcSKCe-.js";
6
6
  import { Link as N } from "./zudoku.components.js";
7
- import { H as S, M as w } from "./Markdown-BUE2ViaD.js";
7
+ import { H as S, M as w } from "./Markdown-C5j8kKSX.js";
8
8
  const H = ({
9
9
  items: r,
10
10
  filterCatalogItems: o = (n) => n,
@@ -1,13 +1,13 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RotateCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
3
- import { D as ce, S as F, R as ue } from "./Slot-DANV2b7_.js";
3
+ import { D as ce, S as O, R as ue } from "./Slot-ITby_hMb.js";
4
4
  import { i as P } from "./invariant-DAFpPywt.js";
5
5
  import { O as he, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
6
- import { i as fe, k as pe, e as xe, d as me } from "./hook-wIlTGE-2.js";
6
+ import { i as fe, k as pe, e as xe, d as me } from "./hook-7wZANGJP.js";
7
7
  import { Button as j } from "./ui/Button.js";
8
- import { u as z } from "./useMutation-3Ph3x6En.js";
8
+ import { u as z } from "./useMutation-BKvPttRn.js";
9
9
  import * as S from "react";
10
- import ye, { createContext as q, useRef as D, useLayoutEffect as ge, useEffect as B, useId as L, useContext as O, useInsertionEffect as je, useMemo as M, useCallback as Ce, Children as ve, isValidElement as we, useState as E } from "react";
10
+ import ye, { createContext as q, useRef as D, useLayoutEffect as ge, useEffect as B, useId as L, useContext as $, useInsertionEffect as je, useMemo as M, useCallback as Ce, Children as ve, isValidElement as we, useState as E } from "react";
11
11
  import { C as ke, a as be } from "./Card-DPhGbYUM.js";
12
12
  import { D as U, e as W, a as X, b as Y, c as G, d as J, f as V, g as K } from "./Dialog-BxpuVLh9.js";
13
13
  import { Input as Ee } from "./ui/Input.js";
@@ -27,7 +27,7 @@ function Z(t) {
27
27
  const i = D(null);
28
28
  return i.current === null && (i.current = t()), i.current;
29
29
  }
30
- const Ie = typeof window < "u", Ne = Ie ? ge : B, ee = /* @__PURE__ */ q(null);
30
+ const Ne = typeof window < "u", Ie = Ne ? ge : B, ee = /* @__PURE__ */ q(null);
31
31
  function Ke(t) {
32
32
  return typeof t == "object" && t !== null;
33
33
  }
@@ -64,12 +64,12 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
64
64
  top: 0,
65
65
  left: 0,
66
66
  right: 0
67
- }), { nonce: u } = O(Ae);
67
+ }), { nonce: u } = $(Ae);
68
68
  return je(() => {
69
- const { width: m, height: h, top: x, left: d, right: c } = r.current;
69
+ const { width: m, height: h, top: x, left: c, right: d } = r.current;
70
70
  if (i || !o.current || !m || !h)
71
71
  return;
72
- const y = s === "left" ? `left: ${d}` : `right: ${c}`;
72
+ const y = s === "left" ? `left: ${c}` : `right: ${d}`;
73
73
  o.current.dataset.motionPopId = n;
74
74
  const f = document.createElement("style");
75
75
  return u && (f.nonce = u), document.head.appendChild(f), f.sheet && f.sheet.insertRule(`
@@ -87,7 +87,7 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
87
87
  }
88
88
  const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: u, anchorX: m }) => {
89
89
  const h = Z(Se), x = L();
90
- let d = !0, c = M(() => (d = !1, {
90
+ let c = !0, d = M(() => (c = !1, {
91
91
  id: x,
92
92
  initial: i,
93
93
  isPresent: s,
@@ -101,17 +101,17 @@ const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom:
101
101
  },
102
102
  register: (y) => (h.set(y, !1), () => h.delete(y))
103
103
  }), [s, h, n]);
104
- return r && d && (c = { ...c }), M(() => {
104
+ return r && c && (d = { ...d }), M(() => {
105
105
  h.forEach((y, f) => h.set(f, !1));
106
106
  }, [s]), S.useEffect(() => {
107
107
  !s && !h.size && n && n();
108
- }, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: c, children: t });
108
+ }, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: d, children: t });
109
109
  };
110
110
  function Se() {
111
111
  return /* @__PURE__ */ new Map();
112
112
  }
113
113
  function qe(t = !0) {
114
- const i = O(ee);
114
+ const i = $(ee);
115
115
  if (i === null)
116
116
  return [!0, null];
117
117
  const { isPresent: s, onExitComplete: n, register: o } = i, r = L();
@@ -122,7 +122,7 @@ function qe(t = !0) {
122
122
  const u = Ce(() => t && n && n(r), [r, n, t]);
123
123
  return !s && n ? [!1, u] : [!0];
124
124
  }
125
- const I = (t) => t.key || "";
125
+ const N = (t) => t.key || "";
126
126
  function H(t) {
127
127
  const i = [];
128
128
  return ve.forEach(t, (s) => {
@@ -130,39 +130,39 @@ function H(t) {
130
130
  }), i;
131
131
  }
132
132
  const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: u = !1, anchorX: m = "left" }) => {
133
- const [h, x] = qe(u), d = M(() => H(t), [t]), c = u && !h ? [] : d.map(I), y = D(!0), f = D(d), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(d), [p, v] = E(d);
134
- Ne(() => {
135
- y.current = !1, f.current = d;
133
+ const [h, x] = qe(u), c = M(() => H(t), [t]), d = u && !h ? [] : c.map(N), y = D(!0), f = D(c), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(c), [p, v] = E(c);
134
+ Ie(() => {
135
+ y.current = !1, f.current = c;
136
136
  for (let w = 0; w < p.length; w++) {
137
- const g = I(p[w]);
138
- c.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
137
+ const g = N(p[w]);
138
+ d.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
139
139
  }
140
- }, [p, c.length, c.join("-")]);
140
+ }, [p, d.length, d.join("-")]);
141
141
  const C = [];
142
- if (d !== a) {
143
- let w = [...d];
142
+ if (c !== a) {
143
+ let w = [...c];
144
144
  for (let g = 0; g < p.length; g++) {
145
- const b = p[g], T = I(b);
146
- c.includes(T) || (w.splice(g, 0, b), C.push(b));
145
+ const b = p[g], T = N(b);
146
+ d.includes(T) || (w.splice(g, 0, b), C.push(b));
147
147
  }
148
- return r === "wait" && C.length && (w = C), v(H(w)), l(d), null;
148
+ return r === "wait" && C.length && (w = C), v(H(w)), l(c), null;
149
149
  }
150
150
  process.env.NODE_ENV !== "production" && r === "wait" && p.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
151
- const { forceRender: A } = O(Pe);
151
+ const { forceRender: A } = $(Pe);
152
152
  return e.jsx(e.Fragment, { children: p.map((w) => {
153
- const g = I(w), b = u && !h ? !1 : d === p || c.includes(g), T = () => {
153
+ const g = N(w), b = u && !h ? !1 : c === p || d.includes(g), T = () => {
154
154
  if (k.has(g))
155
155
  k.set(g, !0);
156
156
  else
157
157
  return;
158
- let $ = !0;
158
+ let F = !0;
159
159
  k.forEach((te) => {
160
- te || ($ = !1);
161
- }), $ && (A?.(), v(f.current), u && x?.(), n && n());
160
+ te || (F = !1);
161
+ }), F && (A?.(), v(f.current), u && x?.(), n && n());
162
162
  };
163
163
  return e.jsx(Me, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : T, anchorX: m, children: w }, g);
164
164
  }) });
165
- }, Oe = ({ service: t }) => {
165
+ }, $e = ({ service: t }) => {
166
166
  const i = pe(), s = xe(), [n, o] = E(
167
167
  null
168
168
  ), [r, u] = E(""), { data: m, isFetching: h } = me({
@@ -194,7 +194,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
194
194
  onSuccess: () => {
195
195
  s.invalidateQueries({ queryKey: ["api-keys"] });
196
196
  }
197
- }), d = z({
197
+ }), c = z({
198
198
  mutationFn: ({
199
199
  consumerId: a,
200
200
  label: l
@@ -217,7 +217,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
217
217
  onSuccess: () => {
218
218
  s.invalidateQueries({ queryKey: ["api-keys"] });
219
219
  }
220
- }), c = z({
220
+ }), d = z({
221
221
  mutationFn: (a) => {
222
222
  if (!t.rollKey)
223
223
  throw new Error("rollKey not implemented");
@@ -227,7 +227,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
227
227
  }), y = (a, l) => {
228
228
  o(a), u(l);
229
229
  }, f = (a) => {
230
- r.trim() && d.mutate({
230
+ r.trim() && c.mutate({
231
231
  consumerId: a,
232
232
  label: r.trim()
233
233
  }), o(null), u("");
@@ -235,13 +235,13 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
235
235
  o(null), u("");
236
236
  };
237
237
  return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
238
- /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page" }),
238
+ /* @__PURE__ */ e.jsx(O.Target, { name: "api-keys-list-page" }),
239
239
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
240
240
  /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
241
241
  t.createKey && /* @__PURE__ */ e.jsx(j, { asChild: !0, children: /* @__PURE__ */ e.jsx(Q, { to: "/settings/api-keys/new", children: "Create API Key" }) })
242
242
  ] }),
243
243
  /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
244
- /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page-before-keys" }),
244
+ /* @__PURE__ */ e.jsx(O.Target, { name: "api-keys-list-page-before-keys" }),
245
245
  /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
246
246
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-8", children: m.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
247
247
  /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
@@ -331,15 +331,23 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
331
331
  }
332
332
  ),
333
333
  t.rollKey && /* @__PURE__ */ e.jsxs(U, { children: [
334
- /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
334
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
335
335
  j,
336
336
  {
337
- size: "icon",
338
337
  title: "Roll this key",
339
338
  variant: "ghost",
340
- disabled: c.isPending,
341
- className: c.isPending ? "animate-spin" : void 0,
342
- children: /* @__PURE__ */ e.jsx(ie, { size: 16 })
339
+ disabled: d.isPending,
340
+ className: "flex items-center gap-1",
341
+ children: [
342
+ /* @__PURE__ */ e.jsx(
343
+ ie,
344
+ {
345
+ size: 16,
346
+ className: d.isPending ? "animate-spin" : void 0
347
+ }
348
+ ),
349
+ "Roll"
350
+ ]
343
351
  }
344
352
  ) }),
345
353
  /* @__PURE__ */ e.jsxs(X, { children: [
@@ -353,7 +361,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
353
361
  j,
354
362
  {
355
363
  onClick: () => {
356
- c.mutate(a.id);
364
+ d.mutate(a.id);
357
365
  },
358
366
  children: "Roll Key"
359
367
  }
@@ -365,7 +373,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
365
373
  ] }),
366
374
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(Le, { children: a.apiKeys.map((l) => /* @__PURE__ */ e.jsxs(ye.Fragment, { children: [
367
375
  /* @__PURE__ */ e.jsx(
368
- Fe,
376
+ Oe,
369
377
  {
370
378
  apiKey: l,
371
379
  onDeleteKey: () => {
@@ -386,17 +394,17 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
386
394
  }
387
395
  ) })
388
396
  ] });
389
- }, $e = (t) => {
397
+ }, Fe = (t) => {
390
398
  const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), o = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
391
399
  return n < 60 ? o.format(-n, "second") : n < 3600 ? o.format(-Math.floor(n / 60), "minute") : n < 86400 ? o.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? o.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? o.format(-Math.floor(n / 2592e3), "month") : o.format(-Math.floor(n / 31536e3), "year");
392
- }, Fe = ({
400
+ }, Oe = ({
393
401
  apiKey: t,
394
402
  onDeleteKey: i,
395
403
  className: s
396
404
  }) => {
397
- const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t, d = x && new Date(x) < /* @__PURE__ */ new Date(), c = x ? Math.ceil(
405
+ const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t, c = x && new Date(x) < /* @__PURE__ */ new Date(), d = x ? Math.ceil(
398
406
  (new Date(x).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
399
- ) : 1 / 0, y = c <= 7 && !d;
407
+ ) : 1 / 0, y = d <= 7 && !c;
400
408
  return /* @__PURE__ */ e.jsxs("div", { className: R("grid col-span-full grid-cols-subgrid p-6", s), children: [
401
409
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
402
410
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
@@ -406,7 +414,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
406
414
  {
407
415
  className: R(
408
416
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
409
- (y || d) && "bg-neutral-200"
417
+ (y || c) && "bg-neutral-200"
410
418
  )
411
419
  }
412
420
  ),
@@ -441,25 +449,25 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
441
449
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
442
450
  h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
443
451
  "Created ",
444
- $e(h),
452
+ Fe(h),
445
453
  "."
446
454
  ] }),
447
455
  " ",
448
456
  x && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
449
457
  "Expires in ",
450
- c,
458
+ d,
451
459
  " ",
452
- c === 1 ? "day" : "days",
460
+ d === 1 ? "day" : "days",
453
461
  "."
454
462
  ] }),
455
- x && d && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
463
+ x && c && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
456
464
  "Expired",
457
465
  " ",
458
- c === 0 ? "today." : `${c * -1} days ago.`
466
+ d === 0 ? "today." : `${d * -1} days ago.`
459
467
  ] })
460
468
  ] })
461
469
  ] }),
462
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs(U, { children: [
470
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: x && i && /* @__PURE__ */ e.jsxs(U, { children: [
463
471
  /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
464
472
  /* @__PURE__ */ e.jsxs(X, { children: [
465
473
  /* @__PURE__ */ e.jsxs(Y, { children: [
@@ -481,10 +489,10 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
481
489
  ] })
482
490
  ] }) })
483
491
  ] });
484
- }, N = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
492
+ }, I = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
485
493
  deleteKey: async (i, s, n) => {
486
494
  const o = new Request(
487
- N + `/${t}/consumers/${i}/keys/${s}`,
495
+ I + `/${t}/consumers/${i}/keys/${s}`,
488
496
  {
489
497
  method: "DELETE"
490
498
  }
@@ -497,7 +505,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
497
505
  const n = await fetch(
498
506
  await s.signRequest(
499
507
  new Request(
500
- N + `/${t}/consumers/${i.id}`,
508
+ I + `/${t}/consumers/${i.id}`,
501
509
  {
502
510
  method: "PATCH",
503
511
  headers: {
@@ -516,15 +524,13 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
516
524
  const n = await fetch(
517
525
  await s.signRequest(
518
526
  new Request(
519
- N + `/${t}/consumers/${i}/roll-key`,
527
+ I + `/${t}/consumers/${i}/roll-key`,
520
528
  {
521
529
  method: "POST",
522
530
  headers: {
523
531
  "Content-Type": "application/json"
524
532
  },
525
- body: JSON.stringify({
526
- expiresOn: /* @__PURE__ */ new Date()
527
- })
533
+ body: JSON.stringify({})
528
534
  }
529
535
  )
530
536
  )
@@ -533,7 +539,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
533
539
  },
534
540
  getConsumers: async (i) => {
535
541
  const s = new Request(
536
- N + `/${t}/consumers`
542
+ I + `/${t}/consumers`
537
543
  );
538
544
  await i.signRequest(s);
539
545
  const n = await fetch(s);
@@ -576,7 +582,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
576
582
  children: [
577
583
  {
578
584
  path: "/settings/api-keys",
579
- element: /* @__PURE__ */ e.jsx(Oe, { service: i })
585
+ element: /* @__PURE__ */ e.jsx($e, { service: i })
580
586
  }
581
587
  // {
582
588
  // path: "/settings/api-keys/new",