@burdenoff/fe-libs 2026.1114.12 → 2026.1114.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/shared/assistant/conversation.d.ts +16 -0
  2. package/dist/shared/assistant/i18nManifest.d.ts +32 -0
  3. package/dist/shared/assistant/i18nManifest.js +32 -0
  4. package/dist/shared/assistant/index.d.ts +10 -0
  5. package/dist/shared/assistant/store.d.ts +7 -0
  6. package/dist/shared/assistant/store.js +3 -0
  7. package/dist/shared/assistant/ui/AssistantChatArea.js +1275 -1181
  8. package/dist/shared/assistant/ui/AssistantMessageList.d.ts +14 -0
  9. package/dist/shared/assistant/ui/AssistantMessageList.js +55 -52
  10. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
  11. package/dist/shared/assistant/ui/composer/AssistantComposer.js +400 -311
  12. package/dist/shared/assistant/ui/composer/AssistantDictation.d.ts +42 -0
  13. package/dist/shared/assistant/ui/composer/AssistantDictation.js +127 -0
  14. package/dist/shared/assistant/ui/composer/AssistantMicMenu.d.ts +23 -0
  15. package/dist/shared/assistant/ui/composer/AssistantMicMenu.js +176 -0
  16. package/dist/shared/assistant/ui/composer/microphones.d.ts +13 -0
  17. package/dist/shared/assistant/ui/composer/microphones.js +15 -0
  18. package/dist/shared/assistant/ui/composer/useCompactDictation.d.ts +70 -0
  19. package/dist/shared/assistant/ui/composer/useCompactDictation.js +136 -0
  20. package/dist/shared/assistant/ui/useVoiceSession.js +166 -164
  21. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.d.ts +67 -0
  22. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +290 -0
  23. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +11 -1
  24. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +288 -244
  25. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.d.ts +5 -0
  26. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +6 -6
  27. package/dist/shared/assistant/ui/voice/LiveWaveform.d.ts +32 -0
  28. package/dist/shared/assistant/ui/voice/LiveWaveform.js +52 -0
  29. package/dist/shared/assistant/ui/voice/VoiceTurnMarks.d.ts +15 -0
  30. package/dist/shared/assistant/ui/voice/VoiceTurnMarks.js +43 -0
  31. package/dist/shared/assistant/ui/voice/formatClock.d.ts +2 -0
  32. package/dist/shared/assistant/ui/voice/formatClock.js +3 -0
  33. package/dist/shared/assistant/ui/voice/useLiveLevel.d.ts +23 -0
  34. package/dist/shared/assistant/ui/voice/useLiveLevel.js +56 -0
  35. package/dist/shared/assistant/voice/liveLevel.d.ts +85 -0
  36. package/dist/shared/assistant/voice/liveLevel.js +78 -0
  37. package/dist/shared/assistant/voice/useVoiceInput.d.ts +27 -1
  38. package/dist/shared/assistant/voice/useVoiceInput.js +141 -71
  39. package/dist/shared-assistant.js +393 -383
  40. package/package.json +1 -1
@@ -4,389 +4,433 @@ import { AssistantAttachmentChips as n } from "../composer/AssistantAttachmentCh
4
4
  import { AssistantVoiceOrb as r } from "./AssistantVoiceOrb.js";
5
5
  import { VoiceStage as ee } from "./VoiceStage.js";
6
6
  import { VoiceMiniController as te } from "./VoiceMiniController.js";
