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