@epam/ai-dial-conversation-input 1.0.0-dev.539 → 1.0.0-dev.546
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/Input/Input.d.ts.map +1 -1
- package/hooks/useMessageState.d.ts +4 -2
- package/hooks/useMessageState.d.ts.map +1 -1
- package/index.js +390 -387
- package/models/ConversationInput.d.ts +6 -1
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +6 -1
- package/models/Input.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, RequestStatus as i, ResponseFormat as a, buildCssVars as o, mergeClasses as s, useIsMobile as c } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialSpinner as D, DialTag as ee, DialTooltip as O, ElementSize as k, PopupSize as A, RadioGroupOrientation as te } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconArrowLeft as ne, IconArrowNarrowRight as j, IconCheck as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentCard as
|
|
3
|
+
import { IconArrowLeft as ne, IconArrowNarrowRight as j, IconCheck as M, IconChevronDown as N, IconChevronRight as re, IconFile as ie, IconMicrophone as ae, IconPaperclip as oe, IconPlaystationSquare as se, IconPlus as P, IconSettings as ce, IconX as le } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as ue } from "react-dom";
|
|
5
|
+
import { createElement as F, memo as de, useCallback as I, useEffect as L, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as R, useRef as z, useState as B } from "react";
|
|
6
|
+
import { Fragment as V, jsx as H, jsxs as U } 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
|
+
L(() => {
|
|
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]), L(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, we = {
|
|
22
22
|
backdrop: "_backdrop_3xrn0_9",
|
|
23
23
|
sheet: "_sheet_3xrn0_13",
|
|
24
24
|
"slide-up": "_slide-up_3xrn0_1",
|
|
25
25
|
title: "_title_3xrn0_18",
|
|
26
26
|
divider: "_divider_3xrn0_22"
|
|
27
|
-
},
|
|
28
|
-
className: s(
|
|
27
|
+
}, W = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Ce(e, r), !e || typeof document > "u" ? null : ue(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
28
|
+
className: s(we.backdrop, "fixed inset-0 z-[55]"),
|
|
29
29
|
onPointerDown: r,
|
|
30
30
|
"aria-hidden": !0
|
|
31
|
-
}), /* @__PURE__ */
|
|
31
|
+
}), /* @__PURE__ */ U("div", {
|
|
32
32
|
role: "dialog",
|
|
33
33
|
"aria-modal": !0,
|
|
34
34
|
"aria-label": t ?? o,
|
|
35
35
|
style: c,
|
|
36
|
-
className: s(
|
|
37
|
-
children: [t != null && /* @__PURE__ */ V
|
|
36
|
+
className: s(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
|
|
37
|
+
children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
38
38
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
39
39
|
children: [
|
|
40
|
-
i && /* @__PURE__ */
|
|
40
|
+
i && /* @__PURE__ */ H("div", {
|
|
41
41
|
className: "absolute start-4",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
icon: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ H(v, {
|
|
43
|
+
icon: /* @__PURE__ */ H(ne, {
|
|
44
44
|
size: f.LG,
|
|
45
45
|
stroke: 1.5,
|
|
46
46
|
className: "rtl:scale-x-[-1]"
|
|
@@ -49,40 +49,40 @@ var Te = (e, t) => {
|
|
|
49
49
|
onClick: i
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
className: s(
|
|
52
|
+
/* @__PURE__ */ H("span", {
|
|
53
|
+
className: s(we.title, l),
|
|
54
54
|
children: t
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ H("div", {
|
|
57
57
|
className: "absolute end-4 m-2",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ H(m, {
|
|
59
59
|
ariaLabel: n,
|
|
60
60
|
size: f.LG,
|
|
61
61
|
onClose: r
|
|
62
62
|
})
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ H("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ H("div", {
|
|
66
66
|
className: "overflow-y-auto",
|
|
67
67
|
children: d
|
|
68
68
|
})]
|
|
69
|
-
})] }), document.body)),
|
|
69
|
+
})] }), document.body)), Te = async (e, t, n) => {
|
|
70
70
|
let r = 6e4 / t, i = [];
|
|
71
71
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
72
72
|
await Promise.allSettled(i);
|
|
73
|
-
},
|
|
74
|
-
let [h, g] =
|
|
75
|
-
|
|
73
|
+
}, Ee = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
74
|
+
let [h, g] = B(n), _ = z(h);
|
|
75
|
+
L(() => {
|
|
76
76
|
_.current = h;
|
|
77
|
-
}, [h]),
|
|
77
|
+
}, [h]), L(() => () => {
|
|
78
78
|
_.current.forEach((e) => {
|
|
79
79
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl);
|
|
80
80
|
});
|
|
81
81
|
}, []);
|
|
82
|
-
let v =
|
|
82
|
+
let v = I((e) => e.map((e) => {
|
|
83
83
|
let n = e.type.startsWith("image/"), r = n ? URL.createObjectURL(e) : void 0;
|
|
84
84
|
return {
|
|
85
|
-
id:
|
|
85
|
+
id: be(),
|
|
86
86
|
name: e.name,
|
|
87
87
|
contentType: e.type,
|
|
88
88
|
file: e,
|
|
@@ -90,14 +90,14 @@ var Te = (e, t) => {
|
|
|
90
90
|
status: i.Idle,
|
|
91
91
|
previewUrl: r
|
|
92
92
|
};
|
|
93
|
-
}), []), y =
|
|
93
|
+
}), []), y = I((e) => {
|
|
94
94
|
g((t) => {
|
|
95
95
|
let n = e(t);
|
|
96
96
|
return n !== t && a?.(n), n;
|
|
97
97
|
});
|
|
98
|
-
}, [a]), b =
|
|
98
|
+
}, [a]), b = I((e) => {
|
|
99
99
|
g(e), a?.(e);
|
|
100
|
-
}, [a]), x =
|
|
100
|
+
}, [a]), x = I(async (t) => {
|
|
101
101
|
if (r) {
|
|
102
102
|
y((e) => e.map((e) => e.id === t.id ? {
|
|
103
103
|
...e,
|
|
@@ -119,7 +119,7 @@ var Te = (e, t) => {
|
|
|
119
119
|
} : e));
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
}, [r, y]), S =
|
|
122
|
+
}, [r, y]), S = I((e, t = !0) => {
|
|
123
123
|
let n = [], r;
|
|
124
124
|
if (y((t) => {
|
|
125
125
|
let i = new Set(t.map((e) => e.id));
|
|
@@ -146,7 +146,7 @@ var Te = (e, t) => {
|
|
|
146
146
|
status: i.Error,
|
|
147
147
|
errorReason: n
|
|
148
148
|
} : e));
|
|
149
|
-
}),
|
|
149
|
+
}), Te(e, ye, x);
|
|
150
150
|
}
|
|
151
151
|
}, [
|
|
152
152
|
p,
|
|
@@ -156,20 +156,20 @@ var Te = (e, t) => {
|
|
|
156
156
|
x,
|
|
157
157
|
o
|
|
158
158
|
]);
|
|
159
|
-
|
|
159
|
+
L(() => {
|
|
160
160
|
s.length !== 0 && (S(v(s)), c?.());
|
|
161
161
|
}, [
|
|
162
162
|
S,
|
|
163
163
|
v,
|
|
164
164
|
c,
|
|
165
165
|
s
|
|
166
|
-
]),
|
|
166
|
+
]), L(() => {
|
|
167
167
|
l.length !== 0 && (S(l, !1), u?.());
|
|
168
168
|
}, [
|
|
169
169
|
S,
|
|
170
170
|
u,
|
|
171
171
|
l
|
|
172
|
-
]),
|
|
172
|
+
]), L(() => {
|
|
173
173
|
if (!o) return;
|
|
174
174
|
let t = !1, n = [], r = _.current.map((r) => {
|
|
175
175
|
if (r.status === i.Loading) return r;
|
|
@@ -196,7 +196,7 @@ var Te = (e, t) => {
|
|
|
196
196
|
y,
|
|
197
197
|
x
|
|
198
198
|
]);
|
|
199
|
-
let C =
|
|
199
|
+
let C = I((e) => {
|
|
200
200
|
y((t) => {
|
|
201
201
|
let n = t.find((t) => t.id === e);
|
|
202
202
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), t.filter((t) => t.id !== e);
|
|
@@ -208,11 +208,11 @@ var Te = (e, t) => {
|
|
|
208
208
|
addAttachments: S,
|
|
209
209
|
resetAttachments: b,
|
|
210
210
|
handleRemove: C,
|
|
211
|
-
handleRetry:
|
|
211
|
+
handleRetry: I((e) => {
|
|
212
212
|
let t = h.find((t) => t.id === e);
|
|
213
213
|
t && x(t);
|
|
214
214
|
}, [h, x]),
|
|
215
|
-
handleExpand:
|
|
215
|
+
handleExpand: I(async (e) => {
|
|
216
216
|
let n = h.find((t) => t.id === e);
|
|
217
217
|
if (!n || n.type !== t.Pasted) return;
|
|
218
218
|
let r = await n.file.text();
|
|
@@ -224,9 +224,9 @@ var Te = (e, t) => {
|
|
|
224
224
|
]),
|
|
225
225
|
hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
|
|
226
226
|
};
|
|
227
|
-
},
|
|
228
|
-
let [n, r] =
|
|
229
|
-
return
|
|
227
|
+
}, De = (e, t) => {
|
|
228
|
+
let [n, r] = B(e), [i, a] = B(!1), [o, s] = B(0);
|
|
229
|
+
return L(() => {
|
|
230
230
|
if (e) {
|
|
231
231
|
r(!0), a(!1), s((e) => e + 1);
|
|
232
232
|
return;
|
|
@@ -242,18 +242,18 @@ var Te = (e, t) => {
|
|
|
242
242
|
isExiting: i,
|
|
243
243
|
instanceKey: o
|
|
244
244
|
};
|
|
245
|
-
},
|
|
246
|
-
let t =
|
|
245
|
+
}, Oe = (e, t) => !e.slice(0, t).includes("\n"), ke = (e, t) => !e.slice(t).includes("\n"), Ae = (e) => {
|
|
246
|
+
let t = z(e);
|
|
247
247
|
t.current = e;
|
|
248
|
-
let n =
|
|
248
|
+
let n = z(-1), r = z(""), i = I((e, i, a) => {
|
|
249
249
|
let o = t.current;
|
|
250
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
251
|
-
}, []), a =
|
|
250
|
+
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);
|
|
251
|
+
}, []), a = I(() => {
|
|
252
252
|
n.current = -1, r.current = "";
|
|
253
|
-
}, []), o =
|
|
253
|
+
}, []), o = I(() => {
|
|
254
254
|
n.current = -1, r.current = "";
|
|
255
255
|
}, []);
|
|
256
|
-
return
|
|
256
|
+
return R(() => ({
|
|
257
257
|
navigate: i,
|
|
258
258
|
notifyChange: a,
|
|
259
259
|
reset: o
|
|
@@ -262,34 +262,34 @@ var Te = (e, t) => {
|
|
|
262
262
|
a,
|
|
263
263
|
o
|
|
264
264
|
]);
|
|
265
|
-
},
|
|
266
|
-
let [
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
}, [e]),
|
|
270
|
-
|
|
271
|
-
}, []),
|
|
272
|
-
if (!
|
|
273
|
-
let e =
|
|
274
|
-
|
|
275
|
-
}, [
|
|
276
|
-
message:
|
|
277
|
-
setMessage:
|
|
278
|
-
textareaRef:
|
|
279
|
-
isMultiLine:
|
|
265
|
+
}, je = ({ messageProp: e, messageRevision: t }) => {
|
|
266
|
+
let [n, r] = B(e), i = z(null), a = z(0), [o, s] = B(!1);
|
|
267
|
+
return L(() => {
|
|
268
|
+
r(e);
|
|
269
|
+
}, [e, t]), L(() => {
|
|
270
|
+
i.current && (a.current = i.current.offsetHeight);
|
|
271
|
+
}, []), pe(() => {
|
|
272
|
+
if (!i.current || a.current === 0) return;
|
|
273
|
+
let e = i.current.offsetHeight > a.current;
|
|
274
|
+
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
275
|
+
}, [n]), {
|
|
276
|
+
message: n,
|
|
277
|
+
setMessage: r,
|
|
278
|
+
textareaRef: i,
|
|
279
|
+
isMultiLine: o
|
|
280
280
|
};
|
|
281
|
-
},
|
|
281
|
+
}, Me = /* @__PURE__ */ function(e) {
|
|
282
282
|
return e.Idle = "idle", e.Recording = "recording", e.Stopped = "stopped", e.Uploading = "uploading", e.Error = "error", e;
|
|
283
|
-
}({}),
|
|
283
|
+
}({}), Ne = [
|
|
284
284
|
"audio/webm;codecs=opus",
|
|
285
285
|
"audio/ogg;codecs=opus",
|
|
286
286
|
"audio/webm"
|
|
287
|
-
],
|
|
288
|
-
let [r, i] =
|
|
287
|
+
], Pe = () => Ne.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onUploadAudio: e, onTranscribeAudio: t, onTranscript: n }) => {
|
|
288
|
+
let [r, i] = B("idle"), [a, o] = B(null), [s, c] = B(null), l = z(null), u = z(null), d = z(null), f = z(null), p = z([]), m = z(""), h = z(null), g = z(null), _ = z([]), v = z(!1), y = I(() => {
|
|
289
289
|
h.current != null && (cancelAnimationFrame(h.current), h.current = null);
|
|
290
|
-
}, []), b =
|
|
290
|
+
}, []), b = I(() => {
|
|
291
291
|
y(), l.current &&= (l.current.getTracks().forEach((e) => e.stop()), null), u.current &&= (u.current.close(), null), d.current = null, f.current = null;
|
|
292
|
-
}, [y]), x =
|
|
292
|
+
}, [y]), x = I(() => {
|
|
293
293
|
(async () => {
|
|
294
294
|
try {
|
|
295
295
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -298,7 +298,7 @@ var Te = (e, t) => {
|
|
|
298
298
|
u.current = t;
|
|
299
299
|
let n = t.createAnalyser();
|
|
300
300
|
n.fftSize = 256, d.current = n, t.createMediaStreamSource(e).connect(n);
|
|
301
|
-
let r =
|
|
301
|
+
let r = Pe();
|
|
302
302
|
m.current = r, p.current = [], _.current = [];
|
|
303
303
|
let a = new MediaRecorder(e, r ? { mimeType: r } : void 0);
|
|
304
304
|
f.current = a, a.ondataavailable = (e) => {
|
|
@@ -321,13 +321,13 @@ var Te = (e, t) => {
|
|
|
321
321
|
c(e instanceof Error ? e.message : "Microphone access denied"), i("error");
|
|
322
322
|
}
|
|
323
323
|
})();
|
|
324
|
-
}, []), S =
|
|
324
|
+
}, []), S = I(() => {
|
|
325
325
|
let e = f.current;
|
|
326
326
|
!e || e.state !== "recording" || (y(), e.onstop = () => {
|
|
327
327
|
let e = m.current || "audio/webm", t = new Blob(p.current, { type: e }), n = e.split(";")[0].split("/")[1] ?? "webm";
|
|
328
328
|
g.current = new File([t], `recording.${n}`, { type: e }), i("stopped");
|
|
329
329
|
}, e.stop());
|
|
330
|
-
}, [y]), C =
|
|
330
|
+
}, [y]), C = I(() => {
|
|
331
331
|
let r = g.current;
|
|
332
332
|
!r || !e || !t || (v.current = !1, i("uploading"), (async () => {
|
|
333
333
|
try {
|
|
@@ -346,10 +346,10 @@ var Te = (e, t) => {
|
|
|
346
346
|
t,
|
|
347
347
|
n,
|
|
348
348
|
b
|
|
349
|
-
]), w =
|
|
349
|
+
]), w = I(() => {
|
|
350
350
|
v.current = !0, b(), g.current = null, o(null), c(null), i("idle");
|
|
351
351
|
}, [b]);
|
|
352
|
-
return
|
|
352
|
+
return L(() => () => {
|
|
353
353
|
v.current = !0, b();
|
|
354
354
|
}, [b]), {
|
|
355
355
|
state: r,
|
|
@@ -360,16 +360,16 @@ var Te = (e, t) => {
|
|
|
360
360
|
confirmRecording: C,
|
|
361
361
|
discardRecording: w
|
|
362
362
|
};
|
|
363
|
-
},
|
|
363
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
364
364
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
365
|
-
}({}),
|
|
365
|
+
}({}), Le = {
|
|
366
366
|
item: "_item_vou13_1",
|
|
367
367
|
itemIcon: "_itemIcon_vou13_11"
|
|
368
368
|
}, Re = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
|
|
369
369
|
let d = (e) => {
|
|
370
370
|
e(), r();
|
|
371
371
|
};
|
|
372
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ H(W, {
|
|
373
373
|
isOpen: e,
|
|
374
374
|
title: t,
|
|
375
375
|
closeLabel: n,
|
|
@@ -377,22 +377,22 @@ var Te = (e, t) => {
|
|
|
377
377
|
style: i,
|
|
378
378
|
className: o,
|
|
379
379
|
titleClassName: c,
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ H("ul", {
|
|
381
381
|
role: "list",
|
|
382
382
|
className: "flex flex-col",
|
|
383
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
383
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(p, {
|
|
384
384
|
type: "button",
|
|
385
|
-
className: s(
|
|
386
|
-
iconBefore: /* @__PURE__ */
|
|
387
|
-
className:
|
|
385
|
+
className: s(Le.item, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
|
|
386
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
387
|
+
className: Le.itemIcon,
|
|
388
388
|
children: n
|
|
389
389
|
}),
|
|
390
|
-
iconAfter: r ? /* @__PURE__ */
|
|
390
|
+
iconAfter: r ? /* @__PURE__ */ H("span", {
|
|
391
391
|
className: "ms-auto",
|
|
392
392
|
children: r
|
|
393
393
|
}) : null,
|
|
394
394
|
textClassName: u,
|
|
395
|
-
label: /* @__PURE__ */
|
|
395
|
+
label: /* @__PURE__ */ H("span", {
|
|
396
396
|
className: l,
|
|
397
397
|
children: t
|
|
398
398
|
}),
|
|
@@ -400,62 +400,62 @@ var Te = (e, t) => {
|
|
|
400
400
|
}) }, e))
|
|
401
401
|
})
|
|
402
402
|
});
|
|
403
|
-
},
|
|
403
|
+
}, ze = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ U("svg", {
|
|
404
404
|
width: f.SM,
|
|
405
405
|
height: f.SM,
|
|
406
406
|
viewBox: "0 0 24 24",
|
|
407
407
|
fill: "none",
|
|
408
408
|
"aria-hidden": !0,
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ H("defs", { children: /* @__PURE__ */ U("linearGradient", {
|
|
410
410
|
id: e,
|
|
411
411
|
x1: "0",
|
|
412
412
|
y1: "0",
|
|
413
413
|
x2: "24",
|
|
414
414
|
y2: "24",
|
|
415
415
|
gradientUnits: "userSpaceOnUse",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ H("stop", {
|
|
417
417
|
offset: "0%",
|
|
418
418
|
stopColor: "#4b7be6"
|
|
419
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ H("stop", {
|
|
420
420
|
offset: "100%",
|
|
421
421
|
stopColor: "#9355f4"
|
|
422
422
|
})]
|
|
423
|
-
}) }), /* @__PURE__ */
|
|
423
|
+
}) }), /* @__PURE__ */ H("path", {
|
|
424
424
|
d: "M5 12l5 5L20 7",
|
|
425
425
|
stroke: `url(#${e})`,
|
|
426
426
|
strokeWidth: "2",
|
|
427
427
|
strokeLinecap: "round",
|
|
428
428
|
strokeLinejoin: "round"
|
|
429
429
|
})]
|
|
430
|
-
}),
|
|
430
|
+
}), G = {
|
|
431
431
|
tabContainer: "_tabContainer_rzv03_1",
|
|
432
432
|
tabActive: "_tabActive_rzv03_13"
|
|
433
433
|
};
|
|
434
|
-
|
|
434
|
+
de(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
435
435
|
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
436
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ H("div", {
|
|
437
437
|
className: "flex flex-nowrap gap-1",
|
|
438
438
|
children: e.map((e) => {
|
|
439
439
|
let r = t === e.id;
|
|
440
|
-
return /* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ H(ee, {
|
|
441
441
|
label: e.label,
|
|
442
442
|
selected: r,
|
|
443
443
|
onClick: () => n(e.id),
|
|
444
444
|
"aria-selected": r,
|
|
445
|
-
className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i,
|
|
445
|
+
className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, G.tabContainer, r && G.tabActive)
|
|
446
446
|
}, e.id);
|
|
447
447
|
})
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region ../ai-dial-kit/src/components/Button/Buttons.tsx
|
|
452
|
-
var
|
|
452
|
+
var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p, {
|
|
453
453
|
...e,
|
|
454
454
|
variant: d.Neutral,
|
|
455
455
|
appearance: u.Outlined
|
|
456
|
-
}),
|
|
457
|
-
let [s, c] =
|
|
458
|
-
|
|
456
|
+
}), Ve = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
457
|
+
let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
|
|
458
|
+
L(() => {
|
|
459
459
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
460
460
|
}, [
|
|
461
461
|
o,
|
|
@@ -472,7 +472,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
472
472
|
setResponseFormat: c,
|
|
473
473
|
setSystemPrompt: u,
|
|
474
474
|
setTemperature: f,
|
|
475
|
-
handleSubmit:
|
|
475
|
+
handleSubmit: I(() => {
|
|
476
476
|
if (!m) return;
|
|
477
477
|
let t = {};
|
|
478
478
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -486,16 +486,16 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
486
486
|
a
|
|
487
487
|
])
|
|
488
488
|
};
|
|
489
|
-
},
|
|
489
|
+
}, q = "!dial-small-semi-text !text-primary gap-1", He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
|
|
490
490
|
"Precise",
|
|
491
491
|
"Neutral",
|
|
492
492
|
"Creative"
|
|
493
|
-
], temperatureHint: g }) => /* @__PURE__ */
|
|
493
|
+
], temperatureHint: g }) => /* @__PURE__ */ U("div", {
|
|
494
494
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
495
495
|
children: [
|
|
496
|
-
e.responseFormat && /* @__PURE__ */
|
|
496
|
+
e.responseFormat && /* @__PURE__ */ H(S, {
|
|
497
497
|
fieldTitle: c,
|
|
498
|
-
labelClassName:
|
|
498
|
+
labelClassName: q,
|
|
499
499
|
elementId: "response-format",
|
|
500
500
|
orientation: te.Column,
|
|
501
501
|
activeRadioButton: t ?? a.Markdown,
|
|
@@ -509,19 +509,19 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
509
509
|
}],
|
|
510
510
|
onChange: (e) => i(e)
|
|
511
511
|
}),
|
|
512
|
-
e.systemPrompt && /* @__PURE__ */
|
|
512
|
+
e.systemPrompt && /* @__PURE__ */ H(y, {
|
|
513
513
|
value: n,
|
|
514
514
|
placeholder: p,
|
|
515
515
|
labelProps: {
|
|
516
|
-
className:
|
|
516
|
+
className: q,
|
|
517
517
|
label: f
|
|
518
518
|
},
|
|
519
519
|
onChange: (e) => o(e ?? "")
|
|
520
520
|
}),
|
|
521
|
-
e.temperature && /* @__PURE__ */
|
|
521
|
+
e.temperature && /* @__PURE__ */ H(E, {
|
|
522
522
|
labelProps: {
|
|
523
523
|
label: m,
|
|
524
|
-
className:
|
|
524
|
+
className: q,
|
|
525
525
|
caption: g
|
|
526
526
|
},
|
|
527
527
|
value: r,
|
|
@@ -533,7 +533,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
533
533
|
})
|
|
534
534
|
]
|
|
535
535
|
}), Ue = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, 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: C }) => {
|
|
536
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: A, handleSubmit: te } =
|
|
536
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: A, handleSubmit: te } = Ve({
|
|
537
537
|
isOpen: e,
|
|
538
538
|
features: o,
|
|
539
539
|
initialResponseFormat: c,
|
|
@@ -542,7 +542,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
542
542
|
onSave: d,
|
|
543
543
|
onClose: r
|
|
544
544
|
});
|
|
545
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ U(W, {
|
|
546
546
|
isOpen: e,
|
|
547
547
|
title: f,
|
|
548
548
|
closeLabel: i,
|
|
@@ -550,7 +550,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
550
550
|
onBack: t,
|
|
551
551
|
backLabel: n,
|
|
552
552
|
style: a,
|
|
553
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ H(He, {
|
|
554
554
|
features: o,
|
|
555
555
|
responseFormat: w,
|
|
556
556
|
systemPrompt: T,
|
|
@@ -567,13 +567,13 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
567
567
|
temperatureLabel: y,
|
|
568
568
|
temperatureLabels: b,
|
|
569
569
|
temperatureHint: x
|
|
570
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ H("div", {
|
|
571
571
|
className: s("px-6 py-4 mobile:pb-8"),
|
|
572
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ H(O, {
|
|
573
573
|
tooltip: C,
|
|
574
574
|
hideTooltip: D || !C,
|
|
575
575
|
triggerClassName: "w-full",
|
|
576
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ H(K, {
|
|
577
577
|
label: S,
|
|
578
578
|
onClick: te,
|
|
579
579
|
disabled: !D,
|
|
@@ -583,7 +583,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
583
583
|
})]
|
|
584
584
|
});
|
|
585
585
|
}, 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: g = "Apply changes", saveDisabledTooltip: _ }) => {
|
|
586
|
-
let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } =
|
|
586
|
+
let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = Ve({
|
|
587
587
|
features: e,
|
|
588
588
|
initialResponseFormat: t,
|
|
589
589
|
initialSystemPrompt: n,
|
|
@@ -591,25 +591,25 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
591
591
|
onSave: i,
|
|
592
592
|
onClose: a
|
|
593
593
|
});
|
|
594
|
-
return /* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ H(b, {
|
|
595
595
|
open: !0,
|
|
596
596
|
header: o,
|
|
597
597
|
size: A.Sm,
|
|
598
598
|
onClose: a,
|
|
599
599
|
className: "!bg-layer-2",
|
|
600
|
-
footer: /* @__PURE__ */
|
|
600
|
+
footer: /* @__PURE__ */ H("div", {
|
|
601
601
|
className: "flex justify-end px-6 py-4",
|
|
602
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ H(O, {
|
|
603
603
|
tooltip: _,
|
|
604
604
|
hideTooltip: S || !_,
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ H(K, {
|
|
606
606
|
label: g,
|
|
607
607
|
onClick: E,
|
|
608
608
|
disabled: !S
|
|
609
609
|
})
|
|
610
610
|
})
|
|
611
611
|
}),
|
|
612
|
-
children: /* @__PURE__ */
|
|
612
|
+
children: /* @__PURE__ */ H(He, {
|
|
613
613
|
features: e,
|
|
614
614
|
responseFormat: v,
|
|
615
615
|
systemPrompt: y,
|
|
@@ -629,15 +629,15 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
|
|
|
629
629
|
})
|
|
630
630
|
});
|
|
631
631
|
};
|
|
632
|
-
|
|
632
|
+
de(We);
|
|
633
633
|
//#endregion
|
|
634
634
|
//#region src/components/AddAttachmentButton/AddAttachmentButton.tsx
|
|
635
635
|
var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
|
|
636
|
-
let g = c(), [_, y] =
|
|
636
|
+
let g = c(), [_, y] = B(!1), [b, x] = B(!1), S = R(() => [
|
|
637
637
|
...e == null ? [] : [{
|
|
638
638
|
key: "attach",
|
|
639
639
|
label: t,
|
|
640
|
-
icon: /* @__PURE__ */
|
|
640
|
+
icon: /* @__PURE__ */ H(oe, {
|
|
641
641
|
size: l,
|
|
642
642
|
"aria-hidden": !0
|
|
643
643
|
}),
|
|
@@ -647,11 +647,11 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
647
647
|
...p == null ? [] : [{
|
|
648
648
|
key: "chat-settings",
|
|
649
649
|
label: p.menuItemLabel ?? "Chat settings",
|
|
650
|
-
icon: /* @__PURE__ */
|
|
650
|
+
icon: /* @__PURE__ */ H(ce, {
|
|
651
651
|
size: l,
|
|
652
652
|
"aria-hidden": !0
|
|
653
653
|
}),
|
|
654
|
-
iconAfter: g ? /* @__PURE__ */
|
|
654
|
+
iconAfter: g ? /* @__PURE__ */ H(re, {
|
|
655
655
|
size: l,
|
|
656
656
|
stroke: 1.5,
|
|
657
657
|
className: "text-secondary rtl:scale-x-[-1]",
|
|
@@ -666,9 +666,9 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
666
666
|
m,
|
|
667
667
|
g
|
|
668
668
|
]);
|
|
669
|
-
return S.length === 0 ? null : /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
icon: /* @__PURE__ */
|
|
669
|
+
return S.length === 0 ? null : /* @__PURE__ */ H(V, { children: g ? /* @__PURE__ */ U(V, { children: [
|
|
670
|
+
/* @__PURE__ */ H(v, {
|
|
671
|
+
icon: /* @__PURE__ */ H(P, {
|
|
672
672
|
size: f.LG,
|
|
673
673
|
"aria-hidden": !0
|
|
674
674
|
}),
|
|
@@ -677,7 +677,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
677
677
|
className: s("size-10 flex-shrink-0", d && "pointer-events-none opacity-50"),
|
|
678
678
|
onClick: () => y(!0)
|
|
679
679
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ H(Re, {
|
|
681
681
|
isOpen: _,
|
|
682
682
|
title: r,
|
|
683
683
|
closeLabel: i,
|
|
@@ -687,7 +687,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
687
687
|
className: "pb-4",
|
|
688
688
|
btnTextClassName: "flex-1"
|
|
689
689
|
}),
|
|
690
|
-
p != null && /* @__PURE__ */
|
|
690
|
+
p != null && /* @__PURE__ */ H(Ue, {
|
|
691
691
|
isOpen: b,
|
|
692
692
|
onBack: () => {
|
|
693
693
|
x(!1), y(!0);
|
|
@@ -714,13 +714,13 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
714
714
|
saveLabel: p.saveLabel,
|
|
715
715
|
saveDisabledTooltip: p.saveDisabledTooltip
|
|
716
716
|
})
|
|
717
|
-
] }) : /* @__PURE__ */ V
|
|
717
|
+
] }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(h, {
|
|
718
718
|
matchReferenceWidth: !1,
|
|
719
719
|
placement: "bottom-start",
|
|
720
720
|
listClassName: u,
|
|
721
721
|
items: S,
|
|
722
|
-
children: /* @__PURE__ */
|
|
723
|
-
icon: /* @__PURE__ */
|
|
722
|
+
children: /* @__PURE__ */ H(v, {
|
|
723
|
+
icon: /* @__PURE__ */ H(P, {
|
|
724
724
|
size: f.LG,
|
|
725
725
|
"aria-hidden": !0
|
|
726
726
|
}),
|
|
@@ -729,7 +729,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
729
729
|
className: "size-10 flex-shrink-0",
|
|
730
730
|
disabled: d
|
|
731
731
|
})
|
|
732
|
-
}), p != null && b && /* @__PURE__ */
|
|
732
|
+
}), p != null && b && /* @__PURE__ */ H(We, {
|
|
733
733
|
features: p.features,
|
|
734
734
|
initialResponseFormat: p.responseFormat ?? a.Markdown,
|
|
735
735
|
initialSystemPrompt: p.systemPrompt,
|
|
@@ -756,9 +756,9 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
756
756
|
recordingDot: "_recordingDot_9pzud_22",
|
|
757
757
|
micRecordingIcon: "_micRecordingIcon_9pzud_26"
|
|
758
758
|
}, Ke = 3, qe = 6, Je = .12, Ye = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
|
|
759
|
-
let m =
|
|
759
|
+
let m = z(null), h = z(null), g = z(!1), y = e === Me.Recording, b = e === Me.Uploading, x = e === Me.Error;
|
|
760
760
|
g.current = y;
|
|
761
|
-
let S =
|
|
761
|
+
let S = I((e, t) => {
|
|
762
762
|
let n = e.getContext("2d");
|
|
763
763
|
if (!n) return;
|
|
764
764
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
@@ -769,7 +769,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
769
769
|
let t = e / o * qe * Math.PI, r = Math.max(Je, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
|
|
770
770
|
n.fillRect(e * 4, (i - s) / 2, Ke, s);
|
|
771
771
|
}
|
|
772
|
-
}, []), C =
|
|
772
|
+
}, []), C = I((e, t) => {
|
|
773
773
|
let n = e.getContext("2d");
|
|
774
774
|
if (!n) return;
|
|
775
775
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
@@ -782,7 +782,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
782
782
|
n.fillRect(e * 4, (i - s) / 2, Ke, s);
|
|
783
783
|
}
|
|
784
784
|
}, []);
|
|
785
|
-
|
|
785
|
+
L(() => {
|
|
786
786
|
h.current = t;
|
|
787
787
|
let e = m.current;
|
|
788
788
|
e && (g.current ? S(e, t?.[t.length - 1] ?? 0) : C(e, t));
|
|
@@ -790,7 +790,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
790
790
|
t,
|
|
791
791
|
S,
|
|
792
792
|
C
|
|
793
|
-
]),
|
|
793
|
+
]), L(() => {
|
|
794
794
|
let e = m.current;
|
|
795
795
|
if (!e) return;
|
|
796
796
|
let t = new ResizeObserver(() => {
|
|
@@ -801,10 +801,10 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
801
801
|
});
|
|
802
802
|
return t.observe(e), () => t.disconnect();
|
|
803
803
|
}, [S, C]);
|
|
804
|
-
let w = /* @__PURE__ */
|
|
804
|
+
let w = /* @__PURE__ */ H("div", {
|
|
805
805
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
806
|
-
children: y ? /* @__PURE__ */
|
|
807
|
-
icon: /* @__PURE__ */
|
|
806
|
+
children: y ? /* @__PURE__ */ H(v, {
|
|
807
|
+
icon: /* @__PURE__ */ H(se, {
|
|
808
808
|
size: f.LG,
|
|
809
809
|
className: J.micRecordingIcon,
|
|
810
810
|
"aria-hidden": !0
|
|
@@ -812,26 +812,26 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
812
812
|
"aria-label": o,
|
|
813
813
|
className: "size-10 flex-shrink-0",
|
|
814
814
|
onClick: r
|
|
815
|
-
}) : /* @__PURE__ */ V
|
|
816
|
-
icon: /* @__PURE__ */
|
|
815
|
+
}) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(v, {
|
|
816
|
+
icon: /* @__PURE__ */ H(le, {
|
|
817
817
|
size: f.LG,
|
|
818
818
|
"aria-hidden": !0
|
|
819
819
|
}),
|
|
820
820
|
"aria-label": l,
|
|
821
821
|
className: "size-10 flex-shrink-0",
|
|
822
822
|
onClick: a
|
|
823
|
-
}), b ? /* @__PURE__ */
|
|
823
|
+
}), b ? /* @__PURE__ */ H(D, {
|
|
824
824
|
fullWidth: !1,
|
|
825
825
|
size: f.LG,
|
|
826
826
|
ariaLabel: u,
|
|
827
827
|
className: "flex size-10 flex-shrink-0 items-center justify-center"
|
|
828
|
-
}) : /* @__PURE__ */
|
|
829
|
-
icon: /* @__PURE__ */
|
|
828
|
+
}) : /* @__PURE__ */ H(v, {
|
|
829
|
+
icon: /* @__PURE__ */ H("div", {
|
|
830
830
|
className: "flex size-8 items-center justify-center rounded-full bg-controls-accent-primary",
|
|
831
|
-
children: /* @__PURE__ */
|
|
831
|
+
children: /* @__PURE__ */ H(M, {
|
|
832
832
|
size: 24,
|
|
833
833
|
"aria-hidden": !0,
|
|
834
|
-
className: "
|
|
834
|
+
className: "rounded-full bg-controls-accent-primary text-control-permanent"
|
|
835
835
|
})
|
|
836
836
|
}),
|
|
837
837
|
"aria-label": c,
|
|
@@ -839,23 +839,23 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
839
839
|
onClick: i
|
|
840
840
|
})] })
|
|
841
841
|
});
|
|
842
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ U("div", {
|
|
843
843
|
className: p,
|
|
844
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ U("div", {
|
|
845
845
|
style: d,
|
|
846
846
|
className: s(J.container, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", x && J.containerError),
|
|
847
|
-
children: [/* @__PURE__ */
|
|
847
|
+
children: [/* @__PURE__ */ U("div", {
|
|
848
848
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
849
|
-
children: [y && /* @__PURE__ */
|
|
849
|
+
children: [y && /* @__PURE__ */ H("span", {
|
|
850
850
|
className: s(J.recordingDot, "size-2 flex-shrink-0 rounded-full"),
|
|
851
851
|
"aria-hidden": !0
|
|
852
|
-
}), /* @__PURE__ */
|
|
852
|
+
}), /* @__PURE__ */ H("canvas", {
|
|
853
853
|
ref: m,
|
|
854
854
|
height: 32,
|
|
855
855
|
className: s(J.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
856
856
|
})]
|
|
857
857
|
}), w]
|
|
858
|
-
}), x && n && /* @__PURE__ */
|
|
858
|
+
}), x && n && /* @__PURE__ */ H(_, {
|
|
859
859
|
text: n,
|
|
860
860
|
className: "mt-1 px-1"
|
|
861
861
|
})]
|
|
@@ -872,73 +872,73 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
872
872
|
sendButtonEnter: "_sendButtonEnter_1q2nu_1",
|
|
873
873
|
sendButtonExiting: "_sendButtonExiting_1q2nu_55",
|
|
874
874
|
sendButtonExit: "_sendButtonExit_1q2nu_55"
|
|
875
|
-
}, Xe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */
|
|
875
|
+
}, Xe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ H(O, {
|
|
876
876
|
tooltip: r,
|
|
877
877
|
hideTooltip: !r,
|
|
878
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ H("button", {
|
|
879
879
|
className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", Y.sendButton, i && Y.sendButtonExiting),
|
|
880
880
|
"aria-label": n,
|
|
881
881
|
onClick: () => e?.(),
|
|
882
882
|
type: "button",
|
|
883
883
|
disabled: t,
|
|
884
884
|
"aria-hidden": i,
|
|
885
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ H(j, {
|
|
886
886
|
size: f.LG,
|
|
887
887
|
className: "rtl:scale-x-[-1]"
|
|
888
888
|
})
|
|
889
889
|
})
|
|
890
|
-
}), Ze = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */
|
|
890
|
+
}), Ze = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H("button", {
|
|
891
891
|
className: s("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
|
|
892
892
|
"aria-label": t,
|
|
893
893
|
onClick: () => e?.(),
|
|
894
894
|
type: "button",
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ H(se, {
|
|
896
896
|
size: f.LG,
|
|
897
897
|
className: Y.stopIcon
|
|
898
898
|
})
|
|
899
|
-
}), Qe = ({ size: e = 20 }) => /* @__PURE__ */
|
|
899
|
+
}), Qe = ({ size: e = 20 }) => /* @__PURE__ */ H(w, {
|
|
900
900
|
variant: T.Circular,
|
|
901
901
|
width: e,
|
|
902
902
|
height: e,
|
|
903
903
|
active: !0
|
|
904
|
-
}), $e = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
904
|
+
}), $e = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
|
|
905
905
|
className: "flex min-w-0 flex-1 items-center",
|
|
906
|
-
children: [/* @__PURE__ */
|
|
906
|
+
children: [/* @__PURE__ */ H(w, {
|
|
907
907
|
variant: T.Text,
|
|
908
908
|
width: "100%",
|
|
909
909
|
height: 16,
|
|
910
910
|
active: !0
|
|
911
|
-
}), e && /* @__PURE__ */
|
|
911
|
+
}), e && /* @__PURE__ */ H("span", {
|
|
912
912
|
className: "sr-only",
|
|
913
913
|
children: e
|
|
914
914
|
})]
|
|
915
|
-
}), et = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
915
|
+
}), et = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
|
|
916
916
|
role: "status",
|
|
917
917
|
"aria-label": e,
|
|
918
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
918
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
|
|
919
919
|
className: "flex h-11 items-center gap-3 px-4",
|
|
920
920
|
"aria-hidden": "true",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ H(Qe, {}), /* @__PURE__ */ H($e, {})]
|
|
922
922
|
}, t))
|
|
923
923
|
}), tt = (e) => e.displayName ?? e.id, nt = (e, t) => {
|
|
924
924
|
let n = t.trim().toLowerCase();
|
|
925
925
|
return n ? e.filter((e) => tt(e).toLowerCase().includes(n)) : e;
|
|
926
|
-
}, rt = (e, t, r, i = 18, a) => /* @__PURE__ */
|
|
926
|
+
}, rt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
|
|
927
927
|
src: e,
|
|
928
928
|
size: i,
|
|
929
929
|
labels: { tooltip: a },
|
|
930
930
|
initialsName: r
|
|
931
931
|
}), it = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
|
|
932
|
-
let [o, c] =
|
|
932
|
+
let [o, c] = B(""), l = R(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = R(() => u ? /* @__PURE__ */ H(Qe, { size: f.LG }) : rt(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
|
|
933
933
|
return {
|
|
934
934
|
selectorIcon: d,
|
|
935
935
|
selectorAriaLabel: p ? `${i?.ariaLabel ?? "Select model"}: ${p}` : i?.ariaLabel ?? "Select model",
|
|
936
936
|
selectedLabel: p,
|
|
937
|
-
menuItems:
|
|
937
|
+
menuItems: R(() => {
|
|
938
938
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
939
939
|
key: `__loading-${t}`,
|
|
940
|
-
icon: /* @__PURE__ */
|
|
941
|
-
label: /* @__PURE__ */
|
|
940
|
+
icon: /* @__PURE__ */ H(Qe, {}),
|
|
941
|
+
label: /* @__PURE__ */ H($e, { loadingLabel: t === 0 ? i?.loading : void 0 }),
|
|
942
942
|
disabled: !0
|
|
943
943
|
}));
|
|
944
944
|
if (!e || e.length === 0) {
|
|
@@ -953,13 +953,13 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
953
953
|
let i = e.id === t;
|
|
954
954
|
return {
|
|
955
955
|
key: e.id,
|
|
956
|
-
label: /* @__PURE__ */
|
|
956
|
+
label: /* @__PURE__ */ U("span", {
|
|
957
957
|
className: "flex w-full items-center justify-between gap-2",
|
|
958
|
-
children: [/* @__PURE__ */
|
|
958
|
+
children: [/* @__PURE__ */ H(r, {
|
|
959
959
|
text: tt(e),
|
|
960
960
|
query: o,
|
|
961
961
|
maxLines: 1
|
|
962
|
-
}), i && /* @__PURE__ */
|
|
962
|
+
}), i && /* @__PURE__ */ H(ze, { gradientId: "ms-check-grad" })]
|
|
963
963
|
}),
|
|
964
964
|
icon: rt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
965
965
|
onClick: () => n?.(e.id),
|
|
@@ -974,9 +974,9 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
974
974
|
i,
|
|
975
975
|
n
|
|
976
976
|
]),
|
|
977
|
-
menuHeader:
|
|
977
|
+
menuHeader: R(() => !u && e && e.length > 0 ? /* @__PURE__ */ H("div", {
|
|
978
978
|
className: s("sticky top-0 z-10 pb-1 pe-2 pt-2", a),
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ H(C, {
|
|
980
980
|
value: o,
|
|
981
981
|
placeholder: i?.searchPlaceholder ?? "Search",
|
|
982
982
|
size: k.Small,
|
|
@@ -994,7 +994,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
994
994
|
e || c("");
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
}, X = typeof window < "u" ?
|
|
997
|
+
}, X = typeof window < "u" ? pe : L;
|
|
998
998
|
function at(e) {
|
|
999
999
|
if (e !== void 0) switch (typeof e) {
|
|
1000
1000
|
case "number": return e;
|
|
@@ -1004,10 +1004,10 @@ function at(e) {
|
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
1006
|
function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1007
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1007
|
+
let { styleHeight: s, styleWidth: c } = R(() => ({
|
|
1008
1008
|
styleHeight: at(o?.height),
|
|
1009
1009
|
styleWidth: at(o?.width)
|
|
1010
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1010
|
+
}), [o?.height, o?.width]), [l, u] = B({
|
|
1011
1011
|
height: t,
|
|
1012
1012
|
width: n
|
|
1013
1013
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -1031,7 +1031,7 @@ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1031
1031
|
i,
|
|
1032
1032
|
s,
|
|
1033
1033
|
c
|
|
1034
|
-
]),
|
|
1034
|
+
]), R(() => ({
|
|
1035
1035
|
height: s ?? l.height,
|
|
1036
1036
|
width: c ?? l.width
|
|
1037
1037
|
}), [
|
|
@@ -1041,12 +1041,12 @@ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1041
1041
|
]);
|
|
1042
1042
|
}
|
|
1043
1043
|
function st(e) {
|
|
1044
|
-
let t =
|
|
1044
|
+
let t = z(() => {
|
|
1045
1045
|
throw Error("Cannot call during render.");
|
|
1046
1046
|
});
|
|
1047
1047
|
return X(() => {
|
|
1048
1048
|
t.current = e;
|
|
1049
|
-
}, [e]),
|
|
1049
|
+
}, [e]), I((e) => t.current?.(e), [t]);
|
|
1050
1050
|
}
|
|
1051
1051
|
var Z = null;
|
|
1052
1052
|
function ct(e = !1) {
|
|
@@ -1158,7 +1158,7 @@ function pt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
1160
|
function mt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1161
|
-
return
|
|
1161
|
+
return R(() => pt({
|
|
1162
1162
|
itemCount: e,
|
|
1163
1163
|
itemProps: t,
|
|
1164
1164
|
itemSize: n
|
|
@@ -1187,14 +1187,14 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1187
1187
|
element: e,
|
|
1188
1188
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1189
1189
|
style: t
|
|
1190
|
-
}), f =
|
|
1190
|
+
}), f = z({
|
|
1191
1191
|
height: 0,
|
|
1192
1192
|
width: 0
|
|
1193
1193
|
}), p = r === "vertical" ? u : d, m = ht({
|
|
1194
1194
|
containerSize: p,
|
|
1195
1195
|
itemSize: s
|
|
1196
1196
|
});
|
|
1197
|
-
|
|
1197
|
+
pe(() => {
|
|
1198
1198
|
if (typeof c == "function") {
|
|
1199
1199
|
let e = f.current;
|
|
1200
1200
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1211,7 +1211,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1211
1211
|
itemCount: a,
|
|
1212
1212
|
itemProps: o,
|
|
1213
1213
|
itemSize: m
|
|
1214
|
-
}), g =
|
|
1214
|
+
}), g = I((e) => h.get(e), [h]), [_, v] = B(() => ft({
|
|
1215
1215
|
cachedBounds: h,
|
|
1216
1216
|
containerScrollOffset: 0,
|
|
1217
1217
|
containerSize: p,
|
|
@@ -1222,7 +1222,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1222
1222
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1223
1223
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1224
1224
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1225
|
-
}, C =
|
|
1225
|
+
}, C = I(() => ut({
|
|
1226
1226
|
cachedBounds: h,
|
|
1227
1227
|
itemCount: a,
|
|
1228
1228
|
itemSize: m
|
|
@@ -1230,7 +1230,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1230
1230
|
h,
|
|
1231
1231
|
a,
|
|
1232
1232
|
m
|
|
1233
|
-
]), w =
|
|
1233
|
+
]), w = I((t) => ft({
|
|
1234
1234
|
cachedBounds: h,
|
|
1235
1235
|
containerScrollOffset: lt({
|
|
1236
1236
|
containerElement: e,
|
|
@@ -1318,7 +1318,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
1320
|
function _t(e) {
|
|
1321
|
-
return
|
|
1321
|
+
return R(() => e, Object.values(e));
|
|
1322
1322
|
}
|
|
1323
1323
|
function vt(e, t) {
|
|
1324
1324
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
@@ -1329,18 +1329,18 @@ function yt(e) {
|
|
|
1329
1329
|
}
|
|
1330
1330
|
var bt = "data-react-window-index";
|
|
1331
1331
|
function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1332
|
-
let m = _t(u), h =
|
|
1332
|
+
let m = _t(u), h = R(() => de(s, vt), [s]), [g, _] = B(null), v = yt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = gt({
|
|
1333
1333
|
containerElement: g,
|
|
1334
1334
|
containerStyle: f,
|
|
1335
1335
|
defaultContainerSize: n,
|
|
1336
1336
|
direction: "vertical",
|
|
1337
1337
|
itemCount: c,
|
|
1338
1338
|
itemProps: m,
|
|
1339
|
-
itemSize:
|
|
1339
|
+
itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1340
1340
|
onResize: i,
|
|
1341
1341
|
overscanCount: o
|
|
1342
1342
|
});
|
|
1343
|
-
|
|
1343
|
+
fe(r, () => ({
|
|
1344
1344
|
get element() {
|
|
1345
1345
|
return g;
|
|
1346
1346
|
},
|
|
@@ -1369,7 +1369,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1369
1369
|
l,
|
|
1370
1370
|
S,
|
|
1371
1371
|
w
|
|
1372
|
-
]),
|
|
1372
|
+
]), L(() => {
|
|
1373
1373
|
S >= 0 && w >= 0 && a && a({
|
|
1374
1374
|
startIndex: C,
|
|
1375
1375
|
stopIndex: T
|
|
@@ -1384,11 +1384,11 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1384
1384
|
w,
|
|
1385
1385
|
T
|
|
1386
1386
|
]);
|
|
1387
|
-
let E =
|
|
1387
|
+
let E = R(() => {
|
|
1388
1388
|
let e = [];
|
|
1389
1389
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1390
1390
|
let n = y(t);
|
|
1391
|
-
e.push(/* @__PURE__ */
|
|
1391
|
+
e.push(/* @__PURE__ */ F(h, {
|
|
1392
1392
|
...m,
|
|
1393
1393
|
ariaAttributes: {
|
|
1394
1394
|
"aria-posinset": t + 1,
|
|
@@ -1415,7 +1415,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1415
1415
|
m,
|
|
1416
1416
|
S,
|
|
1417
1417
|
w
|
|
1418
|
-
]), D = /* @__PURE__ */
|
|
1418
|
+
]), D = /* @__PURE__ */ H("div", {
|
|
1419
1419
|
"aria-hidden": !0,
|
|
1420
1420
|
style: {
|
|
1421
1421
|
height: b(),
|
|
@@ -1423,7 +1423,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1423
1423
|
zIndex: -1
|
|
1424
1424
|
}
|
|
1425
1425
|
});
|
|
1426
|
-
return
|
|
1426
|
+
return F(d, {
|
|
1427
1427
|
role: "list",
|
|
1428
1428
|
...p,
|
|
1429
1429
|
className: t,
|
|
@@ -1445,24 +1445,24 @@ var St = {
|
|
|
1445
1445
|
stateLabel: "_stateLabel_3wv6u_23"
|
|
1446
1446
|
}, Ct = 44, wt = 8, Tt = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
|
|
1447
1447
|
let u = i[e], d = rt(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
|
|
1448
|
-
return /* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ H("div", {
|
|
1449
1449
|
style: t,
|
|
1450
1450
|
...n,
|
|
1451
|
-
children: /* @__PURE__ */
|
|
1451
|
+
children: /* @__PURE__ */ H(p, {
|
|
1452
1452
|
type: "button",
|
|
1453
1453
|
className: s(St.item, "flex h-full w-full items-center gap-3 px-4"),
|
|
1454
|
-
iconBefore: /* @__PURE__ */
|
|
1454
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
1455
1455
|
className: St.itemIcon,
|
|
1456
1456
|
children: d
|
|
1457
1457
|
}),
|
|
1458
|
-
label: /* @__PURE__ */
|
|
1458
|
+
label: /* @__PURE__ */ U("span", {
|
|
1459
1459
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1460
|
-
children: [/* @__PURE__ */
|
|
1460
|
+
children: [/* @__PURE__ */ H(r, {
|
|
1461
1461
|
text: u.displayName ?? u.id,
|
|
1462
1462
|
query: c,
|
|
1463
1463
|
maxLines: 1,
|
|
1464
1464
|
className: s(o, "min-w-0 flex-1 text-start")
|
|
1465
|
-
}), m && /* @__PURE__ */
|
|
1465
|
+
}), m && /* @__PURE__ */ H(M, {
|
|
1466
1466
|
size: f.SM,
|
|
1467
1467
|
className: St.checkIcon,
|
|
1468
1468
|
"aria-hidden": !0
|
|
@@ -1472,12 +1472,12 @@ var St = {
|
|
|
1472
1472
|
})
|
|
1473
1473
|
});
|
|
1474
1474
|
}, Et = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
|
|
1475
|
-
let [h, g] =
|
|
1476
|
-
|
|
1475
|
+
let [h, g] = B("");
|
|
1476
|
+
L(() => {
|
|
1477
1477
|
e || g("");
|
|
1478
1478
|
}, [e]);
|
|
1479
1479
|
let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? nt(a, h) : [];
|
|
1480
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ U(W, {
|
|
1481
1481
|
isOpen: e,
|
|
1482
1482
|
title: t,
|
|
1483
1483
|
closeLabel: n,
|
|
@@ -1485,19 +1485,19 @@ var St = {
|
|
|
1485
1485
|
style: f,
|
|
1486
1486
|
titleClassName: p,
|
|
1487
1487
|
className: "max-h-[80dvh]",
|
|
1488
|
-
children: [_ && !v && /* @__PURE__ */ V
|
|
1488
|
+
children: [_ && !v && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
1489
1489
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1490
|
-
children: /* @__PURE__ */
|
|
1490
|
+
children: /* @__PURE__ */ H(C, {
|
|
1491
1491
|
value: h,
|
|
1492
1492
|
placeholder: r,
|
|
1493
1493
|
size: k.Standard,
|
|
1494
1494
|
onChange: g
|
|
1495
1495
|
})
|
|
1496
|
-
}), /* @__PURE__ */
|
|
1496
|
+
}), /* @__PURE__ */ H("div", { className: s(St.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ H(et, { loadingLabel: l }) : y ? /* @__PURE__ */ H("div", {
|
|
1497
1497
|
role: "list",
|
|
1498
1498
|
className: s(St.stateLabel, m, "px-4 py-4"),
|
|
1499
1499
|
children: y
|
|
1500
|
-
}) : /* @__PURE__ */
|
|
1500
|
+
}) : /* @__PURE__ */ H(xt, {
|
|
1501
1501
|
role: "list",
|
|
1502
1502
|
className: "overflow-y-auto",
|
|
1503
1503
|
style: { height: Math.min(b.length, wt) * Ct },
|
|
@@ -1516,22 +1516,22 @@ var St = {
|
|
|
1516
1516
|
})]
|
|
1517
1517
|
});
|
|
1518
1518
|
}, Dt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
|
|
1519
|
-
let [_, y] =
|
|
1519
|
+
let [_, y] = B(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = it({
|
|
1520
1520
|
deployments: e,
|
|
1521
1521
|
selectedDeploymentId: t,
|
|
1522
1522
|
onDeploymentChange: n,
|
|
1523
1523
|
modelSelectorLabels: r
|
|
1524
1524
|
});
|
|
1525
1525
|
if (!e) return null;
|
|
1526
|
-
let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */
|
|
1526
|
+
let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ H(N, {
|
|
1527
1527
|
size: f.SM,
|
|
1528
1528
|
className: Y.modelSelectorCaret,
|
|
1529
1529
|
"aria-hidden": !0
|
|
1530
1530
|
});
|
|
1531
|
-
return a ? /* @__PURE__ */ V
|
|
1531
|
+
return a ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(O, {
|
|
1532
1532
|
tooltip: S,
|
|
1533
|
-
children: /* @__PURE__ */
|
|
1534
|
-
icon: /* @__PURE__ */
|
|
1533
|
+
children: /* @__PURE__ */ H(v, {
|
|
1534
|
+
icon: /* @__PURE__ */ U("div", {
|
|
1535
1535
|
className: "flex items-center gap-1",
|
|
1536
1536
|
children: [b, D]
|
|
1537
1537
|
}),
|
|
@@ -1541,14 +1541,14 @@ var St = {
|
|
|
1541
1541
|
},
|
|
1542
1542
|
className: s(Y.modelSelectorButton, E)
|
|
1543
1543
|
})
|
|
1544
|
-
}), u ? /* @__PURE__ */
|
|
1544
|
+
}), u ? /* @__PURE__ */ H(W, {
|
|
1545
1545
|
isOpen: _,
|
|
1546
1546
|
title: r?.ariaLabel ?? "Select model",
|
|
1547
1547
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1548
1548
|
onClose: () => y(!1),
|
|
1549
1549
|
style: l,
|
|
1550
1550
|
children: u(() => y(!1))
|
|
1551
|
-
}) : /* @__PURE__ */
|
|
1551
|
+
}) : /* @__PURE__ */ H(Et, {
|
|
1552
1552
|
isOpen: _,
|
|
1553
1553
|
title: r?.ariaLabel ?? "Select model",
|
|
1554
1554
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1561,7 +1561,7 @@ var St = {
|
|
|
1561
1561
|
errorLabel: r?.error,
|
|
1562
1562
|
emptyLabel: r?.empty,
|
|
1563
1563
|
style: l
|
|
1564
|
-
})] }) : u ? /* @__PURE__ */
|
|
1564
|
+
})] }) : u ? /* @__PURE__ */ H(h, {
|
|
1565
1565
|
placement: "top-end",
|
|
1566
1566
|
matchReferenceWidth: !1,
|
|
1567
1567
|
open: d,
|
|
@@ -1570,9 +1570,9 @@ var St = {
|
|
|
1570
1570
|
outsideClosable: !0,
|
|
1571
1571
|
renderOverlay: () => u(() => m?.(!1)),
|
|
1572
1572
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1573
|
-
children: /* @__PURE__ */
|
|
1573
|
+
children: /* @__PURE__ */ H(O, {
|
|
1574
1574
|
tooltip: S,
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1575
|
+
children: /* @__PURE__ */ U("button", {
|
|
1576
1576
|
type: "button",
|
|
1577
1577
|
"aria-label": x,
|
|
1578
1578
|
className: s("flex items-center justify-center gap-1 rounded-md p-2", Y.modelSelectorButton, o || i || c ? E : void 0, (o || c) && Y.modelSelectorButtonDisabled),
|
|
@@ -1582,12 +1582,12 @@ var St = {
|
|
|
1582
1582
|
children: [b, D]
|
|
1583
1583
|
})
|
|
1584
1584
|
})
|
|
1585
|
-
}) : /* @__PURE__ */
|
|
1585
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1586
1586
|
className: s(c && E),
|
|
1587
1587
|
"aria-disabled": c || void 0,
|
|
1588
|
-
children: /* @__PURE__ */
|
|
1588
|
+
children: /* @__PURE__ */ H(O, {
|
|
1589
1589
|
tooltip: S,
|
|
1590
|
-
children: /* @__PURE__ */
|
|
1590
|
+
children: /* @__PURE__ */ H(g, {
|
|
1591
1591
|
icon: b,
|
|
1592
1592
|
ariaLabel: x,
|
|
1593
1593
|
items: C,
|
|
@@ -1603,183 +1603,186 @@ var St = {
|
|
|
1603
1603
|
})
|
|
1604
1604
|
})
|
|
1605
1605
|
});
|
|
1606
|
-
}, Ot = 160, kt = ({ message: e = "",
|
|
1607
|
-
let
|
|
1608
|
-
"--ci-bg":
|
|
1609
|
-
"--ci-text":
|
|
1610
|
-
"--ci-border":
|
|
1611
|
-
"--ci-border-hover":
|
|
1612
|
-
"--ci-border-focus":
|
|
1613
|
-
"--ci-placeholder":
|
|
1614
|
-
"--ci-shadow":
|
|
1615
|
-
"--ci-shadow-focus":
|
|
1616
|
-
"--ci-send-bg":
|
|
1617
|
-
"--ci-send-text":
|
|
1618
|
-
"--ci-stop-color":
|
|
1619
|
-
}), [
|
|
1606
|
+
}, Ot = 160, kt = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: a = !1, onChange: u, onAttachmentsChange: d, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: y = "Menu", menuCloseLabel: b = "Close", removeLabel: x, retryLabel: S, sendLabel: C, stopLabel: w, micLabel: T = "Record voice message", colors: E, typography: D, className: ee, pendingDropFiles: O = [], onDropFilesConsumed: k, pendingAttachments: A = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: ne = 4e3, deployments: j, selectedDeploymentId: M, onDeploymentChange: N, modelSelectorLabels: re, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: P = !1, hideAttachFile: ce = !1, hideActionBar: le = !1, renderFooterActions: ue, isInputDisabled: F = !1, isModelSelectorDisabled: de = !1, isTranscriptionSupported: L = !1, onUploadAudio: fe, onTranscribeAudio: pe, sendOnEnter: me = Ie.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: ve, autoFocus: ye = !1, messageHistory: be, onDialFileSystemClick: xe, dialFileSystemLabel: Ce, validateAttachment: we, onAttachmentClick: W, modelPickerOverlay: Te, maximumAttachmentsAmount: Oe, onAttachmentsLimitExceeded: ke }) => {
|
|
1607
|
+
let Me = c(), [Ne, Pe] = B(!1), Le = Ae(be), Re = R(() => o({
|
|
1608
|
+
"--ci-bg": E?.background,
|
|
1609
|
+
"--ci-text": E?.text,
|
|
1610
|
+
"--ci-border": E?.border,
|
|
1611
|
+
"--ci-border-hover": E?.borderHover,
|
|
1612
|
+
"--ci-border-focus": E?.borderFocus,
|
|
1613
|
+
"--ci-placeholder": E?.placeholder,
|
|
1614
|
+
"--ci-shadow": E?.shadow,
|
|
1615
|
+
"--ci-shadow-focus": E?.shadowFocus,
|
|
1616
|
+
"--ci-send-bg": E?.sendBackground,
|
|
1617
|
+
"--ci-send-text": E?.sendText,
|
|
1618
|
+
"--ci-stop-color": E?.stopColor
|
|
1619
|
+
}), [E]), ze = R(() => xe ? [{
|
|
1620
1620
|
key: "dial-fs",
|
|
1621
1621
|
label: Ce ?? "DIAL file system",
|
|
1622
|
-
icon: /* @__PURE__ */
|
|
1622
|
+
icon: /* @__PURE__ */ H(ie, {
|
|
1623
1623
|
size: l,
|
|
1624
1624
|
"aria-hidden": !0
|
|
1625
1625
|
}),
|
|
1626
|
-
onClick:
|
|
1627
|
-
}] : [], [
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1626
|
+
onClick: xe
|
|
1627
|
+
}] : [], [xe, Ce]), { message: G, setMessage: K, textareaRef: Be, isMultiLine: Ve } = je({
|
|
1628
|
+
messageProp: e,
|
|
1629
|
+
messageRevision: t
|
|
1630
|
+
}), { attachments: q, buildAttachments: He, addAttachments: Ue, resetAttachments: We, handleRemove: J, handleRetry: Ke, handleExpand: qe, hasBlockedAttachments: Je } = Ee({
|
|
1631
|
+
initialAttachments: oe,
|
|
1632
|
+
onUploadAttachment: r,
|
|
1633
|
+
onAttachmentsChange: d,
|
|
1634
|
+
validateAttachment: we,
|
|
1635
|
+
pendingDropFiles: O,
|
|
1636
|
+
onDropFilesConsumed: k,
|
|
1637
|
+
pendingAttachments: A,
|
|
1638
|
+
onPendingAttachmentsConsumed: te,
|
|
1639
|
+
onExpandPastedText: I((e) => {
|
|
1637
1640
|
K((t) => t ? `${t}\n${e}` : e);
|
|
1638
1641
|
}, [K]),
|
|
1639
|
-
maximumAttachmentsAmount:
|
|
1640
|
-
baseAttachmentsAmount:
|
|
1642
|
+
maximumAttachmentsAmount: Oe,
|
|
1643
|
+
baseAttachmentsAmount: he.length,
|
|
1641
1644
|
onAttachmentsLimitExceeded: ke
|
|
1642
|
-
}), { state:
|
|
1643
|
-
onUploadAudio:
|
|
1644
|
-
onTranscribeAudio:
|
|
1645
|
-
onTranscript:
|
|
1646
|
-
K(e),
|
|
1647
|
-
}, [
|
|
1648
|
-
}),
|
|
1649
|
-
let e = G,
|
|
1650
|
-
K(""),
|
|
1645
|
+
}), { state: Qe, waveformData: $e, errorMessage: et, startRecording: tt, stopRecording: nt, confirmRecording: rt, discardRecording: it } = Fe({
|
|
1646
|
+
onUploadAudio: fe,
|
|
1647
|
+
onTranscribeAudio: pe,
|
|
1648
|
+
onTranscript: I((e) => {
|
|
1649
|
+
K(e), u?.(e);
|
|
1650
|
+
}, [u, K])
|
|
1651
|
+
}), X = z(null), at = z(null), { handlePaste: ot } = Se(Ue, ne), st = G.trim().length > 0 || q.length > 0, Z = st && !Je, { shouldRender: ct, isExiting: lt, instanceKey: Q } = De(!a && st, Ot), $ = se || q.length > 0 || G.includes("\n") || Ve, ut = j === void 0 || M != null, dt = async () => {
|
|
1652
|
+
let e = G, t = q;
|
|
1653
|
+
K(""), Le.reset();
|
|
1651
1654
|
try {
|
|
1652
|
-
await
|
|
1655
|
+
await n?.(e, t), t.forEach((e) => {
|
|
1653
1656
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl);
|
|
1654
|
-
}),
|
|
1657
|
+
}), We([]);
|
|
1655
1658
|
} catch {
|
|
1656
|
-
K(e),
|
|
1659
|
+
K(e), We(t);
|
|
1657
1660
|
}
|
|
1658
|
-
},
|
|
1659
|
-
if (!e.nativeEvent.isComposing && !
|
|
1660
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1661
|
+
}, ft = (e) => {
|
|
1662
|
+
if (!e.nativeEvent.isComposing && !F && !a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1663
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Le.navigate(e.key === "ArrowUp" ? "up" : "down", G, t);
|
|
1661
1664
|
if (n !== null) {
|
|
1662
1665
|
e.preventDefault(), K(n);
|
|
1663
1666
|
return;
|
|
1664
1667
|
}
|
|
1665
1668
|
}
|
|
1666
|
-
e.key === "Enter" && (
|
|
1667
|
-
},
|
|
1669
|
+
e.key === "Enter" && (me === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !a && Z && ut && !F && dt());
|
|
1670
|
+
}, pt = (e) => {
|
|
1668
1671
|
let t = Array.from(e.target.files ?? []);
|
|
1669
1672
|
if (t.length === 0) return;
|
|
1670
|
-
let n =
|
|
1671
|
-
e.target.value = "",
|
|
1673
|
+
let n = He(t);
|
|
1674
|
+
e.target.value = "", Ue(n);
|
|
1672
1675
|
};
|
|
1673
|
-
if (
|
|
1674
|
-
state:
|
|
1675
|
-
waveformData:
|
|
1676
|
-
errorMessage:
|
|
1677
|
-
onStop:
|
|
1678
|
-
onConfirm:
|
|
1679
|
-
onDiscard:
|
|
1680
|
-
style:
|
|
1681
|
-
className:
|
|
1676
|
+
if (Qe !== "idle") return /* @__PURE__ */ H(Ye, {
|
|
1677
|
+
state: Qe,
|
|
1678
|
+
waveformData: $e,
|
|
1679
|
+
errorMessage: et,
|
|
1680
|
+
onStop: nt,
|
|
1681
|
+
onConfirm: rt,
|
|
1682
|
+
onDiscard: it,
|
|
1683
|
+
style: Re,
|
|
1684
|
+
className: ee
|
|
1682
1685
|
});
|
|
1683
|
-
let
|
|
1684
|
-
className: s(Y.textarea,
|
|
1685
|
-
ref:
|
|
1686
|
-
autoFocus:
|
|
1686
|
+
let mt = /* @__PURE__ */ H("textarea", {
|
|
1687
|
+
className: s(Y.textarea, D?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1688
|
+
ref: Be,
|
|
1689
|
+
autoFocus: ye,
|
|
1687
1690
|
value: G,
|
|
1688
1691
|
onChange: (e) => {
|
|
1689
|
-
K(e.target.value),
|
|
1692
|
+
K(e.target.value), Le.notifyChange(), u?.(e.target.value);
|
|
1690
1693
|
},
|
|
1691
|
-
onKeyDown:
|
|
1692
|
-
onPaste:
|
|
1693
|
-
placeholder:
|
|
1694
|
-
"aria-label":
|
|
1695
|
-
disabled:
|
|
1694
|
+
onKeyDown: ft,
|
|
1695
|
+
onPaste: ot,
|
|
1696
|
+
placeholder: p,
|
|
1697
|
+
"aria-label": m,
|
|
1698
|
+
disabled: F,
|
|
1696
1699
|
rows: 1
|
|
1697
1700
|
});
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
ref:
|
|
1700
|
-
style:
|
|
1701
|
-
className: s(Y.wrapper,
|
|
1702
|
-
children: [(
|
|
1703
|
-
attachments: [...
|
|
1701
|
+
return /* @__PURE__ */ U("div", {
|
|
1702
|
+
ref: at,
|
|
1703
|
+
style: Re,
|
|
1704
|
+
className: s(Y.wrapper, F && Y.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", q.length > 6 ? "py-3 ps-3" : "p-3", ee),
|
|
1705
|
+
children: [(he.length > 0 || q.length > 0) && /* @__PURE__ */ H(_e, {
|
|
1706
|
+
attachments: [...he, ...q],
|
|
1704
1707
|
onRemove: (e) => {
|
|
1705
|
-
|
|
1708
|
+
he.some((t) => t.id === e) ? ge?.(e) : J(e);
|
|
1706
1709
|
},
|
|
1707
|
-
onRetry:
|
|
1708
|
-
onExpand:
|
|
1710
|
+
onRetry: Ke,
|
|
1711
|
+
onExpand: qe,
|
|
1709
1712
|
labels: {
|
|
1710
|
-
removeLabel:
|
|
1711
|
-
retryLabel:
|
|
1713
|
+
removeLabel: x,
|
|
1714
|
+
retryLabel: S
|
|
1712
1715
|
},
|
|
1713
|
-
onAttachmentClick:
|
|
1716
|
+
onAttachmentClick: W == null ? void 0 : (e) => {
|
|
1714
1717
|
let t = q.find((t) => t.id === e);
|
|
1715
|
-
t != null &&
|
|
1718
|
+
t != null && W(t);
|
|
1716
1719
|
}
|
|
1717
|
-
}),
|
|
1718
|
-
className: s("flex items-center gap-2",
|
|
1720
|
+
}), le ? $ && mt : /* @__PURE__ */ U("div", {
|
|
1721
|
+
className: s("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1719
1722
|
children: [
|
|
1720
|
-
!
|
|
1721
|
-
className: s("order-2 flex",
|
|
1722
|
-
children: [/* @__PURE__ */
|
|
1723
|
-
ref:
|
|
1723
|
+
!P && /* @__PURE__ */ U("div", {
|
|
1724
|
+
className: s("order-2 flex", !$ && "desktop:order-1"),
|
|
1725
|
+
children: [/* @__PURE__ */ H("input", {
|
|
1726
|
+
ref: X,
|
|
1724
1727
|
type: "file",
|
|
1725
1728
|
multiple: !0,
|
|
1726
|
-
accept:
|
|
1729
|
+
accept: g,
|
|
1727
1730
|
className: "sr-only",
|
|
1728
1731
|
"aria-hidden": !0,
|
|
1729
1732
|
tabIndex: -1,
|
|
1730
|
-
onChange:
|
|
1731
|
-
}), /* @__PURE__ */
|
|
1732
|
-
onAttachClick:
|
|
1733
|
-
attachLabel:
|
|
1734
|
-
addMenuTitle:
|
|
1735
|
-
menuTitle:
|
|
1736
|
-
menuCloseLabel:
|
|
1737
|
-
style:
|
|
1738
|
-
isDisabled:
|
|
1733
|
+
onChange: pt
|
|
1734
|
+
}), /* @__PURE__ */ H(Ge, {
|
|
1735
|
+
onAttachClick: ce ? void 0 : () => X.current?.click(),
|
|
1736
|
+
attachLabel: h,
|
|
1737
|
+
addMenuTitle: _,
|
|
1738
|
+
menuTitle: y,
|
|
1739
|
+
menuCloseLabel: b,
|
|
1740
|
+
style: Re,
|
|
1741
|
+
isDisabled: F,
|
|
1739
1742
|
chatSettings: ve,
|
|
1740
|
-
extraMenuItems:
|
|
1743
|
+
extraMenuItems: ze
|
|
1741
1744
|
})]
|
|
1742
1745
|
}),
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
className: s("order-1 flex w-full min-w-0 items-center self-stretch",
|
|
1745
|
-
children:
|
|
1746
|
+
/* @__PURE__ */ H("div", {
|
|
1747
|
+
className: s("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1748
|
+
children: mt
|
|
1746
1749
|
}),
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto",
|
|
1749
|
-
children: [
|
|
1750
|
-
canSend:
|
|
1751
|
-
onSend:
|
|
1752
|
-
}) : /* @__PURE__ */ V
|
|
1753
|
-
deployments:
|
|
1754
|
-
selectedDeploymentId:
|
|
1755
|
-
onDeploymentChange:
|
|
1756
|
-
modelSelectorLabels:
|
|
1757
|
-
isStreaming:
|
|
1758
|
-
isMobile:
|
|
1759
|
-
isInputDisabled:
|
|
1760
|
-
isDisabled:
|
|
1761
|
-
style:
|
|
1762
|
-
modelPickerOverlay:
|
|
1750
|
+
/* @__PURE__ */ U("div", {
|
|
1751
|
+
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !$ && "desktop:ms-0"),
|
|
1752
|
+
children: [ue ? ue({
|
|
1753
|
+
canSend: Z,
|
|
1754
|
+
onSend: dt
|
|
1755
|
+
}) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(Dt, {
|
|
1756
|
+
deployments: j,
|
|
1757
|
+
selectedDeploymentId: M,
|
|
1758
|
+
onDeploymentChange: N,
|
|
1759
|
+
modelSelectorLabels: re,
|
|
1760
|
+
isStreaming: a,
|
|
1761
|
+
isMobile: Me,
|
|
1762
|
+
isInputDisabled: F,
|
|
1763
|
+
isDisabled: de,
|
|
1764
|
+
style: Re,
|
|
1765
|
+
modelPickerOverlay: Te,
|
|
1763
1766
|
isPickerOpen: Ne,
|
|
1764
1767
|
onPickerToggle: () => Pe((e) => !e),
|
|
1765
1768
|
onPickerOpenChange: Pe
|
|
1766
|
-
}),
|
|
1767
|
-
onStop:
|
|
1768
|
-
ariaLabel:
|
|
1769
|
-
}) : !
|
|
1770
|
-
onSend:
|
|
1771
|
-
isDisabled:
|
|
1772
|
-
ariaLabel:
|
|
1773
|
-
isExiting:
|
|
1774
|
-
},
|
|
1775
|
-
icon: /* @__PURE__ */
|
|
1769
|
+
}), a && i ? /* @__PURE__ */ H(Ze, {
|
|
1770
|
+
onStop: i,
|
|
1771
|
+
ariaLabel: w
|
|
1772
|
+
}) : !a && ct && /* @__PURE__ */ H(Xe, {
|
|
1773
|
+
onSend: dt,
|
|
1774
|
+
isDisabled: !ut || Je,
|
|
1775
|
+
ariaLabel: C,
|
|
1776
|
+
isExiting: lt
|
|
1777
|
+
}, Q)] }), L && !G.trim() && !lt && /* @__PURE__ */ H(v, {
|
|
1778
|
+
icon: /* @__PURE__ */ H(ae, {
|
|
1776
1779
|
size: f.LG,
|
|
1777
1780
|
"aria-hidden": !0
|
|
1778
1781
|
}),
|
|
1779
|
-
"aria-label":
|
|
1782
|
+
"aria-label": T,
|
|
1780
1783
|
className: "size-8 flex-shrink-0",
|
|
1781
|
-
onClick:
|
|
1782
|
-
disabled:
|
|
1784
|
+
onClick: tt,
|
|
1785
|
+
disabled: F || a
|
|
1783
1786
|
})]
|
|
1784
1787
|
})
|
|
1785
1788
|
]
|
|
@@ -1787,18 +1790,18 @@ var St = {
|
|
|
1787
1790
|
});
|
|
1788
1791
|
}, At = { welcome: "_welcome_n2ph8_1" }, jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
|
|
1789
1792
|
let { colors: l, typography: u } = r ?? {};
|
|
1790
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ U("div", {
|
|
1791
1794
|
style: o({
|
|
1792
1795
|
"--ci-root-bg": l?.background,
|
|
1793
1796
|
"--ci-welcome-color": l?.welcomeText
|
|
1794
1797
|
}),
|
|
1795
1798
|
className: s("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1796
|
-
children: [n && /* @__PURE__ */
|
|
1799
|
+
children: [n && /* @__PURE__ */ H("h1", {
|
|
1797
1800
|
className: s(At.welcome, "m-0 text-center", u?.welcomeClassName),
|
|
1798
1801
|
children: n
|
|
1799
|
-
}), /* @__PURE__ */
|
|
1802
|
+
}), /* @__PURE__ */ H("div", {
|
|
1800
1803
|
className: "relative w-full max-w-[748px]",
|
|
1801
|
-
children: /* @__PURE__ */
|
|
1804
|
+
children: /* @__PURE__ */ H(kt, {
|
|
1802
1805
|
placeholder: t,
|
|
1803
1806
|
isStreaming: e,
|
|
1804
1807
|
isInputDisabled: a,
|
|
@@ -1809,56 +1812,56 @@ var St = {
|
|
|
1809
1812
|
})]
|
|
1810
1813
|
});
|
|
1811
1814
|
}, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "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, hideAttachFile: x = !1, fileAccept: S, maximumAttachmentsAmount: C, onAttachmentsLimitExceeded: w, onDialFileSystemClick: T, dialFileSystemLabel: E, pendingAttachments: D, onPendingAttachmentsConsumed: ee }) => {
|
|
1812
|
-
let O =
|
|
1813
|
-
|
|
1815
|
+
let O = z(null), [k, A] = B([]);
|
|
1816
|
+
L(() => {
|
|
1814
1817
|
v?.length && (A(v), y?.());
|
|
1815
1818
|
}, [v, y]);
|
|
1816
|
-
let [te, ne] =
|
|
1817
|
-
|
|
1818
|
-
},
|
|
1819
|
-
r(e,
|
|
1820
|
-
}, [
|
|
1821
|
-
|
|
1822
|
-
},
|
|
1819
|
+
let [te, ne] = B(e ?? ""), [j, M] = B([]), [N, re] = B(t), ae = j.some((e) => e.status === i.Loading || e.status === i.Error), oe = (te.trim().length > 0 || j.length > 0 || N.length > 0) && !ae, se = (e) => {
|
|
1820
|
+
re((t) => t.filter((t) => t.id !== e));
|
|
1821
|
+
}, P = I((e, t) => {
|
|
1822
|
+
r(e, N, t);
|
|
1823
|
+
}, [N, r]), ce = () => {
|
|
1824
|
+
oe && P(te, j);
|
|
1825
|
+
}, le = I(() => A([]), []), ue = I((e) => {
|
|
1823
1826
|
let t = Array.from(e.target.files ?? []);
|
|
1824
1827
|
t.length !== 0 && (e.target.value = "", A(t));
|
|
1825
|
-
}, []),
|
|
1828
|
+
}, []), F = R(() => T ? [{
|
|
1826
1829
|
key: "dial-fs",
|
|
1827
1830
|
label: E ?? "DIAL file system",
|
|
1828
|
-
icon: /* @__PURE__ */
|
|
1831
|
+
icon: /* @__PURE__ */ H(ie, {
|
|
1829
1832
|
size: l,
|
|
1830
1833
|
"aria-hidden": !0
|
|
1831
1834
|
}),
|
|
1832
1835
|
onClick: T
|
|
1833
1836
|
}] : [], [T, E]);
|
|
1834
|
-
return /* @__PURE__ */
|
|
1837
|
+
return /* @__PURE__ */ U("div", {
|
|
1835
1838
|
className: s("flex w-full flex-col gap-2", _),
|
|
1836
|
-
children: [/* @__PURE__ */
|
|
1839
|
+
children: [/* @__PURE__ */ H(kt, {
|
|
1837
1840
|
message: e,
|
|
1838
1841
|
ariaLabel: u,
|
|
1839
1842
|
isStacked: !0,
|
|
1840
1843
|
hideActionBar: !0,
|
|
1841
1844
|
pendingDropFiles: k,
|
|
1842
|
-
onDropFilesConsumed:
|
|
1843
|
-
onSend:
|
|
1845
|
+
onDropFilesConsumed: le,
|
|
1846
|
+
onSend: P,
|
|
1844
1847
|
onUploadAttachment: a,
|
|
1845
1848
|
onChange: ne,
|
|
1846
|
-
onAttachmentsChange:
|
|
1849
|
+
onAttachmentsChange: M,
|
|
1847
1850
|
removeLabel: d,
|
|
1848
1851
|
retryLabel: f,
|
|
1849
1852
|
className: "max-w-full",
|
|
1850
|
-
prefixAttachments:
|
|
1851
|
-
onRemovePrefixAttachment:
|
|
1853
|
+
prefixAttachments: N,
|
|
1854
|
+
onRemovePrefixAttachment: se,
|
|
1852
1855
|
validateAttachment: b,
|
|
1853
1856
|
maximumAttachmentsAmount: C,
|
|
1854
1857
|
onAttachmentsLimitExceeded: w,
|
|
1855
1858
|
pendingAttachments: D,
|
|
1856
1859
|
onPendingAttachmentsConsumed: ee
|
|
1857
|
-
}), /* @__PURE__ */
|
|
1860
|
+
}), /* @__PURE__ */ U("div", {
|
|
1858
1861
|
className: "flex items-center justify-between",
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1862
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1860
1863
|
className: "flex",
|
|
1861
|
-
children: !x && /* @__PURE__ */ V
|
|
1864
|
+
children: !x && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("input", {
|
|
1862
1865
|
ref: O,
|
|
1863
1866
|
type: "file",
|
|
1864
1867
|
multiple: !0,
|
|
@@ -1866,28 +1869,28 @@ var St = {
|
|
|
1866
1869
|
className: "sr-only",
|
|
1867
1870
|
"aria-hidden": !0,
|
|
1868
1871
|
tabIndex: -1,
|
|
1869
|
-
onChange:
|
|
1870
|
-
}), /* @__PURE__ */
|
|
1872
|
+
onChange: ue
|
|
1873
|
+
}), /* @__PURE__ */ H(Ge, {
|
|
1871
1874
|
onAttachClick: () => O.current?.click(),
|
|
1872
1875
|
attachLabel: m,
|
|
1873
1876
|
addMenuTitle: p,
|
|
1874
1877
|
menuTitle: h,
|
|
1875
1878
|
menuCloseLabel: g,
|
|
1876
|
-
extraMenuItems:
|
|
1879
|
+
extraMenuItems: F
|
|
1877
1880
|
})] })
|
|
1878
|
-
}), /* @__PURE__ */
|
|
1881
|
+
}), /* @__PURE__ */ U("div", {
|
|
1879
1882
|
className: "flex gap-2",
|
|
1880
|
-
children: [/* @__PURE__ */
|
|
1883
|
+
children: [/* @__PURE__ */ H(Be, {
|
|
1881
1884
|
label: o,
|
|
1882
1885
|
onClick: n
|
|
1883
|
-
}), /* @__PURE__ */
|
|
1886
|
+
}), /* @__PURE__ */ H(K, {
|
|
1884
1887
|
label: c,
|
|
1885
|
-
onClick:
|
|
1886
|
-
disabled: !
|
|
1888
|
+
onClick: ce,
|
|
1889
|
+
disabled: !oe
|
|
1887
1890
|
})]
|
|
1888
1891
|
})]
|
|
1889
1892
|
})]
|
|
1890
1893
|
});
|
|
1891
1894
|
};
|
|
1892
1895
|
//#endregion
|
|
1893
|
-
export {
|
|
1896
|
+
export { me as AttachmentCard, he as AttachmentGroup, ge as AttachmentTray, W as BottomSheetShell, We as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, ve as FileDndOverlay, kt as Input, Ie as SendOnEnter, xe as getAttachmentIcon };
|