@epam/ai-dial-conversation-input 1.2.0-dev.225 → 1.2.0-dev.231
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,12 +1,12 @@
|
|
|
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, Button as p,
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createElement as ve, forwardRef as ye, memo as be, useCallback as
|
|
2
|
+
import { BASE_ICON_SIZE as f, Button as p, ButtonVariant as m, CloseButton as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as y, ErrorText as b, GhostIconButton as x, Highlight as S, MenuItemMark as C, NeutralButton as w, Popup as T, PopupSize as E, PrimaryButton as D, PrimaryIconButton as O, RadioGroup as k, RadioGroupOrientation as A, Search as j, Skeleton as M, SkeletonVariant as ee, Slider as N, Spinner as te, StaticIconButton as ne, Textarea as P, TextareaResize as F, Tooltip as re } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as oe, IconChevronDown as se, IconChevronRight as ce, IconFile as le, IconMicrophone as ue, IconPaperclip as de, IconPlayerStopFilled as fe, IconPlaystationSquare as pe, IconPlus as me, IconSettings as he, IconTool as ge, IconX as _e } from "@tabler/icons-react";
|
|
4
|
+
import { createElement as ve, forwardRef as ye, memo as be, useCallback as I, useEffect as L, useId as xe, useImperativeHandle as Se, useLayoutEffect as Ce, useMemo as R, useRef as z, useState as B } from "react";
|
|
5
5
|
import { createPortal as we } from "react-dom";
|
|
6
|
-
import { Fragment as
|
|
6
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
7
7
|
import { AttachmentTray as Te, MAX_UPLOADS_PER_MINUTE as Ee, generateAttachmentId as De, useClipboardPaste as Oe } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var W = {
|
|
10
10
|
wrapper: "dial-ci-wrapper",
|
|
11
11
|
actionRow: "dial-ci-action-row",
|
|
12
12
|
textareaWrap: "dial-ci-textarea-wrap",
|
|
@@ -21,17 +21,17 @@ var U = {
|
|
|
21
21
|
modelMenuItem: "dial-ci-model-menu-item",
|
|
22
22
|
modelMenuItemSelected: "dial-ci-model-menu-item-selected"
|
|
23
23
|
}, ke = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ae = (e, t, n) => {
|
|
24
|
-
|
|
24
|
+
L(() => {
|
|
25
25
|
if (!e) return;
|
|
26
26
|
let n = (e) => {
|
|
27
27
|
e.key === "Escape" && t();
|
|
28
28
|
};
|
|
29
29
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
30
|
-
}, [e, t]),
|
|
30
|
+
}, [e, t]), L(() => {
|
|
31
31
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
32
32
|
document.body.style.overflow = "";
|
|
33
33
|
};
|
|
34
|
-
}, [e]),
|
|
34
|
+
}, [e]), L(() => {
|
|
35
35
|
if (!e || n?.current == null) return;
|
|
36
36
|
let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
37
37
|
(t.querySelector(ke) ?? t).focus();
|
|
@@ -56,59 +56,59 @@ var U = {
|
|
|
56
56
|
title: "_title_1d50f_18",
|
|
57
57
|
divider: "_divider_1d50f_22"
|
|
58
58
|
}, Me = ({ 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, children: p }) => {
|
|
59
|
-
let
|
|
60
|
-
if (Ae(e, r,
|
|
61
|
-
let
|
|
59
|
+
let m = z(null);
|
|
60
|
+
if (Ae(e, r, m), !e || typeof document > "u") return null;
|
|
61
|
+
let v = c({
|
|
62
62
|
"--ci-backdrop": f?.backdrop,
|
|
63
63
|
"--ci-sheet-bg": f?.sheetBg,
|
|
64
64
|
"--ci-sheet-text": f?.sheetText,
|
|
65
65
|
"--ci-sheet-divider": f?.divider
|
|
66
66
|
});
|
|
67
|
-
return we(/* @__PURE__ */
|
|
67
|
+
return we(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
68
68
|
className: l(je.backdrop, "fixed inset-0 z-[55]"),
|
|
69
|
-
style:
|
|
69
|
+
style: v,
|
|
70
70
|
onPointerDown: r,
|
|
71
71
|
"aria-hidden": !0
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
-
ref:
|
|
72
|
+
}), /* @__PURE__ */ U("div", {
|
|
73
|
+
ref: m,
|
|
74
74
|
role: "dialog",
|
|
75
75
|
"aria-modal": !0,
|
|
76
76
|
"aria-label": t ?? o,
|
|
77
77
|
tabIndex: -1,
|
|
78
78
|
style: {
|
|
79
|
-
...
|
|
79
|
+
...v,
|
|
80
80
|
...s
|
|
81
81
|
},
|
|
82
82
|
className: l(je.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
|
|
83
|
-
children: [t != null && /* @__PURE__ */
|
|
83
|
+
children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
84
84
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
85
85
|
children: [
|
|
86
|
-
i && /* @__PURE__ */
|
|
86
|
+
i && /* @__PURE__ */ H("div", {
|
|
87
87
|
className: "absolute start-4",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
icon: /* @__PURE__ */
|
|
90
|
-
size:
|
|
91
|
-
stroke:
|
|
88
|
+
children: /* @__PURE__ */ H(x, {
|
|
89
|
+
icon: /* @__PURE__ */ H(ie, {
|
|
90
|
+
size: g.LG,
|
|
91
|
+
stroke: _,
|
|
92
92
|
className: "rtl:scale-x-[-1]"
|
|
93
93
|
}),
|
|
94
94
|
"aria-label": a,
|
|
95
95
|
onClick: i
|
|
96
96
|
})
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ H("span", {
|
|
99
99
|
className: l(je.title, u),
|
|
100
100
|
children: t
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ H("div", {
|
|
103
103
|
className: "absolute end-4 m-2",
|
|
104
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ H(h, {
|
|
105
105
|
ariaLabel: n,
|
|
106
106
|
onClose: r,
|
|
107
|
-
size:
|
|
107
|
+
size: y.Standard
|
|
108
108
|
})
|
|
109
109
|
})
|
|
110
110
|
]
|
|
111
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ H("div", { className: l(je.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ H("div", {
|
|
112
112
|
className: "overflow-y-auto",
|
|
113
113
|
children: p
|
|
114
114
|
})]
|
|
@@ -118,15 +118,15 @@ var U = {
|
|
|
118
118
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
119
119
|
await Promise.allSettled(i);
|
|
120
120
|
}, Pe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
121
|
-
let [h, g] =
|
|
122
|
-
|
|
121
|
+
let [h, g] = B(n), _ = z(h);
|
|
122
|
+
L(() => {
|
|
123
123
|
_.current = h;
|
|
124
|
-
}, [h]),
|
|
124
|
+
}, [h]), L(() => () => {
|
|
125
125
|
_.current.forEach((e) => {
|
|
126
126
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
127
127
|
});
|
|
128
128
|
}, []);
|
|
129
|
-
let v =
|
|
129
|
+
let v = I((e) => e.map((e) => {
|
|
130
130
|
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;
|
|
131
131
|
return {
|
|
132
132
|
id: De(),
|
|
@@ -138,26 +138,26 @@ var U = {
|
|
|
138
138
|
previewUrl: i,
|
|
139
139
|
playUrl: o
|
|
140
140
|
};
|
|
141
|
-
}), []), y =
|
|
142
|
-
|
|
141
|
+
}), []), y = z(i);
|
|
142
|
+
L(() => {
|
|
143
143
|
y.current = i;
|
|
144
144
|
}, [i]);
|
|
145
|
-
let b =
|
|
145
|
+
let b = z(!0), x = I((e) => {
|
|
146
146
|
g((t) => {
|
|
147
147
|
let n = e(t);
|
|
148
148
|
return n === t ? t : n;
|
|
149
149
|
});
|
|
150
150
|
}, []);
|
|
151
|
-
|
|
151
|
+
L(() => {
|
|
152
152
|
if (b.current) {
|
|
153
153
|
b.current = !1;
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
y.current?.(h);
|
|
157
157
|
}, [h]);
|
|
158
|
-
let S =
|
|
158
|
+
let S = I((e) => {
|
|
159
159
|
g(e);
|
|
160
|
-
}, []), C =
|
|
160
|
+
}, []), C = I(async (t) => {
|
|
161
161
|
if (r) {
|
|
162
162
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
163
163
|
...e,
|
|
@@ -180,7 +180,7 @@ var U = {
|
|
|
180
180
|
} : e));
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
}, [r, x]), w =
|
|
183
|
+
}, [r, x]), w = I((e, t = !0) => {
|
|
184
184
|
let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
185
185
|
if (r.length !== 0) {
|
|
186
186
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -211,8 +211,8 @@ var U = {
|
|
|
211
211
|
x,
|
|
212
212
|
C,
|
|
213
213
|
o
|
|
214
|
-
]), T =
|
|
215
|
-
|
|
214
|
+
]), T = z(/* @__PURE__ */ new WeakSet());
|
|
215
|
+
L(() => {
|
|
216
216
|
if (s.length === 0) {
|
|
217
217
|
T.current = /* @__PURE__ */ new WeakSet();
|
|
218
218
|
return;
|
|
@@ -224,13 +224,13 @@ var U = {
|
|
|
224
224
|
v,
|
|
225
225
|
c,
|
|
226
226
|
s
|
|
227
|
-
]),
|
|
227
|
+
]), L(() => {
|
|
228
228
|
l.length !== 0 && (w(l, !1), u?.());
|
|
229
229
|
}, [
|
|
230
230
|
w,
|
|
231
231
|
u,
|
|
232
232
|
l
|
|
233
|
-
]),
|
|
233
|
+
]), L(() => {
|
|
234
234
|
if (!o) return;
|
|
235
235
|
let t = !1, n = [], r = _.current.map((r) => {
|
|
236
236
|
if (r.status === a.Loading) return r;
|
|
@@ -257,7 +257,7 @@ var U = {
|
|
|
257
257
|
x,
|
|
258
258
|
C
|
|
259
259
|
]);
|
|
260
|
-
let E =
|
|
260
|
+
let E = I((e) => {
|
|
261
261
|
x((t) => {
|
|
262
262
|
let n = t.find((t) => t.id === e);
|
|
263
263
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -269,11 +269,11 @@ var U = {
|
|
|
269
269
|
addAttachments: w,
|
|
270
270
|
resetAttachments: S,
|
|
271
271
|
handleRemove: E,
|
|
272
|
-
handleRetry:
|
|
272
|
+
handleRetry: I((e) => {
|
|
273
273
|
let t = h.find((t) => t.id === e);
|
|
274
274
|
t && C(t);
|
|
275
275
|
}, [h, C]),
|
|
276
|
-
handleExpand:
|
|
276
|
+
handleExpand: I(async (e) => {
|
|
277
277
|
let n = h.find((t) => t.id === e);
|
|
278
278
|
if (!n || n.type !== t.Pasted) return;
|
|
279
279
|
let r = await n.file.text();
|
|
@@ -299,12 +299,12 @@ var U = {
|
|
|
299
299
|
}, Le = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Re = "[role=\"option\"]:not([aria-disabled=\"true\"])", ze = /* @__PURE__ */ function(e) {
|
|
300
300
|
return e.Next = "next", e.Previous = "previous", e;
|
|
301
301
|
}({}), Be = ({ config: e, message: t }) => {
|
|
302
|
-
let [n, r] =
|
|
302
|
+
let [n, r] = B(!1), [i, a] = B(null), [o, s] = B(null), c = z(null);
|
|
303
303
|
c.current = i;
|
|
304
304
|
let l = e != null && i != null && i <= t.length ? (() => {
|
|
305
305
|
let n = t.slice(i, Fe(t, i));
|
|
306
306
|
return Le(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
|
|
307
|
-
})() : "", u =
|
|
307
|
+
})() : "", u = I((t, n, i) => {
|
|
308
308
|
if (e == null || i) return;
|
|
309
309
|
let { start: c, end: l } = Ie(t, n), u = t.slice(c, l);
|
|
310
310
|
if (!Le(u, e.triggerPrefix)) {
|
|
@@ -317,7 +317,7 @@ var U = {
|
|
|
317
317
|
}
|
|
318
318
|
r(!1);
|
|
319
319
|
}, [e, o]);
|
|
320
|
-
|
|
320
|
+
L(() => {
|
|
321
321
|
if (e == null) {
|
|
322
322
|
r(!1), s(null), a(null);
|
|
323
323
|
return;
|
|
@@ -327,11 +327,11 @@ var U = {
|
|
|
327
327
|
let i = Math.min(n, t.length);
|
|
328
328
|
Le(t.slice(i, Fe(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
|
|
329
329
|
}, [e, t]);
|
|
330
|
-
let d =
|
|
330
|
+
let d = I(() => {
|
|
331
331
|
r(!1), s(i);
|
|
332
|
-
}, [i]), f =
|
|
332
|
+
}, [i]), f = I(() => {
|
|
333
333
|
r(!1);
|
|
334
|
-
}, []), p =
|
|
334
|
+
}, []), p = I((n) => {
|
|
335
335
|
if (e == null) return;
|
|
336
336
|
let { start: i, end: s } = Ie(t, n);
|
|
337
337
|
if (!Le(t.slice(i, s), e.triggerPrefix)) {
|
|
@@ -343,11 +343,11 @@ var U = {
|
|
|
343
343
|
e,
|
|
344
344
|
t,
|
|
345
345
|
o
|
|
346
|
-
]), m = xe(), h =
|
|
347
|
-
|
|
346
|
+
]), m = xe(), h = z(null), [g, _] = B(null);
|
|
347
|
+
L(() => {
|
|
348
348
|
_(null);
|
|
349
349
|
}, [n, l]);
|
|
350
|
-
let v =
|
|
350
|
+
let v = I(() => Array.from(h.current?.querySelectorAll(Re) ?? []), []), y = I((e) => {
|
|
351
351
|
let t = v();
|
|
352
352
|
if (t.length === 0) {
|
|
353
353
|
_(null);
|
|
@@ -355,7 +355,7 @@ var U = {
|
|
|
355
355
|
}
|
|
356
356
|
let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
|
|
357
357
|
_(r.id), r.scrollIntoView?.({ block: "nearest" });
|
|
358
|
-
}, [v, g]), b =
|
|
358
|
+
}, [v, g]), b = I(() => v().find((e) => e.id === g) ?? null, [v, g]);
|
|
359
359
|
return {
|
|
360
360
|
isMenuOpen: n,
|
|
361
361
|
query: l,
|
|
@@ -371,17 +371,17 @@ var U = {
|
|
|
371
371
|
getActiveOption: b
|
|
372
372
|
};
|
|
373
373
|
}, Ve = (e, t) => !e.slice(0, t).includes("\n"), He = (e, t) => !e.slice(t).includes("\n"), Ue = (e) => {
|
|
374
|
-
let t =
|
|
374
|
+
let t = z(e);
|
|
375
375
|
t.current = e;
|
|
376
|
-
let n =
|
|
376
|
+
let n = z(-1), r = z(""), i = I((e, i, a) => {
|
|
377
377
|
let o = t.current;
|
|
378
378
|
return !o || o.length === 0 ? null : e === "up" ? !Ve(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 || !He(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
379
|
-
}, []), a =
|
|
379
|
+
}, []), a = I(() => {
|
|
380
380
|
n.current = -1, r.current = "";
|
|
381
|
-
}, []), o =
|
|
381
|
+
}, []), o = I(() => {
|
|
382
382
|
n.current = -1, r.current = "";
|
|
383
383
|
}, []);
|
|
384
|
-
return
|
|
384
|
+
return R(() => ({
|
|
385
385
|
navigate: i,
|
|
386
386
|
notifyChange: a,
|
|
387
387
|
reset: o
|
|
@@ -395,11 +395,11 @@ var U = {
|
|
|
395
395
|
if (n <= t) return;
|
|
396
396
|
let r = t;
|
|
397
397
|
o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
|
|
398
|
-
t.offset > r && s.push(/* @__PURE__ */
|
|
398
|
+
t.offset > r && s.push(/* @__PURE__ */ H("span", {
|
|
399
399
|
"aria-hidden": !0,
|
|
400
400
|
children: e.slice(r, t.offset)
|
|
401
401
|
}, `text-${l++}`)), s.push(t.node), r = t.offset;
|
|
402
|
-
}), r < n && s.push(/* @__PURE__ */
|
|
402
|
+
}), r < n && s.push(/* @__PURE__ */ H("span", {
|
|
403
403
|
"aria-hidden": !0,
|
|
404
404
|
children: e.slice(r, n)
|
|
405
405
|
}, `text-${l++}`));
|
|
@@ -407,10 +407,10 @@ var U = {
|
|
|
407
407
|
return a.forEach((t, n) => {
|
|
408
408
|
if (u(c, t.start), t.start + t.length <= c) return;
|
|
409
409
|
let a = e.slice(t.start, t.start + t.length);
|
|
410
|
-
s.push(t.render ? /* @__PURE__ */
|
|
410
|
+
s.push(t.render ? /* @__PURE__ */ H("span", {
|
|
411
411
|
className: "pointer-events-auto",
|
|
412
412
|
children: t.render()
|
|
413
|
-
}, `range-${n}`) : /* @__PURE__ */
|
|
413
|
+
}, `range-${n}`) : /* @__PURE__ */ H("span", {
|
|
414
414
|
"aria-hidden": !0,
|
|
415
415
|
className: t.isUnsupported ? i : r,
|
|
416
416
|
children: a
|
|
@@ -433,7 +433,7 @@ var U = {
|
|
|
433
433
|
let a = document.createRange();
|
|
434
434
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
435
435
|
}, qe = ({ textareaRef: e, message: t, hasActiveMentions: n }) => {
|
|
436
|
-
let r =
|
|
436
|
+
let r = z(null), [i, a] = B([]), o = I(() => {
|
|
437
437
|
let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
|
|
438
438
|
if (!n || t == null || i == null || o == null || s == null || o === s) {
|
|
439
439
|
a((e) => e.length === 0 ? e : []);
|
|
@@ -449,7 +449,7 @@ var U = {
|
|
|
449
449
|
}, [n, e]);
|
|
450
450
|
return Ce(() => {
|
|
451
451
|
o();
|
|
452
|
-
}, [o, t]),
|
|
452
|
+
}, [o, t]), L(() => {
|
|
453
453
|
if (!n) return;
|
|
454
454
|
let t = e.current;
|
|
455
455
|
if (t == null || typeof ResizeObserver > "u") return;
|
|
@@ -465,8 +465,8 @@ var U = {
|
|
|
465
465
|
updateSelectionRects: o
|
|
466
466
|
};
|
|
467
467
|
}, Je = ({ messageProp: e, messageRevision: t }) => {
|
|
468
|
-
let [n, r] =
|
|
469
|
-
return
|
|
468
|
+
let [n, r] = B(e), i = z(null);
|
|
469
|
+
return L(() => {
|
|
470
470
|
r(e);
|
|
471
471
|
}, [e, t]), {
|
|
472
472
|
message: n,
|
|
@@ -477,10 +477,10 @@ var U = {
|
|
|
477
477
|
let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
478
478
|
i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
479
479
|
}, Xe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ze = ({ insertion: e, textareaRef: t }) => {
|
|
480
|
-
let n = e?.revision, r =
|
|
480
|
+
let n = e?.revision, r = z(e?.text);
|
|
481
481
|
r.current = e?.text;
|
|
482
|
-
let i =
|
|
483
|
-
return
|
|
482
|
+
let i = z(n), a = z(null);
|
|
483
|
+
return L(() => {
|
|
484
484
|
if (n === i.current) return;
|
|
485
485
|
i.current = n;
|
|
486
486
|
let e = r.current;
|
|
@@ -510,7 +510,7 @@ var U = {
|
|
|
510
510
|
"audio/ogg;codecs=opus",
|
|
511
511
|
"audio/webm"
|
|
512
512
|
], tt = 100, nt = 100, rt = .01, it = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
|
|
513
|
-
let [a, o] =
|
|
513
|
+
let [a, o] = B("idle"), [s, c] = B(null), l = z(null), d = z(null), f = z({
|
|
514
514
|
onAttachAudio: e,
|
|
515
515
|
onTranscribeAudio: t,
|
|
516
516
|
onTranscript: n,
|
|
@@ -522,7 +522,7 @@ var U = {
|
|
|
522
522
|
onTranscript: n,
|
|
523
523
|
errorLabel: i
|
|
524
524
|
};
|
|
525
|
-
let p =
|
|
525
|
+
let p = I((e = "dictation") => {
|
|
526
526
|
if (d.current) return;
|
|
527
527
|
let t = { controller: new AbortController() };
|
|
528
528
|
d.current = t, c(null), o("recording");
|
|
@@ -593,10 +593,10 @@ var U = {
|
|
|
593
593
|
x(e);
|
|
594
594
|
}
|
|
595
595
|
})();
|
|
596
|
-
}, []), m =
|
|
596
|
+
}, []), m = I(() => d.current?.stop?.(), []), h = I(() => {
|
|
597
597
|
d.current?.controller.abort(), d.current = null, c(null), o("idle");
|
|
598
598
|
}, []);
|
|
599
|
-
return
|
|
599
|
+
return L(() => () => {
|
|
600
600
|
d.current?.controller.abort(), d.current = null;
|
|
601
601
|
}, []), {
|
|
602
602
|
state: a,
|
|
@@ -622,7 +622,7 @@ var U = {
|
|
|
622
622
|
"--ci-sheet-item-active": f?.itemActiveBg,
|
|
623
623
|
"--ci-sheet-icon": f?.itemIcon
|
|
624
624
|
});
|
|
625
|
-
return /* @__PURE__ */
|
|
625
|
+
return /* @__PURE__ */ H(Me, {
|
|
626
626
|
isOpen: e,
|
|
627
627
|
title: t,
|
|
628
628
|
closeLabel: n,
|
|
@@ -631,23 +631,23 @@ var U = {
|
|
|
631
631
|
className: o,
|
|
632
632
|
titleClassName: s,
|
|
633
633
|
colors: f?.shell,
|
|
634
|
-
children: /* @__PURE__ */
|
|
634
|
+
children: /* @__PURE__ */ H("ul", {
|
|
635
635
|
role: "list",
|
|
636
636
|
className: "flex flex-col",
|
|
637
637
|
style: h,
|
|
638
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
638
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(p, {
|
|
639
639
|
type: "button",
|
|
640
640
|
className: l(st.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
641
|
-
iconBefore: /* @__PURE__ */
|
|
641
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
642
642
|
className: st.itemIcon,
|
|
643
643
|
children: n
|
|
644
644
|
}),
|
|
645
|
-
iconAfter: r ? /* @__PURE__ */
|
|
645
|
+
iconAfter: r ? /* @__PURE__ */ H("span", {
|
|
646
646
|
className: "ms-auto",
|
|
647
647
|
children: r
|
|
648
648
|
}) : null,
|
|
649
649
|
textClassName: d,
|
|
650
|
-
label: /* @__PURE__ */
|
|
650
|
+
label: /* @__PURE__ */ H("span", {
|
|
651
651
|
className: u,
|
|
652
652
|
children: t
|
|
653
653
|
}),
|
|
@@ -656,8 +656,8 @@ var U = {
|
|
|
656
656
|
})
|
|
657
657
|
});
|
|
658
658
|
}, lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
659
|
-
let [s, c] =
|
|
660
|
-
|
|
659
|
+
let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
|
|
660
|
+
L(() => {
|
|
661
661
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
662
662
|
}, [
|
|
663
663
|
o,
|
|
@@ -674,7 +674,7 @@ var U = {
|
|
|
674
674
|
setResponseFormat: c,
|
|
675
675
|
setSystemPrompt: u,
|
|
676
676
|
setTemperature: f,
|
|
677
|
-
handleSubmit:
|
|
677
|
+
handleSubmit: I(() => {
|
|
678
678
|
if (!m) return;
|
|
679
679
|
let t = {};
|
|
680
680
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -688,17 +688,17 @@ var U = {
|
|
|
688
688
|
a
|
|
689
689
|
])
|
|
690
690
|
};
|
|
691
|
-
}, ut = { label: "_label_14i7c_1" },
|
|
691
|
+
}, ut = { label: "_label_14i7c_1" }, G = ({ 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 = [
|
|
692
692
|
"Precise",
|
|
693
693
|
"Neutral",
|
|
694
694
|
"Creative"
|
|
695
695
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
696
696
|
let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ut.label, "gap-1");
|
|
697
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ U("div", {
|
|
698
698
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
699
699
|
style: S,
|
|
700
700
|
children: [
|
|
701
|
-
e.responseFormat && /* @__PURE__ */
|
|
701
|
+
e.responseFormat && /* @__PURE__ */ H(k, {
|
|
702
702
|
id: "response-format",
|
|
703
703
|
labelProps: {
|
|
704
704
|
label: d,
|
|
@@ -706,7 +706,7 @@ var U = {
|
|
|
706
706
|
caption: f
|
|
707
707
|
},
|
|
708
708
|
optionsClassName: "mb-2",
|
|
709
|
-
orientation:
|
|
709
|
+
orientation: A.Column,
|
|
710
710
|
value: t ?? o.Markdown,
|
|
711
711
|
items: [{
|
|
712
712
|
value: o.Markdown,
|
|
@@ -717,18 +717,18 @@ var U = {
|
|
|
717
717
|
}],
|
|
718
718
|
onChange: (e) => a(e)
|
|
719
719
|
}),
|
|
720
|
-
e.systemPrompt && /* @__PURE__ */
|
|
720
|
+
e.systemPrompt && /* @__PURE__ */ H(P, {
|
|
721
721
|
value: n,
|
|
722
722
|
placeholder: g,
|
|
723
723
|
className: i,
|
|
724
|
-
resize:
|
|
724
|
+
resize: F.Vertical,
|
|
725
725
|
labelProps: {
|
|
726
726
|
className: C,
|
|
727
727
|
label: h
|
|
728
728
|
},
|
|
729
729
|
onChange: (e) => s(e ?? "")
|
|
730
730
|
}),
|
|
731
|
-
e.temperature && /* @__PURE__ */
|
|
731
|
+
e.temperature && /* @__PURE__ */ H(N, {
|
|
732
732
|
labelProps: {
|
|
733
733
|
label: _,
|
|
734
734
|
className: C,
|
|
@@ -744,8 +744,8 @@ var U = {
|
|
|
744
744
|
})
|
|
745
745
|
]
|
|
746
746
|
});
|
|
747
|
-
},
|
|
748
|
-
let { responseFormat: w, systemPrompt: T, temperature:
|
|
747
|
+
}, dt = ({ 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 }) => {
|
|
748
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: j, handleSubmit: M } = lt({
|
|
749
749
|
isOpen: e,
|
|
750
750
|
features: o,
|
|
751
751
|
initialResponseFormat: s,
|
|
@@ -754,7 +754,7 @@ var U = {
|
|
|
754
754
|
onSave: d,
|
|
755
755
|
onClose: r
|
|
756
756
|
});
|
|
757
|
-
return /* @__PURE__ */
|
|
757
|
+
return /* @__PURE__ */ U(Me, {
|
|
758
758
|
isOpen: e,
|
|
759
759
|
title: f,
|
|
760
760
|
closeLabel: i,
|
|
@@ -762,14 +762,14 @@ var U = {
|
|
|
762
762
|
onBack: t,
|
|
763
763
|
backLabel: n,
|
|
764
764
|
style: a,
|
|
765
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ H(G, {
|
|
766
766
|
features: o,
|
|
767
767
|
responseFormat: w,
|
|
768
768
|
systemPrompt: T,
|
|
769
|
-
temperature:
|
|
769
|
+
temperature: E,
|
|
770
770
|
onResponseFormatChange: k,
|
|
771
771
|
onSystemPromptChange: A,
|
|
772
|
-
onTemperatureChange:
|
|
772
|
+
onTemperatureChange: j,
|
|
773
773
|
responseFormatLabel: p,
|
|
774
774
|
responseFormatHint: m,
|
|
775
775
|
responseFormatMarkdownLabel: h,
|
|
@@ -779,23 +779,23 @@ var U = {
|
|
|
779
779
|
temperatureLabel: y,
|
|
780
780
|
temperatureLabels: b,
|
|
781
781
|
temperatureHint: x
|
|
782
|
-
}), /* @__PURE__ */
|
|
782
|
+
}), /* @__PURE__ */ H("div", {
|
|
783
783
|
className: l("px-6 py-4 mobile:pb-8"),
|
|
784
|
-
children: /* @__PURE__ */
|
|
784
|
+
children: /* @__PURE__ */ H(re, {
|
|
785
785
|
tooltip: C,
|
|
786
786
|
hideTooltip: O || !C,
|
|
787
787
|
triggerClassName: "w-full",
|
|
788
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ H(D, {
|
|
789
789
|
label: S,
|
|
790
|
-
onClick:
|
|
790
|
+
onClick: M,
|
|
791
791
|
disabled: !O,
|
|
792
792
|
className: "w-full"
|
|
793
793
|
})
|
|
794
794
|
})
|
|
795
795
|
})]
|
|
796
796
|
});
|
|
797
|
-
}, ft = { modal: "_modal_kl0h0_1" }, pt = ({ 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:
|
|
798
|
-
let { responseFormat:
|
|
797
|
+
}, ft = { modal: "_modal_kl0h0_1" }, pt = ({ 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: h, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = ft.modal }) => {
|
|
798
|
+
let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = lt({
|
|
799
799
|
features: e,
|
|
800
800
|
initialResponseFormat: t,
|
|
801
801
|
initialSystemPrompt: n,
|
|
@@ -803,30 +803,28 @@ var U = {
|
|
|
803
803
|
onSave: i,
|
|
804
804
|
onClose: a
|
|
805
805
|
});
|
|
806
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ H(T, {
|
|
807
807
|
open: !0,
|
|
808
808
|
header: o,
|
|
809
809
|
titleClassName: s,
|
|
810
|
-
size:
|
|
810
|
+
size: E.Sm,
|
|
811
811
|
onClose: a,
|
|
812
|
-
className:
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}),
|
|
825
|
-
children: /* @__PURE__ */ V(dt, {
|
|
812
|
+
className: b,
|
|
813
|
+
mainButtons: [{
|
|
814
|
+
label: v,
|
|
815
|
+
variant: m.Primary,
|
|
816
|
+
onClick: A,
|
|
817
|
+
disabled: !w,
|
|
818
|
+
tooltipProps: y ? {
|
|
819
|
+
tooltip: y,
|
|
820
|
+
hideTooltip: w
|
|
821
|
+
} : void 0
|
|
822
|
+
}],
|
|
823
|
+
children: /* @__PURE__ */ H(G, {
|
|
826
824
|
features: e,
|
|
827
|
-
responseFormat:
|
|
828
|
-
systemPrompt:
|
|
829
|
-
temperature:
|
|
825
|
+
responseFormat: x,
|
|
826
|
+
systemPrompt: S,
|
|
827
|
+
temperature: C,
|
|
830
828
|
onResponseFormatChange: D,
|
|
831
829
|
onSystemPromptChange: O,
|
|
832
830
|
onTemperatureChange: k,
|
|
@@ -836,15 +834,15 @@ var U = {
|
|
|
836
834
|
responseFormatPlainTextLabel: d,
|
|
837
835
|
systemPromptLabel: f,
|
|
838
836
|
systemPromptTooltip: p,
|
|
839
|
-
temperatureLabel:
|
|
840
|
-
temperatureLabels:
|
|
841
|
-
temperatureHint:
|
|
837
|
+
temperatureLabel: h,
|
|
838
|
+
temperatureLabels: g,
|
|
839
|
+
temperatureHint: _
|
|
842
840
|
})
|
|
843
841
|
});
|
|
844
842
|
}, mt = {
|
|
845
843
|
icon: "_icon_1fv6z_1",
|
|
846
844
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
847
|
-
}, ht = ({ 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: m }) => /* @__PURE__ */
|
|
845
|
+
}, ht = ({ 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: m }) => /* @__PURE__ */ H(Me, {
|
|
848
846
|
isOpen: e,
|
|
849
847
|
title: o,
|
|
850
848
|
closeLabel: i,
|
|
@@ -852,33 +850,33 @@ var U = {
|
|
|
852
850
|
onBack: t,
|
|
853
851
|
backLabel: n,
|
|
854
852
|
style: a,
|
|
855
|
-
children: /* @__PURE__ */
|
|
853
|
+
children: /* @__PURE__ */ H("ul", {
|
|
856
854
|
role: "menu",
|
|
857
855
|
className: "flex flex-col pb-4",
|
|
858
856
|
style: c({
|
|
859
857
|
"--tbs-icon-text": m?.iconText,
|
|
860
858
|
"--tbs-selected-icon-text": m?.selectedIconText
|
|
861
859
|
}),
|
|
862
|
-
children: s.map((e) => /* @__PURE__ */
|
|
860
|
+
children: s.map((e) => /* @__PURE__ */ H("li", {
|
|
863
861
|
role: "none",
|
|
864
|
-
children: /* @__PURE__ */
|
|
862
|
+
children: /* @__PURE__ */ H(p, {
|
|
865
863
|
type: "button",
|
|
866
864
|
role: "menuitemcheckbox",
|
|
867
865
|
"aria-checked": e.isSelected,
|
|
868
866
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
869
|
-
iconBefore: /* @__PURE__ */
|
|
867
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
870
868
|
className: l("flex items-center", mt.icon),
|
|
871
869
|
children: e.icon
|
|
872
870
|
}),
|
|
873
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
871
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ H("span", {
|
|
874
872
|
className: l("ms-auto", mt.selectedIcon),
|
|
875
|
-
children: /* @__PURE__ */
|
|
873
|
+
children: /* @__PURE__ */ H(oe, {
|
|
876
874
|
size: f,
|
|
877
875
|
"aria-hidden": !0,
|
|
878
|
-
stroke:
|
|
876
|
+
stroke: _
|
|
879
877
|
})
|
|
880
878
|
}) : null,
|
|
881
|
-
label: /* @__PURE__ */
|
|
879
|
+
label: /* @__PURE__ */ H("span", {
|
|
882
880
|
className: d,
|
|
883
881
|
children: e.label
|
|
884
882
|
}),
|
|
@@ -889,68 +887,68 @@ var U = {
|
|
|
889
887
|
}), gt = {
|
|
890
888
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
891
889
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
892
|
-
}, _t = ({ 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:
|
|
893
|
-
let A = d(), [
|
|
890
|
+
}, _t = ({ 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: b, toolsMenuItems: S = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: O, colors: k }) => {
|
|
891
|
+
let A = d(), [j, M] = B(!1), [ee, N] = B(!1), [te, ne] = B(!1), [P, F] = B(null), [re, ie] = B(!1), ae = R(() => c({
|
|
894
892
|
"--aab-tool-icon": k?.toolIcon,
|
|
895
893
|
"--aab-chevron-icon": k?.chevronIcon
|
|
896
|
-
}), [k?.toolIcon, k?.chevronIcon]),
|
|
894
|
+
}), [k?.toolIcon, k?.chevronIcon]), oe = S.length > 0 && w != null, se = D != null && D.length > 0, le = R(() => S.map((e) => ({
|
|
897
895
|
key: e.id,
|
|
898
896
|
label: e.label,
|
|
899
|
-
icon: /* @__PURE__ */
|
|
900
|
-
style:
|
|
897
|
+
icon: /* @__PURE__ */ H("span", {
|
|
898
|
+
style: ae,
|
|
901
899
|
className: l("flex items-center", gt.toolIcon),
|
|
902
900
|
children: e.icon
|
|
903
901
|
}),
|
|
904
902
|
selectable: !0,
|
|
905
|
-
mark:
|
|
903
|
+
mark: C.Check,
|
|
906
904
|
checked: e.isSelected,
|
|
907
905
|
onClick: () => w?.(e.id)
|
|
908
906
|
})), [
|
|
909
|
-
|
|
907
|
+
S,
|
|
910
908
|
w,
|
|
911
|
-
|
|
912
|
-
]),
|
|
909
|
+
ae
|
|
910
|
+
]), fe = R(() => [
|
|
913
911
|
...e == null ? [] : [{
|
|
914
912
|
key: "attach",
|
|
915
913
|
label: r,
|
|
916
|
-
icon: /* @__PURE__ */
|
|
914
|
+
icon: /* @__PURE__ */ H(de, {
|
|
917
915
|
size: f,
|
|
918
916
|
"aria-hidden": !0,
|
|
919
|
-
stroke:
|
|
917
|
+
stroke: _
|
|
920
918
|
}),
|
|
921
919
|
onClick: e
|
|
922
920
|
}],
|
|
923
|
-
...
|
|
924
|
-
...
|
|
921
|
+
...b ?? [],
|
|
922
|
+
...oe ? [{
|
|
925
923
|
key: "tools",
|
|
926
924
|
label: T,
|
|
927
|
-
icon: /* @__PURE__ */
|
|
925
|
+
icon: /* @__PURE__ */ H(ge, {
|
|
928
926
|
size: f,
|
|
929
927
|
"aria-hidden": !0,
|
|
930
|
-
stroke:
|
|
928
|
+
stroke: _
|
|
931
929
|
}),
|
|
932
930
|
onClick: A ? () => {
|
|
933
|
-
|
|
931
|
+
ne(!0), M(!1);
|
|
934
932
|
} : () => void 0,
|
|
935
|
-
...A ? { iconAfter: /* @__PURE__ */
|
|
933
|
+
...A ? { iconAfter: /* @__PURE__ */ H(ce, {
|
|
936
934
|
size: f,
|
|
937
|
-
stroke:
|
|
938
|
-
style:
|
|
935
|
+
stroke: _,
|
|
936
|
+
style: ae,
|
|
939
937
|
className: l("rtl:scale-x-[-1]", gt.chevronIcon),
|
|
940
938
|
"aria-hidden": !0
|
|
941
|
-
}) } : { children:
|
|
939
|
+
}) } : { children: le }
|
|
942
940
|
}] : [],
|
|
943
941
|
...(D ?? []).map((e) => ({
|
|
944
942
|
key: e.key,
|
|
945
943
|
label: e.title,
|
|
946
944
|
icon: e.icon,
|
|
947
945
|
onClick: A ? () => {
|
|
948
|
-
|
|
946
|
+
F(e.key), M(!1);
|
|
949
947
|
} : () => void 0,
|
|
950
|
-
...A ? { iconAfter: /* @__PURE__ */
|
|
948
|
+
...A ? { iconAfter: /* @__PURE__ */ H(ce, {
|
|
951
949
|
size: f,
|
|
952
|
-
stroke:
|
|
953
|
-
style:
|
|
950
|
+
stroke: _,
|
|
951
|
+
style: ae,
|
|
954
952
|
className: l("rtl:scale-x-[-1]", gt.chevronIcon),
|
|
955
953
|
"aria-hidden": !0
|
|
956
954
|
}) } : {
|
|
@@ -958,171 +956,171 @@ var U = {
|
|
|
958
956
|
key: `${e.key}-panel`,
|
|
959
957
|
label: ""
|
|
960
958
|
}],
|
|
961
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
959
|
+
renderSubMenu: () => e.renderOverlay(() => ie(!1), O?.() ?? 0)
|
|
962
960
|
}
|
|
963
961
|
})),
|
|
964
962
|
...t == null ? [] : [{
|
|
965
963
|
key: "record-voice",
|
|
966
964
|
label: n,
|
|
967
|
-
icon: /* @__PURE__ */
|
|
965
|
+
icon: /* @__PURE__ */ H(ue, {
|
|
968
966
|
size: f,
|
|
969
967
|
"aria-hidden": !0,
|
|
970
|
-
stroke:
|
|
968
|
+
stroke: _
|
|
971
969
|
}),
|
|
972
970
|
onClick: () => {
|
|
973
|
-
|
|
971
|
+
M(!1), ie(!1), t();
|
|
974
972
|
}
|
|
975
973
|
}],
|
|
976
|
-
...
|
|
974
|
+
...h == null ? [] : [{
|
|
977
975
|
key: "chat-settings",
|
|
978
|
-
label:
|
|
979
|
-
icon: /* @__PURE__ */
|
|
976
|
+
label: h.menuItemLabel ?? "Chat settings",
|
|
977
|
+
icon: /* @__PURE__ */ H(he, {
|
|
980
978
|
size: f,
|
|
981
979
|
"aria-hidden": !0,
|
|
982
|
-
stroke:
|
|
980
|
+
stroke: _
|
|
983
981
|
}),
|
|
984
|
-
iconAfter: A ? /* @__PURE__ */
|
|
982
|
+
iconAfter: A ? /* @__PURE__ */ H(ce, {
|
|
985
983
|
size: f,
|
|
986
|
-
stroke:
|
|
987
|
-
style:
|
|
984
|
+
stroke: _,
|
|
985
|
+
style: ae,
|
|
988
986
|
className: l("rtl:scale-x-[-1]", gt.chevronIcon),
|
|
989
987
|
"aria-hidden": !0
|
|
990
988
|
}) : null,
|
|
991
|
-
onClick: () =>
|
|
989
|
+
onClick: () => N(!0)
|
|
992
990
|
}]
|
|
993
991
|
], [
|
|
994
992
|
r,
|
|
995
993
|
e,
|
|
996
994
|
t,
|
|
997
995
|
n,
|
|
998
|
-
|
|
999
|
-
|
|
996
|
+
h,
|
|
997
|
+
b,
|
|
1000
998
|
A,
|
|
1001
|
-
|
|
999
|
+
oe,
|
|
1002
1000
|
T,
|
|
1003
|
-
|
|
1001
|
+
le,
|
|
1004
1002
|
D,
|
|
1005
1003
|
O,
|
|
1006
|
-
|
|
1004
|
+
ae
|
|
1007
1005
|
]);
|
|
1008
|
-
if (
|
|
1009
|
-
let
|
|
1006
|
+
if (fe.length === 0) return null;
|
|
1007
|
+
let pe = /* @__PURE__ */ H(v, {
|
|
1010
1008
|
matchReferenceWidth: !1,
|
|
1011
1009
|
placement: "bottom-start",
|
|
1012
1010
|
listClassName: p,
|
|
1013
1011
|
overlayContentClassName: "flex flex-col gap-1",
|
|
1014
|
-
items:
|
|
1015
|
-
open:
|
|
1016
|
-
onOpenChange:
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1018
|
-
icon: /* @__PURE__ */
|
|
1019
|
-
size:
|
|
1012
|
+
items: fe,
|
|
1013
|
+
open: se ? re : void 0,
|
|
1014
|
+
onOpenChange: se ? ie : void 0,
|
|
1015
|
+
children: /* @__PURE__ */ H(x, {
|
|
1016
|
+
icon: /* @__PURE__ */ H(me, {
|
|
1017
|
+
size: g.LG,
|
|
1020
1018
|
"aria-hidden": !0,
|
|
1021
|
-
stroke:
|
|
1019
|
+
stroke: _
|
|
1022
1020
|
}),
|
|
1023
1021
|
"aria-label": i,
|
|
1024
1022
|
tooltipProps: { tooltip: i },
|
|
1025
1023
|
disabled: m
|
|
1026
1024
|
})
|
|
1027
1025
|
});
|
|
1028
|
-
return /* @__PURE__ */ V
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
icon: /* @__PURE__ */
|
|
1031
|
-
size:
|
|
1026
|
+
return /* @__PURE__ */ H(V, { children: A ? /* @__PURE__ */ U(V, { children: [
|
|
1027
|
+
/* @__PURE__ */ H(x, {
|
|
1028
|
+
icon: /* @__PURE__ */ H(me, {
|
|
1029
|
+
size: g.LG,
|
|
1032
1030
|
"aria-hidden": !0,
|
|
1033
|
-
stroke:
|
|
1031
|
+
stroke: _
|
|
1034
1032
|
}),
|
|
1035
1033
|
"aria-label": i,
|
|
1036
|
-
size:
|
|
1034
|
+
size: y.Large,
|
|
1037
1035
|
tooltipProps: { tooltip: i },
|
|
1038
1036
|
disabled: m,
|
|
1039
|
-
onClick: () =>
|
|
1037
|
+
onClick: () => M(!0)
|
|
1040
1038
|
}),
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
isOpen:
|
|
1039
|
+
/* @__PURE__ */ H(ct, {
|
|
1040
|
+
isOpen: j,
|
|
1043
1041
|
title: a,
|
|
1044
1042
|
closeLabel: s,
|
|
1045
|
-
onClose: () =>
|
|
1043
|
+
onClose: () => M(!1),
|
|
1046
1044
|
style: u,
|
|
1047
|
-
items:
|
|
1045
|
+
items: fe,
|
|
1048
1046
|
className: "pb-4",
|
|
1049
1047
|
btnTextClassName: "flex-1"
|
|
1050
1048
|
}),
|
|
1051
|
-
|
|
1052
|
-
isOpen:
|
|
1049
|
+
oe && /* @__PURE__ */ H(ht, {
|
|
1050
|
+
isOpen: te,
|
|
1053
1051
|
onBack: () => {
|
|
1054
|
-
|
|
1052
|
+
ne(!1), M(!0);
|
|
1055
1053
|
},
|
|
1056
1054
|
backLabel: E,
|
|
1057
|
-
onClose: () =>
|
|
1055
|
+
onClose: () => ne(!1),
|
|
1058
1056
|
closeLabel: s,
|
|
1059
1057
|
style: u,
|
|
1060
1058
|
title: T,
|
|
1061
|
-
items:
|
|
1059
|
+
items: S,
|
|
1062
1060
|
onToolToggle: w
|
|
1063
1061
|
}),
|
|
1064
|
-
D?.map((e) => /* @__PURE__ */
|
|
1065
|
-
isOpen:
|
|
1062
|
+
D?.map((e) => /* @__PURE__ */ H(Me, {
|
|
1063
|
+
isOpen: P === e.key,
|
|
1066
1064
|
title: e.title,
|
|
1067
1065
|
closeLabel: s,
|
|
1068
1066
|
onBack: () => {
|
|
1069
|
-
|
|
1067
|
+
F(null), M(!0);
|
|
1070
1068
|
},
|
|
1071
1069
|
backLabel: e.backLabel ?? "Back",
|
|
1072
|
-
onClose: () =>
|
|
1070
|
+
onClose: () => F(null),
|
|
1073
1071
|
style: u,
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1072
|
+
children: /* @__PURE__ */ H("div", {
|
|
1075
1073
|
role: "menu",
|
|
1076
1074
|
"aria-label": e.title,
|
|
1077
|
-
children: e.renderOverlay(() =>
|
|
1075
|
+
children: e.renderOverlay(() => F(null), O?.() ?? 0)
|
|
1078
1076
|
})
|
|
1079
1077
|
}, e.key)),
|
|
1080
|
-
|
|
1081
|
-
isOpen:
|
|
1078
|
+
h != null && /* @__PURE__ */ H(dt, {
|
|
1079
|
+
isOpen: ee,
|
|
1082
1080
|
onBack: () => {
|
|
1083
|
-
|
|
1081
|
+
N(!1), M(!0);
|
|
1084
1082
|
},
|
|
1085
|
-
backLabel:
|
|
1086
|
-
onClose: () =>
|
|
1083
|
+
backLabel: h.backLabel ?? "Back",
|
|
1084
|
+
onClose: () => N(!1),
|
|
1087
1085
|
closeLabel: s,
|
|
1088
1086
|
style: u,
|
|
1089
|
-
features:
|
|
1090
|
-
initialResponseFormat:
|
|
1091
|
-
initialSystemPrompt:
|
|
1092
|
-
initialTemperature:
|
|
1093
|
-
onSave:
|
|
1094
|
-
title:
|
|
1095
|
-
responseFormatLabel:
|
|
1096
|
-
responseFormatHint:
|
|
1097
|
-
responseFormatMarkdownLabel:
|
|
1098
|
-
responseFormatPlainTextLabel:
|
|
1099
|
-
systemPromptLabel:
|
|
1100
|
-
systemPromptTooltip:
|
|
1101
|
-
temperatureLabel:
|
|
1102
|
-
temperatureLabels:
|
|
1103
|
-
temperatureHint:
|
|
1104
|
-
saveLabel:
|
|
1105
|
-
saveDisabledTooltip:
|
|
1087
|
+
features: h.features,
|
|
1088
|
+
initialResponseFormat: h.responseFormat ?? o.Markdown,
|
|
1089
|
+
initialSystemPrompt: h.systemPrompt,
|
|
1090
|
+
initialTemperature: h.temperature,
|
|
1091
|
+
onSave: h.onSave,
|
|
1092
|
+
title: h.title,
|
|
1093
|
+
responseFormatLabel: h.responseFormatLabel,
|
|
1094
|
+
responseFormatHint: h.responseFormatHint,
|
|
1095
|
+
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
1096
|
+
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
1097
|
+
systemPromptLabel: h.systemPromptLabel,
|
|
1098
|
+
systemPromptTooltip: h.systemPromptTooltip,
|
|
1099
|
+
temperatureLabel: h.temperatureLabel,
|
|
1100
|
+
temperatureLabels: h.temperatureLabels,
|
|
1101
|
+
temperatureHint: h.temperatureHint,
|
|
1102
|
+
saveLabel: h.saveLabel,
|
|
1103
|
+
saveDisabledTooltip: h.saveDisabledTooltip
|
|
1106
1104
|
})
|
|
1107
|
-
] }) : /* @__PURE__ */
|
|
1108
|
-
features:
|
|
1109
|
-
initialResponseFormat:
|
|
1110
|
-
initialSystemPrompt:
|
|
1111
|
-
initialTemperature:
|
|
1112
|
-
onSave:
|
|
1113
|
-
onClose: () =>
|
|
1114
|
-
title:
|
|
1115
|
-
responseFormatLabel:
|
|
1116
|
-
responseFormatHint:
|
|
1117
|
-
responseFormatMarkdownLabel:
|
|
1118
|
-
responseFormatPlainTextLabel:
|
|
1119
|
-
systemPromptLabel:
|
|
1120
|
-
systemPromptTooltip:
|
|
1121
|
-
temperatureLabel:
|
|
1122
|
-
temperatureLabels:
|
|
1123
|
-
temperatureHint:
|
|
1124
|
-
saveLabel:
|
|
1125
|
-
saveDisabledTooltip:
|
|
1105
|
+
] }) : /* @__PURE__ */ U(V, { children: [pe, h != null && ee && /* @__PURE__ */ H(pt, {
|
|
1106
|
+
features: h.features,
|
|
1107
|
+
initialResponseFormat: h.responseFormat ?? o.Markdown,
|
|
1108
|
+
initialSystemPrompt: h.systemPrompt,
|
|
1109
|
+
initialTemperature: h.temperature,
|
|
1110
|
+
onSave: h.onSave,
|
|
1111
|
+
onClose: () => N(!1),
|
|
1112
|
+
title: h.title,
|
|
1113
|
+
responseFormatLabel: h.responseFormatLabel,
|
|
1114
|
+
responseFormatHint: h.responseFormatHint,
|
|
1115
|
+
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
1116
|
+
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
1117
|
+
systemPromptLabel: h.systemPromptLabel,
|
|
1118
|
+
systemPromptTooltip: h.systemPromptTooltip,
|
|
1119
|
+
temperatureLabel: h.temperatureLabel,
|
|
1120
|
+
temperatureLabels: h.temperatureLabels,
|
|
1121
|
+
temperatureHint: h.temperatureHint,
|
|
1122
|
+
saveLabel: h.saveLabel,
|
|
1123
|
+
saveDisabledTooltip: h.saveDisabledTooltip
|
|
1126
1124
|
})] }) });
|
|
1127
1125
|
}, vt = {
|
|
1128
1126
|
chip: "_chip_1lvv5_1",
|
|
@@ -1134,7 +1132,7 @@ var U = {
|
|
|
1134
1132
|
}, yt = (e) => `Remove ${e}`, bt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = yt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
|
|
1135
1133
|
if (e.length === 0) return null;
|
|
1136
1134
|
let d = !!(a && o);
|
|
1137
|
-
return /* @__PURE__ */
|
|
1135
|
+
return /* @__PURE__ */ H("div", {
|
|
1138
1136
|
className: "flex flex-wrap items-center gap-2",
|
|
1139
1137
|
style: c({
|
|
1140
1138
|
"--ci-chip-bg": u?.chipBg,
|
|
@@ -1150,46 +1148,46 @@ var U = {
|
|
|
1150
1148
|
"--ci-chip-close": u?.chipClose,
|
|
1151
1149
|
"--ci-chip-close-hover": u?.chipCloseHover
|
|
1152
1150
|
}),
|
|
1153
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1151
|
+
children: e.map((e) => /* @__PURE__ */ U("div", {
|
|
1154
1152
|
className: l(vt.chip, e.isSelected && vt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
|
|
1155
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ U("button", {
|
|
1156
1154
|
type: "button",
|
|
1157
1155
|
onClick: () => t(e.id),
|
|
1158
1156
|
"aria-pressed": e.isSelected,
|
|
1159
1157
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1160
1158
|
children: [
|
|
1161
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ H("span", {
|
|
1162
1160
|
className: l(vt.chipIcon, "shrink-0"),
|
|
1163
1161
|
"aria-hidden": !0,
|
|
1164
1162
|
children: e.icon
|
|
1165
1163
|
}),
|
|
1166
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ U("span", {
|
|
1167
1165
|
className: l(vt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
1168
|
-
children: [e.label, d && /* @__PURE__ */
|
|
1166
|
+
children: [e.label, d && /* @__PURE__ */ H("span", {
|
|
1169
1167
|
"aria-hidden": !0,
|
|
1170
1168
|
children: ":"
|
|
1171
1169
|
})]
|
|
1172
1170
|
}),
|
|
1173
|
-
d && /* @__PURE__ */
|
|
1171
|
+
d && /* @__PURE__ */ H("span", {
|
|
1174
1172
|
className: l(vt.chipState, s?.fontClassName || "dial-small-paragraph-text", "ms-1 shrink-0 uppercase tracking-wider"),
|
|
1175
1173
|
"aria-hidden": !0,
|
|
1176
1174
|
children: e.isSelected ? a : o
|
|
1177
1175
|
})
|
|
1178
1176
|
]
|
|
1179
|
-
}), r && /* @__PURE__ */
|
|
1177
|
+
}), r && /* @__PURE__ */ H("button", {
|
|
1180
1178
|
type: "button",
|
|
1181
1179
|
onClick: () => n(e.id),
|
|
1182
1180
|
"aria-label": i(e.label),
|
|
1183
1181
|
className: l(vt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
1184
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ H(_e, {
|
|
1185
1183
|
size: 12,
|
|
1186
1184
|
"aria-hidden": !0,
|
|
1187
|
-
stroke:
|
|
1185
|
+
stroke: _
|
|
1188
1186
|
})
|
|
1189
1187
|
})]
|
|
1190
1188
|
}, e.id))
|
|
1191
1189
|
});
|
|
1192
|
-
},
|
|
1190
|
+
}, K = {
|
|
1193
1191
|
wrapper: "_wrapper_19a9k_2",
|
|
1194
1192
|
wrapperDisabled: "_wrapperDisabled_19a9k_9",
|
|
1195
1193
|
textarea: "_textarea_19a9k_13",
|
|
@@ -1208,13 +1206,13 @@ var U = {
|
|
|
1208
1206
|
recordingDot: "_recordingDot_129ri_19",
|
|
1209
1207
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
1210
1208
|
}, St = 3, Ct = 4, wt = 200, Tt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: c = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
|
|
1211
|
-
let p =
|
|
1209
|
+
let p = z(null), m = z(new Float32Array(wt)), h = z(0), v = z(0), y = e === Qe.Recording, S = e === Qe.Error, C = e === Qe.Processing, w = I((e) => {
|
|
1212
1210
|
let t = e.getContext("2d");
|
|
1213
1211
|
if (!t) return;
|
|
1214
1212
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1215
1213
|
let { width: n, height: r } = e;
|
|
1216
1214
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1217
|
-
let i = Math.min(Math.max(1, Math.floor(n / Ct)), wt - 1), a =
|
|
1215
|
+
let i = Math.min(Math.max(1, Math.floor(n / Ct)), wt - 1), a = h.current, o = v.current;
|
|
1218
1216
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1219
1217
|
for (let e = 0; e <= i; e++) {
|
|
1220
1218
|
let n = ((a - i + e) % wt + wt) % wt, o = m.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
@@ -1222,11 +1220,11 @@ var U = {
|
|
|
1222
1220
|
}
|
|
1223
1221
|
t.restore();
|
|
1224
1222
|
}, []);
|
|
1225
|
-
|
|
1226
|
-
if (!
|
|
1223
|
+
L(() => {
|
|
1224
|
+
if (!y) return;
|
|
1227
1225
|
let e = p.current;
|
|
1228
1226
|
if (!e) return;
|
|
1229
|
-
m.current.fill(0),
|
|
1227
|
+
m.current.fill(0), h.current = 0, v.current = 0;
|
|
1230
1228
|
let n, r = () => {
|
|
1231
1229
|
if (v.current += 1, v.current >= Ct) {
|
|
1232
1230
|
v.current -= Ct;
|
|
@@ -1239,7 +1237,7 @@ var U = {
|
|
|
1239
1237
|
let r = (t[e] - 128) / 128;
|
|
1240
1238
|
n += r * r;
|
|
1241
1239
|
}
|
|
1242
|
-
m.current[
|
|
1240
|
+
m.current[h.current % wt] = Math.sqrt(n / t.length), h.current++;
|
|
1243
1241
|
}
|
|
1244
1242
|
}
|
|
1245
1243
|
w(e), n = requestAnimationFrame(r);
|
|
@@ -1248,10 +1246,10 @@ var U = {
|
|
|
1248
1246
|
cancelAnimationFrame(n);
|
|
1249
1247
|
};
|
|
1250
1248
|
}, [
|
|
1251
|
-
|
|
1249
|
+
y,
|
|
1252
1250
|
t,
|
|
1253
1251
|
w
|
|
1254
|
-
]),
|
|
1252
|
+
]), L(() => {
|
|
1255
1253
|
let e = p.current;
|
|
1256
1254
|
if (!e) return;
|
|
1257
1255
|
let t = new ResizeObserver(() => {
|
|
@@ -1259,22 +1257,22 @@ var U = {
|
|
|
1259
1257
|
});
|
|
1260
1258
|
return t.observe(e), () => t.disconnect();
|
|
1261
1259
|
}, [w]);
|
|
1262
|
-
let T = /* @__PURE__ */
|
|
1260
|
+
let T = /* @__PURE__ */ U("div", {
|
|
1263
1261
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
1264
1262
|
children: [
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
icon: /* @__PURE__ */
|
|
1267
|
-
size:
|
|
1263
|
+
/* @__PURE__ */ H(x, {
|
|
1264
|
+
icon: /* @__PURE__ */ H(_e, {
|
|
1265
|
+
size: g.LG,
|
|
1268
1266
|
"aria-hidden": !0,
|
|
1269
|
-
stroke:
|
|
1267
|
+
stroke: _
|
|
1270
1268
|
}),
|
|
1271
1269
|
"aria-label": s,
|
|
1272
1270
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1273
1271
|
onClick: i
|
|
1274
1272
|
}),
|
|
1275
|
-
|
|
1276
|
-
icon: /* @__PURE__ */
|
|
1277
|
-
size:
|
|
1273
|
+
y && /* @__PURE__ */ H(O, {
|
|
1274
|
+
icon: /* @__PURE__ */ H(fe, {
|
|
1275
|
+
size: g.LG,
|
|
1278
1276
|
"aria-hidden": !0
|
|
1279
1277
|
}),
|
|
1280
1278
|
onClick: () => r?.(),
|
|
@@ -1282,93 +1280,93 @@ var U = {
|
|
|
1282
1280
|
"aria-label": o,
|
|
1283
1281
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
1284
1282
|
}),
|
|
1285
|
-
C && /* @__PURE__ */
|
|
1283
|
+
C && /* @__PURE__ */ H("span", {
|
|
1286
1284
|
className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1285
|
+
children: /* @__PURE__ */ H(te, {
|
|
1288
1286
|
size: 20,
|
|
1289
1287
|
ariaLabel: c
|
|
1290
1288
|
})
|
|
1291
1289
|
})
|
|
1292
1290
|
]
|
|
1293
1291
|
});
|
|
1294
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ U("div", {
|
|
1295
1293
|
className: d,
|
|
1296
|
-
children: [/* @__PURE__ */
|
|
1294
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1297
1295
|
style: u,
|
|
1298
|
-
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f &&
|
|
1299
|
-
children: [/* @__PURE__ */
|
|
1296
|
+
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && K.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && xt.wrapperError),
|
|
1297
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1300
1298
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1301
|
-
children: [
|
|
1299
|
+
children: [y && /* @__PURE__ */ H("span", {
|
|
1302
1300
|
className: l(xt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1303
1301
|
"aria-hidden": !0
|
|
1304
|
-
}), /* @__PURE__ */
|
|
1302
|
+
}), /* @__PURE__ */ H("canvas", {
|
|
1305
1303
|
ref: p,
|
|
1306
1304
|
height: 26,
|
|
1307
1305
|
"aria-hidden": !0,
|
|
1308
1306
|
className: l(xt.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1309
1307
|
})]
|
|
1310
|
-
}), /* @__PURE__ */
|
|
1308
|
+
}), /* @__PURE__ */ U("div", {
|
|
1311
1309
|
className: "flex items-center justify-between gap-2",
|
|
1312
|
-
children: [a ?? /* @__PURE__ */
|
|
1310
|
+
children: [a ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), T]
|
|
1313
1311
|
})]
|
|
1314
|
-
}), S && n && /* @__PURE__ */
|
|
1312
|
+
}), S && n && /* @__PURE__ */ H("div", {
|
|
1315
1313
|
role: "alert",
|
|
1316
|
-
children: /* @__PURE__ */
|
|
1314
|
+
children: /* @__PURE__ */ H(b, {
|
|
1317
1315
|
text: n,
|
|
1318
1316
|
className: "mt-1 px-1"
|
|
1319
1317
|
})
|
|
1320
1318
|
})]
|
|
1321
1319
|
});
|
|
1322
|
-
}, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */
|
|
1320
|
+
}, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(O, {
|
|
1323
1321
|
"aria-label": n,
|
|
1324
1322
|
onClick: () => e?.(),
|
|
1325
1323
|
disabled: t,
|
|
1326
1324
|
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1327
|
-
icon: /* @__PURE__ */
|
|
1328
|
-
size:
|
|
1325
|
+
icon: /* @__PURE__ */ H(ae, {
|
|
1326
|
+
size: g.LG,
|
|
1329
1327
|
className: "rtl:scale-x-[-1]",
|
|
1330
|
-
stroke:
|
|
1328
|
+
stroke: _
|
|
1331
1329
|
})
|
|
1332
|
-
}), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */
|
|
1333
|
-
icon: /* @__PURE__ */
|
|
1334
|
-
size:
|
|
1335
|
-
stroke:
|
|
1330
|
+
}), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(ne, {
|
|
1331
|
+
icon: /* @__PURE__ */ H(pe, {
|
|
1332
|
+
size: g.LG,
|
|
1333
|
+
stroke: _
|
|
1336
1334
|
}),
|
|
1337
1335
|
onClick: () => e?.(),
|
|
1338
1336
|
"aria-label": t
|
|
1339
|
-
}), Ot = ({ size: e = 20 }) => /* @__PURE__ */
|
|
1340
|
-
variant:
|
|
1337
|
+
}), Ot = ({ size: e = 20 }) => /* @__PURE__ */ H(M, {
|
|
1338
|
+
variant: ee.Circular,
|
|
1341
1339
|
width: e,
|
|
1342
1340
|
height: e,
|
|
1343
1341
|
active: !0
|
|
1344
|
-
}), kt = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1342
|
+
}), kt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
|
|
1345
1343
|
className: "flex min-w-0 flex-1 items-center",
|
|
1346
|
-
children: [/* @__PURE__ */
|
|
1347
|
-
variant:
|
|
1344
|
+
children: [/* @__PURE__ */ H(M, {
|
|
1345
|
+
variant: ee.Text,
|
|
1348
1346
|
width: "100%",
|
|
1349
1347
|
height: 16,
|
|
1350
1348
|
active: !0
|
|
1351
|
-
}), e && /* @__PURE__ */
|
|
1349
|
+
}), e && /* @__PURE__ */ H("span", {
|
|
1352
1350
|
className: "sr-only",
|
|
1353
1351
|
children: e
|
|
1354
1352
|
})]
|
|
1355
|
-
}), At = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1353
|
+
}), At = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
|
|
1356
1354
|
role: "status",
|
|
1357
1355
|
"aria-label": e,
|
|
1358
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1356
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
|
|
1359
1357
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1360
1358
|
"aria-hidden": "true",
|
|
1361
|
-
children: [/* @__PURE__ */
|
|
1359
|
+
children: [/* @__PURE__ */ H(Ot, {}), /* @__PURE__ */ H(kt, {})]
|
|
1362
1360
|
}, t))
|
|
1363
1361
|
}), jt = (e) => e.displayName ?? e.id, Mt = (e, t) => {
|
|
1364
1362
|
let n = t.trim().toLowerCase();
|
|
1365
1363
|
return n ? e.filter((e) => jt(e).toLowerCase().includes(n)) : e;
|
|
1366
|
-
},
|
|
1364
|
+
}, q = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
|
|
1367
1365
|
src: e,
|
|
1368
1366
|
size: i,
|
|
1369
1367
|
labels: { tooltip: a },
|
|
1370
1368
|
initialsName: r
|
|
1371
|
-
}),
|
|
1369
|
+
}), Nt = {
|
|
1372
1370
|
searchHeader: "_searchHeader_1u7db_1",
|
|
1373
1371
|
itemText: "_itemText_1u7db_13",
|
|
1374
1372
|
itemHover: "_itemHover_1u7db_17",
|
|
@@ -1376,16 +1374,16 @@ var U = {
|
|
|
1376
1374
|
selectedItemText: "_selectedItemText_1u7db_26",
|
|
1377
1375
|
checkIcon: "_checkIcon_1u7db_30"
|
|
1378
1376
|
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
|
|
1379
|
-
let [a, o] =
|
|
1377
|
+
let [a, o] = B(""), s = R(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = R(() => u ? /* @__PURE__ */ H(Ot, { size: g.LG }) : q(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", g.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1380
1378
|
u,
|
|
1381
1379
|
s,
|
|
1382
1380
|
d,
|
|
1383
1381
|
r?.unavailableTooltip
|
|
1384
|
-
]), p = s?.displayName ?? s?.id, m = s?.displayVersion,
|
|
1382
|
+
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = R(() => {
|
|
1385
1383
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
1386
1384
|
key: `__loading-${t}`,
|
|
1387
|
-
icon: /* @__PURE__ */
|
|
1388
|
-
label: /* @__PURE__ */
|
|
1385
|
+
icon: /* @__PURE__ */ H(Ot, {}),
|
|
1386
|
+
label: /* @__PURE__ */ H(kt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1389
1387
|
disabled: !0
|
|
1390
1388
|
}));
|
|
1391
1389
|
if (!e || e.length === 0) {
|
|
@@ -1401,15 +1399,15 @@ var U = {
|
|
|
1401
1399
|
let r = e.id === t;
|
|
1402
1400
|
return {
|
|
1403
1401
|
key: e.id,
|
|
1404
|
-
label: /* @__PURE__ */
|
|
1402
|
+
label: /* @__PURE__ */ H(S, {
|
|
1405
1403
|
text: jt(e),
|
|
1406
1404
|
query: a,
|
|
1407
1405
|
maxLines: 1
|
|
1408
1406
|
}),
|
|
1409
|
-
icon:
|
|
1410
|
-
mark:
|
|
1407
|
+
icon: q(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1408
|
+
mark: C.Check,
|
|
1411
1409
|
checked: r,
|
|
1412
|
-
className: l(o?.itemText &&
|
|
1410
|
+
className: l(o?.itemText && Nt.itemText, o?.itemHoverBackground && Nt.itemHover, r && o?.selectedItemBackground && Nt.selectedItemBackground, r && o?.selectedItemText && Nt.selectedItemText, r && o?.checkIcon && Nt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
|
|
1413
1411
|
onClick: () => n?.(e.id)
|
|
1414
1412
|
};
|
|
1415
1413
|
});
|
|
@@ -1423,7 +1421,7 @@ var U = {
|
|
|
1423
1421
|
i?.itemClassName,
|
|
1424
1422
|
i?.selectedItemClassName,
|
|
1425
1423
|
i?.colors
|
|
1426
|
-
]),
|
|
1424
|
+
]), v = R(() => c({
|
|
1427
1425
|
"--ms-item-text": i?.colors?.itemText,
|
|
1428
1426
|
"--ms-item-hover-bg": i?.colors?.itemHoverBackground,
|
|
1429
1427
|
"--ms-selected-item-bg": i?.colors?.selectedItemBackground,
|
|
@@ -1432,17 +1430,17 @@ var U = {
|
|
|
1432
1430
|
}), [i?.colors]);
|
|
1433
1431
|
return {
|
|
1434
1432
|
selectorIcon: f,
|
|
1435
|
-
selectorAriaLabel:
|
|
1433
|
+
selectorAriaLabel: h,
|
|
1436
1434
|
selectedLabel: p,
|
|
1437
1435
|
selectedVersion: m,
|
|
1438
1436
|
menuItems: _,
|
|
1439
|
-
menuHeader:
|
|
1437
|
+
menuHeader: R(() => !u && e && e.length > 0 ? /* @__PURE__ */ H("div", {
|
|
1440
1438
|
style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
|
|
1441
|
-
className: l("sticky top-0 z-10 pb-1 pe-2 pt-2",
|
|
1442
|
-
children: /* @__PURE__ */
|
|
1439
|
+
className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", Nt.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
|
|
1440
|
+
children: /* @__PURE__ */ H(j, {
|
|
1443
1441
|
value: a,
|
|
1444
1442
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1445
|
-
size:
|
|
1443
|
+
size: y.Small,
|
|
1446
1444
|
wrapperClassName: "border-0",
|
|
1447
1445
|
onChange: (e) => o(e ?? "")
|
|
1448
1446
|
})
|
|
@@ -1454,12 +1452,12 @@ var U = {
|
|
|
1454
1452
|
i?.searchHeaderClassName,
|
|
1455
1453
|
i?.colors?.searchHeaderBackground
|
|
1456
1454
|
]),
|
|
1457
|
-
menuStyle:
|
|
1455
|
+
menuStyle: v,
|
|
1458
1456
|
onOpenChange: (e) => {
|
|
1459
1457
|
e || o("");
|
|
1460
1458
|
}
|
|
1461
1459
|
};
|
|
1462
|
-
}, Ft = typeof window < "u" ? Ce :
|
|
1460
|
+
}, Ft = typeof window < "u" ? Ce : L;
|
|
1463
1461
|
function It(e) {
|
|
1464
1462
|
if (e !== void 0) switch (typeof e) {
|
|
1465
1463
|
case "number": return e;
|
|
@@ -1468,11 +1466,11 @@ function It(e) {
|
|
|
1468
1466
|
break;
|
|
1469
1467
|
}
|
|
1470
1468
|
}
|
|
1471
|
-
function
|
|
1472
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1469
|
+
function J({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1470
|
+
let { styleHeight: s, styleWidth: c } = R(() => ({
|
|
1473
1471
|
styleHeight: It(o?.height),
|
|
1474
1472
|
styleWidth: It(o?.width)
|
|
1475
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1473
|
+
}), [o?.height, o?.width]), [l, u] = B({
|
|
1476
1474
|
height: t,
|
|
1477
1475
|
width: n
|
|
1478
1476
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -1496,7 +1494,7 @@ function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1496
1494
|
i,
|
|
1497
1495
|
s,
|
|
1498
1496
|
c
|
|
1499
|
-
]),
|
|
1497
|
+
]), R(() => ({
|
|
1500
1498
|
height: s ?? l.height,
|
|
1501
1499
|
width: c ?? l.width
|
|
1502
1500
|
}), [
|
|
@@ -1505,26 +1503,26 @@ function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1505
1503
|
c
|
|
1506
1504
|
]);
|
|
1507
1505
|
}
|
|
1508
|
-
function
|
|
1509
|
-
let t =
|
|
1506
|
+
function Y(e) {
|
|
1507
|
+
let t = z(() => {
|
|
1510
1508
|
throw Error("Cannot call during render.");
|
|
1511
1509
|
});
|
|
1512
1510
|
return Ft(() => {
|
|
1513
1511
|
t.current = e;
|
|
1514
|
-
}, [e]),
|
|
1512
|
+
}, [e]), I((e) => t.current?.(e), [t]);
|
|
1515
1513
|
}
|
|
1516
|
-
var
|
|
1517
|
-
function
|
|
1518
|
-
if (
|
|
1514
|
+
var X = null;
|
|
1515
|
+
function Lt(e = !1) {
|
|
1516
|
+
if (X === null || e) {
|
|
1519
1517
|
let e = document.createElement("div"), t = e.style;
|
|
1520
1518
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1521
1519
|
let n = document.createElement("div"), r = n.style;
|
|
1522
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1520
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? X = "positive-descending" : (e.scrollLeft = 1, X = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), X;
|
|
1523
1521
|
}
|
|
1524
|
-
return
|
|
1522
|
+
return X;
|
|
1525
1523
|
}
|
|
1526
1524
|
function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1527
|
-
if (t === "horizontal" && n) switch (
|
|
1525
|
+
if (t === "horizontal" && n) switch (Lt()) {
|
|
1528
1526
|
case "negative": return -r;
|
|
1529
1527
|
case "positive-descending":
|
|
1530
1528
|
if (e) {
|
|
@@ -1535,26 +1533,26 @@ function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1535
1533
|
}
|
|
1536
1534
|
return r;
|
|
1537
1535
|
}
|
|
1538
|
-
function
|
|
1536
|
+
function Z(e, t = "Assertion error") {
|
|
1539
1537
|
if (!e) throw console.error(t), Error(t);
|
|
1540
1538
|
}
|
|
1541
|
-
function
|
|
1539
|
+
function Q(e, t) {
|
|
1542
1540
|
if (e === t) return !0;
|
|
1543
|
-
if (!!e != !!t || (
|
|
1541
|
+
if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1544
1542
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1545
1543
|
return !0;
|
|
1546
1544
|
}
|
|
1547
|
-
function
|
|
1545
|
+
function zt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1548
1546
|
if (t === 0) return 0;
|
|
1549
1547
|
if (typeof n == "number") return t * n;
|
|
1550
1548
|
{
|
|
1551
1549
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1552
|
-
return
|
|
1550
|
+
return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1553
1551
|
}
|
|
1554
1552
|
}
|
|
1555
1553
|
function Bt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1556
1554
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1557
|
-
let s =
|
|
1555
|
+
let s = zt({
|
|
1558
1556
|
cachedBounds: t,
|
|
1559
1557
|
itemCount: r,
|
|
1560
1558
|
itemSize: i
|
|
@@ -1589,7 +1587,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1589
1587
|
let r = /* @__PURE__ */ new Map();
|
|
1590
1588
|
return {
|
|
1591
1589
|
get(i) {
|
|
1592
|
-
for (
|
|
1590
|
+
for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1593
1591
|
let e = r.size, a;
|
|
1594
1592
|
switch (typeof n) {
|
|
1595
1593
|
case "function":
|
|
@@ -1605,14 +1603,14 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1605
1603
|
});
|
|
1606
1604
|
else {
|
|
1607
1605
|
let t = r.get(e - 1);
|
|
1608
|
-
|
|
1606
|
+
Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1609
1607
|
scrollOffset: t.scrollOffset + t.size,
|
|
1610
1608
|
size: a
|
|
1611
1609
|
});
|
|
1612
1610
|
}
|
|
1613
1611
|
}
|
|
1614
1612
|
let a = r.get(i);
|
|
1615
|
-
return
|
|
1613
|
+
return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1616
1614
|
},
|
|
1617
1615
|
set(e, t) {
|
|
1618
1616
|
r.set(e, t);
|
|
@@ -1623,7 +1621,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1623
1621
|
};
|
|
1624
1622
|
}
|
|
1625
1623
|
function Ut({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1626
|
-
return
|
|
1624
|
+
return R(() => Ht({
|
|
1627
1625
|
itemCount: e,
|
|
1628
1626
|
itemProps: t,
|
|
1629
1627
|
itemSize: n
|
|
@@ -1637,7 +1635,7 @@ function Wt({ containerSize: e, itemSize: t }) {
|
|
|
1637
1635
|
let n;
|
|
1638
1636
|
switch (typeof t) {
|
|
1639
1637
|
case "string":
|
|
1640
|
-
|
|
1638
|
+
Z(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Z(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1641
1639
|
break;
|
|
1642
1640
|
default:
|
|
1643
1641
|
n = t;
|
|
@@ -1646,13 +1644,13 @@ function Wt({ containerSize: e, itemSize: t }) {
|
|
|
1646
1644
|
return n;
|
|
1647
1645
|
}
|
|
1648
1646
|
function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1649
|
-
let { height: u = n, width: d = n } =
|
|
1647
|
+
let { height: u = n, width: d = n } = J({
|
|
1650
1648
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1651
1649
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1652
1650
|
element: e,
|
|
1653
1651
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1654
1652
|
style: t
|
|
1655
|
-
}), f =
|
|
1653
|
+
}), f = z({
|
|
1656
1654
|
height: 0,
|
|
1657
1655
|
width: 0
|
|
1658
1656
|
}), p = r === "vertical" ? u : d, m = Wt({
|
|
@@ -1676,7 +1674,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1676
1674
|
itemCount: a,
|
|
1677
1675
|
itemProps: o,
|
|
1678
1676
|
itemSize: m
|
|
1679
|
-
}), g =
|
|
1677
|
+
}), g = I((e) => h.get(e), [h]), [_, v] = B(() => Vt({
|
|
1680
1678
|
cachedBounds: h,
|
|
1681
1679
|
containerScrollOffset: 0,
|
|
1682
1680
|
containerSize: p,
|
|
@@ -1687,7 +1685,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1687
1685
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1688
1686
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1689
1687
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1690
|
-
}, C =
|
|
1688
|
+
}, C = I(() => zt({
|
|
1691
1689
|
cachedBounds: h,
|
|
1692
1690
|
itemCount: a,
|
|
1693
1691
|
itemSize: m
|
|
@@ -1695,7 +1693,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1695
1693
|
h,
|
|
1696
1694
|
a,
|
|
1697
1695
|
m
|
|
1698
|
-
]), w =
|
|
1696
|
+
]), w = I((t) => Vt({
|
|
1699
1697
|
cachedBounds: h,
|
|
1700
1698
|
containerScrollOffset: Rt({
|
|
1701
1699
|
containerElement: e,
|
|
@@ -1737,7 +1735,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1737
1735
|
itemCount: a,
|
|
1738
1736
|
overscanCount: l
|
|
1739
1737
|
});
|
|
1740
|
-
return
|
|
1738
|
+
return Q(s, t) ? t : s;
|
|
1741
1739
|
});
|
|
1742
1740
|
};
|
|
1743
1741
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1753,7 +1751,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1753
1751
|
]), {
|
|
1754
1752
|
getCellBounds: g,
|
|
1755
1753
|
getEstimatedSize: C,
|
|
1756
|
-
scrollToIndex:
|
|
1754
|
+
scrollToIndex: Y(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1757
1755
|
let s = Bt({
|
|
1758
1756
|
align: t,
|
|
1759
1757
|
cachedBounds: h,
|
|
@@ -1771,7 +1769,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1771
1769
|
scrollOffset: s
|
|
1772
1770
|
}), typeof e.scrollTo != "function") {
|
|
1773
1771
|
let e = w(s);
|
|
1774
|
-
|
|
1772
|
+
Q(_, e) || v(e);
|
|
1775
1773
|
}
|
|
1776
1774
|
return s;
|
|
1777
1775
|
}
|
|
@@ -1783,25 +1781,25 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1783
1781
|
};
|
|
1784
1782
|
}
|
|
1785
1783
|
function Kt(e) {
|
|
1786
|
-
return
|
|
1784
|
+
return R(() => e, Object.values(e));
|
|
1787
1785
|
}
|
|
1788
1786
|
function qt(e, t) {
|
|
1789
1787
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1790
|
-
return
|
|
1788
|
+
return Q(n, a) && Q(r, o) && Q(i, s);
|
|
1791
1789
|
}
|
|
1792
1790
|
function Jt(e) {
|
|
1793
1791
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1794
1792
|
}
|
|
1795
1793
|
var Yt = "data-react-window-index";
|
|
1796
1794
|
function Xt({ 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 }) {
|
|
1797
|
-
let m = Kt(u), h =
|
|
1795
|
+
let m = Kt(u), h = R(() => be(s, qt), [s]), [g, _] = B(null), v = Jt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Gt({
|
|
1798
1796
|
containerElement: g,
|
|
1799
1797
|
containerStyle: f,
|
|
1800
1798
|
defaultContainerSize: n,
|
|
1801
1799
|
direction: "vertical",
|
|
1802
1800
|
itemCount: c,
|
|
1803
1801
|
itemProps: m,
|
|
1804
|
-
itemSize:
|
|
1802
|
+
itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1805
1803
|
onResize: i,
|
|
1806
1804
|
overscanCount: o
|
|
1807
1805
|
});
|
|
@@ -1834,7 +1832,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1834
1832
|
l,
|
|
1835
1833
|
S,
|
|
1836
1834
|
w
|
|
1837
|
-
]),
|
|
1835
|
+
]), L(() => {
|
|
1838
1836
|
S >= 0 && w >= 0 && a && a({
|
|
1839
1837
|
startIndex: C,
|
|
1840
1838
|
stopIndex: T
|
|
@@ -1849,7 +1847,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1849
1847
|
w,
|
|
1850
1848
|
T
|
|
1851
1849
|
]);
|
|
1852
|
-
let E =
|
|
1850
|
+
let E = R(() => {
|
|
1853
1851
|
let e = [];
|
|
1854
1852
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1855
1853
|
let n = y(t);
|
|
@@ -1880,7 +1878,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1880
1878
|
m,
|
|
1881
1879
|
S,
|
|
1882
1880
|
w
|
|
1883
|
-
]), D = /* @__PURE__ */
|
|
1881
|
+
]), D = /* @__PURE__ */ H("div", {
|
|
1884
1882
|
"aria-hidden": !0,
|
|
1885
1883
|
style: {
|
|
1886
1884
|
height: b(),
|
|
@@ -1912,41 +1910,41 @@ var Zt = {
|
|
|
1912
1910
|
itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
|
|
1913
1911
|
itemSelectedText: "_itemSelectedText_5skzl_41"
|
|
1914
1912
|
}, Qt = 44, $t = 8, en = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
|
|
1915
|
-
let m = r[e],
|
|
1916
|
-
return /* @__PURE__ */
|
|
1913
|
+
let m = r[e], h = q(m.iconUrl, m.type, m.displayName ?? m.id, g.SM), v = m.id === i;
|
|
1914
|
+
return /* @__PURE__ */ H("div", {
|
|
1917
1915
|
style: t,
|
|
1918
1916
|
...n,
|
|
1919
|
-
children: /* @__PURE__ */
|
|
1917
|
+
children: /* @__PURE__ */ H(p, {
|
|
1920
1918
|
type: "button",
|
|
1921
1919
|
"aria-current": v ? "true" : void 0,
|
|
1922
|
-
className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c,
|
|
1923
|
-
iconBefore: /* @__PURE__ */
|
|
1920
|
+
className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c, W.modelMenuItem, v && W.modelMenuItemSelected),
|
|
1921
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
1924
1922
|
className: Zt.itemIcon,
|
|
1925
|
-
children:
|
|
1923
|
+
children: h
|
|
1926
1924
|
}),
|
|
1927
|
-
label: /* @__PURE__ */
|
|
1925
|
+
label: /* @__PURE__ */ U("span", {
|
|
1928
1926
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1929
|
-
children: [/* @__PURE__ */
|
|
1927
|
+
children: [/* @__PURE__ */ H(S, {
|
|
1930
1928
|
text: m.displayName ?? m.id,
|
|
1931
1929
|
query: o,
|
|
1932
1930
|
maxLines: 1,
|
|
1933
1931
|
className: l(a, "min-w-0 flex-1 text-start")
|
|
1934
|
-
}), v && /* @__PURE__ */
|
|
1935
|
-
size:
|
|
1932
|
+
}), v && /* @__PURE__ */ H(oe, {
|
|
1933
|
+
size: g.SM,
|
|
1936
1934
|
className: Zt.checkIcon,
|
|
1937
1935
|
"aria-hidden": !0,
|
|
1938
|
-
stroke:
|
|
1936
|
+
stroke: _
|
|
1939
1937
|
})]
|
|
1940
1938
|
}),
|
|
1941
1939
|
onClick: () => f(m.id)
|
|
1942
1940
|
})
|
|
1943
1941
|
});
|
|
1944
1942
|
}, tn = ({ 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: _ }) => {
|
|
1945
|
-
let [
|
|
1946
|
-
|
|
1943
|
+
let [v, b] = B("");
|
|
1944
|
+
L(() => {
|
|
1947
1945
|
e || b("");
|
|
1948
1946
|
}, [e]);
|
|
1949
|
-
let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Mt(a,
|
|
1947
|
+
let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Mt(a, v) : [], T = (e) => {
|
|
1950
1948
|
s(e), i();
|
|
1951
1949
|
}, E = _?.colors, D = c({
|
|
1952
1950
|
"--ci-sheet-divider": g?.divider,
|
|
@@ -1958,32 +1956,32 @@ var Zt = {
|
|
|
1958
1956
|
"--ci-sheet-selected-bg": E?.selectedItemBackground,
|
|
1959
1957
|
"--ci-sheet-selected-text": E?.selectedItemText
|
|
1960
1958
|
});
|
|
1961
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ H(Me, {
|
|
1962
1960
|
isOpen: e,
|
|
1963
1961
|
title: t,
|
|
1964
1962
|
closeLabel: n,
|
|
1965
1963
|
onClose: i,
|
|
1966
1964
|
style: p,
|
|
1967
1965
|
titleClassName: m,
|
|
1968
|
-
className: l("max-h-[80dvh]", _?.className,
|
|
1966
|
+
className: l("max-h-[80dvh]", _?.className, W.modelMenu),
|
|
1969
1967
|
colors: g?.shell,
|
|
1970
|
-
children: /* @__PURE__ */
|
|
1968
|
+
children: /* @__PURE__ */ U("div", {
|
|
1971
1969
|
className: "contents",
|
|
1972
1970
|
style: D,
|
|
1973
|
-
children: [x && !S && /* @__PURE__ */
|
|
1971
|
+
children: [x && !S && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
1974
1972
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
1975
|
-
className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName,
|
|
1976
|
-
children: /* @__PURE__ */
|
|
1977
|
-
value:
|
|
1973
|
+
className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName, W.modelMenuSearch),
|
|
1974
|
+
children: /* @__PURE__ */ H(j, {
|
|
1975
|
+
value: v,
|
|
1978
1976
|
placeholder: r,
|
|
1979
|
-
size:
|
|
1977
|
+
size: y.Standard,
|
|
1980
1978
|
onChange: (e) => b(e ?? "")
|
|
1981
1979
|
})
|
|
1982
|
-
}), /* @__PURE__ */
|
|
1980
|
+
}), /* @__PURE__ */ H("div", { className: l(Zt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ H(At, { loadingLabel: u }) : C ? /* @__PURE__ */ H("div", {
|
|
1983
1981
|
role: "list",
|
|
1984
1982
|
className: l(Zt.stateLabel, h, "px-4 py-4"),
|
|
1985
1983
|
children: C
|
|
1986
|
-
}) : /* @__PURE__ */
|
|
1984
|
+
}) : /* @__PURE__ */ H(Xt, {
|
|
1987
1985
|
role: "list",
|
|
1988
1986
|
className: "overflow-y-auto",
|
|
1989
1987
|
style: { height: Math.min(w.length, $t) * Qt },
|
|
@@ -1994,7 +1992,7 @@ var Zt = {
|
|
|
1994
1992
|
items: w,
|
|
1995
1993
|
selectedDeploymentId: o,
|
|
1996
1994
|
labelClassName: h,
|
|
1997
|
-
query:
|
|
1995
|
+
query: v,
|
|
1998
1996
|
itemClassName: _?.itemClassName,
|
|
1999
1997
|
selectedItemClassName: _?.selectedItemClassName,
|
|
2000
1998
|
hasSelectedBackground: !!E?.selectedItemBackground,
|
|
@@ -2004,8 +2002,8 @@ var Zt = {
|
|
|
2004
2002
|
})]
|
|
2005
2003
|
})
|
|
2006
2004
|
});
|
|
2007
|
-
}, nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: m, onPickerOpenChange:
|
|
2008
|
-
let [y,
|
|
2005
|
+
}, nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: m, onPickerOpenChange: h }) => {
|
|
2006
|
+
let [y, b] = B(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Pt({
|
|
2009
2007
|
deployments: e,
|
|
2010
2008
|
selectedDeploymentId: t,
|
|
2011
2009
|
onDeploymentChange: n,
|
|
@@ -2013,40 +2011,40 @@ var Zt = {
|
|
|
2013
2011
|
styles: i
|
|
2014
2012
|
});
|
|
2015
2013
|
if (!e) return null;
|
|
2016
|
-
let A = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0,
|
|
2017
|
-
size:
|
|
2018
|
-
className: l(
|
|
2014
|
+
let A = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, j = /* @__PURE__ */ H(se, {
|
|
2015
|
+
size: g.SM,
|
|
2016
|
+
className: l(K.modelSelectorCaret, W.modelSelectorCaret),
|
|
2019
2017
|
"aria-hidden": !0,
|
|
2020
|
-
stroke:
|
|
2021
|
-
}),
|
|
2022
|
-
className: l("flex shrink-0 items-center",
|
|
2018
|
+
stroke: _
|
|
2019
|
+
}), M = /* @__PURE__ */ H("span", {
|
|
2020
|
+
className: l("flex shrink-0 items-center", W.modelSelectorIcon),
|
|
2023
2021
|
children: S
|
|
2024
2022
|
});
|
|
2025
|
-
if (o) return /* @__PURE__ */
|
|
2023
|
+
if (o) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(x, {
|
|
2026
2024
|
tooltipProps: { tooltip: w },
|
|
2027
|
-
icon: /* @__PURE__ */
|
|
2025
|
+
icon: /* @__PURE__ */ U("div", {
|
|
2028
2026
|
className: "flex items-center gap-1",
|
|
2029
|
-
children: [
|
|
2027
|
+
children: [M, j]
|
|
2030
2028
|
}),
|
|
2031
2029
|
"aria-label": C,
|
|
2032
2030
|
onClick: () => {
|
|
2033
|
-
c ||
|
|
2031
|
+
c || b(!0);
|
|
2034
2032
|
},
|
|
2035
|
-
className: l("w-[50px]",
|
|
2036
|
-
}), d ? /* @__PURE__ */
|
|
2033
|
+
className: l("w-[50px]", K.modelSelectorButton, A, W.modelSelectorButton)
|
|
2034
|
+
}), d ? /* @__PURE__ */ H(Me, {
|
|
2037
2035
|
isOpen: y,
|
|
2038
2036
|
title: r?.ariaLabel ?? "Select model",
|
|
2039
2037
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2040
|
-
onClose: () =>
|
|
2038
|
+
onClose: () => b(!1),
|
|
2041
2039
|
style: u,
|
|
2042
|
-
className: l(i?.className,
|
|
2043
|
-
children: d(() =>
|
|
2044
|
-
}) : /* @__PURE__ */
|
|
2040
|
+
className: l(i?.className, W.modelMenu),
|
|
2041
|
+
children: d(() => b(!1))
|
|
2042
|
+
}) : /* @__PURE__ */ H(tn, {
|
|
2045
2043
|
isOpen: y,
|
|
2046
2044
|
title: r?.ariaLabel ?? "Select model",
|
|
2047
2045
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2048
2046
|
searchPlaceholder: r?.searchPlaceholder ?? "Search",
|
|
2049
|
-
onClose: () =>
|
|
2047
|
+
onClose: () => b(!1),
|
|
2050
2048
|
deployments: e,
|
|
2051
2049
|
selectedDeploymentId: t,
|
|
2052
2050
|
onSelect: (e) => n?.(e),
|
|
@@ -2058,113 +2056,113 @@ var Zt = {
|
|
|
2058
2056
|
})] });
|
|
2059
2057
|
if (d) {
|
|
2060
2058
|
let e = T ? `${w} · ${T}` : w;
|
|
2061
|
-
return /* @__PURE__ */
|
|
2059
|
+
return /* @__PURE__ */ H(v, {
|
|
2062
2060
|
placement: "top-end",
|
|
2063
2061
|
matchReferenceWidth: !1,
|
|
2064
2062
|
open: f,
|
|
2065
|
-
onOpenChange:
|
|
2063
|
+
onOpenChange: h,
|
|
2066
2064
|
trigger: [],
|
|
2067
2065
|
outsideClosable: !0,
|
|
2068
|
-
renderOverlay: () => d(() =>
|
|
2069
|
-
listClassName: l("!w-[368px] !bg-layer-raised", i?.className,
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2066
|
+
renderOverlay: () => d(() => h?.(!1)),
|
|
2067
|
+
listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
|
|
2068
|
+
children: /* @__PURE__ */ H(p, {
|
|
2071
2069
|
"aria-label": C,
|
|
2072
2070
|
"aria-disabled": c || void 0,
|
|
2073
2071
|
tooltipProps: { tooltip: e },
|
|
2074
|
-
className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5",
|
|
2072
|
+
className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5", K.modelSelectorButton, A, c && K.modelSelectorButtonDisabled, W.modelSelectorButton),
|
|
2075
2073
|
onClick: () => {
|
|
2076
2074
|
!a && !c && m?.();
|
|
2077
2075
|
},
|
|
2078
|
-
iconBefore:
|
|
2079
|
-
iconAfter:
|
|
2076
|
+
iconBefore: M,
|
|
2077
|
+
iconAfter: j,
|
|
2080
2078
|
textClassName: "min-w-0",
|
|
2081
|
-
label: /* @__PURE__ */
|
|
2079
|
+
label: /* @__PURE__ */ U("span", {
|
|
2082
2080
|
className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
|
|
2083
|
-
children: [/* @__PURE__ */
|
|
2084
|
-
className: l("dial-small-text max-w-[180px] shrink-0 truncate",
|
|
2081
|
+
children: [/* @__PURE__ */ H("span", {
|
|
2082
|
+
className: l("dial-small-text max-w-[180px] shrink-0 truncate", K.modelSelectorName),
|
|
2085
2083
|
children: w
|
|
2086
|
-
}), T && /* @__PURE__ */
|
|
2087
|
-
className: l("dial-tiny-text min-w-0 truncate",
|
|
2084
|
+
}), T && /* @__PURE__ */ H("span", {
|
|
2085
|
+
className: l("dial-tiny-text min-w-0 truncate", K.modelSelectorVersion),
|
|
2088
2086
|
children: T
|
|
2089
2087
|
})]
|
|
2090
2088
|
})
|
|
2091
2089
|
})
|
|
2092
2090
|
});
|
|
2093
2091
|
}
|
|
2094
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ H("div", {
|
|
2095
2093
|
className: l(c && A),
|
|
2096
2094
|
"aria-disabled": c || void 0,
|
|
2097
|
-
children: /* @__PURE__ */
|
|
2095
|
+
children: /* @__PURE__ */ H(v, {
|
|
2098
2096
|
items: E,
|
|
2099
2097
|
menuHeader: D,
|
|
2100
2098
|
placement: "bottom-end",
|
|
2101
2099
|
matchReferenceWidth: !1,
|
|
2102
2100
|
maxDropdownHeight: s,
|
|
2103
|
-
listClassName: l("!w-[240px]", i?.className,
|
|
2101
|
+
listClassName: l("!w-[240px]", i?.className, W.modelMenu),
|
|
2104
2102
|
listStyle: O,
|
|
2105
2103
|
disabled: c,
|
|
2106
2104
|
onOpenChange: c ? void 0 : k,
|
|
2107
|
-
children: /* @__PURE__ */
|
|
2105
|
+
children: /* @__PURE__ */ H(p, {
|
|
2108
2106
|
"aria-label": C,
|
|
2109
2107
|
"aria-disabled": c || void 0,
|
|
2110
2108
|
tooltipProps: { tooltip: w },
|
|
2111
|
-
iconBefore:
|
|
2112
|
-
iconAfter:
|
|
2113
|
-
className: l("h-auto gap-1 !rounded-full !border-0 p-1.5",
|
|
2109
|
+
iconBefore: M,
|
|
2110
|
+
iconAfter: j,
|
|
2111
|
+
className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", K.modelSelectorButton, c && K.modelSelectorButtonDisabled, W.modelSelectorButton)
|
|
2114
2112
|
})
|
|
2115
2113
|
})
|
|
2116
2114
|
});
|
|
2117
|
-
},
|
|
2118
|
-
let
|
|
2119
|
-
"--ci-bg":
|
|
2120
|
-
"--ci-text":
|
|
2121
|
-
"--ci-border":
|
|
2122
|
-
"--ci-border-focus":
|
|
2123
|
-
"--ci-placeholder":
|
|
2124
|
-
"--ci-text-disabled":
|
|
2125
|
-
"--ci-model-selector-caret-color":
|
|
2126
|
-
"--ci-model-selector-hover-bg":
|
|
2127
|
-
"--ci-model-selector-disabled-color":
|
|
2128
|
-
"--ci-model-selector-name-color":
|
|
2129
|
-
"--ci-model-selector-version-color":
|
|
2130
|
-
"--ci-voice-error":
|
|
2131
|
-
"--ci-voice-waveform":
|
|
2132
|
-
"--ci-voice-accent":
|
|
2133
|
-
"--ci-mention-highlight-bg":
|
|
2134
|
-
"--ci-mention-highlight-text":
|
|
2135
|
-
"--ci-mention-highlight-unsupported-bg":
|
|
2136
|
-
"--ci-mention-highlight-unsupported-text":
|
|
2137
|
-
}), [
|
|
2115
|
+
}, rn = ye(({ 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: y = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: O, sendLabel: k, sendTooltip: A, emptyMessageTooltip: j, stopLabel: M, micLabel: ee = "Dictate", recordVoiceLabel: N = "Record voice", stopRecordingLabel: te, discardRecordingLabel: ne, colors: P, typography: F, attachmentTray: re, modelMenu: ie, className: ae, pendingDropFiles: oe = [], onDropFilesConsumed: se, pendingAttachments: ce = [], onPendingAttachmentsConsumed: de, pasteTextThreshold: fe = 4e3, maxMessageLength: pe = 5e4, deployments: me, selectedDeploymentId: he, onDeploymentChange: ge, modelSelectorLabels: _e, initialAttachments: ve = [], hideAddButton: ye = !1, hideAttachFile: be = !1, hideActionBar: xe = !1, actionRowLayout: we = ot.Stacked, isInlineActionRowAllowedBelowDesktop: Ee = !1, renderFooterActions: De, isInputDisabled: ke = !1, isModelSelectorDisabled: Ae = !1, isSendDisabled: je = !1, isAudioMessageSupported: Me = !1, isVoiceRecordingSupported: Ne = Me, onTranscribeAudio: Fe, transcribingLabel: Ie, voiceErrorLabel: Le, sendOnEnter: Re = at.Enter, prefixAttachments: Ve = [], onRemovePrefixAttachment: He, chatSettings: Ge, toolsMenuItems: Ke, onToolToggle: Xe, canRemoveTools: et = !0, toolsMenuTitle: tt, toolsBackLabel: nt, toolsChipLabels: rt, menuOverlays: st, activeMentions: ct, onBackspaceAtCaret: lt, caretPositionOverride: ut, commandMenu: G, autoFocus: dt = !1, messageHistory: ft, onDialFileSystemClick: pt, dialFileSystemLabel: mt, validateAttachment: ht, onAttachmentClick: gt, modelPickerOverlay: vt, maximumAttachmentsAmount: yt, onAttachmentsLimitExceeded: xt, isAttachmentsEnabled: St = !0, isTextAttachmentsAllowed: Ct = !0, usageLimitsSlot: wt, onMessageTooLong: Ot }, kt) => {
|
|
2116
|
+
let At = d(), [jt, Mt] = B(!1), q = Ue(ft), Nt = ct ?? [], Pt = Nt.length > 0, Ft = R(() => c({
|
|
2117
|
+
"--ci-bg": P?.background,
|
|
2118
|
+
"--ci-text": P?.text,
|
|
2119
|
+
"--ci-border": P?.border,
|
|
2120
|
+
"--ci-border-focus": P?.borderFocus,
|
|
2121
|
+
"--ci-placeholder": P?.placeholder,
|
|
2122
|
+
"--ci-text-disabled": P?.textDisabled,
|
|
2123
|
+
"--ci-model-selector-caret-color": P?.modelSelectorCaret,
|
|
2124
|
+
"--ci-model-selector-hover-bg": P?.modelSelectorHoverBg,
|
|
2125
|
+
"--ci-model-selector-disabled-color": P?.modelSelectorDisabled,
|
|
2126
|
+
"--ci-model-selector-name-color": P?.modelSelectorName,
|
|
2127
|
+
"--ci-model-selector-version-color": P?.modelSelectorVersion,
|
|
2128
|
+
"--ci-voice-error": P?.voiceError,
|
|
2129
|
+
"--ci-voice-waveform": P?.voiceWaveform,
|
|
2130
|
+
"--ci-voice-accent": P?.voiceAccent,
|
|
2131
|
+
"--ci-mention-highlight-bg": P?.mentionHighlightBg,
|
|
2132
|
+
"--ci-mention-highlight-text": P?.mentionHighlightText,
|
|
2133
|
+
"--ci-mention-highlight-unsupported-bg": P?.mentionHighlightUnsupportedBg,
|
|
2134
|
+
"--ci-mention-highlight-unsupported-text": P?.mentionHighlightUnsupportedText
|
|
2135
|
+
}), [P]), It = R(() => pt ? [{
|
|
2138
2136
|
key: "dial-fs",
|
|
2139
|
-
label:
|
|
2140
|
-
icon: /* @__PURE__ */
|
|
2137
|
+
label: mt ?? "DIAL file system",
|
|
2138
|
+
icon: /* @__PURE__ */ H(le, {
|
|
2141
2139
|
size: f,
|
|
2142
2140
|
"aria-hidden": !0,
|
|
2143
|
-
stroke:
|
|
2141
|
+
stroke: _
|
|
2144
2142
|
}),
|
|
2145
|
-
onClick:
|
|
2146
|
-
}] : [], [
|
|
2143
|
+
onClick: pt
|
|
2144
|
+
}] : [], [pt, mt]), { message: J, setMessage: Y, textareaRef: X } = Je({
|
|
2147
2145
|
messageProp: e,
|
|
2148
2146
|
messageRevision: t
|
|
2149
2147
|
});
|
|
2150
|
-
|
|
2151
|
-
n !== void 0 &&
|
|
2152
|
-
}, [n,
|
|
2153
|
-
let { handleUndoKeyDown:
|
|
2148
|
+
L(() => {
|
|
2149
|
+
n !== void 0 && X.current?.focus();
|
|
2150
|
+
}, [n, X]), Se(kt, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
|
|
2151
|
+
let { handleUndoKeyDown: Lt } = Ze({
|
|
2154
2152
|
insertion: r,
|
|
2155
|
-
textareaRef:
|
|
2156
|
-
}), { isMenuOpen:
|
|
2157
|
-
config:
|
|
2158
|
-
message:
|
|
2159
|
-
}),
|
|
2160
|
-
|
|
2161
|
-
},
|
|
2153
|
+
textareaRef: X
|
|
2154
|
+
}), { isMenuOpen: Rt, query: Z, activeWordStart: Q, dismiss: zt, closeOnOutsidePress: Bt, handleCaretMove: Vt, handleValueChange: Ht, listboxId: Ut, overlayRef: Wt, activeOptionId: Gt, moveActiveOption: Kt, getActiveOption: qt } = Be({
|
|
2155
|
+
config: G,
|
|
2156
|
+
message: J
|
|
2157
|
+
}), Jt = () => {
|
|
2158
|
+
Vt(X.current?.selectionStart ?? J.length);
|
|
2159
|
+
}, Yt = () => {
|
|
2162
2160
|
requestAnimationFrame(() => {
|
|
2163
|
-
|
|
2161
|
+
Vt(X.current?.selectionStart ?? J.length);
|
|
2164
2162
|
});
|
|
2165
|
-
},
|
|
2166
|
-
e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" ||
|
|
2167
|
-
},
|
|
2163
|
+
}, Xt = (e) => {
|
|
2164
|
+
e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Vt(e.currentTarget.selectionStart ?? J.length);
|
|
2165
|
+
}, Zt = G?.emptyQueryHint != null, Qt = G != null && Q != null ? Q + G.triggerPrefix.length : null, $t = Qt != null && J.slice(Qt).split("\n", 1)[0] !== "", en = Zt && Rt && Z === "" && Qt != null && !$t, tn = G != null && Rt ? Q ?? 0 : null, rn = z(null), an = z(null), [on, sn] = B(null), cn = I(() => {
|
|
2168
2166
|
let e = rn.current, t = an.current;
|
|
2169
2167
|
if (e == null || t == null) {
|
|
2170
2168
|
sn(null);
|
|
@@ -2180,250 +2178,250 @@ var Zt = {
|
|
|
2180
2178
|
cn();
|
|
2181
2179
|
}, [
|
|
2182
2180
|
cn,
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
]),
|
|
2186
|
-
if (
|
|
2187
|
-
let e =
|
|
2181
|
+
tn,
|
|
2182
|
+
J
|
|
2183
|
+
]), L(() => {
|
|
2184
|
+
if (tn == null) return;
|
|
2185
|
+
let e = X.current;
|
|
2188
2186
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2189
2187
|
let t = new ResizeObserver(cn);
|
|
2190
2188
|
return t.observe(e), () => t.disconnect();
|
|
2191
2189
|
}, [
|
|
2192
|
-
|
|
2193
|
-
|
|
2190
|
+
tn,
|
|
2191
|
+
X,
|
|
2194
2192
|
cn
|
|
2195
2193
|
]);
|
|
2196
2194
|
let { mirrorRef: ln, selectionRects: un, updateSelectionRects: dn } = qe({
|
|
2197
|
-
textareaRef:
|
|
2198
|
-
message:
|
|
2199
|
-
hasActiveMentions:
|
|
2200
|
-
}), fn =
|
|
2201
|
-
if (
|
|
2202
|
-
let t = `${
|
|
2203
|
-
if (
|
|
2204
|
-
let r =
|
|
2205
|
-
|
|
2195
|
+
textareaRef: X,
|
|
2196
|
+
message: J,
|
|
2197
|
+
hasActiveMentions: Pt
|
|
2198
|
+
}), fn = I((e) => {
|
|
2199
|
+
if (G == null || (zt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Q == null)) return;
|
|
2200
|
+
let t = `${G.triggerPrefix}${Z}`, n = Q + t.length;
|
|
2201
|
+
if (J.slice(Q, n) !== t) return;
|
|
2202
|
+
let r = J.slice(0, Q) + J.slice(n);
|
|
2203
|
+
Y(r), q.notifyChange(), u?.(r);
|
|
2206
2204
|
}, [
|
|
2207
|
-
|
|
2208
|
-
Bt,
|
|
2205
|
+
G,
|
|
2209
2206
|
zt,
|
|
2210
|
-
q,
|
|
2211
2207
|
Z,
|
|
2212
2208
|
J,
|
|
2213
|
-
|
|
2209
|
+
Q,
|
|
2210
|
+
Y,
|
|
2211
|
+
q,
|
|
2214
2212
|
u,
|
|
2215
|
-
|
|
2216
|
-
]), pn =
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
}, [
|
|
2213
|
+
X
|
|
2214
|
+
]), pn = z(void 0);
|
|
2215
|
+
L(() => {
|
|
2216
|
+
ut == null || pn.current === t || (pn.current = t, X.current?.setSelectionRange(ut, ut), Vt(ut));
|
|
2217
|
+
}, [J]);
|
|
2220
2218
|
let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Pe({
|
|
2221
|
-
initialAttachments:
|
|
2219
|
+
initialAttachments: ve,
|
|
2222
2220
|
onUploadAttachment: a,
|
|
2223
2221
|
onAttachmentsChange: p,
|
|
2224
|
-
validateAttachment:
|
|
2225
|
-
pendingDropFiles:
|
|
2226
|
-
onDropFilesConsumed:
|
|
2227
|
-
pendingAttachments:
|
|
2228
|
-
onPendingAttachmentsConsumed:
|
|
2229
|
-
onExpandPastedText:
|
|
2230
|
-
|
|
2231
|
-
}, [
|
|
2232
|
-
maximumAttachmentsAmount:
|
|
2233
|
-
baseAttachmentsAmount:
|
|
2234
|
-
onAttachmentsLimitExceeded:
|
|
2235
|
-
}), Sn =
|
|
2222
|
+
validateAttachment: ht,
|
|
2223
|
+
pendingDropFiles: oe,
|
|
2224
|
+
onDropFilesConsumed: se,
|
|
2225
|
+
pendingAttachments: ce,
|
|
2226
|
+
onPendingAttachmentsConsumed: de,
|
|
2227
|
+
onExpandPastedText: I((e) => {
|
|
2228
|
+
Y((t) => t ? `${t}\n${e}` : e);
|
|
2229
|
+
}, [Y]),
|
|
2230
|
+
maximumAttachmentsAmount: yt,
|
|
2231
|
+
baseAttachmentsAmount: Ve.length,
|
|
2232
|
+
onAttachmentsLimitExceeded: xt
|
|
2233
|
+
}), Sn = I((e) => {
|
|
2236
2234
|
gn(hn([e]));
|
|
2237
|
-
}, [gn, hn]), Cn =
|
|
2238
|
-
wn.current =
|
|
2239
|
-
let [Tn, En] =
|
|
2235
|
+
}, [gn, hn]), Cn = z(!1), wn = z(J);
|
|
2236
|
+
wn.current = J;
|
|
2237
|
+
let [Tn, En] = B({
|
|
2240
2238
|
text: "",
|
|
2241
2239
|
revision: 0
|
|
2242
2240
|
}), { state: Dn, analyserNodeRef: On, errorMessage: kn, startRecording: An, stopRecording: jn, discardRecording: Mn } = it({
|
|
2243
2241
|
onAttachAudio: Sn,
|
|
2244
|
-
onTranscribeAudio:
|
|
2245
|
-
onTranscript:
|
|
2242
|
+
onTranscribeAudio: Fe,
|
|
2243
|
+
onTranscript: I((e) => {
|
|
2246
2244
|
let t = e.trim();
|
|
2247
2245
|
if (t) {
|
|
2248
2246
|
let e = wn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2249
|
-
wn.current = n,
|
|
2247
|
+
wn.current = n, Y(n), En((e) => ({
|
|
2250
2248
|
text: t,
|
|
2251
2249
|
revision: e.revision + 1
|
|
2252
|
-
})),
|
|
2250
|
+
})), q.notifyChange(), u?.(n);
|
|
2253
2251
|
}
|
|
2254
2252
|
Cn.current = !0;
|
|
2255
2253
|
}, [
|
|
2256
|
-
|
|
2257
|
-
|
|
2254
|
+
Y,
|
|
2255
|
+
q,
|
|
2258
2256
|
u
|
|
2259
2257
|
]),
|
|
2260
|
-
errorLabel:
|
|
2258
|
+
errorLabel: Le
|
|
2261
2259
|
}), $ = Dn === Qe.Recording || Dn === Qe.Processing;
|
|
2262
|
-
|
|
2263
|
-
(Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1,
|
|
2264
|
-
}, [Dn,
|
|
2265
|
-
let Nn =
|
|
2260
|
+
L(() => {
|
|
2261
|
+
(Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1, X.current?.focus());
|
|
2262
|
+
}, [Dn, X]);
|
|
2263
|
+
let Nn = z(null), Pn = z(null), Fn = St && Ct, { handlePaste: In } = Oe(gn, Fn ? fe : Infinity), Ln = I((e) => {
|
|
2266
2264
|
if (!Fn) {
|
|
2267
2265
|
let t = e.clipboardData.getData("text/plain");
|
|
2268
|
-
t.length >=
|
|
2266
|
+
t.length >= pe && Ot?.(t.length, pe);
|
|
2269
2267
|
}
|
|
2270
2268
|
In(e);
|
|
2271
2269
|
}, [
|
|
2272
2270
|
Fn,
|
|
2273
|
-
|
|
2274
|
-
|
|
2271
|
+
pe,
|
|
2272
|
+
Ot,
|
|
2275
2273
|
In
|
|
2276
|
-
]), Rn =
|
|
2277
|
-
|
|
2274
|
+
]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !je && !$, [Bn, Vn] = B([]);
|
|
2275
|
+
L(() => {
|
|
2278
2276
|
Vn([]);
|
|
2279
|
-
}, [(
|
|
2280
|
-
let Hn =
|
|
2281
|
-
let e =
|
|
2282
|
-
return
|
|
2277
|
+
}, [(Ke ?? []).map((e) => e.id).join("|")]);
|
|
2278
|
+
let Hn = R(() => {
|
|
2279
|
+
let e = Ke ?? [];
|
|
2280
|
+
return et ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
|
|
2283
2281
|
}, [
|
|
2284
|
-
|
|
2282
|
+
Ke,
|
|
2285
2283
|
Bn,
|
|
2286
|
-
|
|
2287
|
-
]), Un =
|
|
2288
|
-
Vn((t) => t.includes(e) ? t : [...t, e]),
|
|
2289
|
-
}, [
|
|
2290
|
-
if (
|
|
2291
|
-
if (
|
|
2292
|
-
|
|
2284
|
+
et
|
|
2285
|
+
]), Un = I((e) => {
|
|
2286
|
+
Vn((t) => t.includes(e) ? t : [...t, e]), Ke?.find((t) => t.id === e)?.isSelected && Xe?.(e);
|
|
2287
|
+
}, [Ke, Xe]), Wn = me === void 0 || he != null, Gn = Me && !s, Kn = async () => {
|
|
2288
|
+
if (je || $) return;
|
|
2289
|
+
if (J.length >= pe) {
|
|
2290
|
+
Ot?.(J.length, pe);
|
|
2293
2291
|
return;
|
|
2294
2292
|
}
|
|
2295
|
-
let e =
|
|
2296
|
-
|
|
2293
|
+
let e = J, t = mn;
|
|
2294
|
+
Y(""), q.reset();
|
|
2297
2295
|
try {
|
|
2298
2296
|
await i?.(e, t), t.forEach((e) => {
|
|
2299
2297
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2300
2298
|
}), _n([]);
|
|
2301
2299
|
} catch {
|
|
2302
|
-
|
|
2300
|
+
Y(e), _n(t);
|
|
2303
2301
|
}
|
|
2304
|
-
}, qn = (e) =>
|
|
2305
|
-
if (!
|
|
2306
|
-
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(),
|
|
2307
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(),
|
|
2302
|
+
}, qn = (e) => Re === at.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
|
|
2303
|
+
if (!Rt || e.nativeEvent.isComposing) return !1;
|
|
2304
|
+
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), zt(), !0;
|
|
2305
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Kt(e.key === "ArrowDown" ? ze.Next : ze.Previous), !0;
|
|
2308
2306
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2309
|
-
let t =
|
|
2307
|
+
let t = qt();
|
|
2310
2308
|
return t == null ? qn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2311
2309
|
}, Yn = (e) => {
|
|
2312
|
-
if (!$ && !
|
|
2313
|
-
if (!e.nativeEvent.isComposing && !
|
|
2310
|
+
if (!$ && !Lt(e) && !Jn(e)) {
|
|
2311
|
+
if (!e.nativeEvent.isComposing && !ke && !s) {
|
|
2314
2312
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2315
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2313
|
+
let t = e.currentTarget.selectionStart ?? 0, n = q.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
2316
2314
|
if (n !== null) {
|
|
2317
|
-
e.preventDefault(),
|
|
2315
|
+
e.preventDefault(), Y(n);
|
|
2318
2316
|
return;
|
|
2319
2317
|
}
|
|
2320
2318
|
}
|
|
2321
|
-
if (e.key === "Backspace" &&
|
|
2322
|
-
let t =
|
|
2319
|
+
if (e.key === "Backspace" && lt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
|
|
2320
|
+
let t = lt(e.currentTarget.selectionStart);
|
|
2323
2321
|
if (t != null) {
|
|
2324
2322
|
e.preventDefault();
|
|
2325
2323
|
let n = e.currentTarget;
|
|
2326
|
-
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n,
|
|
2324
|
+
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
|
|
2327
2325
|
return;
|
|
2328
2326
|
}
|
|
2329
2327
|
}
|
|
2330
2328
|
}
|
|
2331
|
-
e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !
|
|
2329
|
+
e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !ke && Kn());
|
|
2332
2330
|
}
|
|
2333
2331
|
}, Xn = (e) => {
|
|
2334
2332
|
let t = Array.from(e.target.files ?? []);
|
|
2335
2333
|
if (t.length === 0) return;
|
|
2336
2334
|
let n = hn(t);
|
|
2337
2335
|
e.target.value = "", gn(n);
|
|
2338
|
-
}, Zn =
|
|
2336
|
+
}, Zn = R(() => {
|
|
2339
2337
|
let e = [];
|
|
2340
|
-
return
|
|
2341
|
-
offset:
|
|
2342
|
-
node: /* @__PURE__ */
|
|
2338
|
+
return tn != null && e.push({
|
|
2339
|
+
offset: tn,
|
|
2340
|
+
node: /* @__PURE__ */ H("span", {
|
|
2343
2341
|
ref: rn,
|
|
2344
2342
|
"aria-hidden": !0,
|
|
2345
2343
|
className: "inline-block h-[1lh] w-0 align-text-top"
|
|
2346
2344
|
}, "caret-marker")
|
|
2347
|
-
}),
|
|
2348
|
-
offset:
|
|
2349
|
-
node: /* @__PURE__ */
|
|
2350
|
-
className:
|
|
2345
|
+
}), en && G != null && Qt != null && e.push({
|
|
2346
|
+
offset: Qt,
|
|
2347
|
+
node: /* @__PURE__ */ H("span", {
|
|
2348
|
+
className: K.commandHint,
|
|
2351
2349
|
"aria-hidden": !0,
|
|
2352
2350
|
"data-mirror-synthetic": !0,
|
|
2353
|
-
children:
|
|
2351
|
+
children: G.emptyQueryHint
|
|
2354
2352
|
}, "command-hint")
|
|
2355
2353
|
}), e;
|
|
2356
2354
|
}, [
|
|
2357
|
-
Q,
|
|
2358
2355
|
tn,
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2356
|
+
en,
|
|
2357
|
+
G,
|
|
2358
|
+
Qt
|
|
2359
|
+
]), Qn = /* @__PURE__ */ H("textarea", {
|
|
2360
|
+
className: l(K.textarea, (Pt || Zn.length > 0) && K.textareaMentionMode, F?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2361
|
+
ref: X,
|
|
2362
|
+
autoFocus: dt,
|
|
2363
|
+
value: J,
|
|
2366
2364
|
onChange: (e) => {
|
|
2367
|
-
|
|
2365
|
+
Y(e.target.value), q.notifyChange();
|
|
2368
2366
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2369
|
-
|
|
2367
|
+
Ht(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2370
2368
|
},
|
|
2371
2369
|
onSelect: dn,
|
|
2372
|
-
onFocus:
|
|
2373
|
-
onClick:
|
|
2370
|
+
onFocus: Yt,
|
|
2371
|
+
onClick: Jt,
|
|
2374
2372
|
onKeyDown: Yn,
|
|
2375
|
-
onKeyUp:
|
|
2373
|
+
onKeyUp: Xt,
|
|
2376
2374
|
onPaste: Ln,
|
|
2377
2375
|
placeholder: m,
|
|
2378
|
-
"aria-label":
|
|
2379
|
-
"aria-autocomplete":
|
|
2380
|
-
"aria-controls":
|
|
2381
|
-
"aria-activedescendant":
|
|
2382
|
-
"aria-hidden":
|
|
2383
|
-
disabled:
|
|
2376
|
+
"aria-label": h,
|
|
2377
|
+
"aria-autocomplete": G == null ? void 0 : "list",
|
|
2378
|
+
"aria-controls": Rt ? Ut : void 0,
|
|
2379
|
+
"aria-activedescendant": Gt ?? void 0,
|
|
2380
|
+
"aria-hidden": Pt ? !0 : void 0,
|
|
2381
|
+
disabled: ke,
|
|
2384
2382
|
readOnly: $,
|
|
2385
2383
|
rows: 1
|
|
2386
|
-
}), $n =
|
|
2384
|
+
}), $n = G == null ? Qn : /* @__PURE__ */ U(V, { children: [Qn, /* @__PURE__ */ H("div", {
|
|
2387
2385
|
"aria-hidden": !0,
|
|
2388
|
-
className: l("pointer-events-none absolute",
|
|
2386
|
+
className: l("pointer-events-none absolute", F?.fontClassName || "dial-body-paragraph-text"),
|
|
2389
2387
|
style: {
|
|
2390
2388
|
left: on?.left ?? 0,
|
|
2391
2389
|
top: on?.top ?? 0
|
|
2392
2390
|
},
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2394
|
-
open:
|
|
2391
|
+
children: /* @__PURE__ */ H(v, {
|
|
2392
|
+
open: Rt,
|
|
2395
2393
|
onOpenChange: (e) => {
|
|
2396
|
-
e ||
|
|
2394
|
+
e || Bt();
|
|
2397
2395
|
},
|
|
2398
2396
|
placement: "top-start",
|
|
2399
2397
|
trigger: [],
|
|
2400
2398
|
initialFocus: -1,
|
|
2401
2399
|
matchReferenceWidth: !1,
|
|
2402
|
-
outsidePressIgnoreRef:
|
|
2403
|
-
renderOverlay: () => /* @__PURE__ */
|
|
2404
|
-
ref:
|
|
2405
|
-
role:
|
|
2406
|
-
"aria-label":
|
|
2407
|
-
children:
|
|
2408
|
-
query:
|
|
2409
|
-
caretPosition:
|
|
2400
|
+
outsidePressIgnoreRef: X,
|
|
2401
|
+
renderOverlay: () => /* @__PURE__ */ H("div", {
|
|
2402
|
+
ref: Wt,
|
|
2403
|
+
role: G.menuLabel == null ? void 0 : "group",
|
|
2404
|
+
"aria-label": G.menuLabel,
|
|
2405
|
+
children: G.renderMenu({
|
|
2406
|
+
query: Z,
|
|
2407
|
+
caretPosition: Q ?? 0,
|
|
2410
2408
|
close: fn,
|
|
2411
|
-
listboxId:
|
|
2412
|
-
activeOptionId:
|
|
2409
|
+
listboxId: Ut,
|
|
2410
|
+
activeOptionId: Gt
|
|
2413
2411
|
})
|
|
2414
2412
|
}),
|
|
2415
|
-
children: /* @__PURE__ */
|
|
2413
|
+
children: /* @__PURE__ */ H("span", {
|
|
2416
2414
|
"aria-hidden": !0,
|
|
2417
2415
|
className: "inline-block h-[1lh] w-0"
|
|
2418
2416
|
})
|
|
2419
2417
|
})
|
|
2420
|
-
})] }), er = /* @__PURE__ */
|
|
2418
|
+
})] }), er = /* @__PURE__ */ U("div", {
|
|
2421
2419
|
ref: an,
|
|
2422
2420
|
className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
|
|
2423
|
-
children: [(
|
|
2421
|
+
children: [(Pt || Zn.length > 0) && /* @__PURE__ */ U("div", {
|
|
2424
2422
|
ref: ln,
|
|
2425
|
-
className: l(
|
|
2426
|
-
children: [We(
|
|
2423
|
+
className: l(K.textarea, F?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
|
|
2424
|
+
children: [We(J, Nt, Zn, K.mentionHighlight, K.mentionHighlightUnsupported), un.map((e, t) => /* @__PURE__ */ H("div", {
|
|
2427
2425
|
"aria-hidden": !0,
|
|
2428
2426
|
className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
|
|
2429
2427
|
style: {
|
|
@@ -2434,48 +2432,48 @@ var Zt = {
|
|
|
2434
2432
|
}
|
|
2435
2433
|
}, `selection-${t}`))]
|
|
2436
2434
|
}), $n]
|
|
2437
|
-
}), tr =
|
|
2438
|
-
onAttachClick:
|
|
2439
|
-
attachLabel:
|
|
2435
|
+
}), tr = ye ? void 0 : /* @__PURE__ */ H(_t, {
|
|
2436
|
+
onAttachClick: be ? void 0 : () => Nn.current?.click(),
|
|
2437
|
+
attachLabel: y,
|
|
2440
2438
|
addMenuTitle: C,
|
|
2441
2439
|
menuTitle: w,
|
|
2442
2440
|
menuCloseLabel: T,
|
|
2443
|
-
style:
|
|
2444
|
-
isDisabled:
|
|
2445
|
-
chatSettings:
|
|
2446
|
-
extraMenuItems:
|
|
2447
|
-
onRecordVoice:
|
|
2448
|
-
recordVoiceLabel:
|
|
2449
|
-
toolsMenuItems:
|
|
2450
|
-
onToolToggle:
|
|
2451
|
-
toolsMenuTitle:
|
|
2452
|
-
toolsBackLabel:
|
|
2453
|
-
menuOverlays:
|
|
2454
|
-
getCaretPosition: () =>
|
|
2455
|
-
}), nr =
|
|
2456
|
-
className: l("flex",
|
|
2441
|
+
style: Ft,
|
|
2442
|
+
isDisabled: ke || $,
|
|
2443
|
+
chatSettings: Ge,
|
|
2444
|
+
extraMenuItems: It,
|
|
2445
|
+
onRecordVoice: Ne && St && !s && !$ ? () => An($e.Attachment) : void 0,
|
|
2446
|
+
recordVoiceLabel: N,
|
|
2447
|
+
toolsMenuItems: et ? Ke : void 0,
|
|
2448
|
+
onToolToggle: Xe,
|
|
2449
|
+
toolsMenuTitle: tt,
|
|
2450
|
+
toolsBackLabel: nt,
|
|
2451
|
+
menuOverlays: st,
|
|
2452
|
+
getCaretPosition: () => X.current?.selectionStart ?? J.length
|
|
2453
|
+
}), nr = we === ot.Inline && (!At || Ee), rr = tr && /* @__PURE__ */ H("div", {
|
|
2454
|
+
className: l("flex", W.addCluster),
|
|
2457
2455
|
children: tr
|
|
2458
|
-
}), ir = Hn.length > 0 &&
|
|
2459
|
-
className: l("min-w-0 flex-1",
|
|
2460
|
-
children: /* @__PURE__ */
|
|
2456
|
+
}), ir = Hn.length > 0 && Xe != null && /* @__PURE__ */ H("div", {
|
|
2457
|
+
className: l("min-w-0 flex-1", W.toolsChips),
|
|
2458
|
+
children: /* @__PURE__ */ H(bt, {
|
|
2461
2459
|
items: Hn,
|
|
2462
|
-
onToolToggle:
|
|
2460
|
+
onToolToggle: Xe,
|
|
2463
2461
|
onToolDismiss: Un,
|
|
2464
|
-
canRemove:
|
|
2465
|
-
removeLabel:
|
|
2466
|
-
stateOnLabel:
|
|
2467
|
-
stateOffLabel:
|
|
2462
|
+
canRemove: et,
|
|
2463
|
+
removeLabel: rt?.removeLabel,
|
|
2464
|
+
stateOnLabel: rt?.stateOnLabel,
|
|
2465
|
+
stateOffLabel: rt?.stateOffLabel
|
|
2468
2466
|
})
|
|
2469
2467
|
});
|
|
2470
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ U("div", {
|
|
2471
2469
|
ref: Pn,
|
|
2472
|
-
style:
|
|
2473
|
-
className: l(
|
|
2470
|
+
style: Ft,
|
|
2471
|
+
className: l(K.wrapper, ke && K.wrapperDisabled, ke && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", mn.length > 6 ? "py-4 ps-4" : "p-4", ae, W.wrapper),
|
|
2474
2472
|
children: [
|
|
2475
|
-
(
|
|
2476
|
-
attachments: [...
|
|
2473
|
+
(Ve.length > 0 || mn.length > 0) && /* @__PURE__ */ H(Te, {
|
|
2474
|
+
attachments: [...Ve, ...mn],
|
|
2477
2475
|
onRemove: (e) => {
|
|
2478
|
-
|
|
2476
|
+
Ve.some((t) => t.id === e) ? He?.(e) : vn(e);
|
|
2479
2477
|
},
|
|
2480
2478
|
onRetry: yn,
|
|
2481
2479
|
onExpand: bn,
|
|
@@ -2484,13 +2482,13 @@ var Zt = {
|
|
|
2484
2482
|
retryLabel: D,
|
|
2485
2483
|
uploadingLabel: O
|
|
2486
2484
|
},
|
|
2487
|
-
styles:
|
|
2488
|
-
onAttachmentClick:
|
|
2489
|
-
let t = [...
|
|
2490
|
-
t != null &&
|
|
2485
|
+
styles: re,
|
|
2486
|
+
onAttachmentClick: gt == null ? void 0 : (e) => {
|
|
2487
|
+
let t = [...Ve, ...mn].find((t) => t.id === e);
|
|
2488
|
+
t != null && gt(t);
|
|
2491
2489
|
}
|
|
2492
2490
|
}),
|
|
2493
|
-
!
|
|
2491
|
+
!ye && /* @__PURE__ */ H("input", {
|
|
2494
2492
|
ref: Nn,
|
|
2495
2493
|
type: "file",
|
|
2496
2494
|
multiple: !0,
|
|
@@ -2500,11 +2498,11 @@ var Zt = {
|
|
|
2500
2498
|
tabIndex: -1,
|
|
2501
2499
|
onChange: Xn
|
|
2502
2500
|
}),
|
|
2503
|
-
kn && /* @__PURE__ */
|
|
2501
|
+
kn && /* @__PURE__ */ H(b, {
|
|
2504
2502
|
text: kn,
|
|
2505
2503
|
className: "min-w-0 break-words px-1"
|
|
2506
2504
|
}),
|
|
2507
|
-
$ && /* @__PURE__ */
|
|
2505
|
+
$ && /* @__PURE__ */ H(Tt, {
|
|
2508
2506
|
embedded: !0,
|
|
2509
2507
|
state: Dn,
|
|
2510
2508
|
analyserNodeRef: On,
|
|
@@ -2512,112 +2510,112 @@ var Zt = {
|
|
|
2512
2510
|
onStop: jn,
|
|
2513
2511
|
onDiscard: Mn,
|
|
2514
2512
|
attachButton: tr,
|
|
2515
|
-
stopLabel:
|
|
2516
|
-
discardLabel:
|
|
2517
|
-
processingLabel:
|
|
2513
|
+
stopLabel: te,
|
|
2514
|
+
discardLabel: ne,
|
|
2515
|
+
processingLabel: Ie
|
|
2518
2516
|
}),
|
|
2519
|
-
!$ &&
|
|
2520
|
-
!$ && !
|
|
2517
|
+
!$ && xe && er,
|
|
2518
|
+
!$ && !xe && nr && ir && /* @__PURE__ */ H("div", {
|
|
2521
2519
|
className: "flex",
|
|
2522
2520
|
children: ir
|
|
2523
2521
|
}),
|
|
2524
|
-
!$ && !
|
|
2525
|
-
className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap",
|
|
2522
|
+
!$ && !xe && /* @__PURE__ */ U("div", {
|
|
2523
|
+
className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap", W.actionRow),
|
|
2526
2524
|
children: [
|
|
2527
2525
|
nr && rr,
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full",
|
|
2526
|
+
/* @__PURE__ */ H("div", {
|
|
2527
|
+
className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full", W.textareaWrap),
|
|
2530
2528
|
children: er
|
|
2531
2529
|
}),
|
|
2532
2530
|
!nr && rr,
|
|
2533
2531
|
!nr && ir,
|
|
2534
|
-
/* @__PURE__ */
|
|
2535
|
-
className: l("ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2536
|
-
children:
|
|
2532
|
+
/* @__PURE__ */ H("div", {
|
|
2533
|
+
className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
|
|
2534
|
+
children: De ? De({
|
|
2537
2535
|
canSend: zn,
|
|
2538
2536
|
onSend: Kn
|
|
2539
|
-
}) : /* @__PURE__ */
|
|
2540
|
-
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
deployments:
|
|
2543
|
-
selectedDeploymentId:
|
|
2544
|
-
onDeploymentChange:
|
|
2545
|
-
modelSelectorLabels:
|
|
2546
|
-
menuStyles:
|
|
2537
|
+
}) : /* @__PURE__ */ U(V, { children: [
|
|
2538
|
+
wt,
|
|
2539
|
+
/* @__PURE__ */ H(nn, {
|
|
2540
|
+
deployments: me,
|
|
2541
|
+
selectedDeploymentId: he,
|
|
2542
|
+
onDeploymentChange: ge,
|
|
2543
|
+
modelSelectorLabels: _e,
|
|
2544
|
+
menuStyles: ie,
|
|
2547
2545
|
isStreaming: s,
|
|
2548
|
-
isMobile:
|
|
2549
|
-
isDisabled:
|
|
2550
|
-
style:
|
|
2551
|
-
modelPickerOverlay:
|
|
2552
|
-
isPickerOpen:
|
|
2553
|
-
onPickerToggle: () =>
|
|
2554
|
-
onPickerOpenChange:
|
|
2546
|
+
isMobile: At,
|
|
2547
|
+
isDisabled: Ae,
|
|
2548
|
+
style: Ft,
|
|
2549
|
+
modelPickerOverlay: vt,
|
|
2550
|
+
isPickerOpen: jt,
|
|
2551
|
+
onPickerToggle: () => Mt((e) => !e),
|
|
2552
|
+
onPickerOpenChange: Mt
|
|
2555
2553
|
}),
|
|
2556
|
-
Gn && /* @__PURE__ */
|
|
2557
|
-
icon: /* @__PURE__ */
|
|
2558
|
-
size:
|
|
2559
|
-
stroke:
|
|
2554
|
+
Gn && /* @__PURE__ */ H(x, {
|
|
2555
|
+
icon: /* @__PURE__ */ H(ue, {
|
|
2556
|
+
size: g.LG,
|
|
2557
|
+
stroke: _,
|
|
2560
2558
|
"aria-hidden": !0
|
|
2561
2559
|
}),
|
|
2562
|
-
"aria-label":
|
|
2563
|
-
tooltipProps: { tooltip:
|
|
2560
|
+
"aria-label": ee,
|
|
2561
|
+
tooltipProps: { tooltip: ee },
|
|
2564
2562
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2565
2563
|
onClick: () => An($e.Dictation),
|
|
2566
|
-
disabled:
|
|
2564
|
+
disabled: ke || s
|
|
2567
2565
|
}),
|
|
2568
|
-
s && o ? /* @__PURE__ */
|
|
2566
|
+
s && o ? /* @__PURE__ */ H(Dt, {
|
|
2569
2567
|
onStop: o,
|
|
2570
|
-
ariaLabel:
|
|
2571
|
-
}) : !s && /* @__PURE__ */
|
|
2568
|
+
ariaLabel: M
|
|
2569
|
+
}) : !s && /* @__PURE__ */ H(Et, {
|
|
2572
2570
|
onSend: Kn,
|
|
2573
2571
|
isDisabled: !Wn || !zn,
|
|
2574
2572
|
ariaLabel: k,
|
|
2575
|
-
sendTooltip: Rn ? A :
|
|
2573
|
+
sendTooltip: Rn ? A : j ?? A
|
|
2576
2574
|
})
|
|
2577
2575
|
] })
|
|
2578
2576
|
})
|
|
2579
2577
|
]
|
|
2580
2578
|
}),
|
|
2581
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ H("span", {
|
|
2582
2580
|
className: "sr-only",
|
|
2583
2581
|
role: "status",
|
|
2584
2582
|
"aria-live": "polite",
|
|
2585
2583
|
"aria-atomic": "true",
|
|
2586
|
-
children: /* @__PURE__ */
|
|
2584
|
+
children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
|
|
2587
2585
|
})
|
|
2588
2586
|
]
|
|
2589
2587
|
});
|
|
2590
2588
|
});
|
|
2591
|
-
|
|
2592
|
-
var
|
|
2589
|
+
rn.displayName = "Input";
|
|
2590
|
+
var an = {
|
|
2593
2591
|
welcome: "_welcome_1icyo_1",
|
|
2594
2592
|
description: "_description_1icyo_5"
|
|
2595
|
-
},
|
|
2593
|
+
}, on = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, styles: a, className: o, inputClassName: s, isInputDisabled: u = !1, ...d }) => {
|
|
2596
2594
|
let { colors: f, typography: p, attachmentTray: m, modelMenu: h } = a ?? {};
|
|
2597
|
-
return /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ U("div", {
|
|
2598
2596
|
style: c({
|
|
2599
2597
|
"--ci-welcome-color": f?.welcomeText,
|
|
2600
2598
|
"--ci-description-color": f?.descriptionText
|
|
2601
2599
|
}),
|
|
2602
2600
|
className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", o),
|
|
2603
2601
|
children: [
|
|
2604
|
-
n && /* @__PURE__ */
|
|
2602
|
+
n && /* @__PURE__ */ U("div", {
|
|
2605
2603
|
className: "flex flex-col items-center gap-4 text-center",
|
|
2606
|
-
children: [/* @__PURE__ */
|
|
2607
|
-
className: l(
|
|
2604
|
+
children: [/* @__PURE__ */ H("h1", {
|
|
2605
|
+
className: l(an.welcome, "m-0", p?.welcomeClassName || "dial-display2-text"),
|
|
2608
2606
|
children: n
|
|
2609
|
-
}), r && /* @__PURE__ */
|
|
2610
|
-
className: l(
|
|
2607
|
+
}), r && /* @__PURE__ */ H("p", {
|
|
2608
|
+
className: l(an.description, "m-0 max-w-[540px]", p?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2611
2609
|
children: r
|
|
2612
2610
|
})]
|
|
2613
2611
|
}),
|
|
2614
|
-
i != null && /* @__PURE__ */
|
|
2612
|
+
i != null && /* @__PURE__ */ H("div", {
|
|
2615
2613
|
className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
|
|
2616
2614
|
children: i
|
|
2617
2615
|
}),
|
|
2618
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ H("div", {
|
|
2619
2617
|
className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2620
|
-
children: /* @__PURE__ */
|
|
2618
|
+
children: /* @__PURE__ */ H(rn, {
|
|
2621
2619
|
placeholder: t,
|
|
2622
2620
|
isStreaming: e,
|
|
2623
2621
|
isInputDisabled: u,
|
|
@@ -2631,42 +2629,42 @@ var rn = {
|
|
|
2631
2629
|
})
|
|
2632
2630
|
]
|
|
2633
2631
|
});
|
|
2634
|
-
},
|
|
2635
|
-
let
|
|
2636
|
-
|
|
2637
|
-
k?.length && (
|
|
2632
|
+
}, sn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, initialAttachments: u = [], onCancel: d, onSave: p, onUploadAttachment: m, cancelLabel: h = "Cancel", saveLabel: g = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: x, addMenuTitle: S = "Add", attachLabel: C = "Attach file", menuTitle: T = "Menu", menuCloseLabel: E = "Close", className: O, pendingDropFiles: k, onDropFilesConsumed: A, validateAttachment: j, isAttachmentsEnabled: M, isTextAttachmentsAllowed: ee, hideAttachFile: N = !1, fileAccept: te, maximumAttachmentsAmount: ne, onAttachmentsLimitExceeded: P, onDialFileSystemClick: F, dialFileSystemLabel: re, pendingAttachments: ie, onPendingAttachmentsConsumed: ae, onAttachmentClick: oe, pasteTextThreshold: se, maxMessageLength: ce = 5e4, onMessageTooLong: ue }) => {
|
|
2633
|
+
let de = z(null), fe = z(null), [pe, me] = B([]);
|
|
2634
|
+
L(() => {
|
|
2635
|
+
k?.length && (me(k), A?.());
|
|
2638
2636
|
}, [k, A]);
|
|
2639
|
-
let [
|
|
2640
|
-
|
|
2641
|
-
},
|
|
2642
|
-
p(e,
|
|
2643
|
-
}, [
|
|
2644
|
-
if (
|
|
2645
|
-
if (
|
|
2646
|
-
|
|
2637
|
+
let [he, ge] = B(e ?? ""), [_e, ve] = B([]), [ye, be] = B(u), xe = _e.some((e) => e.status === a.Loading || e.status === a.Error), Se = (he.trim().length > 0 || _e.length > 0 || ye.length > 0) && !xe, Ce = (e) => {
|
|
2638
|
+
be((t) => t.filter((t) => t.id !== e));
|
|
2639
|
+
}, we = I((e, t) => {
|
|
2640
|
+
p(e, ye, t);
|
|
2641
|
+
}, [ye, p]), V = () => {
|
|
2642
|
+
if (Se) {
|
|
2643
|
+
if (he.length >= ce) {
|
|
2644
|
+
ue?.(he.length, ce);
|
|
2647
2645
|
return;
|
|
2648
2646
|
}
|
|
2649
|
-
|
|
2647
|
+
we(he, _e);
|
|
2650
2648
|
}
|
|
2651
|
-
},
|
|
2652
|
-
|
|
2653
|
-
}, [n]),
|
|
2649
|
+
}, Te = I(() => me([]), []), Ee = I((e) => {
|
|
2650
|
+
ge(e), n?.(e);
|
|
2651
|
+
}, [n]), De = I((e) => {
|
|
2654
2652
|
let t = Array.from(e.target.files ?? []);
|
|
2655
|
-
t.length !== 0 && (e.target.value = "",
|
|
2656
|
-
}, []),
|
|
2653
|
+
t.length !== 0 && (e.target.value = "", me(t));
|
|
2654
|
+
}, []), Oe = R(() => F ? [{
|
|
2657
2655
|
key: "dial-fs",
|
|
2658
|
-
label:
|
|
2659
|
-
icon: /* @__PURE__ */
|
|
2656
|
+
label: re ?? "DIAL file system",
|
|
2657
|
+
icon: /* @__PURE__ */ H(le, {
|
|
2660
2658
|
size: f,
|
|
2661
2659
|
"aria-hidden": !0,
|
|
2662
|
-
stroke:
|
|
2660
|
+
stroke: _
|
|
2663
2661
|
}),
|
|
2664
|
-
onClick:
|
|
2665
|
-
}] : [], [
|
|
2666
|
-
return /* @__PURE__ */
|
|
2662
|
+
onClick: F
|
|
2663
|
+
}] : [], [F, re]);
|
|
2664
|
+
return /* @__PURE__ */ U("div", {
|
|
2667
2665
|
className: l("flex w-full flex-col gap-2", O),
|
|
2668
|
-
children: [/* @__PURE__ */
|
|
2669
|
-
ref:
|
|
2666
|
+
children: [/* @__PURE__ */ H(rn, {
|
|
2667
|
+
ref: fe,
|
|
2670
2668
|
message: e,
|
|
2671
2669
|
messageRevision: t,
|
|
2672
2670
|
activeMentions: r,
|
|
@@ -2675,70 +2673,70 @@ var rn = {
|
|
|
2675
2673
|
commandMenu: s,
|
|
2676
2674
|
ariaLabel: v,
|
|
2677
2675
|
hideActionBar: !0,
|
|
2678
|
-
pendingDropFiles:
|
|
2679
|
-
onDropFilesConsumed:
|
|
2680
|
-
onSend:
|
|
2676
|
+
pendingDropFiles: pe,
|
|
2677
|
+
onDropFilesConsumed: Te,
|
|
2678
|
+
onSend: we,
|
|
2681
2679
|
onUploadAttachment: m,
|
|
2682
|
-
onChange:
|
|
2683
|
-
onAttachmentsChange:
|
|
2680
|
+
onChange: Ee,
|
|
2681
|
+
onAttachmentsChange: ve,
|
|
2684
2682
|
removeLabel: y,
|
|
2685
2683
|
retryLabel: b,
|
|
2686
2684
|
uploadingLabel: x,
|
|
2687
2685
|
className: "max-w-full",
|
|
2688
|
-
prefixAttachments:
|
|
2689
|
-
onRemovePrefixAttachment:
|
|
2690
|
-
validateAttachment:
|
|
2691
|
-
isAttachmentsEnabled:
|
|
2692
|
-
isTextAttachmentsAllowed:
|
|
2693
|
-
maximumAttachmentsAmount:
|
|
2694
|
-
onAttachmentsLimitExceeded:
|
|
2695
|
-
pendingAttachments:
|
|
2696
|
-
onPendingAttachmentsConsumed:
|
|
2697
|
-
onAttachmentClick:
|
|
2698
|
-
pasteTextThreshold:
|
|
2699
|
-
maxMessageLength:
|
|
2700
|
-
onMessageTooLong:
|
|
2701
|
-
}), /* @__PURE__ */
|
|
2686
|
+
prefixAttachments: ye,
|
|
2687
|
+
onRemovePrefixAttachment: Ce,
|
|
2688
|
+
validateAttachment: j,
|
|
2689
|
+
isAttachmentsEnabled: M,
|
|
2690
|
+
isTextAttachmentsAllowed: ee,
|
|
2691
|
+
maximumAttachmentsAmount: ne,
|
|
2692
|
+
onAttachmentsLimitExceeded: P,
|
|
2693
|
+
pendingAttachments: ie,
|
|
2694
|
+
onPendingAttachmentsConsumed: ae,
|
|
2695
|
+
onAttachmentClick: oe,
|
|
2696
|
+
pasteTextThreshold: se,
|
|
2697
|
+
maxMessageLength: ce,
|
|
2698
|
+
onMessageTooLong: ue
|
|
2699
|
+
}), /* @__PURE__ */ U("div", {
|
|
2702
2700
|
className: "flex items-center justify-between",
|
|
2703
|
-
children: [/* @__PURE__ */
|
|
2701
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2704
2702
|
className: "flex",
|
|
2705
|
-
children: [!
|
|
2706
|
-
ref:
|
|
2703
|
+
children: [!N && /* @__PURE__ */ H("input", {
|
|
2704
|
+
ref: de,
|
|
2707
2705
|
type: "file",
|
|
2708
2706
|
multiple: !0,
|
|
2709
|
-
accept:
|
|
2707
|
+
accept: te,
|
|
2710
2708
|
className: "sr-only",
|
|
2711
2709
|
"aria-hidden": !0,
|
|
2712
2710
|
tabIndex: -1,
|
|
2713
|
-
onChange:
|
|
2714
|
-
}), (!
|
|
2715
|
-
onAttachClick:
|
|
2716
|
-
attachLabel:
|
|
2711
|
+
onChange: De
|
|
2712
|
+
}), (!N || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(_t, {
|
|
2713
|
+
onAttachClick: N ? void 0 : () => de.current?.click(),
|
|
2714
|
+
attachLabel: C,
|
|
2717
2715
|
addMenuTitle: S,
|
|
2718
2716
|
menuTitle: T,
|
|
2719
|
-
menuCloseLabel:
|
|
2720
|
-
extraMenuItems:
|
|
2717
|
+
menuCloseLabel: E,
|
|
2718
|
+
extraMenuItems: Oe,
|
|
2721
2719
|
menuOverlays: c,
|
|
2722
|
-
getCaretPosition: () =>
|
|
2720
|
+
getCaretPosition: () => fe.current?.getCaretPosition() ?? 0
|
|
2723
2721
|
})]
|
|
2724
|
-
}), /* @__PURE__ */
|
|
2722
|
+
}), /* @__PURE__ */ U("div", {
|
|
2725
2723
|
className: "flex gap-2",
|
|
2726
|
-
children: [/* @__PURE__ */
|
|
2724
|
+
children: [/* @__PURE__ */ H(w, {
|
|
2727
2725
|
label: h,
|
|
2728
2726
|
onClick: d
|
|
2729
|
-
}), /* @__PURE__ */
|
|
2730
|
-
label:
|
|
2731
|
-
onClick:
|
|
2732
|
-
disabled: !
|
|
2727
|
+
}), /* @__PURE__ */ H(D, {
|
|
2728
|
+
label: g,
|
|
2729
|
+
onClick: V,
|
|
2730
|
+
disabled: !Se
|
|
2733
2731
|
})]
|
|
2734
2732
|
})]
|
|
2735
2733
|
})]
|
|
2736
2734
|
});
|
|
2737
|
-
},
|
|
2738
|
-
let [t, n] =
|
|
2735
|
+
}, cn = (e) => {
|
|
2736
|
+
let [t, n] = B({
|
|
2739
2737
|
text: e?.text,
|
|
2740
2738
|
revision: e?.revision ?? 0
|
|
2741
|
-
}), r =
|
|
2739
|
+
}), r = I((e) => {
|
|
2742
2740
|
n((t) => ({
|
|
2743
2741
|
text: e,
|
|
2744
2742
|
revision: t.revision + 1
|
|
@@ -2749,11 +2747,11 @@ var rn = {
|
|
|
2749
2747
|
messageRevision: t.revision,
|
|
2750
2748
|
seedMessage: r
|
|
2751
2749
|
};
|
|
2752
|
-
},
|
|
2753
|
-
let n =
|
|
2754
|
-
r.current = t,
|
|
2750
|
+
}, ln = (e, t) => {
|
|
2751
|
+
let n = z(e), r = z(t);
|
|
2752
|
+
r.current = t, L(() => {
|
|
2755
2753
|
e !== n.current && (n.current = e, r.current());
|
|
2756
2754
|
}, [e]);
|
|
2757
2755
|
};
|
|
2758
2756
|
//#endregion
|
|
2759
|
-
export { ot as ActionRowLayout, Me as BottomSheetShell,
|
|
2757
|
+
export { ot as ActionRowLayout, Me as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, pt as ChatSettingsModal, on as ConversationInput, sn as EditMessageInput, rn as Input, at as SendOnEnter, cn as useComposerSeed, ln as useComposerSeedSource };
|