chordia-ui 3.4.2 → 3.4.4

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 (37) hide show
  1. package/dist/Timeline.cjs.js +6 -1
  2. package/dist/Timeline.cjs.js.map +1 -1
  3. package/dist/Timeline.es.js +597 -129
  4. package/dist/Timeline.es.js.map +1 -1
  5. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  6. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  7. package/dist/UpdatedInteractionRecording.es.js +233 -241
  8. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  9. package/dist/components/UpdatedInteractionDetails.cjs.js +2 -2
  10. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  11. package/dist/components/UpdatedInteractionDetails.es.js +451 -360
  12. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  13. package/dist/components/media.cjs.js +1 -1
  14. package/dist/components/media.cjs.js.map +1 -1
  15. package/dist/components/media.es.js +8 -9
  16. package/dist/components/media.es.js.map +1 -1
  17. package/dist/index.cjs.js +1 -1
  18. package/dist/index.cjs2.js +1 -1
  19. package/dist/index.cjs2.js.map +1 -1
  20. package/dist/index.es.js +52 -53
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.es2.js +596 -587
  23. package/dist/index.es2.js.map +1 -1
  24. package/dist/pages/interactionDetails.cjs.js +2 -2
  25. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  26. package/dist/pages/interactionDetails.es.js +16 -17
  27. package/dist/pages/interactionDetails.es.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/components/UpdatedInteractionDetails/UpdatedCompassScore.jsx +54 -2
  30. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +58 -14
  31. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +132 -126
  32. package/src/components/UpdatedInteractionDetails/UpdatedInteractionSignals.jsx +14 -6
  33. package/src/components/login/LoginPage.jsx +18 -3
  34. package/dist/TranscriptCard.cjs.js +0 -7
  35. package/dist/TranscriptCard.cjs.js.map +0 -1
  36. package/dist/TranscriptCard.es.js +0 -474
  37. package/dist/TranscriptCard.es.js.map +0 -1