7
- import { useLiveAvatarHandsFreeGuard as i, useLiveAvatarTab as ne, useLiveAvatarVoiceView as re } from "../assistantLiveAvatarSeam.js";
8
- import { useAvatarCopy as a } from "../../avatar/useAvatarCopy.js";
9
- import { VoiceTranscriptDrawer as ie } from "./VoiceTranscriptDrawer.js";
10
- import { HandsFreePrivacyNotice as ae } from "./HandsFreePrivacyNotice.js";
11
- import { escapeBelongsToLayerAbove as o, voiceSessionEscapeAction as oe } from "./voiceSessionEscape.js";
12
- import { ASSISTANT_PANEL_ATTR as se, ASSISTANT_VOICE_SESSION_ATTR as ce } from "../panelOverlays.js";
13
- import { focusWasDropped as le, useReturnFocus as ue } from "../../../hooks/useReturnFocus.js";
14
- import { micIsInterrupt as s, showsAssistantCaption as de, voiceStageState as fe } from "../../voice/voiceStageState.js";
15
- import { VOICE_THINKING_LABEL as pe, composeVoiceStatus as me, voiceStatusSuffix as he } from "../../voice/voiceStatus.js";
16
- import { useAssistantTr as ge } from "../../i18n.js";
17
- import { spokenSoFar as _e } from "../../voice/voiceSession.js";
18
- import { useCallback as ve, useEffect as c, useMemo as ye, useRef as l, useState as u } from "react";
19
- import { Maximize2 as be, Mic as xe, MicOff as Se, Minimize2 as Ce, ScrollText as we, ShieldAlert as Te, Square as Ee, X as d } from "lucide-react";
20
- import { Fragment as De, jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { useLiveAvatarHandsFreeGuard as ne, useLiveAvatarTab as re, useLiveAvatarVoiceView as ie } from "../assistantLiveAvatarSeam.js";
8
+ import { useAvatarCopy as ae } from "../../avatar/useAvatarCopy.js";
9
+ import { VoiceTranscriptDrawer as oe } from "./VoiceTranscriptDrawer.js";
10
+ import { AssistantPageVoiceBar as se } from "./AssistantPageVoiceBar.js";
11
+ import { useLiveLevel as i } from "./useLiveLevel.js";
12
+ import { useAssistantStore as ce } from "../../store.js";
13
+ import { HandsFreePrivacyNotice as le } from "./HandsFreePrivacyNotice.js";
14
+ import { escapeBelongsToLayerAbove as ue, voiceSessionEscapeAction as de } from "./voiceSessionEscape.js";
15
+ import { ASSISTANT_PANEL_ATTR as fe, ASSISTANT_VOICE_SESSION_ATTR as pe } from "../panelOverlays.js";
16
+ import { focusWasDropped as me, useReturnFocus as he } from "../../../hooks/useReturnFocus.js";
17
+ import { micIsInterrupt as a, showsAssistantCaption as ge, voiceStageState as _e } from "../../voice/voiceStageState.js";
18
+ import { VOICE_THINKING_LABEL as ve, composeVoiceStatus as ye, voiceStatusSuffix as be } from "../../voice/voiceStatus.js";
19
+ import { useAssistantTr as xe } from "../../i18n.js";
20
+ import { spokenSoFar as Se } from "../../voice/voiceSession.js";
21
+ import { useCallback as Ce, useEffect as o, useMemo as we, useRef as s, useState as c } from "react";
22
+ import { Maximize2 as Te, Mic as Ee, MicOff as De, Minimize2 as Oe, ScrollText as ke, ShieldAlert as Ae, Square as je, X as Me } from "lucide-react";
23
+ import { Fragment as Ne, jsx as l, jsxs as u } from "react/jsx-runtime";
24
+ import { createPortal as Pe } from "react-dom";
21
25
  // src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
22
- var m = ({ session: m, turns: ke = [], onSaveTranscript: je, onContinueInChat: Me, notice: g = null, privacyNotice: _ = null, spoken: Ne, onInterrupt: Pe, onToggleMute: v, attachments: Fe = [], onAttachFiles: y, onRemoveAttachment: Ie, onRetryAttachment: Le, canAttachMore: Re = !0, preparingAttachments: ze = 0, attachmentsLocked: b = !1, attachmentNotice: x = null, spokenChunks: Be = null, onEnd: S, capturing: Ve = !0, interrupting: He = !1, awaitingEndpoint: Ue = !1, holding: C = !1, correcting: We = !1, onLetMeFinish: Ge, onImDone: Ke, proposalChip: w = null, proposalTray: T = null, renderAfterTurn: qe, onViewChange: Je, view: E, startedCue: D }) => {
23
- let O = ge(), { muted: k, error: A } = m, j = l(null), M = l(null), [Ye, N] = u("mini"), P = E !== void 0, F = E === "compact", [I, Xe] = u(E);
24
- I !== E && (Xe(E), E === void 0 && I !== void 0 && N(I === "compact" ? "panel" : I));
25
- let Ze = E === void 0 ? Ye : E === "compact" ? "panel" : E, L = ne().open, [Qe, $e] = u(L);
26
- Qe !== L && ($e(L), L && Ye !== "mini" && N("mini"));
27
- let R = re(Ze, m.phase === "ended"), et = i();
28
- c(() => {
29
- Je?.(R);
30
- }, [Je, R]);
31
- let tt = a(), z = R === "full", B = R === "mini", V = R === "mini" ? "panel" : R === "panel" ? "full" : "mini", [H, U] = u(!1), nt = ye(() => ({ run: () => H ? { status: "already" } : (U(!0), { status: "done" }) }), [H]);
32
- e("assistant.transcript", nt);
33
- let W = T !== null && !B, G = l(!1), K = l(v);
34
- K.current = v;
35
- let q = ve(() => {
36
- m.phase !== "listening" && m.phase !== "thinking" || k || G.current || _e(m) || (G.current = !0, K.current());
37
- }, [k, m]), J = ve(() => {
38
- G.current && (G.current = !1, K.current());
39
- }, []), rt = q;
40
- c(() => {
26
+ var d = ({ session: d, turns: Ie = [], onSaveTranscript: Re, onContinueInChat: ze, notice: p = null, privacyNotice: m = null, bargeIn: Be = !1, spoken: Ve, onInterrupt: h, onToggleMute: g, attachments: _ = [], onAttachFiles: v, onRemoveAttachment: He, onRetryAttachment: Ue, canAttachMore: y = !0, preparingAttachments: b = 0, attachmentsLocked: x = !1, attachmentNotice: S = null, spokenChunks: We = null, onEnd: C, capturing: Ge = !0, interrupting: Ke = !1, awaitingEndpoint: qe = !1, holding: w = !1, correcting: Je = !1, onLetMeFinish: Ye, onImDone: Xe, proposalChip: T = null, proposalTray: E = null, renderAfterTurn: Ze, onViewChange: Qe, view: D, pageSlot: $e = null, startedCue: O }) => {
27
+ let k = xe(), { muted: A, error: j } = d, M = s(null), N = s(null), [et, P] = c("mini"), F = D !== void 0, I = D === "compact", L = D === "page", [R, tt] = c(D);
28
+ R !== D && (tt(D), D === void 0 && R !== void 0 && P(R === "compact" ? "panel" : R === "page" ? "mini" : R));
29
+ let nt = D === void 0 ? et : D === "compact" ? "panel" : D === "page" ? "mini" : D, z = re().open, [rt, it] = c(z);
30
+ rt !== z && (it(z), z && et !== "mini" && P("mini"));
31
+ let B = ie(nt, d.phase === "ended"), at = ne();
32
+ o(() => {
33
+ Qe?.(B);
34
+ }, [Qe, B]);
35
+ let ot = ae(), V = B === "full", H = B === "mini", st = B === "mini" ? "panel" : B === "panel" ? "full" : "mini", [U, W] = c(!1), ct = we(() => ({ run: () => U ? { status: "already" } : (W(!0), { status: "done" }) }), [U]);
36
+ e("assistant.transcript", ct);
37
+ let G = E !== null && !H, K = s(!1), lt = s(g);
38
+ lt.current = g;
39
+ let ut = Ce(() => {
40
+ d.phase !== "listening" && d.phase !== "thinking" || A || K.current || Se(d) || (K.current = !0, lt.current());
41
+ }, [A, d]), dt = Ce(() => {
42
+ K.current && (K.current = !1, lt.current());
43
+ }, []), ft = ut;
44
+ o(() => {
41
45
  let e = () => {
42
- document.visibilityState === "hidden" ? q() : J();
46
+ document.visibilityState === "hidden" ? ut() : dt();
43
47
  };
44
48
  return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
45
- }, [q, J]), c(() => {
46
- let e = J;
49
+ }, [ut, dt]), o(() => {
50
+ let e = dt;
47
51
  return window.addEventListener("focus", e), () => {
48
- window.removeEventListener("focus", e), G.current = !1;
52
+ window.removeEventListener("focus", e), K.current = !1;
49
53
  };
50
- }, []), c(() => {
51
- document.activeElement?.closest("[data-hands-free-notice]") || j.current?.focus();
52
- }, []), ue(M, { fallbackSelector: `[${se}]` });
53
- let it = l(P);
54
- c(() => {
55
- let e = it.current;
56
- it.current = P, e && !P && le(document) && (M.current?.querySelector("[data-testid=\"assistant-voice-transcript-close\"]") ?? j.current)?.focus({ preventScroll: !0 });
57
- }, [P]), c(() => {
54
+ }, []), o(() => {
55
+ document.activeElement?.closest("[data-hands-free-notice]") || M.current?.focus();
56
+ }, []), he(N, { fallbackSelector: `[${fe}]` });
57
+ let pt = s(F);
58
+ o(() => {
59
+ let e = pt.current;
60
+ pt.current = F, e && !F && me(document) && (N.current?.querySelector("[data-testid=\"assistant-voice-transcript-close\"]") ?? M.current)?.focus({ preventScroll: !0 });
61
+ }, [F]), o(() => {
58
62
  let e = (e) => {
59
63
  if (e.key === "Escape") {
60
- let t = oe({
64
+ let t = de({
61
65
  defaultPrevented: e.defaultPrevented,
62
- layerAbove: o({
66
+ layerAbove: ue({
63
67
  target: e.target,
64
- session: M.current,
68
+ session: N.current,
65
69
  doc: document
66
70
  }),
67
- transcriptOpen: H
71
+ transcriptOpen: U
68
72
  });
69
73
  if (t === "ignore") return;
70
- e.preventDefault(), t === "close-transcript" ? U(!1) : _ ? _.decline() : W ? T?.onClose() : S();
74
+ e.preventDefault(), t === "close-transcript" ? W(!1) : m ? m.decline() : G ? E?.onClose() : C();
71
75
  return;
72
76
  }
73
- if (e.key !== "Tab" || !z) return;
74
- let t = (H ? M.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : M.current)?.querySelectorAll("button:not([disabled])");
77
+ if (e.key !== "Tab" || !V) return;
78
+ let t = (U ? N.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : N.current)?.querySelectorAll("button:not([disabled])");
75
79
  if (!t || t.length === 0) return;
76
80
  let n = t[0], r = t[t.length - 1];
77
81
  n && r && (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
78
82
  };
79
83
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
80
84
  }, [
81
- S,
82
- z,
83
- H,
84
- W,
85
- T,
86
- _
85
+ C,
86
+ V,
87
+ U,
88
+ G,
89
+ E,
90
+ m
87
91
  ]);
88
- let Y = g !== null && A === null, X = et && g === null && A === null, at = _e(m), Z = Ge && Ke && m.phase === "listening" && !k && A === null ? {
89
- letMeFinish: Ge,
90
- imDone: Ke
91
- } : null, ot = Z !== null;
92
- c(() => {
93
- if (ot) return;
92
+ let q = p !== null && j === null, J = at && p === null && j === null, Y = Se(d), X = Ye && Xe && d.phase === "listening" && !A && j === null ? {
93
+ letMeFinish: Ye,
94
+ imDone: Xe
95
+ } : null, mt = X !== null;
96
+ o(() => {
97
+ if (mt) return;
94
98
  let e = document.activeElement;
95
- e && e !== document.body || j.current?.focus();
96
- }, [ot]);
97
- let Q = fe({
98
- snapshot: m,
99
- capturing: Ve,
100
- interrupting: He,
101
- awaitingEndpoint: Ue
102
- }), st = (() => {
103
- switch (Q) {
104
- case "connecting": return O("voiceSession.connecting", "Starting the microphone…");
105
- case "endpoint-grace": return O("voiceSession.endpointGrace", "Still listening — take your time");
106
- case "interrupting": return O("voiceSession.interrupting", "Stopped — go ahead");
107
- case "thinking": return O(pe.key, pe.fallback);
108
- case "speaking": return O("voiceSession.speaking", "Speaking — tap to stop");
99
+ e && e !== document.body || M.current?.focus();
100
+ }, [mt]);
101
+ let Z = _e({
102
+ snapshot: d,
103
+ capturing: Ge,
104
+ interrupting: Ke,
105
+ awaitingEndpoint: qe
106
+ }), ht = (() => {
107
+ switch (Z) {
108
+ case "connecting": return k("voiceSession.connecting", "Starting the microphone…");
109
+ case "endpoint-grace": return k("voiceSession.endpointGrace", "Still listening — take your time");
110
+ case "interrupting": return k("voiceSession.interrupting", "Stopped — go ahead");
111
+ case "thinking": return k(ve.key, ve.fallback);
112
+ case "speaking": return k("voiceSession.speaking", "Speaking — tap to stop");
109
113
  case "mic-error":
110
114
  case "ended": return "";
111
- case "listening": return k ? O("voiceSession.muted", "Microphone off") : O("voiceSession.listening", "Listening…");
112
- default: return Q;
115
+ case "listening": return A ? k("voiceSession.muted", "Microphone off") : k("voiceSession.listening", "Listening…");
116
+ default: return Z;
113
117
  }
114
- })(), ct = !k && (Q === "listening" || Q === "endpoint-grace"), lt = ct && C ? O("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : ct && We ? O("voiceSession.correcting", "Stopped that answer — listening to your correction") : st, $ = he({
115
- tr: O,
116
- stage: Q,
117
- muted: k,
118
- label: lt
119
- }), ut = me(lt, $), dt = Q === "thinking";
120
- return /* @__PURE__ */ p("div", {
121
- ref: M,
122
- className: `flex flex-col ${F ? "items-stretch" : "items-center"} justify-between ${F ? "bg-bg-elevated" : "bg-bg-sunken"} ${F ? "absolute inset-0 z-20 px-3 pb-3 pt-2" : R === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : R === "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"}`,
118
+ })(), gt = !A && (Z === "listening" || Z === "endpoint-grace"), _t = gt && w ? k("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : gt && Je ? k("voiceSession.correcting", "Stopped that answer — listening to your correction") : ht, Q = be({
119
+ tr: k,
120
+ stage: Z,
121
+ muted: A,
122
+ label: _t
123
+ }), vt = ye(_t, Q), yt = Z === "thinking", $ = !A && (Z === "listening" || Z === "endpoint-grace"), bt = ce((e) => e.micDeviceId), xt = i({
124
+ active: L && ($ || Z === "speaking"),
125
+ mic: L && $,
126
+ pulseKey: Y,
127
+ speaking: Z === "speaking",
128
+ deviceId: bt
129
+ });
130
+ return L ? $e ? Pe(/* @__PURE__ */ l(se, {
131
+ rootRef: N,
132
+ endRef: M,
133
+ stage: Z,
134
+ muted: A,
135
+ status: vt,
136
+ statusSuffix: Q,
137
+ rotateStatus: yt,
138
+ stageText: _t,
139
+ heard: $ ? Y : "",
140
+ level: xt,
141
+ notice: q ? f(p, k) : null,
142
+ announcedNotice: q && Fe(p) ? f(p, k) : null,
143
+ attachmentNotice: S,
144
+ startedCue: O,
145
+ errorText: j === null ? null : Le(j, k),
146
+ attachments: _,
147
+ preparingAttachments: b,
148
+ attachmentsLocked: x,
149
+ canAttachMore: y,
150
+ onAttachFiles: v,
151
+ onPickerOpen: ft,
152
+ onRemoveAttachment: He,
153
+ onRetryAttachment: Ue,
154
+ hold: X ? {
155
+ holding: w,
156
+ onPress: w ? X.imDone : X.letMeFinish
157
+ } : null,
158
+ onToggleMute: g,
159
+ muteDisabled: d.phase === "idle" || d.phase === "ended" || j !== null || Z === "connecting",
160
+ onInterrupt: h,
161
+ bargeIn: Be,
162
+ onEnd: C,
163
+ privacyNotice: m
164
+ }), $e) : null : /* @__PURE__ */ u("div", {
165
+ ref: N,
166
+ className: `flex flex-col ${I ? "items-stretch" : "items-center"} justify-between ${I ? "bg-bg-elevated" : "bg-bg-sunken"} ${I ? "absolute inset-0 z-20 px-3 pb-3 pt-2" : B === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : B === "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"}`,
123
167
  role: "dialog",
124
- "aria-modal": z || void 0,
125
- "aria-label": O("voiceSession.title", "Voice conversation"),
168
+ "aria-modal": V || void 0,
169
+ "aria-label": k("voiceSession.title", "Voice conversation"),
126
170
  "data-testid": "assistant-voice-session",
127
- [ce]: "",
171
+ [pe]: "",
128
172
  children: [
129
- F ? null : /* @__PURE__ */ p("button", {
130
- ref: j,
173
+ I ? null : /* @__PURE__ */ u("button", {
174
+ ref: M,
131
175
  type: "button",
132
- onClick: S,
133
- className: `absolute ${z ? "end-6 top-6 h-14 gap-2 px-5 text-base" : B ? "end-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "end-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`,
134
- title: O("voiceSession.end", "End the voice conversation"),
176
+ onClick: C,
177
+ className: `absolute ${V ? "end-6 top-6 h-14 gap-2 px-5 text-base" : H ? "end-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "end-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`,
178
+ title: k("voiceSession.end", "End the voice conversation"),
135
179
  "data-testid": "assistant-voice-end",
136
- children: [/* @__PURE__ */ f(d, {
137
- className: z ? "size-6" : B ? "size-4" : "size-5",
180
+ children: [/* @__PURE__ */ l(Me, {
181
+ className: V ? "size-6" : H ? "size-4" : "size-5",
138
182
  "aria-hidden": "true"
139
- }), /* @__PURE__ */ f("span", {
140
- className: `truncate whitespace-nowrap font-medium ${B ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
141
- children: O("voiceSession.endShort", "End")
183
+ }), /* @__PURE__ */ l("span", {
184
+ className: `truncate whitespace-nowrap font-medium ${H ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
185
+ children: k("voiceSession.endShort", "End")
142
186
  })]
143
187
  }),
144
- /* @__PURE__ */ p("div", {
145
- className: `flex flex-col items-center ${F ? "min-h-[1.5rem]" : B ? `px-3 ${Y || X || x ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${Y || X || x ? z ? "pt-14" : "pt-10" : ""}`}`,
188
+ /* @__PURE__ */ u("div", {
189
+ className: `flex flex-col items-center ${I ? "min-h-[1.5rem]" : H ? `px-3 ${q || J || S ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${q || J || S ? V ? "pt-14" : "pt-10" : ""}`}`,
146
190
  children: [
147
- Y ? /* @__PURE__ */ f("p", {
191
+ q ? /* @__PURE__ */ l("p", {
148
192
  className: "max-w-xs text-center text-xs text-status-warning",
149
193
  "data-testid": "assistant-voice-notice",
150
- children: h(g, O)
194
+ children: f(p, k)
151
195
  }) : null,
152
- X ? /* @__PURE__ */ f("p", {
196
+ J ? /* @__PURE__ */ l("p", {
153
197
  className: "max-w-xs text-center text-xs text-text-secondary",
154
198
  "data-testid": "assistant-voice-avatar-hands-free",
155
- children: tt.handsFreeOff
199
+ children: ot.handsFreeOff
156
200
  }) : null,
157
- /* @__PURE__ */ f("span", {
201
+ /* @__PURE__ */ l("span", {
158
202
  className: "sr-only start-0 top-0",
159
203
  role: "status",
160
204
  "aria-live": "polite",
161
205
  "aria-atomic": "true",
162
206
  "data-testid": "assistant-voice-notice-announced",
163
- children: Y && Oe(g) ? h(g, O) : X ? tt.handsFreeOff : null
207
+ children: q && Fe(p) ? f(p, k) : J ? ot.handsFreeOff : null
164
208
  }),
165
- x ? /* @__PURE__ */ f("p", {
209
+ S ? /* @__PURE__ */ l("p", {
166
210
  className: "max-w-xs text-center text-xs text-status-warning",
167
211
  role: "status",
168
212
  "aria-live": "polite",
169
213
  "data-testid": "assistant-voice-attachment-notice",
170
- children: x
214
+ children: S
171
215
  }) : null,
172
- D === void 0 ? null : /* @__PURE__ */ p(De, { children: [D ? /* @__PURE__ */ f("p", {
216
+ O === void 0 ? null : /* @__PURE__ */ u(Ne, { children: [O ? /* @__PURE__ */ l("p", {
173
217
  className: "max-w-xs text-center text-xs text-text-secondary",
174
218
  "data-testid": "assistant-voice-started-cue",
175
- children: D
176
- }) : null, /* @__PURE__ */ f("span", {
219
+ children: O
220
+ }) : null, /* @__PURE__ */ l("span", {
177
221
  className: "sr-only start-0 top-0",
178
222
  role: "status",
179
223
  "aria-live": "polite",
180
224
  "aria-atomic": "true",
181
225
  "data-testid": "assistant-voice-started-cue-announced",
182
- children: D
226
+ children: O
183
227
  })] })
184
228
  ]
185
229
  }),
186
230
  (() => {
187
- let e = /* @__PURE__ */ f(r, {
188
- session: m,
189
- compact: B,
190
- connecting: Q === "connecting",
191
- onPress: s(Q) ? Pe : v,
192
- label: s(Q) ? O("voiceSession.interrupt", "Stop the assistant and speak") : k ? O("voiceSession.unmute", "Turn the microphone on") : O("voiceSession.mute", "Turn the microphone off")
193
- }), t = Z ? /* @__PURE__ */ f("button", {
231
+ let e = /* @__PURE__ */ l(r, {
232
+ session: d,
233
+ compact: H,
234
+ connecting: Z === "connecting",
235
+ onPress: a(Z) ? h : g,
236
+ label: a(Z) ? k("voiceSession.interrupt", "Stop the assistant and speak") : A ? k("voiceSession.unmute", "Turn the microphone on") : k("voiceSession.mute", "Turn the microphone off")
237
+ }), t = X ? /* @__PURE__ */ l("button", {
194
238
  type: "button",
195
- onClick: C ? Z.imDone : Z.letMeFinish,
196
- 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 ${B ? "h-7 px-3 text-xs" : z ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${C ? "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"}`,
197
- title: C ? O("voiceSession.imDoneHint", "Send what you said now") : O("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
239
+ onClick: w ? X.imDone : X.letMeFinish,
240
+ 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 ${H ? "h-7 px-3 text-xs" : V ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${w ? "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"}`,
241
+ title: w ? k("voiceSession.imDoneHint", "Send what you said now") : k("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
198
242
  "data-testid": "assistant-voice-hold",
199
- "data-holding": C ? "true" : "false",
200
- children: C ? O("voiceSession.imDone", "I’m done") : O("voiceSession.letMeFinish", "Let me finish")
201
- }) : null, n = s(Q), i = n ? Pe : v, ne = m.phase === "idle" || m.phase === "ended" || A !== null || Q === "connecting" || !i, re = F ? /* @__PURE__ */ p("button", {
243
+ "data-holding": w ? "true" : "false",
244
+ children: w ? k("voiceSession.imDone", "I’m done") : k("voiceSession.letMeFinish", "Let me finish")
245
+ }) : null, n = a(Z), ne = n ? h : g, re = d.phase === "idle" || d.phase === "ended" || j !== null || Z === "connecting" || !ne, ie = I ? /* @__PURE__ */ u("button", {
202
246
  type: "button",
203
- onClick: i,
204
- disabled: ne,
247
+ onClick: ne,
248
+ disabled: re,
205
249
  className: "flex h-11 items-center justify-center gap-2 rounded-full border border-border-default bg-bg-elevated px-6 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default disabled:text-text-muted disabled:hover:bg-bg-elevated",
206
250
  "data-testid": "assistant-voice-primary",
207
- "data-state": Q,
208
- "data-muted": k || void 0,
209
- children: [n ? /* @__PURE__ */ f(Ee, {
251
+ "data-state": Z,
252
+ "data-muted": A || void 0,
253
+ children: [n ? /* @__PURE__ */ l(je, {
210
254
  className: "size-4 fill-current",
211
255
  "aria-hidden": "true"
212
- }) : f(k ? Se : xe, {
256
+ }) : l(A ? De : Ee, {
213
257
  className: "size-4",
214
258
  "aria-hidden": "true"
215
- }), n ? O("window.stopSpeaking", "Stop speaking") : k ? O("window.unmute", "Unmute") : O("window.mute", "Mute")]
216
- }) : null, a = t ? /* @__PURE__ */ p("div", {
259
+ }), n ? k("window.stopSpeaking", "Stop speaking") : A ? k("window.unmute", "Unmute") : k("window.mute", "Mute")]
260
+ }) : null, ae = t ? /* @__PURE__ */ u("div", {
217
261
  className: "flex flex-col items-center gap-2",
218
262
  children: [e, t]
219
- }) : e, ie = F ? /* @__PURE__ */ p("div", {
263
+ }) : e, oe = I ? /* @__PURE__ */ u("div", {
220
264
  className: "flex flex-col items-center gap-2",
221
- children: [t, re]
222
- }) : void 0, ae = de(Q) ? Ne : at || null, o = A === null ? null : Ae(A, O);
223
- return B ? /* @__PURE__ */ f(te, {
224
- spokenChunks: Be,
225
- state: Q,
226
- caption: ae,
227
- statusText: ut,
228
- statusSuffix: $,
229
- rotateStatus: dt,
230
- errorText: o,
231
- control: a
232
- }) : /* @__PURE__ */ f(ee, {
233
- state: Q,
234
- userCaption: at || null,
235
- spokenChunks: Be,
236
- assistantCaption: Ne,
237
- expanded: z,
238
- statusText: ut,
239
- statusSuffix: $,
240
- rotateStatus: dt,
241
- errorText: o,
242
- control: a,
243
- compact: F || void 0,
244
- compactControl: ie
265
+ children: [t, ie]
266
+ }) : void 0, se = ge(Z) ? Ve : Y || null, i = j === null ? null : Le(j, k);
267
+ return H ? /* @__PURE__ */ l(te, {
268
+ spokenChunks: We,
269
+ state: Z,
270
+ caption: se,
271
+ statusText: vt,
272
+ statusSuffix: Q,
273
+ rotateStatus: yt,
274
+ errorText: i,
275
+ control: ae
276
+ }) : /* @__PURE__ */ l(ee, {
277
+ state: Z,
278
+ userCaption: Y || null,
279
+ spokenChunks: We,
280
+ assistantCaption: Ve,
281
+ expanded: V,
282
+ statusText: vt,
283
+ statusSuffix: Q,
284
+ rotateStatus: yt,
285
+ errorText: i,
286
+ control: ae,
287
+ compact: I || void 0,
288
+ compactControl: oe
245
289
  });
246
290
  })(),
247
- w && !W && !F ? /* @__PURE__ */ f("div", {
248
- className: B ? "absolute start-20 end-36 top-2 flex justify-center" : `flex w-full justify-center ${z ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
249
- children: /* @__PURE__ */ f("button", {
291
+ T && !G && !I ? /* @__PURE__ */ l("div", {
292
+ className: H ? "absolute start-20 end-36 top-2 flex justify-center" : `flex w-full justify-center ${V ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
293
+ children: /* @__PURE__ */ l("button", {
250
294
  type: "button",
251
295
  onClick: () => {
252
- N("panel"), w.onOpen();
296
+ P("panel"), T.onOpen();
253
297
  },
254
- 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 ${B ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
298
+ 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 ${H ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
255
299
  "data-testid": "assistant-voice-proposal-chip",
256
- children: w.label
300
+ children: T.label
257
301
  })
258
302
  }) : null,
259
- w && F ? /* @__PURE__ */ p("div", {
303
+ T && I ? /* @__PURE__ */ u("div", {
260
304
  className: "flex min-h-11 w-full items-center gap-2 rounded-xl border border-status-warning bg-status-warning/10 px-3 py-1",
261
305
  "data-testid": "assistant-voice-proposal-chip-row",
262
306
  children: [
263
- /* @__PURE__ */ f(Te, {
307
+ /* @__PURE__ */ l(Ae, {
264
308
  className: "size-4 shrink-0 text-status-warning",
265
309
  "aria-hidden": "true"
266
310
  }),
267
- w.status ? /* @__PURE__ */ f("p", {
311
+ T.status ? /* @__PURE__ */ l("p", {
268
312
  role: "status",
269
313
  "aria-live": "polite",
270
314
  className: "min-w-0 flex-1 text-sm text-text-primary",
271
315
  "data-testid": "assistant-voice-proposal-status",
272
- children: w.status
273
- }) : /* @__PURE__ */ f("span", { className: "flex-1" }),
274
- /* @__PURE__ */ f("button", {
316
+ children: T.status
317
+ }) : /* @__PURE__ */ l("span", { className: "flex-1" }),
318
+ /* @__PURE__ */ l("button", {
275
319
  type: "button",
276
- onClick: w.onOpen,
320
+ onClick: T.onOpen,
277
321
  className: "min-h-9 shrink-0 rounded-button px-3 text-sm font-medium text-action-primary-bg transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
278
322
  "data-testid": "assistant-voice-proposal-chip",
279
- children: w.label
323
+ children: T.label
280
324
  })
281
325
  ]
282
326
  }) : null,
283
- T && W ? /* @__PURE__ */ p("div", {
284
- className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${z ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
327
+ E && G ? /* @__PURE__ */ u("div", {
328
+ className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${V ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
285
329
  "data-testid": "assistant-voice-proposal-tray",
286
- children: [/* @__PURE__ */ f("div", {
330
+ children: [/* @__PURE__ */ l("div", {
287
331
  className: "flex justify-end",
288
- children: /* @__PURE__ */ f("button", {
332
+ children: /* @__PURE__ */ l("button", {
289
333
  type: "button",
290
- onClick: T.onClose,
334
+ onClick: E.onClose,
291
335
  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",
292
- "aria-label": T.closeLabel,
336
+ "aria-label": E.closeLabel,
293
337
  "data-testid": "assistant-voice-proposal-tray-close",
294
- children: /* @__PURE__ */ f(d, {
338
+ children: /* @__PURE__ */ l(Me, {
295
339
  className: "size-4",
296
340
  "aria-hidden": "true"
297
341
  })
298
342
  })
299
- }), T.content]
343
+ }), E.content]
300
344
  }) : null,
301
- _ ? /* @__PURE__ */ f(ae, {
302
- view: R,
303
- onContinue: _.accept,
304
- onNotNow: _.decline
345
+ m ? /* @__PURE__ */ l(le, {
346
+ view: B,
347
+ onContinue: m.accept,
348
+ onNotNow: m.decline
305
349
  }) : null,
306
- H ? /* @__PURE__ */ f(ie, {
307
- turns: ke,
308
- onClose: () => U(!1),
309
- onSave: je,
310
- onContinueInChat: Me,
311
- renderAfterTurn: qe
350
+ U ? /* @__PURE__ */ l(oe, {
351
+ turns: Ie,
352
+ onClose: () => W(!1),
353
+ onSave: Re,
354
+ onContinueInChat: ze,
355
+ renderAfterTurn: Ze
312
356
  }) : null,
313
- y && !F ? /* @__PURE__ */ f("div", {
314
- className: `absolute ${z ? "start-6 top-6" : B ? "start-11 top-2" : "start-3 top-3"}`,
315
- children: /* @__PURE__ */ f(t, {
357
+ v && !I ? /* @__PURE__ */ l("div", {
358
+ className: `absolute ${V ? "start-6 top-6" : H ? "start-11 top-2" : "start-3 top-3"}`,
359
+ children: /* @__PURE__ */ l(t, {
316
360
  onFiles: (e) => {
317
- y(e), P || N((e) => e === "mini" ? "panel" : e);
361
+ v(e), F || P((e) => e === "mini" ? "panel" : e);
318
362
  },
319
- onPickerOpen: rt,
363
+ onPickerOpen: ft,
320
364
  direction: "down",
321
- canAddMore: Re,
322
- disabled: b
365
+ canAddMore: y,
366
+ disabled: x
323
367
  })
324
368
  }) : null,
325
- (Fe.length > 0 || ze > 0) && !B ? /* @__PURE__ */ f("div", {
326
- className: F ? "w-full" : `absolute ${z ? "bottom-24 start-24 end-24" : "bottom-16 start-16 end-16"}`,
369
+ (_.length > 0 || b > 0) && !H ? /* @__PURE__ */ l("div", {
370
+ className: I ? "w-full" : `absolute ${V ? "bottom-24 start-24 end-24" : "bottom-16 start-16 end-16"}`,
327
371
  "data-testid": "assistant-voice-attachments",
328
- children: /* @__PURE__ */ f(n, {
329
- attachments: Fe,
330
- onRemove: Ie ?? (() => void 0),
331
- onRetry: Le ?? (() => void 0),
332
- preparingCount: ze,
333
- disabled: b
372
+ children: /* @__PURE__ */ l(n, {
373
+ attachments: _,
374
+ onRemove: He ?? (() => void 0),
375
+ onRetry: Ue ?? (() => void 0),
376
+ preparingCount: b,
377
+ disabled: x
334
378
  })
335
379
  }) : null,
336
- F ? null : /* @__PURE__ */ f("button", {
380
+ I ? null : /* @__PURE__ */ l("button", {
337
381
  type: "button",
338
- onClick: () => U((e) => !e),
339
- className: `absolute ${z ? "bottom-6 end-6 size-14" : B ? "end-2 top-2 size-8" : "bottom-3 end-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`,
340
- "aria-pressed": H,
341
- "aria-label": O("voiceSession.transcriptTitle", "Voice transcript"),
382
+ onClick: () => W((e) => !e),
383
+ className: `absolute ${V ? "bottom-6 end-6 size-14" : H ? "end-2 top-2 size-8" : "bottom-3 end-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`,
384
+ "aria-pressed": U,
385
+ "aria-label": k("voiceSession.transcriptTitle", "Voice transcript"),
342
386
  "data-testid": "assistant-voice-transcript-toggle",
343
- children: /* @__PURE__ */ f(we, { className: z ? "size-6" : B ? "size-4" : "size-5" })
387
+ children: /* @__PURE__ */ l(ke, { className: V ? "size-6" : H ? "size-4" : "size-5" })
344
388
  }),
345
- P ? null : /* @__PURE__ */ f("button", {
389
+ F ? null : /* @__PURE__ */ l("button", {
346
390
  type: "button",
347
- onClick: () => N(V),
348
- className: `absolute ${z ? "bottom-6 start-6 size-14" : B ? "start-2 top-2 size-8" : "bottom-3 start-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`,
349
- "aria-label": V === "panel" ? O("voiceSession.expandPanel", "Show the conversation in the panel") : V === "full" ? O("voiceSession.expand", "Expand the conversation to full screen") : O("voiceSession.collapse", "Shrink to the compact controller"),
391
+ onClick: () => P(st),
392
+ className: `absolute ${V ? "bottom-6 start-6 size-14" : H ? "start-2 top-2 size-8" : "bottom-3 start-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`,
393
+ "aria-label": st === "panel" ? k("voiceSession.expandPanel", "Show the conversation in the panel") : st === "full" ? k("voiceSession.expand", "Expand the conversation to full screen") : k("voiceSession.collapse", "Shrink to the compact controller"),
350
394
  "data-testid": "assistant-voice-expand",
351
- children: z ? /* @__PURE__ */ f(Ce, { className: "size-5" }) : /* @__PURE__ */ f(be, { className: B ? "size-4" : "size-5" })
395
+ children: V ? /* @__PURE__ */ l(Oe, { className: "size-5" }) : /* @__PURE__ */ l(Te, { className: H ? "size-4" : "size-5" })
352
396
  }),
353
- F ? /* @__PURE__ */ p("div", {
397
+ I ? /* @__PURE__ */ u("div", {
354
398
  className: "flex w-full items-center gap-2 pt-2",
355
399
  "data-testid": "assistant-voice-controls",
356
400
  children: [
357
- y ? /* @__PURE__ */ f(t, {
358
- onFiles: (e) => y(e),
359
- onPickerOpen: rt,
401
+ v ? /* @__PURE__ */ l(t, {
402
+ onFiles: (e) => v(e),
403
+ onPickerOpen: ft,
360
404
  direction: "up",
361
- canAddMore: Re,
362
- disabled: b
405
+ canAddMore: y,
406
+ disabled: x
363
407
  }) : null,
364
- /* @__PURE__ */ p("button", {
408
+ /* @__PURE__ */ u("button", {
365
409
  type: "button",
366
- onClick: () => U((e) => !e),
410
+ onClick: () => W((e) => !e),
367
411
  className: "flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-full border border-border-default bg-bg-elevated px-3 text-sm text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
368
- "aria-expanded": H,
412
+ "aria-expanded": U,
369
413
  "data-testid": "assistant-voice-transcript-toggle",
370
- children: [/* @__PURE__ */ f(we, {
414
+ children: [/* @__PURE__ */ l(ke, {
371
415
  className: "size-4 shrink-0",
372
416
  "aria-hidden": "true"
373
- }), /* @__PURE__ */ f("span", {
417
+ }), /* @__PURE__ */ l("span", {
374
418
  className: "truncate",
375
- children: H ? O("window.hideTranscript", "Hide transcript") : O("window.showTranscript", "Show transcript")
419
+ children: U ? k("window.hideTranscript", "Hide transcript") : k("window.showTranscript", "Show transcript")
376
420
  })]
377
421
  }),
378
- /* @__PURE__ */ p("button", {
379
- ref: j,
422
+ /* @__PURE__ */ u("button", {
423
+ ref: M,
380
424
  type: "button",
381
- onClick: S,
425
+ onClick: C,
382
426
  className: "flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-full border border-status-error-border bg-status-error-bg-subtle px-3 text-sm font-medium text-status-error-text transition-colors hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
383
427
  "data-testid": "assistant-voice-end",
384
- children: [/* @__PURE__ */ f(d, {
428
+ children: [/* @__PURE__ */ l(Me, {
385
429
  className: "size-4 shrink-0",
386
430
  "aria-hidden": "true"
387
- }), /* @__PURE__ */ f("span", {
431
+ }), /* @__PURE__ */ l("span", {
388
432
  className: "truncate",
389
- children: O("window.endVoice", "End voice")
433
+ children: k("window.endVoice", "End voice")
390
434
  })]
391
435
  })
392
436
  ]
@@ -394,13 +438,13 @@ var m = ({ session: m, turns: ke = [], onSaveTranscript: je, onContinueInChat: M
394
438
  ]
395
439
  });
396
440
  };
397
- function h(e, t) {
398
- return typeof e == "string" ? ke(e, t) : e.text;
441
+ function f(e, t) {
442
+ return typeof e == "string" ? Ie(e, t) : e.text;
399
443
  }
400
- function Oe(e) {
444
+ function Fe(e) {
401
445
  return e !== null && (typeof e != "string" || e === "reply-not-heard");
402
446
  }
403
- function ke(e, t) {
447
+ function Ie(e, t) {
404
448
  switch (e) {
405
449
  case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
406
450
  case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
@@ -412,7 +456,7 @@ function ke(e, t) {
412
456
  default: return e;
413
457
  }
414
458
  }
415
- function Ae(e, t) {
459
+ function Le(e, t) {
416
460
  switch (e) {
417
461
  case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
418
462
  case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
@@ -420,4 +464,4 @@ function Ae(e, t) {
420
464
  default: return e;
421
465
  }
422
466
  }
423
- export { m as AssistantVoiceSession };
467
+ export { d as AssistantVoiceSession };