@epam/ai-dial-conversation-input 1.1.0-dev.90 → 1.1.0-dev.91
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/components/AddAttachmentButton/AddAttachmentButton.d.ts +11 -0
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts.map +1 -1
- package/components/BottomSheetShell/BottomSheetShell.d.ts +1 -1
- package/components/BottomSheetShell/BottomSheetShell.d.ts.map +1 -1
- package/components/ChatSettingsFields/ChatSettingsFields.d.ts +9 -0
- package/components/ChatSettingsFields/ChatSettingsFields.d.ts.map +1 -1
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts +2 -0
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts.map +1 -1
- package/components/ToolsBottomSheet/ToolsBottomSheet.d.ts +9 -0
- package/components/ToolsBottomSheet/ToolsBottomSheet.d.ts.map +1 -1
- package/hooks/useModelSelector.d.ts +4 -2
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +692 -658
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as c, Button as l, DIAL_ICON_SIZE as u, DialCloseButton as d, DialDropdown as f, DialDropdownIcon as p, DialErrorText as m, DialInput as h, DialPopup as g, DialRadioGroup as _, DialSearch as v, DialSkeleton as y, DialSkeletonVariant as b, DialSlider as x, DialTag as S, DialTooltip as C, ElementSize as w, GhostIconButton as T, Highlight as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, PrimaryIconButton as A, RadioGroupOrientation as
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentCard as
|
|
2
|
+
import { BASE_ICON_SIZE as c, Button as l, DIAL_ICON_SIZE as u, DialCloseButton as d, DialDropdown as f, DialDropdownIcon as p, DialErrorText as m, DialInput as h, DialPopup as g, DialRadioGroup as _, DialSearch as v, DialSkeleton as y, DialSkeletonVariant as b, DialSlider as x, DialTag as S, DialTooltip as C, ElementSize as w, GhostIconButton as T, Highlight as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, PrimaryIconButton as A, RadioGroupOrientation as j, StaticIconButton as M } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as N, IconArrowNarrowRight as ee, IconCheck as te, IconChevronDown as P, IconChevronRight as F, IconFile as ne, IconMicrophone as re, IconPaperclip as ie, IconPlayerStopFilled as ae, IconPlaystationSquare as oe, IconPlus as I, IconSettings as se, IconTool as ce, IconX as le } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as ue } from "react-dom";
|
|
5
|
+
import { createElement as de, memo as L, useCallback as R, useEffect as z, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as B, useRef as V, useState as H } from "react";
|
|
6
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentCard as me, AttachmentGroup as he, AttachmentTray as ge, AttachmentTray as _e, FileDndOverlay as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, getAttachmentIcon as xe, useClipboardPaste as Se } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Ce = (e, t) => {
|
|
10
|
+
z(() => {
|
|
11
11
|
if (!e) return;
|
|
12
12
|
let n = (e) => {
|
|
13
13
|
e.key === "Escape" && t();
|
|
14
14
|
};
|
|
15
15
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
16
|
-
}, [e, t]),
|
|
16
|
+
}, [e, t]), z(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
22
|
-
backdrop: "
|
|
23
|
-
sheet: "
|
|
24
|
-
"slide-up": "_slide-
|
|
25
|
-
title: "
|
|
26
|
-
divider: "
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
21
|
+
}, we = {
|
|
22
|
+
backdrop: "_backdrop_1yh0r_9",
|
|
23
|
+
sheet: "_sheet_1yh0r_13",
|
|
24
|
+
"slide-up": "_slide-up_1yh0r_1",
|
|
25
|
+
title: "_title_1yh0r_18",
|
|
26
|
+
divider: "_divider_1yh0r_22"
|
|
27
|
+
}, K = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: m, children: h }) => {
|
|
28
|
+
if (Ce(e, r), !e || typeof document > "u") return null;
|
|
29
29
|
let g = a({
|
|
30
30
|
"--ci-backdrop": m?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": m?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": m?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": m?.divider
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
className: o(
|
|
35
|
+
return ue(/* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
36
|
+
className: o(we.backdrop, "fixed inset-0 z-[55]"),
|
|
37
37
|
style: g,
|
|
38
38
|
onPointerDown: r,
|
|
39
39
|
"aria-hidden": !0
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ G("div", {
|
|
41
41
|
role: "dialog",
|
|
42
42
|
"aria-modal": !0,
|
|
43
43
|
"aria-label": t ?? c,
|
|
@@ -45,14 +45,14 @@ var Te = (e, t) => {
|
|
|
45
45
|
...g,
|
|
46
46
|
...l
|
|
47
47
|
},
|
|
48
|
-
className: o(
|
|
49
|
-
children: [t != null && /* @__PURE__ */ U
|
|
48
|
+
className: o(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", p),
|
|
49
|
+
children: [t != null && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
|
|
50
50
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
51
51
|
children: [
|
|
52
|
-
i && /* @__PURE__ */
|
|
52
|
+
i && /* @__PURE__ */ W("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
icon: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ W(T, {
|
|
55
|
+
icon: /* @__PURE__ */ W(N, {
|
|
56
56
|
size: u.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
@@ -61,41 +61,41 @@ var Te = (e, t) => {
|
|
|
61
61
|
onClick: i
|
|
62
62
|
})
|
|
63
63
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
className: o(
|
|
64
|
+
/* @__PURE__ */ W("span", {
|
|
65
|
+
className: o(we.title, f),
|
|
66
66
|
children: t
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ W("div", {
|
|
69
69
|
className: "absolute end-4 m-2",
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ W(d, {
|
|
71
71
|
ariaLabel: n,
|
|
72
72
|
size: u.LG,
|
|
73
73
|
onClose: r
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
]
|
|
77
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ W("div", { className: o(we.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ W("div", {
|
|
78
78
|
className: "overflow-y-auto",
|
|
79
79
|
children: h
|
|
80
80
|
})]
|
|
81
81
|
})] }), document.body);
|
|
82
|
-
},
|
|
82
|
+
}, Te = async (e, t, n) => {
|
|
83
83
|
let r = 6e4 / t, i = [];
|
|
84
84
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
85
85
|
await Promise.allSettled(i);
|
|
86
|
-
},
|
|
87
|
-
let [h, g] =
|
|
88
|
-
|
|
86
|
+
}, Ee = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
87
|
+
let [h, g] = H(n), _ = V(h);
|
|
88
|
+
z(() => {
|
|
89
89
|
_.current = h;
|
|
90
|
-
}, [h]),
|
|
90
|
+
}, [h]), z(() => () => {
|
|
91
91
|
_.current.forEach((e) => {
|
|
92
92
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
93
93
|
});
|
|
94
94
|
}, []);
|
|
95
|
-
let v =
|
|
95
|
+
let v = R((e) => e.map((e) => {
|
|
96
96
|
let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
|
|
97
97
|
return {
|
|
98
|
-
id:
|
|
98
|
+
id: be(),
|
|
99
99
|
name: e.name,
|
|
100
100
|
contentType: e.type,
|
|
101
101
|
file: e,
|
|
@@ -104,26 +104,26 @@ var Te = (e, t) => {
|
|
|
104
104
|
previewUrl: a,
|
|
105
105
|
playUrl: o
|
|
106
106
|
};
|
|
107
|
-
}), []), y =
|
|
108
|
-
|
|
107
|
+
}), []), y = V(a);
|
|
108
|
+
z(() => {
|
|
109
109
|
y.current = a;
|
|
110
110
|
}, [a]);
|
|
111
|
-
let b =
|
|
111
|
+
let b = V(!0), x = R((e) => {
|
|
112
112
|
g((t) => {
|
|
113
113
|
let n = e(t);
|
|
114
114
|
return n === t ? t : n;
|
|
115
115
|
});
|
|
116
116
|
}, []);
|
|
117
|
-
|
|
117
|
+
z(() => {
|
|
118
118
|
if (b.current) {
|
|
119
119
|
b.current = !1;
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
y.current?.(h);
|
|
123
123
|
}, [h]);
|
|
124
|
-
let S =
|
|
124
|
+
let S = R((e) => {
|
|
125
125
|
g(e);
|
|
126
|
-
}, []), C =
|
|
126
|
+
}, []), C = R(async (t) => {
|
|
127
127
|
if (i) {
|
|
128
128
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
129
129
|
...e,
|
|
@@ -145,7 +145,7 @@ var Te = (e, t) => {
|
|
|
145
145
|
} : e));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}, [i, x]), w =
|
|
148
|
+
}, [i, x]), w = R((e, t = !0) => {
|
|
149
149
|
let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
|
|
150
150
|
if (i.length !== 0) {
|
|
151
151
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -166,7 +166,7 @@ var Te = (e, t) => {
|
|
|
166
166
|
status: r.Error,
|
|
167
167
|
errorReason: n
|
|
168
168
|
} : e));
|
|
169
|
-
}),
|
|
169
|
+
}), Te(e, ye, C);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, [
|
|
@@ -177,20 +177,20 @@ var Te = (e, t) => {
|
|
|
177
177
|
C,
|
|
178
178
|
o
|
|
179
179
|
]);
|
|
180
|
-
|
|
180
|
+
z(() => {
|
|
181
181
|
s.length !== 0 && (w(v(s)), c?.());
|
|
182
182
|
}, [
|
|
183
183
|
w,
|
|
184
184
|
v,
|
|
185
185
|
c,
|
|
186
186
|
s
|
|
187
|
-
]),
|
|
187
|
+
]), z(() => {
|
|
188
188
|
l.length !== 0 && (w(l, !1), u?.());
|
|
189
189
|
}, [
|
|
190
190
|
w,
|
|
191
191
|
u,
|
|
192
192
|
l
|
|
193
|
-
]),
|
|
193
|
+
]), z(() => {
|
|
194
194
|
if (!o) return;
|
|
195
195
|
let t = !1, n = [], i = _.current.map((i) => {
|
|
196
196
|
if (i.status === r.Loading) return i;
|
|
@@ -217,7 +217,7 @@ var Te = (e, t) => {
|
|
|
217
217
|
x,
|
|
218
218
|
C
|
|
219
219
|
]);
|
|
220
|
-
let T =
|
|
220
|
+
let T = R((e) => {
|
|
221
221
|
x((t) => {
|
|
222
222
|
let n = t.find((t) => t.id === e);
|
|
223
223
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -229,11 +229,11 @@ var Te = (e, t) => {
|
|
|
229
229
|
addAttachments: w,
|
|
230
230
|
resetAttachments: S,
|
|
231
231
|
handleRemove: T,
|
|
232
|
-
handleRetry:
|
|
232
|
+
handleRetry: R((e) => {
|
|
233
233
|
let t = h.find((t) => t.id === e);
|
|
234
234
|
t && C(t);
|
|
235
235
|
}, [h, C]),
|
|
236
|
-
handleExpand:
|
|
236
|
+
handleExpand: R(async (e) => {
|
|
237
237
|
let n = h.find((t) => t.id === e);
|
|
238
238
|
if (!n || n.type !== t.Pasted) return;
|
|
239
239
|
let r = await n.file.text();
|
|
@@ -245,9 +245,9 @@ var Te = (e, t) => {
|
|
|
245
245
|
]),
|
|
246
246
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
247
247
|
};
|
|
248
|
-
},
|
|
249
|
-
let [n, r] =
|
|
250
|
-
return
|
|
248
|
+
}, De = (e, t) => {
|
|
249
|
+
let [n, r] = H(e), [i, a] = H(!1), [o, s] = H(0);
|
|
250
|
+
return z(() => {
|
|
251
251
|
if (e) {
|
|
252
252
|
r(!0), a(!1), s((e) => e + 1);
|
|
253
253
|
return;
|
|
@@ -263,18 +263,18 @@ var Te = (e, t) => {
|
|
|
263
263
|
isExiting: i,
|
|
264
264
|
instanceKey: o
|
|
265
265
|
};
|
|
266
|
-
},
|
|
267
|
-
let t =
|
|
266
|
+
}, Oe = (e, t) => !e.slice(0, t).includes("\n"), ke = (e, t) => !e.slice(t).includes("\n"), Ae = (e) => {
|
|
267
|
+
let t = V(e);
|
|
268
268
|
t.current = e;
|
|
269
|
-
let n =
|
|
269
|
+
let n = V(-1), r = V(""), i = R((e, i, a) => {
|
|
270
270
|
let o = t.current;
|
|
271
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
272
|
-
}, []), a =
|
|
271
|
+
return !o || o.length === 0 ? null : e === "up" ? !Oe(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 || !ke(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
272
|
+
}, []), a = R(() => {
|
|
273
273
|
n.current = -1, r.current = "";
|
|
274
|
-
}, []), o =
|
|
274
|
+
}, []), o = R(() => {
|
|
275
275
|
n.current = -1, r.current = "";
|
|
276
276
|
}, []);
|
|
277
|
-
return
|
|
277
|
+
return B(() => ({
|
|
278
278
|
navigate: i,
|
|
279
279
|
notifyChange: a,
|
|
280
280
|
reset: o
|
|
@@ -283,13 +283,13 @@ var Te = (e, t) => {
|
|
|
283
283
|
a,
|
|
284
284
|
o
|
|
285
285
|
]);
|
|
286
|
-
},
|
|
287
|
-
let [n, r] =
|
|
288
|
-
return
|
|
286
|
+
}, je = ({ messageProp: e, messageRevision: t }) => {
|
|
287
|
+
let [n, r] = H(e), i = V(null), a = V(0), [o, s] = H(!1);
|
|
288
|
+
return z(() => {
|
|
289
289
|
r(e);
|
|
290
|
-
}, [e, t]),
|
|
290
|
+
}, [e, t]), z(() => {
|
|
291
291
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
292
|
+
}, []), pe(() => {
|
|
293
293
|
if (!i.current || a.current === 0) return;
|
|
294
294
|
let e = i.current.offsetHeight > a.current;
|
|
295
295
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -299,20 +299,20 @@ var Te = (e, t) => {
|
|
|
299
299
|
textareaRef: i,
|
|
300
300
|
isMultiLine: o
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, Me = /* @__PURE__ */ function(e) {
|
|
303
303
|
return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
|
|
304
|
-
}({}),
|
|
304
|
+
}({}), Ne = [
|
|
305
305
|
"audio/webm;codecs=opus",
|
|
306
306
|
"audio/ogg;codecs=opus",
|
|
307
307
|
"audio/webm"
|
|
308
|
-
],
|
|
309
|
-
let [t, n] =
|
|
308
|
+
], Pe = () => Ne.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onAttachAudio: e }) => {
|
|
309
|
+
let [t, n] = H("idle"), [r, i] = H(null), [a, o] = H(0), s = V(null), c = V(null), l = V(null), u = V(null), d = V([]), f = V(""), p = V(null), m = V(e);
|
|
310
310
|
m.current = e;
|
|
311
|
-
let h =
|
|
311
|
+
let h = R(() => {
|
|
312
312
|
p.current != null && (clearInterval(p.current), p.current = null);
|
|
313
|
-
}, []), g =
|
|
313
|
+
}, []), g = R(() => {
|
|
314
314
|
h(), s.current &&= (s.current.getTracks().forEach((e) => e.stop()), null), c.current &&= (c.current.close(), null), l.current = null, u.current = null;
|
|
315
|
-
}, [h]), _ =
|
|
315
|
+
}, [h]), _ = R(() => {
|
|
316
316
|
(async () => {
|
|
317
317
|
try {
|
|
318
318
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -321,7 +321,7 @@ var Te = (e, t) => {
|
|
|
321
321
|
c.current = t;
|
|
322
322
|
let r = t.createAnalyser();
|
|
323
323
|
r.fftSize = 256, l.current = r, t.createMediaStreamSource(e).connect(r);
|
|
324
|
-
let i =
|
|
324
|
+
let i = Pe();
|
|
325
325
|
f.current = i, d.current = [];
|
|
326
326
|
let a = new MediaRecorder(e, i ? { mimeType: i } : void 0);
|
|
327
327
|
u.current = a, a.ondataavailable = (e) => {
|
|
@@ -333,17 +333,17 @@ var Te = (e, t) => {
|
|
|
333
333
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
334
334
|
}
|
|
335
335
|
})();
|
|
336
|
-
}, []), v =
|
|
336
|
+
}, []), v = R(() => {
|
|
337
337
|
let e = u.current;
|
|
338
338
|
!e || e.state !== "recording" || (h(), e.onstop = () => {
|
|
339
339
|
let e = f.current || "audio/webm", t = new Blob(d.current, { type: e }), r = e.split(";")[0], a = r.split("/")[1] ?? "webm", s = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), c = new File([t], `voice-${s}.${a}`, { type: r });
|
|
340
340
|
m.current(c), g(), o(0), i(null), n("idle");
|
|
341
341
|
}, e.stop());
|
|
342
|
-
}, [h, g]), y =
|
|
342
|
+
}, [h, g]), y = R(() => {
|
|
343
343
|
let e = u.current;
|
|
344
344
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), g(), o(0), i(null), n("idle");
|
|
345
345
|
}, [g]);
|
|
346
|
-
return
|
|
346
|
+
return z(() => () => {
|
|
347
347
|
g();
|
|
348
348
|
}, [g]), {
|
|
349
349
|
state: t,
|
|
@@ -354,12 +354,12 @@ var Te = (e, t) => {
|
|
|
354
354
|
stopRecording: v,
|
|
355
355
|
discardRecording: y
|
|
356
356
|
};
|
|
357
|
-
},
|
|
357
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
358
358
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
359
|
-
}({}),
|
|
359
|
+
}({}), Le = {
|
|
360
360
|
item: "_item_l2r5m_1",
|
|
361
361
|
itemIcon: "_itemIcon_l2r5m_11"
|
|
362
|
-
},
|
|
362
|
+
}, Re = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
363
363
|
let m = (e) => {
|
|
364
364
|
e(), r();
|
|
365
365
|
}, h = a({
|
|
@@ -368,7 +368,7 @@ var Te = (e, t) => {
|
|
|
368
368
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
369
369
|
"--ci-sheet-icon": p?.itemIcon
|
|
370
370
|
});
|
|
371
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ W(K, {
|
|
372
372
|
isOpen: e,
|
|
373
373
|
title: t,
|
|
374
374
|
closeLabel: n,
|
|
@@ -377,23 +377,23 @@ var Te = (e, t) => {
|
|
|
377
377
|
className: c,
|
|
378
378
|
titleClassName: u,
|
|
379
379
|
colors: p?.shell,
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ W("ul", {
|
|
381
381
|
role: "list",
|
|
382
382
|
className: "flex flex-col",
|
|
383
383
|
style: h,
|
|
384
|
-
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
384
|
+
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(l, {
|
|
385
385
|
type: "button",
|
|
386
|
-
className: o(
|
|
387
|
-
iconBefore: /* @__PURE__ */
|
|
388
|
-
className:
|
|
386
|
+
className: o(Le.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
387
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
388
|
+
className: Le.itemIcon,
|
|
389
389
|
children: n
|
|
390
390
|
}),
|
|
391
|
-
iconAfter: r ? /* @__PURE__ */
|
|
391
|
+
iconAfter: r ? /* @__PURE__ */ W("span", {
|
|
392
392
|
className: "ms-auto",
|
|
393
393
|
children: r
|
|
394
394
|
}) : null,
|
|
395
395
|
textClassName: f,
|
|
396
|
-
label: /* @__PURE__ */
|
|
396
|
+
label: /* @__PURE__ */ W("span", {
|
|
397
397
|
className: d,
|
|
398
398
|
children: t
|
|
399
399
|
}),
|
|
@@ -401,9 +401,9 @@ var Te = (e, t) => {
|
|
|
401
401
|
}) }, e))
|
|
402
402
|
})
|
|
403
403
|
});
|
|
404
|
-
},
|
|
405
|
-
let [s, c] =
|
|
406
|
-
|
|
404
|
+
}, ze = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
405
|
+
let [s, c] = H(t), [l, u] = H(n), [d, f] = H(r), p = V(o);
|
|
406
|
+
z(() => {
|
|
407
407
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
408
408
|
}, [
|
|
409
409
|
o,
|
|
@@ -420,7 +420,7 @@ var Te = (e, t) => {
|
|
|
420
420
|
setResponseFormat: c,
|
|
421
421
|
setSystemPrompt: u,
|
|
422
422
|
setTemperature: f,
|
|
423
|
-
handleSubmit:
|
|
423
|
+
handleSubmit: R(() => {
|
|
424
424
|
if (!m) return;
|
|
425
425
|
let t = {};
|
|
426
426
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -434,54 +434,58 @@ var Te = (e, t) => {
|
|
|
434
434
|
a
|
|
435
435
|
])
|
|
436
436
|
};
|
|
437
|
-
},
|
|
437
|
+
}, Be = { label: "_label_14i7c_1" }, Ve = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
|
|
438
438
|
"Precise",
|
|
439
439
|
"Neutral",
|
|
440
440
|
"Creative"
|
|
441
|
-
], temperatureHint:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
441
|
+
], temperatureHint: b, labelClassName: S = "!dial-small-semi-text", colors: C }) => {
|
|
442
|
+
let w = a({ "--csf-label-text": C?.labelText }), T = o(S, Be.label, "gap-1");
|
|
443
|
+
return /* @__PURE__ */ G("div", {
|
|
444
|
+
className: "flex flex-col gap-4 px-6 py-3",
|
|
445
|
+
style: w,
|
|
446
|
+
children: [
|
|
447
|
+
e.responseFormat && /* @__PURE__ */ W(_, {
|
|
448
|
+
fieldTitle: u,
|
|
449
|
+
labelClassName: T,
|
|
450
|
+
elementId: "response-format",
|
|
451
|
+
orientation: j.Column,
|
|
452
|
+
activeRadioButton: t ?? i.Markdown,
|
|
453
|
+
labelDescription: d,
|
|
454
|
+
radioButtons: [{
|
|
455
|
+
id: i.Markdown,
|
|
456
|
+
name: f
|
|
457
|
+
}, {
|
|
458
|
+
id: i.PlainText,
|
|
459
|
+
name: p
|
|
460
|
+
}],
|
|
461
|
+
onChange: (e) => s(e)
|
|
462
|
+
}),
|
|
463
|
+
e.systemPrompt && /* @__PURE__ */ W(h, {
|
|
464
|
+
value: n,
|
|
465
|
+
placeholder: g,
|
|
466
|
+
labelProps: {
|
|
467
|
+
className: T,
|
|
468
|
+
label: m
|
|
469
|
+
},
|
|
470
|
+
onChange: (e) => c(e ?? "")
|
|
471
|
+
}),
|
|
472
|
+
e.temperature && /* @__PURE__ */ W(x, {
|
|
473
|
+
labelProps: {
|
|
474
|
+
label: v,
|
|
475
|
+
className: T,
|
|
476
|
+
caption: b
|
|
477
|
+
},
|
|
478
|
+
value: r,
|
|
479
|
+
min: 0,
|
|
480
|
+
max: 1,
|
|
481
|
+
step: .1,
|
|
482
|
+
labels: y,
|
|
483
|
+
onChange: l
|
|
484
|
+
})
|
|
485
|
+
]
|
|
486
|
+
});
|
|
487
|
+
}, He = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, 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: w }) => {
|
|
488
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: A, setSystemPrompt: j, setTemperature: M, handleSubmit: N } = ze({
|
|
485
489
|
isOpen: e,
|
|
486
490
|
features: s,
|
|
487
491
|
initialResponseFormat: c,
|
|
@@ -490,7 +494,7 @@ var Te = (e, t) => {
|
|
|
490
494
|
onSave: d,
|
|
491
495
|
onClose: r
|
|
492
496
|
});
|
|
493
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ G(K, {
|
|
494
498
|
isOpen: e,
|
|
495
499
|
title: f,
|
|
496
500
|
closeLabel: i,
|
|
@@ -498,14 +502,14 @@ var Te = (e, t) => {
|
|
|
498
502
|
onBack: t,
|
|
499
503
|
backLabel: n,
|
|
500
504
|
style: a,
|
|
501
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ W(Ve, {
|
|
502
506
|
features: s,
|
|
503
507
|
responseFormat: T,
|
|
504
508
|
systemPrompt: E,
|
|
505
509
|
temperature: D,
|
|
506
510
|
onResponseFormatChange: A,
|
|
507
|
-
onSystemPromptChange:
|
|
508
|
-
onTemperatureChange:
|
|
511
|
+
onSystemPromptChange: j,
|
|
512
|
+
onTemperatureChange: M,
|
|
509
513
|
responseFormatLabel: p,
|
|
510
514
|
responseFormatHint: m,
|
|
511
515
|
responseFormatMarkdownLabel: h,
|
|
@@ -515,23 +519,23 @@ var Te = (e, t) => {
|
|
|
515
519
|
temperatureLabel: y,
|
|
516
520
|
temperatureLabels: b,
|
|
517
521
|
temperatureHint: x
|
|
518
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ W("div", {
|
|
519
523
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
520
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ W(C, {
|
|
521
525
|
tooltip: w,
|
|
522
526
|
hideTooltip: O || !w,
|
|
523
527
|
triggerClassName: "w-full",
|
|
524
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ W(k, {
|
|
525
529
|
label: S,
|
|
526
|
-
onClick:
|
|
530
|
+
onClick: N,
|
|
527
531
|
disabled: !O,
|
|
528
532
|
className: "w-full"
|
|
529
533
|
})
|
|
530
534
|
})
|
|
531
535
|
})]
|
|
532
536
|
});
|
|
533
|
-
},
|
|
534
|
-
let { responseFormat:
|
|
537
|
+
}, Ue = { modal: "_modal_1clcg_1" }, We = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = Ue.modal }) => {
|
|
538
|
+
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: A } = ze({
|
|
535
539
|
features: e,
|
|
536
540
|
initialResponseFormat: t,
|
|
537
541
|
initialSystemPrompt: n,
|
|
@@ -539,32 +543,32 @@ var Te = (e, t) => {
|
|
|
539
543
|
onSave: i,
|
|
540
544
|
onClose: a
|
|
541
545
|
});
|
|
542
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ W(g, {
|
|
543
547
|
open: !0,
|
|
544
548
|
header: o,
|
|
545
549
|
size: O.Sm,
|
|
546
550
|
onClose: a,
|
|
547
|
-
className:
|
|
548
|
-
footer: /* @__PURE__ */
|
|
551
|
+
className: y,
|
|
552
|
+
footer: /* @__PURE__ */ W("div", {
|
|
549
553
|
className: "flex justify-end px-6 py-4",
|
|
550
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ W(C, {
|
|
551
555
|
tooltip: v,
|
|
552
|
-
hideTooltip:
|
|
553
|
-
children: /* @__PURE__ */
|
|
556
|
+
hideTooltip: w || !v,
|
|
557
|
+
children: /* @__PURE__ */ W(k, {
|
|
554
558
|
label: _,
|
|
555
|
-
onClick:
|
|
556
|
-
disabled: !
|
|
559
|
+
onClick: A,
|
|
560
|
+
disabled: !w
|
|
557
561
|
})
|
|
558
562
|
})
|
|
559
563
|
}),
|
|
560
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ W(Ve, {
|
|
561
565
|
features: e,
|
|
562
|
-
responseFormat:
|
|
563
|
-
systemPrompt:
|
|
564
|
-
temperature:
|
|
565
|
-
onResponseFormatChange:
|
|
566
|
-
onSystemPromptChange:
|
|
567
|
-
onTemperatureChange:
|
|
566
|
+
responseFormat: b,
|
|
567
|
+
systemPrompt: x,
|
|
568
|
+
temperature: S,
|
|
569
|
+
onResponseFormatChange: T,
|
|
570
|
+
onSystemPromptChange: E,
|
|
571
|
+
onTemperatureChange: D,
|
|
568
572
|
responseFormatLabel: s,
|
|
569
573
|
responseFormatHint: c,
|
|
570
574
|
responseFormatMarkdownLabel: l,
|
|
@@ -577,220 +581,246 @@ var Te = (e, t) => {
|
|
|
577
581
|
})
|
|
578
582
|
});
|
|
579
583
|
};
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
+
L(We);
|
|
585
|
+
var Ge = {
|
|
586
|
+
icon: "_icon_1oz9i_1",
|
|
587
|
+
selectedIcon: "_selectedIcon_1oz9i_5"
|
|
588
|
+
}, Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, colors: p }) => /* @__PURE__ */ W(K, {
|
|
584
589
|
isOpen: e,
|
|
585
|
-
title:
|
|
590
|
+
title: u,
|
|
586
591
|
closeLabel: i,
|
|
587
592
|
onClose: r,
|
|
588
593
|
onBack: t,
|
|
589
594
|
backLabel: n,
|
|
590
|
-
style:
|
|
591
|
-
children: /* @__PURE__ */
|
|
595
|
+
style: s,
|
|
596
|
+
children: /* @__PURE__ */ W("ul", {
|
|
592
597
|
role: "menu",
|
|
593
598
|
className: "flex flex-col pb-4",
|
|
594
|
-
|
|
599
|
+
style: a({
|
|
600
|
+
"--tbs-icon-text": p?.iconText,
|
|
601
|
+
"--tbs-selected-icon-text": p?.selectedIconText
|
|
602
|
+
}),
|
|
603
|
+
children: d.map((e) => /* @__PURE__ */ W("li", {
|
|
595
604
|
role: "none",
|
|
596
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ W(l, {
|
|
597
606
|
type: "button",
|
|
598
607
|
role: "menuitemcheckbox",
|
|
599
608
|
"aria-checked": e.isSelected,
|
|
600
609
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
601
|
-
iconBefore: /* @__PURE__ */
|
|
602
|
-
className: "flex items-center
|
|
610
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
611
|
+
className: o("flex items-center", Ge.icon),
|
|
603
612
|
children: e.icon
|
|
604
613
|
}),
|
|
605
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
606
|
-
className: "ms-auto
|
|
607
|
-
children: /* @__PURE__ */
|
|
614
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ W("span", {
|
|
615
|
+
className: o("ms-auto", Ge.selectedIcon),
|
|
616
|
+
children: /* @__PURE__ */ W(te, {
|
|
608
617
|
size: c,
|
|
609
618
|
"aria-hidden": !0
|
|
610
619
|
})
|
|
611
620
|
}) : null,
|
|
612
|
-
label: /* @__PURE__ */
|
|
621
|
+
label: /* @__PURE__ */ W("span", {
|
|
613
622
|
className: "dial-small-text",
|
|
614
623
|
children: e.label
|
|
615
624
|
}),
|
|
616
|
-
onClick: () =>
|
|
625
|
+
onClick: () => f(e.id)
|
|
617
626
|
})
|
|
618
627
|
}, e.id))
|
|
619
628
|
})
|
|
620
|
-
}), qe =
|
|
621
|
-
|
|
629
|
+
}), qe = {
|
|
630
|
+
selectedToolIcon: "_selectedToolIcon_1lz31_1",
|
|
631
|
+
toolIcon: "_toolIcon_1lz31_5",
|
|
632
|
+
chevronIcon: "_chevronIcon_1lz31_9"
|
|
633
|
+
}, Je = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: d, listClassName: p = "cp-dropdown-overlay !w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: _ = [], onToolToggle: v, toolsMenuTitle: y = "Tools", toolsBackLabel: b = "Back", colors: x }) => {
|
|
634
|
+
let S = s(), [C, E] = H(!1), [D, O] = H(!1), [k, A] = H(!1), j = B(() => a({
|
|
635
|
+
"--aab-selected-tool-icon": x?.selectedToolIcon,
|
|
636
|
+
"--aab-tool-icon": x?.toolIcon,
|
|
637
|
+
"--aab-chevron-icon": x?.chevronIcon
|
|
638
|
+
}), [
|
|
639
|
+
x?.selectedToolIcon,
|
|
640
|
+
x?.toolIcon,
|
|
641
|
+
x?.chevronIcon
|
|
642
|
+
]), M = _.length > 0 && v != null, N = B(() => _.map((e) => ({
|
|
622
643
|
key: e.id,
|
|
623
|
-
label: /* @__PURE__ */
|
|
644
|
+
label: /* @__PURE__ */ G("span", {
|
|
624
645
|
className: "flex flex-1 items-center gap-2",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
646
|
+
children: [/* @__PURE__ */ W("span", {
|
|
626
647
|
className: "flex-1",
|
|
627
648
|
children: e.label
|
|
628
|
-
}), e.isSelected && /* @__PURE__ */
|
|
649
|
+
}), e.isSelected && /* @__PURE__ */ W(te, {
|
|
629
650
|
size: c,
|
|
630
|
-
|
|
651
|
+
style: j,
|
|
652
|
+
className: qe.selectedToolIcon,
|
|
631
653
|
"aria-hidden": !0
|
|
632
654
|
})]
|
|
633
655
|
}),
|
|
634
|
-
icon: /* @__PURE__ */
|
|
635
|
-
|
|
656
|
+
icon: /* @__PURE__ */ W("span", {
|
|
657
|
+
style: j,
|
|
658
|
+
className: o("flex items-center", qe.toolIcon),
|
|
636
659
|
children: e.icon
|
|
637
660
|
}),
|
|
638
|
-
onClick: () =>
|
|
639
|
-
})), [
|
|
661
|
+
onClick: () => v?.(e.id)
|
|
662
|
+
})), [
|
|
663
|
+
_,
|
|
664
|
+
v,
|
|
665
|
+
j
|
|
666
|
+
]), ee = B(() => [
|
|
640
667
|
...e == null ? [] : [{
|
|
641
668
|
key: "attach",
|
|
642
669
|
label: t,
|
|
643
|
-
icon: /* @__PURE__ */
|
|
670
|
+
icon: /* @__PURE__ */ W(ie, {
|
|
644
671
|
size: c,
|
|
645
672
|
"aria-hidden": !0
|
|
646
673
|
}),
|
|
647
674
|
onClick: e
|
|
648
675
|
}],
|
|
649
|
-
...
|
|
650
|
-
...
|
|
676
|
+
...g ?? [],
|
|
677
|
+
...M ? [{
|
|
651
678
|
key: "tools",
|
|
652
|
-
label:
|
|
653
|
-
icon: /* @__PURE__ */
|
|
679
|
+
label: y,
|
|
680
|
+
icon: /* @__PURE__ */ W(ce, {
|
|
654
681
|
size: c,
|
|
655
682
|
"aria-hidden": !0
|
|
656
683
|
}),
|
|
657
|
-
onClick:
|
|
658
|
-
|
|
684
|
+
onClick: S ? () => {
|
|
685
|
+
A(!0), E(!1);
|
|
659
686
|
} : () => void 0,
|
|
660
|
-
...
|
|
687
|
+
...S ? { iconAfter: /* @__PURE__ */ W(F, {
|
|
661
688
|
size: c,
|
|
662
689
|
stroke: 1.5,
|
|
663
|
-
|
|
690
|
+
style: j,
|
|
691
|
+
className: o("rtl:scale-x-[-1]", qe.chevronIcon),
|
|
664
692
|
"aria-hidden": !0
|
|
665
|
-
}) } : { children:
|
|
693
|
+
}) } : { children: N }
|
|
666
694
|
}] : [],
|
|
667
|
-
...
|
|
695
|
+
...h == null ? [] : [{
|
|
668
696
|
key: "chat-settings",
|
|
669
|
-
label:
|
|
670
|
-
icon: /* @__PURE__ */
|
|
697
|
+
label: h.menuItemLabel ?? "Chat settings",
|
|
698
|
+
icon: /* @__PURE__ */ W(se, {
|
|
671
699
|
size: c,
|
|
672
700
|
"aria-hidden": !0
|
|
673
701
|
}),
|
|
674
|
-
iconAfter:
|
|
702
|
+
iconAfter: S ? /* @__PURE__ */ W(F, {
|
|
675
703
|
size: c,
|
|
676
704
|
stroke: 1.5,
|
|
677
|
-
|
|
705
|
+
style: j,
|
|
706
|
+
className: o("rtl:scale-x-[-1]", qe.chevronIcon),
|
|
678
707
|
"aria-hidden": !0
|
|
679
708
|
}) : null,
|
|
680
|
-
onClick: () =>
|
|
709
|
+
onClick: () => O(!0)
|
|
681
710
|
}]
|
|
682
711
|
], [
|
|
683
712
|
t,
|
|
684
713
|
e,
|
|
685
|
-
|
|
686
|
-
|
|
714
|
+
h,
|
|
715
|
+
g,
|
|
716
|
+
S,
|
|
717
|
+
M,
|
|
687
718
|
y,
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
k
|
|
719
|
+
N,
|
|
720
|
+
j
|
|
691
721
|
]);
|
|
692
|
-
return
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
icon: /* @__PURE__ */
|
|
722
|
+
return ee.length === 0 ? null : /* @__PURE__ */ W(U, { children: S ? /* @__PURE__ */ G(U, { children: [
|
|
723
|
+
/* @__PURE__ */ W(T, {
|
|
724
|
+
icon: /* @__PURE__ */ W(I, {
|
|
695
725
|
size: u.LG,
|
|
696
726
|
"aria-hidden": !0
|
|
697
727
|
}),
|
|
698
728
|
"aria-label": n,
|
|
699
729
|
size: w.Large,
|
|
700
730
|
tooltipProps: { tooltip: n },
|
|
701
|
-
disabled:
|
|
702
|
-
onClick: () =>
|
|
731
|
+
disabled: m,
|
|
732
|
+
onClick: () => E(!0)
|
|
703
733
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
isOpen:
|
|
734
|
+
/* @__PURE__ */ W(Re, {
|
|
735
|
+
isOpen: C,
|
|
706
736
|
title: r,
|
|
707
|
-
closeLabel:
|
|
708
|
-
onClose: () =>
|
|
709
|
-
style:
|
|
710
|
-
items:
|
|
737
|
+
closeLabel: l,
|
|
738
|
+
onClose: () => E(!1),
|
|
739
|
+
style: d,
|
|
740
|
+
items: ee,
|
|
711
741
|
className: "pb-4",
|
|
712
742
|
btnTextClassName: "flex-1"
|
|
713
743
|
}),
|
|
714
|
-
|
|
715
|
-
isOpen:
|
|
744
|
+
M && /* @__PURE__ */ W(Ke, {
|
|
745
|
+
isOpen: k,
|
|
716
746
|
onBack: () => {
|
|
717
|
-
|
|
747
|
+
A(!1), E(!0);
|
|
718
748
|
},
|
|
719
|
-
backLabel:
|
|
720
|
-
onClose: () =>
|
|
721
|
-
closeLabel:
|
|
722
|
-
style:
|
|
723
|
-
title:
|
|
724
|
-
items:
|
|
725
|
-
onToolToggle:
|
|
749
|
+
backLabel: b,
|
|
750
|
+
onClose: () => A(!1),
|
|
751
|
+
closeLabel: l,
|
|
752
|
+
style: d,
|
|
753
|
+
title: y,
|
|
754
|
+
items: _,
|
|
755
|
+
onToolToggle: v
|
|
726
756
|
}),
|
|
727
|
-
|
|
728
|
-
isOpen:
|
|
757
|
+
h != null && /* @__PURE__ */ W(He, {
|
|
758
|
+
isOpen: D,
|
|
729
759
|
onBack: () => {
|
|
730
|
-
|
|
760
|
+
O(!1), E(!0);
|
|
731
761
|
},
|
|
732
|
-
backLabel:
|
|
733
|
-
onClose: () =>
|
|
734
|
-
closeLabel:
|
|
735
|
-
style:
|
|
736
|
-
features:
|
|
737
|
-
initialResponseFormat:
|
|
738
|
-
initialSystemPrompt:
|
|
739
|
-
initialTemperature:
|
|
740
|
-
onSave:
|
|
741
|
-
title:
|
|
742
|
-
responseFormatLabel:
|
|
743
|
-
responseFormatHint:
|
|
744
|
-
responseFormatMarkdownLabel:
|
|
745
|
-
responseFormatPlainTextLabel:
|
|
746
|
-
systemPromptLabel:
|
|
747
|
-
systemPromptTooltip:
|
|
748
|
-
temperatureLabel:
|
|
749
|
-
temperatureLabels:
|
|
750
|
-
temperatureHint:
|
|
751
|
-
saveLabel:
|
|
752
|
-
saveDisabledTooltip:
|
|
762
|
+
backLabel: h.backLabel ?? "Back",
|
|
763
|
+
onClose: () => O(!1),
|
|
764
|
+
closeLabel: l,
|
|
765
|
+
style: d,
|
|
766
|
+
features: h.features,
|
|
767
|
+
initialResponseFormat: h.responseFormat ?? i.Markdown,
|
|
768
|
+
initialSystemPrompt: h.systemPrompt,
|
|
769
|
+
initialTemperature: h.temperature,
|
|
770
|
+
onSave: h.onSave,
|
|
771
|
+
title: h.title,
|
|
772
|
+
responseFormatLabel: h.responseFormatLabel,
|
|
773
|
+
responseFormatHint: h.responseFormatHint,
|
|
774
|
+
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
775
|
+
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
776
|
+
systemPromptLabel: h.systemPromptLabel,
|
|
777
|
+
systemPromptTooltip: h.systemPromptTooltip,
|
|
778
|
+
temperatureLabel: h.temperatureLabel,
|
|
779
|
+
temperatureLabels: h.temperatureLabels,
|
|
780
|
+
temperatureHint: h.temperatureHint,
|
|
781
|
+
saveLabel: h.saveLabel,
|
|
782
|
+
saveDisabledTooltip: h.saveDisabledTooltip
|
|
753
783
|
})
|
|
754
|
-
] }) : /* @__PURE__ */ U
|
|
784
|
+
] }) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(f, {
|
|
755
785
|
matchReferenceWidth: !1,
|
|
756
786
|
placement: "bottom-start",
|
|
757
|
-
listClassName:
|
|
758
|
-
items:
|
|
759
|
-
children: /* @__PURE__ */
|
|
760
|
-
icon: /* @__PURE__ */
|
|
787
|
+
listClassName: p,
|
|
788
|
+
items: ee,
|
|
789
|
+
children: /* @__PURE__ */ W(T, {
|
|
790
|
+
icon: /* @__PURE__ */ W(I, {
|
|
761
791
|
size: u.LG,
|
|
762
792
|
"aria-hidden": !0
|
|
763
793
|
}),
|
|
764
794
|
"aria-label": n,
|
|
765
795
|
tooltipProps: { tooltip: n },
|
|
766
|
-
disabled:
|
|
796
|
+
disabled: m
|
|
767
797
|
})
|
|
768
|
-
}),
|
|
769
|
-
features:
|
|
770
|
-
initialResponseFormat:
|
|
771
|
-
initialSystemPrompt:
|
|
772
|
-
initialTemperature:
|
|
773
|
-
onSave:
|
|
774
|
-
onClose: () =>
|
|
775
|
-
title:
|
|
776
|
-
responseFormatLabel:
|
|
777
|
-
responseFormatHint:
|
|
778
|
-
responseFormatMarkdownLabel:
|
|
779
|
-
responseFormatPlainTextLabel:
|
|
780
|
-
systemPromptLabel:
|
|
781
|
-
systemPromptTooltip:
|
|
782
|
-
temperatureLabel:
|
|
783
|
-
temperatureLabels:
|
|
784
|
-
temperatureHint:
|
|
785
|
-
saveLabel:
|
|
786
|
-
saveDisabledTooltip:
|
|
798
|
+
}), h != null && D && /* @__PURE__ */ W(We, {
|
|
799
|
+
features: h.features,
|
|
800
|
+
initialResponseFormat: h.responseFormat ?? i.Markdown,
|
|
801
|
+
initialSystemPrompt: h.systemPrompt,
|
|
802
|
+
initialTemperature: h.temperature,
|
|
803
|
+
onSave: h.onSave,
|
|
804
|
+
onClose: () => O(!1),
|
|
805
|
+
title: h.title,
|
|
806
|
+
responseFormatLabel: h.responseFormatLabel,
|
|
807
|
+
responseFormatHint: h.responseFormatHint,
|
|
808
|
+
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
809
|
+
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
810
|
+
systemPromptLabel: h.systemPromptLabel,
|
|
811
|
+
systemPromptTooltip: h.systemPromptTooltip,
|
|
812
|
+
temperatureLabel: h.temperatureLabel,
|
|
813
|
+
temperatureLabels: h.temperatureLabels,
|
|
814
|
+
temperatureHint: h.temperatureHint,
|
|
815
|
+
saveLabel: h.saveLabel,
|
|
816
|
+
saveDisabledTooltip: h.saveDisabledTooltip
|
|
787
817
|
})] }) });
|
|
788
|
-
},
|
|
818
|
+
}, q = {
|
|
789
819
|
chip: "_chip_1gvzk_1",
|
|
790
820
|
chipIcon: "_chipIcon_1gvzk_6",
|
|
791
821
|
chipText: "_chipText_1gvzk_10",
|
|
792
822
|
chipClose: "_chipClose_1gvzk_14"
|
|
793
|
-
},
|
|
823
|
+
}, J = (e) => `${e} tool${e === 1 ? "" : "s"}`, Ye = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = J, removeLabel: i = Ye, typography: s, colors: l }) => {
|
|
794
824
|
let u = e.filter((e) => e.isSelected);
|
|
795
825
|
if (u.length === 0) return null;
|
|
796
826
|
let d = a({
|
|
@@ -802,47 +832,47 @@ var Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
802
832
|
"--ci-chip-close-hover": l?.chipCloseHover
|
|
803
833
|
});
|
|
804
834
|
if (n) {
|
|
805
|
-
let e = u.length === 1 ? u[0].icon : /* @__PURE__ */
|
|
835
|
+
let e = u.length === 1 ? u[0].icon : /* @__PURE__ */ W(ce, {
|
|
806
836
|
size: c,
|
|
807
837
|
"aria-hidden": !0
|
|
808
838
|
});
|
|
809
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ W("div", {
|
|
810
840
|
className: "flex flex-wrap items-center gap-2",
|
|
811
841
|
style: d,
|
|
812
|
-
children: /* @__PURE__ */
|
|
813
|
-
className: o(
|
|
814
|
-
children: [/* @__PURE__ */
|
|
815
|
-
className:
|
|
842
|
+
children: /* @__PURE__ */ G("div", {
|
|
843
|
+
className: o(q.chip, "flex items-center gap-1.5 rounded-full border px-2 py-1"),
|
|
844
|
+
children: [/* @__PURE__ */ W("span", {
|
|
845
|
+
className: q.chipIcon,
|
|
816
846
|
"aria-hidden": !0,
|
|
817
847
|
children: e
|
|
818
|
-
}), /* @__PURE__ */
|
|
819
|
-
className: o(
|
|
848
|
+
}), /* @__PURE__ */ W("span", {
|
|
849
|
+
className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
820
850
|
children: r(u.length)
|
|
821
851
|
})]
|
|
822
852
|
})
|
|
823
853
|
});
|
|
824
854
|
}
|
|
825
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ W("div", {
|
|
826
856
|
className: "flex flex-wrap items-center gap-2",
|
|
827
857
|
style: d,
|
|
828
|
-
children: u.map((e) => /* @__PURE__ */
|
|
829
|
-
className: o(
|
|
858
|
+
children: u.map((e) => /* @__PURE__ */ G("div", {
|
|
859
|
+
className: o(q.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
|
|
830
860
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
className:
|
|
861
|
+
/* @__PURE__ */ W("span", {
|
|
862
|
+
className: q.chipIcon,
|
|
833
863
|
"aria-hidden": !0,
|
|
834
864
|
children: e.icon
|
|
835
865
|
}),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
className: o(
|
|
866
|
+
/* @__PURE__ */ W("span", {
|
|
867
|
+
className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
838
868
|
children: e.label
|
|
839
869
|
}),
|
|
840
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ W("button", {
|
|
841
871
|
type: "button",
|
|
842
872
|
onClick: () => t(e.id),
|
|
843
|
-
className: o(
|
|
873
|
+
className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
844
874
|
"aria-label": i(e.label),
|
|
845
|
-
children: /* @__PURE__ */
|
|
875
|
+
children: /* @__PURE__ */ W(le, {
|
|
846
876
|
size: 12,
|
|
847
877
|
"aria-hidden": !0
|
|
848
878
|
})
|
|
@@ -850,43 +880,43 @@ var Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
850
880
|
]
|
|
851
881
|
}, e.id))
|
|
852
882
|
});
|
|
853
|
-
},
|
|
883
|
+
}, Y = {
|
|
854
884
|
wrapper: "_wrapper_4e8i8_1",
|
|
855
885
|
wrapperDisabled: "_wrapperDisabled_4e8i8_8",
|
|
856
886
|
textarea: "_textarea_4e8i8_13",
|
|
857
887
|
modelSelectorButton: "_modelSelectorButton_4e8i8_24",
|
|
858
888
|
modelSelectorCaret: "_modelSelectorCaret_4e8i8_24",
|
|
859
889
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_4e8i8_33"
|
|
860
|
-
},
|
|
890
|
+
}, Ze = {
|
|
861
891
|
wrapperError: "_wrapperError_5wiyg_1",
|
|
862
892
|
waveformCanvas: "_waveformCanvas_5wiyg_5",
|
|
863
893
|
timer: "_timer_5wiyg_9",
|
|
864
894
|
stopRecordingIcon: "_stopRecordingIcon_5wiyg_15",
|
|
865
895
|
recordingDot: "_recordingDot_5wiyg_29",
|
|
866
896
|
"recording-pulse": "_recording-pulse_5wiyg_1"
|
|
867
|
-
},
|
|
868
|
-
let p =
|
|
897
|
+
}, Qe = 3, $e = 4, X = 200, et = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, tt = ({ state: e, analyserNodeRef: t, elapsedSeconds: n, errorMessage: r, onStop: i, onDiscard: a, stopLabel: s = "Stop recording", discardLabel: c = "Discard recording", timerLabel: l = "Recording time", style: d, className: f }) => {
|
|
898
|
+
let p = V(null), h = V(new Float32Array(X)), g = V(0), _ = V(0), v = e === Me.Recording, y = e === Me.Error, b = R((e) => {
|
|
869
899
|
let t = e.getContext("2d");
|
|
870
900
|
if (!t) return;
|
|
871
901
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
872
902
|
let { width: n, height: r } = e;
|
|
873
903
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
874
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
904
|
+
let i = Math.min(Math.max(1, Math.floor(n / $e)), X - 1), a = g.current, o = _.current;
|
|
875
905
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
876
906
|
for (let e = 0; e <= i; e++) {
|
|
877
|
-
let n = ((a - i + e) %
|
|
878
|
-
t.fillRect(e *
|
|
907
|
+
let n = ((a - i + e) % X + X) % X, o = h.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
908
|
+
t.fillRect(e * $e, (r - c) / 2, Qe, c);
|
|
879
909
|
}
|
|
880
910
|
t.restore();
|
|
881
911
|
}, []);
|
|
882
|
-
|
|
912
|
+
z(() => {
|
|
883
913
|
if (!v) return;
|
|
884
914
|
let e = p.current;
|
|
885
915
|
if (!e) return;
|
|
886
916
|
h.current.fill(0), g.current = 0, _.current = 0;
|
|
887
917
|
let n, r = () => {
|
|
888
|
-
if (_.current += 1, _.current >=
|
|
889
|
-
_.current -=
|
|
918
|
+
if (_.current += 1, _.current >= $e) {
|
|
919
|
+
_.current -= $e;
|
|
890
920
|
let e = t.current;
|
|
891
921
|
if (e) {
|
|
892
922
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -896,7 +926,7 @@ var Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
896
926
|
let r = (t[e] - 128) / 128;
|
|
897
927
|
n += r * r;
|
|
898
928
|
}
|
|
899
|
-
h.current[g.current %
|
|
929
|
+
h.current[g.current % X] = Math.sqrt(n / t.length), g.current++;
|
|
900
930
|
}
|
|
901
931
|
}
|
|
902
932
|
b(e), n = requestAnimationFrame(r);
|
|
@@ -908,7 +938,7 @@ var Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
908
938
|
v,
|
|
909
939
|
t,
|
|
910
940
|
b
|
|
911
|
-
]),
|
|
941
|
+
]), z(() => {
|
|
912
942
|
let e = p.current;
|
|
913
943
|
if (!e) return;
|
|
914
944
|
let t = new ResizeObserver(() => {
|
|
@@ -916,154 +946,157 @@ var Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
916
946
|
});
|
|
917
947
|
return t.observe(e), () => t.disconnect();
|
|
918
948
|
}, [b]);
|
|
919
|
-
let x = /* @__PURE__ */
|
|
949
|
+
let x = /* @__PURE__ */ G("div", {
|
|
920
950
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
922
|
-
icon: /* @__PURE__ */
|
|
951
|
+
children: [/* @__PURE__ */ W(T, {
|
|
952
|
+
icon: /* @__PURE__ */ W(le, {
|
|
923
953
|
size: u.LG,
|
|
924
954
|
"aria-hidden": !0
|
|
925
955
|
}),
|
|
926
956
|
"aria-label": c,
|
|
927
957
|
onClick: a
|
|
928
|
-
}), v && /* @__PURE__ */
|
|
929
|
-
icon: /* @__PURE__ */
|
|
958
|
+
}), v && /* @__PURE__ */ W(A, {
|
|
959
|
+
icon: /* @__PURE__ */ W(ae, { size: u.LG }),
|
|
930
960
|
onClick: () => i?.(),
|
|
931
961
|
"aria-label": s
|
|
932
962
|
})]
|
|
933
963
|
});
|
|
934
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ G("div", {
|
|
935
965
|
className: f,
|
|
936
|
-
children: [/* @__PURE__ */
|
|
966
|
+
children: [/* @__PURE__ */ G("div", {
|
|
937
967
|
style: d,
|
|
938
|
-
className: o(
|
|
939
|
-
children: [/* @__PURE__ */
|
|
968
|
+
className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", y && Ze.wrapperError),
|
|
969
|
+
children: [/* @__PURE__ */ G("div", {
|
|
940
970
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
941
|
-
children: [v && /* @__PURE__ */ U
|
|
942
|
-
className: o(
|
|
971
|
+
children: [v && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
972
|
+
className: o(Ze.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
943
973
|
"aria-hidden": !0
|
|
944
|
-
}), /* @__PURE__ */
|
|
945
|
-
className: o(
|
|
974
|
+
}), /* @__PURE__ */ W("span", {
|
|
975
|
+
className: o(Ze.timer, "flex-shrink-0"),
|
|
946
976
|
"aria-label": l,
|
|
947
|
-
children:
|
|
948
|
-
})] }), /* @__PURE__ */
|
|
977
|
+
children: et(n)
|
|
978
|
+
})] }), /* @__PURE__ */ W("canvas", {
|
|
949
979
|
ref: p,
|
|
950
980
|
height: 32,
|
|
951
|
-
className: o(
|
|
981
|
+
className: o(Ze.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
952
982
|
})]
|
|
953
983
|
}), x]
|
|
954
|
-
}), y && r && /* @__PURE__ */
|
|
984
|
+
}), y && r && /* @__PURE__ */ W(m, {
|
|
955
985
|
text: r,
|
|
956
986
|
className: "mt-1 px-1"
|
|
957
987
|
})]
|
|
958
988
|
});
|
|
959
|
-
},
|
|
989
|
+
}, nt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ W(A, {
|
|
960
990
|
"aria-label": n,
|
|
961
991
|
onClick: () => e?.(),
|
|
962
992
|
disabled: t,
|
|
963
993
|
"aria-hidden": r,
|
|
964
|
-
icon: /* @__PURE__ */
|
|
994
|
+
icon: /* @__PURE__ */ W(ee, {
|
|
965
995
|
size: u.LG,
|
|
966
996
|
className: "rtl:scale-x-[-1]"
|
|
967
997
|
})
|
|
968
|
-
}),
|
|
969
|
-
icon: /* @__PURE__ */
|
|
998
|
+
}), rt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ W(M, {
|
|
999
|
+
icon: /* @__PURE__ */ W(oe, { size: u.LG }),
|
|
970
1000
|
onClick: () => e?.(),
|
|
971
1001
|
"aria-label": t
|
|
972
|
-
}),
|
|
1002
|
+
}), it = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ G("svg", {
|
|
973
1003
|
width: u.SM,
|
|
974
1004
|
height: u.SM,
|
|
975
1005
|
viewBox: "0 0 24 24",
|
|
976
1006
|
fill: "none",
|
|
977
1007
|
"aria-hidden": !0,
|
|
978
|
-
children: [/* @__PURE__ */
|
|
1008
|
+
children: [/* @__PURE__ */ W("defs", { children: /* @__PURE__ */ G("linearGradient", {
|
|
979
1009
|
id: e,
|
|
980
1010
|
x1: "0",
|
|
981
1011
|
y1: "0",
|
|
982
1012
|
x2: "24",
|
|
983
1013
|
y2: "24",
|
|
984
1014
|
gradientUnits: "userSpaceOnUse",
|
|
985
|
-
children: [/* @__PURE__ */
|
|
1015
|
+
children: [/* @__PURE__ */ W("stop", {
|
|
986
1016
|
offset: "0%",
|
|
987
1017
|
stopColor: "#4b7be6"
|
|
988
|
-
}), /* @__PURE__ */
|
|
1018
|
+
}), /* @__PURE__ */ W("stop", {
|
|
989
1019
|
offset: "100%",
|
|
990
1020
|
stopColor: "#9355f4"
|
|
991
1021
|
})]
|
|
992
|
-
}) }), /* @__PURE__ */
|
|
1022
|
+
}) }), /* @__PURE__ */ W("path", {
|
|
993
1023
|
d: "M5 12l5 5L20 7",
|
|
994
1024
|
stroke: `url(#${e})`,
|
|
995
1025
|
strokeWidth: "2",
|
|
996
1026
|
strokeLinecap: "round",
|
|
997
1027
|
strokeLinejoin: "round"
|
|
998
1028
|
})]
|
|
999
|
-
}),
|
|
1029
|
+
}), at = {
|
|
1000
1030
|
tabContainer: "_tabContainer_153ct_1",
|
|
1001
1031
|
tabActive: "_tabActive_153ct_13"
|
|
1002
1032
|
};
|
|
1003
|
-
|
|
1033
|
+
L(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
1004
1034
|
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
1005
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ W("div", {
|
|
1006
1036
|
className: "flex flex-nowrap gap-1",
|
|
1007
1037
|
role: "tablist",
|
|
1008
1038
|
children: e.map((e) => {
|
|
1009
1039
|
let r = t === e.id;
|
|
1010
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ W("div", {
|
|
1011
1041
|
role: "tab",
|
|
1012
1042
|
"aria-selected": r,
|
|
1013
1043
|
className: "contents",
|
|
1014
|
-
children: /* @__PURE__ */
|
|
1044
|
+
children: /* @__PURE__ */ W(S, {
|
|
1015
1045
|
label: e.label,
|
|
1016
1046
|
selected: r,
|
|
1017
1047
|
onClick: () => n(e.id),
|
|
1018
|
-
className: o("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i,
|
|
1048
|
+
className: o("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, at.tabContainer, r && at.tabActive)
|
|
1019
1049
|
})
|
|
1020
1050
|
}, e.id);
|
|
1021
1051
|
})
|
|
1022
1052
|
});
|
|
1023
1053
|
});
|
|
1024
|
-
var
|
|
1054
|
+
var ot = ({ size: e = 20 }) => /* @__PURE__ */ W(y, {
|
|
1025
1055
|
variant: b.Circular,
|
|
1026
1056
|
width: e,
|
|
1027
1057
|
height: e,
|
|
1028
1058
|
active: !0
|
|
1029
|
-
}),
|
|
1059
|
+
}), st = ({ loadingLabel: e }) => /* @__PURE__ */ G("span", {
|
|
1030
1060
|
className: "flex min-w-0 flex-1 items-center",
|
|
1031
|
-
children: [/* @__PURE__ */
|
|
1061
|
+
children: [/* @__PURE__ */ W(y, {
|
|
1032
1062
|
variant: b.Text,
|
|
1033
1063
|
width: "100%",
|
|
1034
1064
|
height: 16,
|
|
1035
1065
|
active: !0
|
|
1036
|
-
}), e && /* @__PURE__ */
|
|
1066
|
+
}), e && /* @__PURE__ */ W("span", {
|
|
1037
1067
|
className: "sr-only",
|
|
1038
1068
|
children: e
|
|
1039
1069
|
})]
|
|
1040
|
-
}),
|
|
1070
|
+
}), ct = ({ loadingLabel: e }) => /* @__PURE__ */ W("div", {
|
|
1041
1071
|
role: "status",
|
|
1042
1072
|
"aria-label": e,
|
|
1043
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1073
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ G("div", {
|
|
1044
1074
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1045
1075
|
"aria-hidden": "true",
|
|
1046
|
-
children: [/* @__PURE__ */
|
|
1076
|
+
children: [/* @__PURE__ */ W(ot, {}), /* @__PURE__ */ W(st, {})]
|
|
1047
1077
|
}, t))
|
|
1048
|
-
}),
|
|
1078
|
+
}), lt = (e) => e.displayName ?? e.id, ut = (e, t) => {
|
|
1049
1079
|
let n = t.trim().toLowerCase();
|
|
1050
|
-
return n ? e.filter((e) =>
|
|
1051
|
-
},
|
|
1080
|
+
return n ? e.filter((e) => lt(e).toLowerCase().includes(n)) : e;
|
|
1081
|
+
}, dt = (e, t, r, i = 18, a) => /* @__PURE__ */ W(n, {
|
|
1052
1082
|
src: e,
|
|
1053
1083
|
size: i,
|
|
1054
1084
|
labels: { tooltip: a },
|
|
1055
1085
|
initialsName: r
|
|
1056
|
-
}),
|
|
1057
|
-
|
|
1086
|
+
}), ft = {
|
|
1087
|
+
searchHeader: "_searchHeader_3587a_1",
|
|
1088
|
+
selectedItem: "_selectedItem_3587a_5"
|
|
1089
|
+
}, pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ft.searchHeader, selectedItemClassName: a = ft.selectedItem }) => {
|
|
1090
|
+
let [s, c] = H(""), l = B(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = B(() => d ? /* @__PURE__ */ W(ot, { size: u.LG }) : dt(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", u.LG), [d, l]), p = l?.displayName ?? l?.id;
|
|
1058
1091
|
return {
|
|
1059
|
-
selectorIcon:
|
|
1060
|
-
selectorAriaLabel:
|
|
1061
|
-
selectedLabel:
|
|
1062
|
-
menuItems:
|
|
1063
|
-
if (
|
|
1092
|
+
selectorIcon: f,
|
|
1093
|
+
selectorAriaLabel: p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model",
|
|
1094
|
+
selectedLabel: p,
|
|
1095
|
+
menuItems: B(() => {
|
|
1096
|
+
if (d) return Array.from({ length: 7 }, (e, t) => ({
|
|
1064
1097
|
key: `__loading-${t}`,
|
|
1065
|
-
icon: /* @__PURE__ */
|
|
1066
|
-
label: /* @__PURE__ */
|
|
1098
|
+
icon: /* @__PURE__ */ W(ot, {}),
|
|
1099
|
+
label: /* @__PURE__ */ W(st, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1067
1100
|
disabled: !0
|
|
1068
1101
|
}));
|
|
1069
1102
|
if (!e || e.length === 0) {
|
|
@@ -1074,53 +1107,54 @@ var rt = ({ size: e = 20 }) => /* @__PURE__ */ H(y, {
|
|
|
1074
1107
|
disabled: !0
|
|
1075
1108
|
}] : [];
|
|
1076
1109
|
}
|
|
1077
|
-
return
|
|
1110
|
+
return ut(e, s).map((e) => {
|
|
1078
1111
|
let r = e.id === t;
|
|
1079
1112
|
return {
|
|
1080
1113
|
key: e.id,
|
|
1081
|
-
label: /* @__PURE__ */
|
|
1114
|
+
label: /* @__PURE__ */ G("span", {
|
|
1082
1115
|
className: "flex w-full items-center justify-between gap-2",
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
1084
|
-
text:
|
|
1085
|
-
query:
|
|
1116
|
+
children: [/* @__PURE__ */ W(E, {
|
|
1117
|
+
text: lt(e),
|
|
1118
|
+
query: s,
|
|
1086
1119
|
maxLines: 1
|
|
1087
|
-
}), r && /* @__PURE__ */
|
|
1120
|
+
}), r && /* @__PURE__ */ W(it, { gradientId: "ms-check-grad" })]
|
|
1088
1121
|
}),
|
|
1089
|
-
icon:
|
|
1122
|
+
icon: dt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1090
1123
|
onClick: () => n?.(e.id),
|
|
1091
|
-
className: r ?
|
|
1124
|
+
className: r ? a : void 0
|
|
1092
1125
|
};
|
|
1093
1126
|
});
|
|
1094
1127
|
}, [
|
|
1095
1128
|
e,
|
|
1096
|
-
|
|
1097
|
-
|
|
1129
|
+
d,
|
|
1130
|
+
s,
|
|
1098
1131
|
t,
|
|
1099
1132
|
r,
|
|
1100
|
-
n
|
|
1133
|
+
n,
|
|
1134
|
+
a
|
|
1101
1135
|
]),
|
|
1102
|
-
menuHeader:
|
|
1136
|
+
menuHeader: B(() => !d && e && e.length > 0 ? /* @__PURE__ */ W("div", {
|
|
1103
1137
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1104
|
-
children: /* @__PURE__ */
|
|
1105
|
-
value:
|
|
1138
|
+
children: /* @__PURE__ */ W(v, {
|
|
1139
|
+
value: s,
|
|
1106
1140
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1107
1141
|
size: w.Small,
|
|
1108
1142
|
wrapperClassName: "border-0",
|
|
1109
|
-
onChange:
|
|
1143
|
+
onChange: c
|
|
1110
1144
|
})
|
|
1111
1145
|
}) : void 0, [
|
|
1112
1146
|
e,
|
|
1113
|
-
|
|
1114
|
-
|
|
1147
|
+
d,
|
|
1148
|
+
s,
|
|
1115
1149
|
r,
|
|
1116
1150
|
i
|
|
1117
1151
|
]),
|
|
1118
1152
|
onOpenChange: (e) => {
|
|
1119
|
-
e ||
|
|
1153
|
+
e || c("");
|
|
1120
1154
|
}
|
|
1121
1155
|
};
|
|
1122
|
-
},
|
|
1123
|
-
function
|
|
1156
|
+
}, mt = typeof window < "u" ? pe : z;
|
|
1157
|
+
function ht(e) {
|
|
1124
1158
|
if (e !== void 0) switch (typeof e) {
|
|
1125
1159
|
case "number": return e;
|
|
1126
1160
|
case "string":
|
|
@@ -1128,15 +1162,15 @@ function dt(e) {
|
|
|
1128
1162
|
break;
|
|
1129
1163
|
}
|
|
1130
1164
|
}
|
|
1131
|
-
function
|
|
1132
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1133
|
-
styleHeight:
|
|
1134
|
-
styleWidth:
|
|
1135
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1165
|
+
function gt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1166
|
+
let { styleHeight: s, styleWidth: c } = B(() => ({
|
|
1167
|
+
styleHeight: ht(o?.height),
|
|
1168
|
+
styleWidth: ht(o?.width)
|
|
1169
|
+
}), [o?.height, o?.width]), [l, u] = H({
|
|
1136
1170
|
height: t,
|
|
1137
1171
|
width: n
|
|
1138
1172
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1139
|
-
return
|
|
1173
|
+
return mt(() => {
|
|
1140
1174
|
if (i === null || d) return;
|
|
1141
1175
|
let t = new ResizeObserver((e) => {
|
|
1142
1176
|
for (let t of e) {
|
|
@@ -1156,7 +1190,7 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1156
1190
|
i,
|
|
1157
1191
|
s,
|
|
1158
1192
|
c
|
|
1159
|
-
]),
|
|
1193
|
+
]), B(() => ({
|
|
1160
1194
|
height: s ?? l.height,
|
|
1161
1195
|
width: c ?? l.width
|
|
1162
1196
|
}), [
|
|
@@ -1165,26 +1199,26 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1165
1199
|
c
|
|
1166
1200
|
]);
|
|
1167
1201
|
}
|
|
1168
|
-
function
|
|
1169
|
-
let t =
|
|
1202
|
+
function _t(e) {
|
|
1203
|
+
let t = V(() => {
|
|
1170
1204
|
throw Error("Cannot call during render.");
|
|
1171
1205
|
});
|
|
1172
|
-
return
|
|
1206
|
+
return mt(() => {
|
|
1173
1207
|
t.current = e;
|
|
1174
|
-
}, [e]),
|
|
1208
|
+
}, [e]), R((e) => t.current?.(e), [t]);
|
|
1175
1209
|
}
|
|
1176
|
-
var
|
|
1177
|
-
function
|
|
1178
|
-
if (
|
|
1210
|
+
var vt = null;
|
|
1211
|
+
function yt(e = !1) {
|
|
1212
|
+
if (vt === null || e) {
|
|
1179
1213
|
let e = document.createElement("div"), t = e.style;
|
|
1180
1214
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1181
1215
|
let n = document.createElement("div"), r = n.style;
|
|
1182
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1216
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? vt = "positive-descending" : (e.scrollLeft = 1, vt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), vt;
|
|
1183
1217
|
}
|
|
1184
|
-
return
|
|
1218
|
+
return vt;
|
|
1185
1219
|
}
|
|
1186
|
-
function
|
|
1187
|
-
if (t === "horizontal" && n) switch (
|
|
1220
|
+
function bt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1221
|
+
if (t === "horizontal" && n) switch (yt()) {
|
|
1188
1222
|
case "negative": return -r;
|
|
1189
1223
|
case "positive-descending":
|
|
1190
1224
|
if (e) {
|
|
@@ -1198,13 +1232,13 @@ function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1198
1232
|
function Z(e, t = "Assertion error") {
|
|
1199
1233
|
if (!e) throw console.error(t), Error(t);
|
|
1200
1234
|
}
|
|
1201
|
-
function
|
|
1235
|
+
function Q(e, t) {
|
|
1202
1236
|
if (e === t) return !0;
|
|
1203
1237
|
if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1204
1238
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1205
1239
|
return !0;
|
|
1206
1240
|
}
|
|
1207
|
-
function
|
|
1241
|
+
function xt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1208
1242
|
if (t === 0) return 0;
|
|
1209
1243
|
if (typeof n == "number") return t * n;
|
|
1210
1244
|
{
|
|
@@ -1212,9 +1246,9 @@ function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
1212
1246
|
return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1213
1247
|
}
|
|
1214
1248
|
}
|
|
1215
|
-
function
|
|
1249
|
+
function St({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1216
1250
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1217
|
-
let s =
|
|
1251
|
+
let s = xt({
|
|
1218
1252
|
cachedBounds: t,
|
|
1219
1253
|
itemCount: r,
|
|
1220
1254
|
itemSize: i
|
|
@@ -1226,7 +1260,7 @@ function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1226
1260
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1227
1261
|
}
|
|
1228
1262
|
}
|
|
1229
|
-
function
|
|
1263
|
+
function $({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1230
1264
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1231
1265
|
for (; u < a;) {
|
|
1232
1266
|
let n = e.get(u);
|
|
@@ -1245,7 +1279,7 @@ function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1245
1279
|
stopIndexOverscan: l
|
|
1246
1280
|
};
|
|
1247
1281
|
}
|
|
1248
|
-
function
|
|
1282
|
+
function Ct({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1249
1283
|
let r = /* @__PURE__ */ new Map();
|
|
1250
1284
|
return {
|
|
1251
1285
|
get(i) {
|
|
@@ -1282,8 +1316,8 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1282
1316
|
}
|
|
1283
1317
|
};
|
|
1284
1318
|
}
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
1319
|
+
function wt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1320
|
+
return B(() => Ct({
|
|
1287
1321
|
itemCount: e,
|
|
1288
1322
|
itemProps: t,
|
|
1289
1323
|
itemSize: n
|
|
@@ -1293,7 +1327,7 @@ function St({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1293
1327
|
n
|
|
1294
1328
|
]);
|
|
1295
1329
|
}
|
|
1296
|
-
function
|
|
1330
|
+
function Tt({ containerSize: e, itemSize: t }) {
|
|
1297
1331
|
let n;
|
|
1298
1332
|
switch (typeof t) {
|
|
1299
1333
|
case "string":
|
|
@@ -1305,21 +1339,21 @@ function Ct({ containerSize: e, itemSize: t }) {
|
|
|
1305
1339
|
}
|
|
1306
1340
|
return n;
|
|
1307
1341
|
}
|
|
1308
|
-
function
|
|
1309
|
-
let { height: u = n, width: d = n } =
|
|
1342
|
+
function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1343
|
+
let { height: u = n, width: d = n } = gt({
|
|
1310
1344
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1311
1345
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1312
1346
|
element: e,
|
|
1313
1347
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1314
1348
|
style: t
|
|
1315
|
-
}), f =
|
|
1349
|
+
}), f = V({
|
|
1316
1350
|
height: 0,
|
|
1317
1351
|
width: 0
|
|
1318
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1352
|
+
}), p = r === "vertical" ? u : d, m = Tt({
|
|
1319
1353
|
containerSize: p,
|
|
1320
1354
|
itemSize: s
|
|
1321
1355
|
});
|
|
1322
|
-
|
|
1356
|
+
pe(() => {
|
|
1323
1357
|
if (typeof c == "function") {
|
|
1324
1358
|
let e = f.current;
|
|
1325
1359
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1332,11 +1366,11 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1332
1366
|
c,
|
|
1333
1367
|
d
|
|
1334
1368
|
]);
|
|
1335
|
-
let h =
|
|
1369
|
+
let h = wt({
|
|
1336
1370
|
itemCount: a,
|
|
1337
1371
|
itemProps: o,
|
|
1338
1372
|
itemSize: m
|
|
1339
|
-
}), g =
|
|
1373
|
+
}), g = R((e) => h.get(e), [h]), [_, v] = H(() => $({
|
|
1340
1374
|
cachedBounds: h,
|
|
1341
1375
|
containerScrollOffset: 0,
|
|
1342
1376
|
containerSize: p,
|
|
@@ -1347,7 +1381,7 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1347
1381
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1348
1382
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1349
1383
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1350
|
-
}, C =
|
|
1384
|
+
}, C = R(() => xt({
|
|
1351
1385
|
cachedBounds: h,
|
|
1352
1386
|
itemCount: a,
|
|
1353
1387
|
itemSize: m
|
|
@@ -1355,9 +1389,9 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1355
1389
|
h,
|
|
1356
1390
|
a,
|
|
1357
1391
|
m
|
|
1358
|
-
]), w =
|
|
1392
|
+
]), w = R((t) => $({
|
|
1359
1393
|
cachedBounds: h,
|
|
1360
|
-
containerScrollOffset:
|
|
1394
|
+
containerScrollOffset: bt({
|
|
1361
1395
|
containerElement: e,
|
|
1362
1396
|
direction: r,
|
|
1363
1397
|
isRtl: i,
|
|
@@ -1375,19 +1409,19 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1375
1409
|
a,
|
|
1376
1410
|
l
|
|
1377
1411
|
]);
|
|
1378
|
-
return
|
|
1412
|
+
return mt(() => {
|
|
1379
1413
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1380
1414
|
}, [
|
|
1381
1415
|
e,
|
|
1382
1416
|
r,
|
|
1383
1417
|
w
|
|
1384
|
-
]),
|
|
1418
|
+
]), mt(() => {
|
|
1385
1419
|
if (!e) return;
|
|
1386
1420
|
let t = () => {
|
|
1387
1421
|
v((t) => {
|
|
1388
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1422
|
+
let { scrollLeft: n, scrollTop: o } = e, s = $({
|
|
1389
1423
|
cachedBounds: h,
|
|
1390
|
-
containerScrollOffset:
|
|
1424
|
+
containerScrollOffset: bt({
|
|
1391
1425
|
containerElement: e,
|
|
1392
1426
|
direction: r,
|
|
1393
1427
|
isRtl: i,
|
|
@@ -1397,7 +1431,7 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1397
1431
|
itemCount: a,
|
|
1398
1432
|
overscanCount: l
|
|
1399
1433
|
});
|
|
1400
|
-
return
|
|
1434
|
+
return Q(s, t) ? t : s;
|
|
1401
1435
|
});
|
|
1402
1436
|
};
|
|
1403
1437
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1413,8 +1447,8 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1413
1447
|
]), {
|
|
1414
1448
|
getCellBounds: g,
|
|
1415
1449
|
getEstimatedSize: C,
|
|
1416
|
-
scrollToIndex:
|
|
1417
|
-
let s =
|
|
1450
|
+
scrollToIndex: _t(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1451
|
+
let s = St({
|
|
1418
1452
|
align: t,
|
|
1419
1453
|
cachedBounds: h,
|
|
1420
1454
|
containerScrollOffset: n,
|
|
@@ -1424,14 +1458,14 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1424
1458
|
itemSize: m
|
|
1425
1459
|
});
|
|
1426
1460
|
if (e) {
|
|
1427
|
-
if (s =
|
|
1461
|
+
if (s = bt({
|
|
1428
1462
|
containerElement: e,
|
|
1429
1463
|
direction: r,
|
|
1430
1464
|
isRtl: i,
|
|
1431
1465
|
scrollOffset: s
|
|
1432
1466
|
}), typeof e.scrollTo != "function") {
|
|
1433
1467
|
let e = w(s);
|
|
1434
|
-
|
|
1468
|
+
Q(_, e) || v(e);
|
|
1435
1469
|
}
|
|
1436
1470
|
return s;
|
|
1437
1471
|
}
|
|
@@ -1442,30 +1476,30 @@ function Q({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1442
1476
|
stopIndexVisible: x
|
|
1443
1477
|
};
|
|
1444
1478
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1479
|
+
function Dt(e) {
|
|
1480
|
+
return B(() => e, Object.values(e));
|
|
1447
1481
|
}
|
|
1448
|
-
function
|
|
1482
|
+
function Ot(e, t) {
|
|
1449
1483
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1450
|
-
return
|
|
1484
|
+
return Q(n, a) && Q(r, o) && Q(i, s);
|
|
1451
1485
|
}
|
|
1452
|
-
function
|
|
1486
|
+
function kt(e) {
|
|
1453
1487
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1454
1488
|
}
|
|
1455
|
-
var
|
|
1456
|
-
function
|
|
1457
|
-
let m =
|
|
1489
|
+
var At = "data-react-window-index";
|
|
1490
|
+
function jt({ 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 }) {
|
|
1491
|
+
let m = Dt(u), h = B(() => L(s, Ot), [s]), [g, _] = H(null), v = kt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Et({
|
|
1458
1492
|
containerElement: g,
|
|
1459
1493
|
containerStyle: f,
|
|
1460
1494
|
defaultContainerSize: n,
|
|
1461
1495
|
direction: "vertical",
|
|
1462
1496
|
itemCount: c,
|
|
1463
1497
|
itemProps: m,
|
|
1464
|
-
itemSize:
|
|
1498
|
+
itemSize: B(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1465
1499
|
onResize: i,
|
|
1466
1500
|
overscanCount: o
|
|
1467
1501
|
});
|
|
1468
|
-
|
|
1502
|
+
fe(r, () => ({
|
|
1469
1503
|
get element() {
|
|
1470
1504
|
return g;
|
|
1471
1505
|
},
|
|
@@ -1480,12 +1514,12 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1480
1514
|
top: r
|
|
1481
1515
|
});
|
|
1482
1516
|
}
|
|
1483
|
-
}), [g, x]),
|
|
1517
|
+
}), [g, x]), mt(() => {
|
|
1484
1518
|
if (!g) return;
|
|
1485
1519
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1486
1520
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1487
1521
|
let n = `${S + t}`;
|
|
1488
|
-
return e.setAttribute(
|
|
1522
|
+
return e.setAttribute(At, n), !0;
|
|
1489
1523
|
});
|
|
1490
1524
|
if (v) return l.observeRowElements(e);
|
|
1491
1525
|
}, [
|
|
@@ -1494,7 +1528,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1494
1528
|
l,
|
|
1495
1529
|
S,
|
|
1496
1530
|
w
|
|
1497
|
-
]),
|
|
1531
|
+
]), z(() => {
|
|
1498
1532
|
S >= 0 && w >= 0 && a && a({
|
|
1499
1533
|
startIndex: C,
|
|
1500
1534
|
stopIndex: T
|
|
@@ -1509,11 +1543,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1509
1543
|
w,
|
|
1510
1544
|
T
|
|
1511
1545
|
]);
|
|
1512
|
-
let E =
|
|
1546
|
+
let E = B(() => {
|
|
1513
1547
|
let e = [];
|
|
1514
1548
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1515
1549
|
let n = y(t);
|
|
1516
|
-
e.push(/* @__PURE__ */
|
|
1550
|
+
e.push(/* @__PURE__ */ de(h, {
|
|
1517
1551
|
...m,
|
|
1518
1552
|
ariaAttributes: {
|
|
1519
1553
|
"aria-posinset": t + 1,
|
|
@@ -1540,7 +1574,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1540
1574
|
m,
|
|
1541
1575
|
S,
|
|
1542
1576
|
w
|
|
1543
|
-
]), D = /* @__PURE__ */
|
|
1577
|
+
]), D = /* @__PURE__ */ W("div", {
|
|
1544
1578
|
"aria-hidden": !0,
|
|
1545
1579
|
style: {
|
|
1546
1580
|
height: b(),
|
|
@@ -1548,7 +1582,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1548
1582
|
zIndex: -1
|
|
1549
1583
|
}
|
|
1550
1584
|
});
|
|
1551
|
-
return
|
|
1585
|
+
return de(d, {
|
|
1552
1586
|
role: "list",
|
|
1553
1587
|
...p,
|
|
1554
1588
|
className: t,
|
|
@@ -1562,46 +1596,46 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1562
1596
|
}
|
|
1563
1597
|
}, E, e, D);
|
|
1564
1598
|
}
|
|
1565
|
-
var
|
|
1599
|
+
var Mt = {
|
|
1566
1600
|
divider: "_divider_13nxz_1",
|
|
1567
1601
|
item: "_item_13nxz_5",
|
|
1568
1602
|
itemIcon: "_itemIcon_13nxz_15",
|
|
1569
1603
|
checkIcon: "_checkIcon_13nxz_19",
|
|
1570
1604
|
stateLabel: "_stateLabel_13nxz_23"
|
|
1571
|
-
},
|
|
1572
|
-
let d = r[e], f =
|
|
1573
|
-
return /* @__PURE__ */
|
|
1605
|
+
}, Nt = 44, Pt = 8, Ft = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1606
|
+
let d = r[e], f = dt(d.iconUrl, d.type, d.displayName ?? d.id, u.SM), p = d.id === i;
|
|
1607
|
+
return /* @__PURE__ */ W("div", {
|
|
1574
1608
|
style: t,
|
|
1575
1609
|
...n,
|
|
1576
|
-
children: /* @__PURE__ */
|
|
1610
|
+
children: /* @__PURE__ */ W(l, {
|
|
1577
1611
|
type: "button",
|
|
1578
|
-
className: o(
|
|
1579
|
-
iconBefore: /* @__PURE__ */
|
|
1580
|
-
className:
|
|
1612
|
+
className: o(Mt.item, "h-full w-full gap-3 px-4"),
|
|
1613
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
1614
|
+
className: Mt.itemIcon,
|
|
1581
1615
|
children: f
|
|
1582
1616
|
}),
|
|
1583
|
-
label: /* @__PURE__ */
|
|
1617
|
+
label: /* @__PURE__ */ G("span", {
|
|
1584
1618
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1585
|
-
children: [/* @__PURE__ */
|
|
1619
|
+
children: [/* @__PURE__ */ W(E, {
|
|
1586
1620
|
text: d.displayName ?? d.id,
|
|
1587
1621
|
query: s,
|
|
1588
1622
|
maxLines: 1,
|
|
1589
1623
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1590
|
-
}), p && /* @__PURE__ */
|
|
1624
|
+
}), p && /* @__PURE__ */ W(te, {
|
|
1591
1625
|
size: u.SM,
|
|
1592
|
-
className:
|
|
1626
|
+
className: Mt.checkIcon,
|
|
1593
1627
|
"aria-hidden": !0
|
|
1594
1628
|
})]
|
|
1595
1629
|
}),
|
|
1596
1630
|
onClick: () => c(d.id)
|
|
1597
1631
|
})
|
|
1598
1632
|
});
|
|
1599
|
-
},
|
|
1600
|
-
let [_, y] =
|
|
1601
|
-
|
|
1633
|
+
}, It = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g }) => {
|
|
1634
|
+
let [_, y] = H("");
|
|
1635
|
+
z(() => {
|
|
1602
1636
|
e || y("");
|
|
1603
1637
|
}, [e]);
|
|
1604
|
-
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1638
|
+
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? ut(s, _) : [], T = (e) => {
|
|
1605
1639
|
l(e), i();
|
|
1606
1640
|
}, E = a({
|
|
1607
1641
|
"--ci-sheet-divider": g?.divider,
|
|
@@ -1611,7 +1645,7 @@ var $ = {
|
|
|
1611
1645
|
"--ci-sheet-icon": g?.itemIcon,
|
|
1612
1646
|
"--ci-check-icon": g?.checkIcon
|
|
1613
1647
|
});
|
|
1614
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ W(K, {
|
|
1615
1649
|
isOpen: e,
|
|
1616
1650
|
title: t,
|
|
1617
1651
|
closeLabel: n,
|
|
@@ -1620,28 +1654,28 @@ var $ = {
|
|
|
1620
1654
|
titleClassName: m,
|
|
1621
1655
|
className: "max-h-[80dvh]",
|
|
1622
1656
|
colors: g?.shell,
|
|
1623
|
-
children: /* @__PURE__ */
|
|
1657
|
+
children: /* @__PURE__ */ G("div", {
|
|
1624
1658
|
className: "contents",
|
|
1625
1659
|
style: E,
|
|
1626
|
-
children: [b && !x && /* @__PURE__ */ U
|
|
1660
|
+
children: [b && !x && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
1627
1661
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1628
|
-
children: /* @__PURE__ */
|
|
1662
|
+
children: /* @__PURE__ */ W(v, {
|
|
1629
1663
|
value: _,
|
|
1630
1664
|
placeholder: r,
|
|
1631
1665
|
size: w.Standard,
|
|
1632
1666
|
onChange: y
|
|
1633
1667
|
})
|
|
1634
|
-
}), /* @__PURE__ */
|
|
1668
|
+
}), /* @__PURE__ */ W("div", { className: o(Mt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ W(ct, { loadingLabel: u }) : S ? /* @__PURE__ */ W("div", {
|
|
1635
1669
|
role: "list",
|
|
1636
|
-
className: o(
|
|
1670
|
+
className: o(Mt.stateLabel, h, "px-4 py-4"),
|
|
1637
1671
|
children: S
|
|
1638
|
-
}) : /* @__PURE__ */
|
|
1672
|
+
}) : /* @__PURE__ */ W(jt, {
|
|
1639
1673
|
role: "list",
|
|
1640
1674
|
className: "overflow-y-auto",
|
|
1641
|
-
style: { height: Math.min(C.length,
|
|
1642
|
-
rowComponent:
|
|
1675
|
+
style: { height: Math.min(C.length, Pt) * Nt },
|
|
1676
|
+
rowComponent: Ft,
|
|
1643
1677
|
rowCount: C.length,
|
|
1644
|
-
rowHeight:
|
|
1678
|
+
rowHeight: Nt,
|
|
1645
1679
|
rowProps: {
|
|
1646
1680
|
items: C,
|
|
1647
1681
|
selectedDeploymentId: c,
|
|
@@ -1652,23 +1686,23 @@ var $ = {
|
|
|
1652
1686
|
})]
|
|
1653
1687
|
})
|
|
1654
1688
|
});
|
|
1655
|
-
},
|
|
1656
|
-
let [_, v] =
|
|
1689
|
+
}, Lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: s = !1, isDisabled: c = !1, style: l, modelPickerOverlay: d, isPickerOpen: m, onPickerToggle: h, onPickerOpenChange: g }) => {
|
|
1690
|
+
let [_, v] = H(!1), { selectorIcon: y, selectorAriaLabel: b, selectedLabel: x, menuItems: S, menuHeader: E, onOpenChange: D } = pt({
|
|
1657
1691
|
deployments: e,
|
|
1658
1692
|
selectedDeploymentId: t,
|
|
1659
1693
|
onDeploymentChange: n,
|
|
1660
1694
|
modelSelectorLabels: r
|
|
1661
1695
|
});
|
|
1662
1696
|
if (!e) return null;
|
|
1663
|
-
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */
|
|
1697
|
+
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */ W(P, {
|
|
1664
1698
|
size: u.SM,
|
|
1665
|
-
className:
|
|
1699
|
+
className: Y.modelSelectorCaret,
|
|
1666
1700
|
"aria-hidden": !0
|
|
1667
1701
|
});
|
|
1668
|
-
return a ? /* @__PURE__ */ U
|
|
1702
|
+
return a ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
|
|
1669
1703
|
tooltip: x,
|
|
1670
|
-
children: /* @__PURE__ */
|
|
1671
|
-
icon: /* @__PURE__ */
|
|
1704
|
+
children: /* @__PURE__ */ W(T, {
|
|
1705
|
+
icon: /* @__PURE__ */ G("div", {
|
|
1672
1706
|
className: "flex items-center gap-1",
|
|
1673
1707
|
children: [y, k]
|
|
1674
1708
|
}),
|
|
@@ -1676,16 +1710,16 @@ var $ = {
|
|
|
1676
1710
|
onClick: () => {
|
|
1677
1711
|
c || v(!0);
|
|
1678
1712
|
},
|
|
1679
|
-
className: o(
|
|
1713
|
+
className: o(Y.modelSelectorButton, O)
|
|
1680
1714
|
})
|
|
1681
|
-
}), d ? /* @__PURE__ */
|
|
1715
|
+
}), d ? /* @__PURE__ */ W(K, {
|
|
1682
1716
|
isOpen: _,
|
|
1683
1717
|
title: r?.ariaLabel ?? "Select model",
|
|
1684
1718
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1685
1719
|
onClose: () => v(!1),
|
|
1686
1720
|
style: l,
|
|
1687
1721
|
children: d(() => v(!1))
|
|
1688
|
-
}) : /* @__PURE__ */
|
|
1722
|
+
}) : /* @__PURE__ */ W(It, {
|
|
1689
1723
|
isOpen: _,
|
|
1690
1724
|
title: r?.ariaLabel ?? "Select model",
|
|
1691
1725
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1698,7 +1732,7 @@ var $ = {
|
|
|
1698
1732
|
errorLabel: r?.error,
|
|
1699
1733
|
emptyLabel: r?.empty,
|
|
1700
1734
|
style: l
|
|
1701
|
-
})] }) : d ? /* @__PURE__ */
|
|
1735
|
+
})] }) : d ? /* @__PURE__ */ W(f, {
|
|
1702
1736
|
placement: "top-end",
|
|
1703
1737
|
matchReferenceWidth: !1,
|
|
1704
1738
|
open: m,
|
|
@@ -1707,24 +1741,24 @@ var $ = {
|
|
|
1707
1741
|
outsideClosable: !0,
|
|
1708
1742
|
renderOverlay: () => d(() => g?.(!1)),
|
|
1709
1743
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1710
|
-
children: /* @__PURE__ */
|
|
1744
|
+
children: /* @__PURE__ */ W(C, {
|
|
1711
1745
|
tooltip: x,
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1746
|
+
children: /* @__PURE__ */ G("button", {
|
|
1713
1747
|
type: "button",
|
|
1714
1748
|
"aria-label": b,
|
|
1715
|
-
className: o("flex items-center justify-center gap-1 rounded-full p-2",
|
|
1749
|
+
className: o("flex items-center justify-center gap-1 rounded-full p-2", Y.modelSelectorButton, s || i || c ? O : void 0, (s || c) && Y.modelSelectorButtonDisabled),
|
|
1716
1750
|
onClick: () => {
|
|
1717
1751
|
!s && !i && !c && h?.();
|
|
1718
1752
|
},
|
|
1719
1753
|
children: [y, k]
|
|
1720
1754
|
})
|
|
1721
1755
|
})
|
|
1722
|
-
}) : /* @__PURE__ */
|
|
1756
|
+
}) : /* @__PURE__ */ W("div", {
|
|
1723
1757
|
className: o(c && O),
|
|
1724
1758
|
"aria-disabled": c || void 0,
|
|
1725
|
-
children: /* @__PURE__ */
|
|
1759
|
+
children: /* @__PURE__ */ W(C, {
|
|
1726
1760
|
tooltip: x,
|
|
1727
|
-
children: /* @__PURE__ */
|
|
1761
|
+
children: /* @__PURE__ */ W(p, {
|
|
1728
1762
|
icon: y,
|
|
1729
1763
|
ariaLabel: b,
|
|
1730
1764
|
items: S,
|
|
@@ -1736,12 +1770,12 @@ var $ = {
|
|
|
1736
1770
|
size: w.Standard,
|
|
1737
1771
|
caretIcon: k,
|
|
1738
1772
|
iconClassName: s || c ? O : void 0,
|
|
1739
|
-
buttonClassName: o("bg-transparent",
|
|
1773
|
+
buttonClassName: o("bg-transparent", Y.modelSelectorButton, (s || c) && O && Y.modelSelectorButtonDisabled)
|
|
1740
1774
|
})
|
|
1741
1775
|
})
|
|
1742
1776
|
});
|
|
1743
|
-
},
|
|
1744
|
-
let
|
|
1777
|
+
}, Rt = 160, zt = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: d, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, timerAriaLabel: D, colors: O, typography: k, className: A, pendingDropFiles: j = [], onDropFilesConsumed: N, pendingAttachments: ee = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: P = 4e3, deployments: F, selectedDeploymentId: ie, onDeploymentChange: ae, modelSelectorLabels: oe, initialAttachments: I = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: L = !1, isModelSelectorDisabled: z = !1, isSendDisabled: fe = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Ie.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: ve, toolsMenuItems: ye, onToolToggle: be, toolsMenuTitle: xe, toolsBackLabel: Ce, toolsChipLabels: we, autoFocus: K = !1, messageHistory: Te, onDialFileSystemClick: Oe, dialFileSystemLabel: ke, validateAttachment: Me, onAttachmentClick: Ne, modelPickerOverlay: Pe, maximumAttachmentsAmount: Le, onAttachmentsLimitExceeded: Re, isAttachmentsEnabled: ze = !0, usageLimitsSlot: Be, onMessageTooLong: Ve }) => {
|
|
1778
|
+
let He = s(), [Ue, We] = H(!1), Ge = Ae(Te), Ke = B(() => a({
|
|
1745
1779
|
"--ci-bg": O?.background,
|
|
1746
1780
|
"--ci-text": O?.text,
|
|
1747
1781
|
"--ci-border": O?.border,
|
|
@@ -1754,80 +1788,80 @@ var $ = {
|
|
|
1754
1788
|
"--ci-voice-error": O?.voiceError,
|
|
1755
1789
|
"--ci-voice-waveform": O?.voiceWaveform,
|
|
1756
1790
|
"--ci-voice-accent": O?.voiceAccent
|
|
1757
|
-
}), [O]),
|
|
1791
|
+
}), [O]), qe = B(() => Oe ? [{
|
|
1758
1792
|
key: "dial-fs",
|
|
1759
|
-
label:
|
|
1760
|
-
icon: /* @__PURE__ */
|
|
1793
|
+
label: ke ?? "DIAL file system",
|
|
1794
|
+
icon: /* @__PURE__ */ W(ne, {
|
|
1761
1795
|
size: c,
|
|
1762
1796
|
"aria-hidden": !0
|
|
1763
1797
|
}),
|
|
1764
|
-
onClick:
|
|
1765
|
-
}] : [], [
|
|
1798
|
+
onClick: Oe
|
|
1799
|
+
}] : [], [Oe, ke]), { message: q, setMessage: J, textareaRef: Ye, isMultiLine: Ze } = je({
|
|
1766
1800
|
messageProp: e,
|
|
1767
1801
|
messageRevision: t
|
|
1768
|
-
}), { attachments:
|
|
1769
|
-
initialAttachments:
|
|
1802
|
+
}), { attachments: Qe, buildAttachments: $e, addAttachments: X, resetAttachments: et, handleRemove: it, handleRetry: at, handleExpand: ot, hasBlockedAttachments: st } = Ee({
|
|
1803
|
+
initialAttachments: I,
|
|
1770
1804
|
onUploadAttachment: r,
|
|
1771
1805
|
onAttachmentsChange: f,
|
|
1772
|
-
validateAttachment:
|
|
1773
|
-
pendingDropFiles:
|
|
1774
|
-
onDropFilesConsumed:
|
|
1775
|
-
pendingAttachments:
|
|
1776
|
-
onPendingAttachmentsConsumed:
|
|
1777
|
-
onExpandPastedText:
|
|
1806
|
+
validateAttachment: Me,
|
|
1807
|
+
pendingDropFiles: j,
|
|
1808
|
+
onDropFilesConsumed: N,
|
|
1809
|
+
pendingAttachments: ee,
|
|
1810
|
+
onPendingAttachmentsConsumed: te,
|
|
1811
|
+
onExpandPastedText: R((e) => {
|
|
1778
1812
|
J((t) => t ? `${t}\n${e}` : e);
|
|
1779
1813
|
}, [J]),
|
|
1780
|
-
maximumAttachmentsAmount:
|
|
1781
|
-
baseAttachmentsAmount:
|
|
1782
|
-
onAttachmentsLimitExceeded:
|
|
1783
|
-
}), { state: ct, analyserNodeRef: lt, elapsedSeconds: ut, errorMessage: dt, startRecording: ft, stopRecording: pt, discardRecording: mt } =
|
|
1784
|
-
|
|
1785
|
-
}, [
|
|
1786
|
-
if (!
|
|
1814
|
+
maximumAttachmentsAmount: Le,
|
|
1815
|
+
baseAttachmentsAmount: he.length,
|
|
1816
|
+
onAttachmentsLimitExceeded: Re
|
|
1817
|
+
}), { state: ct, analyserNodeRef: lt, elapsedSeconds: ut, errorMessage: dt, startRecording: ft, stopRecording: pt, discardRecording: mt } = Fe({ onAttachAudio: R((e) => {
|
|
1818
|
+
X($e([e]));
|
|
1819
|
+
}, [X, $e]) }), ht = V(null), gt = V(null), { handlePaste: _t } = Se(X, ze ? P : Infinity), vt = R((e) => {
|
|
1820
|
+
if (!ze) {
|
|
1787
1821
|
let t = e.clipboardData.getData("text/plain");
|
|
1788
|
-
t.length >=
|
|
1822
|
+
t.length >= P && Ve?.(t.length, P);
|
|
1789
1823
|
}
|
|
1790
|
-
|
|
1824
|
+
_t(e);
|
|
1791
1825
|
}, [
|
|
1826
|
+
ze,
|
|
1827
|
+
P,
|
|
1792
1828
|
Ve,
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
he,
|
|
1798
|
-
xt,
|
|
1829
|
+
_t
|
|
1830
|
+
]), yt = q.trim().length > 0 || Qe.length > 0, bt = yt && !st && !fe, { shouldRender: Z, isExiting: Q, instanceKey: xt } = De(!l && yt, Rt), St = (ye?.some((e) => e.isSelected) ?? !1) && be != null, $ = se || q.includes("\n") || Ze || St, Ct = F === void 0 || ie != null, wt = B(() => pe && !Q && !l, [
|
|
1831
|
+
pe,
|
|
1832
|
+
Q,
|
|
1799
1833
|
l
|
|
1800
|
-
]),
|
|
1801
|
-
if (
|
|
1802
|
-
if (!
|
|
1803
|
-
|
|
1834
|
+
]), Tt = async () => {
|
|
1835
|
+
if (fe) return;
|
|
1836
|
+
if (!ze && q.length >= P) {
|
|
1837
|
+
Ve?.(q.length, P);
|
|
1804
1838
|
return;
|
|
1805
1839
|
}
|
|
1806
|
-
let e = q, t =
|
|
1807
|
-
J(""),
|
|
1840
|
+
let e = q, t = Qe;
|
|
1841
|
+
J(""), Ge.reset();
|
|
1808
1842
|
try {
|
|
1809
1843
|
await n?.(e, t), t.forEach((e) => {
|
|
1810
1844
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1811
|
-
}),
|
|
1845
|
+
}), et([]);
|
|
1812
1846
|
} catch {
|
|
1813
|
-
J(e),
|
|
1847
|
+
J(e), et(t);
|
|
1814
1848
|
}
|
|
1815
|
-
},
|
|
1816
|
-
if (!e.nativeEvent.isComposing && !
|
|
1817
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1849
|
+
}, Et = (e) => {
|
|
1850
|
+
if (!e.nativeEvent.isComposing && !L && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1851
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Ge.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
|
|
1818
1852
|
if (n !== null) {
|
|
1819
1853
|
e.preventDefault(), J(n);
|
|
1820
1854
|
return;
|
|
1821
1855
|
}
|
|
1822
1856
|
}
|
|
1823
|
-
e.key === "Enter" && (
|
|
1824
|
-
},
|
|
1857
|
+
e.key === "Enter" && (me === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && bt && Ct && !L && Tt());
|
|
1858
|
+
}, Dt = (e) => {
|
|
1825
1859
|
let t = Array.from(e.target.files ?? []);
|
|
1826
1860
|
if (t.length === 0) return;
|
|
1827
|
-
let n =
|
|
1828
|
-
e.target.value = "",
|
|
1861
|
+
let n = $e(t);
|
|
1862
|
+
e.target.value = "", X(n);
|
|
1829
1863
|
};
|
|
1830
|
-
if (ct !== "idle") return /* @__PURE__ */
|
|
1864
|
+
if (ct !== "idle") return /* @__PURE__ */ W(tt, {
|
|
1831
1865
|
state: ct,
|
|
1832
1866
|
analyserNodeRef: lt,
|
|
1833
1867
|
elapsedSeconds: ut,
|
|
@@ -1837,32 +1871,32 @@ var $ = {
|
|
|
1837
1871
|
stopLabel: T,
|
|
1838
1872
|
discardLabel: E,
|
|
1839
1873
|
timerLabel: D,
|
|
1840
|
-
style:
|
|
1874
|
+
style: Ke,
|
|
1841
1875
|
className: A
|
|
1842
1876
|
});
|
|
1843
|
-
let
|
|
1844
|
-
className: o(
|
|
1845
|
-
ref:
|
|
1846
|
-
autoFocus:
|
|
1877
|
+
let Ot = /* @__PURE__ */ W("textarea", {
|
|
1878
|
+
className: o(Y.textarea, k?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1879
|
+
ref: Ye,
|
|
1880
|
+
autoFocus: K,
|
|
1847
1881
|
value: q,
|
|
1848
1882
|
onChange: (e) => {
|
|
1849
|
-
J(e.target.value),
|
|
1883
|
+
J(e.target.value), Ge.notifyChange(), d?.(e.target.value);
|
|
1850
1884
|
},
|
|
1851
|
-
onKeyDown:
|
|
1852
|
-
onPaste:
|
|
1885
|
+
onKeyDown: Et,
|
|
1886
|
+
onPaste: vt,
|
|
1853
1887
|
placeholder: p,
|
|
1854
1888
|
"aria-label": m,
|
|
1855
|
-
disabled:
|
|
1889
|
+
disabled: L,
|
|
1856
1890
|
rows: 1
|
|
1857
1891
|
});
|
|
1858
|
-
return /* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ G("div", {
|
|
1859
1893
|
ref: gt,
|
|
1860
|
-
style:
|
|
1861
|
-
className: o(
|
|
1862
|
-
children: [(
|
|
1863
|
-
attachments: [...
|
|
1894
|
+
style: Ke,
|
|
1895
|
+
className: o(Y.wrapper, L && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", Qe.length > 6 ? "py-3 ps-3" : "p-3", A),
|
|
1896
|
+
children: [(he.length > 0 || Qe.length > 0) && /* @__PURE__ */ W(_e, {
|
|
1897
|
+
attachments: [...he, ...Qe],
|
|
1864
1898
|
onRemove: (e) => {
|
|
1865
|
-
|
|
1899
|
+
he.some((t) => t.id === e) ? ge?.(e) : it(e);
|
|
1866
1900
|
},
|
|
1867
1901
|
onRetry: at,
|
|
1868
1902
|
onExpand: ot,
|
|
@@ -1870,16 +1904,16 @@ var $ = {
|
|
|
1870
1904
|
removeLabel: b,
|
|
1871
1905
|
retryLabel: x
|
|
1872
1906
|
},
|
|
1873
|
-
onAttachmentClick:
|
|
1874
|
-
let t = [...
|
|
1875
|
-
t != null &&
|
|
1907
|
+
onAttachmentClick: Ne == null ? void 0 : (e) => {
|
|
1908
|
+
let t = [...he, ...Qe].find((t) => t.id === e);
|
|
1909
|
+
t != null && Ne(t);
|
|
1876
1910
|
}
|
|
1877
|
-
}),
|
|
1878
|
-
className: o("flex items-center gap-2",
|
|
1911
|
+
}), ue ? $ && Ot : /* @__PURE__ */ G("div", {
|
|
1912
|
+
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1879
1913
|
children: [
|
|
1880
|
-
!
|
|
1881
|
-
className: o("flex", "order-2",
|
|
1882
|
-
children: [/* @__PURE__ */
|
|
1914
|
+
!ce && /* @__PURE__ */ G("div", {
|
|
1915
|
+
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1916
|
+
children: [/* @__PURE__ */ W("input", {
|
|
1883
1917
|
ref: ht,
|
|
1884
1918
|
type: "file",
|
|
1885
1919
|
multiple: !0,
|
|
@@ -1887,93 +1921,93 @@ var $ = {
|
|
|
1887
1921
|
className: "sr-only",
|
|
1888
1922
|
"aria-hidden": !0,
|
|
1889
1923
|
tabIndex: -1,
|
|
1890
|
-
onChange:
|
|
1891
|
-
}), /* @__PURE__ */
|
|
1892
|
-
onAttachClick:
|
|
1924
|
+
onChange: Dt
|
|
1925
|
+
}), /* @__PURE__ */ W(Je, {
|
|
1926
|
+
onAttachClick: le ? void 0 : () => ht.current?.click(),
|
|
1893
1927
|
attachLabel: h,
|
|
1894
1928
|
addMenuTitle: _,
|
|
1895
1929
|
menuTitle: v,
|
|
1896
1930
|
menuCloseLabel: y,
|
|
1897
|
-
style:
|
|
1898
|
-
isDisabled:
|
|
1899
|
-
chatSettings:
|
|
1900
|
-
extraMenuItems:
|
|
1901
|
-
toolsMenuItems:
|
|
1902
|
-
onToolToggle:
|
|
1903
|
-
toolsMenuTitle:
|
|
1904
|
-
toolsBackLabel:
|
|
1931
|
+
style: Ke,
|
|
1932
|
+
isDisabled: L,
|
|
1933
|
+
chatSettings: ve,
|
|
1934
|
+
extraMenuItems: qe,
|
|
1935
|
+
toolsMenuItems: ye,
|
|
1936
|
+
onToolToggle: be,
|
|
1937
|
+
toolsMenuTitle: xe,
|
|
1938
|
+
toolsBackLabel: Ce
|
|
1905
1939
|
})]
|
|
1906
1940
|
}),
|
|
1907
|
-
|
|
1941
|
+
$ && St && /* @__PURE__ */ W("div", {
|
|
1908
1942
|
className: "order-3 min-w-0 flex-1",
|
|
1909
|
-
children: /* @__PURE__ */
|
|
1910
|
-
items:
|
|
1911
|
-
onToolToggle:
|
|
1912
|
-
isMobile:
|
|
1913
|
-
countLabel:
|
|
1914
|
-
removeLabel:
|
|
1943
|
+
children: /* @__PURE__ */ W(Xe, {
|
|
1944
|
+
items: ye ?? [],
|
|
1945
|
+
onToolToggle: be,
|
|
1946
|
+
isMobile: He,
|
|
1947
|
+
countLabel: we?.countLabel,
|
|
1948
|
+
removeLabel: we?.removeLabel
|
|
1915
1949
|
})
|
|
1916
1950
|
}),
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
className: o("order-1 flex w-full min-w-0 items-center self-stretch",
|
|
1919
|
-
children:
|
|
1951
|
+
/* @__PURE__ */ W("div", {
|
|
1952
|
+
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1953
|
+
children: Ot
|
|
1920
1954
|
}),
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
className: o("flex flex-shrink-0 items-center gap-2",
|
|
1923
|
-
children: [
|
|
1924
|
-
canSend:
|
|
1925
|
-
onSend:
|
|
1926
|
-
}) : /* @__PURE__ */ U
|
|
1927
|
-
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
deployments:
|
|
1930
|
-
selectedDeploymentId:
|
|
1931
|
-
onDeploymentChange:
|
|
1932
|
-
modelSelectorLabels:
|
|
1955
|
+
/* @__PURE__ */ G("div", {
|
|
1956
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && St ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1957
|
+
children: [de ? de({
|
|
1958
|
+
canSend: bt,
|
|
1959
|
+
onSend: Tt
|
|
1960
|
+
}) : /* @__PURE__ */ G(U, { children: [
|
|
1961
|
+
Be,
|
|
1962
|
+
/* @__PURE__ */ W(Lt, {
|
|
1963
|
+
deployments: F,
|
|
1964
|
+
selectedDeploymentId: ie,
|
|
1965
|
+
onDeploymentChange: ae,
|
|
1966
|
+
modelSelectorLabels: oe,
|
|
1933
1967
|
isStreaming: l,
|
|
1934
|
-
isMobile:
|
|
1935
|
-
isInputDisabled:
|
|
1936
|
-
isDisabled:
|
|
1937
|
-
style:
|
|
1938
|
-
modelPickerOverlay:
|
|
1939
|
-
isPickerOpen:
|
|
1940
|
-
onPickerToggle: () =>
|
|
1941
|
-
onPickerOpenChange:
|
|
1968
|
+
isMobile: He,
|
|
1969
|
+
isInputDisabled: L,
|
|
1970
|
+
isDisabled: z,
|
|
1971
|
+
style: Ke,
|
|
1972
|
+
modelPickerOverlay: Pe,
|
|
1973
|
+
isPickerOpen: Ue,
|
|
1974
|
+
onPickerToggle: () => We((e) => !e),
|
|
1975
|
+
onPickerOpenChange: We
|
|
1942
1976
|
}),
|
|
1943
|
-
l && i ? /* @__PURE__ */
|
|
1977
|
+
l && i ? /* @__PURE__ */ W(rt, {
|
|
1944
1978
|
onStop: i,
|
|
1945
1979
|
ariaLabel: C
|
|
1946
|
-
}) : !l &&
|
|
1947
|
-
onSend:
|
|
1948
|
-
isDisabled: !
|
|
1980
|
+
}) : !l && Z && /* @__PURE__ */ W(nt, {
|
|
1981
|
+
onSend: Tt,
|
|
1982
|
+
isDisabled: !Ct || st || fe,
|
|
1949
1983
|
ariaLabel: S,
|
|
1950
|
-
isExiting:
|
|
1951
|
-
},
|
|
1952
|
-
] }),
|
|
1953
|
-
icon: /* @__PURE__ */
|
|
1984
|
+
isExiting: Q
|
|
1985
|
+
}, xt)
|
|
1986
|
+
] }), wt && /* @__PURE__ */ W(M, {
|
|
1987
|
+
icon: /* @__PURE__ */ W(re, {
|
|
1954
1988
|
size: u.LG,
|
|
1955
1989
|
"aria-hidden": !0
|
|
1956
1990
|
}),
|
|
1957
1991
|
"aria-label": w,
|
|
1958
1992
|
className: "size-8 flex-shrink-0",
|
|
1959
1993
|
onClick: ft,
|
|
1960
|
-
disabled:
|
|
1994
|
+
disabled: L || l
|
|
1961
1995
|
})]
|
|
1962
1996
|
})
|
|
1963
1997
|
]
|
|
1964
1998
|
})]
|
|
1965
1999
|
});
|
|
1966
|
-
},
|
|
2000
|
+
}, Bt = { welcome: "_welcome_n2ph8_1" }, Vt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
|
|
1967
2001
|
let { colors: u, typography: d } = r ?? {};
|
|
1968
|
-
return /* @__PURE__ */
|
|
2002
|
+
return /* @__PURE__ */ G("div", {
|
|
1969
2003
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
1970
2004
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1971
|
-
children: [n && /* @__PURE__ */
|
|
1972
|
-
className: o(
|
|
2005
|
+
children: [n && /* @__PURE__ */ W("h1", {
|
|
2006
|
+
className: o(Bt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
1973
2007
|
children: n
|
|
1974
|
-
}), /* @__PURE__ */
|
|
2008
|
+
}), /* @__PURE__ */ W("div", {
|
|
1975
2009
|
className: "relative w-full max-w-[748px]",
|
|
1976
|
-
children: /* @__PURE__ */
|
|
2010
|
+
children: /* @__PURE__ */ W(zt, {
|
|
1977
2011
|
placeholder: t,
|
|
1978
2012
|
isStreaming: e,
|
|
1979
2013
|
isInputDisabled: c,
|
|
@@ -1984,96 +2018,96 @@ var $ = {
|
|
|
1984
2018
|
})
|
|
1985
2019
|
})]
|
|
1986
2020
|
});
|
|
1987
|
-
},
|
|
1988
|
-
let
|
|
1989
|
-
|
|
1990
|
-
v?.length && (
|
|
2021
|
+
}, Ht = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: C, maximumAttachmentsAmount: w, onAttachmentsLimitExceeded: T, onDialFileSystemClick: E, dialFileSystemLabel: O, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: M, pasteTextThreshold: N, onMessageTooLong: ee }) => {
|
|
2022
|
+
let te = V(null), [P, F] = H([]);
|
|
2023
|
+
z(() => {
|
|
2024
|
+
v?.length && (F(v), y?.());
|
|
1991
2025
|
}, [v, y]);
|
|
1992
|
-
let [
|
|
1993
|
-
|
|
1994
|
-
},
|
|
1995
|
-
i(e,
|
|
1996
|
-
}, [
|
|
1997
|
-
if (
|
|
1998
|
-
if (!x &&
|
|
1999
|
-
|
|
2026
|
+
let [re, ie] = H(e ?? ""), [ae, oe] = H([]), [I, se] = H(t), ce = ae.some((e) => e.status === r.Loading || e.status === r.Error), le = (re.trim().length > 0 || ae.length > 0 || I.length > 0) && !ce, ue = (e) => {
|
|
2027
|
+
se((t) => t.filter((t) => t.id !== e));
|
|
2028
|
+
}, de = R((e, t) => {
|
|
2029
|
+
i(e, I, t);
|
|
2030
|
+
}, [I, i]), L = () => {
|
|
2031
|
+
if (le) {
|
|
2032
|
+
if (!x && re.length >= (N ?? 4e3)) {
|
|
2033
|
+
ee?.(re.length, N ?? 4e3);
|
|
2000
2034
|
return;
|
|
2001
2035
|
}
|
|
2002
|
-
|
|
2036
|
+
de(re, ae);
|
|
2003
2037
|
}
|
|
2004
|
-
},
|
|
2038
|
+
}, fe = R(() => F([]), []), pe = R((e) => {
|
|
2005
2039
|
let t = Array.from(e.target.files ?? []);
|
|
2006
|
-
t.length !== 0 && (e.target.value = "",
|
|
2007
|
-
}, []),
|
|
2040
|
+
t.length !== 0 && (e.target.value = "", F(t));
|
|
2041
|
+
}, []), me = B(() => E ? [{
|
|
2008
2042
|
key: "dial-fs",
|
|
2009
2043
|
label: O ?? "DIAL file system",
|
|
2010
|
-
icon: /* @__PURE__ */
|
|
2044
|
+
icon: /* @__PURE__ */ W(ne, {
|
|
2011
2045
|
size: c,
|
|
2012
2046
|
"aria-hidden": !0
|
|
2013
2047
|
}),
|
|
2014
2048
|
onClick: E
|
|
2015
2049
|
}] : [], [E, O]);
|
|
2016
|
-
return /* @__PURE__ */
|
|
2050
|
+
return /* @__PURE__ */ G("div", {
|
|
2017
2051
|
className: o("flex w-full flex-col gap-2", _),
|
|
2018
|
-
children: [/* @__PURE__ */
|
|
2052
|
+
children: [/* @__PURE__ */ W(zt, {
|
|
2019
2053
|
message: e,
|
|
2020
2054
|
ariaLabel: u,
|
|
2021
2055
|
isStacked: !0,
|
|
2022
2056
|
hideActionBar: !0,
|
|
2023
|
-
pendingDropFiles:
|
|
2024
|
-
onDropFilesConsumed:
|
|
2025
|
-
onSend:
|
|
2057
|
+
pendingDropFiles: P,
|
|
2058
|
+
onDropFilesConsumed: fe,
|
|
2059
|
+
onSend: de,
|
|
2026
2060
|
onUploadAttachment: a,
|
|
2027
|
-
onChange:
|
|
2028
|
-
onAttachmentsChange:
|
|
2061
|
+
onChange: ie,
|
|
2062
|
+
onAttachmentsChange: oe,
|
|
2029
2063
|
removeLabel: d,
|
|
2030
2064
|
retryLabel: f,
|
|
2031
2065
|
className: "max-w-full",
|
|
2032
|
-
prefixAttachments:
|
|
2033
|
-
onRemovePrefixAttachment:
|
|
2066
|
+
prefixAttachments: I,
|
|
2067
|
+
onRemovePrefixAttachment: ue,
|
|
2034
2068
|
validateAttachment: b,
|
|
2035
2069
|
isAttachmentsEnabled: x,
|
|
2036
2070
|
maximumAttachmentsAmount: w,
|
|
2037
2071
|
onAttachmentsLimitExceeded: T,
|
|
2038
2072
|
pendingAttachments: A,
|
|
2039
|
-
onPendingAttachmentsConsumed:
|
|
2040
|
-
onAttachmentClick:
|
|
2041
|
-
pasteTextThreshold:
|
|
2042
|
-
onMessageTooLong:
|
|
2043
|
-
}), /* @__PURE__ */
|
|
2073
|
+
onPendingAttachmentsConsumed: j,
|
|
2074
|
+
onAttachmentClick: M,
|
|
2075
|
+
pasteTextThreshold: N,
|
|
2076
|
+
onMessageTooLong: ee
|
|
2077
|
+
}), /* @__PURE__ */ G("div", {
|
|
2044
2078
|
className: "flex items-center justify-between",
|
|
2045
|
-
children: [/* @__PURE__ */
|
|
2079
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2046
2080
|
className: "flex",
|
|
2047
|
-
children: !S && /* @__PURE__ */ U
|
|
2048
|
-
ref:
|
|
2081
|
+
children: !S && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("input", {
|
|
2082
|
+
ref: te,
|
|
2049
2083
|
type: "file",
|
|
2050
2084
|
multiple: !0,
|
|
2051
2085
|
accept: C,
|
|
2052
2086
|
className: "sr-only",
|
|
2053
2087
|
"aria-hidden": !0,
|
|
2054
2088
|
tabIndex: -1,
|
|
2055
|
-
onChange:
|
|
2056
|
-
}), /* @__PURE__ */
|
|
2057
|
-
onAttachClick: () =>
|
|
2089
|
+
onChange: pe
|
|
2090
|
+
}), /* @__PURE__ */ W(Je, {
|
|
2091
|
+
onAttachClick: () => te.current?.click(),
|
|
2058
2092
|
attachLabel: m,
|
|
2059
2093
|
addMenuTitle: p,
|
|
2060
2094
|
menuTitle: h,
|
|
2061
2095
|
menuCloseLabel: g,
|
|
2062
|
-
extraMenuItems:
|
|
2096
|
+
extraMenuItems: me
|
|
2063
2097
|
})] })
|
|
2064
|
-
}), /* @__PURE__ */
|
|
2098
|
+
}), /* @__PURE__ */ G("div", {
|
|
2065
2099
|
className: "flex gap-2",
|
|
2066
|
-
children: [/* @__PURE__ */
|
|
2100
|
+
children: [/* @__PURE__ */ W(D, {
|
|
2067
2101
|
label: s,
|
|
2068
2102
|
onClick: n
|
|
2069
|
-
}), /* @__PURE__ */
|
|
2103
|
+
}), /* @__PURE__ */ W(k, {
|
|
2070
2104
|
label: l,
|
|
2071
|
-
onClick:
|
|
2072
|
-
disabled: !
|
|
2105
|
+
onClick: L,
|
|
2106
|
+
disabled: !le
|
|
2073
2107
|
})]
|
|
2074
2108
|
})]
|
|
2075
2109
|
})]
|
|
2076
2110
|
});
|
|
2077
2111
|
};
|
|
2078
2112
|
//#endregion
|
|
2079
|
-
export {
|
|
2113
|
+
export { me as AttachmentCard, he as AttachmentGroup, ge as AttachmentTray, K as BottomSheetShell, We as ChatSettingsModal, Vt as ConversationInput, Ht as EditMessageInput, ve as FileDndOverlay, zt as Input, Ie as SendOnEnter, xe as getAttachmentIcon };
|