@pstdio/ui 0.43.0 → 0.43.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.
Files changed (74) hide show
  1. package/README.md +11 -0
  2. package/dist/{MermaidComponent-X7N-8w2S.js → MermaidComponent-_cmVeKKR.js} +3 -3
  3. package/dist/{MermaidComponent-X7N-8w2S.js.map → MermaidComponent-_cmVeKKR.js.map} +1 -1
  4. package/dist/chat-ui.d.ts +85 -57
  5. package/dist/chat-ui.js +1168 -1183
  6. package/dist/chat-ui.js.map +1 -1
  7. package/dist/{collection-view-fields-CajuwtKF.d.ts → collection-view-fields-B3fhsgn7.d.ts} +2 -0
  8. package/dist/{collection-view-grouping-DnuJ1U4R.js → collection-view-grouping-jIqOrBG8.js} +2 -2
  9. package/dist/{collection-view-grouping-DnuJ1U4R.js.map → collection-view-grouping-jIqOrBG8.js.map} +1 -1
  10. package/dist/{collection-view-search-D_7Qvz7p.js → collection-view-search-KbQpKHdn.js} +767 -630
  11. package/dist/collection-view-search-KbQpKHdn.js.map +1 -0
  12. package/dist/collection-view.d.ts +1 -1
  13. package/dist/collection-view.js +2 -2
  14. package/dist/{data-table-stats-row-C8CtvdDt.js → data-table-stats-row-83mX8b1B.js} +2 -2
  15. package/dist/{data-table-stats-row-C8CtvdDt.js.map → data-table-stats-row-83mX8b1B.js.map} +1 -1
  16. package/dist/data-table.d.ts +2 -2
  17. package/dist/data-table.js +8 -8
  18. package/dist/{diff-drawer-BGQhxyOh.js → diff-drawer-BMl0zobj.js} +2 -2
  19. package/dist/{diff-drawer-BGQhxyOh.js.map → diff-drawer-BMl0zobj.js.map} +1 -1
  20. package/dist/{diff-viewer-DYcswG6O.js → diff-viewer-C5KXwq7E.js} +5 -5
  21. package/dist/{diff-viewer-DYcswG6O.js.map → diff-viewer-C5KXwq7E.js.map} +1 -1
  22. package/dist/diff.js +2 -2
  23. package/dist/{display-sort-control-n3L5WvkJ.js → display-sort-control-BCkgKET1.js} +194 -183
  24. package/dist/display-sort-control-BCkgKET1.js.map +1 -0
  25. package/dist/{edit-mode-data-table-BclZ-pWe.js → edit-mode-data-table-ScVJJT9F.js} +8 -8
  26. package/dist/{edit-mode-data-table-BclZ-pWe.js.map → edit-mode-data-table-ScVJJT9F.js.map} +1 -1
  27. package/dist/{index-5Lw7YMKy.d.ts → index-Bc2BsdD1.d.ts} +6 -0
  28. package/dist/{index-DjZsR4Ey.d.ts → index-DXpADqIg.d.ts} +8 -4
  29. package/dist/index.d.ts +49 -49
  30. package/dist/index.js +453 -455
  31. package/dist/index.js.map +1 -1
  32. package/dist/kanban-renderer.d.ts +3 -3
  33. package/dist/kanban-renderer.js +935 -745
  34. package/dist/kanban-renderer.js.map +1 -1
  35. package/dist/{list-row-CmFG_jCC.js → list-row-F8kBQGB-.js} +394 -384
  36. package/dist/list-row-F8kBQGB-.js.map +1 -0
  37. package/dist/{markdown-editor-CN4qOKky.js → markdown-editor-Dm4Fi3sX.js} +6 -6
  38. package/dist/{markdown-editor-CN4qOKky.js.map → markdown-editor-Dm4Fi3sX.js.map} +1 -1
  39. package/dist/{mermaid-renderer-DybQ_2Cp.js → mermaid-renderer-BtW_13Sz.js} +2 -2
  40. package/dist/{mermaid-renderer-DybQ_2Cp.js.map → mermaid-renderer-BtW_13Sz.js.map} +1 -1
  41. package/dist/mermaid.js +1 -1
  42. package/dist/{number-input-CyrMrDxB.js → number-input-QDqWYzTR.js} +2 -2
  43. package/dist/{number-input-CyrMrDxB.js.map → number-input-QDqWYzTR.js.map} +1 -1
  44. package/dist/{param-editor-28dBRSV4.js → param-editor-B9ASM5Lv.js} +2 -2
  45. package/dist/{param-editor-28dBRSV4.js.map → param-editor-B9ASM5Lv.js.map} +1 -1
  46. package/dist/{param-editor-field-GxhFb86w.js → param-editor-field-BmNUziwI.js} +7 -5
  47. package/dist/param-editor-field-BmNUziwI.js.map +1 -0
  48. package/dist/param-editor.js +3 -3
  49. package/dist/{prism-CnkSh-ZG.js → prism-EZSmZh-a.js} +2 -2
  50. package/dist/{prism-CnkSh-ZG.js.map → prism-EZSmZh-a.js.map} +1 -1
  51. package/dist/{rich-text-DOK4dDeb.js → rich-text-Dx5F8Zm1.js} +384 -363
  52. package/dist/rich-text-Dx5F8Zm1.js.map +1 -0
  53. package/dist/rich-text.d.ts +1 -1
  54. package/dist/rich-text.js +3 -3
  55. package/dist/{scroll-area-crJfiiuF.js → scroll-area-IeoRS73V.js} +3 -5
  56. package/dist/scroll-area-IeoRS73V.js.map +1 -0
  57. package/dist/terminal.js +1 -1
  58. package/dist/{theme-Bd_a7sU8.js → theme-CWDvF5Yn.js} +185 -73
  59. package/dist/theme-CWDvF5Yn.js.map +1 -0
  60. package/dist/theme.js +1 -1
  61. package/dist/{tree-list-B_qqiIoM.js → tree-list-Ces1hpRd.js} +2 -2
  62. package/dist/{tree-list-B_qqiIoM.js.map → tree-list-Ces1hpRd.js.map} +1 -1
  63. package/dist/{workspace-badge-oFp29Gbe.d.ts → workspace-badge-De6OQjb5.d.ts} +2 -1
  64. package/dist/{workspace-badge-BfSkiGP_.js → workspace-badge-DqQKSUJw.js} +12 -12
  65. package/dist/workspace-badge-DqQKSUJw.js.map +1 -0
  66. package/package.json +2 -2
  67. package/dist/collection-view-search-D_7Qvz7p.js.map +0 -1
  68. package/dist/display-sort-control-n3L5WvkJ.js.map +0 -1
  69. package/dist/list-row-CmFG_jCC.js.map +0 -1
  70. package/dist/param-editor-field-GxhFb86w.js.map +0 -1
  71. package/dist/rich-text-DOK4dDeb.js.map +0 -1
  72. package/dist/scroll-area-crJfiiuF.js.map +0 -1
  73. package/dist/theme-Bd_a7sU8.js.map +0 -1
  74. package/dist/workspace-badge-BfSkiGP_.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import { t as e } from "./alert-MQ47wy7f.js";
2
- import { n as t, t as n } from "./scroll-area-crJfiiuF.js";
3
- import { a as r, t as i } from "./list-row-CmFG_jCC.js";
2
+ import { n as t, t as n } from "./scroll-area-IeoRS73V.js";
3
+ import { a as r, t as i } from "./list-row-F8kBQGB-.js";
4
4
  import { t as a } from "./use-virtualizer-CfDHoDer.js";
5
- import { i as o } from "./prism-CnkSh-ZG.js";
5
+ import { i as o } from "./prism-EZSmZh-a.js";
6
6
  import { t as s } from "./drop-indicator-HjlBSIeV.js";
7
7
  import { t as c } from "./empty-state-3mVV_pV-.js";
8
8
  import { t as l } from "./icon-options-Tt6Wzhtv.js";
9
9
  import { n as u, t as d } from "./radio-CiFrDN6O.js";
10
10
  import { n as f, t as p } from "./queued-follow-up-Bj_vtMgd.js";
11
- import { A as m, C as h, E as g, M as _, S as v, T as y, j as b, k as x, w as S } from "./markdown-editor-CN4qOKky.js";
12
- import { c as C, l as w, o as T, s as E } from "./rich-text-DOK4dDeb.js";
11
+ import { A as m, C as h, E as g, M as _, S as v, T as y, j as b, k as x, w as S } from "./markdown-editor-Dm4Fi3sX.js";
12
+ import { c as C, l as w, o as T, s as E } from "./rich-text-Dx5F8Zm1.js";
13
13
  import { t as D } from "./diff-bubble-DewUd_2w.js";
14
- import { AbsoluteCenter as O, Avatar as k, Box as A, Button as j, Card as M, Code as N, Field as P, Flex as F, HStack as I, Icon as L, IconButton as R, Image as z, Input as B, Kbd as V, Link as H, Menu as U, Popover as ee, Portal as te, Skeleton as ne, Span as re, Spinner as W, Stack as G, Tag as ie, Text as K, Textarea as ae, Timeline as oe, Tooltip as q, chakra as se, createSlotRecipeContext as ce, defineSlotRecipe as le, useRecipe as ue, useSlotRecipe as de } from "@chakra-ui/react";
15
- import { c as J } from "react/compiler-runtime";
16
- import { Fragment as fe, jsx as Y, jsxs as X } from "react/jsx-runtime";
17
- import { Fragment as pe, Suspense as me, createContext as he, lazy as ge, useContext as _e, useEffect as Z, useLayoutEffect as ve, useRef as ye, useState as Q } from "react";
14
+ import { AbsoluteCenter as O, Avatar as k, Box as A, Button as j, Card as M, Code as N, Field as P, Flex as F, HStack as I, Icon as L, IconButton as ee, Image as R, Input as z, Kbd as B, Link as te, Menu as V, Popover as ne, Portal as re, Skeleton as ie, Span as H, Spinner as U, Stack as W, Tag as ae, Text as G, Textarea as oe, Timeline as se, Tooltip as ce, chakra as K, createSlotRecipeContext as le, defineSlotRecipe as ue, useRecipe as de, useSlotRecipe as fe } from "@chakra-ui/react";
15
+ import { c as q } from "react/compiler-runtime";
16
+ import { Fragment as pe, jsx as J, jsxs as Y } from "react/jsx-runtime";
17
+ import { Fragment as me, Suspense as he, createContext as ge, lazy as _e, useContext as ve, useEffect as X, useLayoutEffect as ye, useRef as Z, useState as Q } from "react";
18
18
  import { AlertTriangle as be, ArrowDownIcon as xe, ArrowRight as Se, ArrowUp as Ce, Check as we, ChevronUpIcon as Te, CircleQuestionMark as Ee, Copy as De, DotIcon as Oe, File as ke, FileDiff as Ae, FileDown as je, FilePen as Me, FileText as Ne, FileUp as Pe, Globe as Fe, GripVertical as Ie, ListTodo as Le, ListTree as Re, MessageCircleIcon as ze, Move as Be, Pause as Ve, Search as He, ShieldCheck as Ue, ShieldX as We, Terminal as Ge, Trash2 as Ke } from "lucide-react";
19
19
  import { DndContext as qe, KeyboardSensor as Je, PointerSensor as Ye, pointerWithin as Xe, rectIntersection as Ze, useDraggable as Qe, useDroppable as $e, useSensor as et, useSensors as tt } from "@dnd-kit/core";
20
20
  import { StickToBottom as nt, useStickToBottomContext as rt } from "use-stick-to-bottom";
21
- var it = se(nt, { base: {
21
+ var it = K(nt, { base: {
22
22
  position: "relative",
23
23
  flex: 1,
24
24
  overflow: "hidden",
@@ -32,16 +32,17 @@ var it = se(nt, { base: {
32
32
  role: "log"
33
33
  }
34
34
  }), at = (e) => {
35
- let t = J(10), r, i;
35
+ let t = q(10), r, i;
36
36
  t[0] === e ? (r = t[1], i = t[2]) : ({children: r, ...i} = e, t[0] = e, t[1] = r, t[2] = i);
37
37
  let { contentRef: a, scrollRef: o } = rt(), s = o, c = a, l, u;
38
38
  t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = { zIndex: 2 }, u = {
39
+ layerStyle: "chatContent",
39
40
  py: "sm",
40
41
  "aria-live": "polite",
41
42
  role: "list"
42
43
  }, t[3] = l, t[4] = u) : (l = t[3], u = t[4]);
43
44
  let d;
44
- return t[5] !== r || t[6] !== i || t[7] !== s || t[8] !== c ? (d = /* @__PURE__ */ Y(n, {
45
+ return t[5] !== r || t[6] !== i || t[7] !== s || t[8] !== c ? (d = /* @__PURE__ */ J(n, {
45
46
  ...i,
46
47
  height: "full",
47
48
  width: "full",
@@ -60,20 +61,20 @@ var it = se(nt, { base: {
60
61
  Root: it,
61
62
  Viewport: at,
62
63
  ScrollToBottom: (e) => {
63
- let t = J(4), { isAtBottom: n, scrollToBottom: r } = rt(), i;
64
- return t[0] !== n || t[1] !== e || t[2] !== r ? (i = !n && /* @__PURE__ */ Y(O, {
64
+ let t = q(4), { isAtBottom: n, scrollToBottom: r } = rt(), i;
65
+ return t[0] !== n || t[1] !== e || t[2] !== r ? (i = !n && /* @__PURE__ */ J(O, {
65
66
  ...ot,
66
- children: /* @__PURE__ */ Y(R, {
67
+ children: /* @__PURE__ */ J(ee, {
67
68
  rounded: "full",
68
69
  onClick: () => r(),
69
70
  variant: "outline",
70
71
  size: "xs",
71
72
  ...e,
72
- children: /* @__PURE__ */ Y(xe, { size: 16 })
73
+ children: /* @__PURE__ */ J(xe, { size: 16 })
73
74
  })
74
75
  }), t[0] = n, t[1] = e, t[2] = r, t[3] = i) : i = t[3], i;
75
76
  }
76
- }, ct = le({
77
+ }, ct = ue({
77
78
  className: "ai-message",
78
79
  slots: ["root", "content"],
79
80
  base: {
@@ -102,12 +103,8 @@ var it = se(nt, { base: {
102
103
  flexDirection: "row"
103
104
  },
104
105
  content: {
105
- borderTopWidth: "1px",
106
- borderRightWidth: "1px",
107
- borderBottomWidth: "1px",
108
- borderLeftWidth: "1px",
109
- borderColor: "border.subtle",
110
- bg: "bg.subtle",
106
+ "--chat-message-bg": "{colors.bg.subtle}",
107
+ bg: "var(--chat-message-bg)",
111
108
  px: "xs",
112
109
  py: "xs",
113
110
  width: "full",
@@ -160,7 +157,7 @@ var it = se(nt, { base: {
160
157
  shape: "rounded",
161
158
  delivery: "sent"
162
159
  }
163
- }), { withProvider: lt, withContext: ut } = ce({ recipe: ct }), dt = {
160
+ }), { withProvider: lt, withContext: ut } = le({ recipe: ct }), dt = {
164
161
  Root: lt("div", "root"),
165
162
  Content: ut("div", "content")
166
163
  }, ft = (e) => {
@@ -168,15 +165,15 @@ var it = se(nt, { base: {
168
165
  let t = typeof e == "string" ? e : JSON.stringify(e, null, 2);
169
166
  return t.length === 0 ? null : t.length > 200 ? `${t.slice(0, 200)}...` : t;
170
167
  }, pt = (e) => {
171
- let t = J(19), { toolName: r, toolInput: i, onApprove: a, onDeny: o } = e, s;
168
+ let t = q(19), { toolName: r, toolInput: i, onApprove: a, onDeny: o } = e, s;
172
169
  t[0] === i ? s = t[1] : (s = ft(i), t[0] = i, t[1] = s);
173
170
  let c = s, l;
174
- t[2] === r ? l = t[3] : (l = /* @__PURE__ */ X(K, {
171
+ t[2] === r ? l = t[3] : (l = /* @__PURE__ */ Y(G, {
175
172
  textStyle: "label/S/medium",
176
173
  color: "fg",
177
174
  children: [
178
175
  "Allow ",
179
- /* @__PURE__ */ Y(N, {
176
+ /* @__PURE__ */ J(N, {
180
177
  size: "sm",
181
178
  children: r
182
179
  }),
@@ -184,9 +181,9 @@ var it = se(nt, { base: {
184
181
  ]
185
182
  }), t[2] = r, t[3] = l);
186
183
  let u;
187
- t[4] === c ? u = t[5] : (u = c ? /* @__PURE__ */ Y(n, {
184
+ t[4] === c ? u = t[5] : (u = c ? /* @__PURE__ */ J(n, {
188
185
  maxH: "6rem",
189
- children: /* @__PURE__ */ Y(N, {
186
+ children: /* @__PURE__ */ J(N, {
190
187
  size: "sm",
191
188
  whiteSpace: "pre-wrap",
192
189
  display: "block",
@@ -195,31 +192,31 @@ var it = se(nt, { base: {
195
192
  })
196
193
  }) : null, t[4] = c, t[5] = u);
197
194
  let d;
198
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ Y(We, { size: 14 }), t[6] = d) : d = t[6];
195
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ J(We, { size: 14 }), t[6] = d) : d = t[6];
199
196
  let f;
200
- t[7] === o ? f = t[8] : (f = /* @__PURE__ */ X(j, {
197
+ t[7] === o ? f = t[8] : (f = /* @__PURE__ */ Y(j, {
201
198
  size: "xs",
202
199
  variant: "outline",
203
200
  onClick: o,
204
201
  children: [d, "Deny"]
205
202
  }), t[7] = o, t[8] = f);
206
203
  let p;
207
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ Y(Ue, { size: 14 }), t[9] = p) : p = t[9];
204
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ J(Ue, { size: 14 }), t[9] = p) : p = t[9];
208
205
  let m;
209
- t[10] === a ? m = t[11] : (m = /* @__PURE__ */ X(j, {
206
+ t[10] === a ? m = t[11] : (m = /* @__PURE__ */ Y(j, {
210
207
  size: "xs",
211
208
  colorPalette: "green",
212
209
  onClick: a,
213
210
  children: [p, "Allow"]
214
211
  }), t[10] = a, t[11] = m);
215
212
  let h;
216
- t[12] !== f || t[13] !== m ? (h = /* @__PURE__ */ X(I, {
213
+ t[12] !== f || t[13] !== m ? (h = /* @__PURE__ */ Y(I, {
217
214
  gap: "xs",
218
215
  justifyContent: "flex-end",
219
216
  children: [f, m]
220
217
  }), t[12] = f, t[13] = m, t[14] = h) : h = t[14];
221
218
  let g;
222
- return t[15] !== l || t[16] !== u || t[17] !== h ? (g = /* @__PURE__ */ Y(A, {
219
+ return t[15] !== l || t[16] !== u || t[17] !== h ? (g = /* @__PURE__ */ J(A, {
223
220
  px: "sm",
224
221
  py: "xs",
225
222
  mx: "sm",
@@ -227,7 +224,7 @@ var it = se(nt, { base: {
227
224
  borderColor: "border.warning",
228
225
  borderRadius: "lg",
229
226
  bg: "bg.warning",
230
- children: /* @__PURE__ */ X(F, {
227
+ children: /* @__PURE__ */ Y(F, {
231
228
  direction: "column",
232
229
  gap: "xs",
233
230
  children: [
@@ -238,7 +235,7 @@ var it = se(nt, { base: {
238
235
  })
239
236
  }), t[15] = l, t[16] = u, t[17] = h, t[18] = g) : g = t[18], g;
240
237
  }, mt = "md", ht = "neutral", gt = (e) => {
241
- let t = J(17), { attachments: n, onSelect: r, onRemove: i, renderBadge: a, size: s, tone: c } = e, l;
238
+ let t = q(17), { attachments: n, onSelect: r, onRemove: i, renderBadge: a, size: s, tone: c } = e, l;
242
239
  t[0] === n ? l = t[1] : (l = n === void 0 ? [] : n, t[0] = n, t[1] = l);
243
240
  let u = l, d = s === void 0 ? mt : s, f = c === void 0 ? ht : c;
244
241
  if (u.length === 0) return null;
@@ -255,9 +252,9 @@ var it = se(nt, { base: {
255
252
  size: d,
256
253
  tone: f
257
254
  });
258
- return /* @__PURE__ */ Y(pe, { children: r }, e);
255
+ return /* @__PURE__ */ J(me, { children: r }, e);
259
256
  }
260
- return /* @__PURE__ */ Y(o, {
257
+ return /* @__PURE__ */ J(o, {
261
258
  fileName: e,
262
259
  onSelect: t,
263
260
  onRemove: n,
@@ -267,7 +264,7 @@ var it = se(nt, { base: {
267
264
  }, t[9] = i, t[10] = r, t[11] = a, t[12] = d, t[13] = f, t[14] = e) : e = t[14], p = u.map(e), t[2] = u, t[3] = i, t[4] = r, t[5] = a, t[6] = d, t[7] = f, t[8] = p;
268
265
  } else p = t[8];
269
266
  let m;
270
- return t[15] === p ? m = t[16] : (m = /* @__PURE__ */ Y(G, {
267
+ return t[15] === p ? m = t[16] : (m = /* @__PURE__ */ J(W, {
271
268
  marginBottom: "sm",
272
269
  gap: "1",
273
270
  flexDir: "row",
@@ -300,12 +297,12 @@ var it = se(nt, { base: {
300
297
  return t.shouldScroll && e.scrollToBottom("instant"), t;
301
298
  };
302
299
  function bt(e) {
303
- let t = J(8), { conversationKey: n, userMessageCount: r } = e, { scrollToBottom: i } = rt(), a = n ?? null, o;
300
+ let t = q(8), { conversationKey: n, userMessageCount: r } = e, { scrollToBottom: i } = rt(), a = n ?? null, o;
304
301
  t[0] !== a || t[1] !== r ? (o = {
305
302
  conversationKey: a,
306
303
  userMessageCount: r
307
304
  }, t[0] = a, t[1] = r, t[2] = o) : o = t[2];
308
- let s = ye(o), c, l;
305
+ let s = Z(o), c, l;
309
306
  return t[3] !== n || t[4] !== i || t[5] !== r ? (c = () => {
310
307
  let e = yt({
311
308
  state: s.current,
@@ -318,7 +315,7 @@ function bt(e) {
318
315
  n,
319
316
  r,
320
317
  i
321
- ], t[3] = n, t[4] = i, t[5] = r, t[6] = c, t[7] = l) : (c = t[6], l = t[7]), Z(c, l), null;
318
+ ], t[3] = n, t[4] = i, t[5] = r, t[6] = c, t[7] = l) : (c = t[6], l = t[7]), X(c, l), null;
322
319
  }
323
320
  //#endregion
324
321
  //#region src/components/chat-ui/utils/editor-state.ts
@@ -349,19 +346,19 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
349
346
  }
350
347
  };
351
348
  }, Dt = (e) => {
352
- let t = J(22), n, r, i, a;
349
+ let t = q(22), n, r, i, a;
353
350
  t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({title: a, shortcut: i, canInterrupt: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
354
351
  let o = r["aria-label"] ?? a, s;
355
- t[5] === n ? s = t[6] : (s = n ? /* @__PURE__ */ Y(Ve, {
352
+ t[5] === n ? s = t[6] : (s = n ? /* @__PURE__ */ J(Ve, {
356
353
  size: 16,
357
354
  strokeWidth: 2,
358
355
  fill: "currentColor"
359
- }) : /* @__PURE__ */ Y(Ce, {
356
+ }) : /* @__PURE__ */ J(Ce, {
360
357
  size: 16,
361
358
  strokeWidth: 2
362
359
  }), t[5] = n, t[6] = s);
363
360
  let c = s, l;
364
- t[7] !== o || t[8] !== c || t[9] !== r || t[10] !== a ? (l = /* @__PURE__ */ Y(R, {
361
+ t[7] !== o || t[8] !== c || t[9] !== r || t[10] !== a ? (l = /* @__PURE__ */ J(ee, {
365
362
  "data-testid": "send-message-button",
366
363
  size: "xs",
367
364
  variant: "primary",
@@ -373,23 +370,23 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
373
370
  let u = l;
374
371
  if (a) {
375
372
  let e;
376
- t[12] !== i || t[13] !== a ? (e = i ? /* @__PURE__ */ X(fe, { children: [
373
+ t[12] !== i || t[13] !== a ? (e = i ? /* @__PURE__ */ Y(pe, { children: [
377
374
  a,
378
375
  " ",
379
- /* @__PURE__ */ Y(V, {
376
+ /* @__PURE__ */ J(B, {
380
377
  fontSize: "xs",
381
378
  children: i
382
379
  })
383
380
  ] }) : a, t[12] = i, t[13] = a, t[14] = e) : e = t[14];
384
381
  let n = e, r;
385
- t[15] === u ? r = t[16] : (r = /* @__PURE__ */ Y(q.Trigger, {
382
+ t[15] === u ? r = t[16] : (r = /* @__PURE__ */ J(ce.Trigger, {
386
383
  asChild: !0,
387
384
  children: u
388
385
  }), t[15] = u, t[16] = r);
389
386
  let o;
390
- t[17] === n ? o = t[18] : (o = /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(q.Positioner, { children: /* @__PURE__ */ Y(q.Content, { children: n }) }) }), t[17] = n, t[18] = o);
387
+ t[17] === n ? o = t[18] : (o = /* @__PURE__ */ J(re, { children: /* @__PURE__ */ J(ce.Positioner, { children: /* @__PURE__ */ J(ce.Content, { children: n }) }) }), t[17] = n, t[18] = o);
391
388
  let s;
392
- return t[19] !== r || t[20] !== o ? (s = /* @__PURE__ */ X(q.Root, {
389
+ return t[19] !== r || t[20] !== o ? (s = /* @__PURE__ */ Y(ce.Root, {
393
390
  closeDelay: 50,
394
391
  openDelay: 100,
395
392
  children: [r, o]
@@ -397,13 +394,13 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
397
394
  }
398
395
  return u;
399
396
  }, Ot = (e) => {
400
- let t = J(18), { actions: r, submitActions: i, questionPrompt: a, skipDisabled: o, skipTitle: s, onSkip: c, buttonAction: l, submitTitle: u, submitLabel: d, messageTitle: f, runAction: p } = e, m;
401
- t[0] === r ? m = t[1] : (m = /* @__PURE__ */ Y(n, {
397
+ let t = q(18), { actions: r, submitActions: i, questionPrompt: a, skipDisabled: o, skipTitle: s, onSkip: c, buttonAction: l, submitTitle: u, submitLabel: d, messageTitle: f, runAction: p } = e, m;
398
+ t[0] === r ? m = t[1] : (m = /* @__PURE__ */ J(n, {
402
399
  flex: "1",
403
400
  minW: "0",
404
401
  showVerticalScrollbar: !1,
405
402
  showHorizontalScrollbar: !0,
406
- children: /* @__PURE__ */ Y(I, {
403
+ children: /* @__PURE__ */ J(I, {
407
404
  gap: "1",
408
405
  width: "max-content",
409
406
  minH: "7",
@@ -411,7 +408,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
411
408
  })
412
409
  }), t[0] = r, t[1] = m);
413
410
  let h;
414
- t[2] !== c || t[3] !== a || t[4] !== o || t[5] !== s ? (h = a ? /* @__PURE__ */ Y(j, {
411
+ t[2] !== c || t[3] !== a || t[4] !== o || t[5] !== s ? (h = a ? /* @__PURE__ */ J(j, {
415
412
  size: "xs",
416
413
  variant: "ghost",
417
414
  disabled: o,
@@ -420,13 +417,13 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
420
417
  children: "Skip"
421
418
  }) : null, t[2] = c, t[3] = a, t[4] = o, t[5] = s, t[6] = h) : h = t[6];
422
419
  let g;
423
- t[7] !== l || t[8] !== f || t[9] !== p || t[10] !== d || t[11] !== u ? (g = d ? /* @__PURE__ */ Y(j, {
420
+ t[7] !== l || t[8] !== f || t[9] !== p || t[10] !== d || t[11] !== u ? (g = d ? /* @__PURE__ */ J(j, {
424
421
  size: "xs",
425
422
  variant: "primary",
426
423
  disabled: l === "none",
427
424
  onClick: () => p(l),
428
425
  children: d
429
- }) : /* @__PURE__ */ Y(Dt, {
426
+ }) : /* @__PURE__ */ J(Dt, {
430
427
  canInterrupt: l === "interrupt",
431
428
  title: l === "interrupt" ? "Stop Response" : u ?? f,
432
429
  shortcut: l === "submit" ? "Enter" : void 0,
@@ -434,7 +431,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
434
431
  disabled: l === "none"
435
432
  }), t[7] = l, t[8] = f, t[9] = p, t[10] = d, t[11] = u, t[12] = g) : g = t[12];
436
433
  let _;
437
- return t[13] !== i || t[14] !== m || t[15] !== h || t[16] !== g ? (_ = /* @__PURE__ */ X(I, {
434
+ return t[13] !== i || t[14] !== m || t[15] !== h || t[16] !== g ? (_ = /* @__PURE__ */ Y(I, {
438
435
  gap: "1",
439
436
  minH: "7",
440
437
  align: "center",
@@ -509,14 +506,14 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
509
506
  }
510
507
  return !1;
511
508
  }, Zt = (e, t, n, r) => Wt(e, Pt(e, t), n, r).length > 0, Qt = (e) => {
512
- let n = J(22), { question: r, questionIndex: i, isActive: a, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: c } = e, l;
509
+ let n = q(22), { question: r, questionIndex: i, isActive: a, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: c } = e, l;
513
510
  n[0] !== s || n[1] !== r || n[2] !== i || n[3] !== o ? (l = Zt(r, i, o, s), n[0] = s, n[1] = r, n[2] = i, n[3] = o, n[4] = l) : l = n[4];
514
511
  let u = l, d = u ? "answered" : "not answered", f = a ? "outline" : "ghost", p = `question-step-tab-${r.id}`, m = `${r.question} (${d})`, h = `question-step-panel-${r.id}`, g;
515
512
  n[5] !== c || n[6] !== i ? (g = () => c(i), n[5] = c, n[6] = i, n[7] = g) : g = n[7];
516
513
  let _;
517
- n[8] !== u || n[9] !== i ? (_ = u ? /* @__PURE__ */ Y(we, { "aria-hidden": "true" }) : i + 1, n[8] = u, n[9] = i, n[10] = _) : _ = n[10];
514
+ n[8] !== u || n[9] !== i ? (_ = u ? /* @__PURE__ */ J(we, { "aria-hidden": "true" }) : i + 1, n[8] = u, n[9] = i, n[10] = _) : _ = n[10];
518
515
  let v;
519
- n[11] !== a || n[12] !== p || n[13] !== m || n[14] !== h || n[15] !== g || n[16] !== _ || n[17] !== f ? (v = /* @__PURE__ */ Y(j, {
516
+ n[11] !== a || n[12] !== p || n[13] !== m || n[14] !== h || n[15] !== g || n[16] !== _ || n[17] !== f ? (v = /* @__PURE__ */ J(j, {
520
517
  id: p,
521
518
  role: "tab",
522
519
  "aria-label": m,
@@ -529,7 +526,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
529
526
  children: _
530
527
  }), n[11] = a, n[12] = p, n[13] = m, n[14] = h, n[15] = g, n[16] = _, n[17] = f, n[18] = v) : v = n[18];
531
528
  let y;
532
- return n[19] !== r.question || n[20] !== v ? (y = /* @__PURE__ */ Y(t, {
529
+ return n[19] !== r.question || n[20] !== v ? (y = /* @__PURE__ */ J(t, {
533
530
  content: r.question,
534
531
  children: v
535
532
  }), n[19] = r.question, n[20] = v, n[21] = y) : y = n[21], y;
@@ -612,8 +609,8 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
612
609
  if (!r || !n) return e.status === "failed" || e.status === "denied" ? "Unavailable" : "Answered";
613
610
  let i = n.questions[t].question, a = r.split(/\n\n/).find((e) => e.startsWith(`${i}\n`));
614
611
  return a ? a.slice(i.length + 1).trim() || "Skipped" : n.questions.length === 1 ? r : "Answered";
615
- }, vn = he(void 0), yn = () => _e(vn), bn = (e, t) => {
616
- let n = J(14), [r, i] = Q(), a = r?.conversationKey === t ? r : void 0, o;
612
+ }, vn = ge(void 0), yn = () => ve(vn), bn = (e, t) => {
613
+ let n = q(14), [r, i] = Q(), a = r?.conversationKey === t ? r : void 0, o;
617
614
  n[0] !== a || n[1] !== e ? (o = a ? hn(e, a.key) : void 0, n[0] = a, n[1] = e, n[2] = o) : o = n[2];
618
615
  let s = o, c = s ? a?.key : void 0, l = s ? a : void 0, u;
619
616
  n[3] === t ? u = n[4] : (u = (e, n) => i((r) => ({
@@ -643,31 +640,31 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
643
640
  }, xn = (e) => {
644
641
  e.preventDefault();
645
642
  }, Sn = (e) => {
646
- let t = J(7), { option: n } = e, r;
647
- t[0] === n.label ? r = t[1] : (r = /* @__PURE__ */ Y(K, {
643
+ let t = q(7), { option: n } = e, r;
644
+ t[0] === n.label ? r = t[1] : (r = /* @__PURE__ */ J(G, {
648
645
  textStyle: "label/S/regular",
649
646
  color: "fg",
650
647
  children: n.label
651
648
  }), t[0] = n.label, t[1] = r);
652
649
  let i;
653
- t[2] === n.description ? i = t[3] : (i = n.description ? /* @__PURE__ */ Y(K, {
650
+ t[2] === n.description ? i = t[3] : (i = n.description ? /* @__PURE__ */ J(G, {
654
651
  textStyle: "label/XS/regular",
655
652
  color: "fg.muted",
656
653
  children: n.description
657
654
  }) : null, t[2] = n.description, t[3] = i);
658
655
  let a;
659
- return t[4] !== r || t[5] !== i ? (a = /* @__PURE__ */ X(G, {
656
+ return t[4] !== r || t[5] !== i ? (a = /* @__PURE__ */ Y(W, {
660
657
  gap: "0",
661
658
  minWidth: "0",
662
659
  children: [r, i]
663
660
  }), t[4] = r, t[5] = i, t[6] = a) : a = t[6], a;
664
661
  }, Cn = (e) => {
665
- let t = J(12), { option: n, name: i, checked: a, editable: o, onToggle: s } = e, c = !o, l = o ? void 0 : "true", u;
662
+ let t = q(12), { option: n, name: i, checked: a, editable: o, onToggle: s } = e, c = !o, l = o ? void 0 : "true", u;
666
663
  t[0] === o ? u = t[1] : (u = o ? void 0 : { tabIndex: -1 }, t[0] = o, t[1] = u);
667
664
  let d = o ? s : void 0, f;
668
- t[2] === n ? f = t[3] : (f = /* @__PURE__ */ Y(Sn, { option: n }), t[2] = n, t[3] = f);
665
+ t[2] === n ? f = t[3] : (f = /* @__PURE__ */ J(Sn, { option: n }), t[2] = n, t[3] = f);
669
666
  let p;
670
- return t[4] !== a || t[5] !== i || t[6] !== c || t[7] !== l || t[8] !== u || t[9] !== d || t[10] !== f ? (p = /* @__PURE__ */ Y(r, {
667
+ return t[4] !== a || t[5] !== i || t[6] !== c || t[7] !== l || t[8] !== u || t[9] !== d || t[10] !== f ? (p = /* @__PURE__ */ J(r, {
671
668
  name: i,
672
669
  checked: a,
673
670
  readOnly: c,
@@ -678,7 +675,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
678
675
  children: f
679
676
  }), t[4] = a, t[5] = i, t[6] = c, t[7] = l, t[8] = u, t[9] = d, t[10] = f, t[11] = p) : p = t[11], p;
680
677
  }, wn = (e) => {
681
- let t = J(30), { question: n, questionIndex: r, name: i, selectedOption: a, otherSelected: o, editable: s, onToggleOption: c, onToggleOther: l } = e, { otherField: f } = e, p;
678
+ let t = q(30), { question: n, questionIndex: r, name: i, selectedOption: a, otherSelected: o, editable: s, onToggleOption: c, onToggleOther: l } = e, { otherField: f } = e, p;
682
679
  t[0] === n ? p = t[1] : (p = Nt(n), t[0] = n, t[1] = p);
683
680
  let m = p, h;
684
681
  if (t[2] !== n.options || t[3] !== a) {
@@ -692,22 +689,22 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
692
689
  let x;
693
690
  if (t[13] !== s || t[14] !== n.options) {
694
691
  let e;
695
- t[16] === s ? e = t[17] : (e = (e, t) => /* @__PURE__ */ Y(d, {
692
+ t[16] === s ? e = t[17] : (e = (e, t) => /* @__PURE__ */ J(d, {
696
693
  value: String(t),
697
694
  inputProps: s ? void 0 : { tabIndex: -1 },
698
695
  alignItems: "flex-start",
699
- children: /* @__PURE__ */ Y(Sn, { option: e })
696
+ children: /* @__PURE__ */ J(Sn, { option: e })
700
697
  }, e.label), t[16] = s, t[17] = e), x = n.options.map(e), t[13] = s, t[14] = n.options, t[15] = x;
701
698
  } else x = t[15];
702
699
  let S;
703
- t[18] !== s || t[19] !== m ? (S = m ? /* @__PURE__ */ Y(d, {
700
+ t[18] !== s || t[19] !== m ? (S = m ? /* @__PURE__ */ J(d, {
704
701
  value: jt,
705
702
  inputProps: s ? void 0 : { tabIndex: -1 },
706
703
  alignItems: "flex-start",
707
- children: /* @__PURE__ */ Y(Sn, { option: { label: At } })
704
+ children: /* @__PURE__ */ J(Sn, { option: { label: At } })
708
705
  }) : null, t[18] = s, t[19] = m, t[20] = S) : S = t[20];
709
706
  let C = o ? f : null, w;
710
- return t[21] !== i || t[22] !== _ || t[23] !== v || t[24] !== y || t[25] !== b || t[26] !== x || t[27] !== S || t[28] !== C ? (w = /* @__PURE__ */ X(u, {
707
+ return t[21] !== i || t[22] !== _ || t[23] !== v || t[24] !== y || t[25] !== b || t[26] !== x || t[27] !== S || t[28] !== C ? (w = /* @__PURE__ */ Y(u, {
711
708
  name: i,
712
709
  value: _,
713
710
  readOnly: v,
@@ -723,10 +720,10 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
723
720
  ]
724
721
  }), t[21] = i, t[22] = _, t[23] = v, t[24] = y, t[25] = b, t[26] = x, t[27] = S, t[28] = C, t[29] = w) : w = t[29], w;
725
722
  }, Tn = (e) => {
726
- let t = J(4), { items: n } = e, r;
723
+ let t = q(4), { items: n } = e, r;
727
724
  t[0] === n ? r = t[1] : (r = n.map(An), t[0] = n, t[1] = r);
728
725
  let i;
729
- return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ Y(G, {
726
+ return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ J(W, {
730
727
  as: "ul",
731
728
  gap: "0",
732
729
  listStyleType: "none",
@@ -735,10 +732,10 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
735
732
  children: r
736
733
  }), t[2] = r, t[3] = i), i;
737
734
  }, En = (e) => {
738
- let t = J(12), { question: n, questionIndex: r, editable: i, customAnswer: a, onCustomAnswerChange: o, hasOtherChoice: s } = e, c = s ? "Type your answer..." : "Answer...", l = !i, u = i ? void 0 : "true", d = a ?? "", f = i ? c : "Answer", p = s ? `${n.question} (${At})` : n.question, m = i ? "vertical" : "none", h;
735
+ let t = q(12), { question: n, questionIndex: r, editable: i, customAnswer: a, onCustomAnswerChange: o, hasOtherChoice: s } = e, c = s ? "Type your answer..." : "Answer...", l = !i, u = i ? void 0 : "true", d = a ?? "", f = i ? c : "Answer", p = s ? `${n.question} (${At})` : n.question, m = i ? "vertical" : "none", h;
739
736
  t[0] !== o || t[1] !== n || t[2] !== r ? (h = (e) => o?.(n, r, e.currentTarget.value), t[0] = o, t[1] = n, t[2] = r, t[3] = h) : h = t[3];
740
737
  let g;
741
- return t[4] !== l || t[5] !== u || t[6] !== d || t[7] !== f || t[8] !== p || t[9] !== m || t[10] !== h ? (g = /* @__PURE__ */ Y(ae, {
738
+ return t[4] !== l || t[5] !== u || t[6] !== d || t[7] !== f || t[8] !== p || t[9] !== m || t[10] !== h ? (g = /* @__PURE__ */ J(oe, {
742
739
  readOnly: l,
743
740
  "aria-readonly": u,
744
741
  value: d,
@@ -754,10 +751,10 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
754
751
  onChange: h
755
752
  }), t[4] = l, t[5] = u, t[6] = d, t[7] = f, t[8] = p, t[9] = m, t[10] = h, t[11] = g) : g = t[11], g;
756
753
  }, Dn = (e) => {
757
- let t = J(21), { question: n, questionIndex: r, editable: i, selectedOptions: a, customAnswer: o, onToggleOption: s, onToggleOther: c } = e, { name: l, otherField: u } = e, d;
754
+ let t = q(21), { question: n, questionIndex: r, editable: i, selectedOptions: a, customAnswer: o, onToggleOption: s, onToggleOther: c } = e, { name: l, otherField: u } = e, d;
758
755
  t[0] === n ? d = t[1] : (d = Nt(n), t[0] = n, t[1] = d);
759
756
  let f = d, p = o !== void 0, m;
760
- t[2] !== i || t[3] !== l || t[4] !== s || t[5] !== n || t[6] !== r || t[7] !== a ? (m = n.options.map((e) => /* @__PURE__ */ Y(Cn, {
757
+ t[2] !== i || t[3] !== l || t[4] !== s || t[5] !== n || t[6] !== r || t[7] !== a ? (m = n.options.map((e) => /* @__PURE__ */ J(Cn, {
761
758
  option: e,
762
759
  name: l,
763
760
  checked: a.includes(e.label),
@@ -765,7 +762,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
765
762
  onToggle: () => s?.(n, r, e.label)
766
763
  }, e.label)), t[2] = i, t[3] = l, t[4] = s, t[5] = n, t[6] = r, t[7] = a, t[8] = m) : m = t[8];
767
764
  let h;
768
- t[9] !== i || t[10] !== f || t[11] !== l || t[12] !== c || t[13] !== p || t[14] !== n || t[15] !== r ? (h = f ? /* @__PURE__ */ Y(Cn, {
765
+ t[9] !== i || t[10] !== f || t[11] !== l || t[12] !== c || t[13] !== p || t[14] !== n || t[15] !== r ? (h = f ? /* @__PURE__ */ J(Cn, {
769
766
  option: { label: At },
770
767
  name: l,
771
768
  checked: p,
@@ -773,21 +770,21 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
773
770
  onToggle: () => c?.(n, r)
774
771
  }) : null, t[9] = i, t[10] = f, t[11] = l, t[12] = c, t[13] = p, t[14] = n, t[15] = r, t[16] = h) : h = t[16];
775
772
  let g = p ? u : null, _;
776
- return t[17] !== m || t[18] !== h || t[19] !== g ? (_ = /* @__PURE__ */ X(fe, { children: [
773
+ return t[17] !== m || t[18] !== h || t[19] !== g ? (_ = /* @__PURE__ */ Y(pe, { children: [
777
774
  m,
778
775
  h,
779
776
  g
780
777
  ] }), t[17] = m, t[18] = h, t[19] = g, t[20] = _) : _ = t[20], _;
781
778
  }, On = (e) => {
782
- let t = J(30), { question: n, questionIndex: r, editable: i, selectedOptions: a, customAnswer: o, onToggleOption: s, onToggleOther: c } = e, l = n.id ?? `question-${r}`, u;
779
+ let t = q(30), { question: n, questionIndex: r, editable: i, selectedOptions: a, customAnswer: o, onToggleOption: s, onToggleOther: c } = e, l = n.id ?? `question-${r}`, u;
783
780
  t[0] === n ? u = t[1] : (u = Nt(n), t[0] = n, t[1] = u);
784
781
  let d = u, f;
785
- t[2] !== d || t[3] !== e || t[4] !== n.allowCustomAnswer ? (f = n.allowCustomAnswer ? /* @__PURE__ */ Y(En, {
782
+ t[2] !== d || t[3] !== e || t[4] !== n.allowCustomAnswer ? (f = n.allowCustomAnswer ? /* @__PURE__ */ J(En, {
786
783
  ...e,
787
784
  hasOtherChoice: d
788
785
  }) : null, t[2] = d, t[3] = e, t[4] = n.allowCustomAnswer, t[5] = f) : f = t[5];
789
786
  let p = f, m = n.options.length > 0 || d, h;
790
- t[6] === n.question ? h = t[7] : (h = /* @__PURE__ */ Y(K, {
787
+ t[6] === n.question ? h = t[7] : (h = /* @__PURE__ */ J(G, {
791
788
  as: "legend",
792
789
  textStyle: "label/S/medium",
793
790
  color: "fg",
@@ -795,13 +792,13 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
795
792
  children: n.question
796
793
  }), t[6] = n.question, t[7] = h);
797
794
  let g;
798
- t[8] !== m || t[9] !== l || t[10] !== p || t[11] !== e || t[12] !== n.multiple ? (g = m && n.multiple ? /* @__PURE__ */ Y(Dn, {
795
+ t[8] !== m || t[9] !== l || t[10] !== p || t[11] !== e || t[12] !== n.multiple ? (g = m && n.multiple ? /* @__PURE__ */ J(Dn, {
799
796
  ...e,
800
797
  name: l,
801
798
  otherField: p
802
799
  }) : null, t[8] = m, t[9] = l, t[10] = p, t[11] = e, t[12] = n.multiple, t[13] = g) : g = t[13];
803
800
  let _;
804
- t[14] !== o || t[15] !== i || t[16] !== m || t[17] !== l || t[18] !== s || t[19] !== c || t[20] !== p || t[21] !== n || t[22] !== r || t[23] !== a ? (_ = m && !n.multiple ? /* @__PURE__ */ Y(wn, {
801
+ t[14] !== o || t[15] !== i || t[16] !== m || t[17] !== l || t[18] !== s || t[19] !== c || t[20] !== p || t[21] !== n || t[22] !== r || t[23] !== a ? (_ = m && !n.multiple ? /* @__PURE__ */ J(wn, {
805
802
  question: n,
806
803
  questionIndex: r,
807
804
  name: l,
@@ -813,7 +810,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
813
810
  otherField: p
814
811
  }) : null, t[14] = o, t[15] = i, t[16] = m, t[17] = l, t[18] = s, t[19] = c, t[20] = p, t[21] = n, t[22] = r, t[23] = a, t[24] = _) : _ = t[24];
815
812
  let v = m ? null : p, y;
816
- return t[25] !== h || t[26] !== g || t[27] !== _ || t[28] !== v ? (y = /* @__PURE__ */ X(G, {
813
+ return t[25] !== h || t[26] !== g || t[27] !== _ || t[28] !== v ? (y = /* @__PURE__ */ Y(W, {
817
814
  as: "fieldset",
818
815
  gap: "xs",
819
816
  borderWidth: "1px",
@@ -829,7 +826,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
829
826
  ]
830
827
  }), t[25] = h, t[26] = g, t[27] = _, t[28] = v, t[29] = y) : y = t[29], y;
831
828
  }, kn = (e) => {
832
- let t = J(21), { questions: n, editable: r, selectedOptionsByQuestion: i, customAnswersByQuestion: a, onToggleOption: o, onToggleOther: s, onCustomAnswerChange: c } = e, l = r !== void 0 && r, u;
829
+ let t = q(21), { questions: n, editable: r, selectedOptionsByQuestion: i, customAnswersByQuestion: a, onToggleOption: o, onToggleOther: s, onCustomAnswerChange: c } = e, l = r !== void 0 && r, u;
833
830
  t[0] === i ? u = t[1] : (u = i === void 0 ? {} : i, t[0] = i, t[1] = u);
834
831
  let d = u, f;
835
832
  t[2] === a ? f = t[3] : (f = a === void 0 ? {} : a, t[2] = a, t[3] = f);
@@ -838,7 +835,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
838
835
  let e;
839
836
  t[12] !== p || t[13] !== l || t[14] !== c || t[15] !== o || t[16] !== s || t[17] !== d ? (e = (e, t) => {
840
837
  let n = e.id ?? `question-${t}`;
841
- return /* @__PURE__ */ Y(On, {
838
+ return /* @__PURE__ */ J(On, {
842
839
  question: e,
843
840
  questionIndex: t,
844
841
  editable: l,
@@ -851,7 +848,7 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
851
848
  }, t[12] = p, t[13] = l, t[14] = c, t[15] = o, t[16] = s, t[17] = d, t[18] = e) : e = t[18], m = n.map(e), t[4] = p, t[5] = l, t[6] = c, t[7] = o, t[8] = s, t[9] = n, t[10] = d, t[11] = m;
852
849
  } else m = t[11];
853
850
  let h;
854
- return t[19] === m ? h = t[20] : (h = /* @__PURE__ */ Y(G, {
851
+ return t[19] === m ? h = t[20] : (h = /* @__PURE__ */ J(W, {
855
852
  as: "form",
856
853
  gap: "sm",
857
854
  onSubmit: xn,
@@ -860,15 +857,15 @@ var xt = (e = "") => JSON.stringify(C(e)), St = (e) => e.trim().length > 0, Ct =
860
857
  }), t[19] = m, t[20] = h), h;
861
858
  };
862
859
  function An(e, t) {
863
- return /* @__PURE__ */ Y(A, {
860
+ return /* @__PURE__ */ J(A, {
864
861
  as: "li",
865
- children: /* @__PURE__ */ Y(r, {
862
+ children: /* @__PURE__ */ J(r, {
866
863
  checked: e.checked,
867
864
  readOnly: !0,
868
865
  "aria-readonly": "true",
869
866
  inputProps: { tabIndex: -1 },
870
867
  size: "xs",
871
- children: /* @__PURE__ */ Y(K, {
868
+ children: /* @__PURE__ */ J(G, {
872
869
  textStyle: "label/XS/regular",
873
870
  color: "fg",
874
871
  children: e.label
@@ -886,21 +883,21 @@ var jn = (e) => e.questions.map((e, t) => ({
886
883
  required: !!e.required,
887
884
  allowCustomAnswer: !!e.allowCustomAnswer
888
885
  })), Mn = (e) => {
889
- let t = J(49), { questionPrompt: n, selectedOptionsByQuestion: r, customAnswersByQuestion: i, onToggleOption: a, onCustomAnswerChange: o } = e, { onToggleOther: s } = e, { questions: c, isEditable: l } = e, [u, d] = Q(0), f = ye(null), p = yn(), m = p?.selection, h = m?.revision, g, _;
886
+ let t = q(49), { questionPrompt: n, selectedOptionsByQuestion: r, customAnswersByQuestion: i, onToggleOption: a, onCustomAnswerChange: o } = e, { onToggleOther: s } = e, { questions: c, isEditable: l } = e, [u, d] = Q(0), f = Z(null), p = yn(), m = p?.selection, h = m?.revision, g, _;
890
887
  t[0] === h ? (g = t[1], _ = t[2]) : (g = () => {
891
888
  h !== void 0 && f.current?.focus();
892
- }, _ = [h], t[0] = h, t[1] = g, t[2] = _), Z(g, _);
889
+ }, _ = [h], t[0] = h, t[1] = g, t[2] = _), X(g, _);
893
890
  let v;
894
891
  t[3] !== p || t[4] !== m ? (v = (e) => {
895
892
  m ? p?.selectStep(e) : d(e);
896
893
  }, t[3] = p, t[4] = m, t[5] = v) : v = t[5];
897
894
  let y = v, b = Math.min(m?.index ?? u, c.length - 1), x = c[b], S = c.length > 1, C = S ? "0" : "xs", w;
898
- t[6] !== i || t[7] !== S || t[8] !== c || t[9] !== b || t[10] !== y || t[11] !== r ? (w = S ? /* @__PURE__ */ Y(I, {
895
+ t[6] !== i || t[7] !== S || t[8] !== c || t[9] !== b || t[10] !== y || t[11] !== r ? (w = S ? /* @__PURE__ */ J(I, {
899
896
  role: "tablist",
900
897
  "aria-label": "Question steps",
901
898
  gap: "1",
902
899
  minWidth: "0",
903
- children: c.map((e, t) => /* @__PURE__ */ Y(Qt, {
900
+ children: c.map((e, t) => /* @__PURE__ */ J(Qt, {
904
901
  question: e,
905
902
  questionIndex: t,
906
903
  isActive: t === b,
@@ -925,7 +922,7 @@ var jn = (e) => e.questions.map((e, t) => ({
925
922
  o(n.questions[b], b, r);
926
923
  }, t[28] = o, t[29] = n.questions, t[30] = b, t[31] = j) : j = t[31];
927
924
  let M;
928
- t[32] !== i || t[33] !== l || t[34] !== r || t[35] !== A || t[36] !== j || t[37] !== O || t[38] !== k ? (M = /* @__PURE__ */ Y(kn, {
925
+ t[32] !== i || t[33] !== l || t[34] !== r || t[35] !== A || t[36] !== j || t[37] !== O || t[38] !== k ? (M = /* @__PURE__ */ J(kn, {
929
926
  questions: O,
930
927
  editable: l,
931
928
  selectedOptionsByQuestion: r,
@@ -935,7 +932,7 @@ var jn = (e) => e.questions.map((e, t) => ({
935
932
  onCustomAnswerChange: j
936
933
  }), t[32] = i, t[33] = l, t[34] = r, t[35] = A, t[36] = j, t[37] = O, t[38] = k, t[39] = M) : M = t[39];
937
934
  let N;
938
- t[40] !== M || t[41] !== T || t[42] !== E || t[43] !== D ? (N = /* @__PURE__ */ Y(G, {
935
+ t[40] !== M || t[41] !== T || t[42] !== E || t[43] !== D ? (N = /* @__PURE__ */ J(W, {
939
936
  ref: f,
940
937
  tabIndex: -1,
941
938
  id: T,
@@ -945,25 +942,25 @@ var jn = (e) => e.questions.map((e, t) => ({
945
942
  children: M
946
943
  }), t[40] = M, t[41] = T, t[42] = E, t[43] = D, t[44] = N) : N = t[44];
947
944
  let P;
948
- return t[45] !== N || t[46] !== C || t[47] !== w ? (P = /* @__PURE__ */ X(G, {
945
+ return t[45] !== N || t[46] !== C || t[47] !== w ? (P = /* @__PURE__ */ Y(W, {
949
946
  gap: "xs",
950
947
  pb: "sm",
951
948
  pt: C,
952
949
  children: [w, N]
953
950
  }), t[45] = N, t[46] = C, t[47] = w, t[48] = P) : P = t[48], P;
954
951
  }, Nn = (e) => {
955
- let t = J(8), { questionPrompt: n } = e, r;
952
+ let t = q(8), { questionPrompt: n } = e, r;
956
953
  t[0] === n ? r = t[1] : (r = jn(n), t[0] = n, t[1] = r);
957
954
  let i = r, a;
958
955
  t[2] === n ? a = t[3] : (a = Ht(n), t[2] = n, t[3] = a);
959
956
  let o = a, s;
960
- return t[4] !== e || t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ Y(Mn, {
957
+ return t[4] !== e || t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ J(Mn, {
961
958
  ...e,
962
959
  questions: i
963
960
  }, o), t[4] = e, t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
964
961
  }, Pn = (e) => Object.fromEntries((e?.questions ?? []).flatMap((t, n) => e?.delivery === "async" && t.options.length ? [[Pt(t, n), [t.options[0].label]]] : [])), Fn = (e, t) => {
965
- let [n, r] = Q(() => Pn(e)), [i, a] = Q({}), o = Ht(e), s = ye(JSON.stringify([o, t ?? null]));
966
- return Z(() => {
962
+ let [n, r] = Q(() => Pn(e)), [i, a] = Q({}), o = Ht(e), s = Z(JSON.stringify([o, t ?? null]));
963
+ return X(() => {
967
964
  let n = JSON.stringify([o, t ?? null]);
968
965
  s.current !== n && (s.current = n, r(Pn(e)), a({}));
969
966
  }, [
@@ -1001,7 +998,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1001
998
  buildAnswers: () => e ? Yt(e, n, i) : []
1002
999
  };
1003
1000
  }, In = (e) => {
1004
- let t = J(33), { prompt: n, actions: r, disabled: i, onSubmit: a } = e, o = Fn(n), s = yn(), [c, l] = Q(!1), u = ye(!1), d;
1001
+ let t = q(33), { prompt: n, actions: r, disabled: i, onSubmit: a } = e, o = Fn(n), s = yn(), [c, l] = Q(!1), u = Z(!1), d;
1005
1002
  t[0] !== i || t[1] !== a || t[2] !== n || t[3] !== o ? (d = async (e) => {
1006
1003
  let t = e !== void 0 && e;
1007
1004
  if (u.current || i || !t && o.hasMissingRequiredAnswer) return;
@@ -1018,7 +1015,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1018
1015
  }
1019
1016
  }, t[0] = i, t[1] = a, t[2] = n, t[3] = o, t[4] = d) : d = t[4];
1020
1017
  let f = d, p = !i && !c, m;
1021
- t[5] !== n || t[6] !== o.customAnswersByQuestion || t[7] !== o.selectedOptionsByQuestion || t[8] !== o.setCustomAnswer || t[9] !== o.toggleOption || t[10] !== o.toggleOther || t[11] !== p ? (m = /* @__PURE__ */ Y(Nn, {
1018
+ t[5] !== n || t[6] !== o.customAnswersByQuestion || t[7] !== o.selectedOptionsByQuestion || t[8] !== o.setCustomAnswer || t[9] !== o.toggleOption || t[10] !== o.toggleOther || t[11] !== p ? (m = /* @__PURE__ */ J(Nn, {
1022
1019
  isEditable: p,
1023
1020
  questionPrompt: n,
1024
1021
  selectedOptionsByQuestion: o.selectedOptionsByQuestion,
@@ -1028,7 +1025,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1028
1025
  onCustomAnswerChange: o.setCustomAnswer
1029
1026
  }), t[5] = n, t[6] = o.customAnswersByQuestion, t[7] = o.selectedOptionsByQuestion, t[8] = o.setCustomAnswer, t[9] = o.toggleOption, t[10] = o.toggleOther, t[11] = p, t[12] = m) : m = t[12];
1030
1027
  let h;
1031
- t[13] !== s || t[14] !== n.delivery || t[15] !== c ? (h = n.delivery === "async" && s ? /* @__PURE__ */ Y(j, {
1028
+ t[13] !== s || t[14] !== n.delivery || t[15] !== c ? (h = n.delivery === "async" && s ? /* @__PURE__ */ J(j, {
1032
1029
  size: "xs",
1033
1030
  variant: "ghost",
1034
1031
  disabled: c,
@@ -1036,7 +1033,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1036
1033
  children: "Back to message"
1037
1034
  }) : null, t[13] = s, t[14] = n.delivery, t[15] = c, t[16] = h) : h = t[16];
1038
1035
  let g;
1039
- t[17] !== r || t[18] !== h ? (g = /* @__PURE__ */ X(fe, { children: [h, r] }), t[17] = r, t[18] = h, t[19] = g) : g = t[19];
1036
+ t[17] !== r || t[18] !== h ? (g = /* @__PURE__ */ Y(pe, { children: [h, r] }), t[17] = r, t[18] = h, t[19] = g) : g = t[19];
1040
1037
  let _ = i || c, v;
1041
1038
  t[20] === f ? v = t[21] : (v = () => void f(!0), t[20] = f, t[21] = v);
1042
1039
  let y = i || c || o.hasMissingRequiredAnswer || !o.responseText ? "none" : "submit", b;
@@ -1044,7 +1041,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1044
1041
  e === "submit" && f();
1045
1042
  }, t[22] = f, t[23] = b);
1046
1043
  let x;
1047
- t[24] !== g || t[25] !== _ || t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ Y(Ot, {
1044
+ t[24] !== g || t[25] !== _ || t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ J(Ot, {
1048
1045
  actions: g,
1049
1046
  questionPrompt: !0,
1050
1047
  skipDisabled: _,
@@ -1055,9 +1052,9 @@ var jn = (e) => e.questions.map((e, t) => ({
1055
1052
  runAction: b
1056
1053
  }), t[24] = g, t[25] = _, t[26] = v, t[27] = y, t[28] = b, t[29] = x) : x = t[29];
1057
1054
  let S;
1058
- return t[30] !== m || t[31] !== x ? (S = /* @__PURE__ */ X(fe, { children: [m, x] }), t[30] = m, t[31] = x, t[32] = S) : S = t[32], S;
1055
+ return t[30] !== m || t[31] !== x ? (S = /* @__PURE__ */ Y(pe, { children: [m, x] }), t[30] = m, t[31] = x, t[32] = S) : S = t[32], S;
1059
1056
  }, Ln = (e) => {
1060
- let { decision: t, disabled: n } = e, [r, i] = Q(!1), a = ye(!1), o = async (e) => {
1057
+ let { decision: t, disabled: n } = e, [r, i] = Q(!1), a = Z(!1), o = async (e) => {
1061
1058
  let r = t.actions.find((t) => t.id === e);
1062
1059
  if (!(a.current || n || t.pending || !r || r.disabled)) {
1063
1060
  a.current = !0, i(!0);
@@ -1068,7 +1065,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1068
1065
  }
1069
1066
  }
1070
1067
  };
1071
- return /* @__PURE__ */ X(F, {
1068
+ return /* @__PURE__ */ Y(F, {
1072
1069
  "aria-label": "Plan decision",
1073
1070
  align: "center",
1074
1071
  justify: "space-between",
@@ -1076,19 +1073,19 @@ var jn = (e) => e.questions.map((e, t) => ({
1076
1073
  wrap: "wrap",
1077
1074
  children: [
1078
1075
  t.controls,
1079
- t.model ? /* @__PURE__ */ Y(K, {
1076
+ t.model ? /* @__PURE__ */ J(G, {
1080
1077
  textStyle: "label/S/regular",
1081
1078
  minH: "7",
1082
1079
  display: "flex",
1083
1080
  alignItems: "center",
1084
1081
  children: t.model
1085
1082
  }) : null,
1086
- /* @__PURE__ */ Y(I, {
1083
+ /* @__PURE__ */ J(I, {
1087
1084
  gap: "xs",
1088
1085
  marginStart: "auto",
1089
1086
  wrap: "wrap",
1090
1087
  justify: "end",
1091
- children: t.actions.map((e) => /* @__PURE__ */ Y(j, {
1088
+ children: t.actions.map((e) => /* @__PURE__ */ J(j, {
1092
1089
  size: "xs",
1093
1090
  variant: e.variant,
1094
1091
  disabled: n || r || t.pending || e.disabled,
@@ -1099,10 +1096,10 @@ var jn = (e) => e.questions.map((e, t) => ({
1099
1096
  ]
1100
1097
  });
1101
1098
  }, Rn = (e) => {
1102
- let t = J(11), { request: n, question: r, decision: i, actions: a, disabled: o, submitDisabled: s, onSubmit: c } = e;
1099
+ let t = q(11), { request: n, question: r, decision: i, actions: a, disabled: o, submitDisabled: s, onSubmit: c } = e;
1103
1100
  if (n?.kind === "decision" && i) {
1104
1101
  let e;
1105
- return t[0] !== i || t[1] !== o ? (e = /* @__PURE__ */ Y(Ln, {
1102
+ return t[0] !== i || t[1] !== o ? (e = /* @__PURE__ */ J(Ln, {
1106
1103
  decision: i,
1107
1104
  disabled: o
1108
1105
  }, i.id), t[0] = i, t[1] = o, t[2] = e) : e = t[2], e;
@@ -1111,7 +1108,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1111
1108
  let e;
1112
1109
  t[3] === r ? e = t[4] : (e = Ht(r), t[3] = r, t[4] = e);
1113
1110
  let n = o || s, i;
1114
- return t[5] !== a || t[6] !== c || t[7] !== r || t[8] !== e || t[9] !== n ? (i = /* @__PURE__ */ Y(In, {
1111
+ return t[5] !== a || t[6] !== c || t[7] !== r || t[8] !== e || t[9] !== n ? (i = /* @__PURE__ */ J(In, {
1115
1112
  prompt: r,
1116
1113
  actions: a,
1117
1114
  disabled: n,
@@ -1119,48 +1116,26 @@ var jn = (e) => e.questions.map((e, t) => ({
1119
1116
  }, e), t[5] = a, t[6] = c, t[7] = r, t[8] = e, t[9] = n, t[10] = i) : i = t[10], i;
1120
1117
  }
1121
1118
  return null;
1122
- }, zn = (e) => {
1123
- let t = e?.querySelector("[contenteditable=\"true\"]");
1124
- t instanceof HTMLElement && t.focus();
1125
- }, Bn = (e, t) => requestAnimationFrame(() => {
1126
- zn(e), t?.();
1127
- }), Vn = (e, t, n, r, i) => {
1128
- let a = J(17), [o, s] = Q(!1), c, l;
1129
- a[0] !== e || a[1] !== n || a[2] !== i || a[3] !== o ? (c = () => {
1130
- if (!o || !n) return;
1131
- let t = Bn(e.current, () => {
1132
- i(!0), s(!1);
1133
- });
1134
- return () => cancelAnimationFrame(t);
1135
- }, l = [
1136
- o,
1137
- n,
1138
- e,
1139
- i
1140
- ], a[0] = e, a[1] = n, a[2] = i, a[3] = o, a[4] = c, a[5] = l) : (c = a[4], l = a[5]), Z(c, l);
1141
- let u, d;
1142
- a[6] !== t || a[7] !== e || a[8] !== i ? (u = () => {
1143
- if (!t) return;
1144
- let n = Bn(e.current, () => i(!0));
1145
- return () => cancelAnimationFrame(n);
1146
- }, d = [
1147
- t,
1148
- e,
1149
- i
1150
- ], a[6] = t, a[7] = e, a[8] = i, a[9] = u, a[10] = d) : (u = a[9], d = a[10]), Z(u, d);
1151
- let f, p;
1152
- a[11] !== e || a[12] !== r || a[13] !== i ? (f = () => {
1153
- if (r === 0) return;
1154
- let t = Bn(e.current, () => i(!0));
1155
- return () => cancelAnimationFrame(t);
1156
- }, p = [
1157
- r,
1158
- e,
1159
- i
1160
- ], a[11] = e, a[12] = r, a[13] = i, a[14] = f, a[15] = p) : (f = a[14], p = a[15]), Z(f, p);
1161
- let m;
1162
- return a[16] === Symbol.for("react.memo_cache_sentinel") ? (m = () => s(!0), a[16] = m) : m = a[16], m;
1163
- }, Hn = (e) => {
1119
+ }, zn = (e, t) => {
1120
+ let n = q(7), [r, i] = Q(e || t !== 0), a;
1121
+ n[0] !== e || n[1] !== t ? (a = {
1122
+ autoFocus: e,
1123
+ focusSignal: t
1124
+ }, n[0] = e, n[1] = t, n[2] = a) : a = n[2];
1125
+ let [o, s] = Q(a);
1126
+ (o.autoFocus !== e || o.focusSignal !== t) && (s({
1127
+ autoFocus: e,
1128
+ focusSignal: t
1129
+ }), (e && !o.autoFocus || t !== 0 && t !== o.focusSignal) && i(!0));
1130
+ let c, l;
1131
+ n[3] === Symbol.for("react.memo_cache_sentinel") ? (c = () => i(!0), l = () => i(!1), n[3] = c, n[4] = l) : (c = n[3], l = n[4]);
1132
+ let u;
1133
+ return n[5] === r ? u = n[6] : (u = {
1134
+ requested: r,
1135
+ request: c,
1136
+ complete: l
1137
+ }, n[5] = r, n[6] = u), u;
1138
+ }, Bn = (e) => {
1164
1139
  let t = [];
1165
1140
  for (let n = e.length - 1; n >= 0 && t.length < 10; n--) {
1166
1141
  let r = e[n];
@@ -1169,8 +1144,8 @@ var jn = (e) => e.questions.map((e, t) => ({
1169
1144
  i.trim() && t.push(i);
1170
1145
  }
1171
1146
  return t;
1172
- }, Un = (e, t, n, r) => r === 0 ? null : e === null ? t === "previous" && n === "" ? { index: 0 } : null : t === "previous" ? { index: Math.min(e + 1, r - 1) } : { index: e === 0 ? null : e - 1 }, Wn = (e) => {
1173
- let t = J(24), { recentUserMessages: n, text: r, blocked: i, resetKey: a, onChange: o } = e, s = ye(null), c = ye(null), l, u;
1147
+ }, Vn = (e, t, n, r) => r === 0 ? null : e === null ? t === "previous" && n === "" ? { index: 0 } : null : t === "previous" ? { index: Math.min(e + 1, r - 1) } : { index: e === 0 ? null : e - 1 }, Hn = (e) => {
1148
+ let t = q(24), { recentUserMessages: n, text: r, blocked: i, resetKey: a, onChange: o } = e, s = Z(null), c = Z(null), l, u;
1174
1149
  if (t[0] !== i || t[1] !== n || t[2] !== a) {
1175
1150
  l = n.slice(0, 10);
1176
1151
  let e = JSON.stringify(l);
@@ -1180,10 +1155,10 @@ var jn = (e) => e.questions.map((e, t) => ({
1180
1155
  i
1181
1156
  ]), t[0] = i, t[1] = n, t[2] = a, t[3] = l, t[4] = u;
1182
1157
  } else l = t[3], u = t[4];
1183
- let d = u, f = ye(d), p, m;
1158
+ let d = u, f = Z(d), p, m;
1184
1159
  t[5] === d ? (p = t[6], m = t[7]) : (p = () => {
1185
1160
  f.current !== d && (f.current = d, c.current = null);
1186
- }, m = [d], t[5] = d, t[6] = p, t[7] = m), Z(p, m);
1161
+ }, m = [d], t[5] = d, t[6] = p, t[7] = m), X(p, m);
1187
1162
  let h;
1188
1163
  t[8] === Symbol.for("react.memo_cache_sentinel") ? (h = () => {
1189
1164
  c.current = null;
@@ -1195,7 +1170,7 @@ var jn = (e) => e.questions.map((e, t) => ({
1195
1170
  let v = _, y;
1196
1171
  t[12] !== i || t[13] !== o || t[14] !== l || t[15] !== r ? (y = (e) => {
1197
1172
  if (i) return !1;
1198
- let t = Un(c.current, e, r, l.length);
1173
+ let t = Vn(c.current, e, r, l.length);
1199
1174
  if (!t) return !1;
1200
1175
  c.current = t.index;
1201
1176
  let n = t.index === null ? "" : l[t.index];
@@ -1211,12 +1186,12 @@ var jn = (e) => e.questions.map((e, t) => ({
1211
1186
  recallPrevious: x,
1212
1187
  recallNext: S
1213
1188
  }, t[20] = v, t[21] = x, t[22] = S, t[23] = C) : C = t[23], C;
1214
- }, Gn = (e) => {
1215
- let t = J(7), [n, r] = Q(e), [i, a] = Q(e), [o, s] = Q(0), c;
1189
+ }, Un = (e) => {
1190
+ let t = q(7), [n, r] = Q(e), [i, a] = Q(e), [o, s] = Q(0), c;
1216
1191
  t[0] === e ? c = t[1] : (c = () => w(e), t[0] = e, t[1] = c);
1217
1192
  let [l, u] = Q(c), d;
1218
1193
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = (e) => {
1219
- a(e), s(Kn);
1194
+ a(e), s(Wn);
1220
1195
  }, t[2] = d) : d = t[2];
1221
1196
  let f = d;
1222
1197
  if (n !== e) {
@@ -1234,12 +1209,12 @@ var jn = (e) => e.questions.map((e, t) => ({
1234
1209
  text: l
1235
1210
  }, t[3] = o, t[4] = i, t[5] = l, t[6] = p) : p = t[6], p;
1236
1211
  };
1237
- function Kn(e) {
1212
+ function Wn(e) {
1238
1213
  return e + 1;
1239
1214
  }
1240
1215
  //#endregion
1241
1216
  //#region src/components/chat-ui/components/composer-request.ts
1242
- var qn = (e, t, n) => {
1217
+ var Gn = (e, t, n) => {
1243
1218
  let r = [];
1244
1219
  return e && r.push({
1245
1220
  kind: "question",
@@ -1248,14 +1223,14 @@ var qn = (e, t, n) => {
1248
1223
  kind: "decision",
1249
1224
  id: t.id
1250
1225
  }), r.find((e) => e.kind === n?.kind && e.id === n.id) ?? r[0];
1251
- }, Jn = (e, t) => {
1252
- let [n, r] = Q(), i = qn(e, t, n);
1226
+ }, Kn = (e, t) => {
1227
+ let [n, r] = Q(), i = Gn(e, t, n);
1253
1228
  return (i?.kind !== n?.kind || i?.id !== n?.id) && r(i), i;
1254
- }, Yn = (e) => {
1255
- let t = J(2), { placeholder: n } = e;
1229
+ }, qn = (e) => {
1230
+ let t = q(2), { placeholder: n } = e;
1256
1231
  if (!n) return null;
1257
1232
  let r;
1258
- return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ Y(K, {
1233
+ return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ J(G, {
1259
1234
  textStyle: "label/M/regular",
1260
1235
  color: "fg.subtle",
1261
1236
  pointerEvents: "none",
@@ -1263,52 +1238,51 @@ var qn = (e, t, n) => {
1263
1238
  top: "0",
1264
1239
  children: n
1265
1240
  }), t[0] = n, t[1] = r), r;
1266
- }, Xn = "border.accent-light", Zn = (e) => {
1267
- let { defaultState: t, recentUserMessages: r = [], onSubmit: i = () => {}, onInterrupt: a, onAttachFiles: o, onAttachText: s, textAttachmentPasteLineThreshold: c = 200, streaming: l = !1, attachedResources: u = [], onClearAttachments: d, isDisabled: f = !1, submitDisabled: p = !1, onChange: m, placeholder: h, attachmentList: g, actions: _, submitActions: v, attachmentActions: y, attachedToTop: b = !1, recessed: x = !1, questionPrompt: S, decision: C, autoFocus: w = !1, focusSignal: T = 0, submitTitle: D, submitLabel: O, initialSelection: k, onSelectionChange: j, onEditorStateChange: M, retainTextUntilAcknowledged: N = !1, commands: P = [] } = e, I = Jn(S, C), L = !!I, R = x ? "border.subtle" : "border", [z, B] = Q(!1), [V, H] = Q(!1), { editorKey: U, editorState: ee, remountEditor: te, setEditorState: ne, setText: re, text: W } = Gn(t), G = ye(null), ie = Vn(G, w, !f && !z && !L, T, H), K = Wn({
1241
+ }, Jn = "border.accent-light", Yn = (e) => {
1242
+ let { defaultState: t, recentUserMessages: r = [], onSubmit: i = () => {}, onInterrupt: a, onAttachFiles: o, onAttachText: s, textAttachmentPasteLineThreshold: c = 200, streaming: l = !1, attachedResources: u = [], onClearAttachments: d, isDisabled: f = !1, submitDisabled: p = !1, onChange: m, placeholder: h, attachmentList: g, actions: _, submitActions: v, attachmentActions: y, attachedToTop: b = !1, recessed: x = !1, questionPrompt: S, decision: C, autoFocus: w = !1, focusSignal: T = 0, submitTitle: D, submitLabel: O, initialSelection: k, onSelectionChange: j, onEditorStateChange: M, retainTextUntilAcknowledged: N = !1, commands: P = [] } = e, I = Kn(S, C), L = !!I, ee = x ? "border.subtle" : "border", [R, z] = Q(!1), { editorKey: B, editorState: te, remountEditor: V, setEditorState: ne, setText: re, text: ie } = Un(t), H = zn(w, T), U = Hn({
1268
1243
  recentUserMessages: r,
1269
- text: W,
1270
- blocked: f || z || L,
1271
- resetKey: String(U),
1244
+ text: ie,
1245
+ blocked: f || R || L,
1246
+ resetKey: String(B),
1272
1247
  onChange: (e) => {
1273
1248
  re(e), m?.(e);
1274
1249
  }
1275
- }), ae = (e) => {
1250
+ }), W = (e) => {
1276
1251
  let t = e.target;
1277
- t instanceof Element && e.currentTarget.contains(t) && (t.closest("button, input, textarea, select, a, label, [role=button], [role=combobox]") || L || (H(!0), zn(G.current)));
1278
- }, oe = (e) => {
1279
- te(xt(e)), K.change(e);
1280
- }, q = !f && !z && !p && !L, se = {
1252
+ t instanceof Element && e.currentTarget.contains(t) && (t.closest("button, input, textarea, select, a, label, [role=button], [role=combobox]") || L || H.request());
1253
+ }, ae = (e) => {
1254
+ V(xt(e)), U.change(e);
1255
+ }, G = !f && !R && !p && !L, oe = {
1281
1256
  canInterrupt: !L && !!a,
1282
1257
  canSubmit: !p && !L,
1283
1258
  hasQuestionPrompt: L,
1284
- isDisabled: f || z,
1259
+ isDisabled: f || R,
1285
1260
  streaming: l,
1286
- text: W
1287
- }, ce = wt(se), le = l ? "Queue message" : "Send message", ue = async () => {
1288
- if (!q || !W.trim()) return;
1289
- let e = W;
1290
- K.reset(), B(!0), N || oe("");
1261
+ text: ie
1262
+ }, se = wt(oe), ce = l ? "Queue message" : "Send message", K = async () => {
1263
+ if (!G || !ie.trim()) return;
1264
+ let e = ie;
1265
+ U.reset(), z(!0), N || ae("");
1291
1266
  try {
1292
1267
  await kt({
1293
- text: W.trim(),
1268
+ text: ie.trim(),
1294
1269
  attachments: u,
1295
1270
  onSubmit: i,
1296
1271
  onClearAttachments: d
1297
1272
  });
1298
1273
  } catch {
1299
- N || oe(e);
1274
+ N || ae(e);
1300
1275
  } finally {
1301
- B(!1), ie();
1276
+ z(!1), H.request();
1302
1277
  }
1303
- }, de = (e) => {
1304
- e === "interrupt" && a?.(), e === "submit" && ue();
1305
- }, J = Et({
1278
+ }, le = (e) => {
1279
+ e === "interrupt" && a?.(), e === "submit" && K();
1280
+ }, ue = Et({
1306
1281
  onAttachFiles: o,
1307
1282
  onAttachText: s,
1308
1283
  textAttachmentPasteLineThreshold: c
1309
1284
  });
1310
- return /* @__PURE__ */ Y(A, {
1311
- ref: G,
1285
+ return /* @__PURE__ */ J(A, {
1312
1286
  position: "relative",
1313
1287
  width: "100%",
1314
1288
  paddingX: "xs",
@@ -1319,28 +1293,24 @@ var qn = (e, t, n) => {
1319
1293
  borderTopRadius: b ? "0" : void 0,
1320
1294
  borderWidth: "1px",
1321
1295
  borderStyle: "solid",
1322
- borderColor: V ? Xn : R,
1323
- zIndex: +!!V,
1296
+ borderColor: ee,
1297
+ zIndex: 0,
1324
1298
  transition: "border-color 0.2s ease-in-out",
1325
- _hover: {
1326
- borderColor: V ? Xn : R,
1327
- zIndex: 1
1328
- },
1299
+ _hover: { zIndex: 1 },
1329
1300
  _focusWithin: {
1330
- borderColor: Xn,
1301
+ borderColor: Jn,
1331
1302
  zIndex: 1
1332
1303
  },
1333
- onPasteCapture: L ? void 0 : J.onPasteCapture,
1334
- onDropCapture: L ? void 0 : J.onDropCapture,
1335
- onDragOver: L ? void 0 : J.onDragOver,
1336
- onClick: ae,
1337
- onBlur: () => H(!1),
1338
- children: /* @__PURE__ */ X(F, {
1304
+ onPasteCapture: L ? void 0 : ue.onPasteCapture,
1305
+ onDropCapture: L ? void 0 : ue.onDropCapture,
1306
+ onDragOver: L ? void 0 : ue.onDragOver,
1307
+ onClick: W,
1308
+ children: /* @__PURE__ */ Y(F, {
1339
1309
  direction: "column",
1340
1310
  color: "fg",
1341
1311
  gap: "xs",
1342
1312
  children: [
1343
- /* @__PURE__ */ Y(Rn, {
1313
+ /* @__PURE__ */ J(Rn, {
1344
1314
  request: I,
1345
1315
  question: S,
1346
1316
  decision: C,
@@ -1355,57 +1325,59 @@ var qn = (e, t, n) => {
1355
1325
  onClearAttachments: d
1356
1326
  })
1357
1327
  }),
1358
- /* @__PURE__ */ X(A, {
1328
+ /* @__PURE__ */ Y(A, {
1359
1329
  display: L ? "none" : void 0,
1360
- children: [g ? /* @__PURE__ */ Y(A, {
1330
+ children: [g ? /* @__PURE__ */ J(A, {
1361
1331
  mb: "xs",
1362
1332
  children: g
1363
- }) : null, /* @__PURE__ */ Y(n, {
1333
+ }) : null, /* @__PURE__ */ J(n, {
1364
1334
  maxH: "10rem",
1365
1335
  showHorizontalScrollbar: !1,
1366
1336
  contentProps: { pr: "2xs" },
1367
- children: /* @__PURE__ */ Y(F, {
1337
+ children: /* @__PURE__ */ J(F, {
1368
1338
  minH: "7",
1369
1339
  align: "center",
1370
- children: /* @__PURE__ */ Y(E, {
1371
- ref: K.editorRef,
1372
- onRecallPrevious: K.recallPrevious,
1373
- onRecallNext: K.recallNext,
1374
- defaultState: ee,
1340
+ children: /* @__PURE__ */ J(E, {
1341
+ ref: U.editorRef,
1342
+ onRecallPrevious: U.recallPrevious,
1343
+ onRecallNext: U.recallNext,
1344
+ defaultState: te,
1375
1345
  initialSelection: k,
1376
1346
  onSelectionChange: j,
1377
- isEditable: !f && !z && !L,
1378
- placeholder: /* @__PURE__ */ Y(Yn, { placeholder: h }),
1347
+ isEditable: !f && !R && !L,
1348
+ focusRequested: H.requested,
1349
+ onFocusRequestComplete: H.complete,
1350
+ placeholder: /* @__PURE__ */ J(qn, { placeholder: h }),
1379
1351
  onChange: (e, t) => {
1380
- ne(JSON.stringify(t)), M?.(e, JSON.stringify(t)), K.change(e);
1352
+ ne(JSON.stringify(t)), M?.(e, JSON.stringify(t)), U.change(e);
1381
1353
  },
1382
- onSubmit: () => de(Ct(se)),
1354
+ onSubmit: () => le(Ct(oe)),
1383
1355
  commands: P
1384
- }, U)
1356
+ }, B)
1385
1357
  })
1386
1358
  })]
1387
1359
  }),
1388
- L ? null : /* @__PURE__ */ Y(Ot, {
1389
- actions: /* @__PURE__ */ X(fe, { children: [y, _] }),
1360
+ L ? null : /* @__PURE__ */ J(Ot, {
1361
+ actions: /* @__PURE__ */ Y(pe, { children: [y, _] }),
1390
1362
  questionPrompt: !1,
1391
1363
  skipDisabled: !1,
1392
1364
  skipTitle: "",
1393
1365
  onSkip: () => {},
1394
- buttonAction: ce,
1366
+ buttonAction: se,
1395
1367
  submitTitle: D,
1396
1368
  submitLabel: O,
1397
1369
  submitActions: v,
1398
- messageTitle: le,
1399
- runAction: de
1370
+ messageTitle: ce,
1371
+ runAction: le
1400
1372
  })
1401
1373
  ]
1402
1374
  })
1403
1375
  });
1404
- }, Qn = {
1376
+ }, Xn = {
1405
1377
  animationName: "message-fade-in",
1406
1378
  animationDuration: "200ms",
1407
1379
  animationTimingFunction: "ease-out"
1408
- }, $n = (e) => {
1380
+ }, Zn = (e) => {
1409
1381
  let t = /* @__PURE__ */ new Set(), n = new Set(e.state.seenKeys);
1410
1382
  for (let r of e.itemKeys) e.state.initialized && !n.has(r) && t.add(r), n.add(r);
1411
1383
  return {
@@ -1415,17 +1387,17 @@ var qn = (e, t, n) => {
1415
1387
  seenKeys: n
1416
1388
  }
1417
1389
  };
1418
- }, er = (e, t) => {
1390
+ }, Qn = (e, t) => {
1419
1391
  if (e.length !== t.length) return !1;
1420
1392
  for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
1421
1393
  return !0;
1422
- }, tr = (e) => {
1423
- let t = ye({
1394
+ }, $n = (e) => {
1395
+ let t = Z({
1424
1396
  initialized: !1,
1425
1397
  seenKeys: /* @__PURE__ */ new Set()
1426
- }), n = ye(null);
1427
- if (n.current && er(n.current.itemKeys, e)) return n.current.animatedKeys;
1428
- let r = $n({
1398
+ }), n = Z(null);
1399
+ if (n.current && Qn(n.current.itemKeys, e)) return n.current.animatedKeys;
1400
+ let r = Zn({
1429
1401
  itemKeys: e,
1430
1402
  state: t.current
1431
1403
  });
@@ -1433,19 +1405,19 @@ var qn = (e, t, n) => {
1433
1405
  itemKeys: [...e],
1434
1406
  animatedKeys: r.animatedKeys
1435
1407
  }, r.animatedKeys;
1436
- }, nr = (e) => e.type === "text", rr = (e) => (e.parts ?? []).filter(nr).map((e) => e.text.trim()).filter(Boolean).join("\n\n"), ir = (e, t, n) => e.delivery === "unsent" ? "Not sent" : e.createdAt ? new Intl.DateTimeFormat(t, {
1408
+ }, er = (e) => e.type === "text", tr = (e) => (e.parts ?? []).filter(er).map((e) => e.text.trim()).filter(Boolean).join("\n\n"), nr = (e, t, n) => e.delivery === "unsent" ? "Not sent" : e.createdAt ? new Intl.DateTimeFormat(t, {
1437
1409
  hour: "numeric",
1438
1410
  minute: "2-digit",
1439
1411
  timeZone: n
1440
- }).format(new Date(e.createdAt)) : "", ar = (e) => {
1441
- let n = J(20), { message: r, alwaysVisible: i, copyAlwaysVisible: a } = e, o = i !== void 0 && i, s = a === void 0 ? o : a, [c, l] = Q(!1), u = ye(null), d;
1442
- n[0] === r ? d = n[1] : (d = rr(r), n[0] = r, n[1] = d);
1412
+ }).format(new Date(e.createdAt)) : "", rr = (e) => {
1413
+ let n = q(20), { message: r, alwaysVisible: i, copyAlwaysVisible: a } = e, o = i !== void 0 && i, s = a === void 0 ? o : a, [c, l] = Q(!1), u = Z(null), d;
1414
+ n[0] === r ? d = n[1] : (d = tr(r), n[0] = r, n[1] = d);
1443
1415
  let f = d, p;
1444
- n[2] === r ? p = n[3] : (p = ir(r), n[2] = r, n[3] = p);
1416
+ n[2] === r ? p = n[3] : (p = nr(r), n[2] = r, n[3] = p);
1445
1417
  let m = p, h, g;
1446
1418
  n[4] === Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
1447
1419
  u.current !== null && window.clearTimeout(u.current);
1448
- }, g = [], n[4] = h, n[5] = g) : (h = n[4], g = n[5]), Z(h, g);
1420
+ }, g = [], n[4] = h, n[5] = g) : (h = n[4], g = n[5]), X(h, g);
1449
1421
  let _;
1450
1422
  n[6] === f ? _ = n[7] : (_ = async () => {
1451
1423
  if (f) try {
@@ -1457,40 +1429,40 @@ var qn = (e, t, n) => {
1457
1429
  let v = _;
1458
1430
  if (!f && !m) return null;
1459
1431
  let y = o ? "1" : "0", b = o ? "auto" : "none", x;
1460
- n[8] === m ? x = n[9] : (x = m ? /* @__PURE__ */ Y(K, {
1432
+ n[8] === m ? x = n[9] : (x = m ? /* @__PURE__ */ J(G, {
1461
1433
  textStyle: "label/XS/regular",
1462
1434
  color: "fg.muted",
1463
1435
  children: m
1464
1436
  }) : null, n[8] = m, n[9] = x);
1465
1437
  let S;
1466
- n[10] !== s || n[11] !== v || n[12] !== f || n[13] !== c ? (S = f ? /* @__PURE__ */ Y(A, {
1438
+ n[10] !== s || n[11] !== v || n[12] !== f || n[13] !== c ? (S = f ? /* @__PURE__ */ J(A, {
1467
1439
  opacity: s ? "1" : "0",
1468
1440
  pointerEvents: s ? "auto" : "none",
1469
1441
  transition: "opacity 120ms ease",
1470
- css: or,
1471
- children: /* @__PURE__ */ Y(t, {
1442
+ css: ir,
1443
+ children: /* @__PURE__ */ J(t, {
1472
1444
  content: c ? "Copied" : "Copy message",
1473
- children: /* @__PURE__ */ Y(R, {
1445
+ children: /* @__PURE__ */ J(ee, {
1474
1446
  "aria-label": c ? "Copied" : "Copy message",
1475
1447
  variant: "ghost",
1476
1448
  size: "2xs",
1477
1449
  onClick: v,
1478
- children: Y(c ? we : De, { size: 12 })
1450
+ children: J(c ? we : De, { size: 12 })
1479
1451
  })
1480
1452
  })
1481
1453
  }) : null, n[10] = s, n[11] = v, n[12] = f, n[13] = c, n[14] = S) : S = n[14];
1482
1454
  let C;
1483
- return n[15] !== S || n[16] !== y || n[17] !== b || n[18] !== x ? (C = /* @__PURE__ */ X(I, {
1455
+ return n[15] !== S || n[16] !== y || n[17] !== b || n[18] !== x ? (C = /* @__PURE__ */ Y(I, {
1484
1456
  "data-chat-message-action-panel": "true",
1485
1457
  gap: "2xs",
1486
1458
  minH: "6",
1487
1459
  opacity: y,
1488
1460
  pointerEvents: b,
1489
1461
  transition: "opacity 120ms ease",
1490
- css: or,
1462
+ css: ir,
1491
1463
  children: [x, S]
1492
1464
  }), n[15] = S, n[16] = y, n[17] = b, n[18] = x, n[19] = C) : C = n[19], C;
1493
- }, or = {
1465
+ }, ir = {
1494
1466
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
1495
1467
  opacity: 1,
1496
1468
  pointerEvents: "auto"
@@ -1503,32 +1475,32 @@ var qn = (e, t, n) => {
1503
1475
  opacity: 1,
1504
1476
  pointerEvents: "auto"
1505
1477
  }
1506
- }, sr = (e) => {
1507
- let t = J(12), n, r, i, a;
1478
+ }, ar = (e) => {
1479
+ let t = q(12), n, r, i, a;
1508
1480
  t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({children: n, linkHandler: r, streaming: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
1509
1481
  let o;
1510
- t[5] !== n || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ Y(T, {
1482
+ t[5] !== n || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ J(T, {
1511
1483
  defaultState: n,
1512
1484
  linkHandler: r,
1513
1485
  streaming: a,
1514
1486
  fullWidth: !0
1515
1487
  }), t[5] = n, t[6] = r, t[7] = a, t[8] = o) : o = t[8];
1516
1488
  let s;
1517
- return t[9] !== i || t[10] !== o ? (s = /* @__PURE__ */ Y(A, {
1489
+ return t[9] !== i || t[10] !== o ? (s = /* @__PURE__ */ J(A, {
1518
1490
  ...i,
1519
1491
  children: o
1520
1492
  }), t[9] = i, t[10] = o, t[11] = s) : s = t[11], s;
1521
- }, cr = (e) => {
1522
- let t = J(12), { part: n } = e, r = ln(n.state?.input), i = yn(), a;
1493
+ }, or = (e) => {
1494
+ let t = q(12), { part: n } = e, r = ln(n.state?.input), i = yn(), a;
1523
1495
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = { recipe: f }, t[0] = a) : a = t[0];
1524
- let o = ue(a);
1496
+ let o = de(a);
1525
1497
  if (!r) return null;
1526
1498
  let s;
1527
1499
  t[1] === n ? s = t[2] : (s = pn(n), t[1] = n, t[2] = s);
1528
- let c = s, l = c && !!i, u = G, d;
1500
+ let c = s, l = c && !!i, u = W, d;
1529
1501
  t[3] !== l || t[4] !== i || t[5] !== n || t[6] !== c || t[7] !== o ? (d = (e, t) => {
1530
1502
  let r = _n(n, t) ?? e.options[0]?.label ?? "Your answer", a = i?.activeKey === fn(n) && i?.selection?.index === t;
1531
- return /* @__PURE__ */ X(se.button, {
1503
+ return /* @__PURE__ */ Y(K.button, {
1532
1504
  type: "button",
1533
1505
  css: o({ multiline: e.question.includes("\n") }),
1534
1506
  "data-state": c ? "pending" : "answered",
@@ -1536,12 +1508,12 @@ var qn = (e, t, n) => {
1536
1508
  "aria-expanded": l ? a : void 0,
1537
1509
  "aria-label": `${e.question} → ${r}${l ? ". Open question" : ""}`,
1538
1510
  onClick: () => i?.open(n, t),
1539
- children: [/* @__PURE__ */ Y("span", {
1511
+ children: [/* @__PURE__ */ J("span", {
1540
1512
  "data-question-text": !0,
1541
1513
  children: e.question
1542
- }), /* @__PURE__ */ X("span", {
1514
+ }), /* @__PURE__ */ Y("span", {
1543
1515
  "data-question-answer-row": !0,
1544
- children: [/* @__PURE__ */ Y(Se, { "aria-hidden": "true" }), /* @__PURE__ */ Y("span", {
1516
+ children: [/* @__PURE__ */ J(Se, { "aria-hidden": "true" }), /* @__PURE__ */ J("span", {
1545
1517
  "data-question-answer": !0,
1546
1518
  children: r
1547
1519
  })]
@@ -1549,19 +1521,19 @@ var qn = (e, t, n) => {
1549
1521
  }, e.id);
1550
1522
  }, t[3] = l, t[4] = i, t[5] = n, t[6] = c, t[7] = o, t[8] = d) : d = t[8];
1551
1523
  let p = r.questions.map(d), m;
1552
- return t[9] !== u || t[10] !== p ? (m = /* @__PURE__ */ Y(u, {
1524
+ return t[9] !== u || t[10] !== p ? (m = /* @__PURE__ */ J(u, {
1553
1525
  gap: "xs",
1554
1526
  align: "start",
1555
1527
  children: p
1556
1528
  }), t[9] = u, t[10] = p, t[11] = m) : m = t[11], m;
1557
- }, lr = (e) => e.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), ur = (e) => {
1558
- let t = lr(e), n = t.replace(/_/g, "");
1529
+ }, sr = (e) => e.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), cr = (e) => {
1530
+ let t = sr(e), n = t.replace(/_/g, "");
1559
1531
  return [.../* @__PURE__ */ new Set([
1560
1532
  e,
1561
1533
  t,
1562
1534
  n
1563
1535
  ])];
1564
- }, dr = {
1536
+ }, lr = {
1565
1537
  shell: Ge,
1566
1538
  ls: Re,
1567
1539
  read_file: Ne,
@@ -1571,7 +1543,7 @@ var qn = (e, t, n) => {
1571
1543
  upload_files: Pe,
1572
1544
  download_file: je,
1573
1545
  move_file: Be
1574
- }, fr = {
1546
+ }, ur = {
1575
1547
  dot: Oe,
1576
1548
  danger: be,
1577
1549
  search: He,
@@ -1580,11 +1552,11 @@ var qn = (e, t, n) => {
1580
1552
  question: Ee,
1581
1553
  todo: Le,
1582
1554
  terminal: Ge,
1583
- ...dr
1584
- }, pr = "dot", mr = (e) => Object.hasOwn(dr, e), hr = (e) => fr[e], gr = (e) => {
1585
- if (!e) return pr;
1586
- let t = lr(e);
1587
- if (mr(t)) return t;
1555
+ ...lr
1556
+ }, dr = "dot", fr = (e) => Object.hasOwn(lr, e), pr = (e) => ur[e], mr = (e) => {
1557
+ if (!e) return dr;
1558
+ let t = sr(e);
1559
+ if (fr(t)) return t;
1588
1560
  let n = t.replace(/_/g, "");
1589
1561
  switch (t) {
1590
1562
  case "read": return "file";
@@ -1599,79 +1571,79 @@ var qn = (e, t, n) => {
1599
1571
  case "question": return "question";
1600
1572
  case "fs":
1601
1573
  case "file": return "file";
1602
- default: return n === "todowrite" || n === "todo" ? "todo" : pr;
1574
+ default: return n === "todowrite" || n === "todo" ? "todo" : dr;
1603
1575
  }
1604
1576
  };
1605
1577
  //#endregion
1606
1578
  //#region src/components/chat-ui/utils/diff.ts
1607
- function _r(e) {
1579
+ function hr(e) {
1608
1580
  let t = e.lastIndexOf("/");
1609
1581
  return t >= 0 ? e.slice(t + 1) : e;
1610
1582
  }
1611
- function vr(e) {
1583
+ function gr(e) {
1612
1584
  if (!e) return null;
1613
1585
  let t = e.split(" ")[0].trim();
1614
1586
  if (t === "/dev/null") return null;
1615
1587
  let n = t;
1616
1588
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
1617
1589
  }
1618
- var yr = (e) => e.startsWith("--- "), br = (e) => e.startsWith("+++ "), xr = (e) => e.startsWith("@@"), Sr = (e) => e.startsWith("+") && !(br(e) || e === "+++"), Cr = (e) => e.startsWith("-") && !(yr(e) || e === "---"), wr = (e, t) => {
1590
+ var _r = (e) => e.startsWith("--- "), vr = (e) => e.startsWith("+++ "), yr = (e) => e.startsWith("@@"), br = (e) => e.startsWith("+") && !(vr(e) || e === "+++"), xr = (e) => e.startsWith("-") && !(_r(e) || e === "---"), Sr = (e, t) => {
1619
1591
  e.has(t) || e.set(t, {
1620
1592
  additions: 0,
1621
1593
  deletions: 0
1622
1594
  });
1623
- }, Tr = (e, t) => {
1595
+ }, Cr = (e, t) => {
1624
1596
  let n = e.get(t);
1625
1597
  n && (n.additions += 1);
1626
- }, Er = (e, t) => {
1598
+ }, wr = (e, t) => {
1627
1599
  let n = e.get(t);
1628
1600
  n && (n.deletions += 1);
1629
- }, Dr = (e, t, n) => {
1630
- if (yr(e)) return {
1601
+ }, Tr = (e, t, n) => {
1602
+ if (_r(e)) return {
1631
1603
  ...t,
1632
- lastMinusHeader: vr(e.slice(4)),
1604
+ lastMinusHeader: gr(e.slice(4)),
1633
1605
  inHunk: !1
1634
1606
  };
1635
- if (br(e)) {
1636
- let r = vr(e.slice(4)) ?? t.lastMinusHeader;
1637
- return r && wr(n, r), {
1607
+ if (vr(e)) {
1608
+ let r = gr(e.slice(4)) ?? t.lastMinusHeader;
1609
+ return r && Sr(n, r), {
1638
1610
  ...t,
1639
1611
  currentPath: r,
1640
1612
  inHunk: !1
1641
1613
  };
1642
1614
  }
1643
- return t.currentPath ? xr(e) ? {
1615
+ return t.currentPath ? yr(e) ? {
1644
1616
  ...t,
1645
1617
  inHunk: !0
1646
- } : t.inHunk ? Sr(e) ? (Tr(n, t.currentPath), t) : (Cr(e) && Er(n, t.currentPath), t) : t : t;
1618
+ } : t.inHunk ? br(e) ? (Cr(n, t.currentPath), t) : (xr(e) && wr(n, t.currentPath), t) : t : t;
1647
1619
  };
1648
- function Or(e) {
1620
+ function Er(e) {
1649
1621
  if (!e || typeof e != "string") return [];
1650
1622
  let t = /* @__PURE__ */ new Map(), n = {
1651
1623
  currentPath: null,
1652
1624
  lastMinusHeader: null,
1653
1625
  inHunk: !1
1654
1626
  }, r = e.split(/\r?\n/);
1655
- for (let e of r) n = Dr(e, n, t);
1627
+ for (let e of r) n = Tr(e, n, t);
1656
1628
  return Array.from(t.entries()).map(([e, { additions: t, deletions: n }]) => ({
1657
1629
  filePath: e,
1658
1630
  additions: t,
1659
1631
  deletions: n
1660
1632
  }));
1661
1633
  }
1662
- function kr(e) {
1663
- return Or(e).map((e) => ({
1634
+ function Dr(e) {
1635
+ return Er(e).map((e) => ({
1664
1636
  kind: "diff",
1665
- fileName: _r(e.filePath),
1637
+ fileName: hr(e.filePath),
1666
1638
  filePath: e.filePath,
1667
1639
  additions: e.additions,
1668
1640
  deletions: e.deletions
1669
1641
  }));
1670
1642
  }
1671
- function Ar(e) {
1672
- return Or(e).map((e) => e.filePath);
1643
+ function Or(e) {
1644
+ return Er(e).map((e) => e.filePath);
1673
1645
  }
1674
- var jr = (e) => yr(e) || e.startsWith("diff --git "), Mr = (e) => e.startsWith(" ") || e.startsWith("+") || e.startsWith("-") ? !1 : e.trim() !== "", Nr = (e, t, n) => {
1646
+ var kr = (e) => _r(e) || e.startsWith("diff --git "), Ar = (e) => e.startsWith(" ") || e.startsWith("+") || e.startsWith("-") ? !1 : e.trim() !== "", jr = (e, t, n) => {
1675
1647
  if (e.startsWith(" ")) {
1676
1648
  let r = e.slice(1);
1677
1649
  t.push(r), n.push(r);
@@ -1682,26 +1654,26 @@ var jr = (e) => yr(e) || e.startsWith("diff --git "), Mr = (e) => e.startsWith("
1682
1654
  return;
1683
1655
  }
1684
1656
  e.startsWith("+") && n.push(e.slice(1));
1685
- }, Pr = (e, t, n, r) => {
1657
+ }, Mr = (e, t, n, r) => {
1686
1658
  let i = t;
1687
1659
  for (; i < e.length;) {
1688
1660
  let t = e[i] || "";
1689
- if (jr(t) || xr(t) || Mr(t)) break;
1690
- Nr(t, n, r), i += 1;
1661
+ if (kr(t) || yr(t) || Ar(t)) break;
1662
+ jr(t, n, r), i += 1;
1691
1663
  }
1692
1664
  return (n.length > 0 || r.length > 0) && (n.push(""), r.push("")), i;
1693
- }, Fr = (e, t) => {
1694
- let n = vr((e[t] || "").slice(4)), r = e[t + 1] || "";
1695
- if (!br(r)) return { nextIndex: t + 1 };
1696
- let i = vr(r.slice(4)) ?? n ?? "", a = [], o = [], s = t + 2;
1665
+ }, Nr = (e, t) => {
1666
+ let n = gr((e[t] || "").slice(4)), r = e[t + 1] || "";
1667
+ if (!vr(r)) return { nextIndex: t + 1 };
1668
+ let i = gr(r.slice(4)) ?? n ?? "", a = [], o = [], s = t + 2;
1697
1669
  for (; s < e.length;) {
1698
1670
  let t = e[s] || "";
1699
- if (jr(t)) break;
1700
- if (!xr(t)) {
1671
+ if (kr(t)) break;
1672
+ if (!yr(t)) {
1701
1673
  s += 1;
1702
1674
  continue;
1703
1675
  }
1704
- s = Pr(e, s + 1, a, o);
1676
+ s = Mr(e, s + 1, a, o);
1705
1677
  }
1706
1678
  return {
1707
1679
  nextIndex: s,
@@ -1712,22 +1684,22 @@ var jr = (e) => yr(e) || e.startsWith("diff --git "), Mr = (e) => e.startsWith("
1712
1684
  }
1713
1685
  };
1714
1686
  };
1715
- function Ir(e) {
1687
+ function Pr(e) {
1716
1688
  if (!e || typeof e != "string") return [];
1717
1689
  let t = e.split(/\r?\n/), n = [], r = 0;
1718
1690
  for (; r < t.length;) {
1719
- if (!yr(t[r] || "")) {
1691
+ if (!_r(t[r] || "")) {
1720
1692
  r += 1;
1721
1693
  continue;
1722
1694
  }
1723
- let { nextIndex: e, preview: i } = Fr(t, r);
1695
+ let { nextIndex: e, preview: i } = Nr(t, r);
1724
1696
  i && n.push(i), r = Math.max(e, r + 1);
1725
1697
  }
1726
1698
  return n;
1727
1699
  }
1728
1700
  //#endregion
1729
1701
  //#region src/components/chat-ui/tool-rendering/shared.ts
1730
- var Lr = {
1702
+ var Fr = {
1731
1703
  apply_patch: "Apply patch",
1732
1704
  bash: "Run command",
1733
1705
  edit: "Edit file",
@@ -1736,34 +1708,34 @@ var Lr = {
1736
1708
  read: "Read file",
1737
1709
  skill: "Load skill",
1738
1710
  todowrite: "Update todos"
1739
- }, Rr = {
1711
+ }, Ir = {
1740
1712
  error: "failed",
1741
1713
  "output-error": "failed",
1742
1714
  input_streaming: "running",
1743
1715
  running: "running",
1744
1716
  completed: "completed",
1745
1717
  failed: "failed"
1746
- }, zr = (e) => e.replace(/^tool-/, "").toLowerCase(), Br = (e) => e.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Vr = (e) => zr(e.tool ?? "tool"), Hr = (e) => {
1747
- let t = zr(e);
1748
- return Lr[t] ?? Br(t.replace(/_/g, " "));
1749
- }, Ur = (e) => {
1718
+ }, Lr = (e) => e.replace(/^tool-/, "").toLowerCase(), Rr = (e) => e.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), zr = (e) => Lr(e.tool ?? "tool"), Br = (e) => {
1719
+ let t = Lr(e);
1720
+ return Fr[t] ?? Rr(t.replace(/_/g, " "));
1721
+ }, Vr = (e) => {
1750
1722
  let t = e.state?.status ?? e.status;
1751
1723
  if (!t || typeof t != "string") return null;
1752
1724
  let n = t.replace(/-/g, "_");
1753
- return Rr[n] ? Rr[n] : n.includes("stream") ? "running" : null;
1754
- }, Wr = (e) => {
1725
+ return Ir[n] ? Ir[n] : n.includes("stream") ? "running" : null;
1726
+ }, Hr = (e) => {
1755
1727
  let t = e.state?.status ?? e.status;
1756
1728
  return t === "error" || t === "output-error" || t === "failed";
1757
- }, Gr = (e) => Wr(e) ? {
1729
+ }, Ur = (e) => Hr(e) ? {
1758
1730
  type: "icon",
1759
1731
  icon: "danger"
1760
1732
  } : {
1761
1733
  type: "icon",
1762
- icon: gr(Vr(e))
1763
- }, Kr = (e, t, n, r) => {
1734
+ icon: mr(zr(e))
1735
+ }, Wr = (e, t, n, r) => {
1764
1736
  let i = [{
1765
1737
  kind: "text",
1766
- text: n ?? Hr(e.tool ?? "tool"),
1738
+ text: n ?? Br(e.tool ?? "tool"),
1767
1739
  bold: !0
1768
1740
  }];
1769
1741
  t && i.push({
@@ -1775,100 +1747,100 @@ var Lr = {
1775
1747
  monospace: !0
1776
1748
  } : {}
1777
1749
  });
1778
- let a = Ur(e);
1750
+ let a = Vr(e);
1779
1751
  return a && a !== "completed" && i.push({
1780
1752
  kind: "text",
1781
1753
  text: a,
1782
1754
  muted: !0
1783
1755
  }), i;
1784
- }, qr = (e) => {
1756
+ }, Gr = (e) => {
1785
1757
  let t = e.state?.input;
1786
1758
  return !t || typeof t != "object" || Array.isArray(t) ? null : t;
1787
- }, Jr = (e) => {
1759
+ }, Kr = (e) => {
1788
1760
  let t = e.state?.output;
1789
1761
  return !t || typeof t != "object" || Array.isArray(t) ? null : t;
1790
- }, $ = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, Yr = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Xr = (e, t) => {
1791
- let n = Yr(e.state);
1792
- return n ? Yr(n[t]) : null;
1793
- }, Zr = (e) => e.replace(/\\/g, "/").replace(/^\/+/, ""), Qr = (e) => e.includes("--- ") && e.includes("+++ ") && e.includes("@@"), $r = (e) => {
1794
- let t = Jr(e);
1795
- return [Xr(e, "metadata"), Yr(t?.metadata)].filter(Boolean);
1796
- }, ei = (e) => {
1797
- let t = Yr(e);
1762
+ }, $ = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, qr = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Jr = (e, t) => {
1763
+ let n = qr(e.state);
1764
+ return n ? qr(n[t]) : null;
1765
+ }, Yr = (e) => e.replace(/\\/g, "/").replace(/^\/+/, ""), Xr = (e) => e.includes("--- ") && e.includes("+++ ") && e.includes("@@"), Zr = (e) => {
1766
+ let t = Kr(e);
1767
+ return [Jr(e, "metadata"), qr(t?.metadata)].filter(Boolean);
1768
+ }, Qr = (e) => {
1769
+ let t = qr(e);
1798
1770
  if (!t) return null;
1799
1771
  let n = $(t.filePath) ?? $(t.relativePath) ?? $(t.path);
1800
1772
  return n ? {
1801
- filePath: Zr(n),
1773
+ filePath: Yr(n),
1802
1774
  additions: typeof t.additions == "number" ? t.additions : 0,
1803
1775
  deletions: typeof t.deletions == "number" ? t.deletions : 0,
1804
1776
  diff: $(t.diff) ?? void 0,
1805
1777
  before: $(t.before) ?? void 0,
1806
1778
  after: $(t.after) ?? void 0
1807
1779
  } : null;
1808
- }, ti = (e) => {
1780
+ }, $r = (e) => {
1809
1781
  let t = [];
1810
- for (let n of $r(e)) {
1782
+ for (let n of Zr(e)) {
1811
1783
  let e = Array.isArray(n.files) ? n.files : [];
1812
1784
  for (let n of e) {
1813
- let e = ei(n);
1785
+ let e = Qr(n);
1814
1786
  e && t.push(e);
1815
1787
  }
1816
1788
  }
1817
1789
  return t;
1818
- }, ni = (e) => {
1819
- let t = qr(e), n = (Array.isArray(t?.changes) ? t.changes : []).map((e) => $(Yr(e)?.path)).filter((e) => !!e).map(Zr);
1790
+ }, ei = (e) => {
1791
+ let t = Gr(e), n = (Array.isArray(t?.changes) ? t.changes : []).map((e) => $(qr(e)?.path)).filter((e) => !!e).map(Yr);
1820
1792
  return Array.from(new Set(n));
1821
- }, ri = (e) => {
1822
- let t = qr(e), n = $(t?.diff);
1793
+ }, ti = (e) => {
1794
+ let t = Gr(e), n = $(t?.diff);
1823
1795
  if (n) return n;
1824
- for (let t of $r(e)) {
1796
+ for (let t of Zr(e)) {
1825
1797
  let e = $(t.diff);
1826
1798
  if (e) return e;
1827
1799
  }
1828
- let r = ti(e).map((e) => e.diff).filter((e) => !!e);
1800
+ let r = $r(e).map((e) => e.diff).filter((e) => !!e);
1829
1801
  if (r.length > 0) return r.join("\n");
1830
1802
  let i = $(t?.patchText);
1831
- return i && Qr(i) ? i : null;
1832
- }, ii = (e) => {
1803
+ return i && Xr(i) ? i : null;
1804
+ }, ni = (e) => {
1833
1805
  let t = /* @__PURE__ */ new Set(), n = [];
1834
1806
  for (let r of e) t.has(r.filePath) || (t.add(r.filePath), n.push({
1835
1807
  kind: "diff",
1836
- fileName: _r(r.filePath),
1808
+ fileName: hr(r.filePath),
1837
1809
  filePath: r.filePath,
1838
1810
  additions: r.additions,
1839
1811
  deletions: r.deletions
1840
1812
  }));
1841
1813
  return n;
1842
- }, ai = (e) => Array.from(new Set(e.map((e) => e.filePath))), oi = (e) => {
1843
- let t = Jr(e);
1814
+ }, ri = (e) => Array.from(new Set(e.map((e) => e.filePath))), ii = (e) => {
1815
+ let t = Kr(e);
1844
1816
  return $(e.state?.output) ?? $(t?.returnDisplay) ?? $(t?.preview) ?? $(t?.stdout) ?? $(t?.content);
1845
- }, si = (e) => {
1817
+ }, ai = (e) => {
1846
1818
  let t = e.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1847
1819
  return t ? {
1848
1820
  skillName: $(t[1]) ?? void 0,
1849
1821
  content: $(t[2]) ?? ""
1850
1822
  } : null;
1851
- }, ci = (e) => {
1852
- let t = qr(e);
1823
+ }, oi = (e) => {
1824
+ let t = Gr(e);
1853
1825
  return $(t?.name) ?? $(t?.skillName) ?? $(t?.skill) ?? $(t?.skill_name) ?? void 0;
1854
- }, li = (e, t) => ({
1826
+ }, si = (e, t) => ({
1855
1827
  kind: "link",
1856
- text: _r(e),
1828
+ text: hr(e),
1857
1829
  filePath: e,
1858
1830
  ...t ? { variant: t } : {}
1859
- }), ui = (e, t) => !Wr(e) || !e.state?.errorText ? t : [{
1831
+ }), ci = (e, t) => !Hr(e) || !e.state?.errorText ? t : [{
1860
1832
  type: "comment",
1861
1833
  text: e.state.errorText
1862
- }, ...t], di = (e) => Ir(e ?? void 0).map((e) => ({
1834
+ }, ...t], li = (e) => Pr(e ?? void 0).map((e) => ({
1863
1835
  type: "diff",
1864
1836
  language: "diff",
1865
1837
  original: e.original,
1866
1838
  modified: e.modified,
1867
1839
  sideBySide: !1
1868
- })), fi = (e) => kr(e ?? void 0), pi = (e) => Ar(e ?? void 0), mi = (e) => {
1869
- let t = ri(e), n = ti(e), r = ni(e), i = Kr(e, void 0, "Apply patch"), a = fi(t);
1870
- a.length > 0 ? i.push(...a) : n.length > 0 ? i.push(...ii(n)) : i.push(...r.map((e) => li(e, "bubble")));
1871
- let o = [...di(t)];
1840
+ })), ui = (e) => Dr(e ?? void 0), di = (e) => Or(e ?? void 0), fi = (e) => {
1841
+ let t = ti(e), n = $r(e), r = ei(e), i = Wr(e, void 0, "Apply patch"), a = ui(t);
1842
+ a.length > 0 ? i.push(...a) : n.length > 0 ? i.push(...ni(n)) : i.push(...r.map((e) => si(e, "bubble")));
1843
+ let o = [...li(t)];
1872
1844
  if (o.length === 0) for (let e of n) (e.before || e.after) && o.push({
1873
1845
  type: "diff",
1874
1846
  language: "diff",
@@ -1877,33 +1849,33 @@ var Lr = {
1877
1849
  sideBySide: !1
1878
1850
  });
1879
1851
  if (o.length === 0) {
1880
- let e = pi(t);
1881
- e.length === 0 && e.push(...ai(n)), e.length === 0 && e.push(...r), e.length > 0 && o.push({
1852
+ let e = di(t);
1853
+ e.length === 0 && e.push(...ri(n)), e.length === 0 && e.push(...r), e.length > 0 && o.push({
1882
1854
  type: "references",
1883
1855
  references: e
1884
1856
  });
1885
1857
  }
1886
1858
  return {
1887
- indicator: Gr(e),
1859
+ indicator: Ur(e),
1888
1860
  title: i,
1889
- blocks: ui(e, o)
1861
+ blocks: ci(e, o)
1890
1862
  };
1891
- }, hi = (e, t) => [{
1863
+ }, pi = (e, t) => [{
1892
1864
  type: "diff",
1893
1865
  language: "text",
1894
1866
  original: e,
1895
1867
  modified: t,
1896
1868
  sideBySide: !1
1897
- }], gi = (e) => {
1898
- let t = qr(e), n = Jr(e), r = $(t?.filePath) ?? $(t?.file_path) ?? $(n?.filePath) ?? void 0, i = $(n?.oldString) ?? $(t?.old_string) ?? void 0, a = $(n?.newString) ?? $(t?.new_string) ?? void 0, o = Kr(e, void 0, "Edit file");
1899
- r && o.push(li(r));
1900
- let s = i !== void 0 && a !== void 0 ? hi(i, a) : di($(n?.diff));
1869
+ }], mi = (e) => {
1870
+ let t = Gr(e), n = Kr(e), r = $(t?.filePath) ?? $(t?.file_path) ?? $(n?.filePath) ?? void 0, i = $(n?.oldString) ?? $(t?.old_string) ?? void 0, a = $(n?.newString) ?? $(t?.new_string) ?? void 0, o = Wr(e, void 0, "Edit file");
1871
+ r && o.push(si(r));
1872
+ let s = i !== void 0 && a !== void 0 ? pi(i, a) : li($(n?.diff));
1901
1873
  return {
1902
- indicator: Gr(e),
1874
+ indicator: Ur(e),
1903
1875
  title: o,
1904
- blocks: ui(e, s)
1876
+ blocks: ci(e, s)
1905
1877
  };
1906
- }, _i = (e) => {
1878
+ }, hi = (e) => {
1907
1879
  let { buildBaseTitle: t, buildIndicator: n, prependErrorBlock: r } = e;
1908
1880
  return (e) => {
1909
1881
  let i = on(e.state?.output) || on(e.state?.metadata), a = ln(e.state?.input), o = a ? {
@@ -1919,15 +1891,15 @@ var Lr = {
1919
1891
  expandable: !1
1920
1892
  };
1921
1893
  };
1922
- }, vi = (e) => {
1923
- let t = qr(e), n = Jr(e), r = $(t?.filePath) ?? $(t?.file_path) ?? $(t?.file) ?? $(n?.filePath) ?? $(n?.file) ?? $(n?.path) ?? void 0, i = Kr(e, void 0, "Read file");
1924
- return r && i.push(li(r)), {
1925
- indicator: Gr(e),
1894
+ }, gi = (e) => {
1895
+ let t = Gr(e), n = Kr(e), r = $(t?.filePath) ?? $(t?.file_path) ?? $(t?.file) ?? $(n?.filePath) ?? $(n?.file) ?? $(n?.path) ?? void 0, i = Wr(e, void 0, "Read file");
1896
+ return r && i.push(si(r)), {
1897
+ indicator: Ur(e),
1926
1898
  title: i,
1927
- blocks: ui(e, [])
1899
+ blocks: ci(e, [])
1928
1900
  };
1929
- }, yi = (e, t) => {
1930
- let n = qr(e), r = Jr(e), i = Kr(e, $(n?.command) ?? void 0, t, "monospace"), a = [], o = oi(e);
1901
+ }, _i = (e, t) => {
1902
+ let n = Gr(e), r = Kr(e), i = Wr(e, $(n?.command) ?? void 0, t, "monospace"), a = [], o = ii(e);
1931
1903
  o && a.push({
1932
1904
  type: "code",
1933
1905
  language: "text",
@@ -1942,23 +1914,23 @@ var Lr = {
1942
1914
  type: "text",
1943
1915
  text: `Exit code: ${r.exitCode}`
1944
1916
  }), {
1945
- indicator: Gr(e),
1917
+ indicator: Ur(e),
1946
1918
  title: i,
1947
- blocks: ui(e, a)
1919
+ blocks: ci(e, a)
1948
1920
  };
1949
- }, bi = (e) => yi(e, "Run command"), xi = (e) => yi(e, "Shell"), Si = (e) => {
1950
- let t = qr(e), n = oi(e), r = Kr(e, $(t?.pattern) ?? void 0, "Search files"), i = n ? [{
1921
+ }, vi = (e) => _i(e, "Run command"), yi = (e) => _i(e, "Shell"), bi = (e) => {
1922
+ let t = Gr(e), n = ii(e), r = Wr(e, $(t?.pattern) ?? void 0, "Search files"), i = n ? [{
1951
1923
  type: "code",
1952
1924
  language: "text",
1953
1925
  code: n
1954
1926
  }] : [];
1955
1927
  return {
1956
- indicator: Gr(e),
1928
+ indicator: Ur(e),
1957
1929
  title: r,
1958
- blocks: ui(e, i)
1930
+ blocks: ci(e, i)
1959
1931
  };
1960
- }, Ci = (e) => {
1961
- let t = qr(e), n = oi(e), r = Kr(e, $(t?.pattern) ?? void 0, "Find files"), i = [];
1932
+ }, xi = (e) => {
1933
+ let t = Gr(e), n = ii(e), r = Wr(e, $(t?.pattern) ?? void 0, "Find files"), i = [];
1962
1934
  if (n) {
1963
1935
  let e = n.split(/\r?\n/).map((e) => e.trim()).filter((e) => e.length > 0);
1964
1936
  e.length > 0 && i.push({
@@ -1967,50 +1939,50 @@ var Lr = {
1967
1939
  });
1968
1940
  }
1969
1941
  return {
1970
- indicator: Gr(e),
1942
+ indicator: Ur(e),
1971
1943
  title: r,
1972
- blocks: ui(e, i)
1944
+ blocks: ci(e, i)
1973
1945
  };
1974
- }, wi = (e) => {
1975
- let t = oi(e), n = t ? si(t) : null, r = Kr(e, ci(e) ?? n?.skillName, "Load skill"), i = n?.content ?? t, a = i ? [{
1946
+ }, Si = (e) => {
1947
+ let t = ii(e), n = t ? ai(t) : null, r = Wr(e, oi(e) ?? n?.skillName, "Load skill"), i = n?.content ?? t, a = i ? [{
1976
1948
  type: "code",
1977
1949
  language: "markdown",
1978
1950
  code: i
1979
1951
  }] : [];
1980
1952
  return {
1981
- indicator: Gr(e),
1953
+ indicator: Ur(e),
1982
1954
  title: r,
1983
- blocks: ui(e, a)
1955
+ blocks: ci(e, a)
1984
1956
  };
1985
- }, Ti = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, Ei = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Di = (e) => {
1986
- let t = Ei(e);
1957
+ }, Ci = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, wi = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Ti = (e) => {
1958
+ let t = wi(e);
1987
1959
  if (!t) return null;
1988
- let n = Ti(t.content) ?? Ti(t.title);
1960
+ let n = Ci(t.content) ?? Ci(t.title);
1989
1961
  return n ? {
1990
1962
  label: n,
1991
- checked: Ti(t.status) === "completed"
1963
+ checked: Ci(t.status) === "completed"
1992
1964
  } : null;
1993
- }, Oi = (e) => {
1965
+ }, Ei = (e) => {
1994
1966
  if (!e) return {
1995
1967
  items: [],
1996
1968
  explicit: !1
1997
1969
  };
1998
1970
  let t = (() => {
1999
1971
  if (Array.isArray(e)) return e;
2000
- let t = Ei(e);
1972
+ let t = wi(e);
2001
1973
  return !t || !Array.isArray(t.todos) ? null : t.todos;
2002
1974
  })();
2003
1975
  return t ? {
2004
- items: t.map(Di).filter((e) => e !== null),
1976
+ items: t.map(Ti).filter((e) => e !== null),
2005
1977
  explicit: !0
2006
1978
  } : {
2007
1979
  items: [],
2008
1980
  explicit: !1
2009
1981
  };
2010
- }, ki = (e) => {
1982
+ }, Di = (e) => {
2011
1983
  let { buildBaseTitle: t, buildIndicator: n, prependErrorBlock: r } = e;
2012
1984
  return (e) => {
2013
- let i = Oi(e.state?.input), a = Oi(e.state?.output), o = a.explicit ? a : i;
1985
+ let i = Ei(e.state?.input), a = Ei(e.state?.output), o = a.explicit ? a : i;
2014
1986
  if (!o.explicit) return null;
2015
1987
  let s = o.items, c = `${s.length} item${s.length === 1 ? "" : "s"}`, l = t(e, c, "Update todos");
2016
1988
  if (s.length === 0) return {
@@ -2031,37 +2003,37 @@ var Lr = {
2031
2003
  blocks: r(e, u)
2032
2004
  };
2033
2005
  };
2034
- }, Ai = _i({
2035
- buildBaseTitle: Kr,
2036
- buildIndicator: Gr,
2037
- prependErrorBlock: ui
2038
- }), ji = ki({
2039
- buildBaseTitle: Kr,
2040
- buildIndicator: Gr,
2041
- prependErrorBlock: ui
2042
- }), Mi = () => ({
2043
- apply_patch: mi,
2044
- bash: bi,
2045
- edit: gi,
2046
- glob: Ci,
2047
- grep: Si,
2048
- question: Ai,
2049
- read: vi,
2050
- shell: xi,
2051
- skill: wi,
2052
- todo_write: ji,
2053
- todowrite: ji
2054
- }), Ni = {
2006
+ }, Oi = hi({
2007
+ buildBaseTitle: Wr,
2008
+ buildIndicator: Ur,
2009
+ prependErrorBlock: ci
2010
+ }), ki = Di({
2011
+ buildBaseTitle: Wr,
2012
+ buildIndicator: Ur,
2013
+ prependErrorBlock: ci
2014
+ }), Ai = () => ({
2015
+ apply_patch: fi,
2016
+ bash: vi,
2017
+ edit: mi,
2018
+ glob: xi,
2019
+ grep: bi,
2020
+ question: Oi,
2021
+ read: gi,
2022
+ shell: yi,
2023
+ skill: Si,
2024
+ todo_write: ki,
2025
+ todowrite: ki
2026
+ }), ji = {
2055
2027
  error: "failed",
2056
2028
  "output-error": "failed",
2057
2029
  "input-streaming": "running"
2058
- }, Pi = (e) => e.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Fi = (e) => Pi(lr(e ?? "tool").replace(/_/g, " ")), Ii = (e) => e === "error" || e === "output-error", Li = (e) => Ii(e.state?.status) ? {
2030
+ }, Mi = (e) => e.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ni = (e) => Mi(sr(e ?? "tool").replace(/_/g, " ")), Pi = (e) => e === "error" || e === "output-error", Fi = (e) => Pi(e.state?.status) ? {
2059
2031
  type: "icon",
2060
2032
  icon: "danger"
2061
2033
  } : {
2062
2034
  type: "icon",
2063
- icon: gr(e.tool ?? "tool")
2064
- }, Ri = (e) => !e || typeof e != "string" ? null : Ni[e] ? Ni[e] : e.includes("stream") ? "running" : null, zi = (e) => {
2035
+ icon: mr(e.tool ?? "tool")
2036
+ }, Ii = (e) => !e || typeof e != "string" ? null : ji[e] ? ji[e] : e.includes("stream") ? "running" : null, Li = (e) => {
2065
2037
  if (typeof e == "string") return e;
2066
2038
  if (e == null) return null;
2067
2039
  try {
@@ -2069,30 +2041,30 @@ var Lr = {
2069
2041
  } catch {
2070
2042
  return null;
2071
2043
  }
2072
- }, Bi = (e) => e == null ? !0 : typeof e == "string" ? e.trim().length === 0 : Array.isArray(e) ? e.length === 0 || e.every(Bi) : typeof e == "object" && Object.values(e).every(Bi), Vi = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Hi = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, Ui = (e) => Hi(e.mime_type) ?? Hi(e.mediaType) ?? Hi(e.mimeType), Wi = (e) => !!e?.startsWith("image/"), Gi = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, Ki = (e, t) => {
2073
- let n = Vi(e);
2044
+ }, Ri = (e) => e == null ? !0 : typeof e == "string" ? e.trim().length === 0 : Array.isArray(e) ? e.length === 0 || e.every(Ri) : typeof e == "object" && Object.values(e).every(Ri), zi = (e) => !e || typeof e != "object" || Array.isArray(e) ? null : e, Bi = (e) => typeof e == "string" && e.trim().length > 0 ? e : null, Vi = (e) => Bi(e.mime_type) ?? Bi(e.mediaType) ?? Bi(e.mimeType), Hi = (e) => !!e?.startsWith("image/"), Ui = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, Wi = (e, t) => {
2045
+ let n = zi(e);
2074
2046
  if (!n) return null;
2075
- let r = Ui(n), i = Hi(n.data);
2076
- if (i && Wi(r)) return {
2047
+ let r = Vi(n), i = Bi(n.data);
2048
+ if (i && Hi(r)) return {
2077
2049
  type: "image",
2078
2050
  src: `data:${r};base64,${i}`,
2079
2051
  alt: t
2080
2052
  };
2081
- let a = Hi(n.url) ?? Hi(n.src);
2082
- return a && (Wi(r) || Gi.test(a)) ? {
2053
+ let a = Bi(n.url) ?? Bi(n.src);
2054
+ return a && (Hi(r) || Ui.test(a)) ? {
2083
2055
  type: "image",
2084
2056
  src: a,
2085
2057
  alt: t
2086
2058
  } : null;
2087
- }, qi = (e) => {
2088
- let t = Vi(e);
2059
+ }, Gi = (e) => {
2060
+ let t = zi(e);
2089
2061
  if (!t) return null;
2090
- let n = Hi(t.path) ?? Hi(t.filePath) ?? Hi(t.filename), r = Hi(t.content) ?? Hi(t.body) ?? Hi(t.text);
2062
+ let n = Bi(t.path) ?? Bi(t.filePath) ?? Bi(t.filename), r = Bi(t.content) ?? Bi(t.body) ?? Bi(t.text);
2091
2063
  return !n || r === null ? null : {
2092
2064
  filePath: n,
2093
2065
  content: r
2094
2066
  };
2095
- }, Ji = {
2067
+ }, Ki = {
2096
2068
  css: "css",
2097
2069
  html: "html",
2098
2070
  js: "js",
@@ -2104,88 +2076,88 @@ var Lr = {
2104
2076
  tsx: "tsx",
2105
2077
  yaml: "yaml",
2106
2078
  yml: "yaml"
2107
- }, Yi = (e) => {
2079
+ }, qi = (e) => {
2108
2080
  let t = e.split(".").pop()?.toLowerCase();
2109
- return t ? Ji[t] ?? t : "text";
2110
- }, Xi = (e, t) => t.length === 0 ? [] : [{
2081
+ return t ? Ki[t] ?? t : "text";
2082
+ }, Ji = (e, t) => t.length === 0 ? [] : [{
2111
2083
  type: "text",
2112
2084
  text: e
2113
- }, ...t], Zi = (e, t) => {
2085
+ }, ...t], Yi = (e, t) => {
2114
2086
  let n = [];
2115
2087
  for (let r of e) {
2116
- let e = Vi(r), i = Hi(e?.type);
2088
+ let e = zi(r), i = Bi(e?.type);
2117
2089
  if (i === "image") {
2118
- let e = Ki(r, t);
2090
+ let e = Wi(r, t);
2119
2091
  e && n.push(e);
2120
2092
  continue;
2121
2093
  }
2122
2094
  if (i === "text") {
2123
- let t = Hi(e?.text);
2095
+ let t = Bi(e?.text);
2124
2096
  t && n.push({
2125
2097
  type: "text",
2126
2098
  text: t
2127
2099
  });
2128
2100
  continue;
2129
2101
  }
2130
- n.push(...ea(r, t));
2102
+ n.push(...Qi(r, t));
2131
2103
  }
2132
2104
  return n;
2133
- }, Qi = (e) => {
2134
- let t = qi(e);
2105
+ }, Xi = (e) => {
2106
+ let t = Gi(e);
2135
2107
  return t ? [{
2136
2108
  type: "code",
2137
- language: Yi(t.filePath),
2109
+ language: qi(t.filePath),
2138
2110
  code: t.content
2139
2111
  }] : null;
2140
- }, $i = (e) => {
2141
- let t = Vi(e), n = Hi(t?.attachment_name) ?? Hi(t?.attachmentName), r = Hi(t?.attachment_file_id) ?? Hi(t?.attachmentFileId);
2112
+ }, Zi = (e) => {
2113
+ let t = zi(e), n = Bi(t?.attachment_name) ?? Bi(t?.attachmentName), r = Bi(t?.attachment_file_id) ?? Bi(t?.attachmentFileId);
2142
2114
  return !n && !r ? null : [{
2143
2115
  type: "text",
2144
2116
  text: n ?? `Attachment ${r}`
2145
2117
  }];
2146
- }, ea = (e, t) => {
2147
- if (Bi(e)) return [];
2148
- let n = Ki(e, t);
2118
+ }, Qi = (e, t) => {
2119
+ if (Ri(e)) return [];
2120
+ let n = Wi(e, t);
2149
2121
  if (n) return [n];
2150
- if (Array.isArray(e)) return Zi(e, t);
2151
- let r = Qi(e);
2122
+ if (Array.isArray(e)) return Yi(e, t);
2123
+ let r = Xi(e);
2152
2124
  if (r) return r;
2153
- let i = $i(e);
2125
+ let i = Zi(e);
2154
2126
  if (i) return i;
2155
- let a = zi(e);
2127
+ let a = Li(e);
2156
2128
  return a?.trim() ? [{
2157
2129
  type: "code",
2158
2130
  language: typeof e == "string" ? "text" : "json",
2159
2131
  code: a
2160
2132
  }] : [];
2161
- }, ta = (e) => {
2162
- let t = [], n = Fi(e.tool);
2163
- return Ii(e.state?.status) && e.state?.errorText && t.push({
2133
+ }, $i = (e) => {
2134
+ let t = [], n = Ni(e.tool);
2135
+ return Pi(e.state?.status) && e.state?.errorText && t.push({
2164
2136
  type: "comment",
2165
2137
  text: e.state.errorText
2166
- }), t.push(...Xi("Input", ea(e.state?.input, `${n} input`))), t.push(...Xi("Output", ea(e.state?.output, `${n} output`))), t;
2167
- }, na = (e) => {
2138
+ }), t.push(...Ji("Input", Qi(e.state?.input, `${n} input`))), t.push(...Ji("Output", Qi(e.state?.output, `${n} output`))), t;
2139
+ }, ea = (e) => {
2168
2140
  let t = [{
2169
2141
  kind: "text",
2170
- text: Fi(e.tool),
2142
+ text: Ni(e.tool),
2171
2143
  bold: !0
2172
- }], n = qi(e.state?.output);
2144
+ }], n = Gi(e.state?.output);
2173
2145
  n && t.push({
2174
2146
  kind: "link",
2175
2147
  text: n.filePath,
2176
2148
  filePath: n.filePath
2177
2149
  });
2178
- let r = Ri(e.state?.status);
2150
+ let r = Ii(e.state?.status);
2179
2151
  return r && t.push({
2180
2152
  kind: "text",
2181
2153
  text: r,
2182
2154
  muted: !0
2183
2155
  }), {
2184
- indicator: Li(e),
2156
+ indicator: Fi(e),
2185
2157
  title: t,
2186
- blocks: ta(e)
2158
+ blocks: $i(e)
2187
2159
  };
2188
- }, ra = (e) => e.kind === "text" || e.kind === "link" ? e.text.trim().length > 0 : e.kind !== "diff" || e.fileName.trim().length > 0, ia = (e) => {
2160
+ }, ta = (e) => e.kind === "text" || e.kind === "link" ? e.text.trim().length > 0 : e.kind !== "diff" || e.fileName.trim().length > 0, na = (e) => {
2189
2161
  switch (e.type) {
2190
2162
  case "comment":
2191
2163
  case "code":
@@ -2198,53 +2170,53 @@ var Lr = {
2198
2170
  case "input":
2199
2171
  case "component": return !0;
2200
2172
  }
2201
- }, aa = (e) => {
2202
- let t = e.title.some(ra), n = (e.blocks ?? []).some(ia);
2173
+ }, ra = (e) => {
2174
+ let t = e.title.some(ta), n = (e.blocks ?? []).some(na);
2203
2175
  return t || n;
2204
- }, oa = (e) => e ? {
2205
- ...Mi(),
2176
+ }, ia = (e) => e ? {
2177
+ ...Ai(),
2206
2178
  ...e
2207
- } : Mi(), sa = (e, t) => {
2179
+ } : Ai(), aa = (e, t) => {
2208
2180
  let n = e.tool ?? "tool";
2209
- for (let e of ur(n)) {
2181
+ for (let e of cr(n)) {
2210
2182
  let n = t[e];
2211
2183
  if (n) return n;
2212
2184
  }
2213
- }, ca = (e, t, n) => {
2214
- let r = sa(e, t);
2185
+ }, oa = (e, t, n) => {
2186
+ let r = aa(e, t);
2215
2187
  if (r) {
2216
2188
  let t = r(e, n);
2217
2189
  if (t) return t;
2218
2190
  }
2219
- return na(e);
2220
- }, la = (e, t) => {
2221
- let n = oa(t?.toolRenderers);
2222
- return { items: e.map((e) => ca(e, n, t)).filter(aa) };
2223
- }, ua = ge(() => import("./diff-editor-CGpeyoCE.js").then((e) => e.n).then((e) => ({ default: e.DiffEditor }))), da = (e) => {
2224
- let t = J(2), n;
2225
- return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ Y(me, {
2191
+ return ea(e);
2192
+ }, sa = (e, t) => {
2193
+ let n = ia(t?.toolRenderers);
2194
+ return { items: e.map((e) => oa(e, n, t)).filter(ra) };
2195
+ }, ca = _e(() => import("./diff-editor-CGpeyoCE.js").then((e) => e.n).then((e) => ({ default: e.DiffEditor }))), la = (e) => {
2196
+ let t = q(2), n;
2197
+ return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ J(he, {
2226
2198
  fallback: null,
2227
- children: /* @__PURE__ */ Y(ua, { ...e })
2199
+ children: /* @__PURE__ */ J(ca, { ...e })
2228
2200
  }), t[0] = e, t[1] = n), n;
2229
2201
  };
2230
2202
  //#endregion
2231
2203
  //#region src/components/chat-ui/components/timeline-indicator.tsx
2232
- function fa(e) {
2233
- let t = J(10), { ind: n } = e;
2204
+ function ua(e) {
2205
+ let t = q(10), { ind: n } = e;
2234
2206
  if (!n || n.type === "none") return null;
2235
2207
  if (n.type === "icon") {
2236
2208
  let e;
2237
- t[0] === n.icon ? e = t[1] : (e = hr(n.icon), t[0] = n.icon, t[1] = e);
2209
+ t[0] === n.icon ? e = t[1] : (e = pr(n.icon), t[0] = n.icon, t[1] = e);
2238
2210
  let r = e, i;
2239
- return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ Y(oe.Indicator, {
2211
+ return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ J(se.Indicator, {
2240
2212
  outline: "none",
2241
2213
  border: "none",
2242
2214
  background: "bg",
2243
2215
  color: "fg",
2244
- children: /* @__PURE__ */ Y(re, {
2216
+ children: /* @__PURE__ */ J(H, {
2245
2217
  display: "inline-flex",
2246
2218
  alignItems: "center",
2247
- children: /* @__PURE__ */ Y(r, {
2219
+ children: /* @__PURE__ */ J(r, {
2248
2220
  size: 14,
2249
2221
  strokeWidth: 1
2250
2222
  })
@@ -2252,68 +2224,68 @@ function fa(e) {
2252
2224
  }), t[2] = r, t[3] = i), i;
2253
2225
  }
2254
2226
  let r;
2255
- t[4] !== n.alt || t[5] !== n.src ? (r = /* @__PURE__ */ Y(k.Image, {
2227
+ t[4] !== n.alt || t[5] !== n.src ? (r = /* @__PURE__ */ J(k.Image, {
2256
2228
  src: n.src,
2257
2229
  alt: n.alt
2258
2230
  }), t[4] = n.alt, t[5] = n.src, t[6] = r) : r = t[6];
2259
2231
  let i;
2260
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ Y(k.Fallback, {
2232
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ J(k.Fallback, {
2261
2233
  background: "bg.muted",
2262
2234
  color: "fg.muted"
2263
2235
  }), t[7] = i) : i = t[7];
2264
2236
  let a;
2265
- return t[8] === r ? a = t[9] : (a = /* @__PURE__ */ Y(oe.Indicator, { children: /* @__PURE__ */ X(k.Root, {
2237
+ return t[8] === r ? a = t[9] : (a = /* @__PURE__ */ J(se.Indicator, { children: /* @__PURE__ */ Y(k.Root, {
2266
2238
  boxSize: "full",
2267
2239
  children: [r, i]
2268
2240
  }) }), t[8] = r, t[9] = a), a;
2269
2241
  }
2270
2242
  //#endregion
2271
2243
  //#region src/components/chat-ui/components/timeline-title.tsx
2272
- var pa = (e, t, n, r = !1) => {
2244
+ var da = (e, t, n, r = !1) => {
2273
2245
  r && e.stopPropagation(), t.href || e.preventDefault(), t.filePath && n?.(t.filePath);
2274
2246
  };
2275
- function ma(e) {
2276
- let t = J(6), { seg: n } = e, r;
2277
- t[0] !== n.alt || t[1] !== n.src ? (r = /* @__PURE__ */ Y(k.Image, {
2247
+ function fa(e) {
2248
+ let t = q(6), { seg: n } = e, r;
2249
+ t[0] !== n.alt || t[1] !== n.src ? (r = /* @__PURE__ */ J(k.Image, {
2278
2250
  src: n.src,
2279
2251
  alt: n.alt
2280
2252
  }), t[0] = n.alt, t[1] = n.src, t[2] = r) : r = t[2];
2281
2253
  let i;
2282
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ Y(k.Fallback, {
2254
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ J(k.Fallback, {
2283
2255
  background: "bg.muted",
2284
2256
  color: "fg.muted"
2285
2257
  }), t[3] = i) : i = t[3];
2286
2258
  let a;
2287
- return t[4] === r ? a = t[5] : (a = /* @__PURE__ */ X(k.Root, {
2259
+ return t[4] === r ? a = t[5] : (a = /* @__PURE__ */ Y(k.Root, {
2288
2260
  width: "1.5rem",
2289
2261
  height: "1.5rem",
2290
2262
  children: [r, i]
2291
2263
  }), t[4] = r, t[5] = a), a;
2292
2264
  }
2293
- function ha(e) {
2294
- let t = J(9), { seg: n, onOpenFile: r } = e, i = n.additions ?? 0, a = n.deletions ?? 0, o;
2265
+ function pa(e) {
2266
+ let t = q(9), { seg: n, onOpenFile: r } = e, i = n.additions ?? 0, a = n.deletions ?? 0, o;
2295
2267
  t[0] !== r || t[1] !== n.fileName || t[2] !== n.filePath ? (o = () => {
2296
2268
  let e = n.filePath ?? n.fileName;
2297
2269
  r?.(e);
2298
2270
  }, t[0] = r, t[1] = n.fileName, t[2] = n.filePath, t[3] = o) : o = t[3];
2299
2271
  let s;
2300
- return t[4] !== n.fileName || t[5] !== i || t[6] !== a || t[7] !== o ? (s = /* @__PURE__ */ Y(D, {
2272
+ return t[4] !== n.fileName || t[5] !== i || t[6] !== a || t[7] !== o ? (s = /* @__PURE__ */ J(D, {
2301
2273
  fileName: n.fileName,
2302
2274
  additions: i,
2303
2275
  deletions: a,
2304
2276
  onClickFileLink: o
2305
2277
  }), t[4] = n.fileName, t[5] = i, t[6] = a, t[7] = o, t[8] = s) : s = t[8], s;
2306
2278
  }
2307
- function ga(e) {
2308
- let t = J(13), { seg: n, onOpenFile: r } = e, i = n.bold ? "medium" : void 0, a = !!(n.href || n.filePath), o = n.href ?? "#", s = (n.muted, "fg.muted"), c = a ? "pointer" : "default", l;
2309
- t[0] !== r || t[1] !== n ? (l = (e) => pa(e, n, r, !0), t[0] = r, t[1] = n, t[2] = l) : l = t[2];
2279
+ function ma(e) {
2280
+ let t = q(13), { seg: n, onOpenFile: r } = e, i = n.bold ? "medium" : void 0, a = !!(n.href || n.filePath), o = n.href ?? "#", s = (n.muted, "fg.muted"), c = a ? "pointer" : "default", l;
2281
+ t[0] !== r || t[1] !== n ? (l = (e) => da(e, n, r, !0), t[0] = r, t[1] = n, t[2] = l) : l = t[2];
2310
2282
  let u = n.muted ? "fg.muted" : "fg.blue-dark", d;
2311
2283
  t[3] === u ? d = t[4] : (d = {
2312
2284
  textDecoration: "underline",
2313
2285
  color: u
2314
2286
  }, t[3] = u, t[4] = d);
2315
2287
  let f;
2316
- return t[5] !== i || t[6] !== n.text || t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l || t[11] !== d ? (f = /* @__PURE__ */ Y(H, {
2288
+ return t[5] !== i || t[6] !== n.text || t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l || t[11] !== d ? (f = /* @__PURE__ */ J(te, {
2317
2289
  href: o,
2318
2290
  fontWeight: i,
2319
2291
  color: s,
@@ -2324,16 +2296,16 @@ function ga(e) {
2324
2296
  children: n.text
2325
2297
  }), t[5] = i, t[6] = n.text, t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = d, t[12] = f) : f = t[12], f;
2326
2298
  }
2327
- function _a(e) {
2328
- let t = J(12), { seg: n, onOpenFile: r } = e, i = n.bold ? "medium" : void 0, a = n.href ?? "#", o = n.muted ? "fg.muted" : "accent.primary", s;
2329
- t[0] !== r || t[1] !== n ? (s = (e) => pa(e, n, r), t[0] = r, t[1] = n, t[2] = s) : s = t[2];
2299
+ function ha(e) {
2300
+ let t = q(12), { seg: n, onOpenFile: r } = e, i = n.bold ? "medium" : void 0, a = n.href ?? "#", o = n.muted ? "fg.muted" : "accent.primary", s;
2301
+ t[0] !== r || t[1] !== n ? (s = (e) => da(e, n, r), t[0] = r, t[1] = n, t[2] = s) : s = t[2];
2330
2302
  let c = n.muted ? "fg.muted" : "accent.primary", l;
2331
2303
  t[3] === c ? l = t[4] : (l = {
2332
2304
  color: c,
2333
2305
  textDecoration: "underline"
2334
2306
  }, t[3] = c, t[4] = l);
2335
2307
  let u;
2336
- return t[5] !== i || t[6] !== n.text || t[7] !== a || t[8] !== o || t[9] !== s || t[10] !== l ? (u = /* @__PURE__ */ Y(H, {
2308
+ return t[5] !== i || t[6] !== n.text || t[7] !== a || t[8] !== o || t[9] !== s || t[10] !== l ? (u = /* @__PURE__ */ J(te, {
2337
2309
  href: a,
2338
2310
  fontWeight: i,
2339
2311
  color: o,
@@ -2343,11 +2315,11 @@ function _a(e) {
2343
2315
  children: n.text
2344
2316
  }), t[5] = i, t[6] = n.text, t[7] = a, t[8] = o, t[9] = s, t[10] = l, t[11] = u) : u = t[11], u;
2345
2317
  }
2346
- function va(e) {
2347
- let n = J(14), { seg: r, isClickable: i } = e, a = r.bold ? "medium" : void 0, o = r.monospace ? "mono/XS" : void 0, s = r.truncate ? "0" : void 0, c = r.truncate ? "hidden" : void 0, l = r.truncate ? "ellipsis" : void 0, u = r.truncate ? "nowrap" : void 0, d = i && !r.muted ? "fg" : "fg.muted", f;
2318
+ function ga(e) {
2319
+ let n = q(14), { seg: r, isClickable: i } = e, a = r.bold ? "medium" : void 0, o = r.monospace ? "mono/XS" : void 0, s = r.truncate ? "0" : void 0, c = r.truncate ? "hidden" : void 0, l = r.truncate ? "ellipsis" : void 0, u = r.truncate ? "nowrap" : void 0, d = i && !r.muted ? "fg" : "fg.muted", f;
2348
2320
  n[0] === d ? f = n[1] : (f = { color: d }, n[0] = d, n[1] = f);
2349
2321
  let p;
2350
- n[2] !== r.text || n[3] !== a || n[4] !== o || n[5] !== s || n[6] !== c || n[7] !== l || n[8] !== u || n[9] !== f ? (p = /* @__PURE__ */ Y(re, {
2322
+ n[2] !== r.text || n[3] !== a || n[4] !== o || n[5] !== s || n[6] !== c || n[7] !== l || n[8] !== u || n[9] !== f ? (p = /* @__PURE__ */ J(H, {
2351
2323
  fontWeight: a,
2352
2324
  textStyle: o,
2353
2325
  color: "fg.muted",
@@ -2361,13 +2333,13 @@ function va(e) {
2361
2333
  let m = p;
2362
2334
  if (!r.truncate) return m;
2363
2335
  let h;
2364
- return n[11] !== r.text || n[12] !== m ? (h = /* @__PURE__ */ Y(t, {
2336
+ return n[11] !== r.text || n[12] !== m ? (h = /* @__PURE__ */ J(t, {
2365
2337
  content: r.text,
2366
2338
  children: m
2367
2339
  }), n[11] = r.text, n[12] = m, n[13] = h) : h = n[13], h;
2368
2340
  }
2369
- function ya(e) {
2370
- let t = J(22), { seg: n, isClickable: r, onOpenFile: i } = e;
2341
+ function _a(e) {
2342
+ let t = q(22), { seg: n, isClickable: r, onOpenFile: i } = e;
2371
2343
  if (b() && (n.kind === "link" || n.kind === "diff") && (n.filePath || n.kind === "diff")) {
2372
2344
  let e = n.filePath ?? (n.kind === "diff" ? n.fileName : n.text), r;
2373
2345
  t[0] === e ? r = t[1] : (r = {
@@ -2375,13 +2347,13 @@ function ya(e) {
2375
2347
  origin: "tool"
2376
2348
  }, t[0] = e, t[1] = r);
2377
2349
  let i;
2378
- t[2] !== n.additions || t[3] !== n.deletions || t[4] !== n.fileName || t[5] !== n.kind || t[6] !== n.text ? (i = n.kind === "diff" ? /* @__PURE__ */ Y(D, {
2350
+ t[2] !== n.additions || t[3] !== n.deletions || t[4] !== n.fileName || t[5] !== n.kind || t[6] !== n.text ? (i = n.kind === "diff" ? /* @__PURE__ */ J(D, {
2379
2351
  fileName: n.fileName,
2380
2352
  additions: n.additions ?? 0,
2381
2353
  deletions: n.deletions ?? 0
2382
2354
  }) : n.text, t[2] = n.additions, t[3] = n.deletions, t[4] = n.fileName, t[5] = n.kind, t[6] = n.text, t[7] = i) : i = t[7];
2383
2355
  let a;
2384
- return t[8] !== r || t[9] !== i ? (a = /* @__PURE__ */ Y(x, {
2356
+ return t[8] !== r || t[9] !== i ? (a = /* @__PURE__ */ J(x, {
2385
2357
  candidate: r,
2386
2358
  children: i
2387
2359
  }), t[8] = r, t[9] = i, t[10] = a) : a = t[10], a;
@@ -2389,28 +2361,28 @@ function ya(e) {
2389
2361
  switch (n.kind) {
2390
2362
  case "avatar": {
2391
2363
  let e;
2392
- return t[11] === n ? e = t[12] : (e = /* @__PURE__ */ Y(ma, { seg: n }), t[11] = n, t[12] = e), e;
2364
+ return t[11] === n ? e = t[12] : (e = /* @__PURE__ */ J(fa, { seg: n }), t[11] = n, t[12] = e), e;
2393
2365
  }
2394
2366
  case "diff": {
2395
2367
  let e;
2396
- return t[13] !== i || t[14] !== n ? (e = /* @__PURE__ */ Y(ha, {
2368
+ return t[13] !== i || t[14] !== n ? (e = /* @__PURE__ */ J(pa, {
2397
2369
  seg: n,
2398
2370
  onOpenFile: i
2399
2371
  }), t[13] = i, t[14] = n, t[15] = e) : e = t[15], e;
2400
2372
  }
2401
2373
  case "link": {
2402
2374
  let e;
2403
- return t[16] !== i || t[17] !== n ? (e = n.variant === "bubble" ? /* @__PURE__ */ Y(ga, {
2375
+ return t[16] !== i || t[17] !== n ? (e = n.variant === "bubble" ? /* @__PURE__ */ J(ma, {
2404
2376
  seg: n,
2405
2377
  onOpenFile: i
2406
- }) : /* @__PURE__ */ Y(_a, {
2378
+ }) : /* @__PURE__ */ J(ha, {
2407
2379
  seg: n,
2408
2380
  onOpenFile: i
2409
2381
  }), t[16] = i, t[17] = n, t[18] = e) : e = t[18], e;
2410
2382
  }
2411
2383
  case "text": {
2412
2384
  let e;
2413
- return t[19] !== r || t[20] !== n ? (e = /* @__PURE__ */ Y(va, {
2385
+ return t[19] !== r || t[20] !== n ? (e = /* @__PURE__ */ J(ga, {
2414
2386
  seg: n,
2415
2387
  isClickable: r
2416
2388
  }), t[19] = r, t[20] = n, t[21] = e) : e = t[21], e;
@@ -2420,15 +2392,15 @@ function ya(e) {
2420
2392
  }
2421
2393
  //#endregion
2422
2394
  //#region src/components/chat-ui/components/timeline.tsx
2423
- var ba = oe;
2424
- function xa(e) {
2425
- let t = J(5), { code: r, language: i } = e, a = i ? `${i} code block` : "code block", o;
2426
- t[0] === r ? o = t[1] : (o = /* @__PURE__ */ Y(A, {
2395
+ var va = se;
2396
+ function ya(e) {
2397
+ let t = q(5), { code: r, language: i } = e, a = i ? `${i} code block` : "code block", o;
2398
+ t[0] === r ? o = t[1] : (o = /* @__PURE__ */ J(A, {
2427
2399
  as: "code",
2428
2400
  children: r
2429
2401
  }), t[0] = r, t[1] = o);
2430
2402
  let s;
2431
- return t[2] !== a || t[3] !== o ? (s = /* @__PURE__ */ Y(n, {
2403
+ return t[2] !== a || t[3] !== o ? (s = /* @__PURE__ */ J(n, {
2432
2404
  background: "bg.code",
2433
2405
  color: "fg.muted",
2434
2406
  borderWidth: "1px",
@@ -2436,7 +2408,7 @@ function xa(e) {
2436
2408
  borderRadius: "md",
2437
2409
  showHorizontalScrollbar: !0,
2438
2410
  showVerticalScrollbar: !1,
2439
- children: /* @__PURE__ */ Y(A, {
2411
+ children: /* @__PURE__ */ J(A, {
2440
2412
  as: "pre",
2441
2413
  padding: "sm",
2442
2414
  textStyle: "mono/XS",
@@ -2446,25 +2418,25 @@ function xa(e) {
2446
2418
  })
2447
2419
  }), t[2] = a, t[3] = o, t[4] = s) : s = t[4], s;
2448
2420
  }
2449
- function Sa(e) {
2450
- let t = J(38), { b: n, onOpenFile: r } = e;
2421
+ function ba(e) {
2422
+ let t = q(38), { b: n, onOpenFile: r } = e;
2451
2423
  switch (n.type) {
2452
2424
  case "comment": {
2453
2425
  let e;
2454
- t[0] === n.text ? e = t[1] : (e = /* @__PURE__ */ Y(M.Body, { children: n.text }), t[0] = n.text, t[1] = e);
2426
+ t[0] === n.text ? e = t[1] : (e = /* @__PURE__ */ J(M.Body, { children: n.text }), t[0] = n.text, t[1] = e);
2455
2427
  let r;
2456
- t[2] === n.reactions ? r = t[3] : (r = n.reactions?.clap ? /* @__PURE__ */ Y(M.Footer, { children: /* @__PURE__ */ X(j, { children: ["👏 ", n.reactions.clap] }) }) : null, t[2] = n.reactions, t[3] = r);
2428
+ t[2] === n.reactions ? r = t[3] : (r = n.reactions?.clap ? /* @__PURE__ */ J(M.Footer, { children: /* @__PURE__ */ Y(j, { children: ["👏 ", n.reactions.clap] }) }) : null, t[2] = n.reactions, t[3] = r);
2457
2429
  let i;
2458
- return t[4] !== e || t[5] !== r ? (i = /* @__PURE__ */ X(M.Root, { children: [e, r] }), t[4] = e, t[5] = r, t[6] = i) : i = t[6], i;
2430
+ return t[4] !== e || t[5] !== r ? (i = /* @__PURE__ */ Y(M.Root, { children: [e, r] }), t[4] = e, t[5] = r, t[6] = i) : i = t[6], i;
2459
2431
  }
2460
2432
  case "code": {
2461
2433
  let e;
2462
- return t[7] !== n.code || t[8] !== n.language ? (e = /* @__PURE__ */ Y(M.Root, {
2434
+ return t[7] !== n.code || t[8] !== n.language ? (e = /* @__PURE__ */ J(M.Root, {
2463
2435
  border: "0",
2464
2436
  padding: "0",
2465
- children: /* @__PURE__ */ Y(M.Body, {
2437
+ children: /* @__PURE__ */ J(M.Body, {
2466
2438
  padding: "0",
2467
- children: /* @__PURE__ */ Y(xa, {
2439
+ children: /* @__PURE__ */ J(ya, {
2468
2440
  language: n.language,
2469
2441
  code: n.code
2470
2442
  })
@@ -2473,16 +2445,16 @@ function Sa(e) {
2473
2445
  }
2474
2446
  case "diff": {
2475
2447
  let e = n.sideBySide ?? !1, r;
2476
- return t[10] !== n.language || t[11] !== n.modified || t[12] !== n.original || t[13] !== e ? (r = /* @__PURE__ */ Y(M.Root, {
2448
+ return t[10] !== n.language || t[11] !== n.modified || t[12] !== n.original || t[13] !== e ? (r = /* @__PURE__ */ J(M.Root, {
2477
2449
  border: "0",
2478
2450
  padding: "0",
2479
- children: /* @__PURE__ */ Y(M.Body, {
2451
+ children: /* @__PURE__ */ J(M.Body, {
2480
2452
  padding: "0",
2481
- children: /* @__PURE__ */ Y(A, {
2453
+ children: /* @__PURE__ */ J(A, {
2482
2454
  height: "240px",
2483
2455
  minW: "320px",
2484
2456
  overflow: "hidden",
2485
- children: /* @__PURE__ */ Y(da, {
2457
+ children: /* @__PURE__ */ J(la, {
2486
2458
  original: n.original,
2487
2459
  modified: n.modified,
2488
2460
  language: n.language,
@@ -2495,11 +2467,11 @@ function Sa(e) {
2495
2467
  }
2496
2468
  case "text": {
2497
2469
  let e;
2498
- return t[15] === n.text ? e = t[16] : (e = /* @__PURE__ */ Y(M.Root, {
2470
+ return t[15] === n.text ? e = t[16] : (e = /* @__PURE__ */ J(M.Root, {
2499
2471
  background: "transparent",
2500
- children: /* @__PURE__ */ Y(M.Body, {
2472
+ children: /* @__PURE__ */ J(M.Body, {
2501
2473
  padding: "sm",
2502
- children: /* @__PURE__ */ Y(K, {
2474
+ children: /* @__PURE__ */ J(G, {
2503
2475
  textStyle: "label/S/regular",
2504
2476
  children: n.text
2505
2477
  })
@@ -2508,17 +2480,17 @@ function Sa(e) {
2508
2480
  }
2509
2481
  case "todo-list": {
2510
2482
  let e;
2511
- return t[17] === n.items ? e = t[18] : (e = /* @__PURE__ */ Y(Tn, { items: n.items }), t[17] = n.items, t[18] = e), e;
2483
+ return t[17] === n.items ? e = t[18] : (e = /* @__PURE__ */ J(Tn, { items: n.items }), t[17] = n.items, t[18] = e), e;
2512
2484
  }
2513
2485
  case "question-form": {
2514
2486
  let e;
2515
- return t[19] === n.questions ? e = t[20] : (e = /* @__PURE__ */ Y(kn, { questions: n.questions }), t[19] = n.questions, t[20] = e), e;
2487
+ return t[19] === n.questions ? e = t[20] : (e = /* @__PURE__ */ J(kn, { questions: n.questions }), t[19] = n.questions, t[20] = e), e;
2516
2488
  }
2517
2489
  case "references": {
2518
2490
  let e;
2519
- t[21] === n.references ? e = t[22] : (e = n.references.map(Ca), t[21] = n.references, t[22] = e);
2491
+ t[21] === n.references ? e = t[22] : (e = n.references.map(xa), t[21] = n.references, t[22] = e);
2520
2492
  let r;
2521
- return t[23] === e ? r = t[24] : (r = /* @__PURE__ */ Y(G, {
2493
+ return t[23] === e ? r = t[24] : (r = /* @__PURE__ */ J(W, {
2522
2494
  mt: "xs",
2523
2495
  gap: "xs",
2524
2496
  flexDir: "row",
@@ -2529,7 +2501,7 @@ function Sa(e) {
2529
2501
  case "image": {
2530
2502
  if (!n.src.trim()) return null;
2531
2503
  let e;
2532
- t[25] !== n.alt || t[26] !== n.src ? (e = /* @__PURE__ */ Y(z, {
2504
+ t[25] !== n.alt || t[26] !== n.src ? (e = /* @__PURE__ */ J(R, {
2533
2505
  src: n.src,
2534
2506
  alt: n.alt,
2535
2507
  maxH: "18rem",
@@ -2540,18 +2512,18 @@ function Sa(e) {
2540
2512
  borderColor: "border.subtle"
2541
2513
  }), t[25] = n.alt, t[26] = n.src, t[27] = e) : e = t[27];
2542
2514
  let r;
2543
- t[28] === n.caption ? r = t[29] : (r = n.caption ? /* @__PURE__ */ Y(K, {
2515
+ t[28] === n.caption ? r = t[29] : (r = n.caption ? /* @__PURE__ */ J(G, {
2544
2516
  mt: "2xs",
2545
2517
  textStyle: "label/XS/regular",
2546
2518
  color: "fg.muted",
2547
2519
  children: n.caption
2548
2520
  }) : null, t[28] = n.caption, t[29] = r);
2549
2521
  let i;
2550
- return t[30] !== e || t[31] !== r ? (i = /* @__PURE__ */ Y(M.Root, {
2522
+ return t[30] !== e || t[31] !== r ? (i = /* @__PURE__ */ J(M.Root, {
2551
2523
  border: "0",
2552
2524
  padding: "0",
2553
2525
  background: "transparent",
2554
- children: /* @__PURE__ */ X(M.Body, {
2526
+ children: /* @__PURE__ */ Y(M.Body, {
2555
2527
  padding: "0",
2556
2528
  children: [e, r]
2557
2529
  })
@@ -2561,26 +2533,26 @@ function Sa(e) {
2561
2533
  let e;
2562
2534
  t[33] !== n || t[34] !== r ? (e = n.render({ onOpenFile: r }), t[33] = n, t[34] = r, t[35] = e) : e = t[35];
2563
2535
  let i;
2564
- return t[36] === e ? i = t[37] : (i = /* @__PURE__ */ Y(fe, { children: e }), t[36] = e, t[37] = i), i;
2536
+ return t[36] === e ? i = t[37] : (i = /* @__PURE__ */ J(pe, { children: e }), t[36] = e, t[37] = i), i;
2565
2537
  }
2566
2538
  }
2567
2539
  }
2568
- function Ca(e) {
2569
- return /* @__PURE__ */ Y(x, {
2540
+ function xa(e) {
2541
+ return /* @__PURE__ */ J(x, {
2570
2542
  candidate: {
2571
2543
  source: e,
2572
2544
  origin: "tool"
2573
2545
  },
2574
- children: /* @__PURE__ */ Y(o, { fileName: e })
2546
+ children: /* @__PURE__ */ J(o, { fileName: e })
2575
2547
  }, e);
2576
2548
  }
2577
- function wa(e) {
2578
- let t = J(23), { item: n, itemKey: r, isOpen: i, canExpand: a, hasBlocks: o, onToggle: s, onOpenFile: c } = e, l;
2579
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ Y(ba.Separator, {}), t[0] = l) : l = t[0];
2549
+ function Sa(e) {
2550
+ let t = q(23), { item: n, itemKey: r, isOpen: i, canExpand: a, hasBlocks: o, onToggle: s, onOpenFile: c } = e, l;
2551
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ J(va.Separator, {}), t[0] = l) : l = t[0];
2580
2552
  let u;
2581
- t[1] === n.indicator ? u = t[2] : (u = /* @__PURE__ */ X(ba.Connector, { children: [l, /* @__PURE__ */ Y(fa, { ind: n.indicator })] }), t[1] = n.indicator, t[2] = u);
2553
+ t[1] === n.indicator ? u = t[2] : (u = /* @__PURE__ */ Y(va.Connector, { children: [l, /* @__PURE__ */ J(ua, { ind: n.indicator })] }), t[1] = n.indicator, t[2] = u);
2582
2554
  let d = i ? "auto" : "20px", f;
2583
- t[3] !== a || t[4] !== i || t[5] !== n.title || t[6] !== r || t[7] !== c || t[8] !== s ? (f = n.title.length > 0 && /* @__PURE__ */ Y(ba.Title, {
2555
+ t[3] !== a || t[4] !== i || t[5] !== n.title || t[6] !== r || t[7] !== c || t[8] !== s ? (f = n.title.length > 0 && /* @__PURE__ */ J(va.Title, {
2584
2556
  className: "group",
2585
2557
  fontWeight: "normal",
2586
2558
  display: "flex",
@@ -2590,14 +2562,14 @@ function wa(e) {
2590
2562
  overflow: "hidden",
2591
2563
  cursor: a ? "pointer" : "default",
2592
2564
  onClick: a ? () => s(r) : void 0,
2593
- children: /* @__PURE__ */ X(re, {
2565
+ children: /* @__PURE__ */ Y(H, {
2594
2566
  display: "flex",
2595
2567
  alignItems: "center",
2596
2568
  gap: "sm",
2597
2569
  flexWrap: "nowrap",
2598
2570
  minW: "0",
2599
2571
  width: "full",
2600
- children: [/* @__PURE__ */ Y(re, {
2572
+ children: [/* @__PURE__ */ J(H, {
2601
2573
  display: "flex",
2602
2574
  alignItems: "center",
2603
2575
  gap: "xs",
@@ -2605,12 +2577,12 @@ function wa(e) {
2605
2577
  minW: "0",
2606
2578
  flex: "1",
2607
2579
  overflow: "hidden",
2608
- children: n.title.map((e, t) => /* @__PURE__ */ Y(ya, {
2580
+ children: n.title.map((e, t) => /* @__PURE__ */ J(_a, {
2609
2581
  seg: e,
2610
2582
  isClickable: a,
2611
2583
  onOpenFile: c
2612
2584
  }, t))
2613
- }), a ? /* @__PURE__ */ Y(re, {
2585
+ }), a ? /* @__PURE__ */ J(H, {
2614
2586
  display: "inline-flex",
2615
2587
  alignItems: "center",
2616
2588
  transition: "transform 200ms ease, color 200ms ease",
@@ -2618,48 +2590,48 @@ function wa(e) {
2618
2590
  color: "transparent",
2619
2591
  flexShrink: "0",
2620
2592
  _groupHover: { color: "fg" },
2621
- children: /* @__PURE__ */ Y(Te, { size: 12 })
2593
+ children: /* @__PURE__ */ J(Te, { size: 12 })
2622
2594
  }) : null]
2623
2595
  })
2624
2596
  }), t[3] = a, t[4] = i, t[5] = n.title, t[6] = r, t[7] = c, t[8] = s, t[9] = f) : f = t[9];
2625
2597
  let p;
2626
- t[10] !== o || t[11] !== i || t[12] !== n.blocks || t[13] !== c ? (p = o ? /* @__PURE__ */ Y(A, {
2598
+ t[10] !== o || t[11] !== i || t[12] !== n.blocks || t[13] !== c ? (p = o ? /* @__PURE__ */ J(A, {
2627
2599
  display: "grid",
2628
2600
  gridTemplateRows: i ? "1fr" : "0fr",
2629
2601
  transition: "grid-template-rows 220ms ease",
2630
- children: i ? /* @__PURE__ */ Y(A, {
2602
+ children: i ? /* @__PURE__ */ J(A, {
2631
2603
  overflow: "hidden",
2632
2604
  opacity: 1,
2633
2605
  transform: "translateY(0)",
2634
2606
  transition: "opacity 200ms ease, transform 200ms ease",
2635
- children: n.blocks.map((e, t) => /* @__PURE__ */ Y(A, { children: /* @__PURE__ */ Y(Sa, {
2607
+ children: n.blocks.map((e, t) => /* @__PURE__ */ J(A, { children: /* @__PURE__ */ J(ba, {
2636
2608
  b: e,
2637
2609
  onOpenFile: c
2638
2610
  }) }, t))
2639
2611
  }) : null
2640
2612
  }) : null, t[10] = o, t[11] = i, t[12] = n.blocks, t[13] = c, t[14] = p) : p = t[14];
2641
2613
  let m;
2642
- t[15] !== d || t[16] !== f || t[17] !== p ? (m = /* @__PURE__ */ X(ba.Content, {
2614
+ t[15] !== d || t[16] !== f || t[17] !== p ? (m = /* @__PURE__ */ Y(va.Content, {
2643
2615
  h: d,
2644
2616
  children: [f, p]
2645
2617
  }), t[15] = d, t[16] = f, t[17] = p, t[18] = m) : m = t[18];
2646
2618
  let h;
2647
- return t[19] !== r || t[20] !== u || t[21] !== m ? (h = /* @__PURE__ */ X(ba.Item, {
2619
+ return t[19] !== r || t[20] !== u || t[21] !== m ? (h = /* @__PURE__ */ Y(va.Item, {
2648
2620
  gap: "xs",
2649
2621
  children: [u, m]
2650
2622
  }, r), t[19] = r, t[20] = u, t[21] = m, t[22] = h) : h = t[22], h;
2651
2623
  }
2652
- function Ta(e) {
2653
- let t = J(5), n = b(), r = e.linkHandler ?? n, i;
2654
- t[0] === e ? i = t[1] : (i = /* @__PURE__ */ Y(Ea, { ...e }), t[0] = e, t[1] = i);
2624
+ function Ca(e) {
2625
+ let t = q(5), n = b(), r = e.linkHandler ?? n, i;
2626
+ t[0] === e ? i = t[1] : (i = /* @__PURE__ */ J(wa, { ...e }), t[0] = e, t[1] = i);
2655
2627
  let a;
2656
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ Y(m, {
2628
+ return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ J(m, {
2657
2629
  handler: r,
2658
2630
  children: i
2659
2631
  }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
2660
2632
  }
2661
- function Ea(e) {
2662
- let t = J(14), { data: n, onOpenFile: r } = e, i = b(), a;
2633
+ function wa(e) {
2634
+ let t = q(14), { data: n, onOpenFile: r } = e, i = b(), a;
2663
2635
  t[0] !== i || t[1] !== r ? (a = i ? (e) => {
2664
2636
  i.open({
2665
2637
  source: e,
@@ -2668,7 +2640,7 @@ function Ea(e) {
2668
2640
  } : r, t[0] = i, t[1] = r, t[2] = a) : a = t[2];
2669
2641
  let o = a, s;
2670
2642
  t[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {}, t[3] = s) : s = t[3];
2671
- let [c, l] = Q(s), u = Da, d;
2643
+ let [c, l] = Q(s), u = Ta, d;
2672
2644
  t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e) => {
2673
2645
  l((t) => ({
2674
2646
  ...t,
@@ -2680,7 +2652,7 @@ function Ea(e) {
2680
2652
  let e;
2681
2653
  t[9] !== c || t[10] !== o ? (e = (e, t) => {
2682
2654
  let n = u(e, t), r = (e.blocks?.length ?? 0) > 0, i = (e.expandable ?? !0) && r, a = i ? c[n] ?? !1 : r;
2683
- return /* @__PURE__ */ Y(wa, {
2655
+ return /* @__PURE__ */ J(Sa, {
2684
2656
  item: e,
2685
2657
  itemKey: n,
2686
2658
  isOpen: a,
@@ -2692,60 +2664,60 @@ function Ea(e) {
2692
2664
  }, t[9] = c, t[10] = o, t[11] = e) : e = t[11], p = n.items.map(e), t[5] = n.items, t[6] = c, t[7] = o, t[8] = p;
2693
2665
  } else p = t[8];
2694
2666
  let m;
2695
- return t[12] === p ? m = t[13] : (m = /* @__PURE__ */ Y(ba.Root, {
2667
+ return t[12] === p ? m = t[13] : (m = /* @__PURE__ */ J(va.Root, {
2696
2668
  variant: "tool",
2697
2669
  children: p
2698
2670
  }), t[12] = p, t[13] = m), m;
2699
2671
  }
2700
- function Da(e, t) {
2672
+ function Ta(e, t) {
2701
2673
  return e.id ? `id:${e.id}` : `idx:${t}`;
2702
2674
  }
2703
2675
  //#endregion
2704
2676
  //#region src/components/chat-ui/components/tool-invocation-timeline.tsx
2705
- var Oa = (e) => lr(e.tool ?? "").replace(/_/g, "") === "question", ka = (e) => {
2677
+ var Ea = (e) => sr(e.tool ?? "").replace(/_/g, "") === "question", Da = (e) => {
2706
2678
  let t = e.state?.output;
2707
2679
  return typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : t && typeof t == "object" ? Object.keys(t).length > 0 : t != null;
2708
2680
  };
2709
- function Aa(e) {
2710
- let t = J(9), { invocations: n, labeledBlocks: r, hideQuestionForms: i, onOpenFile: a, linkHandler: o } = e, s = i !== void 0 && i, c, l;
2681
+ function Oa(e) {
2682
+ let t = q(9), { invocations: n, labeledBlocks: r, hideQuestionForms: i, onOpenFile: a, linkHandler: o } = e, s = i !== void 0 && i, c, l;
2711
2683
  if (t[0] !== s || t[1] !== n || t[2] !== r) {
2712
2684
  l = Symbol.for("react.early_return_sentinel");
2713
2685
  bb0: {
2714
- let e = s ? n.filter(ja) : n;
2686
+ let e = s ? n.filter(ka) : n;
2715
2687
  if (e.length === 0) {
2716
2688
  l = null;
2717
2689
  break bb0;
2718
2690
  }
2719
- c = la(e, { labeledBlocks: r });
2691
+ c = sa(e, { labeledBlocks: r });
2720
2692
  }
2721
2693
  t[0] = s, t[1] = n, t[2] = r, t[3] = c, t[4] = l;
2722
2694
  } else c = t[3], l = t[4];
2723
2695
  if (l !== Symbol.for("react.early_return_sentinel")) return l;
2724
2696
  let u = c, d;
2725
- return t[5] !== u || t[6] !== o || t[7] !== a ? (d = /* @__PURE__ */ Y(Ta, {
2697
+ return t[5] !== u || t[6] !== o || t[7] !== a ? (d = /* @__PURE__ */ J(Ca, {
2726
2698
  data: u,
2727
2699
  linkHandler: o,
2728
2700
  onOpenFile: a
2729
2701
  }), t[5] = u, t[6] = o, t[7] = a, t[8] = d) : d = t[8], d;
2730
2702
  }
2731
- function ja(e) {
2732
- return !Oa(e) || ka(e);
2703
+ function ka(e) {
2704
+ return !Ea(e) || Da(e);
2733
2705
  }
2734
2706
  //#endregion
2735
2707
  //#region src/components/chat-ui/components/message-parts-renderer.tsx
2736
- var Ma = (e) => e.type === "tool", Na = (e) => e.filename ?? e.url.split("/").pop() ?? "attachment", Pa = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Fa = (e) => e.mediaType?.startsWith("image/") || Pa.test(Na(e)), Ia = (e) => Fa(e) ? /* @__PURE__ */ Y(z, {
2708
+ var Aa = (e) => e.type === "tool", ja = (e) => e.filename ?? e.url.split("/").pop() ?? "attachment", Ma = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Na = (e) => e.mediaType?.startsWith("image/") || Ma.test(ja(e)), Pa = (e) => Na(e) ? /* @__PURE__ */ J(R, {
2737
2709
  src: e.url,
2738
- alt: `${Na(e)} preview thumbnail`,
2710
+ alt: `${ja(e)} preview thumbnail`,
2739
2711
  boxSize: "18px",
2740
2712
  borderRadius: "xs",
2741
2713
  objectFit: "cover"
2742
- }) : void 0, La = (e, t) => {
2714
+ }) : void 0, Fa = (e, t) => {
2743
2715
  if (t) {
2744
2716
  t(e.url);
2745
2717
  return;
2746
2718
  }
2747
2719
  typeof window < "u" && window.open(e.url, "_blank", "noopener,noreferrer");
2748
- }, Ra = (e) => {
2720
+ }, Ia = (e) => {
2749
2721
  if (e.message && e.message.trim().length > 0) return e.message;
2750
2722
  let { errorType: t } = e;
2751
2723
  switch (t) {
@@ -2754,17 +2726,17 @@ var Ma = (e) => e.type === "tool", Na = (e) => e.filename ?? e.url.split("/").po
2754
2726
  case "permission": return "Permission denied.";
2755
2727
  default: return "An error occurred.";
2756
2728
  }
2757
- }, za = {
2729
+ }, La = {
2758
2730
  info: "blue",
2759
2731
  warning: "orange",
2760
2732
  error: "red",
2761
2733
  success: "green",
2762
2734
  loading: "blue"
2763
- }, Ba = (e, t) => {
2735
+ }, Ra = (e, t) => {
2764
2736
  let n = [], r = t;
2765
2737
  for (; r < e.length;) {
2766
2738
  let t = e[r];
2767
- if (!Ma(t) || t.tool === "question" && ln(t.state?.input)) break;
2739
+ if (!Aa(t) || t.tool === "question" && ln(t.state?.input)) break;
2768
2740
  n.push(t), r += 1;
2769
2741
  }
2770
2742
  return {
@@ -2772,42 +2744,42 @@ var Ma = (e) => e.type === "tool", Na = (e) => e.filename ?? e.url.split("/").po
2772
2744
  nextIndex: r - 1
2773
2745
  };
2774
2746
  };
2775
- function Va(e) {
2776
- let t = J(5), n = b(), r = e.linkHandler ?? n, i;
2777
- t[0] === e ? i = t[1] : (i = /* @__PURE__ */ Y(Ha, { ...e }), t[0] = e, t[1] = i);
2747
+ function za(e) {
2748
+ let t = q(5), n = b(), r = e.linkHandler ?? n, i;
2749
+ t[0] === e ? i = t[1] : (i = /* @__PURE__ */ J(Ba, { ...e }), t[0] = e, t[1] = i);
2778
2750
  let a;
2779
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ Y(m, {
2751
+ return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ J(m, {
2780
2752
  handler: r,
2781
2753
  children: i
2782
2754
  }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
2783
2755
  }
2784
- function Ha(t) {
2785
- let n = J(10), { message: r, streaming: i, hideQuestionForms: a, onOpenFile: s, toolInvocationTimeline: c } = t, l = i !== void 0 && i, u = a !== void 0 && a, d = b(), f = g(), p;
2756
+ function Ba(t) {
2757
+ let n = q(10), { message: r, streaming: i, hideQuestionForms: a, onOpenFile: s, toolInvocationTimeline: c } = t, l = i !== void 0 && i, u = a !== void 0 && a, d = b(), f = g(), p;
2786
2758
  if (n[0] !== u || n[1] !== f || n[2] !== d || n[3] !== r || n[4] !== s || n[5] !== l || n[6] !== c) {
2787
- let t = y([r], d), i = c ?? Aa, a;
2759
+ let t = y([r], d), i = c ?? Oa, a;
2788
2760
  n[8] === r.parts ? a = n[9] : (a = r.parts ?? [], n[8] = r.parts, n[9] = a);
2789
2761
  let m = a, g = [];
2790
2762
  for (let n = 0; n < m.length; n += 1) {
2791
2763
  let a = m[n], c = `${r.id}-${n}`;
2792
2764
  bb0: switch (a.type) {
2793
2765
  case "text":
2794
- g.push(/* @__PURE__ */ Y(h, {
2766
+ g.push(/* @__PURE__ */ J(h, {
2795
2767
  value: f.get(a) ?? t.get(a) ?? S,
2796
- children: /* @__PURE__ */ Y("div", { children: /* @__PURE__ */ Y(sr, {
2768
+ children: /* @__PURE__ */ J("div", { children: /* @__PURE__ */ J(ar, {
2797
2769
  streaming: l,
2798
2770
  children: a.text
2799
2771
  }) })
2800
2772
  }, c));
2801
2773
  break bb0;
2802
2774
  case "reasoning":
2803
- g.push(/* @__PURE__ */ Y(A, {
2775
+ g.push(/* @__PURE__ */ J(A, {
2804
2776
  padding: "0",
2805
2777
  css: { "& .rich-text, & .rich-text *": {
2806
2778
  color: "fg.subtle !important",
2807
2779
  fontSize: ".75rem !important",
2808
2780
  fontWeight: "normal !important"
2809
2781
  } },
2810
- children: /* @__PURE__ */ Y(T, {
2782
+ children: /* @__PURE__ */ J(T, {
2811
2783
  defaultState: a.text,
2812
2784
  fullWidth: !0
2813
2785
  })
@@ -2815,13 +2787,13 @@ function Ha(t) {
2815
2787
  break bb0;
2816
2788
  case "tool": {
2817
2789
  if (a.tool === "question" && ln(a.state?.input)) {
2818
- g.push(/* @__PURE__ */ Y(cr, { part: a }, c));
2790
+ g.push(/* @__PURE__ */ J(or, { part: a }, c));
2819
2791
  break bb0;
2820
2792
  }
2821
- let { invocations: e, nextIndex: t } = Ba(m, n);
2822
- n = t, g.push(/* @__PURE__ */ Y(A, {
2793
+ let { invocations: e, nextIndex: t } = Ra(m, n);
2794
+ n = t, g.push(/* @__PURE__ */ J(A, {
2823
2795
  width: "full",
2824
- children: /* @__PURE__ */ Y(i, {
2796
+ children: /* @__PURE__ */ J(i, {
2825
2797
  invocations: e,
2826
2798
  linkHandler: d,
2827
2799
  labeledBlocks: !0,
@@ -2832,40 +2804,40 @@ function Ha(t) {
2832
2804
  break bb0;
2833
2805
  }
2834
2806
  case "file":
2835
- g.push(/* @__PURE__ */ Y(A, {
2807
+ g.push(/* @__PURE__ */ J(A, {
2836
2808
  width: "fit-content",
2837
- children: /* @__PURE__ */ Y(o, {
2838
- fileName: Na(a),
2809
+ children: /* @__PURE__ */ J(o, {
2810
+ fileName: ja(a),
2839
2811
  size: "sm",
2840
2812
  tone: "neutral",
2841
- icon: Ia(a),
2842
- onSelect: () => La(a, s)
2813
+ icon: Pa(a),
2814
+ onSelect: () => Fa(a, s)
2843
2815
  })
2844
2816
  }, c));
2845
2817
  break bb0;
2846
2818
  case "error":
2847
- g.push(/* @__PURE__ */ Y(A, {
2819
+ g.push(/* @__PURE__ */ J(A, {
2848
2820
  py: "2",
2849
2821
  width: "full",
2850
- children: /* @__PURE__ */ Y(e, {
2822
+ children: /* @__PURE__ */ J(e, {
2851
2823
  borderRadius: "xs",
2852
2824
  status: "error",
2853
2825
  colorPalette: "red",
2854
- title: Ra(a),
2826
+ title: Ia(a),
2855
2827
  size: "sm"
2856
2828
  })
2857
2829
  }, c));
2858
2830
  break bb0;
2859
2831
  case "token_usage": break bb0;
2860
2832
  case "alert":
2861
- g.push(/* @__PURE__ */ Y(A, {
2833
+ g.push(/* @__PURE__ */ J(A, {
2862
2834
  width: "full",
2863
- children: /* @__PURE__ */ Y(e, {
2835
+ children: /* @__PURE__ */ J(e, {
2864
2836
  borderRadius: "xs",
2865
2837
  status: a.status === "loading" ? "info" : a.status,
2866
- colorPalette: za[a.status],
2838
+ colorPalette: La[a.status],
2867
2839
  title: a.title,
2868
- icon: a.status === "loading" ? /* @__PURE__ */ Y(W, { size: "sm" }) : void 0,
2840
+ icon: a.status === "loading" ? /* @__PURE__ */ J(U, { size: "sm" }) : void 0,
2869
2841
  size: "sm",
2870
2842
  children: a.message
2871
2843
  })
@@ -2874,23 +2846,23 @@ function Ha(t) {
2874
2846
  default: g.push(null);
2875
2847
  }
2876
2848
  }
2877
- p = /* @__PURE__ */ Y(fe, { children: g }), n[0] = u, n[1] = f, n[2] = d, n[3] = r, n[4] = s, n[5] = l, n[6] = c, n[7] = p;
2849
+ p = /* @__PURE__ */ J(pe, { children: g }), n[0] = u, n[1] = f, n[2] = d, n[3] = r, n[4] = s, n[5] = l, n[6] = c, n[7] = p;
2878
2850
  } else p = n[7];
2879
2851
  return p;
2880
2852
  }
2881
2853
  //#endregion
2882
2854
  //#region src/components/chat-ui/components/message-types.ts
2883
- var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "assistant", Wa = (e) => e.text.trim().length > 0, Ga = (e) => e.title.trim().length > 0 || !!e.message?.trim(), Ka = (e) => {
2855
+ var Va = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "assistant", Ha = (e) => e.text.trim().length > 0, Ua = (e) => e.title.trim().length > 0 || !!e.message?.trim(), Wa = (e) => {
2884
2856
  switch (e.type) {
2885
2857
  case "text":
2886
- case "reasoning": return Wa(e);
2858
+ case "reasoning": return Ha(e);
2887
2859
  case "tool":
2888
2860
  case "file":
2889
2861
  case "error": return !0;
2890
- case "alert": return Ga(e);
2862
+ case "alert": return Ua(e);
2891
2863
  default: return !1;
2892
2864
  }
2893
- }, qa = (e) => e.type === "reasoning" || e.type === "tool" && e.tool.toLowerCase() !== "question", Ja = (e) => e.role === "user" || e.parts.length === 0 ? !1 : e.parts.every(qa), Ya = (e) => {
2865
+ }, Ga = (e) => e.type === "reasoning" || e.type === "tool" && e.tool.toLowerCase() !== "question", Ka = (e) => e.role === "user" || e.parts.length === 0 ? !1 : e.parts.every(Ga), qa = (e) => {
2894
2866
  if (e.length === 0) return null;
2895
2867
  let [t, ...n] = e;
2896
2868
  return t ? {
@@ -2900,12 +2872,12 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
2900
2872
  modelId: n.at(-1)?.modelId ?? t.modelId,
2901
2873
  providerId: n.at(-1)?.providerId ?? t.providerId
2902
2874
  } : null;
2903
- }, Xa = (e, t = {}) => {
2875
+ }, Ja = (e, t = {}) => {
2904
2876
  let n = [], r = [], i = () => {
2905
2877
  r = [];
2906
2878
  };
2907
2879
  for (let t of e) {
2908
- let e = (t.parts ?? []).filter(Ka);
2880
+ let e = (t.parts ?? []).filter(Wa);
2909
2881
  if (e.length === 0) continue;
2910
2882
  let a = e.length === t.parts.length ? t : {
2911
2883
  ...t,
@@ -2915,7 +2887,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
2915
2887
  i(), n.push(a);
2916
2888
  continue;
2917
2889
  }
2918
- if (Ja(a)) {
2890
+ if (Ka(a)) {
2919
2891
  r.push(a);
2920
2892
  continue;
2921
2893
  }
@@ -2929,14 +2901,14 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
2929
2901
  n.push(a);
2930
2902
  }
2931
2903
  if (t.streaming && r.length > 0) {
2932
- let e = Ya(r);
2904
+ let e = qa(r);
2933
2905
  e && n.push(e);
2934
2906
  }
2935
2907
  return n;
2936
- }, Za = (e) => {
2908
+ }, Ya = (e) => {
2937
2909
  let t = e.at(-1);
2938
- return t?.role === "assistant" && t.parts.some((e) => e.type === "text" && Wa(e)) ? t.id : null;
2939
- }, Qa = (e) => {
2910
+ return t?.role === "assistant" && t.parts.some((e) => e.type === "text" && Ha(e)) ? t.id : null;
2911
+ }, Xa = (e) => {
2940
2912
  let t = [], n = [];
2941
2913
  for (let r of e) r.role === "user" ? t.push({
2942
2914
  userMessage: r,
@@ -2946,99 +2918,165 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
2946
2918
  groups: t,
2947
2919
  leadingResponses: n
2948
2920
  };
2949
- }, $a = (e) => {
2950
- let t = J(18), { message: n, streaming: r, hideQuestionForms: i, animate: a, showAssistantActions: o } = e, s = i !== void 0 && i, c = a !== void 0 && a, l;
2951
- t[0] === n.role ? l = t[1] : (l = Ua(n.role), t[0] = n.role, t[1] = l);
2952
- let u = l, d = u === "user" || u === "assistant" && o, f = c ? Qn : void 0, p = r && u === "assistant", m;
2953
- t[2] !== s || t[3] !== n || t[4] !== p ? (m = /* @__PURE__ */ Y(Va, {
2921
+ }, Za = (e) => {
2922
+ let t = q(18), { message: n, streaming: r, hideQuestionForms: i, animate: a, showAssistantActions: o } = e, s = i !== void 0 && i, c = a !== void 0 && a, l;
2923
+ t[0] === n.role ? l = t[1] : (l = Va(n.role), t[0] = n.role, t[1] = l);
2924
+ let u = l, d = u === "user" || u === "assistant" && o, f = c ? Xn : void 0, p = r && u === "assistant", m;
2925
+ t[2] !== s || t[3] !== n || t[4] !== p ? (m = /* @__PURE__ */ J(za, {
2954
2926
  message: n,
2955
2927
  streaming: p,
2956
2928
  hideQuestionForms: s
2957
2929
  }), t[2] = s, t[3] = n, t[4] = p, t[5] = m) : m = t[5];
2958
2930
  let h;
2959
- t[6] !== u || t[7] !== n || t[8] !== d ? (h = d ? /* @__PURE__ */ Y(ar, {
2931
+ t[6] !== u || t[7] !== n || t[8] !== d ? (h = d ? /* @__PURE__ */ J(rr, {
2960
2932
  message: n,
2961
2933
  alwaysVisible: u === "user",
2962
2934
  copyAlwaysVisible: u !== "user"
2963
2935
  }) : null, t[6] = u, t[7] = n, t[8] = d, t[9] = h) : h = t[9];
2964
2936
  let g;
2965
- t[10] !== u || t[11] !== m || t[12] !== h ? (g = /* @__PURE__ */ X(dt.Content, {
2937
+ t[10] !== u || t[11] !== m || t[12] !== h ? (g = /* @__PURE__ */ Y(dt.Content, {
2966
2938
  from: u,
2967
2939
  children: [m, h]
2968
2940
  }), t[10] = u, t[11] = m, t[12] = h, t[13] = g) : g = t[13];
2969
2941
  let _;
2970
- return t[14] !== u || t[15] !== f || t[16] !== g ? (_ = /* @__PURE__ */ Y(dt.Root, {
2942
+ return t[14] !== u || t[15] !== f || t[16] !== g ? (_ = /* @__PURE__ */ J(dt.Root, {
2971
2943
  from: u,
2972
2944
  ...f,
2973
2945
  children: g
2974
2946
  }), t[14] = u, t[15] = f, t[16] = g, t[17] = _) : _ = t[17], _;
2975
- }, eo = (e) => {
2976
- let t = J(6), { message: n, streaming: r, hideQuestionForms: i, animate: a, showAssistantActions: o } = e, s;
2977
- return t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o || t[4] !== r ? (s = /* @__PURE__ */ Y(A, { children: /* @__PURE__ */ Y($a, {
2947
+ }, Qa = (e) => {
2948
+ let t = q(6), { message: n, streaming: r, hideQuestionForms: i, animate: a, showAssistantActions: o } = e, s;
2949
+ return t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o || t[4] !== r ? (s = /* @__PURE__ */ J(A, { children: /* @__PURE__ */ J(Za, {
2978
2950
  message: n,
2979
2951
  streaming: r,
2980
2952
  hideQuestionForms: i,
2981
2953
  animate: a,
2982
2954
  showAssistantActions: o
2983
2955
  }) }), t[0] = a, t[1] = i, t[2] = n, t[3] = o, t[4] = r, t[5] = s) : s = t[5], s;
2984
- }, to = (e) => {
2985
- let t = J(7), { label: n, onClick: r, actionPanel: i } = e, a = i ? "space-between" : "flex-end", o;
2986
- t[0] !== n || t[1] !== r ? (o = /* @__PURE__ */ Y(j, {
2956
+ }, $a = (e) => {
2957
+ let t = q(11), { expanded: n, label: r, onClick: i, actionPanel: a } = e, o;
2958
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = { key: "stickyUserMessage" }, t[0] = o) : o = t[0];
2959
+ let s = fe(o), c;
2960
+ t[1] !== n || t[2] !== s ? (c = s({ expanded: n }), t[1] = n, t[2] = s, t[3] = c) : c = t[3];
2961
+ let l = c, u;
2962
+ t[4] !== r || t[5] !== i ? (u = /* @__PURE__ */ J(j, {
2987
2963
  size: "2xs",
2988
2964
  variant: "outline",
2989
2965
  pointerEvents: "auto",
2990
- onClick: r,
2991
- children: n
2992
- }), t[0] = n, t[1] = r, t[2] = o) : o = t[2];
2993
- let s;
2994
- return t[3] !== i || t[4] !== a || t[5] !== o ? (s = /* @__PURE__ */ X(F, {
2995
- position: "absolute",
2996
- bottom: "0",
2997
- left: "0",
2998
- right: "0",
2999
- justifyContent: a,
3000
- alignItems: "flex-end",
3001
- px: "xs",
3002
- pb: "xs",
3003
- pt: "lg",
3004
- bgGradient: "to-t",
3005
- gradientFrom: "bg.subtle",
3006
- gradientTo: "transparent",
3007
- borderBottomRadius: "xs",
3008
- pointerEvents: "none",
3009
- children: [i, o]
3010
- }), t[3] = i, t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
3011
- }, no = "min(10vh, 4rem)", ro = "min(70dvh, calc(100dvh - 12rem), 22rem)", io = 1, ao = (e) => e.parts.reduce((e, t) => t.type === "text" ? {
3012
- lineCount: e.lineCount + t.text.split(/\r\n|\r|\n/).length,
3013
- textLength: e.textLength + t.text.length
3014
- } : e, {
3015
- lineCount: 0,
3016
- textLength: 0
3017
- }), oo = (e) => {
3018
- if (e.role !== "user") return !1;
3019
- let { lineCount: t, textLength: n } = ao(e);
3020
- return n > 360 || t > 4;
3021
- }, so = (e, t) => {
2966
+ onClick: i,
2967
+ children: r
2968
+ }), t[4] = r, t[5] = i, t[6] = u) : u = t[6];
2969
+ let d;
2970
+ return t[7] !== a || t[8] !== l.footer || t[9] !== u ? (d = /* @__PURE__ */ Y(F, {
2971
+ css: l.footer,
2972
+ children: [a, u]
2973
+ }), t[7] = a, t[8] = l.footer, t[9] = u, t[10] = d) : d = t[10], d;
2974
+ }, eo = 1, to = (e, t) => {
3022
2975
  let n = Math.max(0, e.scrollHeight - e.clientHeight);
3023
- return t === 0 || n <= io ? !1 : t < 0 ? e.scrollTop > io : e.scrollTop < n - io;
3024
- }, co = 3, lo = 20, uo = 1, fo = (e, t) => Math.abs(e.scrollTop - t.scrollTop) <= uo && Math.abs(e.totalSize - t.totalSize) <= uo, po = (e, t) => !!e && Math.max(e.scrollHeight, t) <= e.clientHeight, mo = (e, t) => ({
2976
+ return t === 0 || n <= eo ? !1 : t < 0 ? e.scrollTop > eo : e.scrollTop < n - eo;
2977
+ }, no = (e) => {
2978
+ to(e.currentTarget, e.deltaY) && e.stopPropagation();
2979
+ };
2980
+ function ro(e) {
2981
+ let t = q(46), { message: r, expanded: i, animate: a, onToggle: o } = e, s = Z(null), c = Z(null), l = Z(null), [u, d] = Q(!1), f = u && i, p;
2982
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { key: "stickyUserMessage" }, t[0] = p) : p = t[0];
2983
+ let m = fe(p), h;
2984
+ t[1] !== f || t[2] !== m ? (h = m({ expanded: f }), t[1] = f, t[2] = m, t[3] = h) : h = t[3];
2985
+ let g = h, _ = f ? "expanded" : "collapsed", v = f ? no : void 0, y;
2986
+ t[4] !== g.viewport || t[5] !== _ || t[6] !== v ? (y = {
2987
+ css: g.viewport,
2988
+ "data-sticky-user-message-content": _,
2989
+ onWheel: v
2990
+ }, t[4] = g.viewport, t[5] = _, t[6] = v, t[7] = y) : y = t[7];
2991
+ let b = y, x, S;
2992
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (x = () => {
2993
+ let e = c.current, t = l.current, n = () => {
2994
+ d(e.getBoundingClientRect().height > t.getBoundingClientRect().height + 1);
2995
+ }, r = new ResizeObserver(n);
2996
+ return r.observe(e), r.observe(t), n(), () => r.disconnect();
2997
+ }, S = [], t[8] = x, t[9] = S) : (x = t[8], S = t[9]), ye(x, S);
2998
+ let C, w;
2999
+ t[10] === f ? (C = t[11], w = t[12]) : (C = () => {
3000
+ f || (s.current.scrollTop = 0);
3001
+ }, w = [f], t[10] = f, t[11] = C, t[12] = w), ye(C, w);
3002
+ let T;
3003
+ t[13] === r ? T = t[14] : (T = /* @__PURE__ */ J(rr, {
3004
+ message: r,
3005
+ alwaysVisible: !0,
3006
+ copyAlwaysVisible: !1
3007
+ }), t[13] = r, t[14] = T);
3008
+ let E = T, D = r.delivery ?? "sent", O = a ? Xn : void 0, k;
3009
+ t[15] === g.preview ? k = t[16] : (k = /* @__PURE__ */ J(A, {
3010
+ ref: l,
3011
+ css: g.preview,
3012
+ "aria-hidden": "true"
3013
+ }), t[15] = g.preview, t[16] = k);
3014
+ let j;
3015
+ t[17] === r ? j = t[18] : (j = /* @__PURE__ */ J(za, { message: r }), t[17] = r, t[18] = j);
3016
+ let M;
3017
+ t[19] !== g.body || t[20] !== j ? (M = /* @__PURE__ */ J(A, {
3018
+ ref: c,
3019
+ css: g.body,
3020
+ children: j
3021
+ }), t[19] = g.body, t[20] = j, t[21] = M) : M = t[21];
3022
+ let N;
3023
+ t[22] !== f || t[23] !== M || t[24] !== b ? (N = /* @__PURE__ */ J(n, {
3024
+ viewportRef: s,
3025
+ showVerticalScrollbar: f,
3026
+ viewportProps: b,
3027
+ children: M
3028
+ }), t[22] = f, t[23] = M, t[24] = b, t[25] = N) : N = t[25];
3029
+ let P;
3030
+ t[26] !== E || t[27] !== u || t[28] !== g.actions ? (P = u ? null : /* @__PURE__ */ J(A, {
3031
+ css: g.actions,
3032
+ children: E
3033
+ }), t[26] = E, t[27] = u, t[28] = g.actions, t[29] = P) : P = t[29];
3034
+ let F;
3035
+ t[30] !== E || t[31] !== u || t[32] !== f || t[33] !== r.id || t[34] !== o ? (F = u ? /* @__PURE__ */ J($a, {
3036
+ expanded: f,
3037
+ label: f ? "Show less" : "Show more",
3038
+ onClick: () => o(r.id),
3039
+ actionPanel: E
3040
+ }) : null, t[30] = E, t[31] = u, t[32] = f, t[33] = r.id, t[34] = o, t[35] = F) : F = t[35];
3041
+ let I;
3042
+ t[36] !== g.root || t[37] !== k || t[38] !== N || t[39] !== P || t[40] !== F ? (I = /* @__PURE__ */ Y(dt.Content, {
3043
+ from: "user",
3044
+ css: g.root,
3045
+ children: [
3046
+ k,
3047
+ N,
3048
+ P,
3049
+ F
3050
+ ]
3051
+ }), t[36] = g.root, t[37] = k, t[38] = N, t[39] = P, t[40] = F, t[41] = I) : I = t[41];
3052
+ let L;
3053
+ return t[42] !== D || t[43] !== O || t[44] !== I ? (L = /* @__PURE__ */ J(dt.Root, {
3054
+ from: "user",
3055
+ delivery: D,
3056
+ ...O,
3057
+ children: I
3058
+ }), t[42] = D, t[43] = O, t[44] = I, t[45] = L) : L = t[45], L;
3059
+ }
3060
+ //#endregion
3061
+ //#region src/components/chat-ui/components/use-chat-tail-ready.ts
3062
+ var io = 3, ao = 20, oo = 1, so = (e, t) => Math.abs(e.scrollTop - t.scrollTop) <= oo && Math.abs(e.totalSize - t.totalSize) <= oo, co = (e, t) => !!e && Math.max(e.scrollHeight, t) <= e.clientHeight, lo = (e, t) => ({
3025
3063
  scrollTop: e?.scrollTop ?? 0,
3026
3064
  totalSize: t
3027
- }), ho = (e) => {
3028
- let t = J(8), { itemCount: n, onReady: r, scrollRef: i, totalSize: a } = e, o = ye(r), s, c;
3065
+ }), uo = (e) => {
3066
+ let t = q(8), { itemCount: n, onReady: r, scrollRef: i, totalSize: a } = e, o = Z(r), s, c;
3029
3067
  t[0] === r ? (s = t[1], c = t[2]) : (s = () => {
3030
3068
  o.current = r;
3031
- }, c = [r], t[0] = r, t[1] = s, t[2] = c), Z(s, c);
3069
+ }, c = [r], t[0] = r, t[1] = s, t[2] = c), X(s, c);
3032
3070
  let l, u;
3033
3071
  t[3] !== n || t[4] !== i || t[5] !== a ? (l = () => {
3034
- if (n === 0 || typeof requestAnimationFrame > "u" || po(i.current, a)) {
3072
+ if (n === 0 || typeof requestAnimationFrame > "u" || co(i.current, a)) {
3035
3073
  o.current?.();
3036
3074
  return;
3037
3075
  }
3038
3076
  let e = 0, t = 0, r = 0, s = null, c = () => {
3039
3077
  t += 1;
3040
- let n = mo(i.current, a);
3041
- if (r = s && fo(n, s) ? r + 1 : 0, s = n, r >= co || t >= lo) {
3078
+ let n = lo(i.current, a);
3079
+ if (r = s && so(n, s) ? r + 1 : 0, s = n, r >= io || t >= ao) {
3042
3080
  o.current?.();
3043
3081
  return;
3044
3082
  }
@@ -3049,9 +3087,9 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3049
3087
  n,
3050
3088
  i,
3051
3089
  a
3052
- ], t[3] = n, t[4] = i, t[5] = a, t[6] = l, t[7] = u) : (l = t[6], u = t[7]), ve(l, u);
3053
- }, go = 720, _o = 1, vo = 4, yo = 8, bo = (e, t) => {
3054
- let n = Za(e);
3090
+ ], t[3] = n, t[4] = i, t[5] = a, t[6] = l, t[7] = u) : (l = t[6], u = t[7]), ye(l, u);
3091
+ }, fo = 720, po = 1, mo = 4, ho = 8, go = (e, t) => {
3092
+ let n = Ya(e);
3055
3093
  return [...e.map((e) => ({
3056
3094
  type: "leading-response",
3057
3095
  key: e.id,
@@ -3063,100 +3101,42 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3063
3101
  group: e,
3064
3102
  groupIndex: t
3065
3103
  }))];
3066
- }, xo = (e, t) => {
3104
+ }, _o = (e, t) => {
3067
3105
  if (e === 0) return 0;
3068
- let n = e * go + (e - 1) * yo;
3106
+ let n = e * fo + (e - 1) * ho;
3069
3107
  return Math.max(n - t, 0);
3070
- }, So = (e) => e?.clientHeight || _o, Co = (e) => {
3071
- so(e.currentTarget, e.deltaY) && e.stopPropagation();
3072
- }, wo = (e, t) => {
3073
- if (e) return t ? ro : no;
3074
- }, To = (e) => {
3075
- if (e) return ro;
3076
- }, Eo = (e, t) => {
3077
- if (e) return t ? "expanded" : "collapsed";
3078
- }, Do = (e) => {
3079
- let t = J(84), { group: n, streaming: r, hideQuestionForms: i, isExpanded: a, animate: o, onToggleStickyMessage: s } = e, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O;
3080
- if (t[0] !== o || t[1] !== n.responses || t[2] !== n.userMessage || t[3] !== a || t[4] !== s) {
3081
- m = oo(n.userMessage), h = m && a;
3082
- let e = wo(m, a), r;
3083
- t[26] !== n.userMessage.id || t[27] !== s ? (r = () => s(n.userMessage.id), t[26] = n.userMessage.id, t[27] = s, t[28] = r) : r = t[28], O = r;
3084
- let i;
3085
- t[29] === n.responses ? i = t[30] : (i = Za(n.responses), t[29] = n.responses, t[30] = i), p = i, f = A, d = A, D = "sticky", v = "0", y = 1, u = dt.Root, w = "user", T = n.userMessage.delivery ?? "sent", E = o ? Qn : void 0, l = dt.Content, _ = "user", b = e, x = "hidden", S = m ? "0" : void 0, C = m ? "relative" : void 0, c = A, g = Eo(m, a), t[0] = o, t[1] = n.responses, t[2] = n.userMessage, t[3] = a, t[4] = s, t[5] = c, t[6] = l, t[7] = u, t[8] = d, t[9] = f, t[10] = p, t[11] = m, t[12] = h, t[13] = g, t[14] = _, t[15] = v, t[16] = y, t[17] = b, t[18] = x, t[19] = S, t[20] = C, t[21] = w, t[22] = T, t[23] = E, t[24] = D, t[25] = O;
3086
- } else c = t[5], l = t[6], u = t[7], d = t[8], f = t[9], p = t[10], m = t[11], h = t[12], g = t[13], _ = t[14], v = t[15], y = t[16], b = t[17], x = t[18], S = t[19], C = t[20], w = t[21], T = t[22], E = t[23], D = t[24], O = t[25];
3087
- let k;
3088
- t[31] === h ? k = t[32] : (k = To(h), t[31] = h, t[32] = k);
3089
- let j = h ? "auto" : "visible", M = m ? "xs" : void 0, N = m ? "xs" : void 0, P = h ? "3rem" : void 0, F = h ? Co : void 0, I;
3090
- t[33] === n.userMessage ? I = t[34] : (I = /* @__PURE__ */ Y(Va, { message: n.userMessage }), t[33] = n.userMessage, t[34] = I);
3091
- let L;
3092
- t[35] !== c || t[36] !== g || t[37] !== k || t[38] !== j || t[39] !== M || t[40] !== N || t[41] !== P || t[42] !== F || t[43] !== I ? (L = /* @__PURE__ */ Y(c, {
3093
- "data-sticky-user-message-content": g,
3094
- display: "flex",
3095
- flexDirection: "column",
3096
- gap: "sm",
3097
- maxH: k,
3098
- minH: "0",
3099
- overflowY: j,
3100
- px: M,
3101
- py: N,
3102
- pb: P,
3103
- onWheel: F,
3104
- children: I
3105
- }), t[35] = c, t[36] = g, t[37] = k, t[38] = j, t[39] = M, t[40] = N, t[41] = P, t[42] = F, t[43] = I, t[44] = L) : L = t[44];
3106
- let R;
3107
- t[45] !== n.userMessage || t[46] !== m || t[47] !== a || t[48] !== O ? (R = m ? /* @__PURE__ */ Y(to, {
3108
- label: a ? "Show less" : "Show more",
3109
- onClick: O,
3110
- actionPanel: /* @__PURE__ */ Y(ar, {
3108
+ }, vo = (e) => e?.clientHeight || po, yo = (e) => {
3109
+ let t = q(19), { group: n, streaming: r, hideQuestionForms: i, isExpanded: a, animate: o, onToggleStickyMessage: s } = e, c;
3110
+ t[0] === n.responses ? c = t[1] : (c = Ya(n.responses), t[0] = n.responses, t[1] = c);
3111
+ let l = c, u;
3112
+ t[2] !== o || t[3] !== n.userMessage || t[4] !== a || t[5] !== s ? (u = /* @__PURE__ */ J(A, {
3113
+ position: "sticky",
3114
+ top: "0",
3115
+ zIndex: 1,
3116
+ children: /* @__PURE__ */ J(ro, {
3111
3117
  message: n.userMessage,
3112
- alwaysVisible: !0,
3113
- copyAlwaysVisible: !1
3118
+ expanded: a,
3119
+ animate: o,
3120
+ onToggle: s
3114
3121
  })
3115
- }) : /* @__PURE__ */ Y(ar, {
3116
- message: n.userMessage,
3117
- alwaysVisible: !0,
3118
- copyAlwaysVisible: !1
3119
- }), t[45] = n.userMessage, t[46] = m, t[47] = a, t[48] = O, t[49] = R) : R = t[49];
3120
- let z;
3121
- t[50] !== l || t[51] !== _ || t[52] !== L || t[53] !== b || t[54] !== R || t[55] !== x || t[56] !== S || t[57] !== C ? (z = /* @__PURE__ */ X(l, {
3122
- from: _,
3123
- maxH: b,
3124
- overflow: x,
3125
- p: S,
3126
- position: C,
3127
- children: [L, R]
3128
- }), t[50] = l, t[51] = _, t[52] = L, t[53] = b, t[54] = R, t[55] = x, t[56] = S, t[57] = C, t[58] = z) : z = t[58];
3129
- let B;
3130
- t[59] !== u || t[60] !== z || t[61] !== w || t[62] !== T || t[63] !== E ? (B = /* @__PURE__ */ Y(u, {
3131
- from: w,
3132
- delivery: T,
3133
- ...E,
3134
- children: z
3135
- }), t[59] = u, t[60] = z, t[61] = w, t[62] = T, t[63] = E, t[64] = B) : B = t[64];
3136
- let V;
3137
- t[65] !== d || t[66] !== v || t[67] !== y || t[68] !== B || t[69] !== D ? (V = /* @__PURE__ */ Y(d, {
3138
- position: D,
3139
- top: v,
3140
- zIndex: y,
3141
- children: B
3142
- }), t[65] = d, t[66] = v, t[67] = y, t[68] = B, t[69] = D, t[70] = V) : V = t[70];
3143
- let H;
3144
- if (t[71] !== p || t[72] !== n.responses || t[73] !== i || t[74] !== r) {
3122
+ }), t[2] = o, t[3] = n.userMessage, t[4] = a, t[5] = s, t[6] = u) : u = t[6];
3123
+ let d;
3124
+ if (t[7] !== l || t[8] !== n.responses || t[9] !== i || t[10] !== r) {
3145
3125
  let e;
3146
- t[76] !== p || t[77] !== i || t[78] !== r ? (e = (e) => /* @__PURE__ */ Y(eo, {
3126
+ t[12] !== l || t[13] !== i || t[14] !== r ? (e = (e) => /* @__PURE__ */ J(Qa, {
3147
3127
  message: e,
3148
- streaming: r && e.id === p,
3128
+ streaming: r && e.id === l,
3149
3129
  hideQuestionForms: i,
3150
- showAssistantActions: e.id === p
3151
- }, e.id), t[76] = p, t[77] = i, t[78] = r, t[79] = e) : e = t[79], H = n.responses.map(e), t[71] = p, t[72] = n.responses, t[73] = i, t[74] = r, t[75] = H;
3152
- } else H = t[75];
3153
- let U;
3154
- return t[80] !== f || t[81] !== V || t[82] !== H ? (U = /* @__PURE__ */ X(f, { children: [V, H] }), t[80] = f, t[81] = V, t[82] = H, t[83] = U) : U = t[83], U;
3155
- }, Oo = (e) => {
3156
- let t = J(16), { item: n, groupCount: r, streaming: i, hideActiveQuestionForms: a, expandedStickyMessageIds: o, animate: s, onToggleStickyMessage: c } = e;
3130
+ showAssistantActions: e.id === l
3131
+ }, e.id), t[12] = l, t[13] = i, t[14] = r, t[15] = e) : e = t[15], d = n.responses.map(e), t[7] = l, t[8] = n.responses, t[9] = i, t[10] = r, t[11] = d;
3132
+ } else d = t[11];
3133
+ let f;
3134
+ return t[16] !== u || t[17] !== d ? (f = /* @__PURE__ */ Y(A, { children: [u, d] }), t[16] = u, t[17] = d, t[18] = f) : f = t[18], f;
3135
+ }, bo = (e) => {
3136
+ let t = q(16), { item: n, groupCount: r, streaming: i, hideActiveQuestionForms: a, expandedStickyMessageIds: o, animate: s, onToggleStickyMessage: c } = e;
3157
3137
  if (n.type === "leading-response") {
3158
3138
  let e = i && r === 0 && n.showAssistantActions, o = r > 0 || a, c;
3159
- return t[0] !== s || t[1] !== n.message || t[2] !== n.showAssistantActions || t[3] !== e || t[4] !== o ? (c = /* @__PURE__ */ Y($a, {
3139
+ return t[0] !== s || t[1] !== n.message || t[2] !== n.showAssistantActions || t[3] !== e || t[4] !== o ? (c = /* @__PURE__ */ J(Za, {
3160
3140
  message: n.message,
3161
3141
  streaming: e,
3162
3142
  hideQuestionForms: o,
@@ -3167,7 +3147,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3167
3147
  let l = n.group, u = i && n.groupIndex === r - 1, d = n.groupIndex < r - 1 || a, f;
3168
3148
  t[6] !== o || t[7] !== n.group.userMessage.id ? (f = o.has(n.group.userMessage.id), t[6] = o, t[7] = n.group.userMessage.id, t[8] = f) : f = t[8];
3169
3149
  let p;
3170
- return t[9] !== s || t[10] !== n.group || t[11] !== c || t[12] !== u || t[13] !== d || t[14] !== f ? (p = /* @__PURE__ */ Y(Do, {
3150
+ return t[9] !== s || t[10] !== n.group || t[11] !== c || t[12] !== u || t[13] !== d || t[14] !== f ? (p = /* @__PURE__ */ J(yo, {
3171
3151
  group: l,
3172
3152
  streaming: u,
3173
3153
  hideQuestionForms: d,
@@ -3175,34 +3155,34 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3175
3155
  animate: s,
3176
3156
  onToggleStickyMessage: c
3177
3157
  }), t[9] = s, t[10] = n.group, t[11] = c, t[12] = u, t[13] = d, t[14] = f, t[15] = p) : p = t[15], p;
3178
- }, ko = (e) => {
3179
- let { leadingResponses: t, groups: n, streaming: r, hideActiveQuestionForms: i, expandedStickyMessageIds: o, onToggleStickyMessage: s, onReady: c } = e, { scrollRef: l } = rt(), u = bo(t, n), d = tr(u.map((e) => e.key)), f = So(l.current), p = a({
3158
+ }, xo = (e) => {
3159
+ let { leadingResponses: t, groups: n, streaming: r, hideActiveQuestionForms: i, expandedStickyMessageIds: o, onToggleStickyMessage: s, onReady: c } = e, { scrollRef: l } = rt(), u = go(t, n), d = $n(u.map((e) => e.key)), f = vo(l.current), p = a({
3180
3160
  count: u.length,
3181
3161
  getScrollElement: () => l.current,
3182
- estimateSize: () => go,
3162
+ estimateSize: () => fo,
3183
3163
  getItemKey: (e) => u[e]?.key ?? e,
3184
- overscan: vo,
3185
- gap: yo,
3164
+ overscan: mo,
3165
+ gap: ho,
3186
3166
  initialRect: {
3187
3167
  width: 0,
3188
3168
  height: f
3189
3169
  },
3190
- initialOffset: () => xo(u.length, f)
3170
+ initialOffset: () => _o(u.length, f)
3191
3171
  }), m = p.getTotalSize();
3192
- return ho({
3172
+ return uo({
3193
3173
  itemCount: u.length,
3194
3174
  onReady: c,
3195
3175
  scrollRef: l,
3196
3176
  totalSize: m
3197
- }), /* @__PURE__ */ Y(A, {
3177
+ }), /* @__PURE__ */ J(A, {
3198
3178
  px: "xs",
3199
- children: /* @__PURE__ */ Y(A, {
3179
+ children: /* @__PURE__ */ J(A, {
3200
3180
  position: "relative",
3201
3181
  width: "100%",
3202
3182
  style: { height: m },
3203
3183
  children: p.getVirtualItems().map((e) => {
3204
3184
  let t = u[e.index];
3205
- return t ? /* @__PURE__ */ Y(A, {
3185
+ return t ? /* @__PURE__ */ J(A, {
3206
3186
  ref: p.measureElement,
3207
3187
  "data-index": e.index,
3208
3188
  "data-chat-message-list-item": t.type,
@@ -3211,7 +3191,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3211
3191
  left: "0",
3212
3192
  width: "100%",
3213
3193
  style: { top: e.start },
3214
- children: /* @__PURE__ */ Y(Oo, {
3194
+ children: /* @__PURE__ */ J(bo, {
3215
3195
  item: t,
3216
3196
  groupCount: n.length,
3217
3197
  streaming: r,
@@ -3224,11 +3204,11 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3224
3204
  })
3225
3205
  })
3226
3206
  });
3227
- }, Ao = (e) => {
3207
+ }, So = (e) => {
3228
3208
  let { queuedFollowUps: t, defaultValue: n, onChange: r, onSubmit: i, onUpdate: a, onCreate: o, onRestoreDraft: s, canRestoreDraft: c = !1, disabled: l = !1, onSelect: u, onDiscard: d } = e, [f, p] = Q(null), [m, h] = Q({}), [g, _] = Q(null), [v, y] = Q(0), [b, x] = Q({}), [S, C] = Q(null), [w, T] = Q(!1), [E, D] = Q(null), [O, k] = Q(null), A = t.find((e) => e.id === f?.id), j = !(!f || A), M = !!(f && A && f.revision && f.revision !== A.revision), N = f ? m[f.id]?.text ?? f.prompt : n, P = g?.text === n ? g.state : void 0, F = f ? m[f.id]?.state : P, I = (e) => {
3229
3209
  p(e), C(null), k(null), u?.(e), y((e) => e + 1);
3230
3210
  };
3231
- Z(() => {
3211
+ X(() => {
3232
3212
  !f || A || w || l || E === f.id || (D(f.id), c && r && !n.trim() && !t.length && (s?.(f.id), _({
3233
3213
  text: N,
3234
3214
  state: F ?? xt(N)
@@ -3266,7 +3246,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3266
3246
  state: xt(e)
3267
3247
  }
3268
3248
  }));
3269
- }, R = (e, t) => {
3249
+ }, ee = (e, t) => {
3270
3250
  if (!f) {
3271
3251
  _({
3272
3252
  text: e,
@@ -3281,12 +3261,12 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3281
3261
  state: t
3282
3262
  }
3283
3263
  }));
3284
- }, z = () => {
3264
+ }, R = () => {
3285
3265
  f && (d?.(f.id), h((e) => {
3286
3266
  let t = { ...e };
3287
3267
  return delete t[f.id], t;
3288
3268
  })), I(null);
3289
- }, B = async (e, t, n) => {
3269
+ }, z = async (e, t, n) => {
3290
3270
  if (n) return i?.(e, t, n);
3291
3271
  if (!f) return i?.(e, t);
3292
3272
  if (M || w) throw Error("Select the saved request again before updating.");
@@ -3305,30 +3285,30 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3305
3285
  } finally {
3306
3286
  T(!1);
3307
3287
  }
3308
- }, V = f?.id ?? "draft";
3288
+ }, B = f?.id ?? "draft";
3309
3289
  return {
3310
- initialSelection: b[V],
3290
+ initialSelection: b[B],
3311
3291
  changeSelection: (e) => x((t) => ({
3312
3292
  ...t,
3313
- [V]: e
3293
+ [B]: e
3314
3294
  })),
3315
3295
  draftValue: n,
3316
3296
  change: L,
3317
- changeState: R,
3297
+ changeState: ee,
3318
3298
  edit: (e) => {
3319
3299
  w || I(e);
3320
3300
  },
3321
3301
  selectDraft: () => {
3322
3302
  w || I(null);
3323
3303
  },
3324
- discard: z,
3304
+ discard: R,
3325
3305
  editingItem: f,
3326
3306
  editingItemId: f?.id ?? null,
3327
3307
  focusSignal: v,
3328
3308
  inputValue: N,
3329
3309
  editorState: F,
3330
3310
  isEditing: !!f,
3331
- submit: B,
3311
+ submit: z,
3332
3312
  error: S,
3333
3313
  notice: O ?? (j ? "This request was sent. Create a new queue item to keep your edits." : null),
3334
3314
  createNew: j,
@@ -3336,23 +3316,23 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3336
3316
  stale: M,
3337
3317
  dirtyItemIds: Object.keys(m).filter((e) => m[e].text !== t.find((t) => t.id === e)?.prompt)
3338
3318
  };
3339
- }, jo = (e) => {
3340
- let t = J(51), { conversationKey: n, recentUserMessages: r, actions: i, attachmentActions: a, attachedResources: o, attachmentList: s, chatInputAutoFocus: c, chatInputPlaceholder: l, chatInputQuestionPrompt: u, composerDecision: d, chatInputCommands: f, hasWorkspaceHub: p, inputDisabled: m, submitDisabled: h, onAttachFiles: g, onAttachText: _, onClearAttachments: v, onInterrupt: y, queuedComposer: b, streaming: x } = e, { editing: S, hasQueuedFollowUps: C } = e, w = b.createNew ? "Create new queue item" : "Update", T = b.updating ? "Saving…" : w, E;
3319
+ }, Co = (e) => {
3320
+ let t = q(51), { conversationKey: n, recentUserMessages: r, actions: i, attachmentActions: a, attachedResources: o, attachmentList: s, chatInputAutoFocus: c, chatInputPlaceholder: l, chatInputQuestionPrompt: u, composerDecision: d, chatInputCommands: f, hasWorkspaceHub: p, inputDisabled: m, submitDisabled: h, onAttachFiles: g, onAttachText: _, onClearAttachments: v, onInterrupt: y, queuedComposer: b, streaming: x } = e, { editing: S, hasQueuedFollowUps: C } = e, w = b.createNew ? "Create new queue item" : "Update", T = b.updating ? "Saving…" : w, E;
3341
3321
  t[0] !== S || t[1] !== m || t[2] !== b ? (E = (e) => {
3342
3322
  e.key !== "Escape" || e.defaultPrevented || e.nativeEvent.isComposing || !S || m || b.updating || !e.currentTarget.contains(e.target) || (e.preventDefault(), e.stopPropagation(), b.discard());
3343
3323
  }, t[0] = S, t[1] = m, t[2] = b, t[3] = E) : E = t[3];
3344
3324
  let D = `${n ?? ""}:${b.editingItemId ?? "draft"}`, O;
3345
3325
  t[4] !== b.editorState || t[5] !== b.inputValue ? (O = b.editorState ?? xt(b.inputValue), t[4] = b.editorState, t[5] = b.inputValue, t[6] = O) : O = t[6];
3346
3326
  let k = !S && x, M = S ? void 0 : y, N;
3347
- t[7] !== S || t[8] !== m || t[9] !== b.discard || t[10] !== b.updating ? (N = S ? /* @__PURE__ */ Y(j, {
3327
+ t[7] !== S || t[8] !== m || t[9] !== b.discard || t[10] !== b.updating ? (N = S ? /* @__PURE__ */ J(j, {
3348
3328
  size: "xs",
3349
3329
  variant: "ghost",
3350
3330
  onClick: b.discard,
3351
3331
  disabled: b.updating || m,
3352
3332
  children: "Cancel"
3353
3333
  }) : null, t[7] = S, t[8] = m, t[9] = b.discard, t[10] = b.updating, t[11] = N) : N = t[11];
3354
- let P = m || b.updating, F = h || S && b.stale, I = !S && C, L = S ? w : void 0, R = S ? T : void 0, z;
3355
- t[12] !== i || t[13] !== o || t[14] !== a || t[15] !== s || t[16] !== c || t[17] !== f || t[18] !== l || t[19] !== u || t[20] !== d || t[21] !== S || t[22] !== p || t[23] !== g || t[24] !== _ || t[25] !== v || t[26] !== b.change || t[27] !== b.changeSelection || t[28] !== b.changeState || t[29] !== b.focusSignal || t[30] !== b.initialSelection || t[31] !== b.submit || t[32] !== r || t[33] !== D || t[34] !== R || t[35] !== O || t[36] !== k || t[37] !== M || t[38] !== N || t[39] !== P || t[40] !== F || t[41] !== I || t[42] !== L ? (z = /* @__PURE__ */ Y(Zn, {
3334
+ let P = m || b.updating, F = h || S && b.stale, I = !S && C, L = S ? w : void 0, ee = S ? T : void 0, R;
3335
+ t[12] !== i || t[13] !== o || t[14] !== a || t[15] !== s || t[16] !== c || t[17] !== f || t[18] !== l || t[19] !== u || t[20] !== d || t[21] !== S || t[22] !== p || t[23] !== g || t[24] !== _ || t[25] !== v || t[26] !== b.change || t[27] !== b.changeSelection || t[28] !== b.changeState || t[29] !== b.focusSignal || t[30] !== b.initialSelection || t[31] !== b.submit || t[32] !== r || t[33] !== D || t[34] !== ee || t[35] !== O || t[36] !== k || t[37] !== M || t[38] !== N || t[39] !== P || t[40] !== F || t[41] !== I || t[42] !== L ? (R = /* @__PURE__ */ J(Yn, {
3356
3336
  recentUserMessages: r,
3357
3337
  placeholder: l,
3358
3338
  defaultState: O,
@@ -3380,25 +3360,25 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3380
3360
  autoFocus: c,
3381
3361
  focusSignal: b.focusSignal,
3382
3362
  submitTitle: L,
3383
- submitLabel: R,
3363
+ submitLabel: ee,
3384
3364
  retainTextUntilAcknowledged: S,
3385
3365
  commands: f
3386
- }, D), t[12] = i, t[13] = o, t[14] = a, t[15] = s, t[16] = c, t[17] = f, t[18] = l, t[19] = u, t[20] = d, t[21] = S, t[22] = p, t[23] = g, t[24] = _, t[25] = v, t[26] = b.change, t[27] = b.changeSelection, t[28] = b.changeState, t[29] = b.focusSignal, t[30] = b.initialSelection, t[31] = b.submit, t[32] = r, t[33] = D, t[34] = R, t[35] = O, t[36] = k, t[37] = M, t[38] = N, t[39] = P, t[40] = F, t[41] = I, t[42] = L, t[43] = z) : z = t[43];
3387
- let B;
3388
- t[44] !== S || t[45] !== b ? (B = /* @__PURE__ */ Y(Mo, {
3366
+ }, D), t[12] = i, t[13] = o, t[14] = a, t[15] = s, t[16] = c, t[17] = f, t[18] = l, t[19] = u, t[20] = d, t[21] = S, t[22] = p, t[23] = g, t[24] = _, t[25] = v, t[26] = b.change, t[27] = b.changeSelection, t[28] = b.changeState, t[29] = b.focusSignal, t[30] = b.initialSelection, t[31] = b.submit, t[32] = r, t[33] = D, t[34] = ee, t[35] = O, t[36] = k, t[37] = M, t[38] = N, t[39] = P, t[40] = F, t[41] = I, t[42] = L, t[43] = R) : R = t[43];
3367
+ let z;
3368
+ t[44] !== S || t[45] !== b ? (z = /* @__PURE__ */ J(wo, {
3389
3369
  queuedComposer: b,
3390
3370
  editing: S
3391
- }), t[44] = S, t[45] = b, t[46] = B) : B = t[46];
3392
- let V;
3393
- return t[47] !== E || t[48] !== z || t[49] !== B ? (V = /* @__PURE__ */ X(A, {
3371
+ }), t[44] = S, t[45] = b, t[46] = z) : z = t[46];
3372
+ let B;
3373
+ return t[47] !== E || t[48] !== R || t[49] !== z ? (B = /* @__PURE__ */ Y(A, {
3394
3374
  onKeyDown: E,
3395
- children: [z, B]
3396
- }), t[47] = E, t[48] = z, t[49] = B, t[50] = V) : V = t[50], V;
3397
- }, Mo = (e) => {
3398
- let t = J(4), { queuedComposer: n, editing: r } = e, i = r && n.stale, a = n.error ?? (i ? "This request changed. Your edit is kept; select the saved request again before updating." : n.notice);
3375
+ children: [R, z]
3376
+ }), t[47] = E, t[48] = R, t[49] = z, t[50] = B) : B = t[50], B;
3377
+ }, wo = (e) => {
3378
+ let t = q(4), { queuedComposer: n, editing: r } = e, i = r && n.stale, a = n.error ?? (i ? "This request changed. Your edit is kept; select the saved request again before updating." : n.notice);
3399
3379
  if (!a) return null;
3400
3380
  let o = !!(n.error || i), s = o ? "fg.error" : "fg.muted", c = o ? "alert" : "status", l;
3401
- return t[0] !== a || t[1] !== s || t[2] !== c ? (l = /* @__PURE__ */ Y(K, {
3381
+ return t[0] !== a || t[1] !== s || t[2] !== c ? (l = /* @__PURE__ */ J(G, {
3402
3382
  mt: "2xs",
3403
3383
  color: s,
3404
3384
  textStyle: "label/S/regular",
@@ -3406,7 +3386,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3406
3386
  "aria-label": "Queued edit notice",
3407
3387
  children: a
3408
3388
  }), t[0] = a, t[1] = s, t[2] = c, t[3] = l) : l = t[3], l;
3409
- }, No = (e, { context: t }, n) => {
3389
+ }, To = (e, { context: t }, n) => {
3410
3390
  if (![
3411
3391
  "ArrowUp",
3412
3392
  "ArrowDown",
@@ -3421,7 +3401,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3421
3401
  x: o.left + (o.width - (t.collisionRect?.width ?? 0)) / 2,
3422
3402
  y: o.top + (o.height - (t.collisionRect?.height ?? 0)) / 2
3423
3403
  };
3424
- }, Po = (e) => {
3404
+ }, Eo = (e) => {
3425
3405
  let { item: t, index: n, kind: r } = e, i = $e({
3426
3406
  id: `${t.id}:${r}`,
3427
3407
  disabled: !!(t.sending || t.steeringDelivery),
@@ -3448,14 +3428,14 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3448
3428
  height: "25%"
3449
3429
  }
3450
3430
  }[r];
3451
- return /* @__PURE__ */ Y(A, {
3431
+ return /* @__PURE__ */ J(A, {
3452
3432
  ref: i.setNodeRef,
3453
3433
  position: "absolute",
3454
3434
  insetX: "0",
3455
3435
  pointerEvents: "none",
3456
3436
  ...a
3457
3437
  });
3458
- }, Fo = (e) => {
3438
+ }, Do = (e) => {
3459
3439
  let { visible: t, targeted: n, reason: r } = e, i = $e({
3460
3440
  id: "queue-send-now",
3461
3441
  disabled: !t,
@@ -3463,33 +3443,33 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3463
3443
  kind: "steer",
3464
3444
  order: -1
3465
3445
  }
3466
- }), a = de({ recipe: p })();
3467
- return t ? /* @__PURE__ */ Y(A, {
3446
+ }), a = fe({ recipe: p })();
3447
+ return t ? /* @__PURE__ */ J(A, {
3468
3448
  ref: i.setNodeRef,
3469
3449
  css: a.sendNowHit,
3470
- children: /* @__PURE__ */ X(A, {
3450
+ children: /* @__PURE__ */ Y(A, {
3471
3451
  css: a.sendNow,
3472
3452
  bottom: "0",
3473
3453
  title: r ?? void 0,
3474
3454
  "aria-disabled": !!r,
3475
3455
  "data-targeted": n && !r,
3476
3456
  "data-queue-send-now": !0,
3477
- children: [/* @__PURE__ */ Y(Ce, { size: 14 }), /* @__PURE__ */ Y(K, { children: "drop here to send now" })]
3457
+ children: [/* @__PURE__ */ J(Ce, { size: 14 }), /* @__PURE__ */ J(G, { children: "drop here to send now" })]
3478
3458
  })
3479
3459
  }) : null;
3480
- }, Io = (e) => {
3460
+ }, Oo = (e) => {
3481
3461
  let { item: t, index: n, editor: r, source: i, destination: a, unavailableReason: o, editing: c, onEdit: l, onRemove: u } = e, d = !!(t.sending || t.steeringDelivery), f = Qe({
3482
3462
  id: t.id,
3483
3463
  data: { item: t },
3484
3464
  disabled: d
3485
- }), m = de({ recipe: p })(), [h, g] = Q(!1), [_, v] = Q(!1), y = ye(void 0), b = ye(null);
3486
- Z(() => () => clearTimeout(y.current), []), Z(() => {
3465
+ }), m = fe({ recipe: p })(), [h, g] = Q(!1), [_, v] = Q(!1), y = Z(void 0), b = Z(null);
3466
+ X(() => () => clearTimeout(y.current), []), X(() => {
3487
3467
  c && b.current?.scrollIntoView({ block: "nearest" });
3488
3468
  }, [c]);
3489
3469
  let x = () => {
3490
3470
  clearTimeout(y.current), g(!0);
3491
3471
  }, S = !r;
3492
- return /* @__PURE__ */ X(A, {
3472
+ return /* @__PURE__ */ Y(A, {
3493
3473
  className: "group",
3494
3474
  ref: (e) => {
3495
3475
  f.setNodeRef(e), b.current = e;
@@ -3514,7 +3494,7 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3514
3494
  !t.sending && S && !e.target.closest("button") && l?.(t);
3515
3495
  },
3516
3496
  children: [
3517
- /* @__PURE__ */ Y(R, {
3497
+ /* @__PURE__ */ J(ee, {
3518
3498
  ref: f.setActivatorNodeRef,
3519
3499
  ...f.listeners,
3520
3500
  ...f.attributes,
@@ -3524,24 +3504,24 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3524
3504
  css: m.handle,
3525
3505
  disabled: d,
3526
3506
  onClick: (e) => e.stopPropagation(),
3527
- children: /* @__PURE__ */ Y(Ie, { size: 14 })
3507
+ children: /* @__PURE__ */ J(Ie, { size: 14 })
3528
3508
  }),
3529
- /* @__PURE__ */ X(G, {
3509
+ /* @__PURE__ */ Y(W, {
3530
3510
  flex: "1",
3531
3511
  minW: "0",
3532
3512
  gap: "2xs",
3533
- children: [r ?? /* @__PURE__ */ Y(A, {
3513
+ children: [r ?? /* @__PURE__ */ J(A, {
3534
3514
  asChild: !0,
3535
3515
  css: m.content,
3536
- children: /* @__PURE__ */ X("button", {
3516
+ children: /* @__PURE__ */ Y("button", {
3537
3517
  type: "button",
3538
3518
  disabled: t.sending,
3539
3519
  "aria-label": `Edit queued message: ${t.prompt}`,
3540
3520
  onClick: () => l?.(t),
3541
- children: [/* @__PURE__ */ Y(K, {
3521
+ children: [/* @__PURE__ */ J(G, {
3542
3522
  lineClamp: 2,
3543
3523
  children: t.prompt
3544
- }), /* @__PURE__ */ Y(K, {
3524
+ }), /* @__PURE__ */ J(G, {
3545
3525
  color: "fg.muted",
3546
3526
  textStyle: "label/XS",
3547
3527
  lineClamp: 1,
@@ -3553,204 +3533,204 @@ var Ua = (e) => e === "user" || e === "assistant" || e === "developer" ? e : "as
3553
3533
  ].filter(Boolean).join(" · ") || "Saved request"
3554
3534
  })]
3555
3535
  })
3556
- }), t.steeringDelivery ? /* @__PURE__ */ Y(K, {
3536
+ }), t.steeringDelivery ? /* @__PURE__ */ J(G, {
3557
3537
  css: m.notice,
3558
3538
  children: "Delivery is unconfirmed. Saved input is kept and will not be replayed."
3559
3539
  }) : null]
3560
3540
  }),
3561
- u && !r && !d ? /* @__PURE__ */ Y(I, {
3541
+ u && !r && !d ? /* @__PURE__ */ J(I, {
3562
3542
  css: m.actions,
3563
3543
  "data-visible": h || _ || c,
3564
- children: /* @__PURE__ */ Y(R, {
3544
+ children: /* @__PURE__ */ J(ee, {
3565
3545
  "aria-label": "Remove queued follow-up",
3566
3546
  size: "2xs",
3567
3547
  variant: "destructive-ghost",
3568
3548
  onClick: (e) => {
3569
3549
  e.stopPropagation(), u(t.id);
3570
3550
  },
3571
- children: /* @__PURE__ */ Y(Ke, { size: 14 })
3551
+ children: /* @__PURE__ */ J(Ke, { size: 14 })
3572
3552
  })
3573
3553
  }) : null,
3574
- /* @__PURE__ */ Y(Po, {
3554
+ /* @__PURE__ */ J(Eo, {
3575
3555
  item: t,
3576
3556
  index: n,
3577
3557
  kind: "before"
3578
3558
  }),
3579
- /* @__PURE__ */ Y(Po, {
3559
+ /* @__PURE__ */ J(Eo, {
3580
3560
  item: t,
3581
3561
  index: n,
3582
3562
  kind: "combine"
3583
3563
  }),
3584
- /* @__PURE__ */ Y(Po, {
3564
+ /* @__PURE__ */ J(Eo, {
3585
3565
  item: t,
3586
3566
  index: n,
3587
3567
  kind: "after"
3588
3568
  }),
3589
- a === "before" ? /* @__PURE__ */ Y(s, { top: "0" }) : null,
3590
- a === "after" ? /* @__PURE__ */ Y(s, { bottom: "0" }) : null
3569
+ a === "before" ? /* @__PURE__ */ J(s, { top: "0" }) : null,
3570
+ a === "after" ? /* @__PURE__ */ J(s, { bottom: "0" }) : null
3591
3571
  ]
3592
3572
  });
3593
- }, Lo = (e) => JSON.stringify([e.model, Object.entries(e.params ?? {}).sort(([e], [t]) => e.localeCompare(t))]), Ro = (e) => {
3594
- let t = J(87), { items: r, editingItemId: i, editor: a, retainedEditor: o, retainedEditorPosition: s, dirtyItemIds: c, steeringUnavailableReason: l, onEdit: u, onRemove: d, onMove: f, onSteer: m, onCombine: h } = e, g;
3573
+ }, ko = (e) => JSON.stringify([e.model, Object.entries(e.params ?? {}).sort(([e], [t]) => e.localeCompare(t))]), Ao = (e) => {
3574
+ let t = q(87), { items: r, editingItemId: i, editor: a, retainedEditor: o, retainedEditorPosition: s, dirtyItemIds: c, steeringUnavailableReason: l, onEdit: u, onRemove: d, onMove: f, onSteer: m, onCombine: h } = e, g;
3595
3575
  t[0] === c ? g = t[1] : (g = c === void 0 ? [] : c, t[0] = c, t[1] = g);
3596
3576
  let _ = g, v;
3597
3577
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (v = { recipe: p }, t[2] = v) : v = t[2];
3598
- let y = de(v), b;
3578
+ let y = fe(v), b;
3599
3579
  t[3] === y ? b = t[4] : (b = y(), t[3] = y, t[4] = b);
3600
3580
  let x = b, [S, C] = Q(null), w;
3601
3581
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (w = { activationConstraint: { distance: 4 } }, t[5] = w) : w = t[5];
3602
3582
  let T;
3603
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (T = { coordinateGetter: (e, t) => No(e, t, C) }, t[6] = T) : T = t[6];
3583
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (T = { coordinateGetter: (e, t) => To(e, t, C) }, t[6] = T) : T = t[6];
3604
3584
  let E = tt(et(Ye, w), et(Je, T)), [D, O] = Q(null), k;
3605
3585
  t[7] === Symbol.for("react.memo_cache_sentinel") ? (k = [], t[7] = k) : k = t[7];
3606
- let [j, M] = Q(k), [N, P] = Q(null), [F, I] = Q(null), [L, R] = Q(!1);
3586
+ let [j, M] = Q(k), [N, P] = Q(null), [F, I] = Q(null), [L, ee] = Q(!1);
3607
3587
  if (!r.length && !o) return null;
3608
- let z;
3609
- t[8] !== r || t[9] !== s ? (z = zo(r, s), t[8] = r, t[9] = s, t[10] = z) : z = t[10];
3610
- let B = z, V;
3611
- t[11] !== _ || t[12] !== m || t[13] !== D || t[14] !== l ? (V = D?.steeringUnavailableReason ?? l ?? (D && _.includes(D.id) ? "Update or Cancel this edit before sending." : null) ?? (m ? null : "This conversation cannot accept live input."), t[11] = _, t[12] = m, t[13] = D, t[14] = l, t[15] = V) : V = t[15];
3612
- let H = V, U = !!(D && m && !l), ee;
3613
- t[16] !== _ || t[17] !== D ? (ee = (e) => !D || D.id === e.id ? "Choose another request." : _.includes(D.id) || _.includes(e.id) ? "Update or Cancel the edits first." : Lo(D) === Lo(e) ? e.steeringDelivery ? "Delivery is still being confirmed." : null : "Model and thinking settings must match.", t[16] = _, t[17] = D, t[18] = ee) : ee = t[18];
3614
- let te = ee, ne;
3615
- t[19] !== j || t[20] !== f ? (ne = (e, t, n) => {
3616
- let r = j.filter(Vo), i = r.findIndex((t) => t.id === e.id), a = r.findIndex((e) => e.id === t.id);
3588
+ let R;
3589
+ t[8] !== r || t[9] !== s ? (R = jo(r, s), t[8] = r, t[9] = s, t[10] = R) : R = t[10];
3590
+ let z = R, B;
3591
+ t[11] !== _ || t[12] !== m || t[13] !== D || t[14] !== l ? (B = D?.steeringUnavailableReason ?? l ?? (D && _.includes(D.id) ? "Update or Cancel this edit before sending." : null) ?? (m ? null : "This conversation cannot accept live input."), t[11] = _, t[12] = m, t[13] = D, t[14] = l, t[15] = B) : B = t[15];
3592
+ let te = B, V = !!(D && m && !l), ne;
3593
+ t[16] !== _ || t[17] !== D ? (ne = (e) => !D || D.id === e.id ? "Choose another request." : _.includes(D.id) || _.includes(e.id) ? "Update or Cancel the edits first." : ko(D) === ko(e) ? e.steeringDelivery ? "Delivery is still being confirmed." : null : "Model and thinking settings must match.", t[16] = _, t[17] = D, t[18] = ne) : ne = t[18];
3594
+ let re = ne, ie;
3595
+ t[19] !== j || t[20] !== f ? (ie = (e, t, n) => {
3596
+ let r = j.filter(No), i = r.findIndex((t) => t.id === e.id), a = r.findIndex((e) => e.id === t.id);
3617
3597
  if (i < 0 || a < 0 || i === a) return;
3618
3598
  let o = a + +(n === "after"), s = o - +(i < o);
3619
3599
  if (s !== i) return f?.(e.id, s < i ? "up" : "down", Math.abs(s - i), {
3620
3600
  source: e,
3621
3601
  items: j
3622
3602
  });
3623
- }, t[19] = j, t[20] = f, t[21] = ne) : ne = t[21];
3624
- let re = ne, W;
3625
- t[22] !== te || t[23] !== h || t[24] !== m || t[25] !== re || t[26] !== H ? (W = (e, t) => {
3603
+ }, t[19] = j, t[20] = f, t[21] = ie) : ie = t[21];
3604
+ let H = ie, U;
3605
+ t[22] !== re || t[23] !== h || t[24] !== m || t[25] !== H || t[26] !== te ? (U = (e, t) => {
3626
3606
  if (t.kind === "steer") {
3627
- if (!H) return m?.(e);
3628
- I(H);
3607
+ if (!te) return m?.(e);
3608
+ I(te);
3629
3609
  return;
3630
3610
  }
3631
- if (t.item) return t.kind === "combine" ? te(t.item) ? void 0 : h?.(e, t.item) : re(e, t.item, t.kind);
3632
- }, t[22] = te, t[23] = h, t[24] = m, t[25] = re, t[26] = H, t[27] = W) : W = t[27];
3633
- let G = W, ie;
3634
- t[28] === S ? ie = t[29] : (ie = (e) => {
3611
+ if (t.item) return t.kind === "combine" ? re(t.item) ? void 0 : h?.(e, t.item) : H(e, t.item, t.kind);
3612
+ }, t[22] = re, t[23] = h, t[24] = m, t[25] = H, t[26] = te, t[27] = U) : U = t[27];
3613
+ let W = U, ae;
3614
+ t[28] === S ? ae = t[29] : (ae = (e) => {
3635
3615
  if (!e.pointerCoordinates && S !== null) return [{ id: S }];
3636
3616
  let t = Xe(e);
3637
3617
  return t.length ? t : Ze(e);
3638
- }, t[28] = S, t[29] = ie);
3639
- let ae;
3640
- t[30] === r ? ae = t[31] : (ae = (e) => {
3618
+ }, t[28] = S, t[29] = ae);
3619
+ let oe;
3620
+ t[30] === r ? oe = t[31] : (oe = (e) => {
3641
3621
  C(null), O(e.active.data.current?.item ?? null), M(r), I(null);
3642
- }, t[30] = r, t[31] = ae);
3643
- let oe, q;
3644
- t[32] === Symbol.for("react.memo_cache_sentinel") ? (oe = (e) => P(e.over?.data.current ?? null), q = () => {
3622
+ }, t[30] = r, t[31] = oe);
3623
+ let se, ce;
3624
+ t[32] === Symbol.for("react.memo_cache_sentinel") ? (se = (e) => P(e.over?.data.current ?? null), ce = () => {
3645
3625
  C(null), O(null), P(null);
3646
- }, t[32] = oe, t[33] = q) : (oe = t[32], q = t[33]);
3647
- let se;
3648
- t[34] !== L || t[35] !== G || t[36] !== D ? (se = (e) => {
3626
+ }, t[32] = se, t[33] = ce) : (se = t[32], ce = t[33]);
3627
+ let K;
3628
+ t[34] !== L || t[35] !== W || t[36] !== D ? (K = (e) => {
3649
3629
  let t = D, n = e.over?.data.current;
3650
- O(null), P(null), t && n && !L && (R(!0), Promise.resolve().then(() => G(t, n)).catch((e) => I(e instanceof Error ? e.message : "Could not change the queue. Saved input is kept.")).finally(() => R(!1)));
3651
- }, t[34] = L, t[35] = G, t[36] = D, t[37] = se) : se = t[37];
3652
- let ce = x.root, le = N?.kind === "steer", ue;
3653
- t[38] !== U || t[39] !== H || t[40] !== le ? (ue = /* @__PURE__ */ Y(Fo, {
3654
- visible: U,
3655
- targeted: le,
3656
- reason: H
3657
- }), t[38] = U, t[39] = H, t[40] = le, t[41] = ue) : ue = t[41];
3658
- let fe;
3659
- t[42] === Symbol.for("react.memo_cache_sentinel") ? (fe = { maxH: "queue-viewport" }, t[42] = fe) : fe = t[42];
3660
- let me;
3661
- if (t[43] !== te || t[44] !== N || t[45] !== i || t[46] !== a || t[47] !== r || t[48] !== u || t[49] !== d || t[50] !== o || t[51] !== B || t[52] !== D?.id) {
3630
+ O(null), P(null), t && n && !L && (ee(!0), Promise.resolve().then(() => W(t, n)).catch((e) => I(e instanceof Error ? e.message : "Could not change the queue. Saved input is kept.")).finally(() => ee(!1)));
3631
+ }, t[34] = L, t[35] = W, t[36] = D, t[37] = K) : K = t[37];
3632
+ let le = x.root, ue = N?.kind === "steer", de;
3633
+ t[38] !== V || t[39] !== te || t[40] !== ue ? (de = /* @__PURE__ */ J(Do, {
3634
+ visible: V,
3635
+ targeted: ue,
3636
+ reason: te
3637
+ }), t[38] = V, t[39] = te, t[40] = ue, t[41] = de) : de = t[41];
3638
+ let pe;
3639
+ t[42] === Symbol.for("react.memo_cache_sentinel") ? (pe = { maxH: "queue-viewport" }, t[42] = pe) : pe = t[42];
3640
+ let he;
3641
+ if (t[43] !== re || t[44] !== N || t[45] !== i || t[46] !== a || t[47] !== r || t[48] !== u || t[49] !== d || t[50] !== o || t[51] !== z || t[52] !== D?.id) {
3662
3642
  let e;
3663
- t[54] !== te || t[55] !== N || t[56] !== i || t[57] !== a || t[58] !== u || t[59] !== d || t[60] !== o || t[61] !== B || t[62] !== D?.id ? (e = (e, t) => /* @__PURE__ */ X(pe, { children: [o && t === B ? /* @__PURE__ */ Y(Bo, { children: o }) : null, /* @__PURE__ */ Y(Io, {
3643
+ t[54] !== re || t[55] !== N || t[56] !== i || t[57] !== a || t[58] !== u || t[59] !== d || t[60] !== o || t[61] !== z || t[62] !== D?.id ? (e = (e, t) => /* @__PURE__ */ Y(me, { children: [o && t === z ? /* @__PURE__ */ J(Mo, { children: o }) : null, /* @__PURE__ */ J(Oo, {
3664
3644
  item: e,
3665
3645
  index: t,
3666
3646
  source: D?.id === e.id,
3667
3647
  destination: N?.item?.id === e.id ? N.kind : void 0,
3668
- unavailableReason: N?.kind === "combine" ? te(e) : null,
3648
+ unavailableReason: N?.kind === "combine" ? re(e) : null,
3669
3649
  editing: i === e.id,
3670
3650
  editor: i === e.id ? a : void 0,
3671
3651
  onEdit: u,
3672
3652
  onRemove: d
3673
- })] }, e.id), t[54] = te, t[55] = N, t[56] = i, t[57] = a, t[58] = u, t[59] = d, t[60] = o, t[61] = B, t[62] = D?.id, t[63] = e) : e = t[63], me = r.map(e), t[43] = te, t[44] = N, t[45] = i, t[46] = a, t[47] = r, t[48] = u, t[49] = d, t[50] = o, t[51] = B, t[52] = D?.id, t[53] = me;
3674
- } else me = t[53];
3675
- let he;
3676
- t[64] !== r.length || t[65] !== o || t[66] !== B ? (he = o && B === r.length ? /* @__PURE__ */ Y(Bo, { children: o }) : null, t[64] = r.length, t[65] = o, t[66] = B, t[67] = he) : he = t[67];
3653
+ })] }, e.id), t[54] = re, t[55] = N, t[56] = i, t[57] = a, t[58] = u, t[59] = d, t[60] = o, t[61] = z, t[62] = D?.id, t[63] = e) : e = t[63], he = r.map(e), t[43] = re, t[44] = N, t[45] = i, t[46] = a, t[47] = r, t[48] = u, t[49] = d, t[50] = o, t[51] = z, t[52] = D?.id, t[53] = he;
3654
+ } else he = t[53];
3677
3655
  let ge;
3678
- t[68] !== me || t[69] !== he ? (ge = /* @__PURE__ */ X(n, {
3656
+ t[64] !== r.length || t[65] !== o || t[66] !== z ? (ge = o && z === r.length ? /* @__PURE__ */ J(Mo, { children: o }) : null, t[64] = r.length, t[65] = o, t[66] = z, t[67] = ge) : ge = t[67];
3657
+ let _e;
3658
+ t[68] !== he || t[69] !== ge ? (_e = /* @__PURE__ */ Y(n, {
3679
3659
  maxH: "queue-viewport",
3680
3660
  minH: "0",
3681
- viewportProps: fe,
3682
- children: [me, he]
3683
- }), t[68] = me, t[69] = he, t[70] = ge) : ge = t[70];
3684
- let _e;
3685
- t[71] !== F || t[72] !== x.notice ? (_e = F ? /* @__PURE__ */ Y(K, {
3661
+ viewportProps: pe,
3662
+ children: [he, ge]
3663
+ }), t[68] = he, t[69] = ge, t[70] = _e) : _e = t[70];
3664
+ let ve;
3665
+ t[71] !== F || t[72] !== x.notice ? (ve = F ? /* @__PURE__ */ J(G, {
3686
3666
  css: x.notice,
3687
3667
  role: "alert",
3688
3668
  children: F
3689
- }) : null, t[71] = F, t[72] = x.notice, t[73] = _e) : _e = t[73];
3690
- let Z;
3691
- t[74] !== L || t[75] !== U || t[76] !== x.root || t[77] !== ue || t[78] !== ge || t[79] !== _e ? (Z = /* @__PURE__ */ X(A, {
3692
- css: ce,
3693
- "data-send-now-visible": U,
3669
+ }) : null, t[71] = F, t[72] = x.notice, t[73] = ve) : ve = t[73];
3670
+ let X;
3671
+ t[74] !== L || t[75] !== V || t[76] !== x.root || t[77] !== de || t[78] !== _e || t[79] !== ve ? (X = /* @__PURE__ */ Y(A, {
3672
+ css: le,
3673
+ "data-send-now-visible": V,
3694
3674
  "aria-busy": L,
3695
3675
  children: [
3696
- ue,
3697
- ge,
3698
- _e
3676
+ de,
3677
+ _e,
3678
+ ve
3699
3679
  ]
3700
- }), t[74] = L, t[75] = U, t[76] = x.root, t[77] = ue, t[78] = ge, t[79] = _e, t[80] = Z) : Z = t[80];
3701
- let ve;
3702
- return t[81] !== E || t[82] !== ie || t[83] !== ae || t[84] !== se || t[85] !== Z ? (ve = /* @__PURE__ */ Y(qe, {
3680
+ }), t[74] = L, t[75] = V, t[76] = x.root, t[77] = de, t[78] = _e, t[79] = ve, t[80] = X) : X = t[80];
3681
+ let ye;
3682
+ return t[81] !== E || t[82] !== ae || t[83] !== oe || t[84] !== K || t[85] !== X ? (ye = /* @__PURE__ */ J(qe, {
3703
3683
  sensors: E,
3704
- collisionDetection: ie,
3684
+ collisionDetection: ae,
3705
3685
  autoScroll: !0,
3706
- onDragStart: ae,
3707
- onDragOver: oe,
3708
- onDragCancel: q,
3709
- onDragEnd: se,
3710
- children: Z
3711
- }), t[81] = E, t[82] = ie, t[83] = ae, t[84] = se, t[85] = Z, t[86] = ve) : ve = t[86], ve;
3712
- }, zo = (e, t = Infinity) => {
3686
+ onDragStart: oe,
3687
+ onDragOver: se,
3688
+ onDragCancel: ce,
3689
+ onDragEnd: K,
3690
+ children: X
3691
+ }), t[81] = E, t[82] = ae, t[83] = oe, t[84] = K, t[85] = X, t[86] = ye) : ye = t[86], ye;
3692
+ }, jo = (e, t = Infinity) => {
3713
3693
  let n = e.findIndex((e) => (e.position ?? Infinity) > t);
3714
3694
  return n < 0 ? e.length : n;
3715
- }, Bo = (e) => {
3716
- let t = J(8), { children: n } = e, r;
3695
+ }, Mo = (e) => {
3696
+ let t = q(8), { children: n } = e, r;
3717
3697
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { recipe: p }, t[0] = r) : r = t[0];
3718
- let i = de(r), a;
3698
+ let i = fe(r), a;
3719
3699
  t[1] === i ? a = t[2] : (a = i(), t[1] = i, t[2] = a);
3720
3700
  let o = a, s;
3721
- t[3] === n ? s = t[4] : (s = /* @__PURE__ */ Y(A, {
3701
+ t[3] === n ? s = t[4] : (s = /* @__PURE__ */ J(A, {
3722
3702
  flex: "1",
3723
3703
  minW: "0",
3724
3704
  children: n
3725
3705
  }), t[3] = n, t[4] = s);
3726
3706
  let c;
3727
- return t[5] !== o.row || t[6] !== s ? (c = /* @__PURE__ */ Y(A, {
3707
+ return t[5] !== o.row || t[6] !== s ? (c = /* @__PURE__ */ J(A, {
3728
3708
  css: o.row,
3729
3709
  children: s
3730
3710
  }), t[5] = o.row, t[6] = s, t[7] = c) : c = t[7], c;
3731
3711
  };
3732
- function Vo(e) {
3712
+ function No(e) {
3733
3713
  return !e.sending && !e.steeringDelivery;
3734
3714
  }
3735
3715
  //#endregion
3736
3716
  //#region src/components/chat-ui/components/chat-panel-composer.tsx
3737
- var Ho = (e) => {
3738
- let t = J(42), { composerHeader: n, chatInputQuestionPrompt: r, composerDecision: i, hasWorkspaceHub: a, onQueuedFollowUpMove: o, onQueuedFollowUpRemove: s, onQueuedFollowUpUpdate: c, onQueuedFollowUpSteer: l, onQueuedFollowUpCombine: u, queueSteeringUnavailableReason: d, unsavedQueueItemIds: f, queuedComposer: m, queuedFollowUps: h, workspaceHub: g } = e, _;
3717
+ var Po = (e) => {
3718
+ let t = q(42), { composerHeader: n, chatInputQuestionPrompt: r, composerDecision: i, hasWorkspaceHub: a, onQueuedFollowUpMove: o, onQueuedFollowUpRemove: s, onQueuedFollowUpUpdate: c, onQueuedFollowUpSteer: l, onQueuedFollowUpCombine: u, queueSteeringUnavailableReason: d, unsavedQueueItemIds: f, queuedComposer: m, queuedFollowUps: h, workspaceHub: g } = e, _;
3739
3719
  t[0] === f ? _ = t[1] : (_ = f === void 0 ? [] : f, t[0] = f, t[1] = _);
3740
3720
  let v = _, y;
3741
3721
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (y = { recipe: p }, t[2] = y) : y = t[2];
3742
- let b = de(y), x;
3722
+ let b = fe(y), x;
3743
3723
  t[3] === b ? x = t[4] : (x = b(), t[3] = b, t[4] = x);
3744
3724
  let S = x, C = h.length > 0, w = m.isEditing && !r && !i, T;
3745
- t[5] !== w || t[6] !== C || t[7] !== e ? (T = /* @__PURE__ */ Y(jo, {
3725
+ t[5] !== w || t[6] !== C || t[7] !== e ? (T = /* @__PURE__ */ J(Co, {
3746
3726
  ...e,
3747
3727
  editing: w,
3748
3728
  hasQueuedFollowUps: C
3749
3729
  }), t[5] = w, t[6] = C, t[7] = e, t[8] = T) : T = t[8];
3750
3730
  let E = T, D = a ? "2xs" : "0", O = a ? "2xs" : void 0, k = a ? "1px" : void 0, j = a ? "border" : void 0, M = a ? "xs" : void 0, N = a ? "bg.subtle" : void 0, P = w ? E : void 0, F = w && m.createNew ? E : void 0, I = m.editingItem?.position, L;
3751
3731
  t[9] !== m.dirtyItemIds || t[10] !== v ? (L = [...m.dirtyItemIds, ...v], t[9] = m.dirtyItemIds, t[10] = v, t[11] = L) : L = t[11];
3752
- let R = c ? m.edit : void 0, z;
3753
- t[12] !== u || t[13] !== o || t[14] !== s || t[15] !== l || t[16] !== d || t[17] !== m.editingItemId || t[18] !== h || t[19] !== P || t[20] !== F || t[21] !== I || t[22] !== L || t[23] !== R ? (z = /* @__PURE__ */ Y(Ro, {
3732
+ let ee = c ? m.edit : void 0, R;
3733
+ t[12] !== u || t[13] !== o || t[14] !== s || t[15] !== l || t[16] !== d || t[17] !== m.editingItemId || t[18] !== h || t[19] !== P || t[20] !== F || t[21] !== I || t[22] !== L || t[23] !== ee ? (R = /* @__PURE__ */ J(Ao, {
3754
3734
  items: h,
3755
3735
  editor: P,
3756
3736
  retainedEditor: F,
@@ -3760,26 +3740,26 @@ var Ho = (e) => {
3760
3740
  onSteer: l,
3761
3741
  onCombine: u,
3762
3742
  editingItemId: m.editingItemId,
3763
- onEdit: R,
3743
+ onEdit: ee,
3764
3744
  onRemove: s,
3765
3745
  onMove: o
3766
- }), t[12] = u, t[13] = o, t[14] = s, t[15] = l, t[16] = d, t[17] = m.editingItemId, t[18] = h, t[19] = P, t[20] = F, t[21] = I, t[22] = L, t[23] = R, t[24] = z) : z = t[24];
3767
- let B;
3768
- t[25] !== w || t[26] !== E || t[27] !== m.draftValue || t[28] !== m.selectDraft || t[29] !== S ? (B = w ? /* @__PURE__ */ Y(A, {
3746
+ }), t[12] = u, t[13] = o, t[14] = s, t[15] = l, t[16] = d, t[17] = m.editingItemId, t[18] = h, t[19] = P, t[20] = F, t[21] = I, t[22] = L, t[23] = ee, t[24] = R) : R = t[24];
3747
+ let z;
3748
+ t[25] !== w || t[26] !== E || t[27] !== m.draftValue || t[28] !== m.selectDraft || t[29] !== S ? (z = w ? /* @__PURE__ */ J(A, {
3769
3749
  css: S.draft,
3770
3750
  asChild: !0,
3771
- children: /* @__PURE__ */ Y("button", {
3751
+ children: /* @__PURE__ */ J("button", {
3772
3752
  type: "button",
3773
3753
  onClick: m.selectDraft,
3774
3754
  "aria-label": "Edit saved draft",
3775
3755
  children: m.draftValue || "Saved draft · select to edit"
3776
3756
  })
3777
- }) : E, t[25] = w, t[26] = E, t[27] = m.draftValue, t[28] = m.selectDraft, t[29] = S, t[30] = B) : B = t[30];
3778
- let V;
3779
- return t[31] !== n || t[32] !== M || t[33] !== N || t[34] !== z || t[35] !== B || t[36] !== D || t[37] !== O || t[38] !== k || t[39] !== j || t[40] !== g ? (V = /* @__PURE__ */ Y(G, {
3757
+ }) : E, t[25] = w, t[26] = E, t[27] = m.draftValue, t[28] = m.selectDraft, t[29] = S, t[30] = z) : z = t[30];
3758
+ let B;
3759
+ return t[31] !== n || t[32] !== M || t[33] !== N || t[34] !== R || t[35] !== z || t[36] !== D || t[37] !== O || t[38] !== k || t[39] !== j || t[40] !== g ? (B = /* @__PURE__ */ J(W, {
3780
3760
  p: "xs",
3781
3761
  gap: "0",
3782
- children: /* @__PURE__ */ X(G, {
3762
+ children: /* @__PURE__ */ Y(W, {
3783
3763
  gap: D,
3784
3764
  p: O,
3785
3765
  borderWidth: k,
@@ -3789,38 +3769,38 @@ var Ho = (e) => {
3789
3769
  children: [
3790
3770
  g,
3791
3771
  n,
3792
- z,
3793
- B
3772
+ R,
3773
+ z
3794
3774
  ]
3795
3775
  })
3796
- }), t[31] = n, t[32] = M, t[33] = N, t[34] = z, t[35] = B, t[36] = D, t[37] = O, t[38] = k, t[39] = j, t[40] = g, t[41] = V) : V = t[41], V;
3797
- }, Uo = (e) => {
3776
+ }), t[31] = n, t[32] = M, t[33] = N, t[34] = R, t[35] = z, t[36] = D, t[37] = O, t[38] = k, t[39] = j, t[40] = g, t[41] = B) : B = t[41], B;
3777
+ }, Fo = (e) => {
3798
3778
  let t = Math.max(0, Math.floor(e));
3799
3779
  if (t < 60) return `${t}s`;
3800
3780
  let n = Math.floor(t / 60);
3801
3781
  return n < 60 ? `${n}m ${String(t % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
3802
- }, Wo = (e) => {
3803
- let t = J(8), { startedAt: n, hidden: r } = e, i = r !== void 0 && r, [a] = Q(Date.now), [o, s] = Q(Date.now), c, l;
3782
+ }, Io = (e) => {
3783
+ let t = q(8), { startedAt: n, hidden: r } = e, i = r !== void 0 && r, [a] = Q(Date.now), [o, s] = Q(Date.now), c, l;
3804
3784
  if (t[0] === i ? (c = t[1], l = t[2]) : (c = () => {
3805
3785
  if (i) return;
3806
3786
  let e = () => s(Date.now());
3807
3787
  e();
3808
3788
  let t = setInterval(e, 1e3);
3809
3789
  return () => clearInterval(t);
3810
- }, l = [i], t[0] = i, t[1] = c, t[2] = l), Z(c, l), i) return null;
3790
+ }, l = [i], t[0] = i, t[1] = c, t[2] = l), X(c, l), i) return null;
3811
3791
  let u;
3812
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ Y(W, {
3792
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ J(U, {
3813
3793
  size: "xs",
3814
3794
  color: "fg.muted"
3815
3795
  }), t[3] = u) : u = t[3];
3816
3796
  let d = (o - (n ?? a)) / 1e3, f;
3817
- t[4] === d ? f = t[5] : (f = Uo(d), t[4] = d, t[5] = f);
3797
+ t[4] === d ? f = t[5] : (f = Fo(d), t[4] = d, t[5] = f);
3818
3798
  let p;
3819
- return t[6] === f ? p = t[7] : (p = /* @__PURE__ */ X(I, {
3799
+ return t[6] === f ? p = t[7] : (p = /* @__PURE__ */ Y(I, {
3820
3800
  gap: "2xs",
3821
3801
  px: "sm",
3822
3802
  py: "xs",
3823
- children: [u, /* @__PURE__ */ Y(K, {
3803
+ children: [u, /* @__PURE__ */ J(G, {
3824
3804
  fontFamily: "mono",
3825
3805
  fontSize: "xs",
3826
3806
  color: "fg.muted",
@@ -3828,186 +3808,191 @@ var Ho = (e) => {
3828
3808
  children: f
3829
3809
  })]
3830
3810
  }), t[6] = f, t[7] = p), p;
3831
- }, Go = (e) => {
3832
- let t = J(110), { conversationKey: n, linkHandler: r, messages: i, loading: a, streaming: o, streamingStartedAt: s, emptyStateTitle: l, emptyStateDescription: u, emptyStateContent: d, loaderComponent: f, chatInputPlaceholder: p, chatInputDefaultValue: h, onSubmitMessage: g, onInterrupt: _, onAttachFiles: b, onAttachText: x, onChatInputChange: S, actions: C, attachmentActions: w, composerHeader: T, attachedResources: E, onClearAttachments: D, attachmentList: O, approvalPrompt: k, conversationNotices: A, workspaceHub: j, workspaceInitializing: M, inputDisabled: N, submitDisabled: P, chatInputQuestionPrompt: I, composerDecision: L, chatInputAutoFocus: R, queuedFollowUps: z, onQueuedFollowUpUpdate: B, onQueuedFollowUpCreate: V, onQueuedFollowUpRestoreDraft: H, canRestoreQueuedEditToDraft: U, onQueuedFollowUpSelect: ee, onQueuedFollowUpDiscard: te, onQueuedFollowUpSteer: ne, onQueuedFollowUpCombine: re, queueSteeringUnavailableReason: W, unsavedQueueItemIds: G, onQueuedFollowUpRemove: ie, onQueuedFollowUpMove: K, chatInputCommands: ae } = e, oe = a !== void 0 && a, q = o !== void 0 && o, se = h === void 0 ? "" : h, ce = M !== void 0 && M, le = N !== void 0 && N, ue = P !== void 0 && P, de = R !== void 0 && R, pe;
3833
- t[0] === z ? pe = t[1] : (pe = z === void 0 ? [] : z, t[0] = z, t[1] = pe);
3834
- let me = pe, he;
3835
- t[2] === ae ? he = t[3] : (he = ae === void 0 ? [] : ae, t[2] = ae, t[3] = he);
3836
- let ge = he, _e, Z, ve, ye, be;
3837
- if (t[4] !== n || t[5] !== i || t[6] !== q) {
3838
- let e = Xa(i, { streaming: q });
3839
- _e = e.length > 0, ve = n ?? e[0]?.id, Z = _e ? ve ?? "active-conversation" : null, be = e.reduce(Ko, 0), ye = Qa(e), t[4] = n, t[5] = i, t[6] = q, t[7] = _e, t[8] = Z, t[9] = ve, t[10] = ye, t[11] = be;
3840
- } else _e = t[7], Z = t[8], ve = t[9], ye = t[10], be = t[11];
3841
- let { groups: xe, leadingResponses: Se } = ye, [Ce, we] = Q(qo), [Te, Ee] = Q(null), De = !_e && oe, Oe;
3842
- t[12] === Symbol.for("react.memo_cache_sentinel") ? (Oe = /* @__PURE__ */ Y(ze, {
3811
+ }, Lo = (e) => {
3812
+ let t = q(112), { conversationKey: n, linkHandler: r, messages: i, loading: a, streaming: o, streamingStartedAt: s, emptyStateTitle: l, emptyStateDescription: u, emptyStateContent: d, loaderComponent: f, chatInputPlaceholder: p, chatInputDefaultValue: h, onSubmitMessage: g, onInterrupt: _, onAttachFiles: b, onAttachText: x, onChatInputChange: S, actions: C, attachmentActions: w, composerHeader: T, attachedResources: E, onClearAttachments: D, attachmentList: O, approvalPrompt: k, conversationNotices: j, workspaceHub: M, workspaceInitializing: N, inputDisabled: P, submitDisabled: I, chatInputQuestionPrompt: L, composerDecision: ee, chatInputAutoFocus: R, queuedFollowUps: z, onQueuedFollowUpUpdate: B, onQueuedFollowUpCreate: te, onQueuedFollowUpRestoreDraft: V, canRestoreQueuedEditToDraft: ne, onQueuedFollowUpSelect: re, onQueuedFollowUpDiscard: ie, onQueuedFollowUpSteer: H, onQueuedFollowUpCombine: U, queueSteeringUnavailableReason: W, unsavedQueueItemIds: ae, onQueuedFollowUpRemove: G, onQueuedFollowUpMove: oe, chatInputCommands: se } = e, ce = a !== void 0 && a, K = o !== void 0 && o, le = h === void 0 ? "" : h, ue = N !== void 0 && N, de = P !== void 0 && P, fe = I !== void 0 && I, me = R !== void 0 && R, he;
3813
+ t[0] === z ? he = t[1] : (he = z === void 0 ? [] : z, t[0] = z, t[1] = he);
3814
+ let ge = he, _e;
3815
+ t[2] === se ? _e = t[3] : (_e = se === void 0 ? [] : se, t[2] = se, t[3] = _e);
3816
+ let ve = _e, X, ye, Z, be, xe;
3817
+ if (t[4] !== n || t[5] !== i || t[6] !== K) {
3818
+ let e = Ja(i, { streaming: K });
3819
+ X = e.length > 0, Z = n ?? e[0]?.id, ye = X ? Z ?? "active-conversation" : null, xe = e.reduce(Ro, 0), be = Xa(e), t[4] = n, t[5] = i, t[6] = K, t[7] = X, t[8] = ye, t[9] = Z, t[10] = be, t[11] = xe;
3820
+ } else X = t[7], ye = t[8], Z = t[9], be = t[10], xe = t[11];
3821
+ let { groups: Se, leadingResponses: Ce } = be, [we, Te] = Q(zo), [Ee, De] = Q(null), Oe = !X && ce, ke;
3822
+ t[12] === Symbol.for("react.memo_cache_sentinel") ? (ke = /* @__PURE__ */ J(ze, {
3843
3823
  size: 48,
3844
3824
  strokeWidth: 1.5
3845
- }), t[12] = Oe) : Oe = t[12];
3846
- let ke;
3847
- t[13] !== u || t[14] !== l ? (ke = /* @__PURE__ */ Y(c, {
3848
- icon: Oe,
3825
+ }), t[12] = ke) : ke = t[12];
3826
+ let Ae;
3827
+ t[13] !== u || t[14] !== l ? (Ae = /* @__PURE__ */ J(c, {
3828
+ icon: ke,
3849
3829
  title: l,
3850
3830
  description: u
3851
- }), t[13] = u, t[14] = l, t[15] = ke) : ke = t[15];
3852
- let Ae = De ? f : d ?? ke, je = !!j, Me = bn(i, n ?? i[0]?.id), Ne;
3853
- t[16] !== I || t[17] !== i || t[18] !== Me.prompt ? (Ne = Me.prompt ?? I ?? gn(i), t[16] = I, t[17] = i, t[18] = Me.prompt, t[19] = Ne) : Ne = t[19];
3854
- let Pe = Ne, Fe = !!Pe, Ie = q && _e && !ce && !Pe, Le = !Z || Te === Z, Re;
3855
- t[20] !== U || t[21] !== se || t[22] !== le || t[23] !== S || t[24] !== V || t[25] !== te || t[26] !== H || t[27] !== ee || t[28] !== B || t[29] !== g || t[30] !== me ? (Re = {
3856
- queuedFollowUps: me,
3857
- defaultValue: se,
3831
+ }), t[13] = u, t[14] = l, t[15] = Ae) : Ae = t[15];
3832
+ let je = Oe ? f : d ?? Ae, Me = !!M, Ne = bn(i, n ?? i[0]?.id), Pe;
3833
+ t[16] !== L || t[17] !== i || t[18] !== Ne.prompt ? (Pe = Ne.prompt ?? L ?? gn(i), t[16] = L, t[17] = i, t[18] = Ne.prompt, t[19] = Pe) : Pe = t[19];
3834
+ let Fe = Pe, Ie = !!Fe, Le = K && X && !ue && !Fe, Re = !ye || Ee === ye, Be;
3835
+ t[20] !== ne || t[21] !== le || t[22] !== de || t[23] !== S || t[24] !== te || t[25] !== ie || t[26] !== V || t[27] !== re || t[28] !== B || t[29] !== g || t[30] !== ge ? (Be = {
3836
+ queuedFollowUps: ge,
3837
+ defaultValue: le,
3858
3838
  onChange: S,
3859
3839
  onSubmit: g,
3860
3840
  onUpdate: B,
3861
- onCreate: V,
3862
- onRestoreDraft: H,
3863
- canRestoreDraft: U,
3864
- disabled: le,
3865
- onSelect: ee,
3866
- onDiscard: te
3867
- }, t[20] = U, t[21] = se, t[22] = le, t[23] = S, t[24] = V, t[25] = te, t[26] = H, t[27] = ee, t[28] = B, t[29] = g, t[30] = me, t[31] = Re) : Re = t[31];
3868
- let Be = Ao(Re), Ve;
3869
- t[32] === Symbol.for("react.memo_cache_sentinel") ? (Ve = (e) => {
3870
- we((t) => {
3841
+ onCreate: te,
3842
+ onRestoreDraft: V,
3843
+ canRestoreDraft: ne,
3844
+ disabled: de,
3845
+ onSelect: re,
3846
+ onDiscard: ie
3847
+ }, t[20] = ne, t[21] = le, t[22] = de, t[23] = S, t[24] = te, t[25] = ie, t[26] = V, t[27] = re, t[28] = B, t[29] = g, t[30] = ge, t[31] = Be) : Be = t[31];
3848
+ let Ve = So(Be), He;
3849
+ t[32] === Symbol.for("react.memo_cache_sentinel") ? (He = (e) => {
3850
+ Te((t) => {
3871
3851
  let n = new Set(t);
3872
3852
  return n.has(e) ? n.delete(e) : n.add(e), n;
3873
3853
  });
3874
- }, t[32] = Ve) : Ve = t[32];
3875
- let He = Ve, Ue;
3876
- t[33] !== r || t[34] !== i ? (Ue = y(i, r), t[33] = r, t[34] = i, t[35] = Ue) : Ue = t[35];
3877
- let We = Me.value, Ge = ve ?? null, Ke;
3878
- t[36] !== Ge || t[37] !== be ? (Ke = /* @__PURE__ */ Y(bt, {
3879
- conversationKey: Ge,
3880
- userMessageCount: be
3881
- }), t[36] = Ge, t[37] = be, t[38] = Ke) : Ke = t[38];
3882
- let qe = Le ? "visible" : "hidden", Je;
3883
- t[39] !== A || t[40] !== Ae || t[41] !== Ce || t[42] !== xe || t[43] !== _e || t[44] !== Fe || t[45] !== Se || t[46] !== Z || t[47] !== q ? (Je = _e ? /* @__PURE__ */ X(fe, { children: [/* @__PURE__ */ Y(ko, {
3884
- leadingResponses: Se,
3885
- groups: xe,
3886
- streaming: q,
3887
- hideActiveQuestionForms: Fe,
3888
- expandedStickyMessageIds: Ce,
3889
- onToggleStickyMessage: He,
3890
- onReady: () => Ee(Z)
3891
- }, Z), A] }) : /* @__PURE__ */ X(fe, { children: [A, Ae] }), t[39] = A, t[40] = Ae, t[41] = Ce, t[42] = xe, t[43] = _e, t[44] = Fe, t[45] = Se, t[46] = Z, t[47] = q, t[48] = Je) : Je = t[48];
3892
- let Ye;
3893
- t[49] !== qe || t[50] !== Je ? (Ye = /* @__PURE__ */ Y(st.Viewport, {
3894
- visibility: qe,
3895
- children: Je
3896
- }), t[49] = qe, t[50] = Je, t[51] = Ye) : Ye = t[51];
3854
+ }, t[32] = He) : He = t[32];
3855
+ let Ue = He, We;
3856
+ t[33] !== r || t[34] !== i ? (We = y(i, r), t[33] = r, t[34] = i, t[35] = We) : We = t[35];
3857
+ let Ge = Ne.value, Ke = Z ?? null, qe;
3858
+ t[36] !== Ke || t[37] !== xe ? (qe = /* @__PURE__ */ J(bt, {
3859
+ conversationKey: Ke,
3860
+ userMessageCount: xe
3861
+ }), t[36] = Ke, t[37] = xe, t[38] = qe) : qe = t[38];
3862
+ let Je = Re ? "visible" : "hidden", Ye;
3863
+ t[39] !== j || t[40] !== je || t[41] !== we || t[42] !== Se || t[43] !== X || t[44] !== Ie || t[45] !== Ce || t[46] !== ye || t[47] !== K ? (Ye = X ? /* @__PURE__ */ Y(pe, { children: [/* @__PURE__ */ J(xo, {
3864
+ leadingResponses: Ce,
3865
+ groups: Se,
3866
+ streaming: K,
3867
+ hideActiveQuestionForms: Ie,
3868
+ expandedStickyMessageIds: we,
3869
+ onToggleStickyMessage: Ue,
3870
+ onReady: () => De(ye)
3871
+ }, ye), j] }) : /* @__PURE__ */ Y(pe, { children: [j, je] }), t[39] = j, t[40] = je, t[41] = we, t[42] = Se, t[43] = X, t[44] = Ie, t[45] = Ce, t[46] = ye, t[47] = K, t[48] = Ye) : Ye = t[48];
3897
3872
  let Xe;
3898
- t[52] === Le ? Xe = t[53] : (Xe = Le ? /* @__PURE__ */ Y(st.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, t[52] = Le, t[53] = Xe);
3873
+ t[49] !== Je || t[50] !== Ye ? (Xe = /* @__PURE__ */ J(st.Viewport, {
3874
+ visibility: Je,
3875
+ children: Ye
3876
+ }), t[49] = Je, t[50] = Ye, t[51] = Xe) : Xe = t[51];
3899
3877
  let Ze;
3900
- t[54] !== Ke || t[55] !== Ye || t[56] !== Xe ? (Ze = /* @__PURE__ */ X(st.Root, { children: [
3901
- Ke,
3902
- Ye,
3903
- Xe
3904
- ] }), t[54] = Ke, t[55] = Ye, t[56] = Xe, t[57] = Ze) : Ze = t[57];
3878
+ t[52] === Re ? Ze = t[53] : (Ze = Re ? /* @__PURE__ */ J(st.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, t[52] = Re, t[53] = Ze);
3905
3879
  let Qe;
3906
- t[58] !== ve || t[59] !== Ie || t[60] !== q || t[61] !== s ? (Qe = q ? /* @__PURE__ */ Y(Wo, {
3880
+ t[54] !== qe || t[55] !== Xe || t[56] !== Ze ? (Qe = /* @__PURE__ */ Y(st.Root, { children: [
3881
+ qe,
3882
+ Xe,
3883
+ Ze
3884
+ ] }), t[54] = qe, t[55] = Xe, t[56] = Ze, t[57] = Qe) : Qe = t[57];
3885
+ let $e;
3886
+ t[58] !== Z || t[59] !== Le || t[60] !== K || t[61] !== s ? ($e = K ? /* @__PURE__ */ J(Io, {
3907
3887
  startedAt: s,
3908
- hidden: !Ie
3909
- }, ve) : null, t[58] = ve, t[59] = Ie, t[60] = q, t[61] = s, t[62] = Qe) : Qe = t[62];
3910
- let $e = n ?? i[0]?.id, et;
3911
- t[63] === i ? et = t[64] : (et = Hn(i), t[63] = i, t[64] = et);
3912
- let tt = Me.prompt ? void 0 : L, nt;
3913
- t[65] !== C || t[66] !== Pe || t[67] !== E || t[68] !== w || t[69] !== O || t[70] !== de || t[71] !== ge || t[72] !== p || t[73] !== T || t[74] !== je || t[75] !== le || t[76] !== b || t[77] !== x || t[78] !== D || t[79] !== _ || t[80] !== re || t[81] !== K || t[82] !== ie || t[83] !== ne || t[84] !== B || t[85] !== W || t[86] !== Be || t[87] !== me || t[88] !== q || t[89] !== ue || t[90] !== $e || t[91] !== et || t[92] !== tt || t[93] !== G || t[94] !== j ? (nt = /* @__PURE__ */ Y(Ho, {
3914
- conversationKey: $e,
3915
- recentUserMessages: et,
3888
+ hidden: !Le
3889
+ }, Z) : null, t[58] = Z, t[59] = Le, t[60] = K, t[61] = s, t[62] = $e) : $e = t[62];
3890
+ let et = n ?? i[0]?.id, tt;
3891
+ t[63] === i ? tt = t[64] : (tt = Bn(i), t[63] = i, t[64] = tt);
3892
+ let nt = Ne.prompt ? void 0 : ee, rt;
3893
+ t[65] !== C || t[66] !== Fe || t[67] !== E || t[68] !== w || t[69] !== O || t[70] !== me || t[71] !== ve || t[72] !== p || t[73] !== T || t[74] !== Me || t[75] !== de || t[76] !== b || t[77] !== x || t[78] !== D || t[79] !== _ || t[80] !== U || t[81] !== oe || t[82] !== G || t[83] !== H || t[84] !== B || t[85] !== W || t[86] !== Ve || t[87] !== ge || t[88] !== K || t[89] !== fe || t[90] !== et || t[91] !== tt || t[92] !== nt || t[93] !== ae || t[94] !== M ? (rt = /* @__PURE__ */ J(Po, {
3894
+ conversationKey: et,
3895
+ recentUserMessages: tt,
3916
3896
  actions: C,
3917
3897
  attachmentActions: w,
3918
3898
  composerHeader: T,
3919
3899
  attachedResources: E,
3920
3900
  attachmentList: O,
3921
- chatInputAutoFocus: de,
3901
+ chatInputAutoFocus: me,
3922
3902
  chatInputPlaceholder: p,
3923
- chatInputQuestionPrompt: Pe,
3924
- composerDecision: tt,
3925
- chatInputCommands: ge,
3926
- hasWorkspaceHub: je,
3927
- inputDisabled: le,
3928
- submitDisabled: ue,
3903
+ chatInputQuestionPrompt: Fe,
3904
+ composerDecision: nt,
3905
+ chatInputCommands: ve,
3906
+ hasWorkspaceHub: Me,
3907
+ inputDisabled: de,
3908
+ submitDisabled: fe,
3929
3909
  onAttachFiles: b,
3930
3910
  onAttachText: x,
3931
3911
  onClearAttachments: D,
3932
3912
  onInterrupt: _,
3933
- onQueuedFollowUpMove: K,
3934
- onQueuedFollowUpRemove: ie,
3913
+ onQueuedFollowUpMove: oe,
3914
+ onQueuedFollowUpRemove: G,
3935
3915
  onQueuedFollowUpUpdate: B,
3936
- onQueuedFollowUpSteer: ne,
3937
- onQueuedFollowUpCombine: re,
3916
+ onQueuedFollowUpSteer: H,
3917
+ onQueuedFollowUpCombine: U,
3938
3918
  queueSteeringUnavailableReason: W,
3939
- unsavedQueueItemIds: G,
3940
- queuedComposer: Be,
3941
- queuedFollowUps: me,
3942
- streaming: q,
3943
- workspaceHub: j
3944
- }), t[65] = C, t[66] = Pe, t[67] = E, t[68] = w, t[69] = O, t[70] = de, t[71] = ge, t[72] = p, t[73] = T, t[74] = je, t[75] = le, t[76] = b, t[77] = x, t[78] = D, t[79] = _, t[80] = re, t[81] = K, t[82] = ie, t[83] = ne, t[84] = B, t[85] = W, t[86] = Be, t[87] = me, t[88] = q, t[89] = ue, t[90] = $e, t[91] = et, t[92] = tt, t[93] = G, t[94] = j, t[95] = nt) : nt = t[95];
3945
- let rt;
3946
- t[96] !== k || t[97] !== Ze || t[98] !== Qe || t[99] !== nt ? (rt = /* @__PURE__ */ X(F, {
3919
+ unsavedQueueItemIds: ae,
3920
+ queuedComposer: Ve,
3921
+ queuedFollowUps: ge,
3922
+ streaming: K,
3923
+ workspaceHub: M
3924
+ }), t[65] = C, t[66] = Fe, t[67] = E, t[68] = w, t[69] = O, t[70] = me, t[71] = ve, t[72] = p, t[73] = T, t[74] = Me, t[75] = de, t[76] = b, t[77] = x, t[78] = D, t[79] = _, t[80] = U, t[81] = oe, t[82] = G, t[83] = H, t[84] = B, t[85] = W, t[86] = Ve, t[87] = ge, t[88] = K, t[89] = fe, t[90] = et, t[91] = tt, t[92] = nt, t[93] = ae, t[94] = M, t[95] = rt) : rt = t[95];
3925
+ let it;
3926
+ t[96] !== k || t[97] !== $e || t[98] !== rt ? (it = /* @__PURE__ */ Y(A, {
3927
+ layerStyle: "chatContent",
3928
+ flexShrink: "0",
3929
+ children: [
3930
+ k,
3931
+ $e,
3932
+ rt
3933
+ ]
3934
+ }), t[96] = k, t[97] = $e, t[98] = rt, t[99] = it) : it = t[99];
3935
+ let at;
3936
+ t[100] !== Qe || t[101] !== it ? (at = /* @__PURE__ */ Y(F, {
3947
3937
  position: "relative",
3948
3938
  direction: "column",
3949
3939
  w: "full",
3950
3940
  h: "full",
3951
3941
  overflow: "hidden",
3952
- children: [
3953
- Ze,
3954
- k,
3955
- Qe,
3956
- nt
3957
- ]
3958
- }), t[96] = k, t[97] = Ze, t[98] = Qe, t[99] = nt, t[100] = rt) : rt = t[100];
3959
- let it;
3960
- t[101] !== Me.value || t[102] !== rt ? (it = /* @__PURE__ */ Y(vn, {
3961
- value: We,
3962
- children: rt
3963
- }), t[101] = Me.value, t[102] = rt, t[103] = it) : it = t[103];
3964
- let at;
3965
- t[104] !== r || t[105] !== it ? (at = /* @__PURE__ */ Y(m, {
3966
- handler: r,
3967
- children: it
3968
- }), t[104] = r, t[105] = it, t[106] = at) : at = t[106];
3942
+ children: [Qe, it]
3943
+ }), t[100] = Qe, t[101] = it, t[102] = at) : at = t[102];
3969
3944
  let ot;
3970
- return t[107] !== Ue || t[108] !== at ? (ot = /* @__PURE__ */ Y(v, {
3971
- value: Ue,
3945
+ t[103] !== Ne.value || t[104] !== at ? (ot = /* @__PURE__ */ J(vn, {
3946
+ value: Ge,
3972
3947
  children: at
3973
- }), t[107] = Ue, t[108] = at, t[109] = ot) : ot = t[109], ot;
3948
+ }), t[103] = Ne.value, t[104] = at, t[105] = ot) : ot = t[105];
3949
+ let ct;
3950
+ t[106] !== r || t[107] !== ot ? (ct = /* @__PURE__ */ J(m, {
3951
+ handler: r,
3952
+ children: ot
3953
+ }), t[106] = r, t[107] = ot, t[108] = ct) : ct = t[108];
3954
+ let lt;
3955
+ return t[109] !== We || t[110] !== ct ? (lt = /* @__PURE__ */ J(v, {
3956
+ value: We,
3957
+ children: ct
3958
+ }), t[109] = We, t[110] = ct, t[111] = lt) : lt = t[111], lt;
3974
3959
  };
3975
- function Ko(e, t) {
3960
+ function Ro(e, t) {
3976
3961
  return e + +(t.role === "user");
3977
3962
  }
3978
- function qo() {
3963
+ function zo() {
3979
3964
  return /* @__PURE__ */ new Set();
3980
3965
  }
3981
3966
  //#endregion
3982
3967
  //#region src/components/chat-ui/components/chat-skeleton.tsx
3983
- var Jo = (e) => {
3984
- let t = J(4), { widths: n } = e, r;
3985
- t[0] === n ? r = t[1] : (r = n.map(Xo), t[0] = n, t[1] = r);
3968
+ var Bo = (e) => {
3969
+ let t = q(4), { widths: n } = e, r;
3970
+ t[0] === n ? r = t[1] : (r = n.map(Ho), t[0] = n, t[1] = r);
3986
3971
  let i;
3987
- return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ Y(G, {
3972
+ return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ J(W, {
3988
3973
  gap: "xs",
3989
3974
  w: "full",
3990
3975
  children: r
3991
3976
  }), t[2] = r, t[3] = i), i;
3992
- }, Yo = () => {
3993
- let e = J(2), t;
3994
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ Y(dt.Root, {
3977
+ }, Vo = () => {
3978
+ let e = q(2), t;
3979
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ J(dt.Root, {
3995
3980
  from: "user",
3996
- children: /* @__PURE__ */ Y(dt.Content, {
3981
+ children: /* @__PURE__ */ J(dt.Content, {
3997
3982
  from: "user",
3998
- children: /* @__PURE__ */ Y(Jo, { widths: ["72%", "46%"] })
3983
+ children: /* @__PURE__ */ J(Bo, { widths: ["72%", "46%"] })
3999
3984
  })
4000
3985
  }), e[0] = t) : t = e[0];
4001
3986
  let n;
4002
- return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ X(G, {
3987
+ return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ Y(W, {
4003
3988
  minH: "full",
4004
3989
  py: "xs",
4005
3990
  gap: "0",
4006
- children: [t, /* @__PURE__ */ Y(dt.Root, {
3991
+ children: [t, /* @__PURE__ */ J(dt.Root, {
4007
3992
  from: "assistant",
4008
- children: /* @__PURE__ */ Y(dt.Content, {
3993
+ children: /* @__PURE__ */ J(dt.Content, {
4009
3994
  from: "assistant",
4010
- children: /* @__PURE__ */ Y(Jo, { widths: [
3995
+ children: /* @__PURE__ */ J(Bo, { widths: [
4011
3996
  "76%",
4012
3997
  "62%",
4013
3998
  "40%"
@@ -4016,8 +4001,8 @@ var Jo = (e) => {
4016
4001
  })]
4017
4002
  }), e[1] = n) : n = e[1], n;
4018
4003
  };
4019
- function Xo(e, t) {
4020
- return /* @__PURE__ */ Y(ne, {
4004
+ function Ho(e, t) {
4005
+ return /* @__PURE__ */ J(ie, {
4021
4006
  height: "3",
4022
4007
  width: e,
4023
4008
  borderRadius: "xs"
@@ -4025,31 +4010,31 @@ function Xo(e, t) {
4025
4010
  }
4026
4011
  //#endregion
4027
4012
  //#region src/components/chat-ui/components/conversation-browse.tsx
4028
- var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4013
+ var Uo = 3, Wo = 10, Go = 4, Ko = (e, t) => {
4029
4014
  if (t === null) return 0;
4030
4015
  let n = Math.abs(e - t);
4031
- return n >= $o ? 0 : (1 + Math.cos(Math.PI * n / $o)) / 2;
4032
- }, ts = (e, t) => {
4016
+ return n >= Go ? 0 : (1 + Math.cos(Math.PI * n / Go)) / 2;
4017
+ }, qo = (e, t) => {
4033
4018
  if (t === null) return "fg.subtle";
4034
4019
  let n = Math.abs(e - t);
4035
- return n < .5 ? "fg" : n < $o ? "fg.muted" : "fg.subtle";
4036
- }, ns = (e) => {
4037
- let t = J(11), { item: n, position: r } = e, i = `${r.left}px`, a = `${r.top}px`, o;
4038
- t[0] === n.message ? o = t[1] : (o = /* @__PURE__ */ Y(K, {
4020
+ return n < .5 ? "fg" : n < Go ? "fg.muted" : "fg.subtle";
4021
+ }, Jo = (e) => {
4022
+ let t = q(11), { item: n, position: r } = e, i = `${r.left}px`, a = `${r.top}px`, o;
4023
+ t[0] === n.message ? o = t[1] : (o = /* @__PURE__ */ J(G, {
4039
4024
  textStyle: "label/S/medium",
4040
4025
  color: "fg",
4041
4026
  lineClamp: 2,
4042
4027
  children: n.message
4043
4028
  }), t[0] = n.message, t[1] = o);
4044
4029
  let s;
4045
- t[2] === n.reply ? s = t[3] : (s = n.reply ? /* @__PURE__ */ Y(K, {
4030
+ t[2] === n.reply ? s = t[3] : (s = n.reply ? /* @__PURE__ */ J(G, {
4046
4031
  textStyle: "label/XS/regular",
4047
4032
  color: "fg.muted",
4048
4033
  lineClamp: 2,
4049
4034
  children: n.reply
4050
4035
  }) : null, t[2] = n.reply, t[3] = s);
4051
4036
  let c;
4052
- t[4] !== o || t[5] !== s ? (c = /* @__PURE__ */ X(G, {
4037
+ t[4] !== o || t[5] !== s ? (c = /* @__PURE__ */ Y(W, {
4053
4038
  gap: "1.5",
4054
4039
  p: "3",
4055
4040
  bg: "bg.elevated",
@@ -4059,7 +4044,7 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4059
4044
  children: [o, s]
4060
4045
  }), t[4] = o, t[5] = s, t[6] = c) : c = t[6];
4061
4046
  let l;
4062
- return t[7] !== i || t[8] !== a || t[9] !== c ? (l = /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(A, {
4047
+ return t[7] !== i || t[8] !== a || t[9] !== c ? (l = /* @__PURE__ */ J(re, { children: /* @__PURE__ */ J(A, {
4063
4048
  position: "fixed",
4064
4049
  left: i,
4065
4050
  ml: "2xs",
@@ -4071,9 +4056,9 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4071
4056
  pointerEvents: "none",
4072
4057
  children: c
4073
4058
  }) }), t[7] = i, t[8] = a, t[9] = c, t[10] = l) : l = t[10], l;
4074
- }, rs = (e) => {
4075
- let t = J(22), { items: n, onSelect: r, floating: i } = e, a = i !== void 0 && i, [o, s] = Q(null), [c, l] = Q(null);
4076
- if (n.length < Zo) return null;
4059
+ }, Yo = (e) => {
4060
+ let t = q(22), { items: n, onSelect: r, floating: i } = e, a = i !== void 0 && i, [o, s] = Q(null), [c, l] = Q(null);
4061
+ if (n.length < Uo) return null;
4077
4062
  let u;
4078
4063
  t[0] === n.length ? u = t[1] : (u = (e) => {
4079
4064
  let t = e.currentTarget.getBoundingClientRect(), r = (e.clientY - t.top) / t.height, i = Math.min(n.length - 1, Math.max(0, r * n.length - .5)), a = Math.round(i);
@@ -4095,11 +4080,11 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4095
4080
  let g;
4096
4081
  if (t[5] !== n || t[6] !== r || t[7] !== o) {
4097
4082
  let e;
4098
- t[9] !== r || t[10] !== o ? (e = (e, t) => /* @__PURE__ */ Y(se.button, {
4083
+ t[9] !== r || t[10] !== o ? (e = (e, t) => /* @__PURE__ */ J(K.button, {
4099
4084
  type: "button",
4100
4085
  h: "2px",
4101
- w: `${Qo + 16 * es(t, o)}px`,
4102
- bg: ts(t, o),
4086
+ w: `${Wo + 16 * Ko(t, o)}px`,
4087
+ bg: qo(t, o),
4103
4088
  borderRadius: "1px",
4104
4089
  transition: "width 80ms linear, background-color 80ms linear",
4105
4090
  "aria-label": `Jump to message ${t + 1}`,
@@ -4107,7 +4092,7 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4107
4092
  }, e.id), t[9] = r, t[10] = o, t[11] = e) : e = t[11], g = n.map(e), t[5] = n, t[6] = r, t[7] = o, t[8] = g;
4108
4093
  } else g = t[8];
4109
4094
  let _;
4110
- t[12] !== d || t[13] !== h || t[14] !== g ? (_ = /* @__PURE__ */ Y(F, {
4095
+ t[12] !== d || t[13] !== h || t[14] !== g ? (_ = /* @__PURE__ */ J(F, {
4111
4096
  direction: "column",
4112
4097
  align: "flex-start",
4113
4098
  gap: "1.5",
@@ -4120,24 +4105,24 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4120
4105
  children: g
4121
4106
  }), t[12] = d, t[13] = h, t[14] = g, t[15] = _) : _ = t[15];
4122
4107
  let v;
4123
- t[16] !== p || t[17] !== c ? (v = p && c ? /* @__PURE__ */ Y(ns, {
4108
+ t[16] !== p || t[17] !== c ? (v = p && c ? /* @__PURE__ */ J(Jo, {
4124
4109
  item: p,
4125
4110
  position: c
4126
4111
  }) : null, t[16] = p, t[17] = c, t[18] = v) : v = t[18];
4127
4112
  let y;
4128
- return t[19] !== _ || t[20] !== v ? (y = /* @__PURE__ */ X(A, {
4113
+ return t[19] !== _ || t[20] !== v ? (y = /* @__PURE__ */ Y(A, {
4129
4114
  position: "relative",
4130
4115
  w: "10",
4131
4116
  flexShrink: 0,
4132
4117
  children: [_, v]
4133
4118
  }), t[19] = _, t[20] = v, t[21] = y) : y = t[21], y;
4134
- }, is = (e) => {
4135
- let n = J(17), { tag: r } = e, i;
4136
- n[0] !== r.description || n[1] !== r.label ? (i = /* @__PURE__ */ Y(U.Trigger, {
4119
+ }, Xo = (e) => {
4120
+ let n = q(17), { tag: r } = e, i;
4121
+ n[0] !== r.description || n[1] !== r.label ? (i = /* @__PURE__ */ J(V.Trigger, {
4137
4122
  asChild: !0,
4138
- children: /* @__PURE__ */ Y(ie.Label, {
4123
+ children: /* @__PURE__ */ J(ae.Label, {
4139
4124
  asChild: !0,
4140
- children: /* @__PURE__ */ Y("button", {
4125
+ children: /* @__PURE__ */ J("button", {
4141
4126
  type: "button",
4142
4127
  "aria-label": r.description,
4143
4128
  children: r.label
@@ -4145,36 +4130,36 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4145
4130
  })
4146
4131
  }), n[0] = r.description, n[1] = r.label, n[2] = i) : i = n[2];
4147
4132
  let a = r.closeLabel ?? `Remove ${r.label}`, o;
4148
- n[3] !== a || n[4] !== r.onClose ? (o = /* @__PURE__ */ Y(ie.CloseTrigger, {
4133
+ n[3] !== a || n[4] !== r.onClose ? (o = /* @__PURE__ */ J(ae.CloseTrigger, {
4149
4134
  "aria-label": a,
4150
4135
  onClick: r.onClose
4151
4136
  }), n[3] = a, n[4] = r.onClose, n[5] = o) : o = n[5];
4152
4137
  let s;
4153
- n[6] !== i || n[7] !== o ? (s = /* @__PURE__ */ X(ie.Root, {
4138
+ n[6] !== i || n[7] !== o ? (s = /* @__PURE__ */ Y(ae.Root, {
4154
4139
  variant: "ticket",
4155
4140
  size: "composer",
4156
4141
  children: [i, o]
4157
4142
  }), n[6] = i, n[7] = o, n[8] = s) : s = n[8];
4158
4143
  let c;
4159
- n[9] !== s || n[10] !== r.description ? (c = /* @__PURE__ */ Y(t, {
4144
+ n[9] !== s || n[10] !== r.description ? (c = /* @__PURE__ */ J(t, {
4160
4145
  content: r.description,
4161
4146
  openDelay: 300,
4162
4147
  closeDelay: 150,
4163
4148
  children: s
4164
4149
  }), n[9] = s, n[10] = r.description, n[11] = c) : c = n[11];
4165
4150
  let l;
4166
- n[12] === r.description ? l = n[13] : (l = /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(U.Positioner, { children: /* @__PURE__ */ Y(U.Content, { children: /* @__PURE__ */ Y(K, {
4151
+ n[12] === r.description ? l = n[13] : (l = /* @__PURE__ */ J(re, { children: /* @__PURE__ */ J(V.Positioner, { children: /* @__PURE__ */ J(V.Content, { children: /* @__PURE__ */ J(G, {
4167
4152
  p: "sm",
4168
4153
  textStyle: "label/S/regular",
4169
4154
  overflowWrap: "anywhere",
4170
4155
  children: r.description
4171
4156
  }) }) }) }), n[12] = r.description, n[13] = l);
4172
4157
  let u;
4173
- return n[14] !== c || n[15] !== l ? (u = /* @__PURE__ */ X(U.Root, { children: [c, l] }), n[14] = c, n[15] = l, n[16] = u) : u = n[16], u;
4174
- }, as = (e) => {
4175
- let n = J(64), { mode: r, pending: a, unavailable: o, onRequestConfirmation: s, onAction: c } = e, u;
4158
+ return n[14] !== c || n[15] !== l ? (u = /* @__PURE__ */ Y(V.Root, { children: [c, l] }), n[14] = c, n[15] = l, n[16] = u) : u = n[16], u;
4159
+ }, Zo = (e) => {
4160
+ let n = q(64), { mode: r, pending: a, unavailable: o, onRequestConfirmation: s, onAction: c } = e, u;
4176
4161
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (u = { key: "menu" }, n[0] = u) : u = n[0];
4177
- let d = de(u), f;
4162
+ let d = fe(u), f;
4178
4163
  n[1] === d ? f = n[2] : (f = d(), n[1] = d, n[2] = f);
4179
4164
  let p = f, [m, h] = Q(null), [g, _] = Q(""), [v, y] = Q(!1), b;
4180
4165
  if (n[3] !== r.actions || n[4] !== r.closeActionId) {
@@ -4197,18 +4182,18 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4197
4182
  y(e.open), e.open || h(null);
4198
4183
  }, n[11] = T, n[12] = E) : (T = n[11], E = n[12]);
4199
4184
  let D = `${r.label}: ${r.description} · ${w}`, O;
4200
- n[13] !== r.indicator || n[14] !== o ? (O = r.indicator ? /* @__PURE__ */ Y(ie.StartElement, { children: /* @__PURE__ */ Y(se.span, {
4185
+ n[13] !== r.indicator || n[14] !== o ? (O = r.indicator ? /* @__PURE__ */ J(ae.StartElement, { children: /* @__PURE__ */ J(K.span, {
4201
4186
  role: "img",
4202
4187
  "aria-label": o ? "Status unavailable" : r.indicator.label,
4203
4188
  "data-status-dot": "",
4204
4189
  "data-tone": o ? "neutral" : r.indicator.tone
4205
4190
  }) }) : null, n[13] = r.indicator, n[14] = o, n[15] = O) : O = n[15];
4206
4191
  let k = `${r.label} details`, A;
4207
- n[16] !== r.label || n[17] !== k ? (A = /* @__PURE__ */ Y(ee.Trigger, {
4192
+ n[16] !== r.label || n[17] !== k ? (A = /* @__PURE__ */ J(ne.Trigger, {
4208
4193
  asChild: !0,
4209
- children: /* @__PURE__ */ Y(ie.Label, {
4194
+ children: /* @__PURE__ */ J(ae.Label, {
4210
4195
  asChild: !0,
4211
- children: /* @__PURE__ */ Y("button", {
4196
+ children: /* @__PURE__ */ J("button", {
4212
4197
  type: "button",
4213
4198
  "aria-label": k,
4214
4199
  children: r.label
@@ -4216,13 +4201,13 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4216
4201
  })
4217
4202
  }), n[16] = r.label, n[17] = k, n[18] = A) : A = n[18];
4218
4203
  let M;
4219
- n[19] !== x || n[20] !== C || n[21] !== a || n[22] !== o ? (M = x ? /* @__PURE__ */ Y(ie.CloseTrigger, {
4204
+ n[19] !== x || n[20] !== C || n[21] !== a || n[22] !== o ? (M = x ? /* @__PURE__ */ J(ae.CloseTrigger, {
4220
4205
  "aria-label": x.label,
4221
4206
  disabled: a || o,
4222
4207
  onClick: () => void C(x)
4223
4208
  }) : null, n[19] = x, n[20] = C, n[21] = a, n[22] = o, n[23] = M) : M = n[23];
4224
4209
  let N;
4225
- n[24] !== A || n[25] !== M || n[26] !== O ? (N = /* @__PURE__ */ X(ie.Root, {
4210
+ n[24] !== A || n[25] !== M || n[26] !== O ? (N = /* @__PURE__ */ Y(ae.Root, {
4226
4211
  variant: "ticket",
4227
4212
  size: "composer",
4228
4213
  children: [
@@ -4232,68 +4217,68 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4232
4217
  ]
4233
4218
  }), n[24] = A, n[25] = M, n[26] = O, n[27] = N) : N = n[27];
4234
4219
  let F;
4235
- n[28] !== N || n[29] !== D ? (F = /* @__PURE__ */ Y(t, {
4220
+ n[28] !== N || n[29] !== D ? (F = /* @__PURE__ */ J(t, {
4236
4221
  content: D,
4237
4222
  openDelay: 300,
4238
4223
  closeDelay: 150,
4239
4224
  children: N
4240
4225
  }), n[28] = N, n[29] = D, n[30] = F) : F = n[30];
4241
- let R = `${r.label} details`, z;
4242
- n[31] === r.label ? z = n[32] : (z = /* @__PURE__ */ Y(K, {
4226
+ let ee = `${r.label} details`, R;
4227
+ n[31] === r.label ? R = n[32] : (R = /* @__PURE__ */ J(G, {
4243
4228
  textStyle: "label/S/medium",
4244
4229
  children: r.label
4245
- }), n[31] = r.label, n[32] = z);
4246
- let V;
4247
- n[33] === r.description ? V = n[34] : (V = /* @__PURE__ */ Y(K, {
4230
+ }), n[31] = r.label, n[32] = R);
4231
+ let B;
4232
+ n[33] === r.description ? B = n[34] : (B = /* @__PURE__ */ J(G, {
4248
4233
  textStyle: "label/S/regular",
4249
4234
  overflowWrap: "anywhere",
4250
4235
  children: r.description
4251
- }), n[33] = r.description, n[34] = V);
4252
- let H;
4253
- n[35] === w ? H = n[36] : (H = /* @__PURE__ */ Y(K, {
4236
+ }), n[33] = r.description, n[34] = B);
4237
+ let te;
4238
+ n[35] === w ? te = n[36] : (te = /* @__PURE__ */ J(G, {
4254
4239
  textStyle: "label/XS/regular",
4255
4240
  color: "fg.muted",
4256
4241
  children: w
4257
- }), n[35] = w, n[36] = H);
4258
- let U;
4259
- n[37] !== g || n[38] !== m || n[39] !== C || n[40] !== a || n[41] !== o ? (U = m?.action.argument ? /* @__PURE__ */ X(P.Root, { children: [
4260
- /* @__PURE__ */ Y(P.Label, { children: m.action.argument.label }),
4261
- /* @__PURE__ */ Y(B, {
4242
+ }), n[35] = w, n[36] = te);
4243
+ let V;
4244
+ n[37] !== g || n[38] !== m || n[39] !== C || n[40] !== a || n[41] !== o ? (V = m?.action.argument ? /* @__PURE__ */ Y(P.Root, { children: [
4245
+ /* @__PURE__ */ J(P.Label, { children: m.action.argument.label }),
4246
+ /* @__PURE__ */ J(z, {
4262
4247
  autoFocus: !0,
4263
4248
  size: "sm",
4264
4249
  value: g,
4265
4250
  onChange: (e) => _(e.target.value)
4266
4251
  }),
4267
- /* @__PURE__ */ X(I, { children: [/* @__PURE__ */ Y(j, {
4252
+ /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ J(j, {
4268
4253
  size: "xs",
4269
4254
  variant: "ghost",
4270
4255
  onClick: () => h(null),
4271
4256
  children: "Cancel"
4272
- }), /* @__PURE__ */ Y(j, {
4257
+ }), /* @__PURE__ */ J(j, {
4273
4258
  size: "xs",
4274
4259
  variant: "ghost",
4275
4260
  disabled: a || o || !g.trim(),
4276
4261
  onClick: () => void C(m.action, g, m.mode),
4277
4262
  children: "Apply"
4278
4263
  })] })
4279
- ] }) : null, n[37] = g, n[38] = m, n[39] = C, n[40] = a, n[41] = o, n[42] = U) : U = n[42];
4280
- let ne;
4281
- n[43] !== z || n[44] !== V || n[45] !== H || n[46] !== U ? (ne = /* @__PURE__ */ X(G, {
4264
+ ] }) : null, n[37] = g, n[38] = m, n[39] = C, n[40] = a, n[41] = o, n[42] = V) : V = n[42];
4265
+ let ie;
4266
+ n[43] !== R || n[44] !== B || n[45] !== te || n[46] !== V ? (ie = /* @__PURE__ */ Y(W, {
4282
4267
  p: "sm",
4283
4268
  gap: "xs",
4284
4269
  children: [
4285
- z,
4286
- V,
4287
- H,
4288
- U
4270
+ R,
4271
+ B,
4272
+ te,
4273
+ V
4289
4274
  ]
4290
- }), n[43] = z, n[44] = V, n[45] = H, n[46] = U, n[47] = ne) : ne = n[47];
4291
- let re;
4292
- n[48] !== m || n[49] !== C || n[50] !== r || n[51] !== s || n[52] !== a || n[53] !== o ? (re = m ? null : r.actions.map((e) => /* @__PURE__ */ Y(i, {
4275
+ }), n[43] = R, n[44] = B, n[45] = te, n[46] = V, n[47] = ie) : ie = n[47];
4276
+ let H;
4277
+ n[48] !== m || n[49] !== C || n[50] !== r || n[51] !== s || n[52] !== a || n[53] !== o ? (H = m ? null : r.actions.map((e) => /* @__PURE__ */ J(i, {
4293
4278
  role: "button",
4294
4279
  variant: "full-width",
4295
4280
  label: e.label,
4296
- icon: e.icon ? /* @__PURE__ */ Y(L, {
4281
+ icon: e.icon ? /* @__PURE__ */ J(L, {
4297
4282
  as: l(e.icon),
4298
4283
  boxSize: "icon-xs"
4299
4284
  }) : void 0,
@@ -4304,25 +4289,25 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4304
4289
  mode: r
4305
4290
  })) : C(e);
4306
4291
  }
4307
- }, e.id)), n[48] = m, n[49] = C, n[50] = r, n[51] = s, n[52] = a, n[53] = o, n[54] = re) : re = n[54];
4308
- let W;
4309
- n[55] !== p.content || n[56] !== R || n[57] !== ne || n[58] !== re ? (W = /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(ee.Positioner, { children: /* @__PURE__ */ X(ee.Content, {
4292
+ }, e.id)), n[48] = m, n[49] = C, n[50] = r, n[51] = s, n[52] = a, n[53] = o, n[54] = H) : H = n[54];
4293
+ let U;
4294
+ n[55] !== p.content || n[56] !== ee || n[57] !== ie || n[58] !== H ? (U = /* @__PURE__ */ J(re, { children: /* @__PURE__ */ J(ne.Positioner, { children: /* @__PURE__ */ Y(ne.Content, {
4310
4295
  css: p.content,
4311
- "aria-label": R,
4312
- children: [ne, re]
4313
- }) }) }), n[55] = p.content, n[56] = R, n[57] = ne, n[58] = re, n[59] = W) : W = n[59];
4314
- let ae;
4315
- return n[60] !== v || n[61] !== F || n[62] !== W ? (ae = /* @__PURE__ */ X(ee.Root, {
4296
+ "aria-label": ee,
4297
+ children: [ie, H]
4298
+ }) }) }), n[55] = p.content, n[56] = ee, n[57] = ie, n[58] = H, n[59] = U) : U = n[59];
4299
+ let oe;
4300
+ return n[60] !== v || n[61] !== F || n[62] !== U ? (oe = /* @__PURE__ */ Y(ne.Root, {
4316
4301
  open: v,
4317
4302
  positioning: T,
4318
4303
  onOpenChange: E,
4319
- children: [F, W]
4320
- }), n[60] = v, n[61] = F, n[62] = W, n[63] = ae) : ae = n[63], ae;
4321
- }, os = (e) => {
4322
- let t = J(19), { modes: n, draftTag: r, sentTag: i, pending: a, unavailable: o, onRequestConfirmation: s, onAction: c } = e, l;
4304
+ children: [F, U]
4305
+ }), n[60] = v, n[61] = F, n[62] = U, n[63] = oe) : oe = n[63], oe;
4306
+ }, Qo = (e) => {
4307
+ let t = q(19), { modes: n, draftTag: r, sentTag: i, pending: a, unavailable: o, onRequestConfirmation: s, onAction: c } = e, l;
4323
4308
  if (t[0] !== n || t[1] !== c || t[2] !== s || t[3] !== a || t[4] !== o) {
4324
4309
  let e;
4325
- t[6] !== c || t[7] !== s || t[8] !== a || t[9] !== o ? (e = (e) => /* @__PURE__ */ Y(as, {
4310
+ t[6] !== c || t[7] !== s || t[8] !== a || t[9] !== o ? (e = (e) => /* @__PURE__ */ J(Zo, {
4326
4311
  mode: e,
4327
4312
  pending: a,
4328
4313
  unavailable: o,
@@ -4331,11 +4316,11 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4331
4316
  }, e.id), t[6] = c, t[7] = s, t[8] = a, t[9] = o, t[10] = e) : e = t[10], l = n.map(e), t[0] = n, t[1] = c, t[2] = s, t[3] = a, t[4] = o, t[5] = l;
4332
4317
  } else l = t[5];
4333
4318
  let u;
4334
- t[11] === r ? u = t[12] : (u = r ? /* @__PURE__ */ Y(is, { tag: r }) : null, t[11] = r, t[12] = u);
4319
+ t[11] === r ? u = t[12] : (u = r ? /* @__PURE__ */ J(Xo, { tag: r }) : null, t[11] = r, t[12] = u);
4335
4320
  let d;
4336
- t[13] === i ? d = t[14] : (d = i ? /* @__PURE__ */ Y(is, { tag: i }) : null, t[13] = i, t[14] = d);
4321
+ t[13] === i ? d = t[14] : (d = i ? /* @__PURE__ */ J(Xo, { tag: i }) : null, t[13] = i, t[14] = d);
4337
4322
  let f;
4338
- return t[15] !== l || t[16] !== u || t[17] !== d ? (f = /* @__PURE__ */ X(I, {
4323
+ return t[15] !== l || t[16] !== u || t[17] !== d ? (f = /* @__PURE__ */ Y(I, {
4339
4324
  gap: "2xs",
4340
4325
  minW: "0",
4341
4326
  "aria-label": "Harness controls",
@@ -4345,19 +4330,19 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4345
4330
  d
4346
4331
  ]
4347
4332
  }), t[15] = l, t[16] = u, t[17] = d, t[18] = f) : f = t[18], f;
4348
- }, ss = (e) => {
4349
- let t = J(13), { status: n, statusLabel: r, additions: i, deletions: a } = e;
4333
+ }, $o = (e) => {
4334
+ let t = q(13), { status: n, statusLabel: r, additions: i, deletions: a } = e;
4350
4335
  if (n === "loading") {
4351
4336
  let e;
4352
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ Y(W, {
4337
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(U, {
4353
4338
  size: "xs",
4354
4339
  color: "fg.muted"
4355
4340
  }), t[0] = e) : e = t[0];
4356
4341
  let n = r ?? "Setting up workspace...", i;
4357
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ X(I, {
4342
+ return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ Y(I, {
4358
4343
  gap: "2xs",
4359
4344
  minW: "0",
4360
- children: [e, /* @__PURE__ */ Y(K, {
4345
+ children: [e, /* @__PURE__ */ J(G, {
4361
4346
  textStyle: "label/XS/regular",
4362
4347
  color: "fg.muted",
4363
4348
  truncate: !0,
@@ -4367,15 +4352,15 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4367
4352
  }
4368
4353
  if (n === "error") {
4369
4354
  let e;
4370
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ Y(be, {
4355
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(be, {
4371
4356
  size: 14,
4372
4357
  color: "var(--chakra-colors-fg-error)"
4373
4358
  }), t[3] = e) : e = t[3];
4374
4359
  let n = r ?? "Workspace setup failed", i;
4375
- return t[4] === n ? i = t[5] : (i = /* @__PURE__ */ X(I, {
4360
+ return t[4] === n ? i = t[5] : (i = /* @__PURE__ */ Y(I, {
4376
4361
  gap: "2xs",
4377
4362
  minW: "0",
4378
- children: [e, /* @__PURE__ */ Y(K, {
4363
+ children: [e, /* @__PURE__ */ J(G, {
4379
4364
  textStyle: "label/XS/regular",
4380
4365
  color: "fg.error",
4381
4366
  truncate: !0,
@@ -4385,43 +4370,43 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4385
4370
  }
4386
4371
  if (i <= 0 && a <= 0) return null;
4387
4372
  let o;
4388
- t[6] === i ? o = t[7] : (o = /* @__PURE__ */ X(K, {
4373
+ t[6] === i ? o = t[7] : (o = /* @__PURE__ */ Y(G, {
4389
4374
  textStyle: "label/XS/medium",
4390
4375
  color: "fg.success",
4391
4376
  children: ["+", i]
4392
4377
  }), t[6] = i, t[7] = o);
4393
4378
  let s;
4394
- t[8] === a ? s = t[9] : (s = /* @__PURE__ */ X(K, {
4379
+ t[8] === a ? s = t[9] : (s = /* @__PURE__ */ Y(G, {
4395
4380
  textStyle: "label/XS/medium",
4396
4381
  color: "fg.error",
4397
4382
  children: ["−", a]
4398
4383
  }), t[8] = a, t[9] = s);
4399
4384
  let c;
4400
- return t[10] !== o || t[11] !== s ? (c = /* @__PURE__ */ X(I, {
4385
+ return t[10] !== o || t[11] !== s ? (c = /* @__PURE__ */ Y(I, {
4401
4386
  gap: "2xs",
4402
4387
  children: [o, s]
4403
4388
  }), t[10] = o, t[11] = s, t[12] = c) : c = t[12], c;
4404
- }, cs = (e) => {
4405
- let t = J(13), { workspaceControl: n, additions: r, deletions: i, action: a, status: o, statusLabel: s } = e, c = o === void 0 ? "ready" : o, l;
4406
- t[0] !== r || t[1] !== i || t[2] !== c || t[3] !== s ? (l = /* @__PURE__ */ Y(ss, {
4389
+ }, es = (e) => {
4390
+ let t = q(13), { workspaceControl: n, additions: r, deletions: i, action: a, status: o, statusLabel: s } = e, c = o === void 0 ? "ready" : o, l;
4391
+ t[0] !== r || t[1] !== i || t[2] !== c || t[3] !== s ? (l = /* @__PURE__ */ J($o, {
4407
4392
  status: c,
4408
4393
  statusLabel: s,
4409
4394
  additions: r,
4410
4395
  deletions: i
4411
4396
  }), t[0] = r, t[1] = i, t[2] = c, t[3] = s, t[4] = l) : l = t[4];
4412
4397
  let u;
4413
- t[5] !== l || t[6] !== n ? (u = /* @__PURE__ */ X(I, {
4398
+ t[5] !== l || t[6] !== n ? (u = /* @__PURE__ */ Y(I, {
4414
4399
  gap: "sm",
4415
4400
  minW: "0",
4416
4401
  children: [n, l]
4417
4402
  }), t[5] = l, t[6] = n, t[7] = u) : u = t[7];
4418
4403
  let d;
4419
- t[8] === a ? d = t[9] : (d = a ? /* @__PURE__ */ Y(F, {
4404
+ t[8] === a ? d = t[9] : (d = a ? /* @__PURE__ */ J(F, {
4420
4405
  flexShrink: 0,
4421
4406
  children: a
4422
4407
  }) : null, t[8] = a, t[9] = d);
4423
4408
  let f;
4424
- return t[10] !== u || t[11] !== d ? (f = /* @__PURE__ */ X(F, {
4409
+ return t[10] !== u || t[11] !== d ? (f = /* @__PURE__ */ Y(F, {
4425
4410
  align: "center",
4426
4411
  justify: "space-between",
4427
4412
  gap: "sm",
@@ -4433,6 +4418,6 @@ var Zo = 3, Qo = 10, $o = 4, es = (e, t) => {
4433
4418
  }), t[10] = u, t[11] = d, t[12] = f) : f = t[12], f;
4434
4419
  };
4435
4420
  //#endregion
4436
- export { pt as ApprovalPrompt, gt as AttachmentList, bt as AutoScroll, Zn as ChatInput, dt as ChatMessage, Go as ChatPanel, st as ChatPrimitives, Yo as ChatSkeleton, cs as ChatWorkspaceHub, rs as ConversationBrowse, os as HarnessControls, Dt as SendButton, xt as createSerializedPromptState, _ as parseChatLink };
4421
+ export { pt as ApprovalPrompt, gt as AttachmentList, bt as AutoScroll, Yn as ChatInput, dt as ChatMessage, Lo as ChatPanel, st as ChatPrimitives, Vo as ChatSkeleton, es as ChatWorkspaceHub, Yo as ConversationBrowse, Qo as HarnessControls, Nn as QuestionPromptControls, Dt as SendButton, xt as createSerializedPromptState, _ as parseChatLink, Fn as useQuestionPromptState };
4437
4422
 
4438
4423
  //# sourceMappingURL=chat-ui.js.map