@overdoser/react-toolkit 0.10.1 → 0.11.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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +55 -0
- package/components/Timeline/GanttTimeline.js +66 -64
- package/components/Timeline/HistoryTimeline.js +58 -57
- package/components/Timeline/Timeline.module.scss.js +112 -96
- package/components/Timeline/TimelineShared.d.ts +14 -4
- package/components/Timeline/TimelineShared.js +135 -95
- package/components/Timeline/TraceTimeline.d.ts +40 -9
- package/components/Timeline/TraceTimeline.js +598 -370
- package/components/Timeline/TraceTimeline.module.scss.js +163 -103
- package/components/Timeline/index.d.ts +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +12 -7
- package/manifest.json +29 -8
- package/package.json +1 -1
|
@@ -1,422 +1,470 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as l, jsxs as a, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ul, useRef as p, useState as v, useEffect as ae, useCallback as ie, useLayoutEffect as ml, useMemo as Ct } from "react";
|
|
3
3
|
import c from "clsx";
|
|
4
4
|
import i from "./Timeline.module.scss.js";
|
|
5
|
-
import
|
|
6
|
-
import { fmtDateISO as
|
|
7
|
-
import { traceChipWidth as
|
|
8
|
-
import { TimelineSummary as
|
|
9
|
-
import { useNowTicker as
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import t from "./TraceTimeline.module.scss.js";
|
|
6
|
+
import { fmtDateISO as be, fmtClockUTC as A, fmtISO as V, ticks as hl, tickSubdiv as pl, TL_COLORS as S, fmtDur as we, eventMatches as fl, tint as D, TIMELINE_PALETTE_VARS as Tt } from "./timelineCore.js";
|
|
7
|
+
import { traceChipWidth as gl, layoutTraceBand as vl } from "./traceLayout.js";
|
|
8
|
+
import { TimelineSummary as Nl, TimelineZoomControls as yl, TimelineLegend as bl, HighlightText as kt, TimelineTooltip as wl } from "./TimelineShared.js";
|
|
9
|
+
import { useNowTicker as xl, useContainerWidth as Sl, useTimelinePan as Cl, useWheelZoom as Tl, animateScrollTo as Mt } from "./useTimeline.js";
|
|
10
|
+
import { CopyButton as xe } from "../ActionButton/CopyButton.js";
|
|
11
|
+
const N = 84, Lt = 24, F = 400, kl = 51, Se = 300, Il = ul(
|
|
12
|
+
function(Bt, Rt) {
|
|
12
13
|
const {
|
|
13
14
|
events: u,
|
|
14
|
-
title:
|
|
15
|
-
meta:
|
|
16
|
-
highlight:
|
|
17
|
-
defaultHighlight:
|
|
18
|
-
onHighlightChange:
|
|
19
|
-
showSearch:
|
|
20
|
-
renderSearch:
|
|
21
|
-
services:
|
|
22
|
-
serviceColors:
|
|
23
|
-
compactRows:
|
|
24
|
-
showGridlines:
|
|
25
|
-
showControls:
|
|
26
|
-
showLegend:
|
|
27
|
-
showSummary:
|
|
28
|
-
summaryPlacement:
|
|
29
|
-
summaryDefaultPosition:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
title: Ce,
|
|
16
|
+
meta: Te,
|
|
17
|
+
highlight: ke,
|
|
18
|
+
defaultHighlight: Ht,
|
|
19
|
+
onHighlightChange: Et,
|
|
20
|
+
showSearch: Pt = !0,
|
|
21
|
+
renderSearch: Ze,
|
|
22
|
+
services: _e,
|
|
23
|
+
serviceColors: Dt,
|
|
24
|
+
compactRows: qt = !1,
|
|
25
|
+
showGridlines: Ot = !0,
|
|
26
|
+
showControls: Ye = !0,
|
|
27
|
+
showLegend: Wt = !0,
|
|
28
|
+
showSummary: re = !0,
|
|
29
|
+
summaryPlacement: R = "bubble",
|
|
30
|
+
summaryDefaultPosition: It,
|
|
31
|
+
showDock: C = !0,
|
|
32
|
+
defaultDock: At = null,
|
|
33
|
+
maxHeight: Vt = "80vh",
|
|
34
|
+
minHeight: Ft = 420,
|
|
35
|
+
selectedEventId: U,
|
|
36
|
+
defaultSelectedEventId: Qe = null,
|
|
37
|
+
onEventSelect: Ut,
|
|
38
|
+
renderChip: et,
|
|
39
|
+
renderTooltip: Me,
|
|
40
|
+
renderDetails: Le,
|
|
37
41
|
classes: m,
|
|
38
|
-
className:
|
|
39
|
-
style:
|
|
40
|
-
} =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
className: zt,
|
|
43
|
+
style: $t
|
|
44
|
+
} = Bt, f = p(null), [tt, lt] = v(null), [nt, st] = v(!0), [y, Be] = v(null), [Jt, at] = v(null), [H, Re] = v(null), [z, it] = v(null), [Kt, Xt] = v(null), [jt, Gt] = v(null), rt = p(!1), [Zt, _t] = v(Qe), g = U !== void 0 ? U : Zt, [x, $] = v(
|
|
45
|
+
() => C ? At ?? ((U !== void 0 ? U : Qe) != null ? "details" : null) : null
|
|
46
|
+
), ct = p(g);
|
|
47
|
+
ae(() => {
|
|
48
|
+
g != null && g !== ct.current && C && x == null && $("details"), ct.current = g;
|
|
49
|
+
}, [g, C, x]);
|
|
50
|
+
const [ce, Yt] = v({ l: 0, w: 0 }), ot = p(re);
|
|
51
|
+
ot.current = re;
|
|
52
|
+
const He = ie(() => {
|
|
53
|
+
const e = f.current;
|
|
54
|
+
e && Yt(
|
|
55
|
+
(n) => n.l === e.scrollLeft && n.w === e.clientWidth ? n : { l: e.scrollLeft, w: e.clientWidth }
|
|
46
56
|
);
|
|
47
57
|
}, []);
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
ae(() => {
|
|
59
|
+
re && He();
|
|
50
60
|
});
|
|
51
|
-
const [
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
const e =
|
|
61
|
+
const [J, Qt] = v({ l: 0, w: 2e3 }), Ee = p(J);
|
|
62
|
+
Ee.current = J;
|
|
63
|
+
const Pe = ie(() => {
|
|
64
|
+
const e = f.current;
|
|
55
65
|
if (!e) return;
|
|
56
|
-
const
|
|
57
|
-
(
|
|
58
|
-
}, []),
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
const n = Math.floor(e.scrollLeft / F) * F, s = (Math.ceil((e.clientWidth || 1600) / F) + 1) * F;
|
|
67
|
+
(n !== Ee.current.l || s !== Ee.current.w) && Qt({ l: n, w: s });
|
|
68
|
+
}, []), dt = u.some((e) => e.end == null), M = xl(dt, 400), oe = Sl(f), K = Cl(f), X = p(null), j = p(null), ut = p(null), [el, mt] = v(null), G = p(null);
|
|
69
|
+
ae(
|
|
70
|
+
() => () => {
|
|
71
|
+
G.current && clearTimeout(G.current);
|
|
72
|
+
},
|
|
73
|
+
[]
|
|
74
|
+
);
|
|
75
|
+
const [tl, ll] = v(Ht ?? ""), De = ke !== void 0 ? ke : tl, B = De.trim(), ht = (e) => {
|
|
76
|
+
ke === void 0 && ll(e), Et?.(e);
|
|
77
|
+
}, pt = Ze ? Ze({ value: De, setValue: ht }) : Pt ? /* @__PURE__ */ l(
|
|
61
78
|
"input",
|
|
62
79
|
{
|
|
63
80
|
className: c(i.searchInput, m?.search),
|
|
64
81
|
placeholder: "Highlight keyword in events…",
|
|
65
82
|
"aria-label": "Highlight keyword",
|
|
66
|
-
value:
|
|
67
|
-
onChange: (e) =>
|
|
83
|
+
value: De,
|
|
84
|
+
onChange: (e) => ht(e.target.value)
|
|
68
85
|
}
|
|
69
|
-
) : null,
|
|
70
|
-
let
|
|
71
|
-
u.length ? (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
) : null, q = (e) => e.op || e.requestId || e.reqHeaders && e.reqHeaders["x-request-id"] || e.id, Z = (e) => e.source || "client";
|
|
87
|
+
let d, _;
|
|
88
|
+
u.length ? (d = Math.min(...u.map((e) => e.start)), _ = Math.max(d + 1e3, ...u.map((e) => e.end ?? M))) : (d = M - 3e4, _ = M + 5e3);
|
|
89
|
+
const qe = (_ - d) * 0.03;
|
|
90
|
+
d -= qe, _ += qe;
|
|
91
|
+
const Oe = _ - d, ft = Math.max(240, oe - N - Lt), de = Math.max(ft * 0.45, ft - 210) / Oe, b = nt || !tt ? de : tt, We = p(de), O = p(b), Ie = p(d), Ae = p(1e9);
|
|
92
|
+
We.current = de, O.current = b, Ie.current = d;
|
|
93
|
+
const ue = p(null);
|
|
94
|
+
ml(() => {
|
|
95
|
+
ue.current != null && f.current && (f.current.scrollLeft = ue.current, ue.current = null), Pe();
|
|
79
96
|
});
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
|
|
97
|
+
const Ve = ie((e, n) => {
|
|
98
|
+
const s = f.current;
|
|
99
|
+
if (!s) return;
|
|
100
|
+
const h = O.current || 1e-3, o = Math.max(We.current ? We.current * 0.2 : 1e-7, Math.min(10, h * e)), w = (s.scrollLeft + n - N) / h;
|
|
101
|
+
ue.current = w * o + N - n, st(!1), lt(o);
|
|
85
102
|
}, []);
|
|
86
|
-
|
|
103
|
+
Tl(f, (e) => {
|
|
87
104
|
e.preventDefault();
|
|
88
|
-
const
|
|
89
|
-
|
|
105
|
+
const n = f.current;
|
|
106
|
+
n && Ve(
|
|
90
107
|
Math.exp(-(e.deltaY || e.deltaX) * 22e-4),
|
|
91
|
-
e.clientX -
|
|
108
|
+
e.clientX - n.getBoundingClientRect().left
|
|
92
109
|
);
|
|
93
110
|
});
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const e =
|
|
98
|
-
if (!e || !
|
|
99
|
-
const
|
|
100
|
-
|
|
111
|
+
const Fe = p(null), nl = ie(() => {
|
|
112
|
+
Fe.current == null && (Fe.current = requestAnimationFrame(() => {
|
|
113
|
+
Fe.current = null;
|
|
114
|
+
const e = f.current;
|
|
115
|
+
if (!e || !O.current) return;
|
|
116
|
+
const n = Ie.current + Math.max(0, e.scrollLeft + 117 - N) / O.current;
|
|
117
|
+
Xt(be(n)), Gt(rt.current ? A(n) : null), Pe(), ot.current && He();
|
|
101
118
|
}));
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
|
|
119
|
+
}, [He, Pe]), Ue = p(null), sl = ie((e) => {
|
|
120
|
+
const n = e.clientX;
|
|
121
|
+
Ue.current == null && (Ue.current = requestAnimationFrame(() => {
|
|
122
|
+
Ue.current = null;
|
|
123
|
+
const s = f.current;
|
|
124
|
+
if (!s) return;
|
|
125
|
+
const h = s.getBoundingClientRect(), o = n - h.left + s.scrollLeft;
|
|
126
|
+
if (o < N + 5 || !O.current) {
|
|
127
|
+
Re(null);
|
|
111
128
|
return;
|
|
112
129
|
}
|
|
113
|
-
const
|
|
114
|
-
|
|
130
|
+
const w = Ie.current + (o - N) / O.current, k = Math.max(88, Math.min(Math.round(o), Ae.current - 88));
|
|
131
|
+
Re({ left: Math.round(o), chipLeft: k, label: V(w, !0), t: w });
|
|
115
132
|
}));
|
|
116
|
-
}, []),
|
|
117
|
-
|
|
118
|
-
},
|
|
133
|
+
}, []), me = (e) => {
|
|
134
|
+
U === void 0 && _t(e ? e.id : null), Ut?.(e);
|
|
135
|
+
}, ze = Ct(() => {
|
|
119
136
|
const e = [];
|
|
120
|
-
return (
|
|
121
|
-
u.some((
|
|
122
|
-
}), u.forEach((
|
|
123
|
-
e.includes(
|
|
137
|
+
return (_e || []).forEach((n) => {
|
|
138
|
+
u.some((s) => s.service === n) && e.push(n);
|
|
139
|
+
}), u.forEach((n) => {
|
|
140
|
+
e.includes(n.service) || e.push(n.service);
|
|
124
141
|
}), e;
|
|
125
|
-
}, [u,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}), Object.assign(
|
|
129
|
-
const
|
|
142
|
+
}, [u, _e]), L = {};
|
|
143
|
+
ze.forEach((e, n) => {
|
|
144
|
+
L[e] = Tt[n % Tt.length];
|
|
145
|
+
}), Object.assign(L, Dt);
|
|
146
|
+
const gt = qt, vt = gt ? 20 : 26, al = gt ? 60 : 66, il = u.map((e) => ({
|
|
130
147
|
id: e.id,
|
|
131
|
-
left: Math.round(
|
|
132
|
-
width: Math.round(Math.max(12, ((e.end ?? M) - e.start) *
|
|
133
|
-
labelW:
|
|
134
|
-
})),
|
|
135
|
-
barH:
|
|
136
|
-
rowH:
|
|
137
|
-
chipH:
|
|
138
|
-
minH:
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
left: Math.round(
|
|
149
|
-
date:
|
|
150
|
-
time: !
|
|
151
|
-
sub:
|
|
152
|
-
}),
|
|
148
|
+
left: Math.round(N + (e.start - d) * b),
|
|
149
|
+
width: Math.round(Math.max(12, ((e.end ?? M) - e.start) * b)),
|
|
150
|
+
labelW: gl(Z(e), e.service, String(q(e)))
|
|
151
|
+
})), he = vl(il, {
|
|
152
|
+
barH: vt,
|
|
153
|
+
rowH: al,
|
|
154
|
+
chipH: kl,
|
|
155
|
+
minH: Ft
|
|
156
|
+
}), pe = new Map(he.items.map((e) => [e.id, e])), $e = Math.ceil(Math.max(N + Oe * b + Lt + 60, he.maxExt + 26));
|
|
157
|
+
Ae.current = $e;
|
|
158
|
+
const rl = d + ($e - N) / b, Y = Math.max(d, d + (J.l - F - N) / b), fe = Math.min(rl, d + (J.l + J.w + F - N) / b), E = hl(Y, fe, Math.max(1, (fe - Y) * b), 64), ge = E.step < 1e3;
|
|
159
|
+
rt.current = ge;
|
|
160
|
+
const Je = [], Nt = Math.max(d, (E.list.length ? E.list[0].t : Y) - E.step);
|
|
161
|
+
let yt = be(Nt), bt = A(Nt);
|
|
162
|
+
E.list.forEach((e) => {
|
|
163
|
+
const n = be(e.t), s = A(e.t);
|
|
164
|
+
Je.push({
|
|
165
|
+
left: Math.round(N + (e.t - d) * b),
|
|
166
|
+
date: n !== yt ? n : null,
|
|
167
|
+
time: !ge || s !== bt ? s : null,
|
|
168
|
+
sub: ge ? "." + String(new Date(e.t).getUTCMilliseconds()).padStart(3, "0") : null
|
|
169
|
+
}), yt = n, bt = s;
|
|
153
170
|
});
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
const e =
|
|
157
|
-
if ((
|
|
158
|
-
for (let
|
|
159
|
-
|
|
160
|
-
left: Math.round(
|
|
161
|
-
medium:
|
|
171
|
+
const wt = [], W = pl(E.step);
|
|
172
|
+
if (W.parts > 1) {
|
|
173
|
+
const e = E.step / W.parts;
|
|
174
|
+
if ((fe - Y) / e < 2e3)
|
|
175
|
+
for (let n = Math.ceil(Y / e); n * e <= fe; n++)
|
|
176
|
+
n % W.parts !== 0 && wt.push({
|
|
177
|
+
left: Math.round(N + (n * e - d) * b),
|
|
178
|
+
medium: W.medium > 0 && n % W.parts === W.medium
|
|
162
179
|
});
|
|
163
180
|
}
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
const Ke = H ? H.t : null, r = g != null && u.find((e) => e.id === g) || null;
|
|
182
|
+
ae(() => {
|
|
183
|
+
const e = X.current;
|
|
184
|
+
if (e == null) return;
|
|
185
|
+
const n = f.current;
|
|
186
|
+
if (!n) {
|
|
187
|
+
X.current = null;
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (n.clientWidth && n.clientWidth !== oe) return;
|
|
191
|
+
X.current = null;
|
|
192
|
+
const s = pe.get(e);
|
|
193
|
+
s && Mt(n, { left: Math.max(0, s.left + s.width / 2 - n.clientWidth / 2) });
|
|
194
|
+
}), ae(() => {
|
|
195
|
+
const e = j.current;
|
|
196
|
+
if (e == null) return;
|
|
197
|
+
const n = ut.current;
|
|
198
|
+
if (!n) return;
|
|
199
|
+
j.current = null;
|
|
200
|
+
const s = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/"/g, '\\"'), h = n.querySelector(`[data-crk-log-id="${s}"]`);
|
|
201
|
+
if (!h) return;
|
|
202
|
+
const o = Math.max(
|
|
203
|
+
0,
|
|
204
|
+
n.scrollTop + h.getBoundingClientRect().top - n.getBoundingClientRect().top - 8
|
|
205
|
+
);
|
|
206
|
+
Mt(n, { top: o }, 600), mt(e), G.current && clearTimeout(G.current), G.current = setTimeout(() => mt(null), 1200);
|
|
207
|
+
});
|
|
208
|
+
const cl = (e, n) => {
|
|
209
|
+
const s = pe.get(e.id);
|
|
210
|
+
if (!s) return;
|
|
211
|
+
const h = e.end == null, o = (e.end ?? M) - e.start;
|
|
212
|
+
if (it({
|
|
213
|
+
left: s.left,
|
|
214
|
+
chipLeft: Math.max(88, Math.min(s.left, Ae.current - 88)),
|
|
215
|
+
label: V(e.start, !0)
|
|
216
|
+
}), at(e.id), g === e.id) return;
|
|
217
|
+
const w = f.current, k = w ? w.getBoundingClientRect() : { left: 0 }, ee = w ? w.scrollLeft : 0, ve = window.innerWidth || 1200, te = window.innerHeight || 800, Ne = s.showLabel ? s.labelW : 0, le = s.showLabel ? s.labelX : s.left, Ge = k.left - ee + Math.min(s.left, le), ne = k.left - ee + Math.max(s.left + s.width, le + Ne), se = n.currentTarget.getBoundingClientRect();
|
|
218
|
+
let T = ne + 28, ye = Math.max(95, Math.min(n.clientY, te - 120));
|
|
219
|
+
T + Se > ve - 12 && (T = Ge - Se - 28), T < 12 && (T = Math.max(12, Math.min(ve - Se - 12, n.clientX - Se / 2)), ye = se.bottom + 108, ye > te - 95 && (ye = Math.max(95, se.top - 108))), Be({
|
|
176
220
|
id: e.id,
|
|
177
|
-
x:
|
|
178
|
-
y:
|
|
179
|
-
rid: String(
|
|
180
|
-
route:
|
|
221
|
+
x: T,
|
|
222
|
+
y: ye,
|
|
223
|
+
rid: String(q(e)),
|
|
224
|
+
route: Z(e) + " → " + e.service,
|
|
181
225
|
label: e.label || (e.method || "GET") + " " + (e.url ? e.url.replace(/^https?:\/\/[^/]+/, "") : e.id),
|
|
182
|
-
time:
|
|
183
|
-
durLine:
|
|
226
|
+
time: V(e.start, !0),
|
|
227
|
+
durLine: h ? "in flight · " + we(o) + " so far" : we(o) + " · status " + (e.status ?? "—"),
|
|
184
228
|
url: e.url || ""
|
|
185
229
|
});
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
|
|
230
|
+
}, ol = () => {
|
|
231
|
+
Be(null), it(null), at(null);
|
|
232
|
+
}, Xe = (e) => Object.entries(e || {}).map(([n, s]) => ({ k: n, v: String(s) })), I = r ? r.end == null : !1, xt = C ? x === "details" : r != null, dl = C && x === "log", je = () => {
|
|
233
|
+
me(null), C && $(null);
|
|
234
|
+
}, St = Ct(() => u.slice().sort((e, n) => e.start - n.start), [u]), Q = re ? /* @__PURE__ */ l(
|
|
235
|
+
Nl,
|
|
190
236
|
{
|
|
191
237
|
className: m?.summary,
|
|
192
|
-
placement:
|
|
193
|
-
floatingDefaultPosition:
|
|
194
|
-
|
|
195
|
-
|
|
238
|
+
placement: R,
|
|
239
|
+
floatingDefaultPosition: It,
|
|
240
|
+
bubbleGlyphColors: ze.slice(0, 3).map((e) => L[e]),
|
|
241
|
+
items: St.map((e, n) => {
|
|
242
|
+
const s = pe.get(e.id);
|
|
196
243
|
return {
|
|
197
244
|
id: e.id,
|
|
198
|
-
number: String(
|
|
199
|
-
label: String(
|
|
200
|
-
color:
|
|
201
|
-
time:
|
|
202
|
-
inView: !
|
|
203
|
-
selected:
|
|
245
|
+
number: String(n + 1).padStart(2, "0"),
|
|
246
|
+
label: String(q(e)),
|
|
247
|
+
color: L[e.service] || S.body,
|
|
248
|
+
time: A(e.start),
|
|
249
|
+
inView: !s || !ce.w ? !0 : s.left < ce.l + ce.w && s.left + s.width > ce.l,
|
|
250
|
+
selected: g === e.id
|
|
204
251
|
};
|
|
205
252
|
}),
|
|
206
253
|
onPick: (e) => {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
left: Math.max(0, t.left + t.width / 2 - l.clientWidth / 2)
|
|
210
|
-
});
|
|
254
|
+
const n = u.find((s) => s.id === e);
|
|
255
|
+
n && (me(n), x === "log" && (j.current = e)), X.current = e;
|
|
211
256
|
}
|
|
212
257
|
}
|
|
213
258
|
) : null;
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
(
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
218
|
-
/* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ a("div", { ref: Rt, className: c(i.root, m?.root, zt), style: $t, children: [
|
|
260
|
+
(Ye || pt || Ce != null || Te != null) && /* @__PURE__ */ a("div", { className: c(i.toolbar, m?.toolbar), children: [
|
|
261
|
+
/* @__PURE__ */ a("div", { className: i.toolbarText, children: [
|
|
262
|
+
Ce != null && /* @__PURE__ */ l("span", { className: i.toolbarTitle, children: Ce }),
|
|
263
|
+
/* @__PURE__ */ l("span", { className: i.toolbarMeta, children: Te ?? (u.length ? `${u.length} events · span ${we(Oe - 2 * qe)} · times in UTC` : "No events") })
|
|
219
264
|
] }),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
265
|
+
pt,
|
|
266
|
+
Ye && /* @__PURE__ */ l(
|
|
267
|
+
yl,
|
|
223
268
|
{
|
|
224
|
-
zoomPct: `${Math.round(
|
|
225
|
-
fitActive:
|
|
226
|
-
onZoomIn: () =>
|
|
227
|
-
onZoomOut: () =>
|
|
269
|
+
zoomPct: `${Math.round(b / de * 100)}%`,
|
|
270
|
+
fitActive: nt,
|
|
271
|
+
onZoomIn: () => Ve(1.5, oe / 2),
|
|
272
|
+
onZoomOut: () => Ve(1 / 1.5, oe / 2),
|
|
228
273
|
onFit: () => {
|
|
229
|
-
|
|
274
|
+
st(!0), lt(null);
|
|
230
275
|
},
|
|
231
276
|
hint: "scroll zooms · drag pans"
|
|
232
277
|
}
|
|
233
278
|
)
|
|
234
279
|
] }),
|
|
235
|
-
|
|
236
|
-
|
|
280
|
+
Wt && /* @__PURE__ */ l(
|
|
281
|
+
bl,
|
|
237
282
|
{
|
|
238
283
|
className: m?.legend,
|
|
239
|
-
items:
|
|
284
|
+
items: ze.map((e) => ({ name: e, color: L[e] }))
|
|
240
285
|
}
|
|
241
286
|
),
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
287
|
+
R === "top" && Q,
|
|
288
|
+
/* @__PURE__ */ a("div", { className: i.layout, children: [
|
|
289
|
+
R === "left" && Q,
|
|
290
|
+
/* @__PURE__ */ a("div", { className: i.main, children: [
|
|
291
|
+
/* @__PURE__ */ l("div", { className: c(i.card, m?.card), children: /* @__PURE__ */ l(
|
|
247
292
|
"div",
|
|
248
293
|
{
|
|
249
|
-
ref:
|
|
250
|
-
className: c(i.scroller,
|
|
251
|
-
style: { maxHeight:
|
|
252
|
-
onPointerDown:
|
|
253
|
-
onPointerMove:
|
|
254
|
-
onPointerUp:
|
|
294
|
+
ref: f,
|
|
295
|
+
className: c(i.scroller, t.scroller, m?.scroller),
|
|
296
|
+
style: { maxHeight: Vt },
|
|
297
|
+
onPointerDown: K.onPointerDown,
|
|
298
|
+
onPointerMove: K.onPointerMove,
|
|
299
|
+
onPointerUp: K.onPointerUp,
|
|
255
300
|
onPointerLeave: () => {
|
|
256
|
-
|
|
301
|
+
K.onPointerUp(), Re(null);
|
|
257
302
|
},
|
|
258
|
-
onMouseMove:
|
|
259
|
-
onScroll:
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
303
|
+
onMouseMove: sl,
|
|
304
|
+
onScroll: nl,
|
|
305
|
+
children: /* @__PURE__ */ a("div", { className: t.inner, style: { width: $e }, children: [
|
|
306
|
+
Ot && Je.map((e, n) => /* @__PURE__ */ l("div", { className: t.gridline, style: { left: e.left } }, n)),
|
|
307
|
+
dt && /* @__PURE__ */ l(
|
|
263
308
|
"div",
|
|
264
309
|
{
|
|
265
|
-
className:
|
|
266
|
-
style: { left: Math.round(
|
|
310
|
+
className: t.nowLine,
|
|
311
|
+
style: { left: Math.round(N + (M - d) * b) }
|
|
267
312
|
}
|
|
268
313
|
),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
|
|
314
|
+
H && !y && /* @__PURE__ */ l("div", { className: t.cursorLine, style: { left: H.left } }),
|
|
315
|
+
z && /* @__PURE__ */ l("div", { className: t.eventLine, style: { left: z.left } }),
|
|
316
|
+
/* @__PURE__ */ a("div", { className: c(t.axis, m?.axis), children: [
|
|
317
|
+
/* @__PURE__ */ l("div", { className: t.axisDivider }),
|
|
318
|
+
/* @__PURE__ */ a("div", { className: t.axisSticky, children: [
|
|
319
|
+
/* @__PURE__ */ l("span", { className: t.axisUtc, children: "UTC" }),
|
|
320
|
+
/* @__PURE__ */ l("span", { className: t.axisViewDate, children: Kt || (u.length ? be(d) : "") }),
|
|
321
|
+
ge && /* @__PURE__ */ l("span", { className: t.axisViewTime, children: jt || A(d) })
|
|
277
322
|
] }),
|
|
278
|
-
|
|
279
|
-
e.date && /* @__PURE__ */
|
|
280
|
-
e.time && /* @__PURE__ */
|
|
281
|
-
e.sub && /* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
] },
|
|
284
|
-
|
|
323
|
+
Je.map((e, n) => /* @__PURE__ */ a("span", { children: [
|
|
324
|
+
e.date && /* @__PURE__ */ l("span", { className: t.axisDateLabel, style: { left: e.left }, children: e.date }),
|
|
325
|
+
e.time && /* @__PURE__ */ l("span", { className: t.axisTickLabel, style: { left: e.left }, children: e.time }),
|
|
326
|
+
e.sub && /* @__PURE__ */ l("span", { className: t.axisSubLabel, style: { left: e.left }, children: e.sub }),
|
|
327
|
+
/* @__PURE__ */ l("span", { className: t.axisTickMark, style: { left: e.left } })
|
|
328
|
+
] }, n)),
|
|
329
|
+
wt.map((e, n) => /* @__PURE__ */ l(
|
|
285
330
|
"span",
|
|
286
331
|
{
|
|
287
|
-
className: c(
|
|
332
|
+
className: c(t.axisMinorMark, e.medium && t.axisMinorMedium),
|
|
288
333
|
style: { left: e.left }
|
|
289
334
|
},
|
|
290
|
-
|
|
335
|
+
n
|
|
291
336
|
)),
|
|
292
|
-
|
|
293
|
-
|
|
337
|
+
H && !y && /* @__PURE__ */ l("div", { className: t.axisChip, style: { left: H.chipLeft }, children: H.label }),
|
|
338
|
+
z && /* @__PURE__ */ a(
|
|
294
339
|
"div",
|
|
295
340
|
{
|
|
296
|
-
className: c(
|
|
297
|
-
style: { left:
|
|
341
|
+
className: c(t.axisChip, t.axisChipEvent),
|
|
342
|
+
style: { left: z.chipLeft },
|
|
298
343
|
children: [
|
|
299
344
|
"▸ ",
|
|
300
|
-
|
|
345
|
+
z.label
|
|
301
346
|
]
|
|
302
347
|
}
|
|
303
348
|
)
|
|
304
349
|
] }),
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ a("div", { className: t.lane, style: { height: he.h }, children: [
|
|
351
|
+
/* @__PURE__ */ l("div", { className: t.axisLine, style: { top: he.axisY } }),
|
|
307
352
|
u.map((e) => {
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
310
|
-
const
|
|
353
|
+
const n = pe.get(e.id);
|
|
354
|
+
if (!n) return null;
|
|
355
|
+
const s = L[e.service] || S.body, h = e.end == null, o = fl(e, B), w = Ke != null && Ke >= e.start && Ke <= (e.end ?? M), k = Jt === e.id, ee = B && !o ? 0.25 : 1, ve = String(q(e)), te = Z(e), Ne = L[te] || S.body, le = L[e.service] || S.body, Ge = k ? `0 0 0 3px ${D(s, 55)}, 0 4px 14px rgba(35,32,28,.22)` : B && o ? `0 0 0 3px ${S.hlRing}` : g === e.id ? `0 0 0 3px ${S.selectedRing}` : w ? `0 0 0 3px ${D(s, 30)}` : "none", ne = k ? s : w ? S.stemHot : S.stem, se = {
|
|
311
356
|
onClick: () => {
|
|
312
|
-
|
|
357
|
+
if (K.wasDragSuppressed()) return;
|
|
358
|
+
Be(null);
|
|
359
|
+
const T = g === e.id ? null : e;
|
|
360
|
+
me(T), T && x === "log" && (j.current = T.id);
|
|
313
361
|
},
|
|
314
|
-
onMouseEnter: (
|
|
315
|
-
onMouseLeave:
|
|
362
|
+
onMouseEnter: (T) => cl(e, T),
|
|
363
|
+
onMouseLeave: ol
|
|
316
364
|
};
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
|
|
319
|
-
|
|
365
|
+
return /* @__PURE__ */ a("span", { children: [
|
|
366
|
+
n.showLabel && /* @__PURE__ */ a(P, { children: [
|
|
367
|
+
n.conn && !n.hconn && /* @__PURE__ */ l(
|
|
320
368
|
"div",
|
|
321
369
|
{
|
|
322
|
-
className:
|
|
370
|
+
className: t.stem,
|
|
323
371
|
style: {
|
|
324
|
-
left:
|
|
325
|
-
top:
|
|
326
|
-
height:
|
|
327
|
-
background:
|
|
372
|
+
left: n.left,
|
|
373
|
+
top: n.connTop,
|
|
374
|
+
height: n.connH,
|
|
375
|
+
background: ne
|
|
328
376
|
}
|
|
329
377
|
}
|
|
330
378
|
),
|
|
331
|
-
|
|
332
|
-
/* @__PURE__ */
|
|
379
|
+
n.conn && n.hconn && /* @__PURE__ */ a(P, { children: [
|
|
380
|
+
/* @__PURE__ */ l(
|
|
333
381
|
"div",
|
|
334
382
|
{
|
|
335
|
-
className:
|
|
383
|
+
className: t.stem,
|
|
336
384
|
style: {
|
|
337
|
-
left:
|
|
338
|
-
top:
|
|
339
|
-
height:
|
|
340
|
-
background:
|
|
385
|
+
left: n.left,
|
|
386
|
+
top: n.connTop,
|
|
387
|
+
height: n.connH,
|
|
388
|
+
background: ne
|
|
341
389
|
}
|
|
342
390
|
}
|
|
343
391
|
),
|
|
344
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ l(
|
|
345
393
|
"div",
|
|
346
394
|
{
|
|
347
|
-
className:
|
|
395
|
+
className: t.elbow,
|
|
348
396
|
style: {
|
|
349
|
-
left:
|
|
350
|
-
top:
|
|
351
|
-
width:
|
|
352
|
-
background:
|
|
397
|
+
left: n.hconnLeft,
|
|
398
|
+
top: n.hconnTop,
|
|
399
|
+
width: n.hconnW,
|
|
400
|
+
background: ne
|
|
353
401
|
}
|
|
354
402
|
}
|
|
355
403
|
)
|
|
356
404
|
] }),
|
|
357
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ l(
|
|
358
406
|
"div",
|
|
359
407
|
{
|
|
360
|
-
...
|
|
361
|
-
className: c(
|
|
408
|
+
...se,
|
|
409
|
+
className: c(t.chip, m?.chip),
|
|
362
410
|
style: {
|
|
363
|
-
left:
|
|
364
|
-
top:
|
|
365
|
-
opacity:
|
|
366
|
-
background:
|
|
367
|
-
borderColor:
|
|
368
|
-
boxShadow:
|
|
411
|
+
left: n.labelX,
|
|
412
|
+
top: n.labelTop,
|
|
413
|
+
opacity: ee,
|
|
414
|
+
background: k ? D(s, 7) : B && o ? S.hlWashSoft : void 0,
|
|
415
|
+
borderColor: k ? s : B && o ? S.hlBorder : w ? s : void 0,
|
|
416
|
+
boxShadow: k ? `0 0 0 2px ${D(s, 40)}, 0 4px 12px rgba(35,32,28,.16)` : "0 1px 2px rgba(35,32,28,.06)"
|
|
369
417
|
},
|
|
370
|
-
children:
|
|
371
|
-
color:
|
|
372
|
-
pending:
|
|
418
|
+
children: et ? et(e, {
|
|
419
|
+
color: s,
|
|
420
|
+
pending: h,
|
|
373
421
|
durationMs: (e.end ?? M) - e.start
|
|
374
|
-
}) : /* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
422
|
+
}) : /* @__PURE__ */ a(P, { children: [
|
|
423
|
+
/* @__PURE__ */ a("div", { children: [
|
|
424
|
+
/* @__PURE__ */ l(
|
|
377
425
|
"span",
|
|
378
426
|
{
|
|
379
|
-
className:
|
|
380
|
-
style: { background:
|
|
381
|
-
children:
|
|
427
|
+
className: t.chipBadge,
|
|
428
|
+
style: { background: D(Ne, 14), color: Ne },
|
|
429
|
+
children: te
|
|
382
430
|
}
|
|
383
431
|
),
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ l("span", { className: t.chipArrow, children: " → " }),
|
|
433
|
+
/* @__PURE__ */ l(
|
|
386
434
|
"span",
|
|
387
435
|
{
|
|
388
|
-
className:
|
|
389
|
-
style: { background:
|
|
436
|
+
className: t.chipBadge,
|
|
437
|
+
style: { background: D(le, 14), color: le },
|
|
390
438
|
children: e.service
|
|
391
439
|
}
|
|
392
440
|
)
|
|
393
441
|
] }),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ l("div", { className: t.chipOp, children: /* @__PURE__ */ l(kt, { text: ve, query: B }) }),
|
|
443
|
+
/* @__PURE__ */ l("div", { className: t.chipTime, children: V(e.start, !0) })
|
|
396
444
|
] })
|
|
397
445
|
}
|
|
398
446
|
)
|
|
399
447
|
] }),
|
|
400
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ l(
|
|
401
449
|
"div",
|
|
402
450
|
{
|
|
403
|
-
...
|
|
404
|
-
className: c(
|
|
451
|
+
...se,
|
|
452
|
+
className: c(t.bar, h && t.barPending, m?.bar),
|
|
405
453
|
style: {
|
|
406
|
-
left:
|
|
407
|
-
top:
|
|
408
|
-
width:
|
|
409
|
-
height:
|
|
410
|
-
background:
|
|
411
|
-
borderColor:
|
|
412
|
-
opacity:
|
|
413
|
-
boxShadow:
|
|
454
|
+
left: n.left,
|
|
455
|
+
top: n.barTop,
|
|
456
|
+
width: n.width,
|
|
457
|
+
height: vt,
|
|
458
|
+
background: B && o ? S.hlBarBg : D(s, 22),
|
|
459
|
+
borderColor: s,
|
|
460
|
+
opacity: ee,
|
|
461
|
+
boxShadow: Ge
|
|
414
462
|
},
|
|
415
|
-
children:
|
|
463
|
+
children: h && /* @__PURE__ */ l(
|
|
416
464
|
"span",
|
|
417
465
|
{
|
|
418
|
-
className: c(i.pulseDot,
|
|
419
|
-
style: { background:
|
|
466
|
+
className: c(i.pulseDot, t.barDot),
|
|
467
|
+
style: { background: s }
|
|
420
468
|
}
|
|
421
469
|
)
|
|
422
470
|
}
|
|
@@ -427,103 +475,283 @@ const p = 84, dt = 24, q = 400, dn = 51, me = 300, yn = $t(
|
|
|
427
475
|
] })
|
|
428
476
|
}
|
|
429
477
|
) }),
|
|
430
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ l("div", { className: c(i.footnote, m?.footnote), children: "Click an event to open its details in the side panel · dashed pills are still in flight" }),
|
|
479
|
+
R === "bubble" && Q
|
|
431
480
|
] }),
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
),
|
|
448
|
-
/* @__PURE__ */ n("span", { className: s.drawerRoute, children: Q(a) + " → " + a.service }),
|
|
449
|
-
/* @__PURE__ */ n("div", { className: s.drawerSpacer }),
|
|
450
|
-
/* @__PURE__ */ n(
|
|
451
|
-
"button",
|
|
452
|
-
{
|
|
453
|
-
type: "button",
|
|
454
|
-
className: i.asideClose,
|
|
455
|
-
"aria-label": "Close details",
|
|
456
|
-
onClick: () => Be(null),
|
|
457
|
-
children: "✕"
|
|
458
|
-
}
|
|
459
|
-
)
|
|
460
|
-
] }),
|
|
461
|
-
/* @__PURE__ */ n("div", { className: s.drawerUrl, children: a.url || a.label || a.id }),
|
|
462
|
-
/* @__PURE__ */ n("div", { className: s.drawerRid, children: String(U(a)) }),
|
|
463
|
-
/* @__PURE__ */ n("div", { className: s.drawerXrid, children: a.reqHeaders && a.reqHeaders["x-request-id"] || a.requestId || a.id }),
|
|
464
|
-
/* @__PURE__ */ n("div", { className: s.drawerTiming, children: I(a.start, !0) + (W ? " · in flight" : " → " + I(a.end, !0) + " · " + ue(a.end - a.start)) })
|
|
481
|
+
xt && r && Le && /* @__PURE__ */ l("aside", { className: c(i.aside, t.drawerCustom, m?.drawer), children: Le(r, { close: je, pending: I }) }),
|
|
482
|
+
xt && !(r && Le) && /* @__PURE__ */ a("aside", { className: c(i.aside, C && t.dockAside, m?.drawer), children: [
|
|
483
|
+
C && /* @__PURE__ */ a("div", { className: t.dockHead, children: [
|
|
484
|
+
/* @__PURE__ */ l("span", { className: t.dockTitle, children: "Event details" }),
|
|
485
|
+
/* @__PURE__ */ l("div", { className: t.drawerSpacer }),
|
|
486
|
+
/* @__PURE__ */ l(
|
|
487
|
+
"button",
|
|
488
|
+
{
|
|
489
|
+
type: "button",
|
|
490
|
+
className: i.asideClose,
|
|
491
|
+
"aria-label": "Close details",
|
|
492
|
+
onClick: je,
|
|
493
|
+
children: "✕"
|
|
494
|
+
}
|
|
495
|
+
)
|
|
465
496
|
] }),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
497
|
+
r ? /* @__PURE__ */ a("div", { className: C ? t.dockScroll : void 0, children: [
|
|
498
|
+
/* @__PURE__ */ a("div", { className: t.drawerHead, children: [
|
|
499
|
+
/* @__PURE__ */ a("div", { className: t.drawerHeadRow, children: [
|
|
500
|
+
/* @__PURE__ */ l("span", { className: t.methodBadge, children: r.method || "—" }),
|
|
501
|
+
/* @__PURE__ */ l(
|
|
502
|
+
"span",
|
|
503
|
+
{
|
|
504
|
+
className: c(
|
|
505
|
+
t.statusBadge,
|
|
506
|
+
I && t.statusPending,
|
|
507
|
+
!I && (r.status ?? 0) >= 400 && t.statusError
|
|
508
|
+
),
|
|
509
|
+
children: I ? "pending" : String(r.status ?? "—")
|
|
510
|
+
}
|
|
511
|
+
),
|
|
512
|
+
/* @__PURE__ */ l("span", { className: t.drawerRoute, children: Z(r) + " → " + r.service }),
|
|
513
|
+
/* @__PURE__ */ l("div", { className: t.drawerSpacer }),
|
|
514
|
+
!C && /* @__PURE__ */ l(
|
|
515
|
+
"button",
|
|
516
|
+
{
|
|
517
|
+
type: "button",
|
|
518
|
+
className: i.asideClose,
|
|
519
|
+
"aria-label": "Close details",
|
|
520
|
+
onClick: je,
|
|
521
|
+
children: "✕"
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ l("div", { className: t.drawerUrl, children: r.url || r.label || r.id }),
|
|
526
|
+
/* @__PURE__ */ l("div", { className: t.drawerRid, children: String(q(r)) }),
|
|
527
|
+
/* @__PURE__ */ l("div", { className: t.drawerXrid, children: r.reqHeaders && r.reqHeaders["x-request-id"] || r.requestId || r.id }),
|
|
528
|
+
/* @__PURE__ */ l("div", { className: t.drawerTiming, children: V(r.start, !0) + (I ? " · in flight" : " → " + V(r.end, !0) + " · " + we(r.end - r.start)) })
|
|
483
529
|
] }),
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
530
|
+
/* @__PURE__ */ a("div", { className: t.drawerBody, children: [
|
|
531
|
+
/* @__PURE__ */ l("div", { className: t.drawerSection, children: "Request" }),
|
|
532
|
+
!!Object.keys(r.query || {}).length && /* @__PURE__ */ a(P, { children: [
|
|
533
|
+
/* @__PURE__ */ l("div", { className: i.asideSection, children: "Query parameters" }),
|
|
534
|
+
Xe(r.query).map((e) => /* @__PURE__ */ a("div", { className: t.kvRow, children: [
|
|
535
|
+
/* @__PURE__ */ l("span", { className: c(t.kvKey, t.kvKeyQuery), children: e.k }),
|
|
536
|
+
/* @__PURE__ */ l("span", { className: t.kvVal, children: e.v })
|
|
537
|
+
] }, e.k))
|
|
538
|
+
] }),
|
|
539
|
+
/* @__PURE__ */ l("div", { className: i.asideSection, children: "Headers" }),
|
|
540
|
+
Xe(r.reqHeaders).map((e) => /* @__PURE__ */ a("div", { className: t.kvRow, children: [
|
|
541
|
+
/* @__PURE__ */ l("span", { className: t.kvKey, children: e.k }),
|
|
542
|
+
/* @__PURE__ */ l("span", { className: t.kvVal, children: e.v })
|
|
493
543
|
] }, e.k)),
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
|
|
544
|
+
r.reqBody != null && /* @__PURE__ */ a(P, { children: [
|
|
545
|
+
/* @__PURE__ */ a("div", { className: t.bodyHead, children: [
|
|
546
|
+
/* @__PURE__ */ l("span", { className: c(i.asideSection, t.bodyLabel), children: "Body" }),
|
|
547
|
+
/* @__PURE__ */ l(
|
|
548
|
+
xe,
|
|
549
|
+
{
|
|
550
|
+
size: "sm",
|
|
551
|
+
className: t.payloadCopy,
|
|
552
|
+
value: () => JSON.stringify(r.reqBody, null, 2),
|
|
553
|
+
"aria-label": "Copy request payload"
|
|
554
|
+
}
|
|
555
|
+
)
|
|
556
|
+
] }),
|
|
557
|
+
/* @__PURE__ */ l("pre", { className: i.asideRaw, children: JSON.stringify(r.reqBody, null, 2) })
|
|
558
|
+
] }),
|
|
559
|
+
/* @__PURE__ */ l("div", { className: t.drawerSection, children: "Response" }),
|
|
560
|
+
I ? /* @__PURE__ */ a("div", { className: t.awaiting, children: [
|
|
561
|
+
/* @__PURE__ */ l("span", { className: c(i.pulseDot, t.awaitingDot) }),
|
|
562
|
+
"Awaiting response…"
|
|
563
|
+
] }) : /* @__PURE__ */ a(P, { children: [
|
|
564
|
+
/* @__PURE__ */ l("div", { className: i.asideSection, children: "Headers" }),
|
|
565
|
+
Xe(r.resHeaders).map((e) => /* @__PURE__ */ a("div", { className: t.kvRow, children: [
|
|
566
|
+
/* @__PURE__ */ l("span", { className: t.kvKey, children: e.k }),
|
|
567
|
+
/* @__PURE__ */ l("span", { className: t.kvVal, children: e.v })
|
|
568
|
+
] }, e.k)),
|
|
569
|
+
/* @__PURE__ */ a("div", { className: t.bodyHead, children: [
|
|
570
|
+
/* @__PURE__ */ l("span", { className: c(i.asideSection, t.bodyLabel), children: "Body" }),
|
|
571
|
+
r.resBody != null && /* @__PURE__ */ l(
|
|
572
|
+
xe,
|
|
573
|
+
{
|
|
574
|
+
size: "sm",
|
|
575
|
+
className: t.payloadCopy,
|
|
576
|
+
value: () => JSON.stringify(r.resBody, null, 2),
|
|
577
|
+
"aria-label": "Copy response payload"
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
] }),
|
|
581
|
+
/* @__PURE__ */ l("pre", { className: i.asideRaw, children: r.resBody != null ? JSON.stringify(r.resBody, null, 2) : "(empty)" })
|
|
582
|
+
] })
|
|
496
583
|
] })
|
|
497
|
-
] })
|
|
584
|
+
] }) : /* @__PURE__ */ l("div", { className: t.dockEmpty, children: "Click an event on the timeline to inspect it." })
|
|
585
|
+
] }),
|
|
586
|
+
dl && /* @__PURE__ */ a("aside", { className: c(i.aside, t.dockAside, t.logAside, m?.log), children: [
|
|
587
|
+
/* @__PURE__ */ a("div", { className: t.dockHead, children: [
|
|
588
|
+
/* @__PURE__ */ l("span", { className: t.dockTitle, children: "Full log" }),
|
|
589
|
+
/* @__PURE__ */ a("span", { className: t.dockCount, children: [
|
|
590
|
+
u.length,
|
|
591
|
+
" events"
|
|
592
|
+
] }),
|
|
593
|
+
/* @__PURE__ */ l("div", { className: t.drawerSpacer }),
|
|
594
|
+
/* @__PURE__ */ l(
|
|
595
|
+
"button",
|
|
596
|
+
{
|
|
597
|
+
type: "button",
|
|
598
|
+
className: i.asideClose,
|
|
599
|
+
"aria-label": "Close full log",
|
|
600
|
+
onClick: () => $(null),
|
|
601
|
+
children: "✕"
|
|
602
|
+
}
|
|
603
|
+
)
|
|
604
|
+
] }),
|
|
605
|
+
/* @__PURE__ */ l("div", { ref: ut, className: c(t.dockScroll, t.logBody), children: St.map((e, n) => {
|
|
606
|
+
const s = e.end == null, h = e.url ? e.url.replace(/^https?:\/\/[^/]+/, "") : "";
|
|
607
|
+
return /* @__PURE__ */ a(
|
|
608
|
+
"div",
|
|
609
|
+
{
|
|
610
|
+
"data-crk-log-id": e.id,
|
|
611
|
+
className: c(
|
|
612
|
+
t.logEntry,
|
|
613
|
+
g === e.id && t.logEntrySelected,
|
|
614
|
+
el === e.id && t.logEntryFlash
|
|
615
|
+
),
|
|
616
|
+
onClick: () => {
|
|
617
|
+
me(e), X.current = e.id;
|
|
618
|
+
},
|
|
619
|
+
children: [
|
|
620
|
+
/* @__PURE__ */ a("div", { className: t.logTop, children: [
|
|
621
|
+
/* @__PURE__ */ l("span", { className: t.logNum, children: String(n + 1).padStart(2, "0") }),
|
|
622
|
+
/* @__PURE__ */ l("span", { className: c(t.methodBadge, t.badgeSm), children: e.method || "—" }),
|
|
623
|
+
/* @__PURE__ */ l(
|
|
624
|
+
"span",
|
|
625
|
+
{
|
|
626
|
+
className: c(
|
|
627
|
+
t.statusBadge,
|
|
628
|
+
t.badgeSm,
|
|
629
|
+
s && t.statusPending,
|
|
630
|
+
!s && (e.status ?? 0) >= 400 && t.statusError
|
|
631
|
+
),
|
|
632
|
+
children: s ? "pending" : String(e.status ?? "—")
|
|
633
|
+
}
|
|
634
|
+
),
|
|
635
|
+
/* @__PURE__ */ l("span", { className: t.logPair, children: Z(e) + " → " + e.service }),
|
|
636
|
+
/* @__PURE__ */ l("div", { className: t.drawerSpacer }),
|
|
637
|
+
/* @__PURE__ */ l("span", { className: t.logClock, children: A(e.start) })
|
|
638
|
+
] }),
|
|
639
|
+
/* @__PURE__ */ l("div", { className: t.logOp, children: /* @__PURE__ */ l(kt, { text: String(q(e)), query: B }) }),
|
|
640
|
+
h && /* @__PURE__ */ l("div", { className: t.logPath, children: h }),
|
|
641
|
+
/* @__PURE__ */ a("div", { className: t.logPayloadHead, children: [
|
|
642
|
+
/* @__PURE__ */ l("span", { className: t.logPayloadLabel, children: "Request" }),
|
|
643
|
+
e.reqBody != null && /* @__PURE__ */ l(
|
|
644
|
+
"span",
|
|
645
|
+
{
|
|
646
|
+
className: t.copyStop,
|
|
647
|
+
onClick: (o) => o.stopPropagation(),
|
|
648
|
+
children: /* @__PURE__ */ l(
|
|
649
|
+
xe,
|
|
650
|
+
{
|
|
651
|
+
size: "sm",
|
|
652
|
+
className: t.payloadCopy,
|
|
653
|
+
value: () => JSON.stringify(e.reqBody, null, 2),
|
|
654
|
+
"aria-label": "Copy request payload"
|
|
655
|
+
}
|
|
656
|
+
)
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
] }),
|
|
660
|
+
/* @__PURE__ */ l("pre", { className: c(i.asideRaw, t.logPre), children: e.reqBody != null ? JSON.stringify(e.reqBody, null, 2) : "(empty)" }),
|
|
661
|
+
/* @__PURE__ */ a("div", { className: t.logPayloadHead, children: [
|
|
662
|
+
/* @__PURE__ */ l("span", { className: t.logPayloadLabel, children: "Response" }),
|
|
663
|
+
!s && e.resBody != null && /* @__PURE__ */ l(
|
|
664
|
+
"span",
|
|
665
|
+
{
|
|
666
|
+
className: t.copyStop,
|
|
667
|
+
onClick: (o) => o.stopPropagation(),
|
|
668
|
+
children: /* @__PURE__ */ l(
|
|
669
|
+
xe,
|
|
670
|
+
{
|
|
671
|
+
size: "sm",
|
|
672
|
+
className: t.payloadCopy,
|
|
673
|
+
value: () => JSON.stringify(e.resBody, null, 2),
|
|
674
|
+
"aria-label": "Copy response payload"
|
|
675
|
+
}
|
|
676
|
+
)
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
] }),
|
|
680
|
+
s ? /* @__PURE__ */ a("div", { className: t.awaiting, children: [
|
|
681
|
+
/* @__PURE__ */ l("span", { className: c(i.pulseDot, t.awaitingDot) }),
|
|
682
|
+
"Awaiting response…"
|
|
683
|
+
] }) : /* @__PURE__ */ l("pre", { className: c(i.asideRaw, t.logPre), children: e.resBody != null ? JSON.stringify(e.resBody, null, 2) : "(empty)" })
|
|
684
|
+
]
|
|
685
|
+
},
|
|
686
|
+
e.id
|
|
687
|
+
);
|
|
688
|
+
}) })
|
|
498
689
|
] }),
|
|
499
|
-
(
|
|
690
|
+
(R === "right" || R === "floating") && Q,
|
|
691
|
+
C && /* @__PURE__ */ a("div", { className: c(t.rail, m?.rail), children: [
|
|
692
|
+
/* @__PURE__ */ l(
|
|
693
|
+
"button",
|
|
694
|
+
{
|
|
695
|
+
type: "button",
|
|
696
|
+
title: "Event details",
|
|
697
|
+
"aria-label": "Toggle event details drawer",
|
|
698
|
+
"aria-pressed": x === "details",
|
|
699
|
+
className: c(t.railBtn, x === "details" && t.railBtnActive),
|
|
700
|
+
onClick: () => $(x === "details" ? null : "details"),
|
|
701
|
+
children: /* @__PURE__ */ a("span", { className: t.railGlyphDetails, "aria-hidden": !0, children: [
|
|
702
|
+
/* @__PURE__ */ l("span", {}),
|
|
703
|
+
/* @__PURE__ */ l("span", {}),
|
|
704
|
+
/* @__PURE__ */ l("span", {})
|
|
705
|
+
] })
|
|
706
|
+
}
|
|
707
|
+
),
|
|
708
|
+
/* @__PURE__ */ l(
|
|
709
|
+
"button",
|
|
710
|
+
{
|
|
711
|
+
type: "button",
|
|
712
|
+
title: "Full log",
|
|
713
|
+
"aria-label": "Toggle full log drawer",
|
|
714
|
+
"aria-pressed": x === "log",
|
|
715
|
+
className: c(t.railBtn, x === "log" && t.railBtnActive),
|
|
716
|
+
onClick: () => {
|
|
717
|
+
const e = x === "log" ? null : "log";
|
|
718
|
+
e === "log" && g != null && (j.current = g), $(e);
|
|
719
|
+
},
|
|
720
|
+
children: /* @__PURE__ */ a("span", { className: t.railGlyphLog, "aria-hidden": !0, children: [
|
|
721
|
+
/* @__PURE__ */ l("span", {}),
|
|
722
|
+
/* @__PURE__ */ l("span", {}),
|
|
723
|
+
/* @__PURE__ */ l("span", {})
|
|
724
|
+
] })
|
|
725
|
+
}
|
|
726
|
+
)
|
|
727
|
+
] })
|
|
500
728
|
] }),
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
const e = u.find((
|
|
504
|
-
color:
|
|
729
|
+
R === "bottom" && Q,
|
|
730
|
+
y && (() => {
|
|
731
|
+
const e = u.find((s) => s.id === y.id), n = e && Me ? Me(e, {
|
|
732
|
+
color: L[e.service] || S.body,
|
|
505
733
|
pending: e.end == null,
|
|
506
734
|
durationMs: (e.end ?? M) - e.start
|
|
507
735
|
}) : void 0;
|
|
508
|
-
return
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
736
|
+
return Me && n == null ? null : /* @__PURE__ */ l(wl, { x: y.x, y: y.y, className: m?.tooltip, children: n !== void 0 ? n : /* @__PURE__ */ a(P, { children: [
|
|
737
|
+
/* @__PURE__ */ l("div", { className: c(i.tooltipTitle, i.tooltipMono), children: y.rid }),
|
|
738
|
+
/* @__PURE__ */ l("div", { className: i.tooltipLine, style: { marginTop: 4 }, children: y.route }),
|
|
739
|
+
/* @__PURE__ */ l(
|
|
512
740
|
"div",
|
|
513
741
|
{
|
|
514
742
|
className: c(i.tooltipLine, i.tooltipMono),
|
|
515
743
|
style: { marginTop: 2 },
|
|
516
|
-
children:
|
|
744
|
+
children: y.label
|
|
517
745
|
}
|
|
518
746
|
),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
|
|
747
|
+
/* @__PURE__ */ l("div", { className: i.tooltipLine, style: { marginTop: 4 }, children: y.time }),
|
|
748
|
+
/* @__PURE__ */ l("div", { className: i.tooltipLine, children: y.durLine }),
|
|
749
|
+
y.url && /* @__PURE__ */ l(
|
|
522
750
|
"div",
|
|
523
751
|
{
|
|
524
752
|
className: c(i.tooltipDim, i.tooltipMono),
|
|
525
753
|
style: { marginTop: 4, wordBreak: "break-all", fontSize: "10.5px" },
|
|
526
|
-
children:
|
|
754
|
+
children: y.url
|
|
527
755
|
}
|
|
528
756
|
)
|
|
529
757
|
] }) });
|
|
@@ -532,5 +760,5 @@ const p = 84, dt = 24, q = 400, dn = 51, me = 300, yn = $t(
|
|
|
532
760
|
}
|
|
533
761
|
);
|
|
534
762
|
export {
|
|
535
|
-
|
|
763
|
+
Il as TraceTimeline
|
|
536
764
|
};
|