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,10 +1,9 @@
1
- import { jsxs as r, jsx as o, Fragment as ne } from "react/jsx-runtime";
2
- import { forwardRef as Ee, useRef as H, useState as h, useCallback as oe, useEffect as ie, useImperativeHandle as Ge } from "react";
3
- import { FileSignal as We, RotateCcw as Me, Pause as ze, Play as He, RotateCw as Pe, ChevronDown as Ae, AudioLines as re, PauseCircle as $e, PlayCircle as Be } from "lucide-react";
4
- import { T as je } from "./Timeline.es.js";
5
- function ae(u) {
6
- const l = Math.floor(u / 60), D = Math.round(u % 60);
7
- return `${l}:${D.toString().padStart(2, "0")}`;
1
+ import { jsxs as i, jsx as o, Fragment as Ee } from "react/jsx-runtime";
2
+ import { forwardRef as Ge, useRef as P, useState as f, useCallback as te, useEffect as ne, useImperativeHandle as We } from "react";
3
+ import { FileSignal as Me, RotateCcw as ze, Pause as He, Play as Ae, RotateCw as Pe, ChevronDown as $e, AudioLines as oe, PauseCircle as Be, PlayCircle as je } from "lucide-react";
4
+ function re(g) {
5
+ const d = Math.floor(g / 60), p = Math.round(g % 60);
6
+ return `${d}:${p.toString().padStart(2, "0")}`;
8
7
  }
9
8
  const Le = {
10
9
  Agent: [
@@ -23,177 +22,179 @@ const Le = {
23
22
  { start: 0.6, end: 0.66 },
24
23
  { start: 0.74, end: 0.8 }
25
24
  ]
26
- }, C = [
25
+ }, D = [
27
26
  { speaker: "Agent", type: "agent", time: "00:04", text: "Thanks for calling Miles Point S Pensau. This is Steve. How can I help you?" },
28
27
  { speaker: "Customer", type: "customer", time: "00:12", text: "Hi, Steve. This is Sandra with Botai Catering." },
29
28
  { speaker: "Agent", type: "agent", time: "00:18", text: "Hello. How are you?" },
30
29
  { speaker: "Customer", type: "customer", time: "00:20", text: "I'm doing really good. Hey. I brought my vans in last week, and I call it a beeping van, the one that beeps when you back up. Makes the crunchy noise. So I just took it on Saturday after, I think I had the, the Miles. I picked it up on Saturday morning, and I went to an event. So So I don't know if it's the tire or something, but makes it a little crunchy noise. Sometimes when I do the brake, but only if I turn the wheel too." },
31
30
  { speaker: "Agent", type: "agent", time: "00:21", text: "Oh, interesting. Okay. Can you swing by with it one of these days?" }
32
31
  ], _e = [1, 1.25, 1.5, 2];
33
- function se(u) {
34
- if (!u)
32
+ function ie(g) {
33
+ if (!g)
35
34
  return 0;
36
- const l = u.split(":").map(Number);
37
- return (l[0] || 0) * 60 + (l[1] || 0);
35
+ const d = g.split(":").map(Number);
36
+ return (d[0] || 0) * 60 + (d[1] || 0);
38
37
  }
39
- const Ke = Ee(function({
40
- audioUrl: l,
41
- timelineSegments: D = [],
42
- durationSeconds: S = 0,
38
+ const Ke = Ge(function({
39
+ audioUrl: d,
40
+ timelineSegments: p = [],
41
+ durationSeconds: R = 0,
43
42
  // Parent-managed audio props (optional — if not provided, component manages its own audio)
44
- currentTimeSeconds: P,
45
- timelinePlaying: A,
46
- playbackRate: $,
47
- onSeek: T,
48
- onTogglePlay: B,
43
+ currentTimeSeconds: ae,
44
+ timelinePlaying: $,
45
+ playbackRate: se,
46
+ onSeek: B,
47
+ onTogglePlay: S,
49
48
  onSeekBack: j,
50
49
  onSeekForward: L,
51
50
  onSetPlaybackRate: _,
52
51
  audioRef: X,
53
52
  // Speaker names
54
- agentName: le = "Agent",
55
- customerName: ce = "Customer",
53
+ agentName: T = "Agent",
54
+ customerName: E = "Customer",
56
55
  // Transcript props
57
- transcript: g,
58
- highlightedTurns: de = /* @__PURE__ */ new Set(),
59
- activeTurnIndex: N,
60
- activeDemoIndex: he = 1,
61
- turnObservations: ue = {},
62
- setExpandedSignals: R,
63
- onTurnPlayPause: Y
64
- }, ge) {
65
- var te;
66
- const q = H(null), c = H(null), v = H(null), [K, f] = h(!1), [E, V] = h(0), [fe, pe] = h(0), [me, ye] = h(1), [F, ve] = h(null), [be, ke] = h(1), [xe, w] = h(!1), [Se, Z] = h(!1), [J, G] = h(he), a = !!X, b = !l, s = l && !a, k = b ? xe : a ? A ?? !1 : K, Fe = b ? F ?? 0 : a ? P ?? 0 : E, W = b ? be : a ? $ ?? 1 : me, M = b ? S || 156 : a ? S : fe || S || 0, z = oe(() => {
56
+ transcript: y,
57
+ highlightedTurns: le = /* @__PURE__ */ new Set(),
58
+ activeTurnIndex: Y,
59
+ activeDemoIndex: ce = 1,
60
+ turnObservations: de = {},
61
+ setExpandedSignals: G,
62
+ onTurnPlayPause: q
63
+ }, ue) {
64
+ var ee;
65
+ const K = P(null), u = P(null), k = P(null), [V, m] = f(!1), [W, Z] = f(0), [he, fe] = f(0), [ge, pe] = f(1), [w, ye] = f(null), [me, ve] = f(1), [be, I] = f(!1), [ke, J] = f(!1), [N, M] = f(ce), s = !!X, x = !d, l = d && !s, F = x ? be : s ? $ ?? !1 : V, xe = x ? w ?? 0 : s ? ae ?? 0 : W, z = x ? me : s ? se ?? 1 : ge, H = x ? R || 156 : s ? R : he || R || 0, A = te(() => {
67
66
  const e = () => {
68
- const n = c.current;
69
- n && V(n.currentTime), v.current = requestAnimationFrame(e);
67
+ const t = u.current;
68
+ t && Z(t.currentTime), k.current = requestAnimationFrame(e);
70
69
  };
71
- v.current = requestAnimationFrame(e);
72
- }, []), p = oe(() => {
73
- v.current && (cancelAnimationFrame(v.current), v.current = null);
70
+ k.current = requestAnimationFrame(e);
71
+ }, []), v = te(() => {
72
+ k.current && (cancelAnimationFrame(k.current), k.current = null);
74
73
  }, []);
75
- ie(() => () => p(), [p]), ie(() => {
76
- if (!s)
74
+ ne(() => () => v(), [v]), ne(() => {
75
+ if (!l)
77
76
  return;
78
- const e = c.current;
77
+ const e = u.current;
79
78
  if (!e)
80
79
  return;
81
- const n = () => pe(e.duration || 0), t = () => {
82
- f(!1), p();
80
+ const t = () => fe(e.duration || 0), n = () => {
81
+ m(!1), v();
83
82
  };
84
- return e.addEventListener("loadedmetadata", n), e.addEventListener("ended", t), () => {
85
- e.removeEventListener("loadedmetadata", n), e.removeEventListener("ended", t);
83
+ return e.addEventListener("loadedmetadata", t), e.addEventListener("ended", n), () => {
84
+ e.removeEventListener("loadedmetadata", t), e.removeEventListener("ended", n);
86
85
  };
87
- }, [s, p]);
88
- const O = (e) => {
89
- for (let n = C.length - 1; n >= 0; n--) {
90
- const t = se(C[n].time);
91
- if (e >= t)
92
- return n;
86
+ }, [l, v]);
87
+ const Q = (e) => {
88
+ for (let t = D.length - 1; t >= 0; t--) {
89
+ const n = ie(D[t].time);
90
+ if (e >= n)
91
+ return t;
93
92
  }
94
93
  return 0;
95
- }, m = (e) => {
96
- const t = Math.max(0, Math.min(e, M || 156));
97
- if (s) {
98
- const i = c.current;
99
- i && (i.currentTime = t), V(t);
94
+ }, b = (e) => {
95
+ const n = Math.max(0, Math.min(e, H || 156));
96
+ if (l) {
97
+ const r = u.current;
98
+ r && (r.currentTime = n), Z(n);
100
99
  } else
101
- a && T && T(t);
102
- ve(t), G(O(t));
103
- }, we = () => {
104
- if (s) {
105
- const e = c.current;
100
+ s && B && B(n);
101
+ ye(n), M(Q(n));
102
+ }, Fe = () => {
103
+ if (l) {
104
+ const e = u.current;
106
105
  if (!e)
107
106
  return;
108
- K ? (e.pause(), p(), f(!1)) : e.play().then(() => {
109
- f(!0), z();
107
+ V ? (e.pause(), v(), m(!1)) : e.play().then(() => {
108
+ m(!0), A();
110
109
  }).catch(() => {
111
110
  });
112
111
  } else
113
- a && B ? B() : w((e) => !e);
114
- }, Ie = () => {
115
- a && j ? j() : m(Math.max(0, (s ? E : F ?? 0) - 10));
116
- }, Ce = () => {
117
- a && L ? L() : m(Math.min(M || 156, (s ? E : F ?? 0) + 10));
118
- }, De = (e) => {
119
- if (s) {
120
- const n = c.current;
121
- n && (n.playbackRate = e), ye(e);
112
+ s && S ? S() : I((e) => !e);
113
+ }, Se = () => {
114
+ s && j ? j() : b(Math.max(0, (l ? W : w ?? 0) - 10));
115
+ }, we = () => {
116
+ s && L ? L() : b(Math.min(H || 156, (l ? W : w ?? 0) + 10));
117
+ }, Ie = (e) => {
118
+ if (l) {
119
+ const t = u.current;
120
+ t && (t.playbackRate = e), pe(e);
122
121
  } else
123
- a && _ && _(e);
124
- ke(e), Z(!1);
122
+ s && _ && _(e);
123
+ ve(e), J(!1);
125
124
  };
126
- Ge(ge, () => ({
125
+ We(ue, () => ({
127
126
  seekTo: (e) => {
128
- if (m(e), s) {
129
- const t = c.current;
130
- t && t.play().then(() => {
131
- f(!0), z();
127
+ if (b(e), s)
128
+ !$ && S && S();
129
+ else if (l) {
130
+ const n = u.current;
131
+ n && n.play().then(() => {
132
+ m(!0), A();
132
133
  }).catch(() => {
133
134
  });
134
135
  } else
135
- w(!0);
136
- const n = O(e);
137
- G(n), setTimeout(() => {
138
- var i;
139
- const t = (i = q.current) == null ? void 0 : i.children;
140
- t != null && t[n] && t[n].scrollIntoView({ behavior: "smooth", block: "nearest" });
136
+ I(!0);
137
+ const t = Q(e);
138
+ M(t), setTimeout(() => {
139
+ var r;
140
+ const n = (r = K.current) == null ? void 0 : r.children;
141
+ n != null && n[t] && n[t].scrollIntoView({ behavior: "smooth", block: "nearest" });
141
142
  }, 50);
142
143
  }
143
144
  }));
144
- const Te = (e) => {
145
- var n;
146
- if (J === e && k) {
147
- if (s) {
148
- const t = c.current;
149
- t && t.pause(), p(), f(!1);
145
+ const Ce = (e) => {
146
+ var t;
147
+ if (N === e && F) {
148
+ if (l) {
149
+ const n = u.current;
150
+ n && n.pause(), v(), m(!1);
150
151
  }
151
- w(!1);
152
+ I(!1);
152
153
  } else {
153
- const t = se((n = C[e]) == null ? void 0 : n.time);
154
- if (G(e), m(t), s) {
155
- const i = c.current;
156
- i && (i.currentTime = t, i.play().then(() => {
157
- f(!0), z();
154
+ const n = ie((t = D[e]) == null ? void 0 : t.time);
155
+ if (M(e), b(n), l) {
156
+ const r = u.current;
157
+ r && (r.currentTime = n, r.play().then(() => {
158
+ m(!0), A();
158
159
  }).catch(() => {
159
160
  }));
160
161
  }
161
- w(!0);
162
+ I(!0);
162
163
  }
163
- }, Re = (e, n) => {
164
+ }, De = (e, t) => {
164
165
  if (e == null)
165
166
  return;
166
- const t = (i) => {
167
- const d = Math.floor(i / 6e4), y = Math.floor(i % 6e4 / 1e3);
168
- return `${d.toString().padStart(2, "0")}:${y.toString().padStart(2, "0")}`;
167
+ const n = (r) => {
168
+ const a = Math.floor(r / 6e4), c = Math.floor(r % 6e4 / 1e3);
169
+ return `${a.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}`;
169
170
  };
170
- return `${t(e)}–${n != null ? t(n) : t(e)}`;
171
- }, Q = (te = g == null ? void 0 : g.messages) != null && te.length ? g.messages.map((e, n) => {
172
- var t, i;
171
+ return `${n(e)}–${t != null ? n(t) : n(e)}`;
172
+ }, O = (ee = y == null ? void 0 : y.messages) != null && ee.length ? y.messages.map((e, t) => {
173
+ var n, r;
173
174
  return {
174
- actor: e.actor === "agent" ? ((t = g.actor_map) == null ? void 0 : t.agent) || "Agent" : ((i = g.actor_map) == null ? void 0 : i.customer) || "Customer",
175
+ actor: e.actor === "agent" ? ((n = y.actor_map) == null ? void 0 : n.agent) || "Agent" : ((r = y.actor_map) == null ? void 0 : r.customer) || "Customer",
175
176
  actorType: e.actor === "agent" ? "agent" : "customer",
176
177
  text: e.text || "",
177
- timeRange: Re(e.start ?? e.start_ms, e.end ?? e.end_ms),
178
- isHighlighted: de.has(n),
179
- highlightColor: k && N === n ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
180
- observations: (ue[n] || []).map((d) => ({
181
- ...d,
178
+ timeRange: De(e.start ?? e.start_ms, e.end ?? e.end_ms),
179
+ isHighlighted: le.has(t),
180
+ highlightColor: F && Y === t ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
181
+ observations: (de[t] || []).map((a) => ({
182
+ ...a,
182
183
  onClick: () => {
183
- R == null || R((y) => /* @__PURE__ */ new Set([...y, d.signalKey])), setTimeout(() => {
184
- const y = document.getElementById(`signal-${d.signalKey}`);
185
- y && y.scrollIntoView({ behavior: "smooth", block: "nearest" });
184
+ G == null || G((c) => /* @__PURE__ */ new Set([...c, a.signalKey])), setTimeout(() => {
185
+ const c = document.getElementById(`signal-${a.signalKey}`);
186
+ c && c.scrollIntoView({ behavior: "smooth", block: "nearest" });
186
187
  }, 100);
187
188
  }
188
189
  }))
189
190
  };
190
- }) : null, U = b ? F ?? 0 : Fe, I = M || 156, x = I > 0 ? U / I * 100 : 0, ee = Math.round(U);
191
- return /* @__PURE__ */ r("div", { style: {
191
+ }) : null, U = x ? w ?? 0 : xe, h = H || 156, C = h > 0 ? U / h * 100 : 0, Re = Math.round(U);
192
+ return /* @__PURE__ */ i("div", { style: {
192
193
  display: "flex",
193
194
  flexDirection: "column",
194
195
  gap: 16
195
196
  }, children: [
196
- /* @__PURE__ */ r("div", { style: {
197
+ /* @__PURE__ */ i("div", { style: {
197
198
  display: "flex",
198
199
  alignItems: "center",
199
200
  gap: 16,
@@ -208,14 +209,14 @@ const Ke = Ee(function({
208
209
  borderRadius: 9999,
209
210
  background: "var(--surface-hover, #F3F7F7)",
210
211
  flexShrink: 0
211
- }, children: /* @__PURE__ */ o(We, { size: 20, color: "#2E3236", strokeWidth: 1.5 }) }),
212
+ }, children: /* @__PURE__ */ o(Me, { size: 20, color: "#2E3236", strokeWidth: 1.5 }) }),
212
213
  /* @__PURE__ */ o("span", { style: {
213
214
  fontSize: 15,
214
215
  fontWeight: 500,
215
216
  color: "var(--Grey-Strong, #2E3236)"
216
217
  }, children: "Recording" })
217
218
  ] }),
218
- /* @__PURE__ */ r("div", { style: {
219
+ /* @__PURE__ */ i("div", { style: {
219
220
  display: "flex",
220
221
  padding: 24,
221
222
  flexDirection: "column",
@@ -225,22 +226,22 @@ const Ke = Ee(function({
225
226
  border: "1px solid var(--Grey-absent, #D9D9D9)",
226
227
  background: "var(--Grey-White, #FFF)"
227
228
  }, children: [
228
- /* @__PURE__ */ r("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 16 }, children: [
229
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24 }, children: [
230
- /* @__PURE__ */ r("span", { style: {
229
+ /* @__PURE__ */ i("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 16 }, children: [
230
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24 }, children: [
231
+ /* @__PURE__ */ i("span", { style: {
231
232
  fontSize: 14,
232
233
  fontWeight: 500,
233
234
  color: "var(--Grey-Strong, #2E3236)",
234
235
  lineHeight: 1.2
235
236
  }, children: [
236
- le,
237
+ T,
237
238
  " / ",
238
- ce
239
+ E
239
240
  ] }),
240
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
241
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
241
242
  /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" }),
242
- /* @__PURE__ */ o("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Me, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
243
- /* @__PURE__ */ o("button", { onClick: we, style: {
243
+ /* @__PURE__ */ o("button", { onClick: Se, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(ze, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
244
+ /* @__PURE__ */ o("button", { onClick: Fe, style: {
244
245
  background: "var(--Grey-Strong, #2E3236)",
245
246
  border: "none",
246
247
  cursor: "pointer",
@@ -251,15 +252,15 @@ const Ke = Ee(function({
251
252
  display: "flex",
252
253
  alignItems: "center",
253
254
  justifyContent: "center"
254
- }, children: k ? /* @__PURE__ */ o(ze, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ o(He, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
255
- /* @__PURE__ */ o("button", { onClick: Ce, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
255
+ }, children: F ? /* @__PURE__ */ o(He, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ o(Ae, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
256
+ /* @__PURE__ */ o("button", { onClick: we, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
256
257
  /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" })
257
258
  ] }),
258
- /* @__PURE__ */ r("div", { style: { position: "relative" }, children: [
259
- /* @__PURE__ */ r(
259
+ /* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
260
+ /* @__PURE__ */ i(
260
261
  "button",
261
262
  {
262
- onClick: () => Z((e) => !e),
263
+ onClick: () => J((e) => !e),
263
264
  style: {
264
265
  background: "var(--Grey-White, #FFF)",
265
266
  border: "1px solid var(--Grey-absent, #D9D9D9)",
@@ -279,13 +280,13 @@ const Ke = Ee(function({
279
280
  gap: 4
280
281
  },
281
282
  children: [
282
- W,
283
+ z,
283
284
  "x",
284
- /* @__PURE__ */ o(Ae, { size: 12, color: "#808183" })
285
+ /* @__PURE__ */ o($e, { size: 12, color: "#808183" })
285
286
  ]
286
287
  }
287
288
  ),
288
- Se && /* @__PURE__ */ o("div", { style: {
289
+ ke && /* @__PURE__ */ o("div", { style: {
289
290
  position: "absolute",
290
291
  top: "100%",
291
292
  right: 0,
@@ -297,19 +298,19 @@ const Ke = Ee(function({
297
298
  zIndex: 10,
298
299
  overflow: "hidden",
299
300
  minWidth: 80
300
- }, children: _e.map((e) => /* @__PURE__ */ r(
301
+ }, children: _e.map((e) => /* @__PURE__ */ i(
301
302
  "button",
302
303
  {
303
- onClick: () => De(e),
304
+ onClick: () => Ie(e),
304
305
  style: {
305
306
  display: "block",
306
307
  width: "100%",
307
308
  padding: "8px 12px",
308
309
  border: "none",
309
- background: W === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
310
+ background: z === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
310
311
  cursor: "pointer",
311
312
  fontSize: 13,
312
- fontWeight: W === e ? 600 : 400,
313
+ fontWeight: z === e ? 600 : 400,
313
314
  color: "var(--Grey-Strong, #2E3236)",
314
315
  fontFamily: "var(--font-sans)",
315
316
  textAlign: "left"
@@ -323,37 +324,22 @@ const Ke = Ee(function({
323
324
  )) })
324
325
  ] })
325
326
  ] }),
326
- l && a ? /* @__PURE__ */ r(ne, { children: [
327
- /* @__PURE__ */ o(
328
- je,
329
- {
330
- segments: D,
331
- durationSeconds: S,
332
- currentTimeSeconds: P,
333
- onSeek: T,
334
- showControls: !1,
335
- hasRecording: !0,
336
- timelinePlaying: A,
337
- playbackRate: $
338
- }
339
- ),
340
- /* @__PURE__ */ o("audio", { ref: X, preload: "none", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: l, type: "audio/mpeg" }) })
341
- ] }) : /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
342
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
327
+ /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
328
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
343
329
  /* @__PURE__ */ o("span", { style: {
344
330
  fontSize: 13,
345
- fontWeight: 600,
346
- color: x > 0 ? "var(--Green-Primary, #00925F)" : "var(--Grey-Strong, #2E3236)",
331
+ fontWeight: 500,
332
+ color: "var(--Grey-Strong, #2E3236)",
347
333
  fontFamily: "var(--font-sans)",
348
334
  lineHeight: 1.2,
349
335
  minWidth: 60
350
- }, children: ae(ee) }),
351
- /* @__PURE__ */ r(
336
+ }, children: re(h) }),
337
+ /* @__PURE__ */ i(
352
338
  "div",
353
339
  {
354
340
  onClick: (e) => {
355
- const n = e.currentTarget.getBoundingClientRect(), t = e.clientX - n.left, i = Math.max(0, Math.min(1, t / n.width));
356
- m(i * I);
341
+ const t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, r = Math.max(0, Math.min(1, n / t.width));
342
+ b(r * h);
357
343
  },
358
344
  style: {
359
345
  flex: 1,
@@ -378,7 +364,7 @@ const Ke = Ee(function({
378
364
  left: 0,
379
365
  top: "50%",
380
366
  transform: "translateY(-50%)",
381
- width: `${x}%`,
367
+ width: `${C}%`,
382
368
  height: 4,
383
369
  borderRadius: 2,
384
370
  background: "var(--Green-Primary, #00925F)",
@@ -394,7 +380,7 @@ const Ke = Ee(function({
394
380
  xmlns: "http://www.w3.org/2000/svg",
395
381
  style: {
396
382
  position: "absolute",
397
- left: `${x}%`,
383
+ left: `${C}%`,
398
384
  top: "50%",
399
385
  transform: "translate(-50%, -50%)",
400
386
  pointerEvents: "none"
@@ -414,61 +400,67 @@ const Ke = Ee(function({
414
400
  }
415
401
  )
416
402
  ] }),
417
- /* @__PURE__ */ r("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
418
- ["Agent", "Customer"].map((e, n) => /* @__PURE__ */ r("div", { style: {
419
- display: "flex",
420
- alignItems: "center",
421
- gap: 8,
422
- height: 20,
423
- marginBottom: n === 0 ? 4 : 0
424
- }, children: [
425
- /* @__PURE__ */ o("span", { style: {
426
- fontSize: 13,
427
- fontWeight: 400,
428
- color: "var(--Grey-Muted, #808183)",
429
- fontFamily: "var(--font-sans)",
430
- lineHeight: 1.2,
431
- minWidth: 60
432
- }, children: e }),
433
- /* @__PURE__ */ r(
434
- "div",
435
- {
436
- onClick: (t) => {
437
- const i = t.currentTarget.getBoundingClientRect(), d = Math.max(0, Math.min(1, (t.clientX - i.left) / i.width));
438
- m(d * I);
439
- },
440
- style: {
441
- flex: 1,
442
- height: 6,
443
- position: "relative",
444
- borderRadius: 3,
445
- cursor: "pointer"
446
- },
447
- children: [
448
- /* @__PURE__ */ o("div", { style: {
449
- position: "absolute",
450
- left: 0,
451
- right: 0,
452
- top: "50%",
453
- transform: "translateY(-50%)",
454
- height: 4,
455
- borderRadius: 2,
456
- background: "var(--rail-surface-2, #E3E1D7)"
457
- } }),
458
- Le[e].map((t, i) => /* @__PURE__ */ o("div", { style: {
459
- position: "absolute",
460
- left: `${t.start * 100}%`,
461
- width: `${(t.end - t.start) * 100}%`,
462
- top: 0,
463
- bottom: 0,
403
+ /* @__PURE__ */ i("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
404
+ [T, E].map((e, t) => {
405
+ const n = t === 0, r = p != null && p.length ? p.filter((a) => n ? a.actor === T : a.actor === E).map((a) => ({
406
+ start: h > 0 ? a.startTime / h : 0,
407
+ end: h > 0 ? a.endTime / h : 0
408
+ })) : Le[n ? "Agent" : "Customer"] || [];
409
+ return /* @__PURE__ */ i("div", { style: {
410
+ display: "flex",
411
+ alignItems: "center",
412
+ gap: 8,
413
+ height: 20,
414
+ marginBottom: t === 0 ? 4 : 0
415
+ }, children: [
416
+ /* @__PURE__ */ o("span", { style: {
417
+ fontSize: 13,
418
+ fontWeight: 400,
419
+ color: "var(--Grey-Muted, #808183)",
420
+ fontFamily: "var(--font-sans)",
421
+ lineHeight: 1.2,
422
+ minWidth: 60
423
+ }, children: e }),
424
+ /* @__PURE__ */ i(
425
+ "div",
426
+ {
427
+ onClick: (a) => {
428
+ const c = a.currentTarget.getBoundingClientRect(), Te = Math.max(0, Math.min(1, (a.clientX - c.left) / c.width));
429
+ b(Te * h);
430
+ },
431
+ style: {
432
+ flex: 1,
433
+ height: 6,
434
+ position: "relative",
464
435
  borderRadius: 3,
465
- background: e === "Agent" ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
466
- } }, i))
467
- ]
468
- }
469
- )
470
- ] }, e)),
471
- /* @__PURE__ */ r("div", { style: {
436
+ cursor: "pointer"
437
+ },
438
+ children: [
439
+ /* @__PURE__ */ o("div", { style: {
440
+ position: "absolute",
441
+ left: 0,
442
+ right: 0,
443
+ top: "50%",
444
+ transform: "translateY(-50%)",
445
+ height: 4,
446
+ borderRadius: 2,
447
+ background: "var(--rail-surface-2, #E3E1D7)"
448
+ } }),
449
+ r.map((a, c) => /* @__PURE__ */ o("div", { style: {
450
+ position: "absolute",
451
+ left: `${a.start * 100}%`,
452
+ width: `${(a.end - a.start) * 100}%`,
453
+ top: 0,
454
+ bottom: 0,
455
+ borderRadius: 3,
456
+ background: n ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
457
+ } }, c))
458
+ ]
459
+ }
460
+ )
461
+ ] }, e);
462
+ }),
463
+ /* @__PURE__ */ i("div", { style: {
472
464
  position: "absolute",
473
465
  left: 68,
474
466
  /* 60 label + 8 gap */
@@ -479,17 +471,16 @@ const Ke = Ee(function({
479
471
  }, children: [
480
472
  /* @__PURE__ */ o("div", { style: {
481
473
  position: "absolute",
482
- left: `${x}%`,
474
+ left: `${C}%`,
483
475
  top: 0,
484
476
  height: 44,
485
- /* spans both rows */
486
477
  transform: "translateX(-50%)",
487
478
  borderLeft: "1.5px dashed var(--Grey-Muted, #808183)",
488
479
  opacity: 0.5
489
480
  } }),
490
481
  /* @__PURE__ */ o("div", { style: {
491
482
  position: "absolute",
492
- left: `${x}%`,
483
+ left: `${C}%`,
493
484
  bottom: 0,
494
485
  transform: "translateX(-50%)",
495
486
  background: "var(--Grey-Strong, #2E3236)",
@@ -500,13 +491,14 @@ const Ke = Ee(function({
500
491
  padding: "4px 6px",
501
492
  borderRadius: 4,
502
493
  whiteSpace: "nowrap"
503
- }, children: ae(ee) })
494
+ }, children: re(Re) })
504
495
  ] })
505
496
  ] }),
506
- s && /* @__PURE__ */ o("audio", { ref: c, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: l, type: "audio/mpeg" }) })
497
+ l && /* @__PURE__ */ o("audio", { ref: u, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: d, type: "audio/mpeg" }) }),
498
+ s && d && /* @__PURE__ */ o("audio", { ref: X, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: d, type: "audio/mpeg" }) })
507
499
  ] })
508
500
  ] }),
509
- /* @__PURE__ */ r("div", { style: {
501
+ /* @__PURE__ */ i("div", { style: {
510
502
  width: "100%",
511
503
  display: "flex",
512
504
  flexDirection: "column",
@@ -521,29 +513,29 @@ const Ke = Ee(function({
521
513
  color: "var(--Grey-Strong, #2E3236)",
522
514
  lineHeight: 1.2
523
515
  }, children: "Transcript" }) }),
524
- /* @__PURE__ */ o("div", { id: "transcript-container", ref: q, style: {
516
+ /* @__PURE__ */ o("div", { id: "transcript-container", ref: K, style: {
525
517
  display: "flex",
526
518
  flexDirection: "column",
527
519
  maxHeight: 600,
528
520
  overflowY: "auto"
529
- }, children: (Q || C.map((e) => ({
521
+ }, children: (O || D.map((e) => ({
530
522
  actor: e.speaker,
531
523
  actorType: e.type,
532
524
  text: e.text,
533
525
  timeRange: e.time
534
- }))).map((e, n) => {
535
- const t = !!Q, i = t ? k && N === n : n === J && k, d = (e.actorType || e.type) === "customer";
536
- return /* @__PURE__ */ r("div", { style: {
526
+ }))).map((e, t) => {
527
+ const n = !!O, r = n ? F && Y === t : t === N && F, a = (e.actorType || e.type) === "customer";
528
+ return /* @__PURE__ */ i("div", { style: {
537
529
  display: "flex",
538
530
  padding: 16,
539
531
  flexDirection: "column",
540
532
  alignItems: "flex-start",
541
533
  gap: 16,
542
534
  alignSelf: "stretch",
543
- borderTop: n > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
544
- background: i ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
535
+ borderTop: t > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
536
+ background: r ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
545
537
  }, children: [
546
- /* @__PURE__ */ r("div", { style: {
538
+ /* @__PURE__ */ i("div", { style: {
547
539
  display: "flex",
548
540
  alignItems: "center",
549
541
  justifyContent: "space-between",
@@ -554,12 +546,12 @@ const Ke = Ee(function({
554
546
  fontSize: 14,
555
547
  fontWeight: 600,
556
548
  lineHeight: 1.2,
557
- color: d ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
549
+ color: a ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
558
550
  }, children: e.actor }),
559
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
560
- i && /* @__PURE__ */ r(ne, { children: [
561
- /* @__PURE__ */ o(re, { size: 12, color: "#2E3236" }),
562
- /* @__PURE__ */ o(re, { size: 12, color: "#2E3236" })
551
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
552
+ r && /* @__PURE__ */ i(Ee, { children: [
553
+ /* @__PURE__ */ o(oe, { size: 12, color: "#2E3236" }),
554
+ /* @__PURE__ */ o(oe, { size: 12, color: "#2E3236" })
563
555
  ] }),
564
556
  /* @__PURE__ */ o("span", { style: {
565
557
  fontSize: 13,
@@ -569,12 +561,12 @@ const Ke = Ee(function({
569
561
  }, children: e.timeRange })
570
562
  ] })
571
563
  ] }),
572
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
564
+ /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
573
565
  /* @__PURE__ */ o(
574
566
  "button",
575
567
  {
576
568
  onClick: () => {
577
- t && Y ? Y(e, n) : Te(n);
569
+ n && q ? q(e, t) : Ce(t);
578
570
  },
579
571
  style: {
580
572
  background: "none",
@@ -584,7 +576,7 @@ const Ke = Ee(function({
584
576
  flexShrink: 0,
585
577
  display: "flex"
586
578
  },
587
- children: i ? /* @__PURE__ */ o($e, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ o(Be, { size: 17, color: "#808183", strokeWidth: 1 })
579
+ children: r ? /* @__PURE__ */ o(Be, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ o(je, { size: 17, color: "#808183", strokeWidth: 1 })
588
580
  }
589
581
  ),
590
582
  /* @__PURE__ */ o("p", { style: {
@@ -596,7 +588,7 @@ const Ke = Ee(function({
596
588
  flex: 1
597
589
  }, children: e.text })
598
590
  ] })
599
- ] }, n);
591
+ ] }, t);
600
592
  }) })
601
593
  ] })
602
594
  ] })