@burdenoff/fe-libs 2026.1114.13 → 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.
- package/dist/shared/assistant/conversation.d.ts +16 -0
- package/dist/shared/assistant/i18nManifest.d.ts +30 -0
- package/dist/shared/assistant/i18nManifest.js +30 -0
- package/dist/shared/assistant/index.d.ts +6 -0
- package/dist/shared/assistant/store.d.ts +7 -0
- package/dist/shared/assistant/store.js +3 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1269 -1188
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +14 -0
- package/dist/shared/assistant/ui/AssistantMessageList.js +55 -52
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +387 -395
- package/dist/shared/assistant/ui/composer/AssistantDictation.d.ts +42 -0
- package/dist/shared/assistant/ui/composer/AssistantDictation.js +127 -0
- package/dist/shared/assistant/ui/composer/AssistantMicMenu.d.ts +23 -0
- package/dist/shared/assistant/ui/composer/AssistantMicMenu.js +176 -0
- package/dist/shared/assistant/ui/composer/microphones.d.ts +13 -0
- package/dist/shared/assistant/ui/composer/microphones.js +15 -0
- package/dist/shared/assistant/ui/composer/useCompactDictation.d.ts +70 -0
- package/dist/shared/assistant/ui/composer/useCompactDictation.js +136 -0
- package/dist/shared/assistant/ui/useVoiceSession.js +166 -164
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.d.ts +20 -17
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +230 -123
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +2 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +227 -229
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.d.ts +5 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +6 -6
- package/dist/shared/assistant/ui/voice/LiveWaveform.d.ts +4 -3
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +1 -1
- package/dist/shared/assistant/ui/voice/VoiceTurnMarks.d.ts +15 -0
- package/dist/shared/assistant/ui/voice/VoiceTurnMarks.js +43 -0
- package/dist/shared/assistant/ui/voice/formatClock.d.ts +2 -0
- package/dist/shared/assistant/ui/voice/formatClock.js +3 -0
- package/dist/shared/assistant/ui/voice/useLiveLevel.d.ts +3 -1
- package/dist/shared/assistant/ui/voice/useLiveLevel.js +23 -19
- package/dist/shared/assistant/voice/liveLevel.d.ts +4 -3
- package/dist/shared/assistant/voice/liveLevel.js +18 -15
- package/dist/shared/assistant/voice/useVoiceInput.d.ts +27 -1
- package/dist/shared/assistant/voice/useVoiceInput.js +141 -71
- package/dist/shared-assistant.js +383 -377
- 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
|
|
7
|
-
import { useAssistantStore as
|
|
8
|
-
import { useVoiceInput as
|
|
9
|
-
import { useAssistantAttachments as
|
|
10
|
-
import { getSendableAttachments as
|
|
11
|
-
import { ATTACHMENT_COMMIT_CODES as
|
|
12
|
-
import { AssistantAttachmentButton as
|
|
13
|
-
import { AssistantAttachmentChips as
|
|
14
|
-
import { AssistantFocusChip as
|
|
15
|
-
import { useAskAboutStore as
|
|
16
|
-
import { AssistantVoiceButton as
|
|
17
|
-
import { AssistantVoiceSessionButton as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
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,489 +33,480 @@ 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(
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
text:
|
|
46
|
-
hasAttachments:
|
|
47
|
-
dictated:
|
|
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
|
|
48
49
|
});
|
|
49
50
|
}, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
O,
|
|
52
|
+
B.length,
|
|
53
|
+
H,
|
|
53
54
|
ze
|
|
54
55
|
]);
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
}, []),
|
|
58
|
-
onFinalize:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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;
|
|
76
|
+
}, [
|
|
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()));
|
|
63
88
|
}, [
|
|
64
89
|
Be,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
90
|
+
q,
|
|
91
|
+
Ot,
|
|
92
|
+
kt,
|
|
93
|
+
W,
|
|
94
|
+
E,
|
|
95
|
+
At
|
|
96
|
+
]), l(() => {
|
|
70
97
|
Ve?.({
|
|
71
|
-
committing:
|
|
72
|
-
dictating:
|
|
98
|
+
committing: j,
|
|
99
|
+
dictating: q
|
|
73
100
|
});
|
|
74
101
|
}, [
|
|
75
102
|
Ve,
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
j,
|
|
104
|
+
q
|
|
78
105
|
]);
|
|
79
|
-
let
|
|
80
|
-
|
|
81
|
-
|
|
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 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;
|
|
115
109
|
t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
|
|
116
110
|
});
|
|
117
111
|
};
|
|
118
|
-
|
|
119
|
-
if (!
|
|
120
|
-
let e =
|
|
121
|
-
e && (e.focus({ preventScroll: !0 }),
|
|
122
|
-
}, [
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}), []),
|
|
129
|
-
let e =
|
|
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;
|
|
130
124
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Oe)}px`);
|
|
131
|
-
}, [
|
|
132
|
-
let
|
|
133
|
-
if (!
|
|
134
|
-
|
|
135
|
-
let e =
|
|
136
|
-
|
|
137
|
-
let t =
|
|
138
|
-
if (!
|
|
139
|
-
|
|
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();
|
|
140
134
|
return;
|
|
141
135
|
}
|
|
142
|
-
let n =
|
|
143
|
-
|
|
136
|
+
let n = o.getState().activeConversationId;
|
|
137
|
+
$e.current = !0, Qe(!0);
|
|
144
138
|
try {
|
|
145
|
-
let r = await
|
|
146
|
-
if (!
|
|
139
|
+
let r = await gt();
|
|
140
|
+
if (!X.current) {
|
|
147
141
|
r.ok && await r.rollback();
|
|
148
142
|
return;
|
|
149
143
|
}
|
|
150
144
|
if (!r.ok) {
|
|
151
|
-
r.cancelled ||
|
|
145
|
+
r.cancelled || N({
|
|
152
146
|
kind: "failed",
|
|
153
147
|
failures: r.failures
|
|
154
148
|
});
|
|
155
149
|
return;
|
|
156
150
|
}
|
|
157
|
-
if (
|
|
158
|
-
await r.rollback(),
|
|
151
|
+
if (Rt.current) {
|
|
152
|
+
await r.rollback(), X.current && N({
|
|
159
153
|
kind: "busy",
|
|
160
154
|
failures: []
|
|
161
155
|
});
|
|
162
156
|
return;
|
|
163
157
|
}
|
|
164
|
-
let i =
|
|
158
|
+
let i = o.getState();
|
|
165
159
|
if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
|
|
166
|
-
await r.rollback(),
|
|
160
|
+
await r.rollback(), X.current && N({
|
|
167
161
|
kind: "moved",
|
|
168
162
|
failures: []
|
|
169
163
|
});
|
|
170
164
|
return;
|
|
171
165
|
}
|
|
172
|
-
|
|
166
|
+
R.current = t, g(e, te(r.attachments)), r.handedOver(), k(""), pt();
|
|
173
167
|
} finally {
|
|
174
|
-
|
|
168
|
+
$e.current = !1, X.current && Qe(!1);
|
|
175
169
|
}
|
|
176
170
|
}, [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]),
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
|
|
190
|
-
}, []), Vt =
|
|
191
|
-
if (
|
|
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;
|
|
192
186
|
let e = Ue?.() ?? null;
|
|
193
|
-
e !== null && (
|
|
194
|
-
}, [Ue,
|
|
195
|
-
|
|
196
|
-
!
|
|
197
|
-
}, [
|
|
198
|
-
let Ht =
|
|
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) => {
|
|
199
193
|
if (e !== null) {
|
|
200
|
-
|
|
194
|
+
L.current = e;
|
|
201
195
|
return;
|
|
202
196
|
}
|
|
203
|
-
let t =
|
|
204
|
-
|
|
205
|
-
}, []), Q =
|
|
206
|
-
|
|
207
|
-
!Q &&
|
|
208
|
-
}, [Q,
|
|
209
|
-
|
|
210
|
-
}, [
|
|
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(() => {
|
|
211
205
|
if (!Q) return;
|
|
212
|
-
let e =
|
|
213
|
-
if (
|
|
214
|
-
let t =
|
|
206
|
+
let e = R.current;
|
|
207
|
+
if (R.current = !1, !e) return;
|
|
208
|
+
let t = L.current;
|
|
215
209
|
if (t === null) return;
|
|
216
210
|
let n = t.ownerDocument, r = n.activeElement;
|
|
217
|
-
(r === null || r === n.body || r ===
|
|
211
|
+
(r === null || r === n.body || r === D.current) && t.focus({ preventScroll: !0 });
|
|
218
212
|
}, [Q]);
|
|
219
|
-
let Ut =
|
|
220
|
-
|
|
213
|
+
let Ut = c((e) => {
|
|
214
|
+
k(e), P(null);
|
|
221
215
|
}, []);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}, [
|
|
216
|
+
l(() => {
|
|
217
|
+
N(null);
|
|
218
|
+
}, [B.length]);
|
|
225
219
|
let Wt = (t) => {
|
|
226
|
-
if (t.kind === "busy") return
|
|
227
|
-
if (t.kind === "moved") return
|
|
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 ===
|
|
230
|
-
if (n.some((e) => e.code ===
|
|
231
|
-
let r = n[0], i =
|
|
232
|
-
return `${n.length <= 1 ?
|
|
233
|
-
}, Gt =
|
|
234
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
235
|
-
}, [
|
|
236
|
-
e.key === "Escape" ?
|
|
237
|
-
}, [
|
|
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 ?? "";
|
|
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) => {
|
|
238
232
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
239
|
-
t.length !== 0 && (e.preventDefault(),
|
|
240
|
-
}, [
|
|
241
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
242
|
-
}, []), Yt =
|
|
243
|
-
|
|
244
|
-
}, []), Xt =
|
|
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) => {
|
|
245
239
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
246
|
-
}, []), Zt =
|
|
247
|
-
e.preventDefault(),
|
|
248
|
-
}, [
|
|
240
|
+
}, []), Zt = c((e) => {
|
|
241
|
+
e.preventDefault(), z.current = 0, Ze(!1), V(e.dataTransfer?.files ?? null);
|
|
242
|
+
}, [V]), Qt = (e) => {
|
|
249
243
|
switch (e) {
|
|
250
|
-
case "too-many": return
|
|
251
|
-
case "too-large": return
|
|
252
|
-
case "empty": return
|
|
253
|
-
case "unreadable": return
|
|
254
|
-
case "unsupported-image": return
|
|
255
|
-
case "too-large-to-save": return
|
|
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 (
|
|
259
|
-
case "not-allowed": return
|
|
260
|
-
case "audio-capture": return
|
|
261
|
-
case "network": return
|
|
262
|
-
case "language-not-supported": return
|
|
263
|
-
case "unknown": return
|
|
252
|
+
switch (G.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(G.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) =>
|
|
267
|
-
onDismiss:
|
|
268
|
-
children: /* @__PURE__ */
|
|
260
|
+
})(), $t = (e, n, r = !1) => j ? /* @__PURE__ */ m(t, {
|
|
261
|
+
onDismiss: zt,
|
|
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__ */
|
|
266
|
+
/* @__PURE__ */ m(p, {
|
|
273
267
|
className: "size-3 motion-safe:animate-spin",
|
|
274
268
|
"aria-hidden": "true"
|
|
275
269
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ m("span", { children: S("attachments.saving", "Saving your attachments…") }),
|
|
271
|
+
/* @__PURE__ */ m("button", {
|
|
278
272
|
type: "button",
|
|
279
|
-
onClick:
|
|
273
|
+
onClick: zt,
|
|
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:
|
|
276
|
+
children: S("attachments.cancelSaving", "Cancel")
|
|
283
277
|
})
|
|
284
278
|
]
|
|
285
279
|
})
|
|
286
|
-
}) :
|
|
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(
|
|
291
|
-
}) : !r &&
|
|
284
|
+
children: Wt(M)
|
|
285
|
+
}) : !r && G.isStarting && !G.isListening ? /* @__PURE__ */ m("p", {
|
|
292
286
|
className: "text-text-muted",
|
|
293
287
|
"data-testid": "assistant-voice-starting",
|
|
294
|
-
children:
|
|
295
|
-
}) : !r &&
|
|
288
|
+
children: S("voice.starting", "Starting the microphone…")
|
|
289
|
+
}) : !r && G.isListening ? /* @__PURE__ */ h("p", {
|
|
296
290
|
className: "text-status-error-text",
|
|
297
291
|
"data-testid": "assistant-voice-status",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
-
}) : $ ? /* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ m(ce, {}), G.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
|
-
}) :
|
|
297
|
+
}) : ut ? /* @__PURE__ */ m("button", {
|
|
304
298
|
type: "button",
|
|
305
|
-
onClick:
|
|
299
|
+
onClick: mt,
|
|
306
300
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
307
301
|
"data-testid": "assistant-attachment-rejection",
|
|
308
|
-
children: Qt(
|
|
309
|
-
}) :
|
|
302
|
+
children: Qt(ut)
|
|
303
|
+
}) : lt === "failed" ? /* @__PURE__ */ m("p", {
|
|
310
304
|
className: "text-status-error-text",
|
|
311
305
|
"data-testid": "assistant-attachment-blocked",
|
|
312
|
-
children:
|
|
313
|
-
}) : n ? /* @__PURE__ */
|
|
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", {
|
|
314
308
|
className: "text-text-muted",
|
|
315
309
|
"data-testid": "assistant-stopping-status",
|
|
316
|
-
children:
|
|
317
|
-
}) : e ? /* @__PURE__ */
|
|
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:
|
|
321
|
-
}) : /* @__PURE__ */
|
|
314
|
+
children: S("composer.stopped", "Reply stopped.")
|
|
315
|
+
}) : /* @__PURE__ */ m("p", {
|
|
322
316
|
className: "text-text-muted",
|
|
323
|
-
children:
|
|
317
|
+
children: S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
324
318
|
});
|
|
325
|
-
if (
|
|
326
|
-
let e =
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
ref:
|
|
329
|
-
className: `${
|
|
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" : ""}`,
|
|
330
324
|
children: [
|
|
331
325
|
Ke,
|
|
332
|
-
qe ? /* @__PURE__ */
|
|
333
|
-
voiceLive:
|
|
326
|
+
qe ? /* @__PURE__ */ m(ve, {
|
|
327
|
+
voiceLive: x,
|
|
334
328
|
children: qe
|
|
335
329
|
}) : null,
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
className:
|
|
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
|
-
|
|
335
|
+
u ? /* @__PURE__ */ m("p", {
|
|
342
336
|
className: "text-status-warning",
|
|
343
337
|
"data-testid": "assistant-write-access-warning",
|
|
344
|
-
children:
|
|
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
|
-
|
|
347
|
-
|
|
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", {
|
|
348
351
|
className: "sr-only",
|
|
349
352
|
"data-testid": "assistant-dictation-announced",
|
|
350
|
-
children:
|
|
353
|
+
children: S("voiceSession.listening", "Listening…")
|
|
351
354
|
}) : null
|
|
352
355
|
]
|
|
353
356
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ m("p", {
|
|
355
358
|
id: ee,
|
|
356
359
|
hidden: !0,
|
|
357
360
|
"data-testid": "assistant-composer-hint",
|
|
358
|
-
children:
|
|
361
|
+
children: n
|
|
359
362
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
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"} ${
|
|
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,
|
|
366
370
|
"data-testid": "assistant-composer",
|
|
367
371
|
"data-presentation": "compact",
|
|
368
372
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ m("div", {
|
|
370
374
|
className: "px-3 pt-3 empty:hidden",
|
|
371
|
-
children: /* @__PURE__ */
|
|
372
|
-
disabled:
|
|
373
|
-
showSuggestions:
|
|
374
|
-
onSuggest:
|
|
375
|
-
}), /* @__PURE__ */
|
|
376
|
-
attachments:
|
|
377
|
-
onRemove:
|
|
378
|
-
onRetry:
|
|
379
|
-
disabled:
|
|
380
|
-
preparingCount:
|
|
375
|
+
children: /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
|
|
376
|
+
disabled: j,
|
|
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
|
|
381
385
|
})] })
|
|
382
386
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
ref:
|
|
385
|
-
value:
|
|
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:
|
|
390
|
-
readOnly:
|
|
391
|
-
"aria-busy":
|
|
392
|
-
placeholder:
|
|
393
|
+
disabled: T,
|
|
394
|
+
readOnly: j,
|
|
395
|
+
"aria-busy": j || void 0,
|
|
396
|
+
placeholder: A ? S("composer.dropHere", "Drop files to attach") : Mt,
|
|
393
397
|
rows: 1,
|
|
394
|
-
className:
|
|
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:
|
|
397
|
-
"aria-label":
|
|
400
|
+
title: n,
|
|
401
|
+
"aria-label": S("chatInput.ariaLabel", "Message input"),
|
|
398
402
|
"data-testid": "assistant-input"
|
|
399
403
|
}),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
410
|
}) : null,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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 ? 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
|
|
452
429
|
})
|
|
453
|
-
|
|
454
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
459
|
-
onFiles:
|
|
460
|
-
canAddMore:
|
|
461
|
-
disabled:
|
|
435
|
+
/* @__PURE__ */ m(re, {
|
|
436
|
+
onFiles: V,
|
|
437
|
+
canAddMore: ht,
|
|
438
|
+
disabled: T || j,
|
|
462
439
|
compact: !0,
|
|
463
440
|
capMenuHeight: !0
|
|
464
441
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ m(_e, {
|
|
466
443
|
chip: !0,
|
|
467
444
|
readOnly: Je,
|
|
468
445
|
mode: Pe,
|
|
469
|
-
availableModes:
|
|
446
|
+
availableModes: _,
|
|
470
447
|
onModeChange: Ie,
|
|
471
448
|
auto: Le,
|
|
472
|
-
disabled:
|
|
473
|
-
disabledReason:
|
|
449
|
+
disabled: T || j,
|
|
450
|
+
disabledReason: F === null ? y ? "replying" : Ge ?? "busy" : "busy"
|
|
474
451
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
|
|
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, {
|
|
477
463
|
compact: !0,
|
|
478
|
-
isListening:
|
|
479
|
-
isStarting:
|
|
480
|
-
onToggle:
|
|
481
|
-
disabled:
|
|
482
|
-
}),
|
|
483
|
-
|
|
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", {
|
|
484
476
|
ref: Ht,
|
|
485
477
|
type: "button",
|
|
486
478
|
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 ${
|
|
488
|
-
"aria-label":
|
|
489
|
-
title:
|
|
490
|
-
"aria-disabled":
|
|
491
|
-
"aria-busy":
|
|
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",
|
|
492
484
|
"data-testid": "assistant-stop",
|
|
493
|
-
children:
|
|
485
|
+
children: F === null ? /* @__PURE__ */ m(Ee, {
|
|
494
486
|
className: "size-4 fill-current",
|
|
495
487
|
"aria-hidden": "true"
|
|
496
|
-
}) : /* @__PURE__ */
|
|
488
|
+
}) : /* @__PURE__ */ m(p, {
|
|
497
489
|
className: "size-4 motion-safe:animate-spin",
|
|
498
490
|
"aria-hidden": "true"
|
|
499
491
|
})
|
|
500
|
-
}) : e ? /* @__PURE__ */
|
|
492
|
+
}) : e && !C ? /* @__PURE__ */ m(le, {
|
|
501
493
|
compact: !0,
|
|
502
|
-
invisible:
|
|
503
|
-
onStart:
|
|
504
|
-
disabled:
|
|
505
|
-
}) : /* @__PURE__ */
|
|
494
|
+
invisible: x,
|
|
495
|
+
onStart: v,
|
|
496
|
+
disabled: T || j
|
|
497
|
+
}) : /* @__PURE__ */ m("button", {
|
|
506
498
|
type: "button",
|
|
507
499
|
onClick: () => {
|
|
508
|
-
|
|
500
|
+
P(null), Z();
|
|
509
501
|
},
|
|
510
|
-
disabled: !
|
|
511
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${
|
|
512
|
-
"aria-label":
|
|
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)]"}`,
|
|
504
|
+
"aria-label": S("chatInput.send", "Send message"),
|
|
513
505
|
"data-testid": "assistant-send",
|
|
514
|
-
children: je ||
|
|
506
|
+
children: je || st || j ? /* @__PURE__ */ m(p, {
|
|
515
507
|
className: "size-5 motion-safe:animate-spin",
|
|
516
508
|
"aria-hidden": "true"
|
|
517
|
-
}) : /* @__PURE__ */
|
|
509
|
+
}) : /* @__PURE__ */ m(Te, {
|
|
518
510
|
className: "size-5",
|
|
519
511
|
"aria-hidden": "true"
|
|
520
512
|
})
|
|
@@ -526,90 +518,90 @@ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend:
|
|
|
526
518
|
]
|
|
527
519
|
}) });
|
|
528
520
|
}
|
|
529
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ h("div", {
|
|
530
522
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
531
523
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ h("div", {
|
|
533
525
|
onDragEnter: Jt,
|
|
534
526
|
onDragLeave: Yt,
|
|
535
527
|
onDragOver: Xt,
|
|
536
528
|
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 ${
|
|
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"}`,
|
|
538
530
|
"data-testid": "assistant-composer",
|
|
539
531
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
disabled:
|
|
542
|
-
showSuggestions:
|
|
543
|
-
onSuggest:
|
|
544
|
-
}), /* @__PURE__ */
|
|
545
|
-
attachments:
|
|
546
|
-
onRemove:
|
|
547
|
-
onRetry:
|
|
548
|
-
disabled:
|
|
549
|
-
preparingCount:
|
|
532
|
+
/* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
|
|
533
|
+
disabled: j,
|
|
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
|
|
550
542
|
})] }),
|
|
551
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ h("div", {
|
|
552
544
|
className: "flex items-end gap-2",
|
|
553
545
|
children: [
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
onFiles:
|
|
556
|
-
canAddMore:
|
|
557
|
-
disabled:
|
|
546
|
+
/* @__PURE__ */ m(re, {
|
|
547
|
+
onFiles: V,
|
|
548
|
+
canAddMore: ht,
|
|
549
|
+
disabled: T || j,
|
|
558
550
|
showLabel: !0
|
|
559
551
|
}),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
ref:
|
|
562
|
-
value:
|
|
563
|
-
onChange: (e) =>
|
|
552
|
+
/* @__PURE__ */ m("textarea", {
|
|
553
|
+
ref: D,
|
|
554
|
+
value: O,
|
|
555
|
+
onChange: (e) => k(e.target.value),
|
|
564
556
|
onKeyDown: Gt,
|
|
565
557
|
onPaste: qt,
|
|
566
|
-
disabled:
|
|
567
|
-
readOnly:
|
|
568
|
-
"aria-busy":
|
|
569
|
-
placeholder:
|
|
558
|
+
disabled: T,
|
|
559
|
+
readOnly: j,
|
|
560
|
+
"aria-busy": j || void 0,
|
|
561
|
+
placeholder: A ? S("composer.dropHere", "Drop files to attach") : Mt,
|
|
570
562
|
rows: 1,
|
|
571
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",
|
|
572
|
-
"aria-label":
|
|
564
|
+
"aria-label": S("chatInput.ariaLabel", "Message input"),
|
|
573
565
|
"data-testid": "assistant-input"
|
|
574
566
|
}),
|
|
575
|
-
|
|
576
|
-
isListening:
|
|
577
|
-
isStarting:
|
|
578
|
-
onToggle:
|
|
579
|
-
disabled:
|
|
567
|
+
G.isSupported && /* @__PURE__ */ m(se, {
|
|
568
|
+
isListening: G.isListening,
|
|
569
|
+
isStarting: G.isStarting,
|
|
570
|
+
onToggle: G.toggle,
|
|
571
|
+
disabled: T || j
|
|
580
572
|
}),
|
|
581
|
-
|
|
582
|
-
onStart:
|
|
583
|
-
disabled:
|
|
584
|
-
}) : /* @__PURE__ */
|
|
573
|
+
v && J.length === 0 && B.length === 0 && !G.isActive ? /* @__PURE__ */ m(le, {
|
|
574
|
+
onStart: v,
|
|
575
|
+
disabled: T || j
|
|
576
|
+
}) : /* @__PURE__ */ m("button", {
|
|
585
577
|
type: "button",
|
|
586
|
-
onClick: () => void
|
|
587
|
-
disabled: !
|
|
588
|
-
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 ${
|
|
589
|
-
"aria-label":
|
|
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"}`,
|
|
581
|
+
"aria-label": S("chatInput.send", "Send message"),
|
|
590
582
|
"data-testid": "assistant-send",
|
|
591
|
-
children: je ||
|
|
583
|
+
children: je || st || j ? /* @__PURE__ */ m(p, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ m(Te, { className: "size-4" })
|
|
592
584
|
})
|
|
593
585
|
]
|
|
594
586
|
}),
|
|
595
|
-
(
|
|
587
|
+
(_.length > 1 || _.some((e) => e.writeCapable)) && /* @__PURE__ */ m("div", {
|
|
596
588
|
className: "mt-2 px-0.5",
|
|
597
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ m(ge, {
|
|
598
590
|
mode: Pe,
|
|
599
|
-
availableModes:
|
|
591
|
+
availableModes: _,
|
|
600
592
|
onModeChange: Ie,
|
|
601
|
-
disabled:
|
|
593
|
+
disabled: T || j,
|
|
602
594
|
auto: Le
|
|
603
595
|
})
|
|
604
596
|
})
|
|
605
597
|
]
|
|
606
598
|
}),
|
|
607
|
-
|
|
599
|
+
u ? /* @__PURE__ */ m("p", {
|
|
608
600
|
className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
|
|
609
601
|
"data-testid": "assistant-write-access-warning",
|
|
610
|
-
children:
|
|
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.")
|
|
611
603
|
}) : null,
|
|
612
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ m("div", {
|
|
613
605
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
614
606
|
"aria-live": "polite",
|
|
615
607
|
children: $t(!1, !1)
|
|
@@ -617,4 +609,4 @@ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend:
|
|
|
617
609
|
]
|
|
618
610
|
});
|
|
619
611
|
};
|
|
620
|
-
export {
|
|
612
|
+
export { g as AssistantComposer };
|