@burdenoff/fe-libs 2026.1114.14 → 2026.1115.1

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