chordia-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2126 @@
1
+ import { S as ze, D as K, T as He, C as Pe, f as Le, j as Fe, o as Oe } from "../Timeline.es.js";
2
+ import { a as kt, M as zt, O as wt, d as Ct, e as Tt, g as _t, h as It, i as Dt } from "../Timeline.es.js";
3
+ import { jsx as e, jsxs as n, Fragment as we } from "react/jsx-runtime";
4
+ import Ie, { useMemo as me, useState as k, useRef as pe, useEffect as ve } from "react";
5
+ import { UserCheck as Ae, User as $e, Play as je, ScrollText as Ke, TrendingUp as De, Lightbulb as Se, Building as Me, MessageSquareQuote as Ne, ChevronDown as be, MessageSquare as Ge, Zap as ke, Scale as Ve, FileText as qe, Target as Be, CheckCircle as Re, CornerDownRight as Ue, Clock as Ye, Send as Ze, ChevronRight as Je } from "lucide-react";
6
+ function Qe(t) {
7
+ return `${Math.floor(t / 6e4)}:${String(Math.floor(t % 6e4 / 1e3)).padStart(2, "0")}`;
8
+ }
9
+ function Ee({ ev: t, onPlay: a, onHighlight: c }) {
10
+ var r;
11
+ const l = t.actor === "agent" ? /* @__PURE__ */ e(Ae, { size: 11 }) : /* @__PURE__ */ e($e, { size: 11 });
12
+ return /* @__PURE__ */ n("div", { style: {
13
+ fontSize: "var(--text-sm)",
14
+ padding: "6px 10px",
15
+ borderRadius: "var(--radius-sm)",
16
+ background: "var(--paper-elevated)",
17
+ border: "1px solid var(--border)",
18
+ marginTop: 4
19
+ }, children: [
20
+ /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", gap: 5, marginBottom: 3 }, children: [
21
+ /* @__PURE__ */ e("span", { style: { color: "var(--text-muted)" }, children: l }),
22
+ t.source && /* @__PURE__ */ e("span", { style: { color: "var(--text-muted)", fontWeight: 500 }, children: t.source }),
23
+ /* @__PURE__ */ n("span", { style: { marginLeft: "auto", display: "flex", gap: 4, alignItems: "center" }, children: [
24
+ t.start_ms != null && /* @__PURE__ */ e(ze, { variant: "ghost", size: "sm", onClick: () => a(t.start_ms, t.end_ms), title: "Play audio", children: /* @__PURE__ */ e(je, { size: 10 }) }),
25
+ ((r = t.turn_ids) == null ? void 0 : r.length) > 0 && /* @__PURE__ */ e(ze, { variant: "ghost", size: "sm", onClick: () => c(t.turn_ids), title: "Show in transcript", children: /* @__PURE__ */ e(Ke, { size: 10 }) }),
26
+ t.start_ms != null && /* @__PURE__ */ e("span", { style: { fontSize: "var(--text-xs)", color: "var(--text-faint)" }, children: Qe(t.start_ms) })
27
+ ] })
28
+ ] }),
29
+ /* @__PURE__ */ n("div", { style: { color: "var(--text-base)", fontStyle: "italic", lineHeight: 1.4 }, children: [
30
+ '"',
31
+ (t.text || "").slice(0, 200),
32
+ '"'
33
+ ] })
34
+ ] });
35
+ }
36
+ function Xe({ outcomeLift: t }) {
37
+ var m, y;
38
+ if (t.lift == null) return null;
39
+ const a = t.p_expected, c = t.p_full, l = t.lift_raw ?? (c != null && a != null ? c - a : null), r = t.lift, p = (g) => g != null ? Math.round(g * 100) + "%" : "—", s = (g) => {
40
+ if (g == null) return "—";
41
+ const u = (g * 100).toFixed(1);
42
+ return g > 0 ? `+${u}pp` : `${u}pp`;
43
+ }, d = (g) => g > 0 ? "var(--state-present)" : g < 0 ? "#f87171" : "var(--text-muted)";
44
+ return /* @__PURE__ */ n(K, { title: /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
45
+ /* @__PURE__ */ e(De, { size: 12 }),
46
+ " Agent Lift Analysis"
47
+ ] }), children: [
48
+ /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 16 }, children: [
49
+ /* @__PURE__ */ n("div", { style: { textAlign: "center", flex: 1 }, children: [
50
+ /* @__PURE__ */ e("div", { style: { fontSize: 20, fontWeight: 600, color: "var(--text-faint)" }, children: p(a) }),
51
+ /* @__PURE__ */ e("div", { style: { fontSize: 10, color: "var(--text-faint)", marginTop: 2 }, children: "Expected Outcome" }),
52
+ /* @__PURE__ */ e("div", { style: { fontSize: 9, color: "var(--text-faint)", marginTop: 1 }, children: "Based on call type & difficulty" })
53
+ ] }),
54
+ /* @__PURE__ */ e("div", { style: { fontSize: 16, color: "var(--text-faint)", fontWeight: 300 }, children: "+" }),
55
+ /* @__PURE__ */ n("div", { style: { textAlign: "center", flex: 1 }, children: [
56
+ /* @__PURE__ */ e("div", { style: { fontSize: 20, fontWeight: 700, color: d(l) }, children: s(l) }),
57
+ /* @__PURE__ */ e("div", { style: { fontSize: 10, color: "var(--text-muted)", marginTop: 2 }, children: "Agent Impact" }),
58
+ /* @__PURE__ */ e("div", { style: { fontSize: 9, color: "var(--text-faint)", marginTop: 1 }, children: "Behavior-driven change" })
59
+ ] }),
60
+ /* @__PURE__ */ e("div", { style: { fontSize: 16, color: "var(--text-faint)", fontWeight: 300 }, children: "=" }),
61
+ /* @__PURE__ */ n("div", { style: { textAlign: "center", flex: 1 }, children: [
62
+ /* @__PURE__ */ e("div", { style: { fontSize: 20, fontWeight: 600, color: "var(--text-ink)" }, children: p(c) }),
63
+ /* @__PURE__ */ e("div", { style: { fontSize: 10, color: "var(--text-muted)", marginTop: 2 }, children: "Predicted Outcome" }),
64
+ /* @__PURE__ */ e("div", { style: { fontSize: 9, color: "var(--text-faint)", marginTop: 1 }, children: "With agent behaviors" })
65
+ ] })
66
+ ] }),
67
+ /* @__PURE__ */ n("div", { style: {
68
+ display: "flex",
69
+ alignItems: "center",
70
+ justifyContent: "center",
71
+ gap: 8,
72
+ padding: "8px 12px",
73
+ borderRadius: 6,
74
+ background: "var(--surface-raised, #f5f5f5)",
75
+ marginBottom: 12
76
+ }, children: [
77
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-muted)" }, children: "vs. Average Agent:" }),
78
+ /* @__PURE__ */ n("span", { style: {
79
+ fontSize: 14,
80
+ fontWeight: 700,
81
+ color: d(r),
82
+ display: "flex",
83
+ alignItems: "center",
84
+ gap: 4
85
+ }, children: [
86
+ s(r),
87
+ /* @__PURE__ */ e("svg", { width: "10", height: "7", children: r > 0 ? /* @__PURE__ */ e("path", { d: "M5 0 L9 6 L1 6 Z", fill: "var(--state-present)" }) : r < 0 ? /* @__PURE__ */ e("path", { d: "M5 6 L9 0 L1 0 Z", fill: "#f87171" }) : /* @__PURE__ */ e("rect", { x: "1", y: "2.5", width: "8", height: "1", fill: "var(--text-muted)" }) })
88
+ ] }),
89
+ ((m = t.interpretation) == null ? void 0 : m.lift_band) && /* @__PURE__ */ e("span", { style: {
90
+ fontSize: 9,
91
+ fontWeight: 600,
92
+ color: d(r),
93
+ textTransform: "capitalize"
94
+ }, children: t.interpretation.lift_band.replace(/_/g, " ") })
95
+ ] }),
96
+ ((y = t.driver_signal_keys) == null ? void 0 : y.length) > 0 && /* @__PURE__ */ n("div", { children: [
97
+ /* @__PURE__ */ e("div", { style: { fontSize: 9, fontWeight: 600, color: "var(--text-muted)", marginBottom: 6, textTransform: "uppercase", letterSpacing: "0.04em" }, children: "Key Drivers" }),
98
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: t.driver_signal_keys.map((g, u) => /* @__PURE__ */ e(He, { variant: "default", size: "xs", children: g.replace(/^sig\./, "").replace(/_/g, " ") }, u)) })
99
+ ] })
100
+ ] });
101
+ }
102
+ const Ce = "coaching-synthesis-keyframes";
103
+ function et() {
104
+ if (typeof document > "u" || document.getElementById(Ce)) return;
105
+ const t = document.createElement("style");
106
+ t.id = Ce, t.textContent = `
107
+ @keyframes coaching-shimmer {
108
+ 0% { background-position: -200% 0; }
109
+ 100% { background-position: 200% 0; }
110
+ }
111
+ @keyframes coaching-pulse {
112
+ 0%, 100% { opacity: 0.4; }
113
+ 50% { opacity: 1; }
114
+ }
115
+ `, document.head.appendChild(t);
116
+ }
117
+ function tt({ data: t, loading: a, error: c }) {
118
+ var m, y;
119
+ if (Ie.useEffect(() => {
120
+ et();
121
+ }, []), a)
122
+ return /* @__PURE__ */ n("div", { style: {
123
+ padding: "20px 0",
124
+ display: "flex",
125
+ flexDirection: "column",
126
+ gap: 12
127
+ }, children: [
128
+ /* @__PURE__ */ n("div", { style: {
129
+ display: "flex",
130
+ alignItems: "center",
131
+ gap: 8
132
+ }, children: [
133
+ /* @__PURE__ */ e("div", { style: {
134
+ width: 6,
135
+ height: 6,
136
+ borderRadius: "50%",
137
+ background: "var(--rail-tone)",
138
+ animation: "coaching-pulse 1.5s ease-in-out infinite"
139
+ } }),
140
+ /* @__PURE__ */ e("span", { style: {
141
+ fontSize: "var(--text-base)",
142
+ color: "var(--rail-tone)",
143
+ fontFamily: "var(--font-sans)",
144
+ fontWeight: 500
145
+ }, children: "Compass is synthesizing coaching insights…" })
146
+ ] }),
147
+ [180, 260, 220].map((g, u) => /* @__PURE__ */ e(
148
+ "div",
149
+ {
150
+ style: {
151
+ height: 10,
152
+ width: g,
153
+ maxWidth: "100%",
154
+ borderRadius: 4,
155
+ background: "linear-gradient(90deg, var(--hover-warm-subtle) 25%, var(--hover-warm) 50%, var(--hover-warm-subtle) 75%)",
156
+ backgroundSize: "200% 100%",
157
+ animation: "coaching-shimmer 1.8s ease-in-out infinite",
158
+ animationDelay: `${u * 0.2}s`
159
+ }
160
+ },
161
+ u
162
+ ))
163
+ ] });
164
+ if (c)
165
+ return /* @__PURE__ */ e("div", { style: {
166
+ padding: "16px 0",
167
+ fontSize: "var(--text-base)",
168
+ color: "var(--text-faint)",
169
+ fontFamily: "var(--font-sans)"
170
+ }, children: "Unable to generate coaching summary." });
171
+ if (!t) return null;
172
+ const l = t.strengths || [], r = t.improvements || [], p = t.organizational || t.organizational_insights || [], s = typeof t.one_liner == "string" ? t.one_liner : ((m = t.one_liner) == null ? void 0 : m.text) || "", d = typeof t.context == "string" ? t.context : ((y = t.context) == null ? void 0 : y.text) || "";
173
+ return /* @__PURE__ */ n("div", { style: {
174
+ display: "flex",
175
+ flexDirection: "column",
176
+ gap: 14,
177
+ fontFamily: "var(--font-sans)"
178
+ }, children: [
179
+ s && /* @__PURE__ */ e("div", { style: {
180
+ fontSize: "var(--text-lg)",
181
+ fontWeight: 600,
182
+ color: "var(--text-strong)",
183
+ lineHeight: 1.4
184
+ }, children: s }),
185
+ d && /* @__PURE__ */ e("div", { style: {
186
+ fontSize: "var(--text-base)",
187
+ color: "var(--text-muted)",
188
+ lineHeight: 1.45
189
+ }, children: d }),
190
+ l.length > 0 && /* @__PURE__ */ e(
191
+ ye,
192
+ {
193
+ icon: /* @__PURE__ */ e(De, { size: 13 }),
194
+ label: "Strengths",
195
+ color: "var(--rail-discovery)",
196
+ items: l
197
+ }
198
+ ),
199
+ r.length > 0 && /* @__PURE__ */ e(
200
+ ye,
201
+ {
202
+ icon: /* @__PURE__ */ e(Se, { size: 13 }),
203
+ label: "Improvements",
204
+ color: "var(--rail-compliance)",
205
+ items: r
206
+ }
207
+ ),
208
+ p.length > 0 && /* @__PURE__ */ e(
209
+ ye,
210
+ {
211
+ icon: /* @__PURE__ */ e(Me, { size: 13 }),
212
+ label: "Organizational",
213
+ color: "var(--rail-outcome)",
214
+ items: p
215
+ }
216
+ ),
217
+ t.overall && /* @__PURE__ */ n("div", { style: {
218
+ fontSize: "var(--text-base)",
219
+ color: "var(--text-faint)",
220
+ fontStyle: "italic",
221
+ marginTop: 2
222
+ }, children: [
223
+ "Overall: ",
224
+ t.overall.replace(/_/g, " ")
225
+ ] })
226
+ ] });
227
+ }
228
+ function ye({ icon: t, label: a, color: c, items: l }) {
229
+ return /* @__PURE__ */ n("div", { children: [
230
+ /* @__PURE__ */ n("div", { style: {
231
+ display: "flex",
232
+ alignItems: "center",
233
+ gap: 5,
234
+ marginBottom: 6,
235
+ color: c,
236
+ fontSize: "var(--text-base)",
237
+ fontWeight: 650,
238
+ letterSpacing: "0.04em"
239
+ }, children: [
240
+ t,
241
+ a
242
+ ] }),
243
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: l.map((r, p) => {
244
+ const s = typeof r == "string" ? r : (r == null ? void 0 : r.text) || "", d = typeof r == "object" ? r == null ? void 0 : r.quote : null;
245
+ return /* @__PURE__ */ n("div", { style: { paddingLeft: 14 }, children: [
246
+ /* @__PURE__ */ n("div", { style: {
247
+ fontSize: "var(--text-base)",
248
+ color: "var(--text-base)",
249
+ lineHeight: 1.4
250
+ }, children: [
251
+ "• ",
252
+ s
253
+ ] }),
254
+ d && /* @__PURE__ */ n("div", { style: {
255
+ display: "flex",
256
+ alignItems: "flex-start",
257
+ gap: 4,
258
+ marginTop: 3,
259
+ paddingLeft: 8
260
+ }, children: [
261
+ /* @__PURE__ */ e(
262
+ Ne,
263
+ {
264
+ size: 10,
265
+ style: {
266
+ color: "var(--text-faint)",
267
+ flexShrink: 0,
268
+ marginTop: 2
269
+ }
270
+ }
271
+ ),
272
+ /* @__PURE__ */ n("span", { style: {
273
+ fontSize: "var(--text-base)",
274
+ color: "var(--text-muted)",
275
+ fontStyle: "italic",
276
+ lineHeight: 1.35
277
+ }, children: [
278
+ '"',
279
+ d,
280
+ '"'
281
+ ] })
282
+ ] })
283
+ ] }, p);
284
+ }) })
285
+ ] });
286
+ }
287
+ function nt(t) {
288
+ const a = Math.floor(t / 60), c = Math.round(t % 60);
289
+ return `${a}:${c.toString().padStart(2, "0")}`;
290
+ }
291
+ function rt({ title: t, meta: a, callPurpose: c, classification: l, dimensions: r }) {
292
+ const p = c || {}, s = l || {};
293
+ return /* @__PURE__ */ n(Pe, { variant: "elevated", padding: "sm", children: [
294
+ /* @__PURE__ */ e("div", { style: { fontSize: "var(--text-md)", fontWeight: 550, color: "var(--text-strong)", lineHeight: 1.375, marginBottom: 6 }, children: t }),
295
+ /* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: "4px 12px", fontSize: 11, color: "var(--text-muted)" }, children: [
296
+ a.evaluated_dt && /* @__PURE__ */ n("div", { children: [
297
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Date" }),
298
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: new Date(a.evaluated_dt).toLocaleString() })
299
+ ] }),
300
+ a.duration_seconds != null && /* @__PURE__ */ n("div", { children: [
301
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Duration" }),
302
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: nt(a.duration_seconds) })
303
+ ] }),
304
+ a.message_count && /* @__PURE__ */ n("div", { children: [
305
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Messages" }),
306
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: a.message_count })
307
+ ] }),
308
+ p.interaction_direction && /* @__PURE__ */ n("div", { children: [
309
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Direction" }),
310
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: p.interaction_direction })
311
+ ] }),
312
+ p.interaction_driver && /* @__PURE__ */ n("div", { children: [
313
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Driver" }),
314
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: p.interaction_driver })
315
+ ] }),
316
+ p.customer_intent && /* @__PURE__ */ n("div", { children: [
317
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Intent" }),
318
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: p.customer_intent })
319
+ ] }),
320
+ s.interaction_paradigm && /* @__PURE__ */ n("div", { children: [
321
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: "Paradigm" }),
322
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: s.interaction_paradigm })
323
+ ] }),
324
+ r.map((d, m) => /* @__PURE__ */ n("div", { children: [
325
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "var(--text-faint)" }, children: d.label || d.key }),
326
+ /* @__PURE__ */ e("div", { style: { color: "var(--text-base)" }, children: d.value })
327
+ ] }, m))
328
+ ] }),
329
+ a.session_id && /* @__PURE__ */ e("div", { style: { fontSize: 9, color: "var(--text-faint)", fontFamily: "var(--font-mono)", marginTop: 4, userSelect: "all" }, children: a.session_id })
330
+ ] });
331
+ }
332
+ function it({ scores: t }) {
333
+ return t != null && t.length ? /* @__PURE__ */ e(K, { title: "Scores", children: /* @__PURE__ */ e("div", { style: { display: "flex", gap: 24, flexWrap: "wrap" }, children: t.map((a, c) => {
334
+ const l = a.value != null ? Math.round(a.value) : null;
335
+ return /* @__PURE__ */ n("div", { style: { textAlign: "center", minWidth: 48 }, children: [
336
+ /* @__PURE__ */ e("div", { style: { fontSize: 20, fontWeight: 700, color: "var(--text-ink)" }, children: l ?? "—" }),
337
+ /* @__PURE__ */ e("div", { style: { fontSize: "var(--text-sm)", color: "var(--text-muted)", marginTop: 2 }, children: a.label || a.key })
338
+ ] }, c);
339
+ }) }) }) : null;
340
+ }
341
+ const Te = {
342
+ outcome: { label: "Outcome", icon: /* @__PURE__ */ e(Be, { size: 12 }), color: "var(--rail-outcome)" },
343
+ process: { label: "Process & Protocol", icon: /* @__PURE__ */ e(qe, { size: 12 }), color: "var(--rail-discovery)" },
344
+ compliance: { label: "Compliance", icon: /* @__PURE__ */ e(Ve, { size: 12 }), color: "var(--rail-compliance)" },
345
+ customer_friction: { label: "Customer Friction", icon: /* @__PURE__ */ e(ke, { size: 12 }), color: "var(--rail-coral)" },
346
+ experience: { label: "Experience", icon: /* @__PURE__ */ e(Ge, { size: 12 }), color: "var(--rail-teal)" }
347
+ }, ot = {
348
+ risk: { icon: /* @__PURE__ */ e(ke, { size: 10 }), color: "var(--rail-signal-churn)" },
349
+ opportunity: { icon: /* @__PURE__ */ e(Se, { size: 10 }), color: "var(--state-unknown)" },
350
+ excellence: { icon: /* @__PURE__ */ e(Re, { size: 10 }), color: "var(--rail-teal)" }
351
+ };
352
+ function at({ signals: t, expandedSignals: a, toggleSignal: c, playAudio: l, highlightTurns: r }) {
353
+ var s;
354
+ if (!((s = t == null ? void 0 : t.signals) != null && s.length)) return null;
355
+ const p = me(() => {
356
+ const d = {};
357
+ for (const m of t.signals) {
358
+ const y = m.group || "experience";
359
+ d[y] || (d[y] = []), d[y].push(m);
360
+ }
361
+ return d;
362
+ }, [t]);
363
+ return /* @__PURE__ */ e(K, { title: `Signals (${t.present_count} present / ${t.total_signals_evaluated} evaluated)`, children: Object.entries(p).map(([d, m]) => {
364
+ const y = Te[d] || Te.experience;
365
+ return /* @__PURE__ */ n("div", { style: { marginBottom: 10 }, children: [
366
+ /* @__PURE__ */ n(Le, { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
367
+ y.icon,
368
+ /* @__PURE__ */ e("span", { children: y.label })
369
+ ] }),
370
+ /* @__PURE__ */ e("div", { style: { marginTop: 4, display: "flex", flexDirection: "column", gap: 6 }, children: m.map((g, u) => {
371
+ var w, T, _;
372
+ const z = g.display_name || g.key || "", C = (w = g.baseline) == null ? void 0 : w.delta, S = ((T = g.observations) == null ? void 0 : T.length) > 0, b = a.has(g.key);
373
+ return /* @__PURE__ */ n(
374
+ "div",
375
+ {
376
+ id: `signal-${g.key}`,
377
+ style: {
378
+ border: "1px solid var(--border)",
379
+ borderRadius: "var(--radius-md)",
380
+ background: "var(--paper)",
381
+ overflow: "hidden"
382
+ },
383
+ children: [
384
+ /* @__PURE__ */ n(
385
+ "button",
386
+ {
387
+ type: "button",
388
+ onClick: (B) => {
389
+ S && (c(g.key), B.currentTarget.blur());
390
+ },
391
+ style: {
392
+ width: "100%",
393
+ display: "flex",
394
+ alignItems: "center",
395
+ justifyContent: "space-between",
396
+ padding: "6px 10px",
397
+ background: "transparent",
398
+ border: "none",
399
+ cursor: S ? "pointer" : "default"
400
+ },
401
+ title: [
402
+ g.confidence != null ? `Confidence: ${Math.round(g.confidence * 100)}%` : "",
403
+ C != null ? `Δ baseline: ${C > 0 ? "+" : ""}${(C * 100).toFixed(1)}%` : ""
404
+ ].filter(Boolean).join(" · "),
405
+ children: [
406
+ /* @__PURE__ */ n(
407
+ "span",
408
+ {
409
+ style: {
410
+ display: "flex",
411
+ alignItems: "center",
412
+ gap: 6,
413
+ whiteSpace: "nowrap"
414
+ },
415
+ children: [
416
+ (_ = ot[g.kind]) == null ? void 0 : _.icon,
417
+ /* @__PURE__ */ e("span", { children: z }),
418
+ S && /* @__PURE__ */ n(
419
+ "span",
420
+ {
421
+ style: {
422
+ marginLeft: 4,
423
+ fontSize: 10,
424
+ opacity: 0.6
425
+ },
426
+ children: [
427
+ "(",
428
+ g.observations.length,
429
+ ")"
430
+ ]
431
+ }
432
+ )
433
+ ]
434
+ }
435
+ ),
436
+ S && /* @__PURE__ */ e(
437
+ be,
438
+ {
439
+ size: 14,
440
+ style: {
441
+ color: "var(--text-muted)",
442
+ flexShrink: 0,
443
+ transform: b ? "rotate(180deg)" : "rotate(0deg)",
444
+ transition: "transform 0.16s ease"
445
+ }
446
+ }
447
+ )
448
+ ]
449
+ }
450
+ ),
451
+ b && g.observations && /* @__PURE__ */ e("div", { style: { width: "100%", margin: "0 0 6px" }, children: g.observations.map((B, P) => {
452
+ var F;
453
+ return /* @__PURE__ */ n("div", { style: {
454
+ fontSize: "var(--text-sm)",
455
+ color: "var(--text-muted)",
456
+ padding: "8px 12px",
457
+ background: "var(--paper)",
458
+ borderLeft: `3px solid ${y.color}`,
459
+ marginBottom: 6,
460
+ borderRadius: "0 var(--radius-sm) var(--radius-sm) 0"
461
+ }, children: [
462
+ /* @__PURE__ */ e("div", { style: { fontWeight: 600, color: "var(--text-base)", marginBottom: 3, fontSize: "var(--text-base)" }, children: B.key || "" }),
463
+ /* @__PURE__ */ e("div", { style: { marginBottom: 6, lineHeight: 1.4 }, children: B.reason || B.explanation || "" }),
464
+ (F = B.evidence) == null ? void 0 : F.map((W, M) => /* @__PURE__ */ e(Ee, { ev: W, onPlay: l, onHighlight: r }, M))
465
+ ] }, P);
466
+ }) })
467
+ ]
468
+ },
469
+ u
470
+ );
471
+ }) })
472
+ ] }, d);
473
+ }) });
474
+ }
475
+ const _e = {
476
+ risk: { icon: /* @__PURE__ */ e(ke, { size: 10 }), color: "var(--rail-signal-churn)" },
477
+ opportunity: { icon: /* @__PURE__ */ e(Se, { size: 10 }), color: "var(--state-unknown)" },
478
+ excellence: { icon: /* @__PURE__ */ e(Re, { size: 10 }), color: "var(--rail-teal)" }
479
+ };
480
+ function lt({ guidance: t, playAudio: a, highlightTurns: c }) {
481
+ var l;
482
+ return (l = t == null ? void 0 : t.items) != null && l.length ? /* @__PURE__ */ e(K, { title: `Guidance (${t.total_items} items)`, children: /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.items.map((r, p) => {
483
+ var m;
484
+ const s = _e[r.guidance_kind] || _e.excellence, d = r.owner === "organization" ? { bg: "color-mix(in srgb, var(--rail-discovery) 15%, transparent)", color: "var(--rail-discovery)", text: "ORG" } : r.owner === "shared" ? { bg: "color-mix(in srgb, var(--state-unknown) 15%, transparent)", color: "var(--state-unknown)", text: "SHARED" } : { bg: "color-mix(in srgb, var(--rail-teal) 10%, transparent)", color: "var(--rail-teal)", text: "AGENT" };
485
+ return /* @__PURE__ */ n("div", { style: {
486
+ padding: "10px 12px",
487
+ borderRadius: "var(--radius)",
488
+ background: "var(--paper)",
489
+ borderLeft: `3px solid ${s.color}`
490
+ }, children: [
491
+ /* @__PURE__ */ n("div", { style: { fontSize: "var(--text-base)", color: "var(--text-strong)", display: "flex", alignItems: "center", gap: 5, fontWeight: 550 }, children: [
492
+ s.icon,
493
+ " ",
494
+ r.title || "",
495
+ /* @__PURE__ */ e("span", { style: {
496
+ fontSize: 9,
497
+ padding: "1px 6px",
498
+ borderRadius: 8,
499
+ marginLeft: 4,
500
+ background: d.bg,
501
+ color: d.color,
502
+ fontWeight: 600
503
+ }, children: d.text })
504
+ ] }),
505
+ r.detail && /* @__PURE__ */ e("div", { style: { fontSize: "var(--text-sm)", color: "var(--text-muted)", marginTop: 4, lineHeight: 1.4 }, children: r.detail }),
506
+ (m = r.signal_refs) == null ? void 0 : m.map((y, g) => {
507
+ var u;
508
+ return /* @__PURE__ */ n("div", { style: { marginTop: 6 }, children: [
509
+ /* @__PURE__ */ n("div", { style: { fontSize: 10, color: "var(--text-muted)", fontWeight: 600, marginBottom: 3, display: "flex", alignItems: "center", gap: 3 }, children: [
510
+ /* @__PURE__ */ e(Ue, { size: 10 }),
511
+ " ",
512
+ y.display_name || y.signal_key,
513
+ y.confidence != null && /* @__PURE__ */ n("span", { style: { fontWeight: 400, opacity: 0.7 }, children: [
514
+ " (",
515
+ Math.round(y.confidence * 100),
516
+ "%)"
517
+ ] })
518
+ ] }),
519
+ (u = y.evidence) == null ? void 0 : u.map((z, C) => /* @__PURE__ */ e(Ee, { ev: z, onPlay: a, onHighlight: c }, C))
520
+ ] }, g);
521
+ })
522
+ ] }, p);
523
+ }) }) }) : null;
524
+ }
525
+ function st({ nba: t }) {
526
+ const a = (t == null ? void 0 : t.recommendations) || (t == null ? void 0 : t.actions) || [];
527
+ return a.length ? /* @__PURE__ */ e(K, { title: "Next Best Actions", children: /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: a.slice(0, 8).map((c, l) => /* @__PURE__ */ n("div", { style: { fontSize: 11, color: "var(--text-muted)", display: "flex", alignItems: "center", gap: 4 }, children: [
528
+ /* @__PURE__ */ e(Be, { size: 12 }),
529
+ " ",
530
+ /* @__PURE__ */ e("strong", { style: { color: "var(--text-base)" }, children: c.action || c.title || "" }),
531
+ c.rationale && ` — ${c.rationale}`
532
+ ] }, l)) }) }) : null;
533
+ }
534
+ function ct({
535
+ audioUrl: t,
536
+ timelineSegments: a,
537
+ durationSeconds: c,
538
+ currentTimeSeconds: l,
539
+ timelinePlaying: r,
540
+ playbackRate: p,
541
+ onSeek: s,
542
+ onTogglePlay: d,
543
+ onSeekBack: m,
544
+ onSeekForward: y,
545
+ onSetPlaybackRate: g,
546
+ audioRef: u
547
+ }) {
548
+ return t ? /* @__PURE__ */ n(K, { title: "Recording", children: [
549
+ /* @__PURE__ */ e(
550
+ Fe,
551
+ {
552
+ segments: a,
553
+ durationSeconds: c || 0,
554
+ currentTimeSeconds: l,
555
+ onSeek: s,
556
+ showControls: !0,
557
+ hasRecording: !0,
558
+ timelinePlaying: r,
559
+ playbackRate: p,
560
+ onTogglePlay: d,
561
+ onSeekBack: m,
562
+ onSeekForward: y,
563
+ onSetPlaybackRate: g
564
+ }
565
+ ),
566
+ /* @__PURE__ */ e("audio", { ref: u, preload: "none", style: { display: "none" }, children: /* @__PURE__ */ e("source", { src: t, type: "audio/mpeg" }) })
567
+ ] }) : null;
568
+ }
569
+ function dt({
570
+ transcript: t,
571
+ audioUrl: a,
572
+ highlightedTurns: c,
573
+ activeTurnIndex: l,
574
+ timelinePlaying: r,
575
+ turnObservations: p,
576
+ setExpandedSignals: s,
577
+ onTurnPlayPause: d
578
+ }) {
579
+ var g;
580
+ if (!((g = t == null ? void 0 : t.messages) != null && g.length)) return null;
581
+ const m = (u, z) => {
582
+ if (u == null) return;
583
+ const C = (w) => {
584
+ const T = Math.floor(w / 6e4), _ = Math.floor(w % 6e4 / 1e3);
585
+ return `${T.toString().padStart(2, "0")}:${_.toString().padStart(2, "0")}`;
586
+ }, S = C(u), b = z != null ? C(z) : S;
587
+ return `${S}–${b}`;
588
+ }, y = t.messages.map((u, z) => {
589
+ var C, S;
590
+ return {
591
+ actor: u.actor === "agent" ? ((C = t.actor_map) == null ? void 0 : C.agent) || "Agent" : ((S = t.actor_map) == null ? void 0 : S.customer) || "Customer",
592
+ actorType: u.actor === "agent" ? "agent" : "customer",
593
+ text: u.text || "",
594
+ timeRange: m(u.start ?? u.start_ms, u.end ?? u.end_ms),
595
+ isHighlighted: c.has(z),
596
+ highlightColor: r && l === z ? u.actor === "agent" ? "var(--rail-outcome)" : "var(--rail-discovery)" : void 0,
597
+ observations: (p[z] || []).map((b) => ({
598
+ ...b,
599
+ onClick: () => {
600
+ s((w) => /* @__PURE__ */ new Set([...w, b.signalKey])), setTimeout(() => {
601
+ const w = document.getElementById(`signal-${b.signalKey}`);
602
+ w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
603
+ }, 100);
604
+ }
605
+ }))
606
+ };
607
+ });
608
+ return /* @__PURE__ */ e("div", { id: "transcript-container", children: /* @__PURE__ */ e(
609
+ Oe,
610
+ {
611
+ turns: y,
612
+ audioUrl: a,
613
+ activeTurnIndex: l,
614
+ autoScrollActiveTurn: r,
615
+ isExternalPlaying: r,
616
+ onTurnPlayPause: d
617
+ }
618
+ ) });
619
+ }
620
+ const xe = {
621
+ padding: 0,
622
+ border: "none",
623
+ background: "transparent",
624
+ fontSize: "12px",
625
+ fontWeight: 500,
626
+ color: "rgba(30, 33, 37, 0.65)",
627
+ cursor: "pointer",
628
+ fontFamily: "inherit"
629
+ };
630
+ function pt({
631
+ sessionTitle: t,
632
+ sessionSubtitle: a,
633
+ threadLabel: c,
634
+ messages: l = [],
635
+ onSendMessage: r,
636
+ onReplyMessage: p,
637
+ onEditMessage: s,
638
+ onDeleteMessage: d,
639
+ onCreateNewThread: m,
640
+ // optional: host can handle new thread creation
641
+ currentUser: y,
642
+ isLoading: g = !1
643
+ }) {
644
+ const [u, z] = k(""), [C, S] = k(!1), [b, w] = k(l), [T, _] = k(!1), [B, P] = k(null), [F, W] = k(null), [M, I] = k(""), [q, N] = k(null), [ge, O] = k(""), [U, G] = k(null), [ue, V] = k(!1), [A, Y] = k(""), [L, te] = k(!1), Z = pe(null), J = pe(null), Q = y || {
645
+ name: "You",
646
+ initials: "YO",
647
+ color: "#6B7C93"
648
+ }, ne = c || t || a, he = F ? b.find((i) => i.id === F) : null;
649
+ ve(() => {
650
+ w(l);
651
+ }, [l]), ve(() => {
652
+ Z.current && (!b || b.length === 0 || Z.current.scrollIntoView({ behavior: "smooth" }));
653
+ }, [b]);
654
+ const X = async () => {
655
+ const i = A.trim();
656
+ if (i) {
657
+ te(!0);
658
+ try {
659
+ await (m == null ? void 0 : m(i)), Y(""), V(!1);
660
+ } finally {
661
+ te(!1);
662
+ }
663
+ }
664
+ }, re = () => {
665
+ V(!1), Y("");
666
+ }, ee = async () => {
667
+ const i = u.trim();
668
+ if (!i) return;
669
+ const h = i;
670
+ z("");
671
+ const $ = `temp-${Date.now()}`, de = {
672
+ id: $,
673
+ author: Q,
674
+ content: h,
675
+ timestamp: "Just now",
676
+ type: "comment",
677
+ isOptimistic: !0
678
+ };
679
+ if (w((o) => [...o, de]), r) {
680
+ _(!0);
681
+ try {
682
+ await r(h), w(
683
+ (o) => o.map(
684
+ (x) => x.id === $ ? { ...x, isOptimistic: !1 } : x
685
+ )
686
+ );
687
+ } catch {
688
+ w((o) => o.filter((x) => x.id !== $));
689
+ } finally {
690
+ _(!1);
691
+ }
692
+ return;
693
+ }
694
+ w(
695
+ (o) => o.map(
696
+ (x) => x.id === $ ? { ...x, isOptimistic: !1 } : x
697
+ )
698
+ );
699
+ }, ie = (i) => {
700
+ i.key === "Enter" && !i.shiftKey && (i.preventDefault(), ee());
701
+ }, oe = (i) => {
702
+ W(i.id), I(""), N(null), O(""), P(null), p == null || p(i);
703
+ }, ae = async (i) => {
704
+ const h = M.trim();
705
+ if (h) {
706
+ _(!0);
707
+ try {
708
+ await (r == null ? void 0 : r(h, i)), W(null), I("");
709
+ } finally {
710
+ _(!1);
711
+ }
712
+ }
713
+ }, le = (i) => {
714
+ N(i.id), O(i.content || ""), W(null), I(""), P(null), s == null || s(i);
715
+ }, se = async () => {
716
+ const i = ge.trim();
717
+ !i || !q || (await (s == null ? void 0 : s({ id: q, content: i })), N(null), O(""));
718
+ }, ce = (i) => {
719
+ G(i), P(null);
720
+ };
721
+ return /* @__PURE__ */ n(
722
+ "div",
723
+ {
724
+ style: {
725
+ display: "flex",
726
+ flexDirection: "column",
727
+ height: "100%",
728
+ background: "rgba(255, 255, 255, 0.98)",
729
+ border: "1px solid rgba(52, 58, 64, 0.12)",
730
+ borderRadius: "12px",
731
+ overflow: "hidden",
732
+ position: "relative"
733
+ },
734
+ children: [
735
+ U && /* @__PURE__ */ e(
736
+ "div",
737
+ {
738
+ style: {
739
+ position: "absolute",
740
+ inset: 0,
741
+ zIndex: 50,
742
+ display: "flex",
743
+ alignItems: "center",
744
+ justifyContent: "center",
745
+ background: "rgba(30, 33, 37, 0.35)",
746
+ borderRadius: "12px"
747
+ },
748
+ onClick: () => G(null),
749
+ children: /* @__PURE__ */ n(
750
+ "div",
751
+ {
752
+ style: {
753
+ background: "white",
754
+ borderRadius: "12px",
755
+ padding: "20px 24px",
756
+ boxShadow: "0 8px 24px rgba(30, 33, 37, 0.15)",
757
+ maxWidth: "320px",
758
+ width: "90%"
759
+ },
760
+ onClick: (i) => i.stopPropagation(),
761
+ children: [
762
+ /* @__PURE__ */ e(
763
+ "p",
764
+ {
765
+ style: {
766
+ margin: 0,
767
+ marginBottom: "20px",
768
+ fontSize: "14px",
769
+ fontWeight: 500,
770
+ color: "rgba(30, 33, 37, 0.9)",
771
+ lineHeight: 1.45
772
+ },
773
+ children: "Do you really want to delete?"
774
+ }
775
+ ),
776
+ /* @__PURE__ */ n(
777
+ "div",
778
+ {
779
+ style: {
780
+ display: "flex",
781
+ gap: "10px",
782
+ justifyContent: "flex-end"
783
+ },
784
+ children: [
785
+ /* @__PURE__ */ e(
786
+ "button",
787
+ {
788
+ type: "button",
789
+ onClick: () => G(null),
790
+ style: {
791
+ padding: "8px 16px",
792
+ fontSize: "12px",
793
+ fontWeight: 600,
794
+ color: "rgba(30, 33, 37, 0.45)",
795
+ background: "rgba(30, 33, 37, 0.1)",
796
+ border: "none",
797
+ borderRadius: "6px",
798
+ cursor: "pointer"
799
+ },
800
+ children: "Cancel"
801
+ }
802
+ ),
803
+ /* @__PURE__ */ e(
804
+ "button",
805
+ {
806
+ type: "button",
807
+ onClick: async () => {
808
+ if (!U) return;
809
+ const i = U;
810
+ G(null), await (d == null ? void 0 : d(i));
811
+ },
812
+ style: {
813
+ padding: "8px 16px",
814
+ fontSize: "12px",
815
+ fontWeight: 600,
816
+ color: "white",
817
+ background: "#5e88b0",
818
+ border: "none",
819
+ borderRadius: "6px",
820
+ cursor: "pointer"
821
+ },
822
+ children: "Delete"
823
+ }
824
+ )
825
+ ]
826
+ }
827
+ )
828
+ ]
829
+ }
830
+ )
831
+ }
832
+ ),
833
+ ne && /* @__PURE__ */ e(
834
+ "div",
835
+ {
836
+ style: {
837
+ padding: "14px 16px",
838
+ borderBottom: "1px solid rgba(52, 58, 64, 0.12)",
839
+ background: "rgba(255, 255, 255, 0.98)"
840
+ },
841
+ children: /* @__PURE__ */ n(
842
+ "div",
843
+ {
844
+ style: {
845
+ display: "flex",
846
+ justifyContent: "space-between",
847
+ alignItems: "center",
848
+ gap: "8px"
849
+ },
850
+ children: [
851
+ /* @__PURE__ */ n("div", { children: [
852
+ /* @__PURE__ */ e(
853
+ "div",
854
+ {
855
+ style: {
856
+ fontSize: "14px",
857
+ fontWeight: 600,
858
+ color: "rgba(30, 33, 37, 0.95)",
859
+ marginBottom: "4px"
860
+ },
861
+ children: c || "Session Discussion"
862
+ }
863
+ ),
864
+ (t || a) && /* @__PURE__ */ e(
865
+ "div",
866
+ {
867
+ style: {
868
+ fontSize: "12px",
869
+ color: "rgba(30, 33, 37, 0.52)"
870
+ },
871
+ children: t || a
872
+ }
873
+ )
874
+ ] }),
875
+ /* @__PURE__ */ n(
876
+ "button",
877
+ {
878
+ type: "button",
879
+ onClick: () => {
880
+ V((i) => !i);
881
+ },
882
+ style: {
883
+ display: "inline-flex",
884
+ alignItems: "center",
885
+ gap: "6px",
886
+ padding: "6px 12px",
887
+ fontSize: "13px",
888
+ fontWeight: 500,
889
+ color: "rgba(30, 33, 37, 0.75)",
890
+ background: "transparent",
891
+ border: "1px solid rgba(30, 33, 37, 0.12)",
892
+ borderRadius: "6px",
893
+ cursor: "pointer",
894
+ transition: "background 0.15s ease, color 0.15s ease"
895
+ },
896
+ onMouseEnter: (i) => {
897
+ i.currentTarget.style.background = "rgba(231, 212, 162, 0.12)", i.currentTarget.style.color = "rgba(30, 33, 37, 0.9)";
898
+ },
899
+ onMouseLeave: (i) => {
900
+ i.currentTarget.style.background = "transparent", i.currentTarget.style.color = "rgba(30, 33, 37, 0.75)";
901
+ },
902
+ title: "Start a new discussion thread",
903
+ children: [
904
+ /* @__PURE__ */ e(
905
+ "span",
906
+ {
907
+ style: {
908
+ fontSize: 16,
909
+ lineHeight: 1,
910
+ marginTop: -1
911
+ },
912
+ children: "+"
913
+ }
914
+ ),
915
+ "New thread"
916
+ ]
917
+ }
918
+ )
919
+ ]
920
+ }
921
+ )
922
+ }
923
+ ),
924
+ /* @__PURE__ */ n(
925
+ "div",
926
+ {
927
+ style: {
928
+ flex: 1,
929
+ overflowY: "auto",
930
+ padding: "16px",
931
+ display: "flex",
932
+ flexDirection: "column",
933
+ gap: "16px"
934
+ },
935
+ children: [
936
+ ue && /* @__PURE__ */ n(
937
+ "div",
938
+ {
939
+ style: {
940
+ marginBottom: "16px",
941
+ padding: "12px",
942
+ background: "rgba(30, 33, 37, 0.04)",
943
+ border: "1px solid rgba(52, 58, 64, 0.14)",
944
+ borderRadius: "8px"
945
+ },
946
+ children: [
947
+ /* @__PURE__ */ e(
948
+ "textarea",
949
+ {
950
+ value: A,
951
+ onChange: (i) => Y(i.target.value),
952
+ onKeyDown: (i) => {
953
+ i.key === "Enter" && !i.shiftKey && (i.preventDefault(), X());
954
+ },
955
+ placeholder: "Start a new thread...",
956
+ disabled: L,
957
+ style: {
958
+ width: "100%",
959
+ minHeight: "64px",
960
+ padding: "8px 12px",
961
+ fontSize: "13px",
962
+ color: "rgba(30, 33, 37, 0.88)",
963
+ background: "white",
964
+ border: "1px solid rgba(52, 58, 64, 0.16)",
965
+ borderRadius: "6px",
966
+ resize: "vertical",
967
+ outline: "none",
968
+ fontFamily: "inherit",
969
+ lineHeight: 1.5,
970
+ marginBottom: "10px"
971
+ }
972
+ }
973
+ ),
974
+ /* @__PURE__ */ n("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
975
+ /* @__PURE__ */ e(
976
+ "button",
977
+ {
978
+ type: "button",
979
+ onClick: re,
980
+ disabled: L,
981
+ style: {
982
+ padding: "6px 14px",
983
+ fontSize: "12px",
984
+ fontWeight: 500,
985
+ color: "rgba(30, 33, 37, 0.7)",
986
+ background: "rgba(30, 33, 37, 0.08)",
987
+ border: "none",
988
+ borderRadius: "6px",
989
+ cursor: L ? "not-allowed" : "pointer"
990
+ },
991
+ children: "Cancel"
992
+ }
993
+ ),
994
+ /* @__PURE__ */ e(
995
+ "button",
996
+ {
997
+ type: "button",
998
+ onClick: X,
999
+ disabled: !A.trim() || L,
1000
+ style: {
1001
+ padding: "6px 14px",
1002
+ fontSize: "12px",
1003
+ fontWeight: 600,
1004
+ color: "white",
1005
+ background: A.trim() && !L ? "#5e88b0" : "rgba(30, 33, 37, 0.25)",
1006
+ border: "none",
1007
+ borderRadius: "6px",
1008
+ cursor: A.trim() && !L ? "pointer" : "not-allowed"
1009
+ },
1010
+ children: L ? "Sending..." : "Send"
1011
+ }
1012
+ )
1013
+ ] })
1014
+ ]
1015
+ }
1016
+ ),
1017
+ g ? /* @__PURE__ */ e(
1018
+ "div",
1019
+ {
1020
+ style: {
1021
+ display: "flex",
1022
+ alignItems: "center",
1023
+ justifyContent: "center",
1024
+ padding: "40px",
1025
+ color: "rgba(30, 33, 37, 0.42)"
1026
+ },
1027
+ children: "Loading messages..."
1028
+ }
1029
+ ) : b.length === 0 ? /* @__PURE__ */ e(
1030
+ "div",
1031
+ {
1032
+ style: {
1033
+ display: "flex",
1034
+ alignItems: "center",
1035
+ justifyContent: "center",
1036
+ padding: "40px",
1037
+ color: "rgba(30, 33, 37, 0.42)"
1038
+ },
1039
+ children: "No messages yet. Start the conversation!"
1040
+ }
1041
+ ) : b.map((i) => /* @__PURE__ */ n(
1042
+ "div",
1043
+ {
1044
+ onMouseEnter: () => i.type !== "system" && P(i.id),
1045
+ onMouseLeave: () => P(null),
1046
+ style: {
1047
+ display: "flex",
1048
+ gap: "12px",
1049
+ opacity: i.type === "system" ? 0.75 : 1,
1050
+ padding: "4px 0",
1051
+ margin: "0 -4px",
1052
+ borderRadius: "8px"
1053
+ },
1054
+ children: [
1055
+ i.type !== "system" ? /* @__PURE__ */ e(
1056
+ "div",
1057
+ {
1058
+ style: {
1059
+ width: "36px",
1060
+ height: "36px",
1061
+ borderRadius: "50%",
1062
+ background: i.author.color,
1063
+ color: "white",
1064
+ display: "flex",
1065
+ alignItems: "center",
1066
+ justifyContent: "center",
1067
+ fontSize: "11px",
1068
+ fontWeight: 650,
1069
+ flexShrink: 0
1070
+ },
1071
+ children: i.author.initials
1072
+ }
1073
+ ) : /* @__PURE__ */ e(
1074
+ "div",
1075
+ {
1076
+ style: {
1077
+ width: "36px",
1078
+ height: "36px",
1079
+ borderRadius: "50%",
1080
+ background: "rgba(30, 33, 37, 0.1)",
1081
+ color: "rgba(30, 33, 37, 0.55)",
1082
+ display: "flex",
1083
+ alignItems: "center",
1084
+ justifyContent: "center",
1085
+ flexShrink: 0
1086
+ },
1087
+ children: /* @__PURE__ */ e(Ye, { size: 16 })
1088
+ }
1089
+ ),
1090
+ /* @__PURE__ */ n("div", { style: { flex: 1, minWidth: 0 }, children: [
1091
+ /* @__PURE__ */ n(
1092
+ "div",
1093
+ {
1094
+ style: {
1095
+ display: "flex",
1096
+ alignItems: "baseline",
1097
+ flexWrap: "wrap",
1098
+ gap: "8px",
1099
+ marginBottom: "6px",
1100
+ justifyContent: "space-between"
1101
+ },
1102
+ children: [
1103
+ /* @__PURE__ */ n(
1104
+ "div",
1105
+ {
1106
+ style: {
1107
+ display: "flex",
1108
+ alignItems: "baseline",
1109
+ flexWrap: "wrap",
1110
+ gap: "8px"
1111
+ },
1112
+ children: [
1113
+ /* @__PURE__ */ e(
1114
+ "span",
1115
+ {
1116
+ style: {
1117
+ fontSize: "13px",
1118
+ fontWeight: 650,
1119
+ color: "rgba(30, 33, 37, 0.9)"
1120
+ },
1121
+ children: i.author.name
1122
+ }
1123
+ ),
1124
+ /* @__PURE__ */ e(
1125
+ "span",
1126
+ {
1127
+ style: {
1128
+ fontSize: "10px",
1129
+ fontFamily: "var(--default-mono-font-family)",
1130
+ color: "rgba(30, 33, 37, 0.5)"
1131
+ },
1132
+ children: i.timestamp
1133
+ }
1134
+ )
1135
+ ]
1136
+ }
1137
+ ),
1138
+ i.type !== "system" && B === i.id && /* @__PURE__ */ n(
1139
+ "div",
1140
+ {
1141
+ style: {
1142
+ display: "flex",
1143
+ alignItems: "center",
1144
+ gap: "12px",
1145
+ flexShrink: 0
1146
+ },
1147
+ children: [
1148
+ p && /* @__PURE__ */ e(
1149
+ "button",
1150
+ {
1151
+ type: "button",
1152
+ onClick: (h) => {
1153
+ h.preventDefault(), h.stopPropagation(), oe(i);
1154
+ },
1155
+ style: xe,
1156
+ children: "Reply"
1157
+ }
1158
+ ),
1159
+ s && /* @__PURE__ */ e(
1160
+ "button",
1161
+ {
1162
+ type: "button",
1163
+ onClick: (h) => {
1164
+ h.preventDefault(), h.stopPropagation(), le(i);
1165
+ },
1166
+ style: xe,
1167
+ children: "Edit"
1168
+ }
1169
+ ),
1170
+ d && /* @__PURE__ */ e(
1171
+ "button",
1172
+ {
1173
+ type: "button",
1174
+ onClick: (h) => {
1175
+ h.preventDefault(), h.stopPropagation(), ce(i);
1176
+ },
1177
+ style: {
1178
+ ...xe,
1179
+ color: "rgba(198, 99, 99, 0.9)"
1180
+ },
1181
+ children: "Delete"
1182
+ }
1183
+ )
1184
+ ]
1185
+ }
1186
+ )
1187
+ ]
1188
+ }
1189
+ ),
1190
+ q === i.id ? /* @__PURE__ */ e("div", { style: { marginTop: "6px" }, children: /* @__PURE__ */ e(
1191
+ "textarea",
1192
+ {
1193
+ value: ge,
1194
+ onChange: (h) => O(h.target.value),
1195
+ onKeyDown: (h) => {
1196
+ h.key === "Enter" && !h.shiftKey && (h.preventDefault(), se()), h.key === "Escape" && (N(null), O(""));
1197
+ },
1198
+ placeholder: "Edit message...",
1199
+ autoFocus: !0,
1200
+ style: {
1201
+ width: "100%",
1202
+ minHeight: "64px",
1203
+ padding: "8px 12px",
1204
+ fontSize: "13px",
1205
+ color: "rgba(30, 33, 37, 0.88)",
1206
+ background: "white",
1207
+ border: "1px solid rgba(52, 58, 64, 0.2)",
1208
+ borderRadius: "6px",
1209
+ resize: "vertical",
1210
+ outline: "none",
1211
+ fontFamily: "inherit",
1212
+ lineHeight: 1.5,
1213
+ marginBottom: "8px"
1214
+ }
1215
+ }
1216
+ ) }) : /* @__PURE__ */ e(
1217
+ "div",
1218
+ {
1219
+ style: {
1220
+ fontSize: "13px",
1221
+ color: "rgba(30, 33, 37, 0.88)",
1222
+ lineHeight: 1.55
1223
+ },
1224
+ children: i.content
1225
+ }
1226
+ ),
1227
+ F === i.id && /* @__PURE__ */ e("div", { style: { marginTop: "12px" }, children: /* @__PURE__ */ e(
1228
+ "textarea",
1229
+ {
1230
+ value: M,
1231
+ onChange: (h) => I(h.target.value),
1232
+ onKeyDown: (h) => {
1233
+ h.key === "Enter" && !h.shiftKey && (h.preventDefault(), ae(i.id)), h.key === "Escape" && (W(null), I(""));
1234
+ },
1235
+ placeholder: "Type your reply...",
1236
+ disabled: T,
1237
+ autoFocus: !0,
1238
+ style: {
1239
+ width: "100%",
1240
+ minHeight: "64px",
1241
+ padding: "8px 12px",
1242
+ fontSize: "13px",
1243
+ color: "rgba(30, 33, 37, 0.88)",
1244
+ background: "white",
1245
+ border: "1px solid rgba(52, 58, 64, 0.16)",
1246
+ borderRadius: "6px",
1247
+ resize: "vertical",
1248
+ outline: "none",
1249
+ fontFamily: "inherit",
1250
+ lineHeight: 1.5,
1251
+ marginBottom: "10px"
1252
+ }
1253
+ }
1254
+ ) })
1255
+ ] })
1256
+ ]
1257
+ },
1258
+ i.id
1259
+ )),
1260
+ /* @__PURE__ */ e("div", { ref: Z })
1261
+ ]
1262
+ }
1263
+ ),
1264
+ /* @__PURE__ */ e(
1265
+ "div",
1266
+ {
1267
+ style: {
1268
+ padding: "12px",
1269
+ borderTop: "1px solid rgba(52, 58, 64, 0.12)",
1270
+ background: "rgba(255, 255, 255, 0.95)"
1271
+ },
1272
+ children: /* @__PURE__ */ n(
1273
+ "div",
1274
+ {
1275
+ style: {
1276
+ display: "flex",
1277
+ gap: "8px",
1278
+ alignItems: "flex-end"
1279
+ },
1280
+ children: [
1281
+ /* @__PURE__ */ e(
1282
+ "div",
1283
+ {
1284
+ style: {
1285
+ width: "36px",
1286
+ height: "36px",
1287
+ borderRadius: "50%",
1288
+ background: Q.color,
1289
+ color: "white",
1290
+ display: "flex",
1291
+ alignItems: "center",
1292
+ justifyContent: "center",
1293
+ fontSize: "11px",
1294
+ fontWeight: 650,
1295
+ flexShrink: 0
1296
+ },
1297
+ children: Q.initials
1298
+ }
1299
+ ),
1300
+ /* @__PURE__ */ n(
1301
+ "div",
1302
+ {
1303
+ style: {
1304
+ flex: 1,
1305
+ display: "flex",
1306
+ flexDirection: "column",
1307
+ gap: "8px"
1308
+ },
1309
+ children: [
1310
+ /* @__PURE__ */ e(
1311
+ "textarea",
1312
+ {
1313
+ ref: J,
1314
+ value: u,
1315
+ onChange: (i) => z(i.target.value),
1316
+ onKeyDown: ie,
1317
+ onFocus: () => S(!0),
1318
+ onBlur: () => S(!1),
1319
+ placeholder: he ? "Type your reply..." : "Add a comment...",
1320
+ style: {
1321
+ width: "100%",
1322
+ minHeight: "38px",
1323
+ maxHeight: "120px",
1324
+ padding: "8px 12px",
1325
+ fontSize: "13px",
1326
+ color: "rgba(30, 33, 37, 0.85)",
1327
+ background: "white",
1328
+ border: `1px solid ${C ? "rgba(94, 136, 176, 0.35)" : "rgba(52, 58, 64, 0.16)"}`,
1329
+ borderRadius: "8px",
1330
+ resize: "vertical",
1331
+ outline: "none",
1332
+ transition: "border-color 0.15s ease",
1333
+ fontFamily: "inherit",
1334
+ lineHeight: 1.5
1335
+ }
1336
+ }
1337
+ ),
1338
+ /* @__PURE__ */ e(
1339
+ "div",
1340
+ {
1341
+ style: {
1342
+ display: "flex",
1343
+ alignItems: "center",
1344
+ justifyContent: "flex-end"
1345
+ },
1346
+ children: /* @__PURE__ */ e(
1347
+ "button",
1348
+ {
1349
+ type: "button",
1350
+ onClick: ee,
1351
+ disabled: !u.trim() || T,
1352
+ style: {
1353
+ padding: "8px 16px",
1354
+ background: u.trim() && !T ? "#5e88b0" : "rgba(30, 33, 37, 0.1)",
1355
+ border: "none",
1356
+ borderRadius: "6px",
1357
+ color: u.trim() && !T ? "white" : "rgba(30, 33, 37, 0.45)",
1358
+ fontSize: "12px",
1359
+ fontWeight: 600,
1360
+ cursor: u.trim() && !T ? "pointer" : "not-allowed",
1361
+ display: "flex",
1362
+ alignItems: "center",
1363
+ gap: "6px",
1364
+ transition: "all 0.15s ease"
1365
+ },
1366
+ children: T ? /* @__PURE__ */ n(we, { children: [
1367
+ /* @__PURE__ */ e(
1368
+ "div",
1369
+ {
1370
+ style: {
1371
+ width: "14px",
1372
+ height: "14px",
1373
+ border: "2px solid rgba(255, 255, 255, 0.3)",
1374
+ borderTopColor: "white",
1375
+ borderRadius: "50%",
1376
+ animation: "spin 0.6s linear infinite"
1377
+ }
1378
+ }
1379
+ ),
1380
+ "Sending..."
1381
+ ] }) : /* @__PURE__ */ n(we, { children: [
1382
+ /* @__PURE__ */ e(Ze, { size: 14 }),
1383
+ "Send"
1384
+ ] })
1385
+ }
1386
+ )
1387
+ }
1388
+ )
1389
+ ]
1390
+ }
1391
+ )
1392
+ ]
1393
+ }
1394
+ )
1395
+ }
1396
+ )
1397
+ ]
1398
+ }
1399
+ );
1400
+ }
1401
+ function E(t, a) {
1402
+ return t.find((c) => c.block_id === a);
1403
+ }
1404
+ function gt({ data: t, audioUrl: a, coachingData: c, coachingLoading: l, coachingError: r }) {
1405
+ var re, ee, ie, oe, ae, le, se, ce, fe, i, h, $, de;
1406
+ const p = t.blocks || [];
1407
+ t.evidence_index;
1408
+ const s = pe(null), d = pe(null), [m, y] = k(/* @__PURE__ */ new Set()), [g, u] = k(/* @__PURE__ */ new Set()), [z, C] = k(0), [S, b] = k(!1), [w, T] = k(1), _ = ((re = E(p, "interaction-metadata")) == null ? void 0 : re.payload) || {}, B = ((ee = E(p, "interaction-context")) == null ? void 0 : ee.payload) || {}, P = ((ie = E(p, "interaction-summary")) == null ? void 0 : ie.payload) || {}, F = ((oe = E(p, "interaction-scores")) == null ? void 0 : oe.payload) || {}, W = ((ae = E(p, "interaction-signals")) == null ? void 0 : ae.payload) || {}, M = ((le = E(p, "interaction-guidance")) == null ? void 0 : le.payload) || {}, I = ((se = E(p, "interaction-transcript")) == null ? void 0 : se.payload) || {}, q = ((ce = E(p, "interaction-message-thread")) == null ? void 0 : ce.payload) || {}, N = ((fe = E(p, "interaction-nba")) == null ? void 0 : fe.payload) || {}, O = ((((i = E(p, "interaction-dimensions")) == null ? void 0 : i.payload) || {}).dimensions || []).filter((o) => o.value), U = ((h = E(p, "interaction-outcome-lift")) == null ? void 0 : h.payload) || {}, G = me(() => {
1409
+ var f;
1410
+ const o = {}, x = {
1411
+ outcome: { color: "var(--rail-outcome)" },
1412
+ process: { color: "var(--rail-discovery)" },
1413
+ compliance: { color: "var(--rail-compliance)" },
1414
+ customer_friction: { color: "var(--rail-coral)" },
1415
+ experience: { color: "var(--rail-teal)" }
1416
+ };
1417
+ for (const v of W.signals || []) {
1418
+ const D = x[v.group] || {};
1419
+ for (const R of v.observations || [])
1420
+ for (const H of R.evidence || [])
1421
+ if ((f = H.turn_ids) != null && f.length)
1422
+ for (const j of H.turn_ids)
1423
+ o[j] || (o[j] = []), o[j].some((We) => We.label === (R.key || v.display_name || v.key)) || o[j].push({
1424
+ label: R.key || v.display_name || v.key,
1425
+ reason: R.reason || R.explanation || "",
1426
+ color: D.color || "var(--state-present)",
1427
+ signalKey: v.key
1428
+ });
1429
+ }
1430
+ return o;
1431
+ }, [W.signals]), ue = (($ = I.messages) == null ? void 0 : $.map((o, x) => {
1432
+ var H, j;
1433
+ const f = o.start ?? o.start_ms ? (o.start ?? o.start_ms) / 1e3 : 0, v = o.end ?? o.end_ms ? (o.end ?? o.end_ms) / 1e3 : f + 1, D = o.actor === "agent", R = D ? ((H = I.actor_map) == null ? void 0 : H.agent) || "Agent" : ((j = I.actor_map) == null ? void 0 : j.customer) || "Customer";
1434
+ return {
1435
+ startTime: f,
1436
+ endTime: v,
1437
+ actor: R,
1438
+ actorColor: D ? "var(--rail-outcome)" : "var(--rail-discovery)"
1439
+ };
1440
+ })) || [], V = me(() => {
1441
+ if (!S && z === 0) return -1;
1442
+ const o = I.messages || [], x = z * 1e3;
1443
+ for (let f = o.length - 1; f >= 0; f--) {
1444
+ const v = o[f].start ?? o[f].start_ms;
1445
+ if (v != null && x >= v) return f;
1446
+ }
1447
+ return -1;
1448
+ }, [z, S, I.messages]), A = (o) => {
1449
+ s.current && (s.current.currentTime = o, C(o));
1450
+ }, Y = () => {
1451
+ if (s.current)
1452
+ if (S)
1453
+ s.current.pause(), b(!1);
1454
+ else {
1455
+ const o = s.current.play();
1456
+ o !== void 0 && o.catch(() => {
1457
+ }), b(!0);
1458
+ }
1459
+ }, L = () => {
1460
+ s.current && (s.current.currentTime = Math.max(0, s.current.currentTime - 15));
1461
+ }, te = () => {
1462
+ if (s.current) {
1463
+ const o = _.duration_seconds || s.current.duration || 0;
1464
+ s.current.currentTime = Math.min(o, s.current.currentTime + 15);
1465
+ }
1466
+ }, Z = (o) => {
1467
+ s.current && (s.current.playbackRate = o, T(o));
1468
+ };
1469
+ ve(() => {
1470
+ const o = s.current;
1471
+ if (!o) return;
1472
+ const x = () => C(o.currentTime), f = () => b(!0), v = () => b(!1), D = () => b(!1);
1473
+ return o.addEventListener("timeupdate", x), o.addEventListener("play", f), o.addEventListener("pause", v), o.addEventListener("ended", D), () => {
1474
+ o.removeEventListener("timeupdate", x), o.removeEventListener("play", f), o.removeEventListener("pause", v), o.removeEventListener("ended", D);
1475
+ };
1476
+ }, [a]);
1477
+ const J = (o, x) => {
1478
+ const f = s.current;
1479
+ if (!f) return;
1480
+ const v = o / 1e3;
1481
+ f.currentTime = v, C(v);
1482
+ const D = f.play();
1483
+ if (D !== void 0 && D.catch(() => {
1484
+ }), d.current && (f.removeEventListener("timeupdate", d.current), d.current = null), x != null) {
1485
+ const R = x / 1e3, H = () => {
1486
+ f.currentTime >= R && (f.pause(), d.current && (f.removeEventListener("timeupdate", d.current), d.current = null));
1487
+ };
1488
+ d.current = H, f.addEventListener("timeupdate", H);
1489
+ }
1490
+ }, Q = (o, x) => {
1491
+ const v = (I.messages || [])[x], D = s.current;
1492
+ if (!v || !D) return;
1493
+ const R = v.start ?? v.start_ms, H = v.end ?? v.end_ms;
1494
+ if (S && V === x) {
1495
+ D.pause();
1496
+ return;
1497
+ }
1498
+ R != null && J(R, H);
1499
+ }, ne = (o) => {
1500
+ y(new Set(o));
1501
+ const x = document.getElementById("transcript-container");
1502
+ x && x.scrollIntoView({ behavior: "smooth", block: "nearest" }), setTimeout(() => y(/* @__PURE__ */ new Set()), 5e3);
1503
+ }, he = (o) => {
1504
+ u((x) => {
1505
+ const f = new Set(x);
1506
+ return f.has(o) ? f.delete(o) : f.add(o), f;
1507
+ });
1508
+ }, X = ((de = B.call_purpose) == null ? void 0 : de.interaction_driver) || P.one_liner || "Interaction Detail";
1509
+ return /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
1510
+ /* @__PURE__ */ e(
1511
+ rt,
1512
+ {
1513
+ title: X,
1514
+ meta: _,
1515
+ callPurpose: B.call_purpose,
1516
+ classification: B.classification,
1517
+ dimensions: O
1518
+ }
1519
+ ),
1520
+ /* @__PURE__ */ e(it, { scores: F.scores }),
1521
+ /* @__PURE__ */ e(Xe, { outcomeLift: U }),
1522
+ (l || c || r) && /* @__PURE__ */ e(K, { title: "Coaching Summary", children: /* @__PURE__ */ e(
1523
+ tt,
1524
+ {
1525
+ data: c,
1526
+ loading: l,
1527
+ error: r
1528
+ }
1529
+ ) }),
1530
+ /* @__PURE__ */ e(
1531
+ at,
1532
+ {
1533
+ signals: W,
1534
+ expandedSignals: g,
1535
+ toggleSignal: he,
1536
+ playAudio: J,
1537
+ highlightTurns: ne
1538
+ }
1539
+ ),
1540
+ /* @__PURE__ */ e(
1541
+ lt,
1542
+ {
1543
+ guidance: M,
1544
+ playAudio: J,
1545
+ highlightTurns: ne
1546
+ }
1547
+ ),
1548
+ /* @__PURE__ */ e(st, { nba: N }),
1549
+ /* @__PURE__ */ e(
1550
+ ct,
1551
+ {
1552
+ audioUrl: a,
1553
+ timelineSegments: ue,
1554
+ durationSeconds: _.duration_seconds,
1555
+ currentTimeSeconds: z,
1556
+ timelinePlaying: S,
1557
+ playbackRate: w,
1558
+ onSeek: A,
1559
+ onTogglePlay: Y,
1560
+ onSeekBack: L,
1561
+ onSeekForward: te,
1562
+ onSetPlaybackRate: Z,
1563
+ audioRef: s
1564
+ }
1565
+ ),
1566
+ /* @__PURE__ */ e(
1567
+ dt,
1568
+ {
1569
+ transcript: I,
1570
+ audioUrl: a,
1571
+ highlightedTurns: m,
1572
+ activeTurnIndex: V,
1573
+ timelinePlaying: S,
1574
+ turnObservations: G,
1575
+ setExpandedSignals: u,
1576
+ onTurnPlayPause: Q
1577
+ }
1578
+ ),
1579
+ /* @__PURE__ */ e(
1580
+ pt,
1581
+ {
1582
+ messageThread: q,
1583
+ sessionTitle: X,
1584
+ messages: []
1585
+ }
1586
+ )
1587
+ ] });
1588
+ }
1589
+ class ut extends Ie.Component {
1590
+ constructor(a) {
1591
+ super(a), this.state = { hasError: !1 };
1592
+ }
1593
+ static getDerivedStateFromError() {
1594
+ return { hasError: !0 };
1595
+ }
1596
+ componentDidCatch(a, c) {
1597
+ console.error("InteractionDetailPanel render error:", a, c == null ? void 0 : c.componentStack);
1598
+ }
1599
+ render() {
1600
+ return this.state.hasError ? this.props.fallback : this.props.children;
1601
+ }
1602
+ }
1603
+ function mt(t) {
1604
+ return /* @__PURE__ */ e(ut, { fallback: /* @__PURE__ */ e("div", { style: { padding: 16, color: "var(--state-unknown)", fontSize: 12 }, children: "Error rendering detail." }), children: /* @__PURE__ */ e(gt, { ...t }) });
1605
+ }
1606
+ function vt({ pattern: t }) {
1607
+ const [a, c] = k(!1), l = {
1608
+ name: "Customer Escalation Likelihood",
1609
+ description: "Based on observed patterns, this session shows indicators consistent with potential escalation.",
1610
+ technicalKey: "signal.escalation_likelihood",
1611
+ probability: 0.68,
1612
+ confidence: 0.81,
1613
+ observations: 3
1614
+ };
1615
+ return t === "text-link" ? /* @__PURE__ */ n(
1616
+ "div",
1617
+ {
1618
+ style: {
1619
+ position: "relative",
1620
+ background: "rgba(255, 255, 255, 0.82)",
1621
+ border: "1px solid rgba(52, 58, 64, 0.12)",
1622
+ borderRadius: "12px",
1623
+ overflow: "hidden",
1624
+ boxShadow: "0 2px 4px rgba(30, 33, 37, 0.06)"
1625
+ },
1626
+ children: [
1627
+ /* @__PURE__ */ e(
1628
+ "div",
1629
+ {
1630
+ style: {
1631
+ position: "absolute",
1632
+ left: 0,
1633
+ top: 0,
1634
+ bottom: 0,
1635
+ width: "5px",
1636
+ background: "#6B7C93",
1637
+ opacity: 0.6
1638
+ }
1639
+ }
1640
+ ),
1641
+ /* @__PURE__ */ n(
1642
+ "div",
1643
+ {
1644
+ style: {
1645
+ padding: "14px 16px 14px 21px"
1646
+ },
1647
+ children: [
1648
+ /* @__PURE__ */ e("div", { style: { marginBottom: "4px" }, children: /* @__PURE__ */ e(
1649
+ "span",
1650
+ {
1651
+ style: {
1652
+ fontSize: "13px",
1653
+ fontWeight: 680,
1654
+ color: "rgba(30, 33, 37, 0.92)",
1655
+ lineHeight: 1.2
1656
+ },
1657
+ children: l.name
1658
+ }
1659
+ ) }),
1660
+ /* @__PURE__ */ e(
1661
+ "div",
1662
+ {
1663
+ style: {
1664
+ fontSize: "12px",
1665
+ color: "rgba(30, 33, 37, 0.65)",
1666
+ lineHeight: 1.4,
1667
+ marginBottom: "6px"
1668
+ },
1669
+ children: l.description
1670
+ }
1671
+ ),
1672
+ /* @__PURE__ */ e(
1673
+ "div",
1674
+ {
1675
+ style: {
1676
+ fontSize: "11px",
1677
+ color: "rgba(30, 33, 37, 0.42)",
1678
+ fontFamily: "ui-monospace, monospace",
1679
+ marginBottom: "8px"
1680
+ },
1681
+ children: l.technicalKey
1682
+ }
1683
+ ),
1684
+ /* @__PURE__ */ n(
1685
+ "div",
1686
+ {
1687
+ style: {
1688
+ display: "flex",
1689
+ alignItems: "center",
1690
+ gap: "12px",
1691
+ fontSize: "11.5px",
1692
+ marginBottom: "10px"
1693
+ },
1694
+ children: [
1695
+ /* @__PURE__ */ e("span", { style: { color: "rgba(139, 157, 127, 0.65)" }, children: "prob" }),
1696
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(139, 157, 127, 0.85)" }, children: l.probability.toFixed(2) }),
1697
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
1698
+ /* @__PURE__ */ e("span", { style: { color: "rgba(184, 156, 106, 0.65)" }, children: "conf" }),
1699
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(184, 156, 106, 0.85)" }, children: l.confidence.toFixed(2) }),
1700
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
1701
+ /* @__PURE__ */ n("span", { style: { color: "rgba(30, 33, 37, 0.52)" }, children: [
1702
+ l.observations,
1703
+ " observations"
1704
+ ] })
1705
+ ]
1706
+ }
1707
+ ),
1708
+ !a && /* @__PURE__ */ e(
1709
+ "button",
1710
+ {
1711
+ onClick: () => c(!0),
1712
+ style: {
1713
+ fontSize: "12px",
1714
+ color: "rgba(30, 33, 37, 0.56)",
1715
+ background: "none",
1716
+ border: "none",
1717
+ padding: 0,
1718
+ cursor: "pointer",
1719
+ textDecoration: "underline",
1720
+ textDecorationColor: "rgba(30, 33, 37, 0.2)"
1721
+ },
1722
+ onMouseEnter: (r) => {
1723
+ r.currentTarget.style.color = "rgba(30, 33, 37, 0.78)", r.currentTarget.style.textDecorationColor = "rgba(30, 33, 37, 0.4)";
1724
+ },
1725
+ onMouseLeave: (r) => {
1726
+ r.currentTarget.style.color = "rgba(30, 33, 37, 0.56)", r.currentTarget.style.textDecorationColor = "rgba(30, 33, 37, 0.2)";
1727
+ },
1728
+ children: "View contributing observations"
1729
+ }
1730
+ )
1731
+ ]
1732
+ }
1733
+ ),
1734
+ a && /* @__PURE__ */ n(
1735
+ "div",
1736
+ {
1737
+ style: {
1738
+ borderTop: "1px solid rgba(52, 58, 64, 0.08)",
1739
+ background: "rgba(244, 241, 230, 0.25)",
1740
+ padding: "16px 16px 16px 21px"
1741
+ },
1742
+ children: [
1743
+ /* @__PURE__ */ e(
1744
+ "div",
1745
+ {
1746
+ style: {
1747
+ fontSize: "10px",
1748
+ fontWeight: 650,
1749
+ letterSpacing: "0.08em",
1750
+ textTransform: "uppercase",
1751
+ color: "rgba(30, 33, 37, 0.52)",
1752
+ marginBottom: "8px"
1753
+ },
1754
+ children: "Contributing Observations"
1755
+ }
1756
+ ),
1757
+ /* @__PURE__ */ e("div", { style: { fontSize: "12px", color: "rgba(30, 33, 37, 0.62)" }, children: "[Observations would appear here]" }),
1758
+ /* @__PURE__ */ e(
1759
+ "button",
1760
+ {
1761
+ onClick: () => c(!1),
1762
+ style: {
1763
+ marginTop: "10px",
1764
+ fontSize: "12px",
1765
+ color: "rgba(30, 33, 37, 0.56)",
1766
+ background: "none",
1767
+ border: "none",
1768
+ padding: 0,
1769
+ cursor: "pointer",
1770
+ textDecoration: "underline",
1771
+ textDecorationColor: "rgba(30, 33, 37, 0.2)"
1772
+ },
1773
+ onMouseEnter: (r) => {
1774
+ r.currentTarget.style.color = "rgba(30, 33, 37, 0.78)", r.currentTarget.style.textDecorationColor = "rgba(30, 33, 37, 0.4)";
1775
+ },
1776
+ onMouseLeave: (r) => {
1777
+ r.currentTarget.style.color = "rgba(30, 33, 37, 0.56)", r.currentTarget.style.textDecorationColor = "rgba(30, 33, 37, 0.2)";
1778
+ },
1779
+ children: "Hide observations"
1780
+ }
1781
+ )
1782
+ ]
1783
+ }
1784
+ )
1785
+ ]
1786
+ }
1787
+ ) : t === "rotating-chevron" ? /* @__PURE__ */ n(
1788
+ "div",
1789
+ {
1790
+ style: {
1791
+ position: "relative",
1792
+ background: "rgba(255, 255, 255, 0.82)",
1793
+ border: "1px solid rgba(52, 58, 64, 0.12)",
1794
+ borderRadius: "12px",
1795
+ overflow: "hidden",
1796
+ boxShadow: "0 2px 4px rgba(30, 33, 37, 0.06)"
1797
+ },
1798
+ children: [
1799
+ /* @__PURE__ */ e(
1800
+ "div",
1801
+ {
1802
+ style: {
1803
+ position: "absolute",
1804
+ left: 0,
1805
+ top: 0,
1806
+ bottom: 0,
1807
+ width: "5px",
1808
+ background: "#6B7C93",
1809
+ opacity: 0.6
1810
+ }
1811
+ }
1812
+ ),
1813
+ /* @__PURE__ */ e(
1814
+ "button",
1815
+ {
1816
+ type: "button",
1817
+ onClick: () => c(!a),
1818
+ style: {
1819
+ width: "100%",
1820
+ padding: "14px 16px 14px 21px",
1821
+ background: "transparent",
1822
+ border: "none",
1823
+ cursor: "pointer",
1824
+ textAlign: "left",
1825
+ transition: "background 0.15s ease"
1826
+ },
1827
+ onMouseEnter: (r) => {
1828
+ r.currentTarget.style.background = "rgba(231, 212, 162, 0.08)";
1829
+ },
1830
+ onMouseLeave: (r) => {
1831
+ r.currentTarget.style.background = "transparent";
1832
+ },
1833
+ children: /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "flex-start", gap: "12px" }, children: [
1834
+ /* @__PURE__ */ n("div", { style: { flex: 1, minWidth: 0 }, children: [
1835
+ /* @__PURE__ */ e("div", { style: { marginBottom: "4px" }, children: /* @__PURE__ */ e(
1836
+ "span",
1837
+ {
1838
+ style: {
1839
+ fontSize: "13px",
1840
+ fontWeight: 680,
1841
+ color: "rgba(30, 33, 37, 0.92)",
1842
+ lineHeight: 1.2
1843
+ },
1844
+ children: l.name
1845
+ }
1846
+ ) }),
1847
+ /* @__PURE__ */ e(
1848
+ "div",
1849
+ {
1850
+ style: {
1851
+ fontSize: "12px",
1852
+ color: "rgba(30, 33, 37, 0.65)",
1853
+ lineHeight: 1.4,
1854
+ marginBottom: "6px"
1855
+ },
1856
+ children: l.description
1857
+ }
1858
+ ),
1859
+ /* @__PURE__ */ e(
1860
+ "div",
1861
+ {
1862
+ style: {
1863
+ fontSize: "11px",
1864
+ color: "rgba(30, 33, 37, 0.42)",
1865
+ fontFamily: "ui-monospace, monospace",
1866
+ marginBottom: "8px"
1867
+ },
1868
+ children: l.technicalKey
1869
+ }
1870
+ ),
1871
+ /* @__PURE__ */ n(
1872
+ "div",
1873
+ {
1874
+ style: {
1875
+ display: "flex",
1876
+ alignItems: "center",
1877
+ gap: "12px",
1878
+ fontSize: "11.5px"
1879
+ },
1880
+ children: [
1881
+ /* @__PURE__ */ e("span", { style: { color: "rgba(139, 157, 127, 0.65)" }, children: "prob" }),
1882
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(139, 157, 127, 0.85)" }, children: l.probability.toFixed(2) }),
1883
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
1884
+ /* @__PURE__ */ e("span", { style: { color: "rgba(184, 156, 106, 0.65)" }, children: "conf" }),
1885
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(184, 156, 106, 0.85)" }, children: l.confidence.toFixed(2) }),
1886
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
1887
+ /* @__PURE__ */ n("span", { style: { color: "rgba(30, 33, 37, 0.52)" }, children: [
1888
+ l.observations,
1889
+ " observations"
1890
+ ] })
1891
+ ]
1892
+ }
1893
+ )
1894
+ ] }),
1895
+ /* @__PURE__ */ e(
1896
+ "div",
1897
+ {
1898
+ style: {
1899
+ paddingTop: "2px",
1900
+ color: "rgba(30, 33, 37, 0.42)",
1901
+ flexShrink: 0,
1902
+ transition: "transform 0.2s ease"
1903
+ },
1904
+ children: /* @__PURE__ */ e(
1905
+ be,
1906
+ {
1907
+ size: 18,
1908
+ style: {
1909
+ transform: a ? "rotate(180deg)" : "rotate(0deg)",
1910
+ transition: "transform 0.2s ease"
1911
+ }
1912
+ }
1913
+ )
1914
+ }
1915
+ )
1916
+ ] })
1917
+ }
1918
+ ),
1919
+ a && /* @__PURE__ */ n(
1920
+ "div",
1921
+ {
1922
+ style: {
1923
+ borderTop: "1px solid rgba(52, 58, 64, 0.08)",
1924
+ background: "rgba(244, 241, 230, 0.25)",
1925
+ padding: "16px 16px 16px 21px"
1926
+ },
1927
+ children: [
1928
+ /* @__PURE__ */ e(
1929
+ "div",
1930
+ {
1931
+ style: {
1932
+ fontSize: "10px",
1933
+ fontWeight: 650,
1934
+ letterSpacing: "0.08em",
1935
+ textTransform: "uppercase",
1936
+ color: "rgba(30, 33, 37, 0.52)",
1937
+ marginBottom: "8px"
1938
+ },
1939
+ children: "Contributing Observations"
1940
+ }
1941
+ ),
1942
+ /* @__PURE__ */ e("div", { style: { fontSize: "12px", color: "rgba(30, 33, 37, 0.62)" }, children: "[Observations would appear here]" })
1943
+ ]
1944
+ }
1945
+ )
1946
+ ]
1947
+ }
1948
+ ) : /* @__PURE__ */ n(
1949
+ "div",
1950
+ {
1951
+ style: {
1952
+ position: "relative",
1953
+ background: "rgba(255, 255, 255, 0.82)",
1954
+ border: "1px solid rgba(52, 58, 64, 0.12)",
1955
+ borderRadius: "12px",
1956
+ overflow: "hidden",
1957
+ boxShadow: "0 2px 4px rgba(30, 33, 37, 0.06)"
1958
+ },
1959
+ children: [
1960
+ /* @__PURE__ */ e(
1961
+ "div",
1962
+ {
1963
+ style: {
1964
+ position: "absolute",
1965
+ left: 0,
1966
+ top: 0,
1967
+ bottom: 0,
1968
+ width: "5px",
1969
+ background: "#6B7C93",
1970
+ opacity: 0.6
1971
+ }
1972
+ }
1973
+ ),
1974
+ /* @__PURE__ */ n(
1975
+ "button",
1976
+ {
1977
+ type: "button",
1978
+ onClick: () => c(!a),
1979
+ style: {
1980
+ width: "100%",
1981
+ padding: "14px 16px 14px 21px",
1982
+ background: "transparent",
1983
+ border: "none",
1984
+ cursor: "pointer",
1985
+ textAlign: "left",
1986
+ display: "flex",
1987
+ alignItems: "flex-start",
1988
+ gap: "12px",
1989
+ transition: "background 0.15s ease"
1990
+ },
1991
+ onMouseEnter: (r) => {
1992
+ r.currentTarget.style.background = "rgba(231, 212, 162, 0.08)";
1993
+ },
1994
+ onMouseLeave: (r) => {
1995
+ r.currentTarget.style.background = "transparent";
1996
+ },
1997
+ children: [
1998
+ /* @__PURE__ */ e(
1999
+ "div",
2000
+ {
2001
+ style: {
2002
+ paddingTop: "2px",
2003
+ color: "rgba(30, 33, 37, 0.42)",
2004
+ flexShrink: 0
2005
+ },
2006
+ children: a ? /* @__PURE__ */ e(be, { size: 16 }) : /* @__PURE__ */ e(Je, { size: 16 })
2007
+ }
2008
+ ),
2009
+ /* @__PURE__ */ n("div", { style: { flex: 1, minWidth: 0 }, children: [
2010
+ /* @__PURE__ */ e("div", { style: { marginBottom: "4px" }, children: /* @__PURE__ */ e(
2011
+ "span",
2012
+ {
2013
+ style: {
2014
+ fontSize: "13px",
2015
+ fontWeight: 680,
2016
+ color: "rgba(30, 33, 37, 0.92)",
2017
+ lineHeight: 1.2
2018
+ },
2019
+ children: l.name
2020
+ }
2021
+ ) }),
2022
+ /* @__PURE__ */ e(
2023
+ "div",
2024
+ {
2025
+ style: {
2026
+ fontSize: "12px",
2027
+ color: "rgba(30, 33, 37, 0.65)",
2028
+ lineHeight: 1.4,
2029
+ marginBottom: "6px"
2030
+ },
2031
+ children: l.description
2032
+ }
2033
+ ),
2034
+ /* @__PURE__ */ e(
2035
+ "div",
2036
+ {
2037
+ style: {
2038
+ fontSize: "11px",
2039
+ color: "rgba(30, 33, 37, 0.42)",
2040
+ fontFamily: "ui-monospace, monospace",
2041
+ marginBottom: "8px"
2042
+ },
2043
+ children: l.technicalKey
2044
+ }
2045
+ ),
2046
+ /* @__PURE__ */ n(
2047
+ "div",
2048
+ {
2049
+ style: {
2050
+ display: "flex",
2051
+ alignItems: "center",
2052
+ gap: "12px",
2053
+ fontSize: "11.5px"
2054
+ },
2055
+ children: [
2056
+ /* @__PURE__ */ e("span", { style: { color: "rgba(139, 157, 127, 0.65)" }, children: "prob" }),
2057
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(139, 157, 127, 0.85)" }, children: l.probability.toFixed(2) }),
2058
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
2059
+ /* @__PURE__ */ e("span", { style: { color: "rgba(184, 156, 106, 0.65)" }, children: "conf" }),
2060
+ /* @__PURE__ */ e("strong", { style: { color: "rgba(184, 156, 106, 0.85)" }, children: l.confidence.toFixed(2) }),
2061
+ /* @__PURE__ */ e("span", { style: { color: "rgba(30, 33, 37, 0.24)" }, children: "·" }),
2062
+ /* @__PURE__ */ n("span", { style: { color: "rgba(30, 33, 37, 0.52)" }, children: [
2063
+ l.observations,
2064
+ " observations"
2065
+ ] })
2066
+ ]
2067
+ }
2068
+ )
2069
+ ] })
2070
+ ]
2071
+ }
2072
+ ),
2073
+ a && /* @__PURE__ */ n(
2074
+ "div",
2075
+ {
2076
+ style: {
2077
+ borderTop: "1px solid rgba(52, 58, 64, 0.08)",
2078
+ background: "rgba(244, 241, 230, 0.25)",
2079
+ padding: "16px 16px 16px 21px"
2080
+ },
2081
+ children: [
2082
+ /* @__PURE__ */ e(
2083
+ "div",
2084
+ {
2085
+ style: {
2086
+ fontSize: "10px",
2087
+ fontWeight: 650,
2088
+ letterSpacing: "0.08em",
2089
+ textTransform: "uppercase",
2090
+ color: "rgba(30, 33, 37, 0.52)",
2091
+ marginBottom: "8px"
2092
+ },
2093
+ children: "Contributing Observations"
2094
+ }
2095
+ ),
2096
+ /* @__PURE__ */ e("div", { style: { fontSize: "12px", color: "rgba(30, 33, 37, 0.62)" }, children: "[Observations would appear here]" })
2097
+ ]
2098
+ }
2099
+ )
2100
+ ]
2101
+ }
2102
+ );
2103
+ }
2104
+ export {
2105
+ Xe as AgentLiftCard,
2106
+ tt as CoachingSynthesisCard,
2107
+ kt as ConditionCard,
2108
+ Ee as EvidenceItem,
2109
+ vt as ExpandPatternComparison,
2110
+ rt as InteractionContext,
2111
+ mt as InteractionDetailPanel,
2112
+ lt as InteractionGuidance,
2113
+ st as InteractionNBA,
2114
+ ct as InteractionRecording,
2115
+ it as InteractionScores,
2116
+ at as InteractionSignals,
2117
+ dt as InteractionTranscript,
2118
+ zt as ModelScoreCard,
2119
+ wt as ObservationCard,
2120
+ Ct as ScoreDriverCard,
2121
+ Tt as ScoreDriverCardVariant,
2122
+ _t as SignalCard,
2123
+ It as SmallObservationCard,
2124
+ Dt as SummarySection
2125
+ };
2126
+ //# sourceMappingURL=interactionDetails.es.js.map