adonisjs-server-stats 1.6.14 → 1.9.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 (69) hide show
  1. package/README.md +24 -8
  2. package/dist/core/index.js +248 -245
  3. package/dist/core/log-utils.d.ts +14 -0
  4. package/dist/react/{CacheSection-DGxMDlWK.js → CacheSection-xH75hwXu.js} +1 -1
  5. package/dist/react/{CacheTab-CnVW5PLs.js → CacheTab-DYmsZJJ1.js} +1 -1
  6. package/dist/react/{ConfigSection-DPcrfqXY.js → ConfigSection-D8BO1Ry9.js} +1 -1
  7. package/dist/react/{ConfigTab-BSWq_o2p.js → ConfigTab-CcN-tfjv.js} +1 -1
  8. package/dist/react/{CustomPaneTab-xjkYwTvH.js → CustomPaneTab-D7_o3Ec6.js} +1 -1
  9. package/dist/react/{EmailsSection-CSyTg1aX.js → EmailsSection-BzlsTdPs.js} +1 -1
  10. package/dist/react/{EmailsTab-Dh2YSa_f.js → EmailsTab-Uh2CQY3o.js} +44 -22
  11. package/dist/react/{EventsSection-C1pbJDfW.js → EventsSection-CGQWiIdV.js} +1 -1
  12. package/dist/react/{EventsTab-eCh02cdd.js → EventsTab-CC6DQzEm.js} +1 -1
  13. package/dist/react/{JobsSection-CLAin5vU.js → JobsSection-D7AHQmZi.js} +1 -1
  14. package/dist/react/{JobsTab-Dl5nrj2z.js → JobsTab-B3Lfdqed.js} +1 -1
  15. package/dist/react/LogsSection-Cly1dpvS.js +227 -0
  16. package/dist/react/LogsTab-BbYK-iyh.js +103 -0
  17. package/dist/react/{OverviewSection-nm3xdACz.js → OverviewSection-CkBGFEWq.js} +1 -1
  18. package/dist/react/{QueriesSection-DB12HMfQ.js → QueriesSection-CfCpnNUD.js} +1 -1
  19. package/dist/react/{QueriesTab-fyBB1u_Y.js → QueriesTab-DbBmAqzO.js} +1 -1
  20. package/dist/react/{RequestsSection-DTqB81ac.js → RequestsSection-Cb5a6MlT.js} +1 -1
  21. package/dist/react/{RoutesSection-DJWa4NPV.js → RoutesSection-CRqF-cNM.js} +1 -1
  22. package/dist/react/{RoutesTab-D3l8TOpu.js → RoutesTab-Bwreij3e.js} +1 -1
  23. package/dist/react/{TimelineSection-C4d-jRX1.js → TimelineSection-B2y06kRE.js} +1 -1
  24. package/dist/react/{TimelineTab-C5TFaSmQ.js → TimelineTab-6hthfdBB.js} +1 -1
  25. package/dist/react/{index-UdTfSvtO.js → index-CecA4IdQ.js} +394 -393
  26. package/dist/react/index.js +1 -1
  27. package/dist/react/react/components/shared/JsonViewer.d.ts +2 -1
  28. package/dist/react/style.css +1 -1
  29. package/dist/src/controller/debug_controller.js +10 -9
  30. package/dist/src/dashboard/dashboard_store.js +10 -6
  31. package/dist/src/data/data_access.js +12 -1
  32. package/dist/src/debug/email_collector.d.ts +11 -1
  33. package/dist/src/debug/email_collector.js +31 -1
  34. package/dist/src/debug/types.d.ts +1 -1
  35. package/dist/src/edge/client/dashboard.js +2 -2
  36. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  37. package/dist/src/edge/client-vue/dashboard.js +4 -4
  38. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  39. package/dist/src/provider/server_stats_provider.d.ts +31 -0
  40. package/dist/src/provider/server_stats_provider.js +244 -5
  41. package/dist/src/routes/register_routes.js +2 -2
  42. package/dist/src/styles/components.css +84 -0
  43. package/dist/vue/{CacheSection-C788Yfai.js → CacheSection-Cx-hj09X.js} +2 -2
  44. package/dist/vue/{ConfigSection-CRzYxqW2.js → ConfigSection-CMXyryf6.js} +1 -1
  45. package/dist/vue/{EmailsSection-C8JFMtW7.js → EmailsSection-DgKl9xGT.js} +1 -1
  46. package/dist/vue/EmailsTab-CNyEODVB.js +177 -0
  47. package/dist/vue/{EventsSection-C4wXUgxG.js → EventsSection-BNMCAim1.js} +2 -2
  48. package/dist/vue/{EventsTab-DQ4Nd6AK.js → EventsTab-BBM7olXF.js} +1 -1
  49. package/dist/vue/{JobsSection-CsKWTjgN.js → JobsSection-CCMgMlxd.js} +2 -2
  50. package/dist/vue/{JobsTab-BCvhOARO.js → JobsTab-WFnxPdN7.js} +1 -1
  51. package/dist/vue/{JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js → JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js} +25 -23
  52. package/dist/vue/LogsSection-CvOnTxUu.js +252 -0
  53. package/dist/vue/LogsTab-Bg3o0Mm6.js +147 -0
  54. package/dist/vue/{OverviewSection-CbMdAido.js → OverviewSection-CHgaKtUR.js} +1 -1
  55. package/dist/vue/{QueriesSection-BPiv7u3r.js → QueriesSection-BnHRD98z.js} +1 -1
  56. package/dist/vue/{RequestsSection-LtImH4rD.js → RequestsSection-B-uSlM0f.js} +1 -1
  57. package/dist/vue/{RoutesSection-CrxOxmzx.js → RoutesSection-BrceOcKQ.js} +1 -1
  58. package/dist/vue/{TimelineSection-DLxMW2J_.js → TimelineSection-CfvnA2Oo.js} +1 -1
  59. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +2 -0
  60. package/dist/vue/components/shared/JsonViewer.vue.d.ts +3 -0
  61. package/dist/vue/{index-qCQpBftQ.js → index-oLxS08vN.js} +56 -54
  62. package/dist/vue/index.js +1 -1
  63. package/dist/vue/style.css +1 -1
  64. package/package.json +1 -1
  65. package/dist/react/LogsSection-C1p81fXO.js +0 -212
  66. package/dist/react/LogsTab-D-kR7PjX.js +0 -88
  67. package/dist/vue/EmailsTab-DhFhoNmU.js +0 -157
  68. package/dist/vue/LogsSection-BFVjSZ24.js +0 -227
  69. package/dist/vue/LogsTab-DpEQ7euu.js +0 -122
@@ -1,119 +1,119 @@
1
- import { jsx as e, jsxs as d, Fragment as H } from "react/jsx-runtime";
2
- import K, { useState as N, useRef as j, useEffect as R, useCallback as B, useMemo as O, Suspense as F, lazy as T } from "react";
1
+ import { jsx as e, jsxs as l, Fragment as H } from "react/jsx-runtime";
2
+ import K, { useState as y, useRef as j, useEffect as R, useCallback as B, useMemo as O, Suspense as F, lazy as T } from "react";
3
3
  import { DEFAULT_FEATURES as G, detectFeatures as Q, ServerStatsController as X, getTheme as Y, onThemeChange as Z, toggleTheme as ee, buildSparklineData as se, computeStats as te, formatStatNum as U, detectMetricGroupsFromStats as ne, getVisibleMetricGroups as oe, METRIC_DEFINITIONS as ie, TAB_ICONS as L, DashboardDataController as re, subscribeToChannel as ae, DebugDataController as le, compactPreview as ce } from "adonisjs-server-stats/core";
4
4
  import { createPortal as de } from "react-dom";
5
5
  function z(s = {}) {
6
- const { baseUrl: i = "", debugEndpoint: t = "/admin/api/debug", authToken: n } = s, [a, h] = N(G), [c, r] = N(!0), [g, p] = N(null), m = j(!1);
6
+ const { baseUrl: r = "", debugEndpoint: t = "/admin/api/debug", authToken: o } = s, [a, d] = y(G), [g, n] = y(!0), [v, p] = y(null), h = j(!1);
7
7
  return R(() => {
8
- if (m.current) return;
9
- m.current = !0;
10
- let l = !1;
8
+ if (h.current) return;
9
+ h.current = !0;
10
+ let u = !1;
11
11
  return (async () => {
12
12
  try {
13
- const f = await Q({ baseUrl: i, debugEndpoint: t, authToken: n });
14
- l || (h(f), r(!1));
13
+ const f = await Q({ baseUrl: r, debugEndpoint: t, authToken: o });
14
+ u || (d(f), n(!1));
15
15
  } catch (f) {
16
- l || (p(f instanceof Error ? f : new Error(String(f))), r(!1));
16
+ u || (p(f instanceof Error ? f : new Error(String(f))), n(!1));
17
17
  }
18
18
  })(), () => {
19
- l = !0;
19
+ u = !0;
20
20
  };
21
- }, [i, t, n]), { features: a, isLoading: c, error: g };
21
+ }, [r, t, o]), { features: a, isLoading: g, error: v };
22
22
  }