@@ -1,90 +1,556 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { useState as L, useEffect as D, useMemo as P } from "react";
3
- import { RotateCcw as S, Pause as X, Play as A, RotateCw as N } from "lucide-react";
4
- function J({
5
- segments: d = [],
6
- durationSeconds: T = 0,
7
- actorRows: b = [],
8
- currentTimeSeconds: w = 0,
9
- onSeek: f,
10
- showControls: M = !1,
11
- hasRecording: m = !1,
12
- timelinePlaying: x = !1,
13
- playbackRate: k = 1,
14
- speedOptions: E = [1, 1.25, 1.5, 2],
15
- onTogglePlay: I,
16
- onSeekBack: h,
17
- onSeekForward: y,
18
- onSetPlaybackRate: g,
19
- totalDurationLabel: F
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
+ import { useEffect as A, useState as H, useRef as W, useMemo as X } from "react";
3
+ import { Pause as F, Play as D, RotateCcw as Y, RotateCw as _ } from "lucide-react";
4
+ const P = {
5
+ customer: {
6
+ label: "Customer",
7
+ railColor: "var(--rail-discovery)",
8
+ cardBg: "var(--card-customer)",
9
+ cardBgHighlight: "rgba(94, 136, 176, 0.12)",
10
+ borderColor: "var(--border-subtle)"
11
+ },
12
+ agent: {
13
+ label: "Agent",
14
+ railColor: "var(--rail-outcome)",
15
+ cardBg: "var(--card-agent)",
16
+ cardBgHighlight: "rgba(107, 124, 147, 0.10)",
17
+ borderColor: "var(--border-subtle)"
18
+ },
19
+ assistant: {
20
+ label: "AI Assistant",
21
+ railColor: "var(--rail-purple)",
22
+ cardBg: "var(--card-assistant)",
23
+ cardBgHighlight: "rgba(155, 122, 168, 0.10)",
24
+ borderColor: "var(--border-subtle)"
25
+ },
26
+ system: {
27
+ label: "System",
28
+ railColor: "var(--text-faint)",
29
+ cardBg: "transparent",
30
+ cardBgHighlight: "transparent",
31
+ borderColor: "transparent"
32
+ }
33
+ }, j = "conversation-turn-keyframes";
34
+ function K() {
35
+ if (typeof document > "u" || document.getElementById(j))
36
+ return;
37
+ const s = document.createElement("style");
38
+ s.id = j, s.textContent = `
39
+ @keyframes turn-playing-pulse {
40
+ 0%, 100% { opacity: 0.4; }
41
+ 50% { opacity: 0.9; }
42
+ }
43
+ `, document.head.appendChild(s);
44
+ }
45
+ function O({
46
+ role: s = "agent",
47
+ text: h,
48
+ actorLabel: f,
49
+ actorRailColor: B,
50
+ actionKicker: b,
51
+ toolBadges: y,
52
+ streaming: g = !1,
53
+ meta: S,
54
+ timeRange: E,
55
+ isHighlighted: T = !1,
56
+ highlightRailColor: n,
57
+ observations: i,
58
+ onObservationClick: x,
59
+ children: R
60
+ }) {
61
+ A(() => {
62
+ K();
63
+ }, []);
64
+ const C = P[s] || P.agent, w = f || C.label, k = B || C.railColor, o = T || g;
65
+ return s === "system" ? /* @__PURE__ */ t(
66
+ "div",
67
+ {
68
+ style: {
69
+ textAlign: "center",
70
+ padding: "6px 0",
71
+ flexShrink: 0,
72
+ fontSize: "var(--text-sm, 11px)",
73
+ color: "var(--text-faint, rgba(30,33,37,0.36))",
74
+ fontWeight: 500,
75
+ letterSpacing: "0.02em"
76
+ },
77
+ children: h
78
+ }
79
+ ) : /* @__PURE__ */ u(
80
+ "div",
81
+ {
82
+ style: {
83
+ position: "relative",
84
+ padding: "10px 14px 10px 18px",
85
+ borderRadius: 10,
86
+ overflow: "hidden",
87
+ flexShrink: 0,
88
+ background: o ? C.cardBgHighlight : C.cardBg,
89
+ border: `1px solid ${g ? k : C.borderColor}`,
90
+ boxShadow: g ? `0 0 8px ${C.cardBgHighlight}` : "none",
91
+ transition: "background 0.2s, border-color 0.2s, box-shadow 0.2s"
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ t(
95
+ "div",
96
+ {
97
+ style: {
98
+ position: "absolute",
99
+ left: 0,
100
+ top: 0,
101
+ bottom: 0,
102
+ width: "var(--rail-width-thin, 4px)",
103
+ backgroundColor: k,
104
+ borderRadius: "10px 0 0 10px"
105
+ }
106
+ }
107
+ ),
108
+ /* @__PURE__ */ u(
109
+ "div",
110
+ {
111
+ style: {
112
+ display: "flex",
113
+ alignItems: "flex-start",
114
+ justifyContent: "space-between",
115
+ gap: 8,
116
+ marginBottom: 4
117
+ },
118
+ children: [
119
+ /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
120
+ b ? /* @__PURE__ */ t(
121
+ "div",
122
+ {
123
+ style: {
124
+ fontSize: "var(--text-xs-plus, 10.5px)",
125
+ fontWeight: 650,
126
+ textTransform: "uppercase",
127
+ letterSpacing: "var(--tracking-label, 0.16em)",
128
+ color: k
129
+ },
130
+ children: b
131
+ }
132
+ ) : null,
133
+ /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ style: {
137
+ fontSize: "var(--text-xs-plus, 10.5px)",
138
+ fontWeight: 650,
139
+ textTransform: "uppercase",
140
+ letterSpacing: "var(--tracking-label, 0.16em)",
141
+ color: "var(--text-faint, rgba(30,33,37,0.36))"
142
+ },
143
+ children: w
144
+ }
145
+ )
146
+ ] }),
147
+ y && y.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, flexShrink: 0, justifyContent: "flex-end" }, children: y.map((e, l) => {
148
+ const d = e.pending, c = !d && e.success === !1;
149
+ return /* @__PURE__ */ u(
150
+ "span",
151
+ {
152
+ style: {
153
+ display: "inline-flex",
154
+ alignItems: "center",
155
+ gap: 5,
156
+ fontSize: "var(--text-xs, 10px)",
157
+ padding: "2px 8px 2px 6px",
158
+ borderRadius: 999,
159
+ background: "var(--paper, rgba(255,255,255,0.78))",
160
+ border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
161
+ color: "var(--text-faint, rgba(30,33,37,0.36))",
162
+ fontWeight: 500,
163
+ fontFamily: "var(--font-fira-code, var(--font-mono, monospace))",
164
+ letterSpacing: "0.01em",
165
+ lineHeight: 1.4,
166
+ whiteSpace: "nowrap"
167
+ },
168
+ children: [
169
+ /* @__PURE__ */ t(
170
+ "span",
171
+ {
172
+ style: {
173
+ width: 5,
174
+ height: 5,
175
+ borderRadius: "50%",
176
+ backgroundColor: d ? "var(--rail-discovery, #5E88B0)" : c ? "var(--rail-compliance, #C98A5A)" : "var(--text-xfaint, rgba(30,33,37,0.28))",
177
+ flexShrink: 0
178
+ }
179
+ }
180
+ ),
181
+ e.name
182
+ ]
183
+ },
184
+ l
185
+ );
186
+ }) }) : null
187
+ ]
188
+ }
189
+ ),
190
+ /* @__PURE__ */ u(
191
+ "div",
192
+ {
193
+ style: {
194
+ fontSize: "var(--text-md, 13px)",
195
+ lineHeight: "var(--leading-normal, 1.5)",
196
+ color: g ? "var(--text-strong, rgba(30,33,37,0.92))" : "var(--text-base, rgba(30,33,37,0.78))",
197
+ fontWeight: g ? 550 : 400
198
+ },
199
+ children: [
200
+ h,
201
+ g ? /* @__PURE__ */ t(
202
+ "span",
203
+ {
204
+ style: {
205
+ display: "inline-block",
206
+ width: 6,
207
+ height: 14,
208
+ background: k,
209
+ marginLeft: 2,
210
+ borderRadius: 1,
211
+ animation: "cursorBlink 0.8s ease-in-out infinite",
212
+ verticalAlign: "text-bottom"
213
+ }
214
+ }
215
+ ) : null
216
+ ]
217
+ }
218
+ ),
219
+ E || R || i && i.length > 0 ? /* @__PURE__ */ u("div", { style: { marginTop: 6, display: "flex", alignItems: "center", gap: 6 }, children: [
220
+ R,
221
+ E ? /* @__PURE__ */ t(
222
+ "span",
223
+ {
224
+ style: {
225
+ fontSize: "var(--text-sm, 11px)",
226
+ padding: "2px 8px",
227
+ borderRadius: 999,
228
+ border: "1px solid var(--border, rgba(52,58,64,0.12))",
229
+ background: "var(--timestamp-bg, rgba(255,255,255,0.70))",
230
+ color: "var(--text-muted, rgba(30,33,37,0.56))",
231
+ fontFamily: "var(--font-mono, monospace)"
232
+ },
233
+ children: E
234
+ }
235
+ ) : null,
236
+ i && i.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginLeft: "auto" }, children: i.map((e, l) => /* @__PURE__ */ u(
237
+ "span",
238
+ {
239
+ onClick: e.onClick || (x ? () => x(e) : void 0),
240
+ style: {
241
+ display: "inline-flex",
242
+ alignItems: "center",
243
+ gap: 4,
244
+ fontSize: "var(--text-xs, 10px)",
245
+ padding: "2px 8px",
246
+ borderRadius: 999,
247
+ background: `color-mix(in srgb, ${e.color || "var(--state-present)"} 12%, transparent)`,
248
+ border: `1px solid color-mix(in srgb, ${e.color || "var(--state-present)"} 25%, transparent)`,
249
+ color: e.color || "var(--state-present)",
250
+ fontWeight: 550,
251
+ lineHeight: 1.4,
252
+ whiteSpace: "nowrap",
253
+ cursor: e.onClick || x ? "pointer" : "default",
254
+ transition: "background 0.15s"
255
+ },
256
+ title: e.reason || e.label,
257
+ children: [
258
+ /* @__PURE__ */ t("span", { style: {
259
+ width: 4,
260
+ height: 4,
261
+ borderRadius: "50%",
262
+ backgroundColor: e.color || "var(--state-present)",
263
+ flexShrink: 0,
264
+ opacity: 0.7
265
+ } }),
266
+ e.label
267
+ ]
268
+ },
269
+ l
270
+ )) }) : null
271
+ ] }) : null,
272
+ S ? /* @__PURE__ */ t(
273
+ "div",
274
+ {
275
+ style: {
276
+ marginTop: 6,
277
+ fontSize: "var(--text-xs-plus, 10.5px)",
278
+ color: "var(--text-faint, rgba(30,33,37,0.36))",
279
+ fontFamily: "var(--font-mono, monospace)"
280
+ },
281
+ children: S
282
+ }
283
+ ) : null,
284
+ o && n ? /* @__PURE__ */ t(
285
+ "div",
286
+ {
287
+ style: {
288
+ position: "absolute",
289
+ right: 8,
290
+ top: 8,
291
+ bottom: 8,
292
+ width: 6,
293
+ borderRadius: 4,
294
+ backgroundColor: n,
295
+ opacity: 0.7,
296
+ animation: "turn-playing-pulse 1.5s ease-in-out infinite"
297
+ }
298
+ }
299
+ ) : null
300
+ ]
301
+ }
302
+ );
303
+ }
304
+ const V = (s) => {
305
+ const [h, f] = s.split("–").map((B) => {
306
+ const [b, y] = B.split(":").map(Number);
307
+ return b * 60 + y;
308
+ });
309
+ return { start: h, end: f };
310
+ }, q = (s) => ({
311
+ customer: "customer",
312
+ agent: "agent",
313
+ third_party: "agent",
314
+ system: "system",
315
+ assistant: "assistant"
316
+ })[s] || "agent";
317
+ function U({
318
+ turns: s,
319
+ audioUrl: h,
320
+ activeTurnIndex: f = -1,
321
+ autoScrollActiveTurn: B = !1,
322
+ isExternalPlaying: b = !1,
323
+ onTurnPlayPause: y
324
+ }) {
325
+ const [g, S] = H(null), [E, T] = H(!1), n = W(null), i = W(null), x = W([]), R = W(null), C = W(-1), w = typeof y == "function", k = b !== void 0;
326
+ A(() => {
327
+ if (h)
328
+ return n.current = new Audio(h), n.current.preload = "auto", () => {
329
+ n.current && (n.current.pause(), n.current = null);
330
+ };
331
+ }, [h]), A(() => () => {
332
+ n.current && (n.current.pause(), i.current && n.current.removeEventListener("timeupdate", i.current));
333
+ }, []), A(() => {
334
+ if (!B || f < 0)
335
+ return;
336
+ const e = R.current, l = x.current[f];
337
+ if (!l || !e)
338
+ return;
339
+ const d = e.getBoundingClientRect(), c = l.getBoundingClientRect(), v = 12, m = c.top >= d.top + v && c.bottom <= d.bottom - 8;
340
+ if (!(C.current === f) || !m) {
341
+ const M = c.top - d.top + e.scrollTop;
342
+ e.scrollTop = Math.max(M - v, 0);
343
+ }
344
+ C.current = f;
345
+ }, [f, B]);
346
+ const o = (e, l) => {
347
+ if (w) {
348
+ y(s[l], l);
349
+ return;
350
+ }
351
+ if (g === l && E)
352
+ n.current && (n.current.pause(), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null)), T(!1);
353
+ else {
354
+ const d = g;
355
+ if (S(l), h && n.current) {
356
+ const { start: c, end: v } = V(e);
357
+ d !== null && d !== l && (n.current.pause(), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null));
358
+ const m = () => {
359
+ if (n.current) {
360
+ if (n.current.currentTime = c, v) {
361
+ const $ = () => {
362
+ n.current && n.current.currentTime >= v && (n.current.pause(), T(!1), S(null), i.current && (n.current.removeEventListener("timeupdate", i.current), i.current = null));
363
+ };
364
+ i.current = $, n.current.addEventListener("timeupdate", $);
365
+ }
366
+ n.current.play().then(() => T(!0)).catch(($) => {
367
+ $ && $.name === "AbortError" || (T(!1), S(null));
368
+ });
369
+ }
370
+ };
371
+ n.current.readyState >= 2 ? m() : (n.current.addEventListener("loadedmetadata", m, { once: !0 }), n.current.load());
372
+ } else
373
+ T(!0);
374
+ }
375
+ };
376
+ return /* @__PURE__ */ u(
377
+ "div",
378
+ {
379
+ ref: R,
380
+ className: "custom-thin-scrollbar-library",
381
+ style: {
382
+ maxHeight: 560,
383
+ overflowY: "auto",
384
+ scrollBehavior: "smooth",
385
+ border: "1px solid var(--border, rgba(52,58,64,0.12))",
386
+ // borderRadius: "var(--radius-lg, 12px)",
387
+ borderRadius: "12px 0px 0px 12px",
388
+ background: "var(--paper-elevated, rgba(255,255,255,0.82))",
389
+ padding: 16
390
+ },
391
+ children: [
392
+ /* @__PURE__ */ t(
393
+ "div",
394
+ {
395
+ style: {
396
+ fontSize: "var(--text-xs-plus, 10.5px)",
397
+ fontWeight: 650,
398
+ textTransform: "uppercase",
399
+ letterSpacing: "var(--tracking-label, 0.16em)",
400
+ color: "var(--text-faint, rgba(30,33,37,0.36))",
401
+ marginBottom: 12
402
+ },
403
+ children: "Transcript"
404
+ }
405
+ ),
406
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: s.map((e, l) => {
407
+ const d = w || k ? !!b && f === l : g === l && E, c = !!e.isHighlighted || d, v = q(e.actorType);
408
+ return /* @__PURE__ */ t(
409
+ "div",
410
+ {
411
+ ref: (m) => {
412
+ x.current[l] = m;
413
+ },
414
+ children: /* @__PURE__ */ t(
415
+ O,
416
+ {
417
+ role: v,
418
+ text: e.text,
419
+ actorLabel: e.actor,
420
+ actorRailColor: e.actorColor,
421
+ timeRange: e.timeRange,
422
+ isHighlighted: c,
423
+ highlightRailColor: d ? e.highlightColor || (v === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)") : e.highlightColor,
424
+ toolBadges: e.toolBadges,
425
+ observations: e.observations,
426
+ onObservationClick: e.onObservationClick,
427
+ children: e.timeRange ? /* @__PURE__ */ t(
428
+ "button",
429
+ {
430
+ onClick: () => o(e.timeRange, l),
431
+ style: {
432
+ width: 24,
433
+ height: 24,
434
+ borderRadius: "50%",
435
+ border: "1px solid var(--border, rgba(52,58,64,0.12))",
436
+ background: d ? "var(--rail-discovery, #5E88B0)" : "var(--paper, rgba(255,255,255,0.78))",
437
+ display: "inline-flex",
438
+ alignItems: "center",
439
+ justifyContent: "center",
440
+ cursor: "pointer",
441
+ padding: 0,
442
+ transition: "all 0.15s"
443
+ },
444
+ "aria-label": d ? `Pause segment ${e.timeRange}` : `Play segment ${e.timeRange}`,
445
+ children: d ? /* @__PURE__ */ t(
446
+ F,
447
+ {
448
+ style: { width: 12, height: 12, color: "var(--paper, #fff)", fill: "var(--paper, #fff)" },
449
+ strokeWidth: 0
450
+ }
451
+ ) : /* @__PURE__ */ t(
452
+ D,
453
+ {
454
+ style: { width: 12, height: 12, color: "var(--text-muted, rgba(30,33,37,0.56))", fill: "var(--text-muted, rgba(30,33,37,0.56))", marginLeft: 1 },
455
+ strokeWidth: 0
456
+ }
457
+ )
458
+ }
459
+ ) : null
460
+ }
461
+ )
462
+ },
463
+ l
464
+ );
465
+ }) })
466
+ ]
467
+ }
468
+ );
469
+ }
470
+ function tt({
471
+ segments: s = [],
472
+ durationSeconds: h = 0,
473
+ actorRows: f = [],
474
+ currentTimeSeconds: B = 0,
475
+ onSeek: b,
476
+ showControls: y = !1,
477
+ hasRecording: g = !1,
478
+ timelinePlaying: S = !1,
479
+ playbackRate: E = 1,
480
+ speedOptions: T = [1, 1.25, 1.5, 2],
481
+ onTogglePlay: n,
482
+ onSeekBack: i,
483
+ onSeekForward: x,
484
+ onSetPlaybackRate: R,
485
+ totalDurationLabel: C
20
486
  }) {
21
- const [u, v] = L(null);
22
- D(() => {
23
- if (!u)
487
+ const [w, k] = H(null);
488
+ A(() => {
489
+ if (!w)
24
490
  return;
25
- const t = setTimeout(() => v(null), 220);
26
- return () => clearTimeout(t);
27
- }, [u]);
28
- const a = Math.max(
29
- Number(T) || 0,
30
- ...d.map((t) => Number(t.endTime) || 0),
491
+ const r = setTimeout(() => k(null), 220);
492
+ return () => clearTimeout(r);
493
+ }, [w]);
494
+ const o = Math.max(
495
+ Number(h) || 0,
496
+ ...s.map((r) => Number(r.endTime) || 0),
31
497
  1
32
- ), C = Math.max(0, Math.min(Number(w) || 0, a)), $ = a > 0 ? C / a * 100 : 0, z = `calc(${$}% + ${(5 * (1 - $ / 100)).toFixed(4)}rem)`, n = (t) => {
33
- const i = Math.floor(t / 60), e = Math.floor(t % 60);
34
- return `${i.toString().padStart(2, "0")}:${e.toString().padStart(2, "0")}`;
35
- }, B = P(() => {
36
- if (b.length)
37
- return b.map((e) => ({
38
- ...e,
39
- segments: d.filter((c) => c.actor === e.key)
498
+ ), e = Math.max(0, Math.min(Number(B) || 0, o)), l = o > 0 ? e / o * 100 : 0, d = `calc(${l}% + ${(5 * (1 - l / 100)).toFixed(4)}rem)`, c = (r) => {
499
+ const p = Math.floor(r / 60), a = Math.floor(r % 60);
500
+ return `${p.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}`;
501
+ }, v = X(() => {
502
+ if (f.length)
503
+ return f.map((a) => ({
504
+ ...a,
505
+ segments: s.filter((I) => I.actor === a.key)
40
506
  }));
41
- const t = Array.from(new Set(d.map((e) => e.actor))), i = new Map(d.map((e) => [e.actor, e.actorColor]));
42
- return t.map((e) => ({
43
- key: e,
44
- label: e,
45
- color: i.get(e) || "#6B7C93",
46
- segments: d.filter((c) => c.actor === e)
507
+ const r = Array.from(new Set(s.map((a) => a.actor))), p = new Map(s.map((a) => [a.actor, a.actorColor]));
508
+ return r.map((a) => ({
509
+ key: a,
510
+ label: a,
511
+ color: p.get(a) || "#6B7C93",
512
+ segments: s.filter((I) => I.actor === a)
47
513
  }));
48
- }, [b, d]), l = [], j = 120;
49
- for (let t = 0; t <= a; t += j)
50
- l.push(t);
51
- (!l.length || l[l.length - 1] < a) && l.push(a);
52
- const R = (t) => {
53
- if (!f)
514
+ }, [f, s]), m = [], $ = 120;
515
+ for (let r = 0; r <= o; r += $)
516
+ m.push(r);
517
+ (!m.length || m[m.length - 1] < o) && m.push(o);
518
+ const M = (r) => {
519
+ if (!b)
54
520
  return;
55
- const i = t.currentTarget.getBoundingClientRect();
56
- if (!i.width)
521
+ const p = r.currentTarget.getBoundingClientRect();
522
+ if (!p.width)
57
523
  return;
58
- const e = Math.max(0, Math.min((t.clientX - i.left) / i.width, 1));
59
- f(e * a);
524
+ const a = Math.max(0, Math.min((r.clientX - p.left) / p.width, 1));
525
+ b(a * o);
60
526
  };
61
- return /* @__PURE__ */ o("div", { style: {
527
+ return /* @__PURE__ */ u("div", { style: {
62
528
  padding: "10px 0"
63
529
  }, children: [
64
- M && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 8 }, children: [
65
- /* @__PURE__ */ o("div", { style: {
530
+ y && /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 8 }, children: [
531
+ /* @__PURE__ */ u("div", { style: {
66
532
  fontSize: "var(--text-sm, 11px)",
67
533
  fontFamily: "var(--font-mono, monospace)",
68
534
  color: "var(--text-muted, rgba(30,33,37,0.56))",
69
535
  fontWeight: 500,
70
536
  minWidth: 70
71
537
  }, children: [
72
- n(C),
538
+ c(e),
73
539
  " ",
74
- /* @__PURE__ */ o("span", { style: { color: "var(--text-faint, rgba(30,33,37,0.36))" }, children: [
540
+ /* @__PURE__ */ u("span", { style: { color: "var(--text-faint, rgba(30,33,37,0.36))" }, children: [
75
541
  "/ ",
76
- n(a)
542
+ c(o)
77
543
  ] })
78
544
  ] }),
79
- /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
80
- /* @__PURE__ */ r(
545
+ /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
546
+ /* @__PURE__ */ t(
81
547
  "button",
82
548
  {
83
549
  type: "button",
84
550
  onClick: () => {
85
- v("rewind"), h == null || h();
551
+ k("rewind"), i == null || i();
86
552
  },
87
- disabled: !m,
553
+ disabled: !g,
88
554
  title: "Rewind 15s",
89
555
  style: {
90
556
  display: "inline-flex",
@@ -93,20 +559,20 @@ function J({
93
559
  width: 28,
94
560
  height: 28,
95
561
  borderRadius: "50%",
96
- border: `1px solid ${u === "rewind" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
562
+ border: `1px solid ${w === "rewind" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
97
563
  background: "var(--paper, rgba(255,255,255,0.78))",
98
564
  cursor: "pointer",
99
565
  padding: 0
100
566
  },
101
- children: /* @__PURE__ */ r(S, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
567
+ children: /* @__PURE__ */ t(Y, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
102
568
  }
103
569
  ),
104
- /* @__PURE__ */ r(
570
+ /* @__PURE__ */ t(
105
571
  "button",
106
572
  {
107
573
  type: "button",
108
- onClick: I,
109
- disabled: !m,
574
+ onClick: n,
575
+ disabled: !g,
110
576
  style: {
111
577
  display: "inline-flex",
112
578
  alignItems: "center",
@@ -120,18 +586,18 @@ function J({
120
586
  cursor: "pointer",
121
587
  padding: 0
122
588
  },
123
- "aria-label": x ? "Pause recording" : "Play recording",
124
- children: x ? /* @__PURE__ */ r(X, { size: 14 }) : /* @__PURE__ */ r(A, { size: 14, style: { marginLeft: 1 } })
589
+ "aria-label": S ? "Pause recording" : "Play recording",
590
+ children: S ? /* @__PURE__ */ t(F, { size: 14 }) : /* @__PURE__ */ t(D, { size: 14, style: { marginLeft: 1 } })
125
591
  }
126
592
  ),
127
- /* @__PURE__ */ r(
593
+ /* @__PURE__ */ t(
128
594
  "button",
129
595
  {
130
596
  type: "button",
131
597
  onClick: () => {
132
- v("forward"), y == null || y();
598
+ k("forward"), x == null || x();
133
599
  },
134
- disabled: !m,
600
+ disabled: !g,
135
601
  title: "Forward 15s",
136
602
  style: {
137
603
  display: "inline-flex",
@@ -140,23 +606,23 @@ function J({
140
606
  width: 28,
141
607
  height: 28,
142
608
  borderRadius: "50%",
143
- border: `1px solid ${u === "forward" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
609
+ border: `1px solid ${w === "forward" ? "var(--rail-discovery, #5E88B0)" : "var(--border, rgba(52,58,64,0.12))"}`,
144
610
  background: "var(--paper, rgba(255,255,255,0.78))",
145
611
  cursor: "pointer",
146
612
  padding: 0
147
613
  },
148
- children: /* @__PURE__ */ r(N, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
614
+ children: /* @__PURE__ */ t(_, { size: 13, stroke: "var(--rail-discovery, #5E88B0)" })
149
615
  }
150
616
  ),
151
- /* @__PURE__ */ r("div", { style: { display: "inline-flex", alignItems: "center", gap: 4, borderRadius: 999, border: "1px solid var(--border, rgba(52,58,64,0.12))", padding: "2px 3px", background: "var(--paper, rgba(255,255,255,0.78))", marginLeft: 4 }, children: E.map((t) => {
152
- const i = k === t;
153
- return /* @__PURE__ */ r(
617
+ /* @__PURE__ */ t("div", { style: { display: "inline-flex", alignItems: "center", gap: 4, borderRadius: 999, border: "1px solid var(--border, rgba(52,58,64,0.12))", padding: "2px 3px", background: "var(--paper, rgba(255,255,255,0.78))", marginLeft: 4 }, children: T.map((r) => {
618
+ const p = E === r;
619
+ return /* @__PURE__ */ t(
154
620
  "button",
155
621
  {
156
622
  type: "button",
157
- onClick: () => g == null ? void 0 : g(t),
158
- disabled: !m,
159
- title: `Speed: ${t}x`,
623
+ onClick: () => R == null ? void 0 : R(r),
624
+ disabled: !g,
625
+ title: `Speed: ${r}x`,
160
626
  style: {
161
627
  display: "inline-flex",
162
628
  alignItems: "center",
@@ -165,49 +631,49 @@ function J({
165
631
  minWidth: 38,
166
632
  padding: "0 6px",
167
633
  borderRadius: 999,
168
- border: `1px solid ${i ? "var(--rail-discovery, #5E88B0)" : "transparent"}`,
169
- background: i ? "var(--rail-discovery, #5E88B0)" : "transparent",
170
- color: i ? "#fff" : "var(--text-muted, rgba(30,33,37,0.56))",
634
+ border: `1px solid ${p ? "var(--rail-discovery, #5E88B0)" : "transparent"}`,
635
+ background: p ? "var(--rail-discovery, #5E88B0)" : "transparent",
636
+ color: p ? "#fff" : "var(--text-muted, rgba(30,33,37,0.56))",
171
637
  fontSize: "var(--text-xs, 10px)",
172
638
  fontWeight: 600,
173
639
  cursor: "pointer"
174
640
  },
175
- children: t === 1.5 ? "1.50x" : `${t}x`
641
+ children: r === 1.5 ? "1.50x" : `${r}x`
176
642
  },
177
- t
643
+ r
178
644
  );
179
645
  }) })
180
646
  ] })
181
647
  ] }),
182
- /* @__PURE__ */ r("div", { style: {
648
+ /* @__PURE__ */ t("div", { style: {
183
649
  background: "var(--paper, rgba(255,255,255,0.78))",
184
650
  border: "1px solid var(--border, rgba(52,58,64,0.12))",
185
651
  borderRadius: 10,
186
652
  padding: "12px 16px 10px"
187
- }, children: /* @__PURE__ */ o("div", { style: { position: "relative" }, children: [
188
- /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", marginBottom: 6, height: 16 }, children: [
189
- /* @__PURE__ */ r("div", { style: { width: "5rem", flexShrink: 0 } }),
190
- /* @__PURE__ */ r("div", { style: { position: "relative", flex: 1 }, children: l.map((t) => {
191
- const i = a > 0 ? t / a * 100 : 0;
192
- return /* @__PURE__ */ r(
653
+ }, children: /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
654
+ /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", marginBottom: 6, height: 16 }, children: [
655
+ /* @__PURE__ */ t("div", { style: { width: "5rem", flexShrink: 0 } }),
656
+ /* @__PURE__ */ t("div", { style: { position: "relative", flex: 1 }, children: m.map((r) => {
657
+ const p = o > 0 ? r / o * 100 : 0;
658
+ return /* @__PURE__ */ t(
193
659
  "div",
194
660
  {
195
661
  style: {
196
662
  position: "absolute",
197
663
  fontSize: "var(--text-xs, 10px)",
198
664
  color: "var(--text-faint, rgba(30,33,37,0.36))",
199
- left: `${i}%`,
665
+ left: `${p}%`,
200
666
  transform: "translateX(-50%)",
201
667
  fontFamily: "var(--font-mono, monospace)",
202
668
  whiteSpace: "nowrap"
203
669
  },
204
- children: n(t)
670
+ children: c(r)
205
671
  },
206
- t
672
+ r
207
673
  );
208
674
  }) })
209
675
  ] }),
210
- /* @__PURE__ */ r(
676
+ /* @__PURE__ */ t(
211
677
  "div",
212
678
  {
213
679
  style: {
@@ -219,29 +685,29 @@ function J({
219
685
  width: "calc(100% - 5rem)",
220
686
  zIndex: 20
221
687
  },
222
- children: l.map((t) => {
223
- const i = a > 0 ? t / a * 100 : 0;
224
- return /* @__PURE__ */ r(
688
+ children: m.map((r) => {
689
+ const p = o > 0 ? r / o * 100 : 0;
690
+ return /* @__PURE__ */ t(
225
691
  "div",
226
692
  {
227
693
  style: {
228
694
  position: "absolute",
229
695
  top: 0,
230
696
  bottom: 0,
231
- left: `${i}%`,
697
+ left: `${p}%`,
232
698
  borderLeft: "1px dashed var(--border, rgba(52,58,64,0.12))",
233
699
  transform: "translateX(-1px)"
234
700
  }
235
701
  },
236
- t
702
+ r
237
703
  );
238
704
  })
239
705
  }
240
706
  ),
241
- /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 8 }, children: B.map((t) => {
242
- const i = t.key === "system" || t.label === "System";
243
- return /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center" }, children: [
244
- /* @__PURE__ */ r(
707
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 8 }, children: v.map((r) => {
708
+ const p = r.key === "system" || r.label === "System";
709
+ return /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center" }, children: [
710
+ /* @__PURE__ */ t(
245
711
  "div",
246
712
  {
247
713
  style: {
@@ -253,10 +719,10 @@ function J({
253
719
  fontFamily: "var(--font-sans, system-ui, sans-serif)",
254
720
  paddingRight: 8
255
721
  },
256
- children: t.label
722
+ children: r.label
257
723
  }
258
724
  ),
259
- /* @__PURE__ */ r(
725
+ /* @__PURE__ */ t(
260
726
  "div",
261
727
  {
262
728
  style: {
@@ -267,54 +733,54 @@ function J({
267
733
  backgroundColor: "var(--paper-secondary, rgba(244,241,230,0.6))",
268
734
  border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))"
269
735
  },
270
- children: t.segments.map((e, c) => {
271
- let s = a > 0 ? e.startTime / a * 100 : 0, p = a > 0 ? (e.endTime - e.startTime) / a * 100 : 0;
272
- s = Math.max(0, Math.min(100, s)), s + p > 100 && (p = 100 - s), p = Math.max(0, p);
273
- const W = e.endTime - e.startTime;
274
- return i && W <= 5 ? /* @__PURE__ */ r(
736
+ children: r.segments.map((a, I) => {
737
+ let z = o > 0 ? a.startTime / o * 100 : 0, L = o > 0 ? (a.endTime - a.startTime) / o * 100 : 0;
738
+ z = Math.max(0, Math.min(100, z)), z + L > 100 && (L = 100 - z), L = Math.max(0, L);
739
+ const N = a.endTime - a.startTime;
740
+ return p && N <= 5 ? /* @__PURE__ */ t(
275
741
  "div",
276
742
  {
277
743
  style: {
278
744
  position: "absolute",
279
745
  cursor: "pointer",
280
- left: `${s}%`,
746
+ left: `${z}%`,
281
747
  top: "50%",
282
748
  transform: "translateY(-50%)",
283
749
  width: 10,
284
750
  height: 10,
285
751
  borderRadius: "50%",
286
- backgroundColor: t.color,
752
+ backgroundColor: r.color,
287
753
  opacity: 0.85
288
754
  },
289
- title: `${t.label}: ${n(e.startTime)}-${n(e.endTime)}`
755
+ title: `${r.label}: ${c(a.startTime)}-${c(a.endTime)}`
290
756
  },
291
- c
292
- ) : /* @__PURE__ */ r(
757
+ I
758
+ ) : /* @__PURE__ */ t(
293
759
  "div",
294
760
  {
295
761
  style: {
296
762
  position: "absolute",
297
763
  top: 0,
298
764
  bottom: 0,
299
- left: `${s}%`,
300
- width: `${Math.max(p, 0.7)}%`,
301
- maxWidth: `${100 - s}%`,
302
- backgroundColor: t.color,
765
+ left: `${z}%`,
766
+ width: `${Math.max(L, 0.7)}%`,
767
+ maxWidth: `${100 - z}%`,
768
+ backgroundColor: r.color,
303
769
  opacity: 0.85,
304
770
  borderRadius: 2,
305
771
  cursor: "pointer",
306
772
  transition: "opacity 0.15s"
307
773
  },
308
- title: `${t.label}: ${n(e.startTime)}-${n(e.endTime)}`
774
+ title: `${r.label}: ${c(a.startTime)}-${c(a.endTime)}`
309
775
  },
310
- c
776
+ I
311
777
  );
312
778
  })
313
779
  }
314
780
  )
315
- ] }, t.key);
781
+ ] }, r.key);
316
782
  }) }),
317
- /* @__PURE__ */ r(
783
+ /* @__PURE__ */ t(
318
784
  "div",
319
785
  {
320
786
  style: {
@@ -327,16 +793,16 @@ function J({
327
793
  backgroundColor: "var(--rail-discovery, #5E88B0)",
328
794
  opacity: 0.55,
329
795
  boxShadow: "0 0 0 1px rgba(94,136,176,0.10)",
330
- left: z,
796
+ left: d,
331
797
  transform: "translateX(-50%)"
332
798
  }
333
799
  }
334
800
  ),
335
- f ? /* @__PURE__ */ r(
801
+ b ? /* @__PURE__ */ t(
336
802
  "button",
337
803
  {
338
804
  type: "button",
339
- onClick: R,
805
+ onClick: M,
340
806
  style: {
341
807
  position: "absolute",
342
808
  cursor: "pointer",
@@ -359,6 +825,8 @@ function J({
359
825
  ] });
360
826
  }
361
827
  export {
362
- J as T
828
+ O as C,
829
+ U as T,
830
+ tt as a
363
831
  };
364
832
  //# sourceMappingURL=Timeline.es.js.map