tekivex-ui 2.5.7 → 2.5.8

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 (40) hide show
  1. package/dist/TkxForm-2tGLCPH6.js +326 -0
  2. package/dist/TkxForm-C2VqR2wC.cjs +12 -0
  3. package/dist/charts.cjs +1 -1
  4. package/dist/charts.js +264 -251
  5. package/dist/headless.cjs +1 -1
  6. package/dist/headless.js +21 -20
  7. package/dist/index-BgHMZe4Z.js +66 -0
  8. package/dist/index-Bt5y50Qa.cjs +1 -0
  9. package/dist/index-DnqXtpwV.cjs +2 -0
  10. package/dist/{index-CAXjeKoK.js → index-iUUHRxqJ.js} +77 -75
  11. package/dist/index.cjs +21 -21
  12. package/dist/index.js +24 -25
  13. package/dist/quantum.cjs +2 -2
  14. package/dist/quantum.js +4 -4
  15. package/dist/realtime.cjs +8 -4
  16. package/dist/realtime.js +391 -377
  17. package/dist/{security-loRa1HyV.js → security-C-ZPGoyG.js} +1 -1
  18. package/dist/{security-DMqZVW5d.cjs → security-Uf0mjv8o.cjs} +1 -1
  19. package/dist/src/charts/TkxDonutChart.d.ts.map +1 -1
  20. package/dist/src/charts/TkxPieChart.d.ts.map +1 -1
  21. package/dist/src/components/TkxForm.d.ts +17 -16
  22. package/dist/src/components/TkxForm.d.ts.map +1 -1
  23. package/dist/src/components/TkxLiveMetrics.d.ts.map +1 -1
  24. package/dist/src/components/TkxPlayground.d.ts.map +1 -1
  25. package/dist/src/components/TkxProgress.d.ts.map +1 -1
  26. package/dist/src/themes/index.d.ts.map +1 -1
  27. package/dist/{tkx-C_AlpMt4.js → tkx-BtHzWKTl.js} +1 -1
  28. package/dist/{tkx-69KQ0myA.cjs → tkx-C7GvVUE9.cjs} +1 -1
  29. package/package.json +5 -5
  30. package/src/charts/TkxDonutChart.tsx +6 -2
  31. package/src/charts/TkxPieChart.tsx +7 -3
  32. package/src/charts/shared.ts +4 -4
  33. package/src/components/TkxForm.tsx +35 -32
  34. package/src/components/TkxLiveMetrics.tsx +24 -2
  35. package/src/components/TkxPlayground.tsx +40 -5
  36. package/src/components/TkxProgress.tsx +0 -2
  37. package/src/themes/index.ts +8 -1
  38. package/dist/TkxForm-BK5Sq7oj.cjs +0 -12
  39. package/dist/TkxForm-br3i_vo8.js +0 -388
  40. package/dist/index-DB_m7X7e.cjs +0 -2
