chordia-ui 3.5.0 → 3.5.2
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/dist/UpdatedInteractionRecording.cjs.js +1 -1
- package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
- package/dist/UpdatedInteractionRecording.es.js +165 -162
- package/dist/UpdatedInteractionRecording.es.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js +4 -4
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +1304 -979
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/components/data.cjs.js +1 -1
- package/dist/components/data.cjs.js.map +1 -1
- package/dist/components/data.es.js +355 -366
- package/dist/components/data.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UpdatedInteractionDetails/UpdatedCompassScore.jsx +8 -24
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +9 -43
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +13 -1
- package/src/components/UpdatedInteractionDetails/UpdatedThreads.jsx +515 -152
- package/src/components/data/DataTable.jsx +0 -18
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as He, useRef as
|
|
3
|
-
import { FilePlay as Be, RotateCcw as Pe, Pause as $e, Play as
|
|
4
|
-
function se(
|
|
5
|
-
const
|
|
6
|
-
return `${
|
|
1
|
+
import { jsxs as a, jsx as o, Fragment as ze } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as He, useRef as Y, useState as g, useCallback as re, useEffect as q, useImperativeHandle as Ae } from "react";
|
|
3
|
+
import { FilePlay as Be, RotateCcw as Pe, Pause as $e, Play as Le, RotateCw as je, ChevronDown as _e, AudioLines as ie, PauseCircle as Xe, PlayCircle as Ye } from "lucide-react";
|
|
4
|
+
function se(v) {
|
|
5
|
+
const u = Math.floor(v / 60), b = Math.round(v % 60);
|
|
6
|
+
return `${u}:${b.toString().padStart(2, "0")}`;
|
|
7
7
|
}
|
|
8
8
|
const qe = {
|
|
9
9
|
Agent: [
|
|
@@ -22,125 +22,125 @@ const qe = {
|
|
|
22
22
|
{ start: 0.6, end: 0.66 },
|
|
23
23
|
{ start: 0.74, end: 0.8 }
|
|
24
24
|
]
|
|
25
|
-
},
|
|
25
|
+
}, z = [
|
|
26
26
|
{ speaker: "Agent", type: "agent", time: "00:04", text: "Thanks for calling Miles Point S Pensau. This is Steve. How can I help you?" },
|
|
27
27
|
{ speaker: "Customer", type: "customer", time: "00:12", text: "Hi, Steve. This is Sandra with Botai Catering." },
|
|
28
28
|
{ speaker: "Agent", type: "agent", time: "00:18", text: "Hello. How are you?" },
|
|
29
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." },
|
|
30
30
|
{ speaker: "Agent", type: "agent", time: "00:21", text: "Oh, interesting. Okay. Can you swing by with it one of these days?" }
|
|
31
31
|
], Ke = [1, 1.25, 1.5, 2];
|
|
32
|
-
function ae(
|
|
33
|
-
if (!
|
|
32
|
+
function ae(v) {
|
|
33
|
+
if (!v)
|
|
34
34
|
return 0;
|
|
35
|
-
const
|
|
36
|
-
return (
|
|
35
|
+
const u = v.split(":").map(Number);
|
|
36
|
+
return (u[0] || 0) * 60 + (u[1] || 0);
|
|
37
37
|
}
|
|
38
38
|
const Ne = He(function({
|
|
39
|
-
audioUrl:
|
|
40
|
-
timelineSegments:
|
|
41
|
-
durationSeconds:
|
|
39
|
+
audioUrl: u,
|
|
40
|
+
timelineSegments: b = [],
|
|
41
|
+
durationSeconds: H = 0,
|
|
42
42
|
// Parent-managed audio props (optional — if not provided, component manages its own audio)
|
|
43
43
|
currentTimeSeconds: le,
|
|
44
|
-
timelinePlaying:
|
|
44
|
+
timelinePlaying: K,
|
|
45
45
|
playbackRate: ce,
|
|
46
|
-
onSeek:
|
|
47
|
-
onTogglePlay:
|
|
48
|
-
onSeekBack:
|
|
49
|
-
onSeekForward:
|
|
50
|
-
onSetPlaybackRate:
|
|
51
|
-
audioRef:
|
|
46
|
+
onSeek: V,
|
|
47
|
+
onTogglePlay: C,
|
|
48
|
+
onSeekBack: Z,
|
|
49
|
+
onSeekForward: J,
|
|
50
|
+
onSetPlaybackRate: N,
|
|
51
|
+
audioRef: Q,
|
|
52
52
|
// Speaker names
|
|
53
|
-
agentName:
|
|
54
|
-
customerName:
|
|
53
|
+
agentName: A = "Agent",
|
|
54
|
+
customerName: B = "Customer",
|
|
55
55
|
// Transcript props
|
|
56
56
|
transcript: h,
|
|
57
57
|
highlightedTurns: de = /* @__PURE__ */ new Set(),
|
|
58
|
-
activeTurnIndex:
|
|
59
|
-
activeDemoIndex:
|
|
60
|
-
turnObservations:
|
|
61
|
-
setExpandedSignals:
|
|
62
|
-
onTurnPlayPause:
|
|
58
|
+
activeTurnIndex: w,
|
|
59
|
+
activeDemoIndex: ue = 1,
|
|
60
|
+
turnObservations: he = {},
|
|
61
|
+
setExpandedSignals: P,
|
|
62
|
+
onTurnPlayPause: O
|
|
63
63
|
}, ge) {
|
|
64
|
-
var
|
|
65
|
-
const
|
|
64
|
+
var oe;
|
|
65
|
+
const R = Y(null), f = Y(null), F = Y(null), [U, k] = g(!1), [$, ee] = g(0), [fe, pe] = g(0), [ye, me] = g(1), [I, ve] = g(null), [be, ke] = g(1), [xe, D] = g(!1), [Te, te] = g(!1), [E, G] = g(ue), [Fe, Se] = g(null), c = !!Q, S = !u, d = u && !c, y = S ? xe : c ? K ?? !1 : U, Ce = S ? I ?? 0 : c ? le ?? 0 : $, L = S ? be : c ? ce ?? 1 : ye, j = S ? H || 156 : c ? H : fe || H || 0, _ = re(() => {
|
|
66
66
|
const e = () => {
|
|
67
|
-
const t =
|
|
68
|
-
t &&
|
|
67
|
+
const t = f.current;
|
|
68
|
+
t && ee(t.currentTime), F.current = requestAnimationFrame(e);
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
}, []),
|
|
72
|
-
|
|
70
|
+
F.current = requestAnimationFrame(e);
|
|
71
|
+
}, []), x = re(() => {
|
|
72
|
+
F.current && (cancelAnimationFrame(F.current), F.current = null);
|
|
73
73
|
}, []);
|
|
74
|
-
|
|
75
|
-
if (!
|
|
74
|
+
q(() => () => x(), [x]), q(() => {
|
|
75
|
+
if (!d)
|
|
76
76
|
return;
|
|
77
|
-
const e =
|
|
77
|
+
const e = f.current;
|
|
78
78
|
if (!e)
|
|
79
79
|
return;
|
|
80
80
|
const t = () => pe(e.duration || 0), n = () => {
|
|
81
|
-
|
|
81
|
+
k(!1), x();
|
|
82
82
|
};
|
|
83
83
|
return e.addEventListener("loadedmetadata", t), e.addEventListener("ended", n), () => {
|
|
84
84
|
e.removeEventListener("loadedmetadata", t), e.removeEventListener("ended", n);
|
|
85
85
|
};
|
|
86
|
-
}, [
|
|
87
|
-
const
|
|
88
|
-
for (let t =
|
|
89
|
-
const n = ae(
|
|
86
|
+
}, [d, x]);
|
|
87
|
+
const X = (e) => {
|
|
88
|
+
for (let t = z.length - 1; t >= 0; t--) {
|
|
89
|
+
const n = ae(z[t].time);
|
|
90
90
|
if (e >= n)
|
|
91
91
|
return t;
|
|
92
92
|
}
|
|
93
93
|
return 0;
|
|
94
|
-
},
|
|
94
|
+
}, T = (e) => {
|
|
95
95
|
const n = Math.max(0, Math.min(e, j || 156));
|
|
96
|
-
if (
|
|
97
|
-
const r =
|
|
98
|
-
r && (r.currentTime = n),
|
|
96
|
+
if (d) {
|
|
97
|
+
const r = f.current;
|
|
98
|
+
r && (r.currentTime = n), ee(n);
|
|
99
99
|
} else
|
|
100
|
-
|
|
101
|
-
ve(n),
|
|
100
|
+
c && V && V(n);
|
|
101
|
+
ve(n), G(X(n));
|
|
102
102
|
}, we = () => {
|
|
103
|
-
if (
|
|
104
|
-
const e =
|
|
103
|
+
if (d) {
|
|
104
|
+
const e = f.current;
|
|
105
105
|
if (!e)
|
|
106
106
|
return;
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
U ? (e.pause(), x(), k(!1)) : e.play().then(() => {
|
|
108
|
+
k(!0), _();
|
|
109
109
|
}).catch(() => {
|
|
110
110
|
});
|
|
111
111
|
} else
|
|
112
|
-
|
|
112
|
+
c && C ? C() : D((e) => !e);
|
|
113
113
|
}, Re = () => {
|
|
114
|
-
|
|
114
|
+
c && Z ? Z() : T(Math.max(0, (d ? $ : I ?? 0) - 10));
|
|
115
115
|
}, Ie = () => {
|
|
116
|
-
|
|
116
|
+
c && J ? J() : T(Math.min(j || 156, (d ? $ : I ?? 0) + 10));
|
|
117
117
|
}, De = (e) => {
|
|
118
|
-
if (
|
|
119
|
-
const t =
|
|
118
|
+
if (d) {
|
|
119
|
+
const t = f.current;
|
|
120
120
|
t && (t.playbackRate = e), me(e);
|
|
121
121
|
} else
|
|
122
|
-
|
|
123
|
-
ke(e),
|
|
122
|
+
c && N && N(e);
|
|
123
|
+
ke(e), te(!1);
|
|
124
124
|
};
|
|
125
125
|
Ae(ge, () => ({
|
|
126
126
|
seekTo: (e) => {
|
|
127
|
-
if (
|
|
128
|
-
!
|
|
129
|
-
else if (
|
|
130
|
-
const n =
|
|
127
|
+
if (T(e), c)
|
|
128
|
+
!K && C && C();
|
|
129
|
+
else if (d) {
|
|
130
|
+
const n = f.current;
|
|
131
131
|
n && n.play().then(() => {
|
|
132
|
-
|
|
132
|
+
k(!0), _();
|
|
133
133
|
}).catch(() => {
|
|
134
134
|
});
|
|
135
135
|
} else
|
|
136
|
-
|
|
137
|
-
const t =
|
|
138
|
-
|
|
139
|
-
var
|
|
140
|
-
const n =
|
|
136
|
+
D(!0);
|
|
137
|
+
const t = X(e);
|
|
138
|
+
G(t), setTimeout(() => {
|
|
139
|
+
var s;
|
|
140
|
+
const n = R.current, r = (s = n == null ? void 0 : n.children) == null ? void 0 : s[t];
|
|
141
141
|
if (n && r) {
|
|
142
|
-
const
|
|
143
|
-
n.scrollTo({ top:
|
|
142
|
+
const i = n.getBoundingClientRect().top, m = r.getBoundingClientRect().top - i + n.scrollTop;
|
|
143
|
+
n.scrollTo({ top: m - 20, behavior: "smooth" });
|
|
144
144
|
}
|
|
145
145
|
}, 50);
|
|
146
146
|
},
|
|
@@ -151,20 +151,20 @@ const Ne = He(function({
|
|
|
151
151
|
if ((n = h == null ? void 0 : h.messages) != null && n.length) {
|
|
152
152
|
const r = h.messages;
|
|
153
153
|
t = 0;
|
|
154
|
-
for (let
|
|
155
|
-
const
|
|
156
|
-
if (e >=
|
|
157
|
-
t =
|
|
154
|
+
for (let s = r.length - 1; s >= 0; s--) {
|
|
155
|
+
const i = (r[s].start ?? r[s].start_ms ?? 0) / 1e3;
|
|
156
|
+
if (e >= i) {
|
|
157
|
+
t = s;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
} else
|
|
162
|
-
t =
|
|
163
|
-
|
|
164
|
-
var
|
|
165
|
-
const r =
|
|
166
|
-
if (r &&
|
|
167
|
-
const
|
|
162
|
+
t = X(e);
|
|
163
|
+
G(t), Se(t), setTimeout(() => {
|
|
164
|
+
var i;
|
|
165
|
+
const r = R.current, s = (i = r == null ? void 0 : r.children) == null ? void 0 : i[t];
|
|
166
|
+
if (r && s) {
|
|
167
|
+
const l = r.getBoundingClientRect().top, Me = s.getBoundingClientRect().top - l + r.scrollTop;
|
|
168
168
|
r.scrollTo({ top: Me - 20, behavior: "smooth" });
|
|
169
169
|
}
|
|
170
170
|
}, 50);
|
|
@@ -172,32 +172,32 @@ const Ne = He(function({
|
|
|
172
172
|
}));
|
|
173
173
|
const Ee = (e) => {
|
|
174
174
|
var t;
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
const n =
|
|
178
|
-
n && n.pause(),
|
|
175
|
+
if (E === e && y) {
|
|
176
|
+
if (d) {
|
|
177
|
+
const n = f.current;
|
|
178
|
+
n && n.pause(), x(), k(!1);
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
D(!1);
|
|
181
181
|
} else {
|
|
182
|
-
const n = ae((t =
|
|
183
|
-
if (
|
|
184
|
-
const r =
|
|
182
|
+
const n = ae((t = z[e]) == null ? void 0 : t.time);
|
|
183
|
+
if (G(e), T(n), d) {
|
|
184
|
+
const r = f.current;
|
|
185
185
|
r && (r.currentTime = n, r.play().then(() => {
|
|
186
|
-
|
|
186
|
+
k(!0), _();
|
|
187
187
|
}).catch(() => {
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
D(!0);
|
|
191
191
|
}
|
|
192
192
|
}, Ge = (e, t) => {
|
|
193
193
|
if (e == null)
|
|
194
194
|
return;
|
|
195
195
|
const n = (r) => {
|
|
196
|
-
const
|
|
197
|
-
return `${
|
|
196
|
+
const s = Math.floor(r / 6e4), i = Math.floor(r % 6e4 / 1e3);
|
|
197
|
+
return `${s.toString().padStart(2, "0")}:${i.toString().padStart(2, "0")}`;
|
|
198
198
|
};
|
|
199
199
|
return `${n(e)}–${t != null ? n(t) : n(e)}`;
|
|
200
|
-
},
|
|
200
|
+
}, W = (oe = h == null ? void 0 : h.messages) != null && oe.length ? h.messages.map((e, t) => {
|
|
201
201
|
var n, r;
|
|
202
202
|
return {
|
|
203
203
|
actor: e.actor === "agent" ? ((n = h.actor_map) == null ? void 0 : n.agent) || "Agent" : ((r = h.actor_map) == null ? void 0 : r.customer) || "Customer",
|
|
@@ -205,41 +205,41 @@ const Ne = He(function({
|
|
|
205
205
|
text: e.text || "",
|
|
206
206
|
timeRange: Ge(e.start ?? e.start_ms, e.end ?? e.end_ms),
|
|
207
207
|
isHighlighted: de.has(t),
|
|
208
|
-
highlightColor: y &&
|
|
209
|
-
observations: (
|
|
210
|
-
...
|
|
208
|
+
highlightColor: y && w === t ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
|
|
209
|
+
observations: (he[t] || []).map((s) => ({
|
|
210
|
+
...s,
|
|
211
211
|
onClick: () => {
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
212
|
+
P == null || P((i) => /* @__PURE__ */ new Set([...i, s.signalKey])), setTimeout(() => {
|
|
213
|
+
const i = document.getElementById(`signal-${s.signalKey}`);
|
|
214
|
+
i && i.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
215
215
|
}, 100);
|
|
216
216
|
}
|
|
217
217
|
}))
|
|
218
218
|
};
|
|
219
219
|
}) : null;
|
|
220
|
-
|
|
220
|
+
q(() => {
|
|
221
221
|
var r;
|
|
222
222
|
if (!y)
|
|
223
223
|
return;
|
|
224
|
-
const e =
|
|
224
|
+
const e = W ? w : E;
|
|
225
225
|
if (e == null || e < 0)
|
|
226
226
|
return;
|
|
227
|
-
const t =
|
|
227
|
+
const t = R.current;
|
|
228
228
|
if (!t)
|
|
229
229
|
return;
|
|
230
230
|
const n = (r = t.children) == null ? void 0 : r[e];
|
|
231
231
|
if (n) {
|
|
232
|
-
const
|
|
233
|
-
t.scrollTo({ top:
|
|
232
|
+
const s = t.getBoundingClientRect().top, l = n.getBoundingClientRect().top - s + t.scrollTop;
|
|
233
|
+
t.scrollTo({ top: l - 20, behavior: "smooth" });
|
|
234
234
|
}
|
|
235
|
-
}, [
|
|
236
|
-
const
|
|
237
|
-
return /* @__PURE__ */
|
|
235
|
+
}, [w, E, y, W]);
|
|
236
|
+
const ne = S ? I ?? 0 : Ce, p = j || 156, M = p > 0 ? ne / p * 100 : 0, We = Math.round(ne);
|
|
237
|
+
return /* @__PURE__ */ a("div", { style: {
|
|
238
238
|
display: "flex",
|
|
239
239
|
flexDirection: "column",
|
|
240
240
|
gap: 16
|
|
241
241
|
}, children: [
|
|
242
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ a("div", { style: {
|
|
243
243
|
display: "flex",
|
|
244
244
|
alignItems: "center",
|
|
245
245
|
gap: 16,
|
|
@@ -261,7 +261,7 @@ const Ne = He(function({
|
|
|
261
261
|
color: "var(--Grey-Strong, #2E3236)"
|
|
262
262
|
}, children: "Recording" })
|
|
263
263
|
] }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ a("div", { style: {
|
|
265
265
|
display: "flex",
|
|
266
266
|
padding: 24,
|
|
267
267
|
flexDirection: "column",
|
|
@@ -271,19 +271,19 @@ const Ne = He(function({
|
|
|
271
271
|
border: "1px solid var(--Grey-absent, #D9D9D9)",
|
|
272
272
|
background: "var(--Grey-White, #FFF)"
|
|
273
273
|
}, children: [
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ a("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
275
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24 }, children: [
|
|
276
|
+
/* @__PURE__ */ a("span", { style: {
|
|
277
277
|
fontSize: 14,
|
|
278
278
|
fontWeight: 500,
|
|
279
279
|
color: "var(--Grey-Strong, #2E3236)",
|
|
280
280
|
lineHeight: 1.2
|
|
281
281
|
}, children: [
|
|
282
|
-
|
|
282
|
+
A,
|
|
283
283
|
" / ",
|
|
284
|
-
|
|
284
|
+
B
|
|
285
285
|
] }),
|
|
286
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
287
287
|
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" }),
|
|
288
288
|
/* @__PURE__ */ o("button", { onClick: Re, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
|
|
289
289
|
/* @__PURE__ */ o("button", { onClick: we, style: {
|
|
@@ -297,15 +297,15 @@ const Ne = He(function({
|
|
|
297
297
|
display: "flex",
|
|
298
298
|
alignItems: "center",
|
|
299
299
|
justifyContent: "center"
|
|
300
|
-
}, children: y ? /* @__PURE__ */ o($e, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ o(
|
|
301
|
-
/* @__PURE__ */ o("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(
|
|
300
|
+
}, children: y ? /* @__PURE__ */ o($e, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ o(Le, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
|
|
301
|
+
/* @__PURE__ */ o("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ o(je, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
|
|
302
302
|
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" })
|
|
303
303
|
] }),
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ a("div", { style: { position: "relative" }, children: [
|
|
305
|
+
/* @__PURE__ */ a(
|
|
306
306
|
"button",
|
|
307
307
|
{
|
|
308
|
-
onClick: () =>
|
|
308
|
+
onClick: () => te((e) => !e),
|
|
309
309
|
style: {
|
|
310
310
|
background: "var(--Grey-White, #FFF)",
|
|
311
311
|
border: "1px solid var(--Grey-absent, #D9D9D9)",
|
|
@@ -325,7 +325,7 @@ const Ne = He(function({
|
|
|
325
325
|
gap: 4
|
|
326
326
|
},
|
|
327
327
|
children: [
|
|
328
|
-
|
|
328
|
+
L,
|
|
329
329
|
"x",
|
|
330
330
|
/* @__PURE__ */ o(_e, { size: 12, color: "#808183" })
|
|
331
331
|
]
|
|
@@ -343,7 +343,7 @@ const Ne = He(function({
|
|
|
343
343
|
zIndex: 10,
|
|
344
344
|
overflow: "hidden",
|
|
345
345
|
minWidth: 80
|
|
346
|
-
}, children: Ke.map((e) => /* @__PURE__ */
|
|
346
|
+
}, children: Ke.map((e) => /* @__PURE__ */ a(
|
|
347
347
|
"button",
|
|
348
348
|
{
|
|
349
349
|
onClick: () => De(e),
|
|
@@ -352,10 +352,10 @@ const Ne = He(function({
|
|
|
352
352
|
width: "100%",
|
|
353
353
|
padding: "8px 12px",
|
|
354
354
|
border: "none",
|
|
355
|
-
background:
|
|
355
|
+
background: L === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
|
|
356
356
|
cursor: "pointer",
|
|
357
357
|
fontSize: 13,
|
|
358
|
-
fontWeight:
|
|
358
|
+
fontWeight: L === e ? 600 : 400,
|
|
359
359
|
color: "var(--Grey-Strong, #2E3236)",
|
|
360
360
|
fontFamily: "var(--font-sans)",
|
|
361
361
|
textAlign: "left"
|
|
@@ -369,8 +369,8 @@ const Ne = He(function({
|
|
|
369
369
|
)) })
|
|
370
370
|
] })
|
|
371
371
|
] }),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
373
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
374
374
|
/* @__PURE__ */ o("span", { style: {
|
|
375
375
|
fontSize: 13,
|
|
376
376
|
fontWeight: 500,
|
|
@@ -378,13 +378,13 @@ const Ne = He(function({
|
|
|
378
378
|
fontFamily: "var(--font-sans)",
|
|
379
379
|
lineHeight: 1.2,
|
|
380
380
|
minWidth: 60
|
|
381
|
-
}, children: se(
|
|
382
|
-
/* @__PURE__ */
|
|
381
|
+
}, children: se(p) }),
|
|
382
|
+
/* @__PURE__ */ a(
|
|
383
383
|
"div",
|
|
384
384
|
{
|
|
385
385
|
onClick: (e) => {
|
|
386
386
|
const t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, r = Math.max(0, Math.min(1, n / t.width));
|
|
387
|
-
|
|
387
|
+
T(r * p);
|
|
388
388
|
},
|
|
389
389
|
style: {
|
|
390
390
|
flex: 1,
|
|
@@ -409,7 +409,7 @@ const Ne = He(function({
|
|
|
409
409
|
left: 0,
|
|
410
410
|
top: "50%",
|
|
411
411
|
transform: "translateY(-50%)",
|
|
412
|
-
width: `${
|
|
412
|
+
width: `${M}%`,
|
|
413
413
|
height: 4,
|
|
414
414
|
borderRadius: 2,
|
|
415
415
|
background: "var(--Green-Primary, #00925F)",
|
|
@@ -425,7 +425,7 @@ const Ne = He(function({
|
|
|
425
425
|
xmlns: "http://www.w3.org/2000/svg",
|
|
426
426
|
style: {
|
|
427
427
|
position: "absolute",
|
|
428
|
-
left: `${
|
|
428
|
+
left: `${M}%`,
|
|
429
429
|
top: "50%",
|
|
430
430
|
transform: "translate(-50%, -50%)",
|
|
431
431
|
pointerEvents: "none"
|
|
@@ -445,13 +445,16 @@ const Ne = He(function({
|
|
|
445
445
|
}
|
|
446
446
|
)
|
|
447
447
|
] }),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
[
|
|
450
|
-
const n = t === 0, r =
|
|
451
|
-
|
|
452
|
-
|
|
448
|
+
/* @__PURE__ */ a("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
|
|
449
|
+
[A, B].map((e, t) => {
|
|
450
|
+
const n = t === 0, r = (i) => {
|
|
451
|
+
const l = (i.actor || "").toLowerCase(), m = (i.actorRole || i.role || i.type || "").toLowerCase();
|
|
452
|
+
return n ? l === A.toLowerCase() || l === "agent" || m === "agent" : l === B.toLowerCase() || l === "customer" || m === "customer";
|
|
453
|
+
}, s = b != null && b.length ? b.filter(r).map((i) => ({
|
|
454
|
+
start: p > 0 ? i.startTime / p : 0,
|
|
455
|
+
end: p > 0 ? i.endTime / p : 0
|
|
453
456
|
})) : qe[n ? "Agent" : "Customer"] || [];
|
|
454
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ a("div", { style: {
|
|
455
458
|
display: "flex",
|
|
456
459
|
alignItems: "center",
|
|
457
460
|
gap: 8,
|
|
@@ -466,12 +469,12 @@ const Ne = He(function({
|
|
|
466
469
|
lineHeight: 1.2,
|
|
467
470
|
minWidth: 60
|
|
468
471
|
}, children: e }),
|
|
469
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ a(
|
|
470
473
|
"div",
|
|
471
474
|
{
|
|
472
475
|
onClick: (i) => {
|
|
473
|
-
const
|
|
474
|
-
|
|
476
|
+
const l = i.currentTarget.getBoundingClientRect(), m = Math.max(0, Math.min(1, (i.clientX - l.left) / l.width));
|
|
477
|
+
T(m * p);
|
|
475
478
|
},
|
|
476
479
|
style: {
|
|
477
480
|
flex: 1,
|
|
@@ -491,7 +494,7 @@ const Ne = He(function({
|
|
|
491
494
|
borderRadius: 2,
|
|
492
495
|
background: "var(--rail-surface-2, #E3E1D7)"
|
|
493
496
|
} }),
|
|
494
|
-
|
|
497
|
+
s.map((i, l) => /* @__PURE__ */ o("div", { style: {
|
|
495
498
|
position: "absolute",
|
|
496
499
|
left: `${i.start * 100}%`,
|
|
497
500
|
width: `${(i.end - i.start) * 100}%`,
|
|
@@ -499,13 +502,13 @@ const Ne = He(function({
|
|
|
499
502
|
bottom: 0,
|
|
500
503
|
borderRadius: 3,
|
|
501
504
|
background: n ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
|
|
502
|
-
} },
|
|
505
|
+
} }, l))
|
|
503
506
|
]
|
|
504
507
|
}
|
|
505
508
|
)
|
|
506
509
|
] }, e);
|
|
507
510
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ a("div", { style: {
|
|
509
512
|
position: "absolute",
|
|
510
513
|
left: 68,
|
|
511
514
|
/* 60 label + 8 gap */
|
|
@@ -516,7 +519,7 @@ const Ne = He(function({
|
|
|
516
519
|
}, children: [
|
|
517
520
|
/* @__PURE__ */ o("div", { style: {
|
|
518
521
|
position: "absolute",
|
|
519
|
-
left: `${
|
|
522
|
+
left: `${M}%`,
|
|
520
523
|
top: 0,
|
|
521
524
|
height: 44,
|
|
522
525
|
transform: "translateX(-50%)",
|
|
@@ -525,7 +528,7 @@ const Ne = He(function({
|
|
|
525
528
|
} }),
|
|
526
529
|
/* @__PURE__ */ o("div", { style: {
|
|
527
530
|
position: "absolute",
|
|
528
|
-
left: `${
|
|
531
|
+
left: `${M}%`,
|
|
529
532
|
bottom: 0,
|
|
530
533
|
transform: "translateX(-50%)",
|
|
531
534
|
background: "var(--Grey-Strong, #2E3236)",
|
|
@@ -539,11 +542,11 @@ const Ne = He(function({
|
|
|
539
542
|
}, children: se(We) })
|
|
540
543
|
] })
|
|
541
544
|
] }),
|
|
542
|
-
|
|
543
|
-
|
|
545
|
+
d && /* @__PURE__ */ o("audio", { ref: f, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: u, type: "audio/mpeg" }) }),
|
|
546
|
+
c && u && /* @__PURE__ */ o("audio", { ref: Q, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ o("source", { src: u, type: "audio/mpeg" }) })
|
|
544
547
|
] })
|
|
545
548
|
] }),
|
|
546
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ a("div", { style: {
|
|
547
550
|
width: "100%",
|
|
548
551
|
display: "flex",
|
|
549
552
|
flexDirection: "column",
|
|
@@ -558,19 +561,19 @@ const Ne = He(function({
|
|
|
558
561
|
color: "var(--Grey-Strong, #2E3236)",
|
|
559
562
|
lineHeight: 1.2
|
|
560
563
|
}, children: "Transcript" }) }),
|
|
561
|
-
/* @__PURE__ */ o("div", { id: "transcript-container", ref:
|
|
564
|
+
/* @__PURE__ */ o("div", { id: "transcript-container", ref: R, style: {
|
|
562
565
|
display: "flex",
|
|
563
566
|
flexDirection: "column",
|
|
564
567
|
maxHeight: 600,
|
|
565
568
|
overflowY: "auto"
|
|
566
|
-
}, children: (
|
|
569
|
+
}, children: (W || z.map((e) => ({
|
|
567
570
|
actor: e.speaker,
|
|
568
571
|
actorType: e.type,
|
|
569
572
|
text: e.text,
|
|
570
573
|
timeRange: e.time
|
|
571
574
|
}))).map((e, t) => {
|
|
572
|
-
const n = !!
|
|
573
|
-
return /* @__PURE__ */
|
|
575
|
+
const n = !!W, r = Fe === t, s = n ? y && w === t : t === E && y, i = s || r, l = (e.actorType || e.type) === "customer";
|
|
576
|
+
return /* @__PURE__ */ a("div", { style: {
|
|
574
577
|
display: "flex",
|
|
575
578
|
padding: 16,
|
|
576
579
|
flexDirection: "column",
|
|
@@ -578,9 +581,9 @@ const Ne = He(function({
|
|
|
578
581
|
gap: 16,
|
|
579
582
|
alignSelf: "stretch",
|
|
580
583
|
borderTop: t > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
|
|
581
|
-
background:
|
|
584
|
+
background: i ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
|
|
582
585
|
}, children: [
|
|
583
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ a("div", { style: {
|
|
584
587
|
display: "flex",
|
|
585
588
|
alignItems: "center",
|
|
586
589
|
justifyContent: "space-between",
|
|
@@ -591,10 +594,10 @@ const Ne = He(function({
|
|
|
591
594
|
fontSize: 14,
|
|
592
595
|
fontWeight: 600,
|
|
593
596
|
lineHeight: 1.2,
|
|
594
|
-
color:
|
|
597
|
+
color: l ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
|
|
595
598
|
}, children: e.actor }),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
|
|
599
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
600
|
+
s && /* @__PURE__ */ a(ze, { children: [
|
|
598
601
|
/* @__PURE__ */ o(ie, { size: 12, color: "#2E3236" }),
|
|
599
602
|
/* @__PURE__ */ o(ie, { size: 12, color: "#2E3236" })
|
|
600
603
|
] }),
|
|
@@ -606,12 +609,12 @@ const Ne = He(function({
|
|
|
606
609
|
}, children: e.timeRange })
|
|
607
610
|
] })
|
|
608
611
|
] }),
|
|
609
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
|
|
610
613
|
/* @__PURE__ */ o(
|
|
611
614
|
"button",
|
|
612
615
|
{
|
|
613
616
|
onClick: () => {
|
|
614
|
-
n &&
|
|
617
|
+
n && O ? O(e, t) : Ee(t);
|
|
615
618
|
},
|
|
616
619
|
style: {
|
|
617
620
|
background: "none",
|
|
@@ -621,7 +624,7 @@ const Ne = He(function({
|
|
|
621
624
|
flexShrink: 0,
|
|
622
625
|
display: "flex"
|
|
623
626
|
},
|
|
624
|
-
children:
|
|
627
|
+
children: s ? /* @__PURE__ */ o(Xe, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ o(Ye, { size: 17, color: "#808183", strokeWidth: 1 })
|
|
625
628
|
}
|
|
626
629
|
),
|
|
627
630
|
/* @__PURE__ */ o("p", { style: {
|