inline-chat-kit 0.59.0 → 0.59.2
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/CHANGELOG.md +70 -0
- package/dist/{ChatExperience-BeLjIxHU.js → ChatExperience-umh3nGe_.js} +1114 -1035
- package/dist/ChatExperience-umh3nGe_.js.map +1 -0
- package/dist/demo.js +1 -1
- package/dist/inline-chat-kit.css +1 -1
- package/dist/inline-chat-kit.js +1 -1
- package/package.json +1 -1
- package/dist/ChatExperience-BeLjIxHU.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import e, { createContext as t, createElement as n, forwardRef as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
3
3
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
4
4
|
import { AnimatePresence as y, LayoutGroup as b, MotionConfig as x, animate as S, motion as C, useAnimationControls as w, useMotionValue as T, useReducedMotion as E } from "motion/react";
|
|
5
|
-
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as
|
|
6
|
-
var
|
|
5
|
+
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as N, ChevronRight as ee, Copy as P, CornerDownLeft as F, File as I, FileText as L, Film as R, Highlighter as te, Image as ne, Link2 as re, Maximize2 as z, MessageCircle as ie, Mic as ae, Minimize2 as oe, Moon as se, MoreHorizontal as ce, Music as le, Palette as ue, Paperclip as B, Pencil as de, Plus as fe, RotateCcw as pe, Save as me, Share as he, Square as ge, Sun as _e, TextCursor as ve, ThumbsDown as ye, ThumbsUp as be, Trash2 as xe, TriangleAlert as Se, X as Ce } from "lucide-react";
|
|
6
|
+
var V = {
|
|
7
7
|
btn: "ick-btn-ZW5E",
|
|
8
8
|
xs: "ick-xs-rDs4",
|
|
9
9
|
s: "ick-s-DE-t",
|
|
@@ -21,25 +21,25 @@ var B = {
|
|
|
21
21
|
loading: "ick-loading-NCs-",
|
|
22
22
|
spinner: "ick-spinner-0n6Q",
|
|
23
23
|
spin: "ick-spin-QgE6"
|
|
24
|
+
}, we = {
|
|
25
|
+
primary: V.primary,
|
|
26
|
+
secondary: V.secondary,
|
|
27
|
+
outline: V.outline,
|
|
28
|
+
ghost: V.ghost,
|
|
29
|
+
glass: V.glass
|
|
24
30
|
}, Te = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
xs: B.xs,
|
|
32
|
-
s: B.s,
|
|
33
|
-
m: B.m,
|
|
34
|
-
l: B.l,
|
|
35
|
-
xl: B.xl
|
|
36
|
-
}, V = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
|
|
31
|
+
xs: V.xs,
|
|
32
|
+
s: V.s,
|
|
33
|
+
m: V.m,
|
|
34
|
+
l: V.l,
|
|
35
|
+
xl: V.xl
|
|
36
|
+
}, H = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
|
|
37
37
|
let u = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
a ?
|
|
42
|
-
i ?
|
|
38
|
+
V.btn,
|
|
39
|
+
we[e],
|
|
40
|
+
Te[t],
|
|
41
|
+
a ? V.hasText : "",
|
|
42
|
+
i ? V.loading : "",
|
|
43
43
|
o ?? ""
|
|
44
44
|
].filter(Boolean).join(" ");
|
|
45
45
|
return /* @__PURE__ */ v("button", {
|
|
@@ -50,24 +50,24 @@ var B = {
|
|
|
50
50
|
...c,
|
|
51
51
|
children: [
|
|
52
52
|
n && /* @__PURE__ */ _("span", {
|
|
53
|
-
className:
|
|
53
|
+
className: V.icon,
|
|
54
54
|
children: n
|
|
55
55
|
}),
|
|
56
56
|
a && /* @__PURE__ */ _("span", {
|
|
57
|
-
className:
|
|
57
|
+
className: V.label,
|
|
58
58
|
children: a
|
|
59
59
|
}),
|
|
60
60
|
r && /* @__PURE__ */ _("span", {
|
|
61
|
-
className:
|
|
61
|
+
className: V.icon,
|
|
62
62
|
children: r
|
|
63
63
|
}),
|
|
64
64
|
i && /* @__PURE__ */ _("span", {
|
|
65
|
-
className:
|
|
65
|
+
className: V.spinner,
|
|
66
66
|
"aria-hidden": "true"
|
|
67
67
|
})
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
|
-
}),
|
|
70
|
+
}), Ee = {
|
|
71
71
|
list: "ick-list-4-Xw",
|
|
72
72
|
item: "ick-item-5jP3",
|
|
73
73
|
picture: "ick-picture-JacB",
|
|
@@ -76,7 +76,7 @@ var B = {
|
|
|
76
76
|
name: "ick-name-6t7S",
|
|
77
77
|
size: "ick-size-sR5p",
|
|
78
78
|
remove: "ick-remove-6I5y"
|
|
79
|
-
},
|
|
79
|
+
}, De = {
|
|
80
80
|
approval: {
|
|
81
81
|
once: "Allow once",
|
|
82
82
|
always: "Always allow",
|
|
@@ -226,9 +226,9 @@ var B = {
|
|
|
226
226
|
paragraph: "Paragraph {index}",
|
|
227
227
|
responding: "Generating response"
|
|
228
228
|
}
|
|
229
|
-
},
|
|
230
|
-
function
|
|
231
|
-
let n = s(
|
|
229
|
+
}, Oe = t({});
|
|
230
|
+
function ke({ labels: e, children: t }) {
|
|
231
|
+
let n = s(Oe), r = e ? JSON.stringify(e) : "", i = f(() => {
|
|
232
232
|
if (!r) return n;
|
|
233
233
|
let e = JSON.parse(r), t = { ...n };
|
|
234
234
|
for (let r of Object.keys(e)) t[r] = {
|
|
@@ -237,25 +237,25 @@ function Ae({ labels: e, children: t }) {
|
|
|
237
237
|
};
|
|
238
238
|
return t;
|
|
239
239
|
}, [n, r]);
|
|
240
|
-
return /* @__PURE__ */ _(
|
|
240
|
+
return /* @__PURE__ */ _(Oe.Provider, {
|
|
241
241
|
value: i,
|
|
242
242
|
children: t
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
let n = s(
|
|
245
|
+
function U(e, t) {
|
|
246
|
+
let n = s(Oe)[e];
|
|
247
247
|
return {
|
|
248
|
-
...
|
|
248
|
+
...De[e],
|
|
249
249
|
...n,
|
|
250
250
|
...t
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Ae(e, t) {
|
|
254
254
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e);
|
|
255
255
|
}
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/Attachments/Attachments.tsx
|
|
258
|
-
function
|
|
258
|
+
function je(e) {
|
|
259
259
|
if (e === void 0 || !Number.isFinite(e) || e < 0) return "";
|
|
260
260
|
if (e < 1024) return `${e} B`;
|
|
261
261
|
let t = [
|
|
@@ -266,50 +266,50 @@ function Me(e) {
|
|
|
266
266
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
267
267
|
return `${n < 10 ? n.toFixed(1) : Math.round(n)} ${t[r]}`;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var Me = (e) => !!e.url && (e.type ?? "").startsWith("image/"), Ne = (e) => e.replace(/["\\]/g, encodeURIComponent);
|
|
270
270
|
function Pe({ type: e }) {
|
|
271
271
|
let t = (e ?? "").split("/")[0];
|
|
272
|
-
return _(t === "image" ?
|
|
272
|
+
return _(t === "image" ? ne : t === "video" ? R : t === "audio" ? le : e === "application/pdf" || t === "text" ? L : I, {
|
|
273
273
|
size: 16,
|
|
274
274
|
"aria-hidden": !0
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
function Fe({ attachments: e, onRemove: t, labels: n, className: r, ...i }) {
|
|
278
|
-
let a =
|
|
278
|
+
let a = U("attachments", n);
|
|
279
279
|
return e.length === 0 ? null : /* @__PURE__ */ _("ul", {
|
|
280
|
-
className: [
|
|
280
|
+
className: [Ee.list, r ?? ""].filter(Boolean).join(" "),
|
|
281
281
|
...i,
|
|
282
282
|
children: e.map((e) => {
|
|
283
|
-
let n =
|
|
283
|
+
let n = je(e.size);
|
|
284
284
|
return /* @__PURE__ */ v("li", {
|
|
285
|
-
className:
|
|
286
|
-
"data-picture":
|
|
287
|
-
children: [
|
|
288
|
-
className:
|
|
285
|
+
className: Ee.item,
|
|
286
|
+
"data-picture": Me(e) || void 0,
|
|
287
|
+
children: [Me(e) ? /* @__PURE__ */ _("span", {
|
|
288
|
+
className: Ee.picture,
|
|
289
289
|
style: { backgroundImage: `url("${Ne(e.url)}")` },
|
|
290
290
|
role: "img",
|
|
291
291
|
"aria-label": e.name
|
|
292
292
|
}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
293
|
-
className:
|
|
293
|
+
className: Ee.glyph,
|
|
294
294
|
children: /* @__PURE__ */ _(Pe, { type: e.type })
|
|
295
295
|
}), /* @__PURE__ */ v("span", {
|
|
296
|
-
className:
|
|
296
|
+
className: Ee.body,
|
|
297
297
|
children: [/* @__PURE__ */ _("span", {
|
|
298
|
-
className:
|
|
298
|
+
className: Ee.name,
|
|
299
299
|
children: e.name
|
|
300
300
|
}), n && /* @__PURE__ */ _("span", {
|
|
301
|
-
className:
|
|
301
|
+
className: Ee.size,
|
|
302
302
|
children: n
|
|
303
303
|
})]
|
|
304
304
|
})] }), t && /* @__PURE__ */ _("span", {
|
|
305
|
-
className:
|
|
306
|
-
children: /* @__PURE__ */ _(
|
|
305
|
+
className: Ee.remove,
|
|
306
|
+
children: /* @__PURE__ */ _(H, {
|
|
307
307
|
variant: "glass",
|
|
308
308
|
size: "s",
|
|
309
309
|
onClick: () => t(e.id),
|
|
310
310
|
onPointerDown: (e) => e.stopPropagation(),
|
|
311
311
|
"aria-label": `${a.remove} ${e.name}`,
|
|
312
|
-
icon: /* @__PURE__ */ _(
|
|
312
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
313
313
|
size: 14,
|
|
314
314
|
"aria-hidden": !0
|
|
315
315
|
})
|
|
@@ -365,13 +365,13 @@ function Le({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
|
|
|
365
365
|
alignItems: "center",
|
|
366
366
|
justifyContent: "center"
|
|
367
367
|
},
|
|
368
|
-
children: e === "send" ? /* @__PURE__ */ _(
|
|
368
|
+
children: e === "send" ? /* @__PURE__ */ _(F, {
|
|
369
369
|
size: r,
|
|
370
370
|
color: t,
|
|
371
371
|
strokeWidth: 1.8,
|
|
372
372
|
strokeLinecap: "round",
|
|
373
373
|
strokeLinejoin: "round"
|
|
374
|
-
}) : e === "mic" ? /* @__PURE__ */ _(
|
|
374
|
+
}) : e === "mic" ? /* @__PURE__ */ _(ae, {
|
|
375
375
|
size: r,
|
|
376
376
|
color: t,
|
|
377
377
|
strokeWidth: 1.8,
|
|
@@ -383,7 +383,7 @@ function Le({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
|
|
|
383
383
|
strokeWidth: 2.2,
|
|
384
384
|
strokeLinecap: "round",
|
|
385
385
|
strokeLinejoin: "round"
|
|
386
|
-
}) : /* @__PURE__ */ _(
|
|
386
|
+
}) : /* @__PURE__ */ _(ge, {
|
|
387
387
|
size: r,
|
|
388
388
|
color: t,
|
|
389
389
|
fill: t,
|
|
@@ -421,7 +421,7 @@ var W = {
|
|
|
421
421
|
//#endregion
|
|
422
422
|
//#region src/ChatInput/HoverActionsRow.tsx
|
|
423
423
|
function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r, onCopy: i, onEdit: a, value: o, ac: s }) {
|
|
424
|
-
let c =
|
|
424
|
+
let c = U("input");
|
|
425
425
|
return /* @__PURE__ */ _(y, {
|
|
426
426
|
initial: !1,
|
|
427
427
|
children: e && /* @__PURE__ */ v(C.div, {
|
|
@@ -467,7 +467,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
467
467
|
},
|
|
468
468
|
exit: {}
|
|
469
469
|
},
|
|
470
|
-
children: /* @__PURE__ */ _(
|
|
470
|
+
children: /* @__PURE__ */ _(H, {
|
|
471
471
|
variant: "ghost",
|
|
472
472
|
icon: n ? c.readLess : c.readMore,
|
|
473
473
|
onClick: (e) => {
|
|
@@ -483,7 +483,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
483
483
|
})
|
|
484
484
|
}, "read-more"), [{
|
|
485
485
|
id: "copy",
|
|
486
|
-
icon: /* @__PURE__ */ _(
|
|
486
|
+
icon: /* @__PURE__ */ _(P, {
|
|
487
487
|
size: 14,
|
|
488
488
|
"aria-hidden": !0
|
|
489
489
|
}),
|
|
@@ -491,7 +491,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
491
491
|
label: c.copy
|
|
492
492
|
}, {
|
|
493
493
|
id: "edit",
|
|
494
|
-
icon: /* @__PURE__ */ _(
|
|
494
|
+
icon: /* @__PURE__ */ _(de, {
|
|
495
495
|
size: 14,
|
|
496
496
|
"aria-hidden": !0
|
|
497
497
|
}),
|
|
@@ -514,7 +514,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
514
514
|
},
|
|
515
515
|
exit: {}
|
|
516
516
|
},
|
|
517
|
-
children: /* @__PURE__ */ _(
|
|
517
|
+
children: /* @__PURE__ */ _(H, {
|
|
518
518
|
variant: "ghost",
|
|
519
519
|
icon: t,
|
|
520
520
|
onClick: n,
|
|
@@ -528,12 +528,12 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
528
528
|
//#endregion
|
|
529
529
|
//#region src/ChatInput/AddCardsOverlay.tsx
|
|
530
530
|
function ze() {
|
|
531
|
-
let e =
|
|
531
|
+
let e = U("input");
|
|
532
532
|
return [
|
|
533
533
|
{
|
|
534
534
|
id: "attach",
|
|
535
535
|
label: e.attach,
|
|
536
|
-
icon: /* @__PURE__ */ _(
|
|
536
|
+
icon: /* @__PURE__ */ _(B, {
|
|
537
537
|
size: 16,
|
|
538
538
|
"aria-hidden": !0
|
|
539
539
|
})
|
|
@@ -541,7 +541,7 @@ function ze() {
|
|
|
541
541
|
{
|
|
542
542
|
id: "design",
|
|
543
543
|
label: e.design,
|
|
544
|
-
icon: /* @__PURE__ */ _(
|
|
544
|
+
icon: /* @__PURE__ */ _(ue, {
|
|
545
545
|
size: 16,
|
|
546
546
|
"aria-hidden": !0
|
|
547
547
|
})
|
|
@@ -549,7 +549,7 @@ function ze() {
|
|
|
549
549
|
{
|
|
550
550
|
id: "connectors",
|
|
551
551
|
label: e.connectors,
|
|
552
|
-
icon: /* @__PURE__ */ _(
|
|
552
|
+
icon: /* @__PURE__ */ _(re, {
|
|
553
553
|
size: 16,
|
|
554
554
|
"aria-hidden": !0
|
|
555
555
|
})
|
|
@@ -557,7 +557,7 @@ function ze() {
|
|
|
557
557
|
];
|
|
558
558
|
}
|
|
559
559
|
function Be({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph: i, showButtons: a, ac: o }) {
|
|
560
|
-
let s = ze(), c = r ?? s, { closeMenu: l } =
|
|
560
|
+
let s = ze(), c = r ?? s, { closeMenu: l } = U("input");
|
|
561
561
|
return /* @__PURE__ */ _(y, { children: e && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(C.div, {
|
|
562
562
|
className: W.addBackdrop,
|
|
563
563
|
initial: { opacity: 0 },
|
|
@@ -661,9 +661,9 @@ function Be({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph
|
|
|
661
661
|
pointerEvents: "auto",
|
|
662
662
|
zIndex: 10
|
|
663
663
|
},
|
|
664
|
-
children: /* @__PURE__ */ _(
|
|
664
|
+
children: /* @__PURE__ */ _(H, {
|
|
665
665
|
variant: "ghost",
|
|
666
|
-
icon: /* @__PURE__ */ _(
|
|
666
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
667
667
|
size: 14,
|
|
668
668
|
"aria-hidden": !0
|
|
669
669
|
}),
|
|
@@ -730,7 +730,7 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
730
730
|
onTranscript: t,
|
|
731
731
|
onDone: n
|
|
732
732
|
}), w = p({
|
|
733
|
-
...
|
|
733
|
+
...De.voice,
|
|
734
734
|
...i
|
|
735
735
|
});
|
|
736
736
|
c(() => {
|
|
@@ -739,7 +739,7 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
739
739
|
onTranscript: t,
|
|
740
740
|
onDone: n
|
|
741
741
|
}, w.current = {
|
|
742
|
-
...
|
|
742
|
+
...De.voice,
|
|
743
743
|
...i
|
|
744
744
|
};
|
|
745
745
|
});
|
|
@@ -929,12 +929,20 @@ var nt = .9, rt = {
|
|
|
929
929
|
angle3: -50,
|
|
930
930
|
hoverPull: 12
|
|
931
931
|
}
|
|
932
|
-
}
|
|
932
|
+
};
|
|
933
|
+
function it(e) {
|
|
934
|
+
let { stiffness: t, damping: n, mass: r = 1 } = e;
|
|
935
|
+
return t === void 0 ? e : {
|
|
936
|
+
...e,
|
|
937
|
+
damping: Math.max(n ?? 0, 2 * Math.sqrt(t * r))
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
var at = {
|
|
933
941
|
type: "spring",
|
|
934
942
|
stiffness: 600,
|
|
935
943
|
damping: 21.5,
|
|
936
944
|
mass: .2
|
|
937
|
-
},
|
|
945
|
+
}, ot = (e) => {
|
|
938
946
|
if (typeof document.execCommand == "function") try {
|
|
939
947
|
if (document.execCommand("insertText", !1, e)) return !0;
|
|
940
948
|
} catch {}
|
|
@@ -944,14 +952,14 @@ var nt = .9, rt = {
|
|
|
944
952
|
n.deleteContents();
|
|
945
953
|
let r = document.createTextNode(e);
|
|
946
954
|
return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
|
|
947
|
-
},
|
|
948
|
-
let
|
|
955
|
+
}, st = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, busy: j = !1, placeholder: M, menu: N, labels: ee, animationConfig: P, style: F }, I) {
|
|
956
|
+
let L = l(), R = U("input", ee), te = U("voice"), ne = M ?? R.placeholder, re = N !== !1, z = p(null), ie = p(null), ae = p(null), oe = p(0), se = p(!1), ce = p(null), [le, ue] = m(!1), [B, de] = m(!1), [pe, me] = m(!1), [he, ge] = m(!0), [_e, ve] = m(!1), [ye, be] = m(!1), [xe, Se] = m(!1), V = p(0), we = p(!1), Te = p(0), Ee = p(!1), De = p(null);
|
|
949
957
|
c(() => () => {
|
|
950
|
-
|
|
958
|
+
De.current && clearTimeout(De.current);
|
|
951
959
|
}, []);
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
let
|
|
960
|
+
let Oe = w(), ke = p(e), Ae = p(P);
|
|
961
|
+
Ae.current = P;
|
|
962
|
+
let je = p(null), [Me, Ne] = m([]), Pe = s ?? Me, Ie = p(Pe);
|
|
955
963
|
Ie.current = Pe;
|
|
956
964
|
let ze = p([]);
|
|
957
965
|
c(() => () => {
|
|
@@ -990,10 +998,10 @@ var nt = .9, rt = {
|
|
|
990
998
|
}
|
|
991
999
|
Ne((t) => (Ve(t.find((t) => t.id === e)?.url), t.filter((t) => t.id !== e)));
|
|
992
1000
|
}, [f, Ve]);
|
|
993
|
-
u(
|
|
994
|
-
focus: (e) =>
|
|
1001
|
+
u(I, () => ({
|
|
1002
|
+
focus: (e) => z.current?.focus(e),
|
|
995
1003
|
setValue: (e) => {
|
|
996
|
-
let t =
|
|
1004
|
+
let t = z.current;
|
|
997
1005
|
t && (t.textContent = e, $e(t)), n(e);
|
|
998
1006
|
},
|
|
999
1007
|
getValue: () => t
|
|
@@ -1001,7 +1009,7 @@ var nt = .9, rt = {
|
|
|
1001
1009
|
let We = p(null), Ge = p(null), Ke = p(null);
|
|
1002
1010
|
c(() => {
|
|
1003
1011
|
if (!E) return;
|
|
1004
|
-
let e =
|
|
1012
|
+
let e = z.current;
|
|
1005
1013
|
if (!e) return;
|
|
1006
1014
|
let t = () => {
|
|
1007
1015
|
let t = window.getSelection();
|
|
@@ -1012,23 +1020,23 @@ var nt = .9, rt = {
|
|
|
1012
1020
|
let G = Qe({
|
|
1013
1021
|
onTranscribe: E,
|
|
1014
1022
|
onTranscript: o((e) => {
|
|
1015
|
-
let t = Ge.current, r =
|
|
1023
|
+
let t = Ge.current, r = z.current;
|
|
1016
1024
|
if (!t || !r) return;
|
|
1017
1025
|
let i = t.base.slice(0, t.at) + e + t.base.slice(t.at);
|
|
1018
1026
|
r.textContent = i, tt(r, t.at + e.length), n(i);
|
|
1019
1027
|
}, [n]),
|
|
1020
1028
|
onDone: () => {
|
|
1021
|
-
Ge.current = null,
|
|
1029
|
+
Ge.current = null, z.current?.focus();
|
|
1022
1030
|
},
|
|
1023
1031
|
meterRef: We,
|
|
1024
|
-
labels:
|
|
1025
|
-
}), K = e === "responding" || e === "resting", q = K, qe = t.trim().length > 0 || Pe.length > 0, Je = e === "typing" || e === "idle", Ye = Je && qe && !j, Xe = !!i && (e === "responding" || j && Je), Ze = j && Je && qe && !i, rt = e === "resting" &&
|
|
1032
|
+
labels: te
|
|
1033
|
+
}), K = e === "responding" || e === "resting", q = K, qe = t.trim().length > 0 || Pe.length > 0, Je = e === "typing" || e === "idle", Ye = Je && qe && !j, Xe = !!i && (e === "responding" || j && Je), Ze = j && Je && qe && !i, rt = e === "resting" && le, st = rt, ct = e === "resting" && ye, lt = G.state === "listening" || G.state === "requesting" || G.state === "transcribing", ut = !!E && G.supported && !A, dt = Ye || Xe || Ze, J = P, ft = J ? {
|
|
1026
1034
|
type: "spring",
|
|
1027
1035
|
stiffness: J.bubble.stiffness,
|
|
1028
1036
|
damping: J.bubble.damping,
|
|
1029
1037
|
mass: J.bubble.mass
|
|
1030
|
-
} :
|
|
1031
|
-
let e =
|
|
1038
|
+
} : at, pt = o(() => {
|
|
1039
|
+
let e = ie.current, t = ae.current;
|
|
1032
1040
|
if (!e || !t) return;
|
|
1033
1041
|
if (!(e.scrollHeight > e.clientHeight)) {
|
|
1034
1042
|
t.removeAttribute("data-fade");
|
|
@@ -1038,32 +1046,32 @@ var nt = .9, rt = {
|
|
|
1038
1046
|
!n && !r ? t.dataset.fade = "both" : n ? r ? t.removeAttribute("data-fade") : t.dataset.fade = "bottom" : t.dataset.fade = "top";
|
|
1039
1047
|
}, []);
|
|
1040
1048
|
c(() => {
|
|
1041
|
-
let e =
|
|
1042
|
-
if (e) return e.addEventListener("scroll",
|
|
1043
|
-
}, [
|
|
1049
|
+
let e = ie.current;
|
|
1050
|
+
if (e) return e.addEventListener("scroll", pt, { passive: !0 }), () => e.removeEventListener("scroll", pt);
|
|
1051
|
+
}, [pt]), c(() => {
|
|
1044
1052
|
let e = requestAnimationFrame(() => {
|
|
1045
|
-
let e =
|
|
1046
|
-
e && !q && (e.scrollTop = e.scrollHeight),
|
|
1053
|
+
let e = ie.current;
|
|
1054
|
+
e && !q && (e.scrollTop = e.scrollHeight), pt();
|
|
1047
1055
|
});
|
|
1048
1056
|
return () => cancelAnimationFrame(e);
|
|
1049
1057
|
}, [
|
|
1050
1058
|
t,
|
|
1051
1059
|
q,
|
|
1052
|
-
|
|
1060
|
+
pt
|
|
1053
1061
|
]), c(() => {
|
|
1054
|
-
(e === "idle" || e === "typing") &&
|
|
1062
|
+
(e === "idle" || e === "typing") && z.current?.focus({ preventScroll: !0 });
|
|
1055
1063
|
}, [e]), c(() => {
|
|
1056
|
-
let e =
|
|
1057
|
-
e && (
|
|
1064
|
+
let e = z.current;
|
|
1065
|
+
e && (V.current = e.scrollHeight || 17);
|
|
1058
1066
|
}, []), c(() => {
|
|
1059
|
-
let e =
|
|
1060
|
-
!e || !
|
|
1061
|
-
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (
|
|
1062
|
-
|
|
1067
|
+
let e = z.current, t = ce.current;
|
|
1068
|
+
!e || !V.current || requestAnimationFrame(() => {
|
|
1069
|
+
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (ie.current?.scrollHeight ?? 0) > V.current + 2, a = Ae.current;
|
|
1070
|
+
we.current ? !(i || n >= r - 2) && n < Te.current * (a?.wrap?.exitThreshold ?? .75) && (we.current = !1, Ee.current = !1, me(!1), ge(!0), De.current &&= (clearTimeout(De.current), null)) : (Te.current = r, (i || n >= Te.current * (a?.wrap?.nearThreshold ?? .92)) && (we.current = !0, Ee.current = !0, ge(!1)));
|
|
1063
1071
|
});
|
|
1064
1072
|
}, [t]), c(() => {
|
|
1065
1073
|
if (!K) return;
|
|
1066
|
-
let e =
|
|
1074
|
+
let e = ie.current;
|
|
1067
1075
|
if (!e || e.scrollTop === 0) return;
|
|
1068
1076
|
let t = e.scrollTop;
|
|
1069
1077
|
S(t, 0, {
|
|
@@ -1076,24 +1084,24 @@ var nt = .9, rt = {
|
|
|
1076
1084
|
}
|
|
1077
1085
|
});
|
|
1078
1086
|
}, [K]), c(() => {
|
|
1079
|
-
K ?
|
|
1087
|
+
K ? Se(!1) : (ve(!1), be(!1));
|
|
1080
1088
|
}, [K]), c(() => {
|
|
1081
1089
|
if (!K) return;
|
|
1082
|
-
let e =
|
|
1083
|
-
e && (
|
|
1090
|
+
let e = ae.current;
|
|
1091
|
+
e && (ye && !_e ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
|
|
1084
1092
|
}, [
|
|
1085
1093
|
K,
|
|
1086
|
-
|
|
1087
|
-
|
|
1094
|
+
ye,
|
|
1095
|
+
_e
|
|
1088
1096
|
]), c(() => {
|
|
1089
|
-
let t =
|
|
1090
|
-
if (
|
|
1097
|
+
let t = ke.current;
|
|
1098
|
+
if (ke.current = e, t !== "responding" || e !== "resting") return;
|
|
1091
1099
|
requestAnimationFrame(() => {
|
|
1092
|
-
let e =
|
|
1093
|
-
e && (
|
|
1094
|
-
}),
|
|
1095
|
-
let n =
|
|
1096
|
-
|
|
1100
|
+
let e = ie.current;
|
|
1101
|
+
e && (oe.current = e.scrollHeight, be(e.scrollHeight > 241), pt());
|
|
1102
|
+
}), de(!0);
|
|
1103
|
+
let n = Ae.current;
|
|
1104
|
+
Oe.start({
|
|
1097
1105
|
scaleX: [
|
|
1098
1106
|
1,
|
|
1099
1107
|
n?.ripple?.scaleX ?? 1.018,
|
|
@@ -1114,35 +1122,35 @@ var nt = .9, rt = {
|
|
|
1114
1122
|
]
|
|
1115
1123
|
}
|
|
1116
1124
|
});
|
|
1117
|
-
let r = window.setTimeout(() =>
|
|
1125
|
+
let r = window.setTimeout(() => de(!1), n?.ripple?.pulseDuration ?? 260);
|
|
1118
1126
|
return () => clearTimeout(r);
|
|
1119
1127
|
}, [
|
|
1120
1128
|
e,
|
|
1121
|
-
|
|
1122
|
-
|
|
1129
|
+
Oe,
|
|
1130
|
+
pt
|
|
1123
1131
|
]);
|
|
1124
|
-
let
|
|
1125
|
-
let e =
|
|
1126
|
-
e && (
|
|
1127
|
-
}, [n]),
|
|
1128
|
-
e.preventDefault(),
|
|
1129
|
-
}, [
|
|
1132
|
+
let mt = o(() => {
|
|
1133
|
+
let e = z.current;
|
|
1134
|
+
e && (se.current = !0, n(e.textContent ?? ""));
|
|
1135
|
+
}, [n]), ht = o((e) => {
|
|
1136
|
+
e.preventDefault(), ot(e.clipboardData.getData("text/plain")) || mt();
|
|
1137
|
+
}, [mt]), gt = o((e) => {
|
|
1130
1138
|
if (e.key === "Enter") {
|
|
1131
|
-
if (e.preventDefault(), e.shiftKey)
|
|
1139
|
+
if (e.preventDefault(), e.shiftKey) ot("\n") || mt();
|
|
1132
1140
|
else if (j) return;
|
|
1133
1141
|
else (t.trim().length > 0 || Ie.current.length > 0) && r(t, Ie.current);
|
|
1134
1142
|
}
|
|
1135
1143
|
}, [
|
|
1136
1144
|
t,
|
|
1137
1145
|
r,
|
|
1138
|
-
|
|
1146
|
+
mt,
|
|
1139
1147
|
j
|
|
1140
1148
|
]);
|
|
1141
1149
|
return c(() => {
|
|
1142
|
-
let e =
|
|
1150
|
+
let e = z.current;
|
|
1143
1151
|
if (e) {
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1152
|
+
if (se.current) {
|
|
1153
|
+
se.current = !1;
|
|
1146
1154
|
return;
|
|
1147
1155
|
}
|
|
1148
1156
|
e.textContent !== t && (e.textContent = t, document.activeElement === e && $e(e));
|
|
@@ -1150,24 +1158,24 @@ var nt = .9, rt = {
|
|
|
1150
1158
|
}, [t]), /* @__PURE__ */ _(x, {
|
|
1151
1159
|
reducedMotion: "user",
|
|
1152
1160
|
children: /* @__PURE__ */ _(b, {
|
|
1153
|
-
id:
|
|
1161
|
+
id: L,
|
|
1154
1162
|
children: /* @__PURE__ */ v("div", {
|
|
1155
1163
|
className: W.wrap,
|
|
1156
|
-
onMouseEnter: () =>
|
|
1157
|
-
onMouseLeave: () =>
|
|
1158
|
-
style:
|
|
1164
|
+
onMouseEnter: () => ue(!0),
|
|
1165
|
+
onMouseLeave: () => ue(!1),
|
|
1166
|
+
style: F,
|
|
1159
1167
|
children: [
|
|
1160
1168
|
/* @__PURE__ */ _(C.div, {
|
|
1161
1169
|
className: `${W.root} ${K ? W.isGlassRoot : ""}`,
|
|
1162
1170
|
layout: !0,
|
|
1163
|
-
animate: { filter:
|
|
1171
|
+
animate: { filter: xe ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
|
|
1164
1172
|
style: {
|
|
1165
|
-
pointerEvents:
|
|
1166
|
-
width:
|
|
1167
|
-
maxWidth:
|
|
1173
|
+
pointerEvents: xe ? "none" : "auto",
|
|
1174
|
+
width: F?.width === "100%" ? "100%" : void 0,
|
|
1175
|
+
maxWidth: F?.maxWidth
|
|
1168
1176
|
},
|
|
1169
1177
|
transition: {
|
|
1170
|
-
...
|
|
1178
|
+
...ft,
|
|
1171
1179
|
filter: {
|
|
1172
1180
|
type: "tween",
|
|
1173
1181
|
duration: .2,
|
|
@@ -1175,19 +1183,19 @@ var nt = .9, rt = {
|
|
|
1175
1183
|
}
|
|
1176
1184
|
},
|
|
1177
1185
|
children: /* @__PURE__ */ v(C.div, {
|
|
1178
|
-
className: `${W.surface} ${K ? W.glass : ""} ${rt ? W.hovered : ""} ${
|
|
1186
|
+
className: `${W.surface} ${K ? W.glass : ""} ${rt ? W.hovered : ""} ${B ? W.pulsed : ""}`,
|
|
1179
1187
|
style: {
|
|
1180
1188
|
alignItems: "stretch",
|
|
1181
1189
|
flexDirection: "column",
|
|
1182
1190
|
justifyContent: "center"
|
|
1183
1191
|
},
|
|
1184
|
-
transition:
|
|
1185
|
-
animate:
|
|
1186
|
-
onClick: () =>
|
|
1192
|
+
transition: ft,
|
|
1193
|
+
animate: Oe,
|
|
1194
|
+
onClick: () => z.current?.focus(),
|
|
1187
1195
|
children: [
|
|
1188
1196
|
/* @__PURE__ */ _("input", {
|
|
1189
1197
|
type: "file",
|
|
1190
|
-
ref:
|
|
1198
|
+
ref: je,
|
|
1191
1199
|
accept: h,
|
|
1192
1200
|
multiple: T,
|
|
1193
1201
|
style: { display: "none" },
|
|
@@ -1230,15 +1238,15 @@ var nt = .9, rt = {
|
|
|
1230
1238
|
display: "flex",
|
|
1231
1239
|
flexDirection: "row",
|
|
1232
1240
|
alignItems: "center",
|
|
1233
|
-
flexWrap:
|
|
1234
|
-
justifyContent:
|
|
1241
|
+
flexWrap: pe ? "wrap" : "nowrap",
|
|
1242
|
+
justifyContent: pe ? "flex-end" : "flex-start",
|
|
1235
1243
|
width: "100%",
|
|
1236
1244
|
minWidth: 0,
|
|
1237
1245
|
flex: 1
|
|
1238
1246
|
},
|
|
1239
1247
|
children: [
|
|
1240
1248
|
/* @__PURE__ */ _("span", {
|
|
1241
|
-
ref:
|
|
1249
|
+
ref: ce,
|
|
1242
1250
|
"aria-hidden": "true",
|
|
1243
1251
|
style: {
|
|
1244
1252
|
position: "absolute",
|
|
@@ -1251,16 +1259,16 @@ var nt = .9, rt = {
|
|
|
1251
1259
|
children: t
|
|
1252
1260
|
}),
|
|
1253
1261
|
/* @__PURE__ */ _("div", {
|
|
1254
|
-
ref:
|
|
1262
|
+
ref: ae,
|
|
1255
1263
|
className: W.editorClip,
|
|
1256
|
-
style: { flexBasis:
|
|
1264
|
+
style: { flexBasis: pe ? "100%" : void 0 },
|
|
1257
1265
|
children: /* @__PURE__ */ _(C.div, {
|
|
1258
|
-
ref:
|
|
1266
|
+
ref: ie,
|
|
1259
1267
|
className: `${W.editorWrap} ${K ? W.editorWrapGlass : ""}`,
|
|
1260
1268
|
layout: "position",
|
|
1261
|
-
animate: K &&
|
|
1269
|
+
animate: K && ye ? { maxHeight: _e ? oe.current : 240 } : void 0,
|
|
1262
1270
|
transition: {
|
|
1263
|
-
...
|
|
1271
|
+
...ft,
|
|
1264
1272
|
maxHeight: {
|
|
1265
1273
|
type: "spring",
|
|
1266
1274
|
stiffness: 300,
|
|
@@ -1269,24 +1277,24 @@ var nt = .9, rt = {
|
|
|
1269
1277
|
}
|
|
1270
1278
|
},
|
|
1271
1279
|
children: /* @__PURE__ */ _("div", {
|
|
1272
|
-
ref:
|
|
1280
|
+
ref: z,
|
|
1273
1281
|
className: W.editor,
|
|
1274
1282
|
contentEditable: q ? "false" : "plaintext-only",
|
|
1275
1283
|
suppressContentEditableWarning: !0,
|
|
1276
|
-
onInput:
|
|
1277
|
-
onKeyDown:
|
|
1278
|
-
onPaste:
|
|
1284
|
+
onInput: mt,
|
|
1285
|
+
onKeyDown: gt,
|
|
1286
|
+
onPaste: ht,
|
|
1279
1287
|
spellCheck: !1,
|
|
1280
1288
|
role: "textbox",
|
|
1281
1289
|
"aria-multiline": "true",
|
|
1282
|
-
"aria-label":
|
|
1283
|
-
"data-placeholder": q ? "" :
|
|
1290
|
+
"aria-label": ne,
|
|
1291
|
+
"data-placeholder": q ? "" : ne
|
|
1284
1292
|
})
|
|
1285
1293
|
})
|
|
1286
1294
|
}),
|
|
1287
1295
|
/* @__PURE__ */ v("div", {
|
|
1288
1296
|
className: W.buttonGroup,
|
|
1289
|
-
children: [!K &&
|
|
1297
|
+
children: [!K && he && ut && /* @__PURE__ */ _(C.div, {
|
|
1290
1298
|
initial: {
|
|
1291
1299
|
opacity: 0,
|
|
1292
1300
|
scale: nt,
|
|
@@ -1304,7 +1312,7 @@ var nt = .9, rt = {
|
|
|
1304
1312
|
scale: nt,
|
|
1305
1313
|
width: 0,
|
|
1306
1314
|
marginLeft: 0,
|
|
1307
|
-
transition:
|
|
1315
|
+
transition: Ee.current ? {
|
|
1308
1316
|
type: "tween",
|
|
1309
1317
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1310
1318
|
ease: "easeOut",
|
|
@@ -1329,7 +1337,7 @@ var nt = .9, rt = {
|
|
|
1329
1337
|
position: "relative",
|
|
1330
1338
|
height: 28
|
|
1331
1339
|
},
|
|
1332
|
-
children: /* @__PURE__ */ _(
|
|
1340
|
+
children: /* @__PURE__ */ _(H, {
|
|
1333
1341
|
variant: "ghost",
|
|
1334
1342
|
"data-voice": G.state,
|
|
1335
1343
|
icon: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
@@ -1343,7 +1351,7 @@ var nt = .9, rt = {
|
|
|
1343
1351
|
})] }),
|
|
1344
1352
|
onClick: (e) => {
|
|
1345
1353
|
if (e.stopPropagation(), G.state !== "denied") {
|
|
1346
|
-
if (!
|
|
1354
|
+
if (!lt) {
|
|
1347
1355
|
let e = Math.min(Ke.current ?? t.length, t.length);
|
|
1348
1356
|
Ge.current = {
|
|
1349
1357
|
base: t,
|
|
@@ -1356,7 +1364,7 @@ var nt = .9, rt = {
|
|
|
1356
1364
|
"aria-busy": G.state === "requesting" || G.state === "transcribing",
|
|
1357
1365
|
"aria-pressed": G.state === "listening",
|
|
1358
1366
|
disabled: G.state === "denied",
|
|
1359
|
-
"aria-label": G.state === "listening" ?
|
|
1367
|
+
"aria-label": G.state === "listening" ? R.stopListening : G.state === "requesting" ? R.waitingForMicrophone : G.state === "transcribing" ? R.cancelTranscription : G.state === "denied" ? R.microphoneBlocked : R.dictate,
|
|
1360
1368
|
style: {
|
|
1361
1369
|
width: "100%",
|
|
1362
1370
|
height: "100%",
|
|
@@ -1366,11 +1374,11 @@ var nt = .9, rt = {
|
|
|
1366
1374
|
}, "mic"), /* @__PURE__ */ v(y, {
|
|
1367
1375
|
initial: !1,
|
|
1368
1376
|
onExitComplete: () => {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
},
|
|
1377
|
+
Ee.current && (Ee.current = !1, me(!0), De.current && clearTimeout(De.current), De.current = window.setTimeout(() => {
|
|
1378
|
+
ge(!0), De.current = null;
|
|
1379
|
+
}, Ae.current?.wrap?.slideInDelay ?? 120));
|
|
1372
1380
|
},
|
|
1373
|
-
children: [!K &&
|
|
1381
|
+
children: [!K && he && (re || A) && /* @__PURE__ */ _(C.div, {
|
|
1374
1382
|
initial: {
|
|
1375
1383
|
opacity: 0,
|
|
1376
1384
|
scale: nt,
|
|
@@ -1385,7 +1393,7 @@ var nt = .9, rt = {
|
|
|
1385
1393
|
opacity: 0,
|
|
1386
1394
|
scale: nt,
|
|
1387
1395
|
width: 0,
|
|
1388
|
-
transition:
|
|
1396
|
+
transition: Ee.current ? {
|
|
1389
1397
|
type: "tween",
|
|
1390
1398
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1391
1399
|
ease: "easeOut",
|
|
@@ -1437,23 +1445,23 @@ var nt = .9, rt = {
|
|
|
1437
1445
|
position: "absolute",
|
|
1438
1446
|
inset: 0
|
|
1439
1447
|
},
|
|
1440
|
-
children: /* @__PURE__ */ _(
|
|
1448
|
+
children: /* @__PURE__ */ _(H, {
|
|
1441
1449
|
variant: "ghost",
|
|
1442
|
-
icon: /* @__PURE__ */ _(
|
|
1450
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
1443
1451
|
size: 14,
|
|
1444
1452
|
"aria-hidden": !0
|
|
1445
1453
|
}),
|
|
1446
1454
|
onClick: (e) => {
|
|
1447
1455
|
e.stopPropagation(), k?.();
|
|
1448
1456
|
},
|
|
1449
|
-
"aria-label":
|
|
1450
|
-
title:
|
|
1457
|
+
"aria-label": R.cancelEdit,
|
|
1458
|
+
title: R.cancelEdit,
|
|
1451
1459
|
style: {
|
|
1452
1460
|
width: "100%",
|
|
1453
1461
|
height: "100%"
|
|
1454
1462
|
}
|
|
1455
1463
|
})
|
|
1456
|
-
}, "cancel-btn") :
|
|
1464
|
+
}, "cancel-btn") : re && !xe ? /* @__PURE__ */ _(C.div, {
|
|
1457
1465
|
initial: {
|
|
1458
1466
|
opacity: 0,
|
|
1459
1467
|
scale: .5
|
|
@@ -1474,17 +1482,17 @@ var nt = .9, rt = {
|
|
|
1474
1482
|
position: "absolute",
|
|
1475
1483
|
inset: 0
|
|
1476
1484
|
},
|
|
1477
|
-
children: /* @__PURE__ */ _(
|
|
1485
|
+
children: /* @__PURE__ */ _(H, {
|
|
1478
1486
|
variant: "ghost",
|
|
1479
|
-
icon: /* @__PURE__ */ _(
|
|
1487
|
+
icon: /* @__PURE__ */ _(fe, {
|
|
1480
1488
|
size: 14,
|
|
1481
1489
|
"aria-hidden": !0
|
|
1482
1490
|
}),
|
|
1483
1491
|
onClick: (e) => {
|
|
1484
|
-
e.stopPropagation(),
|
|
1492
|
+
e.stopPropagation(), Se(!0);
|
|
1485
1493
|
},
|
|
1486
|
-
"aria-label":
|
|
1487
|
-
title:
|
|
1494
|
+
"aria-label": R.add,
|
|
1495
|
+
title: R.add,
|
|
1488
1496
|
style: {
|
|
1489
1497
|
width: "100%",
|
|
1490
1498
|
height: "100%"
|
|
@@ -1492,7 +1500,7 @@ var nt = .9, rt = {
|
|
|
1492
1500
|
})
|
|
1493
1501
|
}, "plus-btn") : null
|
|
1494
1502
|
})
|
|
1495
|
-
}, "lead"),
|
|
1503
|
+
}, "lead"), dt && he && /* @__PURE__ */ _(C.div, {
|
|
1496
1504
|
initial: {
|
|
1497
1505
|
opacity: 0,
|
|
1498
1506
|
scale: nt,
|
|
@@ -1510,7 +1518,7 @@ var nt = .9, rt = {
|
|
|
1510
1518
|
scale: nt,
|
|
1511
1519
|
width: 0,
|
|
1512
1520
|
marginLeft: 0,
|
|
1513
|
-
transition:
|
|
1521
|
+
transition: Ee.current ? {
|
|
1514
1522
|
type: "tween",
|
|
1515
1523
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1516
1524
|
ease: "easeOut"
|
|
@@ -1522,8 +1530,8 @@ var nt = .9, rt = {
|
|
|
1522
1530
|
type: "tween",
|
|
1523
1531
|
duration: .15
|
|
1524
1532
|
},
|
|
1525
|
-
width:
|
|
1526
|
-
marginLeft:
|
|
1533
|
+
width: it(ft),
|
|
1534
|
+
marginLeft: it(ft)
|
|
1527
1535
|
}
|
|
1528
1536
|
},
|
|
1529
1537
|
transition: {
|
|
@@ -1544,14 +1552,14 @@ var nt = .9, rt = {
|
|
|
1544
1552
|
transformOrigin: "right",
|
|
1545
1553
|
height: 28
|
|
1546
1554
|
},
|
|
1547
|
-
children: /* @__PURE__ */ _(
|
|
1555
|
+
children: /* @__PURE__ */ _(H, {
|
|
1548
1556
|
variant: "primary",
|
|
1549
1557
|
icon: /* @__PURE__ */ _(Le, { mode: Xe ? "stop" : A ? "check" : "send" }),
|
|
1550
1558
|
onClick: (e) => {
|
|
1551
1559
|
e.stopPropagation(), Xe ? i?.() : j || r(t, Pe);
|
|
1552
1560
|
},
|
|
1553
1561
|
disabled: Ze,
|
|
1554
|
-
"aria-label": Xe ?
|
|
1562
|
+
"aria-label": Xe ? R.stop : A ? R.save : R.send,
|
|
1555
1563
|
style: {
|
|
1556
1564
|
flexShrink: 0,
|
|
1557
1565
|
width: 28
|
|
@@ -1566,31 +1574,31 @@ var nt = .9, rt = {
|
|
|
1566
1574
|
})
|
|
1567
1575
|
}),
|
|
1568
1576
|
/* @__PURE__ */ _(Be, {
|
|
1569
|
-
isAddOpen:
|
|
1570
|
-
setIsAddOpen:
|
|
1571
|
-
items:
|
|
1577
|
+
isAddOpen: xe,
|
|
1578
|
+
setIsAddOpen: Se,
|
|
1579
|
+
items: N || void 0,
|
|
1572
1580
|
onAdd: (e, t) => {
|
|
1573
|
-
let n =
|
|
1574
|
-
t === "attach" && !n?.onSelect &&
|
|
1581
|
+
let n = N ? N.find((e) => e.id === t) : void 0;
|
|
1582
|
+
t === "attach" && !n?.onSelect && je.current?.click(), a?.();
|
|
1575
1583
|
},
|
|
1576
|
-
showInlineGlyph:
|
|
1577
|
-
showButtons:
|
|
1584
|
+
showInlineGlyph: dt,
|
|
1585
|
+
showButtons: he,
|
|
1578
1586
|
ac: J
|
|
1579
1587
|
}),
|
|
1580
1588
|
/* @__PURE__ */ _(Re, {
|
|
1581
|
-
showActions:
|
|
1582
|
-
showReadMore:
|
|
1583
|
-
isExpanded:
|
|
1584
|
-
setIsExpanded:
|
|
1589
|
+
showActions: st,
|
|
1590
|
+
showReadMore: ct,
|
|
1591
|
+
isExpanded: _e,
|
|
1592
|
+
setIsExpanded: ve,
|
|
1585
1593
|
onCopy: D,
|
|
1586
1594
|
onEdit: O,
|
|
1587
1595
|
value: t,
|
|
1588
1596
|
ac: J
|
|
1589
1597
|
}),
|
|
1590
|
-
|
|
1598
|
+
ut && (G.state === "denied" || G.state === "failed") && /* @__PURE__ */ _("p", {
|
|
1591
1599
|
className: W.voiceNote,
|
|
1592
1600
|
"data-tone": G.state,
|
|
1593
|
-
children: G.state === "denied" ?
|
|
1601
|
+
children: G.state === "denied" ? R.microphoneBlockedHelp : G.error ?? te.couldNotOpen
|
|
1594
1602
|
})
|
|
1595
1603
|
]
|
|
1596
1604
|
})
|
|
@@ -1599,7 +1607,7 @@ var nt = .9, rt = {
|
|
|
1599
1607
|
});
|
|
1600
1608
|
//#endregion
|
|
1601
1609
|
//#region src/turnParts/turnParts.ts
|
|
1602
|
-
function
|
|
1610
|
+
function ct(e, t) {
|
|
1603
1611
|
let n = e.findIndex((e) => e.id === t.id);
|
|
1604
1612
|
if (n === -1) return [...e, t];
|
|
1605
1613
|
let r = e.slice();
|
|
@@ -1610,7 +1618,7 @@ function st(e, t) {
|
|
|
1610
1618
|
}
|
|
1611
1619
|
//#endregion
|
|
1612
1620
|
//#region src/useChatTurns/useChatTurns.ts
|
|
1613
|
-
var
|
|
1621
|
+
var lt = 260, ut = 220, dt = "Generating response", J = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2, 11), ft = () => ({
|
|
1614
1622
|
id: J(),
|
|
1615
1623
|
user: "",
|
|
1616
1624
|
ai: "",
|
|
@@ -1618,7 +1626,7 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1618
1626
|
versions: [],
|
|
1619
1627
|
versionIndex: 0,
|
|
1620
1628
|
state: "idle"
|
|
1621
|
-
}),
|
|
1629
|
+
}), pt = (e) => {
|
|
1622
1630
|
let t = e.versions;
|
|
1623
1631
|
if (!t?.length) return e;
|
|
1624
1632
|
let n = e.versionIndex ?? 0, r = t[n];
|
|
@@ -1630,7 +1638,7 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1630
1638
|
parts: e.parts
|
|
1631
1639
|
} : t)
|
|
1632
1640
|
};
|
|
1633
|
-
},
|
|
1641
|
+
}, mt = (e) => typeof e == "object" && !!e && Symbol.asyncIterator in e, ht = (e, t, n) => {
|
|
1634
1642
|
let r = 1e3 / t, i = Array(e.length), a = 0;
|
|
1635
1643
|
for (let t = 0; t < e.length; t++) {
|
|
1636
1644
|
a += r;
|
|
@@ -1639,8 +1647,8 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1639
1647
|
}
|
|
1640
1648
|
return i;
|
|
1641
1649
|
};
|
|
1642
|
-
function
|
|
1643
|
-
let [a, s] = m(() => [
|
|
1650
|
+
function gt({ onSend: e, revealSpeed: t = lt, sentencePause: n = ut, announcements: r, nextTurn: i = "after-answer" }) {
|
|
1651
|
+
let [a, s] = m(() => [ft()]), [l, u] = m(!1), d = p(null), f = p(null), h = p(/* @__PURE__ */ new Map()), g = p(/* @__PURE__ */ new Map()), _ = p(null), v = p(e), y = p(r), b = p(a);
|
|
1644
1652
|
c(() => {
|
|
1645
1653
|
v.current = e, b.current = a, y.current = r;
|
|
1646
1654
|
});
|
|
@@ -1653,7 +1661,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1653
1661
|
...n,
|
|
1654
1662
|
...t
|
|
1655
1663
|
};
|
|
1656
|
-
return "versionIndex" in t || "versions" in t ? i :
|
|
1664
|
+
return "versionIndex" in t || "versions" in t ? i : pt(i);
|
|
1657
1665
|
});
|
|
1658
1666
|
return r ? (b.current = i, i) : n;
|
|
1659
1667
|
});
|
|
@@ -1665,10 +1673,10 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1665
1673
|
e.clear(), t.clear(), s((e) => {
|
|
1666
1674
|
let t = e.map((e) => {
|
|
1667
1675
|
let t = n.find(([t]) => t === e.id)?.[1], i = r.find(([t]) => t === e.id)?.[1];
|
|
1668
|
-
return t === void 0 && !i ? e :
|
|
1676
|
+
return t === void 0 && !i ? e : pt({
|
|
1669
1677
|
...e,
|
|
1670
1678
|
...t === void 0 ? null : { ai: t },
|
|
1671
|
-
...i ? { parts: i.reduce(
|
|
1679
|
+
...i ? { parts: i.reduce(ct, e.parts) } : null
|
|
1672
1680
|
});
|
|
1673
1681
|
});
|
|
1674
1682
|
return b.current = t, t;
|
|
@@ -1693,7 +1701,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1693
1701
|
let D = o(() => {
|
|
1694
1702
|
s((e) => {
|
|
1695
1703
|
if (e.some((e) => (e.state === "idle" || e.state === "typing") && e.ai === "")) return e;
|
|
1696
|
-
let t = [...e,
|
|
1704
|
+
let t = [...e, ft()];
|
|
1697
1705
|
return b.current = t, t;
|
|
1698
1706
|
});
|
|
1699
1707
|
}, []), O = o((e, t) => {
|
|
@@ -1703,7 +1711,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1703
1711
|
w(e, r), a();
|
|
1704
1712
|
return;
|
|
1705
1713
|
}
|
|
1706
|
-
let o =
|
|
1714
|
+
let o = ht(r, t, n), s = performance.now(), c = 0, l = () => {
|
|
1707
1715
|
if (i.aborted) {
|
|
1708
1716
|
w(e, r), a();
|
|
1709
1717
|
return;
|
|
@@ -1725,7 +1733,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1725
1733
|
let n = y.current;
|
|
1726
1734
|
if (n === !1) return;
|
|
1727
1735
|
if (e === "responding") {
|
|
1728
|
-
let e = n && "responding" in n ? n.responding :
|
|
1736
|
+
let e = n && "responding" in n ? n.responding : dt;
|
|
1729
1737
|
e && Ke(e);
|
|
1730
1738
|
return;
|
|
1731
1739
|
}
|
|
@@ -1754,7 +1762,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1754
1762
|
turnId: e,
|
|
1755
1763
|
attachments: r
|
|
1756
1764
|
});
|
|
1757
|
-
if (
|
|
1765
|
+
if (mt(n)) for await (let t of n) {
|
|
1758
1766
|
if (a.signal.aborted) break;
|
|
1759
1767
|
if (typeof t == "string") c += t, w(e, c);
|
|
1760
1768
|
else {
|
|
@@ -1854,23 +1862,23 @@ var Y = {
|
|
|
1854
1862
|
menuItem: "ick-menuItem-V7gI",
|
|
1855
1863
|
menuIcon: "ick-menuIcon-tjBi",
|
|
1856
1864
|
menuCount: "ick-menuCount-tC3s"
|
|
1857
|
-
},
|
|
1865
|
+
}, _t = {
|
|
1858
1866
|
s: "s",
|
|
1859
1867
|
m: "m",
|
|
1860
1868
|
l: "l"
|
|
1861
|
-
},
|
|
1869
|
+
}, vt = {
|
|
1862
1870
|
s: 14,
|
|
1863
1871
|
m: 16,
|
|
1864
1872
|
l: 18
|
|
1865
|
-
},
|
|
1873
|
+
}, yt = vt, bt = {
|
|
1866
1874
|
s: Y.s,
|
|
1867
1875
|
m: Y.m,
|
|
1868
1876
|
l: Y.l
|
|
1869
|
-
},
|
|
1877
|
+
}, xt = {
|
|
1870
1878
|
plain: Y.plain,
|
|
1871
1879
|
glass: Y.glass,
|
|
1872
1880
|
bordered: Y.bordered
|
|
1873
|
-
},
|
|
1881
|
+
}, St = (e) => e.count === void 0 ? e.label : `${e.label}, ${e.count}`, Ct = (e) => {
|
|
1874
1882
|
let t = e?.parentElement ?? null;
|
|
1875
1883
|
for (; t;) {
|
|
1876
1884
|
let { overflowY: e } = getComputedStyle(t);
|
|
@@ -1878,8 +1886,8 @@ var Y = {
|
|
|
1878
1886
|
t = t.parentElement;
|
|
1879
1887
|
}
|
|
1880
1888
|
return window;
|
|
1881
|
-
},
|
|
1882
|
-
let D =
|
|
1889
|
+
}, wt = r(function({ title: e, subtitle: t, avatar: n, headingLevel: r = 2, truncate: i = !0, onBack: a, backHref: s, backLabel: l, actions: u = [], overflowLabel: d, variant: f = "plain", size: h = "m", align: g = "start", sticky: y = !1, elevateOnScroll: b = y, collapseActionsAt: x = 520, landmark: S = !0, children: C, className: w, ...T }, E) {
|
|
1890
|
+
let D = U("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [M, N] = m(!1), [ee, P] = m(!1), F = o((e) => {
|
|
1883
1891
|
j.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
1884
1892
|
}, [E]);
|
|
1885
1893
|
c(() => {
|
|
@@ -1887,29 +1895,29 @@ var Y = {
|
|
|
1887
1895
|
if (!e || x === !1 || typeof ResizeObserver > "u") return;
|
|
1888
1896
|
let t = new ResizeObserver(([e]) => {
|
|
1889
1897
|
let t = e.contentRect.width;
|
|
1890
|
-
|
|
1898
|
+
N(t > 0 && t < x);
|
|
1891
1899
|
});
|
|
1892
1900
|
return t.observe(e), () => t.disconnect();
|
|
1893
1901
|
}, [x]), c(() => {
|
|
1894
1902
|
if (!b) return;
|
|
1895
|
-
let e =
|
|
1903
|
+
let e = Ct(j.current), t = () => {
|
|
1896
1904
|
let t = e === window ? window.scrollY : e.scrollTop;
|
|
1897
|
-
|
|
1905
|
+
P(t > 0);
|
|
1898
1906
|
};
|
|
1899
1907
|
return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1900
1908
|
}, [b]);
|
|
1901
|
-
let
|
|
1909
|
+
let I = x !== !1 && M, L = I ? u.filter((e) => e.pinned) : u, R = I ? u.filter((e) => !e.pinned) : [], te = r ? `h${r}` : "span";
|
|
1902
1910
|
return /* @__PURE__ */ v(S ? "header" : "div", {
|
|
1903
|
-
ref:
|
|
1911
|
+
ref: F,
|
|
1904
1912
|
className: [
|
|
1905
1913
|
Y.header,
|
|
1906
|
-
|
|
1907
|
-
|
|
1914
|
+
bt[h],
|
|
1915
|
+
xt[f],
|
|
1908
1916
|
g === "center" ? Y.center : "",
|
|
1909
1917
|
y ? Y.sticky : "",
|
|
1910
1918
|
w ?? ""
|
|
1911
1919
|
].filter(Boolean).join(" "),
|
|
1912
|
-
"data-scrolled": b &&
|
|
1920
|
+
"data-scrolled": b && ee || void 0,
|
|
1913
1921
|
...T,
|
|
1914
1922
|
children: [/* @__PURE__ */ v("div", {
|
|
1915
1923
|
className: Y.start,
|
|
@@ -1919,14 +1927,14 @@ var Y = {
|
|
|
1919
1927
|
className: Y.back,
|
|
1920
1928
|
"aria-label": k,
|
|
1921
1929
|
children: /* @__PURE__ */ _(O, {
|
|
1922
|
-
size:
|
|
1930
|
+
size: yt[h],
|
|
1923
1931
|
"aria-hidden": !0
|
|
1924
1932
|
})
|
|
1925
|
-
}) : a ? /* @__PURE__ */ _(
|
|
1933
|
+
}) : a ? /* @__PURE__ */ _(H, {
|
|
1926
1934
|
variant: "secondary",
|
|
1927
|
-
size:
|
|
1935
|
+
size: _t[h],
|
|
1928
1936
|
icon: /* @__PURE__ */ _(O, {
|
|
1929
|
-
size:
|
|
1937
|
+
size: yt[h],
|
|
1930
1938
|
"aria-hidden": !0
|
|
1931
1939
|
}),
|
|
1932
1940
|
"aria-label": k,
|
|
@@ -1938,7 +1946,7 @@ var Y = {
|
|
|
1938
1946
|
}),
|
|
1939
1947
|
(e || t) && /* @__PURE__ */ v("div", {
|
|
1940
1948
|
className: Y.titles,
|
|
1941
|
-
children: [e && /* @__PURE__ */ _(
|
|
1949
|
+
children: [e && /* @__PURE__ */ _(te, {
|
|
1942
1950
|
className: [Y.title, i ? Y.truncate : ""].filter(Boolean).join(" "),
|
|
1943
1951
|
title: typeof e == "string" && i ? e : void 0,
|
|
1944
1952
|
children: e
|
|
@@ -1952,12 +1960,12 @@ var Y = {
|
|
|
1952
1960
|
className: Y.end,
|
|
1953
1961
|
children: [
|
|
1954
1962
|
C,
|
|
1955
|
-
|
|
1963
|
+
L.map((e) => /* @__PURE__ */ _(Tt, {
|
|
1956
1964
|
action: e,
|
|
1957
1965
|
size: h
|
|
1958
1966
|
}, e.id)),
|
|
1959
|
-
|
|
1960
|
-
actions:
|
|
1967
|
+
R.length > 0 && /* @__PURE__ */ _(Et, {
|
|
1968
|
+
actions: R,
|
|
1961
1969
|
size: h,
|
|
1962
1970
|
label: A
|
|
1963
1971
|
})
|
|
@@ -1965,8 +1973,8 @@ var Y = {
|
|
|
1965
1973
|
})]
|
|
1966
1974
|
});
|
|
1967
1975
|
});
|
|
1968
|
-
function
|
|
1969
|
-
let n =
|
|
1976
|
+
function Tt({ action: e, size: t }) {
|
|
1977
|
+
let n = St(e), r = e.count !== void 0 && e.count > 0 ? /* @__PURE__ */ _("span", {
|
|
1970
1978
|
className: Y.badge,
|
|
1971
1979
|
"aria-hidden": "true",
|
|
1972
1980
|
children: e.count > 99 ? "99+" : e.count
|
|
@@ -1979,9 +1987,9 @@ function wt({ action: e, size: t }) {
|
|
|
1979
1987
|
children: [e.icon, r]
|
|
1980
1988
|
}) : /* @__PURE__ */ v("span", {
|
|
1981
1989
|
className: Y.actionWrap,
|
|
1982
|
-
children: [/* @__PURE__ */ _(
|
|
1990
|
+
children: [/* @__PURE__ */ _(H, {
|
|
1983
1991
|
variant: "secondary",
|
|
1984
|
-
size:
|
|
1992
|
+
size: _t[t],
|
|
1985
1993
|
icon: e.icon,
|
|
1986
1994
|
"aria-label": n,
|
|
1987
1995
|
title: e.label,
|
|
@@ -1991,7 +1999,7 @@ function wt({ action: e, size: t }) {
|
|
|
1991
1999
|
}), r]
|
|
1992
2000
|
});
|
|
1993
2001
|
}
|
|
1994
|
-
function
|
|
2002
|
+
function Et({ actions: e, size: t, label: n }) {
|
|
1995
2003
|
let [r, i] = m(!1), [a, s] = m(0), [u, d] = m(!1), f = p(null), h = p(null), g = l(), y = o((e) => {
|
|
1996
2004
|
i(!1), e && f.current?.focus();
|
|
1997
2005
|
}, []), b = Math.min(a, Math.max(e.length - 1, 0));
|
|
@@ -1999,12 +2007,12 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
1999
2007
|
r && (h.current?.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"]"))?.[b]?.focus();
|
|
2000
2008
|
}, [r, b]), /* @__PURE__ */ v("span", {
|
|
2001
2009
|
className: Y.overflow,
|
|
2002
|
-
children: [/* @__PURE__ */ _(
|
|
2010
|
+
children: [/* @__PURE__ */ _(H, {
|
|
2003
2011
|
ref: f,
|
|
2004
2012
|
variant: "secondary",
|
|
2005
|
-
size:
|
|
2006
|
-
icon: /* @__PURE__ */ _(
|
|
2007
|
-
size:
|
|
2013
|
+
size: _t[t],
|
|
2014
|
+
icon: /* @__PURE__ */ _(ce, {
|
|
2015
|
+
size: yt[t],
|
|
2008
2016
|
"aria-hidden": !0
|
|
2009
2017
|
}),
|
|
2010
2018
|
"aria-label": n,
|
|
@@ -2073,17 +2081,17 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
2073
2081
|
})]
|
|
2074
2082
|
});
|
|
2075
2083
|
}
|
|
2076
|
-
var
|
|
2084
|
+
var Dt = {
|
|
2077
2085
|
row: "ick-row-yugg",
|
|
2078
2086
|
reveal: "ick-reveal-z3mw"
|
|
2079
|
-
},
|
|
2080
|
-
function
|
|
2081
|
-
let [h, y] = m(!1), b = p(null), x =
|
|
2087
|
+
}, Ot = 1600;
|
|
2088
|
+
function kt({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i = null, children: a, reveal: s = !1, busy: l = !1, labels: u, className: d, ...f }) {
|
|
2089
|
+
let [h, y] = m(!1), b = p(null), x = U("answerActions", u);
|
|
2082
2090
|
c(() => () => {
|
|
2083
2091
|
b.current && clearTimeout(b.current);
|
|
2084
2092
|
}, []);
|
|
2085
2093
|
let S = o(() => {
|
|
2086
|
-
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1),
|
|
2094
|
+
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1), Ot);
|
|
2087
2095
|
}, [
|
|
2088
2096
|
x.copied,
|
|
2089
2097
|
t,
|
|
@@ -2091,15 +2099,15 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2091
2099
|
]), C = (e) => r?.(i === e ? null : e);
|
|
2092
2100
|
return /* @__PURE__ */ v("div", {
|
|
2093
2101
|
className: [
|
|
2094
|
-
|
|
2095
|
-
s ?
|
|
2102
|
+
Dt.row,
|
|
2103
|
+
s ? Dt.reveal : "",
|
|
2096
2104
|
d ?? ""
|
|
2097
2105
|
].filter(Boolean).join(" "),
|
|
2098
2106
|
...f,
|
|
2099
2107
|
children: [
|
|
2100
|
-
e.trim() && /* @__PURE__ */ _(
|
|
2108
|
+
e.trim() && /* @__PURE__ */ _(H, {
|
|
2101
2109
|
variant: "ghost",
|
|
2102
|
-
icon: _(h ? j :
|
|
2110
|
+
icon: _(h ? j : P, {
|
|
2103
2111
|
size: 14,
|
|
2104
2112
|
"aria-hidden": !0
|
|
2105
2113
|
}),
|
|
@@ -2107,9 +2115,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2107
2115
|
"aria-label": h ? x.copied : x.copy,
|
|
2108
2116
|
title: h ? x.copied : x.copy
|
|
2109
2117
|
}),
|
|
2110
|
-
n && /* @__PURE__ */ _(
|
|
2118
|
+
n && /* @__PURE__ */ _(H, {
|
|
2111
2119
|
variant: "ghost",
|
|
2112
|
-
icon: /* @__PURE__ */ _(
|
|
2120
|
+
icon: /* @__PURE__ */ _(pe, {
|
|
2113
2121
|
size: 14,
|
|
2114
2122
|
"aria-hidden": !0
|
|
2115
2123
|
}),
|
|
@@ -2119,9 +2127,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2119
2127
|
"aria-label": x.regenerate,
|
|
2120
2128
|
title: x.regenerate
|
|
2121
2129
|
}),
|
|
2122
|
-
r && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
2130
|
+
r && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(H, {
|
|
2123
2131
|
variant: "ghost",
|
|
2124
|
-
icon: /* @__PURE__ */ _(
|
|
2132
|
+
icon: /* @__PURE__ */ _(be, {
|
|
2125
2133
|
size: 14,
|
|
2126
2134
|
"aria-hidden": !0
|
|
2127
2135
|
}),
|
|
@@ -2129,9 +2137,9 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2129
2137
|
"aria-pressed": i === "up",
|
|
2130
2138
|
"aria-label": x.up,
|
|
2131
2139
|
title: x.up
|
|
2132
|
-
}), /* @__PURE__ */ _(
|
|
2140
|
+
}), /* @__PURE__ */ _(H, {
|
|
2133
2141
|
variant: "ghost",
|
|
2134
|
-
icon: /* @__PURE__ */ _(
|
|
2142
|
+
icon: /* @__PURE__ */ _(ye, {
|
|
2135
2143
|
size: 14,
|
|
2136
2144
|
"aria-hidden": !0
|
|
2137
2145
|
}),
|
|
@@ -2144,7 +2152,7 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2144
2152
|
]
|
|
2145
2153
|
});
|
|
2146
2154
|
}
|
|
2147
|
-
var
|
|
2155
|
+
var At = {
|
|
2148
2156
|
branch: "ick-branch-lR6b",
|
|
2149
2157
|
step: "ick-step-JSch ick-target-vuT2",
|
|
2150
2158
|
count: "ick-count-kOmV",
|
|
@@ -2152,34 +2160,34 @@ var kt = {
|
|
|
2152
2160
|
};
|
|
2153
2161
|
//#endregion
|
|
2154
2162
|
//#region src/Branch/Branch.tsx
|
|
2155
|
-
function
|
|
2156
|
-
let o =
|
|
2163
|
+
function jt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a }) {
|
|
2164
|
+
let o = U("branch", r);
|
|
2157
2165
|
if (e < 2) return null;
|
|
2158
2166
|
let s = Math.min(Math.max(t, 0), e - 1), c = o.position.replace("{index}", String(s + 1)).replace("{total}", String(e));
|
|
2159
2167
|
return /* @__PURE__ */ v("div", {
|
|
2160
|
-
className: [
|
|
2168
|
+
className: [At.branch, i ?? ""].filter(Boolean).join(" "),
|
|
2161
2169
|
role: "group",
|
|
2162
2170
|
"aria-label": c,
|
|
2163
2171
|
...a,
|
|
2164
2172
|
children: [
|
|
2165
2173
|
/* @__PURE__ */ _("button", {
|
|
2166
2174
|
type: "button",
|
|
2167
|
-
className:
|
|
2175
|
+
className: At.step,
|
|
2168
2176
|
onClick: () => n(s - 1),
|
|
2169
2177
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2170
2178
|
disabled: s === 0,
|
|
2171
2179
|
"aria-label": o.previous,
|
|
2172
|
-
children: /* @__PURE__ */ _(
|
|
2180
|
+
children: /* @__PURE__ */ _(N, {
|
|
2173
2181
|
size: 14,
|
|
2174
2182
|
"aria-hidden": !0
|
|
2175
2183
|
})
|
|
2176
2184
|
}),
|
|
2177
2185
|
/* @__PURE__ */ v("span", {
|
|
2178
|
-
className:
|
|
2186
|
+
className: At.count,
|
|
2179
2187
|
children: [
|
|
2180
2188
|
s + 1,
|
|
2181
2189
|
/* @__PURE__ */ _("span", {
|
|
2182
|
-
className:
|
|
2190
|
+
className: At.of,
|
|
2183
2191
|
children: "/"
|
|
2184
2192
|
}),
|
|
2185
2193
|
e
|
|
@@ -2187,12 +2195,12 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2187
2195
|
}),
|
|
2188
2196
|
/* @__PURE__ */ _("button", {
|
|
2189
2197
|
type: "button",
|
|
2190
|
-
className:
|
|
2198
|
+
className: At.step,
|
|
2191
2199
|
onClick: () => n(s + 1),
|
|
2192
2200
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2193
2201
|
disabled: s === e - 1,
|
|
2194
2202
|
"aria-label": o.next,
|
|
2195
|
-
children: /* @__PURE__ */ _(
|
|
2203
|
+
children: /* @__PURE__ */ _(ee, {
|
|
2196
2204
|
size: 14,
|
|
2197
2205
|
"aria-hidden": !0
|
|
2198
2206
|
})
|
|
@@ -2200,7 +2208,7 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2200
2208
|
]
|
|
2201
2209
|
});
|
|
2202
2210
|
}
|
|
2203
|
-
var
|
|
2211
|
+
var Mt = {
|
|
2204
2212
|
loader: "ick-loader-7WbG",
|
|
2205
2213
|
dot: "ick-dot-JJFT",
|
|
2206
2214
|
blink: "ick-blink-MCVu",
|
|
@@ -2210,10 +2218,10 @@ var jt = {
|
|
|
2210
2218
|
};
|
|
2211
2219
|
//#endregion
|
|
2212
2220
|
//#region src/Loader/Loader.tsx
|
|
2213
|
-
function
|
|
2221
|
+
function Nt({ variant: e = "dots", children: t, label: n = null, className: r, ...i }) {
|
|
2214
2222
|
let a = [
|
|
2215
|
-
|
|
2216
|
-
|
|
2223
|
+
Mt.loader,
|
|
2224
|
+
Mt[e],
|
|
2217
2225
|
r ?? ""
|
|
2218
2226
|
].filter(Boolean).join(" ");
|
|
2219
2227
|
return /* @__PURE__ */ v("div", {
|
|
@@ -2222,21 +2230,21 @@ function Mt({ variant: e = "dots", children: t, label: n = null, className: r, .
|
|
|
2222
2230
|
"aria-hidden": !n || void 0,
|
|
2223
2231
|
...i,
|
|
2224
2232
|
children: [n && /* @__PURE__ */ _("span", {
|
|
2225
|
-
className:
|
|
2233
|
+
className: Mt.srOnly,
|
|
2226
2234
|
children: n
|
|
2227
2235
|
}), e === "dots" ? /* @__PURE__ */ v(g, { children: [
|
|
2228
|
-
/* @__PURE__ */ _("span", { className:
|
|
2229
|
-
/* @__PURE__ */ _("span", { className:
|
|
2230
|
-
/* @__PURE__ */ _("span", { className:
|
|
2236
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2237
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2238
|
+
/* @__PURE__ */ _("span", { className: Mt.dot })
|
|
2231
2239
|
] }) : /* @__PURE__ */ _("span", {
|
|
2232
|
-
className:
|
|
2240
|
+
className: Mt.text,
|
|
2233
2241
|
children: t
|
|
2234
2242
|
})]
|
|
2235
2243
|
});
|
|
2236
2244
|
}
|
|
2237
2245
|
//#endregion
|
|
2238
2246
|
//#region src/disclosure/useDisclosure.ts
|
|
2239
|
-
function
|
|
2247
|
+
function Pt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
2240
2248
|
let [i, a] = m(null), s = e ?? i ?? t ?? r;
|
|
2241
2249
|
return {
|
|
2242
2250
|
isOpen: s,
|
|
@@ -2250,7 +2258,7 @@ function Nt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
|
2250
2258
|
])
|
|
2251
2259
|
};
|
|
2252
2260
|
}
|
|
2253
|
-
var
|
|
2261
|
+
var Ft = {
|
|
2254
2262
|
header: "ick-header-C0FS ick-target-vuT2",
|
|
2255
2263
|
chevron: "ick-chevron-RY4c",
|
|
2256
2264
|
static: "ick-static-6vUk",
|
|
@@ -2258,30 +2266,30 @@ var Pt = {
|
|
|
2258
2266
|
label: "ick-label-L-k2",
|
|
2259
2267
|
sweep: "ick-sweep-owLs",
|
|
2260
2268
|
meta: "ick-meta-wT3y"
|
|
2261
|
-
},
|
|
2262
|
-
function
|
|
2269
|
+
}, It = (...e) => e.filter(Boolean).join(" ");
|
|
2270
|
+
function Lt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, glyph: a, label: o, pending: s, meta: c, children: l, className: u }) {
|
|
2263
2271
|
let d = /* @__PURE__ */ v(g, { children: [
|
|
2264
2272
|
a && /* @__PURE__ */ _("span", {
|
|
2265
|
-
className:
|
|
2273
|
+
className: Ft.glyph,
|
|
2266
2274
|
children: a
|
|
2267
2275
|
}),
|
|
2268
2276
|
/* @__PURE__ */ _("span", {
|
|
2269
|
-
className:
|
|
2277
|
+
className: Ft.label,
|
|
2270
2278
|
"data-pending": s || void 0,
|
|
2271
2279
|
children: o
|
|
2272
2280
|
}),
|
|
2273
2281
|
l,
|
|
2274
2282
|
c ? /* @__PURE__ */ _("span", {
|
|
2275
|
-
className:
|
|
2283
|
+
className: Ft.meta,
|
|
2276
2284
|
children: c
|
|
2277
2285
|
}) : null,
|
|
2278
2286
|
n && /* @__PURE__ */ _(M, {
|
|
2279
|
-
className:
|
|
2287
|
+
className: Ft.chevron,
|
|
2280
2288
|
size: 14,
|
|
2281
2289
|
"aria-hidden": !0
|
|
2282
2290
|
})
|
|
2283
2291
|
] }), f = {
|
|
2284
|
-
className: Ft
|
|
2292
|
+
className: It(Ft.header, u),
|
|
2285
2293
|
"data-fit": e
|
|
2286
2294
|
};
|
|
2287
2295
|
return n ? /* @__PURE__ */ _("button", {
|
|
@@ -2295,25 +2303,25 @@ function It({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, g
|
|
|
2295
2303
|
children: d
|
|
2296
2304
|
}) : /* @__PURE__ */ _("div", {
|
|
2297
2305
|
...f,
|
|
2298
|
-
className:
|
|
2306
|
+
className: It(f.className, Ft.static),
|
|
2299
2307
|
children: d
|
|
2300
2308
|
});
|
|
2301
2309
|
}
|
|
2302
|
-
var
|
|
2310
|
+
var Rt = {
|
|
2303
2311
|
outer: "ick-outer-6UEA",
|
|
2304
2312
|
wrap: "ick-wrap-u6ww"
|
|
2305
2313
|
};
|
|
2306
2314
|
//#endregion
|
|
2307
2315
|
//#region src/disclosure/DisclosureBody.tsx
|
|
2308
|
-
function
|
|
2316
|
+
function zt({ id: e, open: t, className: n, children: r }) {
|
|
2309
2317
|
let i = q();
|
|
2310
2318
|
return /* @__PURE__ */ _("div", {
|
|
2311
2319
|
id: e,
|
|
2312
|
-
className:
|
|
2320
|
+
className: Rt.outer,
|
|
2313
2321
|
children: /* @__PURE__ */ _(y, {
|
|
2314
2322
|
initial: !1,
|
|
2315
2323
|
children: t && r ? /* @__PURE__ */ _(C.div, {
|
|
2316
|
-
className:
|
|
2324
|
+
className: Rt.wrap,
|
|
2317
2325
|
initial: i ? { opacity: 0 } : {
|
|
2318
2326
|
height: 0,
|
|
2319
2327
|
opacity: 0
|
|
@@ -2345,20 +2353,20 @@ function Rt({ id: e, open: t, className: n, children: r }) {
|
|
|
2345
2353
|
}
|
|
2346
2354
|
//#endregion
|
|
2347
2355
|
//#region src/duration/formatDuration.ts
|
|
2348
|
-
function
|
|
2356
|
+
function Bt(e) {
|
|
2349
2357
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
2350
2358
|
if (e < 1e3) return `${Math.round(e)}ms`;
|
|
2351
2359
|
let t = e / 1e3;
|
|
2352
2360
|
return `${t < 10 ? t.toFixed(1) : Math.round(t)}s`;
|
|
2353
2361
|
}
|
|
2354
|
-
var
|
|
2362
|
+
var Vt = {
|
|
2355
2363
|
reasoning: "ick-reasoning-qbLZ",
|
|
2356
2364
|
bodyInner: "ick-bodyInner-5PBC"
|
|
2357
2365
|
};
|
|
2358
2366
|
//#endregion
|
|
2359
2367
|
//#region src/Reasoning/Reasoning.tsx
|
|
2360
|
-
function
|
|
2361
|
-
let u =
|
|
2368
|
+
function Ht({ children: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2369
|
+
let u = U("reasoning", o), d = l(), f = t === "thinking", { isOpen: p, toggle: h } = Pt({
|
|
2362
2370
|
open: r,
|
|
2363
2371
|
defaultOpen: i,
|
|
2364
2372
|
onOpenChange: a,
|
|
@@ -2374,12 +2382,12 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2374
2382
|
from: null,
|
|
2375
2383
|
took: e.from === null ? null : Date.now() - e.from
|
|
2376
2384
|
}));
|
|
2377
|
-
let S = n ?? b.took, C = f || S === null ? "" :
|
|
2385
|
+
let S = n ?? b.took, C = f || S === null ? "" : Bt(S);
|
|
2378
2386
|
return /* @__PURE__ */ v("div", {
|
|
2379
|
-
className: [
|
|
2387
|
+
className: [Vt.reasoning, s ?? ""].filter(Boolean).join(" "),
|
|
2380
2388
|
"data-state": t,
|
|
2381
2389
|
...c,
|
|
2382
|
-
children: [/* @__PURE__ */ _(
|
|
2390
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2383
2391
|
fit: "inline",
|
|
2384
2392
|
open: p,
|
|
2385
2393
|
onToggle: h,
|
|
@@ -2390,17 +2398,17 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2390
2398
|
}),
|
|
2391
2399
|
label: f ? u.thinking : C ? `${u.thoughtFor} ${C}` : u.thought,
|
|
2392
2400
|
pending: f
|
|
2393
|
-
}), /* @__PURE__ */ _(
|
|
2401
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2394
2402
|
id: d,
|
|
2395
2403
|
open: p,
|
|
2396
|
-
className:
|
|
2404
|
+
className: Vt.bodyInner,
|
|
2397
2405
|
children: e
|
|
2398
2406
|
})]
|
|
2399
2407
|
});
|
|
2400
2408
|
}
|
|
2401
2409
|
//#endregion
|
|
2402
2410
|
//#region src/CodeBlock/highlight.ts
|
|
2403
|
-
var
|
|
2411
|
+
var Ut = [
|
|
2404
2412
|
"bash",
|
|
2405
2413
|
"css",
|
|
2406
2414
|
"diff",
|
|
@@ -2412,7 +2420,7 @@ var Ht = [
|
|
|
2412
2420
|
"typescript",
|
|
2413
2421
|
"xml",
|
|
2414
2422
|
"yaml"
|
|
2415
|
-
],
|
|
2423
|
+
], Wt = {
|
|
2416
2424
|
js: "javascript",
|
|
2417
2425
|
jsx: "javascript",
|
|
2418
2426
|
mjs: "javascript",
|
|
@@ -2433,15 +2441,15 @@ var Ht = [
|
|
|
2433
2441
|
patch: "diff",
|
|
2434
2442
|
yml: "yaml",
|
|
2435
2443
|
yamllint: "yaml"
|
|
2436
|
-
},
|
|
2444
|
+
}, Gt = new Set(Ut), Kt = (e) => [{
|
|
2437
2445
|
value: e,
|
|
2438
2446
|
kind: null
|
|
2439
|
-
}],
|
|
2447
|
+
}], qt = (e) => {
|
|
2440
2448
|
if (!e) return null;
|
|
2441
|
-
let t =
|
|
2442
|
-
return
|
|
2443
|
-
},
|
|
2444
|
-
function
|
|
2449
|
+
let t = Wt[e.toLowerCase()] ?? e.toLowerCase();
|
|
2450
|
+
return Gt.has(t) ? t : null;
|
|
2451
|
+
}, Jt = (e) => qt(e) !== null;
|
|
2452
|
+
function Yt(e) {
|
|
2445
2453
|
let t = [], n = (e, n) => {
|
|
2446
2454
|
if (!e) return;
|
|
2447
2455
|
let r = t[t.length - 1];
|
|
@@ -2461,42 +2469,42 @@ function Jt(e) {
|
|
|
2461
2469
|
};
|
|
2462
2470
|
return r(e.children ?? [], null), t;
|
|
2463
2471
|
}
|
|
2464
|
-
var
|
|
2465
|
-
function
|
|
2466
|
-
return
|
|
2472
|
+
var Xt = null, Zt = null, Qt = () => Xt;
|
|
2473
|
+
function $t() {
|
|
2474
|
+
return Xt ? Promise.resolve(Xt) : Zt || (Zt = (async () => {
|
|
2467
2475
|
let { createHighlighter: e } = await import("./grammars-B19jp7qm.js"), t = e();
|
|
2468
|
-
return
|
|
2469
|
-
let r =
|
|
2470
|
-
if (!r) return
|
|
2476
|
+
return Xt = (e, n) => {
|
|
2477
|
+
let r = qt(n);
|
|
2478
|
+
if (!r) return Kt(e);
|
|
2471
2479
|
try {
|
|
2472
|
-
let n =
|
|
2473
|
-
return n.length > 0 ? n :
|
|
2480
|
+
let n = Yt(t.highlight(r, e));
|
|
2481
|
+
return n.length > 0 ? n : Kt(e);
|
|
2474
2482
|
} catch {
|
|
2475
|
-
return
|
|
2483
|
+
return Kt(e);
|
|
2476
2484
|
}
|
|
2477
|
-
},
|
|
2478
|
-
})(),
|
|
2485
|
+
}, Xt;
|
|
2486
|
+
})(), Zt);
|
|
2479
2487
|
}
|
|
2480
|
-
var
|
|
2488
|
+
var en = {
|
|
2481
2489
|
block: "ick-block-xN1a",
|
|
2482
2490
|
bar: "ick-bar-5YJ4",
|
|
2483
2491
|
lang: "ick-lang-pkCd",
|
|
2484
2492
|
copy: "ick-copy-KoCs ick-target-vuT2",
|
|
2485
2493
|
copyLabel: "ick-copyLabel-E8mN",
|
|
2486
2494
|
pre: "ick-pre-qaBX"
|
|
2487
|
-
},
|
|
2488
|
-
function
|
|
2489
|
-
let d =
|
|
2495
|
+
}, tn = 1600;
|
|
2496
|
+
function nn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor: a = tn, labels: s, className: l, ...u }) {
|
|
2497
|
+
let d = U("codeBlock", s), [h, g] = m(!1), y = p(null), [b, x] = m(Qt);
|
|
2490
2498
|
c(() => {
|
|
2491
|
-
if (b || !
|
|
2499
|
+
if (b || !Jt(t)) return;
|
|
2492
2500
|
let e = !0;
|
|
2493
|
-
return
|
|
2501
|
+
return $t().then((t) => {
|
|
2494
2502
|
e && x(() => t);
|
|
2495
2503
|
}), () => {
|
|
2496
2504
|
e = !1;
|
|
2497
2505
|
};
|
|
2498
2506
|
}, [b, t]);
|
|
2499
|
-
let S = f(() => b ? b(e, t) :
|
|
2507
|
+
let S = f(() => b ? b(e, t) : Kt(e), [
|
|
2500
2508
|
b,
|
|
2501
2509
|
e,
|
|
2502
2510
|
t
|
|
@@ -2513,29 +2521,29 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2513
2521
|
d.copiedAnnouncement
|
|
2514
2522
|
]), w = n === !1 ? null : n ?? t ?? null, T = w !== null || r;
|
|
2515
2523
|
return /* @__PURE__ */ v("div", {
|
|
2516
|
-
className: [
|
|
2524
|
+
className: [en.block, l ?? ""].filter(Boolean).join(" "),
|
|
2517
2525
|
...u,
|
|
2518
2526
|
children: [T && /* @__PURE__ */ v("div", {
|
|
2519
|
-
className:
|
|
2527
|
+
className: en.bar,
|
|
2520
2528
|
children: [/* @__PURE__ */ _("span", {
|
|
2521
|
-
className:
|
|
2529
|
+
className: en.lang,
|
|
2522
2530
|
children: w
|
|
2523
2531
|
}), r && /* @__PURE__ */ v("button", {
|
|
2524
2532
|
type: "button",
|
|
2525
|
-
className:
|
|
2533
|
+
className: en.copy,
|
|
2526
2534
|
onClick: C,
|
|
2527
2535
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2528
2536
|
"aria-label": h ? d.copied : d.copyCode,
|
|
2529
|
-
children: [_(h ? j :
|
|
2537
|
+
children: [_(h ? j : P, {
|
|
2530
2538
|
size: 13,
|
|
2531
2539
|
"aria-hidden": !0
|
|
2532
2540
|
}), /* @__PURE__ */ _("span", {
|
|
2533
|
-
className:
|
|
2541
|
+
className: en.copyLabel,
|
|
2534
2542
|
children: h ? d.copied : d.copy
|
|
2535
2543
|
})]
|
|
2536
2544
|
})]
|
|
2537
2545
|
}), /* @__PURE__ */ _("pre", {
|
|
2538
|
-
className:
|
|
2546
|
+
className: en.pre,
|
|
2539
2547
|
children: /* @__PURE__ */ _("code", { children: S.map((e, t) => e.kind ? /* @__PURE__ */ _("span", {
|
|
2540
2548
|
"data-hl": e.kind,
|
|
2541
2549
|
children: e.value
|
|
@@ -2543,7 +2551,7 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2543
2551
|
})]
|
|
2544
2552
|
});
|
|
2545
2553
|
}
|
|
2546
|
-
var
|
|
2554
|
+
var rn = {
|
|
2547
2555
|
glyph: "ick-glyph-NSSW",
|
|
2548
2556
|
queued: "ick-queued-6cCj",
|
|
2549
2557
|
spinner: "ick-spinner-HeOp",
|
|
@@ -2551,15 +2559,15 @@ var nn = {
|
|
|
2551
2559
|
};
|
|
2552
2560
|
//#endregion
|
|
2553
2561
|
//#region src/stateGlyph/StateGlyph.tsx
|
|
2554
|
-
function
|
|
2562
|
+
function an({ state: e }) {
|
|
2555
2563
|
return /* @__PURE__ */ _("span", {
|
|
2556
|
-
className:
|
|
2564
|
+
className: rn.glyph,
|
|
2557
2565
|
"data-state": e,
|
|
2558
2566
|
"aria-hidden": !0,
|
|
2559
|
-
children: e === "running" ? /* @__PURE__ */ _("span", { className:
|
|
2567
|
+
children: e === "running" ? /* @__PURE__ */ _("span", { className: rn.spinner }) : e === "done" ? /* @__PURE__ */ _(j, { size: 13 }) : e === "error" ? /* @__PURE__ */ _(Se, { size: 13 }) : /* @__PURE__ */ _("span", { className: rn.queued })
|
|
2560
2568
|
});
|
|
2561
2569
|
}
|
|
2562
|
-
var
|
|
2570
|
+
var on = {
|
|
2563
2571
|
tool: "ick-tool-en0M",
|
|
2564
2572
|
card: "ick-card-nzIg",
|
|
2565
2573
|
overview: "ick-overview-lVM-",
|
|
@@ -2571,7 +2579,7 @@ var an = {
|
|
|
2571
2579
|
};
|
|
2572
2580
|
//#endregion
|
|
2573
2581
|
//#region src/Tool/Tool.tsx
|
|
2574
|
-
function
|
|
2582
|
+
function sn(e) {
|
|
2575
2583
|
if (e == null) return null;
|
|
2576
2584
|
if (i(e)) return {
|
|
2577
2585
|
kind: "node",
|
|
@@ -2598,75 +2606,75 @@ function on(e) {
|
|
|
2598
2606
|
};
|
|
2599
2607
|
}
|
|
2600
2608
|
}
|
|
2601
|
-
function
|
|
2609
|
+
function cn({ label: e, value: t, tone: n }) {
|
|
2602
2610
|
if (!t) return null;
|
|
2603
|
-
if (t.kind === "json") return /* @__PURE__ */ _(
|
|
2611
|
+
if (t.kind === "json") return /* @__PURE__ */ _(nn, {
|
|
2604
2612
|
code: t.code,
|
|
2605
2613
|
lang: "json",
|
|
2606
2614
|
label: e
|
|
2607
2615
|
});
|
|
2608
2616
|
let r = t.kind === "text" ? /* @__PURE__ */ _("p", {
|
|
2609
|
-
className:
|
|
2617
|
+
className: on.text,
|
|
2610
2618
|
children: t.text
|
|
2611
2619
|
}) : t.node;
|
|
2612
2620
|
return /* @__PURE__ */ v("div", {
|
|
2613
|
-
className:
|
|
2621
|
+
className: on.section,
|
|
2614
2622
|
"data-tone": n,
|
|
2615
2623
|
children: [/* @__PURE__ */ _("span", {
|
|
2616
|
-
className:
|
|
2624
|
+
className: on.sectionLabel,
|
|
2617
2625
|
children: e
|
|
2618
2626
|
}), r]
|
|
2619
2627
|
});
|
|
2620
2628
|
}
|
|
2621
|
-
function
|
|
2622
|
-
let m =
|
|
2629
|
+
function ln({ name: e, state: t = "done", summary: n, input: r, output: i, error: a, duration: o, open: s, defaultOpen: c, onOpenChange: u, labels: d, className: f, ...p }) {
|
|
2630
|
+
let m = U("tool", d), h = l(), g = t === "error", { isOpen: y, toggle: b } = Pt({
|
|
2623
2631
|
open: s,
|
|
2624
2632
|
defaultOpen: c,
|
|
2625
2633
|
onOpenChange: u,
|
|
2626
2634
|
preferOpen: g
|
|
2627
|
-
}), x =
|
|
2635
|
+
}), x = sn(r), S = g ? null : sn(i), C = g ? sn(a) : null, w = !!(x || S || C || t === "running"), T = t === "done" || g ? Bt(o ?? NaN) : "";
|
|
2628
2636
|
return /* @__PURE__ */ v("div", {
|
|
2629
|
-
className: [
|
|
2637
|
+
className: [on.tool, f ?? ""].filter(Boolean).join(" "),
|
|
2630
2638
|
"data-state": t,
|
|
2631
2639
|
...p,
|
|
2632
|
-
children: [/* @__PURE__ */ _(
|
|
2640
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2633
2641
|
open: y,
|
|
2634
2642
|
onToggle: b,
|
|
2635
2643
|
controls: h,
|
|
2636
2644
|
disabled: !w,
|
|
2637
|
-
glyph: /* @__PURE__ */ _(
|
|
2645
|
+
glyph: /* @__PURE__ */ _(an, { state: t }),
|
|
2638
2646
|
label: e,
|
|
2639
2647
|
meta: T || void 0,
|
|
2640
2648
|
children: /* @__PURE__ */ _("span", {
|
|
2641
|
-
className:
|
|
2649
|
+
className: on.srOnly,
|
|
2642
2650
|
children: m[t]
|
|
2643
2651
|
})
|
|
2644
2652
|
}), /* @__PURE__ */ v("div", {
|
|
2645
|
-
className:
|
|
2653
|
+
className: on.card,
|
|
2646
2654
|
children: [/* @__PURE__ */ _("p", {
|
|
2647
|
-
className:
|
|
2655
|
+
className: on.overview,
|
|
2648
2656
|
children: n ?? m[t]
|
|
2649
|
-
}), /* @__PURE__ */ v(
|
|
2657
|
+
}), /* @__PURE__ */ v(zt, {
|
|
2650
2658
|
id: h,
|
|
2651
2659
|
open: y && w,
|
|
2652
|
-
className:
|
|
2660
|
+
className: on.bodyInner,
|
|
2653
2661
|
children: [
|
|
2654
|
-
/* @__PURE__ */ _(
|
|
2662
|
+
/* @__PURE__ */ _(cn, {
|
|
2655
2663
|
label: m.input,
|
|
2656
2664
|
value: x
|
|
2657
2665
|
}),
|
|
2658
2666
|
t === "running" && !S && /* @__PURE__ */ v("div", {
|
|
2659
|
-
className:
|
|
2667
|
+
className: on.section,
|
|
2660
2668
|
children: [/* @__PURE__ */ _("span", {
|
|
2661
|
-
className:
|
|
2669
|
+
className: on.sectionLabel,
|
|
2662
2670
|
children: m.output
|
|
2663
|
-
}), /* @__PURE__ */ _(
|
|
2671
|
+
}), /* @__PURE__ */ _(Nt, {})]
|
|
2664
2672
|
}),
|
|
2665
|
-
/* @__PURE__ */ _(
|
|
2673
|
+
/* @__PURE__ */ _(cn, {
|
|
2666
2674
|
label: m.output,
|
|
2667
2675
|
value: S
|
|
2668
2676
|
}),
|
|
2669
|
-
/* @__PURE__ */ _(
|
|
2677
|
+
/* @__PURE__ */ _(cn, {
|
|
2670
2678
|
label: m.error,
|
|
2671
2679
|
value: C,
|
|
2672
2680
|
tone: "error"
|
|
@@ -2676,7 +2684,7 @@ function cn({ name: e, state: t = "done", summary: n, input: r, output: i, error
|
|
|
2676
2684
|
})]
|
|
2677
2685
|
});
|
|
2678
2686
|
}
|
|
2679
|
-
var
|
|
2687
|
+
var un = {
|
|
2680
2688
|
approval: "ick-approval-zlJi",
|
|
2681
2689
|
head: "ick-head-CX4j",
|
|
2682
2690
|
title: "ick-title-n-wh",
|
|
@@ -2685,62 +2693,62 @@ var ln = {
|
|
|
2685
2693
|
actions: "ick-actions-t5Oz",
|
|
2686
2694
|
deny: "ick-deny-XXyG",
|
|
2687
2695
|
settled: "ick-settled-OaBX"
|
|
2688
|
-
},
|
|
2696
|
+
}, dn = [
|
|
2689
2697
|
"once",
|
|
2690
2698
|
"always",
|
|
2691
2699
|
"deny"
|
|
2692
|
-
],
|
|
2700
|
+
], fn = {
|
|
2693
2701
|
once: "allowedOnce",
|
|
2694
2702
|
always: "allowedAlways",
|
|
2695
2703
|
denied: "wasDenied"
|
|
2696
2704
|
};
|
|
2697
|
-
function
|
|
2698
|
-
let d =
|
|
2705
|
+
function pn({ title: e, description: t, children: n, decision: r = null, onDecide: i, readOnly: a = !1, choices: o = dn, labels: s, className: c, ...u }) {
|
|
2706
|
+
let d = U("approval", s), f = (e) => o.includes(e), p = l(), m = r !== null;
|
|
2699
2707
|
return /* @__PURE__ */ v("section", {
|
|
2700
|
-
className: [
|
|
2708
|
+
className: [un.approval, c ?? ""].filter(Boolean).join(" "),
|
|
2701
2709
|
"data-decision": r ?? void 0,
|
|
2702
2710
|
"aria-labelledby": p,
|
|
2703
2711
|
...u,
|
|
2704
2712
|
children: [
|
|
2705
2713
|
/* @__PURE__ */ v("div", {
|
|
2706
|
-
className:
|
|
2714
|
+
className: un.head,
|
|
2707
2715
|
children: [/* @__PURE__ */ _("p", {
|
|
2708
|
-
className:
|
|
2716
|
+
className: un.title,
|
|
2709
2717
|
id: p,
|
|
2710
2718
|
children: e
|
|
2711
2719
|
}), t && /* @__PURE__ */ _("p", {
|
|
2712
|
-
className:
|
|
2720
|
+
className: un.description,
|
|
2713
2721
|
children: t
|
|
2714
2722
|
})]
|
|
2715
2723
|
}),
|
|
2716
2724
|
n && /* @__PURE__ */ _("div", {
|
|
2717
|
-
className:
|
|
2725
|
+
className: un.subject,
|
|
2718
2726
|
children: n
|
|
2719
2727
|
}),
|
|
2720
2728
|
m ? /* @__PURE__ */ v("p", {
|
|
2721
|
-
className:
|
|
2729
|
+
className: un.settled,
|
|
2722
2730
|
"data-decision": r,
|
|
2723
|
-
children: [_(r === "denied" ?
|
|
2731
|
+
children: [_(r === "denied" ? Ce : j, {
|
|
2724
2732
|
size: 13,
|
|
2725
2733
|
"aria-hidden": !0
|
|
2726
|
-
}), d[
|
|
2734
|
+
}), d[fn[r]]]
|
|
2727
2735
|
}) : !a && /* @__PURE__ */ v("div", {
|
|
2728
|
-
className:
|
|
2736
|
+
className: un.actions,
|
|
2729
2737
|
children: [
|
|
2730
|
-
f("deny") && /* @__PURE__ */ _(
|
|
2738
|
+
f("deny") && /* @__PURE__ */ _(H, {
|
|
2731
2739
|
variant: "ghost",
|
|
2732
2740
|
size: "m",
|
|
2733
|
-
className:
|
|
2741
|
+
className: un.deny,
|
|
2734
2742
|
onClick: () => i?.("denied"),
|
|
2735
2743
|
children: d.deny
|
|
2736
2744
|
}),
|
|
2737
|
-
f("always") && /* @__PURE__ */ _(
|
|
2745
|
+
f("always") && /* @__PURE__ */ _(H, {
|
|
2738
2746
|
variant: "outline",
|
|
2739
2747
|
size: "m",
|
|
2740
2748
|
onClick: () => i?.("always"),
|
|
2741
2749
|
children: d.always
|
|
2742
2750
|
}),
|
|
2743
|
-
f("once") && /* @__PURE__ */ _(
|
|
2751
|
+
f("once") && /* @__PURE__ */ _(H, {
|
|
2744
2752
|
variant: "primary",
|
|
2745
2753
|
size: "m",
|
|
2746
2754
|
onClick: () => i?.("once"),
|
|
@@ -2751,7 +2759,7 @@ function fn({ title: e, description: t, children: n, decision: r = null, onDecid
|
|
|
2751
2759
|
]
|
|
2752
2760
|
});
|
|
2753
2761
|
}
|
|
2754
|
-
var
|
|
2762
|
+
var mn = {
|
|
2755
2763
|
tasks: "ick-tasks-2ToX",
|
|
2756
2764
|
list: "ick-list-D8wS",
|
|
2757
2765
|
item: "ick-item-QsIm",
|
|
@@ -2762,33 +2770,33 @@ var pn = {
|
|
|
2762
2770
|
};
|
|
2763
2771
|
//#endregion
|
|
2764
2772
|
//#region src/TaskList/TaskList.tsx
|
|
2765
|
-
function
|
|
2766
|
-
let u =
|
|
2773
|
+
function hn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2774
|
+
let u = U("tasks", o), d = l(), f = q(), p = e.filter((e) => (e.state ?? "pending") === "done").length, m = Pt({
|
|
2767
2775
|
open: r,
|
|
2768
2776
|
defaultOpen: i,
|
|
2769
2777
|
onOpenChange: a,
|
|
2770
2778
|
preferOpen: !(e.length > 0 && p === e.length)
|
|
2771
2779
|
}), h = !n || m.isOpen, g = u.progress.replace("{done}", String(p)).replace("{total}", String(e.length));
|
|
2772
2780
|
return /* @__PURE__ */ v("section", {
|
|
2773
|
-
className: [
|
|
2781
|
+
className: [mn.tasks, s ?? ""].filter(Boolean).join(" "),
|
|
2774
2782
|
...c,
|
|
2775
|
-
children: [t && /* @__PURE__ */ _(
|
|
2783
|
+
children: [t && /* @__PURE__ */ _(Lt, {
|
|
2776
2784
|
open: h,
|
|
2777
2785
|
onToggle: n ? m.toggle : void 0,
|
|
2778
2786
|
controls: d,
|
|
2779
2787
|
label: t,
|
|
2780
2788
|
meta: g
|
|
2781
|
-
}), /* @__PURE__ */ _(
|
|
2789
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2782
2790
|
id: d,
|
|
2783
2791
|
open: h,
|
|
2784
2792
|
children: /* @__PURE__ */ _("ol", {
|
|
2785
|
-
className:
|
|
2793
|
+
className: mn.list,
|
|
2786
2794
|
children: /* @__PURE__ */ _(y, {
|
|
2787
2795
|
initial: !1,
|
|
2788
2796
|
children: e.map((e) => {
|
|
2789
2797
|
let t = e.state ?? "pending";
|
|
2790
2798
|
return /* @__PURE__ */ v(C.li, {
|
|
2791
|
-
className:
|
|
2799
|
+
className: mn.item,
|
|
2792
2800
|
"data-state": t,
|
|
2793
2801
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2794
2802
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2804,19 +2812,19 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2804
2812
|
y: -4
|
|
2805
2813
|
},
|
|
2806
2814
|
transition: { duration: f ? .12 : .2 },
|
|
2807
|
-
children: [/* @__PURE__ */ _(
|
|
2808
|
-
className:
|
|
2815
|
+
children: [/* @__PURE__ */ _(an, { state: t }), /* @__PURE__ */ v("span", {
|
|
2816
|
+
className: mn.body,
|
|
2809
2817
|
children: [
|
|
2810
2818
|
/* @__PURE__ */ _("span", {
|
|
2811
|
-
className:
|
|
2819
|
+
className: mn.label,
|
|
2812
2820
|
children: e.label
|
|
2813
2821
|
}),
|
|
2814
2822
|
/* @__PURE__ */ _("span", {
|
|
2815
|
-
className:
|
|
2823
|
+
className: mn.srOnly,
|
|
2816
2824
|
children: u[t]
|
|
2817
2825
|
}),
|
|
2818
2826
|
e.detail && /* @__PURE__ */ _("span", {
|
|
2819
|
-
className:
|
|
2827
|
+
className: mn.detail,
|
|
2820
2828
|
children: e.detail
|
|
2821
2829
|
})
|
|
2822
2830
|
]
|
|
@@ -2828,7 +2836,7 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2828
2836
|
})]
|
|
2829
2837
|
});
|
|
2830
2838
|
}
|
|
2831
|
-
var
|
|
2839
|
+
var gn = {
|
|
2832
2840
|
chain: "ick-chain-NGeh",
|
|
2833
2841
|
list: "ick-list-B2Pj",
|
|
2834
2842
|
step: "ick-step--tPX",
|
|
@@ -2839,37 +2847,37 @@ var hn = {
|
|
|
2839
2847
|
};
|
|
2840
2848
|
//#endregion
|
|
2841
2849
|
//#region src/ChainOfThought/ChainOfThought.tsx
|
|
2842
|
-
function
|
|
2843
|
-
let u =
|
|
2850
|
+
function _n({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2851
|
+
let u = U("chain", o), d = l(), f = q(), p = t === "thinking", { isOpen: m, toggle: h } = Pt({
|
|
2844
2852
|
open: r,
|
|
2845
2853
|
defaultOpen: i,
|
|
2846
2854
|
onOpenChange: a,
|
|
2847
2855
|
preferOpen: p
|
|
2848
|
-
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" :
|
|
2856
|
+
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" : Bt(n ?? NaN), x = `${u.through} ${e.length} ${e.length === 1 ? u.step : u.steps}`;
|
|
2849
2857
|
return /* @__PURE__ */ v("section", {
|
|
2850
|
-
className: [
|
|
2858
|
+
className: [gn.chain, s ?? ""].filter(Boolean).join(" "),
|
|
2851
2859
|
"data-state": t,
|
|
2852
2860
|
...c,
|
|
2853
|
-
children: [/* @__PURE__ */ _(
|
|
2861
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2854
2862
|
fit: "inline",
|
|
2855
2863
|
open: m,
|
|
2856
2864
|
onToggle: h,
|
|
2857
2865
|
controls: d,
|
|
2858
|
-
glyph: /* @__PURE__ */ _(
|
|
2866
|
+
glyph: /* @__PURE__ */ _(an, { state: p ? "running" : "done" }),
|
|
2859
2867
|
label: p ? g?.label ?? u.thinking : x,
|
|
2860
2868
|
pending: p,
|
|
2861
2869
|
meta: b || void 0
|
|
2862
|
-
}), /* @__PURE__ */ _(
|
|
2870
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2863
2871
|
id: d,
|
|
2864
2872
|
open: m && e.length > 0,
|
|
2865
2873
|
children: /* @__PURE__ */ _("ol", {
|
|
2866
|
-
className:
|
|
2874
|
+
className: gn.list,
|
|
2867
2875
|
children: /* @__PURE__ */ _(y, {
|
|
2868
2876
|
initial: !1,
|
|
2869
2877
|
children: e.map((e) => {
|
|
2870
2878
|
let t = e.state ?? "done";
|
|
2871
2879
|
return /* @__PURE__ */ v(C.li, {
|
|
2872
|
-
className:
|
|
2880
|
+
className: gn.step,
|
|
2873
2881
|
"data-state": t,
|
|
2874
2882
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2875
2883
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2886,16 +2894,16 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2886
2894
|
},
|
|
2887
2895
|
transition: { duration: f ? .12 : .2 },
|
|
2888
2896
|
children: [/* @__PURE__ */ _("span", {
|
|
2889
|
-
className:
|
|
2897
|
+
className: gn.rail,
|
|
2890
2898
|
"aria-hidden": !0,
|
|
2891
|
-
children: /* @__PURE__ */ _(
|
|
2899
|
+
children: /* @__PURE__ */ _(an, { state: t })
|
|
2892
2900
|
}), /* @__PURE__ */ v("span", {
|
|
2893
|
-
className:
|
|
2901
|
+
className: gn.body,
|
|
2894
2902
|
children: [/* @__PURE__ */ _("span", {
|
|
2895
|
-
className:
|
|
2903
|
+
className: gn.stepLabel,
|
|
2896
2904
|
children: e.label
|
|
2897
2905
|
}), e.body && /* @__PURE__ */ _("span", {
|
|
2898
|
-
className:
|
|
2906
|
+
className: gn.working,
|
|
2899
2907
|
children: e.body
|
|
2900
2908
|
})]
|
|
2901
2909
|
})]
|
|
@@ -2906,7 +2914,7 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2906
2914
|
})]
|
|
2907
2915
|
});
|
|
2908
2916
|
}
|
|
2909
|
-
var
|
|
2917
|
+
var vn = {
|
|
2910
2918
|
sources: "ick-sources-w6ma",
|
|
2911
2919
|
list: "ick-list-UdKr",
|
|
2912
2920
|
item: "ick-item-zBLs",
|
|
@@ -2919,55 +2927,55 @@ var _n = {
|
|
|
2919
2927
|
};
|
|
2920
2928
|
//#endregion
|
|
2921
2929
|
//#region src/Sources/Sources.tsx
|
|
2922
|
-
function
|
|
2923
|
-
let f =
|
|
2930
|
+
function yn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onSelect: i, open: a, defaultOpen: o, onOpenChange: s, labels: c, className: u, ...d }) {
|
|
2931
|
+
let f = U("sources", c), p = l(), m = Pt({
|
|
2924
2932
|
open: a,
|
|
2925
2933
|
defaultOpen: o,
|
|
2926
2934
|
onOpenChange: s,
|
|
2927
2935
|
preferOpen: !0
|
|
2928
2936
|
}), h = !n || m.isOpen, y = `${e.length} ${e.length === 1 ? f.one : f.many}`;
|
|
2929
2937
|
return /* @__PURE__ */ v("section", {
|
|
2930
|
-
className: [
|
|
2938
|
+
className: [vn.sources, u ?? ""].filter(Boolean).join(" "),
|
|
2931
2939
|
...d,
|
|
2932
|
-
children: [/* @__PURE__ */ _(
|
|
2940
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2933
2941
|
open: h,
|
|
2934
2942
|
onToggle: n ? m.toggle : void 0,
|
|
2935
2943
|
controls: p,
|
|
2936
2944
|
label: t ?? f.title,
|
|
2937
2945
|
meta: y
|
|
2938
|
-
}), /* @__PURE__ */ _(
|
|
2946
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2939
2947
|
id: p,
|
|
2940
2948
|
open: h && e.length > 0,
|
|
2941
2949
|
children: /* @__PURE__ */ _("ol", {
|
|
2942
|
-
className:
|
|
2950
|
+
className: vn.list,
|
|
2943
2951
|
children: e.map((e, t) => {
|
|
2944
2952
|
let n = t + 1, a = e.id === r, o = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
2945
|
-
className:
|
|
2953
|
+
className: vn.number,
|
|
2946
2954
|
"data-active": a || void 0,
|
|
2947
2955
|
children: n
|
|
2948
2956
|
}), /* @__PURE__ */ v("span", {
|
|
2949
|
-
className:
|
|
2957
|
+
className: vn.body,
|
|
2950
2958
|
children: [
|
|
2951
2959
|
/* @__PURE__ */ _("span", {
|
|
2952
|
-
className:
|
|
2960
|
+
className: vn.name,
|
|
2953
2961
|
children: e.title
|
|
2954
2962
|
}),
|
|
2955
2963
|
e.origin && /* @__PURE__ */ _("span", {
|
|
2956
|
-
className:
|
|
2964
|
+
className: vn.origin,
|
|
2957
2965
|
children: e.origin
|
|
2958
2966
|
}),
|
|
2959
2967
|
e.quote && /* @__PURE__ */ _("span", {
|
|
2960
|
-
className:
|
|
2968
|
+
className: vn.quote,
|
|
2961
2969
|
children: e.quote
|
|
2962
2970
|
})
|
|
2963
2971
|
]
|
|
2964
2972
|
})] });
|
|
2965
2973
|
return /* @__PURE__ */ _("li", {
|
|
2966
|
-
className:
|
|
2974
|
+
className: vn.item,
|
|
2967
2975
|
"data-active": a || void 0,
|
|
2968
2976
|
id: `${p}-${e.id}`,
|
|
2969
2977
|
children: e.url ? /* @__PURE__ */ _("a", {
|
|
2970
|
-
className:
|
|
2978
|
+
className: vn.entry,
|
|
2971
2979
|
href: e.url,
|
|
2972
2980
|
target: "_blank",
|
|
2973
2981
|
rel: "noreferrer noopener",
|
|
@@ -2975,7 +2983,7 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2975
2983
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2976
2984
|
children: o
|
|
2977
2985
|
}) : /* @__PURE__ */ _("div", {
|
|
2978
|
-
className:
|
|
2986
|
+
className: vn.entry,
|
|
2979
2987
|
children: o
|
|
2980
2988
|
})
|
|
2981
2989
|
}, e.id);
|
|
@@ -2984,13 +2992,13 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2984
2992
|
})]
|
|
2985
2993
|
});
|
|
2986
2994
|
}
|
|
2987
|
-
var
|
|
2995
|
+
var bn = { chip: "ick-chip-FJNL" };
|
|
2988
2996
|
//#endregion
|
|
2989
2997
|
//#region src/Chip/Chip.tsx
|
|
2990
|
-
function
|
|
2998
|
+
function xn({ children: e, className: t }) {
|
|
2991
2999
|
let n = q();
|
|
2992
3000
|
return /* @__PURE__ */ _(C.span, {
|
|
2993
|
-
className: [
|
|
3001
|
+
className: [bn.chip, t ?? ""].filter(Boolean).join(" "),
|
|
2994
3002
|
initial: n ? { opacity: 0 } : {
|
|
2995
3003
|
opacity: 0,
|
|
2996
3004
|
scale: .85
|
|
@@ -3035,7 +3043,7 @@ var X = {
|
|
|
3035
3043
|
fieldLabel: "ick-fieldLabel--DkK",
|
|
3036
3044
|
fieldInput: "ick-fieldInput-Er9C",
|
|
3037
3045
|
shellCard: "ick-shellCard-pBK9"
|
|
3038
|
-
},
|
|
3046
|
+
}, Sn = r(function({ children: e, selected: t, onCard: n, className: r, ...i }, a) {
|
|
3039
3047
|
return /* @__PURE__ */ _("span", {
|
|
3040
3048
|
ref: a,
|
|
3041
3049
|
className: [X.badge, r ?? ""].filter(Boolean).join(" "),
|
|
@@ -3045,7 +3053,7 @@ var X = {
|
|
|
3045
3053
|
...i,
|
|
3046
3054
|
children: e
|
|
3047
3055
|
});
|
|
3048
|
-
}),
|
|
3056
|
+
}), Cn = r(function({ letter: e, title: t, description: n, selected: r = !1, className: i, ...a }, o) {
|
|
3049
3057
|
let s = q();
|
|
3050
3058
|
return /* @__PURE__ */ v(C.button, {
|
|
3051
3059
|
ref: o,
|
|
@@ -3055,7 +3063,7 @@ var X = {
|
|
|
3055
3063
|
"aria-pressed": r,
|
|
3056
3064
|
whileTap: s ? void 0 : { scale: .99 },
|
|
3057
3065
|
...a,
|
|
3058
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3066
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3059
3067
|
selected: r,
|
|
3060
3068
|
children: e
|
|
3061
3069
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3069,13 +3077,13 @@ var X = {
|
|
|
3069
3077
|
})]
|
|
3070
3078
|
})]
|
|
3071
3079
|
});
|
|
3072
|
-
}),
|
|
3080
|
+
}), wn = r(function({ letter: e, label: t, value: n, onChange: r, onEnter: i, className: a, id: o, onFocus: s, onBlur: c, onKeyDown: u, ...d }, f) {
|
|
3073
3081
|
let [p, h] = m(!1), g = l(), y = o ?? g;
|
|
3074
3082
|
return /* @__PURE__ */ v("label", {
|
|
3075
3083
|
className: [X.field, a ?? ""].filter(Boolean).join(" "),
|
|
3076
3084
|
"data-focused": p || void 0,
|
|
3077
3085
|
htmlFor: y,
|
|
3078
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3086
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3079
3087
|
selected: p,
|
|
3080
3088
|
children: e
|
|
3081
3089
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3103,13 +3111,13 @@ var X = {
|
|
|
3103
3111
|
})]
|
|
3104
3112
|
})]
|
|
3105
3113
|
});
|
|
3106
|
-
}),
|
|
3114
|
+
}), Tn = r(function({ letter: e, value: t, placeholder: n, onChange: r, onEnter: i, className: a, onKeyDown: o, ...s }, c) {
|
|
3107
3115
|
let l = t.trim().length > 0;
|
|
3108
3116
|
return /* @__PURE__ */ v("label", {
|
|
3109
3117
|
className: [X.option, a ?? ""].filter(Boolean).join(" "),
|
|
3110
3118
|
"data-selected": l || void 0,
|
|
3111
3119
|
"data-other": "",
|
|
3112
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3120
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3113
3121
|
selected: l,
|
|
3114
3122
|
children: e
|
|
3115
3123
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3129,7 +3137,7 @@ var X = {
|
|
|
3129
3137
|
})
|
|
3130
3138
|
})]
|
|
3131
3139
|
});
|
|
3132
|
-
}),
|
|
3140
|
+
}), En = r(function({ number: e, title: t, subtitle: n, children: r, footer: i, card: a = !0, className: o, ...s }, c) {
|
|
3133
3141
|
return /* @__PURE__ */ v("div", {
|
|
3134
3142
|
ref: c,
|
|
3135
3143
|
className: [
|
|
@@ -3141,7 +3149,7 @@ var X = {
|
|
|
3141
3149
|
children: [
|
|
3142
3150
|
/* @__PURE__ */ v("div", {
|
|
3143
3151
|
className: X.header,
|
|
3144
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3152
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3145
3153
|
selected: !0,
|
|
3146
3154
|
children: e
|
|
3147
3155
|
}), /* @__PURE__ */ v("div", {
|
|
@@ -3168,7 +3176,7 @@ var X = {
|
|
|
3168
3176
|
});
|
|
3169
3177
|
//#endregion
|
|
3170
3178
|
//#region src/radiusCorrection/useCorrectedRadius.ts
|
|
3171
|
-
function
|
|
3179
|
+
function Dn(e) {
|
|
3172
3180
|
let [t, n] = m(void 0);
|
|
3173
3181
|
return d(() => {
|
|
3174
3182
|
let t = e.current;
|
|
@@ -3179,12 +3187,12 @@ function En(e) {
|
|
|
3179
3187
|
}
|
|
3180
3188
|
//#endregion
|
|
3181
3189
|
//#region src/QuestionCard/QuestionCard.tsx
|
|
3182
|
-
var
|
|
3190
|
+
var On = {
|
|
3183
3191
|
type: "spring",
|
|
3184
3192
|
stiffness: 260,
|
|
3185
3193
|
damping: 30
|
|
3186
|
-
},
|
|
3187
|
-
function
|
|
3194
|
+
}, kn = (e, t) => Array.from(t)[e] ?? String(e + 1), An = 300, jn = 380;
|
|
3195
|
+
function Mn(e, t) {
|
|
3188
3196
|
if (!t) return [];
|
|
3189
3197
|
if (e.type === "inputs" && "values" in t) {
|
|
3190
3198
|
let n = e.fields.map((e) => t.values?.[e.id]).filter(Boolean);
|
|
@@ -3202,11 +3210,11 @@ function jn(e, t) {
|
|
|
3202
3210
|
}
|
|
3203
3211
|
return [];
|
|
3204
3212
|
}
|
|
3205
|
-
function
|
|
3213
|
+
function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
3206
3214
|
let [a, o] = m(() => n && "values" in n ? { ...n.values } : {}), [s, l] = m(() => n && "optionIds" in n ? [...n.optionIds ?? []] : []), [u, d] = m(() => n && "optionIds" in n ? n.other ?? "" : ""), [h, g] = m(n && "optionId" in n ? n.optionId : null), y = p(null), b = f(() => e.type === "inputs" ? e.fields.map(() => ({ current: null })) : [], [e]);
|
|
3207
3215
|
c(() => {
|
|
3208
3216
|
if (e.type !== "inputs") return;
|
|
3209
|
-
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 :
|
|
3217
|
+
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 : jn);
|
|
3210
3218
|
return () => clearTimeout(t);
|
|
3211
3219
|
}, [e.type]);
|
|
3212
3220
|
let x = f(() => e.type !== "inputs" || e.fields.every((e) => e.optional || (a[e.id] ?? "").trim()), [e, a]), S = {
|
|
@@ -3217,17 +3225,17 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3217
3225
|
};
|
|
3218
3226
|
if (e.type === "inputs") {
|
|
3219
3227
|
let t = () => x && r?.({ values: a });
|
|
3220
|
-
return /* @__PURE__ */ _(
|
|
3228
|
+
return /* @__PURE__ */ _(En, {
|
|
3221
3229
|
...S,
|
|
3222
|
-
footer: /* @__PURE__ */ _(
|
|
3230
|
+
footer: /* @__PURE__ */ _(H, {
|
|
3223
3231
|
variant: "secondary",
|
|
3224
3232
|
size: "m",
|
|
3225
3233
|
disabled: !x,
|
|
3226
3234
|
onClick: t,
|
|
3227
3235
|
children: i.next
|
|
3228
3236
|
}),
|
|
3229
|
-
children: e.fields.map((e, n) => /* @__PURE__ */ _(
|
|
3230
|
-
letter:
|
|
3237
|
+
children: e.fields.map((e, n) => /* @__PURE__ */ _(wn, {
|
|
3238
|
+
letter: kn(n, i.letters),
|
|
3231
3239
|
label: e.label,
|
|
3232
3240
|
placeholder: e.placeholder,
|
|
3233
3241
|
value: a[e.id] ?? "",
|
|
@@ -3243,15 +3251,15 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3243
3251
|
}, e.id))
|
|
3244
3252
|
});
|
|
3245
3253
|
}
|
|
3246
|
-
if (e.type === "single") return /* @__PURE__ */ _(
|
|
3254
|
+
if (e.type === "single") return /* @__PURE__ */ _(En, {
|
|
3247
3255
|
...S,
|
|
3248
|
-
children: e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3249
|
-
letter:
|
|
3256
|
+
children: e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3257
|
+
letter: kn(t, i.letters),
|
|
3250
3258
|
title: e.title,
|
|
3251
3259
|
description: e.description,
|
|
3252
3260
|
selected: h === e.id,
|
|
3253
3261
|
onClick: () => {
|
|
3254
|
-
g(e.id), setTimeout(() => r?.({ optionId: e.id }),
|
|
3262
|
+
g(e.id), setTimeout(() => r?.({ optionId: e.id }), An);
|
|
3255
3263
|
}
|
|
3256
3264
|
}, e.id))
|
|
3257
3265
|
});
|
|
@@ -3261,23 +3269,23 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3261
3269
|
...C ? { other: C } : {}
|
|
3262
3270
|
});
|
|
3263
3271
|
};
|
|
3264
|
-
return /* @__PURE__ */ v(
|
|
3272
|
+
return /* @__PURE__ */ v(En, {
|
|
3265
3273
|
...S,
|
|
3266
|
-
footer: /* @__PURE__ */ _(
|
|
3274
|
+
footer: /* @__PURE__ */ _(H, {
|
|
3267
3275
|
variant: "secondary",
|
|
3268
3276
|
size: "m",
|
|
3269
3277
|
disabled: !e.allowEmpty && w,
|
|
3270
3278
|
onClick: T,
|
|
3271
3279
|
children: e.allowEmpty && w ? i.none : i.next
|
|
3272
3280
|
}),
|
|
3273
|
-
children: [e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3274
|
-
letter:
|
|
3281
|
+
children: [e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3282
|
+
letter: kn(t, i.letters),
|
|
3275
3283
|
title: e.title,
|
|
3276
3284
|
description: e.description,
|
|
3277
3285
|
selected: s.includes(e.id),
|
|
3278
3286
|
onClick: () => l((t) => t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t, e.id])
|
|
3279
|
-
}, e.id)), e.allowOther && /* @__PURE__ */ _(
|
|
3280
|
-
letter:
|
|
3287
|
+
}, e.id)), e.allowOther && /* @__PURE__ */ _(Tn, {
|
|
3288
|
+
letter: kn(e.options.length, i.letters),
|
|
3281
3289
|
value: u,
|
|
3282
3290
|
placeholder: e.otherPlaceholder ?? i.other,
|
|
3283
3291
|
onChange: d,
|
|
@@ -3285,9 +3293,9 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3285
3293
|
})]
|
|
3286
3294
|
});
|
|
3287
3295
|
}
|
|
3288
|
-
function
|
|
3289
|
-
let c =
|
|
3290
|
-
if (n === "active") m = /* @__PURE__ */ _(
|
|
3296
|
+
function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit: a, readOnly: o = !1, labels: s }) {
|
|
3297
|
+
let c = U("question", s), l = n !== "upcoming", u = q(), d = p(null), f = Dn(d), m;
|
|
3298
|
+
if (n === "active") m = /* @__PURE__ */ _(Nn, {
|
|
3291
3299
|
question: e,
|
|
3292
3300
|
number: t,
|
|
3293
3301
|
answer: r,
|
|
@@ -3295,9 +3303,9 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3295
3303
|
labels: c
|
|
3296
3304
|
});
|
|
3297
3305
|
else if (n === "collapsed") {
|
|
3298
|
-
let n =
|
|
3306
|
+
let n = Mn(e, r), i = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("span", {
|
|
3299
3307
|
className: X.collapsedLabel,
|
|
3300
|
-
children: [/* @__PURE__ */ _(
|
|
3308
|
+
children: [/* @__PURE__ */ _(Sn, {
|
|
3301
3309
|
onCard: !0,
|
|
3302
3310
|
children: t
|
|
3303
3311
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3306,7 +3314,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3306
3314
|
})]
|
|
3307
3315
|
}), /* @__PURE__ */ v("span", {
|
|
3308
3316
|
className: X.collapsedAnswer,
|
|
3309
|
-
children: [n.map((e, t) => /* @__PURE__ */ _(
|
|
3317
|
+
children: [n.map((e, t) => /* @__PURE__ */ _(xn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ _(de, {
|
|
3310
3318
|
className: X.pencil,
|
|
3311
3319
|
size: 14,
|
|
3312
3320
|
"aria-hidden": !0
|
|
@@ -3324,7 +3332,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3324
3332
|
});
|
|
3325
3333
|
} else m = /* @__PURE__ */ v("div", {
|
|
3326
3334
|
className: X.upcoming,
|
|
3327
|
-
children: [/* @__PURE__ */ _(
|
|
3335
|
+
children: [/* @__PURE__ */ _(Sn, { children: t }), /* @__PURE__ */ _("span", {
|
|
3328
3336
|
className: X.upcomingLabel,
|
|
3329
3337
|
children: e.shortTitle
|
|
3330
3338
|
})]
|
|
@@ -3335,7 +3343,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3335
3343
|
"data-active": n === "active" || void 0,
|
|
3336
3344
|
className: X.item,
|
|
3337
3345
|
"data-card": l || void 0,
|
|
3338
|
-
transition: { layout:
|
|
3346
|
+
transition: { layout: On },
|
|
3339
3347
|
style: { borderRadius: f },
|
|
3340
3348
|
children: /* @__PURE__ */ _(y, {
|
|
3341
3349
|
mode: "popLayout",
|
|
@@ -3359,7 +3367,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3359
3367
|
})
|
|
3360
3368
|
});
|
|
3361
3369
|
}
|
|
3362
|
-
var
|
|
3370
|
+
var Fn = {
|
|
3363
3371
|
group: "ick-group-pPcU",
|
|
3364
3372
|
body: "ick-body-lHD3",
|
|
3365
3373
|
list: "ick-list-7cp2",
|
|
@@ -3367,7 +3375,7 @@ var Pn = {
|
|
|
3367
3375
|
summary: "ick-summary-eb2t",
|
|
3368
3376
|
count: "ick-count-eHDc",
|
|
3369
3377
|
summaryList: "ick-summaryList-2sOL"
|
|
3370
|
-
},
|
|
3378
|
+
}, In = 3, Ln = {
|
|
3371
3379
|
visualDuration: .34,
|
|
3372
3380
|
bounce: .1,
|
|
3373
3381
|
rowDuration: .3,
|
|
@@ -3378,18 +3386,18 @@ var Pn = {
|
|
|
3378
3386
|
fadeOut: .08,
|
|
3379
3387
|
fadeInDelay: .08
|
|
3380
3388
|
};
|
|
3381
|
-
function
|
|
3382
|
-
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E =
|
|
3383
|
-
...
|
|
3389
|
+
function Rn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null, collapsible: a = !1, onCommit: o, onEdit: s, readOnly: c = !1, labels: u, foldMotion: d, className: f }) {
|
|
3390
|
+
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E = Dn(T), D = U("questionGroup", u), O = q(), k = a && !h, A = n.map((e) => e.shortTitle).join(" · "), j = {
|
|
3391
|
+
...Ln,
|
|
3384
3392
|
...d
|
|
3385
3393
|
}, M = O ? { duration: 0 } : {
|
|
3386
3394
|
type: "spring",
|
|
3387
3395
|
visualDuration: j.visualDuration,
|
|
3388
3396
|
bounce: j.bounce
|
|
3389
|
-
},
|
|
3397
|
+
}, N = {
|
|
3390
3398
|
hidden: { transition: { staggerChildren: O ? 0 : j.stagger } },
|
|
3391
3399
|
shown: { transition: { staggerChildren: O ? 0 : j.stagger } }
|
|
3392
|
-
},
|
|
3400
|
+
}, ee = (e, t = 0) => O ? { duration: 0 } : {
|
|
3393
3401
|
type: "spring",
|
|
3394
3402
|
visualDuration: j.rowDuration,
|
|
3395
3403
|
bounce: j.rowBounce,
|
|
@@ -3398,19 +3406,19 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3398
3406
|
duration: e,
|
|
3399
3407
|
delay: t
|
|
3400
3408
|
}
|
|
3401
|
-
},
|
|
3409
|
+
}, P = {
|
|
3402
3410
|
hidden: {
|
|
3403
3411
|
opacity: 0,
|
|
3404
3412
|
y: O ? 0 : j.rowOffset,
|
|
3405
|
-
transition:
|
|
3413
|
+
transition: ee(j.fadeOut)
|
|
3406
3414
|
},
|
|
3407
3415
|
shown: {
|
|
3408
3416
|
opacity: 1,
|
|
3409
3417
|
y: 0,
|
|
3410
|
-
transition:
|
|
3418
|
+
transition: ee(j.fadeIn, O ? 0 : j.fadeInDelay)
|
|
3411
3419
|
}
|
|
3412
|
-
},
|
|
3413
|
-
variants:
|
|
3420
|
+
}, F = {
|
|
3421
|
+
variants: N,
|
|
3414
3422
|
initial: "hidden",
|
|
3415
3423
|
animate: "shown",
|
|
3416
3424
|
exit: "hidden",
|
|
@@ -3424,13 +3432,13 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3424
3432
|
ref: T,
|
|
3425
3433
|
layout: !O,
|
|
3426
3434
|
transition: M,
|
|
3427
|
-
className: [
|
|
3435
|
+
className: [Fn.group, f ?? ""].filter(Boolean).join(" "),
|
|
3428
3436
|
"data-moving": x || void 0,
|
|
3429
3437
|
style: { borderRadius: E },
|
|
3430
3438
|
children: [(t || a) && /* @__PURE__ */ _(C.div, {
|
|
3431
3439
|
layout: !O && "position",
|
|
3432
3440
|
transition: M,
|
|
3433
|
-
children: /* @__PURE__ */ _(
|
|
3441
|
+
children: /* @__PURE__ */ _(Lt, {
|
|
3434
3442
|
open: !k,
|
|
3435
3443
|
onToggle: a ? () => {
|
|
3436
3444
|
S(!0), g((e) => !e);
|
|
@@ -3442,34 +3450,34 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3442
3450
|
id: w,
|
|
3443
3451
|
layout: !O && "position",
|
|
3444
3452
|
transition: M,
|
|
3445
|
-
className:
|
|
3453
|
+
className: Fn.body,
|
|
3446
3454
|
children: /* @__PURE__ */ _(y, {
|
|
3447
3455
|
initial: !1,
|
|
3448
3456
|
mode: "popLayout",
|
|
3449
3457
|
children: k ? /* @__PURE__ */ _(C.div, {
|
|
3450
|
-
...
|
|
3458
|
+
...F,
|
|
3451
3459
|
children: /* @__PURE__ */ v(C.div, {
|
|
3452
|
-
variants:
|
|
3453
|
-
className:
|
|
3460
|
+
variants: P,
|
|
3461
|
+
className: Fn.summary,
|
|
3454
3462
|
children: [/* @__PURE__ */ v("span", {
|
|
3455
|
-
className:
|
|
3463
|
+
className: Fn.count,
|
|
3456
3464
|
children: [
|
|
3457
3465
|
n.length,
|
|
3458
3466
|
" ",
|
|
3459
3467
|
D.answers
|
|
3460
3468
|
]
|
|
3461
3469
|
}), /* @__PURE__ */ _("span", {
|
|
3462
|
-
className:
|
|
3470
|
+
className: Fn.summaryList,
|
|
3463
3471
|
children: A
|
|
3464
3472
|
})]
|
|
3465
3473
|
})
|
|
3466
3474
|
}, "summary") : /* @__PURE__ */ _(C.div, {
|
|
3467
|
-
className:
|
|
3468
|
-
...
|
|
3475
|
+
className: Fn.list,
|
|
3476
|
+
...F,
|
|
3469
3477
|
children: n.map((e, t) => /* @__PURE__ */ _(C.div, {
|
|
3470
|
-
variants:
|
|
3471
|
-
className:
|
|
3472
|
-
children: /* @__PURE__ */ _(
|
|
3478
|
+
variants: P,
|
|
3479
|
+
className: Fn.row,
|
|
3480
|
+
children: /* @__PURE__ */ _(Pn, {
|
|
3473
3481
|
question: e,
|
|
3474
3482
|
number: t + 1,
|
|
3475
3483
|
state: t === i ? "active" : r[e.id] ? "collapsed" : "upcoming",
|
|
@@ -3485,59 +3493,60 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3485
3493
|
})
|
|
3486
3494
|
});
|
|
3487
3495
|
}
|
|
3488
|
-
var
|
|
3496
|
+
var zn = { message: "ick-message-wTar" };
|
|
3489
3497
|
//#endregion
|
|
3490
3498
|
//#region src/SystemMessage/SystemMessage.tsx
|
|
3491
|
-
function
|
|
3499
|
+
function Bn({ children: e, tone: t = "notice", className: n, ...r }) {
|
|
3492
3500
|
return /* @__PURE__ */ _("div", {
|
|
3493
|
-
className: [
|
|
3501
|
+
className: [zn.message, n ?? ""].filter(Boolean).join(" "),
|
|
3494
3502
|
"data-tone": t,
|
|
3495
3503
|
...r,
|
|
3496
3504
|
children: e
|
|
3497
3505
|
});
|
|
3498
3506
|
}
|
|
3499
|
-
var
|
|
3507
|
+
var Vn = {
|
|
3500
3508
|
artifact: "ick-artifact-rz53",
|
|
3501
3509
|
card: "ick-card-iGYJ",
|
|
3502
3510
|
head: "ick-head-XVNm",
|
|
3503
3511
|
title: "ick-title-1JVB",
|
|
3504
3512
|
"artifact-sweep": "ick-artifact-sweep-19ol",
|
|
3505
3513
|
meta: "ick-meta-vxo7",
|
|
3514
|
+
grows: "ick-grows-v7GM",
|
|
3506
3515
|
preview: "ick-preview-jRni",
|
|
3507
3516
|
text: "ick-text-uJx8",
|
|
3508
3517
|
waiting: "ick-waiting-ADQs"
|
|
3509
|
-
},
|
|
3510
|
-
function
|
|
3518
|
+
}, Hn = 8;
|
|
3519
|
+
function Un(e, t) {
|
|
3511
3520
|
let n = e.split("\n");
|
|
3512
3521
|
return {
|
|
3513
3522
|
shown: n.slice(0, t).join("\n"),
|
|
3514
3523
|
more: n.length > t
|
|
3515
3524
|
};
|
|
3516
3525
|
}
|
|
3517
|
-
function
|
|
3518
|
-
let f = o === "writing", p = a ?
|
|
3519
|
-
className:
|
|
3526
|
+
function Wn({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, state: o = "done", lines: s = Hn, onOpen: c, open: l, className: u, ...d }) {
|
|
3527
|
+
let f = o === "writing", p = a ? Un(a, s) : null, m = /* @__PURE__ */ _(Kn, { children: /* @__PURE__ */ _("div", {
|
|
3528
|
+
className: Vn.preview,
|
|
3520
3529
|
"data-more": p?.more || void 0,
|
|
3521
3530
|
"aria-hidden": !0,
|
|
3522
3531
|
children: p === null ? /* @__PURE__ */ _("div", {
|
|
3523
|
-
className:
|
|
3524
|
-
children: /* @__PURE__ */ _(
|
|
3525
|
-
}) : r === "code" ? /* @__PURE__ */ _(
|
|
3532
|
+
className: Vn.waiting,
|
|
3533
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
3534
|
+
}) : r === "code" ? /* @__PURE__ */ _(nn, {
|
|
3526
3535
|
code: p.shown,
|
|
3527
3536
|
lang: i,
|
|
3528
3537
|
label: !1,
|
|
3529
3538
|
copyable: !1
|
|
3530
3539
|
}) : /* @__PURE__ */ _("p", {
|
|
3531
|
-
className:
|
|
3540
|
+
className: Vn.text,
|
|
3532
3541
|
children: p.shown
|
|
3533
3542
|
})
|
|
3534
|
-
}), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
3543
|
+
}) }), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(Gn, {
|
|
3535
3544
|
title: t,
|
|
3536
3545
|
meta: n,
|
|
3537
3546
|
writing: f
|
|
3538
|
-
}), m] }), y = { className:
|
|
3547
|
+
}), m] }), y = { className: Vn.card };
|
|
3539
3548
|
return /* @__PURE__ */ _("div", {
|
|
3540
|
-
className: [
|
|
3549
|
+
className: [Vn.artifact, u ?? ""].filter(Boolean).join(" "),
|
|
3541
3550
|
"data-state": o,
|
|
3542
3551
|
"data-open": l || void 0,
|
|
3543
3552
|
...d,
|
|
@@ -3553,36 +3562,62 @@ function Un({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, s
|
|
|
3553
3562
|
})
|
|
3554
3563
|
});
|
|
3555
3564
|
}
|
|
3556
|
-
function
|
|
3565
|
+
function Gn({ title: e, meta: t, writing: n }) {
|
|
3557
3566
|
return /* @__PURE__ */ v("span", {
|
|
3558
|
-
className:
|
|
3567
|
+
className: Vn.head,
|
|
3559
3568
|
children: [/* @__PURE__ */ _("span", {
|
|
3560
|
-
className:
|
|
3569
|
+
className: Vn.title,
|
|
3561
3570
|
"data-writing": n || void 0,
|
|
3562
3571
|
children: e
|
|
3563
3572
|
}), t && /* @__PURE__ */ _("span", {
|
|
3564
|
-
className:
|
|
3573
|
+
className: Vn.meta,
|
|
3565
3574
|
children: t
|
|
3566
3575
|
})]
|
|
3567
3576
|
});
|
|
3568
3577
|
}
|
|
3578
|
+
function Kn({ children: e }) {
|
|
3579
|
+
let t = p(null), [n, r] = m("auto");
|
|
3580
|
+
return d(() => {
|
|
3581
|
+
let e = t.current;
|
|
3582
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
3583
|
+
let n = new ResizeObserver(() => r(e.offsetHeight));
|
|
3584
|
+
return n.observe(e), () => n.disconnect();
|
|
3585
|
+
}, []), /* @__PURE__ */ _(C.div, {
|
|
3586
|
+
className: Vn.grows,
|
|
3587
|
+
initial: !1,
|
|
3588
|
+
animate: { height: n },
|
|
3589
|
+
transition: {
|
|
3590
|
+
duration: q() ? 0 : .22,
|
|
3591
|
+
ease: [
|
|
3592
|
+
.32,
|
|
3593
|
+
.72,
|
|
3594
|
+
0,
|
|
3595
|
+
1
|
|
3596
|
+
]
|
|
3597
|
+
},
|
|
3598
|
+
children: /* @__PURE__ */ _("div", {
|
|
3599
|
+
ref: t,
|
|
3600
|
+
children: e
|
|
3601
|
+
})
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3569
3604
|
//#endregion
|
|
3570
3605
|
//#region src/markdown/parse.ts
|
|
3571
|
-
var
|
|
3572
|
-
function
|
|
3606
|
+
var qn = "\\`*_{}[]()#+-.!>~|", Jn = (e) => e === void 0 || /\s/.test(e);
|
|
3607
|
+
function Yn(e, t, n, r) {
|
|
3573
3608
|
let i = e[t + n];
|
|
3574
|
-
return !(
|
|
3609
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t - 1] ?? ""));
|
|
3575
3610
|
}
|
|
3576
|
-
function
|
|
3611
|
+
function Xn(e, t, n, r) {
|
|
3577
3612
|
let i = e[t - 1];
|
|
3578
|
-
return !(
|
|
3613
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t + n] ?? ""));
|
|
3579
3614
|
}
|
|
3580
|
-
function
|
|
3615
|
+
function Zn(e, t, n) {
|
|
3581
3616
|
let r = 0;
|
|
3582
3617
|
for (; e[t + r] === n;) r++;
|
|
3583
3618
|
return r;
|
|
3584
3619
|
}
|
|
3585
|
-
function
|
|
3620
|
+
function Qn(e, t) {
|
|
3586
3621
|
let n = 0;
|
|
3587
3622
|
for (let r = t; r < e.length; r++) {
|
|
3588
3623
|
let t = e[r];
|
|
@@ -3591,7 +3626,7 @@ function Xn(e, t) {
|
|
|
3591
3626
|
continue;
|
|
3592
3627
|
}
|
|
3593
3628
|
if (t === "`") {
|
|
3594
|
-
let t =
|
|
3629
|
+
let t = Zn(e, r, "`"), n = e.indexOf("`".repeat(t), r + t);
|
|
3595
3630
|
r = n === -1 ? e.length : n + t - 1;
|
|
3596
3631
|
continue;
|
|
3597
3632
|
}
|
|
@@ -3600,7 +3635,7 @@ function Xn(e, t) {
|
|
|
3600
3635
|
}
|
|
3601
3636
|
return -1;
|
|
3602
3637
|
}
|
|
3603
|
-
function
|
|
3638
|
+
function $n(e, t) {
|
|
3604
3639
|
if (e[t] !== "(") return null;
|
|
3605
3640
|
let n = 0, r = -1;
|
|
3606
3641
|
for (let i = t; i < e.length; i++) {
|
|
@@ -3622,8 +3657,8 @@ function Zn(e, t) {
|
|
|
3622
3657
|
end: r + 1
|
|
3623
3658
|
};
|
|
3624
3659
|
}
|
|
3625
|
-
var
|
|
3626
|
-
function
|
|
3660
|
+
var er = /^<\/?[A-Za-z][A-Za-z0-9-]*(\s[^<>]*?)?\/?>|^<!--[\s\S]*?-->/;
|
|
3661
|
+
function tr(e) {
|
|
3627
3662
|
let t = [], n = "", r = () => {
|
|
3628
3663
|
n && t.push({
|
|
3629
3664
|
type: "text",
|
|
@@ -3638,7 +3673,7 @@ function $n(e) {
|
|
|
3638
3673
|
r(), t.push({ type: "break" }), i += 2;
|
|
3639
3674
|
continue;
|
|
3640
3675
|
}
|
|
3641
|
-
if (o &&
|
|
3676
|
+
if (o && qn.includes(o)) {
|
|
3642
3677
|
n += o, i += 2;
|
|
3643
3678
|
continue;
|
|
3644
3679
|
}
|
|
@@ -3651,7 +3686,7 @@ function $n(e) {
|
|
|
3651
3686
|
continue;
|
|
3652
3687
|
}
|
|
3653
3688
|
if (a === "`") {
|
|
3654
|
-
let n =
|
|
3689
|
+
let n = Zn(e, i, "`"), a = e.indexOf("`".repeat(n), i + n);
|
|
3655
3690
|
if (a !== -1 && !e.slice(i + n, a).startsWith("`")) {
|
|
3656
3691
|
r();
|
|
3657
3692
|
let o = e.slice(i + n, a);
|
|
@@ -3663,7 +3698,7 @@ function $n(e) {
|
|
|
3663
3698
|
}
|
|
3664
3699
|
}
|
|
3665
3700
|
if (a === "!" && e[i + 1] === "[") {
|
|
3666
|
-
let n =
|
|
3701
|
+
let n = Qn(e, i + 1), a = n === -1 ? null : $n(e, n + 1);
|
|
3667
3702
|
if (a) {
|
|
3668
3703
|
r(), t.push({
|
|
3669
3704
|
type: "image",
|
|
@@ -3684,13 +3719,13 @@ function $n(e) {
|
|
|
3684
3719
|
}
|
|
3685
3720
|
}
|
|
3686
3721
|
if (a === "[") {
|
|
3687
|
-
let n =
|
|
3722
|
+
let n = Qn(e, i), a = n === -1 ? null : $n(e, n + 1);
|
|
3688
3723
|
if (a) {
|
|
3689
3724
|
r(), t.push({
|
|
3690
3725
|
type: "link",
|
|
3691
3726
|
url: a.url,
|
|
3692
3727
|
...a.title ? { title: a.title } : {},
|
|
3693
|
-
children:
|
|
3728
|
+
children: tr(e.slice(i + 1, n))
|
|
3694
3729
|
}), i = a.end;
|
|
3695
3730
|
continue;
|
|
3696
3731
|
}
|
|
@@ -3700,14 +3735,14 @@ function $n(e) {
|
|
|
3700
3735
|
if (n !== -1 && n > i + 2) {
|
|
3701
3736
|
r(), t.push({
|
|
3702
3737
|
type: "delete",
|
|
3703
|
-
children:
|
|
3738
|
+
children: tr(e.slice(i + 2, n))
|
|
3704
3739
|
}), i = n + 2;
|
|
3705
3740
|
continue;
|
|
3706
3741
|
}
|
|
3707
3742
|
}
|
|
3708
3743
|
if (a === "*" || a === "_") {
|
|
3709
|
-
let n = Math.min(
|
|
3710
|
-
if (
|
|
3744
|
+
let n = Math.min(Zn(e, i, a), 2);
|
|
3745
|
+
if (Yn(e, i, n, a)) {
|
|
3711
3746
|
let o = i + n, s = -1;
|
|
3712
3747
|
for (; o < e.length;) {
|
|
3713
3748
|
if (e[o] === "\\") {
|
|
@@ -3715,8 +3750,8 @@ function $n(e) {
|
|
|
3715
3750
|
continue;
|
|
3716
3751
|
}
|
|
3717
3752
|
if (e[o] === a) {
|
|
3718
|
-
let t =
|
|
3719
|
-
if (t >= n &&
|
|
3753
|
+
let t = Zn(e, o, a);
|
|
3754
|
+
if (t >= n && Xn(e, o, n, a)) {
|
|
3720
3755
|
s = o;
|
|
3721
3756
|
break;
|
|
3722
3757
|
}
|
|
@@ -3727,7 +3762,7 @@ function $n(e) {
|
|
|
3727
3762
|
}
|
|
3728
3763
|
if (s !== -1 && s > i + n) {
|
|
3729
3764
|
r();
|
|
3730
|
-
let a =
|
|
3765
|
+
let a = tr(e.slice(i + n, s));
|
|
3731
3766
|
t.push(n === 2 ? {
|
|
3732
3767
|
type: "strong",
|
|
3733
3768
|
children: a
|
|
@@ -3740,7 +3775,7 @@ function $n(e) {
|
|
|
3740
3775
|
}
|
|
3741
3776
|
}
|
|
3742
3777
|
if (a === "<") {
|
|
3743
|
-
let n = e.slice(i).match(
|
|
3778
|
+
let n = e.slice(i).match(er);
|
|
3744
3779
|
if (n) {
|
|
3745
3780
|
r(), t.push({
|
|
3746
3781
|
type: "html",
|
|
@@ -3753,8 +3788,8 @@ function $n(e) {
|
|
|
3753
3788
|
}
|
|
3754
3789
|
return r(), t;
|
|
3755
3790
|
}
|
|
3756
|
-
var
|
|
3757
|
-
function
|
|
3791
|
+
var nr = /^ {0,3}(`{3,}|~{3,})\s*([^`\s]*)[^`]*$/, rr = /^ {0,3}(#{1,6})(?:\s+(.*?))?\s*#*\s*$/, ir = /^ {0,3}(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$/, ar = /^ {0,3}>\s?/, or = /^(\s*)([-*+])(\s+)(.*)$/, sr = /^(\s*)(\d{1,9})([.)])(\s+)(.*)$/, cr = /^ {0,3}\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/, lr = /^:?-+:?$/, ur = /^\s*$/;
|
|
3792
|
+
function dr(e) {
|
|
3758
3793
|
let t = e.trim().replace(/^\|/, "").replace(/\|$/, ""), n = [], r = "";
|
|
3759
3794
|
for (let e = 0; e < t.length; e++) {
|
|
3760
3795
|
if (t[e] === "\\" && t[e + 1] === "|") {
|
|
@@ -3769,16 +3804,16 @@ function lr(e) {
|
|
|
3769
3804
|
}
|
|
3770
3805
|
return n.push(r.trim()), n;
|
|
3771
3806
|
}
|
|
3772
|
-
var
|
|
3773
|
-
function
|
|
3807
|
+
var fr = (e) => nr.test(e) || rr.test(e) || ir.test(e) || ar.test(e) || or.test(e) || sr.test(e);
|
|
3808
|
+
function pr(e) {
|
|
3774
3809
|
let t = e.replace(/\r\n?/g, "\n").split("\n"), n = [], r = 0;
|
|
3775
3810
|
for (; r < t.length;) {
|
|
3776
3811
|
let e = t[r];
|
|
3777
|
-
if (
|
|
3812
|
+
if (ur.test(e)) {
|
|
3778
3813
|
r++;
|
|
3779
3814
|
continue;
|
|
3780
3815
|
}
|
|
3781
|
-
let i = e.match(
|
|
3816
|
+
let i = e.match(nr);
|
|
3782
3817
|
if (i) {
|
|
3783
3818
|
let e = i[1][0], a = i[1].length, o = [];
|
|
3784
3819
|
for (r++; r < t.length;) {
|
|
@@ -3795,44 +3830,44 @@ function dr(e) {
|
|
|
3795
3830
|
});
|
|
3796
3831
|
continue;
|
|
3797
3832
|
}
|
|
3798
|
-
let a = e.match(
|
|
3833
|
+
let a = e.match(rr);
|
|
3799
3834
|
if (a) {
|
|
3800
3835
|
n.push({
|
|
3801
3836
|
type: "heading",
|
|
3802
3837
|
depth: a[1].length,
|
|
3803
|
-
children:
|
|
3838
|
+
children: tr(a[2] ?? "")
|
|
3804
3839
|
}), r++;
|
|
3805
3840
|
continue;
|
|
3806
3841
|
}
|
|
3807
|
-
if (
|
|
3842
|
+
if (ir.test(e)) {
|
|
3808
3843
|
n.push({ type: "thematicBreak" }), r++;
|
|
3809
3844
|
continue;
|
|
3810
3845
|
}
|
|
3811
|
-
if (
|
|
3846
|
+
if (ar.test(e)) {
|
|
3812
3847
|
let e = [];
|
|
3813
|
-
for (; r < t.length && !
|
|
3848
|
+
for (; r < t.length && !ur.test(t[r]);) e.push(t[r].replace(ar, "")), r++;
|
|
3814
3849
|
n.push({
|
|
3815
3850
|
type: "blockquote",
|
|
3816
|
-
children:
|
|
3851
|
+
children: pr(e.join("\n"))
|
|
3817
3852
|
});
|
|
3818
3853
|
continue;
|
|
3819
3854
|
}
|
|
3820
|
-
let o = e.includes("|") && r + 1 < t.length &&
|
|
3821
|
-
if (o && o.length ===
|
|
3822
|
-
let i =
|
|
3855
|
+
let o = e.includes("|") && r + 1 < t.length && cr.test(t[r + 1]) ? dr(t[r + 1]) : null;
|
|
3856
|
+
if (o && o.length === dr(e).length && o.every((e) => lr.test(e))) {
|
|
3857
|
+
let i = dr(e), a = [{
|
|
3823
3858
|
type: "tableRow",
|
|
3824
3859
|
children: i.map((e) => ({
|
|
3825
3860
|
type: "tableCell",
|
|
3826
|
-
children:
|
|
3861
|
+
children: tr(e)
|
|
3827
3862
|
}))
|
|
3828
3863
|
}];
|
|
3829
|
-
for (r += 2; r < t.length && !
|
|
3830
|
-
let e =
|
|
3864
|
+
for (r += 2; r < t.length && !ur.test(t[r]) && t[r].includes("|");) {
|
|
3865
|
+
let e = dr(t[r]);
|
|
3831
3866
|
a.push({
|
|
3832
3867
|
type: "tableRow",
|
|
3833
3868
|
children: i.map((t, n) => ({
|
|
3834
3869
|
type: "tableCell",
|
|
3835
|
-
children:
|
|
3870
|
+
children: tr(e[n] ?? "")
|
|
3836
3871
|
}))
|
|
3837
3872
|
}), r++;
|
|
3838
3873
|
}
|
|
@@ -3842,16 +3877,16 @@ function dr(e) {
|
|
|
3842
3877
|
});
|
|
3843
3878
|
continue;
|
|
3844
3879
|
}
|
|
3845
|
-
let s = e.match(
|
|
3880
|
+
let s = e.match(or), c = e.match(sr);
|
|
3846
3881
|
if (s || c) {
|
|
3847
3882
|
let e = !!c, i = c ? Number(c[2]) : void 0, a = [];
|
|
3848
3883
|
for (; r < t.length;) {
|
|
3849
|
-
let n = t[r].match(
|
|
3884
|
+
let n = t[r].match(or), i = t[r].match(sr), o = e ? i : n;
|
|
3850
3885
|
if (!o || !!i !== e) break;
|
|
3851
3886
|
let s = e ? o[1].length + o[2].length + 1 + o[4].length : o[1].length + 1 + o[3].length, c = [e ? o[5] : o[4]];
|
|
3852
3887
|
for (r++; r < t.length;) {
|
|
3853
3888
|
let e = t[r];
|
|
3854
|
-
if (
|
|
3889
|
+
if (ur.test(e)) {
|
|
3855
3890
|
let e = t[r + 1];
|
|
3856
3891
|
if (e !== void 0 && RegExp(`^ {${s},}\\S`).test(e)) {
|
|
3857
3892
|
c.push(""), r++;
|
|
@@ -3863,12 +3898,12 @@ function dr(e) {
|
|
|
3863
3898
|
c.push(e.slice(s)), r++;
|
|
3864
3899
|
continue;
|
|
3865
3900
|
}
|
|
3866
|
-
if (
|
|
3901
|
+
if (or.test(e) || sr.test(e) || fr(e)) break;
|
|
3867
3902
|
c.push(e.trim()), r++;
|
|
3868
3903
|
}
|
|
3869
3904
|
a.push({
|
|
3870
3905
|
type: "listItem",
|
|
3871
|
-
children:
|
|
3906
|
+
children: pr(c.join("\n"))
|
|
3872
3907
|
});
|
|
3873
3908
|
}
|
|
3874
3909
|
n.push({
|
|
@@ -3880,25 +3915,25 @@ function dr(e) {
|
|
|
3880
3915
|
continue;
|
|
3881
3916
|
}
|
|
3882
3917
|
let l = [];
|
|
3883
|
-
for (; r < t.length && !
|
|
3918
|
+
for (; r < t.length && !ur.test(t[r]) && !(l.length && fr(t[r]) || l.length && t[r].includes("|") && r + 1 < t.length && cr.test(t[r + 1]));) l.push(t[r]), r++;
|
|
3884
3919
|
let u = l.map((e) => e.replace(/^[ \t]+/, "")).join("\n").replace(/\s+$/, "");
|
|
3885
3920
|
n.push({
|
|
3886
3921
|
type: "paragraph",
|
|
3887
|
-
children:
|
|
3922
|
+
children: tr(u)
|
|
3888
3923
|
});
|
|
3889
3924
|
}
|
|
3890
3925
|
return n;
|
|
3891
3926
|
}
|
|
3892
3927
|
//#endregion
|
|
3893
3928
|
//#region src/markdown/parseMarkdown.ts
|
|
3894
|
-
var
|
|
3929
|
+
var mr = "\n\n", hr = [
|
|
3895
3930
|
"h1",
|
|
3896
3931
|
"h2",
|
|
3897
3932
|
"h3",
|
|
3898
3933
|
"h4",
|
|
3899
3934
|
"h5",
|
|
3900
3935
|
"h6"
|
|
3901
|
-
],
|
|
3936
|
+
], gr = class {
|
|
3902
3937
|
tokens = [];
|
|
3903
3938
|
text(e) {
|
|
3904
3939
|
let t = [];
|
|
@@ -3909,7 +3944,7 @@ var fr = "\n\n", pr = [
|
|
|
3909
3944
|
return t;
|
|
3910
3945
|
}
|
|
3911
3946
|
break() {
|
|
3912
|
-
this.tokens.push(
|
|
3947
|
+
this.tokens.push(mr);
|
|
3913
3948
|
}
|
|
3914
3949
|
}, Z = (e, t, n) => ({
|
|
3915
3950
|
type: "el",
|
|
@@ -3917,29 +3952,29 @@ var fr = "\n\n", pr = [
|
|
|
3917
3952
|
children: t,
|
|
3918
3953
|
...n ? { props: n } : {}
|
|
3919
3954
|
});
|
|
3920
|
-
function
|
|
3955
|
+
function _r(e, t, n) {
|
|
3921
3956
|
return e.map((e, r) => (r > 0 && t.break(), n(e)));
|
|
3922
3957
|
}
|
|
3923
|
-
function
|
|
3958
|
+
function vr(e, t) {
|
|
3924
3959
|
let n = [];
|
|
3925
3960
|
for (let r of e) switch (r.type) {
|
|
3926
3961
|
case "text":
|
|
3927
3962
|
n.push(...t.text(r.value));
|
|
3928
3963
|
break;
|
|
3929
3964
|
case "strong":
|
|
3930
|
-
n.push(Z("strong",
|
|
3965
|
+
n.push(Z("strong", vr(r.children, t)));
|
|
3931
3966
|
break;
|
|
3932
3967
|
case "emphasis":
|
|
3933
|
-
n.push(Z("em",
|
|
3968
|
+
n.push(Z("em", vr(r.children, t)));
|
|
3934
3969
|
break;
|
|
3935
3970
|
case "delete":
|
|
3936
|
-
n.push(Z("del",
|
|
3971
|
+
n.push(Z("del", vr(r.children, t)));
|
|
3937
3972
|
break;
|
|
3938
3973
|
case "inlineCode":
|
|
3939
3974
|
n.push(Z("code", t.text(r.value)));
|
|
3940
3975
|
break;
|
|
3941
3976
|
case "link":
|
|
3942
|
-
n.push(Z("a",
|
|
3977
|
+
n.push(Z("a", vr(r.children, t), {
|
|
3943
3978
|
href: r.url,
|
|
3944
3979
|
target: "_blank",
|
|
3945
3980
|
rel: "noopener noreferrer",
|
|
@@ -3958,25 +3993,25 @@ function gr(e, t) {
|
|
|
3958
3993
|
case "break":
|
|
3959
3994
|
n.push(Z("br", []));
|
|
3960
3995
|
break;
|
|
3961
|
-
default: "children" in r && Array.isArray(r.children) && n.push(...
|
|
3996
|
+
default: "children" in r && Array.isArray(r.children) && n.push(...vr(r.children, t));
|
|
3962
3997
|
}
|
|
3963
3998
|
return n;
|
|
3964
3999
|
}
|
|
3965
|
-
function
|
|
4000
|
+
function yr(e, t) {
|
|
3966
4001
|
let n = [];
|
|
3967
4002
|
return e.forEach((e, r) => {
|
|
3968
4003
|
switch (r > 0 && t.break(), e.type) {
|
|
3969
4004
|
case "paragraph":
|
|
3970
|
-
n.push(Z("p",
|
|
4005
|
+
n.push(Z("p", vr(e.children, t)));
|
|
3971
4006
|
break;
|
|
3972
4007
|
case "heading":
|
|
3973
|
-
n.push(Z(
|
|
4008
|
+
n.push(Z(hr[e.depth - 1] ?? "h6", vr(e.children, t)));
|
|
3974
4009
|
break;
|
|
3975
4010
|
case "list":
|
|
3976
|
-
n.push(Z(e.ordered ? "ol" : "ul",
|
|
4011
|
+
n.push(Z(e.ordered ? "ol" : "ul", _r(e.children, t, (e) => Z("li", yr(e.children, t))), e.ordered && e.start != null && e.start !== 1 ? { start: String(e.start) } : void 0));
|
|
3977
4012
|
break;
|
|
3978
4013
|
case "blockquote":
|
|
3979
|
-
n.push(Z("blockquote",
|
|
4014
|
+
n.push(Z("blockquote", yr(e.children, t)));
|
|
3980
4015
|
break;
|
|
3981
4016
|
case "code":
|
|
3982
4017
|
n.push({
|
|
@@ -3989,24 +4024,24 @@ function _r(e, t) {
|
|
|
3989
4024
|
n.push(Z("hr", []));
|
|
3990
4025
|
break;
|
|
3991
4026
|
case "table": {
|
|
3992
|
-
let [r, ...i] = e.children, a = (e, n) =>
|
|
4027
|
+
let [r, ...i] = e.children, a = (e, n) => _r(e.children, t, (e) => Z(n, vr(e.children, t))), o = r ? Z("thead", [Z("tr", a(r, "th"))]) : null;
|
|
3993
4028
|
o && i.length && t.break();
|
|
3994
|
-
let s = i.length ? Z("tbody",
|
|
4029
|
+
let s = i.length ? Z("tbody", _r(i, t, (e) => Z("tr", a(e, "td")))) : null;
|
|
3995
4030
|
n.push(Z("table", [o, s].filter((e) => e !== null)));
|
|
3996
4031
|
break;
|
|
3997
4032
|
}
|
|
3998
|
-
default: "children" in e && Array.isArray(e.children) && n.push(...
|
|
4033
|
+
default: "children" in e && Array.isArray(e.children) && n.push(...vr(e.children, t));
|
|
3999
4034
|
}
|
|
4000
4035
|
}), n;
|
|
4001
4036
|
}
|
|
4002
|
-
function
|
|
4003
|
-
let t = new
|
|
4037
|
+
function br(e) {
|
|
4038
|
+
let t = new gr(), n = yr(pr(e), t);
|
|
4004
4039
|
return {
|
|
4005
4040
|
tokens: t.tokens,
|
|
4006
4041
|
nodes: n
|
|
4007
4042
|
};
|
|
4008
4043
|
}
|
|
4009
|
-
var
|
|
4044
|
+
var xr = {
|
|
4010
4045
|
citation: "ick-citation-3Yqh",
|
|
4011
4046
|
marked: "ick-marked-MYhj",
|
|
4012
4047
|
passage: "ick-passage-QMNg",
|
|
@@ -4014,16 +4049,16 @@ var yr = {
|
|
|
4014
4049
|
};
|
|
4015
4050
|
//#endregion
|
|
4016
4051
|
//#region src/InlineCitation/InlineCitation.tsx
|
|
4017
|
-
function
|
|
4018
|
-
let { cite: s } =
|
|
4052
|
+
function Sr({ index: e, source: t, children: n, onSelect: r, labels: i, className: a, ...o }) {
|
|
4053
|
+
let { cite: s } = U("citation", i), c = t ? `${s} ${e}: ${t.title}` : `${s} ${e}`, l = r ? /* @__PURE__ */ _("button", {
|
|
4019
4054
|
type: "button",
|
|
4020
|
-
className:
|
|
4055
|
+
className: xr.marker,
|
|
4021
4056
|
onClick: () => r(e, t),
|
|
4022
4057
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4023
4058
|
"aria-label": c,
|
|
4024
4059
|
children: e
|
|
4025
4060
|
}) : /* @__PURE__ */ _("span", {
|
|
4026
|
-
className:
|
|
4061
|
+
className: xr.marker,
|
|
4027
4062
|
"data-static": "",
|
|
4028
4063
|
"aria-label": c,
|
|
4029
4064
|
role: "note",
|
|
@@ -4031,22 +4066,22 @@ function br({ index: e, source: t, children: n, onSelect: r, labels: i, classNam
|
|
|
4031
4066
|
});
|
|
4032
4067
|
return n ? /* @__PURE__ */ v("span", {
|
|
4033
4068
|
className: [
|
|
4034
|
-
|
|
4035
|
-
|
|
4069
|
+
xr.citation,
|
|
4070
|
+
xr.marked,
|
|
4036
4071
|
a ?? ""
|
|
4037
4072
|
].filter(Boolean).join(" "),
|
|
4038
4073
|
...o,
|
|
4039
4074
|
children: [/* @__PURE__ */ _("span", {
|
|
4040
|
-
className:
|
|
4075
|
+
className: xr.passage,
|
|
4041
4076
|
children: n
|
|
4042
4077
|
}), l]
|
|
4043
4078
|
}) : /* @__PURE__ */ _("span", {
|
|
4044
|
-
className: [
|
|
4079
|
+
className: [xr.citation, a ?? ""].filter(Boolean).join(" "),
|
|
4045
4080
|
...o,
|
|
4046
4081
|
children: l
|
|
4047
4082
|
});
|
|
4048
4083
|
}
|
|
4049
|
-
var
|
|
4084
|
+
var Cr = {
|
|
4050
4085
|
marker: "ick-marker-BYwC",
|
|
4051
4086
|
shimmer: "ick-shimmer-InQp",
|
|
4052
4087
|
"shimmer-sweep": "ick-shimmer-sweep-O8S3",
|
|
@@ -4057,21 +4092,21 @@ var xr = {
|
|
|
4057
4092
|
canvas: "ick-canvas-IRKL",
|
|
4058
4093
|
menu: "ick-menu-gZzr",
|
|
4059
4094
|
srOnly: "ick-srOnly-Q3GJ"
|
|
4060
|
-
},
|
|
4095
|
+
}, wr = -20, Tr = Math.tan(wr * Math.PI / 180), Er = (e) => {
|
|
4061
4096
|
if (e.length === 0) return "";
|
|
4062
4097
|
let t = e[0], n = `M ${t.x} ${t.y}`;
|
|
4063
4098
|
for (let t = 1; t < e.length; t++) n += ` L ${e[t].x} ${e[t].y}`;
|
|
4064
4099
|
return n;
|
|
4065
|
-
},
|
|
4100
|
+
}, Dr = (e) => {
|
|
4066
4101
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4067
4102
|
return e.forEach((e) => {
|
|
4068
|
-
let i = e.x +
|
|
4103
|
+
let i = e.x + Tr * e.y;
|
|
4069
4104
|
i < t && (t = i), i > n && (n = i), e.y < r && (r = e.y);
|
|
4070
4105
|
}), {
|
|
4071
4106
|
x: (t + n) / 2,
|
|
4072
4107
|
y: r
|
|
4073
4108
|
};
|
|
4074
|
-
},
|
|
4109
|
+
}, Or = (e) => {
|
|
4075
4110
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4076
4111
|
return e.forEach((e) => {
|
|
4077
4112
|
e.x < t && (t = e.x), e.x + e.w > n && (n = e.x + e.w), e.y < r && (r = e.y);
|
|
@@ -4079,67 +4114,67 @@ var xr = {
|
|
|
4079
4114
|
x: (t + n) / 2,
|
|
4080
4115
|
y: r
|
|
4081
4116
|
};
|
|
4082
|
-
},
|
|
4117
|
+
}, kr = (e, t) => {
|
|
4083
4118
|
if (e.size === 0) return "";
|
|
4084
4119
|
let n = [...e].sort((e, t) => e - t), r = "";
|
|
4085
4120
|
for (let e = n[0]; e <= n[n.length - 1]; e++) r += t[e];
|
|
4086
4121
|
return r.trim();
|
|
4087
|
-
},
|
|
4122
|
+
}, Ar = (e, t = 60) => e.length > t ? `${e.slice(0, t).trimEnd()}…` : e, jr = (e) => {
|
|
4088
4123
|
let t = "";
|
|
4089
4124
|
return e.forEach((e) => {
|
|
4090
|
-
let n = e.y + e.h / 2, r = e.x - n *
|
|
4125
|
+
let n = e.y + e.h / 2, r = e.x - n * Tr, i = e.x + e.w - n * Tr;
|
|
4091
4126
|
t += `M ${r} ${n} L ${i} ${n} `;
|
|
4092
4127
|
}), t.trim();
|
|
4093
4128
|
};
|
|
4094
|
-
function
|
|
4095
|
-
let h =
|
|
4096
|
-
e.viaKeyboard && (
|
|
4097
|
-
}, []),
|
|
4098
|
-
let t =
|
|
4099
|
-
|
|
4129
|
+
function Mr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlightComplete: a, onReplyInThread: s, sources: u, onSelectSource: d }) {
|
|
4130
|
+
let h = U("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [M, N] = m(0), ee = p(null), P = p(null), [F, I] = m(null), [L, R] = m(null), te = o((e) => {
|
|
4131
|
+
e.viaKeyboard && (P.current = document.activeElement), N(0), j(e);
|
|
4132
|
+
}, []), ne = o((e = "none") => {
|
|
4133
|
+
let t = P.current;
|
|
4134
|
+
P.current = null, j(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : g.current?.focus());
|
|
4100
4135
|
}, []);
|
|
4101
4136
|
c(() => {
|
|
4102
4137
|
let e = (e) => {
|
|
4103
|
-
A && g.current && !g.current.contains(e.target) &&
|
|
4138
|
+
A && g.current && !g.current.contains(e.target) && ne();
|
|
4104
4139
|
};
|
|
4105
4140
|
return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
|
|
4106
|
-
}, [A,
|
|
4107
|
-
let
|
|
4141
|
+
}, [A, ne]);
|
|
4142
|
+
let re = f(() => br(t), [t]), z = re.tokens, ae = p(w), oe = p(a), se = p(A);
|
|
4108
4143
|
c(() => {
|
|
4109
|
-
|
|
4144
|
+
ae.current = w, oe.current = a, se.current = A;
|
|
4110
4145
|
});
|
|
4111
|
-
let
|
|
4146
|
+
let ce = f(() => [...b.map((e) => ({
|
|
4112
4147
|
id: e.id,
|
|
4113
|
-
d:
|
|
4148
|
+
d: Er(e.points),
|
|
4114
4149
|
kind: "path",
|
|
4115
4150
|
item: e,
|
|
4116
|
-
text:
|
|
4151
|
+
text: kr(e.highlightedIndices, z)
|
|
4117
4152
|
})), ...w.map((e) => ({
|
|
4118
4153
|
id: e.id,
|
|
4119
|
-
d:
|
|
4154
|
+
d: jr(e.rects),
|
|
4120
4155
|
kind: "selection",
|
|
4121
4156
|
item: e,
|
|
4122
4157
|
text: e.text
|
|
4123
4158
|
}))], [
|
|
4124
4159
|
b,
|
|
4125
4160
|
w,
|
|
4126
|
-
|
|
4127
|
-
]),
|
|
4128
|
-
let n = e.kind === "path" ?
|
|
4129
|
-
|
|
4161
|
+
z
|
|
4162
|
+
]), le = (e, t = !1) => {
|
|
4163
|
+
let n = e.kind === "path" ? Dr(e.item.points) : Or(e.item.rects);
|
|
4164
|
+
te({
|
|
4130
4165
|
x: n.x,
|
|
4131
4166
|
y: n.y,
|
|
4132
4167
|
pathId: e.id,
|
|
4133
4168
|
kind: e.kind,
|
|
4134
4169
|
viaKeyboard: t
|
|
4135
4170
|
});
|
|
4136
|
-
},
|
|
4171
|
+
}, ue = o((e, t, n = !1) => {
|
|
4137
4172
|
let r = g.current, i = t.trim();
|
|
4138
4173
|
if (!r || !i) return;
|
|
4139
4174
|
let a = /* @__PURE__ */ new Set();
|
|
4140
4175
|
r.querySelectorAll("span[data-index]").forEach((t) => {
|
|
4141
4176
|
e.intersectsNode(t) && a.add(parseInt(t.getAttribute("data-index"), 10));
|
|
4142
|
-
}),
|
|
4177
|
+
}), oe.current?.(i);
|
|
4143
4178
|
let o = r.getBoundingClientRect(), s = Array.from(e.getClientRects()).map((e) => ({
|
|
4144
4179
|
x: e.left - o.left,
|
|
4145
4180
|
y: e.top - o.top,
|
|
@@ -4167,24 +4202,24 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4167
4202
|
text: i,
|
|
4168
4203
|
highlightedIndices: a
|
|
4169
4204
|
}]);
|
|
4170
|
-
let d =
|
|
4171
|
-
|
|
4205
|
+
let d = Or(l);
|
|
4206
|
+
te({
|
|
4172
4207
|
x: d.x,
|
|
4173
4208
|
y: d.y,
|
|
4174
4209
|
pathId: u,
|
|
4175
4210
|
kind: "selection",
|
|
4176
4211
|
viaKeyboard: n
|
|
4177
4212
|
});
|
|
4178
|
-
}, [
|
|
4213
|
+
}, [te]);
|
|
4179
4214
|
c(() => {
|
|
4180
4215
|
let e = (e) => {
|
|
4181
|
-
if (
|
|
4216
|
+
if (se.current) return;
|
|
4182
4217
|
let t = g.current;
|
|
4183
4218
|
if (!t) return;
|
|
4184
4219
|
let n = window.getSelection();
|
|
4185
4220
|
if (!n || n.isCollapsed || n.rangeCount === 0 || !n.toString().trim()) return;
|
|
4186
4221
|
let r = n.getRangeAt(0);
|
|
4187
|
-
t.contains(r.commonAncestorContainer) && (
|
|
4222
|
+
t.contains(r.commonAncestorContainer) && (ue(r, n.toString(), e), requestAnimationFrame(() => window.getSelection()?.removeAllRanges()));
|
|
4188
4223
|
}, t = () => e(!1), n = (t) => {
|
|
4189
4224
|
let n = (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a";
|
|
4190
4225
|
!t.shiftKey && !n || e(!0);
|
|
@@ -4192,82 +4227,82 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4192
4227
|
return document.addEventListener("mouseup", t), document.addEventListener("keyup", n), () => {
|
|
4193
4228
|
document.removeEventListener("mouseup", t), document.removeEventListener("keyup", n);
|
|
4194
4229
|
};
|
|
4195
|
-
}, [
|
|
4196
|
-
let [
|
|
4197
|
-
|
|
4198
|
-
let
|
|
4199
|
-
from: Math.min(
|
|
4200
|
-
to: Math.max(
|
|
4201
|
-
}, [
|
|
4202
|
-
|
|
4203
|
-
},
|
|
4230
|
+
}, [ue]);
|
|
4231
|
+
let [B, de] = m(i);
|
|
4232
|
+
B !== i && (de(i), j(null));
|
|
4233
|
+
let fe = f(() => z.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [z]), [pe, me] = m(null), [he, ge] = m(null), _e = l(), ve = f(() => pe === null || he === null ? null : {
|
|
4234
|
+
from: Math.min(he, pe),
|
|
4235
|
+
to: Math.max(he, pe)
|
|
4236
|
+
}, [pe, he]), ye = () => {
|
|
4237
|
+
me(null), ge(null);
|
|
4238
|
+
}, be = () => {
|
|
4204
4239
|
let e = g.current;
|
|
4205
|
-
if (!e || !
|
|
4206
|
-
let t = e.querySelector(`span[data-index="${
|
|
4240
|
+
if (!e || !ve) return;
|
|
4241
|
+
let t = e.querySelector(`span[data-index="${ve.from}"]`), n = e.querySelector(`span[data-index="${ve.to}"]`);
|
|
4207
4242
|
if (!t || !n) return;
|
|
4208
4243
|
let r = document.createRange();
|
|
4209
4244
|
r.setStartBefore(t), r.setEndAfter(n);
|
|
4210
4245
|
let i = "";
|
|
4211
|
-
for (let e =
|
|
4212
|
-
|
|
4213
|
-
},
|
|
4246
|
+
for (let e = ve.from; e <= ve.to; e++) i += z[e];
|
|
4247
|
+
ue(r, i, !0), ye();
|
|
4248
|
+
}, Se = () => [...ee.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
|
|
4214
4249
|
c(() => {
|
|
4215
4250
|
if (!A) return;
|
|
4216
|
-
let e =
|
|
4251
|
+
let e = Se();
|
|
4217
4252
|
if (e.length === 0) return;
|
|
4218
|
-
let t =
|
|
4253
|
+
let t = ee.current?.contains(document.activeElement);
|
|
4219
4254
|
(A.viaKeyboard || t) && e[Math.min(M, e.length - 1)]?.focus();
|
|
4220
4255
|
}, [A, M]);
|
|
4221
|
-
let
|
|
4222
|
-
let t =
|
|
4256
|
+
let Ce = (e) => {
|
|
4257
|
+
let t = Se().length;
|
|
4223
4258
|
if (t === 0) return;
|
|
4224
4259
|
let n = (n) => {
|
|
4225
|
-
e.preventDefault(), e.stopPropagation(),
|
|
4260
|
+
e.preventDefault(), e.stopPropagation(), N((e) => (e + n + t) % t);
|
|
4226
4261
|
};
|
|
4227
4262
|
switch (e.key) {
|
|
4228
4263
|
case "ArrowRight":
|
|
4229
4264
|
case "ArrowDown": return n(1);
|
|
4230
4265
|
case "ArrowLeft":
|
|
4231
4266
|
case "ArrowUp": return n(-1);
|
|
4232
|
-
case "Home": return e.preventDefault(),
|
|
4233
|
-
case "End": return e.preventDefault(),
|
|
4267
|
+
case "Home": return e.preventDefault(), N(0);
|
|
4268
|
+
case "End": return e.preventDefault(), N(t - 1);
|
|
4234
4269
|
default: return;
|
|
4235
4270
|
}
|
|
4236
|
-
},
|
|
4237
|
-
if (e.target !== e.currentTarget && e.key !== "Escape" ||
|
|
4271
|
+
}, V = (e) => {
|
|
4272
|
+
if (e.target !== e.currentTarget && e.key !== "Escape" || fe.length === 0) return;
|
|
4238
4273
|
let t = (t, n) => {
|
|
4239
4274
|
e.preventDefault();
|
|
4240
|
-
let r =
|
|
4241
|
-
|
|
4275
|
+
let r = pe === null ? -1 : fe.indexOf(pe), i = r === -1 ? fe[t === 1 ? 0 : fe.length - 1] : fe[Math.min(fe.length - 1, Math.max(0, r + t))];
|
|
4276
|
+
me(i), (!n || he === null) && ge(i);
|
|
4242
4277
|
}, n = (t) => {
|
|
4243
|
-
e.preventDefault(),
|
|
4278
|
+
e.preventDefault(), me(t), (!e.shiftKey || he === null) && ge(t);
|
|
4244
4279
|
};
|
|
4245
4280
|
switch (e.key) {
|
|
4246
4281
|
case "ArrowRight": return t(1, e.shiftKey);
|
|
4247
4282
|
case "ArrowLeft": return t(-1, e.shiftKey);
|
|
4248
|
-
case "Home": return n(
|
|
4249
|
-
case "End": return n(
|
|
4283
|
+
case "Home": return n(fe[0]);
|
|
4284
|
+
case "End": return n(fe[fe.length - 1]);
|
|
4250
4285
|
case "Enter":
|
|
4251
|
-
case " ": return
|
|
4252
|
-
case "Escape": return !A &&
|
|
4286
|
+
case " ": return ve ? (e.preventDefault(), be()) : void 0;
|
|
4287
|
+
case "Escape": return !A && pe === null ? void 0 : (e.preventDefault(), ne("restore"), ye());
|
|
4253
4288
|
default: return;
|
|
4254
4289
|
}
|
|
4255
|
-
},
|
|
4290
|
+
}, we = (e, t, n) => {
|
|
4256
4291
|
let r = document.elementFromPoint(e, t);
|
|
4257
4292
|
if (r && r.hasAttribute("data-index")) {
|
|
4258
4293
|
let e = parseInt(r.getAttribute("data-index"), 10);
|
|
4259
4294
|
n.add(e);
|
|
4260
4295
|
}
|
|
4261
|
-
},
|
|
4296
|
+
}, Te = (e) => {
|
|
4262
4297
|
if (A) {
|
|
4263
|
-
|
|
4298
|
+
ne();
|
|
4264
4299
|
return;
|
|
4265
4300
|
}
|
|
4266
4301
|
if (i === "precise" || e.button !== 0 && e.pointerType === "mouse") return;
|
|
4267
4302
|
e.preventDefault(), k(!0);
|
|
4268
4303
|
let t = e.currentTarget;
|
|
4269
4304
|
t.setPointerCapture(e.pointerId);
|
|
4270
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a *
|
|
4305
|
+
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a * Tr, s = {
|
|
4271
4306
|
id: Date.now().toString(),
|
|
4272
4307
|
points: [{
|
|
4273
4308
|
x: o,
|
|
@@ -4275,14 +4310,14 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4275
4310
|
}],
|
|
4276
4311
|
highlightedIndices: /* @__PURE__ */ new Set()
|
|
4277
4312
|
};
|
|
4278
|
-
D(s),
|
|
4279
|
-
},
|
|
4313
|
+
D(s), ne(), we(e.clientX, e.clientY, s.highlightedIndices);
|
|
4314
|
+
}, Ee = (e) => {
|
|
4280
4315
|
if (i === "precise" || !E) return;
|
|
4281
|
-
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r *
|
|
4316
|
+
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r * Tr;
|
|
4282
4317
|
D((t) => {
|
|
4283
4318
|
if (!t) return t;
|
|
4284
4319
|
let n = new Set(t.highlightedIndices);
|
|
4285
|
-
return
|
|
4320
|
+
return we(e.clientX, e.clientY, n), {
|
|
4286
4321
|
...t,
|
|
4287
4322
|
points: [...t.points, {
|
|
4288
4323
|
x: a,
|
|
@@ -4291,28 +4326,28 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4291
4326
|
highlightedIndices: n
|
|
4292
4327
|
};
|
|
4293
4328
|
});
|
|
4294
|
-
},
|
|
4329
|
+
}, De = (e) => {
|
|
4295
4330
|
if (i !== "precise" && (k(!1), E)) {
|
|
4296
4331
|
if (e.currentTarget.releasePointerCapture(e.pointerId), S((e) => [...e, E]), E.highlightedIndices.size > 0) {
|
|
4297
|
-
let e =
|
|
4298
|
-
|
|
4332
|
+
let e = Dr(E.points);
|
|
4333
|
+
te({
|
|
4299
4334
|
x: e.x,
|
|
4300
4335
|
y: e.y,
|
|
4301
4336
|
pathId: E.id,
|
|
4302
4337
|
kind: "path"
|
|
4303
4338
|
});
|
|
4304
4339
|
}
|
|
4305
|
-
a && E.highlightedIndices.size > 0 && a(
|
|
4340
|
+
a && E.highlightedIndices.size > 0 && a(kr(E.highlightedIndices, z)), D(null);
|
|
4306
4341
|
}
|
|
4307
|
-
},
|
|
4342
|
+
}, Oe = (e) => {
|
|
4308
4343
|
i !== "precise" && (k(!1), E && (e.currentTarget.releasePointerCapture(e.pointerId), D(null)));
|
|
4309
|
-
},
|
|
4344
|
+
}, ke = (e) => {
|
|
4310
4345
|
let t = b.find((t) => t.id === e);
|
|
4311
|
-
return t ?
|
|
4312
|
-
},
|
|
4346
|
+
return t ? kr(t.highlightedIndices, z) : "";
|
|
4347
|
+
}, je = (e) => {
|
|
4313
4348
|
let t = A?.viaKeyboard;
|
|
4314
|
-
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)),
|
|
4315
|
-
},
|
|
4349
|
+
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)), ne(t ? "container" : "none");
|
|
4350
|
+
}, Me = () => {
|
|
4316
4351
|
let e = A?.viaKeyboard;
|
|
4317
4352
|
if (A && s) {
|
|
4318
4353
|
if (A.kind === "selection") {
|
|
@@ -4326,36 +4361,36 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4326
4361
|
s(e.text, c);
|
|
4327
4362
|
}
|
|
4328
4363
|
} else {
|
|
4329
|
-
let e =
|
|
4364
|
+
let e = ke(A.pathId), t = document.getElementById(`highlight-path-${A.pathId}`);
|
|
4330
4365
|
t && s(e, t.getBoundingClientRect());
|
|
4331
4366
|
}
|
|
4332
4367
|
}
|
|
4333
|
-
|
|
4368
|
+
ne(e ? "restore" : "none");
|
|
4334
4369
|
}, Ne = (e) => {
|
|
4335
|
-
let t =
|
|
4370
|
+
let t = z[e];
|
|
4336
4371
|
if (!r) return t;
|
|
4337
4372
|
let n = !1;
|
|
4338
4373
|
A && (n = (A.kind === "path" ? b.find((e) => e.id === A.pathId) : w.find((e) => e.id === A.pathId))?.highlightedIndices?.has(e) ?? !1);
|
|
4339
4374
|
let i = !1;
|
|
4340
|
-
return
|
|
4375
|
+
return F && (i = (b.find((e) => e.id === F) ?? w.find((e) => e.id === F))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
|
|
4341
4376
|
"data-index": e,
|
|
4342
|
-
className:
|
|
4377
|
+
className: Cr.token,
|
|
4343
4378
|
"data-space": !t.trim() || void 0,
|
|
4344
4379
|
"data-active": n || void 0,
|
|
4345
4380
|
"data-pressed": i || void 0,
|
|
4346
|
-
"data-kbd-cursor":
|
|
4347
|
-
"data-kbd-selected":
|
|
4381
|
+
"data-kbd-cursor": pe === e || void 0,
|
|
4382
|
+
"data-kbd-selected": ve && e >= ve.from && e <= ve.to || void 0,
|
|
4348
4383
|
children: t
|
|
4349
4384
|
}, e);
|
|
4350
4385
|
}, Pe = (e) => e.map((e, t) => {
|
|
4351
4386
|
if (e.type === "token") return Ne(e.index);
|
|
4352
|
-
if (e.type === "code") return /* @__PURE__ */ _(
|
|
4387
|
+
if (e.type === "code") return /* @__PURE__ */ _(nn, {
|
|
4353
4388
|
code: e.value,
|
|
4354
4389
|
lang: e.lang
|
|
4355
4390
|
}, `c${t}`);
|
|
4356
4391
|
if (e.type === "el" && e.tag === "cite") {
|
|
4357
4392
|
let n = Number(e.props?.index ?? 0);
|
|
4358
|
-
return /* @__PURE__ */ _(
|
|
4393
|
+
return /* @__PURE__ */ _(Sr, {
|
|
4359
4394
|
index: n,
|
|
4360
4395
|
source: u?.[n - 1],
|
|
4361
4396
|
onSelect: d ? (e, t) => d(e, t) : void 0
|
|
@@ -4383,84 +4418,84 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4383
4418
|
},
|
|
4384
4419
|
"data-drawing": O || void 0,
|
|
4385
4420
|
"data-menu": !!A || void 0,
|
|
4386
|
-
className:
|
|
4421
|
+
className: Cr.surface,
|
|
4387
4422
|
...r ? {
|
|
4388
|
-
onPointerDown:
|
|
4389
|
-
onPointerMove:
|
|
4390
|
-
onPointerUp:
|
|
4391
|
-
onPointerCancel:
|
|
4423
|
+
onPointerDown: Te,
|
|
4424
|
+
onPointerMove: Ee,
|
|
4425
|
+
onPointerUp: De,
|
|
4426
|
+
onPointerCancel: Oe,
|
|
4392
4427
|
tabIndex: 0,
|
|
4393
|
-
onKeyDown:
|
|
4394
|
-
onBlur:
|
|
4395
|
-
"aria-describedby":
|
|
4428
|
+
onKeyDown: V,
|
|
4429
|
+
onBlur: ye,
|
|
4430
|
+
"aria-describedby": _e
|
|
4396
4431
|
} : null,
|
|
4397
4432
|
children: [
|
|
4398
4433
|
r && /* @__PURE__ */ _("span", {
|
|
4399
|
-
id:
|
|
4400
|
-
className:
|
|
4434
|
+
id: _e,
|
|
4435
|
+
className: Cr.srOnly,
|
|
4401
4436
|
"aria-hidden": "true",
|
|
4402
4437
|
children: h.keyboardHint
|
|
4403
4438
|
}),
|
|
4404
|
-
r && /* @__PURE__ */ _("div", { className:
|
|
4439
|
+
r && /* @__PURE__ */ _("div", { className: Cr.hitbox }),
|
|
4405
4440
|
/* @__PURE__ */ _("div", {
|
|
4406
|
-
className:
|
|
4441
|
+
className: Cr.tokens,
|
|
4407
4442
|
"data-focus": !!A || void 0,
|
|
4408
|
-
children: Pe(
|
|
4443
|
+
children: Pe(re.nodes)
|
|
4409
4444
|
}),
|
|
4410
4445
|
r && /* @__PURE__ */ _("svg", {
|
|
4411
|
-
className:
|
|
4446
|
+
className: Cr.canvas,
|
|
4412
4447
|
children: /* @__PURE__ */ v("g", {
|
|
4413
|
-
transform: `skewX(${
|
|
4414
|
-
children: [
|
|
4448
|
+
transform: `skewX(${wr})`,
|
|
4449
|
+
children: [ce.map((t) => /* @__PURE__ */ v(e.Fragment, { children: [/* @__PURE__ */ _("path", {
|
|
4415
4450
|
id: `highlight-${t.kind}-${t.id}`,
|
|
4416
|
-
className:
|
|
4451
|
+
className: Cr.marker,
|
|
4417
4452
|
d: t.d,
|
|
4418
4453
|
"data-cursor": "pointer",
|
|
4419
|
-
"data-pressed":
|
|
4420
|
-
"data-active": A?.pathId === t.id ||
|
|
4454
|
+
"data-pressed": F === t.id || void 0,
|
|
4455
|
+
"data-active": A?.pathId === t.id || L === t.id || void 0,
|
|
4421
4456
|
"data-dimmed": A && A.pathId !== t.id || void 0,
|
|
4422
4457
|
style: { pointerEvents: O ? "none" : "stroke" },
|
|
4423
4458
|
onPointerDown: (e) => {
|
|
4424
|
-
O || (e.stopPropagation(),
|
|
4459
|
+
O || (e.stopPropagation(), I(t.id));
|
|
4425
4460
|
},
|
|
4426
4461
|
onPointerUp: (e) => {
|
|
4427
|
-
|
|
4462
|
+
F === t.id && (e.stopPropagation(), le(t), I(null));
|
|
4428
4463
|
},
|
|
4429
|
-
onPointerLeave: () =>
|
|
4430
|
-
onPointerCancel: () =>
|
|
4464
|
+
onPointerLeave: () => I(null),
|
|
4465
|
+
onPointerCancel: () => I(null)
|
|
4431
4466
|
}), /* @__PURE__ */ _("path", {
|
|
4432
|
-
className:
|
|
4467
|
+
className: Cr.shimmer,
|
|
4433
4468
|
d: t.d,
|
|
4434
4469
|
pathLength: 1,
|
|
4435
|
-
"data-active": A?.pathId === t.id ||
|
|
4470
|
+
"data-active": A?.pathId === t.id || L === t.id || void 0
|
|
4436
4471
|
})] }, t.id)), E && /* @__PURE__ */ _("path", {
|
|
4437
|
-
className:
|
|
4438
|
-
d:
|
|
4472
|
+
className: Cr.marker,
|
|
4473
|
+
d: Er(E.points)
|
|
4439
4474
|
})]
|
|
4440
4475
|
})
|
|
4441
4476
|
}),
|
|
4442
|
-
r &&
|
|
4477
|
+
r && ce.length > 0 && /* @__PURE__ */ _("div", {
|
|
4443
4478
|
role: "group",
|
|
4444
|
-
"aria-label":
|
|
4445
|
-
children:
|
|
4479
|
+
"aria-label": Ae(ce.length === 1 ? h.countOne : h.countMany, { count: ce.length }),
|
|
4480
|
+
children: ce.map((e) => /* @__PURE__ */ _("button", {
|
|
4446
4481
|
type: "button",
|
|
4447
|
-
className:
|
|
4482
|
+
className: Cr.srOnly,
|
|
4448
4483
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4449
|
-
onFocus: () =>
|
|
4450
|
-
onBlur: () =>
|
|
4484
|
+
onFocus: () => R(e.id),
|
|
4485
|
+
onBlur: () => R(null),
|
|
4451
4486
|
onClick: (t) => {
|
|
4452
|
-
t.stopPropagation(),
|
|
4487
|
+
t.stopPropagation(), le(e, !0);
|
|
4453
4488
|
},
|
|
4454
|
-
children: `${h.highlight} ${
|
|
4489
|
+
children: `${h.highlight} ${Ar(e.text)}`
|
|
4455
4490
|
}, e.id))
|
|
4456
4491
|
}),
|
|
4457
4492
|
/* @__PURE__ */ _(y, { children: r && A && /* @__PURE__ */ v(C.div, {
|
|
4458
|
-
ref:
|
|
4493
|
+
ref: ee,
|
|
4459
4494
|
role: "menu",
|
|
4460
4495
|
"aria-label": h.menu,
|
|
4461
|
-
onKeyDown:
|
|
4496
|
+
onKeyDown: Ce,
|
|
4462
4497
|
onBlur: (e) => {
|
|
4463
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
4498
|
+
e.currentTarget.contains(e.relatedTarget) || ne();
|
|
4464
4499
|
},
|
|
4465
4500
|
initial: { opacity: 0 },
|
|
4466
4501
|
animate: {
|
|
@@ -4474,7 +4509,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4474
4509
|
staggerDirection: -1
|
|
4475
4510
|
}
|
|
4476
4511
|
},
|
|
4477
|
-
className:
|
|
4512
|
+
className: Cr.menu,
|
|
4478
4513
|
style: {
|
|
4479
4514
|
left: A.x,
|
|
4480
4515
|
top: A.y
|
|
@@ -4501,13 +4536,13 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4501
4536
|
scale: .9,
|
|
4502
4537
|
transition: { duration: .1 }
|
|
4503
4538
|
},
|
|
4504
|
-
children: /* @__PURE__ */ _(
|
|
4539
|
+
children: /* @__PURE__ */ _(H, {
|
|
4505
4540
|
variant: "primary",
|
|
4506
4541
|
role: "menuitem",
|
|
4507
4542
|
tabIndex: M === 0 ? 0 : -1,
|
|
4508
|
-
icon: /* @__PURE__ */ _(
|
|
4543
|
+
icon: /* @__PURE__ */ _(ie, { size: 14 }),
|
|
4509
4544
|
onClick: (e) => {
|
|
4510
|
-
e.stopPropagation(),
|
|
4545
|
+
e.stopPropagation(), Me();
|
|
4511
4546
|
},
|
|
4512
4547
|
title: h.reply,
|
|
4513
4548
|
children: h.reply
|
|
@@ -4533,13 +4568,13 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4533
4568
|
scale: .9,
|
|
4534
4569
|
transition: { duration: .1 }
|
|
4535
4570
|
},
|
|
4536
|
-
children: /* @__PURE__ */ _(
|
|
4571
|
+
children: /* @__PURE__ */ _(H, {
|
|
4537
4572
|
variant: "primary",
|
|
4538
4573
|
role: "menuitem",
|
|
4539
4574
|
tabIndex: M === 1 ? 0 : -1,
|
|
4540
|
-
icon: /* @__PURE__ */ _(
|
|
4575
|
+
icon: /* @__PURE__ */ _(xe, { size: 14 }),
|
|
4541
4576
|
onClick: (e) => {
|
|
4542
|
-
e.stopPropagation(),
|
|
4577
|
+
e.stopPropagation(), je(A.pathId);
|
|
4543
4578
|
},
|
|
4544
4579
|
title: h.remove,
|
|
4545
4580
|
"aria-label": h.remove
|
|
@@ -4550,16 +4585,16 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4550
4585
|
})
|
|
4551
4586
|
});
|
|
4552
4587
|
}
|
|
4553
|
-
var
|
|
4588
|
+
var Nr = {
|
|
4554
4589
|
turn: "ick-turn-R-WW",
|
|
4555
4590
|
question: "ick-question-Fhqf",
|
|
4556
4591
|
body: "ick-body-wvid",
|
|
4557
4592
|
custom: "ick-custom-s7j-",
|
|
4558
4593
|
answer: "ick-answer-pZAi",
|
|
4559
4594
|
actions: "ick-actions-CWq8"
|
|
4560
|
-
},
|
|
4595
|
+
}, Pr = (e) => {
|
|
4561
4596
|
navigator.clipboard?.writeText(e);
|
|
4562
|
-
},
|
|
4597
|
+
}, Fr = (e, t) => {
|
|
4563
4598
|
let n = t.map((t, n) => ({
|
|
4564
4599
|
part: t,
|
|
4565
4600
|
order: n,
|
|
@@ -4577,14 +4612,16 @@ var jr = {
|
|
|
4577
4612
|
part: e
|
|
4578
4613
|
});
|
|
4579
4614
|
return i < e.length && a(e.length), r;
|
|
4580
|
-
},
|
|
4581
|
-
let
|
|
4582
|
-
className:
|
|
4583
|
-
|
|
4615
|
+
}, Ir = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: o = null, onOpenArtifact: s, onArtifactChange: c, entranceDelay: l = 0, selectionMode: u = "marker", highlights: d = !0, questionAlign: f = "end", onDraft: p, onSubmit: m, onStop: h, busy: g, onEdit: y, onCancelEdit: b, onCopy: x = Pr, onHighlight: S, onReplyInThread: w, onRegenerate: T, onShowVersion: E, onFeedback: D, feedback: O = null, answerActions: k = !0, onAnswerQuestion: A, onEditQuestion: j, onDecideApproval: M, renderPart: N, composerMenu: ee, labels: P, className: F, onTranscribe: I }) {
|
|
4616
|
+
let L = q(), R = L ? 0 : -16, te = e.parts ?? [], ne = te.find((e) => e.kind === "sources")?.sources, re = Fr(e.ai, te), z = k && (e.state === "resting" || e.state === "responding") && re.length > 0, ie = z && e.state === "resting", ae = z ? re[re.length - 1].kind === "prose" ? re.length - 1 : re.length : -1, oe = z ? /* @__PURE__ */ v("div", {
|
|
4617
|
+
className: Nr.actions,
|
|
4618
|
+
"data-pending": ie ? void 0 : "",
|
|
4619
|
+
style: ie ? void 0 : { visibility: "hidden" },
|
|
4620
|
+
children: [/* @__PURE__ */ _(jt, {
|
|
4584
4621
|
total: e.versions?.length ?? 0,
|
|
4585
4622
|
index: e.versionIndex ?? 0,
|
|
4586
4623
|
onSelect: (t) => E?.(e.id, t)
|
|
4587
|
-
}), /* @__PURE__ */ _(
|
|
4624
|
+
}), /* @__PURE__ */ _(kt, {
|
|
4588
4625
|
text: e.ai,
|
|
4589
4626
|
onCopy: x,
|
|
4590
4627
|
onRegenerate: T ? () => T(e.id) : void 0,
|
|
@@ -4593,12 +4630,12 @@ var jr = {
|
|
|
4593
4630
|
})]
|
|
4594
4631
|
}) : null, se = (t) => {
|
|
4595
4632
|
switch (t.kind) {
|
|
4596
|
-
case "reasoning": return /* @__PURE__ */ _(
|
|
4633
|
+
case "reasoning": return /* @__PURE__ */ _(Ht, {
|
|
4597
4634
|
state: t.state,
|
|
4598
4635
|
duration: t.duration,
|
|
4599
4636
|
children: t.text ?? ""
|
|
4600
4637
|
}, t.id);
|
|
4601
|
-
case "tool": return /* @__PURE__ */ _(
|
|
4638
|
+
case "tool": return /* @__PURE__ */ _(ln, {
|
|
4602
4639
|
name: t.name ?? "",
|
|
4603
4640
|
state: t.state,
|
|
4604
4641
|
summary: t.summary,
|
|
@@ -4607,35 +4644,35 @@ var jr = {
|
|
|
4607
4644
|
error: t.error,
|
|
4608
4645
|
duration: t.duration
|
|
4609
4646
|
}, t.id);
|
|
4610
|
-
case "tasks": return /* @__PURE__ */ _(
|
|
4647
|
+
case "tasks": return /* @__PURE__ */ _(hn, {
|
|
4611
4648
|
title: t.title,
|
|
4612
4649
|
tasks: t.tasks ?? [],
|
|
4613
4650
|
collapsible: t.collapsible
|
|
4614
4651
|
}, t.id);
|
|
4615
|
-
case "chain": return /* @__PURE__ */ _(
|
|
4652
|
+
case "chain": return /* @__PURE__ */ _(_n, {
|
|
4616
4653
|
steps: t.steps ?? [],
|
|
4617
4654
|
state: t.state,
|
|
4618
4655
|
duration: t.duration
|
|
4619
4656
|
}, t.id);
|
|
4620
|
-
case "sources": return /* @__PURE__ */ _(
|
|
4657
|
+
case "sources": return /* @__PURE__ */ _(yn, {
|
|
4621
4658
|
sources: t.sources ?? [],
|
|
4622
4659
|
title: t.title,
|
|
4623
4660
|
collapsible: t.collapsible
|
|
4624
4661
|
}, t.id);
|
|
4625
|
-
case "approval": return /* @__PURE__ */ _(
|
|
4662
|
+
case "approval": return /* @__PURE__ */ _(pn, {
|
|
4626
4663
|
title: t.title,
|
|
4627
4664
|
description: t.description,
|
|
4628
4665
|
decision: t.decision ?? null,
|
|
4629
4666
|
choices: t.choices,
|
|
4630
4667
|
onDecide: (n) => M?.(e.id, t.id, n),
|
|
4631
|
-
children: t.tool && /* @__PURE__ */ _(
|
|
4668
|
+
children: t.tool && /* @__PURE__ */ _(ln, {
|
|
4632
4669
|
name: t.tool.name,
|
|
4633
4670
|
state: "pending",
|
|
4634
4671
|
input: t.tool.input,
|
|
4635
4672
|
defaultOpen: !0
|
|
4636
4673
|
})
|
|
4637
4674
|
}, t.id);
|
|
4638
|
-
case "artifact": return /* @__PURE__ */ _(
|
|
4675
|
+
case "artifact": return /* @__PURE__ */ _(Wn, {
|
|
4639
4676
|
id: t.id,
|
|
4640
4677
|
title: t.title,
|
|
4641
4678
|
meta: t.meta,
|
|
@@ -4646,11 +4683,11 @@ var jr = {
|
|
|
4646
4683
|
open: o === t.id,
|
|
4647
4684
|
onOpen: s ? (t) => s(e.id, t) : void 0
|
|
4648
4685
|
}, t.id);
|
|
4649
|
-
case "notice": return /* @__PURE__ */ _(
|
|
4686
|
+
case "notice": return /* @__PURE__ */ _(Bn, {
|
|
4650
4687
|
tone: t.tone,
|
|
4651
4688
|
children: t.text
|
|
4652
4689
|
}, t.id);
|
|
4653
|
-
case "question": return /* @__PURE__ */ _(
|
|
4690
|
+
case "question": return /* @__PURE__ */ _(Rn, {
|
|
4654
4691
|
id: t.id,
|
|
4655
4692
|
title: t.title,
|
|
4656
4693
|
questions: t.questions ?? [],
|
|
@@ -4663,13 +4700,13 @@ var jr = {
|
|
|
4663
4700
|
onEdit: (n) => j?.(e.id, t.id, n)
|
|
4664
4701
|
}, t.id);
|
|
4665
4702
|
case "custom": {
|
|
4666
|
-
let n =
|
|
4703
|
+
let n = N?.(t, {
|
|
4667
4704
|
turnId: e.id,
|
|
4668
4705
|
openArtifact: (t) => c ? c(t) : s?.(e.id, t),
|
|
4669
4706
|
closeArtifact: () => c?.(null)
|
|
4670
4707
|
});
|
|
4671
4708
|
return n == null || n === !1 ? null : /* @__PURE__ */ _("div", {
|
|
4672
|
-
className:
|
|
4709
|
+
className: Nr.custom,
|
|
4673
4710
|
"data-part": "custom",
|
|
4674
4711
|
"data-part-type": t.type,
|
|
4675
4712
|
children: n
|
|
@@ -4678,12 +4715,12 @@ var jr = {
|
|
|
4678
4715
|
}
|
|
4679
4716
|
}, ce = /* @__PURE__ */ v(C.article, {
|
|
4680
4717
|
id: `turn-${e.id}`,
|
|
4681
|
-
className: [
|
|
4718
|
+
className: [Nr.turn, F ?? ""].filter(Boolean).join(" "),
|
|
4682
4719
|
"data-active-input": t || void 0,
|
|
4683
4720
|
"aria-busy": e.state === "responding" || void 0,
|
|
4684
4721
|
initial: {
|
|
4685
4722
|
opacity: 0,
|
|
4686
|
-
y:
|
|
4723
|
+
y: R
|
|
4687
4724
|
},
|
|
4688
4725
|
animate: {
|
|
4689
4726
|
opacity: 1,
|
|
@@ -4691,10 +4728,10 @@ var jr = {
|
|
|
4691
4728
|
},
|
|
4692
4729
|
exit: {
|
|
4693
4730
|
opacity: 0,
|
|
4694
|
-
y:
|
|
4731
|
+
y: R
|
|
4695
4732
|
},
|
|
4696
4733
|
transition: {
|
|
4697
|
-
duration:
|
|
4734
|
+
duration: L ? .15 : .4,
|
|
4698
4735
|
ease: [
|
|
4699
4736
|
.22,
|
|
4700
4737
|
1,
|
|
@@ -4704,9 +4741,9 @@ var jr = {
|
|
|
4704
4741
|
delay: l
|
|
4705
4742
|
},
|
|
4706
4743
|
children: [/* @__PURE__ */ _("div", {
|
|
4707
|
-
className:
|
|
4744
|
+
className: Nr.question,
|
|
4708
4745
|
"data-align": f,
|
|
4709
|
-
children: /* @__PURE__ */ _(
|
|
4746
|
+
children: /* @__PURE__ */ _(st, {
|
|
4710
4747
|
ref: n,
|
|
4711
4748
|
style: f === "stretch" ? { width: "100%" } : void 0,
|
|
4712
4749
|
state: e.state,
|
|
@@ -4716,43 +4753,43 @@ var jr = {
|
|
|
4716
4753
|
attachments: e.attachments,
|
|
4717
4754
|
onStop: h,
|
|
4718
4755
|
busy: g,
|
|
4719
|
-
onTranscribe:
|
|
4756
|
+
onTranscribe: I,
|
|
4720
4757
|
onCopy: x,
|
|
4721
4758
|
onEdit: () => y?.(e.id),
|
|
4722
4759
|
onCancelEdit: () => b?.(e.id),
|
|
4723
4760
|
isEditing: e.ai.length > 0 && e.state === "typing",
|
|
4724
4761
|
animationConfig: i,
|
|
4725
4762
|
placeholder: r,
|
|
4726
|
-
menu:
|
|
4763
|
+
menu: ee
|
|
4727
4764
|
})
|
|
4728
4765
|
}), /* @__PURE__ */ v("div", {
|
|
4729
|
-
className:
|
|
4766
|
+
className: Nr.body,
|
|
4730
4767
|
children: [
|
|
4731
|
-
|
|
4732
|
-
className:
|
|
4733
|
-
children: [/* @__PURE__ */ _(
|
|
4768
|
+
re.map((t, n) => t.kind === "part" ? se(t.part) : /* @__PURE__ */ v("div", {
|
|
4769
|
+
className: Nr.answer,
|
|
4770
|
+
children: [/* @__PURE__ */ _(Mr, {
|
|
4734
4771
|
text: t.text,
|
|
4735
4772
|
marking: d,
|
|
4736
4773
|
selectionMode: u,
|
|
4737
|
-
sources:
|
|
4774
|
+
sources: ne,
|
|
4738
4775
|
onHighlightComplete: d ? (t) => S?.(e.id, t) : void 0,
|
|
4739
4776
|
onReplyInThread: d ? w : void 0
|
|
4740
4777
|
}), ae === n && oe]
|
|
4741
4778
|
}, `prose-${t.from}`)),
|
|
4742
|
-
e.state === "responding" && !e.ai &&
|
|
4743
|
-
className:
|
|
4744
|
-
children: /* @__PURE__ */ _(
|
|
4779
|
+
e.state === "responding" && !e.ai && te.length === 0 && /* @__PURE__ */ _("div", {
|
|
4780
|
+
className: Nr.answer,
|
|
4781
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
4745
4782
|
}),
|
|
4746
|
-
ae ===
|
|
4747
|
-
className:
|
|
4783
|
+
ae === re.length && /* @__PURE__ */ _("div", {
|
|
4784
|
+
className: Nr.answer,
|
|
4748
4785
|
"data-actions-only": "",
|
|
4749
4786
|
children: oe
|
|
4750
4787
|
})
|
|
4751
4788
|
]
|
|
4752
4789
|
})]
|
|
4753
4790
|
});
|
|
4754
|
-
return
|
|
4755
|
-
labels:
|
|
4791
|
+
return P ? /* @__PURE__ */ _(ke, {
|
|
4792
|
+
labels: P,
|
|
4756
4793
|
children: ce
|
|
4757
4794
|
}) : ce;
|
|
4758
4795
|
}, (e, t) => {
|
|
@@ -4766,7 +4803,7 @@ var jr = {
|
|
|
4766
4803
|
if (!Object.is(e[r], t[r])) return !1;
|
|
4767
4804
|
}
|
|
4768
4805
|
return !0;
|
|
4769
|
-
}),
|
|
4806
|
+
}), Lr = {
|
|
4770
4807
|
context: "ick-context-ZOiv",
|
|
4771
4808
|
ring: "ick-ring-uVUc",
|
|
4772
4809
|
track: "ick-track---kg",
|
|
@@ -4775,7 +4812,7 @@ var jr = {
|
|
|
4775
4812
|
};
|
|
4776
4813
|
//#endregion
|
|
4777
4814
|
//#region src/Context/Context.tsx
|
|
4778
|
-
function
|
|
4815
|
+
function Rr(e) {
|
|
4779
4816
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
4780
4817
|
if (e >= 1e6) {
|
|
4781
4818
|
let t = e / 1e6;
|
|
@@ -4787,11 +4824,11 @@ function Ir(e) {
|
|
|
4787
4824
|
}
|
|
4788
4825
|
return String(Math.round(e));
|
|
4789
4826
|
}
|
|
4790
|
-
var
|
|
4791
|
-
function
|
|
4792
|
-
let s =
|
|
4827
|
+
var zr = 6, Br = 2 * Math.PI * zr;
|
|
4828
|
+
function Vr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className: a, ...o }) {
|
|
4829
|
+
let s = U("context", i), c = t > 0 ? Math.min(1, Math.max(0, e / t)) : 0, l = Math.round(c * 100), u = c >= n, d = r === !1 ? null : r ?? `${l}%`, f = `${s.name}: ${l}%, ${Rr(e)} ${s.of} ${Rr(t)} ${s.tokens}${u ? `. ${s.nearlyFull}` : ""}`;
|
|
4793
4830
|
return /* @__PURE__ */ v("div", {
|
|
4794
|
-
className: [
|
|
4831
|
+
className: [Lr.context, a ?? ""].filter(Boolean).join(" "),
|
|
4795
4832
|
"data-warn": u || void 0,
|
|
4796
4833
|
role: "meter",
|
|
4797
4834
|
"aria-valuenow": l,
|
|
@@ -4801,31 +4838,31 @@ function zr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className:
|
|
|
4801
4838
|
title: f,
|
|
4802
4839
|
...o,
|
|
4803
4840
|
children: [/* @__PURE__ */ v("svg", {
|
|
4804
|
-
className:
|
|
4841
|
+
className: Lr.ring,
|
|
4805
4842
|
viewBox: "0 0 16 16",
|
|
4806
4843
|
"aria-hidden": !0,
|
|
4807
4844
|
focusable: "false",
|
|
4808
4845
|
children: [/* @__PURE__ */ _("circle", {
|
|
4809
|
-
className:
|
|
4846
|
+
className: Lr.track,
|
|
4810
4847
|
cx: "8",
|
|
4811
4848
|
cy: "8",
|
|
4812
|
-
r:
|
|
4849
|
+
r: zr
|
|
4813
4850
|
}), /* @__PURE__ */ _("circle", {
|
|
4814
|
-
className:
|
|
4851
|
+
className: Lr.fill,
|
|
4815
4852
|
cx: "8",
|
|
4816
4853
|
cy: "8",
|
|
4817
|
-
r:
|
|
4818
|
-
strokeDasharray:
|
|
4819
|
-
strokeDashoffset:
|
|
4854
|
+
r: zr,
|
|
4855
|
+
strokeDasharray: Br,
|
|
4856
|
+
strokeDashoffset: Br * (1 - c),
|
|
4820
4857
|
transform: "rotate(-90 8 8)"
|
|
4821
4858
|
})]
|
|
4822
4859
|
}), d !== null && /* @__PURE__ */ _("span", {
|
|
4823
|
-
className:
|
|
4860
|
+
className: Lr.label,
|
|
4824
4861
|
children: d
|
|
4825
4862
|
})]
|
|
4826
4863
|
});
|
|
4827
4864
|
}
|
|
4828
|
-
var
|
|
4865
|
+
var Hr = {
|
|
4829
4866
|
pane: "ick-pane-Yv8Y",
|
|
4830
4867
|
grabber: "ick-grabber-OhMd",
|
|
4831
4868
|
head: "ick-head-p2-j",
|
|
@@ -4839,8 +4876,8 @@ var Br = {
|
|
|
4839
4876
|
};
|
|
4840
4877
|
//#endregion
|
|
4841
4878
|
//#region src/Artifact/ArtifactPane.tsx
|
|
4842
|
-
function
|
|
4843
|
-
let h =
|
|
4879
|
+
function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expanded: a = !1, onToggleExpanded: o, closeLabel: s, expandLabel: u, collapseLabel: d, className: f, ...m }) {
|
|
4880
|
+
let h = U("pane"), g = s ?? h.close, y = u ?? h.expand, b = d ?? h.collapse, x = l(), S = p(null), C = p(null);
|
|
4844
4881
|
return c(() => {
|
|
4845
4882
|
C.current?.focus({ preventScroll: !0 });
|
|
4846
4883
|
}, []), c(() => {
|
|
@@ -4858,36 +4895,36 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4858
4895
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
4859
4896
|
}, [i]), /* @__PURE__ */ v("div", {
|
|
4860
4897
|
ref: S,
|
|
4861
|
-
className: [
|
|
4898
|
+
className: [Hr.pane, f ?? ""].filter(Boolean).join(" "),
|
|
4862
4899
|
"aria-labelledby": x,
|
|
4863
4900
|
"aria-modal": i || void 0,
|
|
4864
4901
|
role: i ? "dialog" : "complementary",
|
|
4865
4902
|
...m,
|
|
4866
4903
|
children: [
|
|
4867
4904
|
i && /* @__PURE__ */ _("span", {
|
|
4868
|
-
className:
|
|
4905
|
+
className: Hr.grabber,
|
|
4869
4906
|
"aria-hidden": !0
|
|
4870
4907
|
}),
|
|
4871
4908
|
/* @__PURE__ */ v("div", {
|
|
4872
|
-
className:
|
|
4909
|
+
className: Hr.head,
|
|
4873
4910
|
children: [
|
|
4874
4911
|
/* @__PURE__ */ v("div", {
|
|
4875
|
-
className:
|
|
4912
|
+
className: Hr.headText,
|
|
4876
4913
|
children: [/* @__PURE__ */ _("h2", {
|
|
4877
|
-
className:
|
|
4914
|
+
className: Hr.title,
|
|
4878
4915
|
id: x,
|
|
4879
4916
|
ref: C,
|
|
4880
4917
|
tabIndex: -1,
|
|
4881
4918
|
children: e
|
|
4882
4919
|
}), t && /* @__PURE__ */ _("p", {
|
|
4883
|
-
className:
|
|
4920
|
+
className: Hr.meta,
|
|
4884
4921
|
children: t
|
|
4885
4922
|
})]
|
|
4886
4923
|
}),
|
|
4887
|
-
o && !i && /* @__PURE__ */ _(
|
|
4924
|
+
o && !i && /* @__PURE__ */ _(H, {
|
|
4888
4925
|
variant: "ghost",
|
|
4889
4926
|
size: "s",
|
|
4890
|
-
icon: _(a ?
|
|
4927
|
+
icon: _(a ? oe : z, {
|
|
4891
4928
|
size: 15,
|
|
4892
4929
|
"aria-hidden": !0
|
|
4893
4930
|
}),
|
|
@@ -4895,10 +4932,10 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4895
4932
|
"aria-pressed": a,
|
|
4896
4933
|
onClick: o
|
|
4897
4934
|
}),
|
|
4898
|
-
r && /* @__PURE__ */ _(
|
|
4935
|
+
r && /* @__PURE__ */ _(H, {
|
|
4899
4936
|
variant: "ghost",
|
|
4900
4937
|
size: "s",
|
|
4901
|
-
icon: /* @__PURE__ */ _(
|
|
4938
|
+
icon: /* @__PURE__ */ _(Ce, {
|
|
4902
4939
|
size: 15,
|
|
4903
4940
|
"aria-hidden": !0
|
|
4904
4941
|
}),
|
|
@@ -4908,15 +4945,15 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4908
4945
|
]
|
|
4909
4946
|
}),
|
|
4910
4947
|
/* @__PURE__ */ _("div", {
|
|
4911
|
-
className:
|
|
4912
|
-
children: n ?? /* @__PURE__ */ _(
|
|
4948
|
+
className: Hr.body,
|
|
4949
|
+
children: n ?? /* @__PURE__ */ _(Wr, {})
|
|
4913
4950
|
})
|
|
4914
4951
|
]
|
|
4915
4952
|
});
|
|
4916
4953
|
}
|
|
4917
|
-
function
|
|
4954
|
+
function Wr() {
|
|
4918
4955
|
return /* @__PURE__ */ _("div", {
|
|
4919
|
-
className:
|
|
4956
|
+
className: Hr.skeleton,
|
|
4920
4957
|
"aria-hidden": !0,
|
|
4921
4958
|
children: [
|
|
4922
4959
|
68,
|
|
@@ -4927,18 +4964,18 @@ function Hr() {
|
|
|
4927
4964
|
100,
|
|
4928
4965
|
84
|
|
4929
4966
|
].map((e, t) => /* @__PURE__ */ _("span", {
|
|
4930
|
-
className:
|
|
4967
|
+
className: Hr.line,
|
|
4931
4968
|
style: { width: `${e}%` }
|
|
4932
4969
|
}, t))
|
|
4933
4970
|
});
|
|
4934
4971
|
}
|
|
4935
|
-
var
|
|
4972
|
+
var Gr = {
|
|
4936
4973
|
layout: "ick-layout-nC6G",
|
|
4937
4974
|
chat: "ick-chat-OTXm",
|
|
4938
4975
|
card: "ick-card-Iddg",
|
|
4939
4976
|
slot: "ick-slot-O--R",
|
|
4940
4977
|
scrim: "ick-scrim-11Pp"
|
|
4941
|
-
},
|
|
4978
|
+
}, Kr = 760, qr = {
|
|
4942
4979
|
closed: {
|
|
4943
4980
|
width: 0,
|
|
4944
4981
|
transition: {
|
|
@@ -4956,7 +4993,7 @@ var Ur = {
|
|
|
4956
4993
|
bounce: 0
|
|
4957
4994
|
}
|
|
4958
4995
|
}
|
|
4959
|
-
},
|
|
4996
|
+
}, Jr = {
|
|
4960
4997
|
closed: {
|
|
4961
4998
|
opacity: 0,
|
|
4962
4999
|
x: 24,
|
|
@@ -4975,7 +5012,7 @@ var Ur = {
|
|
|
4975
5012
|
delay: .06
|
|
4976
5013
|
}
|
|
4977
5014
|
}
|
|
4978
|
-
},
|
|
5015
|
+
}, Yr = {
|
|
4979
5016
|
closed: {
|
|
4980
5017
|
y: "100%",
|
|
4981
5018
|
transition: {
|
|
@@ -4992,7 +5029,7 @@ var Ur = {
|
|
|
4992
5029
|
bounce: .18
|
|
4993
5030
|
}
|
|
4994
5031
|
}
|
|
4995
|
-
},
|
|
5032
|
+
}, Xr = {
|
|
4996
5033
|
closed: {
|
|
4997
5034
|
opacity: 0,
|
|
4998
5035
|
transition: { duration: .18 }
|
|
@@ -5001,34 +5038,34 @@ var Ur = {
|
|
|
5001
5038
|
opacity: 1,
|
|
5002
5039
|
transition: { duration: .26 }
|
|
5003
5040
|
}
|
|
5004
|
-
},
|
|
5041
|
+
}, Zr = { transition: { duration: 0 } }, Qr = (e) => ({
|
|
5005
5042
|
closed: {
|
|
5006
5043
|
...e.closed,
|
|
5007
|
-
...
|
|
5044
|
+
...Zr
|
|
5008
5045
|
},
|
|
5009
5046
|
open: {
|
|
5010
5047
|
...e.open,
|
|
5011
|
-
...
|
|
5048
|
+
...Zr
|
|
5012
5049
|
}
|
|
5013
5050
|
});
|
|
5014
|
-
function
|
|
5051
|
+
function $r({ children: e, pane: t, onDismiss: n, surface: r = "flush", className: i, ...a }) {
|
|
5015
5052
|
let s = p(null), [l, u] = m(!1), [d, h] = m(!1), g = o(() => h((e) => !e), []), b = E(), [x, S, w] = f(() => {
|
|
5016
|
-
let e = l ?
|
|
5053
|
+
let e = l ? Yr : qr, t = l ? void 0 : Jr;
|
|
5017
5054
|
return b ? [
|
|
5018
|
-
|
|
5019
|
-
t &&
|
|
5020
|
-
Xr
|
|
5055
|
+
Qr(e),
|
|
5056
|
+
t && Qr(t),
|
|
5057
|
+
Qr(Xr)
|
|
5021
5058
|
] : [
|
|
5022
5059
|
e,
|
|
5023
5060
|
t,
|
|
5024
|
-
|
|
5061
|
+
Xr
|
|
5025
5062
|
];
|
|
5026
5063
|
}, [b, l]);
|
|
5027
5064
|
c(() => {
|
|
5028
5065
|
let e = s.current;
|
|
5029
5066
|
if (!e || typeof ResizeObserver > "u") return;
|
|
5030
5067
|
let t = new ResizeObserver(([e]) => {
|
|
5031
|
-
u(e.contentRect.width <=
|
|
5068
|
+
u(e.contentRect.width <= Kr);
|
|
5032
5069
|
});
|
|
5033
5070
|
return t.observe(e), () => t.disconnect();
|
|
5034
5071
|
}, []);
|
|
@@ -5039,17 +5076,17 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5039
5076
|
});
|
|
5040
5077
|
return /* @__PURE__ */ v("div", {
|
|
5041
5078
|
ref: s,
|
|
5042
|
-
className: [
|
|
5079
|
+
className: [Gr.layout, i ?? ""].filter(Boolean).join(" "),
|
|
5043
5080
|
"data-pane": T ? "" : void 0,
|
|
5044
5081
|
"data-surface": r === "panes" ? "panes" : void 0,
|
|
5045
5082
|
...a,
|
|
5046
5083
|
children: [/* @__PURE__ */ _("div", {
|
|
5047
|
-
className:
|
|
5084
|
+
className: Gr.chat,
|
|
5048
5085
|
children: e
|
|
5049
5086
|
}), /* @__PURE__ */ v(y, {
|
|
5050
5087
|
initial: !1,
|
|
5051
5088
|
children: [T && l && n && /* @__PURE__ */ _(C.div, {
|
|
5052
|
-
className:
|
|
5089
|
+
className: Gr.scrim,
|
|
5053
5090
|
variants: w,
|
|
5054
5091
|
initial: "closed",
|
|
5055
5092
|
animate: "open",
|
|
@@ -5057,13 +5094,13 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5057
5094
|
"aria-hidden": !0,
|
|
5058
5095
|
onClick: n
|
|
5059
5096
|
}, "scrim"), T && /* @__PURE__ */ _(C.div, {
|
|
5060
|
-
className:
|
|
5097
|
+
className: Gr.slot,
|
|
5061
5098
|
variants: x,
|
|
5062
5099
|
initial: "closed",
|
|
5063
5100
|
animate: "open",
|
|
5064
5101
|
exit: "closed",
|
|
5065
5102
|
children: /* @__PURE__ */ _(C.div, {
|
|
5066
|
-
className:
|
|
5103
|
+
className: Gr.card,
|
|
5067
5104
|
"data-expanded": d && !l || void 0,
|
|
5068
5105
|
variants: S,
|
|
5069
5106
|
...l && n ? {
|
|
@@ -5089,7 +5126,7 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5089
5126
|
}
|
|
5090
5127
|
//#endregion
|
|
5091
5128
|
//#region src/Artifact/useArtifacts.ts
|
|
5092
|
-
function
|
|
5129
|
+
function ei(e = null) {
|
|
5093
5130
|
let [t, n] = m(e);
|
|
5094
5131
|
return {
|
|
5095
5132
|
openId: t,
|
|
@@ -5098,15 +5135,15 @@ function Qr(e = null) {
|
|
|
5098
5135
|
toggle: o((e) => n((t) => t === e ? null : e), [])
|
|
5099
5136
|
};
|
|
5100
5137
|
}
|
|
5101
|
-
var
|
|
5138
|
+
var ti = {
|
|
5102
5139
|
root: "ick-root-JrOP",
|
|
5103
5140
|
viewport: "ick-viewport-C3hz",
|
|
5104
5141
|
content: "ick-content-33lN",
|
|
5105
5142
|
jump: "ick-jump-nd6O"
|
|
5106
|
-
},
|
|
5143
|
+
}, ni = 64, ri = 500, ii = .2, ai = 120, oi = 50, si = 4, ci = (e, t) => e.offsetTop - t.offsetTop, li = (e, t) => t ? e.querySelector(`[id="${CSS.escape(t)}"]`) : null, ui = (e) => (e.lastElementChild?.offsetHeight ?? 0) + (parseFloat(getComputedStyle(e).rowGap) || 0), di = (e, t, n) => {
|
|
5107
5144
|
n !== t.current && (t.current = n, e.style.setProperty("--ick-conversation-tail", `${Math.round(n)}px`));
|
|
5108
|
-
},
|
|
5109
|
-
let C =
|
|
5145
|
+
}, fi = r(function({ children: e, anchorId: t, anchorOffset: n = 0, endOffset: r = 0, tail: i = "auto", threshold: a = ni, scrollButton: s = !0, scrollButtonLabel: l, follow: f = !0, dock: h = !1, className: g, viewportClassName: y, onScroll: b, ...x }, S) {
|
|
5146
|
+
let C = U("conversation").jump, w = l ?? C, T = p(null);
|
|
5110
5147
|
u(S, () => T.current, []);
|
|
5111
5148
|
let E = p(null), O = p(null), [k, A] = m(!0);
|
|
5112
5149
|
c(() => {
|
|
@@ -5121,98 +5158,140 @@ var $r = {
|
|
|
5121
5158
|
r.disconnect(), t.style.removeProperty("--ick-dock-height");
|
|
5122
5159
|
};
|
|
5123
5160
|
}, [h]);
|
|
5124
|
-
let j = p(-1), M = p(null), ee = p(!1),
|
|
5161
|
+
let j = p(-1), M = p(-1), N = p(null), ee = p(!1), P = o(() => {
|
|
5125
5162
|
let e = T.current, t = E.current;
|
|
5126
5163
|
if (!e || !t) return 0;
|
|
5127
5164
|
if (i === "auto" && ee.current) return Math.max(0, e.scrollHeight - e.clientHeight);
|
|
5128
|
-
let n = h ? null : t.lastElementChild, a = n ?
|
|
5165
|
+
let n = h ? null : t.lastElementChild, a = n ? ci(n, e) + n.offsetHeight : ci(t, e) + t.offsetHeight - (h ? 0 : j.current);
|
|
5129
5166
|
return Math.max(0, a + r - e.clientHeight);
|
|
5130
5167
|
}, [
|
|
5131
5168
|
h,
|
|
5132
5169
|
r,
|
|
5133
5170
|
i
|
|
5134
|
-
]),
|
|
5171
|
+
]), F = o(() => {
|
|
5135
5172
|
let e = T.current, a = E.current;
|
|
5136
5173
|
if (!e || !a) return;
|
|
5137
|
-
if (i !== "auto") return
|
|
5138
|
-
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l =
|
|
5139
|
-
if (ee.current = !!c && !!l, !ee.current || !c || !l) return
|
|
5140
|
-
|
|
5141
|
-
|
|
5174
|
+
if (i !== "auto") return di(a, j, Math.max(0, i));
|
|
5175
|
+
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = li(e, N.current);
|
|
5176
|
+
if (ee.current = !!c && !!l, !ee.current || !c || !l) return di(a, j, s);
|
|
5177
|
+
if (h) {
|
|
5178
|
+
let t = Math.max(0, e.clientHeight - n - o - ui(a));
|
|
5179
|
+
return t !== M.current && (M.current = t, a.style.setProperty("--ick-conversation-room", `${Math.round(t)}px`)), di(a, j, s);
|
|
5180
|
+
}
|
|
5181
|
+
let u = ci(c, e) + c.offsetHeight - ci(l, e), d = Math.max(s, e.clientHeight - n - u - o);
|
|
5182
|
+
di(a, j, t ? Math.max(d, j.current) : d);
|
|
5142
5183
|
}, [
|
|
5143
5184
|
i,
|
|
5144
5185
|
n,
|
|
5145
5186
|
r,
|
|
5146
5187
|
t,
|
|
5147
5188
|
h
|
|
5148
|
-
]),
|
|
5189
|
+
]), I = o(() => {
|
|
5149
5190
|
let e = T.current;
|
|
5150
5191
|
if (!e) return 0;
|
|
5151
5192
|
if (t) {
|
|
5152
5193
|
let r = e.querySelector(`[id="${CSS.escape(t)}"]`);
|
|
5153
5194
|
if (r) {
|
|
5154
|
-
let t = Math.max(0, e.scrollHeight - e.clientHeight), i =
|
|
5155
|
-
return Math.max(0, Math.min(Math.max(a,
|
|
5195
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight), i = ci(r, e), a = i - n, o = h && E.current ? ui(E.current) : 0, s = i + r.offsetHeight + o - e.clientHeight;
|
|
5196
|
+
return Math.max(0, Math.min(Math.max(a, s), t));
|
|
5156
5197
|
}
|
|
5157
5198
|
}
|
|
5158
|
-
return
|
|
5199
|
+
return P();
|
|
5159
5200
|
}, [
|
|
5160
5201
|
t,
|
|
5161
5202
|
n,
|
|
5162
|
-
|
|
5163
|
-
|
|
5203
|
+
P,
|
|
5204
|
+
h
|
|
5205
|
+
]), L = p(0), R = p(null), te = o((e) => {
|
|
5164
5206
|
let t = T.current;
|
|
5165
5207
|
if (!t) return;
|
|
5166
5208
|
let n = e && !q();
|
|
5167
|
-
|
|
5168
|
-
top:
|
|
5209
|
+
L.current = n ? performance.now() + ri : 0, t.scrollTo({
|
|
5210
|
+
top: I(),
|
|
5169
5211
|
behavior: n ? "smooth" : "auto"
|
|
5170
5212
|
}), A(!0);
|
|
5171
|
-
}, [
|
|
5213
|
+
}, [I]);
|
|
5172
5214
|
d(() => {
|
|
5173
|
-
t && (
|
|
5215
|
+
t && (N.current = t);
|
|
5174
5216
|
let e = T.current, n = E.current;
|
|
5175
|
-
if (
|
|
5176
|
-
let r = new ResizeObserver(
|
|
5217
|
+
if (F(), !e || !n || typeof ResizeObserver > "u") return;
|
|
5218
|
+
let r = new ResizeObserver(F);
|
|
5177
5219
|
return r.observe(n), r.observe(e), () => r.disconnect();
|
|
5178
|
-
}, [t,
|
|
5220
|
+
}, [t, F]), d(() => {
|
|
5179
5221
|
if (!f || !k && !t) return;
|
|
5180
5222
|
let e = T.current, n = E.current;
|
|
5181
5223
|
if (!e || !n || typeof ResizeObserver > "u") return;
|
|
5182
|
-
let r = () => {
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5224
|
+
let r = 0, i = () => {
|
|
5225
|
+
L.current = 0;
|
|
5226
|
+
let t = I();
|
|
5227
|
+
if (Math.abs(t - e.scrollTop) > a && !q()) {
|
|
5228
|
+
L.current = performance.now() + ri, e.scrollTo({
|
|
5229
|
+
top: t,
|
|
5230
|
+
behavior: "smooth"
|
|
5231
|
+
}), r = window.setTimeout(i, 550);
|
|
5232
|
+
return;
|
|
5233
|
+
}
|
|
5234
|
+
e.scrollTop = t;
|
|
5235
|
+
}, o = () => {
|
|
5236
|
+
let n = I();
|
|
5237
|
+
if (L.current) {
|
|
5238
|
+
let t = L.current - performance.now();
|
|
5239
|
+
if (t > 0 && Math.abs(e.scrollTop - n) > 1) {
|
|
5240
|
+
window.clearTimeout(r), r = window.setTimeout(i, t + oi);
|
|
5241
|
+
return;
|
|
5242
|
+
}
|
|
5243
|
+
L.current = 0;
|
|
5187
5244
|
}
|
|
5188
|
-
let
|
|
5189
|
-
if (
|
|
5190
|
-
|
|
5245
|
+
let o = n - e.scrollTop;
|
|
5246
|
+
if (N.current && !t && !q() && h) {
|
|
5247
|
+
!s && Math.abs(o) > si && (window.clearTimeout(c), c = window.setTimeout(l, ai));
|
|
5248
|
+
return;
|
|
5249
|
+
}
|
|
5250
|
+
if (N.current && !t && Math.abs(o) > a && !q()) {
|
|
5251
|
+
L.current = performance.now() + ri, e.scrollTo({
|
|
5191
5252
|
top: n,
|
|
5192
5253
|
behavior: "smooth"
|
|
5193
5254
|
});
|
|
5194
5255
|
return;
|
|
5195
5256
|
}
|
|
5196
5257
|
e.scrollTop = n;
|
|
5197
|
-
},
|
|
5198
|
-
|
|
5199
|
-
|
|
5258
|
+
}, s = 0, c = 0, l = () => {
|
|
5259
|
+
if (s) return;
|
|
5260
|
+
if (typeof requestAnimationFrame > "u") {
|
|
5261
|
+
e.scrollTop = I();
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
let t = () => {
|
|
5265
|
+
let n = I(), r = n - e.scrollTop;
|
|
5266
|
+
if (Math.abs(r) <= 1) {
|
|
5267
|
+
e.scrollTop = n, s = 0;
|
|
5268
|
+
return;
|
|
5269
|
+
}
|
|
5270
|
+
e.scrollTop += Math.sign(r) * Math.max(1, Math.abs(r) * ii), s = requestAnimationFrame(t);
|
|
5271
|
+
};
|
|
5272
|
+
s = requestAnimationFrame(t);
|
|
5273
|
+
}, u = t != null && t !== R.current;
|
|
5274
|
+
t && (R.current = t), u && !q() && Math.abs(e.scrollTop - I()) > a ? (L.current = performance.now() + ri, e.scrollTo({
|
|
5275
|
+
top: I(),
|
|
5200
5276
|
behavior: "smooth"
|
|
5201
|
-
})) :
|
|
5202
|
-
let
|
|
5203
|
-
return
|
|
5277
|
+
})) : o();
|
|
5278
|
+
let d = new ResizeObserver(o);
|
|
5279
|
+
return d.observe(n), () => {
|
|
5280
|
+
d.disconnect(), window.clearTimeout(r), s && cancelAnimationFrame(s), window.clearTimeout(c);
|
|
5281
|
+
};
|
|
5204
5282
|
}, [
|
|
5205
5283
|
f,
|
|
5206
5284
|
k,
|
|
5207
|
-
|
|
5285
|
+
I,
|
|
5208
5286
|
t,
|
|
5209
|
-
a
|
|
5287
|
+
a,
|
|
5288
|
+
h
|
|
5210
5289
|
]), c(() => {
|
|
5211
5290
|
if (!f) return;
|
|
5212
5291
|
let e = T.current;
|
|
5213
5292
|
if (!e) return;
|
|
5214
5293
|
let n = () => {
|
|
5215
|
-
|
|
5294
|
+
L.current = 0, Math.abs(e.scrollTop - I()) > a && A(!1);
|
|
5216
5295
|
}, r = (e) => {
|
|
5217
5296
|
t ? n() : e.deltaY < 0 && A(!1);
|
|
5218
5297
|
}, i = (e) => {
|
|
@@ -5238,40 +5317,40 @@ var $r = {
|
|
|
5238
5317
|
}, [
|
|
5239
5318
|
f,
|
|
5240
5319
|
a,
|
|
5241
|
-
|
|
5320
|
+
I,
|
|
5242
5321
|
t
|
|
5243
5322
|
]);
|
|
5244
|
-
let
|
|
5323
|
+
let ne = o((e) => {
|
|
5245
5324
|
if (b?.(e), !f) return;
|
|
5246
5325
|
let t = T.current;
|
|
5247
|
-
t && Math.abs(t.scrollTop -
|
|
5326
|
+
t && Math.abs(t.scrollTop - I()) <= si && (L.current = 0, A(!0));
|
|
5248
5327
|
}, [
|
|
5249
5328
|
f,
|
|
5250
5329
|
b,
|
|
5251
|
-
|
|
5252
|
-
]),
|
|
5330
|
+
I
|
|
5331
|
+
]), re = f && !k;
|
|
5253
5332
|
return /* @__PURE__ */ v("div", {
|
|
5254
5333
|
ref: O,
|
|
5255
|
-
className: [
|
|
5334
|
+
className: [ti.root, g ?? ""].filter(Boolean).join(" "),
|
|
5256
5335
|
"data-dock": h || void 0,
|
|
5257
5336
|
children: [/* @__PURE__ */ _("div", {
|
|
5258
5337
|
ref: T,
|
|
5259
|
-
className: [
|
|
5260
|
-
onScroll:
|
|
5338
|
+
className: [ti.viewport, y ?? ""].filter(Boolean).join(" "),
|
|
5339
|
+
onScroll: ne,
|
|
5261
5340
|
...x,
|
|
5262
5341
|
children: /* @__PURE__ */ _("div", {
|
|
5263
5342
|
ref: E,
|
|
5264
|
-
className:
|
|
5343
|
+
className: ti.content,
|
|
5265
5344
|
"data-dock": h || void 0,
|
|
5266
5345
|
children: e
|
|
5267
5346
|
})
|
|
5268
5347
|
}), s && /* @__PURE__ */ _("button", {
|
|
5269
5348
|
type: "button",
|
|
5270
|
-
className:
|
|
5271
|
-
"data-shown":
|
|
5272
|
-
tabIndex:
|
|
5273
|
-
"aria-hidden": !
|
|
5274
|
-
onClick: () =>
|
|
5349
|
+
className: ti.jump,
|
|
5350
|
+
"data-shown": re || void 0,
|
|
5351
|
+
tabIndex: re ? 0 : -1,
|
|
5352
|
+
"aria-hidden": !re || void 0,
|
|
5353
|
+
onClick: () => te(!0),
|
|
5275
5354
|
"aria-label": w,
|
|
5276
5355
|
children: /* @__PURE__ */ _(D, {
|
|
5277
5356
|
size: 15,
|
|
@@ -5279,7 +5358,7 @@ var $r = {
|
|
|
5279
5358
|
})
|
|
5280
5359
|
})]
|
|
5281
5360
|
});
|
|
5282
|
-
}),
|
|
5361
|
+
}), pi = {
|
|
5283
5362
|
empty: "ick-empty-BP6G",
|
|
5284
5363
|
icon: "ick-icon-rZWd",
|
|
5285
5364
|
title: "ick-title-AoPi",
|
|
@@ -5288,29 +5367,29 @@ var $r = {
|
|
|
5288
5367
|
};
|
|
5289
5368
|
//#endregion
|
|
5290
5369
|
//#region src/EmptyState/EmptyState.tsx
|
|
5291
|
-
function
|
|
5292
|
-
let l =
|
|
5370
|
+
function mi({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a, children: o, className: s, ...c }) {
|
|
5371
|
+
let l = U("emptyState").suggestions, u = a ?? l, d = i ? r ?? [] : [];
|
|
5293
5372
|
return /* @__PURE__ */ v("div", {
|
|
5294
|
-
className: [
|
|
5373
|
+
className: [pi.empty, s ?? ""].filter(Boolean).join(" "),
|
|
5295
5374
|
...c,
|
|
5296
5375
|
children: [
|
|
5297
5376
|
e && /* @__PURE__ */ _("div", {
|
|
5298
|
-
className:
|
|
5377
|
+
className: pi.icon,
|
|
5299
5378
|
children: e
|
|
5300
5379
|
}),
|
|
5301
5380
|
t && /* @__PURE__ */ _("div", {
|
|
5302
|
-
className:
|
|
5381
|
+
className: pi.title,
|
|
5303
5382
|
children: t
|
|
5304
5383
|
}),
|
|
5305
5384
|
n && /* @__PURE__ */ _("p", {
|
|
5306
|
-
className:
|
|
5385
|
+
className: pi.description,
|
|
5307
5386
|
children: n
|
|
5308
5387
|
}),
|
|
5309
5388
|
d.length > 0 && /* @__PURE__ */ _("div", {
|
|
5310
|
-
className:
|
|
5389
|
+
className: pi.suggestions,
|
|
5311
5390
|
role: "group",
|
|
5312
5391
|
"aria-label": u,
|
|
5313
|
-
children: d.map((e) => /* @__PURE__ */ _(
|
|
5392
|
+
children: d.map((e) => /* @__PURE__ */ _(H, {
|
|
5314
5393
|
variant: "primary",
|
|
5315
5394
|
size: "m",
|
|
5316
5395
|
onClick: () => i?.(e),
|
|
@@ -5323,14 +5402,14 @@ function ci({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i
|
|
|
5323
5402
|
}
|
|
5324
5403
|
//#endregion
|
|
5325
5404
|
//#region src/ReplyThreadPopup/placePanel.ts
|
|
5326
|
-
var
|
|
5327
|
-
function
|
|
5328
|
-
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width +
|
|
5405
|
+
var hi = 24, gi = 480, _i = 80, vi = 260;
|
|
5406
|
+
function yi(e, t, n = Infinity) {
|
|
5407
|
+
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + _i, gi), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, hi), t - hi - i), s = Math.max(hi, n - hi - vi), c = Math.min(Math.max(e.top - hi, Math.min(hi, n)), Number.isFinite(s) ? s : Infinity);
|
|
5329
5408
|
return {
|
|
5330
5409
|
x: o,
|
|
5331
5410
|
y: c,
|
|
5332
5411
|
width: i,
|
|
5333
|
-
maxHeight: Number.isFinite(n) ? Math.max(
|
|
5412
|
+
maxHeight: Number.isFinite(n) ? Math.max(vi, n - c - hi) : Infinity
|
|
5334
5413
|
};
|
|
5335
5414
|
}
|
|
5336
5415
|
var Q = {
|
|
@@ -5354,7 +5433,7 @@ var Q = {
|
|
|
5354
5433
|
turn: "ick-turn-ogjU",
|
|
5355
5434
|
turnRow: "ick-turnRow-0OuP",
|
|
5356
5435
|
srOnly: "ick-srOnly-LwE1"
|
|
5357
|
-
},
|
|
5436
|
+
}, bi = 760, xi = {
|
|
5358
5437
|
closed: {
|
|
5359
5438
|
y: "100%",
|
|
5360
5439
|
opacity: 1,
|
|
@@ -5373,16 +5452,16 @@ var Q = {
|
|
|
5373
5452
|
bounce: .18
|
|
5374
5453
|
}
|
|
5375
5454
|
}
|
|
5376
|
-
},
|
|
5377
|
-
function
|
|
5378
|
-
let i =
|
|
5455
|
+
}, Si = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
|
|
5456
|
+
function Ci({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
5457
|
+
let i = U("thread"), { responding: a } = U("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = rt, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${bi}px)`)?.matches ?? !1);
|
|
5379
5458
|
c(() => {
|
|
5380
|
-
let e = window.matchMedia?.(`(max-width: ${
|
|
5459
|
+
let e = window.matchMedia?.(`(max-width: ${bi}px)`);
|
|
5381
5460
|
if (!e?.addEventListener) return;
|
|
5382
5461
|
let t = () => w(e.matches);
|
|
5383
5462
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5384
5463
|
}, []);
|
|
5385
|
-
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } =
|
|
5464
|
+
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } = gt({
|
|
5386
5465
|
onSend: (e, t) => r(e, T, t),
|
|
5387
5466
|
announcements: { responding: a }
|
|
5388
5467
|
});
|
|
@@ -5396,7 +5475,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5396
5475
|
return;
|
|
5397
5476
|
}
|
|
5398
5477
|
if (e.key !== "Tab") return;
|
|
5399
|
-
let n = [...f.current?.querySelectorAll(
|
|
5478
|
+
let n = [...f.current?.querySelectorAll(Si) ?? []];
|
|
5400
5479
|
if (n.length === 0) return;
|
|
5401
5480
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
5402
5481
|
e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
@@ -5428,12 +5507,12 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5428
5507
|
behavior: "smooth"
|
|
5429
5508
|
});
|
|
5430
5509
|
}, [E]);
|
|
5431
|
-
let { x:
|
|
5510
|
+
let { x: N, y: ee, width: P, maxHeight: F } = typeof window > "u" ? {
|
|
5432
5511
|
x: 0,
|
|
5433
5512
|
y: 0,
|
|
5434
5513
|
width: 480,
|
|
5435
5514
|
maxHeight: Infinity
|
|
5436
|
-
} :
|
|
5515
|
+
} : yi(e.rect, window.innerWidth, window.innerHeight);
|
|
5437
5516
|
return /* @__PURE__ */ _(x, {
|
|
5438
5517
|
reducedMotion: "user",
|
|
5439
5518
|
children: /* @__PURE__ */ _("div", {
|
|
@@ -5456,9 +5535,9 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5456
5535
|
opacity: 0
|
|
5457
5536
|
},
|
|
5458
5537
|
animate: S ? "open" : {
|
|
5459
|
-
left:
|
|
5460
|
-
top:
|
|
5461
|
-
width:
|
|
5538
|
+
left: N,
|
|
5539
|
+
top: ee,
|
|
5540
|
+
width: P,
|
|
5462
5541
|
borderRadius: 28,
|
|
5463
5542
|
opacity: 1
|
|
5464
5543
|
},
|
|
@@ -5467,7 +5546,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5467
5546
|
scale: .95,
|
|
5468
5547
|
filter: "blur(4px)"
|
|
5469
5548
|
},
|
|
5470
|
-
variants: S ?
|
|
5549
|
+
variants: S ? xi : void 0,
|
|
5471
5550
|
transition: S ? void 0 : {
|
|
5472
5551
|
type: "spring",
|
|
5473
5552
|
bounce: 0,
|
|
@@ -5488,7 +5567,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5488
5567
|
(n.offset.y > 120 || n.velocity.y > 600) && t();
|
|
5489
5568
|
}
|
|
5490
5569
|
} : {},
|
|
5491
|
-
style: !S && Number.isFinite(
|
|
5570
|
+
style: !S && Number.isFinite(F) ? { maxHeight: F } : void 0,
|
|
5492
5571
|
className: Q.panel,
|
|
5493
5572
|
children: /* @__PURE__ */ v("div", {
|
|
5494
5573
|
className: Q.column,
|
|
@@ -5515,14 +5594,14 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5515
5594
|
})]
|
|
5516
5595
|
}), /* @__PURE__ */ v("div", {
|
|
5517
5596
|
className: Q.headerActions,
|
|
5518
|
-
children: [/* @__PURE__ */ _(
|
|
5597
|
+
children: [/* @__PURE__ */ _(H, {
|
|
5519
5598
|
variant: "primary",
|
|
5520
|
-
icon: /* @__PURE__ */ _(
|
|
5599
|
+
icon: /* @__PURE__ */ _(me, { size: 16 }),
|
|
5521
5600
|
onClick: n,
|
|
5522
5601
|
children: i.save
|
|
5523
|
-
}), /* @__PURE__ */ _(
|
|
5602
|
+
}), /* @__PURE__ */ _(H, {
|
|
5524
5603
|
variant: "secondary",
|
|
5525
|
-
icon: /* @__PURE__ */ _(
|
|
5604
|
+
icon: /* @__PURE__ */ _(Ce, { size: 16 }),
|
|
5526
5605
|
onClick: t,
|
|
5527
5606
|
"aria-label": i.close
|
|
5528
5607
|
})]
|
|
@@ -5580,7 +5659,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5580
5659
|
children: [/* @__PURE__ */ _("div", {
|
|
5581
5660
|
className: Q.turnRow,
|
|
5582
5661
|
"data-editing": r || void 0,
|
|
5583
|
-
children: /* @__PURE__ */ _(
|
|
5662
|
+
children: /* @__PURE__ */ _(st, {
|
|
5584
5663
|
ref: n ? u : null,
|
|
5585
5664
|
state: e.state,
|
|
5586
5665
|
value: e.user,
|
|
@@ -5611,7 +5690,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5611
5690
|
}
|
|
5612
5691
|
//#endregion
|
|
5613
5692
|
//#region src/CustomCursor/CustomCursor.tsx
|
|
5614
|
-
function
|
|
5693
|
+
function wi() {
|
|
5615
5694
|
let e = T(-100), t = T(-100), [n, r] = m("default"), [i, a] = m(!1), [o, s] = m(!1);
|
|
5616
5695
|
return c(() => {
|
|
5617
5696
|
let n = (n) => {
|
|
@@ -5769,7 +5848,7 @@ function vi() {
|
|
|
5769
5848
|
}
|
|
5770
5849
|
//#endregion
|
|
5771
5850
|
//#region src/theme/useThemeAttribute.ts
|
|
5772
|
-
function
|
|
5851
|
+
function Ti(e) {
|
|
5773
5852
|
c(() => {
|
|
5774
5853
|
e !== void 0 && (e ? document.documentElement.setAttribute("data-theme", e) : document.documentElement.removeAttribute("data-theme"));
|
|
5775
5854
|
}, [e]);
|
|
@@ -5796,134 +5875,134 @@ var $ = {
|
|
|
5796
5875
|
groupTitle: "ick-groupTitle-jiBB",
|
|
5797
5876
|
marks: "ick-marks-gwsN",
|
|
5798
5877
|
mark: "ick-mark-QkpW"
|
|
5799
|
-
},
|
|
5878
|
+
}, Ei = () => "", Di = {
|
|
5800
5879
|
stiffness: 170,
|
|
5801
5880
|
damping: 24,
|
|
5802
5881
|
mass: 1
|
|
5803
5882
|
};
|
|
5804
|
-
function
|
|
5805
|
-
let
|
|
5883
|
+
function Oi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !0, composerMenu: a, onTranscribe: s, onThreadReply: l, title: u, backHref: d, backLabel: h, actions: b, placeholder: x, empty: S, contextTotal: w, contextBase: T = 0, artifact: E, openArtifactId: D, onOpenArtifactChange: O, pane: A = "inline", surface: j = "flush", composer: M = "inline", fill: N = "window", theme: ee, onThemeChange: P, cursor: F = !1, selectionToggle: I = !1, highlights: L = !0, bookmarks: R = !0, anchorOffset: ne = 100, endOffset: re = 120, animationConfig: z, foldMotion: ie, feedDelay: ae = 0, onAnswerQuestion: oe, onEditQuestion: ce, onDecideApproval: le, className: ue }) {
|
|
5884
|
+
let B = U("experience", r?.experience), de = u ?? B.title, [fe, pe] = m([]), [me, ge] = m(!1), [ye, be] = m(null), [xe, Se] = m("marker"), Ce = p(null), V = ee !== void 0, [we, Te] = m(null), H = V ? ee : we, [Ee, De] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
5806
5885
|
c(() => {
|
|
5807
|
-
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () =>
|
|
5886
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => De(e.matches);
|
|
5808
5887
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5809
5888
|
}, []);
|
|
5810
|
-
let
|
|
5811
|
-
|
|
5812
|
-
let
|
|
5813
|
-
|
|
5814
|
-
}, [
|
|
5889
|
+
let Oe = H ?? (Ee ? "dark" : "light");
|
|
5890
|
+
Ti(H);
|
|
5891
|
+
let je = o((e) => {
|
|
5892
|
+
V || Te(e), P?.(e);
|
|
5893
|
+
}, [V, P]), Me = M === "docked", Ne = f(() => Me ? {
|
|
5815
5894
|
...rt,
|
|
5816
|
-
...
|
|
5817
|
-
bubble:
|
|
5818
|
-
} :
|
|
5819
|
-
onSend: e ??
|
|
5820
|
-
announcements: { responding:
|
|
5821
|
-
nextTurn:
|
|
5895
|
+
...z,
|
|
5896
|
+
bubble: z?.bubble ?? Di
|
|
5897
|
+
} : z, [Me, z]), Pe = gt({
|
|
5898
|
+
onSend: e ?? Ei,
|
|
5899
|
+
announcements: { responding: B.responding },
|
|
5900
|
+
nextTurn: Me ? "at-send" : "after-answer"
|
|
5822
5901
|
}), { turns: Fe, setDraft: Ie, submit: Le, showVersion: W, stop: Re, beginEdit: ze, cancelEdit: Be, updatePart: Ve, isStreaming: He } = t ?? Pe, [Ue, We] = m(null), Ge = o((e, t, n) => {
|
|
5823
5902
|
We(e), Le(e, t, n);
|
|
5824
|
-
}, [Le]), G = Ue ? Fe.find((e) => e.id === Ue) ?? null : null, K = G && G.state !== "resting" ? Ue : null, [
|
|
5903
|
+
}, [Le]), G = Ue ? Fe.find((e) => e.id === Ue) ?? null : null, K = (G?.versions?.length ?? 0) > 0, q = G && K && G.state !== "resting" ? Ue : null, [qe, Je] = m(0), Ye = N === "window";
|
|
5825
5904
|
c(() => {
|
|
5826
|
-
if (!
|
|
5905
|
+
if (!Me || !Ye) return;
|
|
5827
5906
|
let e = window.visualViewport;
|
|
5828
5907
|
if (!e) return;
|
|
5829
|
-
let t = () =>
|
|
5908
|
+
let t = () => Je(Math.max(0, Math.round(window.innerHeight - e.height)));
|
|
5830
5909
|
return t(), e.addEventListener("resize", t), () => e.removeEventListener("resize", t);
|
|
5831
|
-
}, [
|
|
5832
|
-
let
|
|
5910
|
+
}, [Me, Ye]);
|
|
5911
|
+
let Xe = o((e) => {
|
|
5833
5912
|
We(e), Le(e);
|
|
5834
|
-
}, [Le]),
|
|
5913
|
+
}, [Le]), Ze = Fe.length === 1 && !Fe[0].user && !Fe[0].ai, Qe = T + Math.round(Fe.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), $e = w !== void 0 && Qe >= w, et = p(!1);
|
|
5835
5914
|
c(() => {
|
|
5836
|
-
if (
|
|
5837
|
-
|
|
5915
|
+
if (!$e) {
|
|
5916
|
+
et.current = !1;
|
|
5838
5917
|
return;
|
|
5839
5918
|
}
|
|
5840
|
-
|
|
5841
|
-
}, [
|
|
5842
|
-
let
|
|
5843
|
-
openArtifactId:
|
|
5844
|
-
artifactHeld:
|
|
5919
|
+
et.current || (et.current = !0, Ke(B.windowFull));
|
|
5920
|
+
}, [$e, B.windowFull]);
|
|
5921
|
+
let tt = ei(), nt = D !== void 0, it = nt ? D : tt.openId, at = p({
|
|
5922
|
+
openArtifactId: it,
|
|
5923
|
+
artifactHeld: nt,
|
|
5845
5924
|
onOpenArtifactChange: O
|
|
5846
5925
|
});
|
|
5847
5926
|
c(() => {
|
|
5848
|
-
|
|
5849
|
-
openArtifactId:
|
|
5850
|
-
artifactHeld:
|
|
5927
|
+
at.current = {
|
|
5928
|
+
openArtifactId: it,
|
|
5929
|
+
artifactHeld: nt,
|
|
5851
5930
|
onOpenArtifactChange: O
|
|
5852
5931
|
};
|
|
5853
5932
|
});
|
|
5854
|
-
let
|
|
5855
|
-
let { artifactHeld: t, onOpenArtifactChange: n } =
|
|
5856
|
-
t || (e === null ?
|
|
5857
|
-
}, [
|
|
5858
|
-
|
|
5933
|
+
let ot = tt.open, st = tt.close, ct = o((e) => {
|
|
5934
|
+
let { artifactHeld: t, onOpenArtifactChange: n } = at.current;
|
|
5935
|
+
t || (e === null ? st() : ot(e)), n?.(e);
|
|
5936
|
+
}, [ot, st]), lt = o(() => ct(null), [ct]), [ut, dt] = m({}), J = o((e, t) => {
|
|
5937
|
+
dt((n) => ({
|
|
5859
5938
|
...n,
|
|
5860
5939
|
[e]: t
|
|
5861
5940
|
}));
|
|
5862
|
-
}, []),
|
|
5863
|
-
|
|
5941
|
+
}, []), ft = Fe.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? de, pt = o((e, t) => {
|
|
5942
|
+
R && t.trim().length > 0 && pe((n) => [...n, {
|
|
5864
5943
|
turnId: e,
|
|
5865
5944
|
text: t.trim()
|
|
5866
5945
|
}]);
|
|
5867
|
-
}, [
|
|
5868
|
-
|
|
5946
|
+
}, [R]), mt = o((e, t) => ct(at.current.openArtifactId === t ? null : t), [ct]), ht = o((e, t) => {
|
|
5947
|
+
be({
|
|
5869
5948
|
text: e,
|
|
5870
5949
|
rect: t
|
|
5871
5950
|
});
|
|
5872
|
-
}, []), Y = f(() =>
|
|
5951
|
+
}, []), Y = f(() => oe ? (e, t, n, r) => oe(Ve, e, t, n, r) : void 0, [oe, Ve]), _t = f(() => ce ? (e, t, n) => ce(Ve, e, t, n) : void 0, [ce, Ve]), vt = f(() => le ? (e, t, n) => le(Ve, e, t, n) : void 0, [le, Ve]), [yt, bt] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
|
|
5873
5952
|
c(() => {
|
|
5874
|
-
if (!
|
|
5875
|
-
let e = window.matchMedia("(pointer: fine)"), t = () =>
|
|
5953
|
+
if (!F) return;
|
|
5954
|
+
let e = window.matchMedia("(pointer: fine)"), t = () => bt(e.matches);
|
|
5876
5955
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5877
|
-
}, [
|
|
5878
|
-
let
|
|
5879
|
-
...
|
|
5956
|
+
}, [F]);
|
|
5957
|
+
let xt = (e) => i === !0 || Array.isArray(i) && i.includes(e), St = [
|
|
5958
|
+
...L && R && fe.length > 0 ? [{
|
|
5880
5959
|
id: "bookmarks",
|
|
5881
|
-
label:
|
|
5960
|
+
label: B.savedHighlights,
|
|
5882
5961
|
icon: /* @__PURE__ */ _(k, {
|
|
5883
5962
|
size: 16,
|
|
5884
5963
|
"aria-hidden": !0
|
|
5885
5964
|
}),
|
|
5886
|
-
count:
|
|
5965
|
+
count: fe.length,
|
|
5887
5966
|
pinned: !0,
|
|
5888
|
-
onClick: () =>
|
|
5967
|
+
onClick: () => ge(!0)
|
|
5889
5968
|
}] : [],
|
|
5890
|
-
...
|
|
5969
|
+
...xt("theme") ? [{
|
|
5891
5970
|
id: "theme",
|
|
5892
|
-
label:
|
|
5893
|
-
icon: _(
|
|
5971
|
+
label: Oe === "dark" ? B.themeToLight : B.themeToDark,
|
|
5972
|
+
icon: _(Oe === "dark" ? _e : se, {
|
|
5894
5973
|
size: 16,
|
|
5895
5974
|
"aria-hidden": !0
|
|
5896
5975
|
}),
|
|
5897
|
-
active:
|
|
5898
|
-
onClick: () =>
|
|
5976
|
+
active: Oe === "dark",
|
|
5977
|
+
onClick: () => je(Oe === "dark" ? "light" : "dark")
|
|
5899
5978
|
}] : [],
|
|
5900
|
-
...
|
|
5979
|
+
...xt("share") ? [{
|
|
5901
5980
|
id: "share",
|
|
5902
|
-
label:
|
|
5903
|
-
icon: /* @__PURE__ */ _(
|
|
5981
|
+
label: B.share,
|
|
5982
|
+
icon: /* @__PURE__ */ _(he, {
|
|
5904
5983
|
size: 16,
|
|
5905
5984
|
"aria-hidden": !0
|
|
5906
5985
|
}),
|
|
5907
5986
|
onClick: () => navigator.share?.({
|
|
5908
|
-
title:
|
|
5987
|
+
title: ft,
|
|
5909
5988
|
url: window.location.href
|
|
5910
5989
|
})
|
|
5911
5990
|
}] : [],
|
|
5912
5991
|
...b ?? []
|
|
5913
|
-
],
|
|
5992
|
+
], Ct = A === "inline" && it ? E?.(it) : null, Tt = /* @__PURE__ */ v(C.div, {
|
|
5914
5993
|
className: [
|
|
5915
5994
|
$.page,
|
|
5916
|
-
j === "panes" || !
|
|
5995
|
+
j === "panes" || !Ye ? $.fitted : "",
|
|
5917
5996
|
"ick-chat-page",
|
|
5918
|
-
|
|
5997
|
+
ue
|
|
5919
5998
|
].filter(Boolean).join(" "),
|
|
5920
|
-
style: { "--ick-experience-anchor": `${
|
|
5921
|
-
"data-composer":
|
|
5999
|
+
style: { "--ick-experience-anchor": `${ne}px` },
|
|
6000
|
+
"data-composer": Me ? "docked" : void 0,
|
|
5922
6001
|
initial: { opacity: 0 },
|
|
5923
6002
|
animate: {
|
|
5924
|
-
opacity:
|
|
5925
|
-
filter:
|
|
5926
|
-
scale:
|
|
6003
|
+
opacity: ye || me ? .4 : 1,
|
|
6004
|
+
filter: ye || me ? "blur(3px)" : "blur(0px)",
|
|
6005
|
+
scale: ye || me ? .9 : 1
|
|
5927
6006
|
},
|
|
5928
6007
|
transition: {
|
|
5929
6008
|
type: "spring",
|
|
@@ -5932,52 +6011,52 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5932
6011
|
mass: .9
|
|
5933
6012
|
},
|
|
5934
6013
|
onAnimationComplete: () => {
|
|
5935
|
-
document.activeElement && document.activeElement !== document.body ||
|
|
6014
|
+
document.activeElement && document.activeElement !== document.body || Ce.current?.focus();
|
|
5936
6015
|
},
|
|
5937
6016
|
children: [
|
|
5938
6017
|
/* @__PURE__ */ _("div", { className: $.topBlur }),
|
|
5939
|
-
/* @__PURE__ */ v(
|
|
6018
|
+
/* @__PURE__ */ v(wt, {
|
|
5940
6019
|
className: `${$.header} ick-chat-header`,
|
|
5941
|
-
title:
|
|
6020
|
+
title: ft,
|
|
5942
6021
|
backHref: d,
|
|
5943
6022
|
backLabel: h,
|
|
5944
6023
|
elevateOnScroll: !1,
|
|
5945
6024
|
collapseActionsAt: 480,
|
|
5946
|
-
actions:
|
|
5947
|
-
children: [w !== void 0 && /* @__PURE__ */ _(
|
|
6025
|
+
actions: St,
|
|
6026
|
+
children: [w !== void 0 && /* @__PURE__ */ _(Vr, {
|
|
5948
6027
|
className: $.context,
|
|
5949
|
-
used:
|
|
6028
|
+
used: Qe,
|
|
5950
6029
|
total: w
|
|
5951
|
-
}),
|
|
6030
|
+
}), I && L && /* @__PURE__ */ v("div", {
|
|
5952
6031
|
className: $.selectMode,
|
|
5953
6032
|
role: "group",
|
|
5954
|
-
"aria-label":
|
|
6033
|
+
"aria-label": B.selectionMode,
|
|
5955
6034
|
children: [/* @__PURE__ */ _("button", {
|
|
5956
6035
|
type: "button",
|
|
5957
|
-
"data-active":
|
|
5958
|
-
onClick: () =>
|
|
5959
|
-
"aria-label":
|
|
5960
|
-
title:
|
|
5961
|
-
children: /* @__PURE__ */ _(
|
|
6036
|
+
"data-active": xe === "marker",
|
|
6037
|
+
onClick: () => Se("marker"),
|
|
6038
|
+
"aria-label": B.marker,
|
|
6039
|
+
title: B.marker,
|
|
6040
|
+
children: /* @__PURE__ */ _(te, { size: 16 })
|
|
5962
6041
|
}), /* @__PURE__ */ _("button", {
|
|
5963
6042
|
type: "button",
|
|
5964
|
-
"data-active":
|
|
5965
|
-
onClick: () =>
|
|
5966
|
-
"aria-label":
|
|
5967
|
-
title:
|
|
5968
|
-
children: /* @__PURE__ */ _(
|
|
6043
|
+
"data-active": xe === "precise",
|
|
6044
|
+
onClick: () => Se("precise"),
|
|
6045
|
+
"aria-label": B.precise,
|
|
6046
|
+
title: B.precise,
|
|
6047
|
+
children: /* @__PURE__ */ _(ve, { size: 16 })
|
|
5969
6048
|
})]
|
|
5970
6049
|
})]
|
|
5971
6050
|
}),
|
|
5972
|
-
/* @__PURE__ */ v(
|
|
6051
|
+
/* @__PURE__ */ v(fi, {
|
|
5973
6052
|
viewportClassName: `${$.feed} ick-chat-feed`,
|
|
5974
|
-
anchorId:
|
|
5975
|
-
dock:
|
|
5976
|
-
anchorOffset:
|
|
5977
|
-
endOffset:
|
|
6053
|
+
anchorId: q ? `turn-${q}` : void 0,
|
|
6054
|
+
dock: Me,
|
|
6055
|
+
anchorOffset: ne,
|
|
6056
|
+
endOffset: Me ? 0 : re,
|
|
5978
6057
|
children: [
|
|
5979
|
-
|
|
5980
|
-
className:
|
|
6058
|
+
Ze && S && /* @__PURE__ */ _(mi, {
|
|
6059
|
+
className: Me ? `${$.opening} ${$.centred}` : $.opening,
|
|
5981
6060
|
title: S.title,
|
|
5982
6061
|
description: S.description,
|
|
5983
6062
|
suggestions: S.suggestions,
|
|
@@ -5985,78 +6064,78 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5985
6064
|
}),
|
|
5986
6065
|
/* @__PURE__ */ _(y, { children: Fe.map((e, t) => {
|
|
5987
6066
|
let r = t === Fe.length - 1 && (e.state === "idle" || e.state === "typing");
|
|
5988
|
-
return /* @__PURE__ */ _(
|
|
6067
|
+
return /* @__PURE__ */ _(Ir, {
|
|
5989
6068
|
turn: e,
|
|
5990
|
-
questionAlign:
|
|
5991
|
-
className:
|
|
6069
|
+
questionAlign: Me && r || Ze && t === 0 ? "stretch" : "end",
|
|
6070
|
+
className: Me && r ? $.dock : Ze && t === 0 ? $.opening : void 0,
|
|
5992
6071
|
onTranscribe: s,
|
|
5993
6072
|
isActiveInput: r,
|
|
5994
|
-
inputRef: r ?
|
|
5995
|
-
entranceDelay: t === 0 ?
|
|
5996
|
-
selectionMode:
|
|
5997
|
-
highlights:
|
|
6073
|
+
inputRef: r ? Ce : null,
|
|
6074
|
+
entranceDelay: t === 0 ? ae : 0,
|
|
6075
|
+
selectionMode: xe,
|
|
6076
|
+
highlights: L,
|
|
5998
6077
|
animationConfig: Ne,
|
|
5999
|
-
foldMotion:
|
|
6000
|
-
openArtifactId:
|
|
6001
|
-
onOpenArtifact:
|
|
6002
|
-
onArtifactChange:
|
|
6078
|
+
foldMotion: ie,
|
|
6079
|
+
openArtifactId: it,
|
|
6080
|
+
onOpenArtifact: mt,
|
|
6081
|
+
onArtifactChange: ct,
|
|
6003
6082
|
placeholder: x,
|
|
6004
6083
|
onDraft: Ie,
|
|
6005
6084
|
onSubmit: Ge,
|
|
6006
|
-
onRegenerate:
|
|
6085
|
+
onRegenerate: Xe,
|
|
6007
6086
|
onShowVersion: W,
|
|
6008
6087
|
onFeedback: J,
|
|
6009
|
-
feedback:
|
|
6010
|
-
onStop: !
|
|
6011
|
-
busy:
|
|
6088
|
+
feedback: ut[e.id] ?? null,
|
|
6089
|
+
onStop: !Me || r ? Re : void 0,
|
|
6090
|
+
busy: Me && r ? He : void 0,
|
|
6012
6091
|
onEdit: ze,
|
|
6013
6092
|
onCancelEdit: Be,
|
|
6014
|
-
onHighlight:
|
|
6015
|
-
onReplyInThread: l ?
|
|
6093
|
+
onHighlight: pt,
|
|
6094
|
+
onReplyInThread: l ? ht : void 0,
|
|
6016
6095
|
onAnswerQuestion: Y,
|
|
6017
|
-
onEditQuestion:
|
|
6018
|
-
onDecideApproval:
|
|
6096
|
+
onEditQuestion: _t,
|
|
6097
|
+
onDecideApproval: vt,
|
|
6019
6098
|
renderPart: n,
|
|
6020
6099
|
composerMenu: a
|
|
6021
6100
|
}, e.id);
|
|
6022
6101
|
}) }),
|
|
6023
|
-
|
|
6102
|
+
$e && /* @__PURE__ */ _(Bn, { children: B.windowFull })
|
|
6024
6103
|
]
|
|
6025
6104
|
}),
|
|
6026
6105
|
/* @__PURE__ */ _("div", { className: $.bottomBlur })
|
|
6027
6106
|
]
|
|
6028
6107
|
});
|
|
6029
|
-
return /* @__PURE__ */ v(
|
|
6108
|
+
return /* @__PURE__ */ v(ke, {
|
|
6030
6109
|
labels: r,
|
|
6031
6110
|
children: [
|
|
6032
|
-
|
|
6033
|
-
/* @__PURE__ */ _(
|
|
6111
|
+
F && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), yt && /* @__PURE__ */ _(wi, {})] }),
|
|
6112
|
+
/* @__PURE__ */ _($r, {
|
|
6034
6113
|
className: $.workspace,
|
|
6035
6114
|
surface: j,
|
|
6036
|
-
"data-fill":
|
|
6037
|
-
style:
|
|
6038
|
-
onDismiss:
|
|
6039
|
-
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) =>
|
|
6040
|
-
title:
|
|
6041
|
-
meta:
|
|
6115
|
+
"data-fill": Ye ? void 0 : "container",
|
|
6116
|
+
style: Ye && qe > 0 ? { "--ick-keyboard": `${qe}px` } : void 0,
|
|
6117
|
+
onDismiss: lt,
|
|
6118
|
+
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => Ct ? /* @__PURE__ */ _(Ur, {
|
|
6119
|
+
title: Ct.title,
|
|
6120
|
+
meta: Ct.meta,
|
|
6042
6121
|
modal: e,
|
|
6043
6122
|
expanded: t,
|
|
6044
6123
|
onToggleExpanded: n,
|
|
6045
|
-
onClose:
|
|
6046
|
-
children:
|
|
6124
|
+
onClose: lt,
|
|
6125
|
+
children: Ct.children
|
|
6047
6126
|
}) : null,
|
|
6048
|
-
children:
|
|
6127
|
+
children: Tt
|
|
6049
6128
|
}),
|
|
6050
|
-
/* @__PURE__ */ _(y, { children:
|
|
6129
|
+
/* @__PURE__ */ _(y, { children: me && /* @__PURE__ */ _(C.div, {
|
|
6051
6130
|
className: $.scrim,
|
|
6052
6131
|
initial: { opacity: 0 },
|
|
6053
6132
|
animate: { opacity: 1 },
|
|
6054
6133
|
exit: { opacity: 0 },
|
|
6055
|
-
onClick: () =>
|
|
6134
|
+
onClick: () => ge(!1),
|
|
6056
6135
|
children: /* @__PURE__ */ v(C.div, {
|
|
6057
6136
|
className: $.sheet,
|
|
6058
6137
|
role: "dialog",
|
|
6059
|
-
"aria-label":
|
|
6138
|
+
"aria-label": B.savedHighlights,
|
|
6060
6139
|
initial: {
|
|
6061
6140
|
y: 20,
|
|
6062
6141
|
scale: .95
|
|
@@ -6074,24 +6153,24 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6074
6153
|
className: $.sheetHead,
|
|
6075
6154
|
children: [/* @__PURE__ */ _("h2", {
|
|
6076
6155
|
className: $.sheetTitle,
|
|
6077
|
-
children:
|
|
6156
|
+
children: B.highlights
|
|
6078
6157
|
}), /* @__PURE__ */ _("button", {
|
|
6079
6158
|
className: $.close,
|
|
6080
|
-
onClick: () =>
|
|
6081
|
-
children:
|
|
6159
|
+
onClick: () => ge(!1),
|
|
6160
|
+
children: B.close
|
|
6082
6161
|
})]
|
|
6083
|
-
}), Array.from(new Set(
|
|
6162
|
+
}), Array.from(new Set(fe.map((e) => e.turnId))).map((e, t) => /* @__PURE__ */ v("div", {
|
|
6084
6163
|
className: $.group,
|
|
6085
6164
|
children: [/* @__PURE__ */ _("h3", {
|
|
6086
6165
|
className: $.groupTitle,
|
|
6087
|
-
children:
|
|
6166
|
+
children: Ae(B.paragraph, { index: t + 1 })
|
|
6088
6167
|
}), /* @__PURE__ */ _("div", {
|
|
6089
6168
|
className: $.marks,
|
|
6090
|
-
children:
|
|
6169
|
+
children: fe.filter((t) => t.turnId === e).map((t, n) => /* @__PURE__ */ _("button", {
|
|
6091
6170
|
type: "button",
|
|
6092
6171
|
className: $.mark,
|
|
6093
6172
|
onClick: () => {
|
|
6094
|
-
|
|
6173
|
+
ge(!1), setTimeout(() => {
|
|
6095
6174
|
let t = document.getElementById(`turn-${e}`), n = document.querySelector(".ick-chat-feed"), r = document.querySelector(".ick-chat-header");
|
|
6096
6175
|
if (t && n) {
|
|
6097
6176
|
let e = r ? r.offsetHeight : 80;
|
|
@@ -6111,15 +6190,15 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6111
6190
|
}, e))]
|
|
6112
6191
|
})
|
|
6113
6192
|
}) }),
|
|
6114
|
-
/* @__PURE__ */ _(y, { children:
|
|
6115
|
-
activeReply:
|
|
6116
|
-
onClose: () =>
|
|
6193
|
+
/* @__PURE__ */ _(y, { children: ye && l && /* @__PURE__ */ _(Ci, {
|
|
6194
|
+
activeReply: ye,
|
|
6195
|
+
onClose: () => be(null),
|
|
6117
6196
|
onSendMessage: l
|
|
6118
6197
|
}, "thread-popup") })
|
|
6119
6198
|
]
|
|
6120
6199
|
});
|
|
6121
6200
|
}
|
|
6122
6201
|
//#endregion
|
|
6123
|
-
export {
|
|
6202
|
+
export { De as $, pn as A, vt as B, Cn as C, yn as D, xn as E, Ht as F, Qe as G, ct as H, Nt as I, Re as J, Ke as K, jt as L, nn as M, Jt as N, _n as O, $t as P, ke as Q, kt as R, wn as S, En as T, st as U, gt as V, rt as W, Fe as X, Le as Y, je as Z, Rn as _, mi as a, Mn as b, $r as c, Ir as d, H as et, Mr as f, In as g, Bn as h, Ci as i, ln as j, hn as k, Ur as l, Wn as m, Ti as n, fi as o, Sr as p, Be as q, wi as r, ei as s, Oi as t, Vr as u, Ln as v, Tn as w, Sn as x, Pn as y, wt as z };
|
|
6124
6203
|
|
|
6125
|
-
//# sourceMappingURL=ChatExperience-
|
|
6204
|
+
//# sourceMappingURL=ChatExperience-umh3nGe_.js.map
|