@burdenoff/fe-libs 2026.1114.13 → 2026.1114.15

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 (37) hide show
  1. package/dist/shared/assistant/conversation.d.ts +16 -0
  2. package/dist/shared/assistant/i18nManifest.d.ts +30 -0
  3. package/dist/shared/assistant/i18nManifest.js +30 -0
  4. package/dist/shared/assistant/index.d.ts +6 -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 +1269 -1188
  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.js +348 -362
  11. package/dist/shared/assistant/ui/composer/AssistantDictation.d.ts +42 -0
  12. package/dist/shared/assistant/ui/composer/AssistantDictation.js +127 -0
  13. package/dist/shared/assistant/ui/composer/AssistantMicMenu.d.ts +23 -0
  14. package/dist/shared/assistant/ui/composer/AssistantMicMenu.js +176 -0
  15. package/dist/shared/assistant/ui/composer/microphones.d.ts +13 -0
  16. package/dist/shared/assistant/ui/composer/microphones.js +15 -0
  17. package/dist/shared/assistant/ui/composer/useCompactDictation.d.ts +70 -0
  18. package/dist/shared/assistant/ui/composer/useCompactDictation.js +136 -0
  19. package/dist/shared/assistant/ui/useVoiceSession.js +166 -164
  20. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.d.ts +20 -17
  21. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +230 -123
  22. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +2 -0
  23. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +227 -229
  24. package/dist/shared/assistant/ui/voice/LiveWaveform.d.ts +4 -3
  25. package/dist/shared/assistant/ui/voice/LiveWaveform.js +1 -1
  26. package/dist/shared/assistant/ui/voice/VoiceTurnMarks.d.ts +15 -0
  27. package/dist/shared/assistant/ui/voice/VoiceTurnMarks.js +43 -0
  28. package/dist/shared/assistant/ui/voice/formatClock.d.ts +2 -0
  29. package/dist/shared/assistant/ui/voice/formatClock.js +3 -0
  30. package/dist/shared/assistant/ui/voice/useLiveLevel.d.ts +3 -1
  31. package/dist/shared/assistant/ui/voice/useLiveLevel.js +23 -19
  32. package/dist/shared/assistant/voice/liveLevel.d.ts +4 -3
  33. package/dist/shared/assistant/voice/liveLevel.js +18 -15
  34. package/dist/shared/assistant/voice/useVoiceInput.d.ts +27 -1
  35. package/dist/shared/assistant/voice/useVoiceInput.js +141 -71
  36. package/dist/shared-assistant.js +383 -377
  37. package/package.json +1 -1
@@ -3,28 +3,29 @@ import { EscapeLayer as t } from "../../../components/EscapeLayer.js";
3
3
  import { useI18n as n } from "../../../providers/shell/I18nProvider.js";
4
4
  import { useAssistantTr as r } from "../../i18n.js";
5
5
  import { languageDisplayName as i } from "../../voice/speechVoices.js";
