@voltro/devtools 0.90.0 → 0.91.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.
@@ -1,5 +1,5 @@
1
- import { ArrowUpDown as e, Database as t, Trash as n } from "../components/icons.js";
2
- import { Badge as r, Button as i, Card as a, Empty as o, KeyValue as s, SectionTitle as c } from "../components/primitives.js";
1
+ import { Badge as e, Button as t, Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
2
+ import { ArrowUpDown as o, Database as s, Trash as c } from "../components/icons.js";
3
3
  import { useState as l, useSyncExternalStore as u } from "react";
4
4
  import { clearStoreHistory as d, definedStores as f, storeHistory as p, subscribeStoreHistory as m, travelToStoreState as h } from "@voltro/client";
5
5
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
@@ -12,22 +12,22 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
12
12
  n = String(e);
13
13
  }
14
14
  return n.length > t ? `${n.slice(0, t)}…` : n;
15
- }, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: e, state: t }) => {
16
- let [n, i] = l(!1);
15
+ }, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: t, state: n }) => {
16
+ let [r, a] = l(!1);
17
17
  return /* @__PURE__ */ v("div", {
18
18
  className: "vdt:border-t vdt:border-border",
19
19
  children: [/* @__PURE__ */ v("button", {
20
20
  type: "button",
21
21
  className: "vdt:flex vdt:w-full vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2 vdt:text-left vdt:hover:bg-muted",
22
- onClick: () => i((e) => !e),
23
- children: [/* @__PURE__ */ _(r, {
22
+ onClick: () => a((e) => !e),
23
+ children: [/* @__PURE__ */ _(e, {
24
24
  tone: "neutral",
25
- children: e
25
+ children: t
26
26
  }), /* @__PURE__ */ _("span", {
27
27
  className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
28
- children: b(t)
28
+ children: b(n)
29
29
  })]
30
- }), n ? /* @__PURE__ */ _(s, { entries: Object.entries(t).map(([e, t]) => ({
30
+ }), r ? /* @__PURE__ */ _(i, { entries: Object.entries(n).map(([e, t]) => ({
31
31
  key: e,
32
32
  value: b(t, 200)
33
33
  })) }) : null]
@@ -35,13 +35,13 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
35
35
  }, C = () => {
36
36
  let u = y(), [p, m] = l(null), C = f(), w = p ?? u.length;
37
37
  return /* @__PURE__ */ v(g, { children: [
38
- /* @__PURE__ */ v(c, {
39
- Icon: t,
40
- right: /* @__PURE__ */ v(i, {
38
+ /* @__PURE__ */ v(a, {
39
+ Icon: s,
40
+ right: /* @__PURE__ */ v(t, {
41
41
  onClick: () => {
42
42
  d(), m(null);
43
43
  },
44
- children: [/* @__PURE__ */ _(n, {}), "Clear"]
44
+ children: [/* @__PURE__ */ _(c, {}), "Clear"]
45
45
  }),
46
46
  children: [
47
47
  "Stores (",
@@ -49,8 +49,8 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
49
49
  ")"
50
50
  ]
51
51
  }),
52
- C.length === 0 ? /* @__PURE__ */ _(o, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(a, { children: [
53
- /* @__PURE__ */ _(c, { children: e.name }),
52
+ C.length === 0 ? /* @__PURE__ */ _(r, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(n, { children: [
53
+ /* @__PURE__ */ _(a, { children: e.name }),
54
54
  /* @__PURE__ */ _(S, {
55
55
  label: "global",
56
56
  state: e.get()
@@ -60,15 +60,15 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
60
60
  state: e.get(t)
61
61
  }, t))
62
62
  ] }, e.name)),
63
- /* @__PURE__ */ v(c, {
64
- Icon: e,
65
- right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(i, {
63
+ /* @__PURE__ */ v(a, {
64
+ Icon: o,
65
+ right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, {
66
66
  onClick: () => {
67
67
  w <= 0 || h(w - 1, "before") && m(w - 1);
68
68
  },
69
69
  disabled: w <= 0,
70
70
  children: "◀ Back"
71
- }), /* @__PURE__ */ _(i, {
71
+ }), /* @__PURE__ */ _(t, {
72
72
  onClick: () => {
73
73
  p === null || w >= u.length || h(w, "after") && m(w + 1);
74
74
  },
@@ -82,42 +82,42 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
82
82
  p === null ? "" : ` — travelled to ${w}/${u.length}`
83
83
  ]
84
84
  }),
85
- u.length === 0 ? /* @__PURE__ */ _(o, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((e, t) => {
86
- let n = u.length - 1 - t, i = x(e.prev, e.next);
87
- return /* @__PURE__ */ v(a, { children: [/* @__PURE__ */ v("div", {
85
+ u.length === 0 ? /* @__PURE__ */ _(r, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((t, r) => {
86
+ let a = u.length - 1 - r, o = x(t.prev, t.next);
87
+ return /* @__PURE__ */ v(n, { children: [/* @__PURE__ */ v("div", {
88
88
  className: "vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2",
89
89
  children: [
90
- /* @__PURE__ */ _(r, {
91
- tone: e.isUndo === !0 ? "warning" : "neutral",
92
- children: e.store
90
+ /* @__PURE__ */ _(e, {
91
+ tone: t.isUndo === !0 ? "warning" : "neutral",
92
+ children: t.store
93
93
  }),
94
- e.key === void 0 ? null : /* @__PURE__ */ _(r, {
94
+ t.key === void 0 ? null : /* @__PURE__ */ _(e, {
95
95
  tone: "neutral",
96
- children: e.key
96
+ children: t.key
97
97
  }),
98
- e.label === void 0 ? null : /* @__PURE__ */ _("span", {
98
+ t.label === void 0 ? null : /* @__PURE__ */ _("span", {
99
99
  className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
100
- children: e.label
100
+ children: t.label
101
101
  }),
102
- p !== null && n === w ? /* @__PURE__ */ _(r, {
102
+ p !== null && a === w ? /* @__PURE__ */ _(e, {
103
103
  tone: "info",
104
104
  children: "here"
105
105
  }) : null
106
106
  ]
107
- }), /* @__PURE__ */ _(s, { entries: [
107
+ }), /* @__PURE__ */ _(i, { entries: [
108
108
  {
109
109
  key: "changed",
110
- value: i.length > 0 ? i.join(", ") : "(no field diff)"
110
+ value: o.length > 0 ? o.join(", ") : "(no field diff)"
111
111
  },
112
112
  {
113
113
  key: "before",
114
- value: b(e.prev)
114
+ value: b(t.prev)
115
115
  },
116
116
  {
117
117
  key: "after",
118
- value: b(e.next)
118
+ value: b(t.next)
119
119
  }
120
- ] })] }, `${e.at}-${n}`);
120
+ ] })] }, `${t.at}-${a}`);
121
121
  })
122
122
  ] });
123
123
  };
@@ -1,8 +1,8 @@
1
- import { ChevronDown as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
1
+ import { useDocumentVisible as e } from "../useDocumentVisible.js";
2
+ import { ChevronDown as t } from "../components/icons.js";
3
3
  import { useInspectToken as n } from "../inspectAuth.js";
4
4
  import { fetchInspect as r } from "../inspectFetch.js";
5
- import { useDocumentVisible as i } from "../useDocumentVisible.js";
5
+ import { useDevtoolsStrings as i } from "../strings.js";
6
6
  import { useEffect as a, useState as o } from "react";
7
7
  import { useFrameworkRuntimes as s } from "@voltro/client";
8
8
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -11,8 +11,8 @@ var d = 4e3, f = async (e, t, n = !1) => {
11
11
  if (e === "") return null;
12
12
  let i = await r(`${e}/_voltro/inspect/traces${n ? "?includeBackground=1" : ""}`, t);
13
13
  return i !== null && Array.isArray(i.traces) ? i : null;
14
- }, p = [], m = (e, t = !1) => {
15
- let r = s(), c = i(), l = n(), u = r.names.join(","), [m, h] = o(p), g = e && c;
14
+ }, p = [], m = (t, r = !1) => {
15
+ let i = s(), c = e(), l = n(), u = i.names.join(","), [m, h] = o(p), g = t && c;
16
16
  return a(() => {
17
17
  if (!g) {
18
18
  h(p);
@@ -20,34 +20,34 @@ var d = 4e3, f = async (e, t, n = !1) => {
20
20
  }
21
21
  let e = u === "" ? [] : u.split(",").map((e) => ({
22
22
  name: e,
23
- baseUrl: r.get(e).inspectBaseUrl
23
+ baseUrl: i.get(e).inspectBaseUrl
24
24
  })).filter((e) => e.baseUrl !== "");
25
25
  if (e.length === 0) {
26
26
  h(p);
27
27
  return;
28
28
  }
29
- let n = !1, i = async () => {
30
- let r = await Promise.all(e.map((e) => f(e.baseUrl, l, t)));
31
- if (n) return;
29
+ let t = !1, n = async () => {
30
+ let n = await Promise.all(e.map((e) => f(e.baseUrl, l, r)));
31
+ if (t) return;
32
32
  let i = [];
33
- r.forEach((t, n) => {
33
+ n.forEach((t, n) => {
34
34
  if (t !== null) for (let r of t.traces) i.push({
35
35
  apiName: e[n].name,
36
36
  trace: r
37
37
  });
38
38
  }), h(i);
39
39
  };
40
- i();
41
- let a = setInterval(i, d);
40
+ n();
41
+ let a = setInterval(n, d);
42
42
  return () => {
43
- n = !0, clearInterval(a);
43
+ t = !0, clearInterval(a);
44
44
  };
45
45
  }, [
46
- r,
46
+ i,
47
47
  u,
48
48
  g,
49
49
  l,
50
- t
50
+ r
51
51
  ]), m;
52
52
  }, h = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, g = (e) => {
53
53
  let t = new Map(e.map((e) => [e.spanId, e])), n = /* @__PURE__ */ new Map(), r = (e, i) => {
@@ -65,55 +65,55 @@ var d = 4e3, f = async (e, t, n = !1) => {
65
65
  } catch {
66
66
  return String(e);
67
67
  }
68
- }, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: n }) => {
69
- let r = t().traces, i = g(n.spans), a = new Set(n.spans.map((e) => e.spanId)), o = n.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = n.spans.length > 0 && n.spans.every(v), d = n.durationMs > 0 ? n.durationMs : 1;
68
+ }, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: e }) => {
69
+ let n = i().traces, r = g(e.spans), a = new Set(e.spans.map((e) => e.spanId)), o = e.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = e.spans.length > 0 && e.spans.every(v), d = e.durationMs > 0 ? e.durationMs : 1;
70
70
  return /* @__PURE__ */ u("div", {
71
71
  className: "vdt-trace-detail",
72
72
  children: [
73
73
  /* @__PURE__ */ u("div", {
74
74
  className: "vdt-trace-summary",
75
- children: [/* @__PURE__ */ l("span", { children: r.spans(n.spanCount) }), n.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
76
- n.deliveryCount ?? 0,
75
+ children: [/* @__PURE__ */ l("span", { children: n.spans(e.spanCount) }), e.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
76
+ e.deliveryCount ?? 0,
77
77
  " ",
78
- r.delivery(n.deliveryCount ?? 0)
79
- ] }), n.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
80
- r.lastDelivery,
78
+ n.delivery(e.deliveryCount ?? 0)
79
+ ] }), e.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
80
+ n.lastDelivery,
81
81
  ": ",
82
- /* @__PURE__ */ l("strong", { children: h(n.lastDeliveryMs) })
82
+ /* @__PURE__ */ l("strong", { children: h(e.lastDeliveryMs) })
83
83
  ] })] }) : /* @__PURE__ */ u("span", { children: [
84
- r.duration,
84
+ n.duration,
85
85
  ": ",
86
- /* @__PURE__ */ l("strong", { children: h(n.durationMs) })
86
+ /* @__PURE__ */ l("strong", { children: h(e.durationMs) })
87
87
  ] })]
88
88
  }),
89
89
  /* @__PURE__ */ u("code", {
90
90
  className: "vdt-trace-id",
91
- children: ["trace ", n.traceId]
91
+ children: ["trace ", e.traceId]
92
92
  }),
93
93
  o || s ? /* @__PURE__ */ l("p", {
94
94
  className: "vdt-trace-context",
95
- children: o ? r.missingParents : r.sqlWithoutCaller
95
+ children: o ? n.missingParents : n.sqlWithoutCaller
96
96
  }) : null,
97
- n.spans.map((t) => {
98
- let a = Math.min(i.get(t.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (t.startMs - n.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, t.durationMs / d * 100))), f = Object.entries(t.attributes);
97
+ e.spans.map((i) => {
98
+ let a = Math.min(r.get(i.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (i.startMs - e.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, i.durationMs / d * 100))), f = Object.entries(i.attributes);
99
99
  return /* @__PURE__ */ u("details", {
100
100
  className: "vdt-trace-span",
101
- open: t.status === "error",
102
- "data-status": t.status,
101
+ open: i.status === "error",
102
+ "data-status": i.status,
103
103
  children: [/* @__PURE__ */ u("summary", {
104
104
  className: "vdt-trace-span-head",
105
105
  style: { paddingLeft: 8 + a * 8 },
106
106
  children: [
107
107
  /* @__PURE__ */ u("span", {
108
108
  className: "vdt-trace-span-label",
109
- children: [/* @__PURE__ */ l(e, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
109
+ children: [/* @__PURE__ */ l(t, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
110
110
  className: "vdt-trace-span-name",
111
- children: t.name
111
+ children: i.name
112
112
  })]
113
113
  }),
114
114
  /* @__PURE__ */ l("span", {
115
115
  className: "vdt-trace-span-duration",
116
- children: h(t.durationMs)
116
+ children: h(i.durationMs)
117
117
  }),
118
118
  /* @__PURE__ */ l("span", {
119
119
  className: "vdt-trace-span-bar",
@@ -130,28 +130,28 @@ var d = 4e3, f = async (e, t, n = !1) => {
130
130
  /* @__PURE__ */ u("div", {
131
131
  className: "vdt-trace-span-meta",
132
132
  children: [
133
- /* @__PURE__ */ l("span", { children: t.kind }),
134
- /* @__PURE__ */ l("span", { children: t.status }),
135
- /* @__PURE__ */ l("code", { children: t.spanId })
133
+ /* @__PURE__ */ l("span", { children: i.kind }),
134
+ /* @__PURE__ */ l("span", { children: i.status }),
135
+ /* @__PURE__ */ l("code", { children: i.spanId })
136
136
  ]
137
137
  }),
138
- t.statusMessage ? /* @__PURE__ */ l("p", {
138
+ i.statusMessage ? /* @__PURE__ */ l("p", {
139
139
  className: "vdt-trace-span-message",
140
- children: t.statusMessage
140
+ children: i.statusMessage
141
141
  }) : null,
142
142
  f.length > 0 ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
143
143
  className: "vdt-trace-attributes-label",
144
- children: r.attributes
144
+ children: n.attributes
145
145
  }), /* @__PURE__ */ l("dl", {
146
146
  className: "vdt-trace-attributes",
147
147
  children: f.map(([e, t]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l("pre", { children: _(t) }) })] }, e))
148
148
  })] }) : /* @__PURE__ */ l("p", {
149
149
  className: "vdt-trace-no-attributes",
150
- children: r.noAttributes
150
+ children: n.noAttributes
151
151
  })
152
152
  ]
153
153
  })]
154
- }, t.spanId);
154
+ }, i.spanId);
155
155
  })
156
156
  ]
157
157
  });
@@ -1,9 +1,9 @@
1
- import { Webhook as e } from "../components/icons.js";
2
- import { useDevtoolsStrings as t } from "../strings.js";
3
- import { Badge as n, Button as r, Card as i, CardBody as a, Empty as o, SectionTitle as s } from "../components/primitives.js";
1
+ import { useDocumentVisible as e } from "../useDocumentVisible.js";
2
+ import { Badge as t, Button as n, Card as r, CardBody as i, Empty as a, SectionTitle as o } from "../components/primitives.js";
3
+ import { Webhook as s } from "../components/icons.js";
4
4
  import { useInspectToken as c } from "../inspectAuth.js";
5
5
  import { fetchInspect as l } from "../inspectFetch.js";
6
- import { useDocumentVisible as u } from "../useDocumentVisible.js";
6
+ import { useDevtoolsStrings as u } from "../strings.js";
7
7
  import { useEffect as d, useState as f } from "react";
8
8
  import { DEFAULT_WEBHOOK_INSPECT_LIST as p, MAX_WEBHOOK_INSPECT_OFFSET as m, isWebhookEventActivity as h, isWebhookInspectActivityStatus as g, isWebhookInspectPagination as _, useFrameworkRuntimes as v, webhookInspectListRequest as y } from "@voltro/client";
9
9
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
@@ -34,45 +34,45 @@ var C = {
34
34
  } catch {
35
35
  return null;
36
36
  }
37
- }, E = (e, t, n = !0) => {
38
- let r = u(), i = c(), a = n && r && e !== "", [o, s] = f(0), l = JSON.stringify([
39
- e,
40
- i,
41
- t.targetOffset,
42
- t.deliveryOffset,
43
- t.limit,
44
- o
37
+ }, E = (t, n, r = !0) => {
38
+ let i = e(), a = c(), o = r && i && t !== "", [s, l] = f(0), u = JSON.stringify([
39
+ t,
40
+ a,
41
+ n.targetOffset,
42
+ n.deliveryOffset,
43
+ n.limit,
44
+ s
45
45
  ]), [p, m] = f();
46
46
  d(() => {
47
- if (!a) return;
48
- let n = !1, r, o = async () => {
49
- let a;
47
+ if (!o) return;
48
+ let e = !1, r, i = async () => {
49
+ let o;
50
50
  try {
51
- a = await T(e, i, t);
51
+ o = await T(t, a, n);
52
52
  } catch {
53
- a = null;
53
+ o = null;
54
54
  }
55
- n || (m({
56
- key: l,
57
- data: a
58
- }), r = setTimeout(() => void o(), w));
55
+ e || (m({
56
+ key: u,
57
+ data: o
58
+ }), r = setTimeout(() => void i(), w));
59
59
  };
60
- return o(), () => {
61
- n = !0, clearTimeout(r);
60
+ return i(), () => {
61
+ e = !0, clearTimeout(r);
62
62
  };
63
63
  }, [
64
- e,
64
+ t,
65
+ o,
65
66
  a,
66
- i,
67
- l,
68
- t
67
+ u,
68
+ n
69
69
  ]);
70
- let h = p?.key === l ? p : void 0;
70
+ let h = p?.key === u ? p : void 0;
71
71
  return {
72
- data: a && h?.data ? h.data : C,
73
- pending: a && h === void 0,
74
- failed: a && h?.data === null,
75
- refresh: () => s((e) => e + 1)
72
+ data: o && h?.data ? h.data : C,
73
+ pending: o && h === void 0,
74
+ failed: o && h?.data === null,
75
+ refresh: () => l((e) => e + 1)
76
76
  };
77
77
  }, D = {
78
78
  pending: "neutral",
@@ -83,58 +83,58 @@ var C = {
83
83
  }, O = (e) => {
84
84
  let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
85
85
  return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
86
- }, k = (e) => {
87
- let t = v(), n = u(), r = c(), i = JSON.stringify(t.names.map((e) => t.get(e).inspectBaseUrl)), a = e && n, o = JSON.stringify([
86
+ }, k = (t) => {
87
+ let n = v(), r = e(), i = c(), a = JSON.stringify(n.names.map((e) => n.get(e).inspectBaseUrl)), o = t && r, s = JSON.stringify([
88
+ a,
88
89
  i,
89
- r,
90
- a
91
- ]), [s, l] = f();
90
+ o
91
+ ]), [l, u] = f();
92
92
  return d(() => {
93
- if (!a) return;
94
- let e = JSON.parse(i);
93
+ if (!o) return;
94
+ let e = JSON.parse(a);
95
95
  if (e.length === 0) {
96
- l({
97
- key: o,
96
+ u({
97
+ key: s,
98
98
  count: 0
99
99
  });
100
100
  return;
101
101
  }
102
102
  if (e.some((e) => e === "")) {
103
- l({
104
- key: o,
103
+ u({
104
+ key: s,
105
105
  count: null
106
106
  });
107
107
  return;
108
108
  }
109
- let t = !1, n, s = async () => {
110
- let i = await Promise.all(e.map((e) => T(e, r)));
109
+ let t = !1, n, r = async () => {
110
+ let a = await Promise.all(e.map((e) => T(e, i)));
111
111
  if (t) return;
112
- let a = i.some((e) => e === null) ? void 0 : i.reduce((e, t) => e + t.outgoing.length + t.incoming.length + t.eventActivity.reduce((e, t) => e + t.targets, 0), 0);
113
- l({
114
- key: o,
115
- count: a !== void 0 && Number.isSafeInteger(a) ? a : null
116
- }), n = setTimeout(() => void s(), w);
112
+ let o = a.some((e) => e === null) ? void 0 : a.reduce((e, t) => e + t.outgoing.length + t.incoming.length + t.eventActivity.reduce((e, t) => e + t.targets, 0), 0);
113
+ u({
114
+ key: s,
115
+ count: o !== void 0 && Number.isSafeInteger(o) ? o : null
116
+ }), n = setTimeout(() => void r(), w);
117
117
  };
118
- return s(), () => {
118
+ return r(), () => {
119
119
  t = !0, clearTimeout(n);
120
120
  };
121
121
  }, [
122
- a,
123
- r,
122
+ o,
124
123
  i,
125
- o
126
- ]), a && s?.key === o ? s.count : null;
127
- }, A = ({ apiName: o, baseUrl: c }) => {
128
- let [l, u] = f({
124
+ a,
125
+ s
126
+ ]), o && l?.key === s ? l.count : null;
127
+ }, A = ({ apiName: e, baseUrl: a }) => {
128
+ let [c, l] = f({
129
129
  ...p,
130
130
  includeActivity: !1
131
- }), d = E(c, l), h = d.data, g = t().webhooks;
132
- return !(h.outgoing.length + h.incoming.length + h.targets.length + h.deliveries.length > 0) && !d.pending && !d.failed && l.targetOffset === 0 && l.deliveryOffset === 0 ? null : /* @__PURE__ */ x("div", {
131
+ }), d = E(a, c), h = d.data, g = u().webhooks;
132
+ return !(h.outgoing.length + h.incoming.length + h.targets.length + h.deliveries.length > 0) && !d.pending && !d.failed && c.targetOffset === 0 && c.deliveryOffset === 0 ? null : /* @__PURE__ */ x("div", {
133
133
  className: "vdt:space-y-4",
134
- children: /* @__PURE__ */ S(i, { children: [/* @__PURE__ */ x(s, {
135
- Icon: e,
136
- children: o
137
- }), /* @__PURE__ */ S(a, { children: [
134
+ children: /* @__PURE__ */ S(r, { children: [/* @__PURE__ */ x(o, {
135
+ Icon: s,
136
+ children: e
137
+ }), /* @__PURE__ */ S(i, { children: [
138
138
  h.outgoing.length > 0 ? /* @__PURE__ */ S("div", {
139
139
  className: "vdt:mb-4",
140
140
  children: [/* @__PURE__ */ x("div", {
@@ -149,7 +149,7 @@ var C = {
149
149
  className: "vdt:text-foreground vdt:font-mono",
150
150
  children: e.id
151
151
  }),
152
- /* @__PURE__ */ S(n, {
152
+ /* @__PURE__ */ S(t, {
153
153
  tone: "neutral",
154
154
  children: ["v", e.version]
155
155
  }),
@@ -175,14 +175,14 @@ var C = {
175
175
  className: "vdt:text-foreground vdt:font-mono",
176
176
  children: e.path
177
177
  }),
178
- e.provider ? /* @__PURE__ */ x(n, {
178
+ e.provider ? /* @__PURE__ */ x(t, {
179
179
  tone: "info",
180
180
  children: e.provider
181
181
  }) : null,
182
- e.signatureConfigured ? /* @__PURE__ */ x(n, {
182
+ e.signatureConfigured ? /* @__PURE__ */ x(t, {
183
183
  tone: "success",
184
184
  children: g.signed
185
- }) : /* @__PURE__ */ x(n, {
185
+ }) : /* @__PURE__ */ x(t, {
186
186
  tone: "warning",
187
187
  children: g.unsigned
188
188
  })
@@ -198,7 +198,7 @@ var C = {
198
198
  }), /* @__PURE__ */ x("div", {
199
199
  className: "vdt:space-y-1",
200
200
  children: h.targets.map((e) => {
201
- let t = h.outgoing.find((t) => t.id === e.event)?.version ?? e.payloadVersion, r = e.payloadVersion === t ? "current" : e.payloadVersion < t ? "behind" : "ahead";
201
+ let n = h.outgoing.find((t) => t.id === e.event)?.version ?? e.payloadVersion, r = e.payloadVersion === n ? "current" : e.payloadVersion < n ? "behind" : "ahead";
202
202
  return /* @__PURE__ */ S("div", {
203
203
  className: "vdt-record-row vdt:text-sm",
204
204
  children: [
@@ -214,31 +214,31 @@ var C = {
214
214
  className: "vdt:text-foreground vdt:text-xs vdt:truncate vdt:max-w-72",
215
215
  children: e.url
216
216
  }),
217
- e.active ? /* @__PURE__ */ x(n, {
217
+ e.active ? /* @__PURE__ */ x(t, {
218
218
  tone: "success",
219
219
  children: g.active
220
- }) : /* @__PURE__ */ x(n, {
220
+ }) : /* @__PURE__ */ x(t, {
221
221
  tone: "warning",
222
222
  children: g.paused
223
223
  }),
224
- r === "current" ? /* @__PURE__ */ S(n, {
224
+ r === "current" ? /* @__PURE__ */ S(t, {
225
225
  tone: "neutral",
226
226
  children: ["v", e.payloadVersion]
227
- }) : r === "behind" ? /* @__PURE__ */ S(n, {
227
+ }) : r === "behind" ? /* @__PURE__ */ S(t, {
228
228
  tone: "warning",
229
229
  children: [
230
230
  "v",
231
231
  e.payloadVersion,
232
232
  " ← current v",
233
- t
233
+ n
234
234
  ]
235
- }) : /* @__PURE__ */ S(n, {
235
+ }) : /* @__PURE__ */ S(t, {
236
236
  tone: "danger",
237
237
  children: [
238
238
  "v",
239
239
  e.payloadVersion,
240
240
  " → ahead of v",
241
- t
241
+ n
242
242
  ]
243
243
  })
244
244
  ]
@@ -262,7 +262,7 @@ var C = {
262
262
  className: "vdt:text-foreground vdt:min-w-32 vdt:truncate",
263
263
  children: e.event
264
264
  }),
265
- /* @__PURE__ */ x(n, {
265
+ /* @__PURE__ */ x(t, {
266
266
  tone: D[e.status],
267
267
  children: e.status
268
268
  }),
@@ -294,7 +294,7 @@ var C = {
294
294
  children: g.pageError
295
295
  }),
296
296
  ["targets", "deliveries"].map((e) => {
297
- let t = e === "targets" ? l.targetOffset : l.deliveryOffset, n = h.pagination[e], i = h[e].length;
297
+ let t = e === "targets" ? c.targetOffset : c.deliveryOffset, r = h.pagination[e], i = h[e].length;
298
298
  return /* @__PURE__ */ S("nav", {
299
299
  "aria-label": e === "targets" ? g.targetPages : g.deliveryPages,
300
300
  "aria-busy": d.pending,
@@ -306,33 +306,33 @@ var C = {
306
306
  className: "vdt:min-w-0 vdt:flex-1 vdt:text-sm vdt:text-foreground-muted vdt:tabular-nums",
307
307
  children: [d.pending ? g.pageLoading : e === "targets" ? g.targetPages : g.deliveryPages, !d.pending && !d.failed && /* @__PURE__ */ S(b, { children: [" · ", g.pageRange(i === 0 ? 0 : t + 1, i === 0 ? 0 : t + i)] })]
308
308
  }),
309
- /* @__PURE__ */ x(r, {
309
+ /* @__PURE__ */ x(n, {
310
310
  className: "vdt:min-h-11",
311
311
  variant: "outline",
312
312
  disabled: d.pending || t === 0,
313
- onClick: () => u((t) => ({
313
+ onClick: () => l((t) => ({
314
314
  ...t,
315
315
  [e === "targets" ? "targetOffset" : "deliveryOffset"]: 0
316
316
  })),
317
317
  children: g.pageFirst
318
318
  }),
319
- /* @__PURE__ */ x(r, {
319
+ /* @__PURE__ */ x(n, {
320
320
  className: "vdt:min-h-11",
321
321
  variant: "outline",
322
322
  disabled: d.pending || t === 0,
323
- onClick: () => u((n) => ({
323
+ onClick: () => l((n) => ({
324
324
  ...n,
325
- [e === "targets" ? "targetOffset" : "deliveryOffset"]: Math.max(0, t - l.limit)
325
+ [e === "targets" ? "targetOffset" : "deliveryOffset"]: Math.max(0, t - c.limit)
326
326
  })),
327
327
  children: g.pagePrevious
328
328
  }),
329
- /* @__PURE__ */ x(r, {
329
+ /* @__PURE__ */ x(n, {
330
330
  className: "vdt:min-h-11",
331
331
  variant: "outline",
332
- disabled: d.pending || d.failed || !n.hasMore || t > m - l.limit,
333
- onClick: () => u((n) => ({
332
+ disabled: d.pending || d.failed || !r.hasMore || t > m - c.limit,
333
+ onClick: () => l((n) => ({
334
334
  ...n,
335
- [e === "targets" ? "targetOffset" : "deliveryOffset"]: t + l.limit
335
+ [e === "targets" ? "targetOffset" : "deliveryOffset"]: t + c.limit
336
336
  })),
337
337
  children: g.pageNext
338
338
  })
@@ -344,7 +344,7 @@ var C = {
344
344
  children: [/* @__PURE__ */ x("p", {
345
345
  className: "vdt:min-w-0 vdt:flex-1 vdt:text-xs vdt:text-foreground-muted",
346
346
  children: g.pageLiveHint
347
- }), /* @__PURE__ */ x(r, {
347
+ }), /* @__PURE__ */ x(n, {
348
348
  className: "vdt:min-h-11",
349
349
  variant: "ghost",
350
350
  disabled: d.pending,
@@ -357,8 +357,8 @@ var C = {
357
357
  ] })] })
358
358
  });
359
359
  }, j = () => {
360
- let e = v(), n = t().webhooks;
361
- return e.names.length === 0 ? /* @__PURE__ */ x(o, { children: n.empty }) : /* @__PURE__ */ x("div", {
360
+ let e = v(), t = u().webhooks;
361
+ return e.names.length === 0 ? /* @__PURE__ */ x(a, { children: t.empty }) : /* @__PURE__ */ x("div", {
362
362
  className: "vdt:space-y-4 vdt:p-3",
363
363
  children: e.names.map((t) => {
364
364
  let n = e.get(t);