@epam/ai-dial-conversation-input 1.3.0-dev.249 → 1.3.0-dev.253
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/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, LiveRegion as w, LiveRegionElement as T, LiveRegionPoliteness as E, MenuItemMark as D, NeutralButton as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { AttachmentTray as
|
|
5
|
-
import { IconArrowNarrowRight as
|
|
6
|
-
import { createElement as
|
|
2
|
+
import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, LiveRegion as w, LiveRegionElement as T, LiveRegionPoliteness as E, MenuItemMark as D, NeutralButton as O, NeutralIconButton as k, Notification as A, NotificationType as j, NotificationVariant as M, Popup as N, PopupSize as ee, PrimaryButton as te, PrimaryIconButton as ne, RadioGroup as re, RadioGroupOrientation as ie, Search as ae, Skeleton as P, SkeletonVariant as oe, Slider as F, Spinner as se, Textarea as ce, TextareaResize as le, ToggleChip as ue, Tooltip as de } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
4
|
+
import { AttachmentTray as fe, MAX_UPLOADS_PER_MINUTE as pe, generateAttachmentId as me, useClipboardPaste as he } from "@epam/ai-dial-attachment-input";
|
|
5
|
+
import { IconArrowNarrowRight as ge, IconCheck as _e, IconChevronDown as ve, IconChevronRight as ye, IconFile as be, IconMicrophone as xe, IconPaperclip as Se, IconPlayerStop as Ce, IconPlus as we, IconSettings as Te, IconTool as Ee, IconX as De } from "@tabler/icons-react";
|
|
6
|
+
import { createElement as Oe, forwardRef as ke, memo as Ae, useCallback as z, useEffect as B, useId as je, useImperativeHandle as Me, useLayoutEffect as Ne, useMemo as V, useRef as H, useState as U } from "react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var W = {
|
|
9
9
|
wrapper: "dial-ci-wrapper",
|
|
10
10
|
actionRow: "dial-ci-action-row",
|
|
11
11
|
textareaWrap: "dial-ci-textarea-wrap",
|
|
@@ -20,19 +20,19 @@ var U = {
|
|
|
20
20
|
modelMenuItem: "dial-ci-model-menu-item",
|
|
21
21
|
modelMenuItemSelected: "dial-ci-model-menu-item-selected",
|
|
22
22
|
usageBanner: "dial-ci-usage-banner"
|
|
23
|
-
},
|
|
23
|
+
}, G = {
|
|
24
24
|
backdrop: "_backdrop_1ym62_8",
|
|
25
25
|
sheet: "_sheet_1ym62_12",
|
|
26
26
|
title: "_title_1ym62_16",
|
|
27
27
|
divider: "_divider_1ym62_20"
|
|
28
|
-
},
|
|
28
|
+
}, Pe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: m, overlayClassName: h, overlayStyle: g, children: _ }) => {
|
|
29
29
|
let v = c({
|
|
30
30
|
"--ci-backdrop": f?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": f?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": f?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": f?.divider
|
|
34
34
|
});
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ L(p, {
|
|
36
36
|
open: e,
|
|
37
37
|
onClose: r,
|
|
38
38
|
title: t,
|
|
@@ -48,30 +48,30 @@ var U = {
|
|
|
48
48
|
...v,
|
|
49
49
|
...g
|
|
50
50
|
},
|
|
51
|
-
className: l(
|
|
52
|
-
overlayClassName: l(
|
|
51
|
+
className: l(G.sheet, d),
|
|
52
|
+
overlayClassName: l(G.backdrop, h),
|
|
53
53
|
portalId: m,
|
|
54
|
-
headerClassName:
|
|
55
|
-
titleClassName: l(
|
|
54
|
+
headerClassName: G.divider,
|
|
55
|
+
titleClassName: l(G.title, u),
|
|
56
56
|
children: _
|
|
57
57
|
});
|
|
58
|
-
},
|
|
58
|
+
}, Fe = async (e, t, n) => {
|
|
59
59
|
let r = 6e4 / t, i = [];
|
|
60
60
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
61
61
|
await Promise.allSettled(i);
|
|
62
|
-
},
|
|
63
|
-
let [g, _] =
|
|
64
|
-
|
|
62
|
+
}, Ie = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
|
|
63
|
+
let [g, _] = U(n), v = H(g);
|
|
64
|
+
B(() => {
|
|
65
65
|
v.current = g;
|
|
66
|
-
}, [g]),
|
|
66
|
+
}, [g]), B(() => () => {
|
|
67
67
|
v.current.forEach((e) => {
|
|
68
68
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
69
69
|
});
|
|
70
70
|
}, []);
|
|
71
|
-
let y =
|
|
71
|
+
let y = z((e) => e.map((e) => {
|
|
72
72
|
let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), i = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
|
|
73
73
|
return {
|
|
74
|
-
id:
|
|
74
|
+
id: me(),
|
|
75
75
|
name: e.name,
|
|
76
76
|
contentType: e.type,
|
|
77
77
|
file: e,
|
|
@@ -80,22 +80,22 @@ var U = {
|
|
|
80
80
|
previewUrl: i,
|
|
81
81
|
playUrl: o
|
|
82
82
|
};
|
|
83
|
-
}), []), b =
|
|
84
|
-
|
|
83
|
+
}), []), b = H(i);
|
|
84
|
+
B(() => {
|
|
85
85
|
b.current = i;
|
|
86
86
|
}, [i]);
|
|
87
|
-
let x =
|
|
87
|
+
let x = H(!0), S = z((e) => {
|
|
88
88
|
_((t) => {
|
|
89
89
|
let n = e(t);
|
|
90
90
|
return n === t ? t : n;
|
|
91
91
|
});
|
|
92
92
|
}, []);
|
|
93
|
-
|
|
93
|
+
B(() => {
|
|
94
94
|
x.current ? x.current = !1 : b.current?.(g);
|
|
95
95
|
}, [g]);
|
|
96
|
-
let C =
|
|
96
|
+
let C = z((e) => {
|
|
97
97
|
_(e);
|
|
98
|
-
}, []), w =
|
|
98
|
+
}, []), w = z(async (t) => {
|
|
99
99
|
if (r) {
|
|
100
100
|
S((e) => e.map((e) => e.id === t.id ? {
|
|
101
101
|
...e,
|
|
@@ -118,7 +118,7 @@ var U = {
|
|
|
118
118
|
} : e));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
}, [r, S]), T =
|
|
121
|
+
}, [r, S]), T = z((e, t = !0) => {
|
|
122
122
|
let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
123
123
|
if (r.length !== 0) {
|
|
124
124
|
if (p != null && p > 0 && Number.isFinite(p)) {
|
|
@@ -139,7 +139,7 @@ var U = {
|
|
|
139
139
|
status: a.Error,
|
|
140
140
|
errorReason: n
|
|
141
141
|
} : e));
|
|
142
|
-
}),
|
|
142
|
+
}), Fe(e, pe, w);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}, [
|
|
@@ -149,8 +149,8 @@ var U = {
|
|
|
149
149
|
S,
|
|
150
150
|
w,
|
|
151
151
|
o
|
|
152
|
-
]), E =
|
|
153
|
-
|
|
152
|
+
]), E = H(/* @__PURE__ */ new WeakSet());
|
|
153
|
+
B(() => {
|
|
154
154
|
if (s.length === 0) {
|
|
155
155
|
E.current = /* @__PURE__ */ new WeakSet();
|
|
156
156
|
return;
|
|
@@ -163,13 +163,13 @@ var U = {
|
|
|
163
163
|
l,
|
|
164
164
|
c,
|
|
165
165
|
s
|
|
166
|
-
]),
|
|
166
|
+
]), B(() => {
|
|
167
167
|
u.length !== 0 && (T(u, !1), d?.());
|
|
168
168
|
}, [
|
|
169
169
|
T,
|
|
170
170
|
d,
|
|
171
171
|
u
|
|
172
|
-
]),
|
|
172
|
+
]), B(() => {
|
|
173
173
|
if (!o) return;
|
|
174
174
|
let t = !1, n = [], r = v.current.map((r) => {
|
|
175
175
|
if (r.status === a.Loading) return r;
|
|
@@ -196,7 +196,7 @@ var U = {
|
|
|
196
196
|
S,
|
|
197
197
|
w
|
|
198
198
|
]);
|
|
199
|
-
let D =
|
|
199
|
+
let D = z((e) => {
|
|
200
200
|
S((t) => {
|
|
201
201
|
let n = t.find((t) => t.id === e);
|
|
202
202
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -208,11 +208,11 @@ var U = {
|
|
|
208
208
|
addAttachments: T,
|
|
209
209
|
resetAttachments: C,
|
|
210
210
|
handleRemove: D,
|
|
211
|
-
handleRetry:
|
|
211
|
+
handleRetry: z((e) => {
|
|
212
212
|
let t = g.find((t) => t.id === e);
|
|
213
213
|
t && w(t);
|
|
214
214
|
}, [g, w]),
|
|
215
|
-
handleExpand:
|
|
215
|
+
handleExpand: z(async (e) => {
|
|
216
216
|
let n = g.find((t) => t.id === e);
|
|
217
217
|
if (!n || n.type !== t.Pasted) return;
|
|
218
218
|
let r = await n.file.text();
|
|
@@ -224,31 +224,31 @@ var U = {
|
|
|
224
224
|
]),
|
|
225
225
|
hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
|
|
226
226
|
};
|
|
227
|
-
},
|
|
227
|
+
}, Le = (e, t) => {
|
|
228
228
|
let n = t;
|
|
229
229
|
for (; n < e.length && !/\s/.test(e[n]);) n++;
|
|
230
230
|
return n;
|
|
231
|
-
},
|
|
231
|
+
}, Re = (e, t) => {
|
|
232
232
|
let n = t;
|
|
233
233
|
for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
|
|
234
234
|
return {
|
|
235
235
|
start: n,
|
|
236
|
-
end:
|
|
236
|
+
end: Le(e, n)
|
|
237
237
|
};
|
|
238
|
-
},
|
|
238
|
+
}, ze = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Be = "[role=\"option\"]:not([aria-disabled=\"true\"])", Ve = /* @__PURE__ */ function(e) {
|
|
239
239
|
return e.Next = "next", e.Previous = "previous", e;
|
|
240
|
-
}({}),
|
|
241
|
-
let [n, r] =
|
|
240
|
+
}({}), He = ({ config: e, message: t }) => {
|
|
241
|
+
let [n, r] = U(!1), [i, a] = U(null), [o, s] = U(null), c = H(null);
|
|
242
242
|
c.current = i;
|
|
243
243
|
let l = e != null && i != null && i <= t.length ? (() => {
|
|
244
|
-
let n = t.slice(i,
|
|
245
|
-
return
|
|
246
|
-
})() : "", u =
|
|
244
|
+
let n = t.slice(i, Le(t, i));
|
|
245
|
+
return ze(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
|
|
246
|
+
})() : "", u = z((t, n, i) => {
|
|
247
247
|
if (e == null || i) return;
|
|
248
|
-
let { start: c, end: l } =
|
|
249
|
-
|
|
248
|
+
let { start: c, end: l } = Re(t, n), u = t.slice(c, l);
|
|
249
|
+
ze(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
|
|
250
250
|
}, [e, o]);
|
|
251
|
-
|
|
251
|
+
B(() => {
|
|
252
252
|
if (e == null) {
|
|
253
253
|
r(!1), s(null), a(null);
|
|
254
254
|
return;
|
|
@@ -256,25 +256,25 @@ var U = {
|
|
|
256
256
|
let n = c.current;
|
|
257
257
|
if (n == null) return;
|
|
258
258
|
let i = Math.min(n, t.length);
|
|
259
|
-
|
|
259
|
+
ze(t.slice(i, Le(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
|
|
260
260
|
}, [e, t]);
|
|
261
|
-
let d =
|
|
261
|
+
let d = z(() => {
|
|
262
262
|
r(!1), s(i);
|
|
263
|
-
}, [i]), f =
|
|
263
|
+
}, [i]), f = z(() => {
|
|
264
264
|
r(!1);
|
|
265
|
-
}, []), p =
|
|
265
|
+
}, []), p = z((n) => {
|
|
266
266
|
if (e == null) return;
|
|
267
|
-
let { start: i, end: s } =
|
|
268
|
-
|
|
267
|
+
let { start: i, end: s } = Re(t, n);
|
|
268
|
+
ze(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
|
|
269
269
|
}, [
|
|
270
270
|
e,
|
|
271
271
|
t,
|
|
272
272
|
o
|
|
273
|
-
]), m =
|
|
274
|
-
|
|
273
|
+
]), m = je(), h = H(null), [g, _] = U(null);
|
|
274
|
+
B(() => {
|
|
275
275
|
_(null);
|
|
276
276
|
}, [n, l]);
|
|
277
|
-
let v =
|
|
277
|
+
let v = z(() => Array.from(h.current?.querySelectorAll(Be) ?? []), []), y = z((e) => {
|
|
278
278
|
let t = v();
|
|
279
279
|
if (t.length === 0) {
|
|
280
280
|
_(null);
|
|
@@ -282,7 +282,7 @@ var U = {
|
|
|
282
282
|
}
|
|
283
283
|
let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
|
|
284
284
|
_(r.id), r.scrollIntoView?.({ block: "nearest" });
|
|
285
|
-
}, [v, g]), b =
|
|
285
|
+
}, [v, g]), b = z(() => v().find((e) => e.id === g) ?? null, [v, g]);
|
|
286
286
|
return {
|
|
287
287
|
isMenuOpen: n,
|
|
288
288
|
query: l,
|
|
@@ -297,18 +297,18 @@ var U = {
|
|
|
297
297
|
moveActiveOption: y,
|
|
298
298
|
getActiveOption: b
|
|
299
299
|
};
|
|
300
|
-
},
|
|
301
|
-
let t =
|
|
300
|
+
}, Ue = (e, t) => !e.slice(0, t).includes("\n"), We = (e, t) => !e.slice(t).includes("\n"), Ge = (e) => {
|
|
301
|
+
let t = H(e);
|
|
302
302
|
t.current = e;
|
|
303
|
-
let n =
|
|
303
|
+
let n = H(-1), r = H(""), i = z((e, i, a) => {
|
|
304
304
|
let o = t.current;
|
|
305
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
306
|
-
}, []), a =
|
|
305
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ue(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !We(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
306
|
+
}, []), a = z(() => {
|
|
307
307
|
n.current = -1, r.current = "";
|
|
308
|
-
}, []), o =
|
|
308
|
+
}, []), o = z(() => {
|
|
309
309
|
n.current = -1, r.current = "";
|
|
310
310
|
}, []);
|
|
311
|
-
return
|
|
311
|
+
return V(() => ({
|
|
312
312
|
navigate: i,
|
|
313
313
|
notifyChange: a,
|
|
314
314
|
reset: o
|
|
@@ -317,16 +317,16 @@ var U = {
|
|
|
317
317
|
a,
|
|
318
318
|
o
|
|
319
319
|
]);
|
|
320
|
-
},
|
|
320
|
+
}, Ke = (e, t, n, r, i) => {
|
|
321
321
|
let a = [...t].sort((e, t) => e.start - t.start), o = [...n].sort((e, t) => e.offset - t.offset), s = [], c = 0, l = 0, u = (t, n) => {
|
|
322
322
|
if (n <= t) return;
|
|
323
323
|
let r = t;
|
|
324
324
|
o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
|
|
325
|
-
t.offset > r && s.push(/* @__PURE__ */
|
|
325
|
+
t.offset > r && s.push(/* @__PURE__ */ L("span", {
|
|
326
326
|
"aria-hidden": !0,
|
|
327
327
|
children: e.slice(r, t.offset)
|
|
328
328
|
}, `text-${l++}`)), s.push(t.node), r = t.offset;
|
|
329
|
-
}), r < n && s.push(/* @__PURE__ */
|
|
329
|
+
}), r < n && s.push(/* @__PURE__ */ L("span", {
|
|
330
330
|
"aria-hidden": !0,
|
|
331
331
|
children: e.slice(r, n)
|
|
332
332
|
}, `text-${l++}`));
|
|
@@ -334,16 +334,16 @@ var U = {
|
|
|
334
334
|
return a.forEach((t, n) => {
|
|
335
335
|
if (u(c, t.start), t.start + t.length <= c) return;
|
|
336
336
|
let a = e.slice(t.start, t.start + t.length);
|
|
337
|
-
s.push(t.render ? /* @__PURE__ */
|
|
337
|
+
s.push(t.render ? /* @__PURE__ */ L("span", {
|
|
338
338
|
className: "pointer-events-auto",
|
|
339
339
|
children: t.render()
|
|
340
|
-
}, `range-${n}`) : /* @__PURE__ */
|
|
340
|
+
}, `range-${n}`) : /* @__PURE__ */ L("span", {
|
|
341
341
|
"aria-hidden": !0,
|
|
342
342
|
className: t.isUnsupported ? i : r,
|
|
343
343
|
children: a
|
|
344
344
|
}, `range-${n}`)), c = Math.max(c, t.start + t.length);
|
|
345
345
|
}), u(c, e.length), s;
|
|
346
|
-
},
|
|
346
|
+
}, qe = (e, t) => {
|
|
347
347
|
let n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode: (e) => e.parentElement?.closest("[data-mirror-synthetic]") == null ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT }), r = 0;
|
|
348
348
|
for (let e = n.nextNode(); e != null; e = n.nextNode()) {
|
|
349
349
|
let n = e.textContent?.length ?? 0;
|
|
@@ -354,24 +354,24 @@ var U = {
|
|
|
354
354
|
r += n;
|
|
355
355
|
}
|
|
356
356
|
return null;
|
|
357
|
-
},
|
|
358
|
-
let r =
|
|
357
|
+
}, Je = (e, t, n) => {
|
|
358
|
+
let r = qe(e, t), i = qe(e, n);
|
|
359
359
|
if (r == null || i == null) return null;
|
|
360
360
|
let a = document.createRange();
|
|
361
361
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
362
|
-
},
|
|
363
|
-
let r =
|
|
362
|
+
}, Ye = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
|
|
363
|
+
let r = H(null), [i, a] = U([]), o = z(() => {
|
|
364
364
|
let t = e.current, n = r.current;
|
|
365
365
|
if (t == null || n == null) return;
|
|
366
366
|
let i = t.offsetWidth > t.clientWidth;
|
|
367
367
|
n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
|
|
368
|
-
}, [e]), s =
|
|
368
|
+
}, [e]), s = z(() => {
|
|
369
369
|
let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
|
|
370
370
|
if (!n || t == null || i == null || o == null || s == null || o === s) {
|
|
371
371
|
a((e) => e.length === 0 ? e : []);
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
|
-
let c =
|
|
374
|
+
let c = Je(i, o, s);
|
|
375
375
|
if (c == null) {
|
|
376
376
|
a((e) => e.length === 0 ? e : []);
|
|
377
377
|
return;
|
|
@@ -379,14 +379,14 @@ var U = {
|
|
|
379
379
|
let l = i.getBoundingClientRect();
|
|
380
380
|
a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top + i.scrollTop, e.width, e.height)));
|
|
381
381
|
}, [n, e]);
|
|
382
|
-
return
|
|
382
|
+
return Ne(() => {
|
|
383
383
|
n && o(), s();
|
|
384
384
|
}, [
|
|
385
385
|
n,
|
|
386
386
|
o,
|
|
387
387
|
s,
|
|
388
388
|
t
|
|
389
|
-
]),
|
|
389
|
+
]), B(() => {
|
|
390
390
|
if (!n) return;
|
|
391
391
|
let t = e.current;
|
|
392
392
|
if (t == null || typeof ResizeObserver > "u") return;
|
|
@@ -405,29 +405,29 @@ var U = {
|
|
|
405
405
|
updateSelectionRects: s,
|
|
406
406
|
syncMirrorToTextarea: o
|
|
407
407
|
};
|
|
408
|
-
},
|
|
409
|
-
let [n, r] =
|
|
410
|
-
return
|
|
408
|
+
}, Xe = ({ messageProp: e, messageRevision: t }) => {
|
|
409
|
+
let [n, r] = U(e), i = H(null);
|
|
410
|
+
return B(() => {
|
|
411
411
|
r(e);
|
|
412
412
|
}, [e, t]), {
|
|
413
413
|
message: n,
|
|
414
414
|
setMessage: r,
|
|
415
415
|
textareaRef: i
|
|
416
416
|
};
|
|
417
|
-
},
|
|
417
|
+
}, Ze = (e, t, n, r = n) => {
|
|
418
418
|
let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
419
419
|
i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
420
|
-
},
|
|
421
|
-
let n = e?.revision, r =
|
|
420
|
+
}, Qe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, $e = ({ insertion: e, textareaRef: t }) => {
|
|
421
|
+
let n = e?.revision, r = H(e?.text);
|
|
422
422
|
r.current = e?.text;
|
|
423
|
-
let i =
|
|
424
|
-
return
|
|
423
|
+
let i = H(n), a = H(null), o = H(!1);
|
|
424
|
+
return B(() => {
|
|
425
425
|
document.activeElement === t.current && (o.current = !0);
|
|
426
426
|
let e = (e) => {
|
|
427
427
|
e.target === t.current && (o.current = !0);
|
|
428
428
|
};
|
|
429
429
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
430
|
-
}, [t]),
|
|
430
|
+
}, [t]), B(() => {
|
|
431
431
|
if (n === i.current) return;
|
|
432
432
|
i.current = n;
|
|
433
433
|
let e = r.current;
|
|
@@ -437,7 +437,7 @@ var U = {
|
|
|
437
437
|
let { value: r, selectionStart: i, selectionEnd: s } = n, c = !o.current && r.length > 0 && i === 0 && s === 0, l = c ? r.length : i ?? r.length, u = c ? l : s ?? l;
|
|
438
438
|
if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
|
|
439
439
|
let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
|
|
440
|
-
|
|
440
|
+
Ze(n, d, l + e.length), a.current = {
|
|
441
441
|
insertedValue: d,
|
|
442
442
|
previousValue: r,
|
|
443
443
|
previousSelectionStart: l,
|
|
@@ -447,22 +447,22 @@ var U = {
|
|
|
447
447
|
}, [n, t]), {
|
|
448
448
|
handleUndoKeyDown: (e) => {
|
|
449
449
|
let n = a.current, r = t.current;
|
|
450
|
-
return n == null || r == null ||
|
|
450
|
+
return n == null || r == null || !Qe(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Ze(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
|
|
451
451
|
},
|
|
452
452
|
markCaretPlaced: () => {
|
|
453
453
|
o.current = !0;
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
|
-
},
|
|
456
|
+
}, et = /* @__PURE__ */ function(e) {
|
|
457
457
|
return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
|
|
458
|
-
}({}),
|
|
458
|
+
}({}), tt = /* @__PURE__ */ function(e) {
|
|
459
459
|
return e.Dictation = "dictation", e.Attachment = "attachment", e;
|
|
460
|
-
}({}),
|
|
460
|
+
}({}), nt = [
|
|
461
461
|
"audio/webm;codecs=opus",
|
|
462
462
|
"audio/ogg;codecs=opus",
|
|
463
463
|
"audio/webm"
|
|
464
|
-
],
|
|
465
|
-
let [a, o] =
|
|
464
|
+
], rt = 100, it = 100, at = .01, ot = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
|
|
465
|
+
let [a, o] = U("idle"), [s, c] = U(null), l = H(null), d = H(null), f = H({
|
|
466
466
|
onAttachAudio: e,
|
|
467
467
|
onTranscribeAudio: t,
|
|
468
468
|
onTranscript: n,
|
|
@@ -474,7 +474,7 @@ var U = {
|
|
|
474
474
|
onTranscript: n,
|
|
475
475
|
errorLabel: i
|
|
476
476
|
};
|
|
477
|
-
let p =
|
|
477
|
+
let p = z((e = "dictation") => {
|
|
478
478
|
if (d.current) return;
|
|
479
479
|
let t = { controller: new AbortController() };
|
|
480
480
|
d.current = t, c(null), o("recording");
|
|
@@ -492,7 +492,7 @@ var U = {
|
|
|
492
492
|
n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
|
|
493
493
|
}, S = () => {
|
|
494
494
|
if (!a || n.aborted) return;
|
|
495
|
-
let e =
|
|
495
|
+
let e = nt.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
|
|
496
496
|
p = t;
|
|
497
497
|
let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
|
|
498
498
|
if (!(g || n.aborted)) {
|
|
@@ -500,7 +500,7 @@ var U = {
|
|
|
500
500
|
try {
|
|
501
501
|
let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
|
|
502
502
|
_.length = 0, y();
|
|
503
|
-
let p = Date.now() - s >=
|
|
503
|
+
let p = Date.now() - s >= it;
|
|
504
504
|
if (l.size && (!i || p && (!c || d))) {
|
|
505
505
|
let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
|
|
506
506
|
if (i) {
|
|
@@ -526,8 +526,8 @@ var U = {
|
|
|
526
526
|
e.getByteTimeDomainData(S), c = !0;
|
|
527
527
|
let t = 0;
|
|
528
528
|
for (let e of S) t += ((e - 128) / 128) ** 2;
|
|
529
|
-
Math.sqrt(t / S.length) >=
|
|
530
|
-
},
|
|
529
|
+
Math.sqrt(t / S.length) >= at && (d = !0, v());
|
|
530
|
+
}, rt));
|
|
531
531
|
};
|
|
532
532
|
t.stop = () => {
|
|
533
533
|
h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
|
|
@@ -545,10 +545,10 @@ var U = {
|
|
|
545
545
|
x(e);
|
|
546
546
|
}
|
|
547
547
|
})();
|
|
548
|
-
}, []), m =
|
|
548
|
+
}, []), m = z(() => d.current?.stop?.(), []), h = z(() => {
|
|
549
549
|
d.current?.controller.abort(), d.current = null, c(null), o("idle");
|
|
550
550
|
}, []);
|
|
551
|
-
return
|
|
551
|
+
return B(() => () => {
|
|
552
552
|
d.current?.controller.abort(), d.current = null;
|
|
553
553
|
}, []), {
|
|
554
554
|
state: a,
|
|
@@ -558,14 +558,14 @@ var U = {
|
|
|
558
558
|
stopRecording: m,
|
|
559
559
|
discardRecording: h
|
|
560
560
|
};
|
|
561
|
-
},
|
|
561
|
+
}, st = /* @__PURE__ */ function(e) {
|
|
562
562
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
563
|
-
}({}),
|
|
563
|
+
}({}), ct = /* @__PURE__ */ function(e) {
|
|
564
564
|
return e.Stacked = "stacked", e.Inline = "inline", e;
|
|
565
|
-
}({}),
|
|
565
|
+
}({}), lt = {
|
|
566
566
|
item: "_item_1sr2n_1",
|
|
567
567
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
568
|
-
},
|
|
568
|
+
}, ut = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
|
|
569
569
|
let p = (e) => {
|
|
570
570
|
e(), r();
|
|
571
571
|
}, h = c({
|
|
@@ -574,7 +574,7 @@ var U = {
|
|
|
574
574
|
"--ci-sheet-item-active": f?.itemActiveBg,
|
|
575
575
|
"--ci-sheet-icon": f?.itemIcon
|
|
576
576
|
});
|
|
577
|
-
return /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ L(Pe, {
|
|
578
578
|
isOpen: e,
|
|
579
579
|
title: t,
|
|
580
580
|
closeLabel: n,
|
|
@@ -583,23 +583,23 @@ var U = {
|
|
|
583
583
|
className: o,
|
|
584
584
|
titleClassName: s,
|
|
585
585
|
colors: f?.shell,
|
|
586
|
-
children: /* @__PURE__ */
|
|
586
|
+
children: /* @__PURE__ */ L("ul", {
|
|
587
587
|
role: "list",
|
|
588
588
|
className: "flex flex-col",
|
|
589
589
|
style: h,
|
|
590
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
590
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ L(m, {
|
|
591
591
|
type: "button",
|
|
592
|
-
className: l(
|
|
593
|
-
iconBefore: /* @__PURE__ */
|
|
594
|
-
className:
|
|
592
|
+
className: l(lt.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
593
|
+
iconBefore: /* @__PURE__ */ L("span", {
|
|
594
|
+
className: lt.itemIcon,
|
|
595
595
|
children: n
|
|
596
596
|
}),
|
|
597
|
-
iconAfter: r ? /* @__PURE__ */
|
|
597
|
+
iconAfter: r ? /* @__PURE__ */ L("span", {
|
|
598
598
|
className: "ms-auto",
|
|
599
599
|
children: r
|
|
600
600
|
}) : null,
|
|
601
601
|
textClassName: d,
|
|
602
|
-
label: /* @__PURE__ */
|
|
602
|
+
label: /* @__PURE__ */ L("span", {
|
|
603
603
|
className: u,
|
|
604
604
|
children: t
|
|
605
605
|
}),
|
|
@@ -607,9 +607,9 @@ var U = {
|
|
|
607
607
|
}) }, e))
|
|
608
608
|
})
|
|
609
609
|
});
|
|
610
|
-
},
|
|
611
|
-
let [s, c] =
|
|
612
|
-
|
|
610
|
+
}, dt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
611
|
+
let [s, c] = U(t), [l, u] = U(n), [d, f] = U(r), p = H(o);
|
|
612
|
+
B(() => {
|
|
613
613
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
614
614
|
}, [
|
|
615
615
|
o,
|
|
@@ -626,7 +626,7 @@ var U = {
|
|
|
626
626
|
setResponseFormat: c,
|
|
627
627
|
setSystemPrompt: u,
|
|
628
628
|
setTemperature: f,
|
|
629
|
-
handleSubmit:
|
|
629
|
+
handleSubmit: z(() => {
|
|
630
630
|
if (!m) return;
|
|
631
631
|
let t = {};
|
|
632
632
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -640,17 +640,17 @@ var U = {
|
|
|
640
640
|
a
|
|
641
641
|
])
|
|
642
642
|
};
|
|
643
|
-
},
|
|
643
|
+
}, ft = { label: "_label_14i7c_1" }, pt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
644
644
|
"Precise",
|
|
645
645
|
"Neutral",
|
|
646
646
|
"Creative"
|
|
647
647
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
648
|
-
let S = c({ "--csf-label-text": x?.labelText }), C = l(b,
|
|
649
|
-
return /* @__PURE__ */
|
|
648
|
+
let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ft.label, "gap-1");
|
|
649
|
+
return /* @__PURE__ */ R("div", {
|
|
650
650
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
651
651
|
style: S,
|
|
652
652
|
children: [
|
|
653
|
-
e.responseFormat && /* @__PURE__ */
|
|
653
|
+
e.responseFormat && /* @__PURE__ */ L(re, {
|
|
654
654
|
id: "response-format",
|
|
655
655
|
labelProps: {
|
|
656
656
|
label: d,
|
|
@@ -658,7 +658,7 @@ var U = {
|
|
|
658
658
|
caption: f
|
|
659
659
|
},
|
|
660
660
|
optionsClassName: "mb-2",
|
|
661
|
-
orientation:
|
|
661
|
+
orientation: ie.Column,
|
|
662
662
|
value: t ?? o.Markdown,
|
|
663
663
|
items: [{
|
|
664
664
|
value: o.Markdown,
|
|
@@ -669,18 +669,18 @@ var U = {
|
|
|
669
669
|
}],
|
|
670
670
|
onChange: (e) => a(e)
|
|
671
671
|
}),
|
|
672
|
-
e.systemPrompt && /* @__PURE__ */
|
|
672
|
+
e.systemPrompt && /* @__PURE__ */ L(ce, {
|
|
673
673
|
value: n,
|
|
674
674
|
placeholder: g,
|
|
675
675
|
className: i,
|
|
676
|
-
resize:
|
|
676
|
+
resize: le.Vertical,
|
|
677
677
|
labelProps: {
|
|
678
678
|
className: C,
|
|
679
679
|
label: h
|
|
680
680
|
},
|
|
681
681
|
onChange: (e) => s(e ?? "")
|
|
682
682
|
}),
|
|
683
|
-
e.temperature && /* @__PURE__ */ F
|
|
683
|
+
e.temperature && /* @__PURE__ */ L(F, {
|
|
684
684
|
labelProps: {
|
|
685
685
|
label: _,
|
|
686
686
|
className: C,
|
|
@@ -697,8 +697,8 @@ var U = {
|
|
|
697
697
|
})
|
|
698
698
|
]
|
|
699
699
|
});
|
|
700
|
-
},
|
|
701
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat:
|
|
700
|
+
}, mt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
701
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = dt({
|
|
702
702
|
isOpen: e,
|
|
703
703
|
features: o,
|
|
704
704
|
initialResponseFormat: s,
|
|
@@ -707,7 +707,7 @@ var U = {
|
|
|
707
707
|
onSave: d,
|
|
708
708
|
onClose: r
|
|
709
709
|
});
|
|
710
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ R(Pe, {
|
|
711
711
|
isOpen: e,
|
|
712
712
|
title: f,
|
|
713
713
|
closeLabel: i,
|
|
@@ -715,14 +715,14 @@ var U = {
|
|
|
715
715
|
onBack: t,
|
|
716
716
|
backLabel: n,
|
|
717
717
|
style: a,
|
|
718
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ L(pt, {
|
|
719
719
|
features: o,
|
|
720
720
|
responseFormat: w,
|
|
721
721
|
systemPrompt: T,
|
|
722
722
|
temperature: E,
|
|
723
|
-
onResponseFormatChange:
|
|
724
|
-
onSystemPromptChange:
|
|
725
|
-
onTemperatureChange:
|
|
723
|
+
onResponseFormatChange: O,
|
|
724
|
+
onSystemPromptChange: k,
|
|
725
|
+
onTemperatureChange: A,
|
|
726
726
|
responseFormatLabel: p,
|
|
727
727
|
responseFormatHint: m,
|
|
728
728
|
responseFormatMarkdownLabel: h,
|
|
@@ -732,23 +732,23 @@ var U = {
|
|
|
732
732
|
temperatureLabel: y,
|
|
733
733
|
temperatureLabels: b,
|
|
734
734
|
temperatureHint: x
|
|
735
|
-
}), /* @__PURE__ */
|
|
735
|
+
}), /* @__PURE__ */ L("div", {
|
|
736
736
|
className: l("px-6 py-4 mobile:pb-8"),
|
|
737
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ L(de, {
|
|
738
738
|
tooltip: C,
|
|
739
739
|
hideTooltip: D || !C,
|
|
740
740
|
triggerClassName: "w-full",
|
|
741
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ L(te, {
|
|
742
742
|
label: S,
|
|
743
|
-
onClick:
|
|
743
|
+
onClick: j,
|
|
744
744
|
disabled: !D,
|
|
745
745
|
className: "w-full"
|
|
746
746
|
})
|
|
747
747
|
})
|
|
748
748
|
})]
|
|
749
749
|
});
|
|
750
|
-
},
|
|
751
|
-
let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit:
|
|
750
|
+
}, K = { modal: "_modal_kl0h0_1" }, ht = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = K.modal }) => {
|
|
751
|
+
let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: O } = dt({
|
|
752
752
|
features: e,
|
|
753
753
|
initialResponseFormat: t,
|
|
754
754
|
initialSystemPrompt: n,
|
|
@@ -756,24 +756,24 @@ var U = {
|
|
|
756
756
|
onSave: i,
|
|
757
757
|
onClose: a
|
|
758
758
|
});
|
|
759
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ L(N, {
|
|
760
760
|
open: !0,
|
|
761
761
|
header: o,
|
|
762
762
|
titleClassName: s,
|
|
763
|
-
size:
|
|
763
|
+
size: ee.Sm,
|
|
764
764
|
onClose: a,
|
|
765
765
|
className: b,
|
|
766
766
|
mainButtons: [{
|
|
767
767
|
label: v,
|
|
768
768
|
variant: h.Primary,
|
|
769
|
-
onClick:
|
|
769
|
+
onClick: O,
|
|
770
770
|
disabled: !w,
|
|
771
771
|
tooltipProps: y ? {
|
|
772
772
|
tooltip: y,
|
|
773
773
|
hideTooltip: w
|
|
774
774
|
} : void 0
|
|
775
775
|
}],
|
|
776
|
-
children: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ L(pt, {
|
|
777
777
|
features: e,
|
|
778
778
|
responseFormat: x,
|
|
779
779
|
systemPrompt: S,
|
|
@@ -792,15 +792,15 @@ var U = {
|
|
|
792
792
|
temperatureHint: _
|
|
793
793
|
})
|
|
794
794
|
});
|
|
795
|
-
},
|
|
795
|
+
}, gt = {
|
|
796
796
|
icon: "_icon_1fv6z_1",
|
|
797
797
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
798
|
-
},
|
|
798
|
+
}, _t = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
|
|
799
799
|
let h = c({
|
|
800
800
|
"--tbs-icon-text": p?.iconText,
|
|
801
801
|
"--tbs-selected-icon-text": p?.selectedIconText
|
|
802
802
|
});
|
|
803
|
-
return /* @__PURE__ */
|
|
803
|
+
return /* @__PURE__ */ L(Pe, {
|
|
804
804
|
isOpen: e,
|
|
805
805
|
title: o,
|
|
806
806
|
closeLabel: i,
|
|
@@ -808,30 +808,30 @@ var U = {
|
|
|
808
808
|
onBack: t,
|
|
809
809
|
backLabel: n,
|
|
810
810
|
style: a,
|
|
811
|
-
children: /* @__PURE__ */
|
|
811
|
+
children: /* @__PURE__ */ L("ul", {
|
|
812
812
|
role: "menu",
|
|
813
813
|
className: "flex flex-col pb-4",
|
|
814
814
|
style: h,
|
|
815
|
-
children: s.map((e) => /* @__PURE__ */
|
|
815
|
+
children: s.map((e) => /* @__PURE__ */ L("li", {
|
|
816
816
|
role: "none",
|
|
817
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ L(m, {
|
|
818
818
|
type: "button",
|
|
819
819
|
role: "menuitemcheckbox",
|
|
820
820
|
"aria-checked": e.isSelected,
|
|
821
821
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
822
|
-
iconBefore: /* @__PURE__ */
|
|
823
|
-
className: l("flex items-center",
|
|
822
|
+
iconBefore: /* @__PURE__ */ L("span", {
|
|
823
|
+
className: l("flex items-center", gt.icon),
|
|
824
824
|
children: e.icon
|
|
825
825
|
}),
|
|
826
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
827
|
-
className: l("ms-auto",
|
|
828
|
-
children: /* @__PURE__ */
|
|
826
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ L("span", {
|
|
827
|
+
className: l("ms-auto", gt.selectedIcon),
|
|
828
|
+
children: /* @__PURE__ */ L(_e, {
|
|
829
829
|
size: f,
|
|
830
830
|
"aria-hidden": !0,
|
|
831
831
|
stroke: v
|
|
832
832
|
})
|
|
833
833
|
}) : null,
|
|
834
|
-
label: /* @__PURE__ */
|
|
834
|
+
label: /* @__PURE__ */ L("span", {
|
|
835
835
|
className: d,
|
|
836
836
|
children: e.label
|
|
837
837
|
}),
|
|
@@ -840,34 +840,34 @@ var U = {
|
|
|
840
840
|
}, e.id))
|
|
841
841
|
})
|
|
842
842
|
});
|
|
843
|
-
},
|
|
843
|
+
}, vt = {
|
|
844
844
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
845
845
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
846
|
-
},
|
|
847
|
-
let k = d(), [A, j] =
|
|
846
|
+
}, yt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: b = [], onToolToggle: x, toolsMenuTitle: C = "Tools", toolsBackLabel: w = "Back", menuOverlays: T, getCaretPosition: E, colors: O }) => {
|
|
847
|
+
let k = d(), [A, j] = U(!1), [M, N] = U(!1), [ee, te] = U(!1), [ne, re] = U(null), [ie, ae] = U(!1), P = V(() => c({
|
|
848
848
|
"--aab-tool-icon": O?.toolIcon,
|
|
849
849
|
"--aab-chevron-icon": O?.chevronIcon
|
|
850
|
-
}), [O?.toolIcon, O?.chevronIcon]),
|
|
850
|
+
}), [O?.toolIcon, O?.chevronIcon]), oe = b.length > 0 && x != null, F = T != null && T.length > 0, se = V(() => b.map((e) => ({
|
|
851
851
|
key: e.id,
|
|
852
852
|
label: e.label,
|
|
853
|
-
icon: /* @__PURE__ */
|
|
854
|
-
style:
|
|
855
|
-
className: l("flex items-center",
|
|
853
|
+
icon: /* @__PURE__ */ L("span", {
|
|
854
|
+
style: P,
|
|
855
|
+
className: l("flex items-center", vt.toolIcon),
|
|
856
856
|
children: e.icon
|
|
857
857
|
}),
|
|
858
858
|
selectable: !0,
|
|
859
859
|
mark: D.Check,
|
|
860
860
|
checked: e.isSelected,
|
|
861
|
-
onClick: () =>
|
|
861
|
+
onClick: () => x?.(e.id)
|
|
862
862
|
})), [
|
|
863
|
+
b,
|
|
863
864
|
x,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
]), de = B(() => [
|
|
865
|
+
P
|
|
866
|
+
]), ce = V(() => [
|
|
867
867
|
...e == null ? [] : [{
|
|
868
868
|
key: "attach",
|
|
869
869
|
label: r,
|
|
870
|
-
icon: /* @__PURE__ */
|
|
870
|
+
icon: /* @__PURE__ */ L(Se, {
|
|
871
871
|
size: f,
|
|
872
872
|
"aria-hidden": !0,
|
|
873
873
|
stroke: v
|
|
@@ -875,74 +875,74 @@ var U = {
|
|
|
875
875
|
onClick: e
|
|
876
876
|
}],
|
|
877
877
|
...g ?? [],
|
|
878
|
-
...
|
|
878
|
+
...oe ? [{
|
|
879
879
|
key: "tools",
|
|
880
|
-
label:
|
|
881
|
-
icon: /* @__PURE__ */
|
|
880
|
+
label: C,
|
|
881
|
+
icon: /* @__PURE__ */ L(Ee, {
|
|
882
882
|
size: f,
|
|
883
883
|
"aria-hidden": !0,
|
|
884
884
|
stroke: v
|
|
885
885
|
}),
|
|
886
886
|
onClick: k ? () => {
|
|
887
|
-
|
|
887
|
+
te(!0), j(!1);
|
|
888
888
|
} : () => void 0,
|
|
889
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
889
|
+
...k ? { iconAfter: /* @__PURE__ */ L(ye, {
|
|
890
890
|
size: f,
|
|
891
891
|
stroke: v,
|
|
892
|
-
style:
|
|
893
|
-
className: l("rtl:scale-x-[-1]",
|
|
892
|
+
style: P,
|
|
893
|
+
className: l("rtl:scale-x-[-1]", vt.chevronIcon),
|
|
894
894
|
"aria-hidden": !0
|
|
895
|
-
}) } : { children:
|
|
895
|
+
}) } : { children: se }
|
|
896
896
|
}] : [],
|
|
897
|
-
...(
|
|
897
|
+
...(T ?? []).map((e) => ({
|
|
898
898
|
key: e.key,
|
|
899
899
|
label: e.title,
|
|
900
900
|
icon: e.icon,
|
|
901
901
|
onClick: k ? () => {
|
|
902
|
-
|
|
902
|
+
re(e.key), j(!1);
|
|
903
903
|
} : () => void 0,
|
|
904
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
904
|
+
...k ? { iconAfter: /* @__PURE__ */ L(ye, {
|
|
905
905
|
size: f,
|
|
906
906
|
stroke: v,
|
|
907
|
-
style:
|
|
908
|
-
className: l("rtl:scale-x-[-1]",
|
|
907
|
+
style: P,
|
|
908
|
+
className: l("rtl:scale-x-[-1]", vt.chevronIcon),
|
|
909
909
|
"aria-hidden": !0
|
|
910
910
|
}) } : {
|
|
911
911
|
children: [{
|
|
912
912
|
key: `${e.key}-panel`,
|
|
913
913
|
label: ""
|
|
914
914
|
}],
|
|
915
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
915
|
+
renderSubMenu: () => e.renderOverlay(() => ae(!1), E?.() ?? 0)
|
|
916
916
|
}
|
|
917
917
|
})),
|
|
918
918
|
...t == null ? [] : [{
|
|
919
919
|
key: "record-voice",
|
|
920
920
|
label: n,
|
|
921
|
-
icon: /* @__PURE__ */
|
|
921
|
+
icon: /* @__PURE__ */ L(xe, {
|
|
922
922
|
size: f,
|
|
923
923
|
"aria-hidden": !0,
|
|
924
924
|
stroke: v
|
|
925
925
|
}),
|
|
926
926
|
onClick: () => {
|
|
927
|
-
j(!1),
|
|
927
|
+
j(!1), ae(!1), t();
|
|
928
928
|
}
|
|
929
929
|
}],
|
|
930
930
|
...h == null ? [] : [{
|
|
931
931
|
key: "chat-settings",
|
|
932
932
|
label: h.menuItemLabel ?? "Chat settings",
|
|
933
|
-
icon: /* @__PURE__ */
|
|
933
|
+
icon: /* @__PURE__ */ L(Te, {
|
|
934
934
|
size: f,
|
|
935
935
|
"aria-hidden": !0,
|
|
936
936
|
stroke: v
|
|
937
937
|
}),
|
|
938
|
-
iconAfter: k ? /* @__PURE__ */
|
|
938
|
+
iconAfter: k ? /* @__PURE__ */ L(ye, {
|
|
939
939
|
size: f,
|
|
940
940
|
stroke: v,
|
|
941
|
-
style:
|
|
942
|
-
className: l("rtl:scale-x-[-1]",
|
|
941
|
+
style: P,
|
|
942
|
+
className: l("rtl:scale-x-[-1]", vt.chevronIcon),
|
|
943
943
|
"aria-hidden": !0
|
|
944
944
|
}) : null,
|
|
945
|
-
onClick: () =>
|
|
945
|
+
onClick: () => N(!0)
|
|
946
946
|
}]
|
|
947
947
|
], [
|
|
948
948
|
r,
|
|
@@ -952,25 +952,25 @@ var U = {
|
|
|
952
952
|
h,
|
|
953
953
|
g,
|
|
954
954
|
k,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
955
|
+
oe,
|
|
956
|
+
C,
|
|
957
|
+
se,
|
|
958
|
+
T,
|
|
958
959
|
E,
|
|
959
|
-
|
|
960
|
-
M
|
|
960
|
+
P
|
|
961
961
|
]);
|
|
962
|
-
if (
|
|
963
|
-
let
|
|
962
|
+
if (ce.length === 0) return null;
|
|
963
|
+
let le = /* @__PURE__ */ L(y, {
|
|
964
964
|
matchReferenceWidth: !1,
|
|
965
965
|
placement: "bottom-start",
|
|
966
966
|
listClassName: p,
|
|
967
967
|
overlayContentClassName: "flex flex-col gap-1",
|
|
968
|
-
items:
|
|
968
|
+
items: ce,
|
|
969
969
|
disabled: m,
|
|
970
|
-
open:
|
|
971
|
-
onOpenChange:
|
|
972
|
-
children: /* @__PURE__ */
|
|
973
|
-
icon: /* @__PURE__ */
|
|
970
|
+
open: F ? ie : void 0,
|
|
971
|
+
onOpenChange: F ? ae : void 0,
|
|
972
|
+
children: /* @__PURE__ */ L(S, {
|
|
973
|
+
icon: /* @__PURE__ */ L(we, {
|
|
974
974
|
size: _.LG,
|
|
975
975
|
"aria-hidden": !0,
|
|
976
976
|
stroke: v
|
|
@@ -980,65 +980,64 @@ var U = {
|
|
|
980
980
|
disabled: m
|
|
981
981
|
})
|
|
982
982
|
});
|
|
983
|
-
return /* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
icon: /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ L(I, { children: k ? /* @__PURE__ */ R(I, { children: [
|
|
984
|
+
/* @__PURE__ */ L(S, {
|
|
985
|
+
icon: /* @__PURE__ */ L(we, {
|
|
986
986
|
size: _.LG,
|
|
987
987
|
"aria-hidden": !0,
|
|
988
988
|
stroke: v
|
|
989
989
|
}),
|
|
990
990
|
"aria-label": i,
|
|
991
|
-
size: b.Large,
|
|
992
991
|
tooltipProps: { tooltip: i },
|
|
993
992
|
disabled: m,
|
|
994
993
|
onClick: () => j(!0)
|
|
995
994
|
}),
|
|
996
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ L(ut, {
|
|
997
996
|
isOpen: A,
|
|
998
997
|
title: a,
|
|
999
998
|
closeLabel: s,
|
|
1000
999
|
onClose: () => j(!1),
|
|
1001
1000
|
style: u,
|
|
1002
|
-
items:
|
|
1001
|
+
items: ce,
|
|
1003
1002
|
className: "pb-4",
|
|
1004
1003
|
btnTextClassName: "flex-1"
|
|
1005
1004
|
}),
|
|
1006
|
-
|
|
1007
|
-
isOpen:
|
|
1005
|
+
oe && /* @__PURE__ */ L(_t, {
|
|
1006
|
+
isOpen: ee,
|
|
1008
1007
|
onBack: () => {
|
|
1009
|
-
|
|
1008
|
+
te(!1), j(!0);
|
|
1010
1009
|
},
|
|
1011
|
-
backLabel:
|
|
1012
|
-
onClose: () =>
|
|
1010
|
+
backLabel: w,
|
|
1011
|
+
onClose: () => te(!1),
|
|
1013
1012
|
closeLabel: s,
|
|
1014
1013
|
style: u,
|
|
1015
|
-
title:
|
|
1016
|
-
items:
|
|
1017
|
-
onToolToggle:
|
|
1014
|
+
title: C,
|
|
1015
|
+
items: b,
|
|
1016
|
+
onToolToggle: x
|
|
1018
1017
|
}),
|
|
1019
|
-
|
|
1020
|
-
isOpen:
|
|
1018
|
+
T?.map((e) => /* @__PURE__ */ L(Pe, {
|
|
1019
|
+
isOpen: ne === e.key,
|
|
1021
1020
|
title: e.title,
|
|
1022
1021
|
closeLabel: s,
|
|
1023
1022
|
onBack: () => {
|
|
1024
|
-
|
|
1023
|
+
re(null), j(!0);
|
|
1025
1024
|
},
|
|
1026
1025
|
backLabel: e.backLabel ?? "Back",
|
|
1027
|
-
onClose: () =>
|
|
1026
|
+
onClose: () => re(null),
|
|
1028
1027
|
style: u,
|
|
1029
|
-
children: /* @__PURE__ */
|
|
1028
|
+
children: /* @__PURE__ */ L("div", {
|
|
1030
1029
|
role: "menu",
|
|
1031
1030
|
"aria-label": e.title,
|
|
1032
|
-
children: e.renderOverlay(() =>
|
|
1031
|
+
children: e.renderOverlay(() => re(null), E?.() ?? 0)
|
|
1033
1032
|
})
|
|
1034
1033
|
}, e.key)),
|
|
1035
|
-
h != null && /* @__PURE__ */
|
|
1036
|
-
isOpen:
|
|
1034
|
+
h != null && /* @__PURE__ */ L(mt, {
|
|
1035
|
+
isOpen: M,
|
|
1037
1036
|
onBack: () => {
|
|
1038
|
-
|
|
1037
|
+
N(!1), j(!0);
|
|
1039
1038
|
},
|
|
1040
1039
|
backLabel: h.backLabel ?? "Back",
|
|
1041
|
-
onClose: () =>
|
|
1040
|
+
onClose: () => N(!1),
|
|
1042
1041
|
closeLabel: s,
|
|
1043
1042
|
style: u,
|
|
1044
1043
|
features: h.features,
|
|
@@ -1059,13 +1058,13 @@ var U = {
|
|
|
1059
1058
|
saveLabel: h.saveLabel,
|
|
1060
1059
|
saveDisabledTooltip: h.saveDisabledTooltip
|
|
1061
1060
|
})
|
|
1062
|
-
] }) : /* @__PURE__ */ I
|
|
1061
|
+
] }) : /* @__PURE__ */ R(I, { children: [le, h != null && M && /* @__PURE__ */ L(ht, {
|
|
1063
1062
|
features: h.features,
|
|
1064
1063
|
initialResponseFormat: h.responseFormat ?? o.Markdown,
|
|
1065
1064
|
initialSystemPrompt: h.systemPrompt,
|
|
1066
1065
|
initialTemperature: h.temperature,
|
|
1067
1066
|
onSave: h.onSave,
|
|
1068
|
-
onClose: () =>
|
|
1067
|
+
onClose: () => N(!1),
|
|
1069
1068
|
title: h.title,
|
|
1070
1069
|
responseFormatLabel: h.responseFormatLabel,
|
|
1071
1070
|
responseFormatHint: h.responseFormatHint,
|
|
@@ -1079,14 +1078,14 @@ var U = {
|
|
|
1079
1078
|
saveLabel: h.saveLabel,
|
|
1080
1079
|
saveDisabledTooltip: h.saveDisabledTooltip
|
|
1081
1080
|
})] }) });
|
|
1082
|
-
},
|
|
1081
|
+
}, bt = {
|
|
1083
1082
|
chip: "_chip_1lvv5_1",
|
|
1084
1083
|
chipSelected: "_chipSelected_1lvv5_9",
|
|
1085
1084
|
chipIcon: "_chipIcon_1lvv5_16",
|
|
1086
1085
|
chipText: "_chipText_1lvv5_19",
|
|
1087
1086
|
chipState: "_chipState_1lvv5_22",
|
|
1088
1087
|
chipClose: "_chipClose_1lvv5_25"
|
|
1089
|
-
},
|
|
1088
|
+
}, xt = (e) => `Remove ${e}`, St = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = xt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
|
|
1090
1089
|
if (e.length === 0) return null;
|
|
1091
1090
|
let d = !!(a && o), f = c({
|
|
1092
1091
|
"--ci-chip-bg": u?.chipBg,
|
|
@@ -1101,58 +1100,58 @@ var U = {
|
|
|
1101
1100
|
"--ci-chip-state-text": u?.chipStateText,
|
|
1102
1101
|
"--ci-chip-close": u?.chipClose,
|
|
1103
1102
|
"--ci-chip-close-hover": u?.chipCloseHover
|
|
1104
|
-
}), p = (e) => /* @__PURE__ */
|
|
1105
|
-
className: l(
|
|
1103
|
+
}), p = (e) => /* @__PURE__ */ L("span", {
|
|
1104
|
+
className: l(bt.chipIcon, "flex shrink-0"),
|
|
1106
1105
|
children: e.icon
|
|
1107
|
-
}), m = (e) => /* @__PURE__ */
|
|
1106
|
+
}), m = (e) => /* @__PURE__ */ R("span", {
|
|
1108
1107
|
className: "flex min-w-0 items-center",
|
|
1109
|
-
children: [/* @__PURE__ */
|
|
1110
|
-
className: l(
|
|
1111
|
-
children: [e.label, d && /* @__PURE__ */
|
|
1108
|
+
children: [/* @__PURE__ */ R("span", {
|
|
1109
|
+
className: l(bt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
1110
|
+
children: [e.label, d && /* @__PURE__ */ L("span", {
|
|
1112
1111
|
"aria-hidden": !0,
|
|
1113
1112
|
children: ":"
|
|
1114
1113
|
})]
|
|
1115
|
-
}), d && /* @__PURE__ */
|
|
1116
|
-
className: l(
|
|
1114
|
+
}), d && /* @__PURE__ */ L("span", {
|
|
1115
|
+
className: l(bt.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
|
|
1117
1116
|
"aria-hidden": !0,
|
|
1118
1117
|
children: e.isSelected ? a : o
|
|
1119
1118
|
})]
|
|
1120
1119
|
});
|
|
1121
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ L("div", {
|
|
1122
1121
|
className: "flex flex-wrap items-center gap-2",
|
|
1123
1122
|
style: f,
|
|
1124
|
-
children: e.map((e) => r ? /* @__PURE__ */
|
|
1125
|
-
className: l(
|
|
1126
|
-
children: [/* @__PURE__ */
|
|
1123
|
+
children: e.map((e) => r ? /* @__PURE__ */ R("div", {
|
|
1124
|
+
className: l(bt.chip, e.isSelected && bt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
|
|
1125
|
+
children: [/* @__PURE__ */ R("button", {
|
|
1127
1126
|
type: "button",
|
|
1128
1127
|
onClick: () => t(e.id),
|
|
1129
1128
|
"aria-pressed": e.isSelected,
|
|
1130
1129
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1130
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1132
1131
|
className: "flex shrink-0",
|
|
1133
1132
|
"aria-hidden": !0,
|
|
1134
1133
|
children: p(e)
|
|
1135
1134
|
}), m(e)]
|
|
1136
|
-
}), /* @__PURE__ */
|
|
1135
|
+
}), /* @__PURE__ */ L("button", {
|
|
1137
1136
|
type: "button",
|
|
1138
1137
|
onClick: () => n(e.id),
|
|
1139
1138
|
"aria-label": i(e.label),
|
|
1140
|
-
className: l(
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1139
|
+
className: l(bt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
1140
|
+
children: /* @__PURE__ */ L(De, {
|
|
1142
1141
|
size: 12,
|
|
1143
1142
|
"aria-hidden": !0,
|
|
1144
1143
|
stroke: v
|
|
1145
1144
|
})
|
|
1146
1145
|
})]
|
|
1147
|
-
}, e.id) : /* @__PURE__ */
|
|
1146
|
+
}, e.id) : /* @__PURE__ */ L(ue, {
|
|
1148
1147
|
icon: p(e),
|
|
1149
1148
|
label: m(e),
|
|
1150
1149
|
isSelected: e.isSelected,
|
|
1151
1150
|
onToggle: () => t(e.id),
|
|
1152
|
-
className: l(
|
|
1151
|
+
className: l(bt.chip, e.isSelected && bt.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
|
|
1153
1152
|
}, e.id))
|
|
1154
1153
|
});
|
|
1155
|
-
},
|
|
1154
|
+
}, q = {
|
|
1156
1155
|
wrapper: "_wrapper_19a9k_2",
|
|
1157
1156
|
wrapperDisabled: "_wrapperDisabled_19a9k_9",
|
|
1158
1157
|
textarea: "_textarea_19a9k_13",
|
|
@@ -1165,33 +1164,33 @@ var U = {
|
|
|
1165
1164
|
modelSelectorName: "_modelSelectorName_19a9k_72",
|
|
1166
1165
|
modelSelectorVersion: "_modelSelectorVersion_19a9k_75",
|
|
1167
1166
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_19a9k_84"
|
|
1168
|
-
},
|
|
1167
|
+
}, Ct = {
|
|
1169
1168
|
waveformCanvas: "_waveformCanvas_18zb5_1",
|
|
1170
1169
|
recordingDot: "_recordingDot_18zb5_15",
|
|
1171
1170
|
"recording-pulse": "_recording-pulse_18zb5_1"
|
|
1172
|
-
},
|
|
1173
|
-
let f =
|
|
1171
|
+
}, wt = 3, Tt = 4, Et = 200, Dt = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
|
|
1172
|
+
let f = H(null), p = H(new Float32Array(Et)), m = H(0), h = H(0), g = e === et.Recording, y = e === et.Processing, b = z((e) => {
|
|
1174
1173
|
let t = e.getContext("2d");
|
|
1175
1174
|
if (!t) return;
|
|
1176
1175
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1177
1176
|
let { width: n, height: r } = e;
|
|
1178
1177
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1179
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
1178
|
+
let i = Math.min(Math.max(1, Math.floor(n / Tt)), 199), a = m.current, o = h.current;
|
|
1180
1179
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1181
1180
|
for (let e = 0; e <= i; e++) {
|
|
1182
|
-
let n = ((a - i + e) %
|
|
1183
|
-
t.fillRect(e *
|
|
1181
|
+
let n = ((a - i + e) % Et + Et) % Et, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
1182
|
+
t.fillRect(e * Tt, (r - c) / 2, wt, c);
|
|
1184
1183
|
}
|
|
1185
1184
|
t.restore();
|
|
1186
1185
|
}, []);
|
|
1187
|
-
|
|
1186
|
+
B(() => {
|
|
1188
1187
|
if (!g) return;
|
|
1189
1188
|
let e = f.current;
|
|
1190
1189
|
if (!e) return;
|
|
1191
1190
|
p.current.fill(0), m.current = 0, h.current = 0;
|
|
1192
1191
|
let n, r = () => {
|
|
1193
|
-
if (h.current += 1, h.current >=
|
|
1194
|
-
h.current -=
|
|
1192
|
+
if (h.current += 1, h.current >= Tt) {
|
|
1193
|
+
h.current -= Tt;
|
|
1195
1194
|
let e = t.current;
|
|
1196
1195
|
if (e) {
|
|
1197
1196
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -1201,7 +1200,7 @@ var U = {
|
|
|
1201
1200
|
let r = (t[e] - 128) / 128;
|
|
1202
1201
|
n += r * r;
|
|
1203
1202
|
}
|
|
1204
|
-
p.current[m.current %
|
|
1203
|
+
p.current[m.current % Et] = Math.sqrt(n / t.length), m.current++;
|
|
1205
1204
|
}
|
|
1206
1205
|
}
|
|
1207
1206
|
b(e), n = requestAnimationFrame(r);
|
|
@@ -1213,7 +1212,7 @@ var U = {
|
|
|
1213
1212
|
g,
|
|
1214
1213
|
t,
|
|
1215
1214
|
b
|
|
1216
|
-
]),
|
|
1215
|
+
]), B(() => {
|
|
1217
1216
|
let e = f.current;
|
|
1218
1217
|
if (!e) return;
|
|
1219
1218
|
let t = new ResizeObserver(() => {
|
|
@@ -1221,11 +1220,11 @@ var U = {
|
|
|
1221
1220
|
});
|
|
1222
1221
|
return t.observe(e), () => t.disconnect();
|
|
1223
1222
|
}, [b]);
|
|
1224
|
-
let x = /* @__PURE__ */
|
|
1223
|
+
let x = /* @__PURE__ */ R("div", {
|
|
1225
1224
|
className: "flex shrink-0 items-center justify-end gap-1",
|
|
1226
1225
|
children: [
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
icon: /* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ L(k, {
|
|
1227
|
+
icon: /* @__PURE__ */ L(De, {
|
|
1229
1228
|
size: _.LG,
|
|
1230
1229
|
"aria-hidden": !0,
|
|
1231
1230
|
stroke: v
|
|
@@ -1234,8 +1233,8 @@ var U = {
|
|
|
1234
1233
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1235
1234
|
onClick: r
|
|
1236
1235
|
}),
|
|
1237
|
-
g && /* @__PURE__ */
|
|
1238
|
-
icon: /* @__PURE__ */
|
|
1236
|
+
g && /* @__PURE__ */ L(ne, {
|
|
1237
|
+
icon: /* @__PURE__ */ L(_e, {
|
|
1239
1238
|
size: _.LG,
|
|
1240
1239
|
"aria-hidden": !0,
|
|
1241
1240
|
stroke: v
|
|
@@ -1245,102 +1244,102 @@ var U = {
|
|
|
1245
1244
|
"aria-label": a,
|
|
1246
1245
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
1247
1246
|
}),
|
|
1248
|
-
y && /* @__PURE__ */
|
|
1247
|
+
y && /* @__PURE__ */ L("span", {
|
|
1249
1248
|
className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1250
|
-
children: /* @__PURE__ */
|
|
1249
|
+
children: /* @__PURE__ */ L(se, {
|
|
1251
1250
|
size: 20,
|
|
1252
1251
|
ariaLabel: s
|
|
1253
1252
|
})
|
|
1254
1253
|
})
|
|
1255
1254
|
]
|
|
1256
1255
|
});
|
|
1257
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ L("div", {
|
|
1258
1257
|
className: u,
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1258
|
+
children: /* @__PURE__ */ R("div", {
|
|
1260
1259
|
style: c,
|
|
1261
|
-
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d &&
|
|
1262
|
-
children: [/* @__PURE__ */
|
|
1260
|
+
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && q.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
|
|
1261
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1263
1262
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1264
|
-
children: [g && /* @__PURE__ */
|
|
1265
|
-
className: l(
|
|
1263
|
+
children: [g && /* @__PURE__ */ L("span", {
|
|
1264
|
+
className: l(Ct.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1266
1265
|
"aria-hidden": !0
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1266
|
+
}), /* @__PURE__ */ L("canvas", {
|
|
1268
1267
|
ref: f,
|
|
1269
1268
|
height: 26,
|
|
1270
1269
|
"aria-hidden": !0,
|
|
1271
|
-
className: l(
|
|
1270
|
+
className: l(Ct.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1272
1271
|
})]
|
|
1273
|
-
}), /* @__PURE__ */
|
|
1272
|
+
}), /* @__PURE__ */ R("div", {
|
|
1274
1273
|
className: "flex items-center justify-between gap-2",
|
|
1275
|
-
children: [i ?? /* @__PURE__ */
|
|
1274
|
+
children: [i ?? /* @__PURE__ */ L("span", { "aria-hidden": !0 }), x]
|
|
1276
1275
|
})]
|
|
1277
1276
|
})
|
|
1278
1277
|
});
|
|
1279
|
-
},
|
|
1278
|
+
}, Ot = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ L(ne, {
|
|
1280
1279
|
"aria-label": n,
|
|
1281
1280
|
onClick: () => e?.(),
|
|
1282
1281
|
disabled: t,
|
|
1283
1282
|
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1284
|
-
icon: /* @__PURE__ */
|
|
1283
|
+
icon: /* @__PURE__ */ L(ge, {
|
|
1285
1284
|
size: _.LG,
|
|
1286
1285
|
className: "rtl:scale-x-[-1]",
|
|
1287
1286
|
stroke: v
|
|
1288
1287
|
})
|
|
1289
|
-
}),
|
|
1290
|
-
icon: /* @__PURE__ */
|
|
1288
|
+
}), kt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ L(k, {
|
|
1289
|
+
icon: /* @__PURE__ */ L(Ce, {
|
|
1291
1290
|
size: _.LG,
|
|
1292
1291
|
stroke: v
|
|
1293
1292
|
}),
|
|
1294
1293
|
onClick: () => e?.(),
|
|
1295
1294
|
"aria-label": t
|
|
1296
|
-
}),
|
|
1297
|
-
variant:
|
|
1295
|
+
}), At = ({ size: e = 20 }) => /* @__PURE__ */ L(P, {
|
|
1296
|
+
variant: oe.Circular,
|
|
1298
1297
|
width: e,
|
|
1299
1298
|
height: e,
|
|
1300
1299
|
active: !0
|
|
1301
|
-
}),
|
|
1300
|
+
}), jt = ({ loadingLabel: e }) => /* @__PURE__ */ R("span", {
|
|
1302
1301
|
className: "flex min-w-0 flex-1 items-center",
|
|
1303
|
-
children: [/* @__PURE__ */
|
|
1304
|
-
variant:
|
|
1302
|
+
children: [/* @__PURE__ */ L(P, {
|
|
1303
|
+
variant: oe.Text,
|
|
1305
1304
|
width: "100%",
|
|
1306
1305
|
height: 16,
|
|
1307
1306
|
active: !0
|
|
1308
|
-
}), e && /* @__PURE__ */
|
|
1307
|
+
}), e && /* @__PURE__ */ L("span", {
|
|
1309
1308
|
className: "sr-only",
|
|
1310
1309
|
children: e
|
|
1311
1310
|
})]
|
|
1312
|
-
}),
|
|
1311
|
+
}), Mt = () => /* @__PURE__ */ L("div", {
|
|
1313
1312
|
"aria-hidden": "true",
|
|
1314
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1313
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ R("div", {
|
|
1315
1314
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1315
|
+
children: [/* @__PURE__ */ L(At, {}), /* @__PURE__ */ L(jt, {})]
|
|
1317
1316
|
}, t))
|
|
1318
|
-
}),
|
|
1317
|
+
}), Nt = (e) => e.displayName ?? e.id, Pt = (e, t) => {
|
|
1319
1318
|
let n = t.trim().toLowerCase();
|
|
1320
|
-
return n ? e.filter((e) =>
|
|
1321
|
-
},
|
|
1319
|
+
return n ? e.filter((e) => Nt(e).toLowerCase().includes(n)) : e;
|
|
1320
|
+
}, Ft = (e, t, r, i = 18, a) => /* @__PURE__ */ L(n, {
|
|
1322
1321
|
src: e,
|
|
1323
1322
|
size: i,
|
|
1324
1323
|
labels: { tooltip: a },
|
|
1325
1324
|
initialsName: r
|
|
1326
|
-
}),
|
|
1325
|
+
}), It = {
|
|
1327
1326
|
searchHeader: "_searchHeader_1u7db_1",
|
|
1328
1327
|
itemText: "_itemText_1u7db_13",
|
|
1329
1328
|
itemHover: "_itemHover_1u7db_17",
|
|
1330
1329
|
selectedItemBackground: "_selectedItemBackground_1u7db_22",
|
|
1331
1330
|
selectedItemText: "_selectedItemText_1u7db_26",
|
|
1332
1331
|
checkIcon: "_checkIcon_1u7db_30"
|
|
1333
|
-
},
|
|
1334
|
-
let [a, o] =
|
|
1332
|
+
}, Lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
|
|
1333
|
+
let [a, o] = U(""), s = V(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = V(() => u ? /* @__PURE__ */ L(At, { size: _.LG }) : Ft(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", _.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1335
1334
|
u,
|
|
1336
1335
|
s,
|
|
1337
1336
|
d,
|
|
1338
1337
|
r?.unavailableTooltip
|
|
1339
|
-
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g =
|
|
1338
|
+
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = V(() => {
|
|
1340
1339
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
1341
1340
|
key: `__loading-${t}`,
|
|
1342
|
-
icon: /* @__PURE__ */
|
|
1343
|
-
label: /* @__PURE__ */
|
|
1341
|
+
icon: /* @__PURE__ */ L(At, {}),
|
|
1342
|
+
label: /* @__PURE__ */ L(jt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1344
1343
|
disabled: !0
|
|
1345
1344
|
}));
|
|
1346
1345
|
if (!e || e.length === 0) {
|
|
@@ -1352,19 +1351,19 @@ var U = {
|
|
|
1352
1351
|
}] : [];
|
|
1353
1352
|
}
|
|
1354
1353
|
let o = i?.colors;
|
|
1355
|
-
return
|
|
1354
|
+
return Pt(e, a).map((e) => {
|
|
1356
1355
|
let r = e.id === t;
|
|
1357
1356
|
return {
|
|
1358
1357
|
key: e.id,
|
|
1359
|
-
label: /* @__PURE__ */
|
|
1360
|
-
text:
|
|
1358
|
+
label: /* @__PURE__ */ L(C, {
|
|
1359
|
+
text: Nt(e),
|
|
1361
1360
|
query: a,
|
|
1362
1361
|
maxLines: 1
|
|
1363
1362
|
}),
|
|
1364
|
-
icon:
|
|
1363
|
+
icon: Ft(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1365
1364
|
mark: D.Check,
|
|
1366
1365
|
checked: r,
|
|
1367
|
-
className: l(o?.itemText &&
|
|
1366
|
+
className: l(o?.itemText && It.itemText, o?.itemHoverBackground && It.itemHover, r && o?.selectedItemBackground && It.selectedItemBackground, r && o?.selectedItemText && It.selectedItemText, r && o?.checkIcon && It.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
|
|
1368
1367
|
onClick: () => n?.(e.id)
|
|
1369
1368
|
};
|
|
1370
1369
|
});
|
|
@@ -1378,7 +1377,7 @@ var U = {
|
|
|
1378
1377
|
i?.itemClassName,
|
|
1379
1378
|
i?.selectedItemClassName,
|
|
1380
1379
|
i?.colors
|
|
1381
|
-
]), v =
|
|
1380
|
+
]), v = V(() => c({
|
|
1382
1381
|
"--ms-item-text": i?.colors?.itemText,
|
|
1383
1382
|
"--ms-item-hover-bg": i?.colors?.itemHoverBackground,
|
|
1384
1383
|
"--ms-selected-item-bg": i?.colors?.selectedItemBackground,
|
|
@@ -1391,10 +1390,10 @@ var U = {
|
|
|
1391
1390
|
selectedLabel: p,
|
|
1392
1391
|
selectedVersion: m,
|
|
1393
1392
|
menuItems: g,
|
|
1394
|
-
menuHeader:
|
|
1393
|
+
menuHeader: V(() => !u && e && e.length > 0 ? /* @__PURE__ */ L("div", {
|
|
1395
1394
|
style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
|
|
1396
|
-
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1",
|
|
1397
|
-
children: /* @__PURE__ */
|
|
1395
|
+
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", It.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
|
|
1396
|
+
children: /* @__PURE__ */ L(ae, {
|
|
1398
1397
|
value: a,
|
|
1399
1398
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1400
1399
|
size: b.Small,
|
|
@@ -1414,22 +1413,22 @@ var U = {
|
|
|
1414
1413
|
e || o("");
|
|
1415
1414
|
}
|
|
1416
1415
|
};
|
|
1417
|
-
},
|
|
1418
|
-
function
|
|
1416
|
+
}, Rt = typeof window < "u" ? Ne : B;
|
|
1417
|
+
function zt(e) {
|
|
1419
1418
|
if (e !== void 0) switch (typeof e) {
|
|
1420
1419
|
case "number": return e;
|
|
1421
1420
|
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
1422
1421
|
}
|
|
1423
1422
|
}
|
|
1424
|
-
function
|
|
1425
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1426
|
-
styleHeight:
|
|
1427
|
-
styleWidth:
|
|
1428
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1423
|
+
function Bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1424
|
+
let { styleHeight: s, styleWidth: c } = V(() => ({
|
|
1425
|
+
styleHeight: zt(o?.height),
|
|
1426
|
+
styleWidth: zt(o?.width)
|
|
1427
|
+
}), [o?.height, o?.width]), [l, u] = U({
|
|
1429
1428
|
height: t,
|
|
1430
1429
|
width: n
|
|
1431
1430
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1432
|
-
return
|
|
1431
|
+
return Rt(() => {
|
|
1433
1432
|
if (i === null || d) return;
|
|
1434
1433
|
let t = new ResizeObserver((e) => {
|
|
1435
1434
|
for (let t of e) {
|
|
@@ -1449,7 +1448,7 @@ function Vt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1449
1448
|
i,
|
|
1450
1449
|
s,
|
|
1451
1450
|
c
|
|
1452
|
-
]),
|
|
1451
|
+
]), V(() => ({
|
|
1453
1452
|
height: s ?? l.height,
|
|
1454
1453
|
width: c ?? l.width
|
|
1455
1454
|
}), [
|
|
@@ -1458,26 +1457,26 @@ function Vt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1458
1457
|
c
|
|
1459
1458
|
]);
|
|
1460
1459
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let t =
|
|
1460
|
+
function Vt(e) {
|
|
1461
|
+
let t = H(() => {
|
|
1463
1462
|
throw Error("Cannot call during render.");
|
|
1464
1463
|
});
|
|
1465
|
-
return
|
|
1464
|
+
return Rt(() => {
|
|
1466
1465
|
t.current = e;
|
|
1467
|
-
}, [e]),
|
|
1466
|
+
}, [e]), z((e) => t.current?.(e), [t]);
|
|
1468
1467
|
}
|
|
1469
|
-
var
|
|
1470
|
-
function
|
|
1471
|
-
if (
|
|
1468
|
+
var J = null;
|
|
1469
|
+
function Y(e = !1) {
|
|
1470
|
+
if (J === null || e) {
|
|
1472
1471
|
let e = document.createElement("div"), t = e.style;
|
|
1473
1472
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1474
1473
|
let n = document.createElement("div"), r = n.style;
|
|
1475
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1474
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? J = "positive-descending" : (e.scrollLeft = 1, J = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), J;
|
|
1476
1475
|
}
|
|
1477
|
-
return
|
|
1476
|
+
return J;
|
|
1478
1477
|
}
|
|
1479
|
-
function
|
|
1480
|
-
if (t === "horizontal" && n) switch (
|
|
1478
|
+
function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1479
|
+
if (t === "horizontal" && n) switch (Y()) {
|
|
1481
1480
|
case "negative": return -r;
|
|
1482
1481
|
case "positive-descending": if (e) {
|
|
1483
1482
|
let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
|
|
@@ -1486,26 +1485,26 @@ function Y({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1486
1485
|
}
|
|
1487
1486
|
return r;
|
|
1488
1487
|
}
|
|
1489
|
-
function
|
|
1488
|
+
function Ht(e, t = "Assertion error") {
|
|
1490
1489
|
if (!e) throw console.error(t), Error(t);
|
|
1491
1490
|
}
|
|
1492
|
-
function
|
|
1491
|
+
function Ut(e, t) {
|
|
1493
1492
|
if (e === t) return !0;
|
|
1494
|
-
if (!!e != !!t || (
|
|
1493
|
+
if (!!e != !!t || (Ht(e !== void 0), Ht(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1495
1494
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1496
1495
|
return !0;
|
|
1497
1496
|
}
|
|
1498
|
-
function
|
|
1497
|
+
function Wt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1499
1498
|
if (t === 0) return 0;
|
|
1500
1499
|
if (typeof n == "number") return t * n;
|
|
1501
1500
|
{
|
|
1502
1501
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1503
|
-
return
|
|
1502
|
+
return Ht(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1504
1503
|
}
|
|
1505
1504
|
}
|
|
1506
|
-
function
|
|
1505
|
+
function Gt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1507
1506
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1508
|
-
let s =
|
|
1507
|
+
let s = Wt({
|
|
1509
1508
|
cachedBounds: t,
|
|
1510
1509
|
itemCount: r,
|
|
1511
1510
|
itemSize: i
|
|
@@ -1517,7 +1516,7 @@ function Kt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1517
1516
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1518
1517
|
}
|
|
1519
1518
|
}
|
|
1520
|
-
function
|
|
1519
|
+
function Z({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1521
1520
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1522
1521
|
for (; u < a;) {
|
|
1523
1522
|
let n = e.get(u);
|
|
@@ -1536,11 +1535,11 @@ function X({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
1536
1535
|
stopIndexOverscan: l
|
|
1537
1536
|
};
|
|
1538
1537
|
}
|
|
1539
|
-
function
|
|
1538
|
+
function Kt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1540
1539
|
let r = /* @__PURE__ */ new Map();
|
|
1541
1540
|
return {
|
|
1542
1541
|
get(i) {
|
|
1543
|
-
for (
|
|
1542
|
+
for (Ht(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1544
1543
|
let e = r.size, a;
|
|
1545
1544
|
switch (typeof n) {
|
|
1546
1545
|
case "function":
|
|
@@ -1554,14 +1553,14 @@ function qt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1554
1553
|
});
|
|
1555
1554
|
else {
|
|
1556
1555
|
let t = r.get(e - 1);
|
|
1557
|
-
|
|
1556
|
+
Ht(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1558
1557
|
scrollOffset: t.scrollOffset + t.size,
|
|
1559
1558
|
size: a
|
|
1560
1559
|
});
|
|
1561
1560
|
}
|
|
1562
1561
|
}
|
|
1563
1562
|
let a = r.get(i);
|
|
1564
|
-
return
|
|
1563
|
+
return Ht(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1565
1564
|
},
|
|
1566
1565
|
set(e, t) {
|
|
1567
1566
|
r.set(e, t);
|
|
@@ -1571,8 +1570,8 @@ function qt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1571
1570
|
}
|
|
1572
1571
|
};
|
|
1573
1572
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return
|
|
1573
|
+
function qt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1574
|
+
return V(() => Kt({
|
|
1576
1575
|
itemCount: e,
|
|
1577
1576
|
itemProps: t,
|
|
1578
1577
|
itemSize: n
|
|
@@ -1582,31 +1581,31 @@ function Jt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1582
1581
|
n
|
|
1583
1582
|
]);
|
|
1584
1583
|
}
|
|
1585
|
-
function
|
|
1584
|
+
function Jt({ containerSize: e, itemSize: t }) {
|
|
1586
1585
|
let n;
|
|
1587
1586
|
switch (typeof t) {
|
|
1588
1587
|
case "string":
|
|
1589
|
-
|
|
1588
|
+
Ht(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Ht(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1590
1589
|
break;
|
|
1591
1590
|
default: n = t;
|
|
1592
1591
|
}
|
|
1593
1592
|
return n;
|
|
1594
1593
|
}
|
|
1595
|
-
function
|
|
1596
|
-
let { height: u = n, width: d = n } =
|
|
1594
|
+
function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1595
|
+
let { height: u = n, width: d = n } = Bt({
|
|
1597
1596
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1598
1597
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1599
1598
|
element: e,
|
|
1600
1599
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1601
1600
|
style: t
|
|
1602
|
-
}), f =
|
|
1601
|
+
}), f = H({
|
|
1603
1602
|
height: 0,
|
|
1604
1603
|
width: 0
|
|
1605
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1604
|
+
}), p = r === "vertical" ? u : d, m = Jt({
|
|
1606
1605
|
containerSize: p,
|
|
1607
1606
|
itemSize: s
|
|
1608
1607
|
});
|
|
1609
|
-
|
|
1608
|
+
Ne(() => {
|
|
1610
1609
|
if (typeof c == "function") {
|
|
1611
1610
|
let e = f.current;
|
|
1612
1611
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1619,11 +1618,11 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1619
1618
|
c,
|
|
1620
1619
|
d
|
|
1621
1620
|
]);
|
|
1622
|
-
let h =
|
|
1621
|
+
let h = qt({
|
|
1623
1622
|
itemCount: a,
|
|
1624
1623
|
itemProps: o,
|
|
1625
1624
|
itemSize: m
|
|
1626
|
-
}), g =
|
|
1625
|
+
}), g = z((e) => h.get(e), [h]), [_, v] = U(() => Z({
|
|
1627
1626
|
cachedBounds: h,
|
|
1628
1627
|
containerScrollOffset: 0,
|
|
1629
1628
|
containerSize: p,
|
|
@@ -1634,7 +1633,7 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1634
1633
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1635
1634
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1636
1635
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1637
|
-
}, C =
|
|
1636
|
+
}, C = z(() => Wt({
|
|
1638
1637
|
cachedBounds: h,
|
|
1639
1638
|
itemCount: a,
|
|
1640
1639
|
itemSize: m
|
|
@@ -1642,14 +1641,14 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1642
1641
|
h,
|
|
1643
1642
|
a,
|
|
1644
1643
|
m
|
|
1645
|
-
]), w =
|
|
1646
|
-
let n =
|
|
1644
|
+
]), w = z((t) => {
|
|
1645
|
+
let n = X({
|
|
1647
1646
|
containerElement: e,
|
|
1648
1647
|
direction: r,
|
|
1649
1648
|
isRtl: i,
|
|
1650
1649
|
scrollOffset: t
|
|
1651
1650
|
});
|
|
1652
|
-
return
|
|
1651
|
+
return Z({
|
|
1653
1652
|
cachedBounds: h,
|
|
1654
1653
|
containerScrollOffset: n,
|
|
1655
1654
|
containerSize: p,
|
|
@@ -1665,30 +1664,30 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1665
1664
|
a,
|
|
1666
1665
|
l
|
|
1667
1666
|
]);
|
|
1668
|
-
return
|
|
1667
|
+
return Rt(() => {
|
|
1669
1668
|
let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
1670
1669
|
v(w(t));
|
|
1671
1670
|
}, [
|
|
1672
1671
|
e,
|
|
1673
1672
|
r,
|
|
1674
1673
|
w
|
|
1675
|
-
]),
|
|
1674
|
+
]), Rt(() => {
|
|
1676
1675
|
if (!e) return;
|
|
1677
1676
|
let t = () => {
|
|
1678
1677
|
v((t) => {
|
|
1679
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1678
|
+
let { scrollLeft: n, scrollTop: o } = e, s = X({
|
|
1680
1679
|
containerElement: e,
|
|
1681
1680
|
direction: r,
|
|
1682
1681
|
isRtl: i,
|
|
1683
1682
|
scrollOffset: r === "vertical" ? o : n
|
|
1684
|
-
}), c =
|
|
1683
|
+
}), c = Z({
|
|
1685
1684
|
cachedBounds: h,
|
|
1686
1685
|
containerScrollOffset: s,
|
|
1687
1686
|
containerSize: p,
|
|
1688
1687
|
itemCount: a,
|
|
1689
1688
|
overscanCount: l
|
|
1690
1689
|
});
|
|
1691
|
-
return
|
|
1690
|
+
return Ut(c, t) ? t : c;
|
|
1692
1691
|
});
|
|
1693
1692
|
};
|
|
1694
1693
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1704,8 +1703,8 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1704
1703
|
]), {
|
|
1705
1704
|
getCellBounds: g,
|
|
1706
1705
|
getEstimatedSize: C,
|
|
1707
|
-
scrollToIndex:
|
|
1708
|
-
let s =
|
|
1706
|
+
scrollToIndex: Vt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1707
|
+
let s = Gt({
|
|
1709
1708
|
align: t,
|
|
1710
1709
|
cachedBounds: h,
|
|
1711
1710
|
containerScrollOffset: n,
|
|
@@ -1715,14 +1714,14 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1715
1714
|
itemSize: m
|
|
1716
1715
|
});
|
|
1717
1716
|
if (e) {
|
|
1718
|
-
if (s =
|
|
1717
|
+
if (s = X({
|
|
1719
1718
|
containerElement: e,
|
|
1720
1719
|
direction: r,
|
|
1721
1720
|
isRtl: i,
|
|
1722
1721
|
scrollOffset: s
|
|
1723
1722
|
}), typeof e.scrollTo != "function") {
|
|
1724
1723
|
let e = w(s);
|
|
1725
|
-
|
|
1724
|
+
Ut(_, e) || v(e);
|
|
1726
1725
|
}
|
|
1727
1726
|
return s;
|
|
1728
1727
|
}
|
|
@@ -1733,30 +1732,30 @@ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1733
1732
|
stopIndexVisible: x
|
|
1734
1733
|
};
|
|
1735
1734
|
}
|
|
1736
|
-
function
|
|
1737
|
-
return
|
|
1735
|
+
function Xt(e) {
|
|
1736
|
+
return V(() => e, Object.values(e));
|
|
1738
1737
|
}
|
|
1739
|
-
function
|
|
1738
|
+
function Zt(e, t) {
|
|
1740
1739
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1741
|
-
return
|
|
1740
|
+
return Ut(n, a) && Ut(r, o) && Ut(i, s);
|
|
1742
1741
|
}
|
|
1743
|
-
function
|
|
1742
|
+
function Qt(e) {
|
|
1744
1743
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1745
1744
|
}
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1748
|
-
let m =
|
|
1745
|
+
var $t = "data-react-window-index";
|
|
1746
|
+
function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1747
|
+
let m = Xt(u), h = V(() => Ae(s, Zt), [s]), [g, _] = U(null), v = Qt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Yt({
|
|
1749
1748
|
containerElement: g,
|
|
1750
1749
|
containerStyle: f,
|
|
1751
1750
|
defaultContainerSize: n,
|
|
1752
1751
|
direction: "vertical",
|
|
1753
1752
|
itemCount: c,
|
|
1754
1753
|
itemProps: m,
|
|
1755
|
-
itemSize:
|
|
1754
|
+
itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1756
1755
|
onResize: i,
|
|
1757
1756
|
overscanCount: o
|
|
1758
1757
|
});
|
|
1759
|
-
|
|
1758
|
+
Me(r, () => ({
|
|
1760
1759
|
get element() {
|
|
1761
1760
|
return g;
|
|
1762
1761
|
},
|
|
@@ -1771,12 +1770,12 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1771
1770
|
top: r
|
|
1772
1771
|
});
|
|
1773
1772
|
}
|
|
1774
|
-
}), [g, x]),
|
|
1773
|
+
}), [g, x]), Rt(() => {
|
|
1775
1774
|
if (!g) return;
|
|
1776
1775
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1777
1776
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1778
1777
|
let n = `${S + t}`;
|
|
1779
|
-
return e.setAttribute(
|
|
1778
|
+
return e.setAttribute($t, n), !0;
|
|
1780
1779
|
});
|
|
1781
1780
|
if (v) return l.observeRowElements(e);
|
|
1782
1781
|
}, [
|
|
@@ -1785,7 +1784,7 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1785
1784
|
l,
|
|
1786
1785
|
S,
|
|
1787
1786
|
w
|
|
1788
|
-
]),
|
|
1787
|
+
]), B(() => {
|
|
1789
1788
|
S >= 0 && w >= 0 && a && a({
|
|
1790
1789
|
startIndex: C,
|
|
1791
1790
|
stopIndex: T
|
|
@@ -1800,11 +1799,11 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1800
1799
|
w,
|
|
1801
1800
|
T
|
|
1802
1801
|
]);
|
|
1803
|
-
let E =
|
|
1802
|
+
let E = V(() => {
|
|
1804
1803
|
let e = [];
|
|
1805
1804
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1806
1805
|
let n = y(t);
|
|
1807
|
-
e.push(/* @__PURE__ */
|
|
1806
|
+
e.push(/* @__PURE__ */ Oe(h, {
|
|
1808
1807
|
...m,
|
|
1809
1808
|
ariaAttributes: {
|
|
1810
1809
|
"aria-posinset": t + 1,
|
|
@@ -1831,7 +1830,7 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1831
1830
|
m,
|
|
1832
1831
|
S,
|
|
1833
1832
|
w
|
|
1834
|
-
]), D = /* @__PURE__ */
|
|
1833
|
+
]), D = /* @__PURE__ */ L("div", {
|
|
1835
1834
|
"aria-hidden": !0,
|
|
1836
1835
|
style: {
|
|
1837
1836
|
height: b(),
|
|
@@ -1839,7 +1838,7 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1839
1838
|
zIndex: -1
|
|
1840
1839
|
}
|
|
1841
1840
|
});
|
|
1842
|
-
return
|
|
1841
|
+
return Oe(d, {
|
|
1843
1842
|
role: "list",
|
|
1844
1843
|
...p,
|
|
1845
1844
|
className: t,
|
|
@@ -1853,7 +1852,7 @@ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1853
1852
|
}
|
|
1854
1853
|
}, E, e, D);
|
|
1855
1854
|
}
|
|
1856
|
-
var
|
|
1855
|
+
var Q = {
|
|
1857
1856
|
search: "_search_5skzl_1",
|
|
1858
1857
|
divider: "_divider_5skzl_5",
|
|
1859
1858
|
item: "_item_5skzl_9",
|
|
@@ -1862,29 +1861,29 @@ var Z = {
|
|
|
1862
1861
|
stateLabel: "_stateLabel_5skzl_27",
|
|
1863
1862
|
itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
|
|
1864
1863
|
itemSelectedText: "_itemSelectedText_5skzl_41"
|
|
1865
|
-
},
|
|
1866
|
-
let p = r[e], h =
|
|
1867
|
-
return /* @__PURE__ */
|
|
1864
|
+
}, tn = 44, nn = 8, rn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
|
|
1865
|
+
let p = r[e], h = Ft(p.iconUrl, p.type, p.displayName ?? p.id, _.SM), g = p.id === i;
|
|
1866
|
+
return /* @__PURE__ */ L("div", {
|
|
1868
1867
|
style: t,
|
|
1869
1868
|
...n,
|
|
1870
|
-
children: /* @__PURE__ */
|
|
1869
|
+
children: /* @__PURE__ */ L(m, {
|
|
1871
1870
|
type: "button",
|
|
1872
1871
|
"aria-current": g ? "true" : void 0,
|
|
1873
|
-
className: l(
|
|
1874
|
-
iconBefore: /* @__PURE__ */
|
|
1875
|
-
className:
|
|
1872
|
+
className: l(Q.item, "h-full w-full gap-3 px-4", g && u && Q.itemSelectedBackground, g && d && Q.itemSelectedText, s, g && c, W.modelMenuItem, g && W.modelMenuItemSelected),
|
|
1873
|
+
iconBefore: /* @__PURE__ */ L("span", {
|
|
1874
|
+
className: Q.itemIcon,
|
|
1876
1875
|
children: h
|
|
1877
1876
|
}),
|
|
1878
|
-
label: /* @__PURE__ */
|
|
1877
|
+
label: /* @__PURE__ */ R("span", {
|
|
1879
1878
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1880
|
-
children: [/* @__PURE__ */
|
|
1879
|
+
children: [/* @__PURE__ */ L(C, {
|
|
1881
1880
|
text: p.displayName ?? p.id,
|
|
1882
1881
|
query: o,
|
|
1883
1882
|
maxLines: 1,
|
|
1884
1883
|
className: l(a, "min-w-0 flex-1 text-start")
|
|
1885
|
-
}), g && /* @__PURE__ */
|
|
1884
|
+
}), g && /* @__PURE__ */ L(_e, {
|
|
1886
1885
|
size: _.SM,
|
|
1887
|
-
className:
|
|
1886
|
+
className: Q.checkIcon,
|
|
1888
1887
|
"aria-hidden": !0,
|
|
1889
1888
|
stroke: v
|
|
1890
1889
|
})]
|
|
@@ -1892,14 +1891,14 @@ var Z = {
|
|
|
1892
1891
|
onClick: () => f(p.id)
|
|
1893
1892
|
})
|
|
1894
1893
|
});
|
|
1895
|
-
},
|
|
1896
|
-
let [v, y] =
|
|
1897
|
-
|
|
1894
|
+
}, an = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _ }) => {
|
|
1895
|
+
let [v, y] = U("");
|
|
1896
|
+
B(() => {
|
|
1898
1897
|
e || y("");
|
|
1899
1898
|
}, [e]);
|
|
1900
|
-
let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, T = x ?
|
|
1899
|
+
let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, T = x ? Pt(a, v) : [], E = (e) => {
|
|
1901
1900
|
s(e), i();
|
|
1902
|
-
}, D = _?.colors,
|
|
1901
|
+
}, D = _?.colors, O = c({
|
|
1903
1902
|
"--ci-sheet-divider": g?.divider,
|
|
1904
1903
|
"--ci-sheet-text": D?.itemText ?? g?.itemText,
|
|
1905
1904
|
"--ci-sheet-item-hover": D?.itemHoverBackground ?? g?.itemHoverBg,
|
|
@@ -1909,44 +1908,44 @@ var Z = {
|
|
|
1909
1908
|
"--ci-sheet-selected-bg": D?.selectedItemBackground,
|
|
1910
1909
|
"--ci-sheet-selected-text": D?.selectedItemText
|
|
1911
1910
|
});
|
|
1912
|
-
return /* @__PURE__ */
|
|
1911
|
+
return /* @__PURE__ */ L(Pe, {
|
|
1913
1912
|
isOpen: e,
|
|
1914
1913
|
title: t,
|
|
1915
1914
|
closeLabel: n,
|
|
1916
1915
|
onClose: i,
|
|
1917
1916
|
style: p,
|
|
1918
1917
|
titleClassName: m,
|
|
1919
|
-
className: l("max-h-[80dvh]", _?.className,
|
|
1918
|
+
className: l("max-h-[80dvh]", _?.className, W.modelMenu),
|
|
1920
1919
|
colors: g?.shell,
|
|
1921
|
-
children: /* @__PURE__ */
|
|
1920
|
+
children: /* @__PURE__ */ R("div", {
|
|
1922
1921
|
className: "contents",
|
|
1923
|
-
style:
|
|
1922
|
+
style: O,
|
|
1924
1923
|
children: [
|
|
1925
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ L(w, {
|
|
1926
1925
|
visuallyHidden: !0,
|
|
1927
1926
|
children: S ? u : null
|
|
1928
1927
|
}),
|
|
1929
|
-
x && !S && /* @__PURE__ */ I
|
|
1928
|
+
x && !S && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
|
|
1930
1929
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
1931
|
-
className: l("flex-shrink-0 px-4 py-[10px]",
|
|
1932
|
-
children: /* @__PURE__ */
|
|
1930
|
+
className: l("flex-shrink-0 px-4 py-[10px]", Q.search, _?.searchHeaderClassName, W.modelMenuSearch),
|
|
1931
|
+
children: /* @__PURE__ */ L(ae, {
|
|
1933
1932
|
value: v,
|
|
1934
1933
|
placeholder: r,
|
|
1935
1934
|
size: b.Standard,
|
|
1936
1935
|
onChange: (e) => y(e ?? "")
|
|
1937
1936
|
})
|
|
1938
|
-
}), /* @__PURE__ */
|
|
1939
|
-
S ? /* @__PURE__ */
|
|
1937
|
+
}), /* @__PURE__ */ L("div", { className: l(Q.divider, "h-px shrink-0") })] }),
|
|
1938
|
+
S ? /* @__PURE__ */ L(Mt, {}) : C ? /* @__PURE__ */ L("div", {
|
|
1940
1939
|
role: "list",
|
|
1941
|
-
className: l(
|
|
1940
|
+
className: l(Q.stateLabel, h, "px-4 py-4"),
|
|
1942
1941
|
children: C
|
|
1943
|
-
}) : /* @__PURE__ */
|
|
1942
|
+
}) : /* @__PURE__ */ L(en, {
|
|
1944
1943
|
role: "list",
|
|
1945
1944
|
className: "overflow-y-auto",
|
|
1946
|
-
style: { height: Math.min(T.length,
|
|
1947
|
-
rowComponent:
|
|
1945
|
+
style: { height: Math.min(T.length, nn) * tn },
|
|
1946
|
+
rowComponent: rn,
|
|
1948
1947
|
rowCount: T.length,
|
|
1949
|
-
rowHeight:
|
|
1948
|
+
rowHeight: tn,
|
|
1950
1949
|
rowProps: {
|
|
1951
1950
|
items: T,
|
|
1952
1951
|
selectedDeploymentId: o,
|
|
@@ -1962,8 +1961,8 @@ var Z = {
|
|
|
1962
1961
|
]
|
|
1963
1962
|
})
|
|
1964
1963
|
});
|
|
1965
|
-
},
|
|
1966
|
-
let [g, b] =
|
|
1964
|
+
}, on = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: p, onPickerOpenChange: h }) => {
|
|
1965
|
+
let [g, b] = U(!1), { selectorIcon: x, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Lt({
|
|
1967
1966
|
deployments: e,
|
|
1968
1967
|
selectedDeploymentId: t,
|
|
1969
1968
|
onDeploymentChange: n,
|
|
@@ -1971,36 +1970,36 @@ var Z = {
|
|
|
1971
1970
|
styles: i
|
|
1972
1971
|
});
|
|
1973
1972
|
if (!e) return null;
|
|
1974
|
-
let
|
|
1973
|
+
let A = a || c, j = A ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, M = /* @__PURE__ */ L(ve, {
|
|
1975
1974
|
size: _.SM,
|
|
1976
|
-
className: l(
|
|
1975
|
+
className: l(q.modelSelectorCaret, W.modelSelectorCaret),
|
|
1977
1976
|
"aria-hidden": !0,
|
|
1978
1977
|
stroke: v
|
|
1979
|
-
}),
|
|
1980
|
-
className: l("flex shrink-0 items-center",
|
|
1978
|
+
}), N = /* @__PURE__ */ L("span", {
|
|
1979
|
+
className: l("flex shrink-0 items-center", W.modelSelectorIcon),
|
|
1981
1980
|
children: x
|
|
1982
1981
|
});
|
|
1983
|
-
if (o) return /* @__PURE__ */ I
|
|
1982
|
+
if (o) return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(S, {
|
|
1984
1983
|
tooltipProps: { tooltip: w },
|
|
1985
|
-
icon: /* @__PURE__ */
|
|
1984
|
+
icon: /* @__PURE__ */ R("div", {
|
|
1986
1985
|
className: "flex items-center gap-1",
|
|
1987
|
-
children: [
|
|
1986
|
+
children: [N, M]
|
|
1988
1987
|
}),
|
|
1989
1988
|
"aria-label": C,
|
|
1990
|
-
"aria-disabled":
|
|
1989
|
+
"aria-disabled": A || void 0,
|
|
1991
1990
|
onClick: () => {
|
|
1992
|
-
|
|
1991
|
+
A || b(!0);
|
|
1993
1992
|
},
|
|
1994
|
-
className: l("w-[50px]",
|
|
1995
|
-
}), d ? /* @__PURE__ */
|
|
1993
|
+
className: l("w-[50px]", q.modelSelectorButton, j, W.modelSelectorButton)
|
|
1994
|
+
}), d ? /* @__PURE__ */ L(Pe, {
|
|
1996
1995
|
isOpen: g,
|
|
1997
1996
|
title: r?.ariaLabel ?? "Select model",
|
|
1998
1997
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1999
1998
|
onClose: () => b(!1),
|
|
2000
1999
|
style: u,
|
|
2001
|
-
className: l(i?.className,
|
|
2000
|
+
className: l(i?.className, W.modelMenu),
|
|
2002
2001
|
children: d(() => b(!1))
|
|
2003
|
-
}) : /* @__PURE__ */
|
|
2002
|
+
}) : /* @__PURE__ */ L(an, {
|
|
2004
2003
|
isOpen: g,
|
|
2005
2004
|
title: r?.ariaLabel ?? "Select model",
|
|
2006
2005
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -2017,7 +2016,7 @@ var Z = {
|
|
|
2017
2016
|
})] });
|
|
2018
2017
|
if (d) {
|
|
2019
2018
|
let e = T ? `${w} · ${T}` : w;
|
|
2020
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ L(y, {
|
|
2021
2020
|
placement: "top-end",
|
|
2022
2021
|
matchReferenceWidth: !1,
|
|
2023
2022
|
open: f,
|
|
@@ -2025,390 +2024,390 @@ var Z = {
|
|
|
2025
2024
|
trigger: [],
|
|
2026
2025
|
outsideClosable: !0,
|
|
2027
2026
|
renderOverlay: () => d(() => h?.(!1)),
|
|
2028
|
-
listClassName: l("!w-[368px] !bg-layer-raised", i?.className,
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2027
|
+
listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
|
|
2028
|
+
children: /* @__PURE__ */ L(m, {
|
|
2030
2029
|
"aria-label": C,
|
|
2031
|
-
"aria-disabled":
|
|
2030
|
+
"aria-disabled": A || void 0,
|
|
2032
2031
|
tooltipProps: { tooltip: e },
|
|
2033
|
-
className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 ps-1.5 pe-2",
|
|
2032
|
+
className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 ps-1.5 pe-2", q.modelSelectorButton, j, A && q.modelSelectorButtonDisabled, W.modelSelectorButton),
|
|
2034
2033
|
onClick: () => {
|
|
2035
|
-
|
|
2034
|
+
A || p?.();
|
|
2036
2035
|
},
|
|
2037
|
-
iconBefore:
|
|
2038
|
-
iconAfter:
|
|
2036
|
+
iconBefore: N,
|
|
2037
|
+
iconAfter: M,
|
|
2039
2038
|
textClassName: "min-w-0",
|
|
2040
|
-
label: /* @__PURE__ */
|
|
2039
|
+
label: /* @__PURE__ */ R("span", {
|
|
2041
2040
|
className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
|
|
2042
|
-
children: [/* @__PURE__ */
|
|
2043
|
-
className: l("dial-small-text max-w-[180px] shrink-0 truncate",
|
|
2041
|
+
children: [/* @__PURE__ */ L("span", {
|
|
2042
|
+
className: l("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
|
|
2044
2043
|
children: w
|
|
2045
|
-
}), T && /* @__PURE__ */
|
|
2046
|
-
className: l("dial-tiny-text min-w-0 truncate",
|
|
2044
|
+
}), T && /* @__PURE__ */ L("span", {
|
|
2045
|
+
className: l("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
|
|
2047
2046
|
children: T
|
|
2048
2047
|
})]
|
|
2049
2048
|
})
|
|
2050
2049
|
})
|
|
2051
2050
|
});
|
|
2052
2051
|
}
|
|
2053
|
-
return /* @__PURE__ */
|
|
2054
|
-
className: l(
|
|
2055
|
-
"aria-disabled":
|
|
2056
|
-
children: /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ L("div", {
|
|
2053
|
+
className: l(j),
|
|
2054
|
+
"aria-disabled": A || void 0,
|
|
2055
|
+
children: /* @__PURE__ */ L(y, {
|
|
2057
2056
|
items: E,
|
|
2058
2057
|
menuHeader: D,
|
|
2059
2058
|
placement: "bottom-end",
|
|
2060
2059
|
matchReferenceWidth: !1,
|
|
2061
2060
|
maxDropdownHeight: s,
|
|
2062
|
-
listClassName: l("!w-[240px]", i?.className,
|
|
2063
|
-
listStyle:
|
|
2064
|
-
disabled:
|
|
2065
|
-
onOpenChange:
|
|
2066
|
-
children: /* @__PURE__ */
|
|
2061
|
+
listClassName: l("!w-[240px]", i?.className, W.modelMenu),
|
|
2062
|
+
listStyle: O,
|
|
2063
|
+
disabled: A,
|
|
2064
|
+
onOpenChange: A ? void 0 : k,
|
|
2065
|
+
children: /* @__PURE__ */ L(m, {
|
|
2067
2066
|
"aria-label": C,
|
|
2068
|
-
"aria-disabled":
|
|
2067
|
+
"aria-disabled": A || void 0,
|
|
2069
2068
|
tooltipProps: { tooltip: w },
|
|
2070
|
-
iconBefore:
|
|
2071
|
-
iconAfter:
|
|
2072
|
-
className: l("h-auto gap-1 !rounded-full !border-0 p-1.5",
|
|
2069
|
+
iconBefore: N,
|
|
2070
|
+
iconAfter: M,
|
|
2071
|
+
className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", q.modelSelectorButton, A && q.modelSelectorButtonDisabled, W.modelSelectorButton)
|
|
2073
2072
|
})
|
|
2074
2073
|
})
|
|
2075
2074
|
});
|
|
2076
|
-
},
|
|
2077
|
-
let
|
|
2078
|
-
"--ci-bg":
|
|
2079
|
-
"--ci-text":
|
|
2080
|
-
"--ci-border":
|
|
2081
|
-
"--ci-border-focus":
|
|
2082
|
-
"--ci-placeholder":
|
|
2083
|
-
"--ci-text-disabled":
|
|
2084
|
-
"--ci-model-selector-caret-color":
|
|
2085
|
-
"--ci-model-selector-hover-bg":
|
|
2086
|
-
"--ci-model-selector-disabled-color":
|
|
2087
|
-
"--ci-model-selector-name-color":
|
|
2088
|
-
"--ci-model-selector-version-color":
|
|
2089
|
-
"--ci-voice-waveform":
|
|
2090
|
-
"--ci-voice-accent":
|
|
2091
|
-
"--ci-mention-highlight-bg":
|
|
2092
|
-
"--ci-mention-highlight-text":
|
|
2093
|
-
"--ci-mention-highlight-unsupported-bg":
|
|
2094
|
-
"--ci-mention-highlight-unsupported-text":
|
|
2095
|
-
}), [
|
|
2075
|
+
}, sn = ke(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: g = "Attach file", fileAccept: b, addMenuTitle: C = "Add", menuTitle: D = "Menu", menuCloseLabel: O = "Close", removeLabel: k, retryLabel: A, uploadingLabel: j, expandLabel: M, clickLabel: N, sendLabel: ee, sendTooltip: te, emptyMessageTooltip: ne, stopLabel: re, micLabel: ie = "Dictate", recordVoiceLabel: ae = "Record voice", stopRecordingLabel: P, discardRecordingLabel: oe, colors: F, typography: se, attachmentTray: ce, modelMenu: le, className: ue, pendingDropFiles: de = [], onDropFilesConsumed: pe, pendingAttachments: me = [], onPendingAttachmentsConsumed: ge, pasteTextThreshold: _e = 4e3, maxMessageLength: ve = 5e4, deployments: ye, selectedDeploymentId: Se, onDeploymentChange: Ce, modelSelectorLabels: we, initialAttachments: Te = [], hideAddButton: Ee = !1, hideAttachFile: De = !1, hideActionBar: Oe = !1, actionRowLayout: ke = ct.Stacked, isInlineActionRowAllowedBelowDesktop: Ae = !1, renderFooterActions: je, isInputDisabled: G = !1, isModelSelectorDisabled: Pe = !1, isSendDisabled: Fe = !1, isAudioMessageSupported: Le = !1, isVoiceRecordingSupported: Re = Le, onTranscribeAudio: ze, transcribingLabel: Be, voiceErrorLabel: Ue, sendOnEnter: We = st.Enter, prefixAttachments: qe = [], onRemovePrefixAttachment: Je, chatSettings: Qe, toolsMenuItems: nt, onToolToggle: rt, canRemoveTools: it = !0, toolsMenuTitle: at, toolsBackLabel: lt, toolsChipLabels: ut, menuOverlays: dt, activeMentions: ft, onBackspaceAtCaret: pt, caretPositionOverride: mt, commandMenu: K, autoFocus: ht = !1, messageHistory: gt, onDialFileSystemClick: _t, dialFileSystemLabel: vt, validateAttachment: bt, onAttachmentClick: xt, modelPickerOverlay: Ct, maximumAttachmentsAmount: wt, onAttachmentsLimitExceeded: Tt, isAttachmentsEnabled: Et = !0, isTextAttachmentsAllowed: At = !0, usageLimitsSlot: jt, onMessageTooLong: Mt }, Nt) => {
|
|
2076
|
+
let Pt = d(), [Ft, It] = U(!1), Lt = Ge(gt), Rt = ft ?? [], zt = Rt.length > 0, Bt = V(() => c({
|
|
2077
|
+
"--ci-bg": F?.background,
|
|
2078
|
+
"--ci-text": F?.text,
|
|
2079
|
+
"--ci-border": F?.border,
|
|
2080
|
+
"--ci-border-focus": F?.borderFocus,
|
|
2081
|
+
"--ci-placeholder": F?.placeholder,
|
|
2082
|
+
"--ci-text-disabled": F?.textDisabled,
|
|
2083
|
+
"--ci-model-selector-caret-color": F?.modelSelectorCaret,
|
|
2084
|
+
"--ci-model-selector-hover-bg": F?.modelSelectorHoverBg,
|
|
2085
|
+
"--ci-model-selector-disabled-color": F?.modelSelectorDisabled,
|
|
2086
|
+
"--ci-model-selector-name-color": F?.modelSelectorName,
|
|
2087
|
+
"--ci-model-selector-version-color": F?.modelSelectorVersion,
|
|
2088
|
+
"--ci-voice-waveform": F?.voiceWaveform,
|
|
2089
|
+
"--ci-voice-accent": F?.voiceAccent,
|
|
2090
|
+
"--ci-mention-highlight-bg": F?.mentionHighlightBg,
|
|
2091
|
+
"--ci-mention-highlight-text": F?.mentionHighlightText,
|
|
2092
|
+
"--ci-mention-highlight-unsupported-bg": F?.mentionHighlightUnsupportedBg,
|
|
2093
|
+
"--ci-mention-highlight-unsupported-text": F?.mentionHighlightUnsupportedText
|
|
2094
|
+
}), [F]), Vt = V(() => _t ? [{
|
|
2096
2095
|
key: "dial-fs",
|
|
2097
|
-
label:
|
|
2098
|
-
icon: /* @__PURE__ */
|
|
2096
|
+
label: vt ?? "DIAL file system",
|
|
2097
|
+
icon: /* @__PURE__ */ L(be, {
|
|
2099
2098
|
size: f,
|
|
2100
2099
|
"aria-hidden": !0,
|
|
2101
2100
|
stroke: v
|
|
2102
2101
|
}),
|
|
2103
|
-
onClick:
|
|
2104
|
-
}] : [], [
|
|
2102
|
+
onClick: _t
|
|
2103
|
+
}] : [], [_t, vt]), { message: J, setMessage: Y, textareaRef: X } = Xe({
|
|
2105
2104
|
messageProp: e,
|
|
2106
2105
|
messageRevision: t
|
|
2107
2106
|
});
|
|
2108
|
-
|
|
2109
|
-
let e =
|
|
2107
|
+
B(() => {
|
|
2108
|
+
let e = X.current;
|
|
2110
2109
|
e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
|
|
2111
|
-
}, [
|
|
2112
|
-
n !== void 0 &&
|
|
2113
|
-
}, [n,
|
|
2114
|
-
let { handleUndoKeyDown:
|
|
2110
|
+
}, [X]), B(() => {
|
|
2111
|
+
n !== void 0 && X.current?.focus();
|
|
2112
|
+
}, [n, X]), Me(Nt, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
|
|
2113
|
+
let { handleUndoKeyDown: Ht, markCaretPlaced: Ut } = $e({
|
|
2115
2114
|
insertion: r,
|
|
2116
|
-
textareaRef:
|
|
2117
|
-
}), { isMenuOpen:
|
|
2118
|
-
config:
|
|
2119
|
-
message:
|
|
2120
|
-
}),
|
|
2121
|
-
|
|
2122
|
-
let
|
|
2123
|
-
|
|
2124
|
-
},
|
|
2125
|
-
|
|
2126
|
-
let e =
|
|
2127
|
-
|
|
2115
|
+
textareaRef: X
|
|
2116
|
+
}), { isMenuOpen: Wt, query: Gt, activeWordStart: Z, dismiss: Kt, closeOnOutsidePress: qt, handleCaretMove: Jt, handleValueChange: Yt, listboxId: Xt, overlayRef: Zt, activeOptionId: Qt, moveActiveOption: $t, getActiveOption: en } = He({
|
|
2117
|
+
config: K,
|
|
2118
|
+
message: J
|
|
2119
|
+
}), Q = H(Jt);
|
|
2120
|
+
Q.current = Jt;
|
|
2121
|
+
let tn = () => {
|
|
2122
|
+
Jt(X.current?.selectionStart ?? J.length);
|
|
2123
|
+
}, nn = H(!1), rn = () => {
|
|
2124
|
+
nn.current ? nn.current = !1 : requestAnimationFrame(() => {
|
|
2125
|
+
let e = X.current;
|
|
2126
|
+
Q.current(e?.selectionStart ?? e?.value.length ?? 0);
|
|
2128
2127
|
});
|
|
2129
|
-
},
|
|
2130
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") &&
|
|
2131
|
-
},
|
|
2132
|
-
let e =
|
|
2128
|
+
}, an = (e) => {
|
|
2129
|
+
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Jt(e.currentTarget.selectionStart ?? J.length);
|
|
2130
|
+
}, sn = K?.emptyQueryHint != null, cn = K != null && Z != null ? Z + K.triggerPrefix.length : null, ln = cn != null && J.slice(cn).split("\n", 1)[0] !== "", un = sn && Wt && Gt === "" && cn != null && !ln, $ = K != null && Wt ? Z ?? 0 : null, dn = H(null), fn = H(null), [pn, mn] = U(null), hn = z(() => {
|
|
2131
|
+
let e = dn.current, t = fn.current;
|
|
2133
2132
|
if (e == null || t == null) {
|
|
2134
|
-
|
|
2133
|
+
mn(null);
|
|
2135
2134
|
return;
|
|
2136
2135
|
}
|
|
2137
2136
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
2138
|
-
|
|
2137
|
+
mn({
|
|
2139
2138
|
left: n.left - r.left,
|
|
2140
2139
|
top: n.top - r.top
|
|
2141
2140
|
});
|
|
2142
2141
|
}, []);
|
|
2143
|
-
|
|
2144
|
-
if (
|
|
2145
|
-
let e =
|
|
2142
|
+
B(() => {
|
|
2143
|
+
if ($ == null) return;
|
|
2144
|
+
let e = X.current;
|
|
2146
2145
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2147
|
-
let t = new ResizeObserver(
|
|
2146
|
+
let t = new ResizeObserver(hn);
|
|
2148
2147
|
return t.observe(e), () => t.disconnect();
|
|
2149
2148
|
}, [
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2149
|
+
$,
|
|
2150
|
+
X,
|
|
2151
|
+
hn
|
|
2153
2152
|
]);
|
|
2154
|
-
let
|
|
2155
|
-
if (
|
|
2156
|
-
let t = `${
|
|
2157
|
-
if (
|
|
2158
|
-
let r =
|
|
2159
|
-
|
|
2153
|
+
let gn = z((e) => {
|
|
2154
|
+
if (K == null || (Kt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Z == null)) return;
|
|
2155
|
+
let t = `${K.triggerPrefix}${Gt}`, n = Z + t.length;
|
|
2156
|
+
if (J.slice(Z, n) !== t) return;
|
|
2157
|
+
let r = J.slice(0, Z) + J.slice(n);
|
|
2158
|
+
Y(r), Lt.notifyChange(), u?.(r);
|
|
2160
2159
|
}, [
|
|
2161
|
-
|
|
2162
|
-
qt,
|
|
2160
|
+
K,
|
|
2163
2161
|
Kt,
|
|
2164
|
-
|
|
2165
|
-
X,
|
|
2162
|
+
Gt,
|
|
2166
2163
|
J,
|
|
2167
|
-
|
|
2164
|
+
Z,
|
|
2165
|
+
Y,
|
|
2166
|
+
Lt,
|
|
2168
2167
|
u,
|
|
2169
|
-
|
|
2170
|
-
]),
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
}, [
|
|
2174
|
-
let
|
|
2175
|
-
|
|
2176
|
-
let { attachments:
|
|
2177
|
-
initialAttachments:
|
|
2168
|
+
X
|
|
2169
|
+
]), _n = H(void 0);
|
|
2170
|
+
B(() => {
|
|
2171
|
+
mt != null && _n.current !== t && (_n.current = t, X.current?.setSelectionRange(mt, mt), Ut(), Jt(mt));
|
|
2172
|
+
}, [J]);
|
|
2173
|
+
let vn = H(J);
|
|
2174
|
+
vn.current = J;
|
|
2175
|
+
let { attachments: yn, buildAttachments: bn, addAttachments: xn, resetAttachments: Sn, handleRemove: Cn, handleRetry: wn, handleExpand: Tn, hasBlockedAttachments: En } = Ie({
|
|
2176
|
+
initialAttachments: Te,
|
|
2178
2177
|
onUploadAttachment: a,
|
|
2179
2178
|
onAttachmentsChange: p,
|
|
2180
|
-
validateAttachment:
|
|
2181
|
-
pendingDropFiles:
|
|
2182
|
-
onDropFilesConsumed:
|
|
2183
|
-
isDropDisabled:
|
|
2184
|
-
pendingAttachments:
|
|
2185
|
-
onPendingAttachmentsConsumed:
|
|
2186
|
-
onExpandPastedText:
|
|
2187
|
-
let t =
|
|
2188
|
-
|
|
2189
|
-
}, [
|
|
2190
|
-
maximumAttachmentsAmount:
|
|
2191
|
-
baseAttachmentsAmount:
|
|
2192
|
-
onAttachmentsLimitExceeded:
|
|
2193
|
-
}),
|
|
2194
|
-
|
|
2195
|
-
}, [
|
|
2179
|
+
validateAttachment: bt,
|
|
2180
|
+
pendingDropFiles: de,
|
|
2181
|
+
onDropFilesConsumed: pe,
|
|
2182
|
+
isDropDisabled: G,
|
|
2183
|
+
pendingAttachments: me,
|
|
2184
|
+
onPendingAttachmentsConsumed: ge,
|
|
2185
|
+
onExpandPastedText: z((e) => {
|
|
2186
|
+
let t = vn.current, n = t ? `${t}\n${e}` : e;
|
|
2187
|
+
vn.current = n, Y(n), u?.(n);
|
|
2188
|
+
}, [Y, u]),
|
|
2189
|
+
maximumAttachmentsAmount: wt,
|
|
2190
|
+
baseAttachmentsAmount: qe.length,
|
|
2191
|
+
onAttachmentsLimitExceeded: Tt
|
|
2192
|
+
}), Dn = z((e) => {
|
|
2193
|
+
xn(bn([e]));
|
|
2194
|
+
}, [xn, bn]), On = H(!1), [kn, An] = U({
|
|
2196
2195
|
text: "",
|
|
2197
2196
|
revision: 0
|
|
2198
|
-
}), { state:
|
|
2199
|
-
onAttachAudio:
|
|
2200
|
-
onTranscribeAudio:
|
|
2201
|
-
onTranscript:
|
|
2197
|
+
}), { state: jn, analyserNodeRef: Mn, errorMessage: Nn, startRecording: Pn, stopRecording: Fn, discardRecording: In } = ot({
|
|
2198
|
+
onAttachAudio: Dn,
|
|
2199
|
+
onTranscribeAudio: ze,
|
|
2200
|
+
onTranscript: z((e) => {
|
|
2202
2201
|
let t = e.trim();
|
|
2203
2202
|
if (t) {
|
|
2204
|
-
let e =
|
|
2205
|
-
|
|
2203
|
+
let e = vn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2204
|
+
vn.current = n, Y(n), An((e) => ({
|
|
2206
2205
|
text: t,
|
|
2207
2206
|
revision: e.revision + 1
|
|
2208
|
-
})),
|
|
2207
|
+
})), Lt.notifyChange(), u?.(n);
|
|
2209
2208
|
}
|
|
2210
|
-
|
|
2209
|
+
On.current = !0;
|
|
2211
2210
|
}, [
|
|
2212
|
-
|
|
2213
|
-
|
|
2211
|
+
Y,
|
|
2212
|
+
Lt,
|
|
2214
2213
|
u
|
|
2215
2214
|
]),
|
|
2216
|
-
errorLabel:
|
|
2217
|
-
}),
|
|
2218
|
-
|
|
2219
|
-
if (
|
|
2220
|
-
|
|
2221
|
-
let e =
|
|
2215
|
+
errorLabel: Ue
|
|
2216
|
+
}), Ln = jn === et.Recording || jn === et.Processing;
|
|
2217
|
+
B(() => {
|
|
2218
|
+
if (jn === et.Error || jn === et.Idle && On.current) {
|
|
2219
|
+
On.current = !1;
|
|
2220
|
+
let e = X.current;
|
|
2222
2221
|
if (e != null) {
|
|
2223
|
-
|
|
2222
|
+
nn.current = document.activeElement !== e, e.focus();
|
|
2224
2223
|
let t = e.value.length;
|
|
2225
2224
|
e.setSelectionRange(t, t);
|
|
2226
2225
|
}
|
|
2227
2226
|
}
|
|
2228
|
-
}, [
|
|
2229
|
-
let Rn =
|
|
2227
|
+
}, [jn, X]);
|
|
2228
|
+
let Rn = H(null), zn = H(null), Bn = Et && At, { handlePaste: Vn } = he(xn, Bn ? _e : Infinity), Hn = z((e) => {
|
|
2230
2229
|
if (!Bn) {
|
|
2231
2230
|
let t = e.clipboardData.getData("text/plain");
|
|
2232
|
-
t.length >=
|
|
2231
|
+
t.length >= ve && Mt?.(t.length, ve);
|
|
2233
2232
|
}
|
|
2234
2233
|
if (Vn(e), e.defaultPrevented) return;
|
|
2235
2234
|
let t = e.clipboardData.getData("text/plain").replace(/\r\n?/g, "\n");
|
|
2236
|
-
t !== "" &&
|
|
2235
|
+
t !== "" && K?.onTextPaste?.(t);
|
|
2237
2236
|
}, [
|
|
2238
2237
|
Bn,
|
|
2239
|
-
|
|
2240
|
-
|
|
2238
|
+
ve,
|
|
2239
|
+
Mt,
|
|
2241
2240
|
Vn,
|
|
2242
|
-
|
|
2243
|
-
]), Un =
|
|
2244
|
-
|
|
2241
|
+
K
|
|
2242
|
+
]), Un = J.trim().length > 0 || yn.length > 0, Wn = Un && !En && !Fe && !Ln, [Gn, Kn] = U([]), qn = (nt ?? []).map((e) => e.id).join("|");
|
|
2243
|
+
B(() => {
|
|
2245
2244
|
Kn([]);
|
|
2246
2245
|
}, [qn]);
|
|
2247
|
-
let Jn =
|
|
2248
|
-
let e =
|
|
2249
|
-
return
|
|
2246
|
+
let Jn = V(() => {
|
|
2247
|
+
let e = nt ?? [];
|
|
2248
|
+
return it ? e.filter((e) => e.isSelected || !Gn.includes(e.id)) : e;
|
|
2250
2249
|
}, [
|
|
2251
|
-
|
|
2250
|
+
nt,
|
|
2252
2251
|
Gn,
|
|
2253
|
-
|
|
2254
|
-
]), Yn =
|
|
2255
|
-
Kn((t) => t.includes(e) ? t : [...t, e]),
|
|
2256
|
-
}, [
|
|
2257
|
-
if (
|
|
2258
|
-
if (
|
|
2259
|
-
|
|
2252
|
+
it
|
|
2253
|
+
]), Yn = z((e) => {
|
|
2254
|
+
Kn((t) => t.includes(e) ? t : [...t, e]), nt?.find((t) => t.id === e)?.isSelected && rt?.(e);
|
|
2255
|
+
}, [nt, rt]), Xn = ye === void 0 || Se != null, Zn = Le && !s, Qn = async () => {
|
|
2256
|
+
if (Fe || Ln) return;
|
|
2257
|
+
if (J.length >= ve) {
|
|
2258
|
+
Mt?.(J.length, ve);
|
|
2260
2259
|
return;
|
|
2261
2260
|
}
|
|
2262
|
-
let e =
|
|
2263
|
-
|
|
2261
|
+
let e = J, t = yn;
|
|
2262
|
+
Y(""), Lt.reset();
|
|
2264
2263
|
try {
|
|
2265
2264
|
await i?.(e, t), t.forEach((e) => {
|
|
2266
2265
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2267
|
-
}),
|
|
2266
|
+
}), Sn([]);
|
|
2268
2267
|
} catch {
|
|
2269
|
-
|
|
2268
|
+
Y(e), Sn(t);
|
|
2270
2269
|
}
|
|
2271
|
-
}, $n = (e) =>
|
|
2272
|
-
if (!
|
|
2273
|
-
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(),
|
|
2274
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(),
|
|
2270
|
+
}, $n = (e) => We === st.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, er = (e) => {
|
|
2271
|
+
if (!Wt || e.nativeEvent.isComposing) return !1;
|
|
2272
|
+
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Kt(), !0;
|
|
2273
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), $t(e.key === "ArrowDown" ? Ve.Next : Ve.Previous), !0;
|
|
2275
2274
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2276
|
-
let t =
|
|
2275
|
+
let t = en();
|
|
2277
2276
|
return t == null ? $n(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2278
2277
|
}, tr = (e) => {
|
|
2279
|
-
if (
|
|
2280
|
-
if (!e.nativeEvent.isComposing && !
|
|
2278
|
+
if (!Ln && !Ht(e) && !er(e)) {
|
|
2279
|
+
if (!e.nativeEvent.isComposing && !G && !s) {
|
|
2281
2280
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2282
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2281
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Lt.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
2283
2282
|
if (n !== null) {
|
|
2284
|
-
e.preventDefault(),
|
|
2283
|
+
e.preventDefault(), Y(n);
|
|
2285
2284
|
return;
|
|
2286
2285
|
}
|
|
2287
2286
|
}
|
|
2288
|
-
if (e.key === "Backspace" &&
|
|
2289
|
-
let t =
|
|
2287
|
+
if (e.key === "Backspace" && pt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
|
|
2288
|
+
let t = pt(e.currentTarget.selectionStart);
|
|
2290
2289
|
if (t != null) {
|
|
2291
2290
|
e.preventDefault();
|
|
2292
2291
|
let n = e.currentTarget;
|
|
2293
|
-
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) ||
|
|
2292
|
+
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ze(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
|
|
2294
2293
|
return;
|
|
2295
2294
|
}
|
|
2296
2295
|
}
|
|
2297
2296
|
}
|
|
2298
|
-
e.key === "Enter" && $n(e) && (e.preventDefault(), !s && Wn && Xn && !
|
|
2297
|
+
e.key === "Enter" && $n(e) && (e.preventDefault(), !s && Wn && Xn && !G && Qn());
|
|
2299
2298
|
}
|
|
2300
2299
|
}, nr = (e) => {
|
|
2301
2300
|
let t = Array.from(e.target.files ?? []);
|
|
2302
2301
|
if (t.length === 0) return;
|
|
2303
|
-
let n =
|
|
2304
|
-
e.target.value = "",
|
|
2305
|
-
}, rr =
|
|
2302
|
+
let n = bn(t);
|
|
2303
|
+
e.target.value = "", xn(n);
|
|
2304
|
+
}, rr = V(() => {
|
|
2306
2305
|
let e = [];
|
|
2307
|
-
return
|
|
2308
|
-
offset:
|
|
2309
|
-
node: /* @__PURE__ */
|
|
2310
|
-
ref:
|
|
2306
|
+
return $ != null && e.push({
|
|
2307
|
+
offset: $,
|
|
2308
|
+
node: /* @__PURE__ */ L("span", {
|
|
2309
|
+
ref: dn,
|
|
2311
2310
|
"aria-hidden": !0,
|
|
2312
2311
|
className: "inline-block h-lh w-0 align-text-top"
|
|
2313
2312
|
}, "caret-marker")
|
|
2314
|
-
}),
|
|
2315
|
-
offset:
|
|
2316
|
-
node: /* @__PURE__ */
|
|
2317
|
-
className:
|
|
2313
|
+
}), un && K != null && cn != null && e.push({
|
|
2314
|
+
offset: cn,
|
|
2315
|
+
node: /* @__PURE__ */ L("span", {
|
|
2316
|
+
className: q.commandHint,
|
|
2318
2317
|
"aria-hidden": !0,
|
|
2319
2318
|
"data-mirror-synthetic": !0,
|
|
2320
|
-
children:
|
|
2319
|
+
children: K.emptyQueryHint
|
|
2321
2320
|
}, "command-hint")
|
|
2322
2321
|
}), e;
|
|
2323
2322
|
}, [
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
]), ir =
|
|
2329
|
-
textareaRef:
|
|
2330
|
-
message:
|
|
2323
|
+
$,
|
|
2324
|
+
un,
|
|
2325
|
+
K,
|
|
2326
|
+
cn
|
|
2327
|
+
]), ir = zt || rr.length > 0, { mirrorRef: ar, selectionRects: or, updateSelectionRects: sr, syncMirrorToTextarea: cr } = Ye({
|
|
2328
|
+
textareaRef: X,
|
|
2329
|
+
message: J,
|
|
2331
2330
|
isMirrorActive: ir
|
|
2332
2331
|
});
|
|
2333
|
-
|
|
2334
|
-
|
|
2332
|
+
Ne(() => {
|
|
2333
|
+
hn();
|
|
2335
2334
|
}, [
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2335
|
+
hn,
|
|
2336
|
+
$,
|
|
2337
|
+
J
|
|
2339
2338
|
]);
|
|
2340
|
-
let lr = /* @__PURE__ */
|
|
2341
|
-
className: l(
|
|
2342
|
-
ref:
|
|
2343
|
-
autoFocus:
|
|
2344
|
-
value:
|
|
2339
|
+
let lr = /* @__PURE__ */ L("textarea", {
|
|
2340
|
+
className: l(q.textarea, ir && q.textareaMentionMode, se?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
|
|
2341
|
+
ref: X,
|
|
2342
|
+
autoFocus: ht,
|
|
2343
|
+
value: J,
|
|
2345
2344
|
onChange: (e) => {
|
|
2346
|
-
|
|
2345
|
+
Y(e.target.value), Lt.notifyChange();
|
|
2347
2346
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2348
|
-
|
|
2347
|
+
Yt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2349
2348
|
},
|
|
2350
2349
|
onSelect: sr,
|
|
2351
2350
|
onScroll: () => {
|
|
2352
|
-
cr(),
|
|
2351
|
+
cr(), $ != null && hn();
|
|
2353
2352
|
},
|
|
2354
|
-
onFocus:
|
|
2355
|
-
onClick:
|
|
2353
|
+
onFocus: rn,
|
|
2354
|
+
onClick: tn,
|
|
2356
2355
|
onKeyDown: tr,
|
|
2357
|
-
onKeyUp:
|
|
2356
|
+
onKeyUp: an,
|
|
2358
2357
|
onPaste: Hn,
|
|
2359
2358
|
placeholder: m,
|
|
2360
2359
|
"aria-label": h,
|
|
2361
|
-
"aria-autocomplete":
|
|
2362
|
-
"aria-controls":
|
|
2363
|
-
"aria-activedescendant":
|
|
2364
|
-
"aria-hidden":
|
|
2365
|
-
disabled:
|
|
2366
|
-
readOnly:
|
|
2360
|
+
"aria-autocomplete": K == null ? void 0 : "list",
|
|
2361
|
+
"aria-controls": Wt ? Xt : void 0,
|
|
2362
|
+
"aria-activedescendant": Qt ?? void 0,
|
|
2363
|
+
"aria-hidden": zt ? !0 : void 0,
|
|
2364
|
+
disabled: G,
|
|
2365
|
+
readOnly: Ln,
|
|
2367
2366
|
rows: 1
|
|
2368
|
-
}), ur = /* @__PURE__ */ I
|
|
2367
|
+
}), ur = /* @__PURE__ */ R(I, { children: [lr, K != null && /* @__PURE__ */ L("div", {
|
|
2369
2368
|
"aria-hidden": !0,
|
|
2370
|
-
className: l("pointer-events-none absolute",
|
|
2369
|
+
className: l("pointer-events-none absolute", se?.fontClassName || "dial-body-paragraph-text"),
|
|
2371
2370
|
style: {
|
|
2372
|
-
left:
|
|
2373
|
-
top:
|
|
2371
|
+
left: pn?.left ?? 0,
|
|
2372
|
+
top: pn?.top ?? 0
|
|
2374
2373
|
},
|
|
2375
|
-
children: /* @__PURE__ */
|
|
2376
|
-
open:
|
|
2374
|
+
children: /* @__PURE__ */ L(y, {
|
|
2375
|
+
open: Wt,
|
|
2377
2376
|
onOpenChange: (e) => {
|
|
2378
|
-
e ||
|
|
2377
|
+
e || qt();
|
|
2379
2378
|
},
|
|
2380
2379
|
placement: "top-start",
|
|
2381
2380
|
trigger: [],
|
|
2382
2381
|
initialFocus: -1,
|
|
2383
2382
|
matchReferenceWidth: !1,
|
|
2384
|
-
outsidePressIgnoreRef:
|
|
2383
|
+
outsidePressIgnoreRef: X,
|
|
2385
2384
|
renderOverlay: () => {
|
|
2386
|
-
let e =
|
|
2387
|
-
return /* @__PURE__ */
|
|
2388
|
-
ref:
|
|
2385
|
+
let e = K.menuLabel != null;
|
|
2386
|
+
return /* @__PURE__ */ L("div", {
|
|
2387
|
+
ref: Zt,
|
|
2389
2388
|
role: e ? "group" : void 0,
|
|
2390
|
-
"aria-label":
|
|
2391
|
-
children:
|
|
2392
|
-
query:
|
|
2393
|
-
caretPosition:
|
|
2394
|
-
close:
|
|
2395
|
-
listboxId:
|
|
2396
|
-
activeOptionId:
|
|
2389
|
+
"aria-label": K.menuLabel,
|
|
2390
|
+
children: K.renderMenu({
|
|
2391
|
+
query: Gt,
|
|
2392
|
+
caretPosition: Z ?? 0,
|
|
2393
|
+
close: gn,
|
|
2394
|
+
listboxId: Xt,
|
|
2395
|
+
activeOptionId: Qt
|
|
2397
2396
|
})
|
|
2398
2397
|
});
|
|
2399
2398
|
},
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2399
|
+
children: /* @__PURE__ */ L("span", {
|
|
2401
2400
|
"aria-hidden": !0,
|
|
2402
2401
|
className: "inline-block h-lh w-0"
|
|
2403
2402
|
})
|
|
2404
2403
|
})
|
|
2405
|
-
})] }), dr = /* @__PURE__ */
|
|
2406
|
-
ref:
|
|
2404
|
+
})] }), dr = /* @__PURE__ */ R("div", {
|
|
2405
|
+
ref: fn,
|
|
2407
2406
|
className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
|
|
2408
|
-
children: [ir && /* @__PURE__ */
|
|
2407
|
+
children: [ir && /* @__PURE__ */ R("div", {
|
|
2409
2408
|
ref: ar,
|
|
2410
|
-
className: l(
|
|
2411
|
-
children: [
|
|
2409
|
+
className: l(q.textarea, se?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 [overflow-wrap:anywhere] whitespace-pre-wrap"),
|
|
2410
|
+
children: [Ke(J, Rt, rr, q.mentionHighlight, q.mentionHighlightUnsupported), or.map((e, t) => /* @__PURE__ */ L("div", {
|
|
2412
2411
|
"aria-hidden": !0,
|
|
2413
2412
|
className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
|
|
2414
2413
|
style: {
|
|
@@ -2419,68 +2418,68 @@ var Z = {
|
|
|
2419
2418
|
}
|
|
2420
2419
|
}, `selection-${t}`))]
|
|
2421
2420
|
}), ur]
|
|
2422
|
-
}), fr =
|
|
2423
|
-
onAttachClick:
|
|
2421
|
+
}), fr = Ee ? void 0 : /* @__PURE__ */ L(yt, {
|
|
2422
|
+
onAttachClick: De ? void 0 : () => Rn.current?.click(),
|
|
2424
2423
|
attachLabel: g,
|
|
2425
2424
|
addMenuTitle: C,
|
|
2426
2425
|
menuTitle: D,
|
|
2427
|
-
menuCloseLabel:
|
|
2428
|
-
style:
|
|
2429
|
-
isDisabled:
|
|
2430
|
-
chatSettings:
|
|
2431
|
-
extraMenuItems:
|
|
2432
|
-
onRecordVoice:
|
|
2433
|
-
recordVoiceLabel:
|
|
2434
|
-
toolsMenuItems:
|
|
2435
|
-
onToolToggle:
|
|
2436
|
-
toolsMenuTitle:
|
|
2437
|
-
toolsBackLabel:
|
|
2438
|
-
menuOverlays:
|
|
2439
|
-
getCaretPosition: () =>
|
|
2440
|
-
}), pr =
|
|
2441
|
-
className: l("flex",
|
|
2426
|
+
menuCloseLabel: O,
|
|
2427
|
+
style: Bt,
|
|
2428
|
+
isDisabled: G || Ln,
|
|
2429
|
+
chatSettings: Qe,
|
|
2430
|
+
extraMenuItems: Vt,
|
|
2431
|
+
onRecordVoice: Re && Et && !s && !Ln ? () => Pn(tt.Attachment) : void 0,
|
|
2432
|
+
recordVoiceLabel: ae,
|
|
2433
|
+
toolsMenuItems: it ? nt : void 0,
|
|
2434
|
+
onToolToggle: rt,
|
|
2435
|
+
toolsMenuTitle: at,
|
|
2436
|
+
toolsBackLabel: lt,
|
|
2437
|
+
menuOverlays: dt,
|
|
2438
|
+
getCaretPosition: () => X.current?.selectionStart ?? J.length
|
|
2439
|
+
}), pr = ke === ct.Inline && (!Pt || Ae), mr = fr && /* @__PURE__ */ L("div", {
|
|
2440
|
+
className: l("flex", W.addCluster),
|
|
2442
2441
|
children: fr
|
|
2443
|
-
}), hr = Jn.length > 0 &&
|
|
2444
|
-
className: l("min-w-0 flex-1",
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2442
|
+
}), hr = Jn.length > 0 && rt != null && /* @__PURE__ */ L("div", {
|
|
2443
|
+
className: l("min-w-0", pr ? "flex-1" : "max-w-full flex-[1_0_auto]", W.toolsChips),
|
|
2444
|
+
children: /* @__PURE__ */ L(St, {
|
|
2446
2445
|
items: Jn,
|
|
2447
|
-
onToolToggle:
|
|
2446
|
+
onToolToggle: rt,
|
|
2448
2447
|
onToolDismiss: Yn,
|
|
2449
|
-
canRemove:
|
|
2450
|
-
removeLabel:
|
|
2451
|
-
stateOnLabel:
|
|
2452
|
-
stateOffLabel:
|
|
2448
|
+
canRemove: it,
|
|
2449
|
+
removeLabel: ut?.removeLabel,
|
|
2450
|
+
stateOnLabel: ut?.stateOnLabel,
|
|
2451
|
+
stateOffLabel: ut?.stateOffLabel
|
|
2453
2452
|
})
|
|
2454
2453
|
});
|
|
2455
|
-
return /* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ R("div", {
|
|
2456
2455
|
ref: zn,
|
|
2457
|
-
style:
|
|
2458
|
-
className: l(
|
|
2456
|
+
style: Bt,
|
|
2457
|
+
className: l(q.wrapper, G && q.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", ue, W.wrapper),
|
|
2459
2458
|
children: [
|
|
2460
|
-
(
|
|
2461
|
-
attachments: [...
|
|
2459
|
+
(qe.length > 0 || yn.length > 0) && /* @__PURE__ */ L(fe, {
|
|
2460
|
+
attachments: [...qe, ...yn],
|
|
2462
2461
|
onRemove: (e) => {
|
|
2463
|
-
|
|
2462
|
+
qe.some((t) => t.id === e) ? Je?.(e) : Cn(e);
|
|
2464
2463
|
},
|
|
2465
|
-
onRetry:
|
|
2466
|
-
onExpand:
|
|
2464
|
+
onRetry: wn,
|
|
2465
|
+
onExpand: Tn,
|
|
2467
2466
|
labels: {
|
|
2468
|
-
removeLabel:
|
|
2469
|
-
retryLabel:
|
|
2470
|
-
uploadingLabel:
|
|
2471
|
-
expandLabel:
|
|
2472
|
-
clickLabel:
|
|
2467
|
+
removeLabel: k,
|
|
2468
|
+
retryLabel: A,
|
|
2469
|
+
uploadingLabel: j,
|
|
2470
|
+
expandLabel: M,
|
|
2471
|
+
clickLabel: N
|
|
2473
2472
|
},
|
|
2474
2473
|
styles: {
|
|
2475
|
-
...
|
|
2476
|
-
className: l(
|
|
2474
|
+
...ce,
|
|
2475
|
+
className: l(yn.length > 6 && "-me-4", ce?.className)
|
|
2477
2476
|
},
|
|
2478
|
-
onAttachmentClick:
|
|
2479
|
-
let t = [...
|
|
2480
|
-
t != null &&
|
|
2477
|
+
onAttachmentClick: xt == null ? void 0 : (e) => {
|
|
2478
|
+
let t = [...qe, ...yn].find((t) => t.id === e);
|
|
2479
|
+
t != null && xt(t);
|
|
2481
2480
|
}
|
|
2482
2481
|
}),
|
|
2483
|
-
!
|
|
2482
|
+
!Ee && /* @__PURE__ */ L("input", {
|
|
2484
2483
|
ref: Rn,
|
|
2485
2484
|
type: "file",
|
|
2486
2485
|
multiple: !0,
|
|
@@ -2490,126 +2489,126 @@ var Z = {
|
|
|
2490
2489
|
tabIndex: -1,
|
|
2491
2490
|
onChange: nr
|
|
2492
2491
|
}),
|
|
2493
|
-
/* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ L(w, {
|
|
2494
2493
|
politeness: E.Assertive,
|
|
2495
2494
|
className: "min-w-0 px-1 wrap-break-word",
|
|
2496
|
-
children:
|
|
2495
|
+
children: Nn && /* @__PURE__ */ L(x, { text: Nn })
|
|
2497
2496
|
}),
|
|
2498
|
-
|
|
2497
|
+
Ln && /* @__PURE__ */ L(Dt, {
|
|
2499
2498
|
embedded: !0,
|
|
2500
|
-
state:
|
|
2501
|
-
analyserNodeRef:
|
|
2502
|
-
onStop:
|
|
2503
|
-
onDiscard:
|
|
2499
|
+
state: jn,
|
|
2500
|
+
analyserNodeRef: Mn,
|
|
2501
|
+
onStop: Fn,
|
|
2502
|
+
onDiscard: In,
|
|
2504
2503
|
attachButton: fr,
|
|
2505
|
-
stopLabel:
|
|
2506
|
-
discardLabel:
|
|
2507
|
-
processingLabel:
|
|
2504
|
+
stopLabel: P,
|
|
2505
|
+
discardLabel: oe,
|
|
2506
|
+
processingLabel: Be
|
|
2508
2507
|
}),
|
|
2509
|
-
|
|
2510
|
-
|
|
2508
|
+
!Ln && Oe && dr,
|
|
2509
|
+
!Ln && !Oe && pr && hr && /* @__PURE__ */ L("div", {
|
|
2511
2510
|
className: "flex",
|
|
2512
2511
|
children: hr
|
|
2513
2512
|
}),
|
|
2514
|
-
|
|
2515
|
-
className: l("flex items-center gap-2", pr ? "flex-nowrap" : "flex-wrap",
|
|
2513
|
+
!Ln && !Oe && /* @__PURE__ */ R("div", {
|
|
2514
|
+
className: l("flex items-center gap-2", pr ? "flex-nowrap" : "flex-wrap", W.actionRow),
|
|
2516
2515
|
children: [
|
|
2517
2516
|
pr && mr,
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
className: l("flex min-w-0 items-center self-stretch", pr ? "flex-1" : "w-full",
|
|
2517
|
+
/* @__PURE__ */ L("div", {
|
|
2518
|
+
className: l("flex min-w-0 items-center self-stretch", pr ? "flex-1" : "w-full", W.textareaWrap),
|
|
2520
2519
|
children: dr
|
|
2521
2520
|
}),
|
|
2522
2521
|
!pr && mr,
|
|
2523
2522
|
!pr && hr,
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
className: l("ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2526
|
-
children:
|
|
2523
|
+
/* @__PURE__ */ L("div", {
|
|
2524
|
+
className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
|
|
2525
|
+
children: je ? je({
|
|
2527
2526
|
canSend: Wn,
|
|
2528
2527
|
onSend: Qn
|
|
2529
|
-
}) : /* @__PURE__ */ I
|
|
2530
|
-
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
deployments:
|
|
2533
|
-
selectedDeploymentId:
|
|
2534
|
-
onDeploymentChange:
|
|
2535
|
-
modelSelectorLabels:
|
|
2536
|
-
menuStyles:
|
|
2528
|
+
}) : /* @__PURE__ */ R(I, { children: [
|
|
2529
|
+
jt,
|
|
2530
|
+
/* @__PURE__ */ L(on, {
|
|
2531
|
+
deployments: ye,
|
|
2532
|
+
selectedDeploymentId: Se,
|
|
2533
|
+
onDeploymentChange: Ce,
|
|
2534
|
+
modelSelectorLabels: we,
|
|
2535
|
+
menuStyles: le,
|
|
2537
2536
|
isStreaming: s,
|
|
2538
|
-
isMobile:
|
|
2539
|
-
isDisabled:
|
|
2540
|
-
style:
|
|
2541
|
-
modelPickerOverlay:
|
|
2542
|
-
isPickerOpen:
|
|
2543
|
-
onPickerToggle: () =>
|
|
2544
|
-
onPickerOpenChange:
|
|
2537
|
+
isMobile: Pt,
|
|
2538
|
+
isDisabled: Pe,
|
|
2539
|
+
style: Bt,
|
|
2540
|
+
modelPickerOverlay: Ct,
|
|
2541
|
+
isPickerOpen: Ft,
|
|
2542
|
+
onPickerToggle: () => It((e) => !e),
|
|
2543
|
+
onPickerOpenChange: It
|
|
2545
2544
|
}),
|
|
2546
|
-
Zn && /* @__PURE__ */
|
|
2547
|
-
icon: /* @__PURE__ */
|
|
2545
|
+
Zn && /* @__PURE__ */ L(S, {
|
|
2546
|
+
icon: /* @__PURE__ */ L(xe, {
|
|
2548
2547
|
size: _.LG,
|
|
2549
2548
|
stroke: v,
|
|
2550
2549
|
"aria-hidden": !0
|
|
2551
2550
|
}),
|
|
2552
|
-
"aria-label":
|
|
2553
|
-
tooltipProps: { tooltip:
|
|
2554
|
-
className: "
|
|
2555
|
-
onClick: () =>
|
|
2556
|
-
disabled:
|
|
2551
|
+
"aria-label": ie,
|
|
2552
|
+
tooltipProps: { tooltip: ie },
|
|
2553
|
+
className: "shrink-0",
|
|
2554
|
+
onClick: () => Pn(tt.Dictation),
|
|
2555
|
+
disabled: G || s
|
|
2557
2556
|
}),
|
|
2558
|
-
s && o ? /* @__PURE__ */
|
|
2557
|
+
s && o ? /* @__PURE__ */ L(kt, {
|
|
2559
2558
|
onStop: o,
|
|
2560
|
-
ariaLabel:
|
|
2561
|
-
}) : !s && /* @__PURE__ */
|
|
2559
|
+
ariaLabel: re
|
|
2560
|
+
}) : !s && /* @__PURE__ */ L(Ot, {
|
|
2562
2561
|
onSend: Qn,
|
|
2563
2562
|
isDisabled: !Xn || !Wn,
|
|
2564
|
-
ariaLabel:
|
|
2565
|
-
sendTooltip: Un ?
|
|
2563
|
+
ariaLabel: ee,
|
|
2564
|
+
sendTooltip: Un ? te : ne ?? te
|
|
2566
2565
|
})
|
|
2567
2566
|
] })
|
|
2568
2567
|
})
|
|
2569
2568
|
]
|
|
2570
2569
|
}),
|
|
2571
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ L(w, {
|
|
2572
2571
|
visuallyHidden: !0,
|
|
2573
2572
|
atomic: !0,
|
|
2574
2573
|
as: T.Span,
|
|
2575
|
-
children: /* @__PURE__ */
|
|
2574
|
+
children: /* @__PURE__ */ L("span", { children: kn.text }, kn.revision)
|
|
2576
2575
|
})
|
|
2577
2576
|
]
|
|
2578
2577
|
});
|
|
2579
2578
|
});
|
|
2580
|
-
|
|
2581
|
-
var
|
|
2579
|
+
sn.displayName = "Input";
|
|
2580
|
+
var cn = {
|
|
2582
2581
|
welcome: "_welcome_1icyo_1",
|
|
2583
2582
|
description: "_description_1icyo_5"
|
|
2584
|
-
},
|
|
2583
|
+
}, ln = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
|
|
2585
2584
|
let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
|
|
2586
2585
|
"--ci-welcome-color": p?.welcomeText,
|
|
2587
2586
|
"--ci-description-color": p?.descriptionText
|
|
2588
2587
|
});
|
|
2589
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ R("div", {
|
|
2590
2589
|
style: _,
|
|
2591
2590
|
className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
|
|
2592
2591
|
children: [
|
|
2593
|
-
n && /* @__PURE__ */
|
|
2594
|
-
className: "flex flex-col items-center gap-4 text-center",
|
|
2595
|
-
children: [/* @__PURE__ */
|
|
2596
|
-
className: l(
|
|
2592
|
+
n && /* @__PURE__ */ R("div", {
|
|
2593
|
+
className: "flex max-w-full flex-col items-center gap-4 text-center",
|
|
2594
|
+
children: [/* @__PURE__ */ L("h1", {
|
|
2595
|
+
className: l(cn.welcome, "m-0 max-w-full [overflow-wrap:anywhere]", m?.welcomeClassName || "dial-display2-text"),
|
|
2597
2596
|
children: n
|
|
2598
|
-
}), r && /* @__PURE__ */
|
|
2599
|
-
className: l(
|
|
2597
|
+
}), r && /* @__PURE__ */ L("p", {
|
|
2598
|
+
className: l(cn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2600
2599
|
children: r
|
|
2601
2600
|
})]
|
|
2602
2601
|
}),
|
|
2603
|
-
i != null && /* @__PURE__ */
|
|
2602
|
+
i != null && /* @__PURE__ */ L("div", {
|
|
2604
2603
|
className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
|
|
2605
2604
|
children: i
|
|
2606
2605
|
}),
|
|
2607
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ R("div", {
|
|
2608
2607
|
className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2609
|
-
children: [a != null && /* @__PURE__ */
|
|
2608
|
+
children: [a != null && /* @__PURE__ */ L("div", {
|
|
2610
2609
|
className: "mb-2",
|
|
2611
2610
|
children: a
|
|
2612
|
-
}), /* @__PURE__ */
|
|
2611
|
+
}), /* @__PURE__ */ L(sn, {
|
|
2613
2612
|
placeholder: t,
|
|
2614
2613
|
isStreaming: e,
|
|
2615
2614
|
isInputDisabled: d,
|
|
@@ -2623,36 +2622,36 @@ var ln = {
|
|
|
2623
2622
|
})
|
|
2624
2623
|
]
|
|
2625
2624
|
});
|
|
2626
|
-
},
|
|
2627
|
-
let
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
}, [
|
|
2631
|
-
let [
|
|
2632
|
-
|
|
2633
|
-
},
|
|
2634
|
-
m(e,
|
|
2635
|
-
}, [
|
|
2636
|
-
|
|
2637
|
-
},
|
|
2638
|
-
|
|
2639
|
-
}, [n]),
|
|
2625
|
+
}, un = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: p, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: y, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: k = "Close", className: A, pendingDropFiles: j, onDropFilesConsumed: M, validateAttachment: N, isAttachmentsEnabled: ee, isTextAttachmentsAllowed: ne, hideAttachFile: re = !1, fileAccept: ie, maximumAttachmentsAmount: ae, onAttachmentsLimitExceeded: P, onDialFileSystemClick: oe, dialFileSystemLabel: F, pendingAttachments: se, onPendingAttachmentsConsumed: ce, onAttachmentClick: le, pasteTextThreshold: ue, maxMessageLength: de = 5e4, onMessageTooLong: I }) => {
|
|
2626
|
+
let fe = H(null), pe = H(null), [me, he] = U([]);
|
|
2627
|
+
B(() => {
|
|
2628
|
+
j?.length && (he(j), M?.());
|
|
2629
|
+
}, [j, M]);
|
|
2630
|
+
let [ge, _e] = U(e ?? ""), [ve, ye] = U([]), [xe, Se] = U(d), Ce = ve.some((e) => e.status === a.Loading || e.status === a.Error), we = (ge.trim().length > 0 || ve.length > 0 || xe.length > 0) && !Ce, Te = (e) => {
|
|
2631
|
+
Se((t) => t.filter((t) => t.id !== e));
|
|
2632
|
+
}, Ee = z((e, t) => {
|
|
2633
|
+
m(e, xe, t);
|
|
2634
|
+
}, [xe, m]), De = () => {
|
|
2635
|
+
we && (ge.length >= de ? I?.(ge.length, de) : Ee(ge, ve));
|
|
2636
|
+
}, Oe = z(() => he([]), []), ke = z((e) => {
|
|
2637
|
+
_e(e), n?.(e);
|
|
2638
|
+
}, [n]), Ae = z((e) => {
|
|
2640
2639
|
let t = Array.from(e.target.files ?? []);
|
|
2641
|
-
t.length !== 0 && (e.target.value = "",
|
|
2642
|
-
}, []),
|
|
2640
|
+
t.length !== 0 && (e.target.value = "", he(t));
|
|
2641
|
+
}, []), je = V(() => oe ? [{
|
|
2643
2642
|
key: "dial-fs",
|
|
2644
|
-
label:
|
|
2645
|
-
icon: /* @__PURE__ */
|
|
2643
|
+
label: F ?? "DIAL file system",
|
|
2644
|
+
icon: /* @__PURE__ */ L(be, {
|
|
2646
2645
|
size: f,
|
|
2647
2646
|
"aria-hidden": !0,
|
|
2648
2647
|
stroke: v
|
|
2649
2648
|
}),
|
|
2650
|
-
onClick:
|
|
2651
|
-
}] : [], [
|
|
2652
|
-
return /* @__PURE__ */
|
|
2653
|
-
className: l("flex w-full flex-col gap-2",
|
|
2654
|
-
children: [/* @__PURE__ */
|
|
2655
|
-
ref:
|
|
2649
|
+
onClick: oe
|
|
2650
|
+
}] : [], [oe, F]);
|
|
2651
|
+
return /* @__PURE__ */ R("div", {
|
|
2652
|
+
className: l("flex w-full flex-col gap-2", A),
|
|
2653
|
+
children: [/* @__PURE__ */ L(sn, {
|
|
2654
|
+
ref: pe,
|
|
2656
2655
|
message: e,
|
|
2657
2656
|
messageRevision: t,
|
|
2658
2657
|
activeMentions: r,
|
|
@@ -2662,107 +2661,107 @@ var ln = {
|
|
|
2662
2661
|
ariaLabel: y,
|
|
2663
2662
|
hideActionBar: !0,
|
|
2664
2663
|
sendOnEnter: u,
|
|
2665
|
-
pendingDropFiles:
|
|
2666
|
-
onDropFilesConsumed:
|
|
2667
|
-
onSend:
|
|
2664
|
+
pendingDropFiles: me,
|
|
2665
|
+
onDropFilesConsumed: Oe,
|
|
2666
|
+
onSend: Ee,
|
|
2668
2667
|
onUploadAttachment: h,
|
|
2669
|
-
onChange:
|
|
2670
|
-
onAttachmentsChange:
|
|
2668
|
+
onChange: ke,
|
|
2669
|
+
onAttachmentsChange: ye,
|
|
2671
2670
|
removeLabel: b,
|
|
2672
2671
|
retryLabel: x,
|
|
2673
2672
|
uploadingLabel: S,
|
|
2674
2673
|
expandLabel: C,
|
|
2675
2674
|
clickLabel: w,
|
|
2676
2675
|
className: "max-w-full",
|
|
2677
|
-
prefixAttachments:
|
|
2678
|
-
onRemovePrefixAttachment:
|
|
2679
|
-
validateAttachment:
|
|
2680
|
-
isAttachmentsEnabled:
|
|
2681
|
-
isTextAttachmentsAllowed:
|
|
2682
|
-
maximumAttachmentsAmount:
|
|
2683
|
-
onAttachmentsLimitExceeded:
|
|
2684
|
-
pendingAttachments:
|
|
2685
|
-
onPendingAttachmentsConsumed:
|
|
2686
|
-
onAttachmentClick:
|
|
2687
|
-
pasteTextThreshold:
|
|
2688
|
-
maxMessageLength:
|
|
2689
|
-
onMessageTooLong:
|
|
2690
|
-
}), /* @__PURE__ */
|
|
2676
|
+
prefixAttachments: xe,
|
|
2677
|
+
onRemovePrefixAttachment: Te,
|
|
2678
|
+
validateAttachment: N,
|
|
2679
|
+
isAttachmentsEnabled: ee,
|
|
2680
|
+
isTextAttachmentsAllowed: ne,
|
|
2681
|
+
maximumAttachmentsAmount: ae,
|
|
2682
|
+
onAttachmentsLimitExceeded: P,
|
|
2683
|
+
pendingAttachments: se,
|
|
2684
|
+
onPendingAttachmentsConsumed: ce,
|
|
2685
|
+
onAttachmentClick: le,
|
|
2686
|
+
pasteTextThreshold: ue,
|
|
2687
|
+
maxMessageLength: de,
|
|
2688
|
+
onMessageTooLong: I
|
|
2689
|
+
}), /* @__PURE__ */ R("div", {
|
|
2691
2690
|
className: "flex items-center justify-between",
|
|
2692
|
-
children: [/* @__PURE__ */
|
|
2691
|
+
children: [/* @__PURE__ */ R("div", {
|
|
2693
2692
|
className: "flex",
|
|
2694
|
-
children: [!
|
|
2695
|
-
ref:
|
|
2693
|
+
children: [!re && /* @__PURE__ */ L("input", {
|
|
2694
|
+
ref: fe,
|
|
2696
2695
|
type: "file",
|
|
2697
2696
|
multiple: !0,
|
|
2698
|
-
accept:
|
|
2697
|
+
accept: ie,
|
|
2699
2698
|
className: "sr-only",
|
|
2700
2699
|
"aria-hidden": !0,
|
|
2701
2700
|
tabIndex: -1,
|
|
2702
|
-
onChange:
|
|
2703
|
-
}), (!
|
|
2704
|
-
onAttachClick:
|
|
2701
|
+
onChange: Ae
|
|
2702
|
+
}), (!re || (c?.length ?? 0) > 0) && /* @__PURE__ */ L(yt, {
|
|
2703
|
+
onAttachClick: re ? void 0 : () => fe.current?.click(),
|
|
2705
2704
|
attachLabel: E,
|
|
2706
2705
|
addMenuTitle: T,
|
|
2707
2706
|
menuTitle: D,
|
|
2708
|
-
menuCloseLabel:
|
|
2709
|
-
extraMenuItems:
|
|
2707
|
+
menuCloseLabel: k,
|
|
2708
|
+
extraMenuItems: je,
|
|
2710
2709
|
menuOverlays: c,
|
|
2711
|
-
getCaretPosition: () =>
|
|
2710
|
+
getCaretPosition: () => pe.current?.getCaretPosition() ?? 0
|
|
2712
2711
|
})]
|
|
2713
|
-
}), /* @__PURE__ */
|
|
2712
|
+
}), /* @__PURE__ */ R("div", {
|
|
2714
2713
|
className: "flex gap-2",
|
|
2715
|
-
children: [/* @__PURE__ */
|
|
2714
|
+
children: [/* @__PURE__ */ L(O, {
|
|
2716
2715
|
label: g,
|
|
2717
2716
|
onClick: p
|
|
2718
|
-
}), /* @__PURE__ */
|
|
2717
|
+
}), /* @__PURE__ */ L(te, {
|
|
2719
2718
|
label: _,
|
|
2720
|
-
onClick:
|
|
2721
|
-
disabled: !
|
|
2719
|
+
onClick: De,
|
|
2720
|
+
disabled: !we
|
|
2722
2721
|
})]
|
|
2723
2722
|
})]
|
|
2724
2723
|
})]
|
|
2725
2724
|
});
|
|
2726
|
-
},
|
|
2725
|
+
}, $ = /* @__PURE__ */ function(e) {
|
|
2727
2726
|
return e.Warning = "warning", e.Reached = "reached", e;
|
|
2728
|
-
}({}),
|
|
2729
|
-
[
|
|
2730
|
-
[
|
|
2731
|
-
},
|
|
2732
|
-
let c = /* @__PURE__ */
|
|
2727
|
+
}({}), dn = {
|
|
2728
|
+
[$.Warning]: M.Warning,
|
|
2729
|
+
[$.Reached]: M.Error
|
|
2730
|
+
}, fn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s }) => {
|
|
2731
|
+
let c = /* @__PURE__ */ L("span", {
|
|
2733
2732
|
className: a,
|
|
2734
2733
|
children: t
|
|
2735
|
-
}), u = n != null && /* @__PURE__ */ I
|
|
2734
|
+
}), u = n != null && /* @__PURE__ */ R(I, { children: [
|
|
2736
2735
|
" ",
|
|
2737
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ L("time", {
|
|
2738
2737
|
dateTime: n.isoValue,
|
|
2739
2738
|
"aria-hidden": n.ariaLabel != null || void 0,
|
|
2740
2739
|
className: o,
|
|
2741
2740
|
children: n.label
|
|
2742
2741
|
}),
|
|
2743
|
-
n.ariaLabel != null && /* @__PURE__ */
|
|
2742
|
+
n.ariaLabel != null && /* @__PURE__ */ L("span", {
|
|
2744
2743
|
className: "sr-only",
|
|
2745
2744
|
children: n.ariaLabel
|
|
2746
2745
|
})
|
|
2747
2746
|
] });
|
|
2748
|
-
return /* @__PURE__ */
|
|
2747
|
+
return /* @__PURE__ */ L(A, {
|
|
2749
2748
|
role: "status",
|
|
2750
|
-
variant:
|
|
2751
|
-
type:
|
|
2749
|
+
variant: dn[e],
|
|
2750
|
+
type: j.SectionMessage,
|
|
2752
2751
|
title: u ? c : void 0,
|
|
2753
2752
|
message: u || c,
|
|
2754
|
-
className: l("bg-layer-sunken",
|
|
2755
|
-
children: r != null && /* @__PURE__ */
|
|
2753
|
+
className: l("bg-layer-sunken", W.usageBanner, s),
|
|
2754
|
+
children: r != null && /* @__PURE__ */ L(g, {
|
|
2756
2755
|
className: "shrink-0 self-start",
|
|
2757
2756
|
ariaLabel: i,
|
|
2758
2757
|
onClose: () => r()
|
|
2759
2758
|
})
|
|
2760
2759
|
});
|
|
2761
|
-
},
|
|
2762
|
-
let [t, n] =
|
|
2760
|
+
}, pn = (e) => {
|
|
2761
|
+
let [t, n] = U({
|
|
2763
2762
|
text: e?.text,
|
|
2764
2763
|
revision: e?.revision ?? 0
|
|
2765
|
-
}), r =
|
|
2764
|
+
}), r = z((e) => {
|
|
2766
2765
|
n((t) => ({
|
|
2767
2766
|
text: e,
|
|
2768
2767
|
revision: t.revision + 1
|
|
@@ -2773,11 +2772,11 @@ var ln = {
|
|
|
2773
2772
|
messageRevision: t.revision,
|
|
2774
2773
|
seedMessage: r
|
|
2775
2774
|
};
|
|
2776
|
-
},
|
|
2777
|
-
let n =
|
|
2778
|
-
r.current = t,
|
|
2775
|
+
}, mn = (e, t) => {
|
|
2776
|
+
let n = H(e), r = H(t);
|
|
2777
|
+
r.current = t, B(() => {
|
|
2779
2778
|
e !== n.current && (n.current = e, r.current());
|
|
2780
2779
|
}, [e]);
|
|
2781
2780
|
};
|
|
2782
2781
|
//#endregion
|
|
2783
|
-
export {
|
|
2782
|
+
export { ct as ActionRowLayout, Pe as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, ht as ChatSettingsModal, ln as ConversationInput, un as EditMessageInput, sn as Input, st as SendOnEnter, $ as UsageLimitBannerSeverity, fn as UsageLimitBannerView, pn as useComposerSeed, mn as useComposerSeedSource };
|