inline-chat-kit 0.61.0 → 0.61.1

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.
@@ -2,8 +2,8 @@
2
2
  import e, { createContext as t, createElement as n, forwardRef as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
3
3
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
4
4
  import { AnimatePresence as y, LayoutGroup as b, MotionConfig as x, animate as S, motion as C, useAnimationControls as w, useMotionValue as T, useReducedMotion as E } from "motion/react";
5
- import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as N, ChevronRight as ee, Copy as te, CornerDownLeft as P, File as F, FileText as ne, Film as re, Highlighter as I, Image as ie, Link2 as ae, Maximize2 as oe, MessageCircle as L, Mic as se, Minimize2 as ce, Moon as le, MoreHorizontal as ue, Music as de, Palette as fe, Paperclip as pe, Pencil as R, Plus as me, RotateCcw as he, Save as ge, Share as _e, Square as ve, Sun as ye, TextCursor as be, ThumbsDown as xe, ThumbsUp as Se, Trash2 as Ce, TriangleAlert as we, X as Te } from "lucide-react";
6
- var z = {
5
+ import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as ee, ChevronLeft as M, ChevronRight as te, Copy as ne, CornerDownLeft as N, File as P, FileText as F, Film as re, Highlighter as I, Image as ie, Link2 as ae, Maximize2 as oe, MessageCircle as L, Mic as R, Minimize2 as se, Moon as ce, MoreHorizontal as le, Music as ue, Palette as de, Paperclip as fe, Pencil as pe, Plus as z, RotateCcw as me, Save as he, Share as ge, Square as _e, Sun as ve, TextCursor as ye, ThumbsDown as be, ThumbsUp as xe, Trash2 as Se, TriangleAlert as Ce, X as we } from "lucide-react";
6
+ var B = {
7
7
  btn: "ick-btn-ZW5E",
8
8
  xs: "ick-xs-rDs4",
9
9
  s: "ick-s-DE-t",
@@ -21,25 +21,25 @@ var z = {
21
21
  loading: "ick-loading-NCs-",
22
22
  spinner: "ick-spinner-0n6Q",
23
23
  spin: "ick-spin-QgE6"
24
+ }, Te = {
25
+ primary: B.primary,
26
+ secondary: B.secondary,
27
+ outline: B.outline,
28
+ ghost: B.ghost,
29
+ glass: B.glass
24
30
  }, Ee = {
25
- primary: z.primary,
26
- secondary: z.secondary,
27
- outline: z.outline,
28
- ghost: z.ghost,
29
- glass: z.glass
30
- }, De = {
31
- xs: z.xs,
32
- s: z.s,
33
- m: z.m,
34
- l: z.l,
35
- xl: z.xl
36
- }, Oe = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
31
+ xs: B.xs,
32
+ s: B.s,
33
+ m: B.m,
34
+ l: B.l,
35
+ xl: B.xl
36
+ }, De = r(function({ variant: e = "primary", size: t = "s", icon: n, iconRight: r, loading: i = !1, children: a, className: o, disabled: s, ...c }, l) {
37
37
  let u = [
38
- z.btn,
39
- Ee[e],
40
- De[t],
41
- a ? z.hasText : "",
42
- i ? z.loading : "",
38
+ B.btn,
39
+ Te[e],
40
+ Ee[t],
41
+ a ? B.hasText : "",
42
+ i ? B.loading : "",
43
43
  o ?? ""
44
44
  ].filter(Boolean).join(" ");
45
45
  return /* @__PURE__ */ v("button", {
@@ -51,44 +51,44 @@ var z = {
51
51
  ...c,
52
52
  children: [
53
53
  n && /* @__PURE__ */ _("span", {
54
- className: z.icon,
54
+ className: B.icon,
55
55
  children: n
56
56
  }),
57
57
  a && /* @__PURE__ */ _("span", {
58
- className: z.label,
58
+ className: B.label,
59
59
  children: a
60
60
  }),
61
61
  r && /* @__PURE__ */ _("span", {
62
- className: z.icon,
62
+ className: B.icon,
63
63
  children: r
64
64
  }),
65
65
  i && /* @__PURE__ */ _("span", {
66
- className: z.spinner,
66
+ className: B.spinner,
67
67
  "aria-hidden": "true"
68
68
  })
69
69
  ]
70
70
  });
71
- }), ke = t({});
72
- function Ae({ components: e, children: t }) {
73
- let n = s(ke), r = e?.Button, i = f(() => r ? {
71
+ }), Oe = t({});
72
+ function ke({ components: e, children: t }) {
73
+ let n = s(Oe), r = e?.Button, i = f(() => r ? {
74
74
  ...n,
75
75
  Button: r
76
76
  } : n, [n, r]);
77
- return /* @__PURE__ */ _(ke.Provider, {
77
+ return /* @__PURE__ */ _(Oe.Provider, {
78
78
  value: i,
79
79
  children: t
80
80
  });
81
81
  }
82
- function je() {
83
- return s(ke);
82
+ function Ae() {
83
+ return s(Oe);
84
84
  }
85
85
  //#endregion
86
86
  //#region src/Button/hostButtonChecks.ts
87
- var Me = /* @__PURE__ */ new Set();
88
- function Ne(e, t) {
89
- Me.has(e) || t.length === 0 || (Me.add(e), console.warn(`inline-chat-kit: the Button given in \`components\` for "${e}" ${t.join("; ")}. See "Bring your own button" in theming.md.`));
87
+ var je = /* @__PURE__ */ new Set();
88
+ function Me(e, t) {
89
+ je.has(e) || t.length === 0 || (je.add(e), console.warn(`inline-chat-kit: the Button given in \`components\` for "${e}" ${t.join("; ")}. See "Bring your own button" in theming.md.`));
90
90
  }
91
- var Pe = [
91
+ var Ne = [
92
92
  "outline-style",
93
93
  "outline-width",
94
94
  "outline-color",
@@ -97,18 +97,18 @@ var Pe = [
97
97
  "background-color",
98
98
  "color"
99
99
  ];
100
- function B(e) {
100
+ function Pe(e) {
101
101
  let t = getComputedStyle(e);
102
- return Pe.map((e) => t.getPropertyValue(e)).join("|");
102
+ return Ne.map((e) => t.getPropertyValue(e)).join("|");
103
103
  }
104
104
  function Fe(e, t, n, r, i) {
105
105
  c(() => {
106
- if (process.env.NODE_ENV === "production" || !e || Me.has(e)) return;
106
+ if (process.env.NODE_ENV === "production" || !e || je.has(e)) return;
107
107
  let a = [];
108
108
  r.current || a.push("does not forward its ref — wrap it in `forwardRef`");
109
109
  let o = n.current ?? t.current?.firstElementChild ?? null;
110
110
  if (!o) {
111
- a.push("rendered nothing"), Ne(e, a);
111
+ a.push("rendered nothing"), Me(e, a);
112
112
  return;
113
113
  }
114
114
  o.tagName !== "BUTTON" && a.push(`renders a <${o.tagName.toLowerCase()}>, not a <button>`);
@@ -117,16 +117,16 @@ function Fe(e, t, n, r, i) {
117
117
  ...i
118
118
  }, c = Object.entries(s).filter(([e, t]) => /^(aria-|data-ick-)/.test(e) && t != null).filter(([e]) => !o.hasAttribute(e)).map(([e]) => e);
119
119
  if (c.length && a.push(`drops ${c.join(", ")} — spread the props it does not use onto the <button>`), a.length) {
120
- Ne(e, a);
120
+ Me(e, a);
121
121
  return;
122
122
  }
123
- let l = B(o), u, d = () => {
123
+ let l = Pe(o), u, d = () => {
124
124
  let t = !0;
125
125
  try {
126
126
  t = o.matches(":focus-visible");
127
127
  } catch {}
128
128
  t && (window.clearTimeout(u), u = window.setTimeout(() => {
129
- document.activeElement === o && B(o) === l && Ne(e, ["shows no change on keyboard focus — give it a visible focus ring"]);
129
+ document.activeElement === o && Pe(o) === l && Me(e, ["shows no change on keyboard focus — give it a visible focus ring"]);
130
130
  }, 400));
131
131
  };
132
132
  return o.addEventListener("focus", d), () => {
@@ -152,7 +152,7 @@ function Re(e, t) {
152
152
  typeof e == "function" ? e(t) : e && (e.current = t);
153
153
  }
154
154
  var V = r(function({ kitRole: e, shape: t, boxClassName: n, boxStyle: r, hostProps: i, variant: a = "primary", size: s = "s", icon: c, iconRight: l, loading: u = !1, disabled: d, children: f, className: m, style: h, ...g }, v) {
155
- let y = je().Button, b = p(null), x = p(!1), S = o((e) => {
155
+ let y = Ae().Button, b = p(null), x = p(!1), S = o((e) => {
156
156
  b.current = e, e && (x.current = !0), Re(v, e);
157
157
  }, [v]), C = p(null), w = {
158
158
  ...g,
@@ -161,7 +161,7 @@ var V = r(function({ kitRole: e, shape: t, boxClassName: n, boxStyle: r, hostPro
161
161
  iconRight: i && "iconRight" in i ? i.iconRight : l,
162
162
  children: i && "children" in i ? i.children : f
163
163
  }, T = t ?? (w.icon && !w.children ? "square" : "default");
164
- if (Fe(y ? e : void 0, C, b, x, g), !y) return /* @__PURE__ */ _(Oe, {
164
+ if (Fe(y ? e : void 0, C, b, x, g), !y) return /* @__PURE__ */ _(De, {
165
165
  ref: v,
166
166
  variant: a,
167
167
  size: s,
@@ -406,7 +406,7 @@ function We(e) {
406
406
  var Ge = (e) => !!e.url && (e.type ?? "").startsWith("image/"), Ke = (e) => e.replace(/["\\]/g, encodeURIComponent);
407
407
  function qe({ type: e }) {
408
408
  let t = (e ?? "").split("/")[0];
409
- return _(t === "image" ? ie : t === "video" ? re : t === "audio" ? de : e === "application/pdf" || t === "text" ? ne : F, {
409
+ return _(t === "image" ? ie : t === "video" ? re : t === "audio" ? ue : e === "application/pdf" || t === "text" ? F : P, {
410
410
  size: 16,
411
411
  "aria-hidden": !0
412
412
  });
@@ -447,7 +447,7 @@ function Je({ attachments: e, onRemove: t, labels: n, className: r, ...i }) {
447
447
  onClick: () => t(e.id),
448
448
  onPointerDown: (e) => e.stopPropagation(),
449
449
  "aria-label": `${a.remove} ${e.name}`,
450
- icon: /* @__PURE__ */ _(Te, {
450
+ icon: /* @__PURE__ */ _(we, {
451
451
  size: 14,
452
452
  "aria-hidden": !0
453
453
  })
@@ -519,13 +519,13 @@ function Ze({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
519
519
  alignItems: "center",
520
520
  justifyContent: "center"
521
521
  },
522
- children: e === "send" ? /* @__PURE__ */ _(P, {
522
+ children: e === "send" ? /* @__PURE__ */ _(N, {
523
523
  size: r,
524
524
  color: t,
525
525
  strokeWidth: 1.8,
526
526
  strokeLinecap: "round",
527
527
  strokeLinejoin: "round"
528
- }) : e === "mic" ? /* @__PURE__ */ _(se, {
528
+ }) : e === "mic" ? /* @__PURE__ */ _(R, {
529
529
  size: r,
530
530
  color: t,
531
531
  strokeWidth: 1.8,
@@ -537,7 +537,7 @@ function Ze({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
537
537
  strokeWidth: 2.2,
538
538
  strokeLinecap: "round",
539
539
  strokeLinejoin: "round"
540
- }) : /* @__PURE__ */ _(ve, {
540
+ }) : /* @__PURE__ */ _(_e, {
541
541
  size: r,
542
542
  color: t,
543
543
  fill: t,
@@ -643,7 +643,7 @@ function Qe({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
643
643
  })
644
644
  }, "read-more"), [{
645
645
  id: "copy",
646
- icon: /* @__PURE__ */ _(te, {
646
+ icon: /* @__PURE__ */ _(ne, {
647
647
  size: 14,
648
648
  "aria-hidden": !0
649
649
  }),
@@ -651,7 +651,7 @@ function Qe({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
651
651
  label: c.copy
652
652
  }, {
653
653
  id: "edit",
654
- icon: /* @__PURE__ */ _(R, {
654
+ icon: /* @__PURE__ */ _(pe, {
655
655
  size: 14,
656
656
  "aria-hidden": !0
657
657
  }),
@@ -695,7 +695,7 @@ function W() {
695
695
  {
696
696
  id: "attach",
697
697
  label: e.attach,
698
- icon: /* @__PURE__ */ _(pe, {
698
+ icon: /* @__PURE__ */ _(fe, {
699
699
  size: 16,
700
700
  "aria-hidden": !0
701
701
  })
@@ -703,7 +703,7 @@ function W() {
703
703
  {
704
704
  id: "design",
705
705
  label: e.design,
706
- icon: /* @__PURE__ */ _(fe, {
706
+ icon: /* @__PURE__ */ _(de, {
707
707
  size: 16,
708
708
  "aria-hidden": !0
709
709
  })
@@ -826,7 +826,7 @@ function $e({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph
826
826
  children: /* @__PURE__ */ _(V, {
827
827
  variant: "ghost",
828
828
  kitRole: "add-close",
829
- icon: /* @__PURE__ */ _(Te, {
829
+ icon: /* @__PURE__ */ _(we, {
830
830
  size: 14,
831
831
  "aria-hidden": !0
832
832
  }),
@@ -1120,13 +1120,13 @@ var _t = {
1120
1120
  n.deleteContents();
1121
1121
  let r = document.createTextNode(e);
1122
1122
  return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
1123
- }, yt = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, busy: j = !1, placeholder: M, menu: N, labels: ee, onLanded: te, animationConfig: P, style: F }, ne) {
1124
- let re = l(), I = H("input", ee), ie = H("voice"), ae = M ?? I.placeholder, oe = N !== !1, L = p(null), se = p(null), ce = p(null), le = p(null), ue = Ye(le), [de, fe] = m(0), pe = p(!1), R = p(null), [he, ge] = m(!1), [_e, ve] = m(!1), [ye, be] = m(!1), [xe, Se] = m(!0), [Ce, we] = m(!1), [z, Ee] = m(!1), [De, ke] = m(!1), Ae = p(0), je = p(!1), Me = p(0), Ne = p(!1), Pe = p(null);
1123
+ }, yt = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, busy: j = !1, placeholder: ee, menu: M, labels: te, onLanded: ne, animationConfig: N, style: P }, F) {
1124
+ let re = l(), I = H("input", te), ie = H("voice"), ae = ee ?? I.placeholder, oe = M !== !1, L = p(null), R = p(null), se = p(null), ce = p(null), le = Ye(ce), [ue, de] = m(0), fe = p(!1), pe = p(null), [me, he] = m(!1), [ge, _e] = m(!1), [ve, ye] = m(!1), [be, xe] = m(!0), [Se, Ce] = m(!1), [B, Te] = m(!1), [Ee, Oe] = m(!1), ke = p(0), Ae = p(!1), je = p(0), Me = p(!1), Ne = p(null);
1125
1125
  c(() => () => {
1126
- Pe.current && clearTimeout(Pe.current);
1126
+ Ne.current && clearTimeout(Ne.current);
1127
1127
  }, []);
1128
- let B = w(), Fe = p(e), Ie = p(P);
1129
- Ie.current = P;
1128
+ let Pe = w(), Fe = p(e), Ie = p(N);
1129
+ Ie.current = N;
1130
1130
  let Le = p(null), [Re, ze] = m([]), Be = s ?? Re, Ve = p(Be);
1131
1131
  Ve.current = Be;
1132
1132
  let He = p([]);
@@ -1166,7 +1166,7 @@ var _t = {
1166
1166
  }
1167
1167
  ze((t) => (Ue(t.find((t) => t.id === e)?.url), t.filter((t) => t.id !== e)));
1168
1168
  }, [f, Ue]);
1169
- u(ne, () => ({
1169
+ u(F, () => ({
1170
1170
  focus: (e) => L.current?.focus(e),
1171
1171
  setValue: (e) => {
1172
1172
  let t = L.current;
@@ -1198,13 +1198,13 @@ var _t = {
1198
1198
  },
1199
1199
  meterRef: Ke,
1200
1200
  labels: ie
1201
- }), G = e === "responding" || e === "resting", et = G, tt = t.trim().length > 0 || Be.length > 0, nt = e === "typing" || e === "idle", rt = nt && tt && !j, K = !!i && (e === "responding" || j && nt), it = j && nt && tt && !i, at = e === "resting" && he, q = at, ot = e === "resting" && z, st = W.state === "listening" || W.state === "requesting" || W.state === "transcribing", ct = !!E && W.supported && !A, lt = rt || K || it, J = P, ht = J ? {
1201
+ }), G = e === "responding" || e === "resting", et = G, tt = t.trim().length > 0 || Be.length > 0, nt = e === "typing" || e === "idle", rt = nt && tt && !j, K = !!i && (e === "responding" || j && nt), it = j && nt && tt && !i, at = e === "resting" && me, q = at, ot = e === "resting" && B, st = W.state === "listening" || W.state === "requesting" || W.state === "transcribing", ct = !!E && W.supported && !A, lt = rt || K || it, J = N, ht = J ? {
1202
1202
  type: "spring",
1203
1203
  stiffness: J.bubble.stiffness,
1204
1204
  damping: J.bubble.damping,
1205
1205
  mass: J.bubble.mass
1206
- } : _t, yt = o(() => {
1207
- let e = se.current, t = ce.current;
1206
+ } : _t, yt = G ? ht : gt(ht), bt = o(() => {
1207
+ let e = R.current, t = se.current;
1208
1208
  if (!e || !t) return;
1209
1209
  if (!(e.scrollHeight > e.clientHeight)) {
1210
1210
  t.removeAttribute("data-fade");
@@ -1214,43 +1214,43 @@ var _t = {
1214
1214
  !n && !r ? t.dataset.fade = "both" : n ? r ? t.removeAttribute("data-fade") : t.dataset.fade = "bottom" : t.dataset.fade = "top";
1215
1215
  }, []);
1216
1216
  c(() => {
1217
- let e = se.current;
1218
- if (e) return e.addEventListener("scroll", yt, { passive: !0 }), () => e.removeEventListener("scroll", yt);
1219
- }, [yt]), c(() => {
1217
+ let e = R.current;
1218
+ if (e) return e.addEventListener("scroll", bt, { passive: !0 }), () => e.removeEventListener("scroll", bt);
1219
+ }, [bt]), c(() => {
1220
1220
  let e = requestAnimationFrame(() => {
1221
- let e = se.current;
1222
- e && !et && (e.scrollTop = e.scrollHeight), yt();
1221
+ let e = R.current;
1222
+ e && !et && (e.scrollTop = e.scrollHeight), bt();
1223
1223
  });
1224
1224
  return () => cancelAnimationFrame(e);
1225
1225
  }, [
1226
1226
  t,
1227
1227
  et,
1228
- yt
1228
+ bt
1229
1229
  ]), c(() => {
1230
1230
  (e === "idle" || e === "typing") && L.current?.focus({ preventScroll: !0 });
1231
1231
  }, [e]), c(() => {
1232
1232
  let e = L.current;
1233
- e && (Ae.current = e.scrollHeight || 17);
1233
+ e && (ke.current = e.scrollHeight || 17);
1234
1234
  }, []), c(() => {
1235
1235
  let e = L.current;
1236
1236
  if (!e || G) return;
1237
1237
  let t = e.clientWidth, n = new ResizeObserver(() => {
1238
- e.clientWidth !== t && (t = e.clientWidth, !e.textContent && e.scrollHeight && (Ae.current = e.scrollHeight));
1238
+ e.clientWidth !== t && (t = e.clientWidth, !e.textContent && e.scrollHeight && (ke.current = e.scrollHeight));
1239
1239
  });
1240
1240
  return n.observe(e), () => n.disconnect();
1241
1241
  }, [G]), c(() => {
1242
- let e = L.current, n = R.current;
1243
- !e || !Ae.current || requestAnimationFrame(() => {
1244
- let r = n ? n.offsetWidth : 0, i = e.clientWidth - 16, a = (se.current?.scrollHeight ?? 0) > Ae.current + 2, o = Ie.current, s = t.length === 0;
1245
- if (!je.current) Me.current = i, !s && (a || r >= Me.current * (o?.wrap?.nearThreshold ?? .92)) && (je.current = !0, Ne.current = !0, Se(!1));
1242
+ let e = L.current, n = pe.current;
1243
+ !e || !ke.current || requestAnimationFrame(() => {
1244
+ let r = n ? n.offsetWidth : 0, i = e.clientWidth - 16, a = (R.current?.scrollHeight ?? 0) > ke.current + 2, o = Ie.current, s = t.length === 0;
1245
+ if (!Ae.current) je.current = i, !s && (a || r >= je.current * (o?.wrap?.nearThreshold ?? .92)) && (Ae.current = !0, Me.current = !0, xe(!1));
1246
1246
  else {
1247
1247
  let e = a || r >= i - 2;
1248
- (s || !e && r < Me.current * (o?.wrap?.exitThreshold ?? .75)) && (je.current = !1, Ne.current = !1, be(!1), Se(!0), Pe.current &&= (clearTimeout(Pe.current), null));
1248
+ (s || !e && r < je.current * (o?.wrap?.exitThreshold ?? .75)) && (Ae.current = !1, Me.current = !1, ye(!1), xe(!0), Ne.current &&= (clearTimeout(Ne.current), null));
1249
1249
  }
1250
1250
  });
1251
1251
  }, [t]), c(() => {
1252
1252
  if (!G) return;
1253
- let e = se.current;
1253
+ let e = R.current;
1254
1254
  if (!e || e.scrollTop === 0) return;
1255
1255
  let t = e.scrollTop;
1256
1256
  S(t, 0, {
@@ -1263,43 +1263,43 @@ var _t = {
1263
1263
  }
1264
1264
  });
1265
1265
  }, [G]), c(() => {
1266
- G ? ke(!1) : (we(!1), Ee(!1));
1266
+ G ? Oe(!1) : (Ce(!1), Te(!1));
1267
1267
  }, [G]), c(() => {
1268
1268
  if (!G) return;
1269
- let e = ce.current;
1270
- e && (z && !Ce ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
1269
+ let e = se.current;
1270
+ e && (B && !Se ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
1271
1271
  }, [
1272
1272
  G,
1273
- z,
1274
- Ce
1273
+ B,
1274
+ Se
1275
1275
  ]), c(() => {
1276
1276
  if (e !== "resting") return;
1277
- let t = se.current, n = L.current;
1277
+ let t = R.current, n = L.current;
1278
1278
  if (!t || !n) return;
1279
1279
  let r = () => {
1280
- fe(t.scrollHeight), Ee(t.scrollHeight > 241), yt();
1280
+ de(t.scrollHeight), Te(t.scrollHeight > 241), bt();
1281
1281
  }, i = requestAnimationFrame(r), a = new ResizeObserver(r);
1282
1282
  return a.observe(n), () => {
1283
1283
  cancelAnimationFrame(i), a.disconnect();
1284
1284
  };
1285
- }, [e, yt]), c(() => {
1286
- let e = le.current;
1287
- if (!te || !e) return;
1285
+ }, [e, bt]), c(() => {
1286
+ let e = ce.current;
1287
+ if (!ne || !e) return;
1288
1288
  let t = performance.now(), n = e.getBoundingClientRect().top, r = 0, i = 0, a = 0, o = () => {
1289
1289
  let s = e.getBoundingClientRect().top, c = Math.abs(s - n);
1290
1290
  if (n = s, r += c, i = c < .5 ? i + 1 : 0, r > 3 && i >= 2 || r <= 3 && performance.now() - t > 150) {
1291
- te();
1291
+ ne();
1292
1292
  return;
1293
1293
  }
1294
1294
  a = requestAnimationFrame(o);
1295
1295
  };
1296
1296
  return a = requestAnimationFrame(o), () => cancelAnimationFrame(a);
1297
- }, [te]), c(() => {
1297
+ }, [ne]), c(() => {
1298
1298
  let t = Fe.current;
1299
1299
  if (Fe.current = e, t !== "responding" || e !== "resting") return;
1300
- ve(!0);
1300
+ _e(!0);
1301
1301
  let n = Ie.current;
1302
- B.start({
1302
+ Pe.start({
1303
1303
  scaleX: [
1304
1304
  1,
1305
1305
  n?.ripple?.scaleX ?? 1.018,
@@ -1320,35 +1320,35 @@ var _t = {
1320
1320
  ]
1321
1321
  }
1322
1322
  });
1323
- let r = window.setTimeout(() => ve(!1), n?.ripple?.pulseDuration ?? 260);
1323
+ let r = window.setTimeout(() => _e(!1), n?.ripple?.pulseDuration ?? 260);
1324
1324
  return () => clearTimeout(r);
1325
1325
  }, [
1326
1326
  e,
1327
- B,
1328
- yt
1327
+ Pe,
1328
+ bt
1329
1329
  ]);
1330
- let bt = o(() => {
1330
+ let xt = o(() => {
1331
1331
  let e = L.current;
1332
- e && (pe.current = !0, n(e.textContent ?? ""));
1333
- }, [n]), xt = o((e) => {
1334
- e.preventDefault(), vt(e.clipboardData.getData("text/plain")) || bt();
1335
- }, [bt]), St = o((e) => {
1332
+ e && (fe.current = !0, n(e.textContent ?? ""));
1333
+ }, [n]), St = o((e) => {
1334
+ e.preventDefault(), vt(e.clipboardData.getData("text/plain")) || xt();
1335
+ }, [xt]), Ct = o((e) => {
1336
1336
  if (e.key === "Enter") {
1337
- if (e.preventDefault(), e.shiftKey) vt("\n") || bt();
1337
+ if (e.preventDefault(), e.shiftKey) vt("\n") || xt();
1338
1338
  else if (j) return;
1339
1339
  else (t.trim().length > 0 || Ve.current.length > 0) && r(t, Ve.current);
1340
1340
  }
1341
1341
  }, [
1342
1342
  t,
1343
1343
  r,
1344
- bt,
1344
+ xt,
1345
1345
  j
1346
1346
  ]);
1347
1347
  return c(() => {
1348
1348
  let e = L.current;
1349
1349
  if (e) {
1350
- if (pe.current) {
1351
- pe.current = !1;
1350
+ if (fe.current) {
1351
+ fe.current = !1;
1352
1352
  return;
1353
1353
  }
1354
1354
  e.textContent !== t && (e.textContent = t, document.activeElement === e && dt(e));
@@ -1359,19 +1359,19 @@ var _t = {
1359
1359
  id: re,
1360
1360
  children: /* @__PURE__ */ v("div", {
1361
1361
  className: U.wrap,
1362
- onMouseEnter: () => ge(!0),
1363
- onMouseLeave: () => ge(!1),
1364
- style: F,
1362
+ onMouseEnter: () => he(!0),
1363
+ onMouseLeave: () => he(!1),
1364
+ style: P,
1365
1365
  children: [
1366
1366
  /* @__PURE__ */ _(C.div, {
1367
1367
  className: `${U.root} ${G ? U.isGlassRoot : ""}`,
1368
- ref: le,
1368
+ ref: ce,
1369
1369
  layout: !0,
1370
- animate: { filter: De ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
1370
+ animate: { filter: Ee ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
1371
1371
  style: {
1372
- pointerEvents: De ? "none" : "auto",
1373
- width: F?.width === "100%" ? "100%" : void 0,
1374
- maxWidth: F?.maxWidth
1372
+ pointerEvents: Ee ? "none" : "auto",
1373
+ width: P?.width === "100%" ? "100%" : void 0,
1374
+ maxWidth: P?.maxWidth
1375
1375
  },
1376
1376
  transition: {
1377
1377
  ...ht,
@@ -1379,17 +1379,18 @@ var _t = {
1379
1379
  type: "tween",
1380
1380
  duration: .2,
1381
1381
  ease: "easeOut"
1382
- }
1382
+ },
1383
+ layout: yt
1383
1384
  },
1384
1385
  children: /* @__PURE__ */ v(C.div, {
1385
- className: `${U.surface} ${G ? U.glass : ""} ${at ? U.hovered : ""} ${_e ? U.pulsed : ""}`,
1386
+ className: `${U.surface} ${G ? U.glass : ""} ${at ? U.hovered : ""} ${ge ? U.pulsed : ""}`,
1386
1387
  style: {
1387
1388
  alignItems: "stretch",
1388
1389
  flexDirection: "column",
1389
1390
  justifyContent: "center"
1390
1391
  },
1391
1392
  transition: ht,
1392
- animate: B,
1393
+ animate: Pe,
1393
1394
  onClick: () => L.current?.focus(),
1394
1395
  children: [
1395
1396
  /* @__PURE__ */ _("input", {
@@ -1437,15 +1438,15 @@ var _t = {
1437
1438
  display: "flex",
1438
1439
  flexDirection: "row",
1439
1440
  alignItems: "center",
1440
- flexWrap: ye ? "wrap" : "nowrap",
1441
- justifyContent: ye ? "flex-end" : "flex-start",
1441
+ flexWrap: ve ? "wrap" : "nowrap",
1442
+ justifyContent: ve ? "flex-end" : "flex-start",
1442
1443
  width: "100%",
1443
1444
  minWidth: 0,
1444
1445
  flex: 1
1445
1446
  },
1446
1447
  children: [
1447
1448
  /* @__PURE__ */ _("span", {
1448
- ref: R,
1449
+ ref: pe,
1449
1450
  "aria-hidden": "true",
1450
1451
  style: {
1451
1452
  position: "absolute",
@@ -1458,14 +1459,14 @@ var _t = {
1458
1459
  children: t
1459
1460
  }),
1460
1461
  /* @__PURE__ */ _("div", {
1461
- ref: ce,
1462
+ ref: se,
1462
1463
  className: U.editorClip,
1463
- style: { flexBasis: ye ? "100%" : void 0 },
1464
+ style: { flexBasis: ve ? "100%" : void 0 },
1464
1465
  children: /* @__PURE__ */ _(C.div, {
1465
- ref: se,
1466
+ ref: R,
1466
1467
  className: `${U.editorWrap} ${G ? U.editorWrapGlass : ""}`,
1467
1468
  layout: "position",
1468
- animate: G && z ? { maxHeight: Ce ? de : 240 } : void 0,
1469
+ animate: G && B ? { maxHeight: Se ? ue : 240 } : void 0,
1469
1470
  transition: {
1470
1471
  ...ht,
1471
1472
  maxHeight: {
@@ -1473,16 +1474,17 @@ var _t = {
1473
1474
  stiffness: 300,
1474
1475
  damping: 35,
1475
1476
  mass: .8
1476
- }
1477
+ },
1478
+ layout: yt
1477
1479
  },
1478
1480
  children: /* @__PURE__ */ _("div", {
1479
1481
  ref: L,
1480
1482
  className: U.editor,
1481
1483
  contentEditable: et ? "false" : "plaintext-only",
1482
1484
  suppressContentEditableWarning: !0,
1483
- onInput: bt,
1484
- onKeyDown: St,
1485
- onPaste: xt,
1485
+ onInput: xt,
1486
+ onKeyDown: Ct,
1487
+ onPaste: St,
1486
1488
  spellCheck: !1,
1487
1489
  role: "textbox",
1488
1490
  "aria-multiline": "true",
@@ -1493,7 +1495,7 @@ var _t = {
1493
1495
  }),
1494
1496
  /* @__PURE__ */ v("div", {
1495
1497
  className: U.buttonGroup,
1496
- children: [!G && xe && ct && /* @__PURE__ */ _(C.div, {
1498
+ children: [!G && be && ct && /* @__PURE__ */ _(C.div, {
1497
1499
  initial: {
1498
1500
  opacity: 0,
1499
1501
  scale: mt,
@@ -1503,7 +1505,7 @@ var _t = {
1503
1505
  animate: {
1504
1506
  opacity: 1,
1505
1507
  scale: 1,
1506
- width: ue,
1508
+ width: le,
1507
1509
  marginLeft: 2
1508
1510
  },
1509
1511
  exit: {
@@ -1511,7 +1513,7 @@ var _t = {
1511
1513
  scale: mt,
1512
1514
  width: 0,
1513
1515
  marginLeft: 0,
1514
- transition: Ne.current ? {
1516
+ transition: Me.current ? {
1515
1517
  type: "tween",
1516
1518
  duration: J?.wrap?.exitDuration ?? .15,
1517
1519
  ease: "easeOut",
@@ -1579,11 +1581,11 @@ var _t = {
1579
1581
  }, "mic"), /* @__PURE__ */ v(y, {
1580
1582
  initial: !1,
1581
1583
  onExitComplete: () => {
1582
- Ne.current && (Ne.current = !1, be(!0), Pe.current && clearTimeout(Pe.current), Pe.current = window.setTimeout(() => {
1583
- Se(!0), Pe.current = null;
1584
+ Me.current && (Me.current = !1, ye(!0), Ne.current && clearTimeout(Ne.current), Ne.current = window.setTimeout(() => {
1585
+ xe(!0), Ne.current = null;
1584
1586
  }, Ie.current?.wrap?.slideInDelay ?? 120));
1585
1587
  },
1586
- children: [!G && xe && (oe || A) && /* @__PURE__ */ _(C.div, {
1588
+ children: [!G && be && (oe || A) && /* @__PURE__ */ _(C.div, {
1587
1589
  initial: {
1588
1590
  opacity: 0,
1589
1591
  scale: mt,
@@ -1592,13 +1594,13 @@ var _t = {
1592
1594
  animate: {
1593
1595
  opacity: 1,
1594
1596
  scale: 1,
1595
- width: ue
1597
+ width: le
1596
1598
  },
1597
1599
  exit: {
1598
1600
  opacity: 0,
1599
1601
  scale: mt,
1600
1602
  width: 0,
1601
- transition: Ne.current ? {
1603
+ transition: Me.current ? {
1602
1604
  type: "tween",
1603
1605
  duration: J?.wrap?.exitDuration ?? .15,
1604
1606
  ease: "easeOut",
@@ -1657,7 +1659,7 @@ var _t = {
1657
1659
  width: "100%",
1658
1660
  height: "100%"
1659
1661
  },
1660
- icon: /* @__PURE__ */ _(Te, {
1662
+ icon: /* @__PURE__ */ _(we, {
1661
1663
  size: 14,
1662
1664
  "aria-hidden": !0
1663
1665
  }),
@@ -1672,7 +1674,7 @@ var _t = {
1672
1674
  height: "100%"
1673
1675
  }
1674
1676
  })
1675
- }, "cancel-btn") : oe && !De ? /* @__PURE__ */ _(C.div, {
1677
+ }, "cancel-btn") : oe && !Ee ? /* @__PURE__ */ _(C.div, {
1676
1678
  initial: {
1677
1679
  opacity: 0,
1678
1680
  scale: .5
@@ -1700,12 +1702,12 @@ var _t = {
1700
1702
  width: "100%",
1701
1703
  height: "100%"
1702
1704
  },
1703
- icon: /* @__PURE__ */ _(me, {
1705
+ icon: /* @__PURE__ */ _(z, {
1704
1706
  size: 14,
1705
1707
  "aria-hidden": !0
1706
1708
  }),
1707
1709
  onClick: (e) => {
1708
- e.stopPropagation(), ke(!0);
1710
+ e.stopPropagation(), Oe(!0);
1709
1711
  },
1710
1712
  "aria-label": I.add,
1711
1713
  title: I.add,
@@ -1717,7 +1719,7 @@ var _t = {
1717
1719
  })
1718
1720
  }, "plus-btn") : null
1719
1721
  })
1720
- }, "lead"), lt && xe && /* @__PURE__ */ _(C.div, {
1722
+ }, "lead"), lt && be && /* @__PURE__ */ _(C.div, {
1721
1723
  initial: {
1722
1724
  opacity: 0,
1723
1725
  scale: mt,
@@ -1727,7 +1729,7 @@ var _t = {
1727
1729
  animate: {
1728
1730
  opacity: 1,
1729
1731
  scale: 1,
1730
- width: ue,
1732
+ width: le,
1731
1733
  marginLeft: 8
1732
1734
  },
1733
1735
  exit: {
@@ -1735,7 +1737,7 @@ var _t = {
1735
1737
  scale: mt,
1736
1738
  width: 0,
1737
1739
  marginLeft: 0,
1738
- transition: Ne.current ? {
1740
+ transition: Me.current ? {
1739
1741
  type: "tween",
1740
1742
  duration: J?.wrap?.exitDuration ?? .15,
1741
1743
  ease: "easeOut"
@@ -1769,7 +1771,7 @@ var _t = {
1769
1771
  transformOrigin: "right",
1770
1772
  height: "var(--ick-composer-control)"
1771
1773
  },
1772
- children: /* @__PURE__ */ _(Oe, {
1774
+ children: /* @__PURE__ */ _(De, {
1773
1775
  variant: "primary",
1774
1776
  "data-ick-role": K ? "stop" : A ? "save" : "send",
1775
1777
  icon: /* @__PURE__ */ _(Ze, { mode: K ? "stop" : A ? "check" : "send" }),
@@ -1794,23 +1796,23 @@ var _t = {
1794
1796
  })
1795
1797
  }),
1796
1798
  /* @__PURE__ */ _($e, {
1797
- isAddOpen: De,
1798
- setIsAddOpen: ke,
1799
- items: N || void 0,
1799
+ isAddOpen: Ee,
1800
+ setIsAddOpen: Oe,
1801
+ items: M || void 0,
1800
1802
  onAdd: (e, t) => {
1801
- let n = N ? N.find((e) => e.id === t) : void 0;
1803
+ let n = M ? M.find((e) => e.id === t) : void 0;
1802
1804
  t === "attach" && !n?.onSelect && Le.current?.click(), a?.();
1803
1805
  },
1804
1806
  showInlineGlyph: lt,
1805
- showButtons: xe,
1806
- control: ue,
1807
+ showButtons: be,
1808
+ control: le,
1807
1809
  ac: J
1808
1810
  }),
1809
1811
  /* @__PURE__ */ _(Qe, {
1810
1812
  showActions: q,
1811
1813
  showReadMore: ot,
1812
- isExpanded: Ce,
1813
- setIsExpanded: we,
1814
+ isExpanded: Se,
1815
+ setIsExpanded: Ce,
1814
1816
  onCopy: D,
1815
1817
  onEdit: O,
1816
1818
  value: t,
@@ -2109,7 +2111,7 @@ var Y = {
2109
2111
  }
2110
2112
  return window;
2111
2113
  }, Lt = r(function({ title: e, subtitle: t, avatar: n, headingLevel: r = 2, truncate: i = !0, onBack: a, backHref: s, backLabel: l, actions: u = [], overflowLabel: d, variant: f = "plain", size: h = "m", align: g = "start", sticky: y = !1, elevateOnScroll: b = y, collapseActionsAt: x = 520, landmark: S = !0, children: C, className: w, ...T }, E) {
2112
- let D = H("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [M, N] = m(!1), [ee, te] = m(!1), P = o((e) => {
2114
+ let D = H("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [ee, M] = m(!1), [te, ne] = m(!1), N = o((e) => {
2113
2115
  j.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
2114
2116
  }, [E]);
2115
2117
  c(() => {
@@ -2117,20 +2119,20 @@ var Y = {
2117
2119
  if (!e || x === !1 || typeof ResizeObserver > "u") return;
2118
2120
  let t = new ResizeObserver(([e]) => {
2119
2121
  let t = e.contentRect.width;
2120
- N(t > 0 && t < x);
2122
+ M(t > 0 && t < x);
2121
2123
  });
2122
2124
  return t.observe(e), () => t.disconnect();
2123
2125
  }, [x]), c(() => {
2124
2126
  if (!b) return;
2125
2127
  let e = It(j.current), t = () => {
2126
2128
  let t = e === window ? window.scrollY : e.scrollTop;
2127
- te(t > 0);
2129
+ ne(t > 0);
2128
2130
  };
2129
2131
  return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
2130
2132
  }, [b]);
2131
- let F = x !== !1 && M, ne = F ? u.filter((e) => e.pinned) : u, re = F ? u.filter((e) => !e.pinned) : [], I = r ? `h${r}` : "span";
2133
+ let P = x !== !1 && ee, F = P ? u.filter((e) => e.pinned) : u, re = P ? u.filter((e) => !e.pinned) : [], I = r ? `h${r}` : "span";
2132
2134
  return /* @__PURE__ */ v(S ? "header" : "div", {
2133
- ref: P,
2135
+ ref: N,
2134
2136
  className: [
2135
2137
  Y.header,
2136
2138
  Nt[h],
@@ -2139,7 +2141,7 @@ var Y = {
2139
2141
  y ? Y.sticky : "",
2140
2142
  w ?? ""
2141
2143
  ].filter(Boolean).join(" "),
2142
- "data-scrolled": b && ee || void 0,
2144
+ "data-scrolled": b && te || void 0,
2143
2145
  ...T,
2144
2146
  children: [/* @__PURE__ */ v("div", {
2145
2147
  className: Y.start,
@@ -2184,7 +2186,7 @@ var Y = {
2184
2186
  className: Y.end,
2185
2187
  children: [
2186
2188
  C,
2187
- ne.map((e) => /* @__PURE__ */ _(Rt, {
2189
+ F.map((e) => /* @__PURE__ */ _(Rt, {
2188
2190
  action: e,
2189
2191
  size: h
2190
2192
  }, e.id)),
@@ -2228,7 +2230,7 @@ function Rt({ action: e, size: t }) {
2228
2230
  });
2229
2231
  }
2230
2232
  function zt({ actions: e, size: t, label: n }) {
2231
- let r = je().Button, [i, a] = m(!1), [s, u] = m(0), [d, f] = m(!1), h = p(null), g = p(null), y = p(!1), b = l(), x = o((e) => {
2233
+ let r = Ae().Button, [i, a] = m(!1), [s, u] = m(0), [d, f] = m(!1), h = p(null), g = p(null), y = p(!1), b = l(), x = o((e) => {
2232
2234
  a(!1), e && h.current?.focus();
2233
2235
  }, []), S = Math.min(s, Math.max(e.length - 1, 0));
2234
2236
  return c(() => {
@@ -2247,7 +2249,7 @@ function zt({ actions: e, size: t, label: n }) {
2247
2249
  variant: "secondary",
2248
2250
  kitRole: "header-more",
2249
2251
  size: At[t],
2250
- icon: /* @__PURE__ */ _(ue, {
2252
+ icon: /* @__PURE__ */ _(le, {
2251
2253
  size: Mt[t],
2252
2254
  "aria-hidden": !0
2253
2255
  }),
@@ -2370,7 +2372,7 @@ function Ht({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
2370
2372
  variant: "ghost",
2371
2373
  kitRole: "answer-action",
2372
2374
  "data-ick-action": "copy",
2373
- icon: _(h ? j : te, {
2375
+ icon: _(h ? j : ne, {
2374
2376
  size: 14,
2375
2377
  "aria-hidden": !0
2376
2378
  }),
@@ -2382,7 +2384,7 @@ function Ht({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
2382
2384
  variant: "ghost",
2383
2385
  kitRole: "answer-action",
2384
2386
  "data-ick-action": "regenerate",
2385
- icon: /* @__PURE__ */ _(he, {
2387
+ icon: /* @__PURE__ */ _(me, {
2386
2388
  size: 14,
2387
2389
  "aria-hidden": !0
2388
2390
  }),
@@ -2396,7 +2398,7 @@ function Ht({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
2396
2398
  variant: "ghost",
2397
2399
  kitRole: "answer-action",
2398
2400
  "data-ick-action": "up",
2399
- icon: /* @__PURE__ */ _(Se, {
2401
+ icon: /* @__PURE__ */ _(xe, {
2400
2402
  size: 14,
2401
2403
  "aria-hidden": !0
2402
2404
  }),
@@ -2408,7 +2410,7 @@ function Ht({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
2408
2410
  variant: "ghost",
2409
2411
  kitRole: "answer-action",
2410
2412
  "data-ick-action": "down",
2411
- icon: /* @__PURE__ */ _(xe, {
2413
+ icon: /* @__PURE__ */ _(be, {
2412
2414
  size: 14,
2413
2415
  "aria-hidden": !0
2414
2416
  }),
@@ -2446,7 +2448,7 @@ function Wt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
2446
2448
  onPointerDown: (e) => e.stopPropagation(),
2447
2449
  disabled: s === 0,
2448
2450
  "aria-label": o.previous,
2449
- children: /* @__PURE__ */ _(N, {
2451
+ children: /* @__PURE__ */ _(M, {
2450
2452
  size: 14,
2451
2453
  "aria-hidden": !0
2452
2454
  })
@@ -2469,7 +2471,7 @@ function Wt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
2469
2471
  onPointerDown: (e) => e.stopPropagation(),
2470
2472
  disabled: s === e - 1,
2471
2473
  "aria-label": o.next,
2472
- children: /* @__PURE__ */ _(ee, {
2474
+ children: /* @__PURE__ */ _(te, {
2473
2475
  size: 14,
2474
2476
  "aria-hidden": !0
2475
2477
  })
@@ -2552,7 +2554,7 @@ function Xt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, g
2552
2554
  className: Jt.meta,
2553
2555
  children: c
2554
2556
  }) : null,
2555
- n && /* @__PURE__ */ _(M, {
2557
+ n && /* @__PURE__ */ _(ee, {
2556
2558
  className: Jt.chevron,
2557
2559
  size: 14,
2558
2560
  "aria-hidden": !0
@@ -2803,7 +2805,7 @@ function gn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
2803
2805
  onClick: C,
2804
2806
  onPointerDown: (e) => e.stopPropagation(),
2805
2807
  "aria-label": h ? d.copied : d.copyCode,
2806
- children: [_(h ? j : te, {
2808
+ children: [_(h ? j : ne, {
2807
2809
  size: 13,
2808
2810
  "aria-hidden": !0
2809
2811
  }), /* @__PURE__ */ _("span", {
@@ -2833,7 +2835,7 @@ function vn({ state: e }) {
2833
2835
  className: _n.glyph,
2834
2836
  "data-state": e,
2835
2837
  "aria-hidden": !0,
2836
- children: e === "running" ? /* @__PURE__ */ _("span", { className: _n.spinner }) : e === "done" ? /* @__PURE__ */ _(j, { size: 13 }) : e === "error" ? /* @__PURE__ */ _(we, { size: 13 }) : /* @__PURE__ */ _("span", { className: _n.queued })
2838
+ children: e === "running" ? /* @__PURE__ */ _("span", { className: _n.spinner }) : e === "done" ? /* @__PURE__ */ _(j, { size: 13 }) : e === "error" ? /* @__PURE__ */ _(Ce, { size: 13 }) : /* @__PURE__ */ _("span", { className: _n.queued })
2837
2839
  });
2838
2840
  }
2839
2841
  var yn = {
@@ -2997,7 +2999,7 @@ function En({ title: e, description: t, children: n, decision: r = null, onDecid
2997
2999
  m ? /* @__PURE__ */ v("p", {
2998
3000
  className: Cn.settled,
2999
3001
  "data-decision": r,
3000
- children: [_(r === "denied" ? Te : j, {
3002
+ children: [_(r === "denied" ? we : j, {
3001
3003
  size: 13,
3002
3004
  "aria-hidden": !0
3003
3005
  }), d[Tn[r]]]
@@ -3588,7 +3590,7 @@ function qn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
3588
3590
  })]
3589
3591
  }), /* @__PURE__ */ v("span", {
3590
3592
  className: X.collapsedAnswer,
3591
- children: [n.map((e, t) => /* @__PURE__ */ _(Pn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ _(R, {
3593
+ children: [n.map((e, t) => /* @__PURE__ */ _(Pn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ _(pe, {
3592
3594
  className: X.pencil,
3593
3595
  size: 14,
3594
3596
  "aria-hidden": !0
@@ -3664,14 +3666,14 @@ function Zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
3664
3666
  let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E = Bn(T), D = H("questionGroup", u), O = q(), k = a && !h, A = n.map((e) => e.shortTitle).join(" · "), j = {
3665
3667
  ...Xn,
3666
3668
  ...d
3667
- }, M = O ? { duration: 0 } : {
3669
+ }, ee = O ? { duration: 0 } : {
3668
3670
  type: "spring",
3669
3671
  visualDuration: j.visualDuration,
3670
3672
  bounce: j.bounce
3671
- }, N = {
3673
+ }, M = {
3672
3674
  hidden: { transition: { staggerChildren: O ? 0 : j.stagger } },
3673
3675
  shown: { transition: { staggerChildren: O ? 0 : j.stagger } }
3674
- }, ee = (e, t = 0) => O ? { duration: 0 } : {
3676
+ }, te = (e, t = 0) => O ? { duration: 0 } : {
3675
3677
  type: "spring",
3676
3678
  visualDuration: j.rowDuration,
3677
3679
  bounce: j.rowBounce,
@@ -3680,19 +3682,19 @@ function Zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
3680
3682
  duration: e,
3681
3683
  delay: t
3682
3684
  }
3683
- }, te = {
3685
+ }, ne = {
3684
3686
  hidden: {
3685
3687
  opacity: 0,
3686
3688
  y: O ? 0 : j.rowOffset,
3687
- transition: ee(j.fadeOut)
3689
+ transition: te(j.fadeOut)
3688
3690
  },
3689
3691
  shown: {
3690
3692
  opacity: 1,
3691
3693
  y: 0,
3692
- transition: ee(j.fadeIn, O ? 0 : j.fadeInDelay)
3694
+ transition: te(j.fadeIn, O ? 0 : j.fadeInDelay)
3693
3695
  }
3694
- }, P = {
3695
- variants: N,
3696
+ }, N = {
3697
+ variants: M,
3696
3698
  initial: "hidden",
3697
3699
  animate: "shown",
3698
3700
  exit: "hidden",
@@ -3705,13 +3707,13 @@ function Zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
3705
3707
  children: /* @__PURE__ */ v(C.div, {
3706
3708
  ref: T,
3707
3709
  layout: !O,
3708
- transition: M,
3710
+ transition: ee,
3709
3711
  className: [Jn.group, f ?? ""].filter(Boolean).join(" "),
3710
3712
  "data-moving": x || void 0,
3711
3713
  style: { borderRadius: E },
3712
3714
  children: [(t || a) && /* @__PURE__ */ _(C.div, {
3713
3715
  layout: !O && "position",
3714
- transition: M,
3716
+ transition: ee,
3715
3717
  children: /* @__PURE__ */ _(Xt, {
3716
3718
  open: !k,
3717
3719
  onToggle: a ? () => {
@@ -3723,15 +3725,15 @@ function Zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
3723
3725
  }), /* @__PURE__ */ _(C.div, {
3724
3726
  id: w,
3725
3727
  layout: !O && "position",
3726
- transition: M,
3728
+ transition: ee,
3727
3729
  className: Jn.body,
3728
3730
  children: /* @__PURE__ */ _(y, {
3729
3731
  initial: !1,
3730
3732
  mode: "popLayout",
3731
3733
  children: k ? /* @__PURE__ */ _(C.div, {
3732
- ...P,
3734
+ ...N,
3733
3735
  children: /* @__PURE__ */ v(C.div, {
3734
- variants: te,
3736
+ variants: ne,
3735
3737
  className: Jn.summary,
3736
3738
  children: [/* @__PURE__ */ v("span", {
3737
3739
  className: Jn.count,
@@ -3747,9 +3749,9 @@ function Zn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
3747
3749
  })
3748
3750
  }, "summary") : /* @__PURE__ */ _(C.div, {
3749
3751
  className: Jn.list,
3750
- ...P,
3752
+ ...N,
3751
3753
  children: n.map((e, t) => /* @__PURE__ */ _(C.div, {
3752
- variants: te,
3754
+ variants: ne,
3753
3755
  className: Jn.row,
3754
3756
  children: /* @__PURE__ */ _(qn, {
3755
3757
  question: e,
@@ -4401,11 +4403,11 @@ var Ir = {
4401
4403
  }), t.trim();
4402
4404
  };
4403
4405
  function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlightComplete: a, onReplyInThread: s, sources: u, onSelectSource: d }) {
4404
- let h = H("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [M, N] = m(0), ee = p(null), te = p(null), [P, F] = m(null), [ne, re] = m(null), I = o((e) => {
4405
- e.viaKeyboard && (te.current = document.activeElement), N(0), j(e);
4406
+ let h = H("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [ee, M] = m(0), te = p(null), ne = p(null), [N, P] = m(null), [F, re] = m(null), I = o((e) => {
4407
+ e.viaKeyboard && (ne.current = document.activeElement), M(0), j(e);
4406
4408
  }, []), ie = o((e = "none") => {
4407
- let t = te.current;
4408
- te.current = null, j(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : g.current?.focus());
4409
+ let t = ne.current;
4410
+ ne.current = null, j(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : g.current?.focus());
4409
4411
  }, []);
4410
4412
  c(() => {
4411
4413
  let e = (e) => {
@@ -4413,11 +4415,11 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4413
4415
  };
4414
4416
  return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
4415
4417
  }, [A, ie]);
4416
- let ae = f(() => Nr(t), [t]), oe = ae.tokens, se = p(w), ce = p(a), le = p(A);
4418
+ let ae = f(() => Nr(t), [t]), oe = ae.tokens, R = p(w), se = p(a), ce = p(A);
4417
4419
  c(() => {
4418
- se.current = w, ce.current = a, le.current = A;
4420
+ R.current = w, se.current = a, ce.current = A;
4419
4421
  });
4420
- let ue = f(() => [...b.map((e) => ({
4422
+ let le = f(() => [...b.map((e) => ({
4421
4423
  id: e.id,
4422
4424
  d: zr(e.points),
4423
4425
  kind: "path",
@@ -4433,7 +4435,7 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4433
4435
  b,
4434
4436
  w,
4435
4437
  oe
4436
- ]), de = (e, t = !1) => {
4438
+ ]), ue = (e, t = !1) => {
4437
4439
  let n = e.kind === "path" ? Br(e.item.points) : Vr(e.item.rects);
4438
4440
  I({
4439
4441
  x: n.x,
@@ -4442,13 +4444,13 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4442
4444
  kind: e.kind,
4443
4445
  viaKeyboard: t
4444
4446
  });
4445
- }, fe = o((e, t, n = !1) => {
4447
+ }, de = o((e, t, n = !1) => {
4446
4448
  let r = g.current, i = t.trim();
4447
4449
  if (!r || !i) return;
4448
4450
  let a = /* @__PURE__ */ new Set();
4449
4451
  r.querySelectorAll("span[data-index]").forEach((t) => {
4450
4452
  e.intersectsNode(t) && a.add(parseInt(t.getAttribute("data-index"), 10));
4451
- }), ce.current?.(i);
4453
+ }), se.current?.(i);
4452
4454
  let o = r.getBoundingClientRect(), s = Array.from(e.getClientRects()).map((e) => ({
4453
4455
  x: e.left - o.left,
4454
4456
  y: e.top - o.top,
@@ -4487,13 +4489,13 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4487
4489
  }, [I]);
4488
4490
  c(() => {
4489
4491
  let e = (e) => {
4490
- if (le.current) return;
4492
+ if (ce.current) return;
4491
4493
  let t = g.current;
4492
4494
  if (!t) return;
4493
4495
  let n = window.getSelection();
4494
4496
  if (!n || n.isCollapsed || n.rangeCount === 0 || !n.toString().trim()) return;
4495
4497
  let r = n.getRangeAt(0);
4496
- t.contains(r.commonAncestorContainer) && (fe(r, n.toString(), e), requestAnimationFrame(() => window.getSelection()?.removeAllRanges()));
4498
+ t.contains(r.commonAncestorContainer) && (de(r, n.toString(), e), requestAnimationFrame(() => window.getSelection()?.removeAllRanges()));
4497
4499
  }, t = () => e(!1), n = (t) => {
4498
4500
  let n = (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a";
4499
4501
  !t.shiftKey && !n || e(!0);
@@ -4501,73 +4503,73 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4501
4503
  return document.addEventListener("mouseup", t), document.addEventListener("keyup", n), () => {
4502
4504
  document.removeEventListener("mouseup", t), document.removeEventListener("keyup", n);
4503
4505
  };
4504
- }, [fe]);
4505
- let [pe, R] = m(i);
4506
- pe !== i && (R(i), j(null));
4507
- let me = f(() => oe.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [oe]), [he, ge] = m(null), [_e, ve] = m(null), ye = l(), be = f(() => he === null || _e === null ? null : {
4508
- from: Math.min(_e, he),
4509
- to: Math.max(_e, he)
4510
- }, [he, _e]), xe = () => {
4511
- ge(null), ve(null);
4512
- }, Se = () => {
4506
+ }, [de]);
4507
+ let [fe, pe] = m(i);
4508
+ fe !== i && (pe(i), j(null));
4509
+ let z = f(() => oe.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [oe]), [me, he] = m(null), [ge, _e] = m(null), ve = l(), ye = f(() => me === null || ge === null ? null : {
4510
+ from: Math.min(ge, me),
4511
+ to: Math.max(ge, me)
4512
+ }, [me, ge]), be = () => {
4513
+ he(null), _e(null);
4514
+ }, xe = () => {
4513
4515
  let e = g.current;
4514
- if (!e || !be) return;
4515
- let t = e.querySelector(`span[data-index="${be.from}"]`), n = e.querySelector(`span[data-index="${be.to}"]`);
4516
+ if (!e || !ye) return;
4517
+ let t = e.querySelector(`span[data-index="${ye.from}"]`), n = e.querySelector(`span[data-index="${ye.to}"]`);
4516
4518
  if (!t || !n) return;
4517
4519
  let r = document.createRange();
4518
4520
  r.setStartBefore(t), r.setEndAfter(n);
4519
4521
  let i = "";
4520
- for (let e = be.from; e <= be.to; e++) i += oe[e];
4521
- fe(r, i, !0), xe();
4522
- }, we = () => [...ee.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
4522
+ for (let e = ye.from; e <= ye.to; e++) i += oe[e];
4523
+ de(r, i, !0), be();
4524
+ }, Ce = () => [...te.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
4523
4525
  c(() => {
4524
4526
  if (!A) return;
4525
- let e = we();
4527
+ let e = Ce();
4526
4528
  if (e.length === 0) return;
4527
- let t = ee.current?.contains(document.activeElement);
4528
- (A.viaKeyboard || t) && e[Math.min(M, e.length - 1)]?.focus();
4529
- }, [A, M]);
4530
- let Te = (e) => {
4531
- let t = we().length;
4529
+ let t = te.current?.contains(document.activeElement);
4530
+ (A.viaKeyboard || t) && e[Math.min(ee, e.length - 1)]?.focus();
4531
+ }, [A, ee]);
4532
+ let we = (e) => {
4533
+ let t = Ce().length;
4532
4534
  if (t === 0) return;
4533
4535
  let n = (n) => {
4534
- e.preventDefault(), e.stopPropagation(), N((e) => (e + n + t) % t);
4536
+ e.preventDefault(), e.stopPropagation(), M((e) => (e + n + t) % t);
4535
4537
  };
4536
4538
  switch (e.key) {
4537
4539
  case "ArrowRight":
4538
4540
  case "ArrowDown": return n(1);
4539
4541
  case "ArrowLeft":
4540
4542
  case "ArrowUp": return n(-1);
4541
- case "Home": return e.preventDefault(), N(0);
4542
- case "End": return e.preventDefault(), N(t - 1);
4543
+ case "Home": return e.preventDefault(), M(0);
4544
+ case "End": return e.preventDefault(), M(t - 1);
4543
4545
  default: return;
4544
4546
  }
4545
- }, z = (e) => {
4546
- if (e.target !== e.currentTarget && e.key !== "Escape" || me.length === 0) return;
4547
+ }, B = (e) => {
4548
+ if (e.target !== e.currentTarget && e.key !== "Escape" || z.length === 0) return;
4547
4549
  let t = (t, n) => {
4548
4550
  e.preventDefault();
4549
- let r = he === null ? -1 : me.indexOf(he), i = r === -1 ? me[t === 1 ? 0 : me.length - 1] : me[Math.min(me.length - 1, Math.max(0, r + t))];
4550
- ge(i), (!n || _e === null) && ve(i);
4551
+ let r = me === null ? -1 : z.indexOf(me), i = r === -1 ? z[t === 1 ? 0 : z.length - 1] : z[Math.min(z.length - 1, Math.max(0, r + t))];
4552
+ he(i), (!n || ge === null) && _e(i);
4551
4553
  }, n = (t) => {
4552
- e.preventDefault(), ge(t), (!e.shiftKey || _e === null) && ve(t);
4554
+ e.preventDefault(), he(t), (!e.shiftKey || ge === null) && _e(t);
4553
4555
  };
4554
4556
  switch (e.key) {
4555
4557
  case "ArrowRight": return t(1, e.shiftKey);
4556
4558
  case "ArrowLeft": return t(-1, e.shiftKey);
4557
- case "Home": return n(me[0]);
4558
- case "End": return n(me[me.length - 1]);
4559
+ case "Home": return n(z[0]);
4560
+ case "End": return n(z[z.length - 1]);
4559
4561
  case "Enter":
4560
- case " ": return be ? (e.preventDefault(), Se()) : void 0;
4561
- case "Escape": return !A && he === null ? void 0 : (e.preventDefault(), ie("restore"), xe());
4562
+ case " ": return ye ? (e.preventDefault(), xe()) : void 0;
4563
+ case "Escape": return !A && me === null ? void 0 : (e.preventDefault(), ie("restore"), be());
4562
4564
  default: return;
4563
4565
  }
4564
- }, Ee = (e, t, n) => {
4566
+ }, Te = (e, t, n) => {
4565
4567
  let r = document.elementFromPoint(e, t);
4566
4568
  if (r && r.hasAttribute("data-index")) {
4567
4569
  let e = parseInt(r.getAttribute("data-index"), 10);
4568
4570
  n.add(e);
4569
4571
  }
4570
- }, De = (e) => {
4572
+ }, Ee = (e) => {
4571
4573
  if (A) {
4572
4574
  ie();
4573
4575
  return;
@@ -4584,14 +4586,14 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4584
4586
  }],
4585
4587
  highlightedIndices: /* @__PURE__ */ new Set()
4586
4588
  };
4587
- D(s), ie(), Ee(e.clientX, e.clientY, s.highlightedIndices);
4588
- }, Oe = (e) => {
4589
+ D(s), ie(), Te(e.clientX, e.clientY, s.highlightedIndices);
4590
+ }, De = (e) => {
4589
4591
  if (i === "precise" || !E) return;
4590
4592
  let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r * Rr;
4591
4593
  D((t) => {
4592
4594
  if (!t) return t;
4593
4595
  let n = new Set(t.highlightedIndices);
4594
- return Ee(e.clientX, e.clientY, n), {
4596
+ return Te(e.clientX, e.clientY, n), {
4595
4597
  ...t,
4596
4598
  points: [...t.points, {
4597
4599
  x: a,
@@ -4600,7 +4602,7 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4600
4602
  highlightedIndices: n
4601
4603
  };
4602
4604
  });
4603
- }, ke = (e) => {
4605
+ }, Oe = (e) => {
4604
4606
  if (i !== "precise" && (k(!1), E)) {
4605
4607
  if (e.currentTarget.releasePointerCapture(e.pointerId), S((e) => [...e, E]), E.highlightedIndices.size > 0) {
4606
4608
  let e = Br(E.points);
@@ -4613,15 +4615,15 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4613
4615
  }
4614
4616
  a && E.highlightedIndices.size > 0 && a(Hr(E.highlightedIndices, oe)), D(null);
4615
4617
  }
4616
- }, Ae = (e) => {
4618
+ }, ke = (e) => {
4617
4619
  i !== "precise" && (k(!1), E && (e.currentTarget.releasePointerCapture(e.pointerId), D(null)));
4618
- }, je = (e) => {
4620
+ }, Ae = (e) => {
4619
4621
  let t = b.find((t) => t.id === e);
4620
4622
  return t ? Hr(t.highlightedIndices, oe) : "";
4621
- }, Me = (e) => {
4623
+ }, je = (e) => {
4622
4624
  let t = A?.viaKeyboard;
4623
4625
  A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)), ie(t ? "container" : "none");
4624
- }, Ne = () => {
4626
+ }, Me = () => {
4625
4627
  let e = A?.viaKeyboard;
4626
4628
  if (A && s) {
4627
4629
  if (A.kind === "selection") {
@@ -4635,29 +4637,29 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4635
4637
  s(e.text, c);
4636
4638
  }
4637
4639
  } else {
4638
- let e = je(A.pathId), t = document.getElementById(`highlight-path-${A.pathId}`);
4640
+ let e = Ae(A.pathId), t = document.getElementById(`highlight-path-${A.pathId}`);
4639
4641
  t && s(e, t.getBoundingClientRect());
4640
4642
  }
4641
4643
  }
4642
4644
  ie(e ? "restore" : "none");
4643
- }, Pe = (e) => {
4645
+ }, Ne = (e) => {
4644
4646
  let t = oe[e];
4645
4647
  if (!r) return t;
4646
4648
  let n = !1;
4647
4649
  A && (n = (A.kind === "path" ? b.find((e) => e.id === A.pathId) : w.find((e) => e.id === A.pathId))?.highlightedIndices?.has(e) ?? !1);
4648
4650
  let i = !1;
4649
- return P && (i = (b.find((e) => e.id === P) ?? w.find((e) => e.id === P))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
4651
+ return N && (i = (b.find((e) => e.id === N) ?? w.find((e) => e.id === N))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
4650
4652
  "data-index": e,
4651
4653
  className: Ir.token,
4652
4654
  "data-space": !t.trim() || void 0,
4653
4655
  "data-active": n || void 0,
4654
4656
  "data-pressed": i || void 0,
4655
- "data-kbd-cursor": he === e || void 0,
4656
- "data-kbd-selected": be && e >= be.from && e <= be.to || void 0,
4657
+ "data-kbd-cursor": me === e || void 0,
4658
+ "data-kbd-selected": ye && e >= ye.from && e <= ye.to || void 0,
4657
4659
  children: t
4658
4660
  }, e);
4659
- }, B = (e) => e.map((e, t) => {
4660
- if (e.type === "token") return Pe(e.index);
4661
+ }, Pe = (e) => e.map((e, t) => {
4662
+ if (e.type === "token") return Ne(e.index);
4661
4663
  if (e.type === "code") return /* @__PURE__ */ _(gn, {
4662
4664
  code: e.value,
4663
4665
  lang: e.lang
@@ -4673,7 +4675,7 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4673
4675
  return n(e.tag, {
4674
4676
  key: `e${t}`,
4675
4677
  ...e.props
4676
- }, e.children.length > 0 ? B(e.children) : void 0);
4678
+ }, e.children.length > 0 ? Pe(e.children) : void 0);
4677
4679
  });
4678
4680
  return /* @__PURE__ */ _(x, {
4679
4681
  reducedMotion: "user",
@@ -4694,18 +4696,18 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4694
4696
  "data-menu": !!A || void 0,
4695
4697
  className: Ir.surface,
4696
4698
  ...r ? {
4697
- onPointerDown: De,
4698
- onPointerMove: Oe,
4699
- onPointerUp: ke,
4700
- onPointerCancel: Ae,
4699
+ onPointerDown: Ee,
4700
+ onPointerMove: De,
4701
+ onPointerUp: Oe,
4702
+ onPointerCancel: ke,
4701
4703
  tabIndex: 0,
4702
- onKeyDown: z,
4703
- onBlur: xe,
4704
- "aria-describedby": ye
4704
+ onKeyDown: B,
4705
+ onBlur: be,
4706
+ "aria-describedby": ve
4705
4707
  } : null,
4706
4708
  children: [
4707
4709
  r && /* @__PURE__ */ _("span", {
4708
- id: ye,
4710
+ id: ve,
4709
4711
  className: Ir.srOnly,
4710
4712
  "aria-hidden": "true",
4711
4713
  children: h.keyboardHint
@@ -4714,60 +4716,60 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4714
4716
  /* @__PURE__ */ _("div", {
4715
4717
  className: Ir.tokens,
4716
4718
  "data-focus": !!A || void 0,
4717
- children: B(ae.nodes)
4719
+ children: Pe(ae.nodes)
4718
4720
  }),
4719
4721
  r && /* @__PURE__ */ _("svg", {
4720
4722
  className: Ir.canvas,
4721
4723
  children: /* @__PURE__ */ v("g", {
4722
4724
  transform: `skewX(${Lr})`,
4723
- children: [ue.map((t) => /* @__PURE__ */ v(e.Fragment, { children: [/* @__PURE__ */ _("path", {
4725
+ children: [le.map((t) => /* @__PURE__ */ v(e.Fragment, { children: [/* @__PURE__ */ _("path", {
4724
4726
  id: `highlight-${t.kind}-${t.id}`,
4725
4727
  className: Ir.marker,
4726
4728
  d: t.d,
4727
4729
  "data-cursor": "pointer",
4728
- "data-pressed": P === t.id || void 0,
4729
- "data-active": A?.pathId === t.id || ne === t.id || void 0,
4730
+ "data-pressed": N === t.id || void 0,
4731
+ "data-active": A?.pathId === t.id || F === t.id || void 0,
4730
4732
  "data-dimmed": A && A.pathId !== t.id || void 0,
4731
4733
  style: { pointerEvents: O ? "none" : "stroke" },
4732
4734
  onPointerDown: (e) => {
4733
- O || (e.stopPropagation(), F(t.id));
4735
+ O || (e.stopPropagation(), P(t.id));
4734
4736
  },
4735
4737
  onPointerUp: (e) => {
4736
- P === t.id && (e.stopPropagation(), de(t), F(null));
4738
+ N === t.id && (e.stopPropagation(), ue(t), P(null));
4737
4739
  },
4738
- onPointerLeave: () => F(null),
4739
- onPointerCancel: () => F(null)
4740
+ onPointerLeave: () => P(null),
4741
+ onPointerCancel: () => P(null)
4740
4742
  }), /* @__PURE__ */ _("path", {
4741
4743
  className: Ir.shimmer,
4742
4744
  d: t.d,
4743
4745
  pathLength: 1,
4744
- "data-active": A?.pathId === t.id || ne === t.id || void 0
4746
+ "data-active": A?.pathId === t.id || F === t.id || void 0
4745
4747
  })] }, t.id)), E && /* @__PURE__ */ _("path", {
4746
4748
  className: Ir.marker,
4747
4749
  d: zr(E.points)
4748
4750
  })]
4749
4751
  })
4750
4752
  }),
4751
- r && ue.length > 0 && /* @__PURE__ */ _("div", {
4753
+ r && le.length > 0 && /* @__PURE__ */ _("div", {
4752
4754
  role: "group",
4753
- "aria-label": Ue(ue.length === 1 ? h.countOne : h.countMany, { count: ue.length }),
4754
- children: ue.map((e) => /* @__PURE__ */ _("button", {
4755
+ "aria-label": Ue(le.length === 1 ? h.countOne : h.countMany, { count: le.length }),
4756
+ children: le.map((e) => /* @__PURE__ */ _("button", {
4755
4757
  type: "button",
4756
4758
  className: Ir.srOnly,
4757
4759
  onPointerDown: (e) => e.stopPropagation(),
4758
4760
  onFocus: () => re(e.id),
4759
4761
  onBlur: () => re(null),
4760
4762
  onClick: (t) => {
4761
- t.stopPropagation(), de(e, !0);
4763
+ t.stopPropagation(), ue(e, !0);
4762
4764
  },
4763
4765
  children: `${h.highlight} ${Ur(e.text)}`
4764
4766
  }, e.id))
4765
4767
  }),
4766
4768
  /* @__PURE__ */ _(y, { children: r && A && /* @__PURE__ */ v(C.div, {
4767
- ref: ee,
4769
+ ref: te,
4768
4770
  role: "menu",
4769
4771
  "aria-label": h.menu,
4770
- onKeyDown: Te,
4772
+ onKeyDown: we,
4771
4773
  onBlur: (e) => {
4772
4774
  e.currentTarget.contains(e.relatedTarget) || ie();
4773
4775
  },
@@ -4816,10 +4818,10 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4816
4818
  kitRole: "highlight-action",
4817
4819
  "data-ick-action": "reply",
4818
4820
  shape: "pill",
4819
- tabIndex: M === 0 ? 0 : -1,
4821
+ tabIndex: ee === 0 ? 0 : -1,
4820
4822
  icon: /* @__PURE__ */ _(L, { size: 14 }),
4821
4823
  onClick: (e) => {
4822
- e.stopPropagation(), Ne();
4824
+ e.stopPropagation(), Me();
4823
4825
  },
4824
4826
  title: h.reply,
4825
4827
  children: h.reply
@@ -4850,10 +4852,10 @@ function Gr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
4850
4852
  role: "menuitem",
4851
4853
  kitRole: "highlight-action",
4852
4854
  "data-ick-action": "remove",
4853
- tabIndex: M === 1 ? 0 : -1,
4854
- icon: /* @__PURE__ */ _(Ce, { size: 14 }),
4855
+ tabIndex: ee === 1 ? 0 : -1,
4856
+ icon: /* @__PURE__ */ _(Se, { size: 14 }),
4855
4857
  onClick: (e) => {
4856
- e.stopPropagation(), Me(A.pathId);
4858
+ e.stopPropagation(), je(A.pathId);
4857
4859
  },
4858
4860
  title: h.remove,
4859
4861
  "aria-label": h.remove
@@ -4891,19 +4893,19 @@ var Kr = {
4891
4893
  part: e
4892
4894
  });
4893
4895
  return i < e.length && a(e.length), r;
4894
- }, Yr = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: s = null, onOpenArtifact: l, onArtifactChange: u, entranceDelay: d = 0, entrance: f = "rise", answerAfterTravel: p = !1, selectionMode: h = "marker", highlights: g = !0, questionAlign: y = "end", onDraft: b, onSubmit: x, onStop: S, busy: w, onEdit: T, onCancelEdit: E, onCopy: D = qr, onHighlight: O, onReplyInThread: k, onRegenerate: A, onShowVersion: j, onFeedback: M, feedback: N = null, answerActions: ee = !0, onAnswerQuestion: te, onEditQuestion: P, onDecideApproval: F, renderPart: ne, composerMenu: re, labels: I, className: ie, onTranscribe: ae }) {
4895
- let oe = q(), L = oe || f === "fade" ? 0 : -16, [se, ce] = m(!1), [le, ue] = m(e.state);
4896
- le !== e.state && (ue(e.state), p && !oe && e.state === "responding" && (le === "typing" || le === "idle") && ce(!0));
4897
- let de = o(() => ce(!1), []);
4896
+ }, Yr = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: s = null, onOpenArtifact: l, onArtifactChange: u, entranceDelay: d = 0, entrance: f = "rise", answerAfterTravel: p = !1, selectionMode: h = "marker", highlights: g = !0, questionAlign: y = "end", onDraft: b, onSubmit: x, onStop: S, busy: w, onEdit: T, onCancelEdit: E, onCopy: D = qr, onHighlight: O, onReplyInThread: k, onRegenerate: A, onShowVersion: j, onFeedback: ee, feedback: M = null, answerActions: te = !0, onAnswerQuestion: ne, onEditQuestion: N, onDecideApproval: P, renderPart: F, composerMenu: re, labels: I, className: ie, onTranscribe: ae }) {
4897
+ let oe = q(), L = oe || f === "fade" ? 0 : -16, [R, se] = m(!1), [ce, le] = m(e.state);
4898
+ ce !== e.state && (le(e.state), p && !oe && e.state === "responding" && (ce === "typing" || ce === "idle") && se(!0));
4899
+ let ue = o(() => se(!1), []);
4898
4900
  c(() => {
4899
- if (!se) return;
4900
- let e = window.setTimeout(() => ce(!1), 1200);
4901
+ if (!R) return;
4902
+ let e = window.setTimeout(() => se(!1), 1200);
4901
4903
  return () => window.clearTimeout(e);
4902
- }, [se]);
4903
- let fe = e.parts ?? [], pe = fe.find((e) => e.kind === "sources")?.sources, R = Jr(e.ai, fe), me = ee && (e.state === "resting" || e.state === "responding") && R.length > 0, he = me && e.state === "resting", ge = me ? R[R.length - 1].kind === "prose" ? R.length - 1 : R.length : -1, _e = me ? /* @__PURE__ */ v("div", {
4904
+ }, [R]);
4905
+ let de = e.parts ?? [], fe = de.find((e) => e.kind === "sources")?.sources, pe = Jr(e.ai, de), z = te && (e.state === "resting" || e.state === "responding") && pe.length > 0, me = z && e.state === "resting", he = z ? pe[pe.length - 1].kind === "prose" ? pe.length - 1 : pe.length : -1, ge = z ? /* @__PURE__ */ v("div", {
4904
4906
  className: Kr.actions,
4905
- "data-pending": he ? void 0 : "",
4906
- style: he ? void 0 : { visibility: "hidden" },
4907
+ "data-pending": me ? void 0 : "",
4908
+ style: me ? void 0 : { visibility: "hidden" },
4907
4909
  children: [/* @__PURE__ */ _(Wt, {
4908
4910
  total: e.versions?.length ?? 0,
4909
4911
  index: e.versionIndex ?? 0,
@@ -4912,10 +4914,10 @@ var Kr = {
4912
4914
  text: e.ai,
4913
4915
  onCopy: D,
4914
4916
  onRegenerate: A ? () => A(e.id) : void 0,
4915
- onFeedback: M ? (t) => M(e.id, t) : void 0,
4916
- feedback: N
4917
+ onFeedback: ee ? (t) => ee(e.id, t) : void 0,
4918
+ feedback: M
4917
4919
  })]
4918
- }) : null, ve = (t) => {
4920
+ }) : null, _e = (t) => {
4919
4921
  switch (t.kind) {
4920
4922
  case "reasoning": return /* @__PURE__ */ _(tn, {
4921
4923
  state: t.state,
@@ -4951,7 +4953,7 @@ var Kr = {
4951
4953
  description: t.description,
4952
4954
  decision: t.decision ?? null,
4953
4955
  choices: t.choices,
4954
- onDecide: (n) => F?.(e.id, t.id, n),
4956
+ onDecide: (n) => P?.(e.id, t.id, n),
4955
4957
  children: t.tool && /* @__PURE__ */ _(Sn, {
4956
4958
  name: t.tool.name,
4957
4959
  state: "pending",
@@ -4983,11 +4985,11 @@ var Kr = {
4983
4985
  collapsible: t.collapsible,
4984
4986
  readOnly: t.readOnly,
4985
4987
  foldMotion: a,
4986
- onCommit: (n, r) => te?.(e.id, t.id, n, r),
4987
- onEdit: (n) => P?.(e.id, t.id, n)
4988
+ onCommit: (n, r) => ne?.(e.id, t.id, n, r),
4989
+ onEdit: (n) => N?.(e.id, t.id, n)
4988
4990
  }, t.id);
4989
4991
  case "custom": {
4990
- let n = ne?.(t, {
4992
+ let n = F?.(t, {
4991
4993
  turnId: e.id,
4992
4994
  openArtifact: (t) => u ? u(t) : l?.(e.id, t),
4993
4995
  closeArtifact: () => u?.(null)
@@ -5000,7 +5002,7 @@ var Kr = {
5000
5002
  }, t.id);
5001
5003
  }
5002
5004
  }
5003
- }, ye = /* @__PURE__ */ v(C.article, {
5005
+ }, ve = /* @__PURE__ */ v(C.article, {
5004
5006
  id: `turn-${e.id}`,
5005
5007
  className: [Kr.turn, ie ?? ""].filter(Boolean).join(" "),
5006
5008
  "data-active-input": t || void 0,
@@ -5045,43 +5047,43 @@ var Kr = {
5045
5047
  onEdit: () => T?.(e.id),
5046
5048
  onCancelEdit: () => E?.(e.id),
5047
5049
  isEditing: e.ai.length > 0 && e.state === "typing",
5048
- onLanded: se ? de : void 0,
5050
+ onLanded: R ? ue : void 0,
5049
5051
  animationConfig: i,
5050
5052
  placeholder: r,
5051
5053
  menu: re
5052
5054
  })
5053
5055
  }), /* @__PURE__ */ v("div", {
5054
5056
  className: Kr.body,
5055
- "data-held": se || void 0,
5056
- "aria-hidden": se || void 0,
5057
+ "data-held": R || void 0,
5058
+ "aria-hidden": R || void 0,
5057
5059
  children: [
5058
- R.map((t, n) => t.kind === "part" ? ve(t.part) : /* @__PURE__ */ v("div", {
5060
+ pe.map((t, n) => t.kind === "part" ? _e(t.part) : /* @__PURE__ */ v("div", {
5059
5061
  className: Kr.answer,
5060
5062
  children: [/* @__PURE__ */ _(Gr, {
5061
5063
  text: t.text,
5062
5064
  marking: g,
5063
5065
  selectionMode: h,
5064
- sources: pe,
5066
+ sources: fe,
5065
5067
  onHighlightComplete: g ? (t) => O?.(e.id, t) : void 0,
5066
5068
  onReplyInThread: g ? k : void 0
5067
- }), ge === n && _e]
5069
+ }), he === n && ge]
5068
5070
  }, `prose-${t.from}`)),
5069
- e.state === "responding" && !e.ai && fe.length === 0 && /* @__PURE__ */ _("div", {
5071
+ e.state === "responding" && !e.ai && de.length === 0 && /* @__PURE__ */ _("div", {
5070
5072
  className: Kr.answer,
5071
5073
  children: /* @__PURE__ */ _(Kt, {})
5072
5074
  }),
5073
- ge === R.length && /* @__PURE__ */ _("div", {
5075
+ he === pe.length && /* @__PURE__ */ _("div", {
5074
5076
  className: Kr.answer,
5075
5077
  "data-actions-only": "",
5076
- children: _e
5078
+ children: ge
5077
5079
  })
5078
5080
  ]
5079
5081
  })]
5080
5082
  });
5081
5083
  return I ? /* @__PURE__ */ _(He, {
5082
5084
  labels: I,
5083
- children: ye
5084
- }) : ye;
5085
+ children: ve
5086
+ }) : ve;
5085
5087
  }, (e, t) => {
5086
5088
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
5087
5089
  for (let r of n) {
@@ -5215,7 +5217,7 @@ function ni({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
5215
5217
  variant: "ghost",
5216
5218
  kitRole: "pane-expand",
5217
5219
  size: "s",
5218
- icon: _(a ? ce : oe, {
5220
+ icon: _(a ? se : oe, {
5219
5221
  size: 15,
5220
5222
  "aria-hidden": !0
5221
5223
  }),
@@ -5227,7 +5229,7 @@ function ni({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
5227
5229
  variant: "ghost",
5228
5230
  kitRole: "pane-close",
5229
5231
  size: "s",
5230
- icon: /* @__PURE__ */ _(Te, {
5232
+ icon: /* @__PURE__ */ _(we, {
5231
5233
  size: 15,
5232
5234
  "aria-hidden": !0
5233
5235
  }),
@@ -5450,25 +5452,25 @@ var mi = {
5450
5452
  r.disconnect(), t.style.removeProperty("--ick-dock-height");
5451
5453
  };
5452
5454
  }, [h]);
5453
- let j = p(-1), M = p(-1), N = p(null), ee = p(!1), te = o(() => {
5455
+ let j = p(-1), ee = p(-1), M = p(null), te = p(!1), ne = o(() => {
5454
5456
  let e = T.current, t = E.current;
5455
5457
  if (!e || !t) return 0;
5456
- if (i === "auto" && ee.current) return Math.max(0, e.scrollHeight - e.clientHeight);
5458
+ if (i === "auto" && te.current) return Math.max(0, e.scrollHeight - e.clientHeight);
5457
5459
  let n = h ? null : t.lastElementChild, a = n ? xi(n, e) + n.offsetHeight : xi(t, e) + t.offsetHeight - (h ? 0 : j.current);
5458
5460
  return Math.max(0, a + r - e.clientHeight);
5459
5461
  }, [
5460
5462
  h,
5461
5463
  r,
5462
5464
  i
5463
- ]), P = o(() => {
5465
+ ]), N = o(() => {
5464
5466
  let e = T.current, a = E.current;
5465
5467
  if (!e || !a) return;
5466
5468
  if (i !== "auto") return wi(a, j, Math.max(0, i));
5467
- let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = Si(e, N.current);
5468
- if (ee.current = !!c && !!l, !ee.current || !c || !l) return wi(a, j, s);
5469
+ let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = Si(e, M.current);
5470
+ if (te.current = !!c && !!l, !te.current || !c || !l) return wi(a, j, s);
5469
5471
  if (h) {
5470
5472
  let t = Math.max(0, e.clientHeight - n - o - Ci(a));
5471
- return t !== M.current && (M.current = t, a.style.setProperty("--ick-conversation-room", `${Math.round(t)}px`)), wi(a, j, s);
5473
+ return t !== ee.current && (ee.current = t, a.style.setProperty("--ick-conversation-room", `${Math.round(t)}px`)), wi(a, j, s);
5472
5474
  }
5473
5475
  let u = xi(c, e) + c.offsetHeight - xi(l, e), d = Math.max(s, e.clientHeight - n - u - o);
5474
5476
  wi(a, j, t ? Math.max(d, j.current) : d);
@@ -5478,7 +5480,7 @@ var mi = {
5478
5480
  r,
5479
5481
  t,
5480
5482
  h
5481
- ]), F = o(() => {
5483
+ ]), P = o(() => {
5482
5484
  let e = T.current;
5483
5485
  if (!e) return 0;
5484
5486
  if (t) {
@@ -5488,36 +5490,36 @@ var mi = {
5488
5490
  return Math.max(0, Math.min(Math.max(a, s), t));
5489
5491
  }
5490
5492
  }
5491
- return te();
5493
+ return ne();
5492
5494
  }, [
5493
5495
  t,
5494
5496
  n,
5495
- te,
5497
+ ne,
5496
5498
  h
5497
- ]), ne = p(0), re = p(null), I = o((e) => {
5499
+ ]), F = p(0), re = p(null), I = o((e) => {
5498
5500
  let t = T.current;
5499
5501
  if (!t) return;
5500
5502
  let n = e && !q();
5501
- ne.current = n ? performance.now() + gi : 0, t.scrollTo({
5502
- top: F(),
5503
+ F.current = n ? performance.now() + gi : 0, t.scrollTo({
5504
+ top: P(),
5503
5505
  behavior: n ? "smooth" : "auto"
5504
5506
  }), A(!0);
5505
- }, [F]);
5507
+ }, [P]);
5506
5508
  d(() => {
5507
- t && (N.current = t);
5509
+ t && (M.current = t);
5508
5510
  let e = T.current, n = E.current;
5509
- if (P(), !e || !n || typeof ResizeObserver > "u") return;
5510
- let r = new ResizeObserver(P);
5511
+ if (N(), !e || !n || typeof ResizeObserver > "u") return;
5512
+ let r = new ResizeObserver(N);
5511
5513
  return r.observe(n), r.observe(e), () => r.disconnect();
5512
- }, [t, P]), d(() => {
5514
+ }, [t, N]), d(() => {
5513
5515
  if (!f || !k && !t) return;
5514
5516
  let e = T.current, n = E.current;
5515
5517
  if (!e || !n || typeof ResizeObserver > "u") return;
5516
5518
  let r = 0, i = () => {
5517
- ne.current = 0;
5518
- let t = F();
5519
+ F.current = 0;
5520
+ let t = P();
5519
5521
  if (Math.abs(t - e.scrollTop) > a && !q()) {
5520
- ne.current = performance.now() + gi, e.scrollTo({
5522
+ F.current = performance.now() + gi, e.scrollTo({
5521
5523
  top: t,
5522
5524
  behavior: "smooth"
5523
5525
  }), r = window.setTimeout(i, 550);
@@ -5525,22 +5527,22 @@ var mi = {
5525
5527
  }
5526
5528
  e.scrollTop = t;
5527
5529
  }, o = () => {
5528
- let n = F();
5529
- if (ne.current) {
5530
- let t = ne.current - performance.now();
5530
+ let n = P();
5531
+ if (F.current) {
5532
+ let t = F.current - performance.now();
5531
5533
  if (t > 0 && Math.abs(e.scrollTop - n) > 1) {
5532
5534
  window.clearTimeout(r), r = window.setTimeout(i, t + yi);
5533
5535
  return;
5534
5536
  }
5535
- ne.current = 0;
5537
+ F.current = 0;
5536
5538
  }
5537
5539
  let o = n - e.scrollTop;
5538
- if (N.current && !t && !q() && h) {
5540
+ if (M.current && !t && !q() && h) {
5539
5541
  !s && Math.abs(o) > bi && (window.clearTimeout(c), c = window.setTimeout(l, vi));
5540
5542
  return;
5541
5543
  }
5542
- if (N.current && !t && Math.abs(o) > a && !q()) {
5543
- ne.current = performance.now() + gi, e.scrollTo({
5544
+ if (M.current && !t && Math.abs(o) > a && !q()) {
5545
+ F.current = performance.now() + gi, e.scrollTo({
5544
5546
  top: n,
5545
5547
  behavior: "smooth"
5546
5548
  });
@@ -5550,11 +5552,11 @@ var mi = {
5550
5552
  }, s = 0, c = 0, l = () => {
5551
5553
  if (s) return;
5552
5554
  if (typeof requestAnimationFrame > "u") {
5553
- e.scrollTop = F();
5555
+ e.scrollTop = P();
5554
5556
  return;
5555
5557
  }
5556
5558
  let t = () => {
5557
- let n = F(), r = n - e.scrollTop;
5559
+ let n = P(), r = n - e.scrollTop;
5558
5560
  if (Math.abs(r) <= 1) {
5559
5561
  e.scrollTop = n, s = 0;
5560
5562
  return;
@@ -5563,8 +5565,8 @@ var mi = {
5563
5565
  };
5564
5566
  s = requestAnimationFrame(t);
5565
5567
  }, u = t != null && t !== re.current;
5566
- t && (re.current = t), u && !q() && Math.abs(e.scrollTop - F()) > a ? (ne.current = performance.now() + gi, e.scrollTo({
5567
- top: F(),
5568
+ t && (re.current = t), u && !q() && Math.abs(e.scrollTop - P()) > a ? (F.current = performance.now() + gi, e.scrollTo({
5569
+ top: P(),
5568
5570
  behavior: "smooth"
5569
5571
  })) : o();
5570
5572
  let d = new ResizeObserver(o);
@@ -5574,7 +5576,7 @@ var mi = {
5574
5576
  }, [
5575
5577
  f,
5576
5578
  k,
5577
- F,
5579
+ P,
5578
5580
  t,
5579
5581
  a,
5580
5582
  h
@@ -5583,7 +5585,7 @@ var mi = {
5583
5585
  let e = T.current;
5584
5586
  if (!e) return;
5585
5587
  let n = () => {
5586
- ne.current = 0, Math.abs(e.scrollTop - F()) > a && A(!1);
5588
+ F.current = 0, Math.abs(e.scrollTop - P()) > a && A(!1);
5587
5589
  }, r = (e) => {
5588
5590
  t ? n() : e.deltaY < 0 && A(!1);
5589
5591
  }, i = (e) => {
@@ -5609,17 +5611,17 @@ var mi = {
5609
5611
  }, [
5610
5612
  f,
5611
5613
  a,
5612
- F,
5614
+ P,
5613
5615
  t
5614
5616
  ]);
5615
5617
  let ie = o((e) => {
5616
5618
  if (b?.(e), !f) return;
5617
5619
  let t = T.current;
5618
- t && Math.abs(t.scrollTop - F()) <= bi && (ne.current = 0, A(!0));
5620
+ t && Math.abs(t.scrollTop - P()) <= bi && (F.current = 0, A(!0));
5619
5621
  }, [
5620
5622
  f,
5621
5623
  b,
5622
- F
5624
+ P
5623
5625
  ]), ae = f && !k;
5624
5626
  return /* @__PURE__ */ v("div", {
5625
5627
  ref: O,
@@ -5655,39 +5657,63 @@ var mi = {
5655
5657
  icon: "ick-icon-rZWd",
5656
5658
  title: "ick-title-AoPi",
5657
5659
  description: "ick-description-c9IG",
5658
- suggestions: "ick-suggestions-aXAf"
5659
- };
5660
- //#endregion
5661
- //#region src/EmptyState/EmptyState.tsx
5662
- function Di({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a, children: o, className: s, ...c }) {
5660
+ suggestions: "ick-suggestions-aXAf",
5661
+ chip: "ick-chip-0w-R"
5662
+ }, Di = .025, Oi = { leave: (e) => ({
5663
+ opacity: 0,
5664
+ x: -24,
5665
+ filter: "blur(4px)",
5666
+ transition: {
5667
+ duration: .16,
5668
+ ease: [
5669
+ .23,
5670
+ 1,
5671
+ .32,
5672
+ 1
5673
+ ],
5674
+ delay: e * Di
5675
+ }
5676
+ }) };
5677
+ function ki({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a, children: o, className: s, ...c }) {
5663
5678
  let l = H("emptyState").suggestions, u = a ?? l, d = i ? r ?? [] : [];
5664
5679
  return /* @__PURE__ */ v("div", {
5665
5680
  className: [Ei.empty, s ?? ""].filter(Boolean).join(" "),
5666
5681
  ...c,
5667
5682
  children: [
5668
- e && /* @__PURE__ */ _("div", {
5683
+ e && /* @__PURE__ */ _(C.div, {
5669
5684
  className: Ei.icon,
5685
+ variants: Oi,
5686
+ custom: 0,
5670
5687
  children: e
5671
5688
  }),
5672
- t && /* @__PURE__ */ _("div", {
5689
+ t && /* @__PURE__ */ _(C.div, {
5673
5690
  className: Ei.title,
5691
+ variants: Oi,
5692
+ custom: 0,
5674
5693
  children: t
5675
5694
  }),
5676
- n && /* @__PURE__ */ _("p", {
5695
+ n && /* @__PURE__ */ _(C.p, {
5677
5696
  className: Ei.description,
5697
+ variants: Oi,
5698
+ custom: 1,
5678
5699
  children: n
5679
5700
  }),
5680
5701
  d.length > 0 && /* @__PURE__ */ _("div", {
5681
5702
  className: Ei.suggestions,
5682
5703
  role: "group",
5683
5704
  "aria-label": u,
5684
- children: d.map((e) => /* @__PURE__ */ _(V, {
5685
- variant: "primary",
5686
- size: "m",
5687
- kitRole: "suggestion",
5688
- shape: "pill",
5689
- onClick: () => i?.(e),
5690
- children: e
5705
+ children: d.map((e, t) => /* @__PURE__ */ _(C.span, {
5706
+ className: Ei.chip,
5707
+ variants: Oi,
5708
+ custom: t + 2,
5709
+ children: /* @__PURE__ */ _(V, {
5710
+ variant: "primary",
5711
+ size: "m",
5712
+ kitRole: "suggestion",
5713
+ shape: "pill",
5714
+ onClick: () => i?.(e),
5715
+ children: e
5716
+ })
5691
5717
  }, e))
5692
5718
  }),
5693
5719
  o
@@ -5696,14 +5722,14 @@ function Di({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i
5696
5722
  }
5697
5723
  //#endregion
5698
5724
  //#region src/ReplyThreadPopup/placePanel.ts
5699
- var Oi = 24, ki = 480, Ai = 80, ji = 260;
5700
- function Mi(e, t, n = Infinity) {
5701
- let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + Ai, ki), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, Oi), t - Oi - i), s = Math.max(Oi, n - Oi - ji), c = Math.min(Math.max(e.top - Oi, Math.min(Oi, n)), Number.isFinite(s) ? s : Infinity);
5725
+ var Ai = 24, ji = 480, Mi = 80, Ni = 260;
5726
+ function Pi(e, t, n = Infinity) {
5727
+ let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + Mi, ji), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, Ai), t - Ai - i), s = Math.max(Ai, n - Ai - Ni), c = Math.min(Math.max(e.top - Ai, Math.min(Ai, n)), Number.isFinite(s) ? s : Infinity);
5702
5728
  return {
5703
5729
  x: o,
5704
5730
  y: c,
5705
5731
  width: i,
5706
- maxHeight: Number.isFinite(n) ? Math.max(ji, n - c - Oi) : Infinity
5732
+ maxHeight: Number.isFinite(n) ? Math.max(Ni, n - c - Ai) : Infinity
5707
5733
  };
5708
5734
  }
5709
5735
  var Q = {
@@ -5727,7 +5753,7 @@ var Q = {
5727
5753
  turn: "ick-turn-ogjU",
5728
5754
  turnRow: "ick-turnRow-0OuP",
5729
5755
  srOnly: "ick-srOnly-LwE1"
5730
- }, Ni = 760, Pi = {
5756
+ }, Fi = 760, Ii = {
5731
5757
  closed: {
5732
5758
  y: "100%",
5733
5759
  opacity: 1,
@@ -5746,11 +5772,11 @@ var Q = {
5746
5772
  bounce: .18
5747
5773
  }
5748
5774
  }
5749
- }, Fi = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
5750
- function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5751
- let i = H("thread"), { responding: a } = H("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = ht, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${Ni}px)`)?.matches ?? !1);
5775
+ }, Li = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
5776
+ function Ri({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5777
+ let i = H("thread"), { responding: a } = H("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = ht, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${Fi}px)`)?.matches ?? !1);
5752
5778
  c(() => {
5753
- let e = window.matchMedia?.(`(max-width: ${Ni}px)`);
5779
+ let e = window.matchMedia?.(`(max-width: ${Fi}px)`);
5754
5780
  if (!e?.addEventListener) return;
5755
5781
  let t = () => w(e.matches);
5756
5782
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
@@ -5769,11 +5795,11 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5769
5795
  return;
5770
5796
  }
5771
5797
  if (e.key !== "Tab") return;
5772
- let n = [...f.current?.querySelectorAll(Fi) ?? []];
5798
+ let n = [...f.current?.querySelectorAll(Li) ?? []];
5773
5799
  if (n.length === 0) return;
5774
5800
  let r = n[0], i = n[n.length - 1], a = document.activeElement;
5775
5801
  e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
5776
- }, M = () => {
5802
+ }, ee = () => {
5777
5803
  let e = d.current;
5778
5804
  if (!e) return;
5779
5805
  if (!(e.scrollHeight - e.clientHeight > 2)) {
@@ -5786,12 +5812,12 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5786
5812
  c(() => {
5787
5813
  let e = d.current;
5788
5814
  if (!e) return;
5789
- let t = () => M();
5815
+ let t = () => ee();
5790
5816
  e.addEventListener("scroll", t, { passive: !0 });
5791
5817
  let n = new ResizeObserver(() => {
5792
- M();
5818
+ ee();
5793
5819
  });
5794
- return n.observe(e), e.firstElementChild && n.observe(e.firstElementChild), M(), () => {
5820
+ return n.observe(e), e.firstElementChild && n.observe(e.firstElementChild), ee(), () => {
5795
5821
  e.removeEventListener("scroll", t), n.disconnect();
5796
5822
  };
5797
5823
  }, [E]), c(() => {
@@ -5801,12 +5827,12 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5801
5827
  behavior: "smooth"
5802
5828
  });
5803
5829
  }, [E]);
5804
- let { x: N, y: ee, width: te, maxHeight: P } = typeof window > "u" ? {
5830
+ let { x: M, y: te, width: ne, maxHeight: N } = typeof window > "u" ? {
5805
5831
  x: 0,
5806
5832
  y: 0,
5807
5833
  width: 480,
5808
5834
  maxHeight: Infinity
5809
- } : Mi(e.rect, window.innerWidth, window.innerHeight);
5835
+ } : Pi(e.rect, window.innerWidth, window.innerHeight);
5810
5836
  return /* @__PURE__ */ _(x, {
5811
5837
  reducedMotion: "user",
5812
5838
  children: /* @__PURE__ */ _("div", {
@@ -5829,9 +5855,9 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5829
5855
  opacity: 0
5830
5856
  },
5831
5857
  animate: S ? "open" : {
5832
- left: N,
5833
- top: ee,
5834
- width: te,
5858
+ left: M,
5859
+ top: te,
5860
+ width: ne,
5835
5861
  borderRadius: 28,
5836
5862
  opacity: 1
5837
5863
  },
@@ -5840,7 +5866,7 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5840
5866
  scale: .95,
5841
5867
  filter: "blur(4px)"
5842
5868
  },
5843
- variants: S ? Pi : void 0,
5869
+ variants: S ? Ii : void 0,
5844
5870
  transition: S ? void 0 : {
5845
5871
  type: "spring",
5846
5872
  bounce: 0,
@@ -5861,7 +5887,7 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5861
5887
  (n.offset.y > 120 || n.velocity.y > 600) && t();
5862
5888
  }
5863
5889
  } : {},
5864
- style: !S && Number.isFinite(P) ? { maxHeight: P } : void 0,
5890
+ style: !S && Number.isFinite(N) ? { maxHeight: N } : void 0,
5865
5891
  className: Q.panel,
5866
5892
  children: /* @__PURE__ */ v("div", {
5867
5893
  className: Q.column,
@@ -5891,13 +5917,13 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5891
5917
  children: [/* @__PURE__ */ _(V, {
5892
5918
  variant: "primary",
5893
5919
  kitRole: "thread-save",
5894
- icon: /* @__PURE__ */ _(ge, { size: 16 }),
5920
+ icon: /* @__PURE__ */ _(he, { size: 16 }),
5895
5921
  onClick: n,
5896
5922
  children: i.save
5897
5923
  }), /* @__PURE__ */ _(V, {
5898
5924
  variant: "secondary",
5899
5925
  kitRole: "thread-close",
5900
- icon: /* @__PURE__ */ _(Te, { size: 16 }),
5926
+ icon: /* @__PURE__ */ _(we, { size: 16 }),
5901
5927
  onClick: t,
5902
5928
  "aria-label": i.close
5903
5929
  })]
@@ -5986,7 +6012,7 @@ function Ii({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
5986
6012
  }
5987
6013
  //#endregion
5988
6014
  //#region src/CustomCursor/CustomCursor.tsx
5989
- function Li() {
6015
+ function zi() {
5990
6016
  let e = T(-100), t = T(-100), [n, r] = m("default"), [i, a] = m(!1), [o, s] = m(!1);
5991
6017
  return c(() => {
5992
6018
  let n = (n) => {
@@ -6144,7 +6170,7 @@ function Li() {
6144
6170
  }
6145
6171
  //#endregion
6146
6172
  //#region src/theme/useThemeAttribute.ts
6147
- function Ri(e) {
6173
+ function Bi(e) {
6148
6174
  c(() => {
6149
6175
  e !== void 0 && (e ? document.documentElement.setAttribute("data-theme", e) : document.documentElement.removeAttribute("data-theme"));
6150
6176
  }, [e]);
@@ -6161,6 +6187,7 @@ var $ = {
6161
6187
  context: "ick-context-MnVe",
6162
6188
  selectMode: "ick-selectMode-4m-8",
6163
6189
  opening: "ick-opening-A1EI",
6190
+ openingBlock: "ick-openingBlock-Wdrk",
6164
6191
  workspace: "ick-workspace-Gtb0",
6165
6192
  scrim: "ick-scrim-nuAi",
6166
6193
  sheet: "ick-sheet-rrgt",
@@ -6171,89 +6198,92 @@ var $ = {
6171
6198
  groupTitle: "ick-groupTitle-jiBB",
6172
6199
  marks: "ick-marks-gwsN",
6173
6200
  mark: "ick-mark-QkpW"
6174
- }, zi = () => "", Bi = {
6201
+ }, Vi = () => "", Hi = {
6175
6202
  stiffness: 170,
6176
6203
  damping: 24,
6177
6204
  mass: 1
6178
6205
  };
6179
- function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, headerActions: a = !0, composerMenu: s, onTranscribe: l, onThreadReply: u, title: d, backHref: h, backLabel: b, actions: x, placeholder: S, empty: w, contextTotal: T, contextBase: E = 0, artifact: D, openArtifactId: O, onOpenArtifactChange: A, pane: j = "inline", surface: M = "flush", composer: N = "inline", fill: ee = "window", theme: te, onThemeChange: P, cursor: F = !1, selectionToggle: ne = !1, highlights: re = !0, bookmarks: ie = !0, anchorOffset: ae = 100, endOffset: oe = 120, animationConfig: L, foldMotion: se, feedDelay: ce = 0, onAnswerQuestion: ue, onEditQuestion: de, onDecideApproval: fe, className: pe }) {
6180
- let R = H("experience", r?.experience), me = d ?? R.title, [he, ge] = m([]), [ve, xe] = m(!1), [Se, Ce] = m(null), [we, Te] = m("marker"), z = p(null), Ee = te !== void 0, [De, Oe] = m(null), ke = Ee ? te : De, [je, Me] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
6206
+ function Ui({ onSend: e, chat: t, renderPart: n, labels: r, components: i, headerActions: a = !0, composerMenu: s, onTranscribe: l, onThreadReply: u, title: d, backHref: h, backLabel: b, actions: S, placeholder: w, empty: T, contextTotal: E, contextBase: D = 0, artifact: O, openArtifactId: A, onOpenArtifactChange: j, pane: ee = "inline", surface: M = "flush", composer: te = "inline", fill: ne = "window", theme: N, onThemeChange: P, cursor: F = !1, selectionToggle: re = !1, highlights: ie = !0, bookmarks: ae = !0, anchorOffset: oe = 100, endOffset: L = 120, animationConfig: R, foldMotion: se, feedDelay: le = 0, onAnswerQuestion: ue, onEditQuestion: de, onDecideApproval: fe, className: pe }) {
6207
+ let z = H("experience", r?.experience), me = d ?? z.title, [he, _e] = m([]), [be, xe] = m(!1), [Se, Ce] = m(null), [we, B] = m("marker"), Te = p(null), Ee = N !== void 0, [De, Oe] = m(null), Ae = Ee ? N : De, [je, Me] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
6181
6208
  c(() => {
6182
6209
  let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => Me(e.matches);
6183
6210
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
6184
6211
  }, []);
6185
- let Ne = ke ?? (je ? "dark" : "light");
6186
- Ri(ke);
6212
+ let Ne = Ae ?? (je ? "dark" : "light");
6213
+ Bi(Ae);
6187
6214
  let Pe = o((e) => {
6188
6215
  Ee || Oe(e), P?.(e);
6189
- }, [Ee, P]), B = N === "docked", Fe = f(() => B ? {
6216
+ }, [Ee, P]), Fe = te === "docked", Ie = f(() => Fe ? {
6190
6217
  ...ht,
6191
- ...L,
6192
- bubble: L?.bubble ?? Bi
6193
- } : L, [B, L]), Ie = kt({
6194
- onSend: e ?? zi,
6195
- announcements: { responding: R.responding },
6196
- nextTurn: B ? "at-send" : "after-answer"
6197
- }), { turns: Le, setDraft: Re, submit: V, showVersion: ze, stop: Be, beginEdit: Ve, cancelEdit: We, updatePart: Ge, isStreaming: Ke } = t ?? Ie, [qe, Je] = m(null), Ye = o((e, t, n) => {
6198
- Je(e), V(e, t, n);
6199
- }, [V]), Xe = qe ? Le.find((e) => e.id === qe) ?? null : null, Ze = (Xe?.versions?.length ?? 0) > 0, U = Xe && Ze && Xe.state !== "resting" ? qe : null, [Qe, W] = m(0), $e = ee === "window";
6218
+ ...R,
6219
+ bubble: R?.bubble ?? Hi
6220
+ } : R, [Fe, R]), Le = kt({
6221
+ onSend: e ?? Vi,
6222
+ announcements: { responding: z.responding },
6223
+ nextTurn: Fe ? "at-send" : "after-answer"
6224
+ }), { turns: Re, setDraft: V, submit: ze, showVersion: Be, stop: Ve, beginEdit: We, cancelEdit: Ge, updatePart: Ke, isStreaming: qe } = t ?? Le, [Je, Ye] = m(null), Xe = o((e, t, n) => {
6225
+ Ye(e), ze(e, t, n);
6226
+ }, [ze]), Ze = Je ? Re.find((e) => e.id === Je) ?? null : null, U = (Ze?.versions?.length ?? 0) > 0, Qe = Ze && U && Ze.state !== "resting" ? Je : null, [W, $e] = m(0), G = ne === "window";
6200
6227
  c(() => {
6201
- if (!B || !$e) return;
6228
+ if (!Fe || !G) return;
6202
6229
  let e = window.visualViewport;
6203
6230
  if (!e) return;
6204
- let t = () => W(Math.max(0, Math.round(window.innerHeight - e.height)));
6231
+ let t = () => $e(Math.max(0, Math.round(window.innerHeight - e.height)));
6205
6232
  return t(), e.addEventListener("resize", t), () => e.removeEventListener("resize", t);
6206
- }, [B, $e]);
6207
- let G = o((e) => {
6208
- Je(e), V(e);
6209
- }, [V]), et = Le.length === 1 && !Le[0].user && !Le[0].ai, tt = E + Math.round(Le.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), nt = T !== void 0 && tt >= T, rt = p(!1);
6233
+ }, [Fe, G]);
6234
+ let et = o((e) => {
6235
+ Ye(e), ze(e);
6236
+ }, [ze]), tt = Re.length === 1 && !Re[0].ai && (Re[0].state === "idle" || Re[0].state === "typing"), nt = gt(Ie?.bubble ? {
6237
+ type: "spring",
6238
+ ...Ie.bubble
6239
+ } : _t), rt = D + Math.round(Re.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), it = E !== void 0 && rt >= E, at = p(!1);
6210
6240
  c(() => {
6211
- if (!nt) {
6212
- rt.current = !1;
6241
+ if (!it) {
6242
+ at.current = !1;
6213
6243
  return;
6214
6244
  }
6215
- rt.current || (rt.current = !0, K(R.windowFull));
6216
- }, [nt, R.windowFull]);
6217
- let it = pi(), at = O !== void 0, q = at ? O : it.openId, ot = p({
6218
- openArtifactId: q,
6219
- artifactHeld: at,
6220
- onOpenArtifactChange: A
6245
+ at.current || (at.current = !0, K(z.windowFull));
6246
+ }, [it, z.windowFull]);
6247
+ let q = pi(), ot = A !== void 0, st = ot ? A : q.openId, ct = p({
6248
+ openArtifactId: st,
6249
+ artifactHeld: ot,
6250
+ onOpenArtifactChange: j
6221
6251
  });
6222
6252
  c(() => {
6223
- ot.current = {
6224
- openArtifactId: q,
6225
- artifactHeld: at,
6226
- onOpenArtifactChange: A
6253
+ ct.current = {
6254
+ openArtifactId: st,
6255
+ artifactHeld: ot,
6256
+ onOpenArtifactChange: j
6227
6257
  };
6228
6258
  });
6229
- let st = it.open, ct = it.close, lt = o((e) => {
6230
- let { artifactHeld: t, onOpenArtifactChange: n } = ot.current;
6231
- t || (e === null ? ct() : st(e)), n?.(e);
6232
- }, [st, ct]), J = o(() => lt(null), [lt]), [ut, dt] = m({}), ft = o((e, t) => {
6233
- dt((n) => ({
6259
+ let lt = q.open, J = q.close, ut = o((e) => {
6260
+ let { artifactHeld: t, onOpenArtifactChange: n } = ct.current;
6261
+ t || (e === null ? J() : lt(e)), n?.(e);
6262
+ }, [lt, J]), dt = o(() => ut(null), [ut]), [ft, pt] = m({}), mt = o((e, t) => {
6263
+ pt((n) => ({
6234
6264
  ...n,
6235
6265
  [e]: t
6236
6266
  }));
6237
- }, []), pt = Le.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? me, mt = o((e, t) => {
6238
- ie && t.trim().length > 0 && ge((n) => [...n, {
6267
+ }, []), vt = Re.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? me, yt = o((e, t) => {
6268
+ ae && t.trim().length > 0 && _e((n) => [...n, {
6239
6269
  turnId: e,
6240
6270
  text: t.trim()
6241
6271
  }]);
6242
- }, [ie]), gt = o((e, t) => lt(ot.current.openArtifactId === t ? null : t), [lt]), _t = o((e, t) => {
6272
+ }, [ae]), bt = o((e, t) => ut(ct.current.openArtifactId === t ? null : t), [ut]), xt = o((e, t) => {
6243
6273
  Ce({
6244
6274
  text: e,
6245
6275
  rect: t
6246
6276
  });
6247
- }, []), vt = f(() => ue ? (e, t, n, r) => ue(Ge, e, t, n, r) : void 0, [ue, Ge]), yt = f(() => de ? (e, t, n) => de(Ge, e, t, n) : void 0, [de, Ge]), bt = f(() => fe ? (e, t, n) => fe(Ge, e, t, n) : void 0, [fe, Ge]), [xt, St] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
6277
+ }, []), St = f(() => ue ? (e, t, n, r) => ue(Ke, e, t, n, r) : void 0, [ue, Ke]), Ct = f(() => de ? (e, t, n) => de(Ke, e, t, n) : void 0, [de, Ke]), wt = f(() => fe ? (e, t, n) => fe(Ke, e, t, n) : void 0, [fe, Ke]), [Tt, Et] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
6248
6278
  c(() => {
6249
6279
  if (!F) return;
6250
- let e = window.matchMedia("(pointer: fine)"), t = () => St(e.matches);
6280
+ let e = window.matchMedia("(pointer: fine)"), t = () => Et(e.matches);
6251
6281
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
6252
6282
  }, [F]);
6253
- let Ct = (e) => a === !0 || Array.isArray(a) && a.includes(e), wt = [
6254
- ...re && ie && he.length > 0 ? [{
6283
+ let Dt = (e) => a === !0 || Array.isArray(a) && a.includes(e), Ot = [
6284
+ ...ie && ae && he.length > 0 ? [{
6255
6285
  id: "bookmarks",
6256
- label: R.savedHighlights,
6286
+ label: z.savedHighlights,
6257
6287
  icon: /* @__PURE__ */ _(k, {
6258
6288
  size: 16,
6259
6289
  "aria-hidden": !0
@@ -6262,43 +6292,43 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6262
6292
  pinned: !0,
6263
6293
  onClick: () => xe(!0)
6264
6294
  }] : [],
6265
- ...Ct("theme") ? [{
6295
+ ...Dt("theme") ? [{
6266
6296
  id: "theme",
6267
- label: Ne === "dark" ? R.themeToLight : R.themeToDark,
6268
- icon: _(Ne === "dark" ? ye : le, {
6297
+ label: Ne === "dark" ? z.themeToLight : z.themeToDark,
6298
+ icon: _(Ne === "dark" ? ve : ce, {
6269
6299
  size: 16,
6270
6300
  "aria-hidden": !0
6271
6301
  }),
6272
6302
  active: Ne === "dark",
6273
6303
  onClick: () => Pe(Ne === "dark" ? "light" : "dark")
6274
6304
  }] : [],
6275
- ...Ct("share") ? [{
6305
+ ...Dt("share") ? [{
6276
6306
  id: "share",
6277
- label: R.share,
6278
- icon: /* @__PURE__ */ _(_e, {
6307
+ label: z.share,
6308
+ icon: /* @__PURE__ */ _(ge, {
6279
6309
  size: 16,
6280
6310
  "aria-hidden": !0
6281
6311
  }),
6282
6312
  onClick: () => navigator.share?.({
6283
- title: pt,
6313
+ title: vt,
6284
6314
  url: window.location.href
6285
6315
  })
6286
6316
  }] : [],
6287
- ...x ?? []
6288
- ], Tt = j === "inline" && q ? D?.(q) : null, Et = /* @__PURE__ */ v(C.div, {
6317
+ ...S ?? []
6318
+ ], Y = ee === "inline" && st ? O?.(st) : null, At = /* @__PURE__ */ v(C.div, {
6289
6319
  className: [
6290
6320
  $.page,
6291
- M === "panes" || !$e ? $.fitted : "",
6321
+ M === "panes" || !G ? $.fitted : "",
6292
6322
  "ick-chat-page",
6293
6323
  pe
6294
6324
  ].filter(Boolean).join(" "),
6295
- style: { "--ick-experience-anchor": `${ae}px` },
6296
- "data-composer": B ? "docked" : void 0,
6325
+ style: { "--ick-experience-anchor": `${oe}px` },
6326
+ "data-composer": Fe ? "docked" : void 0,
6297
6327
  initial: { opacity: 0 },
6298
6328
  animate: {
6299
- opacity: Se || ve ? .4 : 1,
6300
- filter: Se || ve ? "blur(3px)" : "blur(0px)",
6301
- scale: Se || ve ? .9 : 1
6329
+ opacity: Se || be ? .4 : 1,
6330
+ filter: Se || be ? "blur(3px)" : "blur(0px)",
6331
+ scale: Se || be ? .9 : 1
6302
6332
  },
6303
6333
  transition: {
6304
6334
  type: "spring",
@@ -6307,97 +6337,109 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6307
6337
  mass: .9
6308
6338
  },
6309
6339
  onAnimationComplete: () => {
6310
- document.activeElement && document.activeElement !== document.body || z.current?.focus();
6340
+ document.activeElement && document.activeElement !== document.body || Te.current?.focus();
6311
6341
  },
6312
6342
  children: [
6313
6343
  /* @__PURE__ */ _("div", { className: $.topBlur }),
6314
6344
  /* @__PURE__ */ v(Lt, {
6315
6345
  className: `${$.header} ick-chat-header`,
6316
- title: pt,
6346
+ title: vt,
6317
6347
  backHref: h,
6318
6348
  backLabel: b,
6319
6349
  elevateOnScroll: !1,
6320
6350
  collapseActionsAt: 480,
6321
- actions: wt,
6322
- children: [T !== void 0 && /* @__PURE__ */ _(ei, {
6351
+ actions: Ot,
6352
+ children: [E !== void 0 && /* @__PURE__ */ _(ei, {
6323
6353
  className: $.context,
6324
- used: tt,
6325
- total: T
6326
- }), ne && re && /* @__PURE__ */ v("div", {
6354
+ used: rt,
6355
+ total: E
6356
+ }), re && ie && /* @__PURE__ */ v("div", {
6327
6357
  className: $.selectMode,
6328
6358
  role: "group",
6329
- "aria-label": R.selectionMode,
6359
+ "aria-label": z.selectionMode,
6330
6360
  children: [/* @__PURE__ */ _("button", {
6331
6361
  type: "button",
6332
6362
  "data-active": we === "marker",
6333
- onClick: () => Te("marker"),
6334
- "aria-label": R.marker,
6335
- title: R.marker,
6363
+ onClick: () => B("marker"),
6364
+ "aria-label": z.marker,
6365
+ title: z.marker,
6336
6366
  children: /* @__PURE__ */ _(I, { size: 16 })
6337
6367
  }), /* @__PURE__ */ _("button", {
6338
6368
  type: "button",
6339
6369
  "data-active": we === "precise",
6340
- onClick: () => Te("precise"),
6341
- "aria-label": R.precise,
6342
- title: R.precise,
6343
- children: /* @__PURE__ */ _(be, { size: 16 })
6370
+ onClick: () => B("precise"),
6371
+ "aria-label": z.precise,
6372
+ title: z.precise,
6373
+ children: /* @__PURE__ */ _(ye, { size: 16 })
6344
6374
  })]
6345
6375
  })]
6346
6376
  }),
6347
6377
  /* @__PURE__ */ v(Ti, {
6348
6378
  viewportClassName: `${$.feed} ick-chat-feed`,
6349
- anchorId: U ? `turn-${U}` : void 0,
6350
- dock: B,
6351
- anchorOffset: ae,
6352
- endOffset: B ? 0 : oe,
6379
+ anchorId: Qe ? `turn-${Qe}` : void 0,
6380
+ dock: Fe,
6381
+ anchorOffset: oe,
6382
+ endOffset: Fe ? 0 : L,
6353
6383
  children: [
6354
- et && w && /* @__PURE__ */ _(Di, {
6355
- className: B ? `${$.opening} ${$.centred}` : $.opening,
6356
- title: w.title,
6357
- description: w.description,
6358
- suggestions: w.suggestions,
6359
- onSuggestion: (e) => Ye(Le[0].id, e)
6384
+ /* @__PURE__ */ _(x, {
6385
+ reducedMotion: "user",
6386
+ children: /* @__PURE__ */ _(y, {
6387
+ mode: "popLayout",
6388
+ children: tt && T && /* @__PURE__ */ _(C.div, {
6389
+ className: Fe ? `${$.opening} ${$.centred}` : $.opening,
6390
+ layout: "position",
6391
+ transition: { layout: nt },
6392
+ exit: "leave",
6393
+ children: /* @__PURE__ */ _(ki, {
6394
+ className: $.openingBlock,
6395
+ title: T.title,
6396
+ description: T.description,
6397
+ suggestions: T.suggestions,
6398
+ onSuggestion: (e) => Xe(Re[0].id, e)
6399
+ })
6400
+ }, "opening")
6401
+ })
6360
6402
  }),
6361
- /* @__PURE__ */ _(y, { children: Le.map((e, t) => {
6362
- let r = t === Le.length - 1 && (e.state === "idle" || e.state === "typing");
6403
+ /* @__PURE__ */ _(y, { children: Re.map((e, t) => {
6404
+ let r = t === Re.length - 1 && (e.state === "idle" || e.state === "typing");
6363
6405
  return /* @__PURE__ */ _(Yr, {
6364
6406
  turn: e,
6365
- questionAlign: B && r || et && t === 0 ? "stretch" : "end",
6366
- className: B && r ? $.dock : et && t === 0 ? $.opening : void 0,
6407
+ questionAlign: Fe && r || tt && t === 0 ? "stretch" : "end",
6408
+ className: Fe && r ? $.dock : tt && t === 0 ? $.opening : void 0,
6367
6409
  onTranscribe: l,
6368
6410
  isActiveInput: r,
6369
- inputRef: r ? z : null,
6370
- entranceDelay: t === 0 ? ce : 0,
6371
- entrance: B && r ? "fade" : "rise",
6372
- answerAfterTravel: B,
6411
+ inputRef: r ? Te : null,
6412
+ entranceDelay: t === 0 ? le : 0,
6413
+ entrance: Fe && r ? "fade" : "rise",
6414
+ answerAfterTravel: !0,
6373
6415
  selectionMode: we,
6374
- highlights: re,
6375
- animationConfig: Fe,
6416
+ highlights: ie,
6417
+ animationConfig: Ie,
6376
6418
  foldMotion: se,
6377
- openArtifactId: q,
6378
- onOpenArtifact: gt,
6379
- onArtifactChange: lt,
6380
- placeholder: S,
6381
- onDraft: Re,
6382
- onSubmit: Ye,
6383
- onRegenerate: G,
6384
- onShowVersion: ze,
6385
- onFeedback: ft,
6386
- feedback: ut[e.id] ?? null,
6387
- onStop: !B || r ? Be : void 0,
6388
- busy: B && r ? Ke : void 0,
6389
- onEdit: Ve,
6390
- onCancelEdit: We,
6391
- onHighlight: mt,
6392
- onReplyInThread: u ? _t : void 0,
6393
- onAnswerQuestion: vt,
6394
- onEditQuestion: yt,
6395
- onDecideApproval: bt,
6419
+ openArtifactId: st,
6420
+ onOpenArtifact: bt,
6421
+ onArtifactChange: ut,
6422
+ placeholder: w,
6423
+ onDraft: V,
6424
+ onSubmit: Xe,
6425
+ onRegenerate: et,
6426
+ onShowVersion: Be,
6427
+ onFeedback: mt,
6428
+ feedback: ft[e.id] ?? null,
6429
+ onStop: !Fe || r ? Ve : void 0,
6430
+ busy: Fe && r ? qe : void 0,
6431
+ onEdit: We,
6432
+ onCancelEdit: Ge,
6433
+ onHighlight: yt,
6434
+ onReplyInThread: u ? xt : void 0,
6435
+ onAnswerQuestion: St,
6436
+ onEditQuestion: Ct,
6437
+ onDecideApproval: wt,
6396
6438
  renderPart: n,
6397
6439
  composerMenu: s
6398
6440
  }, e.id);
6399
6441
  }) }),
6400
- nt && /* @__PURE__ */ _($n, { children: R.windowFull })
6442
+ it && /* @__PURE__ */ _($n, { children: z.windowFull })
6401
6443
  ]
6402
6444
  }),
6403
6445
  /* @__PURE__ */ _("div", { className: $.bottomBlur })
@@ -6405,28 +6447,28 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6405
6447
  });
6406
6448
  return /* @__PURE__ */ _(He, {
6407
6449
  labels: r,
6408
- children: /* @__PURE__ */ v(Ae, {
6450
+ children: /* @__PURE__ */ v(ke, {
6409
6451
  components: i,
6410
6452
  children: [
6411
- F && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), xt && /* @__PURE__ */ _(Li, {})] }),
6453
+ F && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), Tt && /* @__PURE__ */ _(zi, {})] }),
6412
6454
  /* @__PURE__ */ _(fi, {
6413
6455
  className: $.workspace,
6414
6456
  surface: M,
6415
- "data-fill": $e ? void 0 : "container",
6416
- style: $e && Qe > 0 ? { "--ick-keyboard": `${Qe}px` } : void 0,
6417
- onDismiss: J,
6418
- pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => Tt ? /* @__PURE__ */ _(ni, {
6419
- title: Tt.title,
6420
- meta: Tt.meta,
6457
+ "data-fill": G ? void 0 : "container",
6458
+ style: G && W > 0 ? { "--ick-keyboard": `${W}px` } : void 0,
6459
+ onDismiss: dt,
6460
+ pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => Y ? /* @__PURE__ */ _(ni, {
6461
+ title: Y.title,
6462
+ meta: Y.meta,
6421
6463
  modal: e,
6422
6464
  expanded: t,
6423
6465
  onToggleExpanded: n,
6424
- onClose: J,
6425
- children: Tt.children
6466
+ onClose: dt,
6467
+ children: Y.children
6426
6468
  }) : null,
6427
- children: Et
6469
+ children: At
6428
6470
  }),
6429
- /* @__PURE__ */ _(y, { children: ve && /* @__PURE__ */ _(C.div, {
6471
+ /* @__PURE__ */ _(y, { children: be && /* @__PURE__ */ _(C.div, {
6430
6472
  className: $.scrim,
6431
6473
  initial: { opacity: 0 },
6432
6474
  animate: { opacity: 1 },
@@ -6435,7 +6477,7 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6435
6477
  children: /* @__PURE__ */ v(C.div, {
6436
6478
  className: $.sheet,
6437
6479
  role: "dialog",
6438
- "aria-label": R.savedHighlights,
6480
+ "aria-label": z.savedHighlights,
6439
6481
  initial: {
6440
6482
  y: 20,
6441
6483
  scale: .95
@@ -6453,17 +6495,17 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6453
6495
  className: $.sheetHead,
6454
6496
  children: [/* @__PURE__ */ _("h2", {
6455
6497
  className: $.sheetTitle,
6456
- children: R.highlights
6498
+ children: z.highlights
6457
6499
  }), /* @__PURE__ */ _("button", {
6458
6500
  className: $.close,
6459
6501
  onClick: () => xe(!1),
6460
- children: R.close
6502
+ children: z.close
6461
6503
  })]
6462
6504
  }), Array.from(new Set(he.map((e) => e.turnId))).map((e, t) => /* @__PURE__ */ v("div", {
6463
6505
  className: $.group,
6464
6506
  children: [/* @__PURE__ */ _("h3", {
6465
6507
  className: $.groupTitle,
6466
- children: Ue(R.paragraph, { index: t + 1 })
6508
+ children: Ue(z.paragraph, { index: t + 1 })
6467
6509
  }), /* @__PURE__ */ _("div", {
6468
6510
  className: $.marks,
6469
6511
  children: he.filter((t) => t.turnId === e).map((t, n) => /* @__PURE__ */ _("button", {
@@ -6490,7 +6532,7 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6490
6532
  }, e))]
6491
6533
  })
6492
6534
  }) }),
6493
- /* @__PURE__ */ _(y, { children: Se && u && /* @__PURE__ */ _(Ii, {
6535
+ /* @__PURE__ */ _(y, { children: Se && u && /* @__PURE__ */ _(Ri, {
6494
6536
  activeReply: Se,
6495
6537
  onClose: () => Ce(null),
6496
6538
  onSendMessage: u
@@ -6500,6 +6542,6 @@ function Vi({ onSend: e, chat: t, renderPart: n, labels: r, components: i, heade
6500
6542
  });
6501
6543
  }
6502
6544
  //#endregion
6503
- export { Be as $, En as A, jt as B, In as C, Mn as D, Pn as E, tn as F, ut as G, bt as H, Kt as I, Qe as J, K, Wt as L, gn as M, cn as N, An as O, pn as P, He as Q, Ht as R, Ln as S, zn as T, yt as U, kt as V, ht as W, Je as X, Ze as Y, We as Z, Zn as _, Di as a, Gn as b, fi as c, Yr as d, Ae as et, Gr as f, Yn as g, $n as h, Ii as i, Sn as j, On as k, ni as l, rr as m, Ri as n, Ti as o, Fr as p, $e as q, Li as r, pi as s, Vi as t, Oe as tt, ei as u, Xn as v, Rn as w, Fn as x, qn as y, Lt as z };
6545
+ export { Be as $, En as A, jt as B, In as C, Mn as D, Pn as E, tn as F, ut as G, bt as H, Kt as I, Qe as J, K, Wt as L, gn as M, cn as N, An as O, pn as P, He as Q, Ht as R, Ln as S, zn as T, yt as U, kt as V, ht as W, Je as X, Ze as Y, We as Z, Zn as _, ki as a, Gn as b, fi as c, Yr as d, ke as et, Gr as f, Yn as g, $n as h, Ri as i, Sn as j, On as k, ni as l, rr as m, Bi as n, Ti as o, Fr as p, $e as q, zi as r, pi as s, Ui as t, De as tt, ei as u, Xn as v, Rn as w, Fn as x, qn as y, Lt as z };
6504
6546
 
6505
- //# sourceMappingURL=ChatExperience-BQgjY0-K.js.map
6547
+ //# sourceMappingURL=ChatExperience-UJ4TfKnR.js.map