@burdenoff/fe-libs 2026.1013.8 → 2026.1013.10

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.
@@ -8,265 +8,266 @@ import { AssistantAttachmentButton as re } from "../composer/AssistantAttachment
8
8
  import { AssistantAttachmentChips as ie } from "../composer/AssistantAttachmentChips.js";
9
9
  import { ASSISTANT_PANEL_ATTR as ae, ASSISTANT_VOICE_SESSION_ATTR as oe } from "../panelOverlays.js";
10
10
  import { AssistantVoiceOrb as se } from "./AssistantVoiceOrb.js";
11
- import { VoiceMiniController as ce } from "./VoiceMiniController.js";
12
- import { VoiceStage as le } from "./VoiceStage.js";
13
- import { VoiceTranscriptDrawer as ue } from "./VoiceTranscriptDrawer.js";
14
- import { escapeBelongsToLayerAbove as de, voiceSessionEscapeAction as fe } from "./voiceSessionEscape.js";
15
- import { HandsFreePrivacyNotice as pe } from "./HandsFreePrivacyNotice.js";
16
- import { useCallback as s, useEffect as c, useMemo as me, useRef as l, useState as u } from "react";
17
- import { Maximize2 as he, Minimize2 as ge, ScrollText as _e, X as d } from "lucide-react";
11
+ import { useLiveAvatarVoiceView as ce } from "../assistantLiveAvatarSeam.js";
12
+ import { VoiceMiniController as le } from "./VoiceMiniController.js";
13
+ import { VoiceStage as ue } from "./VoiceStage.js";
14
+ import { VoiceTranscriptDrawer as de } from "./VoiceTranscriptDrawer.js";
15
+ import { escapeBelongsToLayerAbove as fe, voiceSessionEscapeAction as pe } from "./voiceSessionEscape.js";
16
+ import { HandsFreePrivacyNotice as me } from "./HandsFreePrivacyNotice.js";
17
+ import { useCallback as s, useEffect as c, useMemo as he, useRef as l, useState as u } from "react";
18
+ import { Maximize2 as ge, Minimize2 as _e, ScrollText as ve, X as d } from "lucide-react";
18
19
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
19
20
  //#region src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