6
- import { resolveAssistantLanguage as ee } from "../../voice/languages.js";
7
- import { useAssistantStore as te } from "../../store.js";
8
- import { useVoiceInput as ne } from "../../voice/useVoiceInput.js";
9
- import { useAssistantAttachments as re } from "../../useAssistantAttachments.js";
10
- import { getSendableAttachments as ie } from "../../attachments.js";
11
- import { ATTACHMENT_COMMIT_CODES as ae } from "../../attachmentCommit.js";
12
- import { AssistantAttachmentButton as oe } from "./AssistantAttachmentButton.js";
13
- import { AssistantAttachmentChips as se } from "./AssistantAttachmentChips.js";
14
- import { AssistantFocusChip as ce } from "./AssistantFocusChip.js";
15
- import { useAskAboutStore as a } from "../../askAbout/askAboutStore.js";
16
- import { AssistantVoiceButton as le, ListeningDot as ue } from "./AssistantVoiceButton.js";
17
- import { AssistantVoiceSessionButton as de } from "../voice/AssistantVoiceSessionButton.js";
18
- import { LiveWaveform as fe } from "../voice/LiveWaveform.js";
19
- import { useLiveLevel as pe } from "../voice/useLiveLevel.js";
20
- import { AssistantModeSelector as me } from "./AssistantModeSelector.js";
21
- import { AssistantModeMenu as he } from "./AssistantModeMenu.js";
22
- import { AssistantViewSwitchRow as ge } from "../compact/AssistantViewSwitchRow.js";
23
- import { compactEnterSends as _e, isImeComposingEnter as ve } from "./imeEnter.js";
24
- import { PAGE_COLUMN as ye, useAssistantPageLayout as be } from "../assistantPageLayout.js";
25
- import { useCallback as o, useEffect as s, useId as c, useLayoutEffect as xe, useMemo as Se, useRef as l, useState as u } from "react";
26
- import { ArrowUp as Ce, Check as we, Loader2 as d, Square as Te, X as Ee } from "lucide-react";
27
- import { Fragment as De, jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { resolveAssistantLanguage as a } from "../../voice/languages.js";
7
+ import { useAssistantStore as o } from "../../store.js";
8
+ import { useVoiceInput as s } from "../../voice/useVoiceInput.js";
9
+ import { useAssistantAttachments as ee } from "../../useAssistantAttachments.js";
10
+ import { getSendableAttachments as te } from "../../attachments.js";
11
+ import { ATTACHMENT_COMMIT_CODES as ne } from "../../attachmentCommit.js";
12
+ import { AssistantAttachmentButton as re } from "./AssistantAttachmentButton.js";
13
+ import { AssistantAttachmentChips as ie } from "./AssistantAttachmentChips.js";
14
+ import { AssistantFocusChip as ae } from "./AssistantFocusChip.js";
15
+ import { useAskAboutStore as oe } from "../../askAbout/askAboutStore.js";
16
+ import { AssistantVoiceButton as se, ListeningDot as ce } from "./AssistantVoiceButton.js";
17
+ import { AssistantVoiceSessionButton as le } from "../voice/AssistantVoiceSessionButton.js";
18
+ import { useCompactDictation as ue } from "./useCompactDictation.js";
19
+ import { DictationControls as de, DictationLiveText as fe, MicBlockedNotice as pe } from "./AssistantDictation.js";
20
+ import { AssistantMicMenu as me, useMicSummary as he } from "./AssistantMicMenu.js";
21
+ import { AssistantModeSelector as ge } from "./AssistantModeSelector.js";
22
+ import { AssistantModeMenu as _e } from "./AssistantModeMenu.js";
23
+ import { AssistantViewSwitchRow as ve } from "../compact/AssistantViewSwitchRow.js";
24
+ import { compactEnterSends as ye, isImeComposingEnter as be } from "./imeEnter.js";
25
+ import { PAGE_COLUMN as xe, useAssistantPageLayout as Se } from "../assistantPageLayout.js";
26
+ import { useCallback as c, useEffect as l, useId as u, useLayoutEffect as Ce, useMemo as we, useRef as d, useState as f } from "react";
27
+ import { ArrowUp as Te, Loader2 as p, Square as Ee } from "lucide-react";
28
+ import { Fragment as De, jsx as m, jsxs as h } from "react/jsx-runtime";
28
29
  // src/shared/assistant/ui/composer/AssistantComposer.tsx
29
30
  var Oe = 200;
30
31
  function ke(e) {
@@ -32,115 +33,108 @@ function ke(e) {
32
33
  let t = e.ownerDocument.activeElement;
33
34
  return !t || t === e.ownerDocument.body ? !1 : e.contains(t) ? !0 : e.closest("[data-assistant-panel]")?.contains(t) ?? !1;
34
35
  }
35
- var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend: m, disabled: je = !1, readOnly: Me = !1, placeholder: Ne, mode: Pe, availableModes: h, attachmentCharsPerFile: Fe, onModeChange: Ie, auto: Le, onStartVoiceSession: g, onDraftStart: Re, onDraftChange: ze, suspendDictation: Be = !1, onVoiceStateChange: Ve, presentation: He = "classic", turnInFlight: _ = !1, onStop: Ue, turnId: We, modeDisabledReason: Ge = null, inputRef: v, aboveCard: Ke, viewSwitch: qe, modeReadOnly: Je = !1, voiceSessionActive: y = !1, concealed: Ye = !1 }) => {
36
- let b = r(), Xe = be(), { locale: x } = n(), S = je || Me, C = He === "compact", w = l(null), Ze = o((e) => {
37
- w.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
38
- }, [v]), [T, E] = u(""), [D, Qe] = u(!1), [O, $e] = u(!1), et = l(!1), [tt, k] = u(null), [nt, A] = u(null), [j, M] = u(null), [rt, it] = u(_);
39
- rt === _ ? j !== null && _ && We != null && We !== j && M(null) : (it(_), _ ? (A(null), M(null)) : j !== null && (A(j), M(null)));
40
- let at = l(!1), N = l(null), ot = l(!1), st = l(!1), ct = l(null), P = l(!1), F = l(0), { attachments: I, isBusy: lt, preparingCount: ut, sendBlocker: dt, rejection: ft, addFiles: L, remove: pt, retry: mt, clear: ht, clearRejection: gt, canAddMore: _t, commit: vt, cancelCommit: yt } = re({ perFileChars: Fe }), R = T.trim() !== "" || I.length > 0, bt = l(!1), z = l(!1);
41
- s(() => {
42
- R && !bt.current ? (bt.current = !0, Re?.()) : R || (bt.current = !1);
43
- }, [R, Re]), s(() => {
44
- R || (z.current = !1), ze?.({
45
- text: T,
46
- hasAttachments: I.length > 0,
47
- dictated: z.current
36
+ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend: g, disabled: je = !1, readOnly: Me = !1, placeholder: Ne, mode: Pe, availableModes: _, attachmentCharsPerFile: Fe, onModeChange: Ie, auto: Le, onStartVoiceSession: v, onDraftStart: Re, onDraftChange: ze, suspendDictation: Be = !1, onVoiceStateChange: Ve, presentation: He = "classic", turnInFlight: y = !1, onStop: Ue, turnId: We, modeDisabledReason: Ge = null, inputRef: b, aboveCard: Ke, viewSwitch: qe, modeReadOnly: Je = !1, voiceSessionActive: x = !1, concealed: Ye = !1 }) => {
37
+ let S = r(), C = Se(), { locale: w } = n(), T = je || Me, E = He === "compact", D = d(null), Xe = c((e) => {
38
+ D.current = e, typeof b == "function" ? b(e) : b && (b.current = e);
39
+ }, [b]), [O, k] = f(""), [A, Ze] = f(!1), [j, Qe] = f(!1), $e = d(!1), [M, N] = f(null), [et, P] = f(null), [F, I] = f(null), [tt, nt] = f(y);
40
+ tt === y ? F !== null && y && We != null && We !== F && I(null) : (nt(y), y ? (P(null), I(null)) : F !== null && (P(F), I(null)));
41
+ let rt = d(!1), it = d(null), at = d(!1), ot = d(!1), st = d(null), ct = d(!1), L = d(0), { attachments: R, isBusy: lt, preparingCount: ut, sendBlocker: dt, rejection: ft, addFiles: z, remove: pt, retry: mt, clear: ht, clearRejection: gt, canAddMore: _t, commit: vt, cancelCommit: yt } = ee({ perFileChars: Fe }), B = O.trim() !== "" || R.length > 0, bt = d(!1), V = d(!1);
42
+ l(() => {
43
+ B && !bt.current ? (bt.current = !0, Re?.()) : B || (bt.current = !1);
44
+ }, [B, Re]), l(() => {
45
+ B || (V.current = !1), ze?.({
46
+ text: O,
47
+ hasAttachments: R.length > 0,
48
+ dictated: V.current
48
49
  });
49
50
  }, [
50
- T,
51
- I.length,
52
- R,
51
+ O,
52
+ R.length,
53
+ B,
53
54
  ze
54
55
  ]);
55
- let B = o((e) => {
56
- z.current = !0, E((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
57
- }, []), xt = te((e) => e.assistantLanguage), St = Se(() => ee(xt, x), [xt, x]), V = ne({
58
- onFinalize: B,
59
- language: St.tag
60
- }), H = V.isActive, Ct = V.interim, wt = V.stop;
61
- s(() => {
62
- Be && H && (Ct.trim() !== "" && B(Ct.trim()), wt());
56
+ let H = c((e) => {
57
+ V.current = !0, k((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
58
+ }, []), xt = o((e) => e.assistantLanguage), St = we(() => a(xt, w), [xt, w]), Ct = d(H), wt = d(() => void 0), Tt = o((e) => e.micDeviceId), U = s({
59
+ onFinalize: (e) => Ct.current(e),
60
+ onEnded: () => wt.current(),
61
+ language: St.tag,
62
+ deviceId: Tt
63
+ }), Et = c(() => {
64
+ V.current = !0;
65
+ }, []), W = ue({
66
+ enabled: E,
67
+ voice: U,
68
+ text: O,
69
+ setText: k,
70
+ textareaRef: D,
71
+ markDictated: Et,
72
+ deviceId: Tt
73
+ }), Dt = W.addFinal, Ot = he();
74
+ l(() => {
75
+ Ct.current = E ? Dt : H;
76
+ }, [
77
+ E,
78
+ Dt,
79
+ H
80
+ ]);
81
+ let kt = W.recogniserEnded;
82
+ l(() => {
83
+ wt.current = E ? kt : () => void 0;
84
+ }, [E, kt]);
85
+ let G = U.isActive, At = U.interim, jt = U.stop, Mt = W.keepAndStop;
86
+ l(() => {
87
+ Be && G && (E ? Mt() : (At.trim() !== "" && H(At.trim()), jt()));
63
88
  }, [
64
89
  Be,
90
+ G,
91
+ At,
92
+ jt,
65
93
  H,
66
- Ct,
67
- wt,
68
- B
69
- ]), s(() => {
94
+ E,
95
+ Mt
96
+ ]), l(() => {
70
97
  Ve?.({
71
- committing: O,
72
- dictating: H
98
+ committing: j,
99
+ dictating: G
73
100
  });
74
101
  }, [
75
102
  Ve,
76
- O,
77
- H
103
+ j,
104
+ G
78
105
  ]);
79
- let U = l(null), Tt = o(() => {
80
- U.current = {
81
- text: T,
82
- dictated: z.current
83
- }, V.start();
84
- }, [T, V]), W = o(() => {
85
- w.current?.focus();
86
- }, []), Et = o(() => {
87
- let e = V.interim.trim();
88
- e !== "" && B(e), V.stop(), U.current = null, W();
89
- }, [
90
- V,
91
- B,
92
- W
93
- ]), Dt = o(() => {
94
- let e = U.current;
95
- V.stop(), U.current = null, e && (E(e.text), z.current = e.dictated), W();
96
- }, [V, W]);
97
- s(() => {
98
- H || (U.current = null);
99
- }, [H]);
100
- let [Ot, kt] = u(0), G = V.isListening, [At, jt] = u(G);
101
- At !== G && (jt(G), kt(0)), s(() => {
102
- if (!G) return;
103
- let e = Date.now(), t = setInterval(() => {
104
- kt(Math.floor((Date.now() - e) / 1e3));
105
- }, 1e3);
106
- return () => clearInterval(t);
107
- }, [G]);
108
- let Mt = pe({
109
- active: C && G,
110
- mic: !0,
111
- pulseKey: V.interim
112
- }), Nt = a((e) => e.pending), Pt = Nt ? b("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Ne ?? b("composer.placeholder", "Ask me anything…"), Ft = a((e) => e.focusRequested), It = (e) => {
113
- E(e), requestAnimationFrame(() => {
114
- let t = w.current;
106
+ let Nt = oe((e) => e.pending), Pt = Nt ? S("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Ne ?? S("composer.placeholder", "Ask me anything…"), Ft = oe((e) => e.focusRequested), It = (e) => {
107
+ k(e), requestAnimationFrame(() => {
108
+ let t = D.current;
115
109
  t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
116
110
  });
117
111
  };
118
- s(() => {
119
- if (!Ft || S) return;
120
- let e = w.current;
121
- e && (e.focus({ preventScroll: !0 }), a.getState().actions.composerFocused());
122
- }, [Ft, S]);
123
- let K = T.trim(), q = ie(I), Lt = I.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !S && !O && dt === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = l(S);
124
- zt.current = S;
125
- let Y = l(!0);
126
- s(() => (Y.current = !0, () => {
112
+ l(() => {
113
+ if (!Ft || T) return;
114
+ let e = D.current;
115
+ e && (e.focus({ preventScroll: !0 }), oe.getState().actions.composerFocused());
116
+ }, [Ft, T]);
117
+ let K = O.trim(), q = te(R), Lt = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !T && !j && dt === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = d(T);
118
+ zt.current = T;
119
+ let Y = d(!0);
120
+ l(() => (Y.current = !0, () => {
127
121
  Y.current = !1;
128
- }), []), xe(() => {
129
- let e = w.current;
122
+ }), []), Ce(() => {
123
+ let e = D.current;
130
124
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Oe)}px`);
131
- }, [T]);
132
- let X = o(async () => {
133
- if (!J || et.current) return;
134
- V.isActive && V.stop();
135
- let e = T.trim();
136
- k(null);
137
- let t = C && ke(ct.current);
125
+ }, [O]);
126
+ let X = c(async () => {
127
+ if (!J || $e.current) return;
128
+ U.isActive && U.stop();
129
+ let e = O.trim();
130
+ N(null);
131
+ let t = E && ke(st.current);
138
132
  if (!Rt) {
139
- P.current = t, m(e, q), E(""), ht();
133
+ ct.current = t, g(e, q), k(""), ht();
140
134
  return;
141
135
  }
142
- let n = te.getState().activeConversationId;
143
- et.current = !0, $e(!0);
136
+ let n = o.getState().activeConversationId;
137
+ $e.current = !0, Qe(!0);
144
138
  try {
145
139
  let r = await vt();
146
140
  if (!Y.current) {
@@ -148,373 +142,365 @@ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend:
148
142
  return;
149
143
  }
150
144
  if (!r.ok) {
151
- r.cancelled || k({
145
+ r.cancelled || N({
152
146
  kind: "failed",
153
147
  failures: r.failures
154
148
  });
155
149
  return;
156
150
  }
157
151
  if (zt.current) {
158
- await r.rollback(), Y.current && k({
152
+ await r.rollback(), Y.current && N({
159
153
  kind: "busy",
160
154
  failures: []
161
155
  });
162
156
  return;
163
157
  }
164
- let i = te.getState();
158
+ let i = o.getState();
165
159
  if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
166
- await r.rollback(), Y.current && k({
160
+ await r.rollback(), Y.current && N({
167
161
  kind: "moved",
168
162
  failures: []
169
163
  });
170
164
  return;
171
165
  }
172
- P.current = t, m(e, ie(r.attachments)), r.handedOver(), E(""), ht();
166
+ ct.current = t, g(e, te(r.attachments)), r.handedOver(), k(""), ht();
173
167
  } finally {
174
- et.current = !1, Y.current && $e(!1);
168
+ $e.current = !1, Y.current && Qe(!1);
175
169
  }
176
170
  }, [
177
171
  J,
178
172
  Rt,
179
173
  vt,
180
- m,
181
- T,
174
+ g,
175
+ O,
182
176
  q,
183
177
  ht,
184
- V,
185
- C
186
- ]), Bt = o(() => {
187
- yt(), w.current?.focus();
188
- }, [yt]), Z = o(() => {
189
- zt.current ? at.current = !0 : w.current?.focus();
190
- }, []), Vt = o(() => {
191
- if (st.current) return;
178
+ U,
179
+ E
180
+ ]), Bt = c(() => {
181
+ yt(), D.current?.focus();
182
+ }, [yt]), Z = c(() => {
183
+ zt.current ? rt.current = !0 : D.current?.focus();
184
+ }, []), Vt = c(() => {
185
+ if (ot.current) return;
192
186
  let e = Ue?.() ?? null;
193
- e !== null && (st.current = !0, M(e)), Z();
187
+ e !== null && (ot.current = !0, I(e)), Z();
194
188
  }, [Ue, Z]);
195
- s(() => {
196
- !S && at.current && (at.current = !1, w.current?.focus());
197
- }, [S]);
198
- let Ht = o((e) => {
189
+ l(() => {
190
+ !T && rt.current && (rt.current = !1, D.current?.focus());
191
+ }, [T]);
192
+ let Ht = c((e) => {
199
193
  if (e !== null) {
200
- N.current = e;
194
+ it.current = e;
201
195
  return;
202
196
  }
203
- let t = N.current;
204
- N.current = null, t !== null && t.ownerDocument.activeElement === t && (ot.current = !0);
205
- }, []), Q = C && _ && Ue !== void 0;
206
- xe(() => {
207
- !Q && ot.current && (ot.current = !1, Z());
208
- }, [Q, Z]), s(() => {
209
- j === null && (st.current = !1);
210
- }, [j]), xe(() => {
197
+ let t = it.current;
198
+ it.current = null, t !== null && t.ownerDocument.activeElement === t && (at.current = !0);
199
+ }, []), Q = E && y && Ue !== void 0;
200
+ Ce(() => {
201
+ !Q && at.current && (at.current = !1, Z());
202
+ }, [Q, Z]), l(() => {
203
+ F === null && (ot.current = !1);
204
+ }, [F]), Ce(() => {
211
205
  if (!Q) return;
212
- let e = P.current;
213
- if (P.current = !1, !e) return;
214
- let t = N.current;
206
+ let e = ct.current;
207
+ if (ct.current = !1, !e) return;
208
+ let t = it.current;
215
209
  if (t === null) return;
216
210
  let n = t.ownerDocument, r = n.activeElement;
217
- (r === null || r === n.body || r === w.current) && t.focus({ preventScroll: !0 });
211
+ (r === null || r === n.body || r === D.current) && t.focus({ preventScroll: !0 });
218
212
  }, [Q]);
219
- let Ut = o((e) => {
220
- E(e), A(null);
213
+ let Ut = c((e) => {
214
+ k(e), P(null);
221
215
  }, []);
222
- s(() => {
223
- k(null);
224
- }, [I.length]);
216
+ l(() => {
217
+ N(null);
218
+ }, [R.length]);
225
219
  let Wt = (t) => {
226
- if (t.kind === "busy") return b("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
227
- if (t.kind === "moved") return b("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
220
+ if (t.kind === "busy") return S("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
221
+ if (t.kind === "moved") return S("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
228
222
  let { failures: n } = t;
229
- if (n.some((e) => e.code === ae.editorAccessRequired)) return e(b, x);
230
- if (n.some((e) => e.code === ae.quotaExceeded || e.code === ae.quotaNotProvisioned)) return `${b("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
231
- let r = n[0], i = I.find((e) => e.id === r?.id)?.filename ?? "";
232
- return `${n.length <= 1 ? b("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : b("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
233
- }, Gt = o((e) => {
223
+ if (n.some((e) => e.code === ne.editorAccessRequired)) return e(S, w);
224
+ if (n.some((e) => e.code === ne.quotaExceeded || e.code === ne.quotaNotProvisioned)) return `${S("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
225
+ let r = n[0], i = R.find((e) => e.id === r?.id)?.filename ?? "";
226
+ return `${n.length <= 1 ? S("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : S("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
227
+ }, Gt = c((e) => {
234
228
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X());
235
- }, [X]), Kt = o((e) => {
236
- e.key === "Escape" ? ve(e) && e.stopPropagation() : _e(e) && (e.preventDefault(), A(null), X());
237
- }, [X]), qt = o((e) => {
229
+ }, [X]), Kt = c((e) => {
230
+ e.key === "Escape" ? be(e) && e.stopPropagation() : ye(e) && (e.preventDefault(), P(null), X());
231
+ }, [X]), qt = c((e) => {
238
232
  let t = Array.from(e.clipboardData?.files ?? []);
239
- t.length !== 0 && (e.preventDefault(), L(t));
240
- }, [L]), Jt = o((e) => {
241
- Array.from(e.dataTransfer?.types ?? []).includes("Files") && (F.current += 1, Qe(!0));
242
- }, []), Yt = o(() => {
243
- F.current = Math.max(0, F.current - 1), F.current === 0 && Qe(!1);
244
- }, []), Xt = o((e) => {
233
+ t.length !== 0 && (e.preventDefault(), z(t));
234
+ }, [z]), Jt = c((e) => {
235
+ Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, Ze(!0));
236
+ }, []), Yt = c(() => {
237
+ L.current = Math.max(0, L.current - 1), L.current === 0 && Ze(!1);
238
+ }, []), Xt = c((e) => {
245
239
  Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
246
- }, []), Zt = o((e) => {
247
- e.preventDefault(), F.current = 0, Qe(!1), L(e.dataTransfer?.files ?? null);
248
- }, [L]), Qt = (e) => {
240
+ }, []), Zt = c((e) => {
241
+ e.preventDefault(), L.current = 0, Ze(!1), z(e.dataTransfer?.files ?? null);
242
+ }, [z]), Qt = (e) => {
249
243
  switch (e) {
250
- case "too-many": return b("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
251
- case "too-large": return b("attachments.tooLarge", "That file is larger than 10 MB.");
252
- case "empty": return b("attachments.empty", "That file is empty.");
253
- case "unreadable": return b("attachments.unreadable", "That file could not be read.");
254
- case "unsupported-image": return b("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
255
- case "too-large-to-save": return b("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
244
+ case "too-many": return S("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
245
+ case "too-large": return S("attachments.tooLarge", "That file is larger than 10 MB.");
246
+ case "empty": return S("attachments.empty", "That file is empty.");
247
+ case "unreadable": return S("attachments.unreadable", "That file could not be read.");
248
+ case "unsupported-image": return S("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
249
+ case "too-large-to-save": return S("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
256
250
  }
257
251
  }, $ = (() => {
258
- switch (V.error) {
259
- case "not-allowed": return b("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
260
- case "audio-capture": return b("voice.noMic", "No microphone was found.");
261
- case "network": return b("voice.network", "Speech recognition is offline right now.");
262
- case "language-not-supported": return b("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(V.language, x) });
263
- case "unknown": return b("voice.failed", "Dictation stopped unexpectedly.");
252
+ switch (U.error) {
253
+ case "not-allowed": return S("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
254
+ case "audio-capture": return S("voice.noMic", "No microphone was found.");
255
+ case "network": return S("voice.network", "Speech recognition is offline right now.");
256
+ case "language-not-supported": return S("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, w) });
257
+ case "unknown": return S("voice.failed", "Dictation stopped unexpectedly.");
264
258
  default: return null;
265
259
  }
266
- })(), $t = (e, n, r = !1) => O ? /* @__PURE__ */ f(t, {
260
+ })(), $t = (e, n, r = !1) => j ? /* @__PURE__ */ m(t, {
267
261
  onDismiss: Bt,
268
- children: /* @__PURE__ */ p("p", {
262
+ children: /* @__PURE__ */ h("p", {
269
263
  className: "flex items-center justify-center gap-2 text-text-muted",
270
264
  "data-testid": "assistant-commit-status",
271
265
  children: [
272
- /* @__PURE__ */ f(d, {
266
+ /* @__PURE__ */ m(p, {
273
267
  className: "size-3 motion-safe:animate-spin",
274
268
  "aria-hidden": "true"
275
269
  }),
276
- /* @__PURE__ */ f("span", { children: b("attachments.saving", "Saving your attachments…") }),
277
- /* @__PURE__ */ f("button", {
270
+ /* @__PURE__ */ m("span", { children: S("attachments.saving", "Saving your attachments…") }),
271
+ /* @__PURE__ */ m("button", {
278
272
  type: "button",
279
273
  onClick: Bt,
280
274
  className: "rounded text-text-primary underline underline-offset-2 hover:text-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
281
275
  "data-testid": "assistant-commit-cancel",
282
- children: b("attachments.cancelSaving", "Cancel")
276
+ children: S("attachments.cancelSaving", "Cancel")
283
277
  })
284
278
  ]
285
279
  })
286
- }) : tt ? /* @__PURE__ */ f("p", {
280
+ }) : M ? /* @__PURE__ */ m("p", {
287
281
  className: "text-status-error-text",
288
282
  role: "alert",
289
283
  "data-testid": "assistant-commit-failed",
290
- children: Wt(tt)
291
- }) : !r && V.isStarting && !V.isListening ? /* @__PURE__ */ f("p", {
284
+ children: Wt(M)
285
+ }) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ m("p", {
292
286
  className: "text-text-muted",
293
287
  "data-testid": "assistant-voice-starting",
294
- children: b("voice.starting", "Starting the microphone…")
295
- }) : !r && V.isListening ? /* @__PURE__ */ p("p", {
288
+ children: S("voice.starting", "Starting the microphone…")
289
+ }) : !r && U.isListening ? /* @__PURE__ */ h("p", {
296
290
  className: "text-status-error-text",
297
291
  "data-testid": "assistant-voice-status",
298
- children: [/* @__PURE__ */ f(ue, {}), V.interim || b("voice.listening", "Listening… speak now, tap the square to stop")]
299
- }) : $ ? /* @__PURE__ */ f("p", {
292
+ children: [/* @__PURE__ */ m(ce, {}), U.interim || S("voice.listening", "Listening… speak now, tap the square to stop")]
293
+ }) : $ ? /* @__PURE__ */ m("p", {
300
294
  className: "text-status-error-text",
301
295
  "data-testid": "assistant-voice-error",
302
296
  children: $
303
- }) : ft ? /* @__PURE__ */ f("button", {
297
+ }) : ft ? /* @__PURE__ */ m("button", {
304
298
  type: "button",
305
299
  onClick: gt,
306
300
  className: "text-status-error-text underline-offset-2 hover:underline",
307
301
  "data-testid": "assistant-attachment-rejection",
308
302
  children: Qt(ft)
309
- }) : dt === "failed" ? /* @__PURE__ */ f("p", {
303
+ }) : dt === "failed" ? /* @__PURE__ */ m("p", {
310
304
  className: "text-status-error-text",
311
305
  "data-testid": "assistant-attachment-blocked",
312
- children: Lt.length === 1 ? b("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : b("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
313
- }) : n ? /* @__PURE__ */ f("p", {
306
+ children: Lt.length === 1 ? S("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : S("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
307
+ }) : n ? /* @__PURE__ */ m("p", {
314
308
  className: "text-text-muted",
315
309
  "data-testid": "assistant-stopping-status",
316
- children: b("composer.stopping", "Stopping the reply…")
317
- }) : e ? /* @__PURE__ */ f("p", {
310
+ children: S("composer.stopping", "Stopping the reply…")
311
+ }) : e ? /* @__PURE__ */ m("p", {
318
312
  className: "text-text-muted",
319
313
  "data-testid": "assistant-stop-status",
320
- children: b("composer.stopped", "Reply stopped.")
321
- }) : /* @__PURE__ */ f("p", {
314
+ children: S("composer.stopped", "Reply stopped.")
315
+ }) : /* @__PURE__ */ m("p", {
322
316
  className: "text-text-muted",
323
- children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
317
+ children: S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
324
318
  });
325
- if (C) {
326
- let e = g !== void 0 && K.length === 0 && I.length === 0 && !V.isActive, t = b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), n = V.isSupported && V.isActive && !y, r = !!(O || tt || $ || ft || dt === "failed" || nt !== null || j !== null), i = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
327
- return /* @__PURE__ */ f(Ae, { children: (ee) => /* @__PURE__ */ p("div", {
328
- ref: ct,
329
- className: `${Xe ? `flex-shrink-0 px-3 pt-1.5 ${ye}` : "flex-shrink-0 px-3 pt-1.5"}${Ye ? " hidden" : ""}`,
319
+ if (E) {
320
+ let e = v !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.isSupported && !x && W.phase !== "idle", i = U.error === "not-allowed" || U.error === "audio-capture", a = !!(j || M || $ || ft || dt === "failed" || et !== null || F !== null), o = W.nothingHeard && !a, s = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
321
+ return /* @__PURE__ */ m(Ae, { children: (ee) => /* @__PURE__ */ h("div", {
322
+ ref: st,
323
+ className: `${C ? `flex-shrink-0 px-3 pt-1.5 ${xe}` : "flex-shrink-0 px-3 pt-1.5"}${Ye ? " hidden" : ""}`,
330
324
  children: [
331
325
  Ke,
332
- qe ? /* @__PURE__ */ f(ge, {
333
- voiceLive: y,
326
+ qe ? /* @__PURE__ */ m(ve, {
327
+ voiceLive: x,
334
328
  children: qe
335
329
  }) : null,
336
- /* @__PURE__ */ p("div", {
337
- className: r || c ? "mb-1.5 px-1 text-center text-xs" : "",
330
+ /* @__PURE__ */ h("div", {
331
+ className: a || o || u ? "mb-1.5 px-1 text-center text-xs" : "",
338
332
  "aria-live": "polite",
339
333
  "data-testid": "assistant-composer-status",
340
334
  children: [
341
- c ? /* @__PURE__ */ f("p", {
335
+ u ? /* @__PURE__ */ m("p", {
342
336
  className: "text-status-warning",
343
337
  "data-testid": "assistant-write-access-warning",
344
- children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
338
+ children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
345
339
  }) : null,
346
- r ? $t(nt !== null, j !== null, !0) : null,
347
- n && V.isListening ? /* @__PURE__ */ f("span", {
340
+ i && $ && !j && !M ? /* @__PURE__ */ m(pe, {
341
+ message: $,
342
+ onTryAgain: () => {
343
+ U.clearError(), W.start();
344
+ }
345
+ }) : o ? /* @__PURE__ */ m("p", {
346
+ className: "text-text-secondary",
347
+ "data-testid": "assistant-dictation-nothing-heard",
348
+ children: S("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
349
+ }) : a ? $t(et !== null, F !== null, !0) : null,
350
+ r && U.isListening ? /* @__PURE__ */ m("span", {
348
351
  className: "sr-only",
349
352
  "data-testid": "assistant-dictation-announced",
350
- children: b("voiceSession.listening", "Listening…")
353
+ children: S("voiceSession.listening", "Listening…")
351
354
  }) : null
352
355
  ]
353
356
  }),
354
- /* @__PURE__ */ f("p", {
357
+ /* @__PURE__ */ m("p", {
355
358
  id: ee,
356
359
  hidden: !0,
357
360
  "data-testid": "assistant-composer-hint",
358
- children: t
361
+ children: n
359
362
  }),
360
- /* @__PURE__ */ p("div", {
363
+ /* @__PURE__ */ h("div", {
361
364
  onDragEnter: Jt,
362
365
  onDragLeave: Yt,
363
366
  onDragOver: Xt,
364
367
  onDrop: Zt,
365
- className: `flex flex-col rounded-3xl border transition-colors focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)] ${Je ? "bg-bg-surface" : "bg-bg-elevated"} ${D ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
368
+ className: `flex flex-col rounded-3xl border transition-colors ${r && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${Je ? "bg-bg-surface" : "bg-bg-elevated"} ${r && W.phase !== "transcribing" ? "" : A ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
369
+ "data-dictating": r ? W.phase : void 0,
366
370
  "data-testid": "assistant-composer",
367
371
  "data-presentation": "compact",
368
372
  children: [
369
- /* @__PURE__ */ f("div", {
373
+ /* @__PURE__ */ m("div", {
370
374
  className: "px-3 pt-3 empty:hidden",
371
- children: /* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
372
- disabled: O,
375
+ children: /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
376
+ disabled: j,
373
377
  showSuggestions: K.length === 0,
374
378
  onSuggest: It
375
- }), /* @__PURE__ */ f(se, {
376
- attachments: I,
379
+ }), /* @__PURE__ */ m(ie, {
380
+ attachments: R,
377
381
  onRemove: pt,
378
382
  onRetry: mt,
379
- disabled: S || O,
383
+ disabled: T || j,
380
384
  preparingCount: ut
381
385
  })] })
382
386
  }),
383
- /* @__PURE__ */ f("textarea", {
384
- ref: Ze,
385
- value: T,
387
+ /* @__PURE__ */ m("textarea", {
388
+ ref: Xe,
389
+ value: O,
386
390
  onChange: (e) => Ut(e.target.value),
387
391
  onKeyDown: Kt,
388
392
  onPaste: qt,
389
- disabled: S,
390
- readOnly: O,
391
- "aria-busy": O || void 0,
392
- placeholder: D ? b("composer.dropHere", "Drop files to attach") : Pt,
393
+ disabled: T,
394
+ readOnly: j,
395
+ "aria-busy": j || void 0,
396
+ placeholder: A ? S("composer.dropHere", "Drop files to attach") : Pt,
393
397
  rows: 1,
394
- className: "min-h-10 w-full resize-none bg-transparent px-4 pb-1 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
398
+ className: `min-h-10 w-full resize-none bg-transparent px-4 pb-1 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${r ? " hidden" : ""}`,
395
399
  "aria-describedby": ee,
396
- title: t,
397
- "aria-label": b("chatInput.ariaLabel", "Message input"),
400
+ title: n,
401
+ "aria-label": S("chatInput.ariaLabel", "Message input"),
398
402
  "data-testid": "assistant-input"
399
403
  }),
400
- n && V.interim ? /* @__PURE__ */ f("p", {
401
- className: "-mt-1 line-clamp-2 px-4 pb-1 text-base leading-6 text-text-muted",
402
- "aria-hidden": "true",
403
- "data-testid": "assistant-dictation-interim",
404
- children: V.interim
404
+ r ? /* @__PURE__ */ m(fe, {
405
+ phase: W.phase,
406
+ before: W.before,
407
+ take: W.take,
408
+ interim: W.interim,
409
+ after: W.after
405
410
  }) : null,
406
- n ? /* @__PURE__ */ p("div", {
407
- className: "flex flex-nowrap items-center gap-2 px-1.5 pb-1.5 pt-1",
408
- "data-testid": "assistant-composer-controls",
409
- "data-dictating": "true",
410
- children: [
411
- /* @__PURE__ */ f("button", {
412
- type: "button",
413
- onClick: Dt,
414
- className: "flex size-11 shrink-0 items-center justify-center rounded-full 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)] sm:size-10",
415
- "aria-label": b("composer.dictationCancel", "Cancel dictation"),
416
- title: b("composer.dictationCancel", "Cancel dictation"),
417
- "data-testid": "assistant-voice-cancel",
418
- children: /* @__PURE__ */ f(Ee, {
419
- className: "size-5",
420
- "aria-hidden": "true"
421
- })
422
- }),
423
- V.isListening ? /* @__PURE__ */ f(fe, {
424
- source: Mt,
425
- tone: "listening",
426
- className: "h-8 flex-1",
427
- testId: "assistant-dictation-waveform"
428
- }) : /* @__PURE__ */ f("p", {
429
- className: "min-w-0 flex-1 truncate text-sm text-text-muted",
430
- "data-testid": "assistant-voice-starting",
431
- children: b("voice.starting", "Starting the microphone…")
432
- }),
433
- /* @__PURE__ */ f("span", {
434
- className: "shrink-0 text-xs tabular-nums text-text-muted",
435
- "aria-hidden": "true",
436
- "data-testid": "assistant-dictation-time",
437
- children: `${Math.floor(Ot / 60)}:${String(Ot % 60).padStart(2, "0")}`
438
- }),
439
- /* @__PURE__ */ f("button", {
440
- type: "button",
441
- onClick: Et,
442
- className: `flex size-11 shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover sm:size-10 ${i}`,
443
- "aria-label": b("composer.dictationDone", "Finish dictation"),
444
- title: b("composer.dictationDone", "Finish dictation"),
445
- "aria-pressed": "true",
446
- "data-testid": "assistant-voice",
447
- "data-state": V.isListening ? "listening" : "starting",
448
- children: /* @__PURE__ */ f(we, {
449
- className: "size-5",
450
- "aria-hidden": "true"
451
- })
411
+ r ? W.phase === "transcribing" ? /* @__PURE__ */ m(de, {
412
+ phase: W.phase,
413
+ seconds: W.seconds,
414
+ level: W.level,
415
+ onCancel: W.cancel,
416
+ onFinish: W.finish,
417
+ focusRing: s
418
+ }) : /* @__PURE__ */ m(t, {
419
+ onDismiss: W.cancel,
420
+ children: /* @__PURE__ */ m("div", {
421
+ className: "contents",
422
+ children: /* @__PURE__ */ m(de, {
423
+ phase: W.phase,
424
+ seconds: W.seconds,
425
+ level: W.level,
426
+ onCancel: W.cancel,
427
+ onFinish: W.finish,
428
+ focusRing: s
452
429
  })
453
- ]
454
- }) : /* @__PURE__ */ p("div", {
430
+ })
431
+ }) : /* @__PURE__ */ h("div", {
455
432
  className: "flex flex-nowrap items-center gap-1 px-1.5 pb-1.5 pt-1",
456
433
  "data-testid": "assistant-composer-controls",
457
434
  children: [
458
- /* @__PURE__ */ f(oe, {
459
- onFiles: L,
435
+ /* @__PURE__ */ m(re, {
436
+ onFiles: z,
460
437
  canAddMore: _t,
461
- disabled: S || O,
438
+ disabled: T || j,
462
439
  compact: !0,
463
440
  capMenuHeight: !0
464
441
  }),
465
- /* @__PURE__ */ f(he, {
442
+ /* @__PURE__ */ m(_e, {
466
443
  chip: !0,
467
444
  readOnly: Je,
468
445
  mode: Pe,
469
- availableModes: h,
446
+ availableModes: _,
470
447
  onModeChange: Ie,
471
448
  auto: Le,
472
- disabled: S || O,
473
- disabledReason: j === null ? _ ? "replying" : Ge ?? "busy" : "busy"
449
+ disabled: T || j,
450
+ disabledReason: F === null ? y ? "replying" : Ge ?? "busy" : "busy"
474
451
  }),
475
- /* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
476
- V.isSupported && !y && /* @__PURE__ */ f(le, {
452
+ C ? /* @__PURE__ */ m("span", {
453
+ className: "ms-1 hidden min-w-0 truncate text-xs text-text-secondary sm:block",
454
+ "data-testid": "assistant-mic-summary",
455
+ children: i ? S("dictation.noMicrophone", "No microphone available") : Ot
456
+ }) : null,
457
+ /* @__PURE__ */ m("div", { className: "min-w-0 flex-1" }),
458
+ U.isSupported && !x ? C ? /* @__PURE__ */ m(me, {
459
+ onDictate: W.start,
460
+ blocked: i,
461
+ disabled: T || j
462
+ }) : /* @__PURE__ */ m(se, {
477
463
  compact: !0,
478
- isListening: V.isListening,
479
- isStarting: V.isStarting,
480
- onToggle: Tt,
481
- disabled: S || O
482
- }),
483
- Q ? /* @__PURE__ */ f("button", {
464
+ isListening: U.isListening,
465
+ isStarting: U.isStarting,
466
+ onToggle: W.start,
467
+ disabled: T || j
468
+ }) : null,
469
+ Q ? /* @__PURE__ */ m("button", {
484
470
  ref: Ht,
485
471
  type: "button",
486
472
  onClick: Vt,
487
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${i} ${j === null ? "" : "cursor-default opacity-60"}`,
488
- "aria-label": j === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
489
- title: j === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
490
- "aria-disabled": j === null ? void 0 : "true",
491
- "aria-busy": j === null ? void 0 : "true",
473
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${s} ${F === null ? "" : "cursor-default opacity-60"}`,
474
+ "aria-label": F === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
475
+ title: F === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
476
+ "aria-disabled": F === null ? void 0 : "true",
477
+ "aria-busy": F === null ? void 0 : "true",
492
478
  "data-testid": "assistant-stop",
493
- children: j === null ? /* @__PURE__ */ f(Te, {
479
+ children: F === null ? /* @__PURE__ */ m(Ee, {
494
480
  className: "size-4 fill-current",
495
481
  "aria-hidden": "true"
496
- }) : /* @__PURE__ */ f(d, {
482
+ }) : /* @__PURE__ */ m(p, {
497
483
  className: "size-4 motion-safe:animate-spin",
498
484
  "aria-hidden": "true"
499
485
  })
500
- }) : e ? /* @__PURE__ */ f(de, {
486
+ }) : e && !(C && i) ? /* @__PURE__ */ m(le, {
501
487
  compact: !0,
502
- invisible: y,
503
- onStart: g,
504
- disabled: S || O
505
- }) : /* @__PURE__ */ f("button", {
488
+ invisible: x,
489
+ onStart: v,
490
+ disabled: T || j
491
+ }) : /* @__PURE__ */ m("button", {
506
492
  type: "button",
507
493
  onClick: () => {
508
- A(null), X();
494
+ P(null), X();
509
495
  },
510
496
  disabled: !J,
511
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${i} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
512
- "aria-label": b("chatInput.send", "Send message"),
497
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${s} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
498
+ "aria-label": S("chatInput.send", "Send message"),
513
499
  "data-testid": "assistant-send",
514
- children: je || lt || O ? /* @__PURE__ */ f(d, {
500
+ children: je || lt || j ? /* @__PURE__ */ m(p, {
515
501
  className: "size-5 motion-safe:animate-spin",
516
502
  "aria-hidden": "true"
517
- }) : /* @__PURE__ */ f(Ce, {
503
+ }) : /* @__PURE__ */ m(Te, {
518
504
  className: "size-5",
519
505
  "aria-hidden": "true"
520
506
  })
@@ -526,90 +512,90 @@ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend:
526
512
  ]
527
513
  }) });
528
514
  }
529
- return /* @__PURE__ */ p("div", {
515
+ return /* @__PURE__ */ h("div", {
530
516
  className: "flex-shrink-0 px-3 pb-3 pt-1.5",
531
517
  children: [
532
- /* @__PURE__ */ p("div", {
518
+ /* @__PURE__ */ h("div", {
533
519
  onDragEnter: Jt,
534
520
  onDragLeave: Yt,
535
521
  onDragOver: Xt,
536
522
  onDrop: Zt,
537
- className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${D ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
523
+ className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${A ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
538
524
  "data-testid": "assistant-composer",
539
525
  children: [
540
- /* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
541
- disabled: O,
526
+ /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
527
+ disabled: j,
542
528
  showSuggestions: K.length === 0,
543
529
  onSuggest: It
544
- }), /* @__PURE__ */ f(se, {
545
- attachments: I,
530
+ }), /* @__PURE__ */ m(ie, {
531
+ attachments: R,
546
532
  onRemove: pt,
547
533
  onRetry: mt,
548
- disabled: S || O,
534
+ disabled: T || j,
549
535
  preparingCount: ut
550
536
  })] }),
551
- /* @__PURE__ */ p("div", {
537
+ /* @__PURE__ */ h("div", {
552
538
  className: "flex items-end gap-2",
553
539
  children: [
554
- /* @__PURE__ */ f(oe, {
555
- onFiles: L,
540
+ /* @__PURE__ */ m(re, {
541
+ onFiles: z,
556
542
  canAddMore: _t,
557
- disabled: S || O,
543
+ disabled: T || j,
558
544
  showLabel: !0
559
545
  }),
560
- /* @__PURE__ */ f("textarea", {
561
- ref: w,
562
- value: T,
563
- onChange: (e) => E(e.target.value),
546
+ /* @__PURE__ */ m("textarea", {
547
+ ref: D,
548
+ value: O,
549
+ onChange: (e) => k(e.target.value),
564
550
  onKeyDown: Gt,
565
551
  onPaste: qt,
566
- disabled: S,
567
- readOnly: O,
568
- "aria-busy": O || void 0,
569
- placeholder: D ? b("composer.dropHere", "Drop files to attach") : Pt,
552
+ disabled: T,
553
+ readOnly: j,
554
+ "aria-busy": j || void 0,
555
+ placeholder: A ? S("composer.dropHere", "Drop files to attach") : Pt,
570
556
  rows: 1,
571
557
  className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
572
- "aria-label": b("chatInput.ariaLabel", "Message input"),
558
+ "aria-label": S("chatInput.ariaLabel", "Message input"),
573
559
  "data-testid": "assistant-input"
574
560
  }),
575
- V.isSupported && /* @__PURE__ */ f(le, {
576
- isListening: V.isListening,
577
- isStarting: V.isStarting,
578
- onToggle: V.toggle,
579
- disabled: S || O
561
+ U.isSupported && /* @__PURE__ */ m(se, {
562
+ isListening: U.isListening,
563
+ isStarting: U.isStarting,
564
+ onToggle: U.toggle,
565
+ disabled: T || j
580
566
  }),
581
- g && K.length === 0 && I.length === 0 && !V.isActive ? /* @__PURE__ */ f(de, {
582
- onStart: g,
583
- disabled: S || O
584
- }) : /* @__PURE__ */ f("button", {
567
+ v && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ m(le, {
568
+ onStart: v,
569
+ disabled: T || j
570
+ }) : /* @__PURE__ */ m("button", {
585
571
  type: "button",
586
572
  onClick: () => void X(),
587
573
  disabled: !J,
588
574
  className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${J ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
589
- "aria-label": b("chatInput.send", "Send message"),
575
+ "aria-label": S("chatInput.send", "Send message"),
590
576
  "data-testid": "assistant-send",
591
- children: je || lt || O ? /* @__PURE__ */ f(d, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ f(Ce, { className: "size-4" })
577
+ children: je || lt || j ? /* @__PURE__ */ m(p, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ m(Te, { className: "size-4" })
592
578
  })
593
579
  ]
594
580
  }),
595
- (h.length > 1 || h.some((e) => e.writeCapable)) && /* @__PURE__ */ f("div", {
581
+ (_.length > 1 || _.some((e) => e.writeCapable)) && /* @__PURE__ */ m("div", {
596
582
  className: "mt-2 px-0.5",
597
- children: /* @__PURE__ */ f(me, {
583
+ children: /* @__PURE__ */ m(ge, {
598
584
  mode: Pe,
599
- availableModes: h,
585
+ availableModes: _,
600
586
  onModeChange: Ie,
601
- disabled: S || O,
587
+ disabled: T || j,
602
588
  auto: Le
603
589
  })
604
590
  })
605
591
  ]
606
592
  }),
607
- c ? /* @__PURE__ */ f("p", {
593
+ u ? /* @__PURE__ */ m("p", {
608
594
  className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
609
595
  "data-testid": "assistant-write-access-warning",
610
- children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
596
+ children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
611
597
  }) : null,
612
- /* @__PURE__ */ f("div", {
598
+ /* @__PURE__ */ m("div", {
613
599
  className: "mt-1.5 px-1 text-center text-[11px]",
614
600
  "aria-live": "polite",
615
601
  children: $t(!1, !1)
@@ -617,4 +603,4 @@ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend:
617
603
  ]
618
604
  });
619
605
  };
620
- export { m as AssistantComposer };
606
+ export { g as AssistantComposer };