23
23
  function ue(s = {}) {
24
24
  const {
25
- baseUrl: i = "",
25
+ baseUrl: r = "",
26
26
  endpoint: t = "/admin/api/server-stats",
27
- channelName: n = "admin/server-stats",
27
+ channelName: o = "admin/server-stats",
28
28
  authToken: a,
29
- pollInterval: h = 3e3
30
- } = s, [c, r] = N(null), [g, p] = N(!1), [m, l] = N(!1), [y, f] = N(null), [b, w] = N(!1), E = j(null);
29
+ pollInterval: d = 3e3
30
+ } = s, [g, n] = y(null), [v, p] = y(!1), [h, u] = y(!1), [w, f] = y(null), [m, k] = y(!1), E = j(null);
31
31
  R(() => {
32
- if (b) return;
32
+ if (m) return;
33
33
  const I = new X({
34
- baseUrl: i,
34
+ baseUrl: r,
35
35
  endpoint: t,
36
- channelName: n,
36
+ channelName: o,
37
37
  authToken: a,
38
- pollInterval: h,
39
- onStatsUpdate: (C) => r(C),
38
+ pollInterval: d,
39
+ onStatsUpdate: (C) => n(C),
40
40
  onConnectionChange: (C) => p(C),
41
- onStaleChange: (C) => l(C),
41
+ onStaleChange: (C) => u(C),
42
42
  onError: (C) => f(C),
43
- onUnauthorizedChange: (C) => w(C)
43
+ onUnauthorizedChange: (C) => k(C)
44
44
  });
45
45
  return E.current = I, I.start(), () => {
46
46
  I.stop(), E.current = null;
47
47
  };
48
- }, [i, n, a, h, b]);
48
+ }, [r, o, a, d, m]);
49
49
  const _ = B((I) => E.current?.getHistory(I) ?? [], []);
50
50
  return {
51
- stats: c,
51
+ stats: g,
52
52
  history: E.current?.getAllHistory() ?? {},
53
53
  getHistory: _,
54
- isConnected: g,
55
- isStale: m,
56
- error: y,
57
- unauthorized: b
54
+ isConnected: v,
55
+ isStale: h,
56
+ error: w,
57
+ unauthorized: m
58
58
  };
59
59
  }
60
60
  function A() {
61
- const [s, i] = N(() => Y());
61
+ const [s, r] = y(() => Y());
62
62
  R(() => Z((a) => {
63
- i(a);
63
+ r(a);
64
64
  }), []);
65
65
  const t = B(() => {
66
- const n = ee();
67
- return i(n), n;
66
+ const o = ee();
67
+ return r(o), o;
68
68
  }, []);
69
69
  return { theme: s, toggleTheme: t };
70
70
  }
71
71
  function he({
72
72
  data: s,
73
- color: i = "#34d399",
73
+ color: r = "#34d399",
74
74
  width: t = 120,
75
- height: n = 32,
75
+ height: o = 32,
76
76
  className: a = ""
77
77
  }) {
78
- const h = O(
79
- () => se(s, { width: t, height: n }),
80
- [s, t, n]
81
- ), c = O(() => "ss-grad-" + Math.random().toString(36).slice(2, 8), []), r = { "--ss-accent": i };
82
- if (!h)
83
- return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: r, children: /* @__PURE__ */ e(
78
+ const d = O(
79
+ () => se(s, { width: t, height: o }),
80
+ [s, t, o]
81
+ ), g = O(() => "ss-grad-" + Math.random().toString(36).slice(2, 8), []), n = { "--ss-accent": r };
82
+ if (!d)
83
+ return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: n, children: /* @__PURE__ */ e(
84
84
  "svg",
85
85
  {
86
86
  width: t,
87
- height: n,
88
- viewBox: `0 0 ${t} ${n}`,
87
+ height: o,
88
+ viewBox: `0 0 ${t} ${o}`,
89
89
  style: { display: "block" },
90
- children: /* @__PURE__ */ d("text", { x: t / 2, y: n / 2 + 3, textAnchor: "middle", fill: "#737373", fontSize: "9", children: [
90
+ children: /* @__PURE__ */ l("text", { x: t / 2, y: o / 2 + 3, textAnchor: "middle", fill: "#737373", fontSize: "9", children: [
91
91
  "collecting",
92
92
  "…"
93
93
  ] })
94
94
  }
95
95
  ) });
96
- const g = i || "var(--ss-accent)";
97
- return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: r, children: /* @__PURE__ */ d(
96
+ const v = r || "var(--ss-accent)";
97
+ return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: n, children: /* @__PURE__ */ l(
98
98
  "svg",
99
99
  {
100
100
  width: t,
101
- height: n,
102
- viewBox: `0 0 ${t} ${n}`,
101
+ height: o,
102
+ viewBox: `0 0 ${t} ${o}`,
103
103
  style: { display: "block" },
104
104
  children: [
105
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ d("linearGradient", { id: c, x1: "0", y1: "0", x2: "0", y2: "1", children: [
106
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: g, stopOpacity: "0.25" }),
107
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: g, stopOpacity: "0.02" })
105
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ l("linearGradient", { id: g, x1: "0", y1: "0", x2: "0", y2: "1", children: [
106
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: v, stopOpacity: "0.25" }),
107
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: v, stopOpacity: "0.02" })
108
108
  ] }) }),
