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