@burdenoff/fe-libs 2026.731.4 → 2026.731.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/AssistantWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAGV,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AA0D1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/AssistantWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAGV,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AA0D1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAs6BpD,CAAC"}
|
|
@@ -68,16 +68,16 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
68
68
|
i(() => {
|
|
69
69
|
w || console.error("[AssistantWidget] No transport available — supply `transport`, or a non-empty `modes` where each entry has a transport.");
|
|
70
70
|
}, [w]);
|
|
71
|
-
let [T, E] = s(() => ge()), [D, O] = s([]), [k, A] = s(""), [j, M] = s([]), [N, P] = s(!1), [Ne, F] = s(!1), [I, L] = s([]), [R, z] = s(!1), [Pe, Fe] = s(!1), [Ie, Le] = s(() => me()), [Re, B] = s([]), [V, ze] = s(null), H =
|
|
71
|
+
let [T, E] = s(() => ge()), [D, O] = s([]), [k, A] = s(""), [j, M] = s([]), [N, P] = s(!1), [Ne, F] = s(!1), [I, L] = s([]), [R, z] = s(!1), [Pe, Fe] = s(!1), [Ie, Le] = s(() => me()), [Re, B] = s([]), [V, ze] = s(null), [Be, H] = s(!1), U = o(null), W = o(null), G = o(null), K = o(!1), Ve = o(null), q = Se === "sidebar", He = Ce && !!C?.newSession, Ue = r(() => {
|
|
72
72
|
Le((e) => {
|
|
73
73
|
let t = !e;
|
|
74
74
|
return he(t), t;
|
|
75
75
|
});
|
|
76
|
-
}, []),
|
|
76
|
+
}, []), J = t(xe), We = r(() => {
|
|
77
77
|
h(!0), E(!0), C.prewarm?.("full");
|
|
78
|
-
}, [C]), J = r(() => {
|
|
79
|
-
h(!1), E(!1), C.suspend?.();
|
|
80
78
|
}, [C]), Y = r(() => {
|
|
79
|
+
h(!1), E(!1), C.suspend?.();
|
|
80
|
+
}, [C]), X = r(() => {
|
|
81
81
|
E((e) => {
|
|
82
82
|
let t = !e;
|
|
83
83
|
return h(t), t ? C.prewarm?.("full") : C.suspend?.(), t;
|
|
@@ -86,38 +86,38 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
86
86
|
i(() => {
|
|
87
87
|
let e = (e) => {
|
|
88
88
|
let t = e.detail;
|
|
89
|
-
t?.open === !0 ?
|
|
89
|
+
t?.open === !0 ? We() : t?.open === !1 ? Y() : X();
|
|
90
90
|
};
|
|
91
91
|
return window.addEventListener(f, e), () => window.removeEventListener(f, e);
|
|
92
92
|
}, [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
We,
|
|
94
|
+
Y,
|
|
95
|
+
X
|
|
96
96
|
]), i(() => {
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
let
|
|
97
|
+
J.isListening && J.transcript && A(J.transcript);
|
|
98
|
+
}, [J.transcript, J.isListening]);
|
|
99
|
+
let Z = r(async () => {
|
|
100
100
|
if (C.listArtifacts) try {
|
|
101
101
|
B(await C.listArtifacts());
|
|
102
102
|
} catch {
|
|
103
103
|
B([]);
|
|
104
104
|
}
|
|
105
|
-
}, [C]),
|
|
105
|
+
}, [C]), Ge = o(x);
|
|
106
106
|
i(() => {
|
|
107
|
-
|
|
107
|
+
Ge.current !== x && (Ge.current = x, G.current?.abort(), G.current = null, P(!1), O([]), A(""), L([]), z(!1), F(!1), B([]), K.current = !1);
|
|
108
108
|
}, [x]), i(() => {
|
|
109
|
-
if (!T ||
|
|
109
|
+
if (!T || K.current) return;
|
|
110
110
|
let e = C.loadHistory;
|
|
111
111
|
if (!e) {
|
|
112
|
-
|
|
112
|
+
K.current = !0;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
K.current = !0;
|
|
116
116
|
let t = !1;
|
|
117
117
|
return F(!0), (async () => {
|
|
118
118
|
try {
|
|
119
119
|
let n = await e();
|
|
120
|
-
!t && n.length > 0 && (O((e) => e.length === 0 ? n : e),
|
|
120
|
+
!t && n.length > 0 && (O((e) => e.length === 0 ? n : e), Z());
|
|
121
121
|
} catch {} finally {
|
|
122
122
|
t || F(!1);
|
|
123
123
|
}
|
|
@@ -127,16 +127,16 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
127
127
|
}, [
|
|
128
128
|
T,
|
|
129
129
|
C,
|
|
130
|
-
|
|
130
|
+
Z
|
|
131
131
|
]), i(() => {
|
|
132
|
-
T &&
|
|
132
|
+
T && W.current && (W.current.scrollTop = W.current.scrollHeight);
|
|
133
133
|
}, [D, T]);
|
|
134
|
-
let
|
|
134
|
+
let Q = r((e, t) => {
|
|
135
135
|
O((n) => n.map((n) => n.id === e ? {
|
|
136
136
|
...n,
|
|
137
137
|
...t
|
|
138
138
|
} : n));
|
|
139
|
-
}, []),
|
|
139
|
+
}, []), $ = r(async () => {
|
|
140
140
|
if (C.listSessions) {
|
|
141
141
|
Fe(!0);
|
|
142
142
|
try {
|
|
@@ -147,7 +147,7 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
147
147
|
Fe(!1);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
}, [C]),
|
|
150
|
+
}, [C]), Ke = r(async (e) => {
|
|
151
151
|
if (!(!C.downloadArtifact || V)) {
|
|
152
152
|
ze(e.path);
|
|
153
153
|
try {
|
|
@@ -156,28 +156,28 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
156
156
|
ze(null);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
}, [C, V]),
|
|
159
|
+
}, [C, V]), qe = r(async () => {
|
|
160
160
|
!C.newSession || N || (O([]), A(""), z(!1), B([]), await C.newSession());
|
|
161
|
-
}, [C, N]),
|
|
161
|
+
}, [C, N]), Je = r(async (e, t) => {
|
|
162
162
|
if (!(!C.deleteSession || N)) {
|
|
163
163
|
L((t) => t.filter((t) => t.id !== e)), t && (O([]), A(""));
|
|
164
164
|
try {
|
|
165
165
|
await C.deleteSession(e);
|
|
166
166
|
} finally {
|
|
167
|
-
|
|
167
|
+
$();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}, [
|
|
171
171
|
C,
|
|
172
172
|
N,
|
|
173
|
-
|
|
174
|
-
]),
|
|
175
|
-
z((e) => (e ||
|
|
176
|
-
}, [
|
|
173
|
+
$
|
|
174
|
+
]), Ye = r(() => {
|
|
175
|
+
z((e) => (e || $(), !e));
|
|
176
|
+
}, [$]), Xe = r(async (e) => {
|
|
177
177
|
if (!(!C.selectSession || N)) {
|
|
178
178
|
F(!0);
|
|
179
179
|
try {
|
|
180
|
-
O(await C.selectSession(e)), z(!1),
|
|
180
|
+
O(await C.selectSession(e)), z(!1), $(), Z();
|
|
181
181
|
} catch {} finally {
|
|
182
182
|
F(!1);
|
|
183
183
|
}
|
|
@@ -185,12 +185,12 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
185
185
|
}, [
|
|
186
186
|
C,
|
|
187
187
|
N,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
]),
|
|
188
|
+
$,
|
|
189
|
+
Z
|
|
190
|
+
]), Ze = r(async () => {
|
|
191
191
|
let e = k.trim(), t = j;
|
|
192
192
|
if (!e && t.length === 0 || N) return;
|
|
193
|
-
|
|
193
|
+
J.isListening && J.stop(), J.reset(), A(""), M([]), U.current && (U.current.style.height = "auto");
|
|
194
194
|
let n = t.length > 0 ? `📎 ${t.map((e) => e.name).join(", ")}` : "", r = {
|
|
195
195
|
id: _e(),
|
|
196
196
|
role: "user",
|
|
@@ -207,47 +207,47 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
207
207
|
}
|
|
208
208
|
]), P(!0);
|
|
209
209
|
let a = new AbortController();
|
|
210
|
-
|
|
210
|
+
G.current = a;
|
|
211
211
|
try {
|
|
212
212
|
let { text: n } = await C.sendPrompt({
|
|
213
213
|
prompt: e,
|
|
214
214
|
attachments: t.length > 0 ? t : void 0,
|
|
215
215
|
signal: a.signal,
|
|
216
|
-
onProgress: (e) =>
|
|
216
|
+
onProgress: (e) => Q(i, { content: e })
|
|
217
217
|
});
|
|
218
|
-
|
|
218
|
+
Q(i, {
|
|
219
219
|
content: n,
|
|
220
220
|
pending: !1
|
|
221
|
-
}),
|
|
221
|
+
}), Z();
|
|
222
222
|
} catch (e) {
|
|
223
|
-
|
|
223
|
+
Q(i, {
|
|
224
224
|
content: `Sorry, I couldn't complete that: ${e instanceof Error ? e.message : "Something went wrong. Please try again."}`,
|
|
225
225
|
pending: !1,
|
|
226
226
|
error: !0
|
|
227
227
|
});
|
|
228
228
|
} finally {
|
|
229
|
-
P(!1),
|
|
229
|
+
P(!1), G.current = null, R && $();
|
|
230
230
|
}
|
|
231
231
|
}, [
|
|
232
232
|
k,
|
|
233
233
|
j,
|
|
234
234
|
N,
|
|
235
|
-
|
|
235
|
+
Q,
|
|
236
236
|
C,
|
|
237
|
-
|
|
237
|
+
J,
|
|
238
238
|
R,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
]),
|
|
242
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
243
|
-
}, [
|
|
244
|
-
let e =
|
|
239
|
+
$,
|
|
240
|
+
Z
|
|
241
|
+
]), Qe = r((e) => {
|
|
242
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Ze());
|
|
243
|
+
}, [Ze]), $e = r(() => {
|
|
244
|
+
let e = U.current;
|
|
245
245
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
246
|
-
}, []),
|
|
247
|
-
|
|
248
|
-
}, [
|
|
246
|
+
}, []), et = r(() => {
|
|
247
|
+
J.isListening ? J.stop() : J.start();
|
|
248
|
+
}, [J]), tt = a(() => /* @__PURE__ */ u("button", {
|
|
249
249
|
type: "button",
|
|
250
|
-
onClick:
|
|
250
|
+
onClick: X,
|
|
251
251
|
onMouseEnter: () => !T && C.prewarm?.("probe"),
|
|
252
252
|
onFocus: () => !T && C.prewarm?.("probe"),
|
|
253
253
|
"aria-label": T ? "Close AI assistant" : "Open AI assistant",
|
|
@@ -257,276 +257,311 @@ var ye = ({ transport: p, modes: m, defaultModeId: ye, title: g = "AI Assistant"
|
|
|
257
257
|
children: u(T ? l : de, { className: "size-6" })
|
|
258
258
|
}), [
|
|
259
259
|
T,
|
|
260
|
-
|
|
260
|
+
X,
|
|
261
261
|
be,
|
|
262
262
|
C
|
|
263
263
|
]);
|
|
264
|
-
return w ? /* @__PURE__ */ d(pe, { children: [
|
|
265
|
-
|
|
266
|
-
"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
"
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
"aria-label": "Hide chats",
|
|
282
|
-
"aria-expanded": !0,
|
|
283
|
-
title: "Hide chats",
|
|
284
|
-
"data-testid": "assistant-rail-toggle",
|
|
285
|
-
className: "mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-surface hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
286
|
-
children: [/* @__PURE__ */ u(oe, { className: "size-4 shrink-0" }), "Hide chats"]
|
|
287
|
-
}),
|
|
288
|
-
/* @__PURE__ */ d("button", {
|
|
289
|
-
type: "button",
|
|
290
|
-
onClick: () => void Ke(),
|
|
291
|
-
disabled: N,
|
|
292
|
-
"data-testid": "assistant-new-chat",
|
|
293
|
-
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
|
|
294
|
-
children: [/* @__PURE__ */ u(le, { className: "size-4 shrink-0" }), "New chat"]
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ d("button", {
|
|
297
|
-
type: "button",
|
|
298
|
-
onClick: Je,
|
|
299
|
-
"aria-expanded": R,
|
|
300
|
-
"data-testid": "assistant-history-toggle",
|
|
301
|
-
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
|
|
302
|
-
children: [/* @__PURE__ */ u(ne, { className: "size-4 shrink-0" }), "History"]
|
|
303
|
-
}),
|
|
304
|
-
R ? /* @__PURE__ */ u("div", {
|
|
305
|
-
"data-testid": "assistant-history-list",
|
|
306
|
-
className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
|
|
307
|
-
children: Pe && I.length === 0 ? /* @__PURE__ */ d("p", {
|
|
308
|
-
className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
|
|
309
|
-
children: [/* @__PURE__ */ u(c, { className: "size-3 animate-spin" }), "Loading…"]
|
|
310
|
-
}) : I.length === 0 ? /* @__PURE__ */ u("p", {
|
|
311
|
-
className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
|
|
312
|
-
children: "No past chats yet."
|
|
313
|
-
}) : I.map((t) => /* @__PURE__ */ d("div", {
|
|
314
|
-
"data-testid": "assistant-history-row",
|
|
315
|
-
className: e("group flex items-center gap-1 rounded pr-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
|
|
316
|
-
children: [/* @__PURE__ */ u("button", {
|
|
317
|
-
type: "button",
|
|
318
|
-
onClick: () => void Ye(t.id),
|
|
319
|
-
title: t.title,
|
|
320
|
-
"data-testid": "assistant-history-item",
|
|
321
|
-
className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-left text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
|
|
322
|
-
children: t.title
|
|
323
|
-
}), C.deleteSession ? /* @__PURE__ */ u("button", {
|
|
324
|
-
type: "button",
|
|
325
|
-
onClick: () => void qe(t.id, !!t.active),
|
|
326
|
-
disabled: N,
|
|
327
|
-
"aria-label": `Delete chat: ${t.title}`,
|
|
328
|
-
title: "Delete this chat",
|
|
329
|
-
"data-testid": "assistant-delete-chat",
|
|
330
|
-
className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
|
|
331
|
-
children: /* @__PURE__ */ u(fe, { className: "size-3.5" })
|
|
332
|
-
}) : null]
|
|
333
|
-
}, t.id))
|
|
334
|
-
}) : null
|
|
335
|
-
]
|
|
336
|
-
}) : null, /* @__PURE__ */ d("div", {
|
|
337
|
-
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
338
|
-
children: [
|
|
339
|
-
/* @__PURE__ */ d("div", {
|
|
340
|
-
className: "flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
|
|
341
|
-
children: [/* @__PURE__ */ d("div", {
|
|
342
|
-
className: "flex min-w-0 items-center gap-2",
|
|
343
|
-
children: [K && Ve && !Ie ? /* @__PURE__ */ d("button", {
|
|
344
|
-
type: "button",
|
|
345
|
-
onClick: He,
|
|
346
|
-
"aria-label": "Show chats",
|
|
347
|
-
"aria-expanded": !1,
|
|
348
|
-
title: "Show chats",
|
|
349
|
-
"data-testid": "assistant-rail-toggle",
|
|
350
|
-
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border-subtle px-2 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
351
|
-
children: [/* @__PURE__ */ u(se, { className: "size-4" }), "Chats"]
|
|
352
|
-
}) : /* @__PURE__ */ u("span", {
|
|
353
|
-
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
|
|
354
|
-
children: /* @__PURE__ */ u(de, { className: "size-4" })
|
|
355
|
-
}), /* @__PURE__ */ u("h2", {
|
|
356
|
-
className: "truncate text-sm font-semibold text-text-primary",
|
|
357
|
-
children: Ae
|
|
358
|
-
})]
|
|
359
|
-
}), /* @__PURE__ */ u("button", {
|
|
264
|
+
return w ? /* @__PURE__ */ d(pe, { children: [
|
|
265
|
+
tt,
|
|
266
|
+
T ? /* @__PURE__ */ d("div", {
|
|
267
|
+
role: "dialog",
|
|
268
|
+
"aria-label": Ae,
|
|
269
|
+
"data-testid": "assistant-widget-window",
|
|
270
|
+
"data-layout": Se,
|
|
271
|
+
style: q ? {
|
|
272
|
+
top: Te,
|
|
273
|
+
height: `calc(100vh - ${String(Te)}px)`
|
|
274
|
+
} : void 0,
|
|
275
|
+
className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", q ? "bottom-0 right-0 w-full border-l sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : "flex-col rounded-xl border bottom-24 right-6 h-[560px] max-h-[calc(100vh-7rem)] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200"),
|
|
276
|
+
children: [q && He && Ie ? /* @__PURE__ */ d("aside", {
|
|
277
|
+
"data-testid": "assistant-session-panel",
|
|
278
|
+
className: "flex w-[168px] shrink-0 flex-col gap-1 border-r border-border-subtle bg-bg-sunken p-2",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ d("button", {
|
|
360
281
|
type: "button",
|
|
361
|
-
onClick:
|
|
362
|
-
"aria-label": "
|
|
363
|
-
"
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
282
|
+
onClick: Ue,
|
|
283
|
+
"aria-label": "Hide chats",
|
|
284
|
+
"aria-expanded": !0,
|
|
285
|
+
title: "Hide chats",
|
|
286
|
+
"data-testid": "assistant-rail-toggle",
|
|
287
|
+
className: "mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-surface hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
288
|
+
children: [/* @__PURE__ */ u(oe, { className: "size-4 shrink-0" }), "Hide chats"]
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ d("button", {
|
|
291
|
+
type: "button",
|
|
292
|
+
onClick: () => void qe(),
|
|
293
|
+
disabled: N,
|
|
294
|
+
"data-testid": "assistant-new-chat",
|
|
295
|
+
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
|
|
296
|
+
children: [/* @__PURE__ */ u(le, { className: "size-4 shrink-0" }), "New chat"]
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ d("button", {
|
|
299
|
+
type: "button",
|
|
300
|
+
onClick: Ye,
|
|
301
|
+
"aria-expanded": R,
|
|
302
|
+
"data-testid": "assistant-history-toggle",
|
|
303
|
+
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
|
|
304
|
+
children: [/* @__PURE__ */ u(ne, { className: "size-4 shrink-0" }), "History"]
|
|
305
|
+
}),
|
|
306
|
+
R ? /* @__PURE__ */ u("div", {
|
|
307
|
+
"data-testid": "assistant-history-list",
|
|
308
|
+
className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
|
|
309
|
+
children: Pe && I.length === 0 ? /* @__PURE__ */ d("p", {
|
|
310
|
+
className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
|
|
311
|
+
children: [/* @__PURE__ */ u(c, { className: "size-3 animate-spin" }), "Loading…"]
|
|
312
|
+
}) : I.length === 0 ? /* @__PURE__ */ u("p", {
|
|
313
|
+
className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
|
|
314
|
+
children: "No past chats yet."
|
|
315
|
+
}) : I.map((t) => /* @__PURE__ */ d("div", {
|
|
316
|
+
"data-testid": "assistant-history-row",
|
|
317
|
+
className: e("group flex items-center gap-1 rounded pr-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
|
|
318
|
+
children: [/* @__PURE__ */ u("button", {
|
|
319
|
+
type: "button",
|
|
320
|
+
onClick: () => void Xe(t.id),
|
|
321
|
+
title: t.title,
|
|
322
|
+
"data-testid": "assistant-history-item",
|
|
323
|
+
className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-left text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
|
|
324
|
+
children: t.title
|
|
325
|
+
}), C.deleteSession ? /* @__PURE__ */ u("button", {
|
|
326
|
+
type: "button",
|
|
327
|
+
onClick: () => void Je(t.id, !!t.active),
|
|
328
|
+
disabled: N,
|
|
329
|
+
"aria-label": `Delete chat: ${t.title}`,
|
|
330
|
+
title: "Delete this chat",
|
|
331
|
+
"data-testid": "assistant-delete-chat",
|
|
332
|
+
className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
|
|
333
|
+
children: /* @__PURE__ */ u(fe, { className: "size-3.5" })
|
|
334
|
+
}) : null]
|
|
335
|
+
}, t.id))
|
|
336
|
+
}) : null
|
|
337
|
+
]
|
|
338
|
+
}) : null, /* @__PURE__ */ d("div", {
|
|
339
|
+
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ d("div", {
|
|
342
|
+
className: "flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
|
|
343
|
+
children: [/* @__PURE__ */ d("div", {
|
|
344
|
+
className: "flex min-w-0 items-center gap-2",
|
|
345
|
+
children: [q && He && !Ie ? /* @__PURE__ */ d("button", {
|
|
346
|
+
type: "button",
|
|
347
|
+
onClick: Ue,
|
|
348
|
+
"aria-label": "Show chats",
|
|
349
|
+
"aria-expanded": !1,
|
|
350
|
+
title: "Show chats",
|
|
351
|
+
"data-testid": "assistant-rail-toggle",
|
|
352
|
+
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border-subtle px-2 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
353
|
+
children: [/* @__PURE__ */ u(se, { className: "size-4" }), "Chats"]
|
|
354
|
+
}) : /* @__PURE__ */ u("span", {
|
|
355
|
+
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
|
|
356
|
+
children: /* @__PURE__ */ u(de, { className: "size-4" })
|
|
357
|
+
}), /* @__PURE__ */ u("h2", {
|
|
358
|
+
className: "truncate text-sm font-semibold text-text-primary",
|
|
359
|
+
children: Ae
|
|
360
|
+
})]
|
|
361
|
+
}), /* @__PURE__ */ u("button", {
|
|
376
362
|
type: "button",
|
|
377
|
-
|
|
378
|
-
"aria-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
title: N ? "Finish the current turn before switching" : t.label,
|
|
383
|
-
"data-testid": `assistant-mode-${t.id}`,
|
|
384
|
-
className: e("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", n ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
385
|
-
children: t.label
|
|
386
|
-
}, t.id);
|
|
387
|
-
})
|
|
388
|
-
}) : null,
|
|
389
|
-
/* @__PURE__ */ u("div", {
|
|
390
|
-
ref: U,
|
|
391
|
-
className: "min-h-0 flex-1 space-y-3 overflow-y-auto px-4 py-4",
|
|
392
|
-
"data-testid": "assistant-widget-messages",
|
|
393
|
-
children: D.length === 0 && Ne ? /* @__PURE__ */ d("div", {
|
|
394
|
-
"data-testid": "assistant-widget-restoring",
|
|
395
|
-
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
396
|
-
children: [/* @__PURE__ */ u(c, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ u("p", {
|
|
397
|
-
className: "text-xs leading-relaxed text-text-secondary",
|
|
398
|
-
children: "Restoring your conversation…"
|
|
399
|
-
})]
|
|
400
|
-
}) : D.length === 0 ? /* @__PURE__ */ d("div", {
|
|
401
|
-
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
402
|
-
children: [/* @__PURE__ */ u("span", {
|
|
403
|
-
className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
|
|
404
|
-
children: /* @__PURE__ */ u(ie, { className: "size-6" })
|
|
405
|
-
}), /* @__PURE__ */ u("p", {
|
|
406
|
-
className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
|
|
407
|
-
children: je
|
|
363
|
+
onClick: Y,
|
|
364
|
+
"aria-label": "Close AI assistant",
|
|
365
|
+
"data-testid": "assistant-widget-close",
|
|
366
|
+
className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
367
|
+
children: /* @__PURE__ */ u(l, { className: "size-4" })
|
|
408
368
|
})]
|
|
409
|
-
})
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
369
|
+
}),
|
|
370
|
+
b.length > 1 ? /* @__PURE__ */ u("div", {
|
|
371
|
+
role: "tablist",
|
|
372
|
+
"aria-label": "Assistant mode",
|
|
373
|
+
"data-testid": "assistant-mode-switcher",
|
|
374
|
+
className: "flex shrink-0 items-center gap-1 border-b border-border-subtle bg-bg-surface px-3 py-2",
|
|
375
|
+
children: b.map((t) => {
|
|
376
|
+
let n = t.id === x;
|
|
377
|
+
return /* @__PURE__ */ u("button", {
|
|
378
|
+
type: "button",
|
|
379
|
+
role: "tab",
|
|
380
|
+
"aria-selected": n,
|
|
381
|
+
tabIndex: n ? 0 : -1,
|
|
382
|
+
onClick: () => ke(t.id),
|
|
383
|
+
disabled: N,
|
|
384
|
+
title: N ? "Finish the current turn before switching" : t.label,
|
|
385
|
+
"data-testid": `assistant-mode-${t.id}`,
|
|
386
|
+
className: e("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", n ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
387
|
+
children: t.label
|
|
388
|
+
}, t.id);
|
|
422
389
|
})
|
|
423
|
-
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
title: `Download ${e.name}${e.size ? ` (${ve(e.size)})` : ""}`,
|
|
435
|
-
"data-testid": "assistant-widget-artifact",
|
|
436
|
-
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-2 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
437
|
-
children: [t ? /* @__PURE__ */ u(c, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ u(te, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ u(ee, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ u("span", {
|
|
438
|
-
className: "truncate",
|
|
439
|
-
children: e.name
|
|
390
|
+
}) : null,
|
|
391
|
+
/* @__PURE__ */ u("div", {
|
|
392
|
+
ref: W,
|
|
393
|
+
className: "min-h-0 flex-1 space-y-3 overflow-y-auto px-4 py-4",
|
|
394
|
+
"data-testid": "assistant-widget-messages",
|
|
395
|
+
children: D.length === 0 && Ne ? /* @__PURE__ */ d("div", {
|
|
396
|
+
"data-testid": "assistant-widget-restoring",
|
|
397
|
+
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
398
|
+
children: [/* @__PURE__ */ u(c, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ u("p", {
|
|
399
|
+
className: "text-xs leading-relaxed text-text-secondary",
|
|
400
|
+
children: "Restoring your conversation…"
|
|
440
401
|
})]
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
402
|
+
}) : D.length === 0 ? /* @__PURE__ */ d("div", {
|
|
403
|
+
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
404
|
+
children: [/* @__PURE__ */ u("span", {
|
|
405
|
+
className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
|
|
406
|
+
children: /* @__PURE__ */ u(ie, { className: "size-6" })
|
|
407
|
+
}), /* @__PURE__ */ u("p", {
|
|
408
|
+
className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
|
|
409
|
+
children: je
|
|
410
|
+
})]
|
|
411
|
+
}) : D.map((t) => /* @__PURE__ */ u("div", {
|
|
412
|
+
className: e("flex", t.role === "user" ? "justify-end" : "justify-start"),
|
|
413
|
+
children: /* @__PURE__ */ d("div", {
|
|
414
|
+
"data-testid": `assistant-widget-message-${t.role}`,
|
|
415
|
+
className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", q ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
|
|
416
|
+
children: [t.content ? /* @__PURE__ */ u(n, {
|
|
417
|
+
content: t.content,
|
|
418
|
+
onNavigate: we
|
|
419
|
+
}) : null, t.pending ? /* @__PURE__ */ d("span", {
|
|
420
|
+
"data-testid": "assistant-widget-working",
|
|
421
|
+
className: e("inline-flex items-center gap-1 text-text-secondary", t.content ? "mt-1" : ""),
|
|
422
|
+
children: [/* @__PURE__ */ u(c, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ u("span", { children: "Working on it…" })]
|
|
423
|
+
}) : null]
|
|
424
|
+
})
|
|
425
|
+
}, t.id))
|
|
426
|
+
}),
|
|
427
|
+
C.downloadArtifact && Re.length > 0 ? /* @__PURE__ */ u("div", {
|
|
428
|
+
"data-testid": "assistant-widget-artifacts",
|
|
429
|
+
className: "flex shrink-0 flex-wrap gap-1.5 border-t border-border-subtle bg-bg-sunken px-3 py-2",
|
|
430
|
+
children: Re.map((e) => {
|
|
431
|
+
let t = V === e.path;
|
|
432
|
+
return /* @__PURE__ */ d("button", {
|
|
433
|
+
type: "button",
|
|
434
|
+
onClick: () => void Ke(e),
|
|
435
|
+
disabled: !!V,
|
|
436
|
+
title: `Download ${e.name}${e.size ? ` (${ve(e.size)})` : ""}`,
|
|
437
|
+
"data-testid": "assistant-widget-artifact",
|
|
438
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-2 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
439
|
+
children: [t ? /* @__PURE__ */ u(c, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ u(te, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ u(ee, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ u("span", {
|
|
440
|
+
className: "truncate",
|
|
441
|
+
children: e.name
|
|
442
|
+
})]
|
|
443
|
+
}, e.path);
|
|
444
|
+
})
|
|
445
|
+
}) : null,
|
|
446
|
+
y && j.length > 0 ? /* @__PURE__ */ u("div", {
|
|
447
|
+
className: "flex flex-wrap gap-1.5 border-t border-border-default bg-bg-surface px-3 pt-2",
|
|
448
|
+
children: j.map((e, t) => /* @__PURE__ */ d("span", {
|
|
449
|
+
"data-testid": "assistant-widget-attachment",
|
|
450
|
+
className: "flex items-center gap-1 rounded-md bg-bg-sunken px-2 py-1 text-[11px] text-text-secondary",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ u(ce, { className: "size-3" }),
|
|
453
|
+
/* @__PURE__ */ u("span", {
|
|
454
|
+
className: "max-w-[140px] truncate",
|
|
455
|
+
children: e.name
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ u("button", {
|
|
458
|
+
type: "button",
|
|
459
|
+
onClick: () => M((e) => e.filter((e, n) => n !== t)),
|
|
460
|
+
"aria-label": `Remove ${e.name}`,
|
|
461
|
+
className: "text-text-muted hover:text-text-primary cursor-pointer",
|
|
462
|
+
children: /* @__PURE__ */ u(l, { className: "size-3" })
|
|
463
|
+
})
|
|
464
|
+
]
|
|
465
|
+
}, `${e.name}-${t}`))
|
|
466
|
+
}) : null,
|
|
467
|
+
/* @__PURE__ */ d("div", {
|
|
468
|
+
className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5", y && j.length > 0 ? "" : "border-t border-border-default"),
|
|
449
469
|
children: [
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
470
|
+
y ? /* @__PURE__ */ d(pe, { children: [/* @__PURE__ */ u("input", {
|
|
471
|
+
ref: Ve,
|
|
472
|
+
type: "file",
|
|
473
|
+
accept: Ee,
|
|
474
|
+
multiple: !0,
|
|
475
|
+
className: "hidden",
|
|
476
|
+
onChange: (e) => {
|
|
477
|
+
let t = Array.from(e.target.files ?? []);
|
|
478
|
+
t.length > 0 && M((e) => [...e, ...t]), e.target.value = "";
|
|
479
|
+
}
|
|
480
|
+
}), /* @__PURE__ */ u("button", {
|
|
481
|
+
type: "button",
|
|
482
|
+
onClick: () => Ve.current?.click(),
|
|
483
|
+
"aria-label": "Attach a data file",
|
|
484
|
+
"data-testid": "assistant-widget-upload",
|
|
485
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
486
|
+
children: /* @__PURE__ */ u(ce, { className: "size-4" })
|
|
487
|
+
})] }) : null,
|
|
488
|
+
De ? /* @__PURE__ */ u("button", {
|
|
489
|
+
type: "button",
|
|
490
|
+
onClick: () => H(!0),
|
|
491
|
+
"aria-label": "Connect a data source",
|
|
492
|
+
title: "Connect a source (REST API / connection)",
|
|
493
|
+
"data-testid": "assistant-widget-connect-source",
|
|
494
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
495
|
+
children: /* @__PURE__ */ u(re, { className: "size-4" })
|
|
496
|
+
}) : null,
|
|
497
|
+
J.isSupported ? /* @__PURE__ */ u("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
onClick: et,
|
|
500
|
+
"aria-label": J.isListening ? "Stop voice input" : "Start voice input",
|
|
501
|
+
"aria-pressed": J.isListening,
|
|
502
|
+
"data-testid": "assistant-widget-mic",
|
|
503
|
+
className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", J.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
504
|
+
children: /* @__PURE__ */ u(ae, { className: "size-4" })
|
|
505
|
+
}) : null,
|
|
506
|
+
/* @__PURE__ */ u("textarea", {
|
|
507
|
+
ref: U,
|
|
508
|
+
value: k,
|
|
509
|
+
onChange: (e) => A(e.target.value),
|
|
510
|
+
onKeyDown: Qe,
|
|
511
|
+
onInput: $e,
|
|
512
|
+
rows: 1,
|
|
513
|
+
placeholder: Me,
|
|
514
|
+
"aria-label": "Message the assistant",
|
|
515
|
+
"data-testid": "assistant-widget-input",
|
|
516
|
+
className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
|
|
454
517
|
}),
|
|
455
518
|
/* @__PURE__ */ u("button", {
|
|
456
519
|
type: "button",
|
|
457
|
-
onClick: () =>
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
520
|
+
onClick: () => void Ze(),
|
|
521
|
+
disabled: N || k.trim().length === 0 && j.length === 0,
|
|
522
|
+
"aria-label": "Send message",
|
|
523
|
+
"data-testid": "assistant-widget-send",
|
|
524
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
525
|
+
children: N ? /* @__PURE__ */ u(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(ue, { className: "size-4" })
|
|
461
526
|
})
|
|
462
527
|
]
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
"data-testid": "assistant-widget-mic",
|
|
501
|
-
className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", q.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
502
|
-
children: /* @__PURE__ */ u(ae, { className: "size-4" })
|
|
503
|
-
}) : null,
|
|
504
|
-
/* @__PURE__ */ u("textarea", {
|
|
505
|
-
ref: H,
|
|
506
|
-
value: k,
|
|
507
|
-
onChange: (e) => A(e.target.value),
|
|
508
|
-
onKeyDown: Xe,
|
|
509
|
-
onInput: Ze,
|
|
510
|
-
rows: 1,
|
|
511
|
-
placeholder: Me,
|
|
512
|
-
"aria-label": "Message the assistant",
|
|
513
|
-
"data-testid": "assistant-widget-input",
|
|
514
|
-
className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
|
|
515
|
-
}),
|
|
516
|
-
/* @__PURE__ */ u("button", {
|
|
517
|
-
type: "button",
|
|
518
|
-
onClick: () => void $(),
|
|
519
|
-
disabled: N || k.trim().length === 0 && j.length === 0,
|
|
520
|
-
"aria-label": "Send message",
|
|
521
|
-
"data-testid": "assistant-widget-send",
|
|
522
|
-
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
523
|
-
children: N ? /* @__PURE__ */ u(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(ue, { className: "size-4" })
|
|
524
|
-
})
|
|
525
|
-
]
|
|
526
|
-
})
|
|
527
|
-
]
|
|
528
|
-
})]
|
|
529
|
-
}) : null] }) : null;
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
})]
|
|
531
|
+
}) : null,
|
|
532
|
+
Be ? /* @__PURE__ */ u("div", {
|
|
533
|
+
role: "dialog",
|
|
534
|
+
"aria-modal": "true",
|
|
535
|
+
"aria-label": "Connect a source",
|
|
536
|
+
"data-testid": "assistant-connect-source-modal",
|
|
537
|
+
className: "fixed inset-0 z-[110] flex items-center justify-center bg-black/50 p-4 animate-in fade-in duration-150",
|
|
538
|
+
onClick: () => H(!1),
|
|
539
|
+
children: /* @__PURE__ */ d("div", {
|
|
540
|
+
className: "flex h-[80vh] max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-xl border border-border-default bg-bg-surface shadow-2xl animate-in zoom-in-95 duration-150",
|
|
541
|
+
onClick: (e) => e.stopPropagation(),
|
|
542
|
+
children: [/* @__PURE__ */ d("div", {
|
|
543
|
+
className: "flex shrink-0 items-center justify-between border-b border-border-subtle px-4 py-3",
|
|
544
|
+
children: [/* @__PURE__ */ d("div", {
|
|
545
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
546
|
+
children: [/* @__PURE__ */ u(re, { className: "size-4 shrink-0" }), "Connect a source"]
|
|
547
|
+
}), /* @__PURE__ */ u("button", {
|
|
548
|
+
type: "button",
|
|
549
|
+
onClick: () => H(!1),
|
|
550
|
+
"aria-label": "Close",
|
|
551
|
+
title: "Close",
|
|
552
|
+
"data-testid": "assistant-connect-source-close",
|
|
553
|
+
className: "flex size-8 items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
554
|
+
children: /* @__PURE__ */ u(l, { className: "size-4" })
|
|
555
|
+
})]
|
|
556
|
+
}), /* @__PURE__ */ u("iframe", {
|
|
557
|
+
src: Oe,
|
|
558
|
+
title: "Connected Systems",
|
|
559
|
+
"data-testid": "assistant-connect-source-frame",
|
|
560
|
+
className: "min-h-0 w-full flex-1 border-0 bg-bg-surface"
|
|
561
|
+
})]
|
|
562
|
+
})
|
|
563
|
+
}) : null
|
|
564
|
+
] }) : null;
|
|
530
565
|
};
|
|
531
566
|
//#endregion
|
|
532
567
|
export { f as ASSISTANT_WIDGET_TOGGLE_EVENT, ye as AssistantWidget };
|