package/dist/realtime.js CHANGED
@@ -1,13 +1,13 @@
1
- import { useRef as D, useState as C, useMemo as Q, useEffect as V, useCallback as K, createElement as n } from "react";
2
- import { u as tt } from "./index-CAXjeKoK.js";
3
- import { s as z } from "./security-loRa1HyV.js";
4
- const _ = 64, ut = 5;
5
- let ft = !1;
6
- function It() {
7
- if (ft || typeof document > "u") return;
8
- ft = !0;
9
- const t = document.createElement("style");
10
- t.id = "tkx-live-feed-styles", t.textContent = `
1
+ import { useRef as D, useState as W, useMemo as Q, useEffect as B, useCallback as K, createElement as n } from "react";
2
+ import { u as ee } from "./index-iUUHRxqJ.js";
3
+ import { s as L } from "./security-C-ZPGoyG.js";
4
+ const _ = 64, ue = 5;
5
+ let fe = !1;
6
+ function Ie() {
7
+ if (fe || typeof document > "u") return;
8
+ fe = !0;
9
+ const e = document.createElement("style");
10
+ e.id = "tkx-live-feed-styles", e.textContent = `
11
11
  @keyframes tkx-feed-slide-in {
12
12
  from { transform: translateY(-20px); opacity: 0; }
13
13
  to { transform: translateY(0); opacity: 1; }
@@ -15,34 +15,34 @@ function It() {
15
15
  .tkx-feed-item-new {
16
16
  animation: tkx-feed-slide-in 0.25s ease-out both;
17
17
  }
18
- `.trim(), document.head.appendChild(t);
18
+ `.trim(), document.head.appendChild(e);
19
19
  }
20
- function zt(t) {
21
- const e = Date.now() - t;
22
- return e < 1e4 ? "just now" : e < 6e4 ? `${Math.floor(e / 1e3)}s ago` : e < 36e5 ? `${Math.floor(e / 6e4)}m ago` : e < 864e5 ? `${Math.floor(e / 36e5)}h ago` : `${Math.floor(e / 864e5)}d ago`;
20
+ function Le(e) {
21
+ const t = Date.now() - e;
22
+ return t < 1e4 ? "just now" : t < 6e4 ? `${Math.floor(t / 1e3)}s ago` : t < 36e5 ? `${Math.floor(t / 6e4)}m ago` : t < 864e5 ? `${Math.floor(t / 36e5)}h ago` : `${Math.floor(t / 864e5)}d ago`;
23
23
  }
24
- function Lt(t, e) {
25
- switch (t) {
24
+ function Re(e, t) {
25
+ switch (e) {
26
26
  case "info":
27
- return e.info;
27
+ return t.info;
28
28
  case "success":
29
- return e.success;
29
+ return t.success;
30
30
  case "warning":
31
- return e.warning;
31
+ return t.warning;
32
32
  case "error":
33
- return e.danger;
33
+ return t.danger;
34
34
  default:
35
- return e.border;
35
+ return t.border;
36
36
  }
37
37
  }
38
- function Rt(t) {
39
- return t ? t.split(" ").map((e) => e[0] ?? "").slice(0, 2).join("").toUpperCase() : "?";
38
+ function ze(e) {
39
+ return e ? e.split(" ").map((t) => t[0] ?? "").slice(0, 2).join("").toUpperCase() : "?";
40
40
  }
41
- function Nt({ item: t, isNew: e, showTimestamps: o, onItemClick: r, renderItem: c, theme: s, style: f }) {
42
- const u = Lt(t.type, s);
43
- if (c)
44
- return n("div", { style: f, className: e ? "tkx-feed-item-new" : void 0 }, c(t));
45
- const x = {
41
+ function Ee({ item: e, isNew: t, showTimestamps: o, onItemClick: r, renderItem: a, theme: s, style: f }) {
42
+ const u = Re(e.type, s);
43
+ if (a)
44
+ return n("div", { style: f, className: t ? "tkx-feed-item-new" : void 0 }, a(e));
45
+ const h = {
46
46
  ...f,
47
47
  display: "flex",
48
48
  alignItems: "center",
@@ -58,13 +58,13 @@ function Nt({ item: t, isNew: e, showTimestamps: o, onItemClick: r, renderItem:
58
58
  return n(
59
59
  "div",
60
60
  {
61
- style: x,
62
- className: e ? "tkx-feed-item-new" : void 0,
63
- onClick: r ? () => r(t) : void 0,
61
+ style: h,
62
+ className: t ? "tkx-feed-item-new" : void 0,
63
+ onClick: r ? () => r(e) : void 0,
64
64
  role: r ? "button" : void 0,
65
65
  tabIndex: r ? 0 : void 0,
66
- onKeyDown: r ? (a) => {
67
- (a.key === "Enter" || a.key === " ") && r(t);
66
+ onKeyDown: r ? (l) => {
67
+ (l.key === "Enter" || l.key === " ") && r(e);
68
68
  } : void 0
69
69
  },
70
70
  // Avatar
@@ -86,7 +86,7 @@ function Nt({ item: t, isNew: e, showTimestamps: o, onItemClick: r, renderItem:
86
86
  overflow: "hidden"
87
87
  }
88
88
  },
89
- t.avatar ? n("img", { src: t.avatar, alt: t.author ?? "", style: { width: "100%", height: "100%", objectFit: "cover" } }) : Rt(t.author)
89
+ e.avatar ? n("img", { src: e.avatar, alt: e.author ?? "", style: { width: "100%", height: "100%", objectFit: "cover" } }) : ze(e.author)
90
90
  ),
91
91
  // Body
92
92
  n(
@@ -95,75 +95,75 @@ function Nt({ item: t, isNew: e, showTimestamps: o, onItemClick: r, renderItem:
95
95
  n(
96
96
  "div",
97
97
  { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 2 } },
98
- t.author && n("span", { style: { fontWeight: 600, fontSize: 13, color: s.text } }, z(t.author)),
99
- t.meta && n("span", { style: { fontSize: 11, color: s.textMuted, background: s.surfaceAlt, borderRadius: 4, padding: "1px 5px" } }, z(t.meta))
98
+ e.author && n("span", { style: { fontWeight: 600, fontSize: 13, color: s.text } }, L(e.author)),
99
+ e.meta && n("span", { style: { fontSize: 11, color: s.textMuted, background: s.surfaceAlt, borderRadius: 4, padding: "1px 5px" } }, L(e.meta))
100
100
  ),
101
101
  n(
102
102
  "div",
103
103
  { style: { fontSize: 13, color: s.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } },
104
- z(t.content)
104
+ L(e.content)
105
105
  )
106
106
  ),
107
107
  // Timestamp
108
108
  o && n(
109
109
  "div",
110
110
  { style: { fontSize: 11, color: s.textMuted, flexShrink: 0 } },
111
- zt(t.timestamp)
111
+ Le(e.timestamp)
112
112
  )
113
113
  );
114
114
  }
115
- function qt({
116
- items: t,
117
- maxItems: e = 100,
115
+ function Je({
116
+ items: e,
117
+ maxItems: t = 100,
118
118
  height: o = 400,
119
119
  autoScroll: r = !0,
120
- showTimestamps: c = !0,
120
+ showTimestamps: a = !0,
121
121
  onItemClick: s,
122
122
  emptyMessage: f = "No activity yet.",
123
123
  pauseOnHover: u = !0,
124
- renderItem: x
124
+ renderItem: h
125
125
  }) {
126
- const a = tt();
127
- It();
128
- const m = D(null), [v, k] = C(0), [b, y] = C(!1), [W, E] = C(/* @__PURE__ */ new Set()), B = D([]), L = Q(
129
- () => t.slice(-e),
130
- [t, e]
131
- ), $ = typeof o == "number" ? o : 400, w = L.length * _;
132
- V(() => {
133
- const I = new Set(B.current.map((N) => N.id)), S = L.filter((N) => !I.has(N.id)).map((N) => N.id);
126
+ const l = ee();
127
+ Ie();
128
+ const y = D(null), [v, k] = W(0), [b, x] = W(!1), [C, N] = W(/* @__PURE__ */ new Set()), V = D([]), R = Q(
129
+ () => e.slice(-t),
130
+ [e, t]
131
+ ), $ = typeof o == "number" ? o : 400, w = R.length * _;
132
+ B(() => {
133
+ const I = new Set(V.current.map((E) => E.id)), S = R.filter((E) => !I.has(E.id)).map((E) => E.id);
134
134
  if (S.length > 0) {
135
- E((j) => {
135
+ N((j) => {
136
136
  const F = new Set(j);
137
137
  return S.forEach((A) => F.add(A)), F;
138
138
  });
139
- const N = window.setTimeout(() => {
140
- E((j) => {
139
+ const E = window.setTimeout(() => {
140
+ N((j) => {
141
141
  const F = new Set(j);
142
142
  return S.forEach((A) => F.delete(A)), F;
143
143
  });
144
144
  }, 400);
145
- return () => clearTimeout(N);
145
+ return () => clearTimeout(E);
146
146
  }
147
- }, [L]), V(() => {
148
- B.current = L;
149
- }, [L]);
147
+ }, [R]), B(() => {
148
+ V.current = R;
149
+ }, [R]);
150
150
  const P = r && !(u && b);
151
- V(() => {
152
- if (!P || !m.current) return;
153
- const I = m.current;
154
- (I.scrollHeight - I.scrollTop - I.clientHeight < _ * 3 || L.length <= 5) && (I.scrollTop = I.scrollHeight);
155
- }, [L.length, P]);
151
+ B(() => {
152
+ if (!P || !y.current) return;
153
+ const I = y.current;
154
+ (I.scrollHeight - I.scrollTop - I.clientHeight < _ * 3 || R.length <= 5) && (I.scrollTop = I.scrollHeight);
155
+ }, [R.length, P]);
156
156
  const Y = K(() => {
157
- m.current && k(m.current.scrollTop);
158
- }, []), H = Math.max(0, Math.floor(v / _) - ut), g = Math.min(
159
- L.length - 1,
160
- Math.ceil((v + $) / _) + ut
157
+ y.current && k(y.current.scrollTop);
158
+ }, []), H = Math.max(0, Math.floor(v / _) - ue), g = Math.min(
159
+ R.length - 1,
160
+ Math.ceil((v + $) / _) + ue
161
161
  ), T = {
162
162
  position: "relative",
163
163
  overflow: "auto",
164
164
  height: typeof o == "number" ? `${o}px` : o,
165
- background: a.bg,
166
- border: `1px solid ${a.border}`,
165
+ background: l.bg,
166
+ border: `1px solid ${l.border}`,
167
167
  borderRadius: 8,
168
168
  boxSizing: "border-box"
169
169
  }, G = {
@@ -171,24 +171,24 @@ function qt({
171
171
  height: w,
172
172
  minHeight: "100%"
173
173
  };
174
- if (L.length === 0)
174
+ if (R.length === 0)
175
175
  return n(
176
176
  "div",
177
177
  { style: { ...T, display: "flex", alignItems: "center", justifyContent: "center" } },
178
- n("span", { style: { color: a.textMuted, fontSize: 14 } }, z(f))
178
+ n("span", { style: { color: l.textMuted, fontSize: 14 } }, L(f))
179
179
  );
180
- const R = [];
180
+ const z = [];
181
181
  for (let I = H; I <= g; I++) {
182
- const S = L[I];
183
- S && R.push(
184
- n(Nt, {
182
+ const S = R[I];
183
+ S && z.push(
184
+ n(Ee, {
185
185
  key: S.id,
186
186
  item: S,
187
- isNew: W.has(S.id),
188
- showTimestamps: c,
187
+ isNew: C.has(S.id),
188
+ showTimestamps: a,
189
189
  onItemClick: s,
190
- renderItem: x,
191
- theme: a,
190
+ renderItem: h,
191
+ theme: l,
192
192
  style: {
193
193
  position: "absolute",
194
194
  top: I * _,
@@ -201,23 +201,23 @@ function qt({
201
201
  return n(
202
202
  "div",
203
203
  {
204
- ref: m,
204
+ ref: y,
205
205
  style: T,
206
206
  onScroll: Y,
207
- onMouseEnter: u ? () => y(!0) : void 0,
208
- onMouseLeave: u ? () => y(!1) : void 0,
207
+ onMouseEnter: u ? () => x(!0) : void 0,
208
+ onMouseLeave: u ? () => x(!1) : void 0,
209
209
  "aria-label": "Live feed",
210
210
  role: "feed"
211
211
  },
212
- n("div", { style: G }, ...R)
212
+ n("div", { style: G }, ...z)
213
213
  );
214
214
  }
215
- let pt = !1;
216
- function Et() {
217
- if (pt || typeof document > "u") return;
218
- pt = !0;
219
- const t = document.createElement("style");
220
- t.id = "tkx-live-metrics-styles", t.textContent = `
215
+ let pe = !1;
216
+ function Ne() {
217
+ if (pe || typeof document > "u") return;
218
+ pe = !0;
219
+ const e = document.createElement("style");
220
+ e.id = "tkx-live-metrics-styles", e.textContent = `
221
221
  @keyframes tkx-metric-pulse {
222
222
  0% { opacity: 1; }
223
223
  40% { opacity: 0.4; }
@@ -230,48 +230,62 @@ function Et() {
230
230
  .tkx-metric-shimmer {
231
231
  animation: tkx-metric-shimmer 0.6s ease-in-out;
232
232
  }
233
- `.trim(), document.head.appendChild(t);
233
+ @media (prefers-reduced-motion: reduce) {
234
+ .tkx-metric-shimmer { animation: none; }
235
+ .tkx-metric-pulse { animation: none; }
236
+ }
237
+ `.trim(), document.head.appendChild(e);
234
238
  }
235
- function gt(t, e) {
236
- if (typeof t == "string") return t;
237
- const o = t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(Number.isInteger(t) ? t : t.toFixed(2));
238
- return e ? `${o}${e}` : o;
239
+ function ge(e, t) {
240
+ if (typeof e == "string") return e;
241
+ const o = e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : String(Number.isInteger(e) ? e : e.toFixed(2));
242
+ return t ? `${o}${t}` : o;
239
243
  }
240
- function Wt(t, e) {
241
- switch (t) {
244
+ function We(e, t) {
245
+ switch (e) {
242
246
  case "warning":
243
- return e.warning;
247
+ return t.warning;
244
248
  case "critical":
245
- return e.danger;
249
+ return t.danger;
246
250
  default:
247
- return e.primary;
251
+ return t.primary;
248
252
  }
249
253
  }
250
- function Ct(t, e, o) {
251
- const [r, c] = C(t), s = D(t), f = D(null), u = D(null);
252
- return V(() => {
253
- if (!o) {
254
- c(t);
254
+ function Ce() {
255
+ const [e, t] = W(
256
+ () => typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1
257
+ );
258
+ return B(() => {
259
+ if (typeof window > "u") return;
260
+ const o = window.matchMedia("(prefers-reduced-motion: reduce)"), r = (a) => t(a.matches);
261
+ return o.addEventListener("change", r), () => o.removeEventListener("change", r);
262
+ }, []), e;
263
+ }
264
+ function He(e, t, o) {
265
+ const [r, a] = W(e), s = D(e), f = D(null), u = D(null), h = Ce();
266
+ return B(() => {
267
+ if (!o || h) {
268
+ a(e), s.current = e;
255
269
  return;
256
270
  }
257
- const x = s.current;
258
- if (x === t) return;
271
+ const l = s.current;
272
+ if (l === e) return;
259
273
  f.current = null;
260
- const a = (m) => {
261
- f.current === null && (f.current = m);
262
- const v = m - f.current, k = Math.min(v / e, 1), b = 1 - Math.pow(1 - k, 3);
263
- c(x + (t - x) * b), k < 1 ? u.current = requestAnimationFrame(a) : s.current = t;
274
+ const y = (v) => {
275
+ f.current === null && (f.current = v);
276
+ const k = v - f.current, b = Math.min(k / t, 1), x = 1 - Math.pow(1 - b, 3);
277
+ a(l + (e - l) * x), b < 1 ? u.current = requestAnimationFrame(y) : s.current = e;
264
278
  };
265
- return u.current = requestAnimationFrame(a), () => {
279
+ return u.current = requestAnimationFrame(y), () => {
266
280
  u.current !== null && cancelAnimationFrame(u.current);
267
281
  };
268
- }, [t, e, o]), r;
282
+ }, [e, t, o, h]), r;
269
283
  }
270
- function Ht({ data: t, color: e }) {
271
- if (t.length < 2) return null;
272
- const o = 80, r = 24, c = Math.min(...t), f = Math.max(...t) - c || 1, u = t.map((x, a) => {
273
- const m = a / (t.length - 1) * o, v = r - (x - c) / f * (r - 2) - 1;
274
- return `${m.toFixed(1)},${v.toFixed(1)}`;
284
+ function Fe({ data: e, color: t }) {
285
+ if (e.length < 2) return null;
286
+ const o = 80, r = 24, a = Math.min(...e), f = Math.max(...e) - a || 1, u = e.map((h, l) => {
287
+ const y = l / (e.length - 1) * o, v = r - (h - a) / f * (r - 2) - 1;
288
+ return `${y.toFixed(1)},${v.toFixed(1)}`;
275
289
  });
276
290
  return n(
277
291
  "svg",
@@ -279,29 +293,29 @@ function Ht({ data: t, color: e }) {
279
293
  n("polyline", {
280
294
  points: u.join(" "),
281
295
  fill: "none",
282
- stroke: e,
296
+ stroke: t,
283
297
  strokeWidth: 1.5,
284
298
  strokeLinejoin: "round",
285
299
  strokeLinecap: "round"
286
300
  })
287
301
  );
288
302
  }
289
- function Ft({ trend: t, theme: e }) {
290
- return t === "up" ? n("span", { style: { color: e.success, fontSize: 14, fontWeight: 700 } }, "▲") : t === "down" ? n("span", { style: { color: e.danger, fontSize: 14, fontWeight: 700 } }, "▼") : n("span", { style: { color: e.textMuted, fontSize: 14 } }, "→");
303
+ function Ae({ trend: e, theme: t }) {
304
+ return e === "up" ? n("span", { style: { color: t.success, fontSize: 14, fontWeight: 700 } }, "▲") : e === "down" ? n("span", { style: { color: t.danger, fontSize: 14, fontWeight: 700 } }, "▼") : n("span", { style: { color: t.textMuted, fontSize: 14 } }, "→");
291
305
  }
292
- function At({ metric: t, animate: e, onMetricClick: o, theme: r }) {
293
- const c = t.color ?? Wt(t.status, r), s = typeof t.value == "number" ? t.value : NaN, f = Ct(isNaN(s) ? 0 : s, 600, e && !isNaN(s)), [u, x] = C(!1), a = D(t.value);
294
- V(() => {
295
- if (a.current !== t.value) {
296
- a.current = t.value, x(!0);
297
- const y = window.setTimeout(() => x(!1), 700);
298
- return () => clearTimeout(y);
306
+ function De({ metric: e, animate: t, onMetricClick: o, theme: r }) {
307
+ const a = e.color ?? We(e.status, r), s = typeof e.value == "number" ? e.value : NaN, f = He(isNaN(s) ? 0 : s, 600, t && !isNaN(s)), [u, h] = W(!1), l = D(e.value);
308
+ B(() => {
309
+ if (l.current !== e.value) {
310
+ l.current = e.value, h(!0);
311
+ const x = window.setTimeout(() => h(!1), 700);
312
+ return () => clearTimeout(x);
299
313
  }
300
- }, [t.value]);
301
- const m = t.previousValue !== void 0 && t.previousValue !== s, v = {
314
+ }, [e.value]);
315
+ const y = e.previousValue !== void 0 && e.previousValue !== s, v = {
302
316
  background: r.surface,
303
317
  border: `1px solid ${r.border}`,
304
- borderLeft: `4px solid ${c}`,
318
+ borderLeft: `4px solid ${a}`,
305
319
  borderRadius: 8,
306
320
  padding: "14px 16px",
307
321
  cursor: o ? "pointer" : "default",
@@ -311,171 +325,171 @@ function At({ metric: t, animate: e, onMetricClick: o, theme: r }) {
311
325
  }, k = u ? {
312
326
  position: "absolute",
313
327
  inset: 0,
314
- background: `linear-gradient(90deg, transparent 0%, ${c}22 50%, transparent 100%)`,
328
+ background: `linear-gradient(90deg, transparent 0%, ${a}22 50%, transparent 100%)`,
315
329
  backgroundSize: "200% 100%",
316
330
  animation: "tkx-metric-shimmer 0.6s ease-in-out",
317
331
  pointerEvents: "none"
318
- } : {}, b = isNaN(s) ? z(String(t.value)) : gt(f, t.unit);
332
+ } : {}, b = isNaN(s) ? L(String(e.value)) : ge(f, e.unit);
319
333
  return n(
320
334
  "div",
321
335
  {
322
336
  style: v,
323
337
  className: u ? "tkx-metric-shimmer" : void 0,
324
- onClick: o ? () => o(t) : void 0,
338
+ onClick: o ? () => o(e) : void 0,
325
339
  role: o ? "button" : void 0,
326
340
  tabIndex: o ? 0 : void 0
327
341
  },
328
342
  // Shimmer overlay
329
343
  u && n("div", { style: k }),
330
344
  // Label
331
- n("div", { style: { fontSize: 12, color: r.textMuted, marginBottom: 6, fontWeight: 500, letterSpacing: "0.03em" } }, z(t.label)),
345
+ n("div", { style: { fontSize: 12, color: r.textMuted, marginBottom: 6, fontWeight: 500, letterSpacing: "0.03em" } }, L(e.label)),
332
346
  // Value row
333
347
  n(
334
348
  "div",
335
349
  { style: { display: "flex", alignItems: "flex-end", gap: 6, marginBottom: 6 } },
336
350
  n("span", { style: { fontSize: 28, fontWeight: 700, color: r.text, lineHeight: 1 } }, b),
337
- t.unit && isNaN(s) && n("span", { style: { fontSize: 14, color: r.textMuted, marginBottom: 2 } }, z(t.unit))
351
+ e.unit && isNaN(s) && n("span", { style: { fontSize: 14, color: r.textMuted, marginBottom: 2 } }, L(e.unit))
338
352
  ),
339
353
  // Trend row
340
- (t.trend || t.trendValue) && n(
354
+ (e.trend || e.trendValue) && n(
341
355
  "div",
342
- { style: { display: "flex", alignItems: "center", gap: 4, marginBottom: t.sparkline ? 8 : 0 } },
343
- t.trend && n(Ft, { trend: t.trend, theme: r }),
344
- t.trendValue && n("span", { style: { fontSize: 12, color: r.textMuted } }, z(t.trendValue))
356
+ { style: { display: "flex", alignItems: "center", gap: 4, marginBottom: e.sparkline ? 8 : 0 } },
357
+ e.trend && n(Ae, { trend: e.trend, theme: r }),
358
+ e.trendValue && n("span", { style: { fontSize: 12, color: r.textMuted } }, L(e.trendValue))
345
359
  ),
346
360
  // Previous value
347
- m && n(
361
+ y && n(
348
362
  "div",
349
363
  { style: { fontSize: 11, color: r.textMuted, marginTop: 2 } },
350
- `was ${gt(t.previousValue)}`
364
+ `was ${ge(e.previousValue)}`
351
365
  ),
352
366
  // Sparkline
353
- t.sparkline && t.sparkline.length >= 2 && n(
367
+ e.sparkline && e.sparkline.length >= 2 && n(
354
368
  "div",
355
369
  { style: { marginTop: 8 } },
356
- n(Ht, { data: t.sparkline, color: c })
370
+ n(Fe, { data: e.sparkline, color: a })
357
371
  )
358
372
  );
359
373
  }
360
- function Jt({
361
- metrics: t,
362
- columns: e = 3,
374
+ function Ze({
375
+ metrics: e,
376
+ columns: t = 3,
363
377
  animate: o = !0,
364
378
  onMetricClick: r
365
379
  }) {
366
- const c = tt();
367
- Et();
380
+ const a = ee();
381
+ Ne();
368
382
  const s = {
369
383
  display: "grid",
370
- gridTemplateColumns: `repeat(${e}, minmax(0, 1fr))`,
384
+ gridTemplateColumns: `repeat(${t}, minmax(0, 1fr))`,
371
385
  gap: 16
372
386
  };
373
387
  return n(
374
388
  "div",
375
389
  { style: s },
376
- ...t.map(
377
- (f) => n(At, {
390
+ ...e.map(
391
+ (f) => n(De, {
378
392
  key: f.id,
379
393
  metric: f,
380
394
  animate: o,
381
395
  onMetricClick: r,
382
- theme: c
396
+ theme: a
383
397
  })
384
398
  )
385
399
  );
386
400
  }
387
- function xt(t) {
388
- const e = new Date(t), o = String(e.getHours()).padStart(2, "0"), r = String(e.getMinutes()).padStart(2, "0"), c = String(e.getSeconds()).padStart(2, "0");
389
- return `${o}:${r}:${c}`;
401
+ function xe(e) {
402
+ const t = new Date(e), o = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), a = String(t.getSeconds()).padStart(2, "0");
403
+ return `${o}:${r}:${a}`;
390
404
  }
391
- function ht(t) {
392
- return Math.abs(t) >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : Math.abs(t) >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : Number.isInteger(t) ? String(t) : t.toFixed(2);
405
+ function he(e) {
406
+ return Math.abs(e) >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(2);
393
407
  }
394
- function Zt({
395
- data: t,
396
- maxPoints: e = 60,
408
+ function Qe({
409
+ data: e,
410
+ maxPoints: t = 60,
397
411
  height: o = 200,
398
412
  width: r = "100%",
399
- color: c,
413
+ color: a,
400
414
  fill: s = !0,
401
415
  showGrid: f = !0,
402
416
  showLabels: u = !0,
403
- showTooltip: x = !0,
404
- label: a,
405
- unit: m,
417
+ showTooltip: h = !0,
418
+ label: l,
419
+ unit: y,
406
420
  animate: v = !0,
407
421
  yMin: k,
408
422
  yMax: b
409
423
  }) {
410
- const y = tt(), W = c ?? y.primary, E = D(null), [B, L] = C(600), [$, w] = C(null), [P, Y] = C(0), H = D(t.length);
411
- V(() => {
412
- if (!E.current) return;
413
- const i = new ResizeObserver((h) => {
414
- const O = h[0];
415
- O && L(O.contentRect.width);
424
+ const x = ee(), C = a ?? x.primary, N = D(null), [V, R] = W(600), [$, w] = W(null), [P, Y] = W(0), H = D(e.length);
425
+ B(() => {
426
+ if (!N.current) return;
427
+ const i = new ResizeObserver((m) => {
428
+ const O = m[0];
429
+ O && R(O.contentRect.width);
416
430
  });
417
- return i.observe(E.current), L(E.current.offsetWidth), () => i.disconnect();
431
+ return i.observe(N.current), R(N.current.offsetWidth), () => i.disconnect();
418
432
  }, []);
419
433
  const g = Q(
420
- () => t.slice(-e),
421
- [t, e]
434
+ () => e.slice(-t),
435
+ [e, t]
422
436
  );
423
- V(() => {
437
+ B(() => {
424
438
  g.length > H.current && Y((i) => i + 1), H.current = g.length;
425
439
  }, [g.length]);
426
- const T = u ? 48 : 12, G = 12, R = a ? 28 : 12, I = 28, S = Math.max(B - T - G, 1), N = Math.max(o - R - I, 1), j = g.length ? Math.min(...g.map((i) => i.value)) : 0, F = g.length ? Math.max(...g.map((i) => i.value)) : 1, A = F - j || 1, d = k !== void 0 ? k : j - A * 0.1, p = (b !== void 0 ? b : F + A * 0.1) - d || 1;
440
+ const T = u ? 48 : 12, G = 12, z = l ? 28 : 12, I = 28, S = Math.max(V - T - G, 1), E = Math.max(o - z - I, 1), j = g.length ? Math.min(...g.map((i) => i.value)) : 0, F = g.length ? Math.max(...g.map((i) => i.value)) : 1, A = F - j || 1, d = k !== void 0 ? k : j - A * 0.1, p = (b !== void 0 ? b : F + A * 0.1) - d || 1;
427
441
  function M(i) {
428
442
  return g.length < 2 ? S / 2 : i / (g.length - 1) * S;
429
443
  }
430
- function X(i) {
431
- return N - (i - d) / p * N;
444
+ function q(i) {
445
+ return E - (i - d) / p * E;
432
446
  }
433
- const q = g.length >= 2 ? g.map((i, h) => `${h === 0 ? "M" : "L"}${M(h).toFixed(2)},${X(i.value).toFixed(2)}`).join(" ") : "", at = q ? `${q} L${M(g.length - 1).toFixed(2)},${N} L${M(0).toFixed(2)},${N} Z` : "", et = 4, nt = [];
434
- for (let i = 0; i <= et; i++)
435
- nt.push(i);
436
- const bt = nt.map((i) => {
437
- const h = d + i / et * p;
438
- return { y: X(h), text: ht(h) };
439
- }), ot = Math.min(4, g.length), St = ot > 0 ? Array.from(
440
- { length: ot },
441
- (i, h) => Math.round(h / Math.max(ot - 1, 1) * (g.length - 1))
442
- ) : [], kt = K(
447
+ const X = g.length >= 2 ? g.map((i, m) => `${m === 0 ? "M" : "L"}${M(m).toFixed(2)},${q(i.value).toFixed(2)}`).join(" ") : "", ae = X ? `${X} L${M(g.length - 1).toFixed(2)},${E} L${M(0).toFixed(2)},${E} Z` : "", te = 4, ne = [];
448
+ for (let i = 0; i <= te; i++)
449
+ ne.push(i);
450
+ const be = ne.map((i) => {
451
+ const m = d + i / te * p;
452
+ return { y: q(m), text: he(m) };
453
+ }), oe = Math.min(4, g.length), Se = oe > 0 ? Array.from(
454
+ { length: oe },
455
+ (i, m) => Math.round(m / Math.max(oe - 1, 1) * (g.length - 1))
456
+ ) : [], ke = K(
443
457
  (i) => {
444
- if (!x || g.length === 0) return;
445
- const h = i.currentTarget.getBoundingClientRect(), O = i.clientX - h.left - T;
446
- let U = 0, lt = 1 / 0;
447
- g.forEach((Gt, ct) => {
448
- const dt = Math.abs(M(ct) - O);
449
- dt < lt && (lt = dt, U = ct);
458
+ if (!h || g.length === 0) return;
459
+ const m = i.currentTarget.getBoundingClientRect(), O = i.clientX - m.left - T;
460
+ let U = 0, le = 1 / 0;
461
+ g.forEach((Ue, ce) => {
462
+ const de = Math.abs(M(ce) - O);
463
+ de < le && (le = de, U = ce);
450
464
  });
451
- const st = g[U];
452
- if (!st) return;
453
- const $t = M(U) + T, Tt = X(st.value) + R;
454
- w({ x: $t, y: Tt, point: st });
465
+ const se = g[U];
466
+ if (!se) return;
467
+ const $e = M(U) + T, Te = q(se.value) + z;
468
+ w({ x: $e, y: Te, point: se });
455
469
  },
456
- [g, x, T, R]
457
- ), wt = K(() => w(null), []), rt = B, J = o, it = `tkx-chart-clip-${P}`, Mt = {
470
+ [g, h, T, z]
471
+ ), we = K(() => w(null), []), re = V, J = o, ie = `tkx-chart-clip-${P}`, Me = {
458
472
  position: "relative",
459
473
  width: typeof r == "number" ? `${r}px` : r,
460
- background: y.surface,
461
- border: `1px solid ${y.border}`,
474
+ background: x.surface,
475
+ border: `1px solid ${x.border}`,
462
476
  borderRadius: 8,
463
477
  overflow: "hidden",
464
478
  boxSizing: "border-box"
465
479
  };
466
480
  return n(
467
481
  "div",
468
- { ref: E, style: Mt },
482
+ { ref: N, style: Me },
469
483
  n(
470
484
  "svg",
471
485
  {
472
- width: rt,
486
+ width: re,
473
487
  height: J,
474
- viewBox: `0 0 ${rt} ${J}`,
475
- onMouseMove: kt,
476
- onMouseLeave: wt,
488
+ viewBox: `0 0 ${re} ${J}`,
489
+ onMouseMove: ke,
490
+ onMouseLeave: we,
477
491
  style: { display: "block", userSelect: "none" },
478
- "aria-label": a ? z(a) : "Real-time chart"
492
+ "aria-label": l ? L(l) : "Real-time chart"
479
493
  },
480
494
  // Defs: clip for animation
481
495
  v && g.length >= 2 && n(
@@ -483,7 +497,7 @@ function Zt({
483
497
  null,
484
498
  n(
485
499
  "clipPath",
486
- { id: it },
500
+ { id: ie },
487
501
  n(
488
502
  "rect",
489
503
  {
@@ -503,91 +517,91 @@ function Zt({
503
517
  )
504
518
  ),
505
519
  // Chart title
506
- a && n(
520
+ l && n(
507
521
  "text",
508
522
  {
509
523
  x: T,
510
524
  y: 18,
511
- fill: y.textMuted,
525
+ fill: x.textMuted,
512
526
  fontSize: 12,
513
527
  fontWeight: 500
514
528
  },
515
- z(a)
529
+ L(l)
516
530
  ),
517
531
  // Grid lines
518
- f && nt.map((i) => {
519
- const h = X(d + i / et * p) + R;
532
+ f && ne.map((i) => {
533
+ const m = q(d + i / te * p) + z;
520
534
  return n("line", {
521
535
  key: `grid-${i}`,
522
536
  x1: T,
523
- y1: h,
537
+ y1: m,
524
538
  x2: T + S,
525
- y2: h,
526
- stroke: y.border,
539
+ y2: m,
540
+ stroke: x.border,
527
541
  strokeWidth: 1,
528
542
  strokeDasharray: "4 4"
529
543
  });
530
544
  }),
531
545
  // Y axis labels
532
- u && bt.map((i, h) => n(
546
+ u && be.map((i, m) => n(
533
547
  "text",
534
548
  {
535
- key: `yl-${h}`,
549
+ key: `yl-${m}`,
536
550
  x: T - 4,
537
- y: i.y + R + 4,
538
- fill: y.textMuted,
551
+ y: i.y + z + 4,
552
+ fill: x.textMuted,
539
553
  fontSize: 10,
540
554
  textAnchor: "end"
541
555
  },
542
556
  i.text
543
557
  )),
544
558
  // Y axis unit
545
- m && n(
559
+ y && n(
546
560
  "text",
547
- { x: 4, y: R + 10, fill: y.textMuted, fontSize: 9 },
548
- z(m)
561
+ { x: 4, y: z + 10, fill: x.textMuted, fontSize: 9 },
562
+ L(y)
549
563
  ),
550
564
  // Area fill
551
- s && at && n("path", {
552
- d: at,
553
- fill: `${W}22`,
554
- clipPath: v ? `url(#${it})` : void 0,
555
- transform: `translate(${T}, ${R})`
565
+ s && ae && n("path", {
566
+ d: ae,
567
+ fill: `${C}22`,
568
+ clipPath: v ? `url(#${ie})` : void 0,
569
+ transform: `translate(${T}, ${z})`
556
570
  }),
557
571
  // Data line
558
- q && n("path", {
559
- d: q,
572
+ X && n("path", {
573
+ d: X,
560
574
  fill: "none",
561
- stroke: W,
575
+ stroke: C,
562
576
  strokeWidth: 2,
563
577
  strokeLinejoin: "round",
564
578
  strokeLinecap: "round",
565
- clipPath: v ? `url(#${it})` : void 0,
566
- transform: `translate(${T}, ${R})`
579
+ clipPath: v ? `url(#${ie})` : void 0,
580
+ transform: `translate(${T}, ${z})`
567
581
  }),
568
582
  // X axis labels
569
- St.map((i) => {
570
- const h = g[i];
571
- return h ? n(
583
+ Se.map((i) => {
584
+ const m = g[i];
585
+ return m ? n(
572
586
  "text",
573
587
  {
574
588
  key: `xl-${i}`,
575
589
  x: T + M(i),
576
590
  y: J - 8,
577
- fill: y.textMuted,
591
+ fill: x.textMuted,
578
592
  fontSize: 9,
579
593
  textAnchor: "middle"
580
594
  },
581
- xt(h.timestamp)
595
+ xe(m.timestamp)
582
596
  ) : null;
583
597
  }),
584
598
  // Tooltip vertical line
585
599
  $ && n("line", {
586
600
  x1: $.x,
587
- y1: R,
601
+ y1: z,
588
602
  x2: $.x,
589
- y2: R + N,
590
- stroke: W,
603
+ y2: z + E,
604
+ stroke: C,
591
605
  strokeWidth: 1,
592
606
  strokeDasharray: "3 3",
593
607
  opacity: 0.6
@@ -597,190 +611,190 @@ function Zt({
597
611
  cx: $.x,
598
612
  cy: $.y,
599
613
  r: 4,
600
- fill: W,
601
- stroke: y.surface,
614
+ fill: C,
615
+ stroke: x.surface,
602
616
  strokeWidth: 2
603
617
  }),
604
618
  // Tooltip box
605
619
  $ && (() => {
606
- const i = Math.min($.x + 8, rt - 100), h = Math.max($.y - 36, 4), O = `${ht($.point.value)}${m || ""}`, U = xt($.point.timestamp);
620
+ const i = Math.min($.x + 8, re - 100), m = Math.max($.y - 36, 4), O = `${he($.point.value)}${y || ""}`, U = xe($.point.timestamp);
607
621
  return n(
608
622
  "g",
609
623
  null,
610
624
  n("rect", {
611
625
  x: i - 4,
612
- y: h - 2,
626
+ y: m - 2,
613
627
  width: 90,
614
628
  height: 34,
615
629
  rx: 4,
616
- fill: y.surfaceAlt,
617
- stroke: y.border,
630
+ fill: x.surfaceAlt,
631
+ stroke: x.border,
618
632
  strokeWidth: 1
619
633
  }),
620
- n("text", { x: i, y: h + 11, fill: y.text, fontSize: 12, fontWeight: 700 }, O),
621
- n("text", { x: i, y: h + 26, fill: y.textMuted, fontSize: 10 }, U)
634
+ n("text", { x: i, y: m + 11, fill: x.text, fontSize: 12, fontWeight: 700 }, O),
635
+ n("text", { x: i, y: m + 26, fill: x.textMuted, fontSize: 10 }, U)
622
636
  );
623
637
  })()
624
638
  )
625
639
  );
626
640
  }
627
- const Z = 28, yt = 8, mt = {
641
+ const Z = 28, me = 8, ye = {
628
642
  debug: 0,
629
643
  info: 1,
630
644
  warn: 2,
631
645
  error: 3,
632
646
  fatal: 4
633
647
  };
634
- let vt = !1;
635
- function Dt() {
636
- if (vt || typeof document > "u") return;
637
- vt = !0;
638
- const t = document.createElement("style");
639
- t.id = "tkx-live-log-styles", t.textContent = `
648
+ let ve = !1;
649
+ function je() {
650
+ if (ve || typeof document > "u") return;
651
+ ve = !0;
652
+ const e = document.createElement("style");
653
+ e.id = "tkx-live-log-styles", e.textContent = `
640
654
  .tkx-log-row:hover { filter: brightness(1.12); }
641
655
  .tkx-log-highlight { background: #ffbe0b55; border-radius: 2px; padding: 0 1px; }
642
- `.trim(), document.head.appendChild(t);
656
+ `.trim(), document.head.appendChild(e);
643
657
  }
644
- function jt(t) {
645
- const e = new Date(t), o = String(e.getHours()).padStart(2, "0"), r = String(e.getMinutes()).padStart(2, "0"), c = String(e.getSeconds()).padStart(2, "0"), s = String(e.getMilliseconds()).padStart(3, "0");
646
- return `${o}:${r}:${c}.${s}`;
658
+ function Be(e) {
659
+ const t = new Date(e), o = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), a = String(t.getSeconds()).padStart(2, "0"), s = String(t.getMilliseconds()).padStart(3, "0");
660
+ return `${o}:${r}:${a}.${s}`;
647
661
  }
648
- function Bt(t, e) {
649
- switch (t) {
662
+ function Ve(e, t) {
663
+ switch (e) {
650
664
  case "debug":
651
- return e.textMuted;
665
+ return t.textMuted;
652
666
  case "info":
653
- return e.info;
667
+ return t.info;
654
668
  case "warn":
655
- return e.warning;
669
+ return t.warning;
656
670
  case "error":
657
- return e.danger;
671
+ return t.danger;
658
672
  case "fatal":
659
- return e.danger;
673
+ return t.danger;
660
674
  default:
661
- return e.textMuted;
675
+ return t.textMuted;
662
676
  }
663
677
  }
664
- function Vt(t, e) {
665
- return t === "fatal" ? `${e.danger}22` : "transparent";
678
+ function Oe(e, t) {
679
+ return e === "fatal" ? `${t.danger}22` : "transparent";
666
680
  }
667
- function Ot(t) {
668
- return `[${t.toUpperCase().padEnd(5)}]`;
681
+ function Pe(e) {
682
+ return `[${e.toUpperCase().padEnd(5)}]`;
669
683
  }
670
- function Pt(t, e) {
671
- if (!e) return [t];
672
- const o = z(t), r = z(e);
684
+ function Ye(e, t) {
685
+ if (!t) return [e];
686
+ const o = L(e), r = L(t);
673
687
  if (!r) return [o];
674
688
  try {
675
- const c = new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
676
- return o.split(c).map(
677
- (f, u) => c.test(f) ? n("mark", { key: u, className: "tkx-log-highlight" }, f) : f
689
+ const a = new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
690
+ return o.split(a).map(
691
+ (f, u) => a.test(f) ? n("mark", { key: u, className: "tkx-log-highlight" }, f) : f
678
692
  );
679
693
  } catch {
680
694
  return [o];
681
695
  }
682
696
  }
683
- function Yt({
684
- entry: t,
685
- showLevel: e,
697
+ function _e({
698
+ entry: e,
699
+ showLevel: t,
686
700
  showTimestamp: o,
687
701
  showSource: r,
688
- searchQuery: c,
702
+ searchQuery: a,
689
703
  monospace: s,
690
704
  isExpanded: f,
691
705
  onToggle: u,
692
- onEntryClick: x,
693
- theme: a,
694
- style: m
706
+ onEntryClick: h,
707
+ theme: l,
708
+ style: y
695
709
  }) {
696
- const v = Bt(t.level, a), k = Vt(t.level, a), b = t.metadata && Object.keys(t.metadata).length > 0, y = {
697
- ...m,
710
+ const v = Ve(e.level, l), k = Oe(e.level, l), b = e.metadata && Object.keys(e.metadata).length > 0, x = {
711
+ ...y,
698
712
  display: "flex",
699
713
  alignItems: "center",
700
714
  gap: 6,
701
715
  padding: "0 10px",
702
716
  fontSize: 12,
703
717
  fontFamily: s ? '"JetBrains Mono", "Fira Mono", Consolas, monospace' : "inherit",
704
- cursor: b || x ? "pointer" : "default",
718
+ cursor: b || h ? "pointer" : "default",
705
719
  background: k,
706
720
  boxSizing: "border-box",
707
721
  height: Z,
708
722
  overflow: "hidden",
709
723
  whiteSpace: "nowrap",
710
- borderBottom: `1px solid ${a.border}22`
724
+ borderBottom: `1px solid ${l.border}22`
711
725
  };
712
726
  return n(
713
727
  "div",
714
728
  {
715
- style: y,
729
+ style: x,
716
730
  className: "tkx-log-row",
717
731
  onClick: () => {
718
- b && u(), x && x(t);
732
+ b && u(), h && h(e);
719
733
  },
720
734
  role: b ? "button" : void 0,
721
735
  tabIndex: b ? 0 : void 0,
722
- onKeyDown: b ? (E) => {
723
- (E.key === "Enter" || E.key === " ") && u();
736
+ onKeyDown: b ? (N) => {
737
+ (N.key === "Enter" || N.key === " ") && u();
724
738
  } : void 0,
725
739
  "aria-expanded": b ? f : void 0
726
740
  },
727
741
  // Timestamp
728
742
  o && n(
729
743
  "span",
730
- { style: { color: a.textMuted, flexShrink: 0, minWidth: 84 } },
731
- jt(t.timestamp)
744
+ { style: { color: l.textMuted, flexShrink: 0, minWidth: 84 } },
745
+ Be(e.timestamp)
732
746
  ),
733
747
  // Level badge
734
- e && n(
748
+ t && n(
735
749
  "span",
736
750
  {
737
751
  style: {
738
752
  color: v,
739
753
  flexShrink: 0,
740
- fontWeight: t.level === "fatal" ? 700 : 500,
754
+ fontWeight: e.level === "fatal" ? 700 : 500,
741
755
  minWidth: 56
742
756
  }
743
757
  },
744
- Ot(t.level)
758
+ Pe(e.level)
745
759
  ),
746
760
  // Source badge
747
- r && t.source && n(
761
+ r && e.source && n(
748
762
  "span",
749
763
  {
750
764
  style: {
751
- background: a.surfaceAlt,
752
- border: `1px solid ${a.border}`,
765
+ background: l.surfaceAlt,
766
+ border: `1px solid ${l.border}`,
753
767
  borderRadius: 10,
754
768
  padding: "0 5px",
755
769
  fontSize: 10,
756
- color: a.textMuted,
770
+ color: l.textMuted,
757
771
  flexShrink: 0,
758
772
  maxWidth: 80,
759
773
  overflow: "hidden",
760
774
  textOverflow: "ellipsis"
761
775
  }
762
776
  },
763
- z(t.source)
777
+ L(e.source)
764
778
  ),
765
779
  // Message
766
780
  n(
767
781
  "span",
768
- { style: { flex: 1, color: a.text, overflow: "hidden", textOverflow: "ellipsis" } },
769
- ...Pt(t.message, c)
782
+ { style: { flex: 1, color: l.text, overflow: "hidden", textOverflow: "ellipsis" } },
783
+ ...Ye(e.message, a)
770
784
  ),
771
785
  // Expand indicator
772
786
  b && n(
773
787
  "span",
774
- { style: { color: a.textMuted, fontSize: 10, flexShrink: 0 } },
788
+ { style: { color: l.textMuted, fontSize: 10, flexShrink: 0 } },
775
789
  f ? "▲" : "▼"
776
790
  )
777
791
  );
778
792
  }
779
- function _t({ metadata: t, theme: e, style: o }) {
793
+ function Ge({ metadata: e, theme: t, style: o }) {
780
794
  const r = {
781
795
  ...o,
782
- background: e.surfaceAlt,
783
- borderBottom: `1px solid ${e.border}`,
796
+ background: t.surfaceAlt,
797
+ borderBottom: `1px solid ${t.border}`,
784
798
  padding: "6px 10px 6px 56px",
785
799
  display: "flex",
786
800
  flexWrap: "wrap",
@@ -790,92 +804,92 @@ function _t({ metadata: t, theme: e, style: o }) {
790
804
  return n(
791
805
  "div",
792
806
  { style: r },
793
- ...Object.entries(t).map(
794
- ([c, s]) => n(
807
+ ...Object.entries(e).map(
808
+ ([a, s]) => n(
795
809
  "span",
796
810
  {
797
- key: c,
811
+ key: a,
798
812
  style: {
799
813
  fontSize: 11,
800
814
  fontFamily: "monospace",
801
- color: e.textMuted,
802
- background: e.surface,
803
- border: `1px solid ${e.border}`,
815
+ color: t.textMuted,
816
+ background: t.surface,
817
+ border: `1px solid ${t.border}`,
804
818
  borderRadius: 4,
805
819
  padding: "1px 6px"
806
820
  }
807
821
  },
808
- n("span", { style: { color: e.info } }, `${z(c)}: `),
809
- z(String(s))
822
+ n("span", { style: { color: t.info } }, `${L(a)}: `),
823
+ L(String(s))
810
824
  )
811
825
  )
812
826
  );
813
827
  }
814
- function Qt({
815
- entries: t,
816
- maxEntries: e = 500,
828
+ function et({
829
+ entries: e,
830
+ maxEntries: t = 500,
817
831
  height: o = 400,
818
832
  autoScroll: r = !0,
819
- showLevel: c = !0,
833
+ showLevel: a = !0,
820
834
  showTimestamp: s = !0,
821
835
  showSource: f = !0,
822
836
  filterLevel: u,
823
- searchQuery: x = "",
824
- monospace: a = !0,
825
- onEntryClick: m
837
+ searchQuery: h = "",
838
+ monospace: l = !0,
839
+ onEntryClick: y
826
840
  }) {
827
- const v = tt();
828
- Dt();
829
- const k = D(null), [b, y] = C(0), [W, E] = C(/* @__PURE__ */ new Set()), [B, L] = C(!1), $ = D(t.length), w = Q(() => {
830
- let d = t.slice(-e);
841
+ const v = ee();
842
+ je();
843
+ const k = D(null), [b, x] = W(0), [C, N] = W(/* @__PURE__ */ new Set()), [V, R] = W(!1), $ = D(e.length), w = Q(() => {
844
+ let d = e.slice(-t);
831
845
  if (u !== void 0) {
832
- const l = mt[u];
833
- d = d.filter((p) => mt[p.level] >= l);
846
+ const c = ye[u];
847
+ d = d.filter((p) => ye[p.level] >= c);
834
848
  }
835
- if (x) {
836
- const l = x.toLowerCase();
849
+ if (h) {
850
+ const c = h.toLowerCase();
837
851
  d = d.filter(
838
- (p) => p.message.toLowerCase().includes(l) || (p.source ?? "").toLowerCase().includes(l)
852
+ (p) => p.message.toLowerCase().includes(c) || (p.source ?? "").toLowerCase().includes(c)
839
853
  );
840
854
  }
841
855
  return d;
842
- }, [t, e, u, x]), P = typeof o == "number" ? o : 400, Y = 40, H = Q(() => {
856
+ }, [e, t, u, h]), P = typeof o == "number" ? o : 400, Y = 40, H = Q(() => {
843
857
  const d = [];
844
- let l = 0;
858
+ let c = 0;
845
859
  for (const p of w)
846
- d.push(l), l += Z + (W.has(p.id) ? Y : 0);
847
- return d.push(l), d;
848
- }, [w, W]), g = H[H.length - 1] ?? 0;
849
- V(() => {
850
- !r || B || w.length !== $.current && ($.current = w.length, k.current && (k.current.scrollTop = k.current.scrollHeight));
851
- }, [w.length, r, B]);
860
+ d.push(c), c += Z + (C.has(p.id) ? Y : 0);
861
+ return d.push(c), d;
862
+ }, [w, C]), g = H[H.length - 1] ?? 0;
863
+ B(() => {
864
+ !r || V || w.length !== $.current && ($.current = w.length, k.current && (k.current.scrollTop = k.current.scrollHeight));
865
+ }, [w.length, r, V]);
852
866
  const T = K(() => {
853
867
  if (!k.current) return;
854
- const d = k.current, l = d.scrollHeight - d.scrollTop - d.clientHeight < Z * 2;
855
- L(!l), y(d.scrollTop);
868
+ const d = k.current, c = d.scrollHeight - d.scrollTop - d.clientHeight < Z * 2;
869
+ R(!c), x(d.scrollTop);
856
870
  }, []), G = K((d) => {
857
- E((l) => {
858
- const p = new Set(l);
871
+ N((c) => {
872
+ const p = new Set(c);
859
873
  return p.has(d) ? p.delete(d) : p.add(d), p;
860
874
  });
861
875
  }, []);
862
- function R(d) {
863
- let l = 0, p = w.length - 1;
864
- for (; l < p; ) {
865
- const M = l + p >> 1;
866
- (H[M + 1] ?? 0) <= d ? l = M + 1 : p = M;
876
+ function z(d) {
877
+ let c = 0, p = w.length - 1;
878
+ for (; c < p; ) {
879
+ const M = c + p >> 1;
880
+ (H[M + 1] ?? 0) <= d ? c = M + 1 : p = M;
867
881
  }
868
- return Math.max(0, l - yt);
882
+ return Math.max(0, c - me);
869
883
  }
870
884
  function I(d) {
871
- let l = 0, p = w.length - 1;
872
- for (; l < p; ) {
873
- const M = l + p + 1 >> 1;
874
- (H[M] ?? 0) >= d + P ? p = M - 1 : l = M;
885
+ let c = 0, p = w.length - 1;
886
+ for (; c < p; ) {
887
+ const M = c + p + 1 >> 1;
888
+ (H[M] ?? 0) >= d + P ? p = M - 1 : c = M;
875
889
  }
876
- return Math.min(w.length - 1, l + yt);
890
+ return Math.min(w.length - 1, c + me);
877
891
  }
878
- const S = w.length > 0 ? R(b) : 0, N = w.length > 0 ? I(b) : -1, j = {
892
+ const S = w.length > 0 ? z(b) : 0, E = w.length > 0 ? I(b) : -1, j = {
879
893
  position: "relative",
880
894
  overflow: "auto",
881
895
  height: typeof o == "number" ? `${o}px` : o,
@@ -895,29 +909,29 @@ function Qt({
895
909
  n("span", { style: { color: v.textMuted, fontSize: 13, fontFamily: "monospace" } }, "No log entries.")
896
910
  );
897
911
  const A = [];
898
- for (let d = S; d <= N; d++) {
899
- const l = w[d];
900
- if (!l) continue;
901
- const p = H[d] ?? 0, M = W.has(l.id);
912
+ for (let d = S; d <= E; d++) {
913
+ const c = w[d];
914
+ if (!c) continue;
915
+ const p = H[d] ?? 0, M = C.has(c.id);
902
916
  A.push(
903
- n(Yt, {
904
- key: l.id,
905
- entry: l,
906
- showLevel: c,
917
+ n(_e, {
918
+ key: c.id,
919
+ entry: c,
920
+ showLevel: a,
907
921
  showTimestamp: s,
908
922
  showSource: f,
909
- searchQuery: x,
910
- monospace: a,
923
+ searchQuery: h,
924
+ monospace: l,
911
925
  isExpanded: M,
912
- onToggle: () => G(l.id),
913
- onEntryClick: m,
926
+ onToggle: () => G(c.id),
927
+ onEntryClick: y,
914
928
  theme: v,
915
929
  style: { position: "absolute", top: p, left: 0, right: 0 }
916
930
  })
917
- ), M && l.metadata && Object.keys(l.metadata).length > 0 && A.push(
918
- n(_t, {
919
- key: `${l.id}-meta`,
920
- metadata: l.metadata,
931
+ ), M && c.metadata && Object.keys(c.metadata).length > 0 && A.push(
932
+ n(Ge, {
933
+ key: `${c.id}-meta`,
934
+ metadata: c.metadata,
921
935
  theme: v,
922
936
  style: { position: "absolute", top: p + Z, left: 0, right: 0, height: Y }
923
937
  })
@@ -937,8 +951,8 @@ function Qt({
937
951
  );
938
952
  }
939
953
  export {
940
- qt as TkxLiveFeed,
941
- Qt as TkxLiveLog,
942
- Jt as TkxLiveMetrics,
943
- Zt as TkxRealTimeChart
954
+ Je as TkxLiveFeed,
955
+ et as TkxLiveLog,
956
+ Ze as TkxLiveMetrics,
957
+ Qe as TkxRealTimeChart
944
958
  };