109
- /* @__PURE__ */ e("path", { d: h.areaPath, fill: `url(#${c})` }),
109
+ /* @__PURE__ */ e("path", { d: d.areaPath, fill: `url(#${g})` }),
110
110
  /* @__PURE__ */ e(
111
111
  "path",
112
112
  {
113
113
  className: "ss-dash-sparkline-line",
114
- d: "M" + h.points.replace(/ /g, " L"),
114
+ d: "M" + d.points.replace(/ /g, " L"),
115
115
  fill: "none",
116
- stroke: g,
116
+ stroke: v,
117
117
  strokeWidth: "1.5",
118
118
  strokeLinejoin: "round",
119
119
  strokeLinecap: "round"
@@ -129,8 +129,8 @@ const pe = {
129
129
  "ss-green": "#34d399",
130
130
  "ss-muted": "#737373"
131
131
  };
132
- function me(s, i, t) {
133
- const [n, a] = N({
132
+ function me(s, r, t) {
133
+ const [o, a] = y({
134
134
  position: "absolute",
135
135
  bottom: "100%",
136
136
  left: 0,
@@ -139,100 +139,100 @@ function me(s, i, t) {
139
139
  });
140
140
  return R(() => {
141
141
  if (!t) return;
142
- const h = () => {
143
- const r = s.current, g = i.current;
144
- if (!r || !g) return;
145
- const p = r.closest(".ss-bar");
142
+ const d = () => {
143
+ const n = s.current, v = r.current;
144
+ if (!n || !v) return;
145
+ const p = n.closest(".ss-bar");
146
146
  if (!p) return;
147
- const m = r.getBoundingClientRect(), l = p.getBoundingClientRect(), y = m.left - l.left + m.width / 2;
147
+ const h = n.getBoundingClientRect(), u = p.getBoundingClientRect(), w = h.left - u.left + h.width / 2;
148
148
  a({
149
149
  position: "absolute",
150
150
  bottom: "100%",
151
- left: `${y}px`,
151
+ left: `${w}px`,
152
152
  transform: "translateX(-50%)",
153
153
  marginBottom: "10px",
154
154
  zIndex: 180
155
155
  }), requestAnimationFrame(() => {
156
- const f = g.getBoundingClientRect();
157
- let b = 0;
158
- f.left < 8 ? b = 8 - f.left : f.right > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.right), b && a((w) => ({
159
- ...w,
160
- transform: `translateX(calc(-50% + ${b}px))`
156
+ const f = v.getBoundingClientRect();
157
+ let m = 0;
158
+ f.left < 8 ? m = 8 - f.left : f.right > window.innerWidth - 8 && (m = window.innerWidth - 8 - f.right), m && a((k) => ({
159
+ ...k,
160
+ transform: `translateX(calc(-50% + ${m}px))`
161
161
  }));
162
162
  });
163
163
  };
164
- h();
165
- const c = s.current?.closest(".ss-bar-scroll");
166
- return c?.addEventListener("scroll", h), window.addEventListener("resize", h), () => {
167
- c?.removeEventListener("scroll", h), window.removeEventListener("resize", h);
164
+ d();
165
+ const g = s.current?.closest(".ss-bar-scroll");
166
+ return g?.addEventListener("scroll", d), window.addEventListener("resize", d), () => {
167
+ g?.removeEventListener("scroll", d), window.removeEventListener("resize", d);
168
168
  };
169
- }, [t, s, i]), n;
169
+ }, [t, s, r]), o;
170
170
  }
171
- function be({ metric: s, stats: i, history: t, className: n = "" }) {
172
- const [a, h] = N(!1), [c, r] = N(!1), g = j(null), p = j(null);
173
- if (s.show && !s.show(i))
171
+ function be({ metric: s, stats: r, history: t, className: o = "" }) {
172
+ const [a, d] = y(!1), [g, n] = y(!1), v = j(null), p = j(null);
173
+ if (s.show && !s.show(r))
174
174
  return null;
175
- const m = s.value ? s.value(i) : s.format(i), l = s.color ? s.color(i) : "", y = l && pe[l] || "#34d399", f = typeof s.detail == "function" ? s.detail(i) : s.detail, b = O(() => te(t), [t]), w = a || c, E = me(g, p, w), _ = B(($) => {
176
- $.stopPropagation(), h((o) => !o);
175
+ const h = s.value ? s.value(r) : s.format(r), u = s.color ? s.color(r) : "", w = u && pe[u] || "#34d399", f = typeof s.detail == "function" ? s.detail(r) : s.detail, m = O(() => te(t), [t]), k = a || g, E = me(v, p, k), _ = B(($) => {
176
+ $.stopPropagation(), d((i) => !i);
177
177
  }, []);
178
178
  R(() => {
179
179
  if (!a) return;
180
- const $ = (v) => {
181
- const x = v.target;
182
- g.current && !g.current.contains(x) && p.current && !p.current.contains(x) && h(!1);
183
- }, o = (v) => {
184
- v.key === "Escape" && h(!1);
180
+ const $ = (b) => {
181
+ const x = b.target;
182
+ v.current && !v.current.contains(x) && p.current && !p.current.contains(x) && d(!1);
183
+ }, i = (b) => {
184
+ b.key === "Escape" && d(!1);
185
185
  };
186
- return document.addEventListener("click", $), document.addEventListener("keydown", o), () => {
187
- document.removeEventListener("click", $), document.removeEventListener("keydown", o);
186
+ return document.addEventListener("click", $), document.addEventListener("keydown", i), () => {
187
+ document.removeEventListener("click", $), document.removeEventListener("keydown", i);
188
188
  };
189
189
  }, [a]);
190
- const I = g.current?.closest(".ss-bar"), C = w && I ? de(
191
- /* @__PURE__ */ d(
190
+ const I = v.current?.closest(".ss-bar"), C = k && I ? de(
191
+ /* @__PURE__ */ l(
192
192
  "div",
193
193
  {
194
194
  ref: p,
195
195
  className: `ss-tooltip ${a ? "ss-pinned" : ""}`,
196
196
  style: E,
197
197
  children: [
198
- /* @__PURE__ */ d("div", { className: "ss-tooltip-inner", style: { position: "relative" }, children: [
198
+ /* @__PURE__ */ l("div", { className: "ss-tooltip-inner", style: { position: "relative" }, children: [
199
199
  a && /* @__PURE__ */ e(
200
200
  "button",
201
201
  {
202
202
  className: "ss-tooltip-close",
203
203
  onClick: ($) => {
204
- $.stopPropagation(), h(!1);
204
+ $.stopPropagation(), d(!1);
205
205
  },
206
206
  type: "button",
207
207
  children: "×"
208
208
  }
209
209
  ),
210
- /* @__PURE__ */ d("div", { className: "ss-tooltip-header", children: [
210
+ /* @__PURE__ */ l("div", { className: "ss-tooltip-header", children: [
211
211
  /* @__PURE__ */ e("span", { className: "ss-tooltip-title", children: s.title }),
212
212
  s.unit && /* @__PURE__ */ e("span", { className: "ss-tooltip-unit", children: s.unit })
213
213
  ] }),
214
- /* @__PURE__ */ d("div", { className: "ss-tooltip-current", children: [
214
+ /* @__PURE__ */ l("div", { className: "ss-tooltip-current", children: [
215
215
  /* @__PURE__ */ e("span", { className: "ss-tooltip-current-label", children: "Current: " }),
216
- /* @__PURE__ */ e("span", { className: "ss-tooltip-current-value", children: m })
216
+ /* @__PURE__ */ e("span", { className: "ss-tooltip-current-value", children: h })
217
217
  ] }),
218
- b && /* @__PURE__ */ d("div", { className: "ss-tooltip-stats", children: [
219
- /* @__PURE__ */ d("span", { children: [
218
+ m && /* @__PURE__ */ l("div", { className: "ss-tooltip-stats", children: [
219
+ /* @__PURE__ */ l("span", { children: [
220
220
  "Min: ",
221
- U(b.min, s.unit)
221
+ U(m.min, s.unit)
222
222
  ] }),
223
- /* @__PURE__ */ d("span", { children: [
223
+ /* @__PURE__ */ l("span", { children: [
224
224
  "Max: ",
225
- U(b.max, s.unit)
225
+ U(m.max, s.unit)
226
226
  ] }),
227
- /* @__PURE__ */ d("span", { children: [
227
+ /* @__PURE__ */ l("span", { children: [
228
228
  "Avg: ",
229
- U(b.avg, s.unit)
229
+ U(m.avg, s.unit)
230
230
  ] })
231
231
  ] }),
232
232
  f && /* @__PURE__ */ e("div", { className: "ss-tooltip-details", children: f }),
233
- t.length > 0 && /* @__PURE__ */ d(H, { children: [
234
- /* @__PURE__ */ e("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ e(he, { data: t, color: y }) }),
235
- /* @__PURE__ */ d("div", { className: "ss-tooltip-samples", children: [
233
+ t.length > 0 && /* @__PURE__ */ l(H, { children: [
234
+ /* @__PURE__ */ e("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ e(he, { data: t, color: w }) }),
235
+ /* @__PURE__ */ l("div", { className: "ss-tooltip-samples", children: [
236
236
  "Last ",
237
237
  Math.min(t.length, 60),
238
238
  " samples (~",
@@ -247,21 +247,21 @@ function be({ metric: s, stats: i, history: t, className: n = "" }) {
247
247
  ),
248
248
  I
249
249
  ) : null;
250
- return /* @__PURE__ */ d(H, { children: [
251
- /* @__PURE__ */ d(
250
+ return /* @__PURE__ */ l(H, { children: [
251
+ /* @__PURE__ */ l(
252
252
  "div",
253
253
  {
254
- ref: g,
255
- className: `ss-badge ${a ? "ss-pinned" : ""} ${n}`,
254
+ ref: v,
255
+ className: `ss-badge ${a ? "ss-pinned" : ""} ${o}`,
256
256
  onClick: _,
257
- onMouseEnter: () => !a && r(!0),
258
- onMouseLeave: () => r(!1),
257
+ onMouseEnter: () => !a && n(!0),
258
+ onMouseLeave: () => n(!1),
259
259
  role: "button",
260
260
  tabIndex: 0,
261
261
  onKeyDown: ($) => $.key === "Enter" && _($),
262
262
  children: [
263
263
  /* @__PURE__ */ e("span", { className: "ss-label", children: s.label }),
264
- /* @__PURE__ */ e("span", { className: `ss-value ${l}`, children: m })
264
+ /* @__PURE__ */ e("span", { className: `ss-value ${u}`, children: h })
265
265
  ]
266
266
  }
267
267
  ),
@@ -270,85 +270,85 @@ function be({ metric: s, stats: i, history: t, className: n = "" }) {
270
270
  }
271
271
  function We(s) {
272
272
  const {
273
- featureOptions: i,
273
+ featureOptions: r,
274
274
  autoHideOnUnauthorized: t = !0,
275
- onOpenDebugPanel: n,
275
+ onOpenDebugPanel: o,
276
276
  debugPanelOpen: a = !1,
277
- onConnectionChange: h,
278
- ...c
279
- } = s, { stats: r, getHistory: g, isConnected: p, isStale: m, unauthorized: l } = ue(c);
277
+ onConnectionChange: d,
278
+ ...g
279
+ } = s, { stats: n, getHistory: v, isConnected: p, isStale: h, unauthorized: u } = ue(g);
280
280
  R(() => {
281
- h?.(p);
282
- }, [p, h]);
283
- const { features: y } = z(i), { theme: f } = A(), [b, w] = N(() => typeof window > "u" ? !0 : localStorage.getItem("admin:stats-bar") !== "hidden"), E = j(null), _ = j(null);
281
+ d?.(p);
282
+ }, [p, d]);
283
+ const { features: w } = z(r), { theme: f } = A(), [m, k] = y(() => typeof window > "u" ? !0 : localStorage.getItem("admin:stats-bar") !== "hidden"), E = j(null), _ = j(null);
284
284
  R(() => {
285
- t && l && w(!1);
286
- }, [t, l]);
285
+ t && u && k(!1);
286
+ }, [t, u]);
287
287
  const I = B(() => {
288
- w((v) => {
289
- const x = !v;
288
+ k((b) => {
289
+ const x = !b;
290
290
  return localStorage.setItem("admin:stats-bar", x ? "visible" : "hidden"), x;
291
291
  });
292
292
  }, []);
293
293
  R(() => {
294
- const v = _.current;
295
- if (!v) return;
296
- const x = (k) => {
297
- Math.abs(k.deltaX) > Math.abs(k.deltaY) || (k.preventDefault(), v.scrollLeft += k.deltaY);
294
+ const b = _.current;
295
+ if (!b) return;
296
+ const x = (N) => {
297
+ Math.abs(N.deltaX) > Math.abs(N.deltaY) || (N.preventDefault(), b.scrollLeft += N.deltaY);
298
298
  };
299
- return v.addEventListener("wheel", x, { passive: !1 }), () => v.removeEventListener("wheel", x);
299
+ return b.addEventListener("wheel", x, { passive: !1 }), () => b.removeEventListener("wheel", x);
300
300
  }, []);
301
- const C = O(() => r ? ne(r) : oe(y), [r, y]), $ = O(
302
- () => ie.filter((v) => C.has(v.group || "core")),
301
+ const C = O(() => n ? ne(n) : oe(w), [n, w]), $ = O(
302
+ () => ie.filter((b) => C.has(b.group || "core")),
303
303
  [C]
304
- ), o = O(() => {
305
- const v = [];
304
+ ), i = O(() => {
305
+ const b = [];
306
306
  let x = "";
307
- for (const k of $) {
308
- const D = k.group || "core";
309
- D !== x && (x = D, v.push({ group: x, metrics: [] })), v[v.length - 1].metrics.push(k);
307
+ for (const N of $) {
308
+ const D = N.group || "core";
309
+ D !== x && (x = D, b.push({ group: x, metrics: [] })), b[b.length - 1].metrics.push(N);
310
310
  }
311
- return v;
311
+ return b;
312
312
  }, [$]);
313
- return t && l ? null : /* @__PURE__ */ d(H, { children: [
314
- /* @__PURE__ */ d(
313
+ return t && u ? null : /* @__PURE__ */ l(H, { children: [
314
+ /* @__PURE__ */ l(
315
315
  "button",
316
316
  {
317
317
  type: "button",
318
- className: `ss-toggle ${b ? "ss-visible" : "ss-collapsed"}`,
318
+ className: `ss-toggle ${m ? "ss-visible" : "ss-collapsed"}`,
319
319
  onClick: I,
320
- title: b ? "Hide stats bar" : "Show stats bar",
320
+ title: m ? "Hide stats bar" : "Show stats bar",
321
321
  "data-ss-theme": f,
322
322
  children: [
323
- !b && r && /* @__PURE__ */ d("span", { className: "ss-toggle-summary", style: { display: "flex" }, children: [
324
- C.has("process") && /* @__PURE__ */ d(H, { children: [
325
- /* @__PURE__ */ d(
323
+ !m && n && /* @__PURE__ */ l("span", { className: "ss-toggle-summary", style: { display: "flex" }, children: [
324
+ C.has("process") && /* @__PURE__ */ l(H, { children: [
325
+ /* @__PURE__ */ l(
326
326
  "span",
327
327
  {
328
- className: `ss-value ${r.cpuPercent > 80 ? "ss-red" : r.cpuPercent > 50 ? "ss-amber" : "ss-green"}`,
328
+ className: `ss-value ${n.cpuPercent > 80 ? "ss-red" : n.cpuPercent > 50 ? "ss-amber" : "ss-green"}`,
329
329
  children: [
330
- r.cpuPercent.toFixed(0),
330
+ n.cpuPercent.toFixed(0),
331
331
  "%"
332
332
  ]
333
333
  }
334
334
  ),
335
- /* @__PURE__ */ e("span", { className: "ss-value ss-green", children: r.memHeapUsed !== void 0 ? Math.round(r.memHeapUsed / (1024 * 1024)) + "M" : "-" })
335
+ /* @__PURE__ */ e("span", { className: "ss-value ss-green", children: n.memHeapUsed !== void 0 ? Math.round(n.memHeapUsed / (1024 * 1024)) + "M" : "-" })
336
336
  ] }),
337
- C.has("redis") && r.redisOk !== void 0 && /* @__PURE__ */ e("span", { className: `ss-value ${r.redisOk ? "ss-green" : "ss-red"}`, children: r.redisOk ? "✓" : "✗" })
337
+ C.has("redis") && n.redisOk !== void 0 && /* @__PURE__ */ e("span", { className: `ss-value ${n.redisOk ? "ss-green" : "ss-red"}`, children: n.redisOk ? "✓" : "✗" })
338
338
  ] }),
339
- b && /* @__PURE__ */ e("span", { className: "ss-toggle-label", style: { color: "#737373" }, children: "hide stats" }),
340
- /* @__PURE__ */ e("span", { className: "ss-toggle-arrow", children: b ? "▼" : "▲" })
339
+ m && /* @__PURE__ */ e("span", { className: "ss-toggle-label", style: { color: "#737373" }, children: "hide stats" }),
340
+ /* @__PURE__ */ e("span", { className: "ss-toggle-arrow", children: m ? "▼" : "▲" })
341
341
  ]
342
342
  }
343
343
  ),
344
- /* @__PURE__ */ d("div", { ref: E, className: b ? "ss-bar" : "ss-bar ss-hidden", "data-ss-theme": f, children: [
345
- /* @__PURE__ */ d("div", { className: "ss-bar-left", children: [
346
- n && /* @__PURE__ */ e(
344
+ /* @__PURE__ */ l("div", { ref: E, className: m ? "ss-bar" : "ss-bar ss-hidden", "data-ss-theme": f, children: [
345
+ /* @__PURE__ */ l("div", { className: "ss-bar-left", children: [
346
+ o && /* @__PURE__ */ e(
347
347
  "button",
348
348
  {
349
349
  type: "button",
350
350
  className: `ss-dbg-btn ${a ? "ss-dbg-active" : ""}`,
351
- onClick: n,
351
+ onClick: o,
352
352
  title: "Toggle debug panel",
353
353
  id: "ss-dbg-wrench",
354
354
  children: /* @__PURE__ */ e(
@@ -367,36 +367,36 @@ function We(s) {
367
367
  )
368
368
  }
369
369
  ),
370
- /* @__PURE__ */ e("div", { className: m ? "ss-dot ss-stale" : "ss-dot" })
370
+ /* @__PURE__ */ e("div", { className: h ? "ss-dot ss-stale" : "ss-dot" })
371
371
  ] }),
372
- /* @__PURE__ */ e("div", { ref: _, className: "ss-bar-scroll", id: "ss-bar-scroll", children: r && o.map((v, x) => /* @__PURE__ */ d(K.Fragment, { children: [
372
+ /* @__PURE__ */ e("div", { ref: _, className: "ss-bar-scroll", id: "ss-bar-scroll", children: n && i.map((b, x) => /* @__PURE__ */ l(K.Fragment, { children: [
373
373
  x > 0 && /* @__PURE__ */ e("div", { className: "ss-group-sep" }),
374
- /* @__PURE__ */ e("div", { className: "ss-group", children: v.metrics.map((k) => /* @__PURE__ */ e(
374
+ /* @__PURE__ */ e("div", { className: "ss-group", children: b.metrics.map((N) => /* @__PURE__ */ e(
375
375
  be,
376
376
  {
377
- metric: k,
378
- stats: r,
379
- history: g(k.historyKey || "")
377
+ metric: N,
378
+ stats: n,
379
+ history: v(N.historyKey || "")
380
380
  },
381
- k.id
381
+ N.id
382
382
  )) })
383
- ] }, v.group)) })
383
+ ] }, b.group)) })
384
384
  ] })
385
385
  ] });
386
386
  }
387
387
  function J({
388
388
  theme: s,
389
- onToggle: i,
389
+ onToggle: r,
390
390
  className: t = "",
391
- classPrefix: n = "ss-dash"
391
+ classPrefix: o = "ss-dash"
392
392
  }) {
393
393
  const a = s === "dark";
394
394
  return /* @__PURE__ */ e(
395
395
  "button",
396
396
  {
397
397
  type: "button",
398
- className: `${n === "ss-dbg" ? "ss-dbg-theme-toggle" : "ss-dash-theme-btn"} ${t}`,
399
- onClick: i,
398
+ className: `${o === "ss-dbg" ? "ss-dbg-theme-toggle" : "ss-dash-theme-btn"} ${t}`,
399
+ onClick: r,
400
400
  title: a ? "Switch to light theme" : "Switch to dark theme",
401
401
  "aria-label": a ? "Switch to light theme" : "Switch to dark theme",
402
402
  children: a ? (
@@ -435,23 +435,23 @@ function J({
435
435
  }
436
436
  );
437
437
  }
438
- const ge = T(() => import("./QueriesTab-fyBB1u_Y.js")), ve = T(() => import("./EventsTab-eCh02cdd.js")), fe = T(() => import("./EmailsTab-Dh2YSa_f.js")), we = T(() => import("./RoutesTab-D3l8TOpu.js")), ke = T(() => import("./LogsTab-D-kR7PjX.js")), Ne = T(() => import("./TimelineTab-C5TFaSmQ.js")), ye = T(() => import("./CacheTab-CnVW5PLs.js")), Ce = T(() => import("./JobsTab-Dl5nrj2z.js")), Se = T(() => import("./ConfigTab-BSWq_o2p.js")), Le = T(() => import("./InternalsTab-Oij0A2fN.js")), Te = T(() => import("./CustomPaneTab-xjkYwTvH.js"));
438
+ const ge = T(() => import("./QueriesTab-DbBmAqzO.js")), ve = T(() => import("./EventsTab-CC6DQzEm.js")), fe = T(() => import("./EmailsTab-Uh2CQY3o.js")), we = T(() => import("./RoutesTab-Bwreij3e.js")), ke = T(() => import("./LogsTab-BbYK-iyh.js")), Ne = T(() => import("./TimelineTab-6hthfdBB.js")), ye = T(() => import("./CacheTab-DYmsZJJ1.js")), Ce = T(() => import("./JobsTab-B3Lfdqed.js")), Se = T(() => import("./ConfigTab-CcN-tfjv.js")), Le = T(() => import("./InternalsTab-Oij0A2fN.js")), Te = T(() => import("./CustomPaneTab-D7_o3Ec6.js"));
439
439
  function Je(s) {
440
440
  const {
441
- defaultOpen: i = !1,
441
+ defaultOpen: r = !1,
442
442
  dashboardPath: t,
443
- isOpen: n,
443
+ isOpen: o,
444
444
  onOpenChange: a,
445
- isLive: h = !1,
446
- ...c
447
- } = s, [r, g] = N(i), p = n !== void 0 ? n : r, m = (o) => {
448
- a ? a(o) : g(o);
449
- }, [l, y] = N("queries"), { features: f } = z(c), { theme: b, toggleTheme: w } = A(), E = f.customPanes || [];
445
+ isLive: d = !1,
446
+ ...g
447
+ } = s, [n, v] = y(r), p = o !== void 0 ? o : n, h = (i) => {
448
+ a ? a(i) : v(i);
449
+ }, [u, w] = y("queries"), { features: f } = z(g), { theme: m, toggleTheme: k } = A(), E = f.customPanes || [];
450
450
  R(() => {
451
- const o = (v) => {
452
- v.key === "Escape" && p && m(!1);
451
+ const i = (b) => {
452
+ b.key === "Escape" && p && h(!1);
453
453
  };
454
- return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
454
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
455
455
  }, [p]);
456
456
  const _ = O(
457
457
  () => [
@@ -467,42 +467,42 @@ function Je(s) {
467
467
  { id: "internals", label: "Internals", visible: !0 }
468
468
  ],
469
469
  [f]
470
- ), I = O(() => _.filter((o) => o.visible), [_]);
470
+ ), I = O(() => _.filter((i) => i.visible), [_]);
471
471
  R(() => {
472
- const o = [
473
- ...I.map((v) => v.id),
474
- ...E.map((v) => v.id)
472
+ const i = [
473
+ ...I.map((b) => b.id),
474
+ ...E.map((b) => b.id)
475
475
  ];
476
- !o.includes(l) && o.length > 0 && y(o[0]);
477
- }, [I, E, l]);
476
+ !i.includes(u) && i.length > 0 && w(i[0]);
477
+ }, [I, E, u]);
478
478
  const C = B(() => {
479
- m(!p);
479
+ h(!p);
480
480
  }, [p]), $ = B(() => {
481
- const o = { options: c }, v = E.find((k) => k.id === l);
482
- if (v)
483
- return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: /* @__PURE__ */ e(Te, { pane: v, options: c }) });
481
+ const i = { options: g }, b = E.find((N) => N.id === u);
482
+ if (b)
483
+ return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: /* @__PURE__ */ e(Te, { pane: b, options: g }) });
484
484
  const x = {
485
- queries: /* @__PURE__ */ e(ge, { ...o }),
486
- events: /* @__PURE__ */ e(ve, { ...o }),
487
- emails: /* @__PURE__ */ e(fe, { ...o }),
485
+ queries: /* @__PURE__ */ e(ge, { ...i }),
486
+ events: /* @__PURE__ */ e(ve, { ...i }),
487
+ emails: /* @__PURE__ */ e(fe, { ...i }),
488
488
  routes: /* @__PURE__ */ e(
489
489
  we,
490
490
  {
491
- ...o,
491
+ ...i,
492
492
  currentPath: typeof window < "u" ? window.location.pathname : ""
493
493
  }
494
494
  ),
495
- logs: /* @__PURE__ */ e(ke, { ...o }),
496
- timeline: /* @__PURE__ */ e(Ne, { ...o }),
497
- cache: /* @__PURE__ */ e(ye, { ...o, dashboardPath: t }),
498
- jobs: /* @__PURE__ */ e(Ce, { ...o, dashboardPath: t }),
499
- config: /* @__PURE__ */ e(Se, { ...o, dashboardPath: t }),
500
- internals: /* @__PURE__ */ e(Le, { ...o })
495
+ logs: /* @__PURE__ */ e(ke, { ...i }),
496
+ timeline: /* @__PURE__ */ e(Ne, { ...i }),
497
+ cache: /* @__PURE__ */ e(ye, { ...i, dashboardPath: t }),
498
+ jobs: /* @__PURE__ */ e(Ce, { ...i, dashboardPath: t }),
499
+ config: /* @__PURE__ */ e(Se, { ...i, dashboardPath: t }),
500
+ internals: /* @__PURE__ */ e(Le, { ...i })
501
501
  };
502
- return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: x[l] || /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Unknown tab" }) });
503
- }, [l, c, E]);
504
- return /* @__PURE__ */ d(H, { children: [
505
- n === void 0 && /* @__PURE__ */ e(
502
+ return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: x[u] || /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Unknown tab" }) });
503
+ }, [u, g, E]);
504
+ return /* @__PURE__ */ l(H, { children: [
505
+ o === void 0 && /* @__PURE__ */ e(
506
506
  "button",
507
507
  {
508
508
  type: "button",
@@ -526,56 +526,56 @@ function Je(s) {
526
526
  )
527
527
  }
528
528
  ),
529
- /* @__PURE__ */ d(
529
+ /* @__PURE__ */ l(
530
530
  "div",
531
531
  {
532
532
  className: `ss-dbg-panel ${p ? "ss-dbg-open" : ""}`,
533
- "data-ss-theme": b,
533
+ "data-ss-theme": m,
534
534
  id: "ss-dbg-panel",
535
535
  children: [
536
- /* @__PURE__ */ d("div", { className: "ss-dbg-tabs", children: [
537
- /* @__PURE__ */ d("div", { className: "ss-dbg-tabs-scroll", children: [
538
- I.map((o) => /* @__PURE__ */ d(
536
+ /* @__PURE__ */ l("div", { className: "ss-dbg-tabs", children: [
537
+ /* @__PURE__ */ l("div", { className: "ss-dbg-tabs-scroll", children: [
538
+ I.map((i) => /* @__PURE__ */ l(
539
539
  "button",
540
540
  {
541
541
  type: "button",
542
- className: `ss-dbg-tab ${l === o.id ? "ss-dbg-active" : ""}`,
543
- onClick: () => y(o.id),
542
+ className: `ss-dbg-tab ${u === i.id ? "ss-dbg-active" : ""}`,
543
+ onClick: () => w(i.id),
544
544
  children: [
545
- L[o.id] ? /* @__PURE__ */ e(
545
+ L[i.id] ? /* @__PURE__ */ e(
546
546
  "svg",
547
547
  {
548
548
  className: "ss-dbg-tab-icon",
549
- viewBox: L[o.id].viewBox,
550
- dangerouslySetInnerHTML: { __html: L[o.id].elements.join("") }
549
+ viewBox: L[i.id].viewBox,
550
+ dangerouslySetInnerHTML: { __html: L[i.id].elements.join("") }
551
551
  }
552
552
  ) : null,
553
- o.label
553
+ i.label
554
554
  ]
555
555
  },
556
- o.id
556
+ i.id
557
557
  )),
558
- E.map((o) => /* @__PURE__ */ e(
558
+ E.map((i) => /* @__PURE__ */ e(
559
559
  "button",
560
560
  {
561
561
  type: "button",
562
- className: `ss-dbg-tab ${l === o.id ? "ss-dbg-active" : ""}`,
563
- onClick: () => y(o.id),
564
- children: o.label
562
+ className: `ss-dbg-tab ${u === i.id ? "ss-dbg-active" : ""}`,
563
+ onClick: () => w(i.id),
564
+ children: i.label
565
565
  },
566
- o.id
566
+ i.id
567
567
  ))
568
568
  ] }),
569
- /* @__PURE__ */ d("div", { className: "ss-dbg-tabs-right", children: [
569
+ /* @__PURE__ */ l("div", { className: "ss-dbg-tabs-right", children: [
570
570
  /* @__PURE__ */ e(
571
571
  "span",
572
572
  {
573
- className: `ss-dbg-conn-mode ${h ? "ss-dbg-conn-live" : "ss-dbg-conn-polling"}`,
574
- title: h ? "Connected via Transmit (SSE) — real-time updates" : "Polling every 3s",
575
- children: h ? "live" : "polling"
573
+ className: `ss-dbg-conn-mode ${d ? "ss-dbg-conn-live" : "ss-dbg-conn-polling"}`,
574
+ title: d ? "Connected via Transmit (SSE) — real-time updates" : "Polling every 3s",
575
+ children: d ? "live" : "polling"
576
576
  }
577
577
  ),
578
- /* @__PURE__ */ e(J, { theme: b, onToggle: w, classPrefix: "ss-dbg" }),
578
+ /* @__PURE__ */ e(J, { theme: m, onToggle: k, classPrefix: "ss-dbg" }),
579
579
  t && /* @__PURE__ */ e(
580
580
  "a",
581
581
  {
@@ -605,7 +605,7 @@ function Je(s) {
605
605
  {
606
606
  type: "button",
607
607
  className: "ss-dbg-close",
608
- onClick: () => m(!1),
608
+ onClick: () => h(!1),
609
609
  title: "Close panel",
610
610
  children: "×"
611
611
  }
@@ -618,28 +618,28 @@ function Je(s) {
618
618
  )
619
619
  ] });
620
620
  }
621
- function Ee(s, i = {}) {
621
+ function Ee(s, r = {}) {
622
622
  const {
623
623
  baseUrl: t = "",
624
- dashboardEndpoint: n = "/__stats/api",
624
+ dashboardEndpoint: o = "/__stats/api",
625
625
  authToken: a,
626
- page: h = 1,
627
- perPage: c = 50,
628
- search: r,
629
- sort: g,
626
+ page: d = 1,
627
+ perPage: g = 50,
628
+ search: n,
629
+ sort: v,
630
630
  sortDir: p,
631
- filters: m,
632
- timeRange: l,
633
- refreshKey: y
634
- } = i, [f, b] = N(null), [w, E] = N(null), [_, I] = N(!0), [C, $] = N(null), o = j(null), v = j(s), x = j(!1);
635
- o.current || (o.current = new re({
631
+ filters: h,
632
+ timeRange: u,
633
+ refreshKey: w
634
+ } = r, [f, m] = y(null), [k, E] = y(null), [_, I] = y(!0), [C, $] = y(null), i = j(null), b = j(s), x = j(!1);
635
+ i.current || (i.current = new re({
636
636
  baseUrl: t,
637
- endpoint: n,
637
+ endpoint: o,
638
638
  authToken: a,
639
639
  section: s,
640
- perPage: c,
640
+ perPage: g,
641
641
  callbacks: {
642
- onData: (M) => b(M),
642
+ onData: (M) => m(M),
643
643
  onPagination: (M) => E(M),
644
644
  onLoading: (M) => I(M),
645
645
  onError: (M) => $(M),
@@ -647,18 +647,18 @@ function Ee(s, i = {}) {
647
647
  }
648
648
  }
649
649
  })), R(() => {
650
- const M = o.current, u = v.current !== s;
651
- return v.current = s, M.configure({ page: h, perPage: c, search: r, sort: g, sortDir: p, filters: m, timeRange: l }), u || !x.current ? (u ? M.setSection(s) : M.start(), x.current = !0) : M.fetch(!0), () => {
650
+ const M = i.current, c = b.current !== s;
651
+ return b.current = s, M.configure({ page: d, perPage: g, search: n, sort: v, sortDir: p, filters: h, timeRange: u }), c || !x.current ? (c ? M.setSection(s) : M.start(), x.current = !0) : M.fetch(!0), () => {
652
652
  M.stop();
653
653
  };
654
- }, [s, h, c, r, g, p, m, l, y]);
655
- const k = B(() => {
656
- o.current?.fetch(!0);
654
+ }, [s, d, g, n, v, p, h, u, w]);
655
+ const N = B(() => {
656
+ i.current?.fetch(!0);
657
657
  }, []), D = B(
658
- async (M, u = "post", S) => o.current.mutate(M, u, S),
658
+ async (M, c = "post", S) => i.current.mutate(M, c, S),
659
659
  []
660
- ), P = B(() => o.current.getApi(), []);
661
- return { data: f, meta: w, isLoading: _, error: C, refresh: k, mutate: D, getApi: P };
660
+ ), P = B(() => i.current.getApi(), []);
661
+ return { data: f, meta: k, isLoading: _, error: C, refresh: N, mutate: D, getApi: P };
662
662
  }
663
663
  const $e = [
664
664
  "overview",
@@ -673,60 +673,60 @@ const $e = [
673
673
  "jobs",
674
674
  "config",
675
675
  "internals"
676
- ], xe = T(() => import("./OverviewSection-nm3xdACz.js")), Ie = T(() => import("./RequestsSection-DTqB81ac.js")), Be = T(() => import("./QueriesSection-DB12HMfQ.js")), Me = T(() => import("./EventsSection-C1pbJDfW.js")), Re = T(() => import("./RoutesSection-DJWa4NPV.js")), Oe = T(() => import("./LogsSection-C1p81fXO.js")), _e = T(() => import("./EmailsSection-CSyTg1aX.js")), De = T(() => import("./TimelineSection-C4d-jRX1.js")), je = T(() => import("./CacheSection-DGxMDlWK.js")), He = T(() => import("./JobsSection-CLAin5vU.js")), Pe = T(() => import("./ConfigSection-DPcrfqXY.js")), qe = T(() => import("./InternalsSection-t7ihcWO-.js"));
676
+ ], xe = T(() => import("./OverviewSection-CkBGFEWq.js")), Ie = T(() => import("./RequestsSection-Cb5a6MlT.js")), Be = T(() => import("./QueriesSection-CfCpnNUD.js")), Me = T(() => import("./EventsSection-CGQWiIdV.js")), Re = T(() => import("./RoutesSection-CRqF-cNM.js")), Oe = T(() => import("./LogsSection-Cly1dpvS.js")), _e = T(() => import("./EmailsSection-BzlsTdPs.js")), De = T(() => import("./TimelineSection-B2y06kRE.js")), je = T(() => import("./CacheSection-xH75hwXu.js")), He = T(() => import("./JobsSection-D7AHQmZi.js")), Pe = T(() => import("./ConfigSection-D8BO1Ry9.js")), qe = T(() => import("./InternalsSection-t7ihcWO-.js"));
677
677
  function W(s) {
678
678
  return s === "timeline" ? "dashboard-timeline" : s;
679
679
  }
680
680
  function Ve(s) {
681
681
  const {
682
- baseUrl: i = "",
682
+ baseUrl: r = "",
683
683
  dashboardEndpoint: t = "/__stats/api",
684
- debugEndpoint: n,
684
+ debugEndpoint: o,
685
685
  authToken: a,
686
- backUrl: h = "/",
687
- channelName: c = "server-stats/dashboard"
688
- } = s, { features: r } = z({ baseUrl: i, debugEndpoint: n, authToken: a }), { theme: g, toggleTheme: p } = A(), [m, l] = N("overview"), [y, f] = N(() => typeof window > "u" ? !1 : localStorage.getItem("ss-dash-sidebar") === "collapsed"), [b, w] = N(!1), [E, _] = N(0), I = j(0);
686
+ backUrl: d = "/",
687
+ channelName: g = "server-stats/dashboard"
688
+ } = s, { features: n } = z({ baseUrl: r, debugEndpoint: o, authToken: a }), { theme: v, toggleTheme: p } = A(), [h, u] = y("overview"), [w, f] = y(() => typeof window > "u" ? !1 : localStorage.getItem("ss-dash-sidebar") === "collapsed"), [m, k] = y(!1), [E, _] = y(0), I = j(0);
689
689
  R(() => {
690
- if (!c) return;
691
- const u = ae({
692
- baseUrl: i,
693
- channelName: c,
690
+ if (!g) return;
691
+ const c = ae({
692
+ baseUrl: r,
693
+ channelName: g,
694
694
  authToken: a,
695
695
  onMessage: () => {
696
696
  I.current += 1, _(I.current);
697
697
  },
698
- onConnect: () => w(!0),
699
- onDisconnect: () => w(!1),
700
- onError: () => w(!1)
698
+ onConnect: () => k(!0),
699
+ onDisconnect: () => k(!1),
700
+ onError: () => k(!1)
701
701
  });
702
- return () => u.unsubscribe();
703
- }, [i, c, a]);
704
- const C = r.customPanes || [], $ = B(
705
- (u) => {
706
- const S = u.replace("#", "").split("?")[0];
702
+ return () => c.unsubscribe();
703
+ }, [r, g, a]);
704
+ const C = n.customPanes || [], $ = B(
705
+ (c) => {
706
+ const S = c.replace("#", "").split("?")[0];
707
707
  return S && [...$e, ...C.map((V) => V.id)].includes(S) ? S : "overview";
708
708
  },
709
709
  [C]
710
710
  );
711
711
  R(() => {
712
712
  if (typeof window > "u") return;
713
- const u = $(window.location.hash);
714
- (u !== "overview" || window.location.hash) && l(u);
713
+ const c = $(window.location.hash);
714
+ (c !== "overview" || window.location.hash) && u(c);
715
715
  }, [$]), R(() => {
716
- const u = () => {
716
+ const c = () => {
717
717
  const S = $(window.location.hash);
718
- S !== m && l(S);
718
+ S !== h && u(S);
719
719
  };
720
- return window.addEventListener("hashchange", u), () => window.removeEventListener("hashchange", u);
721
- }, [m, $]), R(() => {
722
- typeof window > "u" || (window.location.hash = m);
723
- }, [m]);
724
- const o = B(() => {
725
- f((u) => {
726
- const S = !u;
720
+ return window.addEventListener("hashchange", c), () => window.removeEventListener("hashchange", c);
721
+ }, [h, $]), R(() => {
722
+ typeof window > "u" || (window.location.hash = h);
723
+ }, [h]);
724
+ const i = B(() => {
725
+ f((c) => {
726
+ const S = !c;
727
727
  return localStorage.setItem("ss-dash-sidebar", S ? "collapsed" : "expanded"), S;
728
728
  });
729
- }, []), v = O(
729
+ }, []), b = O(
730
730
  () => [
731
731
  { id: "overview", label: "Overview", visible: !0 },
732
732
  { id: "requests", label: "Requests", visible: !0 },
@@ -735,107 +735,107 @@ function Ve(s) {
735
735
  { id: "routes", label: "Routes", visible: !0 },
736
736
  { id: "logs", label: "Logs", visible: !0 },
737
737
  { id: "emails", label: "Emails", visible: !0 },
738
- { id: "timeline", label: "Timeline", visible: r.tracing },
739
- { id: "cache", label: "Cache", visible: r.cache },
740
- { id: "jobs", label: "Jobs", visible: r.queues },
738
+ { id: "timeline", label: "Timeline", visible: n.tracing },
739
+ { id: "cache", label: "Cache", visible: n.cache },
740
+ { id: "jobs", label: "Jobs", visible: n.queues },
741
741
  { id: "config", label: "Config", visible: !0 },
742
742
  { id: "internals", label: "Internals", visible: !0 }
743
743
  ],
744
- [r]
745
- ), x = O(() => v.filter((u) => u.visible), [v]), k = O(
746
- () => ({ baseUrl: i, dashboardEndpoint: t, authToken: a, refreshKey: E }),
747
- [i, t, a, E]
748
- ), { data: D } = Ee("overview", k), P = O(() => {
744
+ [n]
745
+ ), x = O(() => b.filter((c) => c.visible), [b]), N = O(
746
+ () => ({ baseUrl: r, dashboardEndpoint: t, authToken: a, refreshKey: E }),
747
+ [r, t, a, E]
748
+ ), { data: D } = Ee("overview", N), P = O(() => {
749
749
  if (!D) return {};
750
- const u = {};
751
- if (D.totalRequests > 0 && (u.requests = { count: D.totalRequests }), D.queryStats?.total > 0 && (u.queries = { count: D.queryStats.total }), D.logLevelBreakdown) {
750
+ const c = {};
751
+ if (D.totalRequests > 0 && (c.requests = { count: D.totalRequests }), D.queryStats?.total > 0 && (c.queries = { count: D.queryStats.total }), D.logLevelBreakdown) {
752
752
  const S = D.logLevelBreakdown, q = S.error + S.warn + S.info + S.debug;
753
- q > 0 && (u.logs = { count: q });
753
+ q > 0 && (c.logs = { count: q });
754
754
  }
755
- return u;
755
+ return c;
756
756
  }, [D]), M = B(() => {
757
- const u = {
758
- overview: /* @__PURE__ */ e(xe, { options: k }),
759
- requests: /* @__PURE__ */ e(Ie, { options: k }),
760
- queries: /* @__PURE__ */ e(Be, { options: k }),
761
- events: /* @__PURE__ */ e(Me, { options: k }),
762
- routes: /* @__PURE__ */ e(Re, { options: k }),
763
- logs: /* @__PURE__ */ e(Oe, { options: k }),
764
- emails: /* @__PURE__ */ e(_e, { options: k }),
765
- timeline: /* @__PURE__ */ e(De, { options: k }),
766
- cache: /* @__PURE__ */ e(je, { options: k }),
767
- jobs: /* @__PURE__ */ e(He, { options: k }),
768
- config: /* @__PURE__ */ e(Pe, { options: k }),
769
- internals: /* @__PURE__ */ e(qe, { options: k, debugEndpoint: n })
757
+ const c = {
758
+ overview: /* @__PURE__ */ e(xe, { options: N }),
759
+ requests: /* @__PURE__ */ e(Ie, { options: N }),
760
+ queries: /* @__PURE__ */ e(Be, { options: N }),
761
+ events: /* @__PURE__ */ e(Me, { options: N }),
762
+ routes: /* @__PURE__ */ e(Re, { options: N }),
763
+ logs: /* @__PURE__ */ e(Oe, { options: N }),
764
+ emails: /* @__PURE__ */ e(_e, { options: N }),
765
+ timeline: /* @__PURE__ */ e(De, { options: N }),
766
+ cache: /* @__PURE__ */ e(je, { options: N }),
767
+ jobs: /* @__PURE__ */ e(He, { options: N }),
768
+ config: /* @__PURE__ */ e(Pe, { options: N }),
769
+ internals: /* @__PURE__ */ e(qe, { options: N, debugEndpoint: o })
770
770
  };
771
- return /* @__PURE__ */ e("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${m}`, children: /* @__PURE__ */ e("div", { className: "ss-dash-pane-inner", children: /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Loading..." }), children: u[m] || /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Unknown section" }) }) }) });
772
- }, [m, k]);
773
- return /* @__PURE__ */ d("div", { className: "ss-dash", "data-theme": g, id: "ss-dash", children: [
774
- /* @__PURE__ */ d("div", { className: "ss-dash-header", children: [
775
- /* @__PURE__ */ d("div", { className: "ss-dash-header-left", children: [
771
+ return /* @__PURE__ */ e("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${h}`, children: /* @__PURE__ */ e("div", { className: "ss-dash-pane-inner", children: /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Loading..." }), children: c[h] || /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Unknown section" }) }) }) });
772
+ }, [h, N]);
773
+ return /* @__PURE__ */ l("div", { className: "ss-dash", "data-theme": v, id: "ss-dash", children: [
774
+ /* @__PURE__ */ l("div", { className: "ss-dash-header", children: [
775
+ /* @__PURE__ */ l("div", { className: "ss-dash-header-left", children: [
776
776
  /* @__PURE__ */ e("span", { className: "ss-dash-logo", children: "Server Stats" }),
777
777
  /* @__PURE__ */ e("span", { className: "ss-dash-logo-sub", children: "Dashboard" })
778
778
  ] }),
779
- /* @__PURE__ */ d("div", { className: "ss-dash-header-center", children: [
779
+ /* @__PURE__ */ l("div", { className: "ss-dash-header-center", children: [
780
780
  /* @__PURE__ */ e(
781
781
  "span",
782
782
  {
783
- className: `ss-dash-live-dot ${b ? "ss-dash-connected" : ""}`,
783
+ className: `ss-dash-live-dot ${m ? "ss-dash-connected" : ""}`,
784
784
  id: "ss-dash-live-dot"
785
785
  }
786
786
  ),
787
787
  /* @__PURE__ */ e(
788
788
  "span",
789
789
  {
790
- className: `ss-dash-live-label ${b ? "ss-dash-connected" : ""}`,
790
+ className: `ss-dash-live-label ${m ? "ss-dash-connected" : ""}`,
791
791
  id: "ss-dash-live-label",
792
- children: b ? "Live" : "Polling"
792
+ children: m ? "Live" : "Polling"
793
793
  }
794
794
  )
795
795
  ] }),
796
- /* @__PURE__ */ d("div", { className: "ss-dash-header-right", children: [
797
- /* @__PURE__ */ e(J, { theme: g, onToggle: p }),
798
- h && /* @__PURE__ */ e("a", { href: h, className: "ss-dash-back-link", title: "Back to app", children: "← App" })
796
+ /* @__PURE__ */ l("div", { className: "ss-dash-header-right", children: [
797
+ /* @__PURE__ */ e(J, { theme: v, onToggle: p }),
798
+ d && /* @__PURE__ */ e("a", { href: d, className: "ss-dash-back-link", title: "Back to app", children: "← App" })
799
799
  ] })
800
800
  ] }),
801
- /* @__PURE__ */ d("div", { className: "ss-dash-body", children: [
802
- /* @__PURE__ */ d(
801
+ /* @__PURE__ */ l("div", { className: "ss-dash-body", children: [
802
+ /* @__PURE__ */ l(
803
803
  "div",
804
804
  {
805
- className: `ss-dash-sidebar ${y ? "ss-dash-collapsed" : ""}`,
805
+ className: `ss-dash-sidebar ${w ? "ss-dash-collapsed" : ""}`,
806
806
  id: "ss-dash-sidebar",
807
807
  children: [
808
- /* @__PURE__ */ d("nav", { className: "ss-dash-nav", children: [
809
- x.map((u) => {
810
- const S = P[u.id];
811
- return /* @__PURE__ */ d(
808
+ /* @__PURE__ */ l("nav", { className: "ss-dash-nav", children: [
809
+ x.map((c) => {
810
+ const S = P[c.id];
811
+ return /* @__PURE__ */ l(
812
812
  "button",
813
813
  {
814
814
  type: "button",
815
- className: `ss-dash-nav-item ${m === u.id ? "ss-dash-active" : ""}`,
816
- "data-ss-section": u.id,
815
+ className: `ss-dash-nav-item ${h === c.id ? "ss-dash-active" : ""}`,
816
+ "data-ss-section": c.id,
817
817
  onClick: () => {
818
- u.id !== m && l(u.id);
818
+ c.id !== h && u(c.id);
819
819
  },
820
- title: y ? u.label : void 0,
820
+ title: w ? c.label : void 0,
821
821
  children: [
822
822
  /* @__PURE__ */ e("span", { className: "ss-dash-nav-icon", children: /* @__PURE__ */ e(
823
823
  "svg",
824
824
  {
825
825
  width: "20",
826
826
  height: "20",
827
- viewBox: (L[W(u.id)] || L.config).viewBox,
827
+ viewBox: (L[W(c.id)] || L.config).viewBox,
828
828
  fill: "none",
829
829
  stroke: "currentColor",
830
830
  strokeWidth: "2",
831
831
  strokeLinecap: "round",
832
832
  strokeLinejoin: "round",
833
833
  dangerouslySetInnerHTML: {
834
- __html: (L[W(u.id)] || L.config).elements.join("")
834
+ __html: (L[W(c.id)] || L.config).elements.join("")
835
835
  }
836
836
  }
837
837
  ) }),
838
- /* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: u.label }),
838
+ /* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: c.label }),
839
839
  S && S.count > 0 && /* @__PURE__ */ e(
840
840
  "span",
841
841
  {
@@ -845,17 +845,17 @@ function Ve(s) {
845
845
  )
846
846
  ]
847
847
  },
848
- u.id
848
+ c.id
849
849
  );
850
850
  }),
851
851
  C.length > 0 && /* @__PURE__ */ e("div", { className: "ss-dash-nav-sep" }),
852
- C.map((u) => /* @__PURE__ */ d(
852
+ C.map((c) => /* @__PURE__ */ l(
853
853
  "button",
854
854
  {
855
855
  type: "button",
856
- className: `ss-dash-nav-item ${m === u.id ? "ss-dash-active" : ""}`,
857
- onClick: () => l(u.id),
858
- title: y ? u.label : void 0,
856
+ className: `ss-dash-nav-item ${h === c.id ? "ss-dash-active" : ""}`,
857
+ onClick: () => u(c.id),
858
+ title: w ? c.label : void 0,
859
859
  children: [
860
860
  /* @__PURE__ */ e("span", { className: "ss-dash-nav-icon", children: /* @__PURE__ */ e(
861
861
  "svg",
@@ -871,10 +871,10 @@ function Ve(s) {
871
871
  dangerouslySetInnerHTML: { __html: L["custom-pane"].elements.join("") }
872
872
  }
873
873
  ) }),
874
- /* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: u.label })
874
+ /* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: c.label })
875
875
  ]
876
876
  },
877
- u.id
877
+ c.id
878
878
  ))
879
879
  ] }),
880
880
  /* @__PURE__ */ e(
@@ -883,9 +883,9 @@ function Ve(s) {
883
883
  type: "button",
884
884
  className: "ss-dash-sidebar-toggle",
885
885
  id: "ss-dash-sidebar-toggle",
886
- onClick: o,
887
- title: y ? "Expand sidebar" : "Collapse sidebar",
888
- children: y ? /* @__PURE__ */ e(
886
+ onClick: i,
887
+ title: w ? "Expand sidebar" : "Collapse sidebar",
888
+ children: w ? /* @__PURE__ */ e(
889
889
  "svg",
890
890
  {
891
891
  width: "16",
@@ -917,57 +917,58 @@ function Ve(s) {
917
917
  ] })
918
918
  ] });
919
919
  }
920
- function Ke(s, i = {}) {
921
- const { baseUrl: t = "", debugEndpoint: n = "/admin/api/debug", authToken: a } = i, [h, c] = N(null), [r, g] = N(!0), [p, m] = N(null), l = j(null);
922
- l.current || (l.current = new le({
920
+ function Ke(s, r = {}) {
921
+ const { baseUrl: t = "", debugEndpoint: o = "/admin/api/debug", authToken: a } = r, [d, g] = y(null), [n, v] = y(!0), [p, h] = y(null), u = j(null);
922
+ u.current || (u.current = new le({
923
923
  baseUrl: t,
924
- endpoint: n,
924
+ endpoint: o,
925
925
  authToken: a,
926
- onData: (w) => c(w),
927
- onLoading: (w) => g(w),
928
- onError: (w) => m(w),
929
- onUnauthorized: (w) => m(w)
926
+ onData: (k) => g(k),
927
+ onLoading: (k) => v(k),
928
+ onError: (k) => h(k),
929
+ onUnauthorized: (k) => h(k)
930
930
  })), R(() => {
931
- const w = l.current;
932
- return w.start(s), () => w.stop();
931
+ const k = u.current;
932
+ return k.start(s), () => k.stop();
933
933
  }, [s]);
934
- const y = B(() => {
935
- l.current?.refresh();
934
+ const w = B(() => {
935
+ u.current?.refresh();
936
936
  }, []), f = B(() => {
937
- c(null);
938
- }, []), b = B((w, E) => {
939
- l.current?.cacheForTab(w, E);
937
+ g(null);
938
+ }, []), m = B((k, E) => {
939
+ u.current?.cacheForTab(k, E);
940
940
  }, []);
941
- return { data: h, isLoading: r, error: p, refresh: y, clearData: f, cacheForTab: b };
941
+ return { data: d, isLoading: n, error: p, refresh: w, clearData: f, cacheForTab: m };
942
942
  }
943
943
  function Ge({
944
944
  color: s = "muted",
945
- children: i,
945
+ children: r,
946
946
  className: t = "",
947
- classPrefix: n = "ss-dash"
947
+ classPrefix: o = "ss-dash"
948
948
  }) {
949
- return /* @__PURE__ */ e("span", { className: `${n}-badge ${n}-badge-${s} ${t}`, children: i });
949
+ return /* @__PURE__ */ e("span", { className: `${o}-badge ${o}-badge-${s} ${t}`, children: r });
950
950
  }
951
- function Qe({ method: s, className: i = "", classPrefix: t = "ss-dash" }) {
951
+ function Qe({ method: s, className: r = "", classPrefix: t = "ss-dash" }) {
952
952
  return /* @__PURE__ */ e(
953
953
  "span",
954
954
  {
955
- className: `${t}-method ${t}-method-${s.toLowerCase()} ${i}`,
955
+ className: `${t}-method ${t}-method-${s.toLowerCase()} ${r}`,
956
956
  children: s
957
957
  }
958
958
  );
959
959
  }
960
- function Xe({ code: s, className: i = "", classPrefix: t = "ss-dash" }) {
961
- let n = `${t}-status-2xx`;
962
- return s >= 500 ? n = `${t}-status-5xx` : s >= 400 ? n = `${t}-status-4xx` : s >= 300 && (n = `${t}-status-3xx`), /* @__PURE__ */ e("span", { className: `${t}-status ${n} ${i}`, children: s });
960
+ function Xe({ code: s, className: r = "", classPrefix: t = "ss-dash" }) {
961
+ let o = `${t}-status-2xx`;
962
+ return s >= 500 ? o = `${t}-status-5xx` : s >= 400 ? o = `${t}-status-4xx` : s >= 300 && (o = `${t}-status-3xx`), /* @__PURE__ */ e("span", { className: `${t}-status ${o} ${r}`, children: s });
963
963
  }
964
964
  function Ye({
965
965
  data: s,
966
- maxPreviewLength: i = 100,
966
+ maxPreviewLength: r = 100,
967
967
  className: t = "",
968
- classPrefix: n = "ss-dash"
968
+ classPrefix: o = "ss-dash",
969
+ defaultExpanded: a = !1
969
970
  }) {
970
- const [a, h] = N(!1), c = O(() => {
971
+ const [d, g] = y(a), n = O(() => {
971
972
  if (typeof s == "string")
972
973
  try {
973
974
  return JSON.parse(s);
@@ -975,73 +976,73 @@ function Ye({
975
976
  return s;
976
977
  }
977
978
  return s;
978
- }, [s]), r = O(() => typeof c == "object" && c !== null ? ce(c, i) : String(c ?? "-"), [c, i]), g = O(() => typeof c == "object" && c !== null ? JSON.stringify(c, null, 2) : String(c), [c]), p = B(() => {
979
- h((l) => !l);
980
- }, []), m = B(async () => {
979
+ }, [s]), v = O(() => typeof n == "object" && n !== null ? ce(n, r) : String(n ?? "-"), [n, r]), p = O(() => typeof n == "object" && n !== null ? JSON.stringify(n, null, 2) : String(n), [n]), h = B(() => {
980
+ g((w) => !w);
981
+ }, []), u = B(async () => {
981
982
  try {
982
- await navigator.clipboard.writeText(g);
983
+ await navigator.clipboard.writeText(p);
983
984
  } catch {
984
985
  }
985
- }, [g]);
986
- return !s && s !== 0 && s !== !1 ? /* @__PURE__ */ e("span", { className: `ss-dim ${n}-c-dim`, children: "-" }) : /* @__PURE__ */ d("div", { className: `${n}-data-cell ${t}`, children: [
987
- /* @__PURE__ */ e(
986
+ }, [p]);
987
+ return !s && s !== 0 && s !== !1 ? /* @__PURE__ */ e("span", { className: `ss-dim ${o}-c-dim`, children: "-" }) : /* @__PURE__ */ l("div", { className: `${o}-data-cell ${t}`, children: [
988
+ !d && /* @__PURE__ */ e(
988
989
  "span",
989
990
  {
990
- className: `${n}-data-preview`,
991
- onClick: p,
991
+ className: `${o}-data-preview`,
992
+ onClick: h,
992
993
  role: "button",
993
994
  tabIndex: 0,
994
- onKeyDown: (l) => l.key === "Enter" && p(),
995
- children: r
995
+ onKeyDown: (w) => w.key === "Enter" && h(),
996
+ children: v
996
997
  }
997
998
  ),
998
- a && /* @__PURE__ */ d("div", { className: `${n}-data-full`, onClick: p, children: [
999
+ d && /* @__PURE__ */ l("div", { className: `${o}-data-full`, onClick: h, children: [
999
1000
  /* @__PURE__ */ e(
1000
1001
  "button",
1001
1002
  {
1002
- className: `${n}-copy-btn`,
1003
- onClick: (l) => {
1004
- l.stopPropagation(), m();
1003
+ className: `${o}-copy-btn`,
1004
+ onClick: (w) => {
1005
+ w.stopPropagation(), u();
1005
1006
  },
1006
1007
  title: "Copy to clipboard",
1007
1008
  type: "button",
1008
1009
  children: "Copy"
1009
1010
  }
1010
1011
  ),
1011
- /* @__PURE__ */ e("pre", { children: g })
1012
+ /* @__PURE__ */ e("pre", { children: p })
1012
1013
  ] })
1013
1014
  ] });
1014
1015
  }
1015
- function Ze({ content: s, children: i, position: t = "top", className: n = "" }) {
1016
- const [a, h] = N(!1), [c, r] = N({ left: 0, bottom: 0 }), g = j(null), p = j(null), m = B(() => {
1017
- h(!0);
1018
- }, []), l = B(() => {
1019
- h(!1);
1016
+ function Ze({ content: s, children: r, position: t = "top", className: o = "" }) {
1017
+ const [a, d] = y(!1), [g, n] = y({ left: 0, bottom: 0 }), v = j(null), p = j(null), h = B(() => {
1018
+ d(!0);
1019
+ }, []), u = B(() => {
1020
+ d(!1);
1020
1021
  }, []);
1021
1022
  return R(() => {
1022
- if (!a || !g.current || !p.current) return;
1023
- const y = g.current.getBoundingClientRect(), f = p.current.getBoundingClientRect();
1024
- let b = y.left + y.width / 2 - f.width / 2, w;
1025
- b < 8 && (b = 8), b + f.width > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.width), t === "top" && (w = window.innerHeight - y.top + 8), r({ left: b, bottom: w ?? 0 });
1026
- }, [a, t]), /* @__PURE__ */ d(
1023
+ if (!a || !v.current || !p.current) return;
1024
+ const w = v.current.getBoundingClientRect(), f = p.current.getBoundingClientRect();
1025
+ let m = w.left + w.width / 2 - f.width / 2, k;
1026
+ m < 8 && (m = 8), m + f.width > window.innerWidth - 8 && (m = window.innerWidth - 8 - f.width), t === "top" && (k = window.innerHeight - w.top + 8), n({ left: m, bottom: k ?? 0 });
1027
+ }, [a, t]), /* @__PURE__ */ l(
1027
1028
  "div",
1028
1029
  {
1029
- ref: g,
1030
- className: `ss-tooltip-trigger ${n}`,
1031
- onMouseEnter: m,
1032
- onMouseLeave: l,
1030
+ ref: v,
1031
+ className: `ss-tooltip-trigger ${o}`,
1032
+ onMouseEnter: h,
1033
+ onMouseLeave: u,
1033
1034
  style: { display: "inline-flex", position: "relative" },
1034
1035
  children: [
1035
- i,
1036
- a && /* @__PURE__ */ d(
1036
+ r,
1037
+ a && /* @__PURE__ */ l(
1037
1038
  "div",
1038
1039
  {
1039
1040
  ref: p,
1040
1041
  className: "ss-tooltip",
1041
1042
  style: {
1042
1043
  position: "fixed",
1043
- left: `${c.left}px`,
1044
- bottom: t === "top" ? `${c.bottom}px` : void 0,
1044
+ left: `${g.left}px`,
1045
+ bottom: t === "top" ? `${g.bottom}px` : void 0,
1045
1046
  zIndex: 200,
1046
1047
  pointerEvents: "none"
1047
1048
  },