@epam/ai-dial-conversation-input 1.3.0-dev.331 → 1.3.0-dev.342
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d, useIsPhone as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b,
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { AttachmentTray as
|
|
5
|
-
import { IconArrowNarrowRight as
|
|
6
|
-
import { Fragment as
|
|
2
|
+
import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b, DropdownOverlayRole as x, ElementSize as S, ErrorText as C, GhostIconButton as w, Highlight as T, LiveRegion as E, LiveRegionElement as D, LiveRegionPoliteness as O, MenuItem as k, MenuItemMark as ee, NeutralButton as A, NeutralIconButton as j, Notification as M, NotificationType as te, NotificationVariant as ne, Popup as re, PopupSize as N, PrimaryButton as P, PrimaryIconButton as F, RadioGroup as I, RadioGroupOrientation as L, Search as ie, Skeleton as ae, SkeletonVariant as R, Slider as z, Spinner as oe, Textarea as se, TextareaResize as ce, ToggleChip as le, Tooltip as ue } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as de, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
4
|
+
import { AttachmentTray as fe, MAX_UPLOADS_PER_MINUTE as pe, generateAttachmentId as me, useClipboardPaste as he } from "@epam/ai-dial-attachment-input";
|
|
5
|
+
import { IconArrowNarrowRight as ge, IconCheck as _e, IconChevronDown as ve, IconChevronRight as ye, IconFile as be, IconMicrophone as xe, IconPaperclip as Se, IconPlayerStop as Ce, IconPlus as we, IconSettings as Te, IconTool as Ee, IconX as De } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as Oe, createElement as ke, forwardRef as Ae, memo as je, useCallback as H, useEffect as U, useId as Me, useImperativeHandle as Ne, useLayoutEffect as Pe, useMemo as W, useRef as G, useState as K, useSyncExternalStore as Fe } from "react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
8
|
var q = {
|
|
9
9
|
wrapper: "dial-ci-wrapper",
|
|
@@ -20,12 +20,12 @@ var q = {
|
|
|
20
20
|
modelMenuItem: "dial-ci-model-menu-item",
|
|
21
21
|
modelMenuItemSelected: "dial-ci-model-menu-item-selected",
|
|
22
22
|
usageBanner: "dial-ci-usage-banner"
|
|
23
|
-
},
|
|
23
|
+
}, Ie = {
|
|
24
24
|
backdrop: "_backdrop_1ym62_8",
|
|
25
25
|
sheet: "_sheet_1ym62_12",
|
|
26
26
|
title: "_title_1ym62_16",
|
|
27
27
|
divider: "_divider_1ym62_20"
|
|
28
|
-
},
|
|
28
|
+
}, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: p, overlayClassName: h, overlayStyle: g, children: _ }) => {
|
|
29
29
|
let v = c({
|
|
30
30
|
"--ci-backdrop": f?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": f?.sheetBg,
|
|
@@ -48,18 +48,18 @@ var q = {
|
|
|
48
48
|
...v,
|
|
49
49
|
...g
|
|
50
50
|
},
|
|
51
|
-
className: l(
|
|
52
|
-
overlayClassName: l(
|
|
51
|
+
className: l(Ie.sheet, d),
|
|
52
|
+
overlayClassName: l(Ie.backdrop, h),
|
|
53
53
|
portalId: p,
|
|
54
|
-
headerClassName:
|
|
55
|
-
titleClassName: l(
|
|
54
|
+
headerClassName: Ie.divider,
|
|
55
|
+
titleClassName: l(Ie.title, u),
|
|
56
56
|
children: _
|
|
57
57
|
});
|
|
58
|
-
},
|
|
58
|
+
}, Re = async (e, t, n) => {
|
|
59
59
|
let r = 6e4 / t, i = [];
|
|
60
60
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
61
61
|
await Promise.allSettled(i);
|
|
62
|
-
},
|
|
62
|
+
}, ze = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
|
|
63
63
|
let [g, _] = K(n), v = G(g);
|
|
64
64
|
U(() => {
|
|
65
65
|
v.current = g;
|
|
@@ -71,7 +71,7 @@ var q = {
|
|
|
71
71
|
let y = H((e) => e.map((e) => {
|
|
72
72
|
let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), i = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
|
|
73
73
|
return {
|
|
74
|
-
id:
|
|
74
|
+
id: me(),
|
|
75
75
|
name: e.name,
|
|
76
76
|
contentType: e.type,
|
|
77
77
|
file: e,
|
|
@@ -139,7 +139,7 @@ var q = {
|
|
|
139
139
|
status: a.Error,
|
|
140
140
|
errorReason: n
|
|
141
141
|
} : e));
|
|
142
|
-
}),
|
|
142
|
+
}), Re(e, pe, w);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}, [
|
|
@@ -224,29 +224,29 @@ var q = {
|
|
|
224
224
|
]),
|
|
225
225
|
hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
|
|
226
226
|
};
|
|
227
|
-
},
|
|
227
|
+
}, Be = (e, t) => {
|
|
228
228
|
let n = t;
|
|
229
229
|
for (; n < e.length && !/\s/.test(e[n]);) n++;
|
|
230
230
|
return n;
|
|
231
|
-
},
|
|
231
|
+
}, Ve = (e, t) => {
|
|
232
232
|
let n = t;
|
|
233
233
|
for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
|
|
234
234
|
return {
|
|
235
235
|
start: n,
|
|
236
|
-
end:
|
|
236
|
+
end: Be(e, n)
|
|
237
237
|
};
|
|
238
|
-
},
|
|
238
|
+
}, He = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Ue = "[role=\"option\"]:not([aria-disabled=\"true\"])", We = /* @__PURE__ */ function(e) {
|
|
239
239
|
return e.Next = "next", e.Previous = "previous", e;
|
|
240
|
-
}({}),
|
|
240
|
+
}({}), Ge = ({ config: e, message: t }) => {
|
|
241
241
|
let [n, r] = K(!1), [i, a] = K(null), [o, s] = K(null), c = G(null);
|
|
242
242
|
c.current = i;
|
|
243
243
|
let l = e != null && i != null && i <= t.length ? (() => {
|
|
244
|
-
let n = t.slice(i,
|
|
245
|
-
return
|
|
244
|
+
let n = t.slice(i, Be(t, i));
|
|
245
|
+
return He(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
|
|
246
246
|
})() : "", u = H((t, n, i) => {
|
|
247
247
|
if (e == null || i) return;
|
|
248
|
-
let { start: c, end: l } =
|
|
249
|
-
|
|
248
|
+
let { start: c, end: l } = Ve(t, n), u = t.slice(c, l);
|
|
249
|
+
He(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
|
|
250
250
|
}, [e, o]);
|
|
251
251
|
U(() => {
|
|
252
252
|
if (e == null) {
|
|
@@ -256,7 +256,7 @@ var q = {
|
|
|
256
256
|
let n = c.current;
|
|
257
257
|
if (n == null) return;
|
|
258
258
|
let i = Math.min(n, t.length);
|
|
259
|
-
|
|
259
|
+
He(t.slice(i, Be(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
|
|
260
260
|
}, [e, t]);
|
|
261
261
|
let d = H(() => {
|
|
262
262
|
r(!1), s(i);
|
|
@@ -264,17 +264,17 @@ var q = {
|
|
|
264
264
|
r(!1);
|
|
265
265
|
}, []), p = H((n) => {
|
|
266
266
|
if (e == null) return;
|
|
267
|
-
let { start: i, end: s } =
|
|
268
|
-
|
|
267
|
+
let { start: i, end: s } = Ve(t, n);
|
|
268
|
+
He(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
|
|
269
269
|
}, [
|
|
270
270
|
e,
|
|
271
271
|
t,
|
|
272
272
|
o
|
|
273
|
-
]), m =
|
|
273
|
+
]), m = Me(), h = G(null), [g, _] = K(null);
|
|
274
274
|
U(() => {
|
|
275
275
|
_(null);
|
|
276
276
|
}, [n, l]);
|
|
277
|
-
let v = H(() => Array.from(h.current?.querySelectorAll(
|
|
277
|
+
let v = H(() => Array.from(h.current?.querySelectorAll(Ue) ?? []), []), y = H((e) => {
|
|
278
278
|
let t = v();
|
|
279
279
|
if (t.length === 0) {
|
|
280
280
|
_(null);
|
|
@@ -297,12 +297,12 @@ var q = {
|
|
|
297
297
|
moveActiveOption: y,
|
|
298
298
|
getActiveOption: b
|
|
299
299
|
};
|
|
300
|
-
},
|
|
300
|
+
}, Ke = (e, t) => !e.slice(0, t).includes("\n"), qe = (e, t) => !e.slice(t).includes("\n"), Je = (e) => {
|
|
301
301
|
let t = G(e);
|
|
302
302
|
t.current = e;
|
|
303
303
|
let n = G(-1), r = G(""), i = H((e, i, a) => {
|
|
304
304
|
let o = t.current;
|
|
305
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
305
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ke(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 || !qe(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
306
306
|
}, []), a = H(() => {
|
|
307
307
|
n.current = -1, r.current = "";
|
|
308
308
|
}, []), o = H(() => {
|
|
@@ -317,7 +317,7 @@ var q = {
|
|
|
317
317
|
a,
|
|
318
318
|
o
|
|
319
319
|
]);
|
|
320
|
-
},
|
|
320
|
+
}, Ye = (e, t, n, r, i) => {
|
|
321
321
|
let a = [...t].sort((e, t) => e.start - t.start), o = [...n].sort((e, t) => e.offset - t.offset), s = [], c = 0, l = 0, u = (t, n) => {
|
|
322
322
|
if (n <= t) return;
|
|
323
323
|
let r = t;
|
|
@@ -343,7 +343,7 @@ var q = {
|
|
|
343
343
|
children: a
|
|
344
344
|
}, `range-${n}`)), c = Math.max(c, t.start + t.length);
|
|
345
345
|
}), u(c, e.length), s;
|
|
346
|
-
},
|
|
346
|
+
}, Xe = (e, t) => {
|
|
347
347
|
let n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode: (e) => e.parentElement?.closest("[data-mirror-synthetic]") == null ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT }), r = 0;
|
|
348
348
|
for (let e = n.nextNode(); e != null; e = n.nextNode()) {
|
|
349
349
|
let n = e.textContent?.length ?? 0;
|
|
@@ -354,12 +354,12 @@ var q = {
|
|
|
354
354
|
r += n;
|
|
355
355
|
}
|
|
356
356
|
return null;
|
|
357
|
-
},
|
|
358
|
-
let r =
|
|
357
|
+
}, Ze = (e, t, n) => {
|
|
358
|
+
let r = Xe(e, t), i = Xe(e, n);
|
|
359
359
|
if (r == null || i == null) return null;
|
|
360
360
|
let a = document.createRange();
|
|
361
361
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
362
|
-
},
|
|
362
|
+
}, Qe = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
|
|
363
363
|
let r = G(null), [i, a] = K([]), o = H(() => {
|
|
364
364
|
let t = e.current, n = r.current;
|
|
365
365
|
if (t == null || n == null) return;
|
|
@@ -371,7 +371,7 @@ var q = {
|
|
|
371
371
|
a((e) => e.length === 0 ? e : []);
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
|
-
let c =
|
|
374
|
+
let c = Ze(i, o, s);
|
|
375
375
|
if (c == null) {
|
|
376
376
|
a((e) => e.length === 0 ? e : []);
|
|
377
377
|
return;
|
|
@@ -379,7 +379,7 @@ var q = {
|
|
|
379
379
|
let l = i.getBoundingClientRect();
|
|
380
380
|
a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top + i.scrollTop, e.width, e.height)));
|
|
381
381
|
}, [n, e]);
|
|
382
|
-
return
|
|
382
|
+
return Pe(() => {
|
|
383
383
|
n && o(), s();
|
|
384
384
|
}, [
|
|
385
385
|
n,
|
|
@@ -405,7 +405,7 @@ var q = {
|
|
|
405
405
|
updateSelectionRects: s,
|
|
406
406
|
syncMirrorToTextarea: o
|
|
407
407
|
};
|
|
408
|
-
},
|
|
408
|
+
}, $e = ({ messageProp: e, messageRevision: t }) => {
|
|
409
409
|
let [n, r] = K(e), i = G(null);
|
|
410
410
|
return U(() => {
|
|
411
411
|
r(e);
|
|
@@ -414,10 +414,10 @@ var q = {
|
|
|
414
414
|
setMessage: r,
|
|
415
415
|
textareaRef: i
|
|
416
416
|
};
|
|
417
|
-
},
|
|
417
|
+
}, et = (e, t, n, r = n) => {
|
|
418
418
|
let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
419
419
|
i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
420
|
-
},
|
|
420
|
+
}, tt = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, nt = ({ insertion: e, textareaRef: t }) => {
|
|
421
421
|
let n = e?.revision, r = G(e?.text);
|
|
422
422
|
r.current = e?.text;
|
|
423
423
|
let i = G(n), a = G(null), o = G(!1);
|
|
@@ -437,7 +437,7 @@ var q = {
|
|
|
437
437
|
let { value: r, selectionStart: i, selectionEnd: s } = n, c = !o.current && r.length > 0 && i === 0 && s === 0, l = c ? r.length : i ?? r.length, u = c ? l : s ?? l;
|
|
438
438
|
if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
|
|
439
439
|
let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
|
|
440
|
-
|
|
440
|
+
et(n, d, l + e.length), a.current = {
|
|
441
441
|
insertedValue: d,
|
|
442
442
|
previousValue: r,
|
|
443
443
|
previousSelectionStart: l,
|
|
@@ -447,21 +447,21 @@ var q = {
|
|
|
447
447
|
}, [n, t]), {
|
|
448
448
|
handleUndoKeyDown: (e) => {
|
|
449
449
|
let n = a.current, r = t.current;
|
|
450
|
-
return n == null || r == null ||
|
|
450
|
+
return n == null || r == null || !tt(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), et(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
|
|
451
451
|
},
|
|
452
452
|
markCaretPlaced: () => {
|
|
453
453
|
o.current = !0;
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
|
-
},
|
|
456
|
+
}, rt = /* @__PURE__ */ function(e) {
|
|
457
457
|
return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
|
|
458
|
-
}({}),
|
|
458
|
+
}({}), it = /* @__PURE__ */ function(e) {
|
|
459
459
|
return e.Dictation = "dictation", e.Attachment = "attachment", e;
|
|
460
|
-
}({}),
|
|
460
|
+
}({}), at = [
|
|
461
461
|
"audio/webm;codecs=opus",
|
|
462
462
|
"audio/ogg;codecs=opus",
|
|
463
463
|
"audio/webm"
|
|
464
|
-
],
|
|
464
|
+
], ot = 100, st = 100, ct = .01, lt = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
|
|
465
465
|
let [a, o] = K("idle"), [s, c] = K(null), l = G(null), d = G(null), f = G({
|
|
466
466
|
onAttachAudio: e,
|
|
467
467
|
onTranscribeAudio: t,
|
|
@@ -492,7 +492,7 @@ var q = {
|
|
|
492
492
|
n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
|
|
493
493
|
}, S = () => {
|
|
494
494
|
if (!a || n.aborted) return;
|
|
495
|
-
let e =
|
|
495
|
+
let e = at.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
|
|
496
496
|
p = t;
|
|
497
497
|
let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
|
|
498
498
|
if (!(g || n.aborted)) {
|
|
@@ -500,7 +500,7 @@ var q = {
|
|
|
500
500
|
try {
|
|
501
501
|
let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
|
|
502
502
|
_.length = 0, y();
|
|
503
|
-
let p = Date.now() - s >=
|
|
503
|
+
let p = Date.now() - s >= st;
|
|
504
504
|
if (l.size && (!i || p && (!c || d))) {
|
|
505
505
|
let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
|
|
506
506
|
if (i) {
|
|
@@ -526,8 +526,8 @@ var q = {
|
|
|
526
526
|
e.getByteTimeDomainData(S), c = !0;
|
|
527
527
|
let t = 0;
|
|
528
528
|
for (let e of S) t += ((e - 128) / 128) ** 2;
|
|
529
|
-
Math.sqrt(t / S.length) >=
|
|
530
|
-
},
|
|
529
|
+
Math.sqrt(t / S.length) >= ct && (d = !0, v());
|
|
530
|
+
}, ot));
|
|
531
531
|
};
|
|
532
532
|
t.stop = () => {
|
|
533
533
|
h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
|
|
@@ -558,14 +558,14 @@ var q = {
|
|
|
558
558
|
stopRecording: m,
|
|
559
559
|
discardRecording: h
|
|
560
560
|
};
|
|
561
|
-
},
|
|
561
|
+
}, ut = /* @__PURE__ */ function(e) {
|
|
562
562
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
563
|
-
}({}),
|
|
563
|
+
}({}), dt = /* @__PURE__ */ function(e) {
|
|
564
564
|
return e.Stacked = "stacked", e.Inline = "inline", e;
|
|
565
|
-
}({}),
|
|
565
|
+
}({}), ft = {
|
|
566
566
|
item: "_item_1sr2n_1",
|
|
567
567
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
568
|
-
},
|
|
568
|
+
}, pt = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
|
|
569
569
|
let p = (e) => {
|
|
570
570
|
e(), r();
|
|
571
571
|
}, m = c({
|
|
@@ -574,7 +574,7 @@ var q = {
|
|
|
574
574
|
"--ci-sheet-item-active": f?.itemActiveBg,
|
|
575
575
|
"--ci-sheet-icon": f?.itemIcon
|
|
576
576
|
});
|
|
577
|
-
return /* @__PURE__ */ B(
|
|
577
|
+
return /* @__PURE__ */ B(Le, {
|
|
578
578
|
isOpen: e,
|
|
579
579
|
title: t,
|
|
580
580
|
closeLabel: n,
|
|
@@ -589,9 +589,9 @@ var q = {
|
|
|
589
589
|
style: m,
|
|
590
590
|
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(h, {
|
|
591
591
|
type: "button",
|
|
592
|
-
className: l(
|
|
592
|
+
className: l(ft.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
593
593
|
iconBefore: /* @__PURE__ */ B("span", {
|
|
594
|
-
className:
|
|
594
|
+
className: ft.itemIcon,
|
|
595
595
|
children: n
|
|
596
596
|
}),
|
|
597
597
|
iconAfter: r ? /* @__PURE__ */ B("span", {
|
|
@@ -607,7 +607,7 @@ var q = {
|
|
|
607
607
|
}) }, e))
|
|
608
608
|
})
|
|
609
609
|
});
|
|
610
|
-
},
|
|
610
|
+
}, mt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
611
611
|
let [s, c] = K(t), [l, u] = K(n), [d, f] = K(r), p = G(o);
|
|
612
612
|
U(() => {
|
|
613
613
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
@@ -640,17 +640,17 @@ var q = {
|
|
|
640
640
|
a
|
|
641
641
|
])
|
|
642
642
|
};
|
|
643
|
-
},
|
|
643
|
+
}, J = { label: "_label_14i7c_1" }, ht = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
644
644
|
"Precise",
|
|
645
645
|
"Neutral",
|
|
646
646
|
"Creative"
|
|
647
647
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
648
|
-
let S = c({ "--csf-label-text": x?.labelText }), C = l(b,
|
|
648
|
+
let S = c({ "--csf-label-text": x?.labelText }), C = l(b, J.label, "gap-1");
|
|
649
649
|
return /* @__PURE__ */ V("div", {
|
|
650
650
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
651
651
|
style: S,
|
|
652
652
|
children: [
|
|
653
|
-
e.responseFormat && /* @__PURE__ */ B(
|
|
653
|
+
e.responseFormat && /* @__PURE__ */ B(I, {
|
|
654
654
|
id: "response-format",
|
|
655
655
|
labelProps: {
|
|
656
656
|
label: d,
|
|
@@ -658,7 +658,7 @@ var q = {
|
|
|
658
658
|
caption: f
|
|
659
659
|
},
|
|
660
660
|
optionsClassName: "mb-2",
|
|
661
|
-
orientation:
|
|
661
|
+
orientation: L.Column,
|
|
662
662
|
value: t ?? o.Markdown,
|
|
663
663
|
items: [{
|
|
664
664
|
value: o.Markdown,
|
|
@@ -669,11 +669,11 @@ var q = {
|
|
|
669
669
|
}],
|
|
670
670
|
onChange: (e) => a(e)
|
|
671
671
|
}),
|
|
672
|
-
e.systemPrompt && /* @__PURE__ */ B(
|
|
672
|
+
e.systemPrompt && /* @__PURE__ */ B(se, {
|
|
673
673
|
value: n,
|
|
674
674
|
placeholder: g,
|
|
675
675
|
className: i,
|
|
676
|
-
resize:
|
|
676
|
+
resize: ce.Vertical,
|
|
677
677
|
labelProps: {
|
|
678
678
|
className: C,
|
|
679
679
|
label: h
|
|
@@ -697,8 +697,8 @@ var q = {
|
|
|
697
697
|
})
|
|
698
698
|
]
|
|
699
699
|
});
|
|
700
|
-
},
|
|
701
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature:
|
|
700
|
+
}, gt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
701
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: ee, handleSubmit: A } = mt({
|
|
702
702
|
isOpen: e,
|
|
703
703
|
features: o,
|
|
704
704
|
initialResponseFormat: s,
|
|
@@ -707,7 +707,7 @@ var q = {
|
|
|
707
707
|
onSave: d,
|
|
708
708
|
onClose: r
|
|
709
709
|
});
|
|
710
|
-
return /* @__PURE__ */ V(
|
|
710
|
+
return /* @__PURE__ */ V(Le, {
|
|
711
711
|
isOpen: e,
|
|
712
712
|
title: f,
|
|
713
713
|
closeLabel: i,
|
|
@@ -715,14 +715,14 @@ var q = {
|
|
|
715
715
|
onBack: t,
|
|
716
716
|
backLabel: n,
|
|
717
717
|
style: a,
|
|
718
|
-
children: [/* @__PURE__ */ B(
|
|
718
|
+
children: [/* @__PURE__ */ B(ht, {
|
|
719
719
|
features: o,
|
|
720
720
|
responseFormat: w,
|
|
721
721
|
systemPrompt: T,
|
|
722
722
|
temperature: E,
|
|
723
723
|
onResponseFormatChange: O,
|
|
724
724
|
onSystemPromptChange: k,
|
|
725
|
-
onTemperatureChange:
|
|
725
|
+
onTemperatureChange: ee,
|
|
726
726
|
responseFormatLabel: p,
|
|
727
727
|
responseFormatHint: m,
|
|
728
728
|
responseFormatMarkdownLabel: h,
|
|
@@ -734,21 +734,21 @@ var q = {
|
|
|
734
734
|
temperatureHint: x
|
|
735
735
|
}), /* @__PURE__ */ B("div", {
|
|
736
736
|
className: l("px-6 py-4 mobile:pb-8"),
|
|
737
|
-
children: /* @__PURE__ */ B(
|
|
737
|
+
children: /* @__PURE__ */ B(ue, {
|
|
738
738
|
tooltip: C,
|
|
739
739
|
hideTooltip: D || !C,
|
|
740
740
|
triggerClassName: "w-full",
|
|
741
|
-
children: /* @__PURE__ */ B(
|
|
741
|
+
children: /* @__PURE__ */ B(P, {
|
|
742
742
|
label: S,
|
|
743
|
-
onClick:
|
|
743
|
+
onClick: A,
|
|
744
744
|
disabled: !D,
|
|
745
745
|
className: "w-full"
|
|
746
746
|
})
|
|
747
747
|
})
|
|
748
748
|
})]
|
|
749
749
|
});
|
|
750
|
-
},
|
|
751
|
-
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit:
|
|
750
|
+
}, _t = { modal: "_modal_kl0h0_1" }, vt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: _, temperatureHint: v, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = _t.modal, colors: S }) => {
|
|
751
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = mt({
|
|
752
752
|
features: e,
|
|
753
753
|
initialResponseFormat: t,
|
|
754
754
|
initialSystemPrompt: n,
|
|
@@ -756,25 +756,25 @@ var q = {
|
|
|
756
756
|
onSave: i,
|
|
757
757
|
onClose: a
|
|
758
758
|
});
|
|
759
|
-
return /* @__PURE__ */ B(
|
|
759
|
+
return /* @__PURE__ */ B(re, {
|
|
760
760
|
open: !0,
|
|
761
761
|
header: o,
|
|
762
762
|
titleClassName: s,
|
|
763
|
-
size:
|
|
763
|
+
size: N.Sm,
|
|
764
764
|
onClose: a,
|
|
765
765
|
className: x,
|
|
766
766
|
overlayStyle: c({ "--csm-bg": S?.background }),
|
|
767
767
|
mainButtons: [{
|
|
768
768
|
label: y,
|
|
769
769
|
variant: g.Primary,
|
|
770
|
-
onClick:
|
|
770
|
+
onClick: ee,
|
|
771
771
|
disabled: !E,
|
|
772
772
|
tooltipProps: b ? {
|
|
773
773
|
tooltip: b,
|
|
774
774
|
hideTooltip: E
|
|
775
775
|
} : void 0
|
|
776
776
|
}],
|
|
777
|
-
children: /* @__PURE__ */ B(
|
|
777
|
+
children: /* @__PURE__ */ B(ht, {
|
|
778
778
|
features: e,
|
|
779
779
|
responseFormat: C,
|
|
780
780
|
systemPrompt: w,
|
|
@@ -793,15 +793,15 @@ var q = {
|
|
|
793
793
|
temperatureHint: v
|
|
794
794
|
})
|
|
795
795
|
});
|
|
796
|
-
},
|
|
796
|
+
}, yt = {
|
|
797
797
|
icon: "_icon_1fv6z_1",
|
|
798
798
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
799
|
-
},
|
|
799
|
+
}, bt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: f }) => {
|
|
800
800
|
let m = c({
|
|
801
801
|
"--tbs-icon-text": f?.iconText,
|
|
802
802
|
"--tbs-selected-icon-text": f?.selectedIconText
|
|
803
803
|
});
|
|
804
|
-
return /* @__PURE__ */ B(
|
|
804
|
+
return /* @__PURE__ */ B(Le, {
|
|
805
805
|
isOpen: e,
|
|
806
806
|
title: o,
|
|
807
807
|
closeLabel: i,
|
|
@@ -809,78 +809,72 @@ var q = {
|
|
|
809
809
|
onBack: t,
|
|
810
810
|
backLabel: n,
|
|
811
811
|
style: a,
|
|
812
|
-
children: /* @__PURE__ */ B("
|
|
812
|
+
children: /* @__PURE__ */ B("div", {
|
|
813
813
|
role: "menu",
|
|
814
|
-
|
|
814
|
+
"aria-label": o,
|
|
815
|
+
className: "flex flex-col px-2 pb-4",
|
|
815
816
|
style: m,
|
|
816
|
-
children: s.map((e) => /* @__PURE__ */ B(
|
|
817
|
-
role: "
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
}) : null,
|
|
835
|
-
label: /* @__PURE__ */ B("span", {
|
|
836
|
-
className: d,
|
|
837
|
-
children: e.label
|
|
838
|
-
}),
|
|
839
|
-
onClick: () => u(e.id)
|
|
840
|
-
})
|
|
817
|
+
children: s.map((e) => /* @__PURE__ */ B(k, {
|
|
818
|
+
role: "menuitemcheckbox",
|
|
819
|
+
"aria-checked": e.isSelected,
|
|
820
|
+
icon: /* @__PURE__ */ B("span", {
|
|
821
|
+
className: l("flex items-center", yt.icon),
|
|
822
|
+
children: e.icon
|
|
823
|
+
}),
|
|
824
|
+
label: e.label,
|
|
825
|
+
labelClassName: d,
|
|
826
|
+
trailing: e.isSelected ? /* @__PURE__ */ B("span", {
|
|
827
|
+
className: l("flex", yt.selectedIcon),
|
|
828
|
+
children: /* @__PURE__ */ B(_e, {
|
|
829
|
+
size: p,
|
|
830
|
+
"aria-hidden": !0,
|
|
831
|
+
stroke: y
|
|
832
|
+
})
|
|
833
|
+
}) : void 0,
|
|
834
|
+
onClick: () => u(e.id)
|
|
841
835
|
}, e.id))
|
|
842
836
|
})
|
|
843
837
|
});
|
|
844
|
-
},
|
|
838
|
+
}, xt = {
|
|
845
839
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
846
840
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
847
|
-
},
|
|
848
|
-
let
|
|
849
|
-
e && (
|
|
850
|
-
}, []),
|
|
841
|
+
}, St = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: m = "w-[240px]", isDisabled: h = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: x = [], onToolToggle: S, toolsMenuTitle: C = "Tools", toolsBackLabel: T = "Back", menuOverlays: E, getCaretPosition: D, colors: O }) => {
|
|
842
|
+
let k = d(), A = f(), [j, M] = K(!1), te = G(0), [ne, re] = K(!1), [N, P] = K(!1), [F, I] = K(!1), [L, ie] = K(null), ae = H((e) => {
|
|
843
|
+
e && (te.current = 0), re(e), e || (I(!1), ie(null));
|
|
844
|
+
}, []), R = G(A);
|
|
851
845
|
U(() => {
|
|
852
|
-
|
|
846
|
+
R.current !== A && (R.current = A, A ? (M(ne && !F && L === null), re(!1)) : (te.current = F || L !== null ? -1 : 0, re(j || F || L !== null), M(!1)));
|
|
853
847
|
}, [
|
|
848
|
+
A,
|
|
849
|
+
ne,
|
|
854
850
|
j,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
I,
|
|
858
|
-
R
|
|
851
|
+
F,
|
|
852
|
+
L
|
|
859
853
|
]);
|
|
860
|
-
let
|
|
861
|
-
"--aab-tool-icon":
|
|
862
|
-
"--aab-chevron-icon":
|
|
863
|
-
}), [
|
|
854
|
+
let z = W(() => c({
|
|
855
|
+
"--aab-tool-icon": O?.toolIcon,
|
|
856
|
+
"--aab-chevron-icon": O?.chevronIcon
|
|
857
|
+
}), [O?.toolIcon, O?.chevronIcon]), oe = x.length > 0 && S != null, se = W(() => x.map((e) => ({
|
|
864
858
|
key: e.id,
|
|
865
859
|
label: e.label,
|
|
866
860
|
icon: /* @__PURE__ */ B("span", {
|
|
867
|
-
style:
|
|
868
|
-
className: l("flex items-center",
|
|
861
|
+
style: z,
|
|
862
|
+
className: l("flex items-center", xt.toolIcon),
|
|
869
863
|
children: e.icon
|
|
870
864
|
}),
|
|
871
865
|
selectable: !0,
|
|
872
|
-
mark:
|
|
866
|
+
mark: ee.Check,
|
|
873
867
|
checked: e.isSelected,
|
|
874
868
|
onClick: () => S?.(e.id)
|
|
875
869
|
})), [
|
|
876
870
|
x,
|
|
877
871
|
S,
|
|
878
|
-
|
|
872
|
+
z
|
|
879
873
|
]), ce = W(() => [
|
|
880
874
|
...e == null ? [] : [{
|
|
881
875
|
key: "attach",
|
|
882
876
|
label: r,
|
|
883
|
-
icon: /* @__PURE__ */ B(
|
|
877
|
+
icon: /* @__PURE__ */ B(Se, {
|
|
884
878
|
size: p,
|
|
885
879
|
"aria-hidden": !0,
|
|
886
880
|
stroke: y
|
|
@@ -890,26 +884,26 @@ var q = {
|
|
|
890
884
|
..._ ?? [],
|
|
891
885
|
...oe ? [{
|
|
892
886
|
key: "tools",
|
|
893
|
-
label:
|
|
894
|
-
icon: /* @__PURE__ */ B(
|
|
887
|
+
label: C,
|
|
888
|
+
icon: /* @__PURE__ */ B(Ee, {
|
|
895
889
|
size: p,
|
|
896
890
|
"aria-hidden": !0,
|
|
897
891
|
stroke: y
|
|
898
892
|
}),
|
|
899
|
-
onClick:
|
|
900
|
-
|
|
893
|
+
onClick: A ? () => {
|
|
894
|
+
I(!0);
|
|
901
895
|
} : () => void 0,
|
|
902
|
-
...
|
|
896
|
+
...A ? { iconAfter: /* @__PURE__ */ B(ye, {
|
|
903
897
|
size: p,
|
|
904
898
|
stroke: y,
|
|
905
|
-
style:
|
|
906
|
-
className: l("rtl:scale-x-[-1]",
|
|
899
|
+
style: z,
|
|
900
|
+
className: l("rtl:scale-x-[-1]", xt.chevronIcon),
|
|
907
901
|
"aria-hidden": !0
|
|
908
902
|
}) } : {
|
|
909
903
|
children: se,
|
|
910
|
-
subMenuOpen:
|
|
904
|
+
subMenuOpen: F,
|
|
911
905
|
onSubMenuOpenChange: (e) => {
|
|
912
|
-
|
|
906
|
+
I(e), e && ie(null);
|
|
913
907
|
}
|
|
914
908
|
}
|
|
915
909
|
}] : [],
|
|
@@ -917,84 +911,84 @@ var q = {
|
|
|
917
911
|
key: e.key,
|
|
918
912
|
label: e.title,
|
|
919
913
|
icon: e.icon,
|
|
920
|
-
onClick:
|
|
921
|
-
|
|
914
|
+
onClick: A ? () => {
|
|
915
|
+
ie(e.key);
|
|
922
916
|
} : () => void 0,
|
|
923
|
-
...
|
|
917
|
+
...A ? { iconAfter: /* @__PURE__ */ B(ye, {
|
|
924
918
|
size: p,
|
|
925
919
|
stroke: y,
|
|
926
|
-
style:
|
|
927
|
-
className: l("rtl:scale-x-[-1]",
|
|
920
|
+
style: z,
|
|
921
|
+
className: l("rtl:scale-x-[-1]", xt.chevronIcon),
|
|
928
922
|
"aria-hidden": !0
|
|
929
923
|
}) } : {
|
|
930
|
-
subMenuOpen:
|
|
924
|
+
subMenuOpen: L === e.key,
|
|
931
925
|
onSubMenuOpenChange: (t) => {
|
|
932
|
-
|
|
926
|
+
ie((n) => t ? e.key : n === e.key ? null : n), t && I(!1);
|
|
933
927
|
},
|
|
934
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
928
|
+
renderSubMenu: () => e.renderOverlay(() => ae(!1), D?.() ?? 0)
|
|
935
929
|
}
|
|
936
930
|
})),
|
|
937
931
|
...t == null ? [] : [{
|
|
938
932
|
key: "record-voice",
|
|
939
933
|
label: n,
|
|
940
|
-
icon: /* @__PURE__ */ B(
|
|
934
|
+
icon: /* @__PURE__ */ B(xe, {
|
|
941
935
|
size: p,
|
|
942
936
|
"aria-hidden": !0,
|
|
943
937
|
stroke: y
|
|
944
938
|
}),
|
|
945
939
|
onClick: () => {
|
|
946
|
-
|
|
940
|
+
ae(!1), t();
|
|
947
941
|
}
|
|
948
942
|
}],
|
|
949
943
|
...g == null ? [] : [{
|
|
950
944
|
key: "chat-settings",
|
|
951
945
|
label: g.menuItemLabel ?? "Chat settings",
|
|
952
|
-
icon: /* @__PURE__ */ B(
|
|
946
|
+
icon: /* @__PURE__ */ B(Te, {
|
|
953
947
|
size: p,
|
|
954
948
|
"aria-hidden": !0,
|
|
955
949
|
stroke: y
|
|
956
950
|
}),
|
|
957
|
-
iconAfter:
|
|
951
|
+
iconAfter: k ? /* @__PURE__ */ B(ye, {
|
|
958
952
|
size: p,
|
|
959
953
|
stroke: y,
|
|
960
|
-
style:
|
|
961
|
-
className: l("rtl:scale-x-[-1]",
|
|
954
|
+
style: z,
|
|
955
|
+
className: l("rtl:scale-x-[-1]", xt.chevronIcon),
|
|
962
956
|
"aria-hidden": !0
|
|
963
957
|
}) : null,
|
|
964
|
-
onClick: () =>
|
|
958
|
+
onClick: () => P(!0)
|
|
965
959
|
}]
|
|
966
960
|
], [
|
|
967
|
-
|
|
961
|
+
ae,
|
|
968
962
|
r,
|
|
969
963
|
e,
|
|
970
964
|
t,
|
|
971
965
|
n,
|
|
972
966
|
g,
|
|
973
967
|
_,
|
|
968
|
+
k,
|
|
974
969
|
A,
|
|
975
|
-
j,
|
|
976
970
|
oe,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
971
|
+
F,
|
|
972
|
+
L,
|
|
973
|
+
C,
|
|
980
974
|
se,
|
|
981
975
|
E,
|
|
982
976
|
D,
|
|
983
|
-
|
|
977
|
+
z
|
|
984
978
|
]);
|
|
985
979
|
if (ce.length === 0) return null;
|
|
986
|
-
let
|
|
980
|
+
let le = /* @__PURE__ */ B(b, {
|
|
987
981
|
matchReferenceWidth: !1,
|
|
988
982
|
placement: "bottom-start",
|
|
989
983
|
listClassName: m,
|
|
990
|
-
initialFocus:
|
|
984
|
+
initialFocus: te.current,
|
|
991
985
|
overlayAriaLabel: i,
|
|
992
986
|
items: ce,
|
|
993
987
|
disabled: h,
|
|
994
|
-
open:
|
|
995
|
-
onOpenChange:
|
|
996
|
-
children: /* @__PURE__ */ B(
|
|
997
|
-
icon: /* @__PURE__ */ B(
|
|
988
|
+
open: ne,
|
|
989
|
+
onOpenChange: ae,
|
|
990
|
+
children: /* @__PURE__ */ B(w, {
|
|
991
|
+
icon: /* @__PURE__ */ B(we, {
|
|
998
992
|
size: v.LG,
|
|
999
993
|
"aria-hidden": !0,
|
|
1000
994
|
stroke: y
|
|
@@ -1005,10 +999,10 @@ var q = {
|
|
|
1005
999
|
disabled: h
|
|
1006
1000
|
})
|
|
1007
1001
|
});
|
|
1008
|
-
return /* @__PURE__ */ V(
|
|
1009
|
-
|
|
1010
|
-
/* @__PURE__ */ B(
|
|
1011
|
-
icon: /* @__PURE__ */ B(
|
|
1002
|
+
return /* @__PURE__ */ V(de, { children: [
|
|
1003
|
+
A ? /* @__PURE__ */ V(de, { children: [
|
|
1004
|
+
/* @__PURE__ */ B(w, {
|
|
1005
|
+
icon: /* @__PURE__ */ B(we, {
|
|
1012
1006
|
size: v.LG,
|
|
1013
1007
|
"aria-hidden": !0,
|
|
1014
1008
|
stroke: y
|
|
@@ -1016,55 +1010,55 @@ var q = {
|
|
|
1016
1010
|
"aria-label": i,
|
|
1017
1011
|
tooltipProps: { tooltip: i },
|
|
1018
1012
|
disabled: h,
|
|
1019
|
-
onClick: () =>
|
|
1013
|
+
onClick: () => M(!0)
|
|
1020
1014
|
}),
|
|
1021
|
-
/* @__PURE__ */ B(
|
|
1022
|
-
isOpen:
|
|
1015
|
+
/* @__PURE__ */ B(pt, {
|
|
1016
|
+
isOpen: j,
|
|
1023
1017
|
title: a,
|
|
1024
1018
|
closeLabel: s,
|
|
1025
|
-
onClose: () =>
|
|
1019
|
+
onClose: () => M(!1),
|
|
1026
1020
|
style: u,
|
|
1027
1021
|
items: ce,
|
|
1028
1022
|
className: "pb-4",
|
|
1029
1023
|
btnTextClassName: "flex-1"
|
|
1030
1024
|
}),
|
|
1031
|
-
oe && /* @__PURE__ */ B(
|
|
1032
|
-
isOpen:
|
|
1025
|
+
oe && /* @__PURE__ */ B(bt, {
|
|
1026
|
+
isOpen: F,
|
|
1033
1027
|
onBack: () => {
|
|
1034
|
-
|
|
1028
|
+
I(!1), M(!0);
|
|
1035
1029
|
},
|
|
1036
1030
|
backLabel: T,
|
|
1037
|
-
onClose: () =>
|
|
1031
|
+
onClose: () => ae(!1),
|
|
1038
1032
|
closeLabel: s,
|
|
1039
1033
|
style: u,
|
|
1040
|
-
title:
|
|
1034
|
+
title: C,
|
|
1041
1035
|
items: x,
|
|
1042
1036
|
onToolToggle: S
|
|
1043
1037
|
}),
|
|
1044
|
-
E?.map((e) => /* @__PURE__ */ B(
|
|
1045
|
-
isOpen:
|
|
1038
|
+
E?.map((e) => /* @__PURE__ */ B(Le, {
|
|
1039
|
+
isOpen: L === e.key,
|
|
1046
1040
|
title: e.title,
|
|
1047
1041
|
closeLabel: s,
|
|
1048
1042
|
onBack: () => {
|
|
1049
|
-
|
|
1043
|
+
ie(null), M(!0);
|
|
1050
1044
|
},
|
|
1051
1045
|
backLabel: e.backLabel ?? "Back",
|
|
1052
|
-
onClose: () =>
|
|
1046
|
+
onClose: () => ae(!1),
|
|
1053
1047
|
style: u,
|
|
1054
1048
|
children: /* @__PURE__ */ B("div", {
|
|
1055
1049
|
role: "menu",
|
|
1056
1050
|
"aria-label": e.title,
|
|
1057
|
-
children: e.renderOverlay(() =>
|
|
1051
|
+
children: e.renderOverlay(() => ae(!1), D?.() ?? 0)
|
|
1058
1052
|
})
|
|
1059
1053
|
}, e.key))
|
|
1060
|
-
] }) : /* @__PURE__ */ B(
|
|
1061
|
-
|
|
1062
|
-
isOpen:
|
|
1054
|
+
] }) : /* @__PURE__ */ B(de, { children: le }),
|
|
1055
|
+
k && g != null && /* @__PURE__ */ B(gt, {
|
|
1056
|
+
isOpen: N,
|
|
1063
1057
|
onBack: () => {
|
|
1064
|
-
|
|
1058
|
+
P(!1), A ? M(!0) : re(!0);
|
|
1065
1059
|
},
|
|
1066
1060
|
backLabel: g.backLabel ?? "Back",
|
|
1067
|
-
onClose: () =>
|
|
1061
|
+
onClose: () => P(!1),
|
|
1068
1062
|
closeLabel: s,
|
|
1069
1063
|
style: u,
|
|
1070
1064
|
features: g.features,
|
|
@@ -1085,13 +1079,13 @@ var q = {
|
|
|
1085
1079
|
saveLabel: g.saveLabel,
|
|
1086
1080
|
saveDisabledTooltip: g.saveDisabledTooltip
|
|
1087
1081
|
}),
|
|
1088
|
-
!
|
|
1082
|
+
!k && g != null && N && /* @__PURE__ */ B(vt, {
|
|
1089
1083
|
features: g.features,
|
|
1090
1084
|
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1091
1085
|
initialSystemPrompt: g.systemPrompt,
|
|
1092
1086
|
initialTemperature: g.temperature,
|
|
1093
1087
|
onSave: g.onSave,
|
|
1094
|
-
onClose: () =>
|
|
1088
|
+
onClose: () => P(!1),
|
|
1095
1089
|
title: g.title,
|
|
1096
1090
|
responseFormatLabel: g.responseFormatLabel,
|
|
1097
1091
|
responseFormatHint: g.responseFormatHint,
|
|
@@ -1107,14 +1101,14 @@ var q = {
|
|
|
1107
1101
|
colors: g.modalColors
|
|
1108
1102
|
})
|
|
1109
1103
|
] });
|
|
1110
|
-
},
|
|
1104
|
+
}, Ct = {
|
|
1111
1105
|
chip: "_chip_1lvv5_1",
|
|
1112
1106
|
chipSelected: "_chipSelected_1lvv5_9",
|
|
1113
1107
|
chipIcon: "_chipIcon_1lvv5_16",
|
|
1114
1108
|
chipText: "_chipText_1lvv5_19",
|
|
1115
1109
|
chipState: "_chipState_1lvv5_22",
|
|
1116
1110
|
chipClose: "_chipClose_1lvv5_25"
|
|
1117
|
-
},
|
|
1111
|
+
}, wt = (e) => `Remove ${e}`, Tt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = wt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
|
|
1118
1112
|
if (e.length === 0) return null;
|
|
1119
1113
|
let d = !!(a && o), f = c({
|
|
1120
1114
|
"--ci-chip-bg": u?.chipBg,
|
|
@@ -1131,18 +1125,18 @@ var q = {
|
|
|
1131
1125
|
"--ci-chip-close": u?.chipClose,
|
|
1132
1126
|
"--ci-chip-close-hover": u?.chipCloseHover
|
|
1133
1127
|
}), p = (e) => /* @__PURE__ */ B("span", {
|
|
1134
|
-
className: l(
|
|
1128
|
+
className: l(Ct.chipIcon, "flex shrink-0"),
|
|
1135
1129
|
children: e.icon
|
|
1136
1130
|
}), m = (e) => /* @__PURE__ */ V("span", {
|
|
1137
1131
|
className: "flex min-w-0 items-center",
|
|
1138
1132
|
children: [/* @__PURE__ */ V("span", {
|
|
1139
|
-
className: l(
|
|
1133
|
+
className: l(Ct.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
1140
1134
|
children: [e.label, d && /* @__PURE__ */ B("span", {
|
|
1141
1135
|
"aria-hidden": !0,
|
|
1142
1136
|
children: ":"
|
|
1143
1137
|
})]
|
|
1144
1138
|
}), d && /* @__PURE__ */ B("span", {
|
|
1145
|
-
className: l(
|
|
1139
|
+
className: l(Ct.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
|
|
1146
1140
|
"aria-hidden": !0,
|
|
1147
1141
|
children: e.isSelected ? a : o
|
|
1148
1142
|
})]
|
|
@@ -1151,7 +1145,7 @@ var q = {
|
|
|
1151
1145
|
className: "flex flex-wrap items-center gap-2",
|
|
1152
1146
|
style: f,
|
|
1153
1147
|
children: e.map((e) => r ? /* @__PURE__ */ V("div", {
|
|
1154
|
-
className: l(
|
|
1148
|
+
className: l(Ct.chip, e.isSelected && Ct.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
|
|
1155
1149
|
children: [/* @__PURE__ */ V("button", {
|
|
1156
1150
|
type: "button",
|
|
1157
1151
|
onClick: () => t(e.id),
|
|
@@ -1166,19 +1160,19 @@ var q = {
|
|
|
1166
1160
|
type: "button",
|
|
1167
1161
|
onClick: () => n(e.id),
|
|
1168
1162
|
"aria-label": i(e.label),
|
|
1169
|
-
className: l(
|
|
1170
|
-
children: /* @__PURE__ */ B(
|
|
1163
|
+
className: l(Ct.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
1164
|
+
children: /* @__PURE__ */ B(De, {
|
|
1171
1165
|
size: 12,
|
|
1172
1166
|
"aria-hidden": !0,
|
|
1173
1167
|
stroke: y
|
|
1174
1168
|
})
|
|
1175
1169
|
})]
|
|
1176
|
-
}, e.id) : /* @__PURE__ */ B(
|
|
1170
|
+
}, e.id) : /* @__PURE__ */ B(le, {
|
|
1177
1171
|
icon: p(e),
|
|
1178
1172
|
label: m(e),
|
|
1179
1173
|
isSelected: e.isSelected,
|
|
1180
1174
|
onToggle: () => t(e.id),
|
|
1181
|
-
className: l(
|
|
1175
|
+
className: l(Ct.chip, e.isSelected && Ct.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
|
|
1182
1176
|
}, e.id))
|
|
1183
1177
|
});
|
|
1184
1178
|
}, Y = {
|
|
@@ -1196,22 +1190,22 @@ var q = {
|
|
|
1196
1190
|
modelSelectorName: "_modelSelectorName_13067_85",
|
|
1197
1191
|
modelSelectorVersion: "_modelSelectorVersion_13067_88",
|
|
1198
1192
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_13067_97"
|
|
1199
|
-
},
|
|
1193
|
+
}, Et = {
|
|
1200
1194
|
waveformCanvas: "_waveformCanvas_18zb5_1",
|
|
1201
1195
|
recordingDot: "_recordingDot_18zb5_15",
|
|
1202
1196
|
"recording-pulse": "_recording-pulse_18zb5_1"
|
|
1203
|
-
},
|
|
1204
|
-
let f = G(null), p = G(new Float32Array(
|
|
1197
|
+
}, Dt = 3, Ot = 4, kt = 200, At = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
|
|
1198
|
+
let f = G(null), p = G(new Float32Array(kt)), m = G(0), h = G(0), g = e === rt.Recording, _ = e === rt.Processing, b = H((e) => {
|
|
1205
1199
|
let t = e.getContext("2d");
|
|
1206
1200
|
if (!t) return;
|
|
1207
1201
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1208
1202
|
let { width: n, height: r } = e;
|
|
1209
1203
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1210
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
1204
|
+
let i = Math.min(Math.max(1, Math.floor(n / Ot)), 199), a = m.current, o = h.current;
|
|
1211
1205
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1212
1206
|
for (let e = 0; e <= i; e++) {
|
|
1213
|
-
let n = ((a - i + e) %
|
|
1214
|
-
t.fillRect(e *
|
|
1207
|
+
let n = ((a - i + e) % kt + kt) % kt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
1208
|
+
t.fillRect(e * Ot, (r - c) / 2, Dt, c);
|
|
1215
1209
|
}
|
|
1216
1210
|
t.restore();
|
|
1217
1211
|
}, []);
|
|
@@ -1221,8 +1215,8 @@ var q = {
|
|
|
1221
1215
|
if (!e) return;
|
|
1222
1216
|
p.current.fill(0), m.current = 0, h.current = 0;
|
|
1223
1217
|
let n, r = () => {
|
|
1224
|
-
if (h.current += 1, h.current >=
|
|
1225
|
-
h.current -=
|
|
1218
|
+
if (h.current += 1, h.current >= Ot) {
|
|
1219
|
+
h.current -= Ot;
|
|
1226
1220
|
let e = t.current;
|
|
1227
1221
|
if (e) {
|
|
1228
1222
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -1232,7 +1226,7 @@ var q = {
|
|
|
1232
1226
|
let r = (t[e] - 128) / 128;
|
|
1233
1227
|
n += r * r;
|
|
1234
1228
|
}
|
|
1235
|
-
p.current[m.current %
|
|
1229
|
+
p.current[m.current % kt] = Math.sqrt(n / t.length), m.current++;
|
|
1236
1230
|
}
|
|
1237
1231
|
}
|
|
1238
1232
|
b(e), n = requestAnimationFrame(r);
|
|
@@ -1255,8 +1249,8 @@ var q = {
|
|
|
1255
1249
|
let x = /* @__PURE__ */ V("div", {
|
|
1256
1250
|
className: "flex shrink-0 items-center justify-end gap-1",
|
|
1257
1251
|
children: [
|
|
1258
|
-
/* @__PURE__ */ B(
|
|
1259
|
-
icon: /* @__PURE__ */ B(
|
|
1252
|
+
/* @__PURE__ */ B(j, {
|
|
1253
|
+
icon: /* @__PURE__ */ B(De, {
|
|
1260
1254
|
size: v.LG,
|
|
1261
1255
|
"aria-hidden": !0,
|
|
1262
1256
|
stroke: y
|
|
@@ -1266,7 +1260,7 @@ var q = {
|
|
|
1266
1260
|
onClick: r
|
|
1267
1261
|
}),
|
|
1268
1262
|
g && /* @__PURE__ */ B(F, {
|
|
1269
|
-
icon: /* @__PURE__ */ B(
|
|
1263
|
+
icon: /* @__PURE__ */ B(_e, {
|
|
1270
1264
|
size: v.LG,
|
|
1271
1265
|
"aria-hidden": !0,
|
|
1272
1266
|
stroke: y
|
|
@@ -1278,7 +1272,7 @@ var q = {
|
|
|
1278
1272
|
}),
|
|
1279
1273
|
_ && /* @__PURE__ */ B("span", {
|
|
1280
1274
|
className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1281
|
-
children: /* @__PURE__ */ B(
|
|
1275
|
+
children: /* @__PURE__ */ B(oe, {
|
|
1282
1276
|
size: 20,
|
|
1283
1277
|
ariaLabel: s
|
|
1284
1278
|
})
|
|
@@ -1293,13 +1287,13 @@ var q = {
|
|
|
1293
1287
|
children: [/* @__PURE__ */ V("div", {
|
|
1294
1288
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1295
1289
|
children: [g && /* @__PURE__ */ B("span", {
|
|
1296
|
-
className: l(
|
|
1290
|
+
className: l(Et.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1297
1291
|
"aria-hidden": !0
|
|
1298
1292
|
}), /* @__PURE__ */ B("canvas", {
|
|
1299
1293
|
ref: f,
|
|
1300
1294
|
height: 26,
|
|
1301
1295
|
"aria-hidden": !0,
|
|
1302
|
-
className: l(
|
|
1296
|
+
className: l(Et.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1303
1297
|
})]
|
|
1304
1298
|
}), /* @__PURE__ */ V("div", {
|
|
1305
1299
|
className: "flex items-center justify-between gap-2",
|
|
@@ -1307,32 +1301,32 @@ var q = {
|
|
|
1307
1301
|
})]
|
|
1308
1302
|
})
|
|
1309
1303
|
});
|
|
1310
|
-
},
|
|
1304
|
+
}, jt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ B(F, {
|
|
1311
1305
|
"aria-label": n,
|
|
1312
1306
|
onClick: () => e?.(),
|
|
1313
1307
|
disabled: t,
|
|
1314
1308
|
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1315
|
-
icon: /* @__PURE__ */ B(
|
|
1309
|
+
icon: /* @__PURE__ */ B(ge, {
|
|
1316
1310
|
size: v.LG,
|
|
1317
1311
|
className: "rtl:scale-x-[-1]",
|
|
1318
1312
|
stroke: y
|
|
1319
1313
|
})
|
|
1320
|
-
}),
|
|
1321
|
-
icon: /* @__PURE__ */ B(
|
|
1314
|
+
}), Mt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B(j, {
|
|
1315
|
+
icon: /* @__PURE__ */ B(Ce, {
|
|
1322
1316
|
size: v.LG,
|
|
1323
1317
|
stroke: y
|
|
1324
1318
|
}),
|
|
1325
1319
|
onClick: () => e?.(),
|
|
1326
1320
|
"aria-label": t
|
|
1327
|
-
}),
|
|
1328
|
-
variant:
|
|
1321
|
+
}), Nt = ({ size: e = 20 }) => /* @__PURE__ */ B(ae, {
|
|
1322
|
+
variant: R.Circular,
|
|
1329
1323
|
width: e,
|
|
1330
1324
|
height: e,
|
|
1331
1325
|
active: !0
|
|
1332
|
-
}),
|
|
1326
|
+
}), Pt = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
|
|
1333
1327
|
className: "flex min-w-0 flex-1 items-center",
|
|
1334
|
-
children: [/* @__PURE__ */ B(
|
|
1335
|
-
variant:
|
|
1328
|
+
children: [/* @__PURE__ */ B(ae, {
|
|
1329
|
+
variant: R.Text,
|
|
1336
1330
|
width: "100%",
|
|
1337
1331
|
height: 16,
|
|
1338
1332
|
active: !0
|
|
@@ -1340,29 +1334,29 @@ var q = {
|
|
|
1340
1334
|
className: "sr-only",
|
|
1341
1335
|
children: e
|
|
1342
1336
|
})]
|
|
1343
|
-
}),
|
|
1337
|
+
}), Ft = () => /* @__PURE__ */ B("div", {
|
|
1344
1338
|
"aria-hidden": "true",
|
|
1345
1339
|
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
|
|
1346
1340
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1347
|
-
children: [/* @__PURE__ */ B(
|
|
1341
|
+
children: [/* @__PURE__ */ B(Nt, {}), /* @__PURE__ */ B(Pt, {})]
|
|
1348
1342
|
}, t))
|
|
1349
|
-
}),
|
|
1343
|
+
}), It = (e) => e.displayName ?? e.id, Lt = (e, t) => {
|
|
1350
1344
|
let n = t.trim().toLowerCase();
|
|
1351
|
-
return n ? e.filter((e) =>
|
|
1352
|
-
},
|
|
1345
|
+
return n ? e.filter((e) => It(e).toLowerCase().includes(n)) : e;
|
|
1346
|
+
}, Rt = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
|
|
1353
1347
|
src: e,
|
|
1354
1348
|
size: i,
|
|
1355
1349
|
labels: { tooltip: a },
|
|
1356
1350
|
initialsName: r
|
|
1357
|
-
}),
|
|
1351
|
+
}), zt = {
|
|
1358
1352
|
searchHeader: "_searchHeader_1u7db_1",
|
|
1359
1353
|
itemText: "_itemText_1u7db_13",
|
|
1360
1354
|
itemHover: "_itemHover_1u7db_17",
|
|
1361
1355
|
selectedItemBackground: "_selectedItemBackground_1u7db_22",
|
|
1362
1356
|
selectedItemText: "_selectedItemText_1u7db_26",
|
|
1363
1357
|
checkIcon: "_checkIcon_1u7db_30"
|
|
1364
|
-
},
|
|
1365
|
-
let [a, o] = K(""), s = W(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = W(() => u ? /* @__PURE__ */ B(
|
|
1358
|
+
}, Bt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
|
|
1359
|
+
let [a, o] = K(""), s = W(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = W(() => u ? /* @__PURE__ */ B(Nt, { size: v.LG }) : Rt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", v.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1366
1360
|
u,
|
|
1367
1361
|
s,
|
|
1368
1362
|
d,
|
|
@@ -1370,8 +1364,8 @@ var q = {
|
|
|
1370
1364
|
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = W(() => {
|
|
1371
1365
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
1372
1366
|
key: `__loading-${t}`,
|
|
1373
|
-
icon: /* @__PURE__ */ B(
|
|
1374
|
-
label: /* @__PURE__ */ B(
|
|
1367
|
+
icon: /* @__PURE__ */ B(Nt, {}),
|
|
1368
|
+
label: /* @__PURE__ */ B(Pt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1375
1369
|
disabled: !0
|
|
1376
1370
|
}));
|
|
1377
1371
|
if (!e || e.length === 0) {
|
|
@@ -1383,19 +1377,19 @@ var q = {
|
|
|
1383
1377
|
}] : [];
|
|
1384
1378
|
}
|
|
1385
1379
|
let o = i?.colors;
|
|
1386
|
-
return
|
|
1380
|
+
return Lt(e, a).map((e) => {
|
|
1387
1381
|
let r = e.id === t;
|
|
1388
1382
|
return {
|
|
1389
1383
|
key: e.id,
|
|
1390
|
-
label: /* @__PURE__ */ B(
|
|
1391
|
-
text:
|
|
1384
|
+
label: /* @__PURE__ */ B(T, {
|
|
1385
|
+
text: It(e),
|
|
1392
1386
|
query: a,
|
|
1393
1387
|
maxLines: 1
|
|
1394
1388
|
}),
|
|
1395
|
-
icon:
|
|
1396
|
-
mark:
|
|
1389
|
+
icon: Rt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1390
|
+
mark: ee.Check,
|
|
1397
1391
|
checked: r,
|
|
1398
|
-
className: l(o?.itemText &&
|
|
1392
|
+
className: l(o?.itemText && zt.itemText, o?.itemHoverBackground && zt.itemHover, r && o?.selectedItemBackground && zt.selectedItemBackground, r && o?.selectedItemText && zt.selectedItemText, r && o?.checkIcon && zt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, q.modelMenuItem, r && q.modelMenuItemSelected),
|
|
1399
1393
|
onClick: () => n?.(e.id)
|
|
1400
1394
|
};
|
|
1401
1395
|
});
|
|
@@ -1426,11 +1420,11 @@ var q = {
|
|
|
1426
1420
|
menuItems: g,
|
|
1427
1421
|
menuHeader: W(() => !u && e && e.length > 0 ? /* @__PURE__ */ B("div", {
|
|
1428
1422
|
style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
|
|
1429
|
-
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1",
|
|
1430
|
-
children: /* @__PURE__ */ B(
|
|
1423
|
+
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", zt.searchHeader, i?.searchHeaderClassName, q.modelMenuSearch),
|
|
1424
|
+
children: /* @__PURE__ */ B(ie, {
|
|
1431
1425
|
value: a,
|
|
1432
1426
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1433
|
-
size:
|
|
1427
|
+
size: S.Small,
|
|
1434
1428
|
wrapperClassName: "border-0",
|
|
1435
1429
|
onChange: (e) => o(e ?? "")
|
|
1436
1430
|
})
|
|
@@ -1447,8 +1441,8 @@ var q = {
|
|
|
1447
1441
|
e || o("");
|
|
1448
1442
|
}
|
|
1449
1443
|
};
|
|
1450
|
-
}, X = typeof window < "u" ?
|
|
1451
|
-
function
|
|
1444
|
+
}, X = typeof window < "u" ? Pe : U;
|
|
1445
|
+
function Vt(e) {
|
|
1452
1446
|
let t = e;
|
|
1453
1447
|
for (; t;) {
|
|
1454
1448
|
if (t.dir) return t.dir === "rtl";
|
|
@@ -1456,17 +1450,17 @@ function zt(e) {
|
|
|
1456
1450
|
}
|
|
1457
1451
|
return !1;
|
|
1458
1452
|
}
|
|
1459
|
-
function
|
|
1453
|
+
function Ht() {
|
|
1460
1454
|
return () => {};
|
|
1461
1455
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return
|
|
1456
|
+
function Ut() {
|
|
1457
|
+
return Fe(Ht, () => !1, () => !0);
|
|
1464
1458
|
}
|
|
1465
|
-
function
|
|
1459
|
+
function Z(e) {
|
|
1466
1460
|
return e?.ownerDocument.defaultView ?? window;
|
|
1467
1461
|
}
|
|
1468
|
-
function
|
|
1469
|
-
return
|
|
1462
|
+
function Wt(e) {
|
|
1463
|
+
return Z(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
1470
1464
|
}
|
|
1471
1465
|
function Q(e) {
|
|
1472
1466
|
if (e !== void 0) switch (typeof e) {
|
|
@@ -1474,7 +1468,7 @@ function Q(e) {
|
|
|
1474
1468
|
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
1475
1469
|
}
|
|
1476
1470
|
}
|
|
1477
|
-
function
|
|
1471
|
+
function Gt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1478
1472
|
let { styleHeight: s, styleWidth: c } = W(() => ({
|
|
1479
1473
|
styleHeight: Q(o?.height),
|
|
1480
1474
|
styleWidth: Q(o?.width)
|
|
@@ -1484,7 +1478,7 @@ function $({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1484
1478
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1485
1479
|
return X(() => {
|
|
1486
1480
|
if (i === null || d) return;
|
|
1487
|
-
let t =
|
|
1481
|
+
let t = Wt(i);
|
|
1488
1482
|
if (!t) return;
|
|
1489
1483
|
let n = new t((e) => {
|
|
1490
1484
|
for (let t of e) {
|
|
@@ -1513,7 +1507,7 @@ function $({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1513
1507
|
c
|
|
1514
1508
|
]);
|
|
1515
1509
|
}
|
|
1516
|
-
function
|
|
1510
|
+
function Kt(e) {
|
|
1517
1511
|
let t = G(() => {
|
|
1518
1512
|
throw Error("Cannot call an event handler while rendering.");
|
|
1519
1513
|
});
|
|
@@ -1521,19 +1515,19 @@ function Ut(e) {
|
|
|
1521
1515
|
t.current = e;
|
|
1522
1516
|
}, [e]), H((...e) => t.current?.(...e), [t]);
|
|
1523
1517
|
}
|
|
1524
|
-
var
|
|
1525
|
-
function
|
|
1526
|
-
let n =
|
|
1518
|
+
var qt = /* @__PURE__ */ new WeakMap();
|
|
1519
|
+
function Jt(e = !1, t = document) {
|
|
1520
|
+
let n = qt.get(t);
|
|
1527
1521
|
if (n === void 0 || e) {
|
|
1528
1522
|
let e = t.createElement("div"), r = e.style;
|
|
1529
1523
|
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
1530
1524
|
let i = t.createElement("div"), a = i.style;
|
|
1531
|
-
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e),
|
|
1525
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), qt.set(t, n);
|
|
1532
1526
|
}
|
|
1533
1527
|
return n;
|
|
1534
1528
|
}
|
|
1535
|
-
function
|
|
1536
|
-
if (t === "horizontal" && n) switch (
|
|
1529
|
+
function $({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1530
|
+
if (t === "horizontal" && n) switch (Jt(!1, e?.ownerDocument ?? document)) {
|
|
1537
1531
|
case "negative": return -r;
|
|
1538
1532
|
case "positive-descending": if (e) {
|
|
1539
1533
|
let { clientWidth: t, scrollWidth: n } = e;
|
|
@@ -1542,8 +1536,8 @@ function Kt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1542
1536
|
}
|
|
1543
1537
|
return r;
|
|
1544
1538
|
}
|
|
1545
|
-
function
|
|
1546
|
-
let r =
|
|
1539
|
+
function Yt({ container: e, element: t, onChange: n }) {
|
|
1540
|
+
let r = Z(t), i = Wt(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
1547
1541
|
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
1548
1542
|
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
1549
1543
|
for (let e of l) o?.unobserve(e);
|
|
@@ -1560,33 +1554,33 @@ function qt({ container: e, element: t, onChange: n }) {
|
|
|
1560
1554
|
o?.disconnect(), c?.disconnect();
|
|
1561
1555
|
};
|
|
1562
1556
|
}
|
|
1563
|
-
function
|
|
1557
|
+
function Xt(e) {
|
|
1564
1558
|
return e.window === e;
|
|
1565
1559
|
}
|
|
1566
|
-
function
|
|
1567
|
-
return t === "window" ? e ?
|
|
1560
|
+
function Zt(e, t) {
|
|
1561
|
+
return t === "window" ? e ? Z(e) : null : t ?? null;
|
|
1568
1562
|
}
|
|
1569
|
-
function
|
|
1570
|
-
return
|
|
1563
|
+
function Qt(e, t) {
|
|
1564
|
+
return Xt(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
1571
1565
|
}
|
|
1572
|
-
function
|
|
1573
|
-
let n =
|
|
1566
|
+
function $t(e, t) {
|
|
1567
|
+
let n = Xt(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
1574
1568
|
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
1575
1569
|
}
|
|
1576
|
-
function
|
|
1577
|
-
let { overflowX: n, overflowY: r } =
|
|
1570
|
+
function en(e, t) {
|
|
1571
|
+
let { overflowX: n, overflowY: r } = Z(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
1578
1572
|
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1579
1573
|
}
|
|
1580
|
-
function
|
|
1574
|
+
function tn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
1581
1575
|
let i = t === "vertical", a, o;
|
|
1582
|
-
if (
|
|
1576
|
+
if (Xt(r)) {
|
|
1583
1577
|
let { documentElement: e } = r.document;
|
|
1584
1578
|
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
1585
1579
|
} else {
|
|
1586
1580
|
let e = r.getBoundingClientRect();
|
|
1587
1581
|
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
1588
1582
|
}
|
|
1589
|
-
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f =
|
|
1583
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = $({
|
|
1590
1584
|
containerElement: e,
|
|
1591
1585
|
direction: t,
|
|
1592
1586
|
isRtl: n,
|
|
@@ -1599,8 +1593,8 @@ function $t({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
|
1599
1593
|
viewportSize: o
|
|
1600
1594
|
};
|
|
1601
1595
|
}
|
|
1602
|
-
function
|
|
1603
|
-
let i =
|
|
1596
|
+
function nn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
1597
|
+
let i = Xt(n) ? n.document.documentElement : n, a = Z(i).getComputedStyle(i), o = (e) => {
|
|
1604
1598
|
let t = parseFloat(e ?? "");
|
|
1605
1599
|
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
1606
1600
|
};
|
|
@@ -1617,26 +1611,26 @@ function en({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
|
1617
1611
|
start: s
|
|
1618
1612
|
};
|
|
1619
1613
|
}
|
|
1620
|
-
function
|
|
1614
|
+
function rn(e, t = "Assertion error") {
|
|
1621
1615
|
if (!e) throw console.error(t), Error(t);
|
|
1622
1616
|
}
|
|
1623
|
-
function
|
|
1617
|
+
function an(e, t) {
|
|
1624
1618
|
if (e === t) return !0;
|
|
1625
|
-
if (!!e != !!t || (
|
|
1619
|
+
if (!!e != !!t || (rn(e !== void 0), rn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1626
1620
|
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
1627
1621
|
return !0;
|
|
1628
1622
|
}
|
|
1629
|
-
function
|
|
1623
|
+
function on({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1630
1624
|
if (t === 0) return 0;
|
|
1631
1625
|
if (typeof n == "number") return t * n;
|
|
1632
1626
|
{
|
|
1633
1627
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1634
|
-
return
|
|
1628
|
+
return rn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1635
1629
|
}
|
|
1636
1630
|
}
|
|
1637
|
-
function
|
|
1631
|
+
function sn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
1638
1632
|
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
1639
|
-
let c = t.get(r), l =
|
|
1633
|
+
let c = t.get(r), l = on({
|
|
1640
1634
|
cachedBounds: t,
|
|
1641
1635
|
itemCount: i,
|
|
1642
1636
|
itemSize: a
|
|
@@ -1648,7 +1642,7 @@ function an({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i,
|
|
|
1648
1642
|
default: return p ? o : o < f ? f : d;
|
|
1649
1643
|
}
|
|
1650
1644
|
}
|
|
1651
|
-
function
|
|
1645
|
+
function cn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1652
1646
|
let a = r - 1;
|
|
1653
1647
|
if (r === 0) return {
|
|
1654
1648
|
startIndexVisible: 0,
|
|
@@ -1682,12 +1676,12 @@ function on({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1682
1676
|
stopIndexOverscan: Math.min(a, s + i)
|
|
1683
1677
|
};
|
|
1684
1678
|
}
|
|
1685
|
-
function
|
|
1679
|
+
function ln({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1686
1680
|
let r = /* @__PURE__ */ new Map();
|
|
1687
1681
|
return {
|
|
1688
1682
|
itemSize: typeof n == "number" ? n : void 0,
|
|
1689
1683
|
get(i) {
|
|
1690
|
-
if (
|
|
1684
|
+
if (rn(i < e, `Invalid index ${i}`), typeof n == "number") return rn(i >= 0, `Invalid index ${i}`), {
|
|
1691
1685
|
size: n,
|
|
1692
1686
|
scrollOffset: i * n
|
|
1693
1687
|
};
|
|
@@ -1699,14 +1693,14 @@ function sn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1699
1693
|
});
|
|
1700
1694
|
else {
|
|
1701
1695
|
let t = r.get(e - 1);
|
|
1702
|
-
|
|
1696
|
+
rn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1703
1697
|
scrollOffset: t.scrollOffset + t.size,
|
|
1704
1698
|
size: a
|
|
1705
1699
|
});
|
|
1706
1700
|
}
|
|
1707
1701
|
}
|
|
1708
1702
|
let a = r.get(i);
|
|
1709
|
-
return
|
|
1703
|
+
return rn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1710
1704
|
},
|
|
1711
1705
|
set(e, t) {
|
|
1712
1706
|
r.set(e, t);
|
|
@@ -1716,8 +1710,8 @@ function sn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1716
1710
|
}
|
|
1717
1711
|
};
|
|
1718
1712
|
}
|
|
1719
|
-
function
|
|
1720
|
-
return W(() =>
|
|
1713
|
+
function un({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1714
|
+
return W(() => ln({
|
|
1721
1715
|
itemCount: e,
|
|
1722
1716
|
itemProps: t,
|
|
1723
1717
|
itemSize: n
|
|
@@ -1727,18 +1721,18 @@ function cn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1727
1721
|
n
|
|
1728
1722
|
]);
|
|
1729
1723
|
}
|
|
1730
|
-
function
|
|
1724
|
+
function dn({ containerSize: e, itemSize: t }) {
|
|
1731
1725
|
let n;
|
|
1732
1726
|
switch (typeof t) {
|
|
1733
1727
|
case "string":
|
|
1734
|
-
|
|
1728
|
+
rn(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), rn(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
1735
1729
|
break;
|
|
1736
1730
|
default: n = t;
|
|
1737
1731
|
}
|
|
1738
1732
|
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
1739
1733
|
}
|
|
1740
|
-
function
|
|
1741
|
-
let f = d !== void 0, p = f ?
|
|
1734
|
+
function fn({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
1735
|
+
let f = d !== void 0, p = f ? Zt(e, d) : e, { height: m = n, width: h = n } = Gt({
|
|
1742
1736
|
defaultHeight: i === "vertical" ? n : void 0,
|
|
1743
1737
|
defaultWidth: i === "horizontal" ? n : void 0,
|
|
1744
1738
|
element: e,
|
|
@@ -1747,7 +1741,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1747
1741
|
}), g = G({
|
|
1748
1742
|
height: 0,
|
|
1749
1743
|
width: 0
|
|
1750
|
-
}), [_, v] = K(n), y = f ? _ : i === "vertical" ? m : h, b =
|
|
1744
|
+
}), [_, v] = K(n), y = f ? _ : i === "vertical" ? m : h, b = dn({
|
|
1751
1745
|
containerSize: y,
|
|
1752
1746
|
itemSize: c
|
|
1753
1747
|
});
|
|
@@ -1764,22 +1758,22 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1764
1758
|
l,
|
|
1765
1759
|
h
|
|
1766
1760
|
]);
|
|
1767
|
-
let x =
|
|
1761
|
+
let x = un({
|
|
1768
1762
|
itemCount: o,
|
|
1769
1763
|
itemProps: s,
|
|
1770
1764
|
itemSize: b
|
|
1771
|
-
}), S =
|
|
1765
|
+
}), S = Ut(), [C] = K(() => S || f ? 0 : r), w = H((e) => x.get(e), [x]), [T, E] = K(() => cn({
|
|
1772
1766
|
cachedBounds: x,
|
|
1773
1767
|
containerScrollOffset: C,
|
|
1774
1768
|
containerSize: y,
|
|
1775
1769
|
itemCount: o,
|
|
1776
1770
|
overscanCount: u
|
|
1777
|
-
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan:
|
|
1771
|
+
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan: ee } = {
|
|
1778
1772
|
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
1779
1773
|
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
1780
1774
|
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
1781
1775
|
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
1782
|
-
},
|
|
1776
|
+
}, A = H(() => on({
|
|
1783
1777
|
cachedBounds: x,
|
|
1784
1778
|
itemCount: o,
|
|
1785
1779
|
itemSize: b
|
|
@@ -1787,14 +1781,14 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1787
1781
|
x,
|
|
1788
1782
|
o,
|
|
1789
1783
|
b
|
|
1790
|
-
]),
|
|
1791
|
-
let n =
|
|
1784
|
+
]), j = H((t) => {
|
|
1785
|
+
let n = $({
|
|
1792
1786
|
containerElement: e,
|
|
1793
1787
|
direction: i,
|
|
1794
1788
|
isRtl: a,
|
|
1795
1789
|
scrollOffset: t
|
|
1796
1790
|
});
|
|
1797
|
-
return
|
|
1791
|
+
return cn({
|
|
1798
1792
|
cachedBounds: x,
|
|
1799
1793
|
containerScrollOffset: n,
|
|
1800
1794
|
containerSize: y,
|
|
@@ -1809,17 +1803,17 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1809
1803
|
a,
|
|
1810
1804
|
o,
|
|
1811
1805
|
u
|
|
1812
|
-
]),
|
|
1806
|
+
]), M = G(!1);
|
|
1813
1807
|
X(() => {
|
|
1814
|
-
if (!e || o === 0 || f ||
|
|
1815
|
-
let t = i === "horizontal" &&
|
|
1816
|
-
if (
|
|
1808
|
+
if (!e || o === 0 || f || M.current || (M.current = !0, r <= 0)) return;
|
|
1809
|
+
let t = i === "horizontal" && Vt(e);
|
|
1810
|
+
if ($({
|
|
1817
1811
|
containerElement: e,
|
|
1818
1812
|
direction: i,
|
|
1819
1813
|
isRtl: t,
|
|
1820
1814
|
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
1821
1815
|
}) !== 0) return;
|
|
1822
|
-
let n =
|
|
1816
|
+
let n = $({
|
|
1823
1817
|
containerElement: e,
|
|
1824
1818
|
direction: i,
|
|
1825
1819
|
isRtl: t,
|
|
@@ -1831,20 +1825,20 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1831
1825
|
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
1832
1826
|
}, [e, o]), X(() => {
|
|
1833
1827
|
if (f && e && p) return;
|
|
1834
|
-
let t = e && !f ?
|
|
1828
|
+
let t = e && !f ? j(i === "vertical" ? e.scrollTop : e.scrollLeft) : cn({
|
|
1835
1829
|
cachedBounds: x,
|
|
1836
1830
|
containerScrollOffset: C,
|
|
1837
1831
|
containerSize: y,
|
|
1838
1832
|
itemCount: o,
|
|
1839
1833
|
overscanCount: u
|
|
1840
1834
|
});
|
|
1841
|
-
E((e) =>
|
|
1835
|
+
E((e) => an(t, e) ? e : t);
|
|
1842
1836
|
}, [
|
|
1843
1837
|
x,
|
|
1844
1838
|
e,
|
|
1845
1839
|
y,
|
|
1846
1840
|
i,
|
|
1847
|
-
|
|
1841
|
+
j,
|
|
1848
1842
|
C,
|
|
1849
1843
|
f,
|
|
1850
1844
|
o,
|
|
@@ -1854,19 +1848,19 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1854
1848
|
if (!e || f) return;
|
|
1855
1849
|
let t = () => {
|
|
1856
1850
|
E((t) => {
|
|
1857
|
-
let { scrollLeft: n, scrollTop: r } = e, s =
|
|
1851
|
+
let { scrollLeft: n, scrollTop: r } = e, s = $({
|
|
1858
1852
|
containerElement: e,
|
|
1859
1853
|
direction: i,
|
|
1860
1854
|
isRtl: a,
|
|
1861
1855
|
scrollOffset: i === "vertical" ? r : n
|
|
1862
|
-
}), c =
|
|
1856
|
+
}), c = cn({
|
|
1863
1857
|
cachedBounds: x,
|
|
1864
1858
|
containerScrollOffset: s,
|
|
1865
1859
|
containerSize: y,
|
|
1866
1860
|
itemCount: o,
|
|
1867
1861
|
overscanCount: u
|
|
1868
1862
|
});
|
|
1869
|
-
return
|
|
1863
|
+
return an(c, t) ? t : c;
|
|
1870
1864
|
});
|
|
1871
1865
|
};
|
|
1872
1866
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1882,34 +1876,34 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1882
1876
|
o,
|
|
1883
1877
|
u
|
|
1884
1878
|
]);
|
|
1885
|
-
let
|
|
1879
|
+
let te = Kt(() => {
|
|
1886
1880
|
if (!e || !p) return;
|
|
1887
|
-
let { offset: t, size: n, viewportSize: r } =
|
|
1881
|
+
let { offset: t, size: n, viewportSize: r } = tn({
|
|
1888
1882
|
containerElement: e,
|
|
1889
1883
|
direction: i,
|
|
1890
1884
|
isRtl: a,
|
|
1891
1885
|
scrollTarget: p
|
|
1892
1886
|
});
|
|
1893
1887
|
v(r);
|
|
1894
|
-
let s =
|
|
1888
|
+
let s = cn({
|
|
1895
1889
|
cachedBounds: x,
|
|
1896
1890
|
containerScrollOffset: t,
|
|
1897
1891
|
containerSize: n,
|
|
1898
1892
|
itemCount: o,
|
|
1899
1893
|
overscanCount: u
|
|
1900
1894
|
});
|
|
1901
|
-
E((e) =>
|
|
1895
|
+
E((e) => an(s, e) ? e : s);
|
|
1902
1896
|
});
|
|
1903
1897
|
return X(() => {
|
|
1904
|
-
f &&
|
|
1898
|
+
f && te();
|
|
1905
1899
|
}), X(() => {
|
|
1906
1900
|
if (!f || !e || !p) return;
|
|
1907
|
-
let t =
|
|
1901
|
+
let t = Z(e), n = () => te();
|
|
1908
1902
|
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
1909
|
-
let r, i =
|
|
1910
|
-
i && !
|
|
1911
|
-
let a =
|
|
1912
|
-
container:
|
|
1903
|
+
let r, i = Wt(e);
|
|
1904
|
+
i && !Xt(p) && (r = new i(n), r.observe(p));
|
|
1905
|
+
let a = Yt({
|
|
1906
|
+
container: Xt(p) ? p.document.documentElement : p,
|
|
1913
1907
|
element: e,
|
|
1914
1908
|
onChange: n
|
|
1915
1909
|
});
|
|
@@ -1920,13 +1914,13 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1920
1914
|
e,
|
|
1921
1915
|
f,
|
|
1922
1916
|
p,
|
|
1923
|
-
|
|
1917
|
+
te
|
|
1924
1918
|
]), {
|
|
1925
1919
|
getCellBounds: w,
|
|
1926
|
-
getEstimatedSize:
|
|
1927
|
-
getScrollPositionForIndex:
|
|
1920
|
+
getEstimatedSize: A,
|
|
1921
|
+
getScrollPositionForIndex: Kt(({ align: t = "auto", index: n }) => {
|
|
1928
1922
|
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
1929
|
-
if (a.start === 0 && a.end === 0) return
|
|
1923
|
+
if (a.start === 0 && a.end === 0) return sn({
|
|
1930
1924
|
align: t,
|
|
1931
1925
|
cachedBounds: x,
|
|
1932
1926
|
clamp: e,
|
|
@@ -1936,7 +1930,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1936
1930
|
itemCount: o,
|
|
1937
1931
|
itemSize: b
|
|
1938
1932
|
});
|
|
1939
|
-
let s =
|
|
1933
|
+
let s = sn({
|
|
1940
1934
|
align: t,
|
|
1941
1935
|
cachedBounds: x,
|
|
1942
1936
|
clamp: !1,
|
|
@@ -1946,10 +1940,10 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1946
1940
|
itemCount: o,
|
|
1947
1941
|
itemSize: b
|
|
1948
1942
|
}) - a.start;
|
|
1949
|
-
return e ? Math.max(0, Math.min(
|
|
1943
|
+
return e ? Math.max(0, Math.min(A() - i, s)) : s;
|
|
1950
1944
|
};
|
|
1951
|
-
if (f && e && p && !
|
|
1952
|
-
let { viewportOffset: t, viewportSize: n } =
|
|
1945
|
+
if (f && e && p && !en(e, i)) {
|
|
1946
|
+
let { viewportOffset: t, viewportSize: n } = tn({
|
|
1953
1947
|
containerElement: e,
|
|
1954
1948
|
direction: i,
|
|
1955
1949
|
isRtl: a,
|
|
@@ -1958,7 +1952,7 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1958
1952
|
clamp: !1,
|
|
1959
1953
|
containerScrollOffset: t,
|
|
1960
1954
|
containerSize: n,
|
|
1961
|
-
padding:
|
|
1955
|
+
padding: nn({
|
|
1962
1956
|
direction: i,
|
|
1963
1957
|
isRtl: a,
|
|
1964
1958
|
scrollTarget: p,
|
|
@@ -1966,20 +1960,20 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1966
1960
|
})
|
|
1967
1961
|
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
1968
1962
|
return {
|
|
1969
|
-
scrollOffset:
|
|
1963
|
+
scrollOffset: Qt(p, i) + s,
|
|
1970
1964
|
scrollTarget: p
|
|
1971
1965
|
};
|
|
1972
1966
|
}
|
|
1973
1967
|
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
1974
1968
|
clamp: !0,
|
|
1975
|
-
containerScrollOffset:
|
|
1969
|
+
containerScrollOffset: $({
|
|
1976
1970
|
containerElement: e,
|
|
1977
1971
|
direction: i,
|
|
1978
1972
|
isRtl: a,
|
|
1979
1973
|
scrollOffset: s
|
|
1980
1974
|
}),
|
|
1981
1975
|
containerSize: c,
|
|
1982
|
-
padding: e ?
|
|
1976
|
+
padding: e ? nn({
|
|
1983
1977
|
direction: i,
|
|
1984
1978
|
isRtl: a,
|
|
1985
1979
|
scrollTarget: e,
|
|
@@ -1990,14 +1984,14 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1990
1984
|
}
|
|
1991
1985
|
});
|
|
1992
1986
|
if (e && (!f || p)) {
|
|
1993
|
-
if (l =
|
|
1987
|
+
if (l = $({
|
|
1994
1988
|
containerElement: e,
|
|
1995
1989
|
direction: i,
|
|
1996
1990
|
isRtl: a,
|
|
1997
1991
|
scrollOffset: l
|
|
1998
1992
|
}), !f && typeof e.scrollTo != "function") {
|
|
1999
|
-
let e =
|
|
2000
|
-
|
|
1993
|
+
let e = j(l);
|
|
1994
|
+
an(T, e) || E(e);
|
|
2001
1995
|
}
|
|
2002
1996
|
return {
|
|
2003
1997
|
scrollOffset: l,
|
|
@@ -2008,37 +2002,37 @@ function un({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2008
2002
|
scrollTarget: p,
|
|
2009
2003
|
startIndexOverscan: O,
|
|
2010
2004
|
startIndexVisible: D,
|
|
2011
|
-
stopIndexOverscan:
|
|
2005
|
+
stopIndexOverscan: ee,
|
|
2012
2006
|
stopIndexVisible: k
|
|
2013
2007
|
};
|
|
2014
2008
|
}
|
|
2015
|
-
function
|
|
2009
|
+
function pn(e) {
|
|
2016
2010
|
let [t, n] = K(e);
|
|
2017
|
-
return
|
|
2011
|
+
return an(t, e) ? t : (n(e), e);
|
|
2018
2012
|
}
|
|
2019
|
-
function
|
|
2013
|
+
function mn(e, t) {
|
|
2020
2014
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
2021
|
-
return
|
|
2015
|
+
return an(n, a) && an(r, o) && an(i, s);
|
|
2022
2016
|
}
|
|
2023
|
-
var
|
|
2024
|
-
function
|
|
2025
|
-
let t = e.getAttribute(
|
|
2017
|
+
var hn = "data-react-window-index", gn = "data-index";
|
|
2018
|
+
function _n(e) {
|
|
2019
|
+
let t = e.getAttribute(hn) ?? e.getAttribute(gn);
|
|
2026
2020
|
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
2027
2021
|
}
|
|
2028
|
-
var
|
|
2029
|
-
function
|
|
2022
|
+
var vn = 1e3, yn = 500;
|
|
2023
|
+
function bn(e) {
|
|
2030
2024
|
return 1 - (1 - e) ** 3;
|
|
2031
2025
|
}
|
|
2032
|
-
function
|
|
2033
|
-
let c = e === "vertical", l = G(null), u = G(void 0), d =
|
|
2026
|
+
function xn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
2027
|
+
let c = e === "vertical", l = G(null), u = G(void 0), d = Kt(() => {
|
|
2034
2028
|
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
2035
|
-
}), f =
|
|
2036
|
-
let e =
|
|
2029
|
+
}), f = Kt(() => {
|
|
2030
|
+
let e = Z(t);
|
|
2037
2031
|
u.current = {
|
|
2038
2032
|
id: e.requestAnimationFrame(p),
|
|
2039
2033
|
view: e
|
|
2040
2034
|
};
|
|
2041
|
-
}), p =
|
|
2035
|
+
}), p = Kt(() => {
|
|
2042
2036
|
u.current = void 0;
|
|
2043
2037
|
let o = l.current;
|
|
2044
2038
|
if (!o) return;
|
|
@@ -2052,27 +2046,27 @@ function yn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2052
2046
|
index: o.index
|
|
2053
2047
|
});
|
|
2054
2048
|
if (m !== void 0) {
|
|
2055
|
-
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t,
|
|
2049
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, $t(r, e)));
|
|
2056
2050
|
o.animation === void 0 && (o.animation = {
|
|
2057
|
-
deadline: p + (o.smooth ?
|
|
2058
|
-
startOffset:
|
|
2051
|
+
deadline: p + (o.smooth ? yn : 0) + vn,
|
|
2052
|
+
startOffset: Qt(r, e),
|
|
2059
2053
|
startTime: p
|
|
2060
2054
|
});
|
|
2061
|
-
let l = o.smooth ? (p - o.animation.startTime) /
|
|
2055
|
+
let l = o.smooth ? (p - o.animation.startTime) / yn : 1;
|
|
2062
2056
|
if (l < 1) {
|
|
2063
2057
|
let { startOffset: e } = o.animation;
|
|
2064
2058
|
o.stableFrames = 0, r.scrollTo({
|
|
2065
2059
|
behavior: "instant",
|
|
2066
|
-
[c ? "top" : "left"]: e + (s - e) *
|
|
2060
|
+
[c ? "top" : "left"]: e + (s - e) * bn(l)
|
|
2067
2061
|
});
|
|
2068
|
-
} else if (Math.abs(s -
|
|
2062
|
+
} else if (Math.abs(s - Qt(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
2069
2063
|
behavior: "instant",
|
|
2070
2064
|
[c ? "top" : "left"]: s
|
|
2071
2065
|
});
|
|
2072
2066
|
else {
|
|
2073
2067
|
let e = a.current;
|
|
2074
|
-
if (!(e.some((e) =>
|
|
2075
|
-
let t =
|
|
2068
|
+
if (!(e.some((e) => _n(e) === o.index) && e.every((e) => {
|
|
2069
|
+
let t = _n(e);
|
|
2076
2070
|
if (t === void 0 || t >= i) return !0;
|
|
2077
2071
|
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
2078
2072
|
return Math.abs(n(t).size - r) <= 1;
|
|
@@ -2114,7 +2108,7 @@ function yn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2114
2108
|
align: "auto",
|
|
2115
2109
|
index: a
|
|
2116
2110
|
});
|
|
2117
|
-
n = t === void 0 || t.scrollOffset ===
|
|
2111
|
+
n = t === void 0 || t.scrollOffset === Qt(t.scrollTarget, e) ? "auto" : "center";
|
|
2118
2112
|
}
|
|
2119
2113
|
let o = s({
|
|
2120
2114
|
align: n,
|
|
@@ -2146,11 +2140,11 @@ function yn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2146
2140
|
s
|
|
2147
2141
|
]);
|
|
2148
2142
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let r =
|
|
2143
|
+
function Sn({ callback: e, element: t, enabled: n = !0 }) {
|
|
2144
|
+
let r = Kt(e);
|
|
2151
2145
|
U(() => {
|
|
2152
2146
|
if (!n || !t) return;
|
|
2153
|
-
let e =
|
|
2147
|
+
let e = Z(t), i = e.requestAnimationFrame(() => {
|
|
2154
2148
|
i = e.requestAnimationFrame(r);
|
|
2155
2149
|
});
|
|
2156
2150
|
return () => {
|
|
@@ -2162,7 +2156,7 @@ function bn({ callback: e, element: t, enabled: n = !0 }) {
|
|
|
2162
2156
|
r
|
|
2163
2157
|
]);
|
|
2164
2158
|
}
|
|
2165
|
-
function
|
|
2159
|
+
function Cn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
2166
2160
|
if (r < 0 || i < r) return [];
|
|
2167
2161
|
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
2168
2162
|
for (let t of e) {
|
|
@@ -2185,20 +2179,20 @@ function xn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopInde
|
|
|
2185
2179
|
index: r + t
|
|
2186
2180
|
}));
|
|
2187
2181
|
}
|
|
2188
|
-
function
|
|
2182
|
+
function wn(e) {
|
|
2189
2183
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
2190
2184
|
}
|
|
2191
|
-
var
|
|
2192
|
-
function
|
|
2193
|
-
let _ =
|
|
2185
|
+
var Tn = "data-react-window-sizer";
|
|
2186
|
+
function En({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
2187
|
+
let _ = pn(f), v = W(() => je(c, mn), [c]), [y, b] = K(null), x = wn(u), S = W(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = Ut(), [w, T] = K(() => C && x), E = G(u);
|
|
2194
2188
|
X(() => {
|
|
2195
2189
|
w && E.current !== u && T(!1);
|
|
2196
|
-
}, [w, u]),
|
|
2190
|
+
}, [w, u]), Sn({
|
|
2197
2191
|
callback: () => T(!1),
|
|
2198
2192
|
element: y,
|
|
2199
2193
|
enabled: w
|
|
2200
2194
|
});
|
|
2201
|
-
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex:
|
|
2195
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: ee, startIndexOverscan: A, startIndexVisible: j, stopIndexOverscan: M, stopIndexVisible: te } = fn({
|
|
2202
2196
|
containerElement: y,
|
|
2203
2197
|
containerStyle: h,
|
|
2204
2198
|
defaultContainerSize: n,
|
|
@@ -2210,68 +2204,68 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2210
2204
|
onResize: a,
|
|
2211
2205
|
overscanCount: s,
|
|
2212
2206
|
scrollElement: p
|
|
2213
|
-
}),
|
|
2207
|
+
}), ne = G([]), re = xn({
|
|
2214
2208
|
direction: "vertical",
|
|
2215
2209
|
element: y,
|
|
2216
2210
|
getCellBounds: D,
|
|
2217
2211
|
isDynamicSize: x,
|
|
2218
2212
|
itemCount: l,
|
|
2219
|
-
itemElements:
|
|
2213
|
+
itemElements: ne,
|
|
2220
2214
|
scrollTarget: k,
|
|
2221
|
-
getScrollPositionForIndex:
|
|
2215
|
+
getScrollPositionForIndex: ee
|
|
2222
2216
|
});
|
|
2223
|
-
|
|
2217
|
+
Ne(i, () => ({
|
|
2224
2218
|
get element() {
|
|
2225
2219
|
return y;
|
|
2226
2220
|
},
|
|
2227
|
-
scrollToRow:
|
|
2228
|
-
}), [y,
|
|
2229
|
-
let
|
|
2221
|
+
scrollToRow: re
|
|
2222
|
+
}), [y, re]);
|
|
2223
|
+
let N = w && x && A === 0;
|
|
2230
2224
|
X(() => {
|
|
2231
2225
|
if (!y) return;
|
|
2232
|
-
let e = Array.from(y.children).filter((e) => !e.hasAttribute(
|
|
2226
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Tn)), t = Cn({
|
|
2233
2227
|
elements: e,
|
|
2234
|
-
isFlowLayout:
|
|
2228
|
+
isFlowLayout: N,
|
|
2235
2229
|
rowCount: l,
|
|
2236
|
-
startIndex:
|
|
2237
|
-
stopIndex:
|
|
2230
|
+
startIndex: A,
|
|
2231
|
+
stopIndex: M
|
|
2238
2232
|
}), n = t.map(({ element: e }) => e);
|
|
2239
2233
|
if (e.forEach((e) => {
|
|
2240
|
-
n.includes(e) || e.removeAttribute(
|
|
2234
|
+
n.includes(e) || e.removeAttribute(hn);
|
|
2241
2235
|
}), t.forEach(({ element: e, index: t }) => {
|
|
2242
|
-
e.setAttribute(
|
|
2243
|
-
}),
|
|
2236
|
+
e.setAttribute(hn, `${t}`);
|
|
2237
|
+
}), ne.current = n, x) return u.observeRowElements(n);
|
|
2244
2238
|
}, [
|
|
2245
2239
|
v,
|
|
2246
2240
|
y,
|
|
2247
2241
|
x,
|
|
2248
|
-
|
|
2242
|
+
N,
|
|
2249
2243
|
l,
|
|
2250
2244
|
u,
|
|
2251
2245
|
d,
|
|
2252
2246
|
_,
|
|
2253
|
-
|
|
2254
|
-
|
|
2247
|
+
A,
|
|
2248
|
+
M
|
|
2255
2249
|
]), U(() => {
|
|
2256
|
-
|
|
2257
|
-
startIndex: M,
|
|
2258
|
-
stopIndex: P
|
|
2259
|
-
}, {
|
|
2250
|
+
A >= 0 && M >= 0 && o && o({
|
|
2260
2251
|
startIndex: j,
|
|
2261
|
-
stopIndex:
|
|
2252
|
+
stopIndex: te
|
|
2253
|
+
}, {
|
|
2254
|
+
startIndex: A,
|
|
2255
|
+
stopIndex: M
|
|
2262
2256
|
});
|
|
2263
2257
|
}, [
|
|
2264
2258
|
o,
|
|
2259
|
+
A,
|
|
2265
2260
|
j,
|
|
2266
2261
|
M,
|
|
2267
|
-
|
|
2268
|
-
P
|
|
2262
|
+
te
|
|
2269
2263
|
]);
|
|
2270
|
-
let
|
|
2264
|
+
let P = W(() => {
|
|
2271
2265
|
let e = [];
|
|
2272
|
-
if (l > 0) for (let t =
|
|
2266
|
+
if (l > 0) for (let t = A; t <= M; t++) {
|
|
2273
2267
|
let n = D(t);
|
|
2274
|
-
e.push(/* @__PURE__ */
|
|
2268
|
+
e.push(/* @__PURE__ */ ke(v, {
|
|
2275
2269
|
..._,
|
|
2276
2270
|
ariaAttributes: {
|
|
2277
2271
|
"aria-posinset": t + 1,
|
|
@@ -2280,7 +2274,7 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2280
2274
|
},
|
|
2281
2275
|
key: d ? d(t, _) : t,
|
|
2282
2276
|
index: t,
|
|
2283
|
-
style:
|
|
2277
|
+
style: N ? { width: "100%" } : {
|
|
2284
2278
|
position: "absolute",
|
|
2285
2279
|
left: 0,
|
|
2286
2280
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
@@ -2294,24 +2288,24 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2294
2288
|
v,
|
|
2295
2289
|
D,
|
|
2296
2290
|
x,
|
|
2297
|
-
|
|
2291
|
+
N,
|
|
2298
2292
|
l,
|
|
2299
2293
|
d,
|
|
2300
2294
|
_,
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
]),
|
|
2295
|
+
A,
|
|
2296
|
+
M
|
|
2297
|
+
]), F = /* @__PURE__ */ B("div", {
|
|
2304
2298
|
"aria-hidden": !0,
|
|
2305
|
-
[
|
|
2299
|
+
[Tn]: "",
|
|
2306
2300
|
style: {
|
|
2307
|
-
position:
|
|
2308
|
-
top:
|
|
2301
|
+
position: N ? "absolute" : void 0,
|
|
2302
|
+
top: N ? 0 : void 0,
|
|
2309
2303
|
height: O(),
|
|
2310
2304
|
width: "100%",
|
|
2311
2305
|
zIndex: -1
|
|
2312
2306
|
}
|
|
2313
|
-
}, "sizer"),
|
|
2314
|
-
return
|
|
2307
|
+
}, "sizer"), I = /* @__PURE__ */ B(Oe, { children: e }, "children"), L = /* @__PURE__ */ B(Oe, { children: P }, "rows");
|
|
2308
|
+
return ke(m, {
|
|
2315
2309
|
role: "list",
|
|
2316
2310
|
...g,
|
|
2317
2311
|
className: t,
|
|
@@ -2325,9 +2319,9 @@ function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2325
2319
|
},
|
|
2326
2320
|
...h
|
|
2327
2321
|
}
|
|
2328
|
-
}, ...
|
|
2322
|
+
}, ...N ? [I, L] : [L, I], F);
|
|
2329
2323
|
}
|
|
2330
|
-
var
|
|
2324
|
+
var Dn = /* @__PURE__ */ Object.assign(En, { displayName: "List" }), On = {
|
|
2331
2325
|
search: "_search_5skzl_1",
|
|
2332
2326
|
divider: "_divider_5skzl_5",
|
|
2333
2327
|
item: "_item_5skzl_9",
|
|
@@ -2336,29 +2330,29 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2336
2330
|
stateLabel: "_stateLabel_5skzl_27",
|
|
2337
2331
|
itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
|
|
2338
2332
|
itemSelectedText: "_itemSelectedText_5skzl_41"
|
|
2339
|
-
},
|
|
2340
|
-
let p = r[e], m =
|
|
2333
|
+
}, kn = 44, An = 8, jn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
|
|
2334
|
+
let p = r[e], m = Rt(p.iconUrl, p.type, p.displayName ?? p.id, v.SM), g = p.id === i;
|
|
2341
2335
|
return /* @__PURE__ */ B("div", {
|
|
2342
2336
|
style: t,
|
|
2343
2337
|
...n,
|
|
2344
2338
|
children: /* @__PURE__ */ B(h, {
|
|
2345
2339
|
type: "button",
|
|
2346
2340
|
"aria-current": g ? "true" : void 0,
|
|
2347
|
-
className: l(
|
|
2341
|
+
className: l(On.item, "h-full w-full gap-3 px-4", g && u && On.itemSelectedBackground, g && d && On.itemSelectedText, s, g && c, q.modelMenuItem, g && q.modelMenuItemSelected),
|
|
2348
2342
|
iconBefore: /* @__PURE__ */ B("span", {
|
|
2349
|
-
className:
|
|
2343
|
+
className: On.itemIcon,
|
|
2350
2344
|
children: m
|
|
2351
2345
|
}),
|
|
2352
2346
|
label: /* @__PURE__ */ V("span", {
|
|
2353
2347
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
2354
|
-
children: [/* @__PURE__ */ B(
|
|
2348
|
+
children: [/* @__PURE__ */ B(T, {
|
|
2355
2349
|
text: p.displayName ?? p.id,
|
|
2356
2350
|
query: o,
|
|
2357
2351
|
maxLines: 1,
|
|
2358
2352
|
className: l(a, "min-w-0 flex-1 text-start")
|
|
2359
|
-
}), g && /* @__PURE__ */ B(
|
|
2353
|
+
}), g && /* @__PURE__ */ B(_e, {
|
|
2360
2354
|
size: v.SM,
|
|
2361
|
-
className:
|
|
2355
|
+
className: On.checkIcon,
|
|
2362
2356
|
"aria-hidden": !0,
|
|
2363
2357
|
stroke: y
|
|
2364
2358
|
})]
|
|
@@ -2366,24 +2360,24 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2366
2360
|
onClick: () => f(p.id)
|
|
2367
2361
|
})
|
|
2368
2362
|
});
|
|
2369
|
-
},
|
|
2370
|
-
let [b,
|
|
2363
|
+
}, Mn = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _, searchQuery: v, onSearchQueryChange: y }) => {
|
|
2364
|
+
let [b, x] = K(""), C = v ?? b, w = y ?? x;
|
|
2371
2365
|
U(() => {
|
|
2372
|
-
e ||
|
|
2366
|
+
e || x("");
|
|
2373
2367
|
}, [e]);
|
|
2374
|
-
let
|
|
2368
|
+
let T = a && a.length > 0, D = u !== void 0, O = !T && !D ? d ?? f : void 0, k = T ? Lt(a, C) : [], ee = (e) => {
|
|
2375
2369
|
s(e), i();
|
|
2376
|
-
},
|
|
2370
|
+
}, A = _?.colors, j = c({
|
|
2377
2371
|
"--ci-sheet-divider": g?.divider,
|
|
2378
|
-
"--ci-sheet-text":
|
|
2379
|
-
"--ci-sheet-item-hover":
|
|
2372
|
+
"--ci-sheet-text": A?.itemText ?? g?.itemText,
|
|
2373
|
+
"--ci-sheet-item-hover": A?.itemHoverBackground ?? g?.itemHoverBg,
|
|
2380
2374
|
"--ci-sheet-item-active": g?.itemActiveBg,
|
|
2381
|
-
"--ci-sheet-icon":
|
|
2382
|
-
"--ci-check-icon":
|
|
2383
|
-
"--ci-sheet-selected-bg":
|
|
2384
|
-
"--ci-sheet-selected-text":
|
|
2375
|
+
"--ci-sheet-icon": A?.itemText ?? g?.itemIcon,
|
|
2376
|
+
"--ci-check-icon": A?.checkIcon ?? g?.checkIcon,
|
|
2377
|
+
"--ci-sheet-selected-bg": A?.selectedItemBackground,
|
|
2378
|
+
"--ci-sheet-selected-text": A?.selectedItemText
|
|
2385
2379
|
});
|
|
2386
|
-
return /* @__PURE__ */ B(
|
|
2380
|
+
return /* @__PURE__ */ B(Le, {
|
|
2387
2381
|
isOpen: e,
|
|
2388
2382
|
title: t,
|
|
2389
2383
|
closeLabel: n,
|
|
@@ -2394,33 +2388,33 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2394
2388
|
colors: g?.shell,
|
|
2395
2389
|
children: /* @__PURE__ */ V("div", {
|
|
2396
2390
|
className: "contents",
|
|
2397
|
-
style:
|
|
2391
|
+
style: j,
|
|
2398
2392
|
children: [
|
|
2399
|
-
/* @__PURE__ */ B(
|
|
2393
|
+
/* @__PURE__ */ B(E, {
|
|
2400
2394
|
visuallyHidden: !0,
|
|
2401
2395
|
children: D ? u : null
|
|
2402
2396
|
}),
|
|
2403
|
-
|
|
2397
|
+
T && !D && /* @__PURE__ */ V(de, { children: [/* @__PURE__ */ B("div", {
|
|
2404
2398
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
2405
|
-
className: l("shrink-0 px-4 py-[10px]",
|
|
2406
|
-
children: /* @__PURE__ */ B(
|
|
2399
|
+
className: l("shrink-0 px-4 py-[10px]", On.search, _?.searchHeaderClassName, q.modelMenuSearch),
|
|
2400
|
+
children: /* @__PURE__ */ B(ie, {
|
|
2407
2401
|
value: C,
|
|
2408
2402
|
placeholder: r,
|
|
2409
|
-
size:
|
|
2403
|
+
size: S.Standard,
|
|
2410
2404
|
onChange: (e) => w(e ?? "")
|
|
2411
2405
|
})
|
|
2412
|
-
}), /* @__PURE__ */ B("div", { className: l(
|
|
2413
|
-
D ? /* @__PURE__ */ B(
|
|
2406
|
+
}), /* @__PURE__ */ B("div", { className: l(On.divider, "h-px shrink-0") })] }),
|
|
2407
|
+
D ? /* @__PURE__ */ B(Ft, {}) : O ? /* @__PURE__ */ B("div", {
|
|
2414
2408
|
role: "list",
|
|
2415
|
-
className: l(
|
|
2409
|
+
className: l(On.stateLabel, h, "px-4 py-4"),
|
|
2416
2410
|
children: O
|
|
2417
|
-
}) : /* @__PURE__ */ B(
|
|
2411
|
+
}) : /* @__PURE__ */ B(Dn, {
|
|
2418
2412
|
role: "list",
|
|
2419
2413
|
className: "overflow-y-auto",
|
|
2420
|
-
style: { height: Math.min(k.length,
|
|
2421
|
-
rowComponent:
|
|
2414
|
+
style: { height: Math.min(k.length, An) * kn },
|
|
2415
|
+
rowComponent: jn,
|
|
2422
2416
|
rowCount: k.length,
|
|
2423
|
-
rowHeight:
|
|
2417
|
+
rowHeight: kn,
|
|
2424
2418
|
rowProps: {
|
|
2425
2419
|
items: k,
|
|
2426
2420
|
selectedDeploymentId: o,
|
|
@@ -2428,18 +2422,18 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2428
2422
|
query: C,
|
|
2429
2423
|
itemClassName: _?.itemClassName,
|
|
2430
2424
|
selectedItemClassName: _?.selectedItemClassName,
|
|
2431
|
-
hasSelectedBackground: !!
|
|
2432
|
-
hasSelectedText: !!
|
|
2433
|
-
onSelect:
|
|
2425
|
+
hasSelectedBackground: !!A?.selectedItemBackground,
|
|
2426
|
+
hasSelectedText: !!A?.selectedItemText,
|
|
2427
|
+
onSelect: ee
|
|
2434
2428
|
}
|
|
2435
2429
|
})
|
|
2436
2430
|
]
|
|
2437
2431
|
})
|
|
2438
2432
|
});
|
|
2439
|
-
},
|
|
2440
|
-
let [
|
|
2441
|
-
|
|
2442
|
-
}, { searchQuery:
|
|
2433
|
+
}, Nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: u, isMobile: d, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: g, onPickerToggle: _, onPickerOpenChange: S }) => {
|
|
2434
|
+
let [C, T] = K(!1), E = g ?? C, D = (e) => {
|
|
2435
|
+
T(e), S?.(e), N(e);
|
|
2436
|
+
}, { searchQuery: O, onSearchQueryChange: k, selectorIcon: ee, selectorAriaLabel: A, selectedLabel: j, selectedVersion: M, menuItems: te, menuHeader: ne, menuStyle: re, onOpenChange: N } = Bt({
|
|
2443
2437
|
deployments: e,
|
|
2444
2438
|
selectedDeploymentId: t,
|
|
2445
2439
|
onDeploymentChange: n,
|
|
@@ -2447,43 +2441,43 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2447
2441
|
styles: i
|
|
2448
2442
|
});
|
|
2449
2443
|
if (!e) return null;
|
|
2450
|
-
let
|
|
2444
|
+
let P = u || f, F = P ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, I = /* @__PURE__ */ B(ve, {
|
|
2451
2445
|
size: v.SM,
|
|
2452
2446
|
className: l(Y.modelSelectorCaret, q.modelSelectorCaret),
|
|
2453
2447
|
"aria-hidden": !0,
|
|
2454
2448
|
stroke: y
|
|
2455
2449
|
}), L = /* @__PURE__ */ B("span", {
|
|
2456
2450
|
className: l("flex shrink-0 items-center", q.modelSelectorIcon),
|
|
2457
|
-
children:
|
|
2451
|
+
children: ee
|
|
2458
2452
|
});
|
|
2459
|
-
if (d) return /* @__PURE__ */ V(
|
|
2453
|
+
if (d) return /* @__PURE__ */ V(de, { children: [/* @__PURE__ */ B(w, {
|
|
2460
2454
|
tooltipProps: { tooltip: j },
|
|
2461
2455
|
icon: /* @__PURE__ */ V("div", {
|
|
2462
2456
|
className: "flex items-center gap-1",
|
|
2463
2457
|
children: [L, I]
|
|
2464
2458
|
}),
|
|
2465
2459
|
"aria-label": A,
|
|
2466
|
-
"aria-disabled":
|
|
2460
|
+
"aria-disabled": P || void 0,
|
|
2467
2461
|
onClick: () => {
|
|
2468
|
-
|
|
2462
|
+
P || D(!0);
|
|
2469
2463
|
},
|
|
2470
|
-
className: l("w-[50px]", Y.modelSelectorButton,
|
|
2471
|
-
}), m ? /* @__PURE__ */ B(
|
|
2472
|
-
isOpen:
|
|
2464
|
+
className: l("w-[50px]", Y.modelSelectorButton, F, q.modelSelectorButton)
|
|
2465
|
+
}), m ? /* @__PURE__ */ B(Le, {
|
|
2466
|
+
isOpen: E,
|
|
2473
2467
|
title: r?.ariaLabel ?? "Select model",
|
|
2474
2468
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2475
|
-
onClose: () =>
|
|
2469
|
+
onClose: () => D(!1),
|
|
2476
2470
|
style: p,
|
|
2477
2471
|
className: l(i?.className, q.modelMenu),
|
|
2478
|
-
children: m(() =>
|
|
2479
|
-
}) : /* @__PURE__ */ B(
|
|
2480
|
-
searchQuery:
|
|
2481
|
-
onSearchQueryChange:
|
|
2482
|
-
isOpen:
|
|
2472
|
+
children: m(() => D(!1))
|
|
2473
|
+
}) : /* @__PURE__ */ B(Mn, {
|
|
2474
|
+
searchQuery: O,
|
|
2475
|
+
onSearchQueryChange: k,
|
|
2476
|
+
isOpen: E,
|
|
2483
2477
|
title: r?.ariaLabel ?? "Select model",
|
|
2484
2478
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2485
2479
|
searchPlaceholder: r?.searchPlaceholder ?? "Search",
|
|
2486
|
-
onClose: () =>
|
|
2480
|
+
onClose: () => D(!1),
|
|
2487
2481
|
deployments: e,
|
|
2488
2482
|
selectedDeploymentId: t,
|
|
2489
2483
|
onSelect: (e) => n?.(e),
|
|
@@ -2498,20 +2492,22 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2498
2492
|
return /* @__PURE__ */ B(b, {
|
|
2499
2493
|
placement: "top-end",
|
|
2500
2494
|
matchReferenceWidth: !1,
|
|
2501
|
-
open:
|
|
2502
|
-
onOpenChange:
|
|
2495
|
+
open: E,
|
|
2496
|
+
onOpenChange: D,
|
|
2503
2497
|
trigger: [],
|
|
2504
2498
|
outsideClosable: !0,
|
|
2505
|
-
|
|
2499
|
+
overlayRole: x.Dialog,
|
|
2500
|
+
overlayAriaLabel: r?.ariaLabel ?? "Select model",
|
|
2501
|
+
renderOverlay: () => m(() => D(!1)),
|
|
2506
2502
|
listClassName: l("w-[368px]!", Y.modelOverlayPanel, i?.className, q.modelMenu),
|
|
2507
2503
|
listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
|
|
2508
2504
|
children: /* @__PURE__ */ B(h, {
|
|
2509
2505
|
"aria-label": A,
|
|
2510
|
-
"aria-disabled":
|
|
2506
|
+
"aria-disabled": P || void 0,
|
|
2511
2507
|
tooltipProps: { tooltip: e },
|
|
2512
|
-
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Y.modelSelectorButton,
|
|
2508
|
+
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Y.modelSelectorButton, F, P && Y.modelSelectorButtonDisabled, q.modelSelectorButton),
|
|
2513
2509
|
onClick: () => {
|
|
2514
|
-
|
|
2510
|
+
P || (_ ? _() : D(!E));
|
|
2515
2511
|
},
|
|
2516
2512
|
iconBefore: L,
|
|
2517
2513
|
iconAfter: I,
|
|
@@ -2530,273 +2526,273 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2530
2526
|
});
|
|
2531
2527
|
}
|
|
2532
2528
|
return /* @__PURE__ */ B("div", {
|
|
2533
|
-
className: l(
|
|
2534
|
-
"aria-disabled":
|
|
2529
|
+
className: l(F),
|
|
2530
|
+
"aria-disabled": P || void 0,
|
|
2535
2531
|
children: /* @__PURE__ */ B(b, {
|
|
2536
|
-
items:
|
|
2537
|
-
menuHeader:
|
|
2532
|
+
items: te,
|
|
2533
|
+
menuHeader: ne,
|
|
2538
2534
|
placement: "bottom-end",
|
|
2539
2535
|
matchReferenceWidth: !1,
|
|
2540
2536
|
maxDropdownHeight: s,
|
|
2541
2537
|
listClassName: l("w-[240px]!", i?.className, q.modelMenu),
|
|
2542
|
-
listStyle:
|
|
2543
|
-
disabled:
|
|
2544
|
-
open:
|
|
2545
|
-
onOpenChange:
|
|
2538
|
+
listStyle: re,
|
|
2539
|
+
disabled: P,
|
|
2540
|
+
open: E,
|
|
2541
|
+
onOpenChange: P ? void 0 : D,
|
|
2546
2542
|
children: /* @__PURE__ */ B(h, {
|
|
2547
2543
|
"aria-label": A,
|
|
2548
|
-
"aria-disabled":
|
|
2544
|
+
"aria-disabled": P || void 0,
|
|
2549
2545
|
tooltipProps: { tooltip: j },
|
|
2550
2546
|
iconBefore: L,
|
|
2551
2547
|
iconAfter: I,
|
|
2552
|
-
className: l("h-auto gap-1 rounded-full! border-0! p-1.5", Y.modelSelectorButton,
|
|
2548
|
+
className: l("h-auto gap-1 rounded-full! border-0! p-1.5", Y.modelSelectorButton, P && Y.modelSelectorButtonDisabled, q.modelSelectorButton)
|
|
2553
2549
|
})
|
|
2554
2550
|
})
|
|
2555
2551
|
});
|
|
2556
|
-
},
|
|
2557
|
-
let
|
|
2558
|
-
|
|
2559
|
-
},
|
|
2560
|
-
"--ci-bg":
|
|
2561
|
-
"--ci-text":
|
|
2562
|
-
"--ci-border":
|
|
2563
|
-
"--ci-border-focus":
|
|
2564
|
-
"--ci-placeholder":
|
|
2565
|
-
"--ci-text-disabled":
|
|
2566
|
-
"--ci-model-selector-caret-color":
|
|
2567
|
-
"--ci-model-selector-hover-bg":
|
|
2568
|
-
"--ci-model-selector-disabled-color":
|
|
2569
|
-
"--ci-model-selector-name-color":
|
|
2570
|
-
"--ci-model-selector-version-color":
|
|
2571
|
-
"--ci-voice-waveform":
|
|
2572
|
-
"--ci-voice-accent":
|
|
2573
|
-
"--ci-mention-highlight-bg":
|
|
2574
|
-
"--ci-mention-highlight-text":
|
|
2575
|
-
"--ci-mention-highlight-unsupported-bg":
|
|
2576
|
-
"--ci-mention-highlight-unsupported-text":
|
|
2577
|
-
"--ci-selection-highlight-bg":
|
|
2578
|
-
}), [
|
|
2552
|
+
}, Pn = Ae(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: m, placeholder: h = "Type a message...", ariaLabel: g, attachLabel: _ = "Attach file", fileAccept: S, addMenuTitle: T = "Add", menuTitle: k = "Menu", menuCloseLabel: ee = "Close", removeLabel: A, retryLabel: j, uploadingLabel: M, expandLabel: te, clickLabel: ne, sendLabel: re, sendTooltip: N, emptyMessageTooltip: P, stopLabel: F, micLabel: I = "Dictate", recordVoiceLabel: L = "Record voice", stopRecordingLabel: ie, discardRecordingLabel: ae, colors: R, typography: z, attachmentTray: oe, modelMenu: se, className: ce, pendingDropFiles: le = [], onDropFilesConsumed: ue, pendingAttachments: pe = [], onPendingAttachmentsConsumed: me, pasteTextThreshold: ge = 4e3, maxMessageLength: _e = 5e4, deployments: ve, selectedDeploymentId: ye, onDeploymentChange: Se, modelSelectorLabels: Ce, initialAttachments: we = [], hideAddButton: Te = !1, hideAttachFile: Ee = !1, hideActionBar: De = !1, actionRowLayout: Oe = dt.Stacked, isInlineActionRowAllowedBelowDesktop: ke = !1, renderFooterActions: Ae, isInputDisabled: je = !1, isModelSelectorDisabled: Me = !1, isSendDisabled: Fe = !1, isAudioMessageSupported: Ie = !1, isVoiceRecordingSupported: Le = Ie, onTranscribeAudio: Re, transcribingLabel: Be, voiceErrorLabel: Ve, sendOnEnter: He = ut.Enter, prefixAttachments: Ue = [], onRemovePrefixAttachment: Ke, chatSettings: qe, toolsMenuItems: Xe, onToolToggle: Ze, canRemoveTools: tt = !0, toolsMenuTitle: at, toolsBackLabel: ot, toolsChipLabels: st, menuOverlays: ct, activeMentions: ft, onBackspaceAtCaret: pt, caretPositionOverride: mt, commandMenu: J, autoFocus: ht = !1, messageHistory: gt, onDialFileSystemClick: _t, dialFileSystemLabel: vt, validateAttachment: yt, onAttachmentClick: bt, modelPickerOverlay: xt, onModelPickerOpenChange: Ct, maximumAttachmentsAmount: wt, onAttachmentsLimitExceeded: Et, isAttachmentsEnabled: Dt = !0, isTextAttachmentsAllowed: Ot = !0, usageLimitsSlot: kt, onMessageTooLong: Nt }, Pt) => {
|
|
2553
|
+
let Ft = d(), It = f(), [Lt, Rt] = K(!1), zt = (e) => {
|
|
2554
|
+
Rt(e), Ct?.(e);
|
|
2555
|
+
}, Bt = Je(gt), X = ft ?? [], Vt = X.length > 0, Ht = W(() => c({
|
|
2556
|
+
"--ci-bg": R?.background,
|
|
2557
|
+
"--ci-text": R?.text,
|
|
2558
|
+
"--ci-border": R?.border,
|
|
2559
|
+
"--ci-border-focus": R?.borderFocus,
|
|
2560
|
+
"--ci-placeholder": R?.placeholder,
|
|
2561
|
+
"--ci-text-disabled": R?.textDisabled,
|
|
2562
|
+
"--ci-model-selector-caret-color": R?.modelSelectorCaret,
|
|
2563
|
+
"--ci-model-selector-hover-bg": R?.modelSelectorHoverBg,
|
|
2564
|
+
"--ci-model-selector-disabled-color": R?.modelSelectorDisabled,
|
|
2565
|
+
"--ci-model-selector-name-color": R?.modelSelectorName,
|
|
2566
|
+
"--ci-model-selector-version-color": R?.modelSelectorVersion,
|
|
2567
|
+
"--ci-voice-waveform": R?.voiceWaveform,
|
|
2568
|
+
"--ci-voice-accent": R?.voiceAccent,
|
|
2569
|
+
"--ci-mention-highlight-bg": R?.mentionHighlightBg,
|
|
2570
|
+
"--ci-mention-highlight-text": R?.mentionHighlightText,
|
|
2571
|
+
"--ci-mention-highlight-unsupported-bg": R?.mentionHighlightUnsupportedBg,
|
|
2572
|
+
"--ci-mention-highlight-unsupported-text": R?.mentionHighlightUnsupportedText,
|
|
2573
|
+
"--ci-selection-highlight-bg": R?.selectionHighlightBg
|
|
2574
|
+
}), [R]), Ut = W(() => _t ? [{
|
|
2579
2575
|
key: "dial-fs",
|
|
2580
|
-
label:
|
|
2581
|
-
icon: /* @__PURE__ */ B(
|
|
2576
|
+
label: vt ?? "DIAL file system",
|
|
2577
|
+
icon: /* @__PURE__ */ B(be, {
|
|
2582
2578
|
size: p,
|
|
2583
2579
|
"aria-hidden": !0,
|
|
2584
2580
|
stroke: y
|
|
2585
2581
|
}),
|
|
2586
|
-
onClick:
|
|
2587
|
-
}] : [], [
|
|
2582
|
+
onClick: _t
|
|
2583
|
+
}] : [], [_t, vt]), { message: Z, setMessage: Wt, textareaRef: Q } = $e({
|
|
2588
2584
|
messageProp: e,
|
|
2589
2585
|
messageRevision: t
|
|
2590
2586
|
});
|
|
2591
2587
|
U(() => {
|
|
2592
|
-
let e =
|
|
2588
|
+
let e = Q.current;
|
|
2593
2589
|
e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
|
|
2594
|
-
}, [
|
|
2595
|
-
n !== void 0 &&
|
|
2596
|
-
}, [n,
|
|
2597
|
-
let { handleUndoKeyDown:
|
|
2590
|
+
}, [Q]), U(() => {
|
|
2591
|
+
n !== void 0 && Q.current?.focus();
|
|
2592
|
+
}, [n, Q]), Ne(Pt, () => ({ getCaretPosition: () => Q.current?.selectionStart ?? Z.length }), [Z, Q]);
|
|
2593
|
+
let { handleUndoKeyDown: Gt, markCaretPlaced: Kt } = nt({
|
|
2598
2594
|
insertion: r,
|
|
2599
|
-
textareaRef:
|
|
2600
|
-
}), { isMenuOpen:
|
|
2595
|
+
textareaRef: Q
|
|
2596
|
+
}), { isMenuOpen: qt, query: Jt, activeWordStart: $, dismiss: Yt, closeOnOutsidePress: Xt, handleCaretMove: Zt, handleValueChange: Qt, listboxId: $t, overlayRef: en, activeOptionId: tn, moveActiveOption: nn, getActiveOption: rn } = Ge({
|
|
2601
2597
|
config: J,
|
|
2602
2598
|
message: Z
|
|
2603
|
-
}),
|
|
2604
|
-
|
|
2605
|
-
let
|
|
2606
|
-
|
|
2607
|
-
},
|
|
2608
|
-
|
|
2609
|
-
let e =
|
|
2610
|
-
|
|
2599
|
+
}), an = G(Zt);
|
|
2600
|
+
an.current = Zt;
|
|
2601
|
+
let on = () => {
|
|
2602
|
+
Zt(Q.current?.selectionStart ?? Z.length);
|
|
2603
|
+
}, sn = G(!1), cn = () => {
|
|
2604
|
+
sn.current ? sn.current = !1 : requestAnimationFrame(() => {
|
|
2605
|
+
let e = Q.current;
|
|
2606
|
+
an.current(e?.selectionStart ?? e?.value.length ?? 0);
|
|
2611
2607
|
});
|
|
2612
|
-
},
|
|
2613
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") &&
|
|
2614
|
-
},
|
|
2615
|
-
let e =
|
|
2608
|
+
}, ln = (e) => {
|
|
2609
|
+
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Zt(e.currentTarget.selectionStart ?? Z.length);
|
|
2610
|
+
}, un = J?.emptyQueryHint != null, dn = J != null && $ != null ? $ + J.triggerPrefix.length : null, fn = dn != null && Z.slice(dn).split("\n", 1)[0] !== "", pn = un && qt && Jt === "" && dn != null && !fn, mn = J != null && qt ? $ ?? 0 : null, hn = G(null), gn = G(null), [_n, vn] = K(null), yn = H(() => {
|
|
2611
|
+
let e = hn.current, t = gn.current;
|
|
2616
2612
|
if (e == null || t == null) {
|
|
2617
|
-
|
|
2613
|
+
vn(null);
|
|
2618
2614
|
return;
|
|
2619
2615
|
}
|
|
2620
2616
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
2621
|
-
|
|
2617
|
+
vn({
|
|
2622
2618
|
left: n.left - r.left,
|
|
2623
2619
|
top: n.top - r.top
|
|
2624
2620
|
});
|
|
2625
2621
|
}, []);
|
|
2626
2622
|
U(() => {
|
|
2627
|
-
if (
|
|
2628
|
-
let e =
|
|
2623
|
+
if (mn == null) return;
|
|
2624
|
+
let e = Q.current;
|
|
2629
2625
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2630
|
-
let t = new ResizeObserver(
|
|
2626
|
+
let t = new ResizeObserver(yn);
|
|
2631
2627
|
return t.observe(e), () => t.disconnect();
|
|
2632
2628
|
}, [
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2629
|
+
mn,
|
|
2630
|
+
Q,
|
|
2631
|
+
yn
|
|
2636
2632
|
]);
|
|
2637
|
-
let
|
|
2638
|
-
if (J == null || (
|
|
2639
|
-
let t = `${J.triggerPrefix}${
|
|
2640
|
-
if (Z.slice(
|
|
2641
|
-
let r = Z.slice(0,
|
|
2642
|
-
|
|
2633
|
+
let bn = H((e) => {
|
|
2634
|
+
if (J == null || (Yt(), !e?.consumeQuery) || (e.returnFocus !== !1 && Q.current?.focus(), $ == null)) return;
|
|
2635
|
+
let t = `${J.triggerPrefix}${Jt}`, n = $ + t.length;
|
|
2636
|
+
if (Z.slice($, n) !== t) return;
|
|
2637
|
+
let r = Z.slice(0, $) + Z.slice(n);
|
|
2638
|
+
Wt(r), Bt.notifyChange(), u?.(r);
|
|
2643
2639
|
}, [
|
|
2644
2640
|
J,
|
|
2641
|
+
Yt,
|
|
2645
2642
|
Jt,
|
|
2646
|
-
Kt,
|
|
2647
2643
|
Z,
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2644
|
+
$,
|
|
2645
|
+
Wt,
|
|
2646
|
+
Bt,
|
|
2651
2647
|
u,
|
|
2652
|
-
|
|
2653
|
-
]),
|
|
2648
|
+
Q
|
|
2649
|
+
]), xn = G(void 0);
|
|
2654
2650
|
U(() => {
|
|
2655
|
-
|
|
2651
|
+
mt != null && xn.current !== t && (xn.current = t, Q.current?.setSelectionRange(mt, mt), Kt(), Zt(mt));
|
|
2656
2652
|
}, [Z]);
|
|
2657
|
-
let
|
|
2658
|
-
|
|
2659
|
-
let { attachments:
|
|
2660
|
-
initialAttachments:
|
|
2653
|
+
let Sn = G(Z);
|
|
2654
|
+
Sn.current = Z;
|
|
2655
|
+
let { attachments: Cn, buildAttachments: wn, addAttachments: Tn, resetAttachments: En, handleRemove: Dn, handleRetry: On, handleExpand: kn, hasBlockedAttachments: An } = ze({
|
|
2656
|
+
initialAttachments: we,
|
|
2661
2657
|
onUploadAttachment: a,
|
|
2662
2658
|
onAttachmentsChange: m,
|
|
2663
|
-
validateAttachment:
|
|
2664
|
-
pendingDropFiles:
|
|
2665
|
-
onDropFilesConsumed:
|
|
2666
|
-
isDropDisabled:
|
|
2667
|
-
pendingAttachments:
|
|
2659
|
+
validateAttachment: yt,
|
|
2660
|
+
pendingDropFiles: le,
|
|
2661
|
+
onDropFilesConsumed: ue,
|
|
2662
|
+
isDropDisabled: je,
|
|
2663
|
+
pendingAttachments: pe,
|
|
2668
2664
|
onPendingAttachmentsConsumed: me,
|
|
2669
2665
|
onExpandPastedText: H((e) => {
|
|
2670
|
-
let t =
|
|
2671
|
-
|
|
2672
|
-
}, [
|
|
2666
|
+
let t = Sn.current, n = t ? `${t}\n${e}` : e;
|
|
2667
|
+
Sn.current = n, Wt(n), u?.(n);
|
|
2668
|
+
}, [Wt, u]),
|
|
2673
2669
|
maximumAttachmentsAmount: wt,
|
|
2674
|
-
baseAttachmentsAmount:
|
|
2675
|
-
onAttachmentsLimitExceeded:
|
|
2676
|
-
}),
|
|
2677
|
-
wn(
|
|
2678
|
-
}, [
|
|
2670
|
+
baseAttachmentsAmount: Ue.length,
|
|
2671
|
+
onAttachmentsLimitExceeded: Et
|
|
2672
|
+
}), jn = H((e) => {
|
|
2673
|
+
Tn(wn([e]));
|
|
2674
|
+
}, [Tn, wn]), Mn = G(!1), [Pn, Fn] = K({
|
|
2679
2675
|
text: "",
|
|
2680
2676
|
revision: 0
|
|
2681
|
-
}), { state:
|
|
2682
|
-
onAttachAudio:
|
|
2677
|
+
}), { state: In, analyserNodeRef: Ln, errorMessage: Rn, startRecording: zn, stopRecording: Bn, discardRecording: Vn } = lt({
|
|
2678
|
+
onAttachAudio: jn,
|
|
2683
2679
|
onTranscribeAudio: Re,
|
|
2684
2680
|
onTranscript: H((e) => {
|
|
2685
2681
|
let t = e.trim();
|
|
2686
2682
|
if (t) {
|
|
2687
|
-
let e =
|
|
2688
|
-
|
|
2683
|
+
let e = Sn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2684
|
+
Sn.current = n, Wt(n), Fn((e) => ({
|
|
2689
2685
|
text: t,
|
|
2690
2686
|
revision: e.revision + 1
|
|
2691
|
-
})),
|
|
2687
|
+
})), Bt.notifyChange(), u?.(n);
|
|
2692
2688
|
}
|
|
2693
2689
|
Mn.current = !0;
|
|
2694
2690
|
}, [
|
|
2695
|
-
|
|
2696
|
-
|
|
2691
|
+
Wt,
|
|
2692
|
+
Bt,
|
|
2697
2693
|
u
|
|
2698
2694
|
]),
|
|
2699
|
-
errorLabel:
|
|
2700
|
-
}),
|
|
2695
|
+
errorLabel: Ve
|
|
2696
|
+
}), Hn = In === rt.Recording || In === rt.Processing;
|
|
2701
2697
|
U(() => {
|
|
2702
|
-
if (
|
|
2698
|
+
if (In === rt.Error || In === rt.Idle && Mn.current) {
|
|
2703
2699
|
Mn.current = !1;
|
|
2704
|
-
let e =
|
|
2700
|
+
let e = Q.current;
|
|
2705
2701
|
if (e != null) {
|
|
2706
|
-
|
|
2702
|
+
sn.current = document.activeElement !== e, e.focus();
|
|
2707
2703
|
let t = e.value.length;
|
|
2708
2704
|
e.setSelectionRange(t, t);
|
|
2709
2705
|
}
|
|
2710
2706
|
}
|
|
2711
|
-
}, [
|
|
2712
|
-
let
|
|
2713
|
-
if (!
|
|
2707
|
+
}, [In, Q]);
|
|
2708
|
+
let Un = G(null), Wn = G(null), Gn = Dt && Ot, { handlePaste: Kn } = he(Tn, Gn ? ge : Infinity), qn = H((e) => {
|
|
2709
|
+
if (!Gn) {
|
|
2714
2710
|
let t = e.clipboardData.getData("text/plain");
|
|
2715
|
-
t.length >=
|
|
2711
|
+
t.length >= _e && Nt?.(t.length, _e);
|
|
2716
2712
|
}
|
|
2717
|
-
if (
|
|
2713
|
+
if (Kn(e), e.defaultPrevented) return;
|
|
2718
2714
|
let t = e.clipboardData.getData("text/plain").replace(/\r\n?/g, "\n");
|
|
2719
2715
|
t !== "" && J?.onTextPaste?.(t);
|
|
2720
2716
|
}, [
|
|
2721
|
-
Wn,
|
|
2722
|
-
ge,
|
|
2723
|
-
Mt,
|
|
2724
2717
|
Gn,
|
|
2718
|
+
_e,
|
|
2719
|
+
Nt,
|
|
2720
|
+
Kn,
|
|
2725
2721
|
J
|
|
2726
|
-
]),
|
|
2722
|
+
]), Jn = Z.trim().length > 0 || Cn.length > 0, Yn = Jn && !An && !Fe && !Hn, [Xn, Zn] = K([]), Qn = (Xe ?? []).map((e) => e.id).join("|");
|
|
2727
2723
|
U(() => {
|
|
2728
|
-
|
|
2729
|
-
}, [
|
|
2730
|
-
let
|
|
2731
|
-
let e =
|
|
2732
|
-
return
|
|
2724
|
+
Zn([]);
|
|
2725
|
+
}, [Qn]);
|
|
2726
|
+
let $n = W(() => {
|
|
2727
|
+
let e = Xe ?? [];
|
|
2728
|
+
return It ? e.filter((e) => e.isSelected) : tt ? e.filter((e) => e.isSelected || !Xn.includes(e.id)) : e;
|
|
2733
2729
|
}, [
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
]),
|
|
2739
|
-
|
|
2740
|
-
}, [
|
|
2741
|
-
if (
|
|
2742
|
-
if (Z.length >=
|
|
2743
|
-
|
|
2730
|
+
Xe,
|
|
2731
|
+
Xn,
|
|
2732
|
+
tt,
|
|
2733
|
+
It
|
|
2734
|
+
]), er = H((e) => {
|
|
2735
|
+
Zn((t) => t.includes(e) ? t : [...t, e]), Xe?.find((t) => t.id === e)?.isSelected && Ze?.(e);
|
|
2736
|
+
}, [Xe, Ze]), tr = ve === void 0 || ye != null, nr = Ie && !s, rr = async () => {
|
|
2737
|
+
if (Fe || Hn) return;
|
|
2738
|
+
if (Z.length >= _e) {
|
|
2739
|
+
Nt?.(Z.length, _e);
|
|
2744
2740
|
return;
|
|
2745
2741
|
}
|
|
2746
|
-
let e = Z, t =
|
|
2747
|
-
|
|
2742
|
+
let e = Z, t = Cn;
|
|
2743
|
+
Wt(""), Bt.reset();
|
|
2748
2744
|
try {
|
|
2749
2745
|
await i?.(e, t), t.forEach((e) => {
|
|
2750
2746
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2751
|
-
}),
|
|
2747
|
+
}), En([]);
|
|
2752
2748
|
} catch {
|
|
2753
|
-
|
|
2749
|
+
Wt(e), En(t);
|
|
2754
2750
|
}
|
|
2755
|
-
},
|
|
2756
|
-
if (!
|
|
2757
|
-
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(),
|
|
2758
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(),
|
|
2751
|
+
}, ir = (e) => He === ut.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, ar = (e) => {
|
|
2752
|
+
if (!qt || e.nativeEvent.isComposing) return !1;
|
|
2753
|
+
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Yt(), !0;
|
|
2754
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), nn(e.key === "ArrowDown" ? We.Next : We.Previous), !0;
|
|
2759
2755
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2760
|
-
let t =
|
|
2761
|
-
return t == null ?
|
|
2762
|
-
},
|
|
2763
|
-
if (!
|
|
2764
|
-
if (!e.nativeEvent.isComposing && !
|
|
2756
|
+
let t = rn();
|
|
2757
|
+
return t == null ? ir(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2758
|
+
}, or = (e) => {
|
|
2759
|
+
if (!Hn && !Gt(e) && !ar(e)) {
|
|
2760
|
+
if (!e.nativeEvent.isComposing && !je && !s) {
|
|
2765
2761
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2766
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2762
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Bt.navigate(e.key === "ArrowUp" ? "up" : "down", Z, t);
|
|
2767
2763
|
if (n !== null) {
|
|
2768
|
-
e.preventDefault(),
|
|
2764
|
+
e.preventDefault(), Wt(n);
|
|
2769
2765
|
return;
|
|
2770
2766
|
}
|
|
2771
2767
|
}
|
|
2772
|
-
if (e.key === "Backspace" &&
|
|
2773
|
-
let t =
|
|
2768
|
+
if (e.key === "Backspace" && pt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
|
|
2769
|
+
let t = pt(e.currentTarget.selectionStart);
|
|
2774
2770
|
if (t != null) {
|
|
2775
2771
|
e.preventDefault();
|
|
2776
2772
|
let n = e.currentTarget;
|
|
2777
|
-
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) ||
|
|
2773
|
+
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || et(n, Z.slice(0, t.start) + Z.slice(t.start + t.length), t.start);
|
|
2778
2774
|
return;
|
|
2779
2775
|
}
|
|
2780
2776
|
}
|
|
2781
2777
|
}
|
|
2782
|
-
e.key === "Enter" &&
|
|
2778
|
+
e.key === "Enter" && ir(e) && (e.preventDefault(), !s && Yn && tr && !je && rr());
|
|
2783
2779
|
}
|
|
2784
|
-
},
|
|
2780
|
+
}, sr = (e) => {
|
|
2785
2781
|
let t = Array.from(e.target.files ?? []);
|
|
2786
2782
|
if (t.length === 0) return;
|
|
2787
|
-
let n =
|
|
2788
|
-
e.target.value = "",
|
|
2789
|
-
},
|
|
2783
|
+
let n = wn(t);
|
|
2784
|
+
e.target.value = "", Tn(n);
|
|
2785
|
+
}, cr = W(() => {
|
|
2790
2786
|
let e = [];
|
|
2791
|
-
return
|
|
2792
|
-
offset:
|
|
2787
|
+
return mn != null && e.push({
|
|
2788
|
+
offset: mn,
|
|
2793
2789
|
node: /* @__PURE__ */ B("span", {
|
|
2794
|
-
ref:
|
|
2790
|
+
ref: hn,
|
|
2795
2791
|
"aria-hidden": !0,
|
|
2796
2792
|
className: "inline-block h-lh w-0 align-text-top"
|
|
2797
2793
|
}, "caret-marker")
|
|
2798
|
-
}),
|
|
2799
|
-
offset:
|
|
2794
|
+
}), pn && J != null && dn != null && e.push({
|
|
2795
|
+
offset: dn,
|
|
2800
2796
|
node: /* @__PURE__ */ B("span", {
|
|
2801
2797
|
className: Y.commandHint,
|
|
2802
2798
|
"aria-hidden": !0,
|
|
@@ -2805,79 +2801,80 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2805
2801
|
}, "command-hint")
|
|
2806
2802
|
}), e;
|
|
2807
2803
|
}, [
|
|
2804
|
+
mn,
|
|
2808
2805
|
pn,
|
|
2809
|
-
fn,
|
|
2810
2806
|
J,
|
|
2811
|
-
|
|
2812
|
-
]),
|
|
2813
|
-
textareaRef:
|
|
2807
|
+
dn
|
|
2808
|
+
]), lr = Vt || cr.length > 0, { mirrorRef: ur, selectionRects: dr, updateSelectionRects: fr, syncMirrorToTextarea: pr } = Qe({
|
|
2809
|
+
textareaRef: Q,
|
|
2814
2810
|
message: Z,
|
|
2815
|
-
isMirrorActive:
|
|
2811
|
+
isMirrorActive: lr
|
|
2816
2812
|
});
|
|
2817
|
-
|
|
2818
|
-
|
|
2813
|
+
Pe(() => {
|
|
2814
|
+
yn();
|
|
2819
2815
|
}, [
|
|
2820
|
-
|
|
2821
|
-
|
|
2816
|
+
yn,
|
|
2817
|
+
mn,
|
|
2822
2818
|
Z
|
|
2823
2819
|
]);
|
|
2824
|
-
let
|
|
2825
|
-
className: l(Y.textarea,
|
|
2826
|
-
ref:
|
|
2827
|
-
autoFocus:
|
|
2820
|
+
let mr = /* @__PURE__ */ B("textarea", {
|
|
2821
|
+
className: l(Y.textarea, lr && Y.textareaMentionMode, z?.fontClassName || "dial-body-paragraph-text", "relative z-0 field-sizing-content max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
|
|
2822
|
+
ref: Q,
|
|
2823
|
+
autoFocus: ht,
|
|
2828
2824
|
value: Z,
|
|
2829
2825
|
onChange: (e) => {
|
|
2830
|
-
|
|
2826
|
+
Wt(e.target.value), Bt.notifyChange();
|
|
2831
2827
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2832
|
-
|
|
2828
|
+
Qt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2833
2829
|
},
|
|
2834
|
-
onSelect:
|
|
2830
|
+
onSelect: fr,
|
|
2835
2831
|
onScroll: () => {
|
|
2836
|
-
|
|
2832
|
+
pr(), mn != null && yn();
|
|
2837
2833
|
},
|
|
2838
|
-
onFocus:
|
|
2839
|
-
onClick:
|
|
2840
|
-
onKeyDown:
|
|
2841
|
-
onKeyUp:
|
|
2842
|
-
onPaste:
|
|
2834
|
+
onFocus: cn,
|
|
2835
|
+
onClick: on,
|
|
2836
|
+
onKeyDown: or,
|
|
2837
|
+
onKeyUp: ln,
|
|
2838
|
+
onPaste: qn,
|
|
2843
2839
|
placeholder: h,
|
|
2844
2840
|
"aria-label": g,
|
|
2845
2841
|
"aria-autocomplete": J == null ? void 0 : "list",
|
|
2846
|
-
"aria-controls":
|
|
2847
|
-
"aria-activedescendant":
|
|
2848
|
-
"aria-hidden":
|
|
2849
|
-
disabled:
|
|
2850
|
-
readOnly:
|
|
2842
|
+
"aria-controls": qt ? $t : void 0,
|
|
2843
|
+
"aria-activedescendant": tn ?? void 0,
|
|
2844
|
+
"aria-hidden": Vt ? !0 : void 0,
|
|
2845
|
+
disabled: je,
|
|
2846
|
+
readOnly: Hn,
|
|
2851
2847
|
rows: 1
|
|
2852
|
-
}),
|
|
2848
|
+
}), hr = /* @__PURE__ */ V(de, { children: [mr, J != null && /* @__PURE__ */ B("div", {
|
|
2853
2849
|
"aria-hidden": !0,
|
|
2854
|
-
className: l("pointer-events-none absolute",
|
|
2850
|
+
className: l("pointer-events-none absolute", z?.fontClassName || "dial-body-paragraph-text"),
|
|
2855
2851
|
style: {
|
|
2856
|
-
left:
|
|
2857
|
-
top:
|
|
2852
|
+
left: _n?.left ?? 0,
|
|
2853
|
+
top: _n?.top ?? 0
|
|
2858
2854
|
},
|
|
2859
2855
|
children: /* @__PURE__ */ B(b, {
|
|
2860
|
-
open:
|
|
2856
|
+
open: qt,
|
|
2861
2857
|
onOpenChange: (e) => {
|
|
2862
|
-
e ||
|
|
2858
|
+
e || Xt();
|
|
2863
2859
|
},
|
|
2864
2860
|
placement: "top-start",
|
|
2865
2861
|
trigger: [],
|
|
2866
2862
|
initialFocus: -1,
|
|
2863
|
+
overlayRole: x.None,
|
|
2867
2864
|
matchReferenceWidth: !1,
|
|
2868
|
-
outsidePressIgnoreRef:
|
|
2865
|
+
outsidePressIgnoreRef: Q,
|
|
2869
2866
|
renderOverlay: () => {
|
|
2870
2867
|
let e = J.menuLabel != null;
|
|
2871
2868
|
return /* @__PURE__ */ B("div", {
|
|
2872
|
-
ref:
|
|
2869
|
+
ref: en,
|
|
2873
2870
|
role: e ? "group" : void 0,
|
|
2874
2871
|
"aria-label": J.menuLabel,
|
|
2875
2872
|
children: J.renderMenu({
|
|
2876
|
-
query:
|
|
2877
|
-
caretPosition:
|
|
2878
|
-
close:
|
|
2879
|
-
listboxId:
|
|
2880
|
-
activeOptionId:
|
|
2873
|
+
query: Jt,
|
|
2874
|
+
caretPosition: $ ?? 0,
|
|
2875
|
+
close: bn,
|
|
2876
|
+
listboxId: $t,
|
|
2877
|
+
activeOptionId: tn
|
|
2881
2878
|
})
|
|
2882
2879
|
});
|
|
2883
2880
|
},
|
|
@@ -2886,13 +2883,13 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2886
2883
|
className: "inline-block h-lh w-0"
|
|
2887
2884
|
})
|
|
2888
2885
|
})
|
|
2889
|
-
})] }),
|
|
2890
|
-
ref:
|
|
2886
|
+
})] }), gr = /* @__PURE__ */ V("div", {
|
|
2887
|
+
ref: gn,
|
|
2891
2888
|
className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
|
|
2892
|
-
children: [
|
|
2893
|
-
ref:
|
|
2894
|
-
className: l(Y.textarea,
|
|
2895
|
-
children: [
|
|
2889
|
+
children: [lr && /* @__PURE__ */ V("div", {
|
|
2890
|
+
ref: ur,
|
|
2891
|
+
className: l(Y.textarea, z?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
|
|
2892
|
+
children: [Ye(Z, X, cr, Y.mentionHighlight, Y.mentionHighlightUnsupported), dr.map((e, t) => /* @__PURE__ */ B("div", {
|
|
2896
2893
|
"aria-hidden": !0,
|
|
2897
2894
|
className: l("pointer-events-none absolute rounded-sm", Y.selectionHighlight),
|
|
2898
2895
|
style: {
|
|
@@ -2902,135 +2899,135 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
2902
2899
|
height: e.height
|
|
2903
2900
|
}
|
|
2904
2901
|
}, `selection-${t}`))]
|
|
2905
|
-
}),
|
|
2906
|
-
}),
|
|
2907
|
-
onAttachClick:
|
|
2902
|
+
}), hr]
|
|
2903
|
+
}), _r = Te ? void 0 : /* @__PURE__ */ B(St, {
|
|
2904
|
+
onAttachClick: Ee ? void 0 : () => Un.current?.click(),
|
|
2908
2905
|
attachLabel: _,
|
|
2909
|
-
addMenuTitle:
|
|
2910
|
-
menuTitle:
|
|
2911
|
-
menuCloseLabel:
|
|
2912
|
-
style:
|
|
2913
|
-
isDisabled:
|
|
2914
|
-
chatSettings:
|
|
2915
|
-
extraMenuItems:
|
|
2916
|
-
onRecordVoice:
|
|
2906
|
+
addMenuTitle: T,
|
|
2907
|
+
menuTitle: k,
|
|
2908
|
+
menuCloseLabel: ee,
|
|
2909
|
+
style: Ht,
|
|
2910
|
+
isDisabled: je || Hn,
|
|
2911
|
+
chatSettings: qe,
|
|
2912
|
+
extraMenuItems: Ut,
|
|
2913
|
+
onRecordVoice: Le && Dt && !s && !Hn ? () => zn(it.Attachment) : void 0,
|
|
2917
2914
|
recordVoiceLabel: L,
|
|
2918
|
-
toolsMenuItems:
|
|
2919
|
-
onToolToggle:
|
|
2920
|
-
toolsMenuTitle:
|
|
2921
|
-
toolsBackLabel:
|
|
2922
|
-
menuOverlays:
|
|
2923
|
-
getCaretPosition: () =>
|
|
2924
|
-
}),
|
|
2915
|
+
toolsMenuItems: tt || It ? Xe : void 0,
|
|
2916
|
+
onToolToggle: Ze,
|
|
2917
|
+
toolsMenuTitle: at,
|
|
2918
|
+
toolsBackLabel: ot,
|
|
2919
|
+
menuOverlays: ct,
|
|
2920
|
+
getCaretPosition: () => Q.current?.selectionStart ?? Z.length
|
|
2921
|
+
}), vr = Oe === dt.Inline && (!Ft || ke), yr = _r && /* @__PURE__ */ B("div", {
|
|
2925
2922
|
className: l("flex", q.addCluster),
|
|
2926
|
-
children:
|
|
2927
|
-
}),
|
|
2928
|
-
className: l("min-w-0",
|
|
2929
|
-
children: /* @__PURE__ */ B(
|
|
2930
|
-
items:
|
|
2931
|
-
onToolToggle:
|
|
2932
|
-
onToolDismiss:
|
|
2933
|
-
canRemove:
|
|
2934
|
-
removeLabel:
|
|
2935
|
-
stateOnLabel:
|
|
2936
|
-
stateOffLabel:
|
|
2923
|
+
children: _r
|
|
2924
|
+
}), br = $n.length > 0 && Ze != null && /* @__PURE__ */ B("div", {
|
|
2925
|
+
className: l("min-w-0", vr ? "flex-1" : "max-w-full flex-[1_0_auto]", q.toolsChips),
|
|
2926
|
+
children: /* @__PURE__ */ B(Tt, {
|
|
2927
|
+
items: $n,
|
|
2928
|
+
onToolToggle: Ze,
|
|
2929
|
+
onToolDismiss: er,
|
|
2930
|
+
canRemove: tt,
|
|
2931
|
+
removeLabel: st?.removeLabel,
|
|
2932
|
+
stateOnLabel: st?.stateOnLabel,
|
|
2933
|
+
stateOffLabel: st?.stateOffLabel
|
|
2937
2934
|
})
|
|
2938
2935
|
});
|
|
2939
2936
|
return /* @__PURE__ */ V("div", {
|
|
2940
|
-
ref:
|
|
2941
|
-
style:
|
|
2942
|
-
className: l(Y.wrapper,
|
|
2937
|
+
ref: Wn,
|
|
2938
|
+
style: Ht,
|
|
2939
|
+
className: l(Y.wrapper, je && Y.wrapperDisabled, je && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", ce, q.wrapper),
|
|
2943
2940
|
children: [
|
|
2944
|
-
(
|
|
2945
|
-
attachments: [...
|
|
2941
|
+
(Ue.length > 0 || Cn.length > 0) && /* @__PURE__ */ B(fe, {
|
|
2942
|
+
attachments: [...Ue, ...Cn],
|
|
2946
2943
|
onRemove: (e) => {
|
|
2947
|
-
|
|
2944
|
+
Ue.some((t) => t.id === e) ? Ke?.(e) : Dn(e);
|
|
2948
2945
|
},
|
|
2949
|
-
onRetry:
|
|
2950
|
-
onExpand:
|
|
2946
|
+
onRetry: On,
|
|
2947
|
+
onExpand: kn,
|
|
2951
2948
|
labels: {
|
|
2952
2949
|
removeLabel: A,
|
|
2953
2950
|
retryLabel: j,
|
|
2954
2951
|
uploadingLabel: M,
|
|
2955
|
-
expandLabel:
|
|
2956
|
-
clickLabel:
|
|
2952
|
+
expandLabel: te,
|
|
2953
|
+
clickLabel: ne
|
|
2957
2954
|
},
|
|
2958
2955
|
styles: {
|
|
2959
|
-
...
|
|
2960
|
-
className: l(
|
|
2956
|
+
...oe,
|
|
2957
|
+
className: l(Cn.length > 6 && "-me-4", oe?.className)
|
|
2961
2958
|
},
|
|
2962
|
-
onAttachmentClick:
|
|
2963
|
-
let t = [...
|
|
2964
|
-
t != null &&
|
|
2959
|
+
onAttachmentClick: bt == null ? void 0 : (e) => {
|
|
2960
|
+
let t = [...Ue, ...Cn].find((t) => t.id === e);
|
|
2961
|
+
t != null && bt(t);
|
|
2965
2962
|
}
|
|
2966
2963
|
}),
|
|
2967
|
-
!
|
|
2968
|
-
ref:
|
|
2964
|
+
!Te && /* @__PURE__ */ B("input", {
|
|
2965
|
+
ref: Un,
|
|
2969
2966
|
type: "file",
|
|
2970
2967
|
multiple: !0,
|
|
2971
|
-
accept:
|
|
2968
|
+
accept: S,
|
|
2972
2969
|
className: "sr-only",
|
|
2973
2970
|
"aria-hidden": !0,
|
|
2974
2971
|
tabIndex: -1,
|
|
2975
|
-
onChange:
|
|
2972
|
+
onChange: sr
|
|
2976
2973
|
}),
|
|
2977
|
-
/* @__PURE__ */ B(
|
|
2978
|
-
politeness:
|
|
2974
|
+
/* @__PURE__ */ B(E, {
|
|
2975
|
+
politeness: O.Assertive,
|
|
2979
2976
|
className: "min-w-0 px-1 wrap-break-word",
|
|
2980
|
-
children:
|
|
2977
|
+
children: Rn && /* @__PURE__ */ B(C, { text: Rn })
|
|
2981
2978
|
}),
|
|
2982
|
-
|
|
2979
|
+
Hn && /* @__PURE__ */ B(At, {
|
|
2983
2980
|
embedded: !0,
|
|
2984
|
-
state:
|
|
2985
|
-
analyserNodeRef:
|
|
2986
|
-
onStop:
|
|
2987
|
-
onDiscard:
|
|
2988
|
-
attachButton:
|
|
2989
|
-
stopLabel:
|
|
2990
|
-
discardLabel:
|
|
2991
|
-
processingLabel:
|
|
2981
|
+
state: In,
|
|
2982
|
+
analyserNodeRef: Ln,
|
|
2983
|
+
onStop: Bn,
|
|
2984
|
+
onDiscard: Vn,
|
|
2985
|
+
attachButton: _r,
|
|
2986
|
+
stopLabel: ie,
|
|
2987
|
+
discardLabel: ae,
|
|
2988
|
+
processingLabel: Be
|
|
2992
2989
|
}),
|
|
2993
|
-
!
|
|
2994
|
-
!
|
|
2990
|
+
!Hn && De && gr,
|
|
2991
|
+
!Hn && !De && vr && br && /* @__PURE__ */ B("div", {
|
|
2995
2992
|
className: "flex",
|
|
2996
|
-
children:
|
|
2993
|
+
children: br
|
|
2997
2994
|
}),
|
|
2998
|
-
!
|
|
2999
|
-
className: l("flex items-center gap-2",
|
|
2995
|
+
!Hn && !De && /* @__PURE__ */ V("div", {
|
|
2996
|
+
className: l("flex items-center gap-2", vr ? "flex-nowrap" : "flex-wrap", q.actionRow),
|
|
3000
2997
|
children: [
|
|
3001
|
-
|
|
2998
|
+
vr && yr,
|
|
3002
2999
|
/* @__PURE__ */ B("div", {
|
|
3003
|
-
className: l("flex min-w-0 items-center self-stretch",
|
|
3004
|
-
children:
|
|
3000
|
+
className: l("flex min-w-0 items-center self-stretch", vr ? "flex-1" : "w-full", q.textareaWrap),
|
|
3001
|
+
children: gr
|
|
3005
3002
|
}),
|
|
3006
|
-
!
|
|
3007
|
-
!
|
|
3003
|
+
!vr && yr,
|
|
3004
|
+
!vr && br,
|
|
3008
3005
|
/* @__PURE__ */ B("div", {
|
|
3009
3006
|
className: l("ms-auto flex shrink-0 items-center gap-2", q.footerActions),
|
|
3010
|
-
children:
|
|
3011
|
-
canSend:
|
|
3012
|
-
onSend:
|
|
3013
|
-
}) : /* @__PURE__ */ V(
|
|
3014
|
-
|
|
3015
|
-
/* @__PURE__ */ B(
|
|
3016
|
-
deployments:
|
|
3017
|
-
selectedDeploymentId:
|
|
3018
|
-
onDeploymentChange:
|
|
3019
|
-
modelSelectorLabels:
|
|
3020
|
-
menuStyles:
|
|
3021
|
-
nameClassName:
|
|
3022
|
-
versionClassName:
|
|
3007
|
+
children: Ae ? Ae({
|
|
3008
|
+
canSend: Yn,
|
|
3009
|
+
onSend: rr
|
|
3010
|
+
}) : /* @__PURE__ */ V(de, { children: [
|
|
3011
|
+
kt,
|
|
3012
|
+
/* @__PURE__ */ B(Nn, {
|
|
3013
|
+
deployments: ve,
|
|
3014
|
+
selectedDeploymentId: ye,
|
|
3015
|
+
onDeploymentChange: Se,
|
|
3016
|
+
modelSelectorLabels: Ce,
|
|
3017
|
+
menuStyles: se,
|
|
3018
|
+
nameClassName: z?.modelSelectorNameClassName,
|
|
3019
|
+
versionClassName: z?.modelSelectorVersionClassName,
|
|
3023
3020
|
isStreaming: s,
|
|
3024
|
-
isMobile:
|
|
3025
|
-
isDisabled:
|
|
3026
|
-
style:
|
|
3021
|
+
isMobile: It,
|
|
3022
|
+
isDisabled: Me,
|
|
3023
|
+
style: Ht,
|
|
3027
3024
|
modelPickerOverlay: xt,
|
|
3028
|
-
isPickerOpen:
|
|
3029
|
-
onPickerToggle: () =>
|
|
3030
|
-
onPickerOpenChange:
|
|
3025
|
+
isPickerOpen: Lt,
|
|
3026
|
+
onPickerToggle: () => zt(!Lt),
|
|
3027
|
+
onPickerOpenChange: zt
|
|
3031
3028
|
}),
|
|
3032
|
-
|
|
3033
|
-
icon: /* @__PURE__ */ B(
|
|
3029
|
+
nr && /* @__PURE__ */ B(w, {
|
|
3030
|
+
icon: /* @__PURE__ */ B(xe, {
|
|
3034
3031
|
size: v.LG,
|
|
3035
3032
|
stroke: y,
|
|
3036
3033
|
"aria-hidden": !0
|
|
@@ -3038,36 +3035,36 @@ var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
|
3038
3035
|
"aria-label": I,
|
|
3039
3036
|
tooltipProps: { tooltip: I },
|
|
3040
3037
|
className: "shrink-0",
|
|
3041
|
-
onClick: () =>
|
|
3042
|
-
disabled:
|
|
3038
|
+
onClick: () => zn(it.Dictation),
|
|
3039
|
+
disabled: je || s
|
|
3043
3040
|
}),
|
|
3044
|
-
s && o ? /* @__PURE__ */ B(
|
|
3041
|
+
s && o ? /* @__PURE__ */ B(Mt, {
|
|
3045
3042
|
onStop: o,
|
|
3046
|
-
ariaLabel:
|
|
3047
|
-
}) : !s && /* @__PURE__ */ B(
|
|
3048
|
-
onSend:
|
|
3049
|
-
isDisabled: !
|
|
3050
|
-
ariaLabel:
|
|
3051
|
-
sendTooltip:
|
|
3043
|
+
ariaLabel: F
|
|
3044
|
+
}) : !s && /* @__PURE__ */ B(jt, {
|
|
3045
|
+
onSend: rr,
|
|
3046
|
+
isDisabled: !tr || !Yn,
|
|
3047
|
+
ariaLabel: re,
|
|
3048
|
+
sendTooltip: Jn ? N : P ?? N
|
|
3052
3049
|
})
|
|
3053
3050
|
] })
|
|
3054
3051
|
})
|
|
3055
3052
|
]
|
|
3056
3053
|
}),
|
|
3057
|
-
/* @__PURE__ */ B(
|
|
3054
|
+
/* @__PURE__ */ B(E, {
|
|
3058
3055
|
visuallyHidden: !0,
|
|
3059
3056
|
atomic: !0,
|
|
3060
|
-
as:
|
|
3061
|
-
children: /* @__PURE__ */ B("span", { children:
|
|
3057
|
+
as: D.Span,
|
|
3058
|
+
children: /* @__PURE__ */ B("span", { children: Pn.text }, Pn.revision)
|
|
3062
3059
|
})
|
|
3063
3060
|
]
|
|
3064
3061
|
});
|
|
3065
3062
|
});
|
|
3066
|
-
|
|
3067
|
-
var
|
|
3063
|
+
Pn.displayName = "Input";
|
|
3064
|
+
var Fn = {
|
|
3068
3065
|
welcome: "_welcome_1icyo_1",
|
|
3069
3066
|
description: "_description_1icyo_5"
|
|
3070
|
-
},
|
|
3067
|
+
}, In = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
|
|
3071
3068
|
let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
|
|
3072
3069
|
"--ci-welcome-color": p?.welcomeText,
|
|
3073
3070
|
"--ci-description-color": p?.descriptionText
|
|
@@ -3079,10 +3076,10 @@ var Nn = {
|
|
|
3079
3076
|
n && /* @__PURE__ */ V("div", {
|
|
3080
3077
|
className: "flex max-w-full flex-col items-center gap-4 text-center",
|
|
3081
3078
|
children: [/* @__PURE__ */ B("h1", {
|
|
3082
|
-
className: l(
|
|
3079
|
+
className: l(Fn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
|
|
3083
3080
|
children: n
|
|
3084
3081
|
}), r && /* @__PURE__ */ B("p", {
|
|
3085
|
-
className: l(
|
|
3082
|
+
className: l(Fn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
|
|
3086
3083
|
children: r
|
|
3087
3084
|
})]
|
|
3088
3085
|
}),
|
|
@@ -3095,7 +3092,7 @@ var Nn = {
|
|
|
3095
3092
|
children: [a != null && /* @__PURE__ */ B("div", {
|
|
3096
3093
|
className: "mb-2",
|
|
3097
3094
|
children: a
|
|
3098
|
-
}), /* @__PURE__ */ B(
|
|
3095
|
+
}), /* @__PURE__ */ B(Pn, {
|
|
3099
3096
|
placeholder: t,
|
|
3100
3097
|
isStreaming: e,
|
|
3101
3098
|
isInputDisabled: d,
|
|
@@ -3109,13 +3106,13 @@ var Nn = {
|
|
|
3109
3106
|
})
|
|
3110
3107
|
]
|
|
3111
3108
|
});
|
|
3112
|
-
},
|
|
3109
|
+
}, Ln = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: f, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: O = "Close", className: k, pendingDropFiles: ee, onDropFilesConsumed: j, validateAttachment: M, isAttachmentsEnabled: te, isTextAttachmentsAllowed: ne, hideAttachFile: re = !1, fileAccept: N, maximumAttachmentsAmount: F, onAttachmentsLimitExceeded: I, onDialFileSystemClick: L, dialFileSystemLabel: ie, pendingAttachments: ae, onPendingAttachmentsConsumed: R, onAttachmentClick: z, pasteTextThreshold: oe, maxMessageLength: se = 5e4, onMessageTooLong: ce }) => {
|
|
3113
3110
|
let le = G(null), ue = G(null), [de, fe] = K([]);
|
|
3114
3111
|
U(() => {
|
|
3115
|
-
|
|
3116
|
-
}, [
|
|
3117
|
-
let [pe, me] = K(e ?? ""), [he, ge] = K([]), [_e,
|
|
3118
|
-
|
|
3112
|
+
ee?.length && (fe(ee), j?.());
|
|
3113
|
+
}, [ee, j]);
|
|
3114
|
+
let [pe, me] = K(e ?? ""), [he, ge] = K([]), [_e, ve] = K(d), ye = he.some((e) => e.status === a.Loading || e.status === a.Error), xe = (pe.trim().length > 0 || he.length > 0 || _e.length > 0) && !ye, Se = (e) => {
|
|
3115
|
+
ve((t) => t.filter((t) => t.id !== e));
|
|
3119
3116
|
}, Ce = H((e, t) => {
|
|
3120
3117
|
m(e, _e, t);
|
|
3121
3118
|
}, [_e, m]), we = () => {
|
|
@@ -3125,19 +3122,19 @@ var Nn = {
|
|
|
3125
3122
|
}, [n]), De = H((e) => {
|
|
3126
3123
|
let t = Array.from(e.target.files ?? []);
|
|
3127
3124
|
t.length !== 0 && (e.target.value = "", fe(t));
|
|
3128
|
-
}, []), Oe = W(() =>
|
|
3125
|
+
}, []), Oe = W(() => L ? [{
|
|
3129
3126
|
key: "dial-fs",
|
|
3130
|
-
label:
|
|
3131
|
-
icon: /* @__PURE__ */ B(
|
|
3127
|
+
label: ie ?? "DIAL file system",
|
|
3128
|
+
icon: /* @__PURE__ */ B(be, {
|
|
3132
3129
|
size: p,
|
|
3133
3130
|
"aria-hidden": !0,
|
|
3134
3131
|
stroke: y
|
|
3135
3132
|
}),
|
|
3136
|
-
onClick:
|
|
3137
|
-
}] : [], [
|
|
3133
|
+
onClick: L
|
|
3134
|
+
}] : [], [L, ie]);
|
|
3138
3135
|
return /* @__PURE__ */ V("div", {
|
|
3139
|
-
className: l("flex w-full flex-col gap-2",
|
|
3140
|
-
children: [/* @__PURE__ */ B(
|
|
3136
|
+
className: l("flex w-full flex-col gap-2", k),
|
|
3137
|
+
children: [/* @__PURE__ */ B(Pn, {
|
|
3141
3138
|
ref: ue,
|
|
3142
3139
|
message: e,
|
|
3143
3140
|
messageRevision: t,
|
|
@@ -3162,14 +3159,14 @@ var Nn = {
|
|
|
3162
3159
|
className: "max-w-full",
|
|
3163
3160
|
prefixAttachments: _e,
|
|
3164
3161
|
onRemovePrefixAttachment: Se,
|
|
3165
|
-
validateAttachment:
|
|
3166
|
-
isAttachmentsEnabled:
|
|
3167
|
-
isTextAttachmentsAllowed:
|
|
3168
|
-
maximumAttachmentsAmount:
|
|
3169
|
-
onAttachmentsLimitExceeded:
|
|
3170
|
-
pendingAttachments:
|
|
3171
|
-
onPendingAttachmentsConsumed:
|
|
3172
|
-
onAttachmentClick:
|
|
3162
|
+
validateAttachment: M,
|
|
3163
|
+
isAttachmentsEnabled: te,
|
|
3164
|
+
isTextAttachmentsAllowed: ne,
|
|
3165
|
+
maximumAttachmentsAmount: F,
|
|
3166
|
+
onAttachmentsLimitExceeded: I,
|
|
3167
|
+
pendingAttachments: ae,
|
|
3168
|
+
onPendingAttachmentsConsumed: R,
|
|
3169
|
+
onAttachmentClick: z,
|
|
3173
3170
|
pasteTextThreshold: oe,
|
|
3174
3171
|
maxMessageLength: se,
|
|
3175
3172
|
onMessageTooLong: ce
|
|
@@ -3177,17 +3174,17 @@ var Nn = {
|
|
|
3177
3174
|
className: "flex items-center justify-between",
|
|
3178
3175
|
children: [/* @__PURE__ */ V("div", {
|
|
3179
3176
|
className: "flex",
|
|
3180
|
-
children: [!
|
|
3177
|
+
children: [!re && /* @__PURE__ */ B("input", {
|
|
3181
3178
|
ref: le,
|
|
3182
3179
|
type: "file",
|
|
3183
3180
|
multiple: !0,
|
|
3184
|
-
accept:
|
|
3181
|
+
accept: N,
|
|
3185
3182
|
className: "sr-only",
|
|
3186
3183
|
"aria-hidden": !0,
|
|
3187
3184
|
tabIndex: -1,
|
|
3188
3185
|
onChange: De
|
|
3189
|
-
}), (!
|
|
3190
|
-
onAttachClick:
|
|
3186
|
+
}), (!re || (c?.length ?? 0) > 0) && /* @__PURE__ */ B(St, {
|
|
3187
|
+
onAttachClick: re ? void 0 : () => le.current?.click(),
|
|
3191
3188
|
attachLabel: E,
|
|
3192
3189
|
addMenuTitle: T,
|
|
3193
3190
|
menuTitle: D,
|
|
@@ -3198,10 +3195,10 @@ var Nn = {
|
|
|
3198
3195
|
})]
|
|
3199
3196
|
}), /* @__PURE__ */ V("div", {
|
|
3200
3197
|
className: "flex gap-2",
|
|
3201
|
-
children: [/* @__PURE__ */ B(
|
|
3198
|
+
children: [/* @__PURE__ */ B(A, {
|
|
3202
3199
|
label: g,
|
|
3203
3200
|
onClick: f
|
|
3204
|
-
}), /* @__PURE__ */ B(
|
|
3201
|
+
}), /* @__PURE__ */ B(P, {
|
|
3205
3202
|
label: _,
|
|
3206
3203
|
onClick: we,
|
|
3207
3204
|
disabled: !xe
|
|
@@ -3209,16 +3206,16 @@ var Nn = {
|
|
|
3209
3206
|
})]
|
|
3210
3207
|
})]
|
|
3211
3208
|
});
|
|
3212
|
-
},
|
|
3209
|
+
}, Rn = /* @__PURE__ */ function(e) {
|
|
3213
3210
|
return e.Warning = "warning", e.Reached = "reached", e;
|
|
3214
|
-
}({}),
|
|
3215
|
-
[
|
|
3216
|
-
[
|
|
3217
|
-
},
|
|
3211
|
+
}({}), zn = { banner: "_banner_180n6_2" }, Bn = {
|
|
3212
|
+
[Rn.Warning]: ne.Warning,
|
|
3213
|
+
[Rn.Reached]: ne.Error
|
|
3214
|
+
}, Vn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", isLiveRegion: s = !0, className: u, colors: d }) => {
|
|
3218
3215
|
let f = /* @__PURE__ */ B("span", {
|
|
3219
3216
|
className: a,
|
|
3220
3217
|
children: t
|
|
3221
|
-
}), p = n != null && /* @__PURE__ */ V(
|
|
3218
|
+
}), p = n != null && /* @__PURE__ */ V(de, { children: [
|
|
3222
3219
|
" ",
|
|
3223
3220
|
/* @__PURE__ */ B("time", {
|
|
3224
3221
|
dateTime: n.isoValue,
|
|
@@ -3231,13 +3228,13 @@ var Nn = {
|
|
|
3231
3228
|
children: n.ariaLabel
|
|
3232
3229
|
})
|
|
3233
3230
|
] });
|
|
3234
|
-
return /* @__PURE__ */ B(
|
|
3231
|
+
return /* @__PURE__ */ B(M, {
|
|
3235
3232
|
role: s ? "status" : "none",
|
|
3236
|
-
variant:
|
|
3237
|
-
type:
|
|
3233
|
+
variant: Bn[e],
|
|
3234
|
+
type: te.SectionMessage,
|
|
3238
3235
|
title: p ? f : void 0,
|
|
3239
3236
|
message: p || f,
|
|
3240
|
-
className: l(
|
|
3237
|
+
className: l(zn.banner, q.usageBanner, u),
|
|
3241
3238
|
style: c({ "--ci-usage-banner-bg": d?.background }),
|
|
3242
3239
|
children: r != null && /* @__PURE__ */ B(_, {
|
|
3243
3240
|
className: "shrink-0 self-start",
|
|
@@ -3245,7 +3242,7 @@ var Nn = {
|
|
|
3245
3242
|
onClose: () => r()
|
|
3246
3243
|
})
|
|
3247
3244
|
});
|
|
3248
|
-
},
|
|
3245
|
+
}, Hn = (e) => {
|
|
3249
3246
|
let [t, n] = K({
|
|
3250
3247
|
text: e?.text,
|
|
3251
3248
|
revision: e?.revision ?? 0
|
|
@@ -3260,11 +3257,11 @@ var Nn = {
|
|
|
3260
3257
|
messageRevision: t.revision,
|
|
3261
3258
|
seedMessage: r
|
|
3262
3259
|
};
|
|
3263
|
-
},
|
|
3260
|
+
}, Un = (e, t) => {
|
|
3264
3261
|
let n = G(e), r = G(t);
|
|
3265
3262
|
r.current = t, U(() => {
|
|
3266
3263
|
e !== n.current && (n.current = e, r.current());
|
|
3267
3264
|
}, [e]);
|
|
3268
3265
|
};
|
|
3269
3266
|
//#endregion
|
|
3270
|
-
export {
|
|
3267
|
+
export { dt as ActionRowLayout, Le as BottomSheetShell, q as CONVERSATION_INPUT_CLASS, vt as ChatSettingsModal, In as ConversationInput, Ln as EditMessageInput, Pn as Input, ut as SendOnEnter, Rn as UsageLimitBannerSeverity, Vn as UsageLimitBannerView, Hn as useComposerSeed, Un as useComposerSeedSource };
|