20
- var m = ({ session: m, turns: be = [], onSaveTranscript: xe, onContinueInChat: Se, notice: Ce = null, privacyNotice: h = null, spoken: g, onInterrupt: we, onToggleMute: _, attachments: v = [], onAttachFiles: y, onRemoveAttachment: Te, onRetryAttachment: Ee, canAttachMore: De = !0, preparingAttachments: b = 0, attachmentsLocked: x = !1, attachmentNotice: S = null, spokenChunks: C = null, onEnd: w, capturing: Oe = !0, interrupting: ke = !1, awaitingEndpoint: Ae = !1, holding: T = !1, correcting: je = !1, onLetMeFinish: E, onImDone: D, proposalChip: O = null, proposalTray: k = null, renderAfterTurn: Me }) => {
21
- let A = n(), { muted: j, error: M } = m, N = l(null), P = l(null), [F, I] = u("mini"), L = F === "full", R = F === "mini", z = F === "mini" ? "panel" : F === "panel" ? "full" : "mini", [B, V] = u(!1);
22
- t("assistant.transcript", me(() => ({ run: () => B ? { status: "already" } : (V(!0), { status: "done" }) }), [B]));
23
- let H = k !== null && !R, U = l(!1), W = l(_);
24
- W.current = _;
25
- let G = s(() => {
26
- m.phase !== "listening" && m.phase !== "thinking" || j || U.current || o(m) || (U.current = !0, W.current());
27
- }, [j, m]), K = s(() => {
28
- U.current && (U.current = !1, W.current());
29
- }, []), Ne = G;
21
+ var m = ({ session: m, turns: xe = [], onSaveTranscript: Se, onContinueInChat: Ce, notice: h = null, privacyNotice: g = null, spoken: _, onInterrupt: we, onToggleMute: v, attachments: y = [], onAttachFiles: b, onRemoveAttachment: Te, onRetryAttachment: Ee, canAttachMore: De = !0, preparingAttachments: x = 0, attachmentsLocked: S = !1, attachmentNotice: C = null, spokenChunks: w = null, onEnd: T, capturing: Oe = !0, interrupting: ke = !1, awaitingEndpoint: Ae = !1, holding: E = !1, correcting: je = !1, onLetMeFinish: D, onImDone: O, proposalChip: k = null, proposalTray: A = null, renderAfterTurn: Me }) => {
22
+ let j = n(), { muted: M, error: N } = m, P = l(null), F = l(null), [Ne, I] = u("mini"), L = ce(Ne, m.phase === "ended"), R = L === "full", z = L === "mini", B = L === "mini" ? "panel" : L === "panel" ? "full" : "mini", [V, H] = u(!1);
23
+ t("assistant.transcript", he(() => ({ run: () => V ? { status: "already" } : (H(!0), { status: "done" }) }), [V]));
24
+ let U = A !== null && !z, W = l(!1), G = l(v);
25
+ G.current = v;
26
+ let K = s(() => {
27
+ m.phase !== "listening" && m.phase !== "thinking" || M || W.current || o(m) || (W.current = !0, G.current());
28
+ }, [M, m]), q = s(() => {
29
+ W.current && (W.current = !1, G.current());
30
+ }, []), Pe = K;
30
31
  c(() => {
31
32
  let e = () => {
32
- document.visibilityState === "hidden" ? G() : K();
33
+ document.visibilityState === "hidden" ? K() : q();
33
34
  };
34
35
  return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
35
- }, [G, K]), c(() => {
36
- let e = K;
36
+ }, [K, q]), c(() => {
37
+ let e = q;
37
38
  return window.addEventListener("focus", e), () => {
38
- window.removeEventListener("focus", e), U.current = !1;
39
+ window.removeEventListener("focus", e), W.current = !1;
39
40
  };
40
41
  }, []), c(() => {
41
- document.activeElement?.closest("[data-hands-free-notice]") || N.current?.focus();
42
- }, []), e(P, { fallbackSelector: `[${ae}]` }), c(() => {
42
+ document.activeElement?.closest("[data-hands-free-notice]") || P.current?.focus();
43
+ }, []), e(F, { fallbackSelector: `[${ae}]` }), c(() => {
43
44
  let e = (e) => {
44
45
  if (e.key === "Escape") {
45
- let t = fe({
46
+ let t = pe({
46
47
  defaultPrevented: e.defaultPrevented,
47
- layerAbove: de({
48
+ layerAbove: fe({
48
49
  target: e.target,
49
- session: P.current,
50
+ session: F.current,
50
51
  doc: document
51
52
  }),
52
- transcriptOpen: B
53
+ transcriptOpen: V
53
54
  });
54
55
  if (t === "ignore") return;
55
- e.preventDefault(), t === "close-transcript" ? V(!1) : h ? h.decline() : H ? k?.onClose() : w();
56
+ e.preventDefault(), t === "close-transcript" ? H(!1) : g ? g.decline() : U ? A?.onClose() : T();
56
57
  return;
57
58
  }
58
- if (e.key !== "Tab" || !L) return;
59
- let t = (B ? P.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : P.current)?.querySelectorAll("button:not([disabled])");
59
+ if (e.key !== "Tab" || !R) return;
60
+ let t = (V ? F.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : F.current)?.querySelectorAll("button:not([disabled])");
60
61
  if (!t || t.length === 0) return;
61
62
  let n = t[0], r = t[t.length - 1];
62
63
  !n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
63
64
  };
64
65
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
65
66
  }, [
66
- w,
67
- L,
68
- B,
69
- H,
70
- k,
71
- h
67
+ T,
68
+ R,
69
+ V,
70
+ U,
71
+ A,
72
+ g
72
73
  ]);
73
- let q = Ce !== null && M === null, J = o(m), Y = E && D && m.phase === "listening" && !j && M === null ? {
74
- letMeFinish: E,
75
- imDone: D
76
- } : null, X = Y !== null;
74
+ let J = h !== null && N === null, Y = o(m), X = D && O && m.phase === "listening" && !M && N === null ? {
75
+ letMeFinish: D,
76
+ imDone: O
77
+ } : null, Fe = X !== null;
77
78
  c(() => {
78
- if (X) return;
79
+ if (Fe) return;
79
80
  let e = document.activeElement;
80
- (!e || e === document.body) && N.current?.focus();
81
- }, [X]);
81
+ (!e || e === document.body) && P.current?.focus();
82
+ }, [Fe]);
82
83
  let Z = i({
83
84
  snapshot: m,
84
85
  capturing: Oe,
85
86
  interrupting: ke,
86
87
  awaitingEndpoint: Ae
87
- }), Pe = (() => {
88
+ }), Ie = (() => {
88
89
  switch (Z) {
89
- case "connecting": return A("voiceSession.connecting", "Starting the microphone…");
90
- case "endpoint-grace": return A("voiceSession.endpointGrace", "Still listening — take your time");
91
- case "interrupting": return A("voiceSession.interrupting", "Stopped — go ahead");
92
- case "thinking": return A(a.key, a.fallback);
93
- case "speaking": return A("voiceSession.speaking", "Speaking — tap to stop");
90
+ case "connecting": return j("voiceSession.connecting", "Starting the microphone…");
91
+ case "endpoint-grace": return j("voiceSession.endpointGrace", "Still listening — take your time");
92
+ case "interrupting": return j("voiceSession.interrupting", "Stopped — go ahead");
93
+ case "thinking": return j(a.key, a.fallback);
94
+ case "speaking": return j("voiceSession.speaking", "Speaking — tap to stop");
94
95
  case "mic-error":
95
96
  case "ended": return "";
96
- case "listening": return j ? A("voiceSession.muted", "Microphone off") : A("voiceSession.listening", "Listening…");
97
+ case "listening": return M ? j("voiceSession.muted", "Microphone off") : j("voiceSession.listening", "Listening…");
97
98
  default: return Z;
98
99
  }
99
- })(), Q = !j && (Z === "listening" || Z === "endpoint-grace"), Fe = Q && T ? A("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : Q && je ? A("voiceSession.correcting", "Stopped that answer — listening to your correction") : Pe, $ = ne({
100
- tr: A,
100
+ })(), Le = !M && (Z === "listening" || Z === "endpoint-grace"), Re = Le && E ? j("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : Le && je ? j("voiceSession.correcting", "Stopped that answer — listening to your correction") : Ie, Q = ne({
101
+ tr: j,
101
102
  stage: Z,
102
- muted: j,
103
- label: Fe
104
- }), Ie = te(Fe, $), Le = Z === "thinking";
103
+ muted: M,
104
+ label: Re
105
+ }), ze = te(Re, Q), $ = Z === "thinking";
105
106
  return /* @__PURE__ */ p("div", {
106
- ref: P,
107
- className: `flex flex-col items-center justify-between bg-bg-sunken ${F === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : F === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 min-h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
107
+ ref: F,
108
+ className: `flex flex-col items-center justify-between bg-bg-sunken ${L === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : L === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 min-h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
108
109
  role: "dialog",
109
- "aria-modal": L || void 0,
110
- "aria-label": A("voiceSession.title", "Voice conversation"),
110
+ "aria-modal": R || void 0,
111
+ "aria-label": j("voiceSession.title", "Voice conversation"),
111
112
  "data-testid": "assistant-voice-session",
112
113
  [oe]: "",
113
114
  children: [
114
115
  /* @__PURE__ */ p("button", {
115
- ref: N,
116
+ ref: P,
116
117
  type: "button",
117
- onClick: w,
118
- className: `absolute ${L ? "right-6 top-6 h-14 gap-2 px-5 text-base" : R ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
119
- title: A("voiceSession.end", "End the voice conversation"),
118
+ onClick: T,
119
+ className: `absolute ${R ? "right-6 top-6 h-14 gap-2 px-5 text-base" : z ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
120
+ title: j("voiceSession.end", "End the voice conversation"),
120
121
  "data-testid": "assistant-voice-end",
121
122
  children: [/* @__PURE__ */ f(d, {
122
- className: L ? "size-6" : R ? "size-4" : "size-5",
123
+ className: R ? "size-6" : z ? "size-4" : "size-5",
123
124
  "aria-hidden": "true"
124
125
  }), /* @__PURE__ */ f("span", {
125
- className: `truncate whitespace-nowrap font-medium ${R ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
126
- children: A("voiceSession.endShort", "End")
126
+ className: `truncate whitespace-nowrap font-medium ${z ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
127
+ children: j("voiceSession.endShort", "End")
127
128
  })]
128
129
  }),
129
130
  /* @__PURE__ */ p("div", {
130
- className: `flex flex-col items-center ${R ? `px-3 ${q || S ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${q || S ? L ? "pt-14" : "pt-10" : ""}`}`,
131
- children: [q ? /* @__PURE__ */ f("p", {
131
+ className: `flex flex-col items-center ${z ? `px-3 ${J || C ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${J || C ? R ? "pt-14" : "pt-10" : ""}`}`,
132
+ children: [J ? /* @__PURE__ */ f("p", {
132
133
  className: "max-w-xs text-center text-xs text-status-warning",
133
134
  "data-testid": "assistant-voice-notice",
134
- children: ve(Ce, A)
135
- }) : null, S ? /* @__PURE__ */ f("p", {
135
+ children: ye(h, j)
136
+ }) : null, C ? /* @__PURE__ */ f("p", {
136
137
  className: "max-w-xs text-center text-xs text-status-warning",
137
138
  role: "status",
138
139
  "aria-live": "polite",
139
140
  "data-testid": "assistant-voice-attachment-notice",
140
- children: S
141
+ children: C
141
142
  }) : null]
142
143
  }),
143
144
  (() => {
144
145
  let e = /* @__PURE__ */ f(se, {
145
146
  session: m,
146
- compact: R,
147
+ compact: z,
147
148
  connecting: Z === "connecting",
148
- onPress: r(Z) ? we : _,
149
- label: r(Z) ? A("voiceSession.interrupt", "Stop the assistant and speak") : j ? A("voiceSession.unmute", "Turn the microphone on") : A("voiceSession.mute", "Turn the microphone off")
150
- }), t = Y ? /* @__PURE__ */ f("button", {
149
+ onPress: r(Z) ? we : v,
150
+ label: r(Z) ? j("voiceSession.interrupt", "Stop the assistant and speak") : M ? j("voiceSession.unmute", "Turn the microphone on") : j("voiceSession.mute", "Turn the microphone off")
151
+ }), t = X ? /* @__PURE__ */ f("button", {
151
152
  type: "button",
152
- onClick: T ? Y.imDone : Y.letMeFinish,
153
- className: `flex items-center justify-center rounded-full border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${R ? "h-7 px-3 text-xs" : L ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${T ? "border-transparent bg-action-primary-bg text-action-primary-text hover:opacity-90" : "border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`,
154
- title: T ? A("voiceSession.imDoneHint", "Send what you said now") : A("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
153
+ onClick: E ? X.imDone : X.letMeFinish,
154
+ className: `flex items-center justify-center rounded-full border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${z ? "h-7 px-3 text-xs" : R ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${E ? "border-transparent bg-action-primary-bg text-action-primary-text hover:opacity-90" : "border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`,
155
+ title: E ? j("voiceSession.imDoneHint", "Send what you said now") : j("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
155
156
  "data-testid": "assistant-voice-hold",
156
- "data-holding": T ? "true" : "false",
157
- children: T ? A("voiceSession.imDone", "I’m done") : A("voiceSession.letMeFinish", "Let me finish")
157
+ "data-holding": E ? "true" : "false",
158
+ children: E ? j("voiceSession.imDone", "I’m done") : j("voiceSession.letMeFinish", "Let me finish")
158
159
  }) : null, n = t ? /* @__PURE__ */ p("div", {
159
160
  className: "flex flex-col items-center gap-2",
160
161
  children: [e, t]
161
- }) : e, i = ee(Z) ? g : J || null, a = M === null ? null : ye(M, A);
162
- return R ? /* @__PURE__ */ f(ce, {
163
- spokenChunks: C,
162
+ }) : e, i = ee(Z) ? _ : Y || null, a = N === null ? null : be(N, j);
163
+ return z ? /* @__PURE__ */ f(le, {
164
+ spokenChunks: w,
164
165
  state: Z,
165
166
  caption: i,
166
- statusText: Ie,
167
- statusSuffix: $,
168
- rotateStatus: Le,
167
+ statusText: ze,
168
+ statusSuffix: Q,
169
+ rotateStatus: $,
169
170
  errorText: a,
170
171
  control: n
171
- }) : /* @__PURE__ */ f(le, {
172
+ }) : /* @__PURE__ */ f(ue, {
172
173
  state: Z,
173
- userCaption: J || null,
174
- spokenChunks: C,
175
- assistantCaption: g,
176
- expanded: L,
177
- statusText: Ie,
178
- statusSuffix: $,
179
- rotateStatus: Le,
174
+ userCaption: Y || null,
175
+ spokenChunks: w,
176
+ assistantCaption: _,
177
+ expanded: R,
178
+ statusText: ze,
179
+ statusSuffix: Q,
180
+ rotateStatus: $,
180
181
  errorText: a,
181
182
  control: n
182
183
  });
183
184
  })(),
184
- O && !H ? /* @__PURE__ */ f("div", {
185
- className: R ? "absolute left-20 right-36 top-2 flex justify-center" : `flex w-full justify-center ${L ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
185
+ k && !U ? /* @__PURE__ */ f("div", {
186
+ className: z ? "absolute left-20 right-36 top-2 flex justify-center" : `flex w-full justify-center ${R ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
186
187
  children: /* @__PURE__ */ f("button", {
187
188
  type: "button",
188
189
  onClick: () => {
189
- I("panel"), O.onOpen();
190
+ I("panel"), k.onOpen();
190
191
  },
191
- className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${R ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
192
+ className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${z ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
192
193
  "data-testid": "assistant-voice-proposal-chip",
193
- children: O.label
194
+ children: k.label
194
195
  })
195
196
  }) : null,
196
- k && H ? /* @__PURE__ */ p("div", {
197
- className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${L ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
197
+ A && U ? /* @__PURE__ */ p("div", {
198
+ className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${R ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
198
199
  "data-testid": "assistant-voice-proposal-tray",
199
200
  children: [/* @__PURE__ */ f("div", {
200
201
  className: "flex justify-end",
201
202
  children: /* @__PURE__ */ f("button", {
202
203
  type: "button",
203
- onClick: k.onClose,
204
+ onClick: A.onClose,
204
205
  className: "flex size-8 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
205
- "aria-label": k.closeLabel,
206
+ "aria-label": A.closeLabel,
206
207
  "data-testid": "assistant-voice-proposal-tray-close",
207
208
  children: /* @__PURE__ */ f(d, {
208
209
  className: "size-4",
209
210
  "aria-hidden": "true"
210
211
  })
211
212
  })
212
- }), k.content]
213
+ }), A.content]
213
214
  }) : null,
214
- h ? /* @__PURE__ */ f(pe, {
215
- view: F,
216
- onContinue: h.accept,
217
- onNotNow: h.decline
215
+ g ? /* @__PURE__ */ f(me, {
216
+ view: L,
217
+ onContinue: g.accept,
218
+ onNotNow: g.decline
218
219
  }) : null,
219
- B ? /* @__PURE__ */ f(ue, {
220
- turns: be,
221
- onClose: () => V(!1),
222
- onSave: xe,
223
- onContinueInChat: Se,
220
+ V ? /* @__PURE__ */ f(de, {
221
+ turns: xe,
222
+ onClose: () => H(!1),
223
+ onSave: Se,
224
+ onContinueInChat: Ce,
224
225
  renderAfterTurn: Me
225
226
  }) : null,
226
- y ? /* @__PURE__ */ f("div", {
227
- className: `absolute ${L ? "left-6 top-6" : R ? "left-11 top-2" : "left-3 top-3"}`,
227
+ b ? /* @__PURE__ */ f("div", {
228
+ className: `absolute ${R ? "left-6 top-6" : z ? "left-11 top-2" : "left-3 top-3"}`,
228
229
  children: /* @__PURE__ */ f(re, {
229
230
  onFiles: (e) => {
230
- y(e), I((e) => e === "mini" ? "panel" : e);
231
+ b(e), I((e) => e === "mini" ? "panel" : e);
231
232
  },
232
- onPickerOpen: Ne,
233
+ onPickerOpen: Pe,
233
234
  direction: "down",
234
235
  canAddMore: De,
235
- disabled: x
236
+ disabled: S
236
237
  })
237
238
  }) : null,
238
- (v.length > 0 || b > 0) && !R ? /* @__PURE__ */ f("div", {
239
- className: `absolute ${L ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
239
+ (y.length > 0 || x > 0) && !z ? /* @__PURE__ */ f("div", {
240
+ className: `absolute ${R ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
240
241
  "data-testid": "assistant-voice-attachments",
241
242
  children: /* @__PURE__ */ f(ie, {
242
- attachments: v,
243
+ attachments: y,
243
244
  onRemove: Te ?? (() => void 0),
244
245
  onRetry: Ee ?? (() => void 0),
245
- preparingCount: b,
246
- disabled: x
246
+ preparingCount: x,
247
+ disabled: S
247
248
  })
248
249
  }) : null,
249
250
  /* @__PURE__ */ f("button", {
250
251
  type: "button",
251
- onClick: () => V((e) => !e),
252
- className: `absolute ${L ? "bottom-6 right-6 size-14" : R ? "right-2 top-2 size-8" : "bottom-3 right-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
253
- "aria-pressed": B,
254
- "aria-label": A("voiceSession.transcriptTitle", "Voice transcript"),
252
+ onClick: () => H((e) => !e),
253
+ className: `absolute ${R ? "bottom-6 right-6 size-14" : z ? "right-2 top-2 size-8" : "bottom-3 right-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
254
+ "aria-pressed": V,
255
+ "aria-label": j("voiceSession.transcriptTitle", "Voice transcript"),
255
256
  "data-testid": "assistant-voice-transcript-toggle",
256
- children: /* @__PURE__ */ f(_e, { className: L ? "size-6" : R ? "size-4" : "size-5" })
257
+ children: /* @__PURE__ */ f(ve, { className: R ? "size-6" : z ? "size-4" : "size-5" })
257
258
  }),
258
259
  /* @__PURE__ */ f("button", {
259
260
  type: "button",
260
- onClick: () => I(z),
261
- className: `absolute ${L ? "bottom-6 left-6 size-14" : R ? "left-2 top-2 size-8" : "bottom-3 left-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
262
- "aria-label": z === "panel" ? A("voiceSession.expandPanel", "Show the conversation in the panel") : z === "full" ? A("voiceSession.expand", "Expand the conversation to full screen") : A("voiceSession.collapse", "Shrink to the compact controller"),
261
+ onClick: () => I(B),
262
+ className: `absolute ${R ? "bottom-6 left-6 size-14" : z ? "left-2 top-2 size-8" : "bottom-3 left-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
263
+ "aria-label": B === "panel" ? j("voiceSession.expandPanel", "Show the conversation in the panel") : B === "full" ? j("voiceSession.expand", "Expand the conversation to full screen") : j("voiceSession.collapse", "Shrink to the compact controller"),
263
264
  "data-testid": "assistant-voice-expand",
264
- children: L ? /* @__PURE__ */ f(ge, { className: "size-5" }) : /* @__PURE__ */ f(he, { className: R ? "size-4" : "size-5" })
265
+ children: R ? /* @__PURE__ */ f(_e, { className: "size-5" }) : /* @__PURE__ */ f(ge, { className: z ? "size-4" : "size-5" })
265
266
  })
266
267
  ]
267
268
  });
268
269
  };
269
- function ve(e, t) {
270
+ function ye(e, t) {
270
271
  switch (e) {
271
272
  case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
272
273
  case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
@@ -277,7 +278,7 @@ function ve(e, t) {
277
278
  default: return e;
278
279
  }
279
280
  }
280
- function ye(e, t) {
281
+ function be(e, t) {
281
282
  switch (e) {
282
283
  case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
283
284
  case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
@@ -3,59 +3,64 @@ import { showPreviousChunk as r } from "../../voice/miniCaptionBudget.js";
3
3
  import { isAwaitingFirstChunk as i } from "../../voice/speechPlayback.js";
4
4
  import { VoiceWaveform as a } from "./VoiceWaveform.js";
5
5
  import { VoiceStatusText as o } from "./VoiceStatusText.js";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { LiveAvatarMiniIndicator as s, useLiveAvatarMiniIndicatorShown as c } from "../assistantLiveAvatarSeam.js";
7
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
7
8
  //#region src/shared/assistant/ui/voice/VoiceMiniController.tsx
8
- var u = ({ state: u, caption: d, spokenChunks: f = null, statusText: p, statusSuffix: m, rotateStatus: h, control: g, errorText: _ = null }) => {
9
- let v = e(u), y = v && f && f.index >= 0 ? f : null, b = v && i(f);
10
- return /* @__PURE__ */ l("div", {
9
+ var f = " self-stretch justify-end pb-8.5 [container-type:size] [@container_(min-height:4.0312rem)_and_(max-height:5.2343rem)]:[&>p[role=status]]:line-clamp-2 [@container_(max-height:4.0312rem)]:[&>p[role=status]]:line-clamp-1 [@container_(max-height:4.0312rem)]:[&>p[role=status]]:min-h-5 [@container_(max-height:5.2343rem)]:[&>p[role=status]>span:not(:last-child)]:sr-only", p = ({ state: p, caption: m, spokenChunks: h = null, statusText: g, statusSuffix: _, rotateStatus: v, control: y, errorText: b = null }) => {
10
+ let x = e(p), S = x && h && h.index >= 0 ? h : null, C = x && i(h);
11
+ return /* @__PURE__ */ d("div", {
11
12
  className: "flex min-h-0 w-full flex-1 items-center gap-3 px-4",
12
13
  "data-testid": "assistant-voice-mini",
13
- "data-state": u,
14
- children: [/* @__PURE__ */ l("div", {
15
- className: "flex min-w-0 flex-1 flex-col gap-1.5",
16
- children: [/* @__PURE__ */ l("div", {
17
- className: "flex items-center gap-2",
18
- children: [/* @__PURE__ */ c(a, {
19
- active: t(u),
20
- settled: n(u),
21
- tone: u === "speaking" ? "speaking" : "listening"
22
- }), /* @__PURE__ */ c(o, {
23
- className: "truncate text-xs text-text-muted",
24
- status: p,
25
- suffix: m,
26
- rotating: h
14
+ "data-state": p,
15
+ children: [
16
+ /* @__PURE__ */ d("div", {
17
+ className: `flex min-w-0 flex-1 flex-col gap-1.5${c() ? f : ""}`,
18
+ children: [/* @__PURE__ */ d("div", {
19
+ className: "flex items-center gap-2",
20
+ children: [/* @__PURE__ */ u(a, {
21
+ active: t(p),
22
+ settled: n(p),
23
+ tone: p === "speaking" ? "speaking" : "listening"
24
+ }), /* @__PURE__ */ u(o, {
25
+ className: "truncate text-xs text-text-muted",
26
+ status: g,
27
+ suffix: _,
28
+ rotating: v
29
+ })]
30
+ }), p === "mic-error" ? /* @__PURE__ */ u("p", {
31
+ className: "line-clamp-2 text-xs text-status-warning",
32
+ role: "alert",
33
+ "data-testid": "assistant-voice-mini-error",
34
+ children: b
35
+ }) : m ? /* @__PURE__ */ u("p", {
36
+ className: [
37
+ "line-clamp-3 break-words text-left text-sm leading-snug",
38
+ C ? "min-h-9" : "",
39
+ x ? "font-semibold text-text-primary" : "font-semibold text-text-secondary"
40
+ ].join(" "),
41
+ role: "status",
42
+ "aria-live": "polite",
43
+ "data-testid": "assistant-voice-caption",
44
+ children: S ? /* @__PURE__ */ d(l, { children: [r(S) ? /* @__PURE__ */ d("span", {
45
+ className: "text-text-muted transition-colors duration-300",
46
+ children: [S.chunks[S.index - 1], " "]
47
+ }) : null, /* @__PURE__ */ u("span", {
48
+ className: "text-text-primary",
49
+ "data-testid": "assistant-voice-caption-current",
50
+ children: S.chunks[S.index]
51
+ })] }) : C ? null : m
52
+ }) : /* @__PURE__ */ u("div", {
53
+ className: "h-9",
54
+ "aria-hidden": "true"
27
55
  })]
28
- }), u === "mic-error" ? /* @__PURE__ */ c("p", {
29
- className: "line-clamp-2 text-xs text-status-warning",
30
- role: "alert",
31
- "data-testid": "assistant-voice-mini-error",
32
- children: _
33
- }) : d ? /* @__PURE__ */ c("p", {
34
- className: [
35
- "line-clamp-3 break-words text-left text-sm leading-snug",
36
- b ? "min-h-9" : "",
37
- v ? "font-semibold text-text-primary" : "font-semibold text-text-secondary"
38
- ].join(" "),
39
- role: "status",
40
- "aria-live": "polite",
41
- "data-testid": "assistant-voice-caption",
42
- children: y ? /* @__PURE__ */ l(s, { children: [r(y) ? /* @__PURE__ */ l("span", {
43
- className: "text-text-muted transition-colors duration-300",
44
- children: [y.chunks[y.index - 1], " "]
45
- }) : null, /* @__PURE__ */ c("span", {
46
- className: "text-text-primary",
47
- "data-testid": "assistant-voice-caption-current",
48
- children: y.chunks[y.index]
49
- })] }) : b ? null : d
50
- }) : /* @__PURE__ */ c("div", {
51
- className: "h-9",
52
- "aria-hidden": "true"
53
- })]
54
- }), /* @__PURE__ */ c("div", {
55
- className: "shrink-0",
56
- children: g
57
- })]
56
+ }),
57
+ /* @__PURE__ */ u("div", {
58
+ className: "shrink-0",
59
+ children: y
60
+ }),
61
+ /* @__PURE__ */ u(s, {})
62
+ ]
58
63
  });
59
64
  };
60
65
  //#endregion
61
- export { u as VoiceMiniController };
66
+ export { p as VoiceMiniController };