@epam/ai-dial-conversation-input 1.2.0-dev.3 → 1.2.0-dev.34
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/Buttons/SendButton.d.ts +2 -0
- package/components/Input/Buttons/SendButton.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +628 -623
- package/models/ConversationInput.d.ts +1 -1
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +1 -1
- package/models/Input.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, RequestStatus as i, ResponseFormat as a, SELECT_LIST_MAX_HEIGHT_PX as o, buildCssVars as s, mergeClasses as c, useIsMobile as l } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentTray as
|
|
2
|
+
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as M, Tooltip as N } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as re, IconArrowNarrowRight as ie, IconCheck as P, IconChevronDown as F, IconChevronRight as ae, IconFile as oe, IconMicrophone as se, IconPaperclip as ce, IconPlayerStopFilled as I, IconPlaystationSquare as le, IconPlus as ue, IconSettings as de, IconTool as fe, IconX as pe } from "@tabler/icons-react";
|
|
4
|
+
import { createElement as me, memo as he, useCallback as L, useEffect as R, useImperativeHandle as ge, useLayoutEffect as _e, useMemo as z, useRef as B, useState as V } from "react";
|
|
5
|
+
import { createPortal as H } from "react-dom";
|
|
6
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentTray as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ce = (e, t, n) => {
|
|
10
|
+
R(() => {
|
|
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]), R(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
|
-
}, [e]),
|
|
20
|
+
}, [e]), R(() => {
|
|
21
21
|
if (!e || n?.current == null) return;
|
|
22
22
|
let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
23
|
-
(t.querySelector(
|
|
23
|
+
(t.querySelector(Se) ?? t).focus();
|
|
24
24
|
let i = (e) => {
|
|
25
25
|
if (e.key !== "Tab") return;
|
|
26
|
-
let n = Array.from(t.querySelectorAll(
|
|
26
|
+
let n = Array.from(t.querySelectorAll(Se));
|
|
27
27
|
if (n.length === 0) {
|
|
28
28
|
e.preventDefault(), t.focus();
|
|
29
29
|
return;
|
|
@@ -35,27 +35,27 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
35
35
|
document.removeEventListener("keydown", i), r?.focus();
|
|
36
36
|
};
|
|
37
37
|
}, [e, n]);
|
|
38
|
-
},
|
|
38
|
+
}, we = {
|
|
39
39
|
backdrop: "_backdrop_1d50f_9",
|
|
40
40
|
sheet: "_sheet_1d50f_13",
|
|
41
41
|
"slide-up": "_slide-up_1d50f_1",
|
|
42
42
|
title: "_title_1d50f_18",
|
|
43
43
|
divider: "_divider_1d50f_22"
|
|
44
|
-
},
|
|
44
|
+
}, Te = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
|
|
45
45
|
let y = B(null);
|
|
46
|
-
if (
|
|
46
|
+
if (Ce(e, r, y), !e || typeof document > "u") return null;
|
|
47
47
|
let b = s({
|
|
48
48
|
"--ci-backdrop": h?.backdrop,
|
|
49
49
|
"--ci-sheet-bg": h?.sheetBg,
|
|
50
50
|
"--ci-sheet-text": h?.sheetText,
|
|
51
51
|
"--ci-sheet-divider": h?.divider
|
|
52
52
|
});
|
|
53
|
-
return
|
|
54
|
-
className: c(
|
|
53
|
+
return H(/* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
54
|
+
className: c(we.backdrop, "fixed inset-0 z-[55]"),
|
|
55
55
|
style: b,
|
|
56
56
|
onPointerDown: r,
|
|
57
57
|
"aria-hidden": !0
|
|
58
|
-
}), /* @__PURE__ */
|
|
58
|
+
}), /* @__PURE__ */ G("div", {
|
|
59
59
|
ref: y,
|
|
60
60
|
role: "dialog",
|
|
61
61
|
"aria-modal": !0,
|
|
@@ -65,14 +65,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
65
65
|
...b,
|
|
66
66
|
...l
|
|
67
67
|
},
|
|
68
|
-
className: c(
|
|
69
|
-
children: [t != null && /* @__PURE__ */
|
|
68
|
+
className: c(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
|
|
69
|
+
children: [t != null && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
|
|
70
70
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
71
71
|
children: [
|
|
72
|
-
i && /* @__PURE__ */
|
|
72
|
+
i && /* @__PURE__ */ W("div", {
|
|
73
73
|
className: "absolute start-4",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
icon: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ W(v, {
|
|
75
|
+
icon: /* @__PURE__ */ W(re, {
|
|
76
76
|
size: p.LG,
|
|
77
77
|
stroke: m,
|
|
78
78
|
className: "rtl:scale-x-[-1]"
|
|
@@ -81,41 +81,41 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
81
81
|
onClick: i
|
|
82
82
|
})
|
|
83
83
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
className: c(
|
|
84
|
+
/* @__PURE__ */ W("span", {
|
|
85
|
+
className: c(we.title, u),
|
|
86
86
|
children: t
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ W("div", {
|
|
89
89
|
className: "absolute end-4 m-2",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ W(f, {
|
|
91
91
|
ariaLabel: n,
|
|
92
92
|
onClose: r,
|
|
93
93
|
size: g.Standard
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
96
|
]
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ W("div", { className: c(we.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ W("div", {
|
|
98
98
|
className: "overflow-y-auto",
|
|
99
99
|
children: _
|
|
100
100
|
})]
|
|
101
101
|
})] }), document.body);
|
|
102
|
-
},
|
|
102
|
+
}, Ee = async (e, t, n) => {
|
|
103
103
|
let r = 6e4 / t, i = [];
|
|
104
104
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
105
105
|
await Promise.allSettled(i);
|
|
106
|
-
},
|
|
106
|
+
}, De = ({ 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 }) => {
|
|
107
107
|
let [h, g] = V(n), _ = B(h);
|
|
108
|
-
|
|
108
|
+
R(() => {
|
|
109
109
|
_.current = h;
|
|
110
|
-
}, [h]),
|
|
110
|
+
}, [h]), R(() => () => {
|
|
111
111
|
_.current.forEach((e) => {
|
|
112
112
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
113
113
|
});
|
|
114
114
|
}, []);
|
|
115
|
-
let v =
|
|
115
|
+
let v = L((e) => e.map((e) => {
|
|
116
116
|
let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
|
|
117
117
|
return {
|
|
118
|
-
id:
|
|
118
|
+
id: be(),
|
|
119
119
|
name: e.name,
|
|
120
120
|
contentType: e.type,
|
|
121
121
|
file: e,
|
|
@@ -125,25 +125,25 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
125
125
|
playUrl: o
|
|
126
126
|
};
|
|
127
127
|
}), []), y = B(a);
|
|
128
|
-
|
|
128
|
+
R(() => {
|
|
129
129
|
y.current = a;
|
|
130
130
|
}, [a]);
|
|
131
|
-
let b = B(!0), x =
|
|
131
|
+
let b = B(!0), x = L((e) => {
|
|
132
132
|
g((t) => {
|
|
133
133
|
let n = e(t);
|
|
134
134
|
return n === t ? t : n;
|
|
135
135
|
});
|
|
136
136
|
}, []);
|
|
137
|
-
|
|
137
|
+
R(() => {
|
|
138
138
|
if (b.current) {
|
|
139
139
|
b.current = !1;
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
y.current?.(h);
|
|
143
143
|
}, [h]);
|
|
144
|
-
let S =
|
|
144
|
+
let S = L((e) => {
|
|
145
145
|
g(e);
|
|
146
|
-
}, []), C =
|
|
146
|
+
}, []), C = L(async (t) => {
|
|
147
147
|
if (r) {
|
|
148
148
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
149
149
|
...e,
|
|
@@ -166,7 +166,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
166
166
|
} : e));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
}, [r, x]), w =
|
|
169
|
+
}, [r, x]), w = L((e, t = !0) => {
|
|
170
170
|
let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
171
171
|
if (r.length !== 0) {
|
|
172
172
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -187,7 +187,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
187
187
|
status: i.Error,
|
|
188
188
|
errorReason: n
|
|
189
189
|
} : e));
|
|
190
|
-
}),
|
|
190
|
+
}), Ee(e, ye, C);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}, [
|
|
@@ -198,20 +198,20 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
198
198
|
C,
|
|
199
199
|
o
|
|
200
200
|
]);
|
|
201
|
-
|
|
201
|
+
R(() => {
|
|
202
202
|
s.length !== 0 && (w(v(s)), c?.());
|
|
203
203
|
}, [
|
|
204
204
|
w,
|
|
205
205
|
v,
|
|
206
206
|
c,
|
|
207
207
|
s
|
|
208
|
-
]),
|
|
208
|
+
]), R(() => {
|
|
209
209
|
l.length !== 0 && (w(l, !1), u?.());
|
|
210
210
|
}, [
|
|
211
211
|
w,
|
|
212
212
|
u,
|
|
213
213
|
l
|
|
214
|
-
]),
|
|
214
|
+
]), R(() => {
|
|
215
215
|
if (!o) return;
|
|
216
216
|
let t = !1, n = [], r = _.current.map((r) => {
|
|
217
217
|
if (r.status === i.Loading) return r;
|
|
@@ -238,7 +238,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
238
238
|
x,
|
|
239
239
|
C
|
|
240
240
|
]);
|
|
241
|
-
let T =
|
|
241
|
+
let T = L((e) => {
|
|
242
242
|
x((t) => {
|
|
243
243
|
let n = t.find((t) => t.id === e);
|
|
244
244
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -250,11 +250,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
250
250
|
addAttachments: w,
|
|
251
251
|
resetAttachments: S,
|
|
252
252
|
handleRemove: T,
|
|
253
|
-
handleRetry:
|
|
253
|
+
handleRetry: L((e) => {
|
|
254
254
|
let t = h.find((t) => t.id === e);
|
|
255
255
|
t && C(t);
|
|
256
256
|
}, [h, C]),
|
|
257
|
-
handleExpand:
|
|
257
|
+
handleExpand: L(async (e) => {
|
|
258
258
|
let n = h.find((t) => t.id === e);
|
|
259
259
|
if (!n || n.type !== t.Pasted) return;
|
|
260
260
|
let r = await n.file.text();
|
|
@@ -266,43 +266,43 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
266
266
|
]),
|
|
267
267
|
hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
|
|
268
268
|
};
|
|
269
|
-
},
|
|
269
|
+
}, Oe = (e, t) => {
|
|
270
270
|
if (!e.startsWith(t)) return !1;
|
|
271
271
|
let n = e.slice(t.length);
|
|
272
272
|
return !/\s/.test(n) && !n.includes(t);
|
|
273
|
-
},
|
|
274
|
-
let [n, r] = V(!1), [i, a] = V(!1), o = e != null &&
|
|
273
|
+
}, ke = ({ config: e, message: t }) => {
|
|
274
|
+
let [n, r] = V(!1), [i, a] = V(!1), o = e != null && Oe(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = L((n, a, o) => {
|
|
275
275
|
if (e == null || a || t !== "" || i) return;
|
|
276
|
-
let s = n === e.triggerPrefix, c = o === "insertFromPaste" &&
|
|
276
|
+
let s = n === e.triggerPrefix, c = o === "insertFromPaste" && Oe(n, e.triggerPrefix);
|
|
277
277
|
(s || c) && r(!0);
|
|
278
278
|
}, [
|
|
279
279
|
e,
|
|
280
280
|
t,
|
|
281
281
|
i
|
|
282
282
|
]);
|
|
283
|
-
return
|
|
283
|
+
return R(() => {
|
|
284
284
|
if (e == null) {
|
|
285
285
|
r(!1), a(!1);
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
|
|
288
|
+
Oe(t, e.triggerPrefix) || (r(!1), a(!1));
|
|
289
289
|
}, [e, t]), {
|
|
290
290
|
isMenuOpen: n,
|
|
291
291
|
query: o,
|
|
292
|
-
dismiss:
|
|
292
|
+
dismiss: L(() => {
|
|
293
293
|
r(!1), a(!0);
|
|
294
294
|
}, []),
|
|
295
295
|
handleValueChange: s
|
|
296
296
|
};
|
|
297
|
-
},
|
|
297
|
+
}, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
|
|
298
298
|
let t = B(e);
|
|
299
299
|
t.current = e;
|
|
300
|
-
let n = B(-1), r = B(""), i =
|
|
300
|
+
let n = B(-1), r = B(""), i = L((e, i, a) => {
|
|
301
301
|
let o = t.current;
|
|
302
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
303
|
-
}, []), a =
|
|
302
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ae(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 || !je(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
303
|
+
}, []), a = L(() => {
|
|
304
304
|
n.current = -1, r.current = "";
|
|
305
|
-
}, []), o =
|
|
305
|
+
}, []), o = L(() => {
|
|
306
306
|
n.current = -1, r.current = "";
|
|
307
307
|
}, []);
|
|
308
308
|
return z(() => ({
|
|
@@ -314,39 +314,39 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
314
314
|
a,
|
|
315
315
|
o
|
|
316
316
|
]);
|
|
317
|
-
},
|
|
317
|
+
}, Ne = ({ messageProp: e, messageRevision: t }) => {
|
|
318
318
|
let [n, r] = V(e), i = B(null);
|
|
319
|
-
return
|
|
319
|
+
return R(() => {
|
|
320
320
|
r(e);
|
|
321
321
|
}, [e, t]), {
|
|
322
322
|
message: n,
|
|
323
323
|
setMessage: r,
|
|
324
324
|
textareaRef: i
|
|
325
325
|
};
|
|
326
|
-
},
|
|
326
|
+
}, Pe = (e, t, n) => {
|
|
327
327
|
let r = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
328
328
|
r ? r.call(e, t) : e.value = t, e.setSelectionRange(n, n), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
329
|
-
},
|
|
329
|
+
}, Fe = ({ insertion: e, textareaRef: t }) => {
|
|
330
330
|
let n = e?.revision, r = B(e?.text);
|
|
331
331
|
r.current = e?.text;
|
|
332
332
|
let i = B(n);
|
|
333
|
-
|
|
333
|
+
R(() => {
|
|
334
334
|
if (n === i.current) return;
|
|
335
335
|
i.current = n;
|
|
336
336
|
let e = t.current, a = r.current;
|
|
337
337
|
if (!e || !a) return;
|
|
338
338
|
let { value: o, selectionStart: s, selectionEnd: c } = e, l = s ?? o.length, u = c ?? l;
|
|
339
|
-
e.focus(), !(typeof document.execCommand == "function" && document.execCommand("insertText", !1, a)) &&
|
|
339
|
+
e.focus(), !(typeof document.execCommand == "function" && document.execCommand("insertText", !1, a)) && Pe(e, `${o.slice(0, l)}${a}${o.slice(u)}`, l + a.length);
|
|
340
340
|
}, [n, t]);
|
|
341
|
-
},
|
|
341
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
342
342
|
return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
|
|
343
|
-
}({}),
|
|
343
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
344
344
|
return e.Dictation = "dictation", e.Attachment = "attachment", e;
|
|
345
|
-
}({}),
|
|
345
|
+
}({}), Re = [
|
|
346
346
|
"audio/webm;codecs=opus",
|
|
347
347
|
"audio/ogg;codecs=opus",
|
|
348
348
|
"audio/webm"
|
|
349
|
-
],
|
|
349
|
+
], ze = 100, Be = 100, Ve = .01, He = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: r = "Voice input failed" }) => {
|
|
350
350
|
let [i, a] = V("idle"), [o, s] = V(null), c = B(null), l = B(null), u = B({
|
|
351
351
|
onAttachAudio: e,
|
|
352
352
|
onTranscribeAudio: t,
|
|
@@ -359,10 +359,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
359
359
|
onTranscript: n,
|
|
360
360
|
errorLabel: r
|
|
361
361
|
};
|
|
362
|
-
let d =
|
|
362
|
+
let d = L((e = "dictation") => {
|
|
363
363
|
if (l.current) return;
|
|
364
364
|
let t = { controller: new AbortController() };
|
|
365
|
-
l.current = t, a("recording");
|
|
365
|
+
l.current = t, s(null), a("recording");
|
|
366
366
|
let { signal: n } = t.controller, r = e === "dictation" ? u.current.onTranscribeAudio : void 0, i, o, d, f, p = !1, m = !1, h = [], g = () => {
|
|
367
367
|
clearInterval(f), f = void 0;
|
|
368
368
|
}, _ = () => {
|
|
@@ -374,10 +374,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
374
374
|
let v = () => {
|
|
375
375
|
n.aborted || (_(), l.current = null, s(null), a("idle"));
|
|
376
376
|
}, y = (e) => {
|
|
377
|
-
n.aborted || (t.controller.abort(), s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
377
|
+
n.aborted || (t.controller.abort(), l.current = null, s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
378
378
|
}, b = () => {
|
|
379
379
|
if (!i || n.aborted) return;
|
|
380
|
-
let e =
|
|
380
|
+
let e = Re.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(i, e ? { mimeType: e } : void 0);
|
|
381
381
|
d = t;
|
|
382
382
|
let o = Date.now(), s = !1, l = !1, b = new Uint8Array(c.current?.fftSize ?? 256), x = async () => {
|
|
383
383
|
if (!(m || n.aborted)) {
|
|
@@ -385,7 +385,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
385
385
|
try {
|
|
386
386
|
let i = t.mimeType || e || "audio/webm", c = new Blob(h, { type: i });
|
|
387
387
|
h.length = 0, _();
|
|
388
|
-
let d = Date.now() - o >=
|
|
388
|
+
let d = Date.now() - o >= Be;
|
|
389
389
|
if (c.size && (!r || d && (!s || l))) {
|
|
390
390
|
let e = i.split(";")[0].split("/")[1] ?? "webm", t = new File([c], "voice-" + crypto.randomUUID() + "." + e, { type: i });
|
|
391
391
|
if (r) {
|
|
@@ -411,8 +411,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
411
411
|
e.getByteTimeDomainData(b), s = !0;
|
|
412
412
|
let t = 0;
|
|
413
413
|
for (let e of b) t += ((e - 128) / 128) ** 2;
|
|
414
|
-
Math.sqrt(t / b.length) >=
|
|
415
|
-
},
|
|
414
|
+
Math.sqrt(t / b.length) >= Ve && (l = !0, g());
|
|
415
|
+
}, ze));
|
|
416
416
|
};
|
|
417
417
|
t.stop = () => {
|
|
418
418
|
p || n.aborted || (p = !0, g(), a("processing"), d?.state === "recording" && d.stop());
|
|
@@ -430,10 +430,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
430
430
|
y(e);
|
|
431
431
|
}
|
|
432
432
|
})();
|
|
433
|
-
}, []), f =
|
|
433
|
+
}, []), f = L(() => l.current?.stop?.(), []), p = L(() => {
|
|
434
434
|
l.current?.controller.abort(), l.current = null, s(null), a("idle");
|
|
435
435
|
}, []);
|
|
436
|
-
return
|
|
436
|
+
return R(() => () => {
|
|
437
437
|
l.current?.controller.abort(), l.current = null;
|
|
438
438
|
}, []), {
|
|
439
439
|
state: i,
|
|
@@ -443,12 +443,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
443
443
|
stopRecording: f,
|
|
444
444
|
discardRecording: p
|
|
445
445
|
};
|
|
446
|
-
},
|
|
446
|
+
}, Ue = /* @__PURE__ */ function(e) {
|
|
447
447
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
448
|
-
}({}),
|
|
448
|
+
}({}), We = {
|
|
449
449
|
item: "_item_1sr2n_1",
|
|
450
450
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
451
|
-
},
|
|
451
|
+
}, Ge = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: l = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
452
452
|
let m = (e) => {
|
|
453
453
|
e(), r();
|
|
454
454
|
}, h = s({
|
|
@@ -457,7 +457,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
457
457
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
458
458
|
"--ci-sheet-icon": p?.itemIcon
|
|
459
459
|
});
|
|
460
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ W(Te, {
|
|
461
461
|
isOpen: e,
|
|
462
462
|
title: t,
|
|
463
463
|
closeLabel: n,
|
|
@@ -466,23 +466,23 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
466
466
|
className: o,
|
|
467
467
|
titleClassName: l,
|
|
468
468
|
colors: p?.shell,
|
|
469
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ W("ul", {
|
|
470
470
|
role: "list",
|
|
471
471
|
className: "flex flex-col",
|
|
472
472
|
style: h,
|
|
473
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
473
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(d, {
|
|
474
474
|
type: "button",
|
|
475
|
-
className: c(
|
|
476
|
-
iconBefore: /* @__PURE__ */
|
|
477
|
-
className:
|
|
475
|
+
className: c(We.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
476
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
477
|
+
className: We.itemIcon,
|
|
478
478
|
children: n
|
|
479
479
|
}),
|
|
480
|
-
iconAfter: r ? /* @__PURE__ */
|
|
480
|
+
iconAfter: r ? /* @__PURE__ */ W("span", {
|
|
481
481
|
className: "ms-auto",
|
|
482
482
|
children: r
|
|
483
483
|
}) : null,
|
|
484
484
|
textClassName: f,
|
|
485
|
-
label: /* @__PURE__ */
|
|
485
|
+
label: /* @__PURE__ */ W("span", {
|
|
486
486
|
className: u,
|
|
487
487
|
children: t
|
|
488
488
|
}),
|
|
@@ -490,9 +490,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
490
490
|
}) }, e))
|
|
491
491
|
})
|
|
492
492
|
});
|
|
493
|
-
},
|
|
493
|
+
}, Ke = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
494
494
|
let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
|
|
495
|
-
|
|
495
|
+
R(() => {
|
|
496
496
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
497
497
|
}, [
|
|
498
498
|
o,
|
|
@@ -509,7 +509,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
509
509
|
setResponseFormat: c,
|
|
510
510
|
setSystemPrompt: u,
|
|
511
511
|
setTemperature: f,
|
|
512
|
-
handleSubmit:
|
|
512
|
+
handleSubmit: L(() => {
|
|
513
513
|
if (!m) return;
|
|
514
514
|
let t = {};
|
|
515
515
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -523,17 +523,17 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
523
523
|
a
|
|
524
524
|
])
|
|
525
525
|
};
|
|
526
|
-
},
|
|
526
|
+
}, qe = { label: "_label_14i7c_1" }, Je = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
527
527
|
"Precise",
|
|
528
528
|
"Neutral",
|
|
529
529
|
"Creative"
|
|
530
530
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
531
|
-
let S = s({ "--csf-label-text": x?.labelText }), C = c(b,
|
|
532
|
-
return /* @__PURE__ */
|
|
531
|
+
let S = s({ "--csf-label-text": x?.labelText }), C = c(b, qe.label, "gap-1");
|
|
532
|
+
return /* @__PURE__ */ G("div", {
|
|
533
533
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
534
534
|
style: S,
|
|
535
535
|
children: [
|
|
536
|
-
e.responseFormat && /* @__PURE__ */
|
|
536
|
+
e.responseFormat && /* @__PURE__ */ W(E, {
|
|
537
537
|
id: "response-format",
|
|
538
538
|
labelProps: {
|
|
539
539
|
label: d,
|
|
@@ -552,18 +552,18 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
552
552
|
}],
|
|
553
553
|
onChange: (e) => o(e)
|
|
554
554
|
}),
|
|
555
|
-
e.systemPrompt && /* @__PURE__ */
|
|
555
|
+
e.systemPrompt && /* @__PURE__ */ W(ne, {
|
|
556
556
|
value: n,
|
|
557
557
|
placeholder: g,
|
|
558
558
|
className: r,
|
|
559
|
-
resize:
|
|
559
|
+
resize: M.Vertical,
|
|
560
560
|
labelProps: {
|
|
561
561
|
className: C,
|
|
562
562
|
label: h
|
|
563
563
|
},
|
|
564
564
|
onChange: (e) => l(e ?? "")
|
|
565
565
|
}),
|
|
566
|
-
e.temperature && /* @__PURE__ */
|
|
566
|
+
e.temperature && /* @__PURE__ */ W(A, {
|
|
567
567
|
labelProps: {
|
|
568
568
|
label: _,
|
|
569
569
|
className: C,
|
|
@@ -579,8 +579,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
579
579
|
})
|
|
580
580
|
]
|
|
581
581
|
});
|
|
582
|
-
},
|
|
583
|
-
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } =
|
|
582
|
+
}, K = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, 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 }) => {
|
|
583
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = Ke({
|
|
584
584
|
isOpen: e,
|
|
585
585
|
features: o,
|
|
586
586
|
initialResponseFormat: s,
|
|
@@ -589,7 +589,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
589
589
|
onSave: d,
|
|
590
590
|
onClose: r
|
|
591
591
|
});
|
|
592
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ G(Te, {
|
|
593
593
|
isOpen: e,
|
|
594
594
|
title: f,
|
|
595
595
|
closeLabel: i,
|
|
@@ -597,7 +597,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
597
597
|
onBack: t,
|
|
598
598
|
backLabel: n,
|
|
599
599
|
style: a,
|
|
600
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ W(Je, {
|
|
601
601
|
features: o,
|
|
602
602
|
responseFormat: T,
|
|
603
603
|
systemPrompt: E,
|
|
@@ -614,13 +614,13 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
614
614
|
temperatureLabel: y,
|
|
615
615
|
temperatureLabels: b,
|
|
616
616
|
temperatureHint: x
|
|
617
|
-
}), /* @__PURE__ */
|
|
617
|
+
}), /* @__PURE__ */ W("div", {
|
|
618
618
|
className: c("px-6 py-4 mobile:pb-8"),
|
|
619
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ W(N, {
|
|
620
620
|
tooltip: C,
|
|
621
621
|
hideTooltip: O || !C,
|
|
622
622
|
triggerClassName: "w-full",
|
|
623
|
-
children: /* @__PURE__ */
|
|
623
|
+
children: /* @__PURE__ */ W(w, {
|
|
624
624
|
label: S,
|
|
625
625
|
onClick: te,
|
|
626
626
|
disabled: !O,
|
|
@@ -629,8 +629,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
629
629
|
})
|
|
630
630
|
})]
|
|
631
631
|
});
|
|
632
|
-
},
|
|
633
|
-
let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } =
|
|
632
|
+
}, Ye = { modal: "_modal_kl0h0_1" }, Xe = ({ 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 = Ye.modal }) => {
|
|
633
|
+
let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Ke({
|
|
634
634
|
features: e,
|
|
635
635
|
initialResponseFormat: t,
|
|
636
636
|
initialSystemPrompt: n,
|
|
@@ -638,26 +638,26 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
638
638
|
onSave: i,
|
|
639
639
|
onClose: a
|
|
640
640
|
});
|
|
641
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ W(S, {
|
|
642
642
|
open: !0,
|
|
643
643
|
header: o,
|
|
644
644
|
titleClassName: s,
|
|
645
645
|
size: C.Sm,
|
|
646
646
|
onClose: a,
|
|
647
647
|
className: y,
|
|
648
|
-
footer: /* @__PURE__ */
|
|
648
|
+
footer: /* @__PURE__ */ W("div", {
|
|
649
649
|
className: "flex justify-end px-6 py-4",
|
|
650
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ W(N, {
|
|
651
651
|
tooltip: v,
|
|
652
652
|
hideTooltip: E || !v,
|
|
653
|
-
children: /* @__PURE__ */
|
|
653
|
+
children: /* @__PURE__ */ W(w, {
|
|
654
654
|
label: _,
|
|
655
655
|
onClick: ee,
|
|
656
656
|
disabled: !E
|
|
657
657
|
})
|
|
658
658
|
})
|
|
659
659
|
}),
|
|
660
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ W(Je, {
|
|
661
661
|
features: e,
|
|
662
662
|
responseFormat: b,
|
|
663
663
|
systemPrompt: x,
|
|
@@ -676,10 +676,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
676
676
|
temperatureHint: g
|
|
677
677
|
})
|
|
678
678
|
});
|
|
679
|
-
},
|
|
679
|
+
}, Ze = {
|
|
680
680
|
icon: "_icon_1fv6z_1",
|
|
681
681
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
682
|
-
},
|
|
682
|
+
}, Qe = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: l, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: h }) => /* @__PURE__ */ W(Te, {
|
|
683
683
|
isOpen: e,
|
|
684
684
|
title: o,
|
|
685
685
|
closeLabel: i,
|
|
@@ -687,33 +687,33 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
687
687
|
onBack: t,
|
|
688
688
|
backLabel: n,
|
|
689
689
|
style: a,
|
|
690
|
-
children: /* @__PURE__ */
|
|
690
|
+
children: /* @__PURE__ */ W("ul", {
|
|
691
691
|
role: "menu",
|
|
692
692
|
className: "flex flex-col pb-4",
|
|
693
693
|
style: s({
|
|
694
694
|
"--tbs-icon-text": h?.iconText,
|
|
695
695
|
"--tbs-selected-icon-text": h?.selectedIconText
|
|
696
696
|
}),
|
|
697
|
-
children: l.map((e) => /* @__PURE__ */
|
|
697
|
+
children: l.map((e) => /* @__PURE__ */ W("li", {
|
|
698
698
|
role: "none",
|
|
699
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ W(d, {
|
|
700
700
|
type: "button",
|
|
701
701
|
role: "menuitemcheckbox",
|
|
702
702
|
"aria-checked": e.isSelected,
|
|
703
703
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
704
|
-
iconBefore: /* @__PURE__ */
|
|
705
|
-
className: c("flex items-center",
|
|
704
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
705
|
+
className: c("flex items-center", Ze.icon),
|
|
706
706
|
children: e.icon
|
|
707
707
|
}),
|
|
708
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
709
|
-
className: c("ms-auto",
|
|
710
|
-
children: /* @__PURE__ */
|
|
708
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ W("span", {
|
|
709
|
+
className: c("ms-auto", Ze.selectedIcon),
|
|
710
|
+
children: /* @__PURE__ */ W(P, {
|
|
711
711
|
size: u,
|
|
712
712
|
"aria-hidden": !0,
|
|
713
713
|
stroke: m
|
|
714
714
|
})
|
|
715
715
|
}) : null,
|
|
716
|
-
label: /* @__PURE__ */
|
|
716
|
+
label: /* @__PURE__ */ W("span", {
|
|
717
717
|
className: p,
|
|
718
718
|
children: e.label
|
|
719
719
|
}),
|
|
@@ -721,19 +721,19 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
721
721
|
})
|
|
722
722
|
}, e.id))
|
|
723
723
|
})
|
|
724
|
-
}),
|
|
724
|
+
}), $e = {
|
|
725
725
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
726
726
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
727
|
-
},
|
|
728
|
-
let k = l(), [ee, A] = V(!1), [te, j] = V(!1), [ne,
|
|
727
|
+
}, et = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
|
|
728
|
+
let k = l(), [ee, A] = V(!1), [te, j] = V(!1), [ne, M] = V(!1), [N, re] = V(null), [ie, P] = V(!1), F = z(() => s({
|
|
729
729
|
"--aab-tool-icon": O?.toolIcon,
|
|
730
730
|
"--aab-chevron-icon": O?.chevronIcon
|
|
731
|
-
}), [O?.toolIcon, O?.chevronIcon]),
|
|
731
|
+
}), [O?.toolIcon, O?.chevronIcon]), oe = C.length > 0 && w != null, I = D != null && D.length > 0, le = z(() => C.map((e) => ({
|
|
732
732
|
key: e.id,
|
|
733
733
|
label: e.label,
|
|
734
|
-
icon: /* @__PURE__ */
|
|
735
|
-
style:
|
|
736
|
-
className: c("flex items-center",
|
|
734
|
+
icon: /* @__PURE__ */ W("span", {
|
|
735
|
+
style: F,
|
|
736
|
+
className: c("flex items-center", $e.toolIcon),
|
|
737
737
|
children: e.icon
|
|
738
738
|
}),
|
|
739
739
|
selectable: !0,
|
|
@@ -743,12 +743,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
743
743
|
})), [
|
|
744
744
|
C,
|
|
745
745
|
w,
|
|
746
|
-
|
|
747
|
-
]),
|
|
746
|
+
F
|
|
747
|
+
]), pe = z(() => [
|
|
748
748
|
...e == null ? [] : [{
|
|
749
749
|
key: "attach",
|
|
750
750
|
label: r,
|
|
751
|
-
icon: /* @__PURE__ */
|
|
751
|
+
icon: /* @__PURE__ */ W(ce, {
|
|
752
752
|
size: u,
|
|
753
753
|
"aria-hidden": !0,
|
|
754
754
|
stroke: m
|
|
@@ -756,71 +756,71 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
756
756
|
onClick: e
|
|
757
757
|
}],
|
|
758
758
|
...S ?? [],
|
|
759
|
-
...
|
|
759
|
+
...oe ? [{
|
|
760
760
|
key: "tools",
|
|
761
761
|
label: T,
|
|
762
|
-
icon: /* @__PURE__ */
|
|
762
|
+
icon: /* @__PURE__ */ W(fe, {
|
|
763
763
|
size: u,
|
|
764
764
|
"aria-hidden": !0,
|
|
765
765
|
stroke: m
|
|
766
766
|
}),
|
|
767
767
|
onClick: k ? () => {
|
|
768
|
-
|
|
768
|
+
M(!0), A(!1);
|
|
769
769
|
} : () => void 0,
|
|
770
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
770
|
+
...k ? { iconAfter: /* @__PURE__ */ W(ae, {
|
|
771
771
|
size: u,
|
|
772
772
|
stroke: m,
|
|
773
|
-
style:
|
|
774
|
-
className: c("rtl:scale-x-[-1]",
|
|
773
|
+
style: F,
|
|
774
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
775
775
|
"aria-hidden": !0
|
|
776
|
-
}) } : { children:
|
|
776
|
+
}) } : { children: le }
|
|
777
777
|
}] : [],
|
|
778
778
|
...(D ?? []).map((e) => ({
|
|
779
779
|
key: e.key,
|
|
780
780
|
label: e.title,
|
|
781
781
|
icon: e.icon,
|
|
782
782
|
onClick: k ? () => {
|
|
783
|
-
|
|
783
|
+
re(e.key), A(!1);
|
|
784
784
|
} : () => void 0,
|
|
785
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
785
|
+
...k ? { iconAfter: /* @__PURE__ */ W(ae, {
|
|
786
786
|
size: u,
|
|
787
787
|
stroke: m,
|
|
788
|
-
style:
|
|
789
|
-
className: c("rtl:scale-x-[-1]",
|
|
788
|
+
style: F,
|
|
789
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
790
790
|
"aria-hidden": !0
|
|
791
791
|
}) } : {
|
|
792
792
|
children: [{
|
|
793
793
|
key: `${e.key}-panel`,
|
|
794
794
|
label: ""
|
|
795
795
|
}],
|
|
796
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
796
|
+
renderSubMenu: () => e.renderOverlay(() => P(!1))
|
|
797
797
|
}
|
|
798
798
|
})),
|
|
799
799
|
...t == null ? [] : [{
|
|
800
800
|
key: "record-voice",
|
|
801
801
|
label: n,
|
|
802
|
-
icon: /* @__PURE__ */
|
|
802
|
+
icon: /* @__PURE__ */ W(se, {
|
|
803
803
|
size: u,
|
|
804
804
|
"aria-hidden": !0,
|
|
805
805
|
stroke: m
|
|
806
806
|
}),
|
|
807
807
|
onClick: () => {
|
|
808
|
-
A(!1),
|
|
808
|
+
A(!1), P(!1), t();
|
|
809
809
|
}
|
|
810
810
|
}],
|
|
811
811
|
...x == null ? [] : [{
|
|
812
812
|
key: "chat-settings",
|
|
813
813
|
label: x.menuItemLabel ?? "Chat settings",
|
|
814
|
-
icon: /* @__PURE__ */
|
|
814
|
+
icon: /* @__PURE__ */ W(de, {
|
|
815
815
|
size: u,
|
|
816
816
|
"aria-hidden": !0,
|
|
817
817
|
stroke: m
|
|
818
818
|
}),
|
|
819
|
-
iconAfter: k ? /* @__PURE__ */
|
|
819
|
+
iconAfter: k ? /* @__PURE__ */ W(ae, {
|
|
820
820
|
size: u,
|
|
821
821
|
stroke: m,
|
|
822
|
-
style:
|
|
823
|
-
className: c("rtl:scale-x-[-1]",
|
|
822
|
+
style: F,
|
|
823
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
824
824
|
"aria-hidden": !0
|
|
825
825
|
}) : null,
|
|
826
826
|
onClick: () => j(!0)
|
|
@@ -833,22 +833,22 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
833
833
|
x,
|
|
834
834
|
S,
|
|
835
835
|
k,
|
|
836
|
-
|
|
836
|
+
oe,
|
|
837
837
|
T,
|
|
838
|
-
|
|
838
|
+
le,
|
|
839
839
|
D,
|
|
840
|
-
|
|
840
|
+
F
|
|
841
841
|
]);
|
|
842
|
-
if (
|
|
843
|
-
let
|
|
842
|
+
if (pe.length === 0) return null;
|
|
843
|
+
let me = /* @__PURE__ */ W(h, {
|
|
844
844
|
matchReferenceWidth: !1,
|
|
845
845
|
placement: "bottom-start",
|
|
846
846
|
listClassName: _,
|
|
847
|
-
items:
|
|
848
|
-
open:
|
|
849
|
-
onOpenChange:
|
|
850
|
-
children: /* @__PURE__ */
|
|
851
|
-
icon: /* @__PURE__ */
|
|
847
|
+
items: pe,
|
|
848
|
+
open: I ? ie : void 0,
|
|
849
|
+
onOpenChange: I ? P : void 0,
|
|
850
|
+
children: /* @__PURE__ */ W(v, {
|
|
851
|
+
icon: /* @__PURE__ */ W(ue, {
|
|
852
852
|
size: p.LG,
|
|
853
853
|
"aria-hidden": !0,
|
|
854
854
|
stroke: m
|
|
@@ -858,9 +858,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
858
858
|
disabled: y
|
|
859
859
|
})
|
|
860
860
|
});
|
|
861
|
-
return /* @__PURE__ */ U
|
|
862
|
-
/* @__PURE__ */
|
|
863
|
-
icon: /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ W(U, { children: k ? /* @__PURE__ */ G(U, { children: [
|
|
862
|
+
/* @__PURE__ */ W(v, {
|
|
863
|
+
icon: /* @__PURE__ */ W(ue, {
|
|
864
864
|
size: p.LG,
|
|
865
865
|
"aria-hidden": !0,
|
|
866
866
|
stroke: m
|
|
@@ -871,42 +871,42 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
871
871
|
disabled: y,
|
|
872
872
|
onClick: () => A(!0)
|
|
873
873
|
}),
|
|
874
|
-
/* @__PURE__ */
|
|
874
|
+
/* @__PURE__ */ W(Ge, {
|
|
875
875
|
isOpen: ee,
|
|
876
876
|
title: o,
|
|
877
877
|
closeLabel: d,
|
|
878
878
|
onClose: () => A(!1),
|
|
879
879
|
style: f,
|
|
880
|
-
items:
|
|
880
|
+
items: pe,
|
|
881
881
|
className: "pb-4",
|
|
882
882
|
btnTextClassName: "flex-1"
|
|
883
883
|
}),
|
|
884
|
-
|
|
884
|
+
oe && /* @__PURE__ */ W(Qe, {
|
|
885
885
|
isOpen: ne,
|
|
886
886
|
onBack: () => {
|
|
887
|
-
|
|
887
|
+
M(!1), A(!0);
|
|
888
888
|
},
|
|
889
889
|
backLabel: E,
|
|
890
|
-
onClose: () =>
|
|
890
|
+
onClose: () => M(!1),
|
|
891
891
|
closeLabel: d,
|
|
892
892
|
style: f,
|
|
893
893
|
title: T,
|
|
894
894
|
items: C,
|
|
895
895
|
onToolToggle: w
|
|
896
896
|
}),
|
|
897
|
-
D?.map((e) => /* @__PURE__ */
|
|
898
|
-
isOpen:
|
|
897
|
+
D?.map((e) => /* @__PURE__ */ W(Te, {
|
|
898
|
+
isOpen: N === e.key,
|
|
899
899
|
title: e.title,
|
|
900
900
|
closeLabel: d,
|
|
901
901
|
onBack: () => {
|
|
902
|
-
|
|
902
|
+
re(null), A(!0);
|
|
903
903
|
},
|
|
904
904
|
backLabel: e.backLabel ?? "Back",
|
|
905
|
-
onClose: () =>
|
|
905
|
+
onClose: () => re(null),
|
|
906
906
|
style: f,
|
|
907
|
-
children: e.renderOverlay(() =>
|
|
907
|
+
children: e.renderOverlay(() => re(null))
|
|
908
908
|
}, e.key)),
|
|
909
|
-
x != null && /* @__PURE__ */
|
|
909
|
+
x != null && /* @__PURE__ */ W(K, {
|
|
910
910
|
isOpen: te,
|
|
911
911
|
onBack: () => {
|
|
912
912
|
j(!1), A(!0);
|
|
@@ -933,7 +933,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
933
933
|
saveLabel: x.saveLabel,
|
|
934
934
|
saveDisabledTooltip: x.saveDisabledTooltip
|
|
935
935
|
})
|
|
936
|
-
] }) : /* @__PURE__ */
|
|
936
|
+
] }) : /* @__PURE__ */ G(U, { children: [me, x != null && te && /* @__PURE__ */ W(Xe, {
|
|
937
937
|
features: x.features,
|
|
938
938
|
initialResponseFormat: x.responseFormat ?? a.Markdown,
|
|
939
939
|
initialSystemPrompt: x.systemPrompt,
|
|
@@ -953,13 +953,13 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
953
953
|
saveLabel: x.saveLabel,
|
|
954
954
|
saveDisabledTooltip: x.saveDisabledTooltip
|
|
955
955
|
})] }) });
|
|
956
|
-
},
|
|
956
|
+
}, tt = {
|
|
957
957
|
chip: "_chip_ydmd8_1",
|
|
958
958
|
chipSelected: "_chipSelected_ydmd8_9",
|
|
959
959
|
chipIcon: "_chipIcon_ydmd8_16",
|
|
960
960
|
chipText: "_chipText_ydmd8_19",
|
|
961
961
|
chipClose: "_chipClose_ydmd8_22"
|
|
962
|
-
},
|
|
962
|
+
}, nt = (e) => `Remove ${e}`, rt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = nt, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ W("div", {
|
|
963
963
|
className: "flex flex-wrap items-center gap-2",
|
|
964
964
|
style: s({
|
|
965
965
|
"--ci-chip-bg": o?.chipBg,
|
|
@@ -974,34 +974,34 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
974
974
|
"--ci-chip-close": o?.chipClose,
|
|
975
975
|
"--ci-chip-close-hover": o?.chipCloseHover
|
|
976
976
|
}),
|
|
977
|
-
children: e.map((e) => /* @__PURE__ */
|
|
978
|
-
className: c(
|
|
979
|
-
children: [/* @__PURE__ */
|
|
977
|
+
children: e.map((e) => /* @__PURE__ */ G("div", {
|
|
978
|
+
className: c(tt.chip, e.isSelected && tt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
|
|
979
|
+
children: [/* @__PURE__ */ G("button", {
|
|
980
980
|
type: "button",
|
|
981
981
|
onClick: () => t(e.id),
|
|
982
982
|
"aria-pressed": e.isSelected,
|
|
983
983
|
className: "flex min-w-0 items-center gap-1.5",
|
|
984
|
-
children: [/* @__PURE__ */
|
|
985
|
-
className: c(
|
|
984
|
+
children: [/* @__PURE__ */ W("span", {
|
|
985
|
+
className: c(tt.chipIcon, "shrink-0"),
|
|
986
986
|
"aria-hidden": !0,
|
|
987
987
|
children: e.icon
|
|
988
|
-
}), /* @__PURE__ */
|
|
989
|
-
className: c(
|
|
988
|
+
}), /* @__PURE__ */ W("span", {
|
|
989
|
+
className: c(tt.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
990
990
|
children: e.label
|
|
991
991
|
})]
|
|
992
|
-
}), r && /* @__PURE__ */
|
|
992
|
+
}), r && /* @__PURE__ */ W("button", {
|
|
993
993
|
type: "button",
|
|
994
994
|
onClick: () => n(e.id),
|
|
995
995
|
"aria-label": i(e.label),
|
|
996
|
-
className: c(
|
|
997
|
-
children: /* @__PURE__ */
|
|
996
|
+
className: c(tt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
997
|
+
children: /* @__PURE__ */ W(pe, {
|
|
998
998
|
size: 12,
|
|
999
999
|
"aria-hidden": !0,
|
|
1000
1000
|
stroke: m
|
|
1001
1001
|
})
|
|
1002
1002
|
})]
|
|
1003
1003
|
}, e.id))
|
|
1004
|
-
}),
|
|
1004
|
+
}), q = {
|
|
1005
1005
|
wrapper: "_wrapper_q1jcl_2",
|
|
1006
1006
|
wrapperDisabled: "_wrapperDisabled_q1jcl_9",
|
|
1007
1007
|
textarea: "_textarea_q1jcl_13",
|
|
@@ -1012,34 +1012,34 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1012
1012
|
modelSelectorName: "_modelSelectorName_q1jcl_50",
|
|
1013
1013
|
modelSelectorVersion: "_modelSelectorVersion_q1jcl_53",
|
|
1014
1014
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_q1jcl_62"
|
|
1015
|
-
},
|
|
1015
|
+
}, it = {
|
|
1016
1016
|
wrapperError: "_wrapperError_129ri_1",
|
|
1017
1017
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
1018
1018
|
recordingDot: "_recordingDot_129ri_19",
|
|
1019
1019
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
1020
|
-
},
|
|
1021
|
-
let h = B(null), g = B(new Float32Array(
|
|
1020
|
+
}, at = 3, ot = 4, st = 200, ct = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
|
|
1021
|
+
let h = B(null), g = B(new Float32Array(st)), y = B(0), b = B(0), x = e === Ie.Recording, S = e === Ie.Error, C = e === Ie.Processing, w = L((e) => {
|
|
1022
1022
|
let t = e.getContext("2d");
|
|
1023
1023
|
if (!t) return;
|
|
1024
1024
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1025
1025
|
let { width: n, height: r } = e;
|
|
1026
1026
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1027
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
1027
|
+
let i = Math.min(Math.max(1, Math.floor(n / ot)), st - 1), a = y.current, o = b.current;
|
|
1028
1028
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1029
1029
|
for (let e = 0; e <= i; e++) {
|
|
1030
|
-
let n = ((a - i + e) %
|
|
1031
|
-
t.fillRect(e *
|
|
1030
|
+
let n = ((a - i + e) % st + st) % st, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
1031
|
+
t.fillRect(e * ot, (r - c) / 2, at, c);
|
|
1032
1032
|
}
|
|
1033
1033
|
t.restore();
|
|
1034
1034
|
}, []);
|
|
1035
|
-
|
|
1035
|
+
R(() => {
|
|
1036
1036
|
if (!x) return;
|
|
1037
1037
|
let e = h.current;
|
|
1038
1038
|
if (!e) return;
|
|
1039
1039
|
g.current.fill(0), y.current = 0, b.current = 0;
|
|
1040
1040
|
let n, r = () => {
|
|
1041
|
-
if (b.current += 1, b.current >=
|
|
1042
|
-
b.current -=
|
|
1041
|
+
if (b.current += 1, b.current >= ot) {
|
|
1042
|
+
b.current -= ot;
|
|
1043
1043
|
let e = t.current;
|
|
1044
1044
|
if (e) {
|
|
1045
1045
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -1049,7 +1049,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1049
1049
|
let r = (t[e] - 128) / 128;
|
|
1050
1050
|
n += r * r;
|
|
1051
1051
|
}
|
|
1052
|
-
g.current[y.current %
|
|
1052
|
+
g.current[y.current % st] = Math.sqrt(n / t.length), y.current++;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
w(e), n = requestAnimationFrame(r);
|
|
@@ -1061,7 +1061,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1061
1061
|
x,
|
|
1062
1062
|
t,
|
|
1063
1063
|
w
|
|
1064
|
-
]),
|
|
1064
|
+
]), R(() => {
|
|
1065
1065
|
let e = h.current;
|
|
1066
1066
|
if (!e) return;
|
|
1067
1067
|
let t = new ResizeObserver(() => {
|
|
@@ -1069,11 +1069,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1069
1069
|
});
|
|
1070
1070
|
return t.observe(e), () => t.disconnect();
|
|
1071
1071
|
}, [w]);
|
|
1072
|
-
let E = /* @__PURE__ */
|
|
1072
|
+
let E = /* @__PURE__ */ G("div", {
|
|
1073
1073
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
1074
1074
|
children: [
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
icon: /* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ W(v, {
|
|
1076
|
+
icon: /* @__PURE__ */ W(pe, {
|
|
1077
1077
|
size: p.LG,
|
|
1078
1078
|
"aria-hidden": !0,
|
|
1079
1079
|
stroke: m
|
|
@@ -1082,8 +1082,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1082
1082
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1083
1083
|
onClick: i
|
|
1084
1084
|
}),
|
|
1085
|
-
x && /* @__PURE__ */
|
|
1086
|
-
icon: /* @__PURE__ */
|
|
1085
|
+
x && /* @__PURE__ */ W(T, {
|
|
1086
|
+
icon: /* @__PURE__ */ W(I, {
|
|
1087
1087
|
size: p.LG,
|
|
1088
1088
|
"aria-hidden": !0
|
|
1089
1089
|
}),
|
|
@@ -1092,93 +1092,94 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1092
1092
|
"aria-label": o,
|
|
1093
1093
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
1094
1094
|
}),
|
|
1095
|
-
C && /* @__PURE__ */
|
|
1095
|
+
C && /* @__PURE__ */ W("span", {
|
|
1096
1096
|
className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1097
|
-
children: /* @__PURE__ */
|
|
1097
|
+
children: /* @__PURE__ */ W(te, {
|
|
1098
1098
|
size: 20,
|
|
1099
1099
|
ariaLabel: l
|
|
1100
1100
|
})
|
|
1101
1101
|
})
|
|
1102
1102
|
]
|
|
1103
1103
|
});
|
|
1104
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ G("div", {
|
|
1105
1105
|
className: d,
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1107
1107
|
style: u,
|
|
1108
|
-
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f &&
|
|
1109
|
-
children: [/* @__PURE__ */
|
|
1108
|
+
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && q.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && it.wrapperError),
|
|
1109
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1110
1110
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1111
|
-
children: [x && /* @__PURE__ */
|
|
1112
|
-
className: c(
|
|
1111
|
+
children: [x && /* @__PURE__ */ W("span", {
|
|
1112
|
+
className: c(it.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1113
1113
|
"aria-hidden": !0
|
|
1114
|
-
}), /* @__PURE__ */
|
|
1114
|
+
}), /* @__PURE__ */ W("canvas", {
|
|
1115
1115
|
ref: h,
|
|
1116
1116
|
height: 26,
|
|
1117
1117
|
"aria-hidden": !0,
|
|
1118
|
-
className: c(
|
|
1118
|
+
className: c(it.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1119
1119
|
})]
|
|
1120
|
-
}), /* @__PURE__ */
|
|
1120
|
+
}), /* @__PURE__ */ G("div", {
|
|
1121
1121
|
className: "flex items-center justify-between gap-2",
|
|
1122
|
-
children: [a ?? /* @__PURE__ */
|
|
1122
|
+
children: [a ?? /* @__PURE__ */ W("span", { "aria-hidden": !0 }), E]
|
|
1123
1123
|
})]
|
|
1124
|
-
}), S && n && /* @__PURE__ */
|
|
1124
|
+
}), S && n && /* @__PURE__ */ W("div", {
|
|
1125
1125
|
role: "alert",
|
|
1126
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ W(_, {
|
|
1127
1127
|
text: n,
|
|
1128
1128
|
className: "mt-1 px-1"
|
|
1129
1129
|
})
|
|
1130
1130
|
})]
|
|
1131
1131
|
});
|
|
1132
|
-
}, lt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message" }) => /* @__PURE__ */
|
|
1132
|
+
}, lt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ W(T, {
|
|
1133
1133
|
"aria-label": n,
|
|
1134
1134
|
onClick: () => e?.(),
|
|
1135
1135
|
disabled: t,
|
|
1136
|
-
|
|
1136
|
+
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1137
|
+
icon: /* @__PURE__ */ W(ie, {
|
|
1137
1138
|
size: p.LG,
|
|
1138
1139
|
className: "rtl:scale-x-[-1]",
|
|
1139
1140
|
stroke: m
|
|
1140
1141
|
})
|
|
1141
|
-
}), ut = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */
|
|
1142
|
-
icon: /* @__PURE__ */
|
|
1142
|
+
}), ut = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ W(j, {
|
|
1143
|
+
icon: /* @__PURE__ */ W(le, {
|
|
1143
1144
|
size: p.LG,
|
|
1144
1145
|
stroke: m
|
|
1145
1146
|
}),
|
|
1146
1147
|
onClick: () => e?.(),
|
|
1147
1148
|
"aria-label": t
|
|
1148
|
-
}), dt = ({ size: e = 20 }) => /* @__PURE__ */
|
|
1149
|
+
}), dt = ({ size: e = 20 }) => /* @__PURE__ */ W(k, {
|
|
1149
1150
|
variant: ee.Circular,
|
|
1150
1151
|
width: e,
|
|
1151
1152
|
height: e,
|
|
1152
1153
|
active: !0
|
|
1153
|
-
}), ft = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1154
|
+
}), ft = ({ loadingLabel: e }) => /* @__PURE__ */ G("span", {
|
|
1154
1155
|
className: "flex min-w-0 flex-1 items-center",
|
|
1155
|
-
children: [/* @__PURE__ */
|
|
1156
|
+
children: [/* @__PURE__ */ W(k, {
|
|
1156
1157
|
variant: ee.Text,
|
|
1157
1158
|
width: "100%",
|
|
1158
1159
|
height: 16,
|
|
1159
1160
|
active: !0
|
|
1160
|
-
}), e && /* @__PURE__ */
|
|
1161
|
+
}), e && /* @__PURE__ */ W("span", {
|
|
1161
1162
|
className: "sr-only",
|
|
1162
1163
|
children: e
|
|
1163
1164
|
})]
|
|
1164
|
-
}), pt = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1165
|
+
}), pt = ({ loadingLabel: e }) => /* @__PURE__ */ W("div", {
|
|
1165
1166
|
role: "status",
|
|
1166
1167
|
"aria-label": e,
|
|
1167
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1168
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ G("div", {
|
|
1168
1169
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1169
1170
|
"aria-hidden": "true",
|
|
1170
|
-
children: [/* @__PURE__ */
|
|
1171
|
+
children: [/* @__PURE__ */ W(dt, {}), /* @__PURE__ */ W(ft, {})]
|
|
1171
1172
|
}, t))
|
|
1172
|
-
}),
|
|
1173
|
+
}), mt = (e) => e.displayName ?? e.id, ht = (e, t) => {
|
|
1173
1174
|
let n = t.trim().toLowerCase();
|
|
1174
|
-
return n ? e.filter((e) =>
|
|
1175
|
-
},
|
|
1175
|
+
return n ? e.filter((e) => mt(e).toLowerCase().includes(n)) : e;
|
|
1176
|
+
}, J = (e, t, r, i = 18, a) => /* @__PURE__ */ W(n, {
|
|
1176
1177
|
src: e,
|
|
1177
1178
|
size: i,
|
|
1178
1179
|
labels: { tooltip: a },
|
|
1179
1180
|
initialsName: r
|
|
1180
|
-
}),
|
|
1181
|
-
let [o, l] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = z(() => d ? /* @__PURE__ */
|
|
1181
|
+
}), Y = { searchHeader: "_searchHeader_1728o_1" }, gt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = Y.searchHeader, colors: a }) => {
|
|
1182
|
+
let [o, l] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = z(() => d ? /* @__PURE__ */ W(dt, { size: p.LG }) : J(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1182
1183
|
d,
|
|
1183
1184
|
u,
|
|
1184
1185
|
f,
|
|
@@ -1192,8 +1193,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1192
1193
|
menuItems: z(() => {
|
|
1193
1194
|
if (d) return Array.from({ length: 7 }, (e, t) => ({
|
|
1194
1195
|
key: `__loading-${t}`,
|
|
1195
|
-
icon: /* @__PURE__ */
|
|
1196
|
-
label: /* @__PURE__ */
|
|
1196
|
+
icon: /* @__PURE__ */ W(dt, {}),
|
|
1197
|
+
label: /* @__PURE__ */ W(ft, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1197
1198
|
disabled: !0
|
|
1198
1199
|
}));
|
|
1199
1200
|
if (!e || e.length === 0) {
|
|
@@ -1204,14 +1205,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1204
1205
|
disabled: !0
|
|
1205
1206
|
}] : [];
|
|
1206
1207
|
}
|
|
1207
|
-
return
|
|
1208
|
+
return ht(e, o).map((e) => ({
|
|
1208
1209
|
key: e.id,
|
|
1209
|
-
label: /* @__PURE__ */
|
|
1210
|
-
text:
|
|
1210
|
+
label: /* @__PURE__ */ W(y, {
|
|
1211
|
+
text: mt(e),
|
|
1211
1212
|
query: o,
|
|
1212
1213
|
maxLines: 1
|
|
1213
1214
|
}),
|
|
1214
|
-
icon:
|
|
1215
|
+
icon: J(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1215
1216
|
mark: b.Check,
|
|
1216
1217
|
checked: e.id === t,
|
|
1217
1218
|
onClick: () => n?.(e.id)
|
|
@@ -1224,10 +1225,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1224
1225
|
r,
|
|
1225
1226
|
n
|
|
1226
1227
|
]),
|
|
1227
|
-
menuHeader: z(() => !d && e && e.length > 0 ? /* @__PURE__ */
|
|
1228
|
+
menuHeader: z(() => !d && e && e.length > 0 ? /* @__PURE__ */ W("div", {
|
|
1228
1229
|
style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
|
|
1229
1230
|
className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1230
|
-
children: /* @__PURE__ */
|
|
1231
|
+
children: /* @__PURE__ */ W(O, {
|
|
1231
1232
|
value: o,
|
|
1232
1233
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1233
1234
|
size: g.Small,
|
|
@@ -1246,7 +1247,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1246
1247
|
e || l("");
|
|
1247
1248
|
}
|
|
1248
1249
|
};
|
|
1249
|
-
}, _t = typeof window < "u" ? _e :
|
|
1250
|
+
}, _t = typeof window < "u" ? _e : R;
|
|
1250
1251
|
function vt(e) {
|
|
1251
1252
|
if (e !== void 0) switch (typeof e) {
|
|
1252
1253
|
case "number": return e;
|
|
@@ -1255,7 +1256,7 @@ function vt(e) {
|
|
|
1255
1256
|
break;
|
|
1256
1257
|
}
|
|
1257
1258
|
}
|
|
1258
|
-
function
|
|
1259
|
+
function yt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1259
1260
|
let { styleHeight: s, styleWidth: c } = z(() => ({
|
|
1260
1261
|
styleHeight: vt(o?.height),
|
|
1261
1262
|
styleWidth: vt(o?.width)
|
|
@@ -1292,26 +1293,26 @@ function X({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1292
1293
|
c
|
|
1293
1294
|
]);
|
|
1294
1295
|
}
|
|
1295
|
-
function
|
|
1296
|
+
function bt(e) {
|
|
1296
1297
|
let t = B(() => {
|
|
1297
1298
|
throw Error("Cannot call during render.");
|
|
1298
1299
|
});
|
|
1299
1300
|
return _t(() => {
|
|
1300
1301
|
t.current = e;
|
|
1301
|
-
}, [e]),
|
|
1302
|
+
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1302
1303
|
}
|
|
1303
|
-
var
|
|
1304
|
-
function
|
|
1305
|
-
if (
|
|
1304
|
+
var xt = null;
|
|
1305
|
+
function X(e = !1) {
|
|
1306
|
+
if (xt === null || e) {
|
|
1306
1307
|
let e = document.createElement("div"), t = e.style;
|
|
1307
1308
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1308
1309
|
let n = document.createElement("div"), r = n.style;
|
|
1309
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1310
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? xt = "positive-descending" : (e.scrollLeft = 1, xt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), xt;
|
|
1310
1311
|
}
|
|
1311
|
-
return
|
|
1312
|
+
return xt;
|
|
1312
1313
|
}
|
|
1313
|
-
function
|
|
1314
|
-
if (t === "horizontal" && n) switch (
|
|
1314
|
+
function Z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1315
|
+
if (t === "horizontal" && n) switch (X()) {
|
|
1315
1316
|
case "negative": return -r;
|
|
1316
1317
|
case "positive-descending":
|
|
1317
1318
|
if (e) {
|
|
@@ -1322,26 +1323,26 @@ function bt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1322
1323
|
}
|
|
1323
1324
|
return r;
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
+
function Q(e, t = "Assertion error") {
|
|
1326
1327
|
if (!e) throw console.error(t), Error(t);
|
|
1327
1328
|
}
|
|
1328
|
-
function
|
|
1329
|
+
function St(e, t) {
|
|
1329
1330
|
if (e === t) return !0;
|
|
1330
|
-
if (!!e != !!t || (
|
|
1331
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1331
1332
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1332
1333
|
return !0;
|
|
1333
1334
|
}
|
|
1334
|
-
function
|
|
1335
|
+
function Ct({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1335
1336
|
if (t === 0) return 0;
|
|
1336
1337
|
if (typeof n == "number") return t * n;
|
|
1337
1338
|
{
|
|
1338
1339
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1339
|
-
return
|
|
1340
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1340
1341
|
}
|
|
1341
1342
|
}
|
|
1342
|
-
function
|
|
1343
|
+
function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1343
1344
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1344
|
-
let s =
|
|
1345
|
+
let s = Ct({
|
|
1345
1346
|
cachedBounds: t,
|
|
1346
1347
|
itemCount: r,
|
|
1347
1348
|
itemSize: i
|
|
@@ -1353,7 +1354,7 @@ function Ct({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1353
1354
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1354
1355
|
}
|
|
1355
1356
|
}
|
|
1356
|
-
function
|
|
1357
|
+
function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1357
1358
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1358
1359
|
for (; u < a;) {
|
|
1359
1360
|
let n = e.get(u);
|
|
@@ -1372,11 +1373,11 @@ function wt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1372
1373
|
stopIndexOverscan: l
|
|
1373
1374
|
};
|
|
1374
1375
|
}
|
|
1375
|
-
function
|
|
1376
|
+
function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1376
1377
|
let r = /* @__PURE__ */ new Map();
|
|
1377
1378
|
return {
|
|
1378
1379
|
get(i) {
|
|
1379
|
-
for (
|
|
1380
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1380
1381
|
let e = r.size, a;
|
|
1381
1382
|
switch (typeof n) {
|
|
1382
1383
|
case "function":
|
|
@@ -1392,14 +1393,14 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1392
1393
|
});
|
|
1393
1394
|
else {
|
|
1394
1395
|
let t = r.get(e - 1);
|
|
1395
|
-
|
|
1396
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1396
1397
|
scrollOffset: t.scrollOffset + t.size,
|
|
1397
1398
|
size: a
|
|
1398
1399
|
});
|
|
1399
1400
|
}
|
|
1400
1401
|
}
|
|
1401
1402
|
let a = r.get(i);
|
|
1402
|
-
return
|
|
1403
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1403
1404
|
},
|
|
1404
1405
|
set(e, t) {
|
|
1405
1406
|
r.set(e, t);
|
|
@@ -1409,8 +1410,8 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1409
1410
|
}
|
|
1410
1411
|
};
|
|
1411
1412
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return z(() =>
|
|
1413
|
+
function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1414
|
+
return z(() => Et({
|
|
1414
1415
|
itemCount: e,
|
|
1415
1416
|
itemProps: t,
|
|
1416
1417
|
itemSize: n
|
|
@@ -1420,11 +1421,11 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1420
1421
|
n
|
|
1421
1422
|
]);
|
|
1422
1423
|
}
|
|
1423
|
-
function
|
|
1424
|
+
function Ot({ containerSize: e, itemSize: t }) {
|
|
1424
1425
|
let n;
|
|
1425
1426
|
switch (typeof t) {
|
|
1426
1427
|
case "string":
|
|
1427
|
-
|
|
1428
|
+
Q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1428
1429
|
break;
|
|
1429
1430
|
default:
|
|
1430
1431
|
n = t;
|
|
@@ -1432,8 +1433,8 @@ function Dt({ containerSize: e, itemSize: t }) {
|
|
|
1432
1433
|
}
|
|
1433
1434
|
return n;
|
|
1434
1435
|
}
|
|
1435
|
-
function
|
|
1436
|
-
let { height: u = n, width: d = n } =
|
|
1436
|
+
function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1437
|
+
let { height: u = n, width: d = n } = yt({
|
|
1437
1438
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1438
1439
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1439
1440
|
element: e,
|
|
@@ -1442,7 +1443,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1442
1443
|
}), f = B({
|
|
1443
1444
|
height: 0,
|
|
1444
1445
|
width: 0
|
|
1445
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1446
|
+
}), p = r === "vertical" ? u : d, m = Ot({
|
|
1446
1447
|
containerSize: p,
|
|
1447
1448
|
itemSize: s
|
|
1448
1449
|
});
|
|
@@ -1459,11 +1460,11 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1459
1460
|
c,
|
|
1460
1461
|
d
|
|
1461
1462
|
]);
|
|
1462
|
-
let h =
|
|
1463
|
+
let h = Dt({
|
|
1463
1464
|
itemCount: a,
|
|
1464
1465
|
itemProps: o,
|
|
1465
1466
|
itemSize: m
|
|
1466
|
-
}), g =
|
|
1467
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = V(() => Tt({
|
|
1467
1468
|
cachedBounds: h,
|
|
1468
1469
|
containerScrollOffset: 0,
|
|
1469
1470
|
containerSize: p,
|
|
@@ -1474,7 +1475,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1474
1475
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1475
1476
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1476
1477
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1477
|
-
}, C =
|
|
1478
|
+
}, C = L(() => Ct({
|
|
1478
1479
|
cachedBounds: h,
|
|
1479
1480
|
itemCount: a,
|
|
1480
1481
|
itemSize: m
|
|
@@ -1482,9 +1483,9 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1482
1483
|
h,
|
|
1483
1484
|
a,
|
|
1484
1485
|
m
|
|
1485
|
-
]), w =
|
|
1486
|
+
]), w = L((t) => Tt({
|
|
1486
1487
|
cachedBounds: h,
|
|
1487
|
-
containerScrollOffset:
|
|
1488
|
+
containerScrollOffset: Z({
|
|
1488
1489
|
containerElement: e,
|
|
1489
1490
|
direction: r,
|
|
1490
1491
|
isRtl: i,
|
|
@@ -1512,9 +1513,9 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1512
1513
|
if (!e) return;
|
|
1513
1514
|
let t = () => {
|
|
1514
1515
|
v((t) => {
|
|
1515
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1516
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Tt({
|
|
1516
1517
|
cachedBounds: h,
|
|
1517
|
-
containerScrollOffset:
|
|
1518
|
+
containerScrollOffset: Z({
|
|
1518
1519
|
containerElement: e,
|
|
1519
1520
|
direction: r,
|
|
1520
1521
|
isRtl: i,
|
|
@@ -1524,7 +1525,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1524
1525
|
itemCount: a,
|
|
1525
1526
|
overscanCount: l
|
|
1526
1527
|
});
|
|
1527
|
-
return
|
|
1528
|
+
return St(s, t) ? t : s;
|
|
1528
1529
|
});
|
|
1529
1530
|
};
|
|
1530
1531
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1540,8 +1541,8 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1540
1541
|
]), {
|
|
1541
1542
|
getCellBounds: g,
|
|
1542
1543
|
getEstimatedSize: C,
|
|
1543
|
-
scrollToIndex:
|
|
1544
|
-
let s =
|
|
1544
|
+
scrollToIndex: bt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1545
|
+
let s = wt({
|
|
1545
1546
|
align: t,
|
|
1546
1547
|
cachedBounds: h,
|
|
1547
1548
|
containerScrollOffset: n,
|
|
@@ -1551,14 +1552,14 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1551
1552
|
itemSize: m
|
|
1552
1553
|
});
|
|
1553
1554
|
if (e) {
|
|
1554
|
-
if (s =
|
|
1555
|
+
if (s = Z({
|
|
1555
1556
|
containerElement: e,
|
|
1556
1557
|
direction: r,
|
|
1557
1558
|
isRtl: i,
|
|
1558
1559
|
scrollOffset: s
|
|
1559
1560
|
}), typeof e.scrollTo != "function") {
|
|
1560
1561
|
let e = w(s);
|
|
1561
|
-
|
|
1562
|
+
St(_, e) || v(e);
|
|
1562
1563
|
}
|
|
1563
1564
|
return s;
|
|
1564
1565
|
}
|
|
@@ -1569,19 +1570,19 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1569
1570
|
stopIndexVisible: x
|
|
1570
1571
|
};
|
|
1571
1572
|
}
|
|
1572
|
-
function
|
|
1573
|
+
function At(e) {
|
|
1573
1574
|
return z(() => e, Object.values(e));
|
|
1574
1575
|
}
|
|
1575
|
-
function
|
|
1576
|
+
function jt(e, t) {
|
|
1576
1577
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1577
|
-
return
|
|
1578
|
+
return St(n, a) && St(r, o) && St(i, s);
|
|
1578
1579
|
}
|
|
1579
|
-
function
|
|
1580
|
+
function Mt(e) {
|
|
1580
1581
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1581
1582
|
}
|
|
1582
|
-
var
|
|
1583
|
-
function
|
|
1584
|
-
let m =
|
|
1583
|
+
var Nt = "data-react-window-index";
|
|
1584
|
+
function Pt({ 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 }) {
|
|
1585
|
+
let m = At(u), h = z(() => he(s, jt), [s]), [g, _] = V(null), v = Mt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = kt({
|
|
1585
1586
|
containerElement: g,
|
|
1586
1587
|
containerStyle: f,
|
|
1587
1588
|
defaultContainerSize: n,
|
|
@@ -1592,7 +1593,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1592
1593
|
onResize: i,
|
|
1593
1594
|
overscanCount: o
|
|
1594
1595
|
});
|
|
1595
|
-
|
|
1596
|
+
ge(r, () => ({
|
|
1596
1597
|
get element() {
|
|
1597
1598
|
return g;
|
|
1598
1599
|
},
|
|
@@ -1612,7 +1613,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1612
1613
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1613
1614
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1614
1615
|
let n = `${S + t}`;
|
|
1615
|
-
return e.setAttribute(
|
|
1616
|
+
return e.setAttribute(Nt, n), !0;
|
|
1616
1617
|
});
|
|
1617
1618
|
if (v) return l.observeRowElements(e);
|
|
1618
1619
|
}, [
|
|
@@ -1621,7 +1622,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1621
1622
|
l,
|
|
1622
1623
|
S,
|
|
1623
1624
|
w
|
|
1624
|
-
]),
|
|
1625
|
+
]), R(() => {
|
|
1625
1626
|
S >= 0 && w >= 0 && a && a({
|
|
1626
1627
|
startIndex: C,
|
|
1627
1628
|
stopIndex: T
|
|
@@ -1640,7 +1641,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1640
1641
|
let e = [];
|
|
1641
1642
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1642
1643
|
let n = y(t);
|
|
1643
|
-
e.push(/* @__PURE__ */
|
|
1644
|
+
e.push(/* @__PURE__ */ me(h, {
|
|
1644
1645
|
...m,
|
|
1645
1646
|
ariaAttributes: {
|
|
1646
1647
|
"aria-posinset": t + 1,
|
|
@@ -1667,7 +1668,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1667
1668
|
m,
|
|
1668
1669
|
S,
|
|
1669
1670
|
w
|
|
1670
|
-
]), D = /* @__PURE__ */
|
|
1671
|
+
]), D = /* @__PURE__ */ W("div", {
|
|
1671
1672
|
"aria-hidden": !0,
|
|
1672
1673
|
style: {
|
|
1673
1674
|
height: b(),
|
|
@@ -1675,7 +1676,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1675
1676
|
zIndex: -1
|
|
1676
1677
|
}
|
|
1677
1678
|
});
|
|
1678
|
-
return
|
|
1679
|
+
return me(d, {
|
|
1679
1680
|
role: "list",
|
|
1680
1681
|
...p,
|
|
1681
1682
|
className: t,
|
|
@@ -1689,35 +1690,35 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1689
1690
|
}
|
|
1690
1691
|
}, E, e, D);
|
|
1691
1692
|
}
|
|
1692
|
-
var
|
|
1693
|
+
var Ft = {
|
|
1693
1694
|
divider: "_divider_1tiyp_1",
|
|
1694
1695
|
item: "_item_1tiyp_5",
|
|
1695
1696
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1696
1697
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1697
1698
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1698
|
-
},
|
|
1699
|
-
let l = r[e], u =
|
|
1700
|
-
return /* @__PURE__ */
|
|
1699
|
+
}, It = 44, Lt = 8, Rt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
|
|
1700
|
+
let l = r[e], u = J(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
|
|
1701
|
+
return /* @__PURE__ */ W("div", {
|
|
1701
1702
|
style: t,
|
|
1702
1703
|
...n,
|
|
1703
|
-
children: /* @__PURE__ */
|
|
1704
|
+
children: /* @__PURE__ */ W(d, {
|
|
1704
1705
|
type: "button",
|
|
1705
1706
|
"aria-current": f ? "true" : void 0,
|
|
1706
|
-
className: c(
|
|
1707
|
-
iconBefore: /* @__PURE__ */
|
|
1708
|
-
className:
|
|
1707
|
+
className: c(Ft.item, "h-full w-full gap-3 px-4"),
|
|
1708
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
1709
|
+
className: Ft.itemIcon,
|
|
1709
1710
|
children: u
|
|
1710
1711
|
}),
|
|
1711
|
-
label: /* @__PURE__ */
|
|
1712
|
+
label: /* @__PURE__ */ G("span", {
|
|
1712
1713
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1713
|
-
children: [/* @__PURE__ */
|
|
1714
|
+
children: [/* @__PURE__ */ W(y, {
|
|
1714
1715
|
text: l.displayName ?? l.id,
|
|
1715
1716
|
query: o,
|
|
1716
1717
|
maxLines: 1,
|
|
1717
1718
|
className: c(a, "min-w-0 flex-1 text-start")
|
|
1718
|
-
}), f && /* @__PURE__ */
|
|
1719
|
+
}), f && /* @__PURE__ */ W(P, {
|
|
1719
1720
|
size: p.SM,
|
|
1720
|
-
className:
|
|
1721
|
+
className: Ft.checkIcon,
|
|
1721
1722
|
"aria-hidden": !0,
|
|
1722
1723
|
stroke: m
|
|
1723
1724
|
})]
|
|
@@ -1725,12 +1726,12 @@ var Pt = {
|
|
|
1725
1726
|
onClick: () => s(l.id)
|
|
1726
1727
|
})
|
|
1727
1728
|
});
|
|
1728
|
-
},
|
|
1729
|
+
}, zt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
|
|
1729
1730
|
let [v, y] = V("");
|
|
1730
|
-
|
|
1731
|
+
R(() => {
|
|
1731
1732
|
e || y("");
|
|
1732
1733
|
}, [e]);
|
|
1733
|
-
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1734
|
+
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? ht(a, v) : [], w = (e) => {
|
|
1734
1735
|
l(e), i();
|
|
1735
1736
|
}, T = s({
|
|
1736
1737
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1740,7 +1741,7 @@ var Pt = {
|
|
|
1740
1741
|
"--ci-sheet-icon": _?.itemIcon,
|
|
1741
1742
|
"--ci-check-icon": _?.checkIcon
|
|
1742
1743
|
});
|
|
1743
|
-
return /* @__PURE__ */
|
|
1744
|
+
return /* @__PURE__ */ W(Te, {
|
|
1744
1745
|
isOpen: e,
|
|
1745
1746
|
title: t,
|
|
1746
1747
|
closeLabel: n,
|
|
@@ -1749,28 +1750,28 @@ var Pt = {
|
|
|
1749
1750
|
titleClassName: m,
|
|
1750
1751
|
className: "max-h-[80dvh]",
|
|
1751
1752
|
colors: _?.shell,
|
|
1752
|
-
children: /* @__PURE__ */
|
|
1753
|
+
children: /* @__PURE__ */ G("div", {
|
|
1753
1754
|
className: "contents",
|
|
1754
1755
|
style: T,
|
|
1755
|
-
children: [b && !x && /* @__PURE__ */
|
|
1756
|
+
children: [b && !x && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
1756
1757
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1758
|
+
children: /* @__PURE__ */ W(O, {
|
|
1758
1759
|
value: v,
|
|
1759
1760
|
placeholder: r,
|
|
1760
1761
|
size: g.Standard,
|
|
1761
1762
|
onChange: (e) => y(e ?? "")
|
|
1762
1763
|
})
|
|
1763
|
-
}), /* @__PURE__ */
|
|
1764
|
+
}), /* @__PURE__ */ W("div", { className: c(Ft.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ W(pt, { loadingLabel: u }) : S ? /* @__PURE__ */ W("div", {
|
|
1764
1765
|
role: "list",
|
|
1765
|
-
className: c(
|
|
1766
|
+
className: c(Ft.stateLabel, h, "px-4 py-4"),
|
|
1766
1767
|
children: S
|
|
1767
|
-
}) : /* @__PURE__ */
|
|
1768
|
+
}) : /* @__PURE__ */ W(Pt, {
|
|
1768
1769
|
role: "list",
|
|
1769
1770
|
className: "overflow-y-auto",
|
|
1770
|
-
style: { height: Math.min(C.length,
|
|
1771
|
-
rowComponent:
|
|
1771
|
+
style: { height: Math.min(C.length, Lt) * It },
|
|
1772
|
+
rowComponent: Rt,
|
|
1772
1773
|
rowCount: C.length,
|
|
1773
|
-
rowHeight:
|
|
1774
|
+
rowHeight: It,
|
|
1774
1775
|
rowProps: {
|
|
1775
1776
|
items: C,
|
|
1776
1777
|
selectedDeploymentId: o,
|
|
@@ -1781,7 +1782,7 @@ var Pt = {
|
|
|
1781
1782
|
})]
|
|
1782
1783
|
})
|
|
1783
1784
|
});
|
|
1784
|
-
},
|
|
1785
|
+
}, Bt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
|
|
1785
1786
|
let [_, y] = V(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = gt({
|
|
1786
1787
|
deployments: e,
|
|
1787
1788
|
selectedDeploymentId: t,
|
|
@@ -1789,16 +1790,16 @@ var Pt = {
|
|
|
1789
1790
|
modelSelectorLabels: r
|
|
1790
1791
|
});
|
|
1791
1792
|
if (!e) return null;
|
|
1792
|
-
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */
|
|
1793
|
+
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ W(F, {
|
|
1793
1794
|
size: p.SM,
|
|
1794
|
-
className:
|
|
1795
|
+
className: q.modelSelectorCaret,
|
|
1795
1796
|
"aria-hidden": !0,
|
|
1796
1797
|
stroke: m
|
|
1797
1798
|
});
|
|
1798
|
-
return a ? /* @__PURE__ */
|
|
1799
|
+
return a ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
|
|
1799
1800
|
tooltip: S,
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1801
|
-
icon: /* @__PURE__ */
|
|
1801
|
+
children: /* @__PURE__ */ W(v, {
|
|
1802
|
+
icon: /* @__PURE__ */ G("div", {
|
|
1802
1803
|
className: "flex items-center gap-1",
|
|
1803
1804
|
children: [b, O]
|
|
1804
1805
|
}),
|
|
@@ -1806,16 +1807,16 @@ var Pt = {
|
|
|
1806
1807
|
onClick: () => {
|
|
1807
1808
|
s || y(!0);
|
|
1808
1809
|
},
|
|
1809
|
-
className: c("w-[50px]",
|
|
1810
|
+
className: c("w-[50px]", q.modelSelectorButton, D)
|
|
1810
1811
|
})
|
|
1811
|
-
}), u ? /* @__PURE__ */
|
|
1812
|
+
}), u ? /* @__PURE__ */ W(Te, {
|
|
1812
1813
|
isOpen: _,
|
|
1813
1814
|
title: r?.ariaLabel ?? "Select model",
|
|
1814
1815
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1815
1816
|
onClose: () => y(!1),
|
|
1816
1817
|
style: l,
|
|
1817
1818
|
children: u(() => y(!1))
|
|
1818
|
-
}) : /* @__PURE__ */
|
|
1819
|
+
}) : /* @__PURE__ */ W(zt, {
|
|
1819
1820
|
isOpen: _,
|
|
1820
1821
|
title: r?.ariaLabel ?? "Select model",
|
|
1821
1822
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1828,7 +1829,7 @@ var Pt = {
|
|
|
1828
1829
|
errorLabel: r?.error,
|
|
1829
1830
|
emptyLabel: r?.empty,
|
|
1830
1831
|
style: l
|
|
1831
|
-
})] }) : u ? /* @__PURE__ */
|
|
1832
|
+
})] }) : u ? /* @__PURE__ */ W(h, {
|
|
1832
1833
|
placement: "top-end",
|
|
1833
1834
|
matchReferenceWidth: !1,
|
|
1834
1835
|
open: d,
|
|
@@ -1837,25 +1838,25 @@ var Pt = {
|
|
|
1837
1838
|
outsideClosable: !0,
|
|
1838
1839
|
renderOverlay: () => u(() => g?.(!1)),
|
|
1839
1840
|
listClassName: "!w-[368px] !bg-layer-raised",
|
|
1840
|
-
children: /* @__PURE__ */
|
|
1841
|
+
children: /* @__PURE__ */ W(N, {
|
|
1841
1842
|
tooltip: C ? `${S} · ${C}` : S,
|
|
1842
|
-
children: /* @__PURE__ */
|
|
1843
|
+
children: /* @__PURE__ */ G("button", {
|
|
1843
1844
|
type: "button",
|
|
1844
1845
|
"aria-label": x,
|
|
1845
1846
|
"aria-disabled": s || void 0,
|
|
1846
|
-
className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5",
|
|
1847
|
+
className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", q.modelSelectorButton, D, s && q.modelSelectorButtonDisabled),
|
|
1847
1848
|
onClick: () => {
|
|
1848
1849
|
!i && !s && f?.();
|
|
1849
1850
|
},
|
|
1850
1851
|
children: [
|
|
1851
1852
|
b,
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ G("span", {
|
|
1853
1854
|
className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
|
|
1854
|
-
children: [/* @__PURE__ */
|
|
1855
|
-
className: c("dial-small-text max-w-[180px] shrink-0 truncate",
|
|
1855
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1856
|
+
className: c("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
|
|
1856
1857
|
children: S
|
|
1857
|
-
}), C && /* @__PURE__ */
|
|
1858
|
-
className: c("dial-tiny-text min-w-0 truncate",
|
|
1858
|
+
}), C && /* @__PURE__ */ W("span", {
|
|
1859
|
+
className: c("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
|
|
1859
1860
|
children: C
|
|
1860
1861
|
})]
|
|
1861
1862
|
}),
|
|
@@ -1863,10 +1864,10 @@ var Pt = {
|
|
|
1863
1864
|
]
|
|
1864
1865
|
})
|
|
1865
1866
|
})
|
|
1866
|
-
}) : /* @__PURE__ */
|
|
1867
|
+
}) : /* @__PURE__ */ W("div", {
|
|
1867
1868
|
className: c(s && D),
|
|
1868
1869
|
"aria-disabled": s || void 0,
|
|
1869
|
-
children: /* @__PURE__ */
|
|
1870
|
+
children: /* @__PURE__ */ W(h, {
|
|
1870
1871
|
items: w,
|
|
1871
1872
|
menuHeader: T,
|
|
1872
1873
|
placement: "bottom-end",
|
|
@@ -1875,172 +1876,171 @@ var Pt = {
|
|
|
1875
1876
|
listClassName: "!w-[240px]",
|
|
1876
1877
|
disabled: s,
|
|
1877
1878
|
onOpenChange: s ? void 0 : E,
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1879
|
+
children: /* @__PURE__ */ W(N, {
|
|
1879
1880
|
tooltip: S,
|
|
1880
|
-
children: /* @__PURE__ */
|
|
1881
|
+
children: /* @__PURE__ */ G("button", {
|
|
1881
1882
|
type: "button",
|
|
1882
1883
|
"aria-label": x,
|
|
1883
1884
|
"aria-disabled": s || void 0,
|
|
1884
|
-
className: c("flex items-center gap-1 rounded-full p-1.5",
|
|
1885
|
+
className: c("flex items-center gap-1 rounded-full p-1.5", q.modelSelectorButton, s && q.modelSelectorButtonDisabled),
|
|
1885
1886
|
children: [b, O]
|
|
1886
1887
|
})
|
|
1887
1888
|
})
|
|
1888
1889
|
})
|
|
1889
1890
|
});
|
|
1890
|
-
},
|
|
1891
|
-
let
|
|
1892
|
-
"--ci-bg":
|
|
1893
|
-
"--ci-text":
|
|
1894
|
-
"--ci-border":
|
|
1895
|
-
"--ci-border-focus":
|
|
1896
|
-
"--ci-placeholder":
|
|
1897
|
-
"--ci-text-disabled":
|
|
1898
|
-
"--ci-model-selector-caret-color":
|
|
1899
|
-
"--ci-model-selector-hover-bg":
|
|
1900
|
-
"--ci-model-selector-disabled-color":
|
|
1901
|
-
"--ci-model-selector-name-color":
|
|
1902
|
-
"--ci-model-selector-version-color":
|
|
1903
|
-
"--ci-voice-error":
|
|
1904
|
-
"--ci-voice-waveform":
|
|
1905
|
-
"--ci-voice-accent":
|
|
1906
|
-
"--ci-first-line-indent": Y ? `calc(${
|
|
1891
|
+
}, Vt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, stopLabel: ee, micLabel: A = "Dictate", recordVoiceLabel: te = "Record voice", stopRecordingLabel: j, discardRecordingLabel: ne, colors: M, typography: N, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: P, pendingAttachments: F = [], onPendingAttachmentsConsumed: ae, pasteTextThreshold: ce = 4e3, maxMessageLength: I = 5e4, deployments: le, selectedDeploymentId: ue, onDeploymentChange: de, modelSelectorLabels: fe, initialAttachments: pe = [], hideAddButton: me = !1, hideAttachFile: he = !1, hideActionBar: ge = !1, renderFooterActions: _e, isInputDisabled: H = !1, isModelSelectorDisabled: ye = !1, isSendDisabled: be = !1, isAudioMessageSupported: Se = !1, isVoiceRecordingSupported: Ce = Se, onTranscribeAudio: we, transcribingLabel: Te, voiceErrorLabel: Ee, sendOnEnter: Oe = Ue.Enter, prefixAttachments: Ae = [], onRemovePrefixAttachment: je, chatSettings: Pe, toolsMenuItems: Re, onToolToggle: ze, canRemoveTools: Be = !0, toolsMenuTitle: Ve, toolsBackLabel: We, toolsChipLabels: Ge, menuOverlays: Ke, inlineStartSlot: qe, onInlineStartRemove: Je, commandMenu: K, autoFocus: Ye = !1, messageHistory: Xe, onDialFileSystemClick: Ze, dialFileSystemLabel: Qe, validateAttachment: $e, onAttachmentClick: tt, modelPickerOverlay: nt, maximumAttachmentsAmount: it, onAttachmentsLimitExceeded: at, isAttachmentsEnabled: ot = !0, isTextAttachmentsAllowed: st = !0, usageLimitsSlot: dt, onMessageTooLong: ft }) => {
|
|
1892
|
+
let pt = l(), [mt, ht] = V(!1), J = Me(Xe), Y = qe != null, [gt, _t] = V(null), [vt, yt] = V(0), bt = z(() => s({
|
|
1893
|
+
"--ci-bg": M?.background,
|
|
1894
|
+
"--ci-text": M?.text,
|
|
1895
|
+
"--ci-border": M?.border,
|
|
1896
|
+
"--ci-border-focus": M?.borderFocus,
|
|
1897
|
+
"--ci-placeholder": M?.placeholder,
|
|
1898
|
+
"--ci-text-disabled": M?.textDisabled,
|
|
1899
|
+
"--ci-model-selector-caret-color": M?.modelSelectorCaret,
|
|
1900
|
+
"--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
|
|
1901
|
+
"--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
|
|
1902
|
+
"--ci-model-selector-name-color": M?.modelSelectorName,
|
|
1903
|
+
"--ci-model-selector-version-color": M?.modelSelectorVersion,
|
|
1904
|
+
"--ci-voice-error": M?.voiceError,
|
|
1905
|
+
"--ci-voice-waveform": M?.voiceWaveform,
|
|
1906
|
+
"--ci-voice-accent": M?.voiceAccent,
|
|
1907
|
+
"--ci-first-line-indent": Y ? `calc(${vt}px + 4px)` : void 0
|
|
1907
1908
|
}), [
|
|
1908
|
-
|
|
1909
|
+
M,
|
|
1909
1910
|
Y,
|
|
1910
|
-
|
|
1911
|
-
]),
|
|
1911
|
+
vt
|
|
1912
|
+
]), xt = z(() => Ze ? [{
|
|
1912
1913
|
key: "dial-fs",
|
|
1913
|
-
label:
|
|
1914
|
-
icon: /* @__PURE__ */
|
|
1914
|
+
label: Qe ?? "DIAL file system",
|
|
1915
|
+
icon: /* @__PURE__ */ W(oe, {
|
|
1915
1916
|
size: u,
|
|
1916
1917
|
"aria-hidden": !0,
|
|
1917
1918
|
stroke: m
|
|
1918
1919
|
}),
|
|
1919
|
-
onClick:
|
|
1920
|
-
}] : [], [
|
|
1920
|
+
onClick: Ze
|
|
1921
|
+
}] : [], [Ze, Qe]), { message: X, setMessage: Z, textareaRef: Q } = Ne({
|
|
1921
1922
|
messageProp: e,
|
|
1922
1923
|
messageRevision: t
|
|
1923
1924
|
});
|
|
1924
|
-
|
|
1925
|
+
Fe({
|
|
1925
1926
|
insertion: n,
|
|
1926
1927
|
textareaRef: Q
|
|
1927
1928
|
});
|
|
1928
|
-
let { isMenuOpen:
|
|
1929
|
-
config:
|
|
1929
|
+
let { isMenuOpen: St, query: Ct, dismiss: wt, handleValueChange: Tt } = ke({
|
|
1930
|
+
config: K,
|
|
1930
1931
|
message: X
|
|
1931
|
-
}),
|
|
1932
|
-
if (
|
|
1932
|
+
}), Et = K?.emptyQueryHint != null, Dt = Et && St && Ct === "", Ot = L((e) => {
|
|
1933
|
+
if (K == null || (wt(), !e?.consumeQuery)) return;
|
|
1933
1934
|
Q.current?.focus();
|
|
1934
|
-
let t = `${
|
|
1935
|
+
let t = `${K.triggerPrefix}${Ct}`;
|
|
1935
1936
|
if (!X.startsWith(t)) return;
|
|
1936
1937
|
let n = X.slice(t.length);
|
|
1937
1938
|
Z(n), J.notifyChange(), d?.(n);
|
|
1938
1939
|
}, [
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1940
|
+
K,
|
|
1941
|
+
wt,
|
|
1942
|
+
Ct,
|
|
1942
1943
|
X,
|
|
1943
1944
|
Z,
|
|
1944
1945
|
J,
|
|
1945
1946
|
d,
|
|
1946
1947
|
Q
|
|
1947
1948
|
]);
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
let t = new ResizeObserver((e) => {
|
|
1949
|
+
R(() => {
|
|
1950
|
+
if (gt == null) return;
|
|
1951
|
+
let e = new ResizeObserver((e) => {
|
|
1952
1952
|
let t = e[0];
|
|
1953
|
-
t != null &&
|
|
1953
|
+
t != null && yt(t.contentRect.width);
|
|
1954
1954
|
});
|
|
1955
|
-
return
|
|
1956
|
-
}, [
|
|
1957
|
-
let { attachments:
|
|
1958
|
-
initialAttachments:
|
|
1955
|
+
return e.observe(gt), () => e.disconnect();
|
|
1956
|
+
}, [gt]);
|
|
1957
|
+
let { attachments: kt, buildAttachments: At, addAttachments: jt, resetAttachments: Mt, handleRemove: Nt, handleRetry: Pt, handleExpand: Ft, hasBlockedAttachments: It } = De({
|
|
1958
|
+
initialAttachments: pe,
|
|
1959
1959
|
onUploadAttachment: i,
|
|
1960
1960
|
onAttachmentsChange: f,
|
|
1961
|
-
validateAttachment:
|
|
1961
|
+
validateAttachment: $e,
|
|
1962
1962
|
pendingDropFiles: ie,
|
|
1963
|
-
onDropFilesConsumed:
|
|
1964
|
-
pendingAttachments:
|
|
1965
|
-
onPendingAttachmentsConsumed:
|
|
1966
|
-
onExpandPastedText:
|
|
1963
|
+
onDropFilesConsumed: P,
|
|
1964
|
+
pendingAttachments: F,
|
|
1965
|
+
onPendingAttachmentsConsumed: ae,
|
|
1966
|
+
onExpandPastedText: L((e) => {
|
|
1967
1967
|
Z((t) => t ? `${t}\n${e}` : e);
|
|
1968
1968
|
}, [Z]),
|
|
1969
|
-
maximumAttachmentsAmount:
|
|
1970
|
-
baseAttachmentsAmount:
|
|
1971
|
-
onAttachmentsLimitExceeded:
|
|
1972
|
-
}),
|
|
1973
|
-
|
|
1974
|
-
}, [
|
|
1975
|
-
|
|
1976
|
-
let [
|
|
1969
|
+
maximumAttachmentsAmount: it,
|
|
1970
|
+
baseAttachmentsAmount: Ae.length,
|
|
1971
|
+
onAttachmentsLimitExceeded: at
|
|
1972
|
+
}), Lt = L((e) => {
|
|
1973
|
+
jt(At([e]));
|
|
1974
|
+
}, [jt, At]), Rt = B(!1), zt = B(X);
|
|
1975
|
+
zt.current = X;
|
|
1976
|
+
let [Vt, Ht] = V({
|
|
1977
1977
|
text: "",
|
|
1978
1978
|
revision: 0
|
|
1979
|
-
}), { state:
|
|
1980
|
-
onAttachAudio:
|
|
1981
|
-
onTranscribeAudio:
|
|
1982
|
-
onTranscript:
|
|
1979
|
+
}), { state: Ut, analyserNodeRef: Wt, errorMessage: Gt, startRecording: Kt, stopRecording: qt, discardRecording: Jt } = He({
|
|
1980
|
+
onAttachAudio: Lt,
|
|
1981
|
+
onTranscribeAudio: we,
|
|
1982
|
+
onTranscript: L((e) => {
|
|
1983
1983
|
let t = e.trim();
|
|
1984
1984
|
if (t) {
|
|
1985
|
-
let e =
|
|
1986
|
-
|
|
1985
|
+
let e = zt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
1986
|
+
zt.current = n, Z(n), Ht((e) => ({
|
|
1987
1987
|
text: t,
|
|
1988
1988
|
revision: e.revision + 1
|
|
1989
1989
|
})), J.notifyChange(), d?.(n);
|
|
1990
1990
|
}
|
|
1991
|
-
|
|
1991
|
+
Rt.current = !0;
|
|
1992
1992
|
}, [
|
|
1993
1993
|
Z,
|
|
1994
1994
|
J,
|
|
1995
1995
|
d
|
|
1996
1996
|
]),
|
|
1997
|
-
errorLabel:
|
|
1998
|
-
}),
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
}, [
|
|
2002
|
-
let
|
|
2003
|
-
if (!
|
|
1997
|
+
errorLabel: Ee
|
|
1998
|
+
}), $ = Ut === Ie.Recording || Ut === Ie.Processing;
|
|
1999
|
+
R(() => {
|
|
2000
|
+
(Ut === Ie.Error || Ut === Ie.Idle && Rt.current) && (Rt.current = !1, Q.current?.focus());
|
|
2001
|
+
}, [Ut, Q]);
|
|
2002
|
+
let Yt = B(null), Xt = B(null), Zt = ot && st, { handlePaste: Qt } = xe(jt, Zt ? ce : Infinity), $t = L((e) => {
|
|
2003
|
+
if (!Zt) {
|
|
2004
2004
|
let t = e.clipboardData.getData("text/plain");
|
|
2005
|
-
t.length >=
|
|
2005
|
+
t.length >= I && ft?.(t.length, I);
|
|
2006
2006
|
}
|
|
2007
|
-
|
|
2007
|
+
Qt(e);
|
|
2008
2008
|
}, [
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
]),
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
}, [(
|
|
2017
|
-
let
|
|
2018
|
-
let e =
|
|
2019
|
-
return
|
|
2009
|
+
Zt,
|
|
2010
|
+
I,
|
|
2011
|
+
ft,
|
|
2012
|
+
Qt
|
|
2013
|
+
]), en = (X.trim().length > 0 || kt.length > 0 || Y) && !It && !be && !$, [tn, nn] = V([]);
|
|
2014
|
+
R(() => {
|
|
2015
|
+
nn([]);
|
|
2016
|
+
}, [(Re ?? []).map((e) => e.id).join("|")]);
|
|
2017
|
+
let rn = z(() => {
|
|
2018
|
+
let e = Re ?? [];
|
|
2019
|
+
return Be ? e.filter((e) => e.isSelected || !tn.includes(e.id)) : e;
|
|
2020
2020
|
}, [
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
]),
|
|
2025
|
-
|
|
2026
|
-
}, [
|
|
2027
|
-
if (
|
|
2028
|
-
if (X.length >=
|
|
2029
|
-
|
|
2021
|
+
Re,
|
|
2022
|
+
tn,
|
|
2023
|
+
Be
|
|
2024
|
+
]), an = L((e) => {
|
|
2025
|
+
nn((t) => t.includes(e) ? t : [...t, e]), Re?.find((t) => t.id === e)?.isSelected && ze?.(e);
|
|
2026
|
+
}, [Re, ze]), on = le === void 0 || ue != null, sn = Se && !o, cn = async () => {
|
|
2027
|
+
if (be || $) return;
|
|
2028
|
+
if (X.length >= I) {
|
|
2029
|
+
ft?.(X.length, I);
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
2032
|
-
let e = X, t =
|
|
2032
|
+
let e = X, t = kt;
|
|
2033
2033
|
Z(""), J.reset();
|
|
2034
2034
|
try {
|
|
2035
2035
|
await r?.(e, t), t.forEach((e) => {
|
|
2036
2036
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2037
|
-
}),
|
|
2037
|
+
}), Mt([]);
|
|
2038
2038
|
} catch {
|
|
2039
|
-
Z(e),
|
|
2039
|
+
Z(e), Mt(t);
|
|
2040
2040
|
}
|
|
2041
|
-
},
|
|
2042
|
-
if (
|
|
2043
|
-
if (!e.nativeEvent.isComposing && !
|
|
2041
|
+
}, ln = (e) => {
|
|
2042
|
+
if (!$) {
|
|
2043
|
+
if (!e.nativeEvent.isComposing && !H && !o) {
|
|
2044
2044
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2045
2045
|
let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
|
|
2046
2046
|
if (n !== null) {
|
|
@@ -2048,40 +2048,40 @@ var Pt = {
|
|
|
2048
2048
|
return;
|
|
2049
2049
|
}
|
|
2050
2050
|
}
|
|
2051
|
-
if (e.key === "Backspace" && Y &&
|
|
2052
|
-
e.preventDefault(),
|
|
2051
|
+
if (e.key === "Backspace" && Y && Je != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
|
|
2052
|
+
e.preventDefault(), Je();
|
|
2053
2053
|
return;
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
|
-
e.key === "Enter" && (
|
|
2056
|
+
e.key === "Enter" && (Oe === Ue.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && en && on && !H && cn());
|
|
2057
2057
|
}
|
|
2058
|
-
},
|
|
2058
|
+
}, un = (e) => {
|
|
2059
2059
|
let t = Array.from(e.target.files ?? []);
|
|
2060
2060
|
if (t.length === 0) return;
|
|
2061
|
-
let n =
|
|
2062
|
-
e.target.value = "",
|
|
2063
|
-
},
|
|
2064
|
-
className: c(
|
|
2061
|
+
let n = At(t);
|
|
2062
|
+
e.target.value = "", jt(n);
|
|
2063
|
+
}, dn = /* @__PURE__ */ W("textarea", {
|
|
2064
|
+
className: c(q.textarea, Y && q.textareaIndented, N?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2065
2065
|
ref: Q,
|
|
2066
|
-
autoFocus:
|
|
2066
|
+
autoFocus: Ye,
|
|
2067
2067
|
value: X,
|
|
2068
2068
|
onChange: (e) => {
|
|
2069
2069
|
Z(e.target.value), J.notifyChange();
|
|
2070
2070
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2071
|
-
|
|
2071
|
+
Tt(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
|
|
2072
2072
|
},
|
|
2073
|
-
onKeyDown:
|
|
2074
|
-
onPaste:
|
|
2073
|
+
onKeyDown: ln,
|
|
2074
|
+
onPaste: $t,
|
|
2075
2075
|
placeholder: Y ? void 0 : g,
|
|
2076
|
-
"aria-label":
|
|
2077
|
-
disabled:
|
|
2078
|
-
readOnly:
|
|
2076
|
+
"aria-label": y,
|
|
2077
|
+
disabled: H,
|
|
2078
|
+
readOnly: $,
|
|
2079
2079
|
rows: 1
|
|
2080
|
-
}),
|
|
2080
|
+
}), fn = K == null ? dn : /* @__PURE__ */ W(h, {
|
|
2081
2081
|
className: "w-full",
|
|
2082
|
-
open:
|
|
2082
|
+
open: St,
|
|
2083
2083
|
onOpenChange: (e) => {
|
|
2084
|
-
e ||
|
|
2084
|
+
e || wt();
|
|
2085
2085
|
},
|
|
2086
2086
|
placement: "top-start",
|
|
2087
2087
|
trigger: [],
|
|
@@ -2089,196 +2089,201 @@ var Pt = {
|
|
|
2089
2089
|
matchReferenceWidth: !1,
|
|
2090
2090
|
outsidePressIgnoreRef: Q,
|
|
2091
2091
|
renderOverlay: () => {
|
|
2092
|
-
let e =
|
|
2093
|
-
query:
|
|
2094
|
-
close:
|
|
2092
|
+
let e = K.renderMenu({
|
|
2093
|
+
query: Ct,
|
|
2094
|
+
close: Ot
|
|
2095
2095
|
});
|
|
2096
|
-
return
|
|
2096
|
+
return K.menuLabel == null ? e : /* @__PURE__ */ W("div", {
|
|
2097
2097
|
role: "group",
|
|
2098
|
-
"aria-label":
|
|
2098
|
+
"aria-label": K.menuLabel,
|
|
2099
2099
|
children: e
|
|
2100
2100
|
});
|
|
2101
2101
|
},
|
|
2102
|
-
children:
|
|
2103
|
-
}),
|
|
2102
|
+
children: dn
|
|
2103
|
+
}), pn = Y || Et ? /* @__PURE__ */ G("div", {
|
|
2104
2104
|
className: "relative w-full",
|
|
2105
2105
|
children: [
|
|
2106
|
-
Y && /* @__PURE__ */
|
|
2107
|
-
ref:
|
|
2106
|
+
Y && /* @__PURE__ */ W("div", {
|
|
2107
|
+
ref: _t,
|
|
2108
2108
|
className: "absolute start-0 top-0",
|
|
2109
|
-
children:
|
|
2109
|
+
children: qe
|
|
2110
2110
|
}),
|
|
2111
|
-
|
|
2112
|
-
className: c(
|
|
2111
|
+
Dt && K != null && /* @__PURE__ */ G("span", {
|
|
2112
|
+
className: c(q.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", N?.fontClassName || "dial-body-paragraph-text"),
|
|
2113
2113
|
"aria-hidden": !0,
|
|
2114
|
-
children: [/* @__PURE__ */
|
|
2114
|
+
children: [/* @__PURE__ */ W("span", {
|
|
2115
2115
|
className: "invisible",
|
|
2116
|
-
children:
|
|
2117
|
-
}),
|
|
2116
|
+
children: K.triggerPrefix
|
|
2117
|
+
}), K.emptyQueryHint]
|
|
2118
2118
|
}),
|
|
2119
|
-
|
|
2119
|
+
fn
|
|
2120
2120
|
]
|
|
2121
|
-
}) :
|
|
2122
|
-
onAttachClick:
|
|
2123
|
-
attachLabel:
|
|
2124
|
-
addMenuTitle:
|
|
2125
|
-
menuTitle:
|
|
2126
|
-
menuCloseLabel:
|
|
2127
|
-
style:
|
|
2128
|
-
isDisabled:
|
|
2129
|
-
chatSettings:
|
|
2130
|
-
extraMenuItems:
|
|
2131
|
-
onRecordVoice:
|
|
2132
|
-
recordVoiceLabel:
|
|
2133
|
-
toolsMenuItems:
|
|
2134
|
-
onToolToggle:
|
|
2135
|
-
toolsMenuTitle:
|
|
2136
|
-
toolsBackLabel:
|
|
2137
|
-
menuOverlays:
|
|
2121
|
+
}) : fn, mn = me ? void 0 : /* @__PURE__ */ W(et, {
|
|
2122
|
+
onAttachClick: he ? void 0 : () => Yt.current?.click(),
|
|
2123
|
+
attachLabel: b,
|
|
2124
|
+
addMenuTitle: S,
|
|
2125
|
+
menuTitle: C,
|
|
2126
|
+
menuCloseLabel: w,
|
|
2127
|
+
style: bt,
|
|
2128
|
+
isDisabled: H || $,
|
|
2129
|
+
chatSettings: Pe,
|
|
2130
|
+
extraMenuItems: xt,
|
|
2131
|
+
onRecordVoice: Ce && ot && !o && !$ ? () => Kt(Le.Attachment) : void 0,
|
|
2132
|
+
recordVoiceLabel: te,
|
|
2133
|
+
toolsMenuItems: Be ? Re : void 0,
|
|
2134
|
+
onToolToggle: ze,
|
|
2135
|
+
toolsMenuTitle: Ve,
|
|
2136
|
+
toolsBackLabel: We,
|
|
2137
|
+
menuOverlays: Ke
|
|
2138
2138
|
});
|
|
2139
|
-
return /* @__PURE__ */
|
|
2140
|
-
ref:
|
|
2141
|
-
style:
|
|
2142
|
-
className: c(
|
|
2139
|
+
return /* @__PURE__ */ G("div", {
|
|
2140
|
+
ref: Xt,
|
|
2141
|
+
style: bt,
|
|
2142
|
+
className: c(q.wrapper, H && q.wrapperDisabled, H && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", kt.length > 6 ? "py-4 ps-4" : "p-4", re),
|
|
2143
2143
|
children: [
|
|
2144
|
-
(
|
|
2145
|
-
attachments: [...
|
|
2144
|
+
(Ae.length > 0 || kt.length > 0) && /* @__PURE__ */ W(ve, {
|
|
2145
|
+
attachments: [...Ae, ...kt],
|
|
2146
2146
|
onRemove: (e) => {
|
|
2147
|
-
|
|
2147
|
+
Ae.some((t) => t.id === e) ? je?.(e) : Nt(e);
|
|
2148
2148
|
},
|
|
2149
|
-
onRetry:
|
|
2150
|
-
onExpand:
|
|
2149
|
+
onRetry: Pt,
|
|
2150
|
+
onExpand: Ft,
|
|
2151
2151
|
labels: {
|
|
2152
|
-
removeLabel:
|
|
2153
|
-
retryLabel:
|
|
2154
|
-
uploadingLabel:
|
|
2152
|
+
removeLabel: T,
|
|
2153
|
+
retryLabel: E,
|
|
2154
|
+
uploadingLabel: D
|
|
2155
2155
|
},
|
|
2156
|
-
onAttachmentClick:
|
|
2157
|
-
let t = [...
|
|
2158
|
-
t != null &&
|
|
2156
|
+
onAttachmentClick: tt == null ? void 0 : (e) => {
|
|
2157
|
+
let t = [...Ae, ...kt].find((t) => t.id === e);
|
|
2158
|
+
t != null && tt(t);
|
|
2159
2159
|
}
|
|
2160
2160
|
}),
|
|
2161
|
-
!
|
|
2162
|
-
ref:
|
|
2161
|
+
!me && /* @__PURE__ */ W("input", {
|
|
2162
|
+
ref: Yt,
|
|
2163
2163
|
type: "file",
|
|
2164
2164
|
multiple: !0,
|
|
2165
|
-
accept:
|
|
2165
|
+
accept: x,
|
|
2166
2166
|
className: "sr-only",
|
|
2167
2167
|
"aria-hidden": !0,
|
|
2168
2168
|
tabIndex: -1,
|
|
2169
|
-
onChange:
|
|
2169
|
+
onChange: un
|
|
2170
2170
|
}),
|
|
2171
|
-
Gt && /* @__PURE__ */
|
|
2171
|
+
Gt && /* @__PURE__ */ W(_, {
|
|
2172
|
+
text: Gt,
|
|
2173
|
+
className: "min-w-0 break-words px-1"
|
|
2174
|
+
}),
|
|
2175
|
+
$ && /* @__PURE__ */ W(ct, {
|
|
2172
2176
|
embedded: !0,
|
|
2173
|
-
state:
|
|
2174
|
-
analyserNodeRef:
|
|
2175
|
-
errorMessage:
|
|
2176
|
-
onStop:
|
|
2177
|
-
onDiscard:
|
|
2178
|
-
attachButton:
|
|
2179
|
-
stopLabel:
|
|
2180
|
-
discardLabel:
|
|
2181
|
-
processingLabel:
|
|
2177
|
+
state: Ut,
|
|
2178
|
+
analyserNodeRef: Wt,
|
|
2179
|
+
errorMessage: Gt,
|
|
2180
|
+
onStop: qt,
|
|
2181
|
+
onDiscard: Jt,
|
|
2182
|
+
attachButton: mn,
|
|
2183
|
+
stopLabel: j,
|
|
2184
|
+
discardLabel: ne,
|
|
2185
|
+
processingLabel: Te
|
|
2182
2186
|
}),
|
|
2183
|
-
|
|
2184
|
-
|
|
2187
|
+
!$ && ge && pn,
|
|
2188
|
+
!$ && !ge && /* @__PURE__ */ G("div", {
|
|
2185
2189
|
className: "flex flex-wrap items-center gap-2",
|
|
2186
2190
|
children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ W("div", {
|
|
2188
2192
|
className: "flex w-full min-w-0 items-center self-stretch",
|
|
2189
|
-
children:
|
|
2193
|
+
children: pn
|
|
2190
2194
|
}),
|
|
2191
|
-
|
|
2195
|
+
mn && /* @__PURE__ */ W("div", {
|
|
2192
2196
|
className: "flex",
|
|
2193
|
-
children:
|
|
2197
|
+
children: mn
|
|
2194
2198
|
}),
|
|
2195
|
-
|
|
2199
|
+
rn.length > 0 && ze != null && /* @__PURE__ */ W("div", {
|
|
2196
2200
|
className: "min-w-0 flex-1",
|
|
2197
|
-
children: /* @__PURE__ */
|
|
2198
|
-
items:
|
|
2199
|
-
onToolToggle:
|
|
2200
|
-
onToolDismiss:
|
|
2201
|
-
canRemove:
|
|
2202
|
-
removeLabel:
|
|
2201
|
+
children: /* @__PURE__ */ W(rt, {
|
|
2202
|
+
items: rn,
|
|
2203
|
+
onToolToggle: ze,
|
|
2204
|
+
onToolDismiss: an,
|
|
2205
|
+
canRemove: Be,
|
|
2206
|
+
removeLabel: Ge?.removeLabel
|
|
2203
2207
|
})
|
|
2204
2208
|
}),
|
|
2205
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ W("div", {
|
|
2206
2210
|
className: "ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2207
|
-
children:
|
|
2208
|
-
canSend:
|
|
2209
|
-
onSend:
|
|
2210
|
-
}) : /* @__PURE__ */
|
|
2211
|
-
|
|
2212
|
-
/* @__PURE__ */
|
|
2211
|
+
children: _e ? _e({
|
|
2212
|
+
canSend: en,
|
|
2213
|
+
onSend: cn
|
|
2214
|
+
}) : /* @__PURE__ */ G(U, { children: [
|
|
2215
|
+
dt,
|
|
2216
|
+
/* @__PURE__ */ W(Bt, {
|
|
2213
2217
|
deployments: le,
|
|
2214
|
-
selectedDeploymentId:
|
|
2215
|
-
onDeploymentChange:
|
|
2216
|
-
modelSelectorLabels:
|
|
2218
|
+
selectedDeploymentId: ue,
|
|
2219
|
+
onDeploymentChange: de,
|
|
2220
|
+
modelSelectorLabels: fe,
|
|
2217
2221
|
isStreaming: o,
|
|
2218
|
-
isMobile:
|
|
2219
|
-
isDisabled:
|
|
2220
|
-
style:
|
|
2221
|
-
modelPickerOverlay:
|
|
2222
|
-
isPickerOpen:
|
|
2223
|
-
onPickerToggle: () =>
|
|
2224
|
-
onPickerOpenChange:
|
|
2222
|
+
isMobile: pt,
|
|
2223
|
+
isDisabled: ye,
|
|
2224
|
+
style: bt,
|
|
2225
|
+
modelPickerOverlay: nt,
|
|
2226
|
+
isPickerOpen: mt,
|
|
2227
|
+
onPickerToggle: () => ht((e) => !e),
|
|
2228
|
+
onPickerOpenChange: ht
|
|
2225
2229
|
}),
|
|
2226
|
-
|
|
2227
|
-
icon: /* @__PURE__ */
|
|
2230
|
+
sn && /* @__PURE__ */ W(v, {
|
|
2231
|
+
icon: /* @__PURE__ */ W(se, {
|
|
2228
2232
|
size: p.LG,
|
|
2229
2233
|
stroke: m,
|
|
2230
2234
|
"aria-hidden": !0
|
|
2231
2235
|
}),
|
|
2232
|
-
"aria-label":
|
|
2233
|
-
tooltipProps: { tooltip:
|
|
2236
|
+
"aria-label": A,
|
|
2237
|
+
tooltipProps: { tooltip: A },
|
|
2234
2238
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2235
|
-
onClick: () =>
|
|
2236
|
-
disabled:
|
|
2239
|
+
onClick: () => Kt(Le.Dictation),
|
|
2240
|
+
disabled: H || o
|
|
2237
2241
|
}),
|
|
2238
|
-
o && a ? /* @__PURE__ */
|
|
2242
|
+
o && a ? /* @__PURE__ */ W(ut, {
|
|
2239
2243
|
onStop: a,
|
|
2240
|
-
ariaLabel:
|
|
2241
|
-
}) : !o && /* @__PURE__ */
|
|
2242
|
-
onSend:
|
|
2243
|
-
isDisabled: !
|
|
2244
|
-
ariaLabel:
|
|
2244
|
+
ariaLabel: ee
|
|
2245
|
+
}) : !o && /* @__PURE__ */ W(lt, {
|
|
2246
|
+
onSend: cn,
|
|
2247
|
+
isDisabled: !on || !en,
|
|
2248
|
+
ariaLabel: O,
|
|
2249
|
+
sendTooltip: k
|
|
2245
2250
|
})
|
|
2246
2251
|
] })
|
|
2247
2252
|
})
|
|
2248
2253
|
]
|
|
2249
2254
|
}),
|
|
2250
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ W("span", {
|
|
2251
2256
|
className: "sr-only",
|
|
2252
2257
|
role: "status",
|
|
2253
2258
|
"aria-live": "polite",
|
|
2254
2259
|
"aria-atomic": "true",
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2260
|
+
children: /* @__PURE__ */ W("span", { children: Vt.text }, Vt.revision)
|
|
2256
2261
|
})
|
|
2257
2262
|
]
|
|
2258
2263
|
});
|
|
2259
|
-
},
|
|
2264
|
+
}, Ht = {
|
|
2260
2265
|
welcome: "_welcome_1icyo_1",
|
|
2261
2266
|
description: "_description_1icyo_5"
|
|
2262
|
-
},
|
|
2267
|
+
}, Ut = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
|
|
2263
2268
|
let { colors: d, typography: f } = i ?? {};
|
|
2264
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ G("div", {
|
|
2265
2270
|
style: s({
|
|
2266
2271
|
"--ci-welcome-color": d?.welcomeText,
|
|
2267
2272
|
"--ci-description-color": d?.descriptionText
|
|
2268
2273
|
}),
|
|
2269
2274
|
className: c("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", a),
|
|
2270
|
-
children: [n && /* @__PURE__ */
|
|
2275
|
+
children: [n && /* @__PURE__ */ G("div", {
|
|
2271
2276
|
className: "flex flex-col items-center gap-4 text-center",
|
|
2272
|
-
children: [/* @__PURE__ */
|
|
2273
|
-
className: c(
|
|
2277
|
+
children: [/* @__PURE__ */ W("h1", {
|
|
2278
|
+
className: c(Ht.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
|
|
2274
2279
|
children: n
|
|
2275
|
-
}), r && /* @__PURE__ */
|
|
2276
|
-
className: c(
|
|
2280
|
+
}), r && /* @__PURE__ */ W("p", {
|
|
2281
|
+
className: c(Ht.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2277
2282
|
children: r
|
|
2278
2283
|
})]
|
|
2279
|
-
}), /* @__PURE__ */
|
|
2284
|
+
}), /* @__PURE__ */ W("div", {
|
|
2280
2285
|
className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2281
|
-
children: /* @__PURE__ */
|
|
2286
|
+
children: /* @__PURE__ */ W(Vt, {
|
|
2282
2287
|
placeholder: t,
|
|
2283
2288
|
isStreaming: e,
|
|
2284
2289
|
isInputDisabled: l,
|
|
@@ -2289,101 +2294,101 @@ var Pt = {
|
|
|
2289
2294
|
})
|
|
2290
2295
|
})]
|
|
2291
2296
|
});
|
|
2292
|
-
},
|
|
2293
|
-
let
|
|
2294
|
-
|
|
2295
|
-
C?.length && (
|
|
2297
|
+
}, Wt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: M, onPendingAttachmentsConsumed: N, onAttachmentClick: re, pasteTextThreshold: ie, maxMessageLength: P = 5e4, onMessageTooLong: F }) => {
|
|
2298
|
+
let ae = B(null), [se, ce] = V([]);
|
|
2299
|
+
R(() => {
|
|
2300
|
+
C?.length && (ce(C), T?.());
|
|
2296
2301
|
}, [C, T]);
|
|
2297
|
-
let [
|
|
2298
|
-
|
|
2299
|
-
}, _e =
|
|
2300
|
-
o(e,
|
|
2301
|
-
}, [
|
|
2302
|
-
if (
|
|
2303
|
-
if (
|
|
2304
|
-
|
|
2302
|
+
let [I, le] = V(e ?? ""), [ue, de] = V([]), [fe, pe] = V(r), me = ue.some((e) => e.status === i.Loading || e.status === i.Error), he = (I.trim().length > 0 || ue.length > 0 || fe.length > 0) && !me, ge = (e) => {
|
|
2303
|
+
pe((t) => t.filter((t) => t.id !== e));
|
|
2304
|
+
}, _e = L((e, t) => {
|
|
2305
|
+
o(e, fe, t);
|
|
2306
|
+
}, [fe, o]), H = () => {
|
|
2307
|
+
if (he) {
|
|
2308
|
+
if (I.length >= P) {
|
|
2309
|
+
F?.(I.length, P);
|
|
2305
2310
|
return;
|
|
2306
2311
|
}
|
|
2307
|
-
_e(
|
|
2312
|
+
_e(I, ue);
|
|
2308
2313
|
}
|
|
2309
|
-
},
|
|
2314
|
+
}, ve = L(() => ce([]), []), ye = L((e) => {
|
|
2310
2315
|
let t = Array.from(e.target.files ?? []);
|
|
2311
|
-
t.length !== 0 && (e.target.value = "",
|
|
2312
|
-
}, []),
|
|
2316
|
+
t.length !== 0 && (e.target.value = "", ce(t));
|
|
2317
|
+
}, []), be = z(() => j ? [{
|
|
2313
2318
|
key: "dial-fs",
|
|
2314
2319
|
label: ne ?? "DIAL file system",
|
|
2315
|
-
icon: /* @__PURE__ */
|
|
2320
|
+
icon: /* @__PURE__ */ W(oe, {
|
|
2316
2321
|
size: u,
|
|
2317
2322
|
"aria-hidden": !0,
|
|
2318
2323
|
stroke: m
|
|
2319
2324
|
}),
|
|
2320
2325
|
onClick: j
|
|
2321
2326
|
}] : [], [j, ne]);
|
|
2322
|
-
return /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ G("div", {
|
|
2323
2328
|
className: c("flex w-full flex-col gap-2", S),
|
|
2324
|
-
children: [/* @__PURE__ */
|
|
2329
|
+
children: [/* @__PURE__ */ W(Vt, {
|
|
2325
2330
|
message: e,
|
|
2326
2331
|
inlineStartSlot: t,
|
|
2327
2332
|
onInlineStartRemove: n,
|
|
2328
2333
|
ariaLabel: f,
|
|
2329
2334
|
hideActionBar: !0,
|
|
2330
|
-
pendingDropFiles:
|
|
2331
|
-
onDropFilesConsumed:
|
|
2335
|
+
pendingDropFiles: se,
|
|
2336
|
+
onDropFilesConsumed: ve,
|
|
2332
2337
|
onSend: _e,
|
|
2333
2338
|
onUploadAttachment: s,
|
|
2334
|
-
onChange:
|
|
2335
|
-
onAttachmentsChange:
|
|
2339
|
+
onChange: le,
|
|
2340
|
+
onAttachmentsChange: de,
|
|
2336
2341
|
removeLabel: p,
|
|
2337
2342
|
retryLabel: h,
|
|
2338
2343
|
uploadingLabel: g,
|
|
2339
2344
|
className: "max-w-full",
|
|
2340
|
-
prefixAttachments:
|
|
2341
|
-
onRemovePrefixAttachment:
|
|
2345
|
+
prefixAttachments: fe,
|
|
2346
|
+
onRemovePrefixAttachment: ge,
|
|
2342
2347
|
validateAttachment: E,
|
|
2343
2348
|
isAttachmentsEnabled: D,
|
|
2344
2349
|
isTextAttachmentsAllowed: O,
|
|
2345
2350
|
maximumAttachmentsAmount: A,
|
|
2346
2351
|
onAttachmentsLimitExceeded: te,
|
|
2347
|
-
pendingAttachments:
|
|
2348
|
-
onPendingAttachmentsConsumed:
|
|
2349
|
-
onAttachmentClick:
|
|
2350
|
-
pasteTextThreshold:
|
|
2351
|
-
maxMessageLength:
|
|
2352
|
-
onMessageTooLong:
|
|
2353
|
-
}), /* @__PURE__ */
|
|
2352
|
+
pendingAttachments: M,
|
|
2353
|
+
onPendingAttachmentsConsumed: N,
|
|
2354
|
+
onAttachmentClick: re,
|
|
2355
|
+
pasteTextThreshold: ie,
|
|
2356
|
+
maxMessageLength: P,
|
|
2357
|
+
onMessageTooLong: F
|
|
2358
|
+
}), /* @__PURE__ */ G("div", {
|
|
2354
2359
|
className: "flex items-center justify-between",
|
|
2355
|
-
children: [/* @__PURE__ */
|
|
2360
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2356
2361
|
className: "flex",
|
|
2357
|
-
children: !k && /* @__PURE__ */
|
|
2358
|
-
ref:
|
|
2362
|
+
children: !k && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("input", {
|
|
2363
|
+
ref: ae,
|
|
2359
2364
|
type: "file",
|
|
2360
2365
|
multiple: !0,
|
|
2361
2366
|
accept: ee,
|
|
2362
2367
|
className: "sr-only",
|
|
2363
2368
|
"aria-hidden": !0,
|
|
2364
2369
|
tabIndex: -1,
|
|
2365
|
-
onChange:
|
|
2366
|
-
}), /* @__PURE__ */
|
|
2367
|
-
onAttachClick: () =>
|
|
2370
|
+
onChange: ye
|
|
2371
|
+
}), /* @__PURE__ */ W(et, {
|
|
2372
|
+
onAttachClick: () => ae.current?.click(),
|
|
2368
2373
|
attachLabel: v,
|
|
2369
2374
|
addMenuTitle: _,
|
|
2370
2375
|
menuTitle: y,
|
|
2371
2376
|
menuCloseLabel: b,
|
|
2372
|
-
extraMenuItems:
|
|
2377
|
+
extraMenuItems: be
|
|
2373
2378
|
})] })
|
|
2374
|
-
}), /* @__PURE__ */
|
|
2379
|
+
}), /* @__PURE__ */ G("div", {
|
|
2375
2380
|
className: "flex gap-2",
|
|
2376
|
-
children: [/* @__PURE__ */
|
|
2381
|
+
children: [/* @__PURE__ */ W(x, {
|
|
2377
2382
|
label: l,
|
|
2378
2383
|
onClick: a
|
|
2379
|
-
}), /* @__PURE__ */
|
|
2384
|
+
}), /* @__PURE__ */ W(w, {
|
|
2380
2385
|
label: d,
|
|
2381
|
-
onClick:
|
|
2382
|
-
disabled: !
|
|
2386
|
+
onClick: H,
|
|
2387
|
+
disabled: !he
|
|
2383
2388
|
})]
|
|
2384
2389
|
})]
|
|
2385
2390
|
})]
|
|
2386
2391
|
});
|
|
2387
2392
|
};
|
|
2388
2393
|
//#endregion
|
|
2389
|
-
export {
|
|
2394
|
+
export { Te as BottomSheetShell, Xe as ChatSettingsModal, Ut as ConversationInput, Wt as EditMessageInput, Vt as Input, Ue as SendOnEnter };
|