inline-chat-kit 0.55.1 → 0.55.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 +33 -0
- package/dist/{ChatExperience-C2UXwrrI.js → ChatExperience-BwjmNCvw.js} +762 -769
- package/dist/ChatExperience-BwjmNCvw.js.map +1 -0
- package/dist/demo/ChatExperienceDemo.d.ts +4 -1
- package/dist/demo.js +4 -4
- package/dist/demo.js.map +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-C2UXwrrI.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import e, { createElement as t, forwardRef as n, isValidElement as r, memo as i, useCallback as a, useEffect as o, useId as s, useImperativeHandle as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
|
|
3
3
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
4
4
|
import { AnimatePresence as _, LayoutGroup as v, MotionConfig as y, animate as b, motion as x, useAnimationControls as S, useMotionValue as C, useReducedMotion as w } from "motion/react";
|
|
5
|
-
import { ArrowDown as T, ArrowLeft as E, Bookmark as D, Brain as O, Check as k, ChevronDown as A, ChevronLeft as j, ChevronRight as M, Copy as N, CornerDownLeft as P, File as ee, FileText as F, Film as I, Highlighter as te, Image as L, Link2 as ne, Maximize2 as R, MessageCircle as re, Mic as ie, Minimize2 as ae, Moon as oe, MoreHorizontal as se, Music as ce, Palette as le, Paperclip as ue, Pencil as de, Plus as fe, RotateCcw as
|
|
6
|
-
var
|
|
5
|
+
import { ArrowDown as T, ArrowLeft as E, Bookmark as D, Brain as O, Check as k, ChevronDown as A, ChevronLeft as j, ChevronRight as M, Copy as N, CornerDownLeft as P, File as ee, FileText as F, Film as I, Highlighter as te, Image as L, Link2 as ne, Maximize2 as R, MessageCircle as re, Mic as ie, Minimize2 as ae, Moon as oe, MoreHorizontal as se, Music as ce, Palette as le, Paperclip as ue, Pencil as de, Plus as fe, RotateCcw as pe, Save as me, Share as he, Square as ge, Sun as _e, TextCursor as z, ThumbsDown as B, ThumbsUp as ve, Trash2 as ye, TriangleAlert as be, X as xe } 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 H = {
|
|
|
21
21
|
loading: "ick-loading-NCs-",
|
|
22
22
|
spinner: "ick-spinner-0n6Q",
|
|
23
23
|
spin: "ick-spin-QgE6"
|
|
24
|
-
}, xe = {
|
|
25
|
-
primary: H.primary,
|
|
26
|
-
secondary: H.secondary,
|
|
27
|
-
outline: H.outline,
|
|
28
|
-
ghost: H.ghost,
|
|
29
|
-
glass: H.glass
|
|
30
24
|
}, Se = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
25
|
+
primary: V.primary,
|
|
26
|
+
secondary: V.secondary,
|
|
27
|
+
outline: V.outline,
|
|
28
|
+
ghost: V.ghost,
|
|
29
|
+
glass: V.glass
|
|
30
|
+
}, Ce = {
|
|
31
|
+
xs: V.xs,
|
|
32
|
+
s: V.s,
|
|
33
|
+
m: V.m,
|
|
34
|
+
l: V.l,
|
|
35
|
+
xl: V.xl
|
|
36
|
+
}, H = n(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
|
+
Se[e],
|
|
40
|
+
Ce[t],
|
|
41
|
+
a ? V.hasText : "",
|
|
42
|
+
i ? V.loading : "",
|
|
43
43
|
o ?? ""
|
|
44
44
|
].filter(Boolean).join(" ");
|
|
45
45
|
return /* @__PURE__ */ g("button", {
|
|
@@ -50,24 +50,24 @@ var H = {
|
|
|
50
50
|
...c,
|
|
51
51
|
children: [
|
|
52
52
|
n && /* @__PURE__ */ h("span", {
|
|
53
|
-
className:
|
|
53
|
+
className: V.icon,
|
|
54
54
|
children: n
|
|
55
55
|
}),
|
|
56
56
|
a && /* @__PURE__ */ h("span", {
|
|
57
|
-
className:
|
|
57
|
+
className: V.label,
|
|
58
58
|
children: a
|
|
59
59
|
}),
|
|
60
60
|
r && /* @__PURE__ */ h("span", {
|
|
61
|
-
className:
|
|
61
|
+
className: V.icon,
|
|
62
62
|
children: r
|
|
63
63
|
}),
|
|
64
64
|
i && /* @__PURE__ */ h("span", {
|
|
65
|
-
className:
|
|
65
|
+
className: V.spinner,
|
|
66
66
|
"aria-hidden": "true"
|
|
67
67
|
})
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
|
-
}),
|
|
70
|
+
}), U = {
|
|
71
71
|
list: "ick-list-4-Xw",
|
|
72
72
|
item: "ick-item-5jP3",
|
|
73
73
|
picture: "ick-picture-JacB",
|
|
@@ -102,39 +102,39 @@ function ke({ attachments: e, onRemove: t, labels: n, className: r, ...i }) {
|
|
|
102
102
|
...n
|
|
103
103
|
};
|
|
104
104
|
return e.length === 0 ? null : /* @__PURE__ */ h("ul", {
|
|
105
|
-
className: [
|
|
105
|
+
className: [U.list, r ?? ""].filter(Boolean).join(" "),
|
|
106
106
|
...i,
|
|
107
107
|
children: e.map((e) => {
|
|
108
108
|
let n = Te(e.size);
|
|
109
109
|
return /* @__PURE__ */ g("li", {
|
|
110
|
-
className:
|
|
110
|
+
className: U.item,
|
|
111
111
|
"data-picture": Ee(e) || void 0,
|
|
112
112
|
children: [Ee(e) ? /* @__PURE__ */ h("span", {
|
|
113
|
-
className:
|
|
113
|
+
className: U.picture,
|
|
114
114
|
style: { backgroundImage: `url("${De(e.url)}")` },
|
|
115
115
|
role: "img",
|
|
116
116
|
"aria-label": e.name
|
|
117
117
|
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
118
|
-
className:
|
|
118
|
+
className: U.glyph,
|
|
119
119
|
children: /* @__PURE__ */ h(Oe, { type: e.type })
|
|
120
120
|
}), /* @__PURE__ */ g("span", {
|
|
121
|
-
className:
|
|
121
|
+
className: U.body,
|
|
122
122
|
children: [/* @__PURE__ */ h("span", {
|
|
123
|
-
className:
|
|
123
|
+
className: U.name,
|
|
124
124
|
children: e.name
|
|
125
125
|
}), n && /* @__PURE__ */ h("span", {
|
|
126
|
-
className:
|
|
126
|
+
className: U.size,
|
|
127
127
|
children: n
|
|
128
128
|
})]
|
|
129
129
|
})] }), t && /* @__PURE__ */ h("span", {
|
|
130
|
-
className:
|
|
131
|
-
children: /* @__PURE__ */ h(
|
|
130
|
+
className: U.remove,
|
|
131
|
+
children: /* @__PURE__ */ h(H, {
|
|
132
132
|
variant: "glass",
|
|
133
133
|
size: "s",
|
|
134
134
|
onClick: () => t(e.id),
|
|
135
135
|
onPointerDown: (e) => e.stopPropagation(),
|
|
136
136
|
"aria-label": `${a.remove} ${e.name}`,
|
|
137
|
-
icon: /* @__PURE__ */ h(
|
|
137
|
+
icon: /* @__PURE__ */ h(xe, {
|
|
138
138
|
size: 14,
|
|
139
139
|
"aria-hidden": !0
|
|
140
140
|
})
|
|
@@ -208,7 +208,7 @@ function je({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
|
|
|
208
208
|
strokeWidth: 2.2,
|
|
209
209
|
strokeLinecap: "round",
|
|
210
210
|
strokeLinejoin: "round"
|
|
211
|
-
}) : /* @__PURE__ */ h(
|
|
211
|
+
}) : /* @__PURE__ */ h(ge, {
|
|
212
212
|
size: r,
|
|
213
213
|
color: t,
|
|
214
214
|
fill: t,
|
|
@@ -291,7 +291,7 @@ function Me({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
291
291
|
},
|
|
292
292
|
exit: {}
|
|
293
293
|
},
|
|
294
|
-
children: /* @__PURE__ */ h(
|
|
294
|
+
children: /* @__PURE__ */ h(H, {
|
|
295
295
|
variant: "ghost",
|
|
296
296
|
icon: n ? "Read less" : "Read more",
|
|
297
297
|
onClick: (e) => {
|
|
@@ -336,7 +336,7 @@ function Me({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
336
336
|
},
|
|
337
337
|
exit: {}
|
|
338
338
|
},
|
|
339
|
-
children: /* @__PURE__ */ h(
|
|
339
|
+
children: /* @__PURE__ */ h(H, {
|
|
340
340
|
variant: "ghost",
|
|
341
341
|
icon: e,
|
|
342
342
|
onClick: t,
|
|
@@ -470,9 +470,9 @@ function Pe({ isAddOpen: e, setIsAddOpen: t, onAdd: n, showInlineGlyph: r, showB
|
|
|
470
470
|
pointerEvents: "auto",
|
|
471
471
|
zIndex: 10
|
|
472
472
|
},
|
|
473
|
-
children: /* @__PURE__ */ h(
|
|
473
|
+
children: /* @__PURE__ */ h(H, {
|
|
474
474
|
variant: "ghost",
|
|
475
|
-
icon: /* @__PURE__ */ h(
|
|
475
|
+
icon: /* @__PURE__ */ h(xe, {
|
|
476
476
|
size: 14,
|
|
477
477
|
"aria-hidden": !0
|
|
478
478
|
}),
|
|
@@ -680,7 +680,7 @@ function Ye(e, t) {
|
|
|
680
680
|
let r = document.createRange(), i = window.getSelection();
|
|
681
681
|
r.setStart(n, Math.max(0, Math.min(t, n.textContent?.length ?? 0))), r.collapse(!0), i?.removeAllRanges(), i?.addRange(r);
|
|
682
682
|
}
|
|
683
|
-
var Xe = {
|
|
683
|
+
var Xe = .9, Ze = {
|
|
684
684
|
bubble: {
|
|
685
685
|
stiffness: 600,
|
|
686
686
|
damping: 22,
|
|
@@ -732,12 +732,12 @@ var Xe = {
|
|
|
732
732
|
angle3: -50,
|
|
733
733
|
hoverPull: 12
|
|
734
734
|
}
|
|
735
|
-
},
|
|
735
|
+
}, Qe = {
|
|
736
736
|
type: "spring",
|
|
737
737
|
stiffness: 600,
|
|
738
738
|
damping: 21.5,
|
|
739
739
|
mass: .2
|
|
740
|
-
},
|
|
740
|
+
}, $e = (e) => {
|
|
741
741
|
if (typeof document.execCommand == "function") try {
|
|
742
742
|
if (document.execCommand("insertText", !1, e)) return !0;
|
|
743
743
|
} catch {}
|
|
@@ -747,14 +747,14 @@ var Xe = {
|
|
|
747
747
|
n.deleteContents();
|
|
748
748
|
let r = document.createTextNode(e);
|
|
749
749
|
return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
|
|
750
|
-
},
|
|
751
|
-
let ee = s(), F = d(null), I = d(null), te = d(null), L = d(0), ne = d(!1), R = d(null), [re, ie] = f(!1), [ae, oe] = f(!1), [se, ce] = f(!1), [le, ue] = f(!0), [de,
|
|
750
|
+
}, et = n(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: l, attachments: u, onAttach: p, onRemoveAttachment: C, accept: w = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, placeholder: j = "Ask anything…", animationConfig: M, style: N }, P) {
|
|
751
|
+
let ee = s(), F = d(null), I = d(null), te = d(null), L = d(0), ne = d(!1), R = d(null), [re, ie] = f(!1), [ae, oe] = f(!1), [se, ce] = f(!1), [le, ue] = f(!0), [de, pe] = f(!1), [me, he] = f(!1), [ge, _e] = f(!1), z = d(0), B = d(!1), ve = d(0), ye = d(!1), be = d(null);
|
|
752
752
|
o(() => () => {
|
|
753
|
-
|
|
753
|
+
be.current && clearTimeout(be.current);
|
|
754
754
|
}, []);
|
|
755
|
-
let
|
|
756
|
-
|
|
757
|
-
let
|
|
755
|
+
let V = S(), Se = d(e), Ce = d(M);
|
|
756
|
+
Ce.current = M;
|
|
757
|
+
let U = d(null), [we, Te] = f([]), Ee = u ?? we, De = d(Ee);
|
|
758
758
|
De.current = Ee;
|
|
759
759
|
let Oe = d([]);
|
|
760
760
|
o(() => () => {
|
|
@@ -824,12 +824,12 @@ var Xe = {
|
|
|
824
824
|
Le.current = null, F.current?.focus();
|
|
825
825
|
},
|
|
826
826
|
meterRef: Ie
|
|
827
|
-
}), K = e === "responding" || e === "resting", ze = K, Be = t.trim().length > 0 || Ee.length > 0, q = (e === "typing" || e === "idle") && Be, Ve = e === "responding", He = e === "resting" && re, Ue = He, We = e === "resting" &&
|
|
827
|
+
}), K = e === "responding" || e === "resting", ze = K, Be = t.trim().length > 0 || Ee.length > 0, q = (e === "typing" || e === "idle") && Be, Ve = e === "responding", He = e === "resting" && re, Ue = He, We = e === "resting" && me, Ge = G.state === "listening" || G.state === "requesting" || G.state === "transcribing", Ze = !!E && G.supported && !A, et = q || Ve, J = M, tt = J ? {
|
|
828
828
|
type: "spring",
|
|
829
829
|
stiffness: J.bubble.stiffness,
|
|
830
830
|
damping: J.bubble.damping,
|
|
831
831
|
mass: J.bubble.mass
|
|
832
|
-
} :
|
|
832
|
+
} : Qe, nt = a(() => {
|
|
833
833
|
let e = I.current, t = te.current;
|
|
834
834
|
if (!e || !t) return;
|
|
835
835
|
if (!(e.scrollHeight > e.clientHeight)) {
|
|
@@ -841,27 +841,27 @@ var Xe = {
|
|
|
841
841
|
}, []);
|
|
842
842
|
o(() => {
|
|
843
843
|
let e = I.current;
|
|
844
|
-
if (e) return e.addEventListener("scroll",
|
|
845
|
-
}, [
|
|
844
|
+
if (e) return e.addEventListener("scroll", nt, { passive: !0 }), () => e.removeEventListener("scroll", nt);
|
|
845
|
+
}, [nt]), o(() => {
|
|
846
846
|
let e = requestAnimationFrame(() => {
|
|
847
847
|
let e = I.current;
|
|
848
|
-
e && !ze && (e.scrollTop = e.scrollHeight),
|
|
848
|
+
e && !ze && (e.scrollTop = e.scrollHeight), nt();
|
|
849
849
|
});
|
|
850
850
|
return () => cancelAnimationFrame(e);
|
|
851
851
|
}, [
|
|
852
852
|
t,
|
|
853
853
|
ze,
|
|
854
|
-
|
|
854
|
+
nt
|
|
855
855
|
]), o(() => {
|
|
856
856
|
(e === "idle" || e === "typing") && F.current?.focus({ preventScroll: !0 });
|
|
857
857
|
}, [e]), o(() => {
|
|
858
858
|
let e = F.current;
|
|
859
|
-
e && (
|
|
859
|
+
e && (z.current = e.scrollHeight || 17);
|
|
860
860
|
}, []), o(() => {
|
|
861
861
|
let e = F.current, t = R.current;
|
|
862
|
-
!e || !
|
|
863
|
-
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (I.current?.scrollHeight ?? 0) >
|
|
864
|
-
|
|
862
|
+
!e || !z.current || requestAnimationFrame(() => {
|
|
863
|
+
let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (I.current?.scrollHeight ?? 0) > z.current + 2, a = Ce.current;
|
|
864
|
+
B.current ? !(i || n >= r - 2) && n < ve.current * (a?.wrap?.exitThreshold ?? .75) && (B.current = !1, ye.current = !1, ce(!1), ue(!0), be.current &&= (clearTimeout(be.current), null)) : (ve.current = r, (i || n >= ve.current * (a?.wrap?.nearThreshold ?? .92)) && (B.current = !0, ye.current = !0, ue(!1)));
|
|
865
865
|
});
|
|
866
866
|
}, [t]), o(() => {
|
|
867
867
|
if (!K) return;
|
|
@@ -878,24 +878,24 @@ var Xe = {
|
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
}, [K]), o(() => {
|
|
881
|
-
K ?
|
|
881
|
+
K ? _e(!1) : (pe(!1), he(!1));
|
|
882
882
|
}, [K]), o(() => {
|
|
883
883
|
if (!K) return;
|
|
884
884
|
let e = te.current;
|
|
885
|
-
e && (
|
|
885
|
+
e && (me && !de ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
|
|
886
886
|
}, [
|
|
887
887
|
K,
|
|
888
|
-
|
|
888
|
+
me,
|
|
889
889
|
de
|
|
890
890
|
]), o(() => {
|
|
891
|
-
let t =
|
|
892
|
-
if (
|
|
891
|
+
let t = Se.current;
|
|
892
|
+
if (Se.current = e, t !== "responding" || e !== "resting") return;
|
|
893
893
|
requestAnimationFrame(() => {
|
|
894
894
|
let e = I.current;
|
|
895
|
-
e && (L.current = e.scrollHeight,
|
|
895
|
+
e && (L.current = e.scrollHeight, he(e.scrollHeight > 241), nt());
|
|
896
896
|
}), oe(!0);
|
|
897
|
-
let n =
|
|
898
|
-
|
|
897
|
+
let n = Ce.current;
|
|
898
|
+
V.start({
|
|
899
899
|
scaleX: [
|
|
900
900
|
1,
|
|
901
901
|
n?.ripple?.scaleX ?? 1.018,
|
|
@@ -920,20 +920,20 @@ var Xe = {
|
|
|
920
920
|
return () => clearTimeout(r);
|
|
921
921
|
}, [
|
|
922
922
|
e,
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
V,
|
|
924
|
+
nt
|
|
925
925
|
]);
|
|
926
|
-
let
|
|
926
|
+
let rt = a(() => {
|
|
927
927
|
let e = F.current;
|
|
928
928
|
e && (ne.current = !0, n(e.textContent ?? ""));
|
|
929
|
-
}, [n]),
|
|
930
|
-
e.preventDefault(),
|
|
931
|
-
}, [
|
|
932
|
-
e.key === "Enter" && (e.preventDefault(), !e.shiftKey && (t.trim().length > 0 || De.current.length > 0) ? r(t, De.current) : e.shiftKey &&
|
|
929
|
+
}, [n]), it = a((e) => {
|
|
930
|
+
e.preventDefault(), $e(e.clipboardData.getData("text/plain")) || rt();
|
|
931
|
+
}, [rt]), at = a((e) => {
|
|
932
|
+
e.key === "Enter" && (e.preventDefault(), !e.shiftKey && (t.trim().length > 0 || De.current.length > 0) ? r(t, De.current) : e.shiftKey && !$e("\n") && rt());
|
|
933
933
|
}, [
|
|
934
934
|
t,
|
|
935
935
|
r,
|
|
936
|
-
|
|
936
|
+
rt
|
|
937
937
|
]);
|
|
938
938
|
return o(() => {
|
|
939
939
|
let e = F.current;
|
|
@@ -957,14 +957,14 @@ var Xe = {
|
|
|
957
957
|
/* @__PURE__ */ h(x.div, {
|
|
958
958
|
className: `${W.root} ${K ? W.isGlassRoot : ""}`,
|
|
959
959
|
layout: !0,
|
|
960
|
-
animate: { filter:
|
|
960
|
+
animate: { filter: ge ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
|
|
961
961
|
style: {
|
|
962
|
-
pointerEvents:
|
|
962
|
+
pointerEvents: ge ? "none" : "auto",
|
|
963
963
|
width: N?.width === "100%" ? "100%" : void 0,
|
|
964
964
|
maxWidth: N?.maxWidth
|
|
965
965
|
},
|
|
966
966
|
transition: {
|
|
967
|
-
...
|
|
967
|
+
...tt,
|
|
968
968
|
filter: {
|
|
969
969
|
type: "tween",
|
|
970
970
|
duration: .2,
|
|
@@ -978,13 +978,13 @@ var Xe = {
|
|
|
978
978
|
flexDirection: "column",
|
|
979
979
|
justifyContent: "center"
|
|
980
980
|
},
|
|
981
|
-
transition:
|
|
982
|
-
animate:
|
|
981
|
+
transition: tt,
|
|
982
|
+
animate: V,
|
|
983
983
|
onClick: () => F.current?.focus(),
|
|
984
984
|
children: [
|
|
985
985
|
/* @__PURE__ */ h("input", {
|
|
986
986
|
type: "file",
|
|
987
|
-
ref:
|
|
987
|
+
ref: U,
|
|
988
988
|
accept: w,
|
|
989
989
|
multiple: T,
|
|
990
990
|
style: { display: "none" },
|
|
@@ -1055,9 +1055,9 @@ var Xe = {
|
|
|
1055
1055
|
ref: I,
|
|
1056
1056
|
className: `${W.editorWrap} ${K ? W.editorWrapGlass : ""}`,
|
|
1057
1057
|
layout: "position",
|
|
1058
|
-
animate: K &&
|
|
1058
|
+
animate: K && me ? { maxHeight: de ? L.current : 240 } : void 0,
|
|
1059
1059
|
transition: {
|
|
1060
|
-
...
|
|
1060
|
+
...tt,
|
|
1061
1061
|
maxHeight: {
|
|
1062
1062
|
type: "spring",
|
|
1063
1063
|
stiffness: 300,
|
|
@@ -1070,9 +1070,9 @@ var Xe = {
|
|
|
1070
1070
|
className: W.editor,
|
|
1071
1071
|
contentEditable: ze ? "false" : "plaintext-only",
|
|
1072
1072
|
suppressContentEditableWarning: !0,
|
|
1073
|
-
onInput:
|
|
1074
|
-
onKeyDown:
|
|
1075
|
-
onPaste:
|
|
1073
|
+
onInput: rt,
|
|
1074
|
+
onKeyDown: at,
|
|
1075
|
+
onPaste: it,
|
|
1076
1076
|
spellCheck: !1,
|
|
1077
1077
|
role: "textbox",
|
|
1078
1078
|
"aria-multiline": "true",
|
|
@@ -1083,28 +1083,25 @@ var Xe = {
|
|
|
1083
1083
|
}),
|
|
1084
1084
|
/* @__PURE__ */ g("div", {
|
|
1085
1085
|
className: W.buttonGroup,
|
|
1086
|
-
children: [!K && le &&
|
|
1086
|
+
children: [!K && le && Ze && /* @__PURE__ */ h(x.div, {
|
|
1087
1087
|
initial: {
|
|
1088
1088
|
opacity: 0,
|
|
1089
|
-
scale:
|
|
1089
|
+
scale: Xe,
|
|
1090
1090
|
width: 0,
|
|
1091
|
-
height: 0,
|
|
1092
1091
|
marginLeft: 0
|
|
1093
1092
|
},
|
|
1094
1093
|
animate: {
|
|
1095
1094
|
opacity: 1,
|
|
1096
1095
|
scale: 1,
|
|
1097
1096
|
width: 28,
|
|
1098
|
-
height: 28,
|
|
1099
1097
|
marginLeft: 2
|
|
1100
1098
|
},
|
|
1101
1099
|
exit: {
|
|
1102
1100
|
opacity: 0,
|
|
1103
|
-
scale:
|
|
1101
|
+
scale: Xe,
|
|
1104
1102
|
width: 0,
|
|
1105
|
-
height: 0,
|
|
1106
1103
|
marginLeft: 0,
|
|
1107
|
-
transition:
|
|
1104
|
+
transition: ye.current ? {
|
|
1108
1105
|
type: "tween",
|
|
1109
1106
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1110
1107
|
ease: "easeOut",
|
|
@@ -1126,9 +1123,10 @@ var Xe = {
|
|
|
1126
1123
|
justifyContent: "center",
|
|
1127
1124
|
alignItems: "center",
|
|
1128
1125
|
flexShrink: 0,
|
|
1129
|
-
position: "relative"
|
|
1126
|
+
position: "relative",
|
|
1127
|
+
height: 28
|
|
1130
1128
|
},
|
|
1131
|
-
children: /* @__PURE__ */ h(
|
|
1129
|
+
children: /* @__PURE__ */ h(H, {
|
|
1132
1130
|
variant: "ghost",
|
|
1133
1131
|
"data-voice": G.state,
|
|
1134
1132
|
icon: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
@@ -1165,29 +1163,26 @@ var Xe = {
|
|
|
1165
1163
|
}, "mic"), /* @__PURE__ */ g(_, {
|
|
1166
1164
|
initial: !1,
|
|
1167
1165
|
onExitComplete: () => {
|
|
1168
|
-
|
|
1169
|
-
ue(!0),
|
|
1170
|
-
},
|
|
1166
|
+
ye.current && (ye.current = !1, ce(!0), be.current && clearTimeout(be.current), be.current = window.setTimeout(() => {
|
|
1167
|
+
ue(!0), be.current = null;
|
|
1168
|
+
}, Ce.current?.wrap?.slideInDelay ?? 120));
|
|
1171
1169
|
},
|
|
1172
1170
|
children: [!K && le && /* @__PURE__ */ h(x.div, {
|
|
1173
1171
|
initial: {
|
|
1174
1172
|
opacity: 0,
|
|
1175
|
-
scale:
|
|
1176
|
-
width: 0
|
|
1177
|
-
height: 0
|
|
1173
|
+
scale: Xe,
|
|
1174
|
+
width: 0
|
|
1178
1175
|
},
|
|
1179
1176
|
animate: {
|
|
1180
1177
|
opacity: 1,
|
|
1181
1178
|
scale: 1,
|
|
1182
|
-
width: 28
|
|
1183
|
-
height: 28
|
|
1179
|
+
width: 28
|
|
1184
1180
|
},
|
|
1185
1181
|
exit: {
|
|
1186
1182
|
opacity: 0,
|
|
1187
|
-
scale:
|
|
1183
|
+
scale: Xe,
|
|
1188
1184
|
width: 0,
|
|
1189
|
-
|
|
1190
|
-
transition: ve.current ? {
|
|
1185
|
+
transition: ye.current ? {
|
|
1191
1186
|
type: "tween",
|
|
1192
1187
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1193
1188
|
ease: "easeOut",
|
|
@@ -1209,7 +1204,8 @@ var Xe = {
|
|
|
1209
1204
|
justifyContent: "center",
|
|
1210
1205
|
alignItems: "center",
|
|
1211
1206
|
flexShrink: 0,
|
|
1212
|
-
position: "relative"
|
|
1207
|
+
position: "relative",
|
|
1208
|
+
height: 28
|
|
1213
1209
|
},
|
|
1214
1210
|
children: /* @__PURE__ */ h(_, {
|
|
1215
1211
|
mode: "popLayout",
|
|
@@ -1238,9 +1234,9 @@ var Xe = {
|
|
|
1238
1234
|
position: "absolute",
|
|
1239
1235
|
inset: 0
|
|
1240
1236
|
},
|
|
1241
|
-
children: /* @__PURE__ */ h(
|
|
1237
|
+
children: /* @__PURE__ */ h(H, {
|
|
1242
1238
|
variant: "ghost",
|
|
1243
|
-
icon: /* @__PURE__ */ h(
|
|
1239
|
+
icon: /* @__PURE__ */ h(xe, {
|
|
1244
1240
|
size: 14,
|
|
1245
1241
|
"aria-hidden": !0
|
|
1246
1242
|
}),
|
|
@@ -1254,7 +1250,7 @@ var Xe = {
|
|
|
1254
1250
|
height: "100%"
|
|
1255
1251
|
}
|
|
1256
1252
|
})
|
|
1257
|
-
}, "cancel-btn") :
|
|
1253
|
+
}, "cancel-btn") : ge ? null : /* @__PURE__ */ h(x.div, {
|
|
1258
1254
|
initial: {
|
|
1259
1255
|
opacity: 0,
|
|
1260
1256
|
scale: .5
|
|
@@ -1275,14 +1271,14 @@ var Xe = {
|
|
|
1275
1271
|
position: "absolute",
|
|
1276
1272
|
inset: 0
|
|
1277
1273
|
},
|
|
1278
|
-
children: /* @__PURE__ */ h(
|
|
1274
|
+
children: /* @__PURE__ */ h(H, {
|
|
1279
1275
|
variant: "ghost",
|
|
1280
1276
|
icon: /* @__PURE__ */ h(fe, {
|
|
1281
1277
|
size: 14,
|
|
1282
1278
|
"aria-hidden": !0
|
|
1283
1279
|
}),
|
|
1284
1280
|
onClick: (e) => {
|
|
1285
|
-
e.stopPropagation(),
|
|
1281
|
+
e.stopPropagation(), _e(!0);
|
|
1286
1282
|
},
|
|
1287
1283
|
"aria-label": "Add",
|
|
1288
1284
|
title: "Add",
|
|
@@ -1293,28 +1289,25 @@ var Xe = {
|
|
|
1293
1289
|
})
|
|
1294
1290
|
}, "plus-btn")
|
|
1295
1291
|
})
|
|
1296
|
-
}, "lead"),
|
|
1292
|
+
}, "lead"), et && le && /* @__PURE__ */ h(x.div, {
|
|
1297
1293
|
initial: {
|
|
1298
1294
|
opacity: 0,
|
|
1299
|
-
scale:
|
|
1295
|
+
scale: Xe,
|
|
1300
1296
|
width: 0,
|
|
1301
|
-
height: 0,
|
|
1302
1297
|
marginLeft: 0
|
|
1303
1298
|
},
|
|
1304
1299
|
animate: {
|
|
1305
1300
|
opacity: 1,
|
|
1306
1301
|
scale: 1,
|
|
1307
1302
|
width: 28,
|
|
1308
|
-
height: 28,
|
|
1309
1303
|
marginLeft: 8
|
|
1310
1304
|
},
|
|
1311
1305
|
exit: {
|
|
1312
1306
|
opacity: 0,
|
|
1313
|
-
scale:
|
|
1307
|
+
scale: Xe,
|
|
1314
1308
|
width: 0,
|
|
1315
|
-
height: 0,
|
|
1316
1309
|
marginLeft: 0,
|
|
1317
|
-
transition:
|
|
1310
|
+
transition: ye.current ? {
|
|
1318
1311
|
type: "tween",
|
|
1319
1312
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1320
1313
|
ease: "easeOut"
|
|
@@ -1326,9 +1319,8 @@ var Xe = {
|
|
|
1326
1319
|
type: "tween",
|
|
1327
1320
|
duration: .15
|
|
1328
1321
|
},
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
marginLeft: et
|
|
1322
|
+
width: tt,
|
|
1323
|
+
marginLeft: tt
|
|
1332
1324
|
}
|
|
1333
1325
|
},
|
|
1334
1326
|
transition: {
|
|
@@ -1346,9 +1338,10 @@ var Xe = {
|
|
|
1346
1338
|
alignItems: "center",
|
|
1347
1339
|
flexShrink: 0,
|
|
1348
1340
|
overflow: "visible",
|
|
1349
|
-
transformOrigin: "right"
|
|
1341
|
+
transformOrigin: "right",
|
|
1342
|
+
height: 28
|
|
1350
1343
|
},
|
|
1351
|
-
children: /* @__PURE__ */ h(
|
|
1344
|
+
children: /* @__PURE__ */ h(H, {
|
|
1352
1345
|
variant: "primary",
|
|
1353
1346
|
icon: /* @__PURE__ */ h(je, { mode: Ve ? "stop" : A ? "check" : "send" }),
|
|
1354
1347
|
onClick: (e) => {
|
|
@@ -1369,12 +1362,12 @@ var Xe = {
|
|
|
1369
1362
|
})
|
|
1370
1363
|
}),
|
|
1371
1364
|
/* @__PURE__ */ h(Pe, {
|
|
1372
|
-
isAddOpen:
|
|
1373
|
-
setIsAddOpen:
|
|
1365
|
+
isAddOpen: ge,
|
|
1366
|
+
setIsAddOpen: _e,
|
|
1374
1367
|
onAdd: (e) => {
|
|
1375
|
-
(!e || e === "Add") &&
|
|
1368
|
+
(!e || e === "Add") && U.current?.click(), l?.();
|
|
1376
1369
|
},
|
|
1377
|
-
showInlineGlyph:
|
|
1370
|
+
showInlineGlyph: et,
|
|
1378
1371
|
showButtons: le,
|
|
1379
1372
|
ac: J
|
|
1380
1373
|
}),
|
|
@@ -1382,13 +1375,13 @@ var Xe = {
|
|
|
1382
1375
|
showActions: Ue,
|
|
1383
1376
|
showReadMore: We,
|
|
1384
1377
|
isExpanded: de,
|
|
1385
|
-
setIsExpanded:
|
|
1378
|
+
setIsExpanded: pe,
|
|
1386
1379
|
onCopy: D,
|
|
1387
1380
|
onEdit: O,
|
|
1388
1381
|
value: t,
|
|
1389
1382
|
ac: J
|
|
1390
1383
|
}),
|
|
1391
|
-
|
|
1384
|
+
Ze && (G.state === "denied" || G.state === "failed") && /* @__PURE__ */ h("p", {
|
|
1392
1385
|
className: W.voiceNote,
|
|
1393
1386
|
"data-tone": G.state,
|
|
1394
1387
|
children: G.state === "denied" ? "Microphone access is blocked. Allow it for this site in your browser settings, then reload." : G.error ?? "The microphone could not be opened."
|
|
@@ -1411,15 +1404,15 @@ function J(e, t) {
|
|
|
1411
1404
|
}
|
|
1412
1405
|
//#endregion
|
|
1413
1406
|
//#region src/useChatTurns/useChatTurns.ts
|
|
1414
|
-
var
|
|
1415
|
-
id:
|
|
1407
|
+
var tt = 260, nt = 220, rt = "Generating response", it = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2, 11), at = () => ({
|
|
1408
|
+
id: it(),
|
|
1416
1409
|
user: "",
|
|
1417
1410
|
ai: "",
|
|
1418
1411
|
parts: [],
|
|
1419
1412
|
versions: [],
|
|
1420
1413
|
versionIndex: 0,
|
|
1421
1414
|
state: "idle"
|
|
1422
|
-
}),
|
|
1415
|
+
}), ot = (e) => {
|
|
1423
1416
|
let t = e.versions;
|
|
1424
1417
|
if (!t?.length) return e;
|
|
1425
1418
|
let n = e.versionIndex ?? 0, r = t[n];
|
|
@@ -1431,7 +1424,7 @@ var et = 260, tt = 220, nt = "Generating response", rt = () => typeof crypto < "
|
|
|
1431
1424
|
parts: e.parts
|
|
1432
1425
|
} : t)
|
|
1433
1426
|
};
|
|
1434
|
-
},
|
|
1427
|
+
}, st = (e) => typeof e == "object" && !!e && Symbol.asyncIterator in e, ct = (e, t, n) => {
|
|
1435
1428
|
let r = 1e3 / t, i = Array(e.length), a = 0;
|
|
1436
1429
|
for (let t = 0; t < e.length; t++) {
|
|
1437
1430
|
a += r;
|
|
@@ -1440,8 +1433,8 @@ var et = 260, tt = 220, nt = "Generating response", rt = () => typeof crypto < "
|
|
|
1440
1433
|
}
|
|
1441
1434
|
return i;
|
|
1442
1435
|
};
|
|
1443
|
-
function
|
|
1444
|
-
let [i, s] = f(() => [
|
|
1436
|
+
function lt({ onSend: e, revealSpeed: t = tt, sentencePause: n = nt, announcements: r }) {
|
|
1437
|
+
let [i, s] = f(() => [at()]), [c, l] = f(!1), u = d(null), p = d(null), m = d(/* @__PURE__ */ new Map()), h = d(/* @__PURE__ */ new Map()), g = d(null), _ = d(e), v = d(r), y = d(i);
|
|
1445
1438
|
o(() => {
|
|
1446
1439
|
_.current = e, y.current = i, v.current = r;
|
|
1447
1440
|
});
|
|
@@ -1454,7 +1447,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1454
1447
|
...n,
|
|
1455
1448
|
...t
|
|
1456
1449
|
};
|
|
1457
|
-
return "versionIndex" in t || "versions" in t ? i :
|
|
1450
|
+
return "versionIndex" in t || "versions" in t ? i : ot(i);
|
|
1458
1451
|
});
|
|
1459
1452
|
return r ? (y.current = i, i) : n;
|
|
1460
1453
|
});
|
|
@@ -1466,7 +1459,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1466
1459
|
e.clear(), t.clear(), s((e) => {
|
|
1467
1460
|
let t = e.map((e) => {
|
|
1468
1461
|
let t = n.find(([t]) => t === e.id)?.[1], i = r.find(([t]) => t === e.id)?.[1];
|
|
1469
|
-
return t === void 0 && !i ? e :
|
|
1462
|
+
return t === void 0 && !i ? e : ot({
|
|
1470
1463
|
...e,
|
|
1471
1464
|
...t === void 0 ? null : { ai: t },
|
|
1472
1465
|
...i ? { parts: i.reduce(J, e.parts) } : null
|
|
@@ -1490,7 +1483,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1490
1483
|
let E = a((e, t) => {
|
|
1491
1484
|
l(!1), u.current = null, b(e, { state: "resting" }), t || s((e) => {
|
|
1492
1485
|
if (e.some((e) => e.state === "idle" && e.ai === "" && e.user === "")) return e;
|
|
1493
|
-
let t = [...e,
|
|
1486
|
+
let t = [...e, at()];
|
|
1494
1487
|
return y.current = t, t;
|
|
1495
1488
|
});
|
|
1496
1489
|
}, [b]), D = a((e, r, i) => new Promise((a) => {
|
|
@@ -1498,7 +1491,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1498
1491
|
C(e, r), a();
|
|
1499
1492
|
return;
|
|
1500
1493
|
}
|
|
1501
|
-
let o =
|
|
1494
|
+
let o = ct(r, t, n), s = performance.now(), c = 0, l = () => {
|
|
1502
1495
|
if (i.aborted) {
|
|
1503
1496
|
C(e, r), a();
|
|
1504
1497
|
return;
|
|
@@ -1520,7 +1513,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1520
1513
|
let n = v.current;
|
|
1521
1514
|
if (n === !1) return;
|
|
1522
1515
|
if (e === "responding") {
|
|
1523
|
-
let e = n && "responding" in n ? n.responding :
|
|
1516
|
+
let e = n && "responding" in n ? n.responding : rt;
|
|
1524
1517
|
e && K(e);
|
|
1525
1518
|
return;
|
|
1526
1519
|
}
|
|
@@ -1549,7 +1542,7 @@ function ct({ onSend: e, revealSpeed: t = et, sentencePause: n = tt, announcemen
|
|
|
1549
1542
|
turnId: e,
|
|
1550
1543
|
attachments: r
|
|
1551
1544
|
});
|
|
1552
|
-
if (
|
|
1545
|
+
if (st(n)) for await (let t of n) {
|
|
1553
1546
|
if (i.signal.aborted) break;
|
|
1554
1547
|
typeof t == "string" ? (s += t, C(e, s)) : w(e, t);
|
|
1555
1548
|
}
|
|
@@ -1639,23 +1632,23 @@ var Y = {
|
|
|
1639
1632
|
menuItem: "ick-menuItem-V7gI",
|
|
1640
1633
|
menuIcon: "ick-menuIcon-tjBi",
|
|
1641
1634
|
menuCount: "ick-menuCount-tC3s"
|
|
1642
|
-
},
|
|
1635
|
+
}, ut = {
|
|
1643
1636
|
s: "s",
|
|
1644
1637
|
m: "m",
|
|
1645
1638
|
l: "l"
|
|
1646
|
-
},
|
|
1639
|
+
}, dt = {
|
|
1647
1640
|
s: 14,
|
|
1648
1641
|
m: 16,
|
|
1649
1642
|
l: 18
|
|
1650
|
-
},
|
|
1643
|
+
}, ft = dt, pt = {
|
|
1651
1644
|
s: Y.s,
|
|
1652
1645
|
m: Y.m,
|
|
1653
1646
|
l: Y.l
|
|
1654
|
-
},
|
|
1647
|
+
}, mt = {
|
|
1655
1648
|
plain: Y.plain,
|
|
1656
1649
|
glass: Y.glass,
|
|
1657
1650
|
bordered: Y.bordered
|
|
1658
|
-
},
|
|
1651
|
+
}, ht = (e) => e.count === void 0 ? e.label : `${e.label}, ${e.count}`, gt = (e) => {
|
|
1659
1652
|
let t = e?.parentElement ?? null;
|
|
1660
1653
|
for (; t;) {
|
|
1661
1654
|
let { overflowY: e } = getComputedStyle(t);
|
|
@@ -1663,7 +1656,7 @@ var Y = {
|
|
|
1663
1656
|
t = t.parentElement;
|
|
1664
1657
|
}
|
|
1665
1658
|
return window;
|
|
1666
|
-
},
|
|
1659
|
+
}, _t = n(function({ title: e, subtitle: t, avatar: n, headingLevel: r = 2, truncate: i = !0, onBack: s, backHref: c, backLabel: l = "Back", actions: u = [], overflowLabel: p = "More actions", variant: m = "plain", size: _ = "m", align: v = "start", sticky: y = !1, elevateOnScroll: b = y, collapseActionsAt: x = 520, landmark: S = !0, children: C, className: w, ...T }, D) {
|
|
1667
1660
|
let O = d(null), [k, A] = f(!1), [j, M] = f(!1), N = a((e) => {
|
|
1668
1661
|
O.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
|
|
1669
1662
|
}, [D]);
|
|
@@ -1677,7 +1670,7 @@ var Y = {
|
|
|
1677
1670
|
return t.observe(e), () => t.disconnect();
|
|
1678
1671
|
}, [x]), o(() => {
|
|
1679
1672
|
if (!b) return;
|
|
1680
|
-
let e =
|
|
1673
|
+
let e = gt(O.current), t = () => {
|
|
1681
1674
|
let t = e === window ? window.scrollY : e.scrollTop;
|
|
1682
1675
|
M(t > 0);
|
|
1683
1676
|
};
|
|
@@ -1688,8 +1681,8 @@ var Y = {
|
|
|
1688
1681
|
ref: N,
|
|
1689
1682
|
className: [
|
|
1690
1683
|
Y.header,
|
|
1691
|
-
|
|
1692
|
-
|
|
1684
|
+
pt[_],
|
|
1685
|
+
mt[m],
|
|
1693
1686
|
v === "center" ? Y.center : "",
|
|
1694
1687
|
y ? Y.sticky : "",
|
|
1695
1688
|
w ?? ""
|
|
@@ -1704,14 +1697,14 @@ var Y = {
|
|
|
1704
1697
|
className: Y.back,
|
|
1705
1698
|
"aria-label": l,
|
|
1706
1699
|
children: /* @__PURE__ */ h(E, {
|
|
1707
|
-
size:
|
|
1700
|
+
size: ft[_],
|
|
1708
1701
|
"aria-hidden": !0
|
|
1709
1702
|
})
|
|
1710
|
-
}) : s ? /* @__PURE__ */ h(
|
|
1703
|
+
}) : s ? /* @__PURE__ */ h(H, {
|
|
1711
1704
|
variant: "secondary",
|
|
1712
|
-
size:
|
|
1705
|
+
size: ut[_],
|
|
1713
1706
|
icon: /* @__PURE__ */ h(E, {
|
|
1714
|
-
size:
|
|
1707
|
+
size: ft[_],
|
|
1715
1708
|
"aria-hidden": !0
|
|
1716
1709
|
}),
|
|
1717
1710
|
"aria-label": l,
|
|
@@ -1737,11 +1730,11 @@ var Y = {
|
|
|
1737
1730
|
className: Y.end,
|
|
1738
1731
|
children: [
|
|
1739
1732
|
C,
|
|
1740
|
-
ee.map((e) => /* @__PURE__ */ h(
|
|
1733
|
+
ee.map((e) => /* @__PURE__ */ h(vt, {
|
|
1741
1734
|
action: e,
|
|
1742
1735
|
size: _
|
|
1743
1736
|
}, e.id)),
|
|
1744
|
-
F.length > 0 && /* @__PURE__ */ h(
|
|
1737
|
+
F.length > 0 && /* @__PURE__ */ h(yt, {
|
|
1745
1738
|
actions: F,
|
|
1746
1739
|
size: _,
|
|
1747
1740
|
label: p
|
|
@@ -1750,8 +1743,8 @@ var Y = {
|
|
|
1750
1743
|
})]
|
|
1751
1744
|
});
|
|
1752
1745
|
});
|
|
1753
|
-
function
|
|
1754
|
-
let n =
|
|
1746
|
+
function vt({ action: e, size: t }) {
|
|
1747
|
+
let n = ht(e), r = e.count !== void 0 && e.count > 0 ? /* @__PURE__ */ h("span", {
|
|
1755
1748
|
className: Y.badge,
|
|
1756
1749
|
"aria-hidden": "true",
|
|
1757
1750
|
children: e.count > 99 ? "99+" : e.count
|
|
@@ -1764,9 +1757,9 @@ function _t({ action: e, size: t }) {
|
|
|
1764
1757
|
children: [e.icon, r]
|
|
1765
1758
|
}) : /* @__PURE__ */ g("span", {
|
|
1766
1759
|
className: Y.actionWrap,
|
|
1767
|
-
children: [/* @__PURE__ */ h(
|
|
1760
|
+
children: [/* @__PURE__ */ h(H, {
|
|
1768
1761
|
variant: "secondary",
|
|
1769
|
-
size:
|
|
1762
|
+
size: ut[t],
|
|
1770
1763
|
icon: e.icon,
|
|
1771
1764
|
"aria-label": n,
|
|
1772
1765
|
title: e.label,
|
|
@@ -1776,7 +1769,7 @@ function _t({ action: e, size: t }) {
|
|
|
1776
1769
|
}), r]
|
|
1777
1770
|
});
|
|
1778
1771
|
}
|
|
1779
|
-
function
|
|
1772
|
+
function yt({ actions: e, size: t, label: n }) {
|
|
1780
1773
|
let [r, i] = f(!1), [c, l] = f(0), [u, p] = f(!1), m = d(null), _ = d(null), v = s(), y = a((e) => {
|
|
1781
1774
|
i(!1), e && m.current?.focus();
|
|
1782
1775
|
}, []), b = Math.min(c, Math.max(e.length - 1, 0));
|
|
@@ -1784,12 +1777,12 @@ function vt({ actions: e, size: t, label: n }) {
|
|
|
1784
1777
|
r && (_.current?.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"]"))?.[b]?.focus();
|
|
1785
1778
|
}, [r, b]), /* @__PURE__ */ g("span", {
|
|
1786
1779
|
className: Y.overflow,
|
|
1787
|
-
children: [/* @__PURE__ */ h(
|
|
1780
|
+
children: [/* @__PURE__ */ h(H, {
|
|
1788
1781
|
ref: m,
|
|
1789
1782
|
variant: "secondary",
|
|
1790
|
-
size:
|
|
1783
|
+
size: ut[t],
|
|
1791
1784
|
icon: /* @__PURE__ */ h(se, {
|
|
1792
|
-
size:
|
|
1785
|
+
size: ft[t],
|
|
1793
1786
|
"aria-hidden": !0
|
|
1794
1787
|
}),
|
|
1795
1788
|
"aria-label": n,
|
|
@@ -1858,26 +1851,26 @@ function vt({ actions: e, size: t, label: n }) {
|
|
|
1858
1851
|
})]
|
|
1859
1852
|
});
|
|
1860
1853
|
}
|
|
1861
|
-
var
|
|
1854
|
+
var bt = {
|
|
1862
1855
|
row: "ick-row-yugg",
|
|
1863
1856
|
reveal: "ick-reveal-z3mw"
|
|
1864
|
-
},
|
|
1857
|
+
}, xt = {
|
|
1865
1858
|
copy: "Copy answer",
|
|
1866
1859
|
copied: "Copied",
|
|
1867
1860
|
regenerate: "Regenerate",
|
|
1868
1861
|
up: "Good answer",
|
|
1869
1862
|
down: "Bad answer"
|
|
1870
|
-
},
|
|
1871
|
-
function
|
|
1863
|
+
}, St = 1600;
|
|
1864
|
+
function Ct({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i = null, children: s, reveal: c = !1, busy: l = !1, labels: u, className: p, ..._ }) {
|
|
1872
1865
|
let [v, y] = f(!1), b = d(null), x = {
|
|
1873
|
-
...
|
|
1866
|
+
...xt,
|
|
1874
1867
|
...u
|
|
1875
1868
|
};
|
|
1876
1869
|
o(() => () => {
|
|
1877
1870
|
b.current && clearTimeout(b.current);
|
|
1878
1871
|
}, []);
|
|
1879
1872
|
let S = a(() => {
|
|
1880
|
-
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), K(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1),
|
|
1873
|
+
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), K(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1), St);
|
|
1881
1874
|
}, [
|
|
1882
1875
|
x.copied,
|
|
1883
1876
|
t,
|
|
@@ -1885,13 +1878,13 @@ function St({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
1885
1878
|
]), C = (e) => r?.(i === e ? null : e);
|
|
1886
1879
|
return /* @__PURE__ */ g("div", {
|
|
1887
1880
|
className: [
|
|
1888
|
-
|
|
1889
|
-
c ?
|
|
1881
|
+
bt.row,
|
|
1882
|
+
c ? bt.reveal : "",
|
|
1890
1883
|
p ?? ""
|
|
1891
1884
|
].filter(Boolean).join(" "),
|
|
1892
1885
|
..._,
|
|
1893
1886
|
children: [
|
|
1894
|
-
/* @__PURE__ */ h(
|
|
1887
|
+
/* @__PURE__ */ h(H, {
|
|
1895
1888
|
variant: "ghost",
|
|
1896
1889
|
icon: h(v ? k : N, {
|
|
1897
1890
|
size: 14,
|
|
@@ -1901,9 +1894,9 @@ function St({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
1901
1894
|
"aria-label": v ? x.copied : x.copy,
|
|
1902
1895
|
title: v ? x.copied : x.copy
|
|
1903
1896
|
}),
|
|
1904
|
-
n && /* @__PURE__ */ h(
|
|
1897
|
+
n && /* @__PURE__ */ h(H, {
|
|
1905
1898
|
variant: "ghost",
|
|
1906
|
-
icon: /* @__PURE__ */ h(
|
|
1899
|
+
icon: /* @__PURE__ */ h(pe, {
|
|
1907
1900
|
size: 14,
|
|
1908
1901
|
"aria-hidden": !0
|
|
1909
1902
|
}),
|
|
@@ -1913,9 +1906,9 @@ function St({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
1913
1906
|
"aria-label": x.regenerate,
|
|
1914
1907
|
title: x.regenerate
|
|
1915
1908
|
}),
|
|
1916
|
-
r && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(
|
|
1909
|
+
r && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(H, {
|
|
1917
1910
|
variant: "ghost",
|
|
1918
|
-
icon: /* @__PURE__ */ h(
|
|
1911
|
+
icon: /* @__PURE__ */ h(ve, {
|
|
1919
1912
|
size: 14,
|
|
1920
1913
|
"aria-hidden": !0
|
|
1921
1914
|
}),
|
|
@@ -1923,9 +1916,9 @@ function St({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
1923
1916
|
"aria-pressed": i === "up",
|
|
1924
1917
|
"aria-label": x.up,
|
|
1925
1918
|
title: x.up
|
|
1926
|
-
}), /* @__PURE__ */ h(
|
|
1919
|
+
}), /* @__PURE__ */ h(H, {
|
|
1927
1920
|
variant: "ghost",
|
|
1928
|
-
icon: /* @__PURE__ */ h(
|
|
1921
|
+
icon: /* @__PURE__ */ h(B, {
|
|
1929
1922
|
size: 14,
|
|
1930
1923
|
"aria-hidden": !0
|
|
1931
1924
|
}),
|
|
@@ -1938,32 +1931,32 @@ function St({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
1938
1931
|
]
|
|
1939
1932
|
});
|
|
1940
1933
|
}
|
|
1941
|
-
var
|
|
1934
|
+
var wt = {
|
|
1942
1935
|
branch: "ick-branch-lR6b",
|
|
1943
1936
|
step: "ick-step-JSch ick-target-vuT2",
|
|
1944
1937
|
count: "ick-count-kOmV",
|
|
1945
1938
|
of: "ick-of-VOS2"
|
|
1946
|
-
},
|
|
1939
|
+
}, Tt = {
|
|
1947
1940
|
previous: "Previous answer",
|
|
1948
1941
|
next: "Next answer",
|
|
1949
1942
|
position: "Answer {index} of {total}"
|
|
1950
1943
|
};
|
|
1951
|
-
function
|
|
1944
|
+
function Et({ total: e, index: t, onSelect: n, labels: r, className: i, ...a }) {
|
|
1952
1945
|
let o = {
|
|
1953
|
-
...
|
|
1946
|
+
...Tt,
|
|
1954
1947
|
...r
|
|
1955
1948
|
};
|
|
1956
1949
|
if (e < 2) return null;
|
|
1957
1950
|
let s = Math.min(Math.max(t, 0), e - 1), c = o.position.replace("{index}", String(s + 1)).replace("{total}", String(e));
|
|
1958
1951
|
return /* @__PURE__ */ g("div", {
|
|
1959
|
-
className: [
|
|
1952
|
+
className: [wt.branch, i ?? ""].filter(Boolean).join(" "),
|
|
1960
1953
|
role: "group",
|
|
1961
1954
|
"aria-label": c,
|
|
1962
1955
|
...a,
|
|
1963
1956
|
children: [
|
|
1964
1957
|
/* @__PURE__ */ h("button", {
|
|
1965
1958
|
type: "button",
|
|
1966
|
-
className:
|
|
1959
|
+
className: wt.step,
|
|
1967
1960
|
onClick: () => n(s - 1),
|
|
1968
1961
|
onPointerDown: (e) => e.stopPropagation(),
|
|
1969
1962
|
disabled: s === 0,
|
|
@@ -1974,11 +1967,11 @@ function Tt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
1974
1967
|
})
|
|
1975
1968
|
}),
|
|
1976
1969
|
/* @__PURE__ */ g("span", {
|
|
1977
|
-
className:
|
|
1970
|
+
className: wt.count,
|
|
1978
1971
|
children: [
|
|
1979
1972
|
s + 1,
|
|
1980
1973
|
/* @__PURE__ */ h("span", {
|
|
1981
|
-
className:
|
|
1974
|
+
className: wt.of,
|
|
1982
1975
|
children: "/"
|
|
1983
1976
|
}),
|
|
1984
1977
|
e
|
|
@@ -1986,7 +1979,7 @@ function Tt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
1986
1979
|
}),
|
|
1987
1980
|
/* @__PURE__ */ h("button", {
|
|
1988
1981
|
type: "button",
|
|
1989
|
-
className:
|
|
1982
|
+
className: wt.step,
|
|
1990
1983
|
onClick: () => n(s + 1),
|
|
1991
1984
|
onPointerDown: (e) => e.stopPropagation(),
|
|
1992
1985
|
disabled: s === e - 1,
|
|
@@ -1999,7 +1992,7 @@ function Tt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
1999
1992
|
]
|
|
2000
1993
|
});
|
|
2001
1994
|
}
|
|
2002
|
-
var
|
|
1995
|
+
var Dt = {
|
|
2003
1996
|
loader: "ick-loader-7WbG",
|
|
2004
1997
|
dot: "ick-dot-JJFT",
|
|
2005
1998
|
blink: "ick-blink-MCVu",
|
|
@@ -2009,10 +2002,10 @@ var Et = {
|
|
|
2009
2002
|
};
|
|
2010
2003
|
//#endregion
|
|
2011
2004
|
//#region src/Loader/Loader.tsx
|
|
2012
|
-
function
|
|
2005
|
+
function Ot({ variant: e = "dots", children: t, label: n = null, className: r, ...i }) {
|
|
2013
2006
|
let a = [
|
|
2014
|
-
|
|
2015
|
-
|
|
2007
|
+
Dt.loader,
|
|
2008
|
+
Dt[e],
|
|
2016
2009
|
r ?? ""
|
|
2017
2010
|
].filter(Boolean).join(" ");
|
|
2018
2011
|
return /* @__PURE__ */ g("div", {
|
|
@@ -2021,21 +2014,21 @@ function Dt({ variant: e = "dots", children: t, label: n = null, className: r, .
|
|
|
2021
2014
|
"aria-hidden": !n || void 0,
|
|
2022
2015
|
...i,
|
|
2023
2016
|
children: [n && /* @__PURE__ */ h("span", {
|
|
2024
|
-
className:
|
|
2017
|
+
className: Dt.srOnly,
|
|
2025
2018
|
children: n
|
|
2026
2019
|
}), e === "dots" ? /* @__PURE__ */ g(m, { children: [
|
|
2027
|
-
/* @__PURE__ */ h("span", { className:
|
|
2028
|
-
/* @__PURE__ */ h("span", { className:
|
|
2029
|
-
/* @__PURE__ */ h("span", { className:
|
|
2020
|
+
/* @__PURE__ */ h("span", { className: Dt.dot }),
|
|
2021
|
+
/* @__PURE__ */ h("span", { className: Dt.dot }),
|
|
2022
|
+
/* @__PURE__ */ h("span", { className: Dt.dot })
|
|
2030
2023
|
] }) : /* @__PURE__ */ h("span", {
|
|
2031
|
-
className:
|
|
2024
|
+
className: Dt.text,
|
|
2032
2025
|
children: t
|
|
2033
2026
|
})]
|
|
2034
2027
|
});
|
|
2035
2028
|
}
|
|
2036
2029
|
//#endregion
|
|
2037
2030
|
//#region src/disclosure/useDisclosure.ts
|
|
2038
|
-
function
|
|
2031
|
+
function kt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
2039
2032
|
let [i, o] = f(null), s = e ?? i ?? t ?? r;
|
|
2040
2033
|
return {
|
|
2041
2034
|
isOpen: s,
|
|
@@ -2049,7 +2042,7 @@ function Ot({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
|
2049
2042
|
])
|
|
2050
2043
|
};
|
|
2051
2044
|
}
|
|
2052
|
-
var
|
|
2045
|
+
var At = {
|
|
2053
2046
|
header: "ick-header-C0FS ick-target-vuT2",
|
|
2054
2047
|
chevron: "ick-chevron-RY4c",
|
|
2055
2048
|
static: "ick-static-6vUk",
|
|
@@ -2057,30 +2050,30 @@ var kt = {
|
|
|
2057
2050
|
label: "ick-label-L-k2",
|
|
2058
2051
|
sweep: "ick-sweep-owLs",
|
|
2059
2052
|
meta: "ick-meta-wT3y"
|
|
2060
|
-
},
|
|
2061
|
-
function
|
|
2053
|
+
}, jt = (...e) => e.filter(Boolean).join(" ");
|
|
2054
|
+
function Mt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, glyph: a, label: o, pending: s, meta: c, children: l, className: u }) {
|
|
2062
2055
|
let d = /* @__PURE__ */ g(m, { children: [
|
|
2063
2056
|
a && /* @__PURE__ */ h("span", {
|
|
2064
|
-
className:
|
|
2057
|
+
className: At.glyph,
|
|
2065
2058
|
children: a
|
|
2066
2059
|
}),
|
|
2067
2060
|
/* @__PURE__ */ h("span", {
|
|
2068
|
-
className:
|
|
2061
|
+
className: At.label,
|
|
2069
2062
|
"data-pending": s || void 0,
|
|
2070
2063
|
children: o
|
|
2071
2064
|
}),
|
|
2072
2065
|
l,
|
|
2073
2066
|
c ? /* @__PURE__ */ h("span", {
|
|
2074
|
-
className:
|
|
2067
|
+
className: At.meta,
|
|
2075
2068
|
children: c
|
|
2076
2069
|
}) : null,
|
|
2077
2070
|
n && /* @__PURE__ */ h(A, {
|
|
2078
|
-
className:
|
|
2071
|
+
className: At.chevron,
|
|
2079
2072
|
size: 14,
|
|
2080
2073
|
"aria-hidden": !0
|
|
2081
2074
|
})
|
|
2082
2075
|
] }), f = {
|
|
2083
|
-
className: At
|
|
2076
|
+
className: jt(At.header, u),
|
|
2084
2077
|
"data-fit": e
|
|
2085
2078
|
};
|
|
2086
2079
|
return n ? /* @__PURE__ */ h("button", {
|
|
@@ -2094,25 +2087,25 @@ function jt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, g
|
|
|
2094
2087
|
children: d
|
|
2095
2088
|
}) : /* @__PURE__ */ h("div", {
|
|
2096
2089
|
...f,
|
|
2097
|
-
className:
|
|
2090
|
+
className: jt(f.className, At.static),
|
|
2098
2091
|
children: d
|
|
2099
2092
|
});
|
|
2100
2093
|
}
|
|
2101
|
-
var
|
|
2094
|
+
var Nt = {
|
|
2102
2095
|
outer: "ick-outer-6UEA",
|
|
2103
2096
|
wrap: "ick-wrap-u6ww"
|
|
2104
2097
|
};
|
|
2105
2098
|
//#endregion
|
|
2106
2099
|
//#region src/disclosure/DisclosureBody.tsx
|
|
2107
|
-
function
|
|
2100
|
+
function Pt({ id: e, open: t, className: n, children: r }) {
|
|
2108
2101
|
let i = q();
|
|
2109
2102
|
return /* @__PURE__ */ h("div", {
|
|
2110
2103
|
id: e,
|
|
2111
|
-
className:
|
|
2104
|
+
className: Nt.outer,
|
|
2112
2105
|
children: /* @__PURE__ */ h(_, {
|
|
2113
2106
|
initial: !1,
|
|
2114
2107
|
children: t && r ? /* @__PURE__ */ h(x.div, {
|
|
2115
|
-
className:
|
|
2108
|
+
className: Nt.wrap,
|
|
2116
2109
|
initial: i ? { opacity: 0 } : {
|
|
2117
2110
|
height: 0,
|
|
2118
2111
|
opacity: 0
|
|
@@ -2144,25 +2137,25 @@ function Nt({ id: e, open: t, className: n, children: r }) {
|
|
|
2144
2137
|
}
|
|
2145
2138
|
//#endregion
|
|
2146
2139
|
//#region src/duration/formatDuration.ts
|
|
2147
|
-
function
|
|
2140
|
+
function Ft(e) {
|
|
2148
2141
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
2149
2142
|
if (e < 1e3) return `${Math.round(e)}ms`;
|
|
2150
2143
|
let t = e / 1e3;
|
|
2151
2144
|
return `${t < 10 ? t.toFixed(1) : Math.round(t)}s`;
|
|
2152
2145
|
}
|
|
2153
|
-
var
|
|
2146
|
+
var It = {
|
|
2154
2147
|
reasoning: "ick-reasoning-qbLZ",
|
|
2155
2148
|
bodyInner: "ick-bodyInner-5PBC"
|
|
2156
|
-
},
|
|
2149
|
+
}, Lt = {
|
|
2157
2150
|
thinking: "Thinking",
|
|
2158
2151
|
thought: "Thought",
|
|
2159
2152
|
thoughtFor: "Thought for"
|
|
2160
2153
|
};
|
|
2161
|
-
function
|
|
2154
|
+
function Rt({ children: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: c, ...l }) {
|
|
2162
2155
|
let u = {
|
|
2163
|
-
...
|
|
2156
|
+
...Lt,
|
|
2164
2157
|
...o
|
|
2165
|
-
}, d = s(), p = t === "thinking", { isOpen: m, toggle: _ } =
|
|
2158
|
+
}, d = s(), p = t === "thinking", { isOpen: m, toggle: _ } = kt({
|
|
2166
2159
|
open: r,
|
|
2167
2160
|
defaultOpen: i,
|
|
2168
2161
|
onOpenChange: a,
|
|
@@ -2178,12 +2171,12 @@ function Lt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2178
2171
|
from: null,
|
|
2179
2172
|
took: e.from === null ? null : Date.now() - e.from
|
|
2180
2173
|
}));
|
|
2181
|
-
let S = n ?? b.took, C = p || S === null ? "" :
|
|
2174
|
+
let S = n ?? b.took, C = p || S === null ? "" : Ft(S);
|
|
2182
2175
|
return /* @__PURE__ */ g("div", {
|
|
2183
|
-
className: [
|
|
2176
|
+
className: [It.reasoning, c ?? ""].filter(Boolean).join(" "),
|
|
2184
2177
|
"data-state": t,
|
|
2185
2178
|
...l,
|
|
2186
|
-
children: [/* @__PURE__ */ h(
|
|
2179
|
+
children: [/* @__PURE__ */ h(Mt, {
|
|
2187
2180
|
fit: "inline",
|
|
2188
2181
|
open: m,
|
|
2189
2182
|
onToggle: _,
|
|
@@ -2194,17 +2187,17 @@ function Lt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2194
2187
|
}),
|
|
2195
2188
|
label: p ? u.thinking : C ? `${u.thoughtFor} ${C}` : u.thought,
|
|
2196
2189
|
pending: p
|
|
2197
|
-
}), /* @__PURE__ */ h(
|
|
2190
|
+
}), /* @__PURE__ */ h(Pt, {
|
|
2198
2191
|
id: d,
|
|
2199
2192
|
open: m,
|
|
2200
|
-
className:
|
|
2193
|
+
className: It.bodyInner,
|
|
2201
2194
|
children: e
|
|
2202
2195
|
})]
|
|
2203
2196
|
});
|
|
2204
2197
|
}
|
|
2205
2198
|
//#endregion
|
|
2206
2199
|
//#region src/CodeBlock/highlight.ts
|
|
2207
|
-
var
|
|
2200
|
+
var zt = [
|
|
2208
2201
|
"bash",
|
|
2209
2202
|
"css",
|
|
2210
2203
|
"diff",
|
|
@@ -2216,7 +2209,7 @@ var Rt = [
|
|
|
2216
2209
|
"typescript",
|
|
2217
2210
|
"xml",
|
|
2218
2211
|
"yaml"
|
|
2219
|
-
],
|
|
2212
|
+
], Bt = {
|
|
2220
2213
|
js: "javascript",
|
|
2221
2214
|
jsx: "javascript",
|
|
2222
2215
|
mjs: "javascript",
|
|
@@ -2237,15 +2230,15 @@ var Rt = [
|
|
|
2237
2230
|
patch: "diff",
|
|
2238
2231
|
yml: "yaml",
|
|
2239
2232
|
yamllint: "yaml"
|
|
2240
|
-
},
|
|
2233
|
+
}, Vt = new Set(zt), Ht = (e) => [{
|
|
2241
2234
|
value: e,
|
|
2242
2235
|
kind: null
|
|
2243
|
-
}],
|
|
2236
|
+
}], Ut = (e) => {
|
|
2244
2237
|
if (!e) return null;
|
|
2245
|
-
let t =
|
|
2246
|
-
return
|
|
2247
|
-
},
|
|
2248
|
-
function
|
|
2238
|
+
let t = Bt[e.toLowerCase()] ?? e.toLowerCase();
|
|
2239
|
+
return Vt.has(t) ? t : null;
|
|
2240
|
+
}, Wt = (e) => Ut(e) !== null;
|
|
2241
|
+
function Gt(e) {
|
|
2249
2242
|
let t = [], n = (e, n) => {
|
|
2250
2243
|
if (!e) return;
|
|
2251
2244
|
let r = t[t.length - 1];
|
|
@@ -2265,42 +2258,42 @@ function Wt(e) {
|
|
|
2265
2258
|
};
|
|
2266
2259
|
return r(e.children ?? [], null), t;
|
|
2267
2260
|
}
|
|
2268
|
-
var
|
|
2269
|
-
function
|
|
2270
|
-
return
|
|
2261
|
+
var Kt = null, qt = null, Jt = () => Kt;
|
|
2262
|
+
function Yt() {
|
|
2263
|
+
return Kt ? Promise.resolve(Kt) : qt || (qt = (async () => {
|
|
2271
2264
|
let { createHighlighter: e } = await import("./grammars-B19jp7qm.js"), t = e();
|
|
2272
|
-
return
|
|
2273
|
-
let r =
|
|
2274
|
-
if (!r) return
|
|
2265
|
+
return Kt = (e, n) => {
|
|
2266
|
+
let r = Ut(n);
|
|
2267
|
+
if (!r) return Ht(e);
|
|
2275
2268
|
try {
|
|
2276
|
-
let n =
|
|
2277
|
-
return n.length > 0 ? n :
|
|
2269
|
+
let n = Gt(t.highlight(r, e));
|
|
2270
|
+
return n.length > 0 ? n : Ht(e);
|
|
2278
2271
|
} catch {
|
|
2279
|
-
return
|
|
2272
|
+
return Ht(e);
|
|
2280
2273
|
}
|
|
2281
|
-
},
|
|
2282
|
-
})(),
|
|
2274
|
+
}, Kt;
|
|
2275
|
+
})(), qt);
|
|
2283
2276
|
}
|
|
2284
|
-
var
|
|
2277
|
+
var Xt = {
|
|
2285
2278
|
block: "ick-block-xN1a",
|
|
2286
2279
|
bar: "ick-bar-5YJ4",
|
|
2287
2280
|
lang: "ick-lang-pkCd",
|
|
2288
2281
|
copy: "ick-copy-KoCs ick-target-vuT2",
|
|
2289
2282
|
copyLabel: "ick-copyLabel-E8mN",
|
|
2290
2283
|
pre: "ick-pre-qaBX"
|
|
2291
|
-
},
|
|
2292
|
-
function
|
|
2293
|
-
let [p, m] = f(!1), _ = d(null), [v, y] = f(
|
|
2284
|
+
}, Zt = 1600;
|
|
2285
|
+
function Qt({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor: s = Zt, className: c, ...l }) {
|
|
2286
|
+
let [p, m] = f(!1), _ = d(null), [v, y] = f(Jt);
|
|
2294
2287
|
o(() => {
|
|
2295
|
-
if (v || !
|
|
2288
|
+
if (v || !Wt(t)) return;
|
|
2296
2289
|
let e = !0;
|
|
2297
|
-
return
|
|
2290
|
+
return Yt().then((t) => {
|
|
2298
2291
|
e && y(() => t);
|
|
2299
2292
|
}), () => {
|
|
2300
2293
|
e = !1;
|
|
2301
2294
|
};
|
|
2302
2295
|
}, [v, t]);
|
|
2303
|
-
let b = u(() => v ? v(e, t) :
|
|
2296
|
+
let b = u(() => v ? v(e, t) : Ht(e), [
|
|
2304
2297
|
v,
|
|
2305
2298
|
e,
|
|
2306
2299
|
t
|
|
@@ -2316,16 +2309,16 @@ function Zt({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2316
2309
|
i
|
|
2317
2310
|
]), S = n === !1 ? null : n ?? t ?? null, C = S !== null || r;
|
|
2318
2311
|
return /* @__PURE__ */ g("div", {
|
|
2319
|
-
className: [
|
|
2312
|
+
className: [Xt.block, c ?? ""].filter(Boolean).join(" "),
|
|
2320
2313
|
...l,
|
|
2321
2314
|
children: [C && /* @__PURE__ */ g("div", {
|
|
2322
|
-
className:
|
|
2315
|
+
className: Xt.bar,
|
|
2323
2316
|
children: [/* @__PURE__ */ h("span", {
|
|
2324
|
-
className:
|
|
2317
|
+
className: Xt.lang,
|
|
2325
2318
|
children: S
|
|
2326
2319
|
}), r && /* @__PURE__ */ g("button", {
|
|
2327
2320
|
type: "button",
|
|
2328
|
-
className:
|
|
2321
|
+
className: Xt.copy,
|
|
2329
2322
|
onClick: x,
|
|
2330
2323
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2331
2324
|
"aria-label": p ? "Copied" : "Copy code",
|
|
@@ -2333,12 +2326,12 @@ function Zt({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2333
2326
|
size: 13,
|
|
2334
2327
|
"aria-hidden": !0
|
|
2335
2328
|
}), /* @__PURE__ */ h("span", {
|
|
2336
|
-
className:
|
|
2329
|
+
className: Xt.copyLabel,
|
|
2337
2330
|
children: p ? "Copied" : "Copy"
|
|
2338
2331
|
})]
|
|
2339
2332
|
})]
|
|
2340
2333
|
}), /* @__PURE__ */ h("pre", {
|
|
2341
|
-
className:
|
|
2334
|
+
className: Xt.pre,
|
|
2342
2335
|
children: /* @__PURE__ */ h("code", { children: b.map((e, t) => e.kind ? /* @__PURE__ */ h("span", {
|
|
2343
2336
|
"data-hl": e.kind,
|
|
2344
2337
|
children: e.value
|
|
@@ -2346,7 +2339,7 @@ function Zt({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2346
2339
|
})]
|
|
2347
2340
|
});
|
|
2348
2341
|
}
|
|
2349
|
-
var
|
|
2342
|
+
var $t = {
|
|
2350
2343
|
glyph: "ick-glyph-NSSW",
|
|
2351
2344
|
queued: "ick-queued-6cCj",
|
|
2352
2345
|
spinner: "ick-spinner-HeOp",
|
|
@@ -2354,15 +2347,15 @@ var Qt = {
|
|
|
2354
2347
|
};
|
|
2355
2348
|
//#endregion
|
|
2356
2349
|
//#region src/stateGlyph/StateGlyph.tsx
|
|
2357
|
-
function
|
|
2350
|
+
function en({ state: e }) {
|
|
2358
2351
|
return /* @__PURE__ */ h("span", {
|
|
2359
|
-
className:
|
|
2352
|
+
className: $t.glyph,
|
|
2360
2353
|
"data-state": e,
|
|
2361
2354
|
"aria-hidden": !0,
|
|
2362
|
-
children: e === "running" ? /* @__PURE__ */ h("span", { className:
|
|
2355
|
+
children: e === "running" ? /* @__PURE__ */ h("span", { className: $t.spinner }) : e === "done" ? /* @__PURE__ */ h(k, { size: 13 }) : e === "error" ? /* @__PURE__ */ h(be, { size: 13 }) : /* @__PURE__ */ h("span", { className: $t.queued })
|
|
2363
2356
|
});
|
|
2364
2357
|
}
|
|
2365
|
-
var
|
|
2358
|
+
var tn = {
|
|
2366
2359
|
tool: "ick-tool-en0M",
|
|
2367
2360
|
card: "ick-card-nzIg",
|
|
2368
2361
|
overview: "ick-overview-lVM-",
|
|
@@ -2371,7 +2364,7 @@ var en = {
|
|
|
2371
2364
|
sectionLabel: "ick-sectionLabel-Eo-k",
|
|
2372
2365
|
text: "ick-text-uxUz",
|
|
2373
2366
|
srOnly: "ick-srOnly-iikt"
|
|
2374
|
-
},
|
|
2367
|
+
}, nn = {
|
|
2375
2368
|
input: "Input",
|
|
2376
2369
|
output: "Output",
|
|
2377
2370
|
error: "Error",
|
|
@@ -2379,7 +2372,7 @@ var en = {
|
|
|
2379
2372
|
running: "Running",
|
|
2380
2373
|
done: "Done"
|
|
2381
2374
|
};
|
|
2382
|
-
function
|
|
2375
|
+
function rn(e) {
|
|
2383
2376
|
if (e == null) return null;
|
|
2384
2377
|
if (r(e)) return {
|
|
2385
2378
|
kind: "node",
|
|
@@ -2406,78 +2399,78 @@ function nn(e) {
|
|
|
2406
2399
|
};
|
|
2407
2400
|
}
|
|
2408
2401
|
}
|
|
2409
|
-
function
|
|
2402
|
+
function an({ label: e, value: t, tone: n }) {
|
|
2410
2403
|
if (!t) return null;
|
|
2411
|
-
if (t.kind === "json") return /* @__PURE__ */ h(
|
|
2404
|
+
if (t.kind === "json") return /* @__PURE__ */ h(Qt, {
|
|
2412
2405
|
code: t.code,
|
|
2413
2406
|
lang: "json",
|
|
2414
2407
|
label: e
|
|
2415
2408
|
});
|
|
2416
2409
|
let r = t.kind === "text" ? /* @__PURE__ */ h("p", {
|
|
2417
|
-
className:
|
|
2410
|
+
className: tn.text,
|
|
2418
2411
|
children: t.text
|
|
2419
2412
|
}) : t.node;
|
|
2420
2413
|
return /* @__PURE__ */ g("div", {
|
|
2421
|
-
className:
|
|
2414
|
+
className: tn.section,
|
|
2422
2415
|
"data-tone": n,
|
|
2423
2416
|
children: [/* @__PURE__ */ h("span", {
|
|
2424
|
-
className:
|
|
2417
|
+
className: tn.sectionLabel,
|
|
2425
2418
|
children: e
|
|
2426
2419
|
}), r]
|
|
2427
2420
|
});
|
|
2428
2421
|
}
|
|
2429
|
-
function
|
|
2422
|
+
function on({ name: e, state: t = "done", summary: n, input: r, output: i, error: a, duration: o, open: c, defaultOpen: l, onOpenChange: u, labels: d, className: f, ...p }) {
|
|
2430
2423
|
let m = {
|
|
2431
|
-
...
|
|
2424
|
+
...nn,
|
|
2432
2425
|
...d
|
|
2433
|
-
}, _ = s(), v = t === "error", { isOpen: y, toggle: b } =
|
|
2426
|
+
}, _ = s(), v = t === "error", { isOpen: y, toggle: b } = kt({
|
|
2434
2427
|
open: c,
|
|
2435
2428
|
defaultOpen: l,
|
|
2436
2429
|
onOpenChange: u,
|
|
2437
2430
|
preferOpen: v
|
|
2438
|
-
}), x =
|
|
2431
|
+
}), x = rn(r), S = v ? null : rn(i), C = v ? rn(a) : null, w = !!(x || S || C || t === "running"), T = t === "done" || v ? Ft(o ?? NaN) : "";
|
|
2439
2432
|
return /* @__PURE__ */ g("div", {
|
|
2440
|
-
className: [
|
|
2433
|
+
className: [tn.tool, f ?? ""].filter(Boolean).join(" "),
|
|
2441
2434
|
"data-state": t,
|
|
2442
2435
|
...p,
|
|
2443
|
-
children: [/* @__PURE__ */ h(
|
|
2436
|
+
children: [/* @__PURE__ */ h(Mt, {
|
|
2444
2437
|
open: y,
|
|
2445
2438
|
onToggle: b,
|
|
2446
2439
|
controls: _,
|
|
2447
2440
|
disabled: !w,
|
|
2448
|
-
glyph: /* @__PURE__ */ h(
|
|
2441
|
+
glyph: /* @__PURE__ */ h(en, { state: t }),
|
|
2449
2442
|
label: e,
|
|
2450
2443
|
meta: T || void 0,
|
|
2451
2444
|
children: /* @__PURE__ */ h("span", {
|
|
2452
|
-
className:
|
|
2445
|
+
className: tn.srOnly,
|
|
2453
2446
|
children: m[t]
|
|
2454
2447
|
})
|
|
2455
2448
|
}), /* @__PURE__ */ g("div", {
|
|
2456
|
-
className:
|
|
2449
|
+
className: tn.card,
|
|
2457
2450
|
children: [/* @__PURE__ */ h("p", {
|
|
2458
|
-
className:
|
|
2451
|
+
className: tn.overview,
|
|
2459
2452
|
children: n ?? m[t]
|
|
2460
|
-
}), /* @__PURE__ */ g(
|
|
2453
|
+
}), /* @__PURE__ */ g(Pt, {
|
|
2461
2454
|
id: _,
|
|
2462
2455
|
open: y && w,
|
|
2463
|
-
className:
|
|
2456
|
+
className: tn.bodyInner,
|
|
2464
2457
|
children: [
|
|
2465
|
-
/* @__PURE__ */ h(
|
|
2458
|
+
/* @__PURE__ */ h(an, {
|
|
2466
2459
|
label: m.input,
|
|
2467
2460
|
value: x
|
|
2468
2461
|
}),
|
|
2469
2462
|
t === "running" && !S && /* @__PURE__ */ g("div", {
|
|
2470
|
-
className:
|
|
2463
|
+
className: tn.section,
|
|
2471
2464
|
children: [/* @__PURE__ */ h("span", {
|
|
2472
|
-
className:
|
|
2465
|
+
className: tn.sectionLabel,
|
|
2473
2466
|
children: m.output
|
|
2474
|
-
}), /* @__PURE__ */ h(
|
|
2467
|
+
}), /* @__PURE__ */ h(Ot, {})]
|
|
2475
2468
|
}),
|
|
2476
|
-
/* @__PURE__ */ h(
|
|
2469
|
+
/* @__PURE__ */ h(an, {
|
|
2477
2470
|
label: m.output,
|
|
2478
2471
|
value: S
|
|
2479
2472
|
}),
|
|
2480
|
-
/* @__PURE__ */ h(
|
|
2473
|
+
/* @__PURE__ */ h(an, {
|
|
2481
2474
|
label: m.error,
|
|
2482
2475
|
value: C,
|
|
2483
2476
|
tone: "error"
|
|
@@ -2487,7 +2480,7 @@ function an({ name: e, state: t = "done", summary: n, input: r, output: i, error
|
|
|
2487
2480
|
})]
|
|
2488
2481
|
});
|
|
2489
2482
|
}
|
|
2490
|
-
var
|
|
2483
|
+
var sn = {
|
|
2491
2484
|
approval: "ick-approval-zlJi",
|
|
2492
2485
|
head: "ick-head-CX4j",
|
|
2493
2486
|
title: "ick-title-n-wh",
|
|
@@ -2496,7 +2489,7 @@ var on = {
|
|
|
2496
2489
|
actions: "ick-actions-t5Oz",
|
|
2497
2490
|
deny: "ick-deny-XXyG",
|
|
2498
2491
|
settled: "ick-settled-OaBX"
|
|
2499
|
-
},
|
|
2492
|
+
}, cn = {
|
|
2500
2493
|
once: "Allow once",
|
|
2501
2494
|
always: "Always allow",
|
|
2502
2495
|
deny: "Deny",
|
|
@@ -2504,61 +2497,61 @@ var on = {
|
|
|
2504
2497
|
allowedAlways: "Allowed from now on",
|
|
2505
2498
|
wasDenied: "Denied",
|
|
2506
2499
|
pending: "Waiting for you"
|
|
2507
|
-
},
|
|
2500
|
+
}, ln = {
|
|
2508
2501
|
once: "allowedOnce",
|
|
2509
2502
|
always: "allowedAlways",
|
|
2510
2503
|
denied: "wasDenied"
|
|
2511
2504
|
};
|
|
2512
|
-
function
|
|
2505
|
+
function un({ title: e, description: t, children: n, decision: r = null, onDecide: i, readOnly: a = !1, labels: o, className: c, ...l }) {
|
|
2513
2506
|
let u = {
|
|
2514
|
-
...
|
|
2507
|
+
...cn,
|
|
2515
2508
|
...o
|
|
2516
2509
|
}, d = s(), f = r !== null;
|
|
2517
2510
|
return /* @__PURE__ */ g("section", {
|
|
2518
|
-
className: [
|
|
2511
|
+
className: [sn.approval, c ?? ""].filter(Boolean).join(" "),
|
|
2519
2512
|
"data-decision": r ?? void 0,
|
|
2520
2513
|
"aria-labelledby": d,
|
|
2521
2514
|
...l,
|
|
2522
2515
|
children: [
|
|
2523
2516
|
/* @__PURE__ */ g("div", {
|
|
2524
|
-
className:
|
|
2517
|
+
className: sn.head,
|
|
2525
2518
|
children: [/* @__PURE__ */ h("p", {
|
|
2526
|
-
className:
|
|
2519
|
+
className: sn.title,
|
|
2527
2520
|
id: d,
|
|
2528
2521
|
children: e
|
|
2529
2522
|
}), t && /* @__PURE__ */ h("p", {
|
|
2530
|
-
className:
|
|
2523
|
+
className: sn.description,
|
|
2531
2524
|
children: t
|
|
2532
2525
|
})]
|
|
2533
2526
|
}),
|
|
2534
2527
|
n && /* @__PURE__ */ h("div", {
|
|
2535
|
-
className:
|
|
2528
|
+
className: sn.subject,
|
|
2536
2529
|
children: n
|
|
2537
2530
|
}),
|
|
2538
2531
|
f ? /* @__PURE__ */ g("p", {
|
|
2539
|
-
className:
|
|
2532
|
+
className: sn.settled,
|
|
2540
2533
|
"data-decision": r,
|
|
2541
|
-
children: [h(r === "denied" ?
|
|
2534
|
+
children: [h(r === "denied" ? xe : k, {
|
|
2542
2535
|
size: 13,
|
|
2543
2536
|
"aria-hidden": !0
|
|
2544
|
-
}), u[
|
|
2537
|
+
}), u[ln[r]]]
|
|
2545
2538
|
}) : !a && /* @__PURE__ */ g("div", {
|
|
2546
|
-
className:
|
|
2539
|
+
className: sn.actions,
|
|
2547
2540
|
children: [
|
|
2548
|
-
/* @__PURE__ */ h(
|
|
2541
|
+
/* @__PURE__ */ h(H, {
|
|
2549
2542
|
variant: "ghost",
|
|
2550
2543
|
size: "m",
|
|
2551
|
-
className:
|
|
2544
|
+
className: sn.deny,
|
|
2552
2545
|
onClick: () => i?.("denied"),
|
|
2553
2546
|
children: u.deny
|
|
2554
2547
|
}),
|
|
2555
|
-
/* @__PURE__ */ h(
|
|
2548
|
+
/* @__PURE__ */ h(H, {
|
|
2556
2549
|
variant: "outline",
|
|
2557
2550
|
size: "m",
|
|
2558
2551
|
onClick: () => i?.("always"),
|
|
2559
2552
|
children: u.always
|
|
2560
2553
|
}),
|
|
2561
|
-
/* @__PURE__ */ h(
|
|
2554
|
+
/* @__PURE__ */ h(H, {
|
|
2562
2555
|
variant: "primary",
|
|
2563
2556
|
size: "m",
|
|
2564
2557
|
onClick: () => i?.("once"),
|
|
@@ -2569,7 +2562,7 @@ function ln({ title: e, description: t, children: n, decision: r = null, onDecid
|
|
|
2569
2562
|
]
|
|
2570
2563
|
});
|
|
2571
2564
|
}
|
|
2572
|
-
var
|
|
2565
|
+
var dn = {
|
|
2573
2566
|
tasks: "ick-tasks-2ToX",
|
|
2574
2567
|
list: "ick-list-D8wS",
|
|
2575
2568
|
item: "ick-item-QsIm",
|
|
@@ -2577,43 +2570,43 @@ var un = {
|
|
|
2577
2570
|
label: "ick-label--3zU",
|
|
2578
2571
|
detail: "ick-detail-nGX0",
|
|
2579
2572
|
srOnly: "ick-srOnly-ZdRo"
|
|
2580
|
-
},
|
|
2573
|
+
}, fn = {
|
|
2581
2574
|
pending: "Queued",
|
|
2582
2575
|
running: "In progress",
|
|
2583
2576
|
done: "Done",
|
|
2584
2577
|
error: "Failed",
|
|
2585
2578
|
progress: "{done} of {total}"
|
|
2586
2579
|
};
|
|
2587
|
-
function
|
|
2580
|
+
function pn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: c, ...l }) {
|
|
2588
2581
|
let u = {
|
|
2589
|
-
...
|
|
2582
|
+
...fn,
|
|
2590
2583
|
...o
|
|
2591
|
-
}, d = s(), f = q(), p = e.filter((e) => (e.state ?? "pending") === "done").length, m =
|
|
2584
|
+
}, d = s(), f = q(), p = e.filter((e) => (e.state ?? "pending") === "done").length, m = kt({
|
|
2592
2585
|
open: r,
|
|
2593
2586
|
defaultOpen: i,
|
|
2594
2587
|
onOpenChange: a,
|
|
2595
2588
|
preferOpen: !(e.length > 0 && p === e.length)
|
|
2596
2589
|
}), v = !n || m.isOpen, y = u.progress.replace("{done}", String(p)).replace("{total}", String(e.length));
|
|
2597
2590
|
return /* @__PURE__ */ g("section", {
|
|
2598
|
-
className: [
|
|
2591
|
+
className: [dn.tasks, c ?? ""].filter(Boolean).join(" "),
|
|
2599
2592
|
...l,
|
|
2600
|
-
children: [t && /* @__PURE__ */ h(
|
|
2593
|
+
children: [t && /* @__PURE__ */ h(Mt, {
|
|
2601
2594
|
open: v,
|
|
2602
2595
|
onToggle: n ? m.toggle : void 0,
|
|
2603
2596
|
controls: d,
|
|
2604
2597
|
label: t,
|
|
2605
2598
|
meta: y
|
|
2606
|
-
}), /* @__PURE__ */ h(
|
|
2599
|
+
}), /* @__PURE__ */ h(Pt, {
|
|
2607
2600
|
id: d,
|
|
2608
2601
|
open: v,
|
|
2609
2602
|
children: /* @__PURE__ */ h("ol", {
|
|
2610
|
-
className:
|
|
2603
|
+
className: dn.list,
|
|
2611
2604
|
children: /* @__PURE__ */ h(_, {
|
|
2612
2605
|
initial: !1,
|
|
2613
2606
|
children: e.map((e) => {
|
|
2614
2607
|
let t = e.state ?? "pending";
|
|
2615
2608
|
return /* @__PURE__ */ g(x.li, {
|
|
2616
|
-
className:
|
|
2609
|
+
className: dn.item,
|
|
2617
2610
|
"data-state": t,
|
|
2618
2611
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2619
2612
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2629,19 +2622,19 @@ function fn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2629
2622
|
y: -4
|
|
2630
2623
|
},
|
|
2631
2624
|
transition: { duration: f ? .12 : .2 },
|
|
2632
|
-
children: [/* @__PURE__ */ h(
|
|
2633
|
-
className:
|
|
2625
|
+
children: [/* @__PURE__ */ h(en, { state: t }), /* @__PURE__ */ g("span", {
|
|
2626
|
+
className: dn.body,
|
|
2634
2627
|
children: [
|
|
2635
2628
|
/* @__PURE__ */ h("span", {
|
|
2636
|
-
className:
|
|
2629
|
+
className: dn.label,
|
|
2637
2630
|
children: e.label
|
|
2638
2631
|
}),
|
|
2639
2632
|
/* @__PURE__ */ h("span", {
|
|
2640
|
-
className:
|
|
2633
|
+
className: dn.srOnly,
|
|
2641
2634
|
children: u[t]
|
|
2642
2635
|
}),
|
|
2643
2636
|
e.detail && /* @__PURE__ */ h("span", {
|
|
2644
|
-
className:
|
|
2637
|
+
className: dn.detail,
|
|
2645
2638
|
children: e.detail
|
|
2646
2639
|
})
|
|
2647
2640
|
]
|
|
@@ -2653,7 +2646,7 @@ function fn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2653
2646
|
})]
|
|
2654
2647
|
});
|
|
2655
2648
|
}
|
|
2656
|
-
var
|
|
2649
|
+
var mn = {
|
|
2657
2650
|
chain: "ick-chain-NGeh",
|
|
2658
2651
|
list: "ick-list-B2Pj",
|
|
2659
2652
|
step: "ick-step--tPX",
|
|
@@ -2661,46 +2654,46 @@ var pn = {
|
|
|
2661
2654
|
body: "ick-body-kZu-",
|
|
2662
2655
|
stepLabel: "ick-stepLabel-Hl78",
|
|
2663
2656
|
working: "ick-working-MbDs"
|
|
2664
|
-
},
|
|
2657
|
+
}, hn = {
|
|
2665
2658
|
through: "Thought through",
|
|
2666
2659
|
step: "step",
|
|
2667
2660
|
steps: "steps",
|
|
2668
2661
|
thinking: "Thinking"
|
|
2669
2662
|
};
|
|
2670
|
-
function
|
|
2663
|
+
function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: c, ...l }) {
|
|
2671
2664
|
let u = {
|
|
2672
|
-
...
|
|
2665
|
+
...hn,
|
|
2673
2666
|
...o
|
|
2674
|
-
}, d = s(), f = q(), p = t === "thinking", { isOpen: m, toggle: v } =
|
|
2667
|
+
}, d = s(), f = q(), p = t === "thinking", { isOpen: m, toggle: v } = kt({
|
|
2675
2668
|
open: r,
|
|
2676
2669
|
defaultOpen: i,
|
|
2677
2670
|
onOpenChange: a,
|
|
2678
2671
|
preferOpen: p
|
|
2679
|
-
}), y = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" :
|
|
2672
|
+
}), y = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" : Ft(n ?? NaN), S = `${u.through} ${e.length} ${e.length === 1 ? u.step : u.steps}`;
|
|
2680
2673
|
return /* @__PURE__ */ g("section", {
|
|
2681
|
-
className: [
|
|
2674
|
+
className: [mn.chain, c ?? ""].filter(Boolean).join(" "),
|
|
2682
2675
|
"data-state": t,
|
|
2683
2676
|
...l,
|
|
2684
|
-
children: [/* @__PURE__ */ h(
|
|
2677
|
+
children: [/* @__PURE__ */ h(Mt, {
|
|
2685
2678
|
fit: "inline",
|
|
2686
2679
|
open: m,
|
|
2687
2680
|
onToggle: v,
|
|
2688
2681
|
controls: d,
|
|
2689
|
-
glyph: /* @__PURE__ */ h(
|
|
2682
|
+
glyph: /* @__PURE__ */ h(en, { state: p ? "running" : "done" }),
|
|
2690
2683
|
label: p ? y?.label ?? u.thinking : S,
|
|
2691
2684
|
pending: p,
|
|
2692
2685
|
meta: b || void 0
|
|
2693
|
-
}), /* @__PURE__ */ h(
|
|
2686
|
+
}), /* @__PURE__ */ h(Pt, {
|
|
2694
2687
|
id: d,
|
|
2695
2688
|
open: m && e.length > 0,
|
|
2696
2689
|
children: /* @__PURE__ */ h("ol", {
|
|
2697
|
-
className:
|
|
2690
|
+
className: mn.list,
|
|
2698
2691
|
children: /* @__PURE__ */ h(_, {
|
|
2699
2692
|
initial: !1,
|
|
2700
2693
|
children: e.map((e) => {
|
|
2701
2694
|
let t = e.state ?? "done";
|
|
2702
2695
|
return /* @__PURE__ */ g(x.li, {
|
|
2703
|
-
className:
|
|
2696
|
+
className: mn.step,
|
|
2704
2697
|
"data-state": t,
|
|
2705
2698
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2706
2699
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2717,16 +2710,16 @@ function hn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2717
2710
|
},
|
|
2718
2711
|
transition: { duration: f ? .12 : .2 },
|
|
2719
2712
|
children: [/* @__PURE__ */ h("span", {
|
|
2720
|
-
className:
|
|
2713
|
+
className: mn.rail,
|
|
2721
2714
|
"aria-hidden": !0,
|
|
2722
|
-
children: /* @__PURE__ */ h(
|
|
2715
|
+
children: /* @__PURE__ */ h(en, { state: t })
|
|
2723
2716
|
}), /* @__PURE__ */ g("span", {
|
|
2724
|
-
className:
|
|
2717
|
+
className: mn.body,
|
|
2725
2718
|
children: [/* @__PURE__ */ h("span", {
|
|
2726
|
-
className:
|
|
2719
|
+
className: mn.stepLabel,
|
|
2727
2720
|
children: e.label
|
|
2728
2721
|
}), e.body && /* @__PURE__ */ h("span", {
|
|
2729
|
-
className:
|
|
2722
|
+
className: mn.working,
|
|
2730
2723
|
children: e.body
|
|
2731
2724
|
})]
|
|
2732
2725
|
})]
|
|
@@ -2737,7 +2730,7 @@ function hn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2737
2730
|
})]
|
|
2738
2731
|
});
|
|
2739
2732
|
}
|
|
2740
|
-
var
|
|
2733
|
+
var _n = {
|
|
2741
2734
|
sources: "ick-sources-w6ma",
|
|
2742
2735
|
list: "ick-list-UdKr",
|
|
2743
2736
|
item: "ick-item-zBLs",
|
|
@@ -2747,63 +2740,63 @@ var gn = {
|
|
|
2747
2740
|
name: "ick-name-1IlF",
|
|
2748
2741
|
origin: "ick-origin-3C2I",
|
|
2749
2742
|
quote: "ick-quote-wat-"
|
|
2750
|
-
},
|
|
2743
|
+
}, vn = {
|
|
2751
2744
|
title: "Sources",
|
|
2752
2745
|
one: "source",
|
|
2753
2746
|
many: "sources"
|
|
2754
2747
|
};
|
|
2755
|
-
function
|
|
2748
|
+
function yn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onSelect: i, open: a, defaultOpen: o, onOpenChange: c, labels: l, className: u, ...d }) {
|
|
2756
2749
|
let f = {
|
|
2757
|
-
...
|
|
2750
|
+
...vn,
|
|
2758
2751
|
...l
|
|
2759
|
-
}, p = s(), _ =
|
|
2752
|
+
}, p = s(), _ = kt({
|
|
2760
2753
|
open: a,
|
|
2761
2754
|
defaultOpen: o,
|
|
2762
2755
|
onOpenChange: c,
|
|
2763
2756
|
preferOpen: !0
|
|
2764
2757
|
}), v = !n || _.isOpen, y = `${e.length} ${e.length === 1 ? f.one : f.many}`;
|
|
2765
2758
|
return /* @__PURE__ */ g("section", {
|
|
2766
|
-
className: [
|
|
2759
|
+
className: [_n.sources, u ?? ""].filter(Boolean).join(" "),
|
|
2767
2760
|
...d,
|
|
2768
|
-
children: [/* @__PURE__ */ h(
|
|
2761
|
+
children: [/* @__PURE__ */ h(Mt, {
|
|
2769
2762
|
open: v,
|
|
2770
2763
|
onToggle: n ? _.toggle : void 0,
|
|
2771
2764
|
controls: p,
|
|
2772
2765
|
label: t ?? f.title,
|
|
2773
2766
|
meta: y
|
|
2774
|
-
}), /* @__PURE__ */ h(
|
|
2767
|
+
}), /* @__PURE__ */ h(Pt, {
|
|
2775
2768
|
id: p,
|
|
2776
2769
|
open: v && e.length > 0,
|
|
2777
2770
|
children: /* @__PURE__ */ h("ol", {
|
|
2778
|
-
className:
|
|
2771
|
+
className: _n.list,
|
|
2779
2772
|
children: e.map((e, t) => {
|
|
2780
2773
|
let n = t + 1, a = e.id === r, o = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
2781
|
-
className:
|
|
2774
|
+
className: _n.number,
|
|
2782
2775
|
"data-active": a || void 0,
|
|
2783
2776
|
children: n
|
|
2784
2777
|
}), /* @__PURE__ */ g("span", {
|
|
2785
|
-
className:
|
|
2778
|
+
className: _n.body,
|
|
2786
2779
|
children: [
|
|
2787
2780
|
/* @__PURE__ */ h("span", {
|
|
2788
|
-
className:
|
|
2781
|
+
className: _n.name,
|
|
2789
2782
|
children: e.title
|
|
2790
2783
|
}),
|
|
2791
2784
|
e.origin && /* @__PURE__ */ h("span", {
|
|
2792
|
-
className:
|
|
2785
|
+
className: _n.origin,
|
|
2793
2786
|
children: e.origin
|
|
2794
2787
|
}),
|
|
2795
2788
|
e.quote && /* @__PURE__ */ h("span", {
|
|
2796
|
-
className:
|
|
2789
|
+
className: _n.quote,
|
|
2797
2790
|
children: e.quote
|
|
2798
2791
|
})
|
|
2799
2792
|
]
|
|
2800
2793
|
})] });
|
|
2801
2794
|
return /* @__PURE__ */ h("li", {
|
|
2802
|
-
className:
|
|
2795
|
+
className: _n.item,
|
|
2803
2796
|
"data-active": a || void 0,
|
|
2804
2797
|
id: `${p}-${e.id}`,
|
|
2805
2798
|
children: e.url ? /* @__PURE__ */ h("a", {
|
|
2806
|
-
className:
|
|
2799
|
+
className: _n.entry,
|
|
2807
2800
|
href: e.url,
|
|
2808
2801
|
target: "_blank",
|
|
2809
2802
|
rel: "noreferrer noopener",
|
|
@@ -2811,7 +2804,7 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2811
2804
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2812
2805
|
children: o
|
|
2813
2806
|
}) : /* @__PURE__ */ h("div", {
|
|
2814
|
-
className:
|
|
2807
|
+
className: _n.entry,
|
|
2815
2808
|
children: o
|
|
2816
2809
|
})
|
|
2817
2810
|
}, e.id);
|
|
@@ -2820,13 +2813,13 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2820
2813
|
})]
|
|
2821
2814
|
});
|
|
2822
2815
|
}
|
|
2823
|
-
var
|
|
2816
|
+
var bn = { chip: "ick-chip-FJNL" };
|
|
2824
2817
|
//#endregion
|
|
2825
2818
|
//#region src/Chip/Chip.tsx
|
|
2826
|
-
function
|
|
2819
|
+
function xn({ children: e, className: t }) {
|
|
2827
2820
|
let n = q();
|
|
2828
2821
|
return /* @__PURE__ */ h(x.span, {
|
|
2829
|
-
className: [
|
|
2822
|
+
className: [bn.chip, t ?? ""].filter(Boolean).join(" "),
|
|
2830
2823
|
initial: n ? { opacity: 0 } : {
|
|
2831
2824
|
opacity: 0,
|
|
2832
2825
|
scale: .85
|
|
@@ -2871,7 +2864,7 @@ var X = {
|
|
|
2871
2864
|
fieldLabel: "ick-fieldLabel--DkK",
|
|
2872
2865
|
fieldInput: "ick-fieldInput-Er9C",
|
|
2873
2866
|
shellCard: "ick-shellCard-pBK9"
|
|
2874
|
-
},
|
|
2867
|
+
}, Sn = n(function({ children: e, selected: t, onCard: n, className: r, ...i }, a) {
|
|
2875
2868
|
return /* @__PURE__ */ h("span", {
|
|
2876
2869
|
ref: a,
|
|
2877
2870
|
className: [X.badge, r ?? ""].filter(Boolean).join(" "),
|
|
@@ -2881,7 +2874,7 @@ var X = {
|
|
|
2881
2874
|
...i,
|
|
2882
2875
|
children: e
|
|
2883
2876
|
});
|
|
2884
|
-
}),
|
|
2877
|
+
}), Cn = n(function({ letter: e, title: t, description: n, selected: r = !1, className: i, ...a }, o) {
|
|
2885
2878
|
let s = q();
|
|
2886
2879
|
return /* @__PURE__ */ g(x.button, {
|
|
2887
2880
|
ref: o,
|
|
@@ -2891,7 +2884,7 @@ var X = {
|
|
|
2891
2884
|
"aria-pressed": r,
|
|
2892
2885
|
whileTap: s ? void 0 : { scale: .99 },
|
|
2893
2886
|
...a,
|
|
2894
|
-
children: [e !== void 0 && /* @__PURE__ */ h(
|
|
2887
|
+
children: [e !== void 0 && /* @__PURE__ */ h(Sn, {
|
|
2895
2888
|
selected: r,
|
|
2896
2889
|
children: e
|
|
2897
2890
|
}), /* @__PURE__ */ g("span", {
|
|
@@ -2905,13 +2898,13 @@ var X = {
|
|
|
2905
2898
|
})]
|
|
2906
2899
|
})]
|
|
2907
2900
|
});
|
|
2908
|
-
}),
|
|
2901
|
+
}), wn = n(function({ letter: e, label: t, value: n, onChange: r, onEnter: i, className: a, id: o, onFocus: c, onBlur: l, onKeyDown: u, ...d }, p) {
|
|
2909
2902
|
let [m, _] = f(!1), v = s(), y = o ?? v;
|
|
2910
2903
|
return /* @__PURE__ */ g("label", {
|
|
2911
2904
|
className: [X.field, a ?? ""].filter(Boolean).join(" "),
|
|
2912
2905
|
"data-focused": m || void 0,
|
|
2913
2906
|
htmlFor: y,
|
|
2914
|
-
children: [e !== void 0 && /* @__PURE__ */ h(
|
|
2907
|
+
children: [e !== void 0 && /* @__PURE__ */ h(Sn, {
|
|
2915
2908
|
selected: m,
|
|
2916
2909
|
children: e
|
|
2917
2910
|
}), /* @__PURE__ */ g("span", {
|
|
@@ -2939,13 +2932,13 @@ var X = {
|
|
|
2939
2932
|
})]
|
|
2940
2933
|
})]
|
|
2941
2934
|
});
|
|
2942
|
-
}),
|
|
2935
|
+
}), Tn = n(function({ letter: e, value: t, placeholder: n, onChange: r, onEnter: i, className: a, onKeyDown: o, ...s }, c) {
|
|
2943
2936
|
let l = t.trim().length > 0;
|
|
2944
2937
|
return /* @__PURE__ */ g("label", {
|
|
2945
2938
|
className: [X.option, a ?? ""].filter(Boolean).join(" "),
|
|
2946
2939
|
"data-selected": l || void 0,
|
|
2947
2940
|
"data-other": "",
|
|
2948
|
-
children: [e !== void 0 && /* @__PURE__ */ h(
|
|
2941
|
+
children: [e !== void 0 && /* @__PURE__ */ h(Sn, {
|
|
2949
2942
|
selected: l,
|
|
2950
2943
|
children: e
|
|
2951
2944
|
}), /* @__PURE__ */ h("span", {
|
|
@@ -2965,7 +2958,7 @@ var X = {
|
|
|
2965
2958
|
})
|
|
2966
2959
|
})]
|
|
2967
2960
|
});
|
|
2968
|
-
}),
|
|
2961
|
+
}), En = n(function({ number: e, title: t, subtitle: n, children: r, footer: i, card: a = !0, className: o, ...s }, c) {
|
|
2969
2962
|
return /* @__PURE__ */ g("div", {
|
|
2970
2963
|
ref: c,
|
|
2971
2964
|
className: [
|
|
@@ -2977,7 +2970,7 @@ var X = {
|
|
|
2977
2970
|
children: [
|
|
2978
2971
|
/* @__PURE__ */ g("div", {
|
|
2979
2972
|
className: X.header,
|
|
2980
|
-
children: [e !== void 0 && /* @__PURE__ */ h(
|
|
2973
|
+
children: [e !== void 0 && /* @__PURE__ */ h(Sn, {
|
|
2981
2974
|
selected: !0,
|
|
2982
2975
|
children: e
|
|
2983
2976
|
}), /* @__PURE__ */ g("div", {
|
|
@@ -3004,7 +2997,7 @@ var X = {
|
|
|
3004
2997
|
});
|
|
3005
2998
|
//#endregion
|
|
3006
2999
|
//#region src/radiusCorrection/useCorrectedRadius.ts
|
|
3007
|
-
function
|
|
3000
|
+
function Dn(e) {
|
|
3008
3001
|
let [t, n] = f(void 0);
|
|
3009
3002
|
return l(() => {
|
|
3010
3003
|
let t = e.current;
|
|
@@ -3015,16 +3008,16 @@ function En(e) {
|
|
|
3015
3008
|
}
|
|
3016
3009
|
//#endregion
|
|
3017
3010
|
//#region src/QuestionCard/QuestionCard.tsx
|
|
3018
|
-
var
|
|
3011
|
+
var On = {
|
|
3019
3012
|
next: "Next",
|
|
3020
3013
|
none: "None of these",
|
|
3021
3014
|
edit: "Edit answer"
|
|
3022
|
-
},
|
|
3015
|
+
}, kn = {
|
|
3023
3016
|
type: "spring",
|
|
3024
3017
|
stiffness: 260,
|
|
3025
3018
|
damping: 30
|
|
3026
|
-
},
|
|
3027
|
-
function
|
|
3019
|
+
}, An = (e) => String.fromCharCode(97 + e), jn = 300, Mn = 380;
|
|
3020
|
+
function Nn(e, t) {
|
|
3028
3021
|
if (!t) return [];
|
|
3029
3022
|
if (e.type === "inputs" && "values" in t) {
|
|
3030
3023
|
let n = e.fields.map((e) => t.values?.[e.id]).filter(Boolean);
|
|
@@ -3042,11 +3035,11 @@ function Mn(e, t) {
|
|
|
3042
3035
|
}
|
|
3043
3036
|
return [];
|
|
3044
3037
|
}
|
|
3045
|
-
function
|
|
3038
|
+
function Pn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
3046
3039
|
let [a, s] = f(() => n && "values" in n ? { ...n.values } : {}), [c, l] = f(() => n && "optionIds" in n ? [...n.optionIds ?? []] : []), [p, m] = f(() => n && "optionIds" in n ? n.other ?? "" : ""), [_, v] = f(n && "optionId" in n ? n.optionId : null), y = d(null), b = u(() => e.type === "inputs" ? e.fields.map(() => ({ current: null })) : [], [e]);
|
|
3047
3040
|
o(() => {
|
|
3048
3041
|
if (e.type !== "inputs") return;
|
|
3049
|
-
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 :
|
|
3042
|
+
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), q() ? 0 : Mn);
|
|
3050
3043
|
return () => clearTimeout(t);
|
|
3051
3044
|
}, [e.type]);
|
|
3052
3045
|
let x = u(() => e.type !== "inputs" || e.fields.every((e) => e.optional || (a[e.id] ?? "").trim()), [e, a]), S = {
|
|
@@ -3057,17 +3050,17 @@ function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3057
3050
|
};
|
|
3058
3051
|
if (e.type === "inputs") {
|
|
3059
3052
|
let t = () => x && r?.({ values: a });
|
|
3060
|
-
return /* @__PURE__ */ h(
|
|
3053
|
+
return /* @__PURE__ */ h(En, {
|
|
3061
3054
|
...S,
|
|
3062
|
-
footer: /* @__PURE__ */ h(
|
|
3055
|
+
footer: /* @__PURE__ */ h(H, {
|
|
3063
3056
|
variant: "secondary",
|
|
3064
3057
|
size: "m",
|
|
3065
3058
|
disabled: !x,
|
|
3066
3059
|
onClick: t,
|
|
3067
3060
|
children: i.next
|
|
3068
3061
|
}),
|
|
3069
|
-
children: e.fields.map((e, n) => /* @__PURE__ */ h(
|
|
3070
|
-
letter:
|
|
3062
|
+
children: e.fields.map((e, n) => /* @__PURE__ */ h(wn, {
|
|
3063
|
+
letter: An(n),
|
|
3071
3064
|
label: e.label,
|
|
3072
3065
|
placeholder: e.placeholder,
|
|
3073
3066
|
value: a[e.id] ?? "",
|
|
@@ -3083,15 +3076,15 @@ function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3083
3076
|
}, e.id))
|
|
3084
3077
|
});
|
|
3085
3078
|
}
|
|
3086
|
-
if (e.type === "single") return /* @__PURE__ */ h(
|
|
3079
|
+
if (e.type === "single") return /* @__PURE__ */ h(En, {
|
|
3087
3080
|
...S,
|
|
3088
|
-
children: e.options.map((e, t) => /* @__PURE__ */ h(
|
|
3089
|
-
letter:
|
|
3081
|
+
children: e.options.map((e, t) => /* @__PURE__ */ h(Cn, {
|
|
3082
|
+
letter: An(t),
|
|
3090
3083
|
title: e.title,
|
|
3091
3084
|
description: e.description,
|
|
3092
3085
|
selected: _ === e.id,
|
|
3093
3086
|
onClick: () => {
|
|
3094
|
-
v(e.id), setTimeout(() => r?.({ optionId: e.id }),
|
|
3087
|
+
v(e.id), setTimeout(() => r?.({ optionId: e.id }), jn);
|
|
3095
3088
|
}
|
|
3096
3089
|
}, e.id))
|
|
3097
3090
|
});
|
|
@@ -3101,23 +3094,23 @@ function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3101
3094
|
...C ? { other: C } : {}
|
|
3102
3095
|
});
|
|
3103
3096
|
};
|
|
3104
|
-
return /* @__PURE__ */ g(
|
|
3097
|
+
return /* @__PURE__ */ g(En, {
|
|
3105
3098
|
...S,
|
|
3106
|
-
footer: /* @__PURE__ */ h(
|
|
3099
|
+
footer: /* @__PURE__ */ h(H, {
|
|
3107
3100
|
variant: "secondary",
|
|
3108
3101
|
size: "m",
|
|
3109
3102
|
disabled: !e.allowEmpty && w,
|
|
3110
3103
|
onClick: T,
|
|
3111
3104
|
children: e.allowEmpty && w ? i.none : i.next
|
|
3112
3105
|
}),
|
|
3113
|
-
children: [e.options.map((e, t) => /* @__PURE__ */ h(
|
|
3114
|
-
letter:
|
|
3106
|
+
children: [e.options.map((e, t) => /* @__PURE__ */ h(Cn, {
|
|
3107
|
+
letter: An(t),
|
|
3115
3108
|
title: e.title,
|
|
3116
3109
|
description: e.description,
|
|
3117
3110
|
selected: c.includes(e.id),
|
|
3118
3111
|
onClick: () => l((t) => t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t, e.id])
|
|
3119
|
-
}, e.id)), e.allowOther && /* @__PURE__ */ h(
|
|
3120
|
-
letter:
|
|
3112
|
+
}, e.id)), e.allowOther && /* @__PURE__ */ h(Tn, {
|
|
3113
|
+
letter: An(e.options.length),
|
|
3121
3114
|
value: p,
|
|
3122
3115
|
placeholder: e.otherPlaceholder ?? "Something else",
|
|
3123
3116
|
onChange: m,
|
|
@@ -3125,12 +3118,12 @@ function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3125
3118
|
})]
|
|
3126
3119
|
});
|
|
3127
3120
|
}
|
|
3128
|
-
function
|
|
3121
|
+
function Fn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit: a, readOnly: o = !1, labels: s }) {
|
|
3129
3122
|
let c = {
|
|
3130
|
-
...
|
|
3123
|
+
...On,
|
|
3131
3124
|
...s
|
|
3132
|
-
}, l = n !== "upcoming", u = q(), f = d(null), p =
|
|
3133
|
-
if (n === "active") v = /* @__PURE__ */ h(
|
|
3125
|
+
}, l = n !== "upcoming", u = q(), f = d(null), p = Dn(f), v;
|
|
3126
|
+
if (n === "active") v = /* @__PURE__ */ h(Pn, {
|
|
3134
3127
|
question: e,
|
|
3135
3128
|
number: t,
|
|
3136
3129
|
answer: r,
|
|
@@ -3138,9 +3131,9 @@ function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3138
3131
|
labels: c
|
|
3139
3132
|
});
|
|
3140
3133
|
else if (n === "collapsed") {
|
|
3141
|
-
let n =
|
|
3134
|
+
let n = Nn(e, r), i = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("span", {
|
|
3142
3135
|
className: X.collapsedLabel,
|
|
3143
|
-
children: [/* @__PURE__ */ h(
|
|
3136
|
+
children: [/* @__PURE__ */ h(Sn, {
|
|
3144
3137
|
onCard: !0,
|
|
3145
3138
|
children: t
|
|
3146
3139
|
}), /* @__PURE__ */ h("span", {
|
|
@@ -3149,7 +3142,7 @@ function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3149
3142
|
})]
|
|
3150
3143
|
}), /* @__PURE__ */ g("span", {
|
|
3151
3144
|
className: X.collapsedAnswer,
|
|
3152
|
-
children: [n.map((e, t) => /* @__PURE__ */ h(
|
|
3145
|
+
children: [n.map((e, t) => /* @__PURE__ */ h(xn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ h(de, {
|
|
3153
3146
|
className: X.pencil,
|
|
3154
3147
|
size: 14,
|
|
3155
3148
|
"aria-hidden": !0
|
|
@@ -3167,7 +3160,7 @@ function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3167
3160
|
});
|
|
3168
3161
|
} else v = /* @__PURE__ */ g("div", {
|
|
3169
3162
|
className: X.upcoming,
|
|
3170
|
-
children: [/* @__PURE__ */ h(
|
|
3163
|
+
children: [/* @__PURE__ */ h(Sn, { children: t }), /* @__PURE__ */ h("span", {
|
|
3171
3164
|
className: X.upcomingLabel,
|
|
3172
3165
|
children: e.shortTitle
|
|
3173
3166
|
})]
|
|
@@ -3178,7 +3171,7 @@ function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3178
3171
|
"data-active": n === "active" || void 0,
|
|
3179
3172
|
className: X.item,
|
|
3180
3173
|
"data-card": l || void 0,
|
|
3181
|
-
transition: { layout:
|
|
3174
|
+
transition: { layout: kn },
|
|
3182
3175
|
style: { borderRadius: p },
|
|
3183
3176
|
children: /* @__PURE__ */ h(_, {
|
|
3184
3177
|
mode: "popLayout",
|
|
@@ -3202,7 +3195,7 @@ function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3202
3195
|
})
|
|
3203
3196
|
});
|
|
3204
3197
|
}
|
|
3205
|
-
var
|
|
3198
|
+
var In = {
|
|
3206
3199
|
group: "ick-group-pPcU",
|
|
3207
3200
|
body: "ick-body-lHD3",
|
|
3208
3201
|
list: "ick-list-7cp2",
|
|
@@ -3210,7 +3203,7 @@ var Fn = {
|
|
|
3210
3203
|
summary: "ick-summary-eb2t",
|
|
3211
3204
|
count: "ick-count-eHDc",
|
|
3212
3205
|
summaryList: "ick-summaryList-2sOL"
|
|
3213
|
-
},
|
|
3206
|
+
}, Ln = 3, Rn = {
|
|
3214
3207
|
visualDuration: .34,
|
|
3215
3208
|
bounce: .1,
|
|
3216
3209
|
rowDuration: .3,
|
|
@@ -3220,13 +3213,13 @@ var Fn = {
|
|
|
3220
3213
|
fadeIn: .16,
|
|
3221
3214
|
fadeOut: .08,
|
|
3222
3215
|
fadeInDelay: .08
|
|
3223
|
-
},
|
|
3224
|
-
function
|
|
3225
|
-
let [y, b] = f(!1), [S, C] = f(!1), w = s(), T = d(null), E =
|
|
3226
|
-
...
|
|
3216
|
+
}, zn = { answers: "answers" };
|
|
3217
|
+
function Bn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null, collapsible: a = !1, onCommit: o, onEdit: c, readOnly: l = !1, labels: u, foldMotion: p, className: m }) {
|
|
3218
|
+
let [y, b] = f(!1), [S, C] = f(!1), w = s(), T = d(null), E = Dn(T), D = {
|
|
3219
|
+
...zn,
|
|
3227
3220
|
...u
|
|
3228
3221
|
}, O = q(), k = a && !y, A = n.map((e) => e.shortTitle).join(" · "), j = {
|
|
3229
|
-
...
|
|
3222
|
+
...Rn,
|
|
3230
3223
|
...p
|
|
3231
3224
|
}, M = O ? { duration: 0 } : {
|
|
3232
3225
|
type: "spring",
|
|
@@ -3270,13 +3263,13 @@ function zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3270
3263
|
ref: T,
|
|
3271
3264
|
layout: !O,
|
|
3272
3265
|
transition: M,
|
|
3273
|
-
className: [
|
|
3266
|
+
className: [In.group, m ?? ""].filter(Boolean).join(" "),
|
|
3274
3267
|
"data-moving": S || void 0,
|
|
3275
3268
|
style: { borderRadius: E },
|
|
3276
3269
|
children: [(t || a) && /* @__PURE__ */ h(x.div, {
|
|
3277
3270
|
layout: !O && "position",
|
|
3278
3271
|
transition: M,
|
|
3279
|
-
children: /* @__PURE__ */ h(
|
|
3272
|
+
children: /* @__PURE__ */ h(Mt, {
|
|
3280
3273
|
open: !k,
|
|
3281
3274
|
onToggle: a ? () => {
|
|
3282
3275
|
C(!0), b((e) => !e);
|
|
@@ -3288,7 +3281,7 @@ function zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3288
3281
|
id: w,
|
|
3289
3282
|
layout: !O && "position",
|
|
3290
3283
|
transition: M,
|
|
3291
|
-
className:
|
|
3284
|
+
className: In.body,
|
|
3292
3285
|
children: /* @__PURE__ */ h(_, {
|
|
3293
3286
|
initial: !1,
|
|
3294
3287
|
mode: "popLayout",
|
|
@@ -3296,26 +3289,26 @@ function zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3296
3289
|
...F,
|
|
3297
3290
|
children: /* @__PURE__ */ g(x.div, {
|
|
3298
3291
|
variants: ee,
|
|
3299
|
-
className:
|
|
3292
|
+
className: In.summary,
|
|
3300
3293
|
children: [/* @__PURE__ */ g("span", {
|
|
3301
|
-
className:
|
|
3294
|
+
className: In.count,
|
|
3302
3295
|
children: [
|
|
3303
3296
|
n.length,
|
|
3304
3297
|
" ",
|
|
3305
3298
|
D.answers
|
|
3306
3299
|
]
|
|
3307
3300
|
}), /* @__PURE__ */ h("span", {
|
|
3308
|
-
className:
|
|
3301
|
+
className: In.summaryList,
|
|
3309
3302
|
children: A
|
|
3310
3303
|
})]
|
|
3311
3304
|
})
|
|
3312
3305
|
}, "summary") : /* @__PURE__ */ h(x.div, {
|
|
3313
|
-
className:
|
|
3306
|
+
className: In.list,
|
|
3314
3307
|
...F,
|
|
3315
3308
|
children: n.map((e, t) => /* @__PURE__ */ h(x.div, {
|
|
3316
3309
|
variants: ee,
|
|
3317
|
-
className:
|
|
3318
|
-
children: /* @__PURE__ */ h(
|
|
3310
|
+
className: In.row,
|
|
3311
|
+
children: /* @__PURE__ */ h(Fn, {
|
|
3319
3312
|
question: e,
|
|
3320
3313
|
number: t + 1,
|
|
3321
3314
|
state: t === i ? "active" : r[e.id] ? "collapsed" : "upcoming",
|
|
@@ -3331,18 +3324,18 @@ function zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3331
3324
|
})
|
|
3332
3325
|
});
|
|
3333
3326
|
}
|
|
3334
|
-
var
|
|
3327
|
+
var Vn = { message: "ick-message-wTar" };
|
|
3335
3328
|
//#endregion
|
|
3336
3329
|
//#region src/SystemMessage/SystemMessage.tsx
|
|
3337
|
-
function
|
|
3330
|
+
function Hn({ children: e, tone: t = "notice", className: n, ...r }) {
|
|
3338
3331
|
return /* @__PURE__ */ h("div", {
|
|
3339
|
-
className: [
|
|
3332
|
+
className: [Vn.message, n ?? ""].filter(Boolean).join(" "),
|
|
3340
3333
|
"data-tone": t,
|
|
3341
3334
|
...r,
|
|
3342
3335
|
children: e
|
|
3343
3336
|
});
|
|
3344
3337
|
}
|
|
3345
|
-
var
|
|
3338
|
+
var Un = {
|
|
3346
3339
|
artifact: "ick-artifact-rz53",
|
|
3347
3340
|
card: "ick-card-iGYJ",
|
|
3348
3341
|
head: "ick-head-XVNm",
|
|
@@ -3352,38 +3345,38 @@ var Hn = {
|
|
|
3352
3345
|
preview: "ick-preview-jRni",
|
|
3353
3346
|
text: "ick-text-uJx8",
|
|
3354
3347
|
waiting: "ick-waiting-ADQs"
|
|
3355
|
-
},
|
|
3356
|
-
function
|
|
3348
|
+
}, Wn = 8;
|
|
3349
|
+
function Gn(e, t) {
|
|
3357
3350
|
let n = e.split("\n");
|
|
3358
3351
|
return {
|
|
3359
3352
|
shown: n.slice(0, t).join("\n"),
|
|
3360
3353
|
more: n.length > t
|
|
3361
3354
|
};
|
|
3362
3355
|
}
|
|
3363
|
-
function
|
|
3364
|
-
let f = o === "writing", p = a ?
|
|
3365
|
-
className:
|
|
3356
|
+
function Kn({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, state: o = "done", lines: s = Wn, onOpen: c, open: l, className: u, ...d }) {
|
|
3357
|
+
let f = o === "writing", p = a ? Gn(a, s) : null, _ = /* @__PURE__ */ h("div", {
|
|
3358
|
+
className: Un.preview,
|
|
3366
3359
|
"data-more": p?.more || void 0,
|
|
3367
3360
|
"aria-hidden": !0,
|
|
3368
3361
|
children: p === null ? /* @__PURE__ */ h("div", {
|
|
3369
|
-
className:
|
|
3370
|
-
children: /* @__PURE__ */ h(
|
|
3371
|
-
}) : r === "code" ? /* @__PURE__ */ h(
|
|
3362
|
+
className: Un.waiting,
|
|
3363
|
+
children: /* @__PURE__ */ h(Ot, {})
|
|
3364
|
+
}) : r === "code" ? /* @__PURE__ */ h(Qt, {
|
|
3372
3365
|
code: p.shown,
|
|
3373
3366
|
lang: i,
|
|
3374
3367
|
label: !1,
|
|
3375
3368
|
copyable: !1
|
|
3376
3369
|
}) : /* @__PURE__ */ h("p", {
|
|
3377
|
-
className:
|
|
3370
|
+
className: Un.text,
|
|
3378
3371
|
children: p.shown
|
|
3379
3372
|
})
|
|
3380
|
-
}), v = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(
|
|
3373
|
+
}), v = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(qn, {
|
|
3381
3374
|
title: t,
|
|
3382
3375
|
meta: n,
|
|
3383
3376
|
writing: f
|
|
3384
|
-
}), _] }), y = { className:
|
|
3377
|
+
}), _] }), y = { className: Un.card };
|
|
3385
3378
|
return /* @__PURE__ */ h("div", {
|
|
3386
|
-
className: [
|
|
3379
|
+
className: [Un.artifact, u ?? ""].filter(Boolean).join(" "),
|
|
3387
3380
|
"data-state": o,
|
|
3388
3381
|
"data-open": l || void 0,
|
|
3389
3382
|
...d,
|
|
@@ -3399,36 +3392,36 @@ function Gn({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, s
|
|
|
3399
3392
|
})
|
|
3400
3393
|
});
|
|
3401
3394
|
}
|
|
3402
|
-
function
|
|
3395
|
+
function qn({ title: e, meta: t, writing: n }) {
|
|
3403
3396
|
return /* @__PURE__ */ g("span", {
|
|
3404
|
-
className:
|
|
3397
|
+
className: Un.head,
|
|
3405
3398
|
children: [/* @__PURE__ */ h("span", {
|
|
3406
|
-
className:
|
|
3399
|
+
className: Un.title,
|
|
3407
3400
|
"data-writing": n || void 0,
|
|
3408
3401
|
children: e
|
|
3409
3402
|
}), t && /* @__PURE__ */ h("span", {
|
|
3410
|
-
className:
|
|
3403
|
+
className: Un.meta,
|
|
3411
3404
|
children: t
|
|
3412
3405
|
})]
|
|
3413
3406
|
});
|
|
3414
3407
|
}
|
|
3415
3408
|
//#endregion
|
|
3416
3409
|
//#region src/markdown/parse.ts
|
|
3417
|
-
var
|
|
3418
|
-
function
|
|
3410
|
+
var Jn = "\\`*_{}[]()#+-.!>~|", Yn = (e) => e === void 0 || /\s/.test(e);
|
|
3411
|
+
function Xn(e, t, n, r) {
|
|
3419
3412
|
let i = e[t + n];
|
|
3420
|
-
return !(
|
|
3413
|
+
return !(Yn(i) || r === "_" && /[\w]/.test(e[t - 1] ?? ""));
|
|
3421
3414
|
}
|
|
3422
|
-
function
|
|
3415
|
+
function Zn(e, t, n, r) {
|
|
3423
3416
|
let i = e[t - 1];
|
|
3424
|
-
return !(
|
|
3417
|
+
return !(Yn(i) || r === "_" && /[\w]/.test(e[t + n] ?? ""));
|
|
3425
3418
|
}
|
|
3426
|
-
function
|
|
3419
|
+
function Qn(e, t, n) {
|
|
3427
3420
|
let r = 0;
|
|
3428
3421
|
for (; e[t + r] === n;) r++;
|
|
3429
3422
|
return r;
|
|
3430
3423
|
}
|
|
3431
|
-
function
|
|
3424
|
+
function $n(e, t) {
|
|
3432
3425
|
let n = 0;
|
|
3433
3426
|
for (let r = t; r < e.length; r++) {
|
|
3434
3427
|
let t = e[r];
|
|
@@ -3437,7 +3430,7 @@ function Qn(e, t) {
|
|
|
3437
3430
|
continue;
|
|
3438
3431
|
}
|
|
3439
3432
|
if (t === "`") {
|
|
3440
|
-
let t =
|
|
3433
|
+
let t = Qn(e, r, "`"), n = e.indexOf("`".repeat(t), r + t);
|
|
3441
3434
|
r = n === -1 ? e.length : n + t - 1;
|
|
3442
3435
|
continue;
|
|
3443
3436
|
}
|
|
@@ -3446,7 +3439,7 @@ function Qn(e, t) {
|
|
|
3446
3439
|
}
|
|
3447
3440
|
return -1;
|
|
3448
3441
|
}
|
|
3449
|
-
function
|
|
3442
|
+
function er(e, t) {
|
|
3450
3443
|
if (e[t] !== "(") return null;
|
|
3451
3444
|
let n = 0, r = -1;
|
|
3452
3445
|
for (let i = t; i < e.length; i++) {
|
|
@@ -3468,8 +3461,8 @@ function $n(e, t) {
|
|
|
3468
3461
|
end: r + 1
|
|
3469
3462
|
};
|
|
3470
3463
|
}
|
|
3471
|
-
var
|
|
3472
|
-
function
|
|
3464
|
+
var tr = /^<\/?[A-Za-z][A-Za-z0-9-]*(\s[^<>]*?)?\/?>|^<!--[\s\S]*?-->/;
|
|
3465
|
+
function nr(e) {
|
|
3473
3466
|
let t = [], n = "", r = () => {
|
|
3474
3467
|
n && t.push({
|
|
3475
3468
|
type: "text",
|
|
@@ -3484,7 +3477,7 @@ function tr(e) {
|
|
|
3484
3477
|
r(), t.push({ type: "break" }), i += 2;
|
|
3485
3478
|
continue;
|
|
3486
3479
|
}
|
|
3487
|
-
if (o &&
|
|
3480
|
+
if (o && Jn.includes(o)) {
|
|
3488
3481
|
n += o, i += 2;
|
|
3489
3482
|
continue;
|
|
3490
3483
|
}
|
|
@@ -3497,7 +3490,7 @@ function tr(e) {
|
|
|
3497
3490
|
continue;
|
|
3498
3491
|
}
|
|
3499
3492
|
if (a === "`") {
|
|
3500
|
-
let n =
|
|
3493
|
+
let n = Qn(e, i, "`"), a = e.indexOf("`".repeat(n), i + n);
|
|
3501
3494
|
if (a !== -1 && !e.slice(i + n, a).startsWith("`")) {
|
|
3502
3495
|
r();
|
|
3503
3496
|
let o = e.slice(i + n, a);
|
|
@@ -3509,7 +3502,7 @@ function tr(e) {
|
|
|
3509
3502
|
}
|
|
3510
3503
|
}
|
|
3511
3504
|
if (a === "!" && e[i + 1] === "[") {
|
|
3512
|
-
let n =
|
|
3505
|
+
let n = $n(e, i + 1), a = n === -1 ? null : er(e, n + 1);
|
|
3513
3506
|
if (a) {
|
|
3514
3507
|
r(), t.push({
|
|
3515
3508
|
type: "image",
|
|
@@ -3530,13 +3523,13 @@ function tr(e) {
|
|
|
3530
3523
|
}
|
|
3531
3524
|
}
|
|
3532
3525
|
if (a === "[") {
|
|
3533
|
-
let n =
|
|
3526
|
+
let n = $n(e, i), a = n === -1 ? null : er(e, n + 1);
|
|
3534
3527
|
if (a) {
|
|
3535
3528
|
r(), t.push({
|
|
3536
3529
|
type: "link",
|
|
3537
3530
|
url: a.url,
|
|
3538
3531
|
...a.title ? { title: a.title } : {},
|
|
3539
|
-
children:
|
|
3532
|
+
children: nr(e.slice(i + 1, n))
|
|
3540
3533
|
}), i = a.end;
|
|
3541
3534
|
continue;
|
|
3542
3535
|
}
|
|
@@ -3546,14 +3539,14 @@ function tr(e) {
|
|
|
3546
3539
|
if (n !== -1 && n > i + 2) {
|
|
3547
3540
|
r(), t.push({
|
|
3548
3541
|
type: "delete",
|
|
3549
|
-
children:
|
|
3542
|
+
children: nr(e.slice(i + 2, n))
|
|
3550
3543
|
}), i = n + 2;
|
|
3551
3544
|
continue;
|
|
3552
3545
|
}
|
|
3553
3546
|
}
|
|
3554
3547
|
if (a === "*" || a === "_") {
|
|
3555
|
-
let n = Math.min(
|
|
3556
|
-
if (
|
|
3548
|
+
let n = Math.min(Qn(e, i, a), 2);
|
|
3549
|
+
if (Xn(e, i, n, a)) {
|
|
3557
3550
|
let o = i + n, s = -1;
|
|
3558
3551
|
for (; o < e.length;) {
|
|
3559
3552
|
if (e[o] === "\\") {
|
|
@@ -3561,8 +3554,8 @@ function tr(e) {
|
|
|
3561
3554
|
continue;
|
|
3562
3555
|
}
|
|
3563
3556
|
if (e[o] === a) {
|
|
3564
|
-
let t =
|
|
3565
|
-
if (t >= n &&
|
|
3557
|
+
let t = Qn(e, o, a);
|
|
3558
|
+
if (t >= n && Zn(e, o, n, a)) {
|
|
3566
3559
|
s = o;
|
|
3567
3560
|
break;
|
|
3568
3561
|
}
|
|
@@ -3573,7 +3566,7 @@ function tr(e) {
|
|
|
3573
3566
|
}
|
|
3574
3567
|
if (s !== -1 && s > i + n) {
|
|
3575
3568
|
r();
|
|
3576
|
-
let a =
|
|
3569
|
+
let a = nr(e.slice(i + n, s));
|
|
3577
3570
|
t.push(n === 2 ? {
|
|
3578
3571
|
type: "strong",
|
|
3579
3572
|
children: a
|
|
@@ -3586,7 +3579,7 @@ function tr(e) {
|
|
|
3586
3579
|
}
|
|
3587
3580
|
}
|
|
3588
3581
|
if (a === "<") {
|
|
3589
|
-
let n = e.slice(i).match(
|
|
3582
|
+
let n = e.slice(i).match(tr);
|
|
3590
3583
|
if (n) {
|
|
3591
3584
|
r(), t.push({
|
|
3592
3585
|
type: "html",
|
|
@@ -3599,8 +3592,8 @@ function tr(e) {
|
|
|
3599
3592
|
}
|
|
3600
3593
|
return r(), t;
|
|
3601
3594
|
}
|
|
3602
|
-
var
|
|
3603
|
-
function
|
|
3595
|
+
var rr = /^ {0,3}(`{3,}|~{3,})\s*([^`\s]*)[^`]*$/, ir = /^ {0,3}(#{1,6})(?:\s+(.*?))?\s*#*\s*$/, ar = /^ {0,3}(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$/, or = /^ {0,3}>\s?/, sr = /^(\s*)([-*+])(\s+)(.*)$/, cr = /^(\s*)(\d{1,9})([.)])(\s+)(.*)$/, lr = /^ {0,3}\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/, ur = /^:?-+:?$/, dr = /^\s*$/;
|
|
3596
|
+
function fr(e) {
|
|
3604
3597
|
let t = e.trim().replace(/^\|/, "").replace(/\|$/, ""), n = [], r = "";
|
|
3605
3598
|
for (let e = 0; e < t.length; e++) {
|
|
3606
3599
|
if (t[e] === "\\" && t[e + 1] === "|") {
|
|
@@ -3615,16 +3608,16 @@ function dr(e) {
|
|
|
3615
3608
|
}
|
|
3616
3609
|
return n.push(r.trim()), n;
|
|
3617
3610
|
}
|
|
3618
|
-
var
|
|
3619
|
-
function
|
|
3611
|
+
var pr = (e) => rr.test(e) || ir.test(e) || ar.test(e) || or.test(e) || sr.test(e) || cr.test(e);
|
|
3612
|
+
function mr(e) {
|
|
3620
3613
|
let t = e.replace(/\r\n?/g, "\n").split("\n"), n = [], r = 0;
|
|
3621
3614
|
for (; r < t.length;) {
|
|
3622
3615
|
let e = t[r];
|
|
3623
|
-
if (
|
|
3616
|
+
if (dr.test(e)) {
|
|
3624
3617
|
r++;
|
|
3625
3618
|
continue;
|
|
3626
3619
|
}
|
|
3627
|
-
let i = e.match(
|
|
3620
|
+
let i = e.match(rr);
|
|
3628
3621
|
if (i) {
|
|
3629
3622
|
let e = i[1][0], a = i[1].length, o = [];
|
|
3630
3623
|
for (r++; r < t.length;) {
|
|
@@ -3641,44 +3634,44 @@ function pr(e) {
|
|
|
3641
3634
|
});
|
|
3642
3635
|
continue;
|
|
3643
3636
|
}
|
|
3644
|
-
let a = e.match(
|
|
3637
|
+
let a = e.match(ir);
|
|
3645
3638
|
if (a) {
|
|
3646
3639
|
n.push({
|
|
3647
3640
|
type: "heading",
|
|
3648
3641
|
depth: a[1].length,
|
|
3649
|
-
children:
|
|
3642
|
+
children: nr(a[2] ?? "")
|
|
3650
3643
|
}), r++;
|
|
3651
3644
|
continue;
|
|
3652
3645
|
}
|
|
3653
|
-
if (
|
|
3646
|
+
if (ar.test(e)) {
|
|
3654
3647
|
n.push({ type: "thematicBreak" }), r++;
|
|
3655
3648
|
continue;
|
|
3656
3649
|
}
|
|
3657
|
-
if (
|
|
3650
|
+
if (or.test(e)) {
|
|
3658
3651
|
let e = [];
|
|
3659
|
-
for (; r < t.length && !
|
|
3652
|
+
for (; r < t.length && !dr.test(t[r]);) e.push(t[r].replace(or, "")), r++;
|
|
3660
3653
|
n.push({
|
|
3661
3654
|
type: "blockquote",
|
|
3662
|
-
children:
|
|
3655
|
+
children: mr(e.join("\n"))
|
|
3663
3656
|
});
|
|
3664
3657
|
continue;
|
|
3665
3658
|
}
|
|
3666
|
-
let o = e.includes("|") && r + 1 < t.length &&
|
|
3667
|
-
if (o && o.length ===
|
|
3668
|
-
let i =
|
|
3659
|
+
let o = e.includes("|") && r + 1 < t.length && lr.test(t[r + 1]) ? fr(t[r + 1]) : null;
|
|
3660
|
+
if (o && o.length === fr(e).length && o.every((e) => ur.test(e))) {
|
|
3661
|
+
let i = fr(e), a = [{
|
|
3669
3662
|
type: "tableRow",
|
|
3670
3663
|
children: i.map((e) => ({
|
|
3671
3664
|
type: "tableCell",
|
|
3672
|
-
children:
|
|
3665
|
+
children: nr(e)
|
|
3673
3666
|
}))
|
|
3674
3667
|
}];
|
|
3675
|
-
for (r += 2; r < t.length && !
|
|
3676
|
-
let e =
|
|
3668
|
+
for (r += 2; r < t.length && !dr.test(t[r]) && t[r].includes("|");) {
|
|
3669
|
+
let e = fr(t[r]);
|
|
3677
3670
|
a.push({
|
|
3678
3671
|
type: "tableRow",
|
|
3679
3672
|
children: i.map((t, n) => ({
|
|
3680
3673
|
type: "tableCell",
|
|
3681
|
-
children:
|
|
3674
|
+
children: nr(e[n] ?? "")
|
|
3682
3675
|
}))
|
|
3683
3676
|
}), r++;
|
|
3684
3677
|
}
|
|
@@ -3688,16 +3681,16 @@ function pr(e) {
|
|
|
3688
3681
|
});
|
|
3689
3682
|
continue;
|
|
3690
3683
|
}
|
|
3691
|
-
let s = e.match(
|
|
3684
|
+
let s = e.match(sr), c = e.match(cr);
|
|
3692
3685
|
if (s || c) {
|
|
3693
3686
|
let e = !!c, i = c ? Number(c[2]) : void 0, a = [];
|
|
3694
3687
|
for (; r < t.length;) {
|
|
3695
|
-
let n = t[r].match(
|
|
3688
|
+
let n = t[r].match(sr), i = t[r].match(cr), o = e ? i : n;
|
|
3696
3689
|
if (!o || !!i !== e) break;
|
|
3697
3690
|
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]];
|
|
3698
3691
|
for (r++; r < t.length;) {
|
|
3699
3692
|
let e = t[r];
|
|
3700
|
-
if (
|
|
3693
|
+
if (dr.test(e)) {
|
|
3701
3694
|
let e = t[r + 1];
|
|
3702
3695
|
if (e !== void 0 && RegExp(`^ {${s},}\\S`).test(e)) {
|
|
3703
3696
|
c.push(""), r++;
|
|
@@ -3709,12 +3702,12 @@ function pr(e) {
|
|
|
3709
3702
|
c.push(e.slice(s)), r++;
|
|
3710
3703
|
continue;
|
|
3711
3704
|
}
|
|
3712
|
-
if (
|
|
3705
|
+
if (sr.test(e) || cr.test(e) || pr(e)) break;
|
|
3713
3706
|
c.push(e.trim()), r++;
|
|
3714
3707
|
}
|
|
3715
3708
|
a.push({
|
|
3716
3709
|
type: "listItem",
|
|
3717
|
-
children:
|
|
3710
|
+
children: mr(c.join("\n"))
|
|
3718
3711
|
});
|
|
3719
3712
|
}
|
|
3720
3713
|
n.push({
|
|
@@ -3726,25 +3719,25 @@ function pr(e) {
|
|
|
3726
3719
|
continue;
|
|
3727
3720
|
}
|
|
3728
3721
|
let l = [];
|
|
3729
|
-
for (; r < t.length && !
|
|
3722
|
+
for (; r < t.length && !dr.test(t[r]) && !(l.length && pr(t[r]) || l.length && t[r].includes("|") && r + 1 < t.length && lr.test(t[r + 1]));) l.push(t[r]), r++;
|
|
3730
3723
|
let u = l.map((e) => e.replace(/^[ \t]+/, "")).join("\n").replace(/\s+$/, "");
|
|
3731
3724
|
n.push({
|
|
3732
3725
|
type: "paragraph",
|
|
3733
|
-
children:
|
|
3726
|
+
children: nr(u)
|
|
3734
3727
|
});
|
|
3735
3728
|
}
|
|
3736
3729
|
return n;
|
|
3737
3730
|
}
|
|
3738
3731
|
//#endregion
|
|
3739
3732
|
//#region src/markdown/parseMarkdown.ts
|
|
3740
|
-
var
|
|
3733
|
+
var hr = "\n\n", gr = [
|
|
3741
3734
|
"h1",
|
|
3742
3735
|
"h2",
|
|
3743
3736
|
"h3",
|
|
3744
3737
|
"h4",
|
|
3745
3738
|
"h5",
|
|
3746
3739
|
"h6"
|
|
3747
|
-
],
|
|
3740
|
+
], _r = class {
|
|
3748
3741
|
tokens = [];
|
|
3749
3742
|
text(e) {
|
|
3750
3743
|
let t = [];
|
|
@@ -3755,7 +3748,7 @@ var mr = "\n\n", hr = [
|
|
|
3755
3748
|
return t;
|
|
3756
3749
|
}
|
|
3757
3750
|
break() {
|
|
3758
|
-
this.tokens.push(
|
|
3751
|
+
this.tokens.push(hr);
|
|
3759
3752
|
}
|
|
3760
3753
|
}, Z = (e, t, n) => ({
|
|
3761
3754
|
type: "el",
|
|
@@ -3763,29 +3756,29 @@ var mr = "\n\n", hr = [
|
|
|
3763
3756
|
children: t,
|
|
3764
3757
|
...n ? { props: n } : {}
|
|
3765
3758
|
});
|
|
3766
|
-
function
|
|
3759
|
+
function vr(e, t, n) {
|
|
3767
3760
|
return e.map((e, r) => (r > 0 && t.break(), n(e)));
|
|
3768
3761
|
}
|
|
3769
|
-
function
|
|
3762
|
+
function yr(e, t) {
|
|
3770
3763
|
let n = [];
|
|
3771
3764
|
for (let r of e) switch (r.type) {
|
|
3772
3765
|
case "text":
|
|
3773
3766
|
n.push(...t.text(r.value));
|
|
3774
3767
|
break;
|
|
3775
3768
|
case "strong":
|
|
3776
|
-
n.push(Z("strong",
|
|
3769
|
+
n.push(Z("strong", yr(r.children, t)));
|
|
3777
3770
|
break;
|
|
3778
3771
|
case "emphasis":
|
|
3779
|
-
n.push(Z("em",
|
|
3772
|
+
n.push(Z("em", yr(r.children, t)));
|
|
3780
3773
|
break;
|
|
3781
3774
|
case "delete":
|
|
3782
|
-
n.push(Z("del",
|
|
3775
|
+
n.push(Z("del", yr(r.children, t)));
|
|
3783
3776
|
break;
|
|
3784
3777
|
case "inlineCode":
|
|
3785
3778
|
n.push(Z("code", t.text(r.value)));
|
|
3786
3779
|
break;
|
|
3787
3780
|
case "link":
|
|
3788
|
-
n.push(Z("a",
|
|
3781
|
+
n.push(Z("a", yr(r.children, t), {
|
|
3789
3782
|
href: r.url,
|
|
3790
3783
|
target: "_blank",
|
|
3791
3784
|
rel: "noopener noreferrer",
|
|
@@ -3804,25 +3797,25 @@ function vr(e, t) {
|
|
|
3804
3797
|
case "break":
|
|
3805
3798
|
n.push(Z("br", []));
|
|
3806
3799
|
break;
|
|
3807
|
-
default: "children" in r && Array.isArray(r.children) && n.push(...
|
|
3800
|
+
default: "children" in r && Array.isArray(r.children) && n.push(...yr(r.children, t));
|
|
3808
3801
|
}
|
|
3809
3802
|
return n;
|
|
3810
3803
|
}
|
|
3811
|
-
function
|
|
3804
|
+
function br(e, t) {
|
|
3812
3805
|
let n = [];
|
|
3813
3806
|
return e.forEach((e, r) => {
|
|
3814
3807
|
switch (r > 0 && t.break(), e.type) {
|
|
3815
3808
|
case "paragraph":
|
|
3816
|
-
n.push(Z("p",
|
|
3809
|
+
n.push(Z("p", yr(e.children, t)));
|
|
3817
3810
|
break;
|
|
3818
3811
|
case "heading":
|
|
3819
|
-
n.push(Z(
|
|
3812
|
+
n.push(Z(gr[e.depth - 1] ?? "h6", yr(e.children, t)));
|
|
3820
3813
|
break;
|
|
3821
3814
|
case "list":
|
|
3822
|
-
n.push(Z(e.ordered ? "ol" : "ul",
|
|
3815
|
+
n.push(Z(e.ordered ? "ol" : "ul", vr(e.children, t, (e) => Z("li", br(e.children, t))), e.ordered && e.start != null && e.start !== 1 ? { start: String(e.start) } : void 0));
|
|
3823
3816
|
break;
|
|
3824
3817
|
case "blockquote":
|
|
3825
|
-
n.push(Z("blockquote",
|
|
3818
|
+
n.push(Z("blockquote", br(e.children, t)));
|
|
3826
3819
|
break;
|
|
3827
3820
|
case "code":
|
|
3828
3821
|
n.push({
|
|
@@ -3835,24 +3828,24 @@ function yr(e, t) {
|
|
|
3835
3828
|
n.push(Z("hr", []));
|
|
3836
3829
|
break;
|
|
3837
3830
|
case "table": {
|
|
3838
|
-
let [r, ...i] = e.children, a = (e, n) =>
|
|
3831
|
+
let [r, ...i] = e.children, a = (e, n) => vr(e.children, t, (e) => Z(n, yr(e.children, t))), o = r ? Z("thead", [Z("tr", a(r, "th"))]) : null;
|
|
3839
3832
|
o && i.length && t.break();
|
|
3840
|
-
let s = i.length ? Z("tbody",
|
|
3833
|
+
let s = i.length ? Z("tbody", vr(i, t, (e) => Z("tr", a(e, "td")))) : null;
|
|
3841
3834
|
n.push(Z("table", [o, s].filter((e) => e !== null)));
|
|
3842
3835
|
break;
|
|
3843
3836
|
}
|
|
3844
|
-
default: "children" in e && Array.isArray(e.children) && n.push(...
|
|
3837
|
+
default: "children" in e && Array.isArray(e.children) && n.push(...yr(e.children, t));
|
|
3845
3838
|
}
|
|
3846
3839
|
}), n;
|
|
3847
3840
|
}
|
|
3848
|
-
function
|
|
3849
|
-
let t = new
|
|
3841
|
+
function xr(e) {
|
|
3842
|
+
let t = new _r(), n = br(mr(e), t);
|
|
3850
3843
|
return {
|
|
3851
3844
|
tokens: t.tokens,
|
|
3852
3845
|
nodes: n
|
|
3853
3846
|
};
|
|
3854
3847
|
}
|
|
3855
|
-
var
|
|
3848
|
+
var Sr = {
|
|
3856
3849
|
citation: "ick-citation-3Yqh",
|
|
3857
3850
|
marked: "ick-marked-MYhj",
|
|
3858
3851
|
passage: "ick-passage-QMNg",
|
|
@@ -3860,16 +3853,16 @@ var xr = {
|
|
|
3860
3853
|
};
|
|
3861
3854
|
//#endregion
|
|
3862
3855
|
//#region src/InlineCitation/InlineCitation.tsx
|
|
3863
|
-
function
|
|
3856
|
+
function Cr({ index: e, source: t, children: n, onSelect: r, labels: i, className: a, ...o }) {
|
|
3864
3857
|
let s = i?.cite ?? "Source", c = t ? `${s} ${e}: ${t.title}` : `${s} ${e}`, l = r ? /* @__PURE__ */ h("button", {
|
|
3865
3858
|
type: "button",
|
|
3866
|
-
className:
|
|
3859
|
+
className: Sr.marker,
|
|
3867
3860
|
onClick: () => r(e, t),
|
|
3868
3861
|
onPointerDown: (e) => e.stopPropagation(),
|
|
3869
3862
|
"aria-label": c,
|
|
3870
3863
|
children: e
|
|
3871
3864
|
}) : /* @__PURE__ */ h("span", {
|
|
3872
|
-
className:
|
|
3865
|
+
className: Sr.marker,
|
|
3873
3866
|
"data-static": "",
|
|
3874
3867
|
"aria-label": c,
|
|
3875
3868
|
role: "note",
|
|
@@ -3877,22 +3870,22 @@ function Sr({ index: e, source: t, children: n, onSelect: r, labels: i, classNam
|
|
|
3877
3870
|
});
|
|
3878
3871
|
return n ? /* @__PURE__ */ g("span", {
|
|
3879
3872
|
className: [
|
|
3880
|
-
|
|
3881
|
-
|
|
3873
|
+
Sr.citation,
|
|
3874
|
+
Sr.marked,
|
|
3882
3875
|
a ?? ""
|
|
3883
3876
|
].filter(Boolean).join(" "),
|
|
3884
3877
|
...o,
|
|
3885
3878
|
children: [/* @__PURE__ */ h("span", {
|
|
3886
|
-
className:
|
|
3879
|
+
className: Sr.passage,
|
|
3887
3880
|
children: n
|
|
3888
3881
|
}), l]
|
|
3889
3882
|
}) : /* @__PURE__ */ h("span", {
|
|
3890
|
-
className: [
|
|
3883
|
+
className: [Sr.citation, a ?? ""].filter(Boolean).join(" "),
|
|
3891
3884
|
...o,
|
|
3892
3885
|
children: l
|
|
3893
3886
|
});
|
|
3894
3887
|
}
|
|
3895
|
-
var
|
|
3888
|
+
var wr = {
|
|
3896
3889
|
marker: "ick-marker-BYwC",
|
|
3897
3890
|
shimmer: "ick-shimmer-InQp",
|
|
3898
3891
|
"shimmer-sweep": "ick-shimmer-sweep-O8S3",
|
|
@@ -3903,21 +3896,21 @@ var Cr = {
|
|
|
3903
3896
|
canvas: "ick-canvas-IRKL",
|
|
3904
3897
|
menu: "ick-menu-gZzr",
|
|
3905
3898
|
srOnly: "ick-srOnly-Q3GJ"
|
|
3906
|
-
},
|
|
3899
|
+
}, Tr = -20, Er = Math.tan(Tr * Math.PI / 180), Dr = (e) => {
|
|
3907
3900
|
if (e.length === 0) return "";
|
|
3908
3901
|
let t = e[0], n = `M ${t.x} ${t.y}`;
|
|
3909
3902
|
for (let t = 1; t < e.length; t++) n += ` L ${e[t].x} ${e[t].y}`;
|
|
3910
3903
|
return n;
|
|
3911
|
-
},
|
|
3904
|
+
}, Or = (e) => {
|
|
3912
3905
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
3913
3906
|
return e.forEach((e) => {
|
|
3914
|
-
let i = e.x +
|
|
3907
|
+
let i = e.x + Er * e.y;
|
|
3915
3908
|
i < t && (t = i), i > n && (n = i), e.y < r && (r = e.y);
|
|
3916
3909
|
}), {
|
|
3917
3910
|
x: (t + n) / 2,
|
|
3918
3911
|
y: r
|
|
3919
3912
|
};
|
|
3920
|
-
},
|
|
3913
|
+
}, kr = (e) => {
|
|
3921
3914
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
3922
3915
|
return e.forEach((e) => {
|
|
3923
3916
|
e.x < t && (t = e.x), e.x + e.w > n && (n = e.x + e.w), e.y < r && (r = e.y);
|
|
@@ -3925,19 +3918,19 @@ var Cr = {
|
|
|
3925
3918
|
x: (t + n) / 2,
|
|
3926
3919
|
y: r
|
|
3927
3920
|
};
|
|
3928
|
-
},
|
|
3921
|
+
}, Ar = (e, t) => {
|
|
3929
3922
|
if (e.size === 0) return "";
|
|
3930
3923
|
let n = [...e].sort((e, t) => e - t), r = "";
|
|
3931
3924
|
for (let e = n[0]; e <= n[n.length - 1]; e++) r += t[e];
|
|
3932
3925
|
return r.trim();
|
|
3933
|
-
},
|
|
3926
|
+
}, jr = (e, t = 60) => e.length > t ? `${e.slice(0, t).trimEnd()}…` : e, Mr = (e) => {
|
|
3934
3927
|
let t = "";
|
|
3935
3928
|
return e.forEach((e) => {
|
|
3936
|
-
let n = e.y + e.h / 2, r = e.x - n *
|
|
3929
|
+
let n = e.y + e.h / 2, r = e.x - n * Er, i = e.x + e.w - n * Er;
|
|
3937
3930
|
t += `M ${r} ${n} L ${i} ${n} `;
|
|
3938
3931
|
}), t.trim();
|
|
3939
3932
|
};
|
|
3940
|
-
function
|
|
3933
|
+
function Nr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onReplyInThread: c, sources: l, onSelectSource: p }) {
|
|
3941
3934
|
let m = d(null), [v, b] = f([]), [S, C] = f([]), [w, T] = f(null), [E, D] = f(!1), [O, k] = f(null), [A, j] = f(0), M = d(null), N = d(null), [P, ee] = f(null), [F, I] = f(null), te = a((e) => {
|
|
3942
3935
|
e.viaKeyboard && (N.current = document.activeElement), j(0), k(e);
|
|
3943
3936
|
}, []), L = a((e = "none") => {
|
|
@@ -3950,19 +3943,19 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
3950
3943
|
};
|
|
3951
3944
|
return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
|
|
3952
3945
|
}, [O, L]);
|
|
3953
|
-
let ne = u(() =>
|
|
3946
|
+
let ne = u(() => xr(n), [n]), R = ne.tokens, ie = d(S), ae = d(i), oe = d(O);
|
|
3954
3947
|
o(() => {
|
|
3955
|
-
ie.current =
|
|
3948
|
+
ie.current = S, ae.current = i, oe.current = O;
|
|
3956
3949
|
});
|
|
3957
|
-
let
|
|
3950
|
+
let se = u(() => [...v.map((e) => ({
|
|
3958
3951
|
id: e.id,
|
|
3959
|
-
d:
|
|
3952
|
+
d: Dr(e.points),
|
|
3960
3953
|
kind: "path",
|
|
3961
3954
|
item: e,
|
|
3962
|
-
text:
|
|
3955
|
+
text: Ar(e.highlightedIndices, R)
|
|
3963
3956
|
})), ...S.map((e) => ({
|
|
3964
3957
|
id: e.id,
|
|
3965
|
-
d:
|
|
3958
|
+
d: Mr(e.rects),
|
|
3966
3959
|
kind: "selection",
|
|
3967
3960
|
item: e,
|
|
3968
3961
|
text: e.text
|
|
@@ -3970,8 +3963,8 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
3970
3963
|
v,
|
|
3971
3964
|
S,
|
|
3972
3965
|
R
|
|
3973
|
-
]),
|
|
3974
|
-
let n = e.kind === "path" ?
|
|
3966
|
+
]), ce = (e, t = !1) => {
|
|
3967
|
+
let n = e.kind === "path" ? Or(e.item.points) : kr(e.item.rects);
|
|
3975
3968
|
te({
|
|
3976
3969
|
x: n.x,
|
|
3977
3970
|
y: n.y,
|
|
@@ -3979,13 +3972,13 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
3979
3972
|
kind: e.kind,
|
|
3980
3973
|
viaKeyboard: t
|
|
3981
3974
|
});
|
|
3982
|
-
},
|
|
3975
|
+
}, le = a((e, t, n = !1) => {
|
|
3983
3976
|
let r = m.current, i = t.trim();
|
|
3984
3977
|
if (!r || !i) return;
|
|
3985
3978
|
let a = /* @__PURE__ */ new Set();
|
|
3986
3979
|
r.querySelectorAll("span[data-index]").forEach((t) => {
|
|
3987
3980
|
e.intersectsNode(t) && a.add(parseInt(t.getAttribute("data-index"), 10));
|
|
3988
|
-
}),
|
|
3981
|
+
}), ae.current?.(i);
|
|
3989
3982
|
let o = r.getBoundingClientRect(), s = Array.from(e.getClientRects()).map((e) => ({
|
|
3990
3983
|
x: e.left - o.left,
|
|
3991
3984
|
y: e.top - o.top,
|
|
@@ -4013,7 +4006,7 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4013
4006
|
text: i,
|
|
4014
4007
|
highlightedIndices: a
|
|
4015
4008
|
}]);
|
|
4016
|
-
let d =
|
|
4009
|
+
let d = kr(l);
|
|
4017
4010
|
te({
|
|
4018
4011
|
x: d.x,
|
|
4019
4012
|
y: d.y,
|
|
@@ -4024,13 +4017,13 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4024
4017
|
}, [te]);
|
|
4025
4018
|
o(() => {
|
|
4026
4019
|
let e = (e) => {
|
|
4027
|
-
if (
|
|
4020
|
+
if (oe.current) return;
|
|
4028
4021
|
let t = m.current;
|
|
4029
|
-
if (!t
|
|
4022
|
+
if (!t) return;
|
|
4030
4023
|
let n = window.getSelection();
|
|
4031
4024
|
if (!n || n.isCollapsed || n.rangeCount === 0 || !n.toString().trim()) return;
|
|
4032
4025
|
let r = n.getRangeAt(0);
|
|
4033
|
-
t.contains(r.commonAncestorContainer) && (
|
|
4026
|
+
t.contains(r.commonAncestorContainer) && (le(r, n.toString(), e), requestAnimationFrame(() => window.getSelection()?.removeAllRanges()));
|
|
4034
4027
|
}, t = () => e(!1), n = (t) => {
|
|
4035
4028
|
let n = (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a";
|
|
4036
4029
|
!t.shiftKey && !n || e(!0);
|
|
@@ -4038,24 +4031,24 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4038
4031
|
return document.addEventListener("mouseup", t), document.addEventListener("keyup", n), () => {
|
|
4039
4032
|
document.removeEventListener("mouseup", t), document.removeEventListener("keyup", n);
|
|
4040
4033
|
};
|
|
4041
|
-
}, [
|
|
4042
|
-
let [
|
|
4043
|
-
|
|
4044
|
-
let
|
|
4045
|
-
from: Math.min(
|
|
4046
|
-
to: Math.max(
|
|
4047
|
-
}, [
|
|
4048
|
-
|
|
4049
|
-
},
|
|
4034
|
+
}, [le]);
|
|
4035
|
+
let [ue, de] = f(r);
|
|
4036
|
+
ue !== r && (de(r), k(null));
|
|
4037
|
+
let fe = u(() => R.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [R]), [pe, me] = f(null), [he, ge] = f(null), _e = s(), z = u(() => pe === null || he === null ? null : {
|
|
4038
|
+
from: Math.min(he, pe),
|
|
4039
|
+
to: Math.max(he, pe)
|
|
4040
|
+
}, [pe, he]), B = () => {
|
|
4041
|
+
me(null), ge(null);
|
|
4042
|
+
}, ve = () => {
|
|
4050
4043
|
let e = m.current;
|
|
4051
|
-
if (!e || !
|
|
4052
|
-
let t = e.querySelector(`span[data-index="${
|
|
4044
|
+
if (!e || !z) return;
|
|
4045
|
+
let t = e.querySelector(`span[data-index="${z.from}"]`), n = e.querySelector(`span[data-index="${z.to}"]`);
|
|
4053
4046
|
if (!t || !n) return;
|
|
4054
4047
|
let r = document.createRange();
|
|
4055
4048
|
r.setStartBefore(t), r.setEndAfter(n);
|
|
4056
4049
|
let i = "";
|
|
4057
|
-
for (let e =
|
|
4058
|
-
|
|
4050
|
+
for (let e = z.from; e <= z.to; e++) i += R[e];
|
|
4051
|
+
le(r, i, !0), B();
|
|
4059
4052
|
}, be = () => [...M.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
|
|
4060
4053
|
o(() => {
|
|
4061
4054
|
if (!O) return;
|
|
@@ -4064,7 +4057,7 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4064
4057
|
let t = M.current?.contains(document.activeElement);
|
|
4065
4058
|
(O.viaKeyboard || t) && e[Math.min(A, e.length - 1)]?.focus();
|
|
4066
4059
|
}, [O, A]);
|
|
4067
|
-
let
|
|
4060
|
+
let xe = (e) => {
|
|
4068
4061
|
let t = be().length;
|
|
4069
4062
|
if (t === 0) return;
|
|
4070
4063
|
let n = (n) => {
|
|
@@ -4079,23 +4072,23 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4079
4072
|
case "End": return e.preventDefault(), j(t - 1);
|
|
4080
4073
|
default: return;
|
|
4081
4074
|
}
|
|
4082
|
-
},
|
|
4083
|
-
if (e.target !== e.currentTarget && e.key !== "Escape" ||
|
|
4075
|
+
}, V = (e) => {
|
|
4076
|
+
if (e.target !== e.currentTarget && e.key !== "Escape" || fe.length === 0) return;
|
|
4084
4077
|
let t = (t, n) => {
|
|
4085
4078
|
e.preventDefault();
|
|
4086
|
-
let r =
|
|
4087
|
-
|
|
4079
|
+
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))];
|
|
4080
|
+
me(i), (!n || he === null) && ge(i);
|
|
4088
4081
|
}, n = (t) => {
|
|
4089
|
-
e.preventDefault(),
|
|
4082
|
+
e.preventDefault(), me(t), (!e.shiftKey || he === null) && ge(t);
|
|
4090
4083
|
};
|
|
4091
4084
|
switch (e.key) {
|
|
4092
4085
|
case "ArrowRight": return t(1, e.shiftKey);
|
|
4093
4086
|
case "ArrowLeft": return t(-1, e.shiftKey);
|
|
4094
|
-
case "Home": return n(
|
|
4095
|
-
case "End": return n(
|
|
4087
|
+
case "Home": return n(fe[0]);
|
|
4088
|
+
case "End": return n(fe[fe.length - 1]);
|
|
4096
4089
|
case "Enter":
|
|
4097
|
-
case " ": return
|
|
4098
|
-
case "Escape": return !O &&
|
|
4090
|
+
case " ": return z ? (e.preventDefault(), ve()) : void 0;
|
|
4091
|
+
case "Escape": return !O && pe === null ? void 0 : (e.preventDefault(), L("restore"), B());
|
|
4099
4092
|
default: return;
|
|
4100
4093
|
}
|
|
4101
4094
|
}, Se = (e, t, n) => {
|
|
@@ -4113,7 +4106,7 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4113
4106
|
e.preventDefault(), D(!0);
|
|
4114
4107
|
let t = e.currentTarget;
|
|
4115
4108
|
t.setPointerCapture(e.pointerId);
|
|
4116
|
-
let n = t.getBoundingClientRect(), i = e.clientX - n.left, a = e.clientY - n.top, o = i - a *
|
|
4109
|
+
let n = t.getBoundingClientRect(), i = e.clientX - n.left, a = e.clientY - n.top, o = i - a * Er, s = {
|
|
4117
4110
|
id: Date.now().toString(),
|
|
4118
4111
|
points: [{
|
|
4119
4112
|
x: o,
|
|
@@ -4122,9 +4115,9 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4122
4115
|
highlightedIndices: /* @__PURE__ */ new Set()
|
|
4123
4116
|
};
|
|
4124
4117
|
T(s), L(), Se(e.clientX, e.clientY, s.highlightedIndices);
|
|
4125
|
-
},
|
|
4118
|
+
}, U = (e) => {
|
|
4126
4119
|
if (r === "precise" || !w) return;
|
|
4127
|
-
let t = m.current.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, a = n - i *
|
|
4120
|
+
let t = m.current.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, a = n - i * Er;
|
|
4128
4121
|
T((t) => {
|
|
4129
4122
|
if (!t) return t;
|
|
4130
4123
|
let n = new Set(t.highlightedIndices);
|
|
@@ -4137,10 +4130,10 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4137
4130
|
highlightedIndices: n
|
|
4138
4131
|
};
|
|
4139
4132
|
});
|
|
4140
|
-
},
|
|
4133
|
+
}, we = (e) => {
|
|
4141
4134
|
if (r !== "precise" && (D(!1), w)) {
|
|
4142
4135
|
if (e.currentTarget.releasePointerCapture(e.pointerId), b((e) => [...e, w]), w.highlightedIndices.size > 0) {
|
|
4143
|
-
let e =
|
|
4136
|
+
let e = Or(w.points);
|
|
4144
4137
|
te({
|
|
4145
4138
|
x: e.x,
|
|
4146
4139
|
y: e.y,
|
|
@@ -4148,17 +4141,17 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4148
4141
|
kind: "path"
|
|
4149
4142
|
});
|
|
4150
4143
|
}
|
|
4151
|
-
i && w.highlightedIndices.size > 0 && i(
|
|
4144
|
+
i && w.highlightedIndices.size > 0 && i(Ar(w.highlightedIndices, R)), T(null);
|
|
4152
4145
|
}
|
|
4153
|
-
},
|
|
4146
|
+
}, Te = (e) => {
|
|
4154
4147
|
r !== "precise" && (D(!1), w && (e.currentTarget.releasePointerCapture(e.pointerId), T(null)));
|
|
4155
|
-
},
|
|
4148
|
+
}, Ee = (e) => {
|
|
4156
4149
|
let t = v.find((t) => t.id === e);
|
|
4157
|
-
return t ?
|
|
4158
|
-
},
|
|
4150
|
+
return t ? Ar(t.highlightedIndices, R) : "";
|
|
4151
|
+
}, De = (e) => {
|
|
4159
4152
|
let t = O?.viaKeyboard;
|
|
4160
4153
|
O?.kind === "selection" ? C((t) => t.filter((t) => t.id !== e)) : b((t) => t.filter((t) => t.id !== e)), L(t ? "container" : "none");
|
|
4161
|
-
},
|
|
4154
|
+
}, Oe = () => {
|
|
4162
4155
|
let e = O?.viaKeyboard;
|
|
4163
4156
|
if (O && c) {
|
|
4164
4157
|
if (O.kind === "selection") {
|
|
@@ -4172,34 +4165,34 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4172
4165
|
c(e.text, s);
|
|
4173
4166
|
}
|
|
4174
4167
|
} else {
|
|
4175
|
-
let e =
|
|
4168
|
+
let e = Ee(O.pathId), t = document.getElementById(`highlight-path-${O.pathId}`);
|
|
4176
4169
|
t && c(e, t.getBoundingClientRect());
|
|
4177
4170
|
}
|
|
4178
4171
|
}
|
|
4179
4172
|
L(e ? "restore" : "none");
|
|
4180
|
-
},
|
|
4173
|
+
}, ke = (e) => {
|
|
4181
4174
|
let t = R[e], n = !1;
|
|
4182
4175
|
O && (n = (O.kind === "path" ? v.find((e) => e.id === O.pathId) : S.find((e) => e.id === O.pathId))?.highlightedIndices?.has(e) ?? !1);
|
|
4183
4176
|
let r = !1;
|
|
4184
4177
|
return P && (r = (v.find((e) => e.id === P) ?? S.find((e) => e.id === P))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ h("span", {
|
|
4185
4178
|
"data-index": e,
|
|
4186
|
-
className:
|
|
4179
|
+
className: wr.token,
|
|
4187
4180
|
"data-space": !t.trim() || void 0,
|
|
4188
4181
|
"data-active": n || void 0,
|
|
4189
4182
|
"data-pressed": r || void 0,
|
|
4190
|
-
"data-kbd-cursor":
|
|
4191
|
-
"data-kbd-selected":
|
|
4183
|
+
"data-kbd-cursor": pe === e || void 0,
|
|
4184
|
+
"data-kbd-selected": z && e >= z.from && e <= z.to || void 0,
|
|
4192
4185
|
children: t
|
|
4193
4186
|
}, e);
|
|
4194
|
-
},
|
|
4195
|
-
if (e.type === "token") return
|
|
4196
|
-
if (e.type === "code") return /* @__PURE__ */ h(
|
|
4187
|
+
}, Ae = (e) => e.map((e, n) => {
|
|
4188
|
+
if (e.type === "token") return ke(e.index);
|
|
4189
|
+
if (e.type === "code") return /* @__PURE__ */ h(Qt, {
|
|
4197
4190
|
code: e.value,
|
|
4198
4191
|
lang: e.lang
|
|
4199
4192
|
}, `c${n}`);
|
|
4200
4193
|
if (e.type === "el" && e.tag === "cite") {
|
|
4201
4194
|
let t = Number(e.props?.index ?? 0);
|
|
4202
|
-
return /* @__PURE__ */ h(
|
|
4195
|
+
return /* @__PURE__ */ h(Cr, {
|
|
4203
4196
|
index: t,
|
|
4204
4197
|
source: l?.[t - 1],
|
|
4205
4198
|
onSelect: p ? (e, t) => p(e, t) : void 0
|
|
@@ -4208,7 +4201,7 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4208
4201
|
return t(e.tag, {
|
|
4209
4202
|
key: `e${n}`,
|
|
4210
4203
|
...e.props
|
|
4211
|
-
}, e.children.length > 0 ?
|
|
4204
|
+
}, e.children.length > 0 ? Ae(e.children) : void 0);
|
|
4212
4205
|
});
|
|
4213
4206
|
return /* @__PURE__ */ h(y, {
|
|
4214
4207
|
reducedMotion: "user",
|
|
@@ -4228,34 +4221,34 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4228
4221
|
"data-drawing": E || void 0,
|
|
4229
4222
|
"data-menu": !!O || void 0,
|
|
4230
4223
|
onPointerDown: Ce,
|
|
4231
|
-
onPointerMove:
|
|
4232
|
-
onPointerUp:
|
|
4233
|
-
onPointerCancel:
|
|
4234
|
-
className:
|
|
4224
|
+
onPointerMove: U,
|
|
4225
|
+
onPointerUp: we,
|
|
4226
|
+
onPointerCancel: Te,
|
|
4227
|
+
className: wr.surface,
|
|
4235
4228
|
tabIndex: 0,
|
|
4236
|
-
onKeyDown:
|
|
4237
|
-
onBlur:
|
|
4238
|
-
"aria-describedby":
|
|
4229
|
+
onKeyDown: V,
|
|
4230
|
+
onBlur: B,
|
|
4231
|
+
"aria-describedby": _e,
|
|
4239
4232
|
children: [
|
|
4240
4233
|
/* @__PURE__ */ h("span", {
|
|
4241
|
-
id:
|
|
4242
|
-
className:
|
|
4234
|
+
id: _e,
|
|
4235
|
+
className: wr.srOnly,
|
|
4243
4236
|
"aria-hidden": "true",
|
|
4244
4237
|
children: "Left and right arrow keys move by word. Hold shift to select. Enter highlights the selection, Escape clears it."
|
|
4245
4238
|
}),
|
|
4246
|
-
/* @__PURE__ */ h("div", { className:
|
|
4239
|
+
/* @__PURE__ */ h("div", { className: wr.hitbox }),
|
|
4247
4240
|
/* @__PURE__ */ h("div", {
|
|
4248
|
-
className:
|
|
4241
|
+
className: wr.tokens,
|
|
4249
4242
|
"data-focus": !!O || void 0,
|
|
4250
|
-
children:
|
|
4243
|
+
children: Ae(ne.nodes)
|
|
4251
4244
|
}),
|
|
4252
4245
|
/* @__PURE__ */ h("svg", {
|
|
4253
|
-
className:
|
|
4246
|
+
className: wr.canvas,
|
|
4254
4247
|
children: /* @__PURE__ */ g("g", {
|
|
4255
|
-
transform: `skewX(${
|
|
4256
|
-
children: [
|
|
4248
|
+
transform: `skewX(${Tr})`,
|
|
4249
|
+
children: [se.map((t) => /* @__PURE__ */ g(e.Fragment, { children: [/* @__PURE__ */ h("path", {
|
|
4257
4250
|
id: `highlight-${t.kind}-${t.id}`,
|
|
4258
|
-
className:
|
|
4251
|
+
className: wr.marker,
|
|
4259
4252
|
d: t.d,
|
|
4260
4253
|
"data-cursor": "pointer",
|
|
4261
4254
|
"data-pressed": P === t.id || void 0,
|
|
@@ -4266,41 +4259,41 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4266
4259
|
E || (e.stopPropagation(), ee(t.id));
|
|
4267
4260
|
},
|
|
4268
4261
|
onPointerUp: (e) => {
|
|
4269
|
-
P === t.id && (e.stopPropagation(),
|
|
4262
|
+
P === t.id && (e.stopPropagation(), ce(t), ee(null));
|
|
4270
4263
|
},
|
|
4271
4264
|
onPointerLeave: () => ee(null),
|
|
4272
4265
|
onPointerCancel: () => ee(null)
|
|
4273
4266
|
}), /* @__PURE__ */ h("path", {
|
|
4274
|
-
className:
|
|
4267
|
+
className: wr.shimmer,
|
|
4275
4268
|
d: t.d,
|
|
4276
4269
|
pathLength: 1,
|
|
4277
4270
|
"data-active": O?.pathId === t.id || F === t.id || void 0
|
|
4278
4271
|
})] }, t.id)), w && /* @__PURE__ */ h("path", {
|
|
4279
|
-
className:
|
|
4280
|
-
d:
|
|
4272
|
+
className: wr.marker,
|
|
4273
|
+
d: Dr(w.points)
|
|
4281
4274
|
})]
|
|
4282
4275
|
})
|
|
4283
4276
|
}),
|
|
4284
|
-
|
|
4277
|
+
se.length > 0 && /* @__PURE__ */ h("div", {
|
|
4285
4278
|
role: "group",
|
|
4286
|
-
"aria-label": `${
|
|
4287
|
-
children:
|
|
4279
|
+
"aria-label": `${se.length} highlight${se.length === 1 ? "" : "s"}`,
|
|
4280
|
+
children: se.map((e) => /* @__PURE__ */ h("button", {
|
|
4288
4281
|
type: "button",
|
|
4289
|
-
className:
|
|
4282
|
+
className: wr.srOnly,
|
|
4290
4283
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4291
4284
|
onFocus: () => I(e.id),
|
|
4292
4285
|
onBlur: () => I(null),
|
|
4293
4286
|
onClick: (t) => {
|
|
4294
|
-
t.stopPropagation(),
|
|
4287
|
+
t.stopPropagation(), ce(e, !0);
|
|
4295
4288
|
},
|
|
4296
|
-
children: `Highlight: ${
|
|
4289
|
+
children: `Highlight: ${jr(e.text)}`
|
|
4297
4290
|
}, e.id))
|
|
4298
4291
|
}),
|
|
4299
4292
|
/* @__PURE__ */ h(_, { children: O && /* @__PURE__ */ g(x.div, {
|
|
4300
4293
|
ref: M,
|
|
4301
4294
|
role: "menu",
|
|
4302
4295
|
"aria-label": "Highlight actions",
|
|
4303
|
-
onKeyDown:
|
|
4296
|
+
onKeyDown: xe,
|
|
4304
4297
|
onBlur: (e) => {
|
|
4305
4298
|
e.currentTarget.contains(e.relatedTarget) || L();
|
|
4306
4299
|
},
|
|
@@ -4316,7 +4309,7 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4316
4309
|
staggerDirection: -1
|
|
4317
4310
|
}
|
|
4318
4311
|
},
|
|
4319
|
-
className:
|
|
4312
|
+
className: wr.menu,
|
|
4320
4313
|
style: {
|
|
4321
4314
|
left: O.x,
|
|
4322
4315
|
top: O.y
|
|
@@ -4343,13 +4336,13 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4343
4336
|
scale: .9,
|
|
4344
4337
|
transition: { duration: .1 }
|
|
4345
4338
|
},
|
|
4346
|
-
children: /* @__PURE__ */ h(
|
|
4339
|
+
children: /* @__PURE__ */ h(H, {
|
|
4347
4340
|
variant: "primary",
|
|
4348
4341
|
role: "menuitem",
|
|
4349
4342
|
tabIndex: A === 0 ? 0 : -1,
|
|
4350
4343
|
icon: /* @__PURE__ */ h(re, { size: 14 }),
|
|
4351
4344
|
onClick: (e) => {
|
|
4352
|
-
e.stopPropagation(),
|
|
4345
|
+
e.stopPropagation(), Oe();
|
|
4353
4346
|
},
|
|
4354
4347
|
title: "Reply in thread",
|
|
4355
4348
|
children: "Reply in thread"
|
|
@@ -4375,13 +4368,13 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4375
4368
|
scale: .9,
|
|
4376
4369
|
transition: { duration: .1 }
|
|
4377
4370
|
},
|
|
4378
|
-
children: /* @__PURE__ */ h(
|
|
4371
|
+
children: /* @__PURE__ */ h(H, {
|
|
4379
4372
|
variant: "primary",
|
|
4380
4373
|
role: "menuitem",
|
|
4381
4374
|
tabIndex: A === 1 ? 0 : -1,
|
|
4382
|
-
icon: /* @__PURE__ */ h(
|
|
4375
|
+
icon: /* @__PURE__ */ h(ye, { size: 14 }),
|
|
4383
4376
|
onClick: (e) => {
|
|
4384
|
-
e.stopPropagation(),
|
|
4377
|
+
e.stopPropagation(), De(O.pathId);
|
|
4385
4378
|
},
|
|
4386
4379
|
title: "Remove highlight",
|
|
4387
4380
|
"aria-label": "Remove highlight"
|
|
@@ -4392,19 +4385,19 @@ function Mr({ text: n, selectionMode: r = "marker", onHighlightComplete: i, onRe
|
|
|
4392
4385
|
})
|
|
4393
4386
|
});
|
|
4394
4387
|
}
|
|
4395
|
-
var
|
|
4388
|
+
var Pr = {
|
|
4396
4389
|
turn: "ick-turn-R-WW",
|
|
4397
4390
|
question: "ick-question-Fhqf",
|
|
4398
4391
|
body: "ick-body-wvid",
|
|
4399
4392
|
answer: "ick-answer-pZAi",
|
|
4400
4393
|
actions: "ick-actions-CWq8"
|
|
4401
|
-
},
|
|
4394
|
+
}, Fr = (e) => {
|
|
4402
4395
|
navigator.clipboard?.writeText(e);
|
|
4403
|
-
},
|
|
4396
|
+
}, Ir = i(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: o = null, onOpenArtifact: s, entranceDelay: c = 0, selectionMode: l = "marker", questionAlign: u = "end", onDraft: d, onSubmit: f, onStop: p, onEdit: m, onCancelEdit: _, onCopy: v = Fr, onHighlight: y, onReplyInThread: b, onRegenerate: S, onShowVersion: C, onFeedback: w, feedback: T = null, answerActions: E = !0, onAnswerQuestion: D, onEditQuestion: O, onDecideApproval: k, className: A, onTranscribe: j }) {
|
|
4404
4397
|
let M = q(), N = M ? 0 : -16, P = e.parts ?? [], ee = P.find((e) => e.kind === "sources")?.sources;
|
|
4405
4398
|
return /* @__PURE__ */ g(x.article, {
|
|
4406
4399
|
id: `turn-${e.id}`,
|
|
4407
|
-
className: [
|
|
4400
|
+
className: [Pr.turn, A ?? ""].filter(Boolean).join(" "),
|
|
4408
4401
|
"data-active-input": t || void 0,
|
|
4409
4402
|
"aria-busy": e.state === "responding" || void 0,
|
|
4410
4403
|
initial: {
|
|
@@ -4430,9 +4423,9 @@ var Nr = {
|
|
|
4430
4423
|
delay: c
|
|
4431
4424
|
},
|
|
4432
4425
|
children: [/* @__PURE__ */ h("div", {
|
|
4433
|
-
className:
|
|
4426
|
+
className: Pr.question,
|
|
4434
4427
|
"data-align": u,
|
|
4435
|
-
children: /* @__PURE__ */ h(
|
|
4428
|
+
children: /* @__PURE__ */ h(et, {
|
|
4436
4429
|
ref: n,
|
|
4437
4430
|
style: u === "stretch" ? { width: "100%" } : void 0,
|
|
4438
4431
|
state: e.state,
|
|
@@ -4450,16 +4443,16 @@ var Nr = {
|
|
|
4450
4443
|
placeholder: r
|
|
4451
4444
|
})
|
|
4452
4445
|
}), /* @__PURE__ */ g("div", {
|
|
4453
|
-
className:
|
|
4446
|
+
className: Pr.body,
|
|
4454
4447
|
children: [
|
|
4455
4448
|
P.map((t) => {
|
|
4456
4449
|
switch (t.kind) {
|
|
4457
|
-
case "reasoning": return /* @__PURE__ */ h(
|
|
4450
|
+
case "reasoning": return /* @__PURE__ */ h(Rt, {
|
|
4458
4451
|
state: t.state,
|
|
4459
4452
|
duration: t.duration,
|
|
4460
4453
|
children: t.text ?? ""
|
|
4461
4454
|
}, t.id);
|
|
4462
|
-
case "tool": return /* @__PURE__ */ h(
|
|
4455
|
+
case "tool": return /* @__PURE__ */ h(on, {
|
|
4463
4456
|
name: t.name ?? "",
|
|
4464
4457
|
state: t.state,
|
|
4465
4458
|
summary: t.summary,
|
|
@@ -4468,34 +4461,34 @@ var Nr = {
|
|
|
4468
4461
|
error: t.error,
|
|
4469
4462
|
duration: t.duration
|
|
4470
4463
|
}, t.id);
|
|
4471
|
-
case "tasks": return /* @__PURE__ */ h(
|
|
4464
|
+
case "tasks": return /* @__PURE__ */ h(pn, {
|
|
4472
4465
|
title: t.title,
|
|
4473
4466
|
tasks: t.tasks ?? [],
|
|
4474
4467
|
collapsible: t.collapsible
|
|
4475
4468
|
}, t.id);
|
|
4476
|
-
case "chain": return /* @__PURE__ */ h(
|
|
4469
|
+
case "chain": return /* @__PURE__ */ h(gn, {
|
|
4477
4470
|
steps: t.steps ?? [],
|
|
4478
4471
|
state: t.state,
|
|
4479
4472
|
duration: t.duration
|
|
4480
4473
|
}, t.id);
|
|
4481
|
-
case "sources": return /* @__PURE__ */ h(
|
|
4474
|
+
case "sources": return /* @__PURE__ */ h(yn, {
|
|
4482
4475
|
sources: t.sources ?? [],
|
|
4483
4476
|
title: t.title,
|
|
4484
4477
|
collapsible: t.collapsible
|
|
4485
4478
|
}, t.id);
|
|
4486
|
-
case "approval": return /* @__PURE__ */ h(
|
|
4479
|
+
case "approval": return /* @__PURE__ */ h(un, {
|
|
4487
4480
|
title: t.title,
|
|
4488
4481
|
description: t.description,
|
|
4489
4482
|
decision: t.decision ?? null,
|
|
4490
4483
|
onDecide: (n) => k?.(e.id, t.id, n),
|
|
4491
|
-
children: t.tool && /* @__PURE__ */ h(
|
|
4484
|
+
children: t.tool && /* @__PURE__ */ h(on, {
|
|
4492
4485
|
name: t.tool.name,
|
|
4493
4486
|
state: "pending",
|
|
4494
4487
|
input: t.tool.input,
|
|
4495
4488
|
defaultOpen: !0
|
|
4496
4489
|
})
|
|
4497
4490
|
}, t.id);
|
|
4498
|
-
case "artifact": return /* @__PURE__ */ h(
|
|
4491
|
+
case "artifact": return /* @__PURE__ */ h(Kn, {
|
|
4499
4492
|
id: t.id,
|
|
4500
4493
|
title: t.title,
|
|
4501
4494
|
meta: t.meta,
|
|
@@ -4506,11 +4499,11 @@ var Nr = {
|
|
|
4506
4499
|
open: o === t.id,
|
|
4507
4500
|
onOpen: s ? (t) => s(e.id, t) : void 0
|
|
4508
4501
|
}, t.id);
|
|
4509
|
-
case "notice": return /* @__PURE__ */ h(
|
|
4502
|
+
case "notice": return /* @__PURE__ */ h(Hn, {
|
|
4510
4503
|
tone: t.tone,
|
|
4511
4504
|
children: t.text
|
|
4512
4505
|
}, t.id);
|
|
4513
|
-
case "question": return /* @__PURE__ */ h(
|
|
4506
|
+
case "question": return /* @__PURE__ */ h(Bn, {
|
|
4514
4507
|
id: t.id,
|
|
4515
4508
|
title: t.title,
|
|
4516
4509
|
questions: t.questions ?? [],
|
|
@@ -4525,24 +4518,24 @@ var Nr = {
|
|
|
4525
4518
|
}
|
|
4526
4519
|
}),
|
|
4527
4520
|
e.state === "responding" && !e.ai && P.length === 0 && /* @__PURE__ */ h("div", {
|
|
4528
|
-
className:
|
|
4529
|
-
children: /* @__PURE__ */ h(
|
|
4521
|
+
className: Pr.answer,
|
|
4522
|
+
children: /* @__PURE__ */ h(Ot, {})
|
|
4530
4523
|
}),
|
|
4531
4524
|
e.ai && /* @__PURE__ */ g("div", {
|
|
4532
|
-
className:
|
|
4533
|
-
children: [/* @__PURE__ */ h(
|
|
4525
|
+
className: Pr.answer,
|
|
4526
|
+
children: [/* @__PURE__ */ h(Nr, {
|
|
4534
4527
|
text: e.ai,
|
|
4535
4528
|
selectionMode: l,
|
|
4536
4529
|
sources: ee,
|
|
4537
4530
|
onHighlightComplete: (t) => y?.(e.id, t),
|
|
4538
4531
|
onReplyInThread: b
|
|
4539
4532
|
}), E && e.state === "resting" && /* @__PURE__ */ g("div", {
|
|
4540
|
-
className:
|
|
4541
|
-
children: [/* @__PURE__ */ h(
|
|
4533
|
+
className: Pr.actions,
|
|
4534
|
+
children: [/* @__PURE__ */ h(Et, {
|
|
4542
4535
|
total: e.versions?.length ?? 0,
|
|
4543
4536
|
index: e.versionIndex ?? 0,
|
|
4544
4537
|
onSelect: (t) => C?.(e.id, t)
|
|
4545
|
-
}), /* @__PURE__ */ h(
|
|
4538
|
+
}), /* @__PURE__ */ h(Ct, {
|
|
4546
4539
|
text: e.ai,
|
|
4547
4540
|
onCopy: v,
|
|
4548
4541
|
onRegenerate: S ? () => S(e.id) : void 0,
|
|
@@ -4554,19 +4547,19 @@ var Nr = {
|
|
|
4554
4547
|
]
|
|
4555
4548
|
})]
|
|
4556
4549
|
});
|
|
4557
|
-
}),
|
|
4550
|
+
}), Lr = {
|
|
4558
4551
|
context: "ick-context-ZOiv",
|
|
4559
4552
|
ring: "ick-ring-uVUc",
|
|
4560
4553
|
track: "ick-track---kg",
|
|
4561
4554
|
fill: "ick-fill-M8v6",
|
|
4562
4555
|
label: "ick-label-PTaW"
|
|
4563
|
-
},
|
|
4556
|
+
}, Rr = {
|
|
4564
4557
|
name: "Context used",
|
|
4565
4558
|
of: "of",
|
|
4566
4559
|
tokens: "tokens",
|
|
4567
4560
|
nearlyFull: "Nearly full — the oldest messages will start dropping out"
|
|
4568
4561
|
};
|
|
4569
|
-
function
|
|
4562
|
+
function zr(e) {
|
|
4570
4563
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
4571
4564
|
if (e >= 1e6) {
|
|
4572
4565
|
let t = e / 1e6;
|
|
@@ -4578,14 +4571,14 @@ function Rr(e) {
|
|
|
4578
4571
|
}
|
|
4579
4572
|
return String(Math.round(e));
|
|
4580
4573
|
}
|
|
4581
|
-
var
|
|
4582
|
-
function
|
|
4574
|
+
var Br = 6, Vr = 2 * Math.PI * Br;
|
|
4575
|
+
function Hr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className: a, ...o }) {
|
|
4583
4576
|
let s = {
|
|
4584
|
-
...
|
|
4577
|
+
...Rr,
|
|
4585
4578
|
...i
|
|
4586
|
-
}, 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}%, ${
|
|
4579
|
+
}, 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}%, ${zr(e)} ${s.of} ${zr(t)} ${s.tokens}${u ? `. ${s.nearlyFull}` : ""}`;
|
|
4587
4580
|
return /* @__PURE__ */ g("div", {
|
|
4588
|
-
className: [
|
|
4581
|
+
className: [Lr.context, a ?? ""].filter(Boolean).join(" "),
|
|
4589
4582
|
"data-warn": u || void 0,
|
|
4590
4583
|
role: "meter",
|
|
4591
4584
|
"aria-valuenow": l,
|
|
@@ -4595,31 +4588,31 @@ function Vr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className:
|
|
|
4595
4588
|
title: f,
|
|
4596
4589
|
...o,
|
|
4597
4590
|
children: [/* @__PURE__ */ g("svg", {
|
|
4598
|
-
className:
|
|
4591
|
+
className: Lr.ring,
|
|
4599
4592
|
viewBox: "0 0 16 16",
|
|
4600
4593
|
"aria-hidden": !0,
|
|
4601
4594
|
focusable: "false",
|
|
4602
4595
|
children: [/* @__PURE__ */ h("circle", {
|
|
4603
|
-
className:
|
|
4596
|
+
className: Lr.track,
|
|
4604
4597
|
cx: "8",
|
|
4605
4598
|
cy: "8",
|
|
4606
|
-
r:
|
|
4599
|
+
r: Br
|
|
4607
4600
|
}), /* @__PURE__ */ h("circle", {
|
|
4608
|
-
className:
|
|
4601
|
+
className: Lr.fill,
|
|
4609
4602
|
cx: "8",
|
|
4610
4603
|
cy: "8",
|
|
4611
|
-
r:
|
|
4612
|
-
strokeDasharray:
|
|
4613
|
-
strokeDashoffset:
|
|
4604
|
+
r: Br,
|
|
4605
|
+
strokeDasharray: Vr,
|
|
4606
|
+
strokeDashoffset: Vr * (1 - c),
|
|
4614
4607
|
transform: "rotate(-90 8 8)"
|
|
4615
4608
|
})]
|
|
4616
4609
|
}), d !== null && /* @__PURE__ */ h("span", {
|
|
4617
|
-
className:
|
|
4610
|
+
className: Lr.label,
|
|
4618
4611
|
children: d
|
|
4619
4612
|
})]
|
|
4620
4613
|
});
|
|
4621
4614
|
}
|
|
4622
|
-
var
|
|
4615
|
+
var Ur = {
|
|
4623
4616
|
pane: "ick-pane-Yv8Y",
|
|
4624
4617
|
grabber: "ick-grabber-OhMd",
|
|
4625
4618
|
head: "ick-head-p2-j",
|
|
@@ -4633,7 +4626,7 @@ var Hr = {
|
|
|
4633
4626
|
};
|
|
4634
4627
|
//#endregion
|
|
4635
4628
|
//#region src/Artifact/ArtifactPane.tsx
|
|
4636
|
-
function
|
|
4629
|
+
function Wr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expanded: a = !1, onToggleExpanded: c, closeLabel: l = "Close", expandLabel: u = "Widen", collapseLabel: f = "Narrow", className: p, ...m }) {
|
|
4637
4630
|
let _ = s(), v = d(null), y = d(null);
|
|
4638
4631
|
return o(() => {
|
|
4639
4632
|
y.current?.focus({ preventScroll: !0 });
|
|
@@ -4652,33 +4645,33 @@ function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4652
4645
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
4653
4646
|
}, [i]), /* @__PURE__ */ g("div", {
|
|
4654
4647
|
ref: v,
|
|
4655
|
-
className: [
|
|
4648
|
+
className: [Ur.pane, p ?? ""].filter(Boolean).join(" "),
|
|
4656
4649
|
"aria-labelledby": _,
|
|
4657
4650
|
"aria-modal": i || void 0,
|
|
4658
4651
|
role: i ? "dialog" : "complementary",
|
|
4659
4652
|
...m,
|
|
4660
4653
|
children: [
|
|
4661
4654
|
i && /* @__PURE__ */ h("span", {
|
|
4662
|
-
className:
|
|
4655
|
+
className: Ur.grabber,
|
|
4663
4656
|
"aria-hidden": !0
|
|
4664
4657
|
}),
|
|
4665
4658
|
/* @__PURE__ */ g("div", {
|
|
4666
|
-
className:
|
|
4659
|
+
className: Ur.head,
|
|
4667
4660
|
children: [
|
|
4668
4661
|
/* @__PURE__ */ g("div", {
|
|
4669
|
-
className:
|
|
4662
|
+
className: Ur.headText,
|
|
4670
4663
|
children: [/* @__PURE__ */ h("h2", {
|
|
4671
|
-
className:
|
|
4664
|
+
className: Ur.title,
|
|
4672
4665
|
id: _,
|
|
4673
4666
|
ref: y,
|
|
4674
4667
|
tabIndex: -1,
|
|
4675
4668
|
children: e
|
|
4676
4669
|
}), t && /* @__PURE__ */ h("p", {
|
|
4677
|
-
className:
|
|
4670
|
+
className: Ur.meta,
|
|
4678
4671
|
children: t
|
|
4679
4672
|
})]
|
|
4680
4673
|
}),
|
|
4681
|
-
c && !i && /* @__PURE__ */ h(
|
|
4674
|
+
c && !i && /* @__PURE__ */ h(H, {
|
|
4682
4675
|
variant: "ghost",
|
|
4683
4676
|
size: "s",
|
|
4684
4677
|
icon: h(a ? ae : R, {
|
|
@@ -4689,10 +4682,10 @@ function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4689
4682
|
"aria-pressed": a,
|
|
4690
4683
|
onClick: c
|
|
4691
4684
|
}),
|
|
4692
|
-
r && /* @__PURE__ */ h(
|
|
4685
|
+
r && /* @__PURE__ */ h(H, {
|
|
4693
4686
|
variant: "ghost",
|
|
4694
4687
|
size: "s",
|
|
4695
|
-
icon: /* @__PURE__ */ h(
|
|
4688
|
+
icon: /* @__PURE__ */ h(xe, {
|
|
4696
4689
|
size: 15,
|
|
4697
4690
|
"aria-hidden": !0
|
|
4698
4691
|
}),
|
|
@@ -4702,15 +4695,15 @@ function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4702
4695
|
]
|
|
4703
4696
|
}),
|
|
4704
4697
|
/* @__PURE__ */ h("div", {
|
|
4705
|
-
className:
|
|
4706
|
-
children: n ?? /* @__PURE__ */ h(
|
|
4698
|
+
className: Ur.body,
|
|
4699
|
+
children: n ?? /* @__PURE__ */ h(Gr, {})
|
|
4707
4700
|
})
|
|
4708
4701
|
]
|
|
4709
4702
|
});
|
|
4710
4703
|
}
|
|
4711
|
-
function
|
|
4704
|
+
function Gr() {
|
|
4712
4705
|
return /* @__PURE__ */ h("div", {
|
|
4713
|
-
className:
|
|
4706
|
+
className: Ur.skeleton,
|
|
4714
4707
|
"aria-hidden": !0,
|
|
4715
4708
|
children: [
|
|
4716
4709
|
68,
|
|
@@ -4721,18 +4714,18 @@ function Wr() {
|
|
|
4721
4714
|
100,
|
|
4722
4715
|
84
|
|
4723
4716
|
].map((e, t) => /* @__PURE__ */ h("span", {
|
|
4724
|
-
className:
|
|
4717
|
+
className: Ur.line,
|
|
4725
4718
|
style: { width: `${e}%` }
|
|
4726
4719
|
}, t))
|
|
4727
4720
|
});
|
|
4728
4721
|
}
|
|
4729
|
-
var
|
|
4722
|
+
var Kr = {
|
|
4730
4723
|
layout: "ick-layout-nC6G",
|
|
4731
4724
|
chat: "ick-chat-OTXm",
|
|
4732
4725
|
slot: "ick-slot-O--R",
|
|
4733
4726
|
card: "ick-card-Iddg",
|
|
4734
4727
|
scrim: "ick-scrim-11Pp"
|
|
4735
|
-
},
|
|
4728
|
+
}, qr = 760, Jr = {
|
|
4736
4729
|
closed: {
|
|
4737
4730
|
width: 0,
|
|
4738
4731
|
transition: {
|
|
@@ -4750,7 +4743,7 @@ var Gr = {
|
|
|
4750
4743
|
bounce: 0
|
|
4751
4744
|
}
|
|
4752
4745
|
}
|
|
4753
|
-
},
|
|
4746
|
+
}, Yr = {
|
|
4754
4747
|
closed: {
|
|
4755
4748
|
opacity: 0,
|
|
4756
4749
|
x: 24,
|
|
@@ -4769,7 +4762,7 @@ var Gr = {
|
|
|
4769
4762
|
delay: .06
|
|
4770
4763
|
}
|
|
4771
4764
|
}
|
|
4772
|
-
},
|
|
4765
|
+
}, Xr = {
|
|
4773
4766
|
closed: {
|
|
4774
4767
|
y: "100%",
|
|
4775
4768
|
transition: {
|
|
@@ -4786,7 +4779,7 @@ var Gr = {
|
|
|
4786
4779
|
bounce: .18
|
|
4787
4780
|
}
|
|
4788
4781
|
}
|
|
4789
|
-
},
|
|
4782
|
+
}, Zr = {
|
|
4790
4783
|
closed: {
|
|
4791
4784
|
opacity: 0,
|
|
4792
4785
|
transition: { duration: .18 }
|
|
@@ -4795,34 +4788,34 @@ var Gr = {
|
|
|
4795
4788
|
opacity: 1,
|
|
4796
4789
|
transition: { duration: .26 }
|
|
4797
4790
|
}
|
|
4798
|
-
},
|
|
4791
|
+
}, Qr = { transition: { duration: 0 } }, $r = (e) => ({
|
|
4799
4792
|
closed: {
|
|
4800
4793
|
...e.closed,
|
|
4801
|
-
...
|
|
4794
|
+
...Qr
|
|
4802
4795
|
},
|
|
4803
4796
|
open: {
|
|
4804
4797
|
...e.open,
|
|
4805
|
-
...
|
|
4798
|
+
...Qr
|
|
4806
4799
|
}
|
|
4807
4800
|
});
|
|
4808
|
-
function
|
|
4801
|
+
function ei({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
|
|
4809
4802
|
let s = d(null), [c, l] = f(!1), [p, m] = f(!1), v = a(() => m((e) => !e), []), y = w(), [b, S, C] = u(() => {
|
|
4810
|
-
let e = c ?
|
|
4803
|
+
let e = c ? Xr : Jr, t = c ? void 0 : Yr;
|
|
4811
4804
|
return y ? [
|
|
4812
|
-
|
|
4813
|
-
t &&
|
|
4814
|
-
|
|
4805
|
+
$r(e),
|
|
4806
|
+
t && $r(t),
|
|
4807
|
+
$r(Zr)
|
|
4815
4808
|
] : [
|
|
4816
4809
|
e,
|
|
4817
4810
|
t,
|
|
4818
|
-
|
|
4811
|
+
Zr
|
|
4819
4812
|
];
|
|
4820
4813
|
}, [y, c]);
|
|
4821
4814
|
o(() => {
|
|
4822
4815
|
let e = s.current;
|
|
4823
4816
|
if (!e || typeof ResizeObserver > "u") return;
|
|
4824
4817
|
let t = new ResizeObserver(([e]) => {
|
|
4825
|
-
l(e.contentRect.width <=
|
|
4818
|
+
l(e.contentRect.width <= qr);
|
|
4826
4819
|
});
|
|
4827
4820
|
return t.observe(e), () => t.disconnect();
|
|
4828
4821
|
}, []);
|
|
@@ -4833,16 +4826,16 @@ function $r({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
|
|
|
4833
4826
|
});
|
|
4834
4827
|
return /* @__PURE__ */ g("div", {
|
|
4835
4828
|
ref: s,
|
|
4836
|
-
className: [
|
|
4829
|
+
className: [Kr.layout, r ?? ""].filter(Boolean).join(" "),
|
|
4837
4830
|
"data-pane": T ? "" : void 0,
|
|
4838
4831
|
...i,
|
|
4839
4832
|
children: [/* @__PURE__ */ h("div", {
|
|
4840
|
-
className:
|
|
4833
|
+
className: Kr.chat,
|
|
4841
4834
|
children: e
|
|
4842
4835
|
}), /* @__PURE__ */ g(_, {
|
|
4843
4836
|
initial: !1,
|
|
4844
4837
|
children: [T && c && n && /* @__PURE__ */ h(x.div, {
|
|
4845
|
-
className:
|
|
4838
|
+
className: Kr.scrim,
|
|
4846
4839
|
variants: C,
|
|
4847
4840
|
initial: "closed",
|
|
4848
4841
|
animate: "open",
|
|
@@ -4850,13 +4843,13 @@ function $r({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
|
|
|
4850
4843
|
"aria-hidden": !0,
|
|
4851
4844
|
onClick: n
|
|
4852
4845
|
}, "scrim"), T && /* @__PURE__ */ h(x.div, {
|
|
4853
|
-
className:
|
|
4846
|
+
className: Kr.slot,
|
|
4854
4847
|
variants: b,
|
|
4855
4848
|
initial: "closed",
|
|
4856
4849
|
animate: "open",
|
|
4857
4850
|
exit: "closed",
|
|
4858
4851
|
children: /* @__PURE__ */ h(x.div, {
|
|
4859
|
-
className:
|
|
4852
|
+
className: Kr.card,
|
|
4860
4853
|
"data-expanded": p && !c || void 0,
|
|
4861
4854
|
variants: S,
|
|
4862
4855
|
...c && n ? {
|
|
@@ -4882,7 +4875,7 @@ function $r({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
|
|
|
4882
4875
|
}
|
|
4883
4876
|
//#endregion
|
|
4884
4877
|
//#region src/Artifact/useArtifacts.ts
|
|
4885
|
-
function
|
|
4878
|
+
function ti(e = null) {
|
|
4886
4879
|
let [t, n] = f(e);
|
|
4887
4880
|
return {
|
|
4888
4881
|
openId: t,
|
|
@@ -4891,30 +4884,30 @@ function ei(e = null) {
|
|
|
4891
4884
|
toggle: a((e) => n((t) => t === e ? null : e), [])
|
|
4892
4885
|
};
|
|
4893
4886
|
}
|
|
4894
|
-
var
|
|
4887
|
+
var ni = {
|
|
4895
4888
|
root: "ick-root-JrOP",
|
|
4896
4889
|
viewport: "ick-viewport-C3hz",
|
|
4897
4890
|
content: "ick-content-33lN",
|
|
4898
4891
|
jump: "ick-jump-nd6O"
|
|
4899
|
-
},
|
|
4892
|
+
}, ri = 64, ii = 500, ai = 4, oi = (e, t) => e.offsetTop - t.offsetTop, si = (e, t) => t ? e.querySelector(`[id="${CSS.escape(t)}"]`) : null, ci = (e, t, n) => {
|
|
4900
4893
|
n !== t.current && (t.current = n, e.style.setProperty("--ick-conversation-tail", `${Math.round(n)}px`));
|
|
4901
|
-
},
|
|
4894
|
+
}, li = n(function({ children: e, anchorId: t, anchorOffset: n = 0, endOffset: r = 0, tail: i = "auto", threshold: s = ri, scrollButton: u = !0, scrollButtonLabel: p = "Jump to the latest", follow: m = !0, className: _, viewportClassName: v, onScroll: y, ...b }, x) {
|
|
4902
4895
|
let S = d(null);
|
|
4903
4896
|
c(x, () => S.current, []);
|
|
4904
4897
|
let C = d(null), [w, E] = f(!0), D = d(-1), O = d(null), k = d(!1), A = a(() => {
|
|
4905
4898
|
let e = S.current, t = C.current;
|
|
4906
4899
|
if (!e || !t) return 0;
|
|
4907
4900
|
if (i === "auto" && k.current) return Math.max(0, e.scrollHeight - e.clientHeight);
|
|
4908
|
-
let n = t.lastElementChild, a = n ?
|
|
4901
|
+
let n = t.lastElementChild, a = n ? oi(n, e) + n.offsetHeight : oi(t, e) + t.offsetHeight - D.current;
|
|
4909
4902
|
return Math.max(0, a + r - e.clientHeight);
|
|
4910
4903
|
}, [r, i]), j = a(() => {
|
|
4911
4904
|
let e = S.current, a = C.current;
|
|
4912
4905
|
if (!e || !a) return;
|
|
4913
|
-
if (i !== "auto") return
|
|
4914
|
-
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l =
|
|
4915
|
-
if (k.current = !!c && !!l, !k.current || !c || !l) return
|
|
4916
|
-
let u =
|
|
4917
|
-
|
|
4906
|
+
if (i !== "auto") return ci(a, D, Math.max(0, i));
|
|
4907
|
+
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = si(e, O.current);
|
|
4908
|
+
if (k.current = !!c && !!l, !k.current || !c || !l) return ci(a, D, s);
|
|
4909
|
+
let u = oi(c, e) + c.offsetHeight - oi(l, e), d = Math.max(s, e.clientHeight - n - u - o);
|
|
4910
|
+
ci(a, D, t ? Math.max(d, D.current) : d);
|
|
4918
4911
|
}, [
|
|
4919
4912
|
i,
|
|
4920
4913
|
n,
|
|
@@ -4926,7 +4919,7 @@ var ti = {
|
|
|
4926
4919
|
if (t) {
|
|
4927
4920
|
let r = e.querySelector(`[id="${CSS.escape(t)}"]`);
|
|
4928
4921
|
if (r) {
|
|
4929
|
-
let t = Math.max(0, e.scrollHeight - e.clientHeight), i =
|
|
4922
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight), i = oi(r, e), a = i - n, o = i + r.offsetHeight - e.clientHeight;
|
|
4930
4923
|
return Math.max(0, Math.min(Math.max(a, o), t));
|
|
4931
4924
|
}
|
|
4932
4925
|
}
|
|
@@ -4939,7 +4932,7 @@ var ti = {
|
|
|
4939
4932
|
let t = S.current;
|
|
4940
4933
|
if (!t) return;
|
|
4941
4934
|
let n = e && !q();
|
|
4942
|
-
N.current = n ? performance.now() +
|
|
4935
|
+
N.current = n ? performance.now() + ii : 0, t.scrollTo({
|
|
4943
4936
|
top: M(),
|
|
4944
4937
|
behavior: n ? "smooth" : "auto"
|
|
4945
4938
|
}), E(!0);
|
|
@@ -4962,7 +4955,7 @@ var ti = {
|
|
|
4962
4955
|
}
|
|
4963
4956
|
let r = n - e.scrollTop;
|
|
4964
4957
|
if (O.current && !t && Math.abs(r) > s && !q()) {
|
|
4965
|
-
N.current = performance.now() +
|
|
4958
|
+
N.current = performance.now() + ii, e.scrollTo({
|
|
4966
4959
|
top: n,
|
|
4967
4960
|
behavior: "smooth"
|
|
4968
4961
|
});
|
|
@@ -4970,7 +4963,7 @@ var ti = {
|
|
|
4970
4963
|
}
|
|
4971
4964
|
e.scrollTop = n;
|
|
4972
4965
|
}, i = t != null && t !== P.current;
|
|
4973
|
-
t && (P.current = t), i && !q() && Math.abs(e.scrollTop - M()) > s ? (N.current = performance.now() +
|
|
4966
|
+
t && (P.current = t), i && !q() && Math.abs(e.scrollTop - M()) > s ? (N.current = performance.now() + ii, e.scrollTo({
|
|
4974
4967
|
top: M(),
|
|
4975
4968
|
behavior: "smooth"
|
|
4976
4969
|
})) : r();
|
|
@@ -5019,27 +5012,27 @@ var ti = {
|
|
|
5019
5012
|
let F = a((e) => {
|
|
5020
5013
|
if (y?.(e), !m) return;
|
|
5021
5014
|
let t = S.current;
|
|
5022
|
-
t && Math.abs(t.scrollTop - M()) <=
|
|
5015
|
+
t && Math.abs(t.scrollTop - M()) <= ai && (N.current = 0, E(!0));
|
|
5023
5016
|
}, [
|
|
5024
5017
|
m,
|
|
5025
5018
|
y,
|
|
5026
5019
|
M
|
|
5027
5020
|
]), I = m && !w;
|
|
5028
5021
|
return /* @__PURE__ */ g("div", {
|
|
5029
|
-
className: [
|
|
5022
|
+
className: [ni.root, _ ?? ""].filter(Boolean).join(" "),
|
|
5030
5023
|
children: [/* @__PURE__ */ h("div", {
|
|
5031
5024
|
ref: S,
|
|
5032
|
-
className: [
|
|
5025
|
+
className: [ni.viewport, v ?? ""].filter(Boolean).join(" "),
|
|
5033
5026
|
onScroll: F,
|
|
5034
5027
|
...b,
|
|
5035
5028
|
children: /* @__PURE__ */ h("div", {
|
|
5036
5029
|
ref: C,
|
|
5037
|
-
className:
|
|
5030
|
+
className: ni.content,
|
|
5038
5031
|
children: e
|
|
5039
5032
|
})
|
|
5040
5033
|
}), u && /* @__PURE__ */ h("button", {
|
|
5041
5034
|
type: "button",
|
|
5042
|
-
className:
|
|
5035
|
+
className: ni.jump,
|
|
5043
5036
|
"data-shown": I || void 0,
|
|
5044
5037
|
tabIndex: I ? 0 : -1,
|
|
5045
5038
|
"aria-hidden": !I || void 0,
|
|
@@ -5051,7 +5044,7 @@ var ti = {
|
|
|
5051
5044
|
})
|
|
5052
5045
|
})]
|
|
5053
5046
|
});
|
|
5054
|
-
}),
|
|
5047
|
+
}), ui = {
|
|
5055
5048
|
empty: "ick-empty-BP6G",
|
|
5056
5049
|
icon: "ick-icon-rZWd",
|
|
5057
5050
|
title: "ick-title-AoPi",
|
|
@@ -5060,29 +5053,29 @@ var ti = {
|
|
|
5060
5053
|
};
|
|
5061
5054
|
//#endregion
|
|
5062
5055
|
//#region src/EmptyState/EmptyState.tsx
|
|
5063
|
-
function
|
|
5056
|
+
function di({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a = "Suggestions", children: o, className: s, ...c }) {
|
|
5064
5057
|
let l = i ? r ?? [] : [];
|
|
5065
5058
|
return /* @__PURE__ */ g("div", {
|
|
5066
|
-
className: [
|
|
5059
|
+
className: [ui.empty, s ?? ""].filter(Boolean).join(" "),
|
|
5067
5060
|
...c,
|
|
5068
5061
|
children: [
|
|
5069
5062
|
e && /* @__PURE__ */ h("div", {
|
|
5070
|
-
className:
|
|
5063
|
+
className: ui.icon,
|
|
5071
5064
|
children: e
|
|
5072
5065
|
}),
|
|
5073
5066
|
t && /* @__PURE__ */ h("div", {
|
|
5074
|
-
className:
|
|
5067
|
+
className: ui.title,
|
|
5075
5068
|
children: t
|
|
5076
5069
|
}),
|
|
5077
5070
|
n && /* @__PURE__ */ h("p", {
|
|
5078
|
-
className:
|
|
5071
|
+
className: ui.description,
|
|
5079
5072
|
children: n
|
|
5080
5073
|
}),
|
|
5081
5074
|
l.length > 0 && /* @__PURE__ */ h("div", {
|
|
5082
|
-
className:
|
|
5075
|
+
className: ui.suggestions,
|
|
5083
5076
|
role: "group",
|
|
5084
5077
|
"aria-label": a,
|
|
5085
|
-
children: l.map((e) => /* @__PURE__ */ h(
|
|
5078
|
+
children: l.map((e) => /* @__PURE__ */ h(H, {
|
|
5086
5079
|
variant: "primary",
|
|
5087
5080
|
size: "m",
|
|
5088
5081
|
onClick: () => i?.(e),
|
|
@@ -5095,14 +5088,14 @@ function ui({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i
|
|
|
5095
5088
|
}
|
|
5096
5089
|
//#endregion
|
|
5097
5090
|
//#region src/ReplyThreadPopup/placePanel.ts
|
|
5098
|
-
var
|
|
5099
|
-
function
|
|
5100
|
-
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width +
|
|
5091
|
+
var fi = 24, pi = 480, mi = 80, hi = 260;
|
|
5092
|
+
function gi(e, t, n = Infinity) {
|
|
5093
|
+
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + mi, pi), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, fi), t - fi - i), s = Math.max(fi, n - fi - hi), c = Math.min(Math.max(e.top - fi, Math.min(fi, n)), Number.isFinite(s) ? s : Infinity);
|
|
5101
5094
|
return {
|
|
5102
5095
|
x: o,
|
|
5103
5096
|
y: c,
|
|
5104
5097
|
width: i,
|
|
5105
|
-
maxHeight: Number.isFinite(n) ? Math.max(
|
|
5098
|
+
maxHeight: Number.isFinite(n) ? Math.max(hi, n - c - fi) : Infinity
|
|
5106
5099
|
};
|
|
5107
5100
|
}
|
|
5108
5101
|
var Q = {
|
|
@@ -5126,7 +5119,7 @@ var Q = {
|
|
|
5126
5119
|
turn: "ick-turn-ogjU",
|
|
5127
5120
|
turnRow: "ick-turnRow-0OuP",
|
|
5128
5121
|
srOnly: "ick-srOnly-LwE1"
|
|
5129
|
-
},
|
|
5122
|
+
}, _i = 760, vi = {
|
|
5130
5123
|
closed: {
|
|
5131
5124
|
y: "100%",
|
|
5132
5125
|
opacity: 1,
|
|
@@ -5145,16 +5138,16 @@ var Q = {
|
|
|
5145
5138
|
bounce: .18
|
|
5146
5139
|
}
|
|
5147
5140
|
}
|
|
5148
|
-
},
|
|
5149
|
-
function
|
|
5150
|
-
let [i, a] = f("none"), c = d(null), l = d(null), u = d(null), [p] = f(() => typeof document > "u" ? null : document.activeElement), m = s(), _ = s(), v =
|
|
5141
|
+
}, yi = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
|
|
5142
|
+
function bi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
5143
|
+
let [i, a] = f("none"), c = d(null), l = d(null), u = d(null), [p] = f(() => typeof document > "u" ? null : document.activeElement), m = s(), _ = s(), v = Ze, [b, S] = f(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${_i}px)`)?.matches ?? !1);
|
|
5151
5144
|
o(() => {
|
|
5152
|
-
let e = window.matchMedia?.(`(max-width: ${
|
|
5145
|
+
let e = window.matchMedia?.(`(max-width: ${_i}px)`);
|
|
5153
5146
|
if (!e?.addEventListener) return;
|
|
5154
5147
|
let t = () => S(e.matches);
|
|
5155
5148
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5156
5149
|
}, []);
|
|
5157
|
-
let C = e.text, { turns: w, setDraft: T, submit: E, stop: D, beginEdit: O } =
|
|
5150
|
+
let C = e.text, { turns: w, setDraft: T, submit: E, stop: D, beginEdit: O } = lt({ onSend: (e, t) => r(e, C, t) });
|
|
5158
5151
|
o(() => (c.current ? c.current.focus() : u.current?.focus(), () => {
|
|
5159
5152
|
p?.isConnected && p.focus();
|
|
5160
5153
|
}), [p]);
|
|
@@ -5165,7 +5158,7 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5165
5158
|
return;
|
|
5166
5159
|
}
|
|
5167
5160
|
if (e.key !== "Tab") return;
|
|
5168
|
-
let n = [...u.current?.querySelectorAll(
|
|
5161
|
+
let n = [...u.current?.querySelectorAll(yi) ?? []];
|
|
5169
5162
|
if (n.length === 0) return;
|
|
5170
5163
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
5171
5164
|
e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
@@ -5202,7 +5195,7 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5202
5195
|
y: 0,
|
|
5203
5196
|
width: 480,
|
|
5204
5197
|
maxHeight: Infinity
|
|
5205
|
-
} :
|
|
5198
|
+
} : gi(e.rect, window.innerWidth, window.innerHeight);
|
|
5206
5199
|
return /* @__PURE__ */ h(y, {
|
|
5207
5200
|
reducedMotion: "user",
|
|
5208
5201
|
children: /* @__PURE__ */ h("div", {
|
|
@@ -5236,7 +5229,7 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5236
5229
|
scale: .95,
|
|
5237
5230
|
filter: "blur(4px)"
|
|
5238
5231
|
},
|
|
5239
|
-
variants: b ?
|
|
5232
|
+
variants: b ? vi : void 0,
|
|
5240
5233
|
transition: b ? void 0 : {
|
|
5241
5234
|
type: "spring",
|
|
5242
5235
|
bounce: 0,
|
|
@@ -5284,14 +5277,14 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5284
5277
|
})]
|
|
5285
5278
|
}), /* @__PURE__ */ g("div", {
|
|
5286
5279
|
className: Q.headerActions,
|
|
5287
|
-
children: [/* @__PURE__ */ h(
|
|
5280
|
+
children: [/* @__PURE__ */ h(H, {
|
|
5288
5281
|
variant: "primary",
|
|
5289
|
-
icon: /* @__PURE__ */ h(
|
|
5282
|
+
icon: /* @__PURE__ */ h(me, { size: 16 }),
|
|
5290
5283
|
onClick: n,
|
|
5291
5284
|
children: "Save"
|
|
5292
|
-
}), /* @__PURE__ */ h(
|
|
5285
|
+
}), /* @__PURE__ */ h(H, {
|
|
5293
5286
|
variant: "secondary",
|
|
5294
|
-
icon: /* @__PURE__ */ h(
|
|
5287
|
+
icon: /* @__PURE__ */ h(xe, { size: 16 }),
|
|
5295
5288
|
onClick: t,
|
|
5296
5289
|
"aria-label": "Close thread"
|
|
5297
5290
|
})]
|
|
@@ -5349,7 +5342,7 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5349
5342
|
children: [/* @__PURE__ */ h("div", {
|
|
5350
5343
|
className: Q.turnRow,
|
|
5351
5344
|
"data-editing": r || void 0,
|
|
5352
|
-
children: /* @__PURE__ */ h(
|
|
5345
|
+
children: /* @__PURE__ */ h(et, {
|
|
5353
5346
|
ref: n ? c : null,
|
|
5354
5347
|
state: e.state,
|
|
5355
5348
|
value: e.user,
|
|
@@ -5380,7 +5373,7 @@ function yi({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5380
5373
|
}
|
|
5381
5374
|
//#endregion
|
|
5382
5375
|
//#region src/CustomCursor/CustomCursor.tsx
|
|
5383
|
-
function
|
|
5376
|
+
function xi() {
|
|
5384
5377
|
let e = C(-100), t = C(-100), [n, r] = f("default"), [i, a] = f(!1), [s, c] = f(!1);
|
|
5385
5378
|
return o(() => {
|
|
5386
5379
|
let n = (n) => {
|
|
@@ -5538,7 +5531,7 @@ function bi() {
|
|
|
5538
5531
|
}
|
|
5539
5532
|
//#endregion
|
|
5540
5533
|
//#region src/theme/useThemeAttribute.ts
|
|
5541
|
-
function
|
|
5534
|
+
function Si(e) {
|
|
5542
5535
|
o(() => {
|
|
5543
5536
|
e !== void 0 && (e ? document.documentElement.setAttribute("data-theme", e) : document.documentElement.removeAttribute("data-theme"));
|
|
5544
5537
|
}, [e]);
|
|
@@ -5565,21 +5558,21 @@ var $ = {
|
|
|
5565
5558
|
};
|
|
5566
5559
|
//#endregion
|
|
5567
5560
|
//#region src/ChatExperience/ChatExperience.tsx
|
|
5568
|
-
function
|
|
5569
|
-
let [F, I] = f([]), [L, ne] = f(!1), [R, re] = f(null), [ie, ae] = f("marker"), se = d(null), ce = S !== void 0, [le, ue] = f(null), de = ce ? S : le, [fe,
|
|
5561
|
+
function Ci({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", backHref: i, backLabel: s, actions: c, placeholder: l, empty: p, contextTotal: v, contextBase: y = 0, artifact: b, theme: S, onThemeChange: C, cursor: w = !1, selectionToggle: T = !1, anchorOffset: E = 100, endOffset: O = 120, animationConfig: k, foldMotion: A, feedDelay: j = 0, onAnswerQuestion: M, onEditQuestion: N, onDecideApproval: P, className: ee }) {
|
|
5562
|
+
let [F, I] = f([]), [L, ne] = f(!1), [R, re] = f(null), [ie, ae] = f("marker"), se = d(null), ce = S !== void 0, [le, ue] = f(null), de = ce ? S : le, [fe, pe] = f(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
5570
5563
|
o(() => {
|
|
5571
|
-
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () =>
|
|
5564
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => pe(e.matches);
|
|
5572
5565
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5573
5566
|
}, []);
|
|
5574
|
-
let
|
|
5575
|
-
|
|
5576
|
-
let
|
|
5567
|
+
let me = de ?? (fe ? "dark" : "light");
|
|
5568
|
+
Si(de);
|
|
5569
|
+
let ge = a((e) => {
|
|
5577
5570
|
ce || ue(e), C?.(e);
|
|
5578
|
-
}, [ce, C]), { turns:
|
|
5579
|
-
|
|
5580
|
-
}, [
|
|
5581
|
-
|
|
5582
|
-
}, [
|
|
5571
|
+
}, [ce, C]), { turns: B, setDraft: ve, submit: ye, showVersion: be, stop: xe, beginEdit: V, cancelEdit: Se, updatePart: Ce } = lt({ onSend: e }), [H, U] = f(null), we = a((e, t, n) => {
|
|
5572
|
+
U(e), ye(e, t, n);
|
|
5573
|
+
}, [ye]), Te = H ? B.find((e) => e.id === H) ?? null : null, Ee = Te && Te.state !== "resting" ? H : null, De = a((e) => {
|
|
5574
|
+
U(e), ye(e);
|
|
5575
|
+
}, [ye]), Oe = B.length === 1 && !B[0].user && !B[0].ai, ke = y + Math.round(B.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), Ae = v !== void 0 && ke >= v, je = d(!1);
|
|
5583
5576
|
o(() => {
|
|
5584
5577
|
if (!Ae) {
|
|
5585
5578
|
je.current = !1;
|
|
@@ -5587,12 +5580,12 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5587
5580
|
}
|
|
5588
5581
|
je.current || (je.current = !0, K("The oldest messages are dropping out of the window."));
|
|
5589
5582
|
}, [Ae]);
|
|
5590
|
-
let W =
|
|
5583
|
+
let W = ti(), [Me, Ne] = f({}), Pe = a((e, t) => {
|
|
5591
5584
|
Ne((n) => ({
|
|
5592
5585
|
...n,
|
|
5593
5586
|
[e]: t
|
|
5594
5587
|
}));
|
|
5595
|
-
}, []), Fe =
|
|
5588
|
+
}, []), Fe = B.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? r, Ie = a((e, t) => {
|
|
5596
5589
|
t.trim().length > 0 && I((n) => [...n, {
|
|
5597
5590
|
turnId: e,
|
|
5598
5591
|
text: t.trim()
|
|
@@ -5602,7 +5595,7 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5602
5595
|
text: e,
|
|
5603
5596
|
rect: t
|
|
5604
5597
|
});
|
|
5605
|
-
}, []), Re = u(() => M ? (e, t, n, r) => M(
|
|
5598
|
+
}, []), Re = u(() => M ? (e, t, n, r) => M(Ce, e, t, n, r) : void 0, [M, Ce]), G = u(() => N ? (e, t, n) => N(Ce, e, t, n) : void 0, [N, Ce]), ze = u(() => P ? (e, t, n) => P(Ce, e, t, n) : void 0, [P, Ce]), [Be, q] = f(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
|
|
5606
5599
|
o(() => {
|
|
5607
5600
|
if (!w) return;
|
|
5608
5601
|
let e = window.matchMedia("(pointer: fine)"), t = () => q(e.matches);
|
|
@@ -5622,18 +5615,18 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5622
5615
|
}] : [],
|
|
5623
5616
|
{
|
|
5624
5617
|
id: "theme",
|
|
5625
|
-
label:
|
|
5626
|
-
icon: h(
|
|
5618
|
+
label: me === "dark" ? "Switch to the light theme" : "Switch to the dark theme",
|
|
5619
|
+
icon: h(me === "dark" ? _e : oe, {
|
|
5627
5620
|
size: 16,
|
|
5628
5621
|
"aria-hidden": !0
|
|
5629
5622
|
}),
|
|
5630
|
-
active:
|
|
5631
|
-
onClick: () => me
|
|
5623
|
+
active: me === "dark",
|
|
5624
|
+
onClick: () => ge(me === "dark" ? "light" : "dark")
|
|
5632
5625
|
},
|
|
5633
5626
|
{
|
|
5634
5627
|
id: "share",
|
|
5635
5628
|
label: "Share",
|
|
5636
|
-
icon: /* @__PURE__ */ h(
|
|
5629
|
+
icon: /* @__PURE__ */ h(he, {
|
|
5637
5630
|
size: 16,
|
|
5638
5631
|
"aria-hidden": !0
|
|
5639
5632
|
}),
|
|
@@ -5667,7 +5660,7 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5667
5660
|
},
|
|
5668
5661
|
children: [
|
|
5669
5662
|
/* @__PURE__ */ h("div", { className: $.topBlur }),
|
|
5670
|
-
/* @__PURE__ */ g(
|
|
5663
|
+
/* @__PURE__ */ g(_t, {
|
|
5671
5664
|
className: `${$.header} ick-chat-header`,
|
|
5672
5665
|
title: Fe,
|
|
5673
5666
|
backHref: i,
|
|
@@ -5675,7 +5668,7 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5675
5668
|
elevateOnScroll: !1,
|
|
5676
5669
|
collapseActionsAt: 480,
|
|
5677
5670
|
actions: Ve,
|
|
5678
|
-
children: [v !== void 0 && /* @__PURE__ */ h(
|
|
5671
|
+
children: [v !== void 0 && /* @__PURE__ */ h(Hr, {
|
|
5679
5672
|
className: $.context,
|
|
5680
5673
|
used: ke,
|
|
5681
5674
|
total: v
|
|
@@ -5696,26 +5689,26 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5696
5689
|
onClick: () => ae("precise"),
|
|
5697
5690
|
"aria-label": "Precise text selection",
|
|
5698
5691
|
title: "Precise text selection",
|
|
5699
|
-
children: /* @__PURE__ */ h(
|
|
5692
|
+
children: /* @__PURE__ */ h(z, { size: 16 })
|
|
5700
5693
|
})]
|
|
5701
5694
|
})]
|
|
5702
5695
|
}),
|
|
5703
|
-
/* @__PURE__ */ g(
|
|
5696
|
+
/* @__PURE__ */ g(li, {
|
|
5704
5697
|
viewportClassName: `${$.feed} ick-chat-feed`,
|
|
5705
5698
|
anchorId: Ee ? `turn-${Ee}` : void 0,
|
|
5706
5699
|
anchorOffset: E,
|
|
5707
5700
|
endOffset: O,
|
|
5708
5701
|
children: [
|
|
5709
|
-
Oe && p && /* @__PURE__ */ h(
|
|
5702
|
+
Oe && p && /* @__PURE__ */ h(di, {
|
|
5710
5703
|
className: $.opening,
|
|
5711
5704
|
title: p.title,
|
|
5712
5705
|
description: p.description,
|
|
5713
5706
|
suggestions: p.suggestions,
|
|
5714
|
-
onSuggestion: (e) => we(
|
|
5707
|
+
onSuggestion: (e) => we(B[0].id, e)
|
|
5715
5708
|
}),
|
|
5716
|
-
/* @__PURE__ */ h(_, { children:
|
|
5717
|
-
let i = r ===
|
|
5718
|
-
return /* @__PURE__ */ h(
|
|
5709
|
+
/* @__PURE__ */ h(_, { children: B.map((e, r) => {
|
|
5710
|
+
let i = r === B.length - 1 && (e.state === "idle" || e.state === "typing");
|
|
5711
|
+
return /* @__PURE__ */ h(Ir, {
|
|
5719
5712
|
turn: e,
|
|
5720
5713
|
questionAlign: Oe && r === 0 ? "stretch" : "end",
|
|
5721
5714
|
className: Oe && r === 0 ? $.opening : void 0,
|
|
@@ -5729,15 +5722,15 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5729
5722
|
openArtifactId: W.openId,
|
|
5730
5723
|
onOpenArtifact: (e, t) => W.toggle(t),
|
|
5731
5724
|
placeholder: l,
|
|
5732
|
-
onDraft:
|
|
5725
|
+
onDraft: ve,
|
|
5733
5726
|
onSubmit: we,
|
|
5734
5727
|
onRegenerate: De,
|
|
5735
|
-
onShowVersion:
|
|
5728
|
+
onShowVersion: be,
|
|
5736
5729
|
onFeedback: Pe,
|
|
5737
5730
|
feedback: Me[e.id] ?? null,
|
|
5738
|
-
onStop:
|
|
5739
|
-
onEdit:
|
|
5740
|
-
onCancelEdit:
|
|
5731
|
+
onStop: xe,
|
|
5732
|
+
onEdit: V,
|
|
5733
|
+
onCancelEdit: Se,
|
|
5741
5734
|
onHighlight: Ie,
|
|
5742
5735
|
onReplyInThread: n ? Le : void 0,
|
|
5743
5736
|
onAnswerQuestion: Re,
|
|
@@ -5745,18 +5738,18 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5745
5738
|
onDecideApproval: ze
|
|
5746
5739
|
}, e.id);
|
|
5747
5740
|
}) }),
|
|
5748
|
-
Ae && /* @__PURE__ */ h(
|
|
5741
|
+
Ae && /* @__PURE__ */ h(Hn, { children: "The oldest messages are dropping out of the window." })
|
|
5749
5742
|
]
|
|
5750
5743
|
}),
|
|
5751
5744
|
/* @__PURE__ */ h("div", { className: $.bottomBlur })
|
|
5752
5745
|
]
|
|
5753
5746
|
});
|
|
5754
5747
|
return /* @__PURE__ */ g(m, { children: [
|
|
5755
|
-
w && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), Be && /* @__PURE__ */ h(
|
|
5756
|
-
/* @__PURE__ */ h(
|
|
5748
|
+
w && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), Be && /* @__PURE__ */ h(xi, {})] }),
|
|
5749
|
+
/* @__PURE__ */ h(ei, {
|
|
5757
5750
|
className: $.workspace,
|
|
5758
5751
|
onDismiss: W.close,
|
|
5759
|
-
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => He ? /* @__PURE__ */ h(
|
|
5752
|
+
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => He ? /* @__PURE__ */ h(Wr, {
|
|
5760
5753
|
title: He.title,
|
|
5761
5754
|
meta: He.meta,
|
|
5762
5755
|
modal: e,
|
|
@@ -5831,7 +5824,7 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5831
5824
|
}, e))]
|
|
5832
5825
|
})
|
|
5833
5826
|
}) }),
|
|
5834
|
-
/* @__PURE__ */ h(_, { children: R && n && /* @__PURE__ */ h(
|
|
5827
|
+
/* @__PURE__ */ h(_, { children: R && n && /* @__PURE__ */ h(bi, {
|
|
5835
5828
|
activeReply: R,
|
|
5836
5829
|
onClose: () => re(null),
|
|
5837
5830
|
onSendMessage: n
|
|
@@ -5839,6 +5832,6 @@ function Si({ onSend: e, onTranscribe: t, onThreadReply: n, title: r = "Chat", b
|
|
|
5839
5832
|
] });
|
|
5840
5833
|
}
|
|
5841
5834
|
//#endregion
|
|
5842
|
-
export {
|
|
5835
|
+
export { un as A, dt as B, Cn as C, yn as D, xn as E, Rt as F, Ke as G, J as H, Ot as I, Me as J, K, Et as L, Qt as M, Wt as N, gn as O, Yt as P, H as Q, Ct as R, wn as S, En as T, et as U, lt as V, Ze as W, ke as X, je as Y, Te as Z, Bn as _, di as a, Nn as b, ei as c, Ir as d, Nr as f, Ln as g, Hn as h, bi as i, on as j, pn as k, Wr as l, Kn as m, Si as n, li as o, Cr as p, Pe as q, xi as r, ti as s, Ci as t, Hr as u, Rn as v, Tn as w, Sn as x, Fn as y, _t as z };
|
|
5843
5836
|
|
|
5844
|
-
//# sourceMappingURL=ChatExperience-
|
|
5837
|
+
//# sourceMappingURL=ChatExperience-BwjmNCvw.js.map
|