chordia-ui 3.4.2 → 3.4.3
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/Timeline.cjs.js +6 -1
- package/dist/Timeline.cjs.js.map +1 -1
- package/dist/Timeline.es.js +597 -129
- package/dist/Timeline.es.js.map +1 -1
- package/dist/UpdatedInteractionRecording.cjs.js +1 -1
- package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
- package/dist/UpdatedInteractionRecording.es.js +260 -258
- package/dist/UpdatedInteractionRecording.es.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js +2 -2
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +349 -322
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/components/media.cjs.js +1 -1
- package/dist/components/media.cjs.js.map +1 -1
- package/dist/components/media.es.js +8 -9
- package/dist/components/media.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +52 -53
- package/dist/index.es.js.map +1 -1
- package/dist/pages/interactionDetails.cjs.js +2 -2
- package/dist/pages/interactionDetails.cjs.js.map +1 -1
- package/dist/pages/interactionDetails.es.js +16 -17
- package/dist/pages/interactionDetails.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +35 -1
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +142 -124
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionSignals.jsx +14 -6
- package/dist/TranscriptCard.cjs.js +0 -7
- package/dist/TranscriptCard.cjs.js.map +0 -1
- package/dist/TranscriptCard.es.js +0 -474
- package/dist/TranscriptCard.es.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as Ee, useRef as
|
|
3
|
-
import { FileSignal as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return `${l}:${D.toString().padStart(2, "0")}`;
|
|
1
|
+
import { jsxs as i, jsx as r, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ee, useRef as P, useState as f, useCallback as re, useEffect as oe, 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 ie, PauseCircle as Be, PlayCircle as je } from "lucide-react";
|
|
4
|
+
function $(p) {
|
|
5
|
+
const d = Math.floor(p / 60), g = Math.round(p % 60);
|
|
6
|
+
return `${d}:${g.toString().padStart(2, "0")}`;
|
|
8
7
|
}
|
|
9
8
|
const Le = {
|
|
10
9
|
Agent: [
|
|
@@ -23,183 +22,185 @@ const Le = {
|
|
|
23
22
|
{ start: 0.6, end: 0.66 },
|
|
24
23
|
{ start: 0.74, end: 0.8 }
|
|
25
24
|
]
|
|
26
|
-
},
|
|
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
|
|
34
|
-
if (!
|
|
32
|
+
function ae(p) {
|
|
33
|
+
if (!p)
|
|
35
34
|
return 0;
|
|
36
|
-
const
|
|
37
|
-
return (
|
|
35
|
+
const d = p.split(":").map(Number);
|
|
36
|
+
return (d[0] || 0) * 60 + (d[1] || 0);
|
|
38
37
|
}
|
|
39
38
|
const Ke = Ee(function({
|
|
40
|
-
audioUrl:
|
|
41
|
-
timelineSegments:
|
|
42
|
-
durationSeconds:
|
|
39
|
+
audioUrl: d,
|
|
40
|
+
timelineSegments: g = [],
|
|
41
|
+
durationSeconds: R = 0,
|
|
43
42
|
// Parent-managed audio props (optional — if not provided, component manages its own audio)
|
|
44
|
-
currentTimeSeconds:
|
|
45
|
-
timelinePlaying:
|
|
46
|
-
playbackRate:
|
|
47
|
-
onSeek:
|
|
48
|
-
onTogglePlay:
|
|
49
|
-
onSeekBack:
|
|
50
|
-
onSeekForward:
|
|
51
|
-
onSetPlaybackRate:
|
|
52
|
-
audioRef:
|
|
43
|
+
currentTimeSeconds: se,
|
|
44
|
+
timelinePlaying: B,
|
|
45
|
+
playbackRate: le,
|
|
46
|
+
onSeek: j,
|
|
47
|
+
onTogglePlay: w,
|
|
48
|
+
onSeekBack: L,
|
|
49
|
+
onSeekForward: _,
|
|
50
|
+
onSetPlaybackRate: X,
|
|
51
|
+
audioRef: Y,
|
|
53
52
|
// Speaker names
|
|
54
|
-
agentName:
|
|
55
|
-
customerName:
|
|
53
|
+
agentName: T = "Agent",
|
|
54
|
+
customerName: G = "Customer",
|
|
56
55
|
// Transcript props
|
|
57
|
-
transcript:
|
|
58
|
-
highlightedTurns:
|
|
59
|
-
activeTurnIndex:
|
|
60
|
-
activeDemoIndex:
|
|
61
|
-
turnObservations:
|
|
62
|
-
setExpandedSignals:
|
|
63
|
-
onTurnPlayPause:
|
|
64
|
-
},
|
|
65
|
-
var
|
|
66
|
-
const
|
|
56
|
+
transcript: y,
|
|
57
|
+
highlightedTurns: ce = /* @__PURE__ */ new Set(),
|
|
58
|
+
activeTurnIndex: q,
|
|
59
|
+
activeDemoIndex: de = 1,
|
|
60
|
+
turnObservations: he = {},
|
|
61
|
+
setExpandedSignals: E,
|
|
62
|
+
onTurnPlayPause: K
|
|
63
|
+
}, ue) {
|
|
64
|
+
var ne;
|
|
65
|
+
const V = P(null), h = P(null), k = P(null), [Z, m] = f(!1), [W, J] = f(0), [fe, pe] = f(0), [ge, ye] = f(1), [I, me] = f(null), [ve, be] = f(1), [ke, C] = f(!1), [xe, N] = f(!1), [Q, M] = f(de), s = !!Y, x = !d, l = d && !s, F = x ? ke : s ? B ?? !1 : Z, Fe = x ? I ?? 0 : s ? se ?? 0 : W, z = x ? ve : s ? le ?? 1 : ge, H = x ? R || 156 : s ? R : fe || R || 0, A = re(() => {
|
|
67
66
|
const e = () => {
|
|
68
|
-
const
|
|
69
|
-
|
|
67
|
+
const t = h.current;
|
|
68
|
+
t && J(t.currentTime), k.current = requestAnimationFrame(e);
|
|
70
69
|
};
|
|
71
|
-
|
|
72
|
-
}, []),
|
|
73
|
-
|
|
70
|
+
k.current = requestAnimationFrame(e);
|
|
71
|
+
}, []), v = re(() => {
|
|
72
|
+
k.current && (cancelAnimationFrame(k.current), k.current = null);
|
|
74
73
|
}, []);
|
|
75
|
-
|
|
76
|
-
if (!
|
|
74
|
+
oe(() => () => v(), [v]), oe(() => {
|
|
75
|
+
if (!l)
|
|
77
76
|
return;
|
|
78
|
-
const e =
|
|
77
|
+
const e = h.current;
|
|
79
78
|
if (!e)
|
|
80
79
|
return;
|
|
81
|
-
const
|
|
82
|
-
|
|
80
|
+
const t = () => pe(e.duration || 0), n = () => {
|
|
81
|
+
m(!1), v();
|
|
83
82
|
};
|
|
84
|
-
return e.addEventListener("loadedmetadata",
|
|
85
|
-
e.removeEventListener("loadedmetadata",
|
|
83
|
+
return e.addEventListener("loadedmetadata", t), e.addEventListener("ended", n), () => {
|
|
84
|
+
e.removeEventListener("loadedmetadata", t), e.removeEventListener("ended", n);
|
|
86
85
|
};
|
|
87
|
-
}, [
|
|
86
|
+
}, [l, v]);
|
|
88
87
|
const O = (e) => {
|
|
89
|
-
for (let
|
|
90
|
-
const
|
|
91
|
-
if (e >=
|
|
92
|
-
return
|
|
88
|
+
for (let t = D.length - 1; t >= 0; t--) {
|
|
89
|
+
const n = ae(D[t].time);
|
|
90
|
+
if (e >= n)
|
|
91
|
+
return t;
|
|
93
92
|
}
|
|
94
93
|
return 0;
|
|
95
|
-
},
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
94
|
+
}, b = (e) => {
|
|
95
|
+
const n = Math.max(0, Math.min(e, H || 156));
|
|
96
|
+
if (l) {
|
|
97
|
+
const o = h.current;
|
|
98
|
+
o && (o.currentTime = n), J(n);
|
|
100
99
|
} else
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
if (
|
|
105
|
-
const e =
|
|
100
|
+
s && j && j(n);
|
|
101
|
+
me(n), M(O(n));
|
|
102
|
+
}, Se = () => {
|
|
103
|
+
if (l) {
|
|
104
|
+
const e = h.current;
|
|
106
105
|
if (!e)
|
|
107
106
|
return;
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
Z ? (e.pause(), v(), m(!1)) : e.play().then(() => {
|
|
108
|
+
m(!0), A();
|
|
110
109
|
}).catch(() => {
|
|
111
110
|
});
|
|
112
111
|
} else
|
|
113
|
-
|
|
112
|
+
s && w ? w() : C((e) => !e);
|
|
113
|
+
}, we = () => {
|
|
114
|
+
s && L ? L() : b(Math.max(0, (l ? W : I ?? 0) - 10));
|
|
114
115
|
}, Ie = () => {
|
|
115
|
-
|
|
116
|
-
}, Ce = () => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const n = c.current;
|
|
121
|
-
n && (n.playbackRate = e), ye(e);
|
|
116
|
+
s && _ ? _() : b(Math.min(H || 156, (l ? W : I ?? 0) + 10));
|
|
117
|
+
}, Ce = (e) => {
|
|
118
|
+
if (l) {
|
|
119
|
+
const t = h.current;
|
|
120
|
+
t && (t.playbackRate = e), ye(e);
|
|
122
121
|
} else
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
s && X && X(e);
|
|
123
|
+
be(e), N(!1);
|
|
125
124
|
};
|
|
126
|
-
|
|
125
|
+
We(ue, () => ({
|
|
127
126
|
seekTo: (e) => {
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
if (b(e), s)
|
|
128
|
+
!B && w && w();
|
|
129
|
+
else if (l) {
|
|
130
|
+
const n = h.current;
|
|
131
|
+
n && n.play().then(() => {
|
|
132
|
+
m(!0), A();
|
|
132
133
|
}).catch(() => {
|
|
133
134
|
});
|
|
134
135
|
} else
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
var
|
|
139
|
-
const
|
|
140
|
-
|
|
136
|
+
C(!0);
|
|
137
|
+
const t = O(e);
|
|
138
|
+
M(t), setTimeout(() => {
|
|
139
|
+
var o;
|
|
140
|
+
const n = (o = V.current) == null ? void 0 : o.children;
|
|
141
|
+
n != null && n[t] && n[t].scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
141
142
|
}, 50);
|
|
142
143
|
}
|
|
143
144
|
}));
|
|
144
|
-
const
|
|
145
|
-
var
|
|
146
|
-
if (
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
|
|
145
|
+
const De = (e) => {
|
|
146
|
+
var t;
|
|
147
|
+
if (Q === e && F) {
|
|
148
|
+
if (l) {
|
|
149
|
+
const n = h.current;
|
|
150
|
+
n && n.pause(), v(), m(!1);
|
|
150
151
|
}
|
|
151
|
-
|
|
152
|
+
C(!1);
|
|
152
153
|
} else {
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
const n = ae((t = D[e]) == null ? void 0 : t.time);
|
|
155
|
+
if (M(e), b(n), l) {
|
|
156
|
+
const o = h.current;
|
|
157
|
+
o && (o.currentTime = n, o.play().then(() => {
|
|
158
|
+
m(!0), A();
|
|
158
159
|
}).catch(() => {
|
|
159
160
|
}));
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
+
C(!0);
|
|
162
163
|
}
|
|
163
|
-
}, Re = (e,
|
|
164
|
+
}, Re = (e, t) => {
|
|
164
165
|
if (e == null)
|
|
165
166
|
return;
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
return `${
|
|
167
|
+
const n = (o) => {
|
|
168
|
+
const a = Math.floor(o / 6e4), c = Math.floor(o % 6e4 / 1e3);
|
|
169
|
+
return `${a.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}`;
|
|
169
170
|
};
|
|
170
|
-
return `${
|
|
171
|
-
},
|
|
172
|
-
var
|
|
171
|
+
return `${n(e)}–${t != null ? n(t) : n(e)}`;
|
|
172
|
+
}, U = (ne = y == null ? void 0 : y.messages) != null && ne.length ? y.messages.map((e, t) => {
|
|
173
|
+
var n, o;
|
|
173
174
|
return {
|
|
174
|
-
actor: e.actor === "agent" ? ((
|
|
175
|
+
actor: e.actor === "agent" ? ((n = y.actor_map) == null ? void 0 : n.agent) || "Agent" : ((o = y.actor_map) == null ? void 0 : o.customer) || "Customer",
|
|
175
176
|
actorType: e.actor === "agent" ? "agent" : "customer",
|
|
176
177
|
text: e.text || "",
|
|
177
178
|
timeRange: Re(e.start ?? e.start_ms, e.end ?? e.end_ms),
|
|
178
|
-
isHighlighted:
|
|
179
|
-
highlightColor:
|
|
180
|
-
observations: (
|
|
181
|
-
...
|
|
179
|
+
isHighlighted: ce.has(t),
|
|
180
|
+
highlightColor: F && q === t ? e.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
|
|
181
|
+
observations: (he[t] || []).map((a) => ({
|
|
182
|
+
...a,
|
|
182
183
|
onClick: () => {
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
E == null || E((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,
|
|
191
|
-
return /* @__PURE__ */
|
|
191
|
+
}) : null, ee = x ? I ?? 0 : Fe, u = H || 156, S = u > 0 ? ee / u * 100 : 0, te = Math.round(ee);
|
|
192
|
+
return /* @__PURE__ */ i("div", { style: {
|
|
192
193
|
display: "flex",
|
|
193
194
|
flexDirection: "column",
|
|
194
195
|
gap: 16
|
|
195
196
|
}, children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ i("div", { style: {
|
|
197
198
|
display: "flex",
|
|
198
199
|
alignItems: "center",
|
|
199
200
|
gap: 16,
|
|
200
201
|
width: "100%"
|
|
201
202
|
}, children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ r("div", { style: {
|
|
203
204
|
display: "flex",
|
|
204
205
|
alignItems: "center",
|
|
205
206
|
justifyContent: "center",
|
|
@@ -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__ */
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
}, children: /* @__PURE__ */ r(Me, { size: 20, color: "#2E3236", strokeWidth: 1.5 }) }),
|
|
213
|
+
/* @__PURE__ */ r("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__ */
|
|
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__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
237
|
+
T,
|
|
237
238
|
" / ",
|
|
238
|
-
|
|
239
|
+
G
|
|
239
240
|
] }),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
242
|
+
/* @__PURE__ */ r("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" }),
|
|
243
|
+
/* @__PURE__ */ r("button", { onClick: we, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ r(ze, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
|
|
244
|
+
/* @__PURE__ */ r("button", { onClick: Se, 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:
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
255
|
+
}, children: F ? /* @__PURE__ */ r(He, { size: 14, color: "#FFF", fill: "#FFF" }) : /* @__PURE__ */ r(Ae, { size: 14, color: "#FFF", fill: "#FFF", strokeWidth: 1.5, style: { marginLeft: 2 } }) }),
|
|
256
|
+
/* @__PURE__ */ r("button", { onClick: Ie, style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ r(Pe, { size: 20, color: "#808183", strokeWidth: 1.5 }) }),
|
|
257
|
+
/* @__PURE__ */ r("span", { style: { fontSize: 13, fontWeight: 400, color: "var(--Grey-Muted, #808183)", lineHeight: 1.2 }, children: "10" })
|
|
257
258
|
] }),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
|
|
260
|
+
/* @__PURE__ */ i(
|
|
260
261
|
"button",
|
|
261
262
|
{
|
|
262
|
-
onClick: () =>
|
|
263
|
+
onClick: () => N((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
|
-
|
|
283
|
+
z,
|
|
283
284
|
"x",
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ r($e, { size: 12, color: "#808183" })
|
|
285
286
|
]
|
|
286
287
|
}
|
|
287
288
|
),
|
|
288
|
-
|
|
289
|
+
xe && /* @__PURE__ */ r("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__ */
|
|
301
|
+
}, children: _e.map((e) => /* @__PURE__ */ i(
|
|
301
302
|
"button",
|
|
302
303
|
{
|
|
303
|
-
onClick: () =>
|
|
304
|
+
onClick: () => Ce(e),
|
|
304
305
|
style: {
|
|
305
306
|
display: "block",
|
|
306
307
|
width: "100%",
|
|
307
308
|
padding: "8px 12px",
|
|
308
309
|
border: "none",
|
|
309
|
-
background:
|
|
310
|
+
background: z === e ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)",
|
|
310
311
|
cursor: "pointer",
|
|
311
312
|
fontSize: 13,
|
|
312
|
-
fontWeight:
|
|
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
|
-
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
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: [
|
|
343
|
-
/* @__PURE__ */ o("span", { style: {
|
|
327
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
328
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
329
|
+
/* @__PURE__ */ r("span", { style: {
|
|
344
330
|
fontSize: 13,
|
|
345
331
|
fontWeight: 600,
|
|
346
|
-
color:
|
|
332
|
+
color: S > 0 ? "var(--Green-Primary, #00925F)" : "var(--Grey-Strong, #2E3236)",
|
|
347
333
|
fontFamily: "var(--font-sans)",
|
|
348
334
|
lineHeight: 1.2,
|
|
349
335
|
minWidth: 60
|
|
350
|
-
}, children:
|
|
351
|
-
/* @__PURE__ */
|
|
336
|
+
}, children: $(te) }),
|
|
337
|
+
/* @__PURE__ */ i(
|
|
352
338
|
"div",
|
|
353
339
|
{
|
|
354
340
|
onClick: (e) => {
|
|
355
|
-
const
|
|
356
|
-
|
|
341
|
+
const t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, o = Math.max(0, Math.min(1, n / t.width));
|
|
342
|
+
b(o * u);
|
|
357
343
|
},
|
|
358
344
|
style: {
|
|
359
345
|
flex: 1,
|
|
@@ -364,7 +350,7 @@ const Ke = Ee(function({
|
|
|
364
350
|
cursor: "pointer"
|
|
365
351
|
},
|
|
366
352
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ r("div", { style: {
|
|
368
354
|
position: "absolute",
|
|
369
355
|
left: 0,
|
|
370
356
|
right: 0,
|
|
@@ -373,18 +359,18 @@ const Ke = Ee(function({
|
|
|
373
359
|
background: "var(--rail-surface-2, #E3E1D7)",
|
|
374
360
|
pointerEvents: "none"
|
|
375
361
|
} }),
|
|
376
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ r("div", { style: {
|
|
377
363
|
position: "absolute",
|
|
378
364
|
left: 0,
|
|
379
365
|
top: "50%",
|
|
380
366
|
transform: "translateY(-50%)",
|
|
381
|
-
width: `${
|
|
367
|
+
width: `${S}%`,
|
|
382
368
|
height: 4,
|
|
383
369
|
borderRadius: 2,
|
|
384
370
|
background: "var(--Green-Primary, #00925F)",
|
|
385
371
|
pointerEvents: "none"
|
|
386
372
|
} }),
|
|
387
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ r(
|
|
388
374
|
"svg",
|
|
389
375
|
{
|
|
390
376
|
width: "16",
|
|
@@ -394,12 +380,12 @@ const Ke = Ee(function({
|
|
|
394
380
|
xmlns: "http://www.w3.org/2000/svg",
|
|
395
381
|
style: {
|
|
396
382
|
position: "absolute",
|
|
397
|
-
left: `${
|
|
383
|
+
left: `${S}%`,
|
|
398
384
|
top: "50%",
|
|
399
385
|
transform: "translate(-50%, -50%)",
|
|
400
386
|
pointerEvents: "none"
|
|
401
387
|
},
|
|
402
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ r(
|
|
403
389
|
"path",
|
|
404
390
|
{
|
|
405
391
|
d: "M7.875 1C11.6572 1 14.75 4.1191 14.75 8C14.75 11.8809 11.6572 15 7.875 15C4.09284 15 1 11.8809 1 8C1 4.1191 4.09284 1 7.875 1Z",
|
|
@@ -409,66 +395,82 @@ const Ke = Ee(function({
|
|
|
409
395
|
}
|
|
410
396
|
)
|
|
411
397
|
}
|
|
412
|
-
)
|
|
398
|
+
),
|
|
399
|
+
/* @__PURE__ */ r("span", { style: {
|
|
400
|
+
position: "absolute",
|
|
401
|
+
right: -48,
|
|
402
|
+
fontSize: 13,
|
|
403
|
+
fontWeight: 400,
|
|
404
|
+
color: "var(--Grey-Muted, #808183)",
|
|
405
|
+
fontFamily: "var(--font-sans)",
|
|
406
|
+
lineHeight: 1.2,
|
|
407
|
+
whiteSpace: "nowrap"
|
|
408
|
+
}, children: $(u) })
|
|
413
409
|
]
|
|
414
410
|
}
|
|
415
411
|
)
|
|
416
412
|
] }),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
[
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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,
|
|
413
|
+
/* @__PURE__ */ i("div", { style: { position: "relative", paddingBottom: 30, cursor: "pointer" }, children: [
|
|
414
|
+
[T, G].map((e, t) => {
|
|
415
|
+
const n = t === 0, o = g != null && g.length ? g.filter((a) => n ? a.actor === T : a.actor === G).map((a) => ({
|
|
416
|
+
start: u > 0 ? a.startTime / u : 0,
|
|
417
|
+
end: u > 0 ? a.endTime / u : 0
|
|
418
|
+
})) : Le[n ? "Agent" : "Customer"] || [];
|
|
419
|
+
return /* @__PURE__ */ i("div", { style: {
|
|
420
|
+
display: "flex",
|
|
421
|
+
alignItems: "center",
|
|
422
|
+
gap: 8,
|
|
423
|
+
height: 20,
|
|
424
|
+
marginBottom: t === 0 ? 4 : 0
|
|
425
|
+
}, children: [
|
|
426
|
+
/* @__PURE__ */ r("span", { style: {
|
|
427
|
+
fontSize: 13,
|
|
428
|
+
fontWeight: 400,
|
|
429
|
+
color: "var(--Grey-Muted, #808183)",
|
|
430
|
+
fontFamily: "var(--font-sans)",
|
|
431
|
+
lineHeight: 1.2,
|
|
432
|
+
minWidth: 60
|
|
433
|
+
}, children: e }),
|
|
434
|
+
/* @__PURE__ */ i(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
onClick: (a) => {
|
|
438
|
+
const c = a.currentTarget.getBoundingClientRect(), Te = Math.max(0, Math.min(1, (a.clientX - c.left) / c.width));
|
|
439
|
+
b(Te * u);
|
|
440
|
+
},
|
|
441
|
+
style: {
|
|
442
|
+
flex: 1,
|
|
443
|
+
height: 6,
|
|
444
|
+
position: "relative",
|
|
464
445
|
borderRadius: 3,
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
446
|
+
cursor: "pointer"
|
|
447
|
+
},
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ r("div", { style: {
|
|
450
|
+
position: "absolute",
|
|
451
|
+
left: 0,
|
|
452
|
+
right: 0,
|
|
453
|
+
top: "50%",
|
|
454
|
+
transform: "translateY(-50%)",
|
|
455
|
+
height: 4,
|
|
456
|
+
borderRadius: 2,
|
|
457
|
+
background: "var(--rail-surface-2, #E3E1D7)"
|
|
458
|
+
} }),
|
|
459
|
+
o.map((a, c) => /* @__PURE__ */ r("div", { style: {
|
|
460
|
+
position: "absolute",
|
|
461
|
+
left: `${a.start * 100}%`,
|
|
462
|
+
width: `${(a.end - a.start) * 100}%`,
|
|
463
|
+
top: 0,
|
|
464
|
+
bottom: 0,
|
|
465
|
+
borderRadius: 3,
|
|
466
|
+
background: n ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
|
|
467
|
+
} }, c))
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
] }, e);
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ i("div", { style: {
|
|
472
474
|
position: "absolute",
|
|
473
475
|
left: 68,
|
|
474
476
|
/* 60 label + 8 gap */
|
|
@@ -477,19 +479,18 @@ const Ke = Ee(function({
|
|
|
477
479
|
bottom: 0,
|
|
478
480
|
pointerEvents: "none"
|
|
479
481
|
}, children: [
|
|
480
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ r("div", { style: {
|
|
481
483
|
position: "absolute",
|
|
482
|
-
left: `${
|
|
484
|
+
left: `${S}%`,
|
|
483
485
|
top: 0,
|
|
484
486
|
height: 44,
|
|
485
|
-
/* spans both rows */
|
|
486
487
|
transform: "translateX(-50%)",
|
|
487
488
|
borderLeft: "1.5px dashed var(--Grey-Muted, #808183)",
|
|
488
489
|
opacity: 0.5
|
|
489
490
|
} }),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ r("div", { style: {
|
|
491
492
|
position: "absolute",
|
|
492
|
-
left: `${
|
|
493
|
+
left: `${S}%`,
|
|
493
494
|
bottom: 0,
|
|
494
495
|
transform: "translateX(-50%)",
|
|
495
496
|
background: "var(--Grey-Strong, #2E3236)",
|
|
@@ -500,68 +501,69 @@ const Ke = Ee(function({
|
|
|
500
501
|
padding: "4px 6px",
|
|
501
502
|
borderRadius: 4,
|
|
502
503
|
whiteSpace: "nowrap"
|
|
503
|
-
}, children:
|
|
504
|
+
}, children: $(te) })
|
|
504
505
|
] })
|
|
505
506
|
] }),
|
|
506
|
-
|
|
507
|
+
l && /* @__PURE__ */ r("audio", { ref: h, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ r("source", { src: d, type: "audio/mpeg" }) }),
|
|
508
|
+
s && d && /* @__PURE__ */ r("audio", { ref: Y, preload: "auto", style: { display: "none" }, children: /* @__PURE__ */ r("source", { src: d, type: "audio/mpeg" }) })
|
|
507
509
|
] })
|
|
508
510
|
] }),
|
|
509
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ i("div", { style: {
|
|
510
512
|
width: "100%",
|
|
511
513
|
display: "flex",
|
|
512
514
|
flexDirection: "column",
|
|
513
515
|
gap: 16
|
|
514
516
|
}, children: [
|
|
515
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ r("div", { style: {
|
|
516
518
|
borderBottom: "1px solid var(--Grey-absent, #D9D9D9)",
|
|
517
519
|
paddingBottom: 16
|
|
518
|
-
}, children: /* @__PURE__ */
|
|
520
|
+
}, children: /* @__PURE__ */ r("span", { style: {
|
|
519
521
|
fontSize: 14,
|
|
520
522
|
fontWeight: 400,
|
|
521
523
|
color: "var(--Grey-Strong, #2E3236)",
|
|
522
524
|
lineHeight: 1.2
|
|
523
525
|
}, children: "Transcript" }) }),
|
|
524
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ r("div", { id: "transcript-container", ref: V, style: {
|
|
525
527
|
display: "flex",
|
|
526
528
|
flexDirection: "column",
|
|
527
529
|
maxHeight: 600,
|
|
528
530
|
overflowY: "auto"
|
|
529
|
-
}, children: (
|
|
531
|
+
}, children: (U || D.map((e) => ({
|
|
530
532
|
actor: e.speaker,
|
|
531
533
|
actorType: e.type,
|
|
532
534
|
text: e.text,
|
|
533
535
|
timeRange: e.time
|
|
534
|
-
}))).map((e,
|
|
535
|
-
const
|
|
536
|
-
return /* @__PURE__ */
|
|
536
|
+
}))).map((e, t) => {
|
|
537
|
+
const n = !!U, o = n ? F && q === t : t === Q && F, a = (e.actorType || e.type) === "customer";
|
|
538
|
+
return /* @__PURE__ */ i("div", { style: {
|
|
537
539
|
display: "flex",
|
|
538
540
|
padding: 16,
|
|
539
541
|
flexDirection: "column",
|
|
540
542
|
alignItems: "flex-start",
|
|
541
543
|
gap: 16,
|
|
542
544
|
alignSelf: "stretch",
|
|
543
|
-
borderTop:
|
|
544
|
-
background:
|
|
545
|
+
borderTop: t > 0 ? "1px solid var(--Grey-absent, #D9D9D9)" : "none",
|
|
546
|
+
background: o ? "var(--surface-hover, #F3F7F7)" : "var(--Grey-White, #FFF)"
|
|
545
547
|
}, children: [
|
|
546
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ i("div", { style: {
|
|
547
549
|
display: "flex",
|
|
548
550
|
alignItems: "center",
|
|
549
551
|
justifyContent: "space-between",
|
|
550
552
|
width: "100%",
|
|
551
553
|
gap: 8
|
|
552
554
|
}, children: [
|
|
553
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ r("span", { style: {
|
|
554
556
|
fontSize: 14,
|
|
555
557
|
fontWeight: 600,
|
|
556
558
|
lineHeight: 1.2,
|
|
557
|
-
color:
|
|
559
|
+
color: a ? "var(--Grey-Strong, #2E3236)" : "var(--Grey-Muted, #808183)"
|
|
558
560
|
}, children: e.actor }),
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
562
|
+
o && /* @__PURE__ */ i(Ge, { children: [
|
|
563
|
+
/* @__PURE__ */ r(ie, { size: 12, color: "#2E3236" }),
|
|
564
|
+
/* @__PURE__ */ r(ie, { size: 12, color: "#2E3236" })
|
|
563
565
|
] }),
|
|
564
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ r("span", { style: {
|
|
565
567
|
fontSize: 13,
|
|
566
568
|
fontWeight: 400,
|
|
567
569
|
lineHeight: 1.2,
|
|
@@ -569,12 +571,12 @@ const Ke = Ee(function({
|
|
|
569
571
|
}, children: e.timeRange })
|
|
570
572
|
] })
|
|
571
573
|
] }),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", gap: 8, width: "100%" }, children: [
|
|
575
|
+
/* @__PURE__ */ r(
|
|
574
576
|
"button",
|
|
575
577
|
{
|
|
576
578
|
onClick: () => {
|
|
577
|
-
|
|
579
|
+
n && K ? K(e, t) : De(t);
|
|
578
580
|
},
|
|
579
581
|
style: {
|
|
580
582
|
background: "none",
|
|
@@ -584,10 +586,10 @@ const Ke = Ee(function({
|
|
|
584
586
|
flexShrink: 0,
|
|
585
587
|
display: "flex"
|
|
586
588
|
},
|
|
587
|
-
children:
|
|
589
|
+
children: o ? /* @__PURE__ */ r(Be, { size: 17, color: "#2E3236", strokeWidth: 1.5 }) : /* @__PURE__ */ r(je, { size: 17, color: "#808183", strokeWidth: 1 })
|
|
588
590
|
}
|
|
589
591
|
),
|
|
590
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ r("p", { style: {
|
|
591
593
|
fontSize: 13,
|
|
592
594
|
fontWeight: 400,
|
|
593
595
|
color: "var(--Grey-Strong, #2E3236)",
|
|
@@ -596,7 +598,7 @@ const Ke = Ee(function({
|
|
|
596
598
|
flex: 1
|
|
597
599
|
}, children: e.text })
|
|
598
600
|
] })
|
|
599
|
-
] },
|
|
601
|
+
] }, t);
|
|
600
602
|
}) })
|
|
601
603
|
] })
|
|
602
604
|
] })
|