@pstdio/ui 0.24.1 → 0.25.0

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 (65) hide show
  1. package/dist/{MermaidComponent-BTgLnpLA.js → MermaidComponent-BVdDqDRU.js} +2 -2
  2. package/dist/{MermaidComponent-BTgLnpLA.js.map → MermaidComponent-BVdDqDRU.js.map} +1 -1
  3. package/dist/chat-ui.js +1326 -1414
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/activity/activity-comment.d.ts +10 -2
  6. package/dist/components/activity/index.d.ts +3 -1
  7. package/dist/components/activity/resource-activity-feed.d.ts +58 -0
  8. package/dist/components/chat-ui/components/chat-input.d.ts +1 -1
  9. package/dist/components/chat-ui/components/chat-panel.d.ts +1 -1
  10. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +1 -1
  11. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  12. package/dist/components/tab-strip/window-tabs.d.ts +1 -0
  13. package/dist/data-table.js +5 -5
  14. package/dist/diff.js +2 -2
  15. package/dist/{edit-mode-data-table-BrydKuMM.js → edit-mode-data-table-B8UpWb7i.js} +4 -4
  16. package/dist/{edit-mode-data-table-BrydKuMM.js.map → edit-mode-data-table-B8UpWb7i.js.map} +1 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +2047 -1735
  19. package/dist/index.js.map +1 -1
  20. package/dist/{kanban-renderer-toolbar-ebqlG13w.js → kanban-renderer-toolbar-DzY6THJY.js} +3 -3
  21. package/dist/{kanban-renderer-toolbar-ebqlG13w.js.map → kanban-renderer-toolbar-DzY6THJY.js.map} +1 -1
  22. package/dist/kanban-renderer.js +5 -5
  23. package/dist/{lazy-markdown-editor-Obb0M8xc.js → lazy-markdown-editor-ClZPZuaU.js} +2 -2
  24. package/dist/{lazy-markdown-editor-Obb0M8xc.js.map → lazy-markdown-editor-ClZPZuaU.js.map} +1 -1
  25. package/dist/{list-row-CRi3Luog.js → list-row-BDoV_iMV.js} +3 -3
  26. package/dist/list-row-BDoV_iMV.js.map +1 -0
  27. package/dist/{markdown-editor-Bj_QX4oN.js → markdown-editor-CAVqJ9yR.js} +2 -2
  28. package/dist/{markdown-editor-Bj_QX4oN.js.map → markdown-editor-CAVqJ9yR.js.map} +1 -1
  29. package/dist/{markdown-kuU19Oh3.js → markdown-gNucAjnF.js} +9 -9
  30. package/dist/{markdown-kuU19Oh3.js.map → markdown-gNucAjnF.js.map} +1 -1
  31. package/dist/{param-editor-DhoxgwGd.js → param-editor-CTx3mDxQ.js} +2 -2
  32. package/dist/{param-editor-DhoxgwGd.js.map → param-editor-CTx3mDxQ.js.map} +1 -1
  33. package/dist/{param-editor-field-DurcyLuw.js → param-editor-field-DteDEyeU.js} +3 -3
  34. package/dist/{param-editor-field-DurcyLuw.js.map → param-editor-field-DteDEyeU.js.map} +1 -1
  35. package/dist/prompt-input-DNpRL5tI.js +564 -0
  36. package/dist/prompt-input-DNpRL5tI.js.map +1 -0
  37. package/dist/rich-message-CuPiKxKX.js +78 -0
  38. package/dist/rich-message-CuPiKxKX.js.map +1 -0
  39. package/dist/rich-text.js +24 -23
  40. package/dist/rich-text.js.map +1 -1
  41. package/dist/theme/primitives/colors.d.ts +0 -23
  42. package/dist/theme/recipes/activity-comment.d.ts +36 -0
  43. package/dist/theme/recipes/alert.d.ts +1 -1
  44. package/dist/theme/recipes/dialog.d.ts +1 -1
  45. package/dist/theme/recipes/drawer.d.ts +1 -1
  46. package/dist/theme/recipes/menu.d.ts +1 -1
  47. package/dist/theme/recipes/popover.d.ts +1 -1
  48. package/dist/theme/recipes/progress-circle.d.ts +3 -3
  49. package/dist/theme/recipes/switch.d.ts +1 -1
  50. package/dist/theme/recipes/timeline.d.ts +1 -1
  51. package/dist/theme/recipes/tooltip.d.ts +1 -1
  52. package/dist/theme/recipes/window-title-bar.d.ts +4 -1
  53. package/dist/{theme-Ca-KyNoi.js → theme-Dc7hVvMC.js} +120 -801
  54. package/dist/theme-Dc7hVvMC.js.map +1 -0
  55. package/dist/theme.js +1 -1
  56. package/dist/{tree-list-DXwHWodb.js → tree-list-CZvcg3_6.js} +2 -2
  57. package/dist/{tree-list-DXwHWodb.js.map → tree-list-CZvcg3_6.js.map} +1 -1
  58. package/package.json +2 -2
  59. package/dist/list-row-CRi3Luog.js.map +0 -1
  60. package/dist/rich-message-dNYvLDd4.js +0 -628
  61. package/dist/rich-message-dNYvLDd4.js.map +0 -1
  62. package/dist/theme/recipes/landing-story.d.ts +0 -10
  63. package/dist/theme/recipes/landing-tool-demo.d.ts +0 -1
  64. package/dist/theme/recipes/landing.d.ts +0 -23
  65. package/dist/theme-Ca-KyNoi.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,22 +1,23 @@
1
- import { jsx as c, jsxs as C, Fragment as tn } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as k, Fragment as At } from "react/jsx-runtime";
2
2
  import { c as A } from "react/compiler-runtime";
3
- import { AbsoluteCenter as bs, IconButton as ot, chakra as vn, createSlotRecipeContext as ys, defineSlotRecipe as xs, Text as j, Code as fn, Button as ft, HStack as ce, Box as B, Flex as Qe, Stack as G, Textarea as Ss, Tooltip as Ct, Portal as Rn, Kbd as ws, Spacer as Ts, Link as Mn, Span as dt, Avatar as rt, Timeline as As, Image as Pn, Card as le, Spinner as nn, Badge as Cs, Icon as Ht, Skeleton as ks } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Is, ShieldX as _s, ShieldCheck as vs, Check as Dn, Pause as Rs, ArrowUp as Ms, Copy as Ps, Move as Ds, FileDown as Es, FileUp as Bs, FileDiff as Fs, Trash2 as En, FilePen as Ls, FileText as $s, ListTree as Os, Terminal as Bn, ListTodo as zs, CircleQuestionMark as Qs, File as qs, Globe as Ws, Search as Hs, AlertTriangle as Fn, DotIcon as Vs, ChevronUpIcon as Ns, GripVertical as Us, Pencil as js, MessageCircleIcon as Ks } from "lucide-react";
5
- import { useStickToBottomContext as It, StickToBottom as Xs } from "use-stick-to-bottom";
6
- import { S as _t, T as sn } from "./browser-storage-DPtOQJx0.js";
7
- import { Fragment as Gs, useRef as Te, useEffect as ae, useState as V } from "react";
8
- import { R as on, C as Ln } from "./lazy-markdown-editor-Obb0M8xc.js";
9
- import { a as Vt, P as Ys, g as Js, R as $n } from "./rich-message-dNYvLDd4.js";
10
- import { R as Zs, a as eo, A as pn } from "./radio-cLMEBBZk.js";
11
- import { E as to } from "./empty-state-Bo4HVrgr.js";
12
- import { useVirtualizer as no } from "@tanstack/react-virtual";
13
- import { a as so, D as oo } from "./diff-bubble-DvUPRnfB.js";
14
- const ro = {
3
+ import { AbsoluteCenter as zn, IconButton as Pe, chakra as Gt, createSlotRecipeContext as Qn, defineSlotRecipe as qn, Text as U, Code as Bt, Button as Oe, HStack as Z, Box as P, Flex as be, Stack as j, Textarea as Wn, Tooltip as Ke, Portal as Yt, Kbd as Hn, Spacer as Vn, Link as Jt, Span as $e, Avatar as Ee, Timeline as Nn, Image as Zt, Card as Y, Spinner as kt, Badge as Un, Icon as dt, Skeleton as jn } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as Kn, ShieldX as Xn, ShieldCheck as Gn, Check as en, Pause as Yn, ArrowUp as Jn, Copy as Zn, Move as es, FileDown as ts, FileUp as ns, FileDiff as ss, Trash2 as tn, FilePen as os, FileText as rs, ListTree as is, Terminal as nn, ListTodo as ls, CircleQuestionMark as as, File as cs, Globe as us, Search as ds, AlertTriangle as sn, DotIcon as fs, ChevronUpIcon as ps, GripVertical as ms, Pencil as hs, MessageCircleIcon as gs } from "lucide-react";
5
+ import { useStickToBottomContext as Ge, StickToBottom as bs } from "use-stick-to-bottom";
6
+ import { S as Ye, T as Ct } from "./browser-storage-DPtOQJx0.js";
7
+ import { Fragment as ys, useRef as ie, useEffect as J, useState as V } from "react";
8
+ import { R as It, C as on } from "./lazy-markdown-editor-ClZPZuaU.js";
9
+ import { a as ft, P as xs, g as Ss } from "./prompt-input-DNpRL5tI.js";
10
+ import { R as ws, a as Ts, A as Ft } from "./radio-cLMEBBZk.js";
11
+ import { E as As } from "./empty-state-Bo4HVrgr.js";
12
+ import { useVirtualizer as ks } from "@tanstack/react-virtual";
13
+ import { RichMessage as rn } from "./rich-message-CuPiKxKX.js";
14
+ import { a as Cs, D as Is } from "./diff-bubble-DvUPRnfB.js";
15
+ const _s = {
15
16
  "aria-roledescription": "conversation",
16
17
  initial: "instant",
17
18
  resize: "instant",
18
19
  role: "log"
19
- }, io = vn(Xs, {
20
+ }, Rs = Gt(bs, {
20
21
  base: {
21
22
  position: "relative",
22
23
  flex: 1,
@@ -25,18 +26,18 @@ const ro = {
25
26
  }
26
27
  }, {
27
28
  forwardProps: ["initial", "resize"],
28
- defaultProps: ro
29
- }), lo = (t) => {
29
+ defaultProps: _s
30
+ }), vs = (t) => {
30
31
  const e = A(10);
31
- let n, o;
32
+ let n, s;
32
33
  e[0] !== t ? ({
33
34
  children: n,
34
- ...o
35
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
35
+ ...s
36
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
36
37
  const {
37
- contentRef: s,
38
+ contentRef: o,
38
39
  scrollRef: r
39
- } = It(), i = r, l = s;
40
+ } = Ge(), i = r, l = o;
40
41
  let a, u;
41
42
  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
42
43
  zIndex: 2
@@ -46,23 +47,23 @@ const ro = {
46
47
  role: "list"
47
48
  }, e[3] = a, e[4] = u) : (a = e[3], u = e[4]);
48
49
  let d;
49
- return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ c(_t, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: u, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
50
- }, ao = {
50
+ return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ c(Ye, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
51
+ }, Ms = {
51
52
  axis: "horizontal",
52
53
  bottom: "md",
53
54
  zIndex: 2
54
- }, co = (t) => {
55
+ }, Ps = (t) => {
55
56
  const e = A(4), {
56
57
  isAtBottom: n,
57
- scrollToBottom: o
58
- } = It();
59
- let s;
60
- return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ c(bs, { ...ao, children: /* @__PURE__ */ c(ot, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ c(Is, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
61
- }, Nt = {
62
- Root: io,
63
- Viewport: lo,
64
- ScrollToBottom: co
65
- }, uo = xs({
58
+ scrollToBottom: s
59
+ } = Ge();
60
+ let o;
61
+ return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ c(zn, { ...Ms, children: /* @__PURE__ */ c(Pe, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ c(Kn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
62
+ }, pt = {
63
+ Root: Rs,
64
+ Viewport: vs,
65
+ ScrollToBottom: Ps
66
+ }, Es = qn({
66
67
  className: "ai-message",
67
68
  slots: ["root", "content"],
68
69
  base: {
@@ -169,102 +170,102 @@ const ro = {
169
170
  shape: "rounded"
170
171
  }
171
172
  }), {
172
- withProvider: fo,
173
- withContext: po
174
- } = ys({
175
- recipe: uo
176
- }), mo = fo("div", "root"), ho = po("div", "content"), ze = {
177
- Root: mo,
178
- Content: ho
179
- }, go = (t) => {
173
+ withProvider: Ds,
174
+ withContext: Bs
175
+ } = Qn({
176
+ recipe: Es
177
+ }), Fs = Ds("div", "root"), Ls = Bs("div", "content"), ge = {
178
+ Root: Fs,
179
+ Content: Ls
180
+ }, $s = (t) => {
180
181
  if (t == null) return null;
181
182
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
182
183
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
183
- }, Jl = (t) => {
184
+ }, yl = (t) => {
184
185
  const e = A(19), {
185
186
  toolName: n,
186
- toolInput: o,
187
- onApprove: s,
187
+ toolInput: s,
188
+ onApprove: o,
188
189
  onDeny: r
189
190
  } = t;
190
191
  let i;
191
- e[0] !== o ? (i = go(o), e[0] = o, e[1] = i) : i = e[1];
192
+ e[0] !== s ? (i = $s(s), e[0] = s, e[1] = i) : i = e[1];
192
193
  const l = i;
193
194
  let a;
194
- e[2] !== n ? (a = /* @__PURE__ */ C(j, { textStyle: "label/S/medium", color: "fg", children: [
195
+ e[2] !== n ? (a = /* @__PURE__ */ k(U, { textStyle: "label/S/medium", color: "fg", children: [
195
196
  "Allow ",
196
- /* @__PURE__ */ c(fn, { size: "sm", children: n }),
197
+ /* @__PURE__ */ c(Bt, { size: "sm", children: n }),
197
198
  "?"
198
199
  ] }), e[2] = n, e[3] = a) : a = e[3];
199
200
  let u;
200
- e[4] !== l ? (u = l ? /* @__PURE__ */ c(_t, { maxH: "6rem", children: /* @__PURE__ */ c(fn, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
201
+ e[4] !== l ? (u = l ? /* @__PURE__ */ c(Ye, { maxH: "6rem", children: /* @__PURE__ */ c(Bt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
201
202
  let d;
202
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(_s, { size: 14 }), e[6] = d) : d = e[6];
203
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(Xn, { size: 14 }), e[6] = d) : d = e[6];
203
204
  let f;
204
- e[7] !== r ? (f = /* @__PURE__ */ C(ft, { size: "xs", variant: "outline", onClick: r, children: [
205
+ e[7] !== r ? (f = /* @__PURE__ */ k(Oe, { size: "xs", variant: "outline", onClick: r, children: [
205
206
  d,
206
207
  "Deny"
207
208
  ] }), e[7] = r, e[8] = f) : f = e[8];
208
- let m;
209
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c(vs, { size: 14 }), e[9] = m) : m = e[9];
210
209
  let p;
211
- e[10] !== s ? (p = /* @__PURE__ */ C(ft, { size: "xs", colorPalette: "green", onClick: s, children: [
212
- m,
210
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ c(Gn, { size: 14 }), e[9] = p) : p = e[9];
211
+ let m;
212
+ e[10] !== o ? (m = /* @__PURE__ */ k(Oe, { size: "xs", colorPalette: "green", onClick: o, children: [
213
+ p,
213
214
  "Allow"
214
- ] }), e[10] = s, e[11] = p) : p = e[11];
215
+ ] }), e[10] = o, e[11] = m) : m = e[11];
215
216
  let h;
216
- e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ C(ce, { gap: "xs", justifyContent: "flex-end", children: [
217
+ e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ k(Z, { gap: "xs", justifyContent: "flex-end", children: [
217
218
  f,
218
- p
219
- ] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
219
+ m
220
+ ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
220
221
  let g;
221
- return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(B, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ C(Qe, { direction: "column", gap: "xs", children: [
222
+ return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(P, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(be, { direction: "column", gap: "xs", children: [
222
223
  a,
223
224
  u,
224
225
  h
225
226
  ] }) }), e[15] = a, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
226
- }, bo = "md", yo = "neutral", Zl = (t) => {
227
+ }, Os = "md", zs = "neutral", xl = (t) => {
227
228
  const e = A(17), {
228
229
  attachments: n,
229
- onSelect: o,
230
- onRemove: s,
230
+ onSelect: s,
231
+ onRemove: o,
231
232
  renderBadge: r,
232
233
  size: i,
233
234
  tone: l
234
235
  } = t;
235
236
  let a;
236
237
  e[0] !== n ? (a = n === void 0 ? [] : n, e[0] = n, e[1] = a) : a = e[1];
237
- const u = a, d = i === void 0 ? bo : i, f = l === void 0 ? yo : l;
238
+ const u = a, d = i === void 0 ? Os : i, f = l === void 0 ? zs : l;
238
239
  if (u.length === 0)
239
240
  return null;
240
- let m;
241
- if (e[2] !== u || e[3] !== s || e[4] !== o || e[5] !== r || e[6] !== d || e[7] !== f) {
241
+ let p;
242
+ if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
242
243
  let h;
243
- e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
244
- const b = o ? () => o(g) : void 0, y = s ? () => s(g) : void 0;
244
+ e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
245
+ const b = s ? () => s(g) : void 0, x = o ? () => o(g) : void 0;
245
246
  if (r) {
246
- const w = r({
247
+ const y = r({
247
248
  attachmentId: g,
248
249
  onSelect: b,
249
- onRemove: y,
250
+ onRemove: x,
250
251
  size: d,
251
252
  tone: f
252
253
  });
253
- return /* @__PURE__ */ c(Gs, { children: w }, g);
254
+ return /* @__PURE__ */ c(ys, { children: y }, g);
254
255
  }
255
- return /* @__PURE__ */ c(on, { fileName: g, onSelect: b, onRemove: y, size: d, tone: f }, g);
256
- }, e[9] = s, e[10] = o, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = u.map(h), e[2] = u, e[3] = s, e[4] = o, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
256
+ return /* @__PURE__ */ c(It, { fileName: g, onSelect: b, onRemove: x, size: d, tone: f }, g);
257
+ }, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], p = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = p;
257
258
  } else
258
- m = e[8];
259
- let p;
260
- return e[15] !== m ? (p = /* @__PURE__ */ c(G, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
261
- }, xo = (t) => {
259
+ p = e[8];
260
+ let m;
261
+ return e[15] !== p ? (m = /* @__PURE__ */ c(j, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: p }), e[15] = p, e[16] = m) : m = e[16], m;
262
+ }, Qs = (t) => {
262
263
  const {
263
264
  previousUserMessageCount: e,
264
265
  userMessageCount: n
265
266
  } = t;
266
267
  return e === 0 ? !1 : n > e;
267
- }, So = (t) => {
268
+ }, qs = (t) => {
268
269
  const e = t.conversationKey ?? null;
269
270
  return t.state.conversationKey !== e ? {
270
271
  shouldScroll: !1,
@@ -273,7 +274,7 @@ const ro = {
273
274
  userMessageCount: t.userMessageCount
274
275
  }
275
276
  } : {
276
- shouldScroll: xo({
277
+ shouldScroll: Qs({
277
278
  previousUserMessageCount: t.state.userMessageCount,
278
279
  userMessageCount: t.userMessageCount
279
280
  }),
@@ -282,58 +283,56 @@ const ro = {
282
283
  userMessageCount: Math.max(t.state.userMessageCount, t.userMessageCount)
283
284
  }
284
285
  };
285
- }, wo = (t) => {
286
- const e = So(t);
286
+ }, Ws = (t) => {
287
+ const e = qs(t);
287
288
  return e.shouldScroll && t.scrollToBottom("instant"), e;
288
289
  };
289
- function To(t) {
290
+ function Hs(t) {
290
291
  const e = A(8), {
291
292
  conversationKey: n,
292
- userMessageCount: o
293
+ userMessageCount: s
293
294
  } = t, {
294
- scrollToBottom: s
295
- } = It(), r = n ?? null;
295
+ scrollToBottom: o
296
+ } = Ge(), r = n ?? null;
296
297
  let i;
297
- e[0] !== r || e[1] !== o ? (i = {
298
+ e[0] !== r || e[1] !== s ? (i = {
298
299
  conversationKey: r,
299
- userMessageCount: o
300
- }, e[0] = r, e[1] = o, e[2] = i) : i = e[2];
301
- const l = Te(i);
300
+ userMessageCount: s
301
+ }, e[0] = r, e[1] = s, e[2] = i) : i = e[2];
302
+ const l = ie(i);
302
303
  let a, u;
303
- return e[3] !== n || e[4] !== s || e[5] !== o ? (a = () => {
304
- const d = wo({
304
+ return e[3] !== n || e[4] !== o || e[5] !== s ? (a = () => {
305
+ const d = Ws({
305
306
  state: l.current,
306
307
  conversationKey: n,
307
- userMessageCount: o,
308
- scrollToBottom: s
308
+ userMessageCount: s,
309
+ scrollToBottom: o
309
310
  });
310
311
  l.current = d.state;
311
- }, u = [n, o, s], e[3] = n, e[4] = s, e[5] = o, e[6] = a, e[7] = u) : (a = e[6], u = e[7]), ae(a, u), null;
312
+ }, u = [n, s, o], e[3] = n, e[4] = o, e[5] = s, e[6] = a, e[7] = u) : (a = e[6], u = e[7]), J(a, u), null;
312
313
  }
313
- const On = (t) => t.trim().length > 0, Ao = (t) => {
314
+ const ln = (t) => t.trim().length > 0, Vs = (t) => {
314
315
  const {
315
316
  canSubmit: e,
316
- hasQuestionPrompt: n,
317
- isDisabled: o,
318
- streaming: s,
319
- text: r
317
+ isDisabled: n,
318
+ text: s
320
319
  } = t;
321
- return o || !e || s && !n || !On(r) ? "none" : "submit";
322
- }, Co = (t) => {
320
+ return n || !e || !ln(s) ? "none" : "submit";
321
+ }, Ns = (t) => {
323
322
  const {
324
323
  canInterrupt: e,
325
324
  canSubmit: n,
326
- hasQuestionPrompt: o,
327
- isDisabled: s,
325
+ hasQuestionPrompt: s,
326
+ isDisabled: o,
328
327
  streaming: r,
329
328
  text: i
330
329
  } = t;
331
- return s ? "none" : r && !o ? e ? "interrupt" : "none" : !n || !On(i) ? "none" : "submit";
332
- }, zn = 200, ko = (t, e = zn) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Io = (t) => {
330
+ return o ? "none" : n && ln(i) ? "submit" : r && !s && e ? "interrupt" : "none";
331
+ }, an = 200, Us = (t, e = an) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, js = (t) => {
333
332
  const {
334
333
  onAttachFiles: e,
335
334
  onAttachText: n,
336
- textAttachmentPasteLineThreshold: o
335
+ textAttachmentPasteLineThreshold: s
337
336
  } = t;
338
337
  return {
339
338
  onDragOver: (l) => {
@@ -350,29 +349,29 @@ const On = (t) => t.trim().length > 0, Ao = (t) => {
350
349
  return;
351
350
  }
352
351
  const u = l.clipboardData.getData("text/plain");
353
- n && ko(u, o) && (l.preventDefault(), n(u));
352
+ n && Us(u, s) && (l.preventDefault(), n(u));
354
353
  }
355
354
  };
356
- }, _o = (t) => {
355
+ }, Ks = (t) => {
357
356
  t.preventDefault();
358
- }, Qn = (t) => {
357
+ }, cn = (t) => {
359
358
  const e = A(7), {
360
359
  option: n
361
360
  } = t;
362
- let o;
363
- e[0] !== n.label ? (o = /* @__PURE__ */ c(j, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
364
361
  let s;
365
- e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
362
+ e[0] !== n.label ? (s = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
363
+ let o;
364
+ e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
366
365
  let r;
367
- return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ C(G, { gap: "0", minWidth: "0", children: [
368
- o,
369
- s
370
- ] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
371
- }, vo = (t) => {
366
+ return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(j, { gap: "0", minWidth: "0", children: [
367
+ s,
368
+ o
369
+ ] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
370
+ }, Xs = (t) => {
372
371
  const e = A(12), {
373
372
  option: n,
374
- name: o,
375
- checked: s,
373
+ name: s,
374
+ checked: o,
376
375
  editable: r,
377
376
  onToggle: i
378
377
  } = t, l = !r, a = r ? void 0 : "true";
@@ -382,521 +381,434 @@ const On = (t) => t.trim().length > 0, Ao = (t) => {
382
381
  }, e[0] = r, e[1] = u) : u = e[1];
383
382
  const d = r ? i : void 0;
384
383
  let f;
385
- e[2] !== n ? (f = /* @__PURE__ */ c(Qn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
386
- let m;
387
- return e[4] !== s || e[5] !== o || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ c(Ln, { name: o, checked: s, readOnly: l, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = s, e[5] = o, e[6] = l, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
388
- }, Ro = (t) => {
384
+ e[2] !== n ? (f = /* @__PURE__ */ c(cn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
385
+ let p;
386
+ return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (p = /* @__PURE__ */ c(on, { name: s, checked: o, readOnly: l, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = p) : p = e[11], p;
387
+ }, Gs = (t) => {
389
388
  const e = A(17), {
390
389
  question: n,
391
- questionIndex: o,
392
- name: s,
390
+ questionIndex: s,
391
+ name: o,
393
392
  selectedOption: r,
394
393
  editable: i,
395
394
  onToggleOption: l
396
395
  } = t, a = r ?? null, u = !i, d = i ? void 0 : "true";
397
396
  let f;
398
- e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== o ? (f = i ? (h) => {
399
- h.value && l?.(n, o, h.value);
400
- } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = o, e[4] = f) : f = e[4];
401
- let m;
397
+ e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
398
+ h.value && l?.(n, s, h.value);
399
+ } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
400
+ let p;
402
401
  if (e[5] !== i || e[6] !== n.options) {
403
402
  let h;
404
- e[8] !== i ? (h = (g) => /* @__PURE__ */ c(Zs, { value: g.label, inputProps: i ? void 0 : {
403
+ e[8] !== i ? (h = (g) => /* @__PURE__ */ c(ws, { value: g.label, inputProps: i ? void 0 : {
405
404
  tabIndex: -1
406
- }, alignItems: "flex-start", children: /* @__PURE__ */ c(Qn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
405
+ }, alignItems: "flex-start", children: /* @__PURE__ */ c(cn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], p = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = p;
407
406
  } else
408
- m = e[7];
409
- let p;
410
- return e[10] !== s || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ c(eo, { name: s, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = s, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
411
- }, Mo = (t) => {
407
+ p = e[7];
408
+ let m;
409
+ return e[10] !== o || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== p ? (m = /* @__PURE__ */ c(Ts, { name: o, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: p }), e[10] = o, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = p, e[16] = m) : m = e[16], m;
410
+ }, Ys = (t) => {
412
411
  const e = A(4), {
413
412
  items: n
414
413
  } = t;
415
- let o;
416
- e[0] !== n ? (o = n.map(Po), e[0] = n, e[1] = o) : o = e[1];
417
414
  let s;
418
- return e[2] !== o ? (s = /* @__PURE__ */ c(G, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
419
- }, qn = (t) => {
415
+ e[0] !== n ? (s = n.map(Js), e[0] = n, e[1] = s) : s = e[1];
416
+ let o;
417
+ return e[2] !== s ? (o = /* @__PURE__ */ c(j, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
418
+ }, un = (t) => {
420
419
  const e = A(19), {
421
420
  questions: n,
422
- editable: o,
423
- selectedOptionsByQuestion: s,
421
+ editable: s,
422
+ selectedOptionsByQuestion: o,
424
423
  customAnswersByQuestion: r,
425
424
  onToggleOption: i,
426
425
  onCustomAnswerChange: l
427
- } = t, a = o === void 0 ? !1 : o;
426
+ } = t, a = s === void 0 ? !1 : s;
428
427
  let u;
429
- e[0] !== s ? (u = s === void 0 ? {} : s, e[0] = s, e[1] = u) : u = e[1];
428
+ e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
430
429
  const d = u;
431
430
  let f;
432
431
  e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
433
- const m = f;
434
- let p;
435
- if (e[4] !== m || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
432
+ const p = f;
433
+ let m;
434
+ if (e[4] !== p || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
436
435
  let g;
437
- e[11] !== m || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, y) => {
438
- const w = b.id ?? `question-${y}`, x = b.multiple ? "checkbox" : "radio", S = d[w] ?? [];
439
- return /* @__PURE__ */ C(G, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
440
- /* @__PURE__ */ c(j, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
441
- x === "radio" ? /* @__PURE__ */ c(Ro, { question: b, questionIndex: y, name: w, selectedOption: S[0], editable: a, onToggleOption: i }) : b.options.map((T) => /* @__PURE__ */ c(vo, { option: T, name: w, checked: S.includes(T.label), editable: a, onToggle: () => i?.(b, y, T.label) }, T.label)),
442
- b.allowCustomAnswer ? /* @__PURE__ */ c(Ss, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: m[w] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (T) => l?.(b, y, T.currentTarget.value) }) : null
443
- ] }, w);
444
- }, e[11] = m, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
436
+ e[11] !== p || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, x) => {
437
+ const y = b.id ?? `question-${x}`, T = b.multiple ? "checkbox" : "radio", S = d[y] ?? [];
438
+ return /* @__PURE__ */ k(j, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
439
+ /* @__PURE__ */ c(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
440
+ T === "radio" ? /* @__PURE__ */ c(Gs, { question: b, questionIndex: x, name: y, selectedOption: S[0], editable: a, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ c(Xs, { option: w, name: y, checked: S.includes(w.label), editable: a, onToggle: () => i?.(b, x, w.label) }, w.label)),
441
+ b.allowCustomAnswer ? /* @__PURE__ */ c(Wn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: p[y] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (w) => l?.(b, x, w.currentTarget.value) }) : null
442
+ ] }, y);
443
+ }, e[11] = p, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], m = n.map(g), e[4] = p, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = m;
445
444
  } else
446
- p = e[10];
445
+ m = e[10];
447
446
  let h;
448
- return e[17] !== p ? (h = /* @__PURE__ */ c(G, { as: "form", gap: "sm", onSubmit: _o, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
447
+ return e[17] !== m ? (h = /* @__PURE__ */ c(j, { as: "form", gap: "sm", onSubmit: Ks, "aria-label": "Question form", children: m }), e[17] = m, e[18] = h) : h = e[18], h;
449
448
  };
450
- function Po(t, e) {
451
- return /* @__PURE__ */ c(B, { as: "li", children: /* @__PURE__ */ c(Ln, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
449
+ function Js(t, e) {
450
+ return /* @__PURE__ */ c(P, { as: "li", children: /* @__PURE__ */ c(on, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
452
451
  tabIndex: -1
453
- }, size: "xs", children: /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
452
+ }, size: "xs", children: /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
454
453
  }
455
- const Ae = (t, e) => t.id ?? `question-${e}`, Do = (t, e, n, o) => {
456
- const s = Ae(e, n), r = t[s] ?? [], i = r.includes(o);
454
+ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
455
+ const o = le(e, n), r = t[o] ?? [], i = r.includes(s);
457
456
  return e.multiple ? {
458
457
  ...t,
459
- [s]: i ? r.filter((l) => l !== o) : [...r, o]
458
+ [o]: i ? r.filter((l) => l !== s) : [...r, s]
460
459
  } : {
461
460
  ...t,
462
- [s]: i ? [] : [o]
461
+ [o]: i ? [] : [s]
463
462
  };
464
- }, Xt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
465
- id: Ae(e, n),
463
+ }, bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
464
+ id: le(e, n),
466
465
  question: e.question,
467
466
  multiple: !!e.multiple,
468
467
  required: !!e.required,
469
468
  allowCustomAnswer: !!e.allowCustomAnswer,
470
- options: e.options.map((o) => ({
471
- label: o.label,
472
- description: o.description ?? ""
469
+ options: e.options.map((s) => ({
470
+ label: s.label,
471
+ description: s.description ?? ""
473
472
  }))
474
- }))) : "", Eo = (t, e, n) => {
475
- const o = [];
476
- for (let s = 0; s < t.questions.length; s += 1) {
477
- const r = t.questions[s], i = Ae(r, s), l = e[i] ?? [], a = n[i]?.trim(), u = a ? [...l, a] : l;
478
- u.length !== 0 && o.push(`${r.question}: ${u.join(", ")}`);
473
+ }))) : "", eo = (t, e, n) => {
474
+ const s = [];
475
+ for (let o = 0; o < t.questions.length; o += 1) {
476
+ const r = t.questions[o], i = le(r, o), l = e[i] ?? [], a = n[i]?.trim(), u = a ? [...l, a] : l;
477
+ u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
479
478
  }
480
- return o;
481
- }, Bo = (t) => typeof t != "string", rn = (t, e) => {
482
- if (Bo(e)) return e;
479
+ return s;
480
+ }, to = (t) => typeof t != "string", _t = (t, e) => {
481
+ if (to(e)) return e;
483
482
  const n = e.trim();
484
483
  if (n.length === 0) return {};
485
- const o = {};
486
- for (let s = 0; s < t.questions.length; s += 1) {
487
- const r = t.questions[s];
488
- r.allowCustomAnswer && (o[Ae(r, s)] = n);
484
+ const s = {};
485
+ for (let o = 0; o < t.questions.length; o += 1) {
486
+ const r = t.questions[o];
487
+ r.allowCustomAnswer && (s[le(r, o)] = n);
489
488
  }
490
- return o;
491
- }, Fo = (t, e, n) => {
489
+ return s;
490
+ }, no = (t, e, n) => {
492
491
  if (!t) return typeof n == "string" ? n.trim() : "";
493
- const o = rn(t, n), s = Eo(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
494
- return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
492
+ const s = _t(t, n), o = eo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
493
+ return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
495
494
  `);
496
- }, Lo = (t, e, n) => {
497
- const o = rn(t, n);
498
- return t.questions.map((s, r) => {
499
- const i = Ae(s, r), l = e[i] ?? [], a = o[i]?.trim();
495
+ }, so = (t, e, n) => {
496
+ const s = _t(t, n);
497
+ return t.questions.map((o, r) => {
498
+ const i = le(o, r), l = e[i] ?? [], a = s[i]?.trim();
500
499
  return a ? [...l, a] : l;
501
500
  });
502
- }, $o = (t, e, n) => {
501
+ }, oo = (t, e, n) => {
503
502
  if (!t) return !1;
504
- const o = rn(t, n);
505
- for (let s = 0; s < t.questions.length; s += 1) {
506
- const r = t.questions[s];
503
+ const s = _t(t, n);
504
+ for (let o = 0; o < t.questions.length; o += 1) {
505
+ const r = t.questions[o];
507
506
  if (!r.required) continue;
508
- const i = Ae(r, s);
509
- if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
507
+ const i = le(r, o);
508
+ if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
510
509
  return !0;
511
510
  }
512
511
  return !1;
513
- }, Oo = (t) => t.questions.map((e, n) => ({
514
- id: Ae(e, n),
512
+ }, ro = (t) => t.questions.map((e, n) => ({
513
+ id: le(e, n),
515
514
  question: e.question,
516
515
  options: e.options,
517
516
  multiple: !!e.multiple,
518
517
  required: !!e.required,
519
518
  allowCustomAnswer: !!e.allowCustomAnswer
520
- })), zo = (t, e, n, o) => {
521
- const s = Ae(t, e);
522
- return (n[s] ?? []).length > 0 || !!o[s]?.trim();
523
- }, Qo = (t) => {
519
+ })), io = (t, e, n, s) => {
520
+ const o = le(t, e);
521
+ return (n[o] ?? []).length > 0 || !!s[o]?.trim();
522
+ }, lo = (t) => {
524
523
  const e = A(22), {
525
524
  question: n,
526
- sourceQuestion: o,
527
- questionIndex: s,
525
+ sourceQuestion: s,
526
+ questionIndex: o,
528
527
  isActive: r,
529
528
  selectedOptionsByQuestion: i,
530
529
  customAnswersByQuestion: l,
531
530
  onSelectStep: a
532
531
  } = t;
533
532
  let u;
534
- e[0] !== l || e[1] !== s || e[2] !== i || e[3] !== o ? (u = zo(o, s, i, l), e[0] = l, e[1] = s, e[2] = i, e[3] = o, e[4] = u) : u = e[4];
535
- const d = u, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
533
+ e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = io(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
534
+ const d = u, f = d ? "answered" : "not answered", p = r ? "outline" : "ghost", m = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
536
535
  let b;
537
- e[5] !== a || e[6] !== s ? (b = () => a(s), e[5] = a, e[6] = s, e[7] = b) : b = e[7];
538
- let y;
539
- e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ c(Dn, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
540
- let w;
541
- e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (w = /* @__PURE__ */ c(ft, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: y }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = w) : w = e[18];
536
+ e[5] !== a || e[6] !== o ? (b = () => a(o), e[5] = a, e[6] = o, e[7] = b) : b = e[7];
542
537
  let x;
543
- return e[19] !== n.question || e[20] !== w ? (x = /* @__PURE__ */ c(sn, { content: n.question, children: w }), e[19] = n.question, e[20] = w, e[21] = x) : x = e[21], x;
544
- }, qo = (t) => {
538
+ e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ c(en, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
539
+ let y;
540
+ e[11] !== r || e[12] !== m || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== x || e[17] !== p ? (y = /* @__PURE__ */ c(Oe, { id: m, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: p, minW: "8", onClick: b, children: x }), e[11] = r, e[12] = m, e[13] = h, e[14] = g, e[15] = b, e[16] = x, e[17] = p, e[18] = y) : y = e[18];
541
+ let T;
542
+ return e[19] !== n.question || e[20] !== y ? (T = /* @__PURE__ */ c(Ct, { content: n.question, children: y }), e[19] = n.question, e[20] = y, e[21] = T) : T = e[21], T;
543
+ }, ao = (t) => {
545
544
  const e = A(31), {
546
545
  questionPrompt: n,
547
- selectedOptionsByQuestion: o,
548
- customAnswersByQuestion: s,
546
+ selectedOptionsByQuestion: s,
547
+ customAnswersByQuestion: o,
549
548
  onToggleOption: r,
550
549
  onCustomAnswerChange: i
551
550
  } = t, {
552
551
  questions: l
553
- } = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d], m = l.length > 1;
554
- let p;
555
- e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== o ? (p = m ? /* @__PURE__ */ c(ce, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((I, v) => /* @__PURE__ */ c(Qo, { question: I, sourceQuestion: n.questions[v], questionIndex: v, isActive: v === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: u }, I.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = o, e[6] = p) : p = e[6];
556
- const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${f.id}` : void 0;
552
+ } = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d], p = l.length > 1;
553
+ let m;
554
+ e[0] !== o || e[1] !== p || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (m = p ? /* @__PURE__ */ c(Z, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((_, R) => /* @__PURE__ */ c(lo, { question: _, sourceQuestion: n.questions[R], questionIndex: R, isActive: R === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, _.id)) }) : null, e[0] = o, e[1] = p, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = m) : m = e[6];
555
+ const h = `question-step-panel-${f.id}`, g = p ? "tabpanel" : void 0, b = p ? `question-step-tab-${f.id}` : void 0;
556
+ let x;
557
+ e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
557
558
  let y;
558
- e[7] !== f ? (y = [f], e[7] = f, e[8] = y) : y = e[8];
559
- let w;
560
- e[9] !== r || e[10] !== n.questions || e[11] !== d ? (w = (I, v, L) => {
559
+ e[9] !== r || e[10] !== n.questions || e[11] !== d ? (y = (_, R, L) => {
561
560
  r(n.questions[d], d, L);
562
- }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = w) : w = e[12];
563
- let x;
564
- e[13] !== i || e[14] !== n.questions || e[15] !== d ? (x = (I, v, L) => {
561
+ }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = y) : y = e[12];
562
+ let T;
563
+ e[13] !== i || e[14] !== n.questions || e[15] !== d ? (T = (_, R, L) => {
565
564
  i(n.questions[d], d, L);
566
- }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = x) : x = e[16];
565
+ }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
567
566
  let S;
568
- e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== w || e[21] !== x ? (S = /* @__PURE__ */ c(qn, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: w, onCustomAnswerChange: x }), e[17] = s, e[18] = o, e[19] = y, e[20] = w, e[21] = x, e[22] = S) : S = e[22];
569
- let T;
570
- e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (T = /* @__PURE__ */ c(G, { id: h, role: g, "aria-labelledby": b, gap: "0", children: S }), e[23] = h, e[24] = g, e[25] = b, e[26] = S, e[27] = T) : T = e[27];
571
- let k;
572
- return e[28] !== p || e[29] !== T ? (k = /* @__PURE__ */ C(G, { gap: "xs", pb: "sm", children: [
573
- p,
574
- T
575
- ] }), e[28] = p, e[29] = T, e[30] = k) : k = e[30], k;
576
- }, Wo = (t) => {
567
+ e[17] !== o || e[18] !== s || e[19] !== x || e[20] !== y || e[21] !== T ? (S = /* @__PURE__ */ c(un, { questions: x, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: y, onCustomAnswerChange: T }), e[17] = o, e[18] = s, e[19] = x, e[20] = y, e[21] = T, e[22] = S) : S = e[22];
568
+ let w;
569
+ e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (w = /* @__PURE__ */ c(j, { id: h, role: g, "aria-labelledby": b, gap: "0", children: S }), e[23] = h, e[24] = g, e[25] = b, e[26] = S, e[27] = w) : w = e[27];
570
+ let C;
571
+ return e[28] !== m || e[29] !== w ? (C = /* @__PURE__ */ k(j, { gap: "xs", pb: "sm", children: [
572
+ m,
573
+ w
574
+ ] }), e[28] = m, e[29] = w, e[30] = C) : C = e[30], C;
575
+ }, co = (t) => {
577
576
  const e = A(8), {
578
577
  questionPrompt: n
579
578
  } = t;
580
- let o;
581
- e[0] !== n ? (o = Oo(n), e[0] = n, e[1] = o) : o = e[1];
582
- const s = o;
579
+ let s;
580
+ e[0] !== n ? (s = ro(n), e[0] = n, e[1] = s) : s = e[1];
581
+ const o = s;
583
582
  let r;
584
- e[2] !== n ? (r = Xt(n), e[2] = n, e[3] = r) : r = e[3];
583
+ e[2] !== n ? (r = bt(n), e[2] = n, e[3] = r) : r = e[3];
585
584
  const i = r;
586
585
  let l;
587
- return e[4] !== t || e[5] !== i || e[6] !== s ? (l = /* @__PURE__ */ c(qo, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = l) : l = e[7], l;
588
- }, mn = "7", Ho = (t) => {
586
+ return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ c(ao, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
587
+ }, Lt = "7", uo = (t) => {
589
588
  const e = A(22);
590
- let n, o, s, r;
589
+ let n, s, o, r;
591
590
  e[0] !== t ? ({
592
591
  title: r,
593
- shortcut: s,
592
+ shortcut: o,
594
593
  canInterrupt: n,
595
- ...o
596
- } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = s, e[4] = r) : (n = e[1], o = e[2], s = e[3], r = e[4]);
597
- const i = o["aria-label"] ?? r;
594
+ ...s
595
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
596
+ const i = s["aria-label"] ?? r;
598
597
  let l;
599
- e[5] !== n ? (l = n ? /* @__PURE__ */ c(Rs, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ c(Ms, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
598
+ e[5] !== n ? (l = n ? /* @__PURE__ */ c(Yn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ c(Jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
600
599
  const a = l;
601
600
  let u;
602
- e[7] !== i || e[8] !== a || e[9] !== o || e[10] !== r ? (u = /* @__PURE__ */ c(ot, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...o, children: a }), e[7] = i, e[8] = a, e[9] = o, e[10] = r, e[11] = u) : u = e[11];
601
+ e[7] !== i || e[8] !== a || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ c(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...s, children: a }), e[7] = i, e[8] = a, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
603
602
  const d = u;
604
603
  if (r) {
605
604
  let f;
606
- e[12] !== s || e[13] !== r ? (f = s ? /* @__PURE__ */ C(tn, { children: [
605
+ e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(At, { children: [
607
606
  r,
608
607
  " ",
609
- /* @__PURE__ */ c(ws, { fontSize: "xs", children: s })
610
- ] }) : r, e[12] = s, e[13] = r, e[14] = f) : f = e[14];
611
- const m = f;
612
- let p;
613
- e[15] !== d ? (p = /* @__PURE__ */ c(Ct.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
608
+ /* @__PURE__ */ c(Hn, { fontSize: "xs", children: o })
609
+ ] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
610
+ const p = f;
611
+ let m;
612
+ e[15] !== d ? (m = /* @__PURE__ */ c(Ke.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = m) : m = e[16];
614
613
  let h;
615
- e[17] !== m ? (h = /* @__PURE__ */ c(Rn, { children: /* @__PURE__ */ c(Ct.Positioner, { children: /* @__PURE__ */ c(Ct.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
614
+ e[17] !== p ? (h = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(Ke.Positioner, { children: /* @__PURE__ */ c(Ke.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
616
615
  let g;
617
- return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ C(Ct.Root, { closeDelay: 50, openDelay: 100, children: [
618
- p,
616
+ return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ k(Ke.Root, { closeDelay: 50, openDelay: 100, children: [
617
+ m,
619
618
  h
620
- ] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
619
+ ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
621
620
  }
622
621
  return d;
623
- }, Vo = (t) => {
622
+ }, fo = (t) => {
624
623
  const e = A(2), {
625
624
  placeholder: n
626
625
  } = t;
627
626
  if (!n)
628
627
  return null;
629
- let o;
630
- return e[0] !== n ? (o = /* @__PURE__ */ c(j, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = o) : o = e[1], o;
631
- }, Ut = "border.accent-light", Gt = (t) => {
628
+ let s;
629
+ return e[0] !== n ? (s = /* @__PURE__ */ c(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
630
+ }, mt = "border.accent-light", yt = (t) => {
632
631
  const e = t?.querySelector('[contenteditable="true"]');
633
632
  e instanceof HTMLElement && e.focus();
634
- }, hn = (t, e) => requestAnimationFrame(() => {
635
- Gt(t), e?.();
636
- }), No = (t) => {
637
- const e = A(107), {
638
- defaultState: n,
639
- onSubmit: o,
633
+ }, $t = (t, e) => requestAnimationFrame(() => {
634
+ yt(t), e?.();
635
+ }), po = (t) => {
636
+ const {
637
+ defaultState: e,
638
+ onSubmit: n = () => {
639
+ },
640
640
  onInterrupt: s,
641
- onAttachFiles: r,
642
- onAttachText: i,
643
- textAttachmentPasteLineThreshold: l,
644
- streaming: a,
645
- attachedResources: u,
646
- onClearAttachments: d,
647
- isDisabled: f,
648
- submitDisabled: m,
641
+ onAttachFiles: o,
642
+ onAttachText: r,
643
+ textAttachmentPasteLineThreshold: i = an,
644
+ streaming: l = !1,
645
+ attachedResources: a = [],
646
+ onClearAttachments: u,
647
+ isDisabled: d = !1,
648
+ submitDisabled: f = !1,
649
649
  onChange: p,
650
- placeholder: h,
651
- attachmentList: g,
652
- actions: b,
653
- attachedToTop: y,
654
- recessed: w,
655
- questionPrompt: x,
656
- autoFocus: S,
657
- focusSignal: T,
658
- submitTitle: k,
659
- references: I,
660
- onAddReference: v
661
- } = t, L = o === void 0 ? Uo : o, D = l === void 0 ? zn : l, $ = a === void 0 ? !1 : a;
662
- let E;
663
- e[0] !== u ? (E = u === void 0 ? [] : u, e[0] = u, e[1] = E) : E = e[1];
664
- const M = E, P = f === void 0 ? !1 : f, F = m === void 0 ? !1 : m, Q = y === void 0 ? !1 : y, O = w === void 0 ? !1 : w, z = S === void 0 ? !1 : S, R = T === void 0 ? 0 : T;
665
- let W;
666
- e[2] !== I ? (W = I === void 0 ? [] : I, e[2] = I, e[3] = W) : W = e[3];
667
- const H = W, ne = O ? "border.subtle" : "border", [We, _e] = V(!1), [ve, de] = V(n), [Re, Ue] = V(0);
668
- let Y;
669
- e[4] !== n ? (Y = () => Vt(n), e[4] = n, e[5] = Y) : Y = e[5];
670
- const [ee, fe] = V(Y);
671
- let pe;
672
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pe = {}, e[6] = pe) : pe = e[6];
673
- const [U, Me] = V(pe);
674
- let Pe;
675
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Pe = {}, e[7] = Pe) : Pe = e[7];
676
- const [J, je] = V(Pe), He = Te(null), lt = Te(p);
677
- let Ke;
678
- e[8] !== x ? (Ke = Xt(x), e[8] = x, e[9] = Ke) : Ke = e[9];
679
- const Ve = Te(Ke);
680
- let me, at;
681
- e[10] !== p ? (me = () => {
682
- lt.current = p;
683
- }, at = [p], e[10] = p, e[11] = me, e[12] = at) : (me = e[11], at = e[12]), ae(me, at);
684
- let De, Ee;
685
- e[13] !== n ? (De = () => {
686
- const q = Vt(n);
687
- de(n), Ue(jo), fe(q), Me({}), je({}), lt.current?.(q);
688
- }, Ee = [n], e[13] = n, e[14] = De, e[15] = Ee) : (De = e[14], Ee = e[15]), ae(De, Ee);
689
- let he;
690
- e[16] !== x ? (he = Xt(x), e[16] = x, e[17] = he) : he = e[17];
691
- const se = he;
692
- let Be, Fe;
693
- e[18] !== se ? (Be = () => {
694
- Ve.current !== se && (Ve.current = se, Me({}), je({}));
695
- }, Fe = [se], e[18] = se, e[19] = Be, e[20] = Fe) : (Be = e[19], Fe = e[20]), ae(Be, Fe);
696
- let ge, be;
697
- e[21] !== z ? (ge = () => {
698
- if (!z)
699
- return;
700
- const q = hn(He.current, () => _e(!0));
650
+ placeholder: m,
651
+ attachmentList: h,
652
+ actions: g,
653
+ attachedToTop: b = !1,
654
+ recessed: x = !1,
655
+ questionPrompt: y,
656
+ autoFocus: T = !1,
657
+ focusSignal: S = 0,
658
+ submitTitle: w,
659
+ references: C = [],
660
+ onAddReference: _
661
+ } = t, R = x ? "border.subtle" : "border", [L, E] = V(!1), [Q, M] = V(!1), [D, B] = V(e), [$, O] = V(0), [F, z] = V(() => ft(e)), [v, W] = V({}), [H, K] = V({}), oe = ie(null), xe = ie(p), Se = ie(bt(y));
662
+ J(() => {
663
+ xe.current = p;
664
+ }, [p]), J(() => {
665
+ const q = ft(e);
666
+ B(e), O((ne) => ne + 1), z(q), W({}), K({}), xe.current?.(q);
667
+ }, [e]);
668
+ const ee = bt(y);
669
+ J(() => {
670
+ Se.current !== ee && (Se.current = ee, W({}), K({}));
671
+ }, [ee]), J(() => {
672
+ if (!T) return;
673
+ const q = $t(oe.current, () => M(!0));
701
674
  return () => cancelAnimationFrame(q);
702
- }, be = [z], e[21] = z, e[22] = ge, e[23] = be) : (ge = e[22], be = e[23]), ae(ge, be);
703
- let Le, ye;
704
- e[24] !== R ? (Le = () => {
705
- if (R === 0)
706
- return;
707
- const q = hn(He.current, () => _e(!0));
675
+ }, [T]), J(() => {
676
+ if (S === 0) return;
677
+ const q = $t(oe.current, () => M(!0));
708
678
  return () => cancelAnimationFrame(q);
709
- }, ye = [R], e[24] = R, e[25] = Le, e[26] = ye) : (Le = e[25], ye = e[26]), ae(Le, ye);
710
- let Xe;
711
- e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Xe = () => {
712
- _e(!0), Gt(He.current);
713
- }, e[27] = Xe) : Xe = e[27];
714
- const ct = Xe;
715
- let oe;
716
- e[28] !== n ? (oe = (q) => {
717
- const ut = q === void 0 ? !1 : q;
718
- de(n), Ue(Ko);
719
- const st = Vt(n);
720
- fe(st), Me({}), je({}), lt.current?.(st), ut && requestAnimationFrame(() => {
721
- Gt(He.current);
679
+ }, [S]);
680
+ const Te = () => {
681
+ M(!0), yt(oe.current);
682
+ }, Be = (q = !1) => {
683
+ B(e), O((se) => se + 1);
684
+ const ne = ft(e);
685
+ z(ne), W({}), K({}), xe.current?.(ne), q && requestAnimationFrame(() => {
686
+ yt(oe.current);
722
687
  });
723
- }, e[28] = n, e[29] = oe) : oe = e[29];
724
- const Ne = oe;
725
- let Z, K, re;
726
- if (e[30] !== J || e[31] !== P || e[32] !== s || e[33] !== x || e[34] !== U || e[35] !== $ || e[36] !== F || e[37] !== ee) {
727
- K = x ? Fo(x, U, J) : ee.trim();
728
- const q = $o(x, U, J);
729
- Z = {
730
- canInterrupt: $ && !x && !!s,
731
- canSubmit: !F,
732
- hasQuestionPrompt: !!x,
733
- isDisabled: P || q,
734
- streaming: $,
735
- text: K
736
- }, re = Co(Z), e[30] = J, e[31] = P, e[32] = s, e[33] = x, e[34] = U, e[35] = $, e[36] = F, e[37] = ee, e[38] = Z, e[39] = K, e[40] = re;
737
- } else
738
- Z = e[38], K = e[39], re = e[40];
739
- const te = re;
740
- let ie;
741
- e[41] !== M || e[42] !== J || e[43] !== d || e[44] !== L || e[45] !== x || e[46] !== Ne || e[47] !== K || e[48] !== U ? (ie = () => {
742
- if (!K)
743
- return;
744
- const q = x ? {
745
- answers: Lo(x, U, J)
688
+ }, X = y ? no(y, v, H) : F.trim(), G = oo(y, v, H), de = {
689
+ canInterrupt: l && !y && !!s,
690
+ canSubmit: !f,
691
+ hasQuestionPrompt: !!y,
692
+ isDisabled: d || L || G,
693
+ streaming: l,
694
+ text: X
695
+ }, te = Ns(de), fe = l && !y ? "Queue message" : "Send message", Fe = async () => {
696
+ if (!X) return;
697
+ const q = y ? {
698
+ answers: so(y, v, H)
746
699
  } : void 0;
747
- L(K, M, q), Ne(!0), d?.();
748
- }, e[41] = M, e[42] = J, e[43] = d, e[44] = L, e[45] = x, e[46] = Ne, e[47] = K, e[48] = U, e[49] = ie) : ie = e[49];
749
- const ue = ie;
750
- let xe;
751
- e[50] !== s || e[51] !== ue ? (xe = (q) => {
752
- if (q === "interrupt") {
753
- s?.();
754
- return;
700
+ E(!0);
701
+ try {
702
+ await n(X, a, q), Be(!0), u?.();
703
+ } catch {
704
+ } finally {
705
+ E(!1);
755
706
  }
756
- q === "submit" && ue();
757
- }, e[50] = s, e[51] = ue, e[52] = xe) : xe = e[52];
758
- const X = xe;
759
- let Ge;
760
- e[53] !== Z || e[54] !== X ? (Ge = () => X(Ao(Z)), e[53] = Z, e[54] = X, e[55] = Ge) : Ge = e[55];
761
- const $e = Ge;
762
- let gt;
763
- e[56] !== te || e[57] !== X ? (gt = () => X(te), e[56] = te, e[57] = X, e[58] = gt) : gt = e[58];
764
- const Dt = gt;
765
- let bt;
766
- e[59] !== r || e[60] !== i || e[61] !== D ? (bt = Io({
767
- onAttachFiles: r,
768
- onAttachText: i,
769
- textAttachmentPasteLineThreshold: D
770
- }), e[59] = r, e[60] = i, e[61] = D, e[62] = bt) : bt = e[62];
771
- const Se = bt;
772
- let yt;
773
- e[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (yt = (q, ut, st) => {
774
- Me((Wt) => Do(Wt, q, ut, st));
775
- }, e[63] = yt) : yt = e[63];
776
- const ms = yt;
777
- let xt;
778
- e[64] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (xt = (q, ut, st) => {
779
- const Wt = Ae(q, ut);
780
- je((gs) => ({
781
- ...gs,
782
- [Wt]: st
707
+ }, Ae = (q) => {
708
+ q === "interrupt" && s?.(), q === "submit" && Fe();
709
+ }, we = js({
710
+ onAttachFiles: o,
711
+ onAttachText: r,
712
+ textAttachmentPasteLineThreshold: i
713
+ }), nt = (q, ne, se) => {
714
+ W((pe) => Zs(pe, q, ne, se));
715
+ }, st = (q, ne, se) => {
716
+ const pe = le(q, ne);
717
+ K((Dt) => ({
718
+ ...Dt,
719
+ [pe]: se
783
720
  }));
784
- }, e[64] = xt) : xt = e[64];
785
- const hs = xt, Et = Q ? "-1px" : void 0, Bt = Q ? "0" : void 0, Ft = We ? Ut : ne, Lt = We ? 1 : 0, $t = We ? Ut : ne;
786
- let Ye;
787
- e[65] !== $t ? (Ye = {
788
- borderColor: $t,
721
+ };
722
+ return /* @__PURE__ */ c(P, { ref: oe, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: b ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: b ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: Q ? mt : R, zIndex: Q ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
723
+ borderColor: Q ? mt : R,
789
724
  zIndex: 1
790
- }, e[65] = $t, e[66] = Ye) : Ye = e[66];
791
- let St;
792
- e[67] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (St = {
793
- borderColor: Ut,
725
+ }, _focusWithin: {
726
+ borderColor: mt,
794
727
  zIndex: 1
795
- }, e[67] = St) : St = e[67];
796
- let wt;
797
- e[68] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (wt = () => _e(!1), e[68] = wt) : wt = e[68];
798
- let Je;
799
- e[69] !== g ? (Je = g ? /* @__PURE__ */ c(B, { children: g }) : null, e[69] = g, e[70] = Je) : Je = e[70];
800
- let Ze;
801
- e[71] !== J || e[72] !== Re || e[73] !== ve || e[74] !== $e || e[75] !== P || e[76] !== v || e[77] !== p || e[78] !== h || e[79] !== x || e[80] !== H || e[81] !== U ? (Ze = x ? /* @__PURE__ */ c(Wo, { questionPrompt: x, selectedOptionsByQuestion: U, customAnswersByQuestion: J, onToggleOption: ms, onCustomAnswerChange: hs }) : /* @__PURE__ */ c(_t, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
802
- pr: "2xs"
803
- }, children: /* @__PURE__ */ c(Qe, { minH: mn, align: "center", children: /* @__PURE__ */ c(Ys, { defaultState: ve, isEditable: !P, placeholder: /* @__PURE__ */ c(Vo, { placeholder: h }), onChange: (q) => {
804
- fe(q), p?.(q);
805
- }, onSubmit: $e, references: H, onAddReference: v }, Re) }) }), e[71] = J, e[72] = Re, e[73] = ve, e[74] = $e, e[75] = P, e[76] = v, e[77] = p, e[78] = h, e[79] = x, e[80] = H, e[81] = U, e[82] = Ze) : Ze = e[82];
806
- let Tt;
807
- e[83] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Tt = /* @__PURE__ */ c(Ts, {}), e[83] = Tt) : Tt = e[83];
808
- const Ot = te === "interrupt", zt = te === "interrupt" ? "Stop Response" : k ?? "Send message", Qt = $ && !x ? void 0 : "Enter", qt = te === "none";
809
- let et;
810
- e[84] !== Dt || e[85] !== Ot || e[86] !== zt || e[87] !== Qt || e[88] !== qt ? (et = /* @__PURE__ */ c(Ho, { canInterrupt: Ot, title: zt, shortcut: Qt, onClick: Dt, disabled: qt }), e[84] = Dt, e[85] = Ot, e[86] = zt, e[87] = Qt, e[88] = qt, e[89] = et) : et = e[89];
811
- let tt;
812
- e[90] !== b || e[91] !== et ? (tt = /* @__PURE__ */ C(ce, { gap: "1", minH: mn, align: "center", children: [
813
- b,
814
- Tt,
815
- et
816
- ] }), e[90] = b, e[91] = et, e[92] = tt) : tt = e[92];
817
- let nt;
818
- e[93] !== Je || e[94] !== Ze || e[95] !== tt ? (nt = /* @__PURE__ */ C(Qe, { direction: "column", color: "fg", gap: "xs", children: [
819
- Je,
820
- Ze,
821
- tt
822
- ] }), e[93] = Je, e[94] = Ze, e[95] = tt, e[96] = nt) : nt = e[96];
823
- let At;
824
- return e[97] !== Se.onDragOver || e[98] !== Se.onDropCapture || e[99] !== Se.onPasteCapture || e[100] !== Et || e[101] !== Bt || e[102] !== Ft || e[103] !== Lt || e[104] !== Ye || e[105] !== nt ? (At = /* @__PURE__ */ c(B, { ref: He, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Et, bg: "bg", borderRadius: "xs", borderTopRadius: Bt, borderWidth: "1px", borderStyle: "solid", borderColor: Ft, zIndex: Lt, transition: "border-color 0.2s ease-in-out", _hover: Ye, _focusWithin: St, onPasteCapture: Se.onPasteCapture, onDropCapture: Se.onDropCapture, onDragOver: Se.onDragOver, onClick: ct, onBlur: wt, children: nt }), e[97] = Se.onDragOver, e[98] = Se.onDropCapture, e[99] = Se.onPasteCapture, e[100] = Et, e[101] = Bt, e[102] = Ft, e[103] = Lt, e[104] = Ye, e[105] = nt, e[106] = At) : At = e[106], At;
825
- };
826
- function Uo() {
827
- }
828
- function jo(t) {
829
- return t + 1;
830
- }
831
- function Ko(t) {
832
- return t + 1;
833
- }
834
- const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo = (t) => {
728
+ }, onPasteCapture: we.onPasteCapture, onDropCapture: we.onDropCapture, onDragOver: we.onDragOver, onClick: Te, onBlur: () => M(!1), children: /* @__PURE__ */ k(be, { direction: "column", color: "fg", gap: "xs", children: [
729
+ h ? /* @__PURE__ */ c(P, { children: h }) : null,
730
+ y ? /* @__PURE__ */ c(co, { questionPrompt: y, selectedOptionsByQuestion: v, customAnswersByQuestion: H, onToggleOption: nt, onCustomAnswerChange: st }) : (
731
+ // The editor is its own composer row: it centres a single line at the shared
732
+ // control height and grows with content, never shrinking below it, so the row
733
+ // aligns with the toolbar beneath it.
734
+ /* @__PURE__ */ c(Ye, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
735
+ pr: "2xs"
736
+ }, children: /* @__PURE__ */ c(be, { minH: Lt, align: "center", children: /* @__PURE__ */ c(xs, { defaultState: D, isEditable: !d && !L, placeholder: /* @__PURE__ */ c(fo, { placeholder: m }), onChange: (q) => {
737
+ z(q), p?.(q);
738
+ }, onSubmit: () => Ae(Vs(de)), references: C, onAddReference: _ }, $) }) })
739
+ ),
740
+ /* @__PURE__ */ k(Z, { gap: "1", minH: Lt, align: "center", children: [
741
+ g,
742
+ /* @__PURE__ */ c(Vn, {}),
743
+ /* @__PURE__ */ c(uo, { canInterrupt: te === "interrupt", title: te === "interrupt" ? "Stop Response" : w ?? fe, shortcut: te === "submit" ? "Enter" : void 0, onClick: () => Ae(te), disabled: te === "none" })
744
+ ] })
745
+ ] }) });
746
+ }, Qe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), mo = (t) => {
835
747
  try {
836
748
  const e = JSON.parse(t);
837
- return mt(e) ? e : null;
749
+ return Qe(e) ? e : null;
838
750
  } catch {
839
751
  return null;
840
752
  }
841
- }, Go = (t) => mt(t) ? t : typeof t == "string" && t.trim().length > 0 ? Xo(t) : null, it = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, we = (t) => {
842
- const e = it(t);
753
+ }, ho = (t) => Qe(t) ? t : typeof t == "string" && t.trim().length > 0 ? mo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, re = (t) => {
754
+ const e = De(t);
843
755
  if (e) return e;
844
756
  if (Array.isArray(t)) {
845
- const n = t.map(we).filter((o) => o !== null);
757
+ const n = t.map(re).filter((s) => s !== null);
846
758
  return n.length > 0 ? n.join(`
847
759
  `) : null;
848
760
  }
849
- return mt(t) ? we(t.response) ?? we(t.answer) ?? we(t.text) ?? we(t.answers) : null;
850
- }, Yo = (t) => {
761
+ return Qe(t) ? re(t.response) ?? re(t.answer) ?? re(t.text) ?? re(t.answers) : null;
762
+ }, go = (t) => {
851
763
  if (typeof t == "string" && t.trim().length > 0)
852
764
  return {
853
765
  label: t,
854
766
  description: void 0
855
767
  };
856
- if (!mt(t)) return null;
857
- const e = it(t.label);
768
+ if (!Qe(t)) return null;
769
+ const e = De(t.label);
858
770
  return e ? {
859
771
  label: e,
860
- description: it(t.description) ?? void 0
772
+ description: De(t.description) ?? void 0
861
773
  } : null;
862
- }, Jo = (t, e) => {
863
- if (!mt(t)) return null;
864
- const n = it(t.question);
774
+ }, bo = (t, e) => {
775
+ if (!Qe(t)) return null;
776
+ const n = De(t.question);
865
777
  if (!n) return null;
866
- const o = Array.isArray(t.options) ? t.options.map(Yo).filter((i) => i !== null) : [], s = it(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o.length === 0 || s === "freeform" || s === "text";
778
+ const s = Array.isArray(t.options) ? t.options.map(go).filter((i) => i !== null) : [], o = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s.length === 0 || o === "freeform" || o === "text";
867
779
  return {
868
- id: it(t.id) ?? `question-${e}`,
780
+ id: De(t.id) ?? `question-${e}`,
869
781
  question: n,
870
- options: o,
871
- multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
782
+ options: s,
783
+ multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
872
784
  required: typeof t.required == "boolean" ? t.required : !0,
873
785
  allowCustomAnswer: r
874
786
  };
875
- }, Wn = (t) => {
876
- const e = Go(t);
787
+ }, dn = (t) => {
788
+ const e = ho(t);
877
789
  if (!e || !Array.isArray(e.questions)) return null;
878
- const n = e.questions.map(Jo).filter((o) => o !== null);
790
+ const n = e.questions.map(bo).filter((s) => s !== null);
879
791
  return n.length === 0 ? null : {
880
792
  questions: n
881
793
  };
882
- }, Zo = (t) => t.tool.toLowerCase() === "question", er = (t) => {
794
+ }, yo = (t) => t.tool.toLowerCase() === "question", xo = (t) => {
883
795
  for (let e = t.length - 1; e >= 0; e -= 1) {
884
796
  const n = t[e];
885
797
  if (n.role === "assistant")
886
- for (let o = n.parts.length - 1; o >= 0; o -= 1) {
887
- const s = n.parts[o];
888
- if (s.type !== "tool" || !Zo(s)) continue;
889
- return we(s.state?.output) ?? we(s.state?.metadata) ? void 0 : Wn(s.state?.input) ?? void 0;
798
+ for (let s = n.parts.length - 1; s >= 0; s -= 1) {
799
+ const o = n.parts[s];
800
+ if (o.type !== "tool" || !yo(o)) continue;
801
+ return re(o.state?.output) ?? re(o.state?.metadata) ? void 0 : dn(o.state?.input) ?? void 0;
890
802
  }
891
803
  }
892
- }, tr = (t = "") => JSON.stringify(Js(t)), Hn = {
804
+ }, So = (t = "") => JSON.stringify(Ss(t)), fn = {
893
805
  animationName: "message-fade-in",
894
806
  animationDuration: "200ms",
895
807
  animationTimingFunction: "ease-out"
896
- }, nr = (t) => {
808
+ }, wo = (t) => {
897
809
  const e = /* @__PURE__ */ new Set(), n = new Set(t.state.seenKeys);
898
- for (const o of t.itemKeys)
899
- t.state.initialized && !n.has(o) && e.add(o), n.add(o);
810
+ for (const s of t.itemKeys)
811
+ t.state.initialized && !n.has(s) && e.add(s), n.add(s);
900
812
  return {
901
813
  animatedKeys: e,
902
814
  state: {
@@ -904,47 +816,47 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
904
816
  seenKeys: n
905
817
  }
906
818
  };
907
- }, sr = (t, e) => {
819
+ }, To = (t, e) => {
908
820
  if (t.length !== e.length) return !1;
909
821
  for (let n = 0; n < t.length; n += 1) if (t[n] !== e[n]) return !1;
910
822
  return !0;
911
- }, or = (t) => {
912
- const e = Te({
823
+ }, Ao = (t) => {
824
+ const e = ie({
913
825
  initialized: !1,
914
826
  seenKeys: /* @__PURE__ */ new Set()
915
- }), n = Te(null);
916
- if (n.current && sr(n.current.itemKeys, t))
827
+ }), n = ie(null);
828
+ if (n.current && To(n.current.itemKeys, t))
917
829
  return n.current.animatedKeys;
918
- const o = nr({
830
+ const s = wo({
919
831
  itemKeys: t,
920
832
  state: e.current
921
833
  });
922
- return e.current = o.state, n.current = {
834
+ return e.current = s.state, n.current = {
923
835
  itemKeys: [...t],
924
- animatedKeys: o.animatedKeys
925
- }, o.animatedKeys;
926
- }, rr = (t) => t.type === "text", ir = (t) => (t.parts ?? []).filter(rr).map((e) => e.text.trim()).filter(Boolean).join(`
836
+ animatedKeys: s.animatedKeys
837
+ }, s.animatedKeys;
838
+ }, ko = (t) => t.type === "text", Co = (t) => (t.parts ?? []).filter(ko).map((e) => e.text.trim()).filter(Boolean).join(`
927
839
 
928
- `), lr = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
840
+ `), Io = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
929
841
  hour: "numeric",
930
842
  minute: "2-digit",
931
843
  timeZone: n
932
- }).format(new Date(t.createdAt)) : "", Yt = (t) => {
844
+ }).format(new Date(t.createdAt)) : "", xt = (t) => {
933
845
  const e = A(20), {
934
846
  message: n,
935
- alwaysVisible: o,
936
- copyAlwaysVisible: s
937
- } = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [l, a] = V(!1), u = Te(null);
847
+ alwaysVisible: s,
848
+ copyAlwaysVisible: o
849
+ } = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, a] = V(!1), u = ie(null);
938
850
  let d;
939
- e[0] !== n ? (d = ir(n), e[0] = n, e[1] = d) : d = e[1];
851
+ e[0] !== n ? (d = Co(n), e[0] = n, e[1] = d) : d = e[1];
940
852
  const f = d;
941
- let m;
942
- e[2] !== n ? (m = lr(n), e[2] = n, e[3] = m) : m = e[3];
943
- const p = m;
853
+ let p;
854
+ e[2] !== n ? (p = Io(n), e[2] = n, e[3] = p) : p = e[3];
855
+ const m = p;
944
856
  let h, g;
945
857
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
946
858
  u.current !== null && window.clearTimeout(u.current);
947
- }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), ae(h, g);
859
+ }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), J(h, g);
948
860
  let b;
949
861
  e[6] !== f ? (b = async () => {
950
862
  if (f)
@@ -954,20 +866,20 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
954
866
  a(!1);
955
867
  }
956
868
  }, e[6] = f, e[7] = b) : b = e[7];
957
- const y = b;
958
- if (!f && !p)
869
+ const x = b;
870
+ if (!f && !m)
959
871
  return null;
960
- const w = r ? "1" : "0", x = r ? "auto" : "none";
872
+ const y = r ? "1" : "0", T = r ? "auto" : "none";
961
873
  let S;
962
- e[8] !== p ? (S = p ? /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = S) : S = e[9];
963
- let T;
964
- e[10] !== i || e[11] !== y || e[12] !== f || e[13] !== l ? (T = f ? /* @__PURE__ */ c(B, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: gn, children: /* @__PURE__ */ c(sn, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ c(ot, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: l ? /* @__PURE__ */ c(Dn, { size: 12 }) : /* @__PURE__ */ c(Ps, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = f, e[13] = l, e[14] = T) : T = e[14];
965
- let k;
966
- return e[15] !== T || e[16] !== w || e[17] !== x || e[18] !== S ? (k = /* @__PURE__ */ C(ce, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: w, pointerEvents: x, transition: "opacity 120ms ease", css: gn, children: [
874
+ e[8] !== m ? (S = m ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: m }) : null, e[8] = m, e[9] = S) : S = e[9];
875
+ let w;
876
+ e[10] !== i || e[11] !== x || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ c(P, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Ot, children: /* @__PURE__ */ c(Ct, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ c(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: x, children: l ? /* @__PURE__ */ c(en, { size: 12 }) : /* @__PURE__ */ c(Zn, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = x, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
877
+ let C;
878
+ return e[15] !== w || e[16] !== y || e[17] !== T || e[18] !== S ? (C = /* @__PURE__ */ k(Z, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: y, pointerEvents: T, transition: "opacity 120ms ease", css: Ot, children: [
967
879
  S,
968
- T
969
- ] }), e[15] = T, e[16] = w, e[17] = x, e[18] = S, e[19] = k) : k = e[19], k;
970
- }, gn = {
880
+ w
881
+ ] }), e[15] = w, e[16] = y, e[17] = T, e[18] = S, e[19] = C) : C = e[19], C;
882
+ }, Ot = {
971
883
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
972
884
  opacity: 1,
973
885
  pointerEvents: "auto"
@@ -980,44 +892,44 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
980
892
  opacity: 1,
981
893
  pointerEvents: "auto"
982
894
  }
983
- }, ar = (t) => {
895
+ }, _o = (t) => {
984
896
  const e = A(8);
985
- let n, o;
897
+ let n, s;
986
898
  e[0] !== t ? ({
987
899
  children: n,
988
- ...o
989
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
990
- let s;
991
- e[3] !== n ? (s = /* @__PURE__ */ c($n, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
900
+ ...s
901
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
902
+ let o;
903
+ e[3] !== n ? (o = /* @__PURE__ */ c(rn, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
992
904
  let r;
993
- return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ c(B, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
994
- }, cr = ar, vt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), ur = (t) => {
995
- const e = vt(t), n = e.replace(/_/g, "");
905
+ return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ c(P, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
906
+ }, Ro = _o, Je = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), vo = (t) => {
907
+ const e = Je(t), n = e.replace(/_/g, "");
996
908
  return [.../* @__PURE__ */ new Set([t, e, n])];
997
- }, Vn = {
998
- shell: Bn,
999
- ls: Os,
1000
- read_file: $s,
1001
- write_file: Ls,
1002
- delete_file: En,
1003
- patch: Fs,
1004
- upload_files: Bs,
1005
- download_file: Es,
1006
- move_file: Ds
1007
- }, dr = {
1008
- dot: Vs,
1009
- danger: Fn,
1010
- search: Hs,
1011
- browser: Ws,
1012
- file: qs,
1013
- question: Qs,
1014
- todo: zs,
1015
- terminal: Bn,
1016
- ...Vn
1017
- }, bn = "dot", fr = (t) => Object.hasOwn(Vn, t), pr = (t) => dr[t], Nn = (t) => {
1018
- if (!t) return bn;
1019
- const e = vt(t);
1020
- if (fr(e)) return e;
909
+ }, pn = {
910
+ shell: nn,
911
+ ls: is,
912
+ read_file: rs,
913
+ write_file: os,
914
+ delete_file: tn,
915
+ patch: ss,
916
+ upload_files: ns,
917
+ download_file: ts,
918
+ move_file: es
919
+ }, Mo = {
920
+ dot: fs,
921
+ danger: sn,
922
+ search: ds,
923
+ browser: us,
924
+ file: cs,
925
+ question: as,
926
+ todo: ls,
927
+ terminal: nn,
928
+ ...pn
929
+ }, zt = "dot", Po = (t) => Object.hasOwn(pn, t), Eo = (t) => Mo[t], mn = (t) => {
930
+ if (!t) return zt;
931
+ const e = Je(t);
932
+ if (Po(e)) return e;
1021
933
  const n = e.replace(/_/g, "");
1022
934
  switch (e) {
1023
935
  case "read":
@@ -1044,52 +956,52 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
1044
956
  case "file":
1045
957
  return "file";
1046
958
  default:
1047
- return n === "todowrite" || n === "todo" ? "todo" : bn;
959
+ return n === "todowrite" || n === "todo" ? "todo" : zt;
1048
960
  }
1049
961
  };
1050
- function ln(t) {
962
+ function Rt(t) {
1051
963
  const e = t.lastIndexOf("/");
1052
964
  return e >= 0 ? t.slice(e + 1) : t;
1053
965
  }
1054
- function kt(t) {
966
+ function Xe(t) {
1055
967
  if (!t) return null;
1056
968
  const e = t.split(" ")[0].trim();
1057
969
  if (e === "/dev/null") return null;
1058
970
  let n = e;
1059
971
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
1060
972
  }
1061
- const Rt = (t) => t.startsWith("--- "), an = (t) => t.startsWith("+++ "), cn = (t) => t.startsWith("@@"), mr = (t) => t.startsWith("+") && !(an(t) || t === "+++"), hr = (t) => t.startsWith("-") && !(Rt(t) || t === "---"), gr = (t, e) => {
973
+ const Ze = (t) => t.startsWith("--- "), vt = (t) => t.startsWith("+++ "), Mt = (t) => t.startsWith("@@"), Do = (t) => t.startsWith("+") && !(vt(t) || t === "+++"), Bo = (t) => t.startsWith("-") && !(Ze(t) || t === "---"), Fo = (t, e) => {
1062
974
  t.has(e) || t.set(e, {
1063
975
  additions: 0,
1064
976
  deletions: 0
1065
977
  });
1066
- }, br = (t, e) => {
978
+ }, Lo = (t, e) => {
1067
979
  const n = t.get(e);
1068
980
  n && (n.additions += 1);
1069
- }, yr = (t, e) => {
981
+ }, $o = (t, e) => {
1070
982
  const n = t.get(e);
1071
983
  n && (n.deletions += 1);
1072
- }, xr = (t, e, n) => {
1073
- if (Rt(t))
984
+ }, Oo = (t, e, n) => {
985
+ if (Ze(t))
1074
986
  return {
1075
987
  ...e,
1076
- lastMinusHeader: kt(t.slice(4)),
988
+ lastMinusHeader: Xe(t.slice(4)),
1077
989
  inHunk: !1
1078
990
  };
1079
- if (an(t)) {
1080
- const s = kt(t.slice(4)) ?? e.lastMinusHeader;
1081
- return s && gr(n, s), {
991
+ if (vt(t)) {
992
+ const o = Xe(t.slice(4)) ?? e.lastMinusHeader;
993
+ return o && Fo(n, o), {
1082
994
  ...e,
1083
- currentPath: s,
995
+ currentPath: o,
1084
996
  inHunk: !1
1085
997
  };
1086
998
  }
1087
- return e.currentPath ? cn(t) ? {
999
+ return e.currentPath ? Mt(t) ? {
1088
1000
  ...e,
1089
1001
  inHunk: !0
1090
- } : e.inHunk ? mr(t) ? (br(n, e.currentPath), e) : (hr(t) && yr(n, e.currentPath), e) : e : e;
1002
+ } : e.inHunk ? Do(t) ? (Lo(n, e.currentPath), e) : (Bo(t) && $o(n, e.currentPath), e) : e : e;
1091
1003
  };
1092
- function Un(t) {
1004
+ function hn(t) {
1093
1005
  if (!t || typeof t != "string") return [];
1094
1006
  const e = /* @__PURE__ */ new Map();
1095
1007
  let n = {
@@ -1097,34 +1009,34 @@ function Un(t) {
1097
1009
  lastMinusHeader: null,
1098
1010
  inHunk: !1
1099
1011
  };
1100
- const o = t.split(/\r?\n/);
1101
- for (const s of o)
1102
- n = xr(s, n, e);
1103
- return Array.from(e.entries()).map(([s, {
1012
+ const s = t.split(/\r?\n/);
1013
+ for (const o of s)
1014
+ n = Oo(o, n, e);
1015
+ return Array.from(e.entries()).map(([o, {
1104
1016
  additions: r,
1105
1017
  deletions: i
1106
1018
  }]) => ({
1107
- filePath: s,
1019
+ filePath: o,
1108
1020
  additions: r,
1109
1021
  deletions: i
1110
1022
  }));
1111
1023
  }
1112
- function Sr(t) {
1113
- return Un(t).map((e) => ({
1024
+ function zo(t) {
1025
+ return hn(t).map((e) => ({
1114
1026
  kind: "diff",
1115
- fileName: ln(e.filePath),
1027
+ fileName: Rt(e.filePath),
1116
1028
  filePath: e.filePath,
1117
1029
  additions: e.additions,
1118
1030
  deletions: e.deletions
1119
1031
  }));
1120
1032
  }
1121
- function wr(t) {
1122
- return Un(t).map((e) => e.filePath);
1033
+ function Qo(t) {
1034
+ return hn(t).map((e) => e.filePath);
1123
1035
  }
1124
- const jn = (t) => Rt(t) || t.startsWith("diff --git "), Tr = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ar = (t, e, n) => {
1036
+ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Wo = (t, e, n) => {
1125
1037
  if (t.startsWith(" ")) {
1126
- const o = t.slice(1);
1127
- e.push(o), n.push(o);
1038
+ const s = t.slice(1);
1039
+ e.push(s), n.push(s);
1128
1040
  return;
1129
1041
  }
1130
1042
  if (t.startsWith("-")) {
@@ -1132,30 +1044,30 @@ const jn = (t) => Rt(t) || t.startsWith("diff --git "), Tr = (t) => t.startsWith
1132
1044
  return;
1133
1045
  }
1134
1046
  t.startsWith("+") && n.push(t.slice(1));
1135
- }, Cr = (t, e, n, o) => {
1136
- let s = e;
1137
- for (; s < t.length; ) {
1138
- const r = t[s] || "";
1139
- if (jn(r) || cn(r) || Tr(r))
1047
+ }, Ho = (t, e, n, s) => {
1048
+ let o = e;
1049
+ for (; o < t.length; ) {
1050
+ const r = t[o] || "";
1051
+ if (gn(r) || Mt(r) || qo(r))
1140
1052
  break;
1141
- Ar(r, n, o), s += 1;
1053
+ Wo(r, n, s), o += 1;
1142
1054
  }
1143
- return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
1144
- }, kr = (t, e) => {
1145
- const n = kt((t[e] || "").slice(4)), o = t[e + 1] || "";
1146
- if (!an(o)) return {
1055
+ return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
1056
+ }, Vo = (t, e) => {
1057
+ const n = Xe((t[e] || "").slice(4)), s = t[e + 1] || "";
1058
+ if (!vt(s)) return {
1147
1059
  nextIndex: e + 1
1148
1060
  };
1149
- const r = kt(o.slice(4)) ?? n ?? "", i = [], l = [];
1061
+ const r = Xe(s.slice(4)) ?? n ?? "", i = [], l = [];
1150
1062
  let a = e + 2;
1151
1063
  for (; a < t.length; ) {
1152
1064
  const u = t[a] || "";
1153
- if (jn(u)) break;
1154
- if (!cn(u)) {
1065
+ if (gn(u)) break;
1066
+ if (!Mt(u)) {
1155
1067
  a += 1;
1156
1068
  continue;
1157
1069
  }
1158
- a = Cr(t, a + 1, i, l);
1070
+ a = Ho(t, a + 1, i, l);
1159
1071
  }
1160
1072
  return {
1161
1073
  nextIndex: a,
@@ -1168,25 +1080,25 @@ const jn = (t) => Rt(t) || t.startsWith("diff --git "), Tr = (t) => t.startsWith
1168
1080
  }
1169
1081
  };
1170
1082
  };
1171
- function Ir(t) {
1083
+ function No(t) {
1172
1084
  if (!t || typeof t != "string") return [];
1173
1085
  const e = t.split(/\r?\n/), n = [];
1174
- let o = 0;
1175
- for (; o < e.length; ) {
1176
- const s = e[o] || "";
1177
- if (!Rt(s)) {
1178
- o += 1;
1086
+ let s = 0;
1087
+ for (; s < e.length; ) {
1088
+ const o = e[s] || "";
1089
+ if (!Ze(o)) {
1090
+ s += 1;
1179
1091
  continue;
1180
1092
  }
1181
1093
  const {
1182
1094
  nextIndex: r,
1183
1095
  preview: i
1184
- } = kr(e, o);
1185
- i && n.push(i), o = Math.max(r, o + 1);
1096
+ } = Vo(e, s);
1097
+ i && n.push(i), s = Math.max(r, s + 1);
1186
1098
  }
1187
1099
  return n;
1188
1100
  }
1189
- const _r = {
1101
+ const Uo = {
1190
1102
  apply_patch: "Apply patch",
1191
1103
  bash: "Run command",
1192
1104
  edit: "Edit file",
@@ -1195,143 +1107,143 @@ const _r = {
1195
1107
  read: "Read file",
1196
1108
  skill: "Load skill",
1197
1109
  todowrite: "Update todos"
1198
- }, yn = {
1110
+ }, Qt = {
1199
1111
  error: "failed",
1200
1112
  "output-error": "failed",
1201
1113
  input_streaming: "running",
1202
1114
  running: "running",
1203
1115
  completed: "completed",
1204
1116
  failed: "failed"
1205
- }, Kn = (t) => t.replace(/^tool-/, "").toLowerCase(), vr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Rr = (t) => Kn(t.tool ?? "tool"), Mr = (t) => {
1206
- const e = Kn(t);
1207
- return _r[e] ?? vr(e.replace(/_/g, " "));
1208
- }, Pr = (t) => {
1117
+ }, bn = (t) => t.replace(/^tool-/, "").toLowerCase(), jo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ko = (t) => bn(t.tool ?? "tool"), Xo = (t) => {
1118
+ const e = bn(t);
1119
+ return Uo[e] ?? jo(e.replace(/_/g, " "));
1120
+ }, Go = (t) => {
1209
1121
  const e = t.state?.status ?? t.status;
1210
1122
  if (!e || typeof e != "string") return null;
1211
1123
  const n = e.replace(/-/g, "_");
1212
- return yn[n] ? yn[n] : n.includes("stream") ? "running" : null;
1213
- }, Xn = (t) => {
1124
+ return Qt[n] ? Qt[n] : n.includes("stream") ? "running" : null;
1125
+ }, yn = (t) => {
1214
1126
  const e = t.state?.status ?? t.status;
1215
1127
  return e === "error" || e === "output-error" || e === "failed";
1216
- }, Ce = (t) => Xn(t) ? {
1128
+ }, ae = (t) => yn(t) ? {
1217
1129
  type: "icon",
1218
1130
  icon: "danger"
1219
1131
  } : {
1220
1132
  type: "icon",
1221
- icon: Nn(Rr(t))
1222
- }, ke = (t, e, n, o) => {
1133
+ icon: mn(Ko(t))
1134
+ }, ce = (t, e, n, s) => {
1223
1135
  const r = [{
1224
1136
  kind: "text",
1225
- text: n ?? Mr(t.tool ?? "tool"),
1137
+ text: n ?? Xo(t.tool ?? "tool"),
1226
1138
  bold: !0
1227
1139
  }];
1228
1140
  e && r.push({
1229
1141
  kind: "text",
1230
1142
  text: e,
1231
1143
  muted: !0,
1232
- ...o === "monospace" ? {
1144
+ ...s === "monospace" ? {
1233
1145
  truncate: !0,
1234
1146
  monospace: !0
1235
1147
  } : {}
1236
1148
  });
1237
- const i = Pr(t);
1149
+ const i = Go(t);
1238
1150
  return i && i !== "completed" && r.push({
1239
1151
  kind: "text",
1240
1152
  text: i,
1241
1153
  muted: !0
1242
1154
  }), r;
1243
- }, qe = (t) => {
1155
+ }, ye = (t) => {
1244
1156
  const e = t.state?.input;
1245
1157
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1246
- }, ht = (t) => {
1158
+ }, qe = (t) => {
1247
1159
  const e = t.state?.output;
1248
1160
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1249
- }, _ = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Dr = (t, e) => {
1250
- const n = pt(t.state);
1251
- return n ? pt(n[e]) : null;
1252
- }, Gn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Er = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Yn = (t) => {
1253
- const e = ht(t);
1254
- return [Dr(t, "metadata"), pt(e?.metadata)].filter(Boolean);
1255
- }, Br = (t) => {
1256
- const e = pt(t);
1161
+ }, I = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ze = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Yo = (t, e) => {
1162
+ const n = ze(t.state);
1163
+ return n ? ze(n[e]) : null;
1164
+ }, xn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Jo = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Sn = (t) => {
1165
+ const e = qe(t);
1166
+ return [Yo(t, "metadata"), ze(e?.metadata)].filter(Boolean);
1167
+ }, Zo = (t) => {
1168
+ const e = ze(t);
1257
1169
  if (!e) return null;
1258
- const n = _(e.filePath) ?? _(e.relativePath) ?? _(e.path);
1170
+ const n = I(e.filePath) ?? I(e.relativePath) ?? I(e.path);
1259
1171
  return n ? {
1260
- filePath: Gn(n),
1172
+ filePath: xn(n),
1261
1173
  additions: typeof e.additions == "number" ? e.additions : 0,
1262
1174
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
1263
- diff: _(e.diff) ?? void 0,
1264
- before: _(e.before) ?? void 0,
1265
- after: _(e.after) ?? void 0
1175
+ diff: I(e.diff) ?? void 0,
1176
+ before: I(e.before) ?? void 0,
1177
+ after: I(e.after) ?? void 0
1266
1178
  } : null;
1267
- }, Jn = (t) => {
1179
+ }, wn = (t) => {
1268
1180
  const e = [];
1269
- for (const n of Yn(t)) {
1270
- const o = Array.isArray(n.files) ? n.files : [];
1271
- for (const s of o) {
1272
- const r = Br(s);
1181
+ for (const n of Sn(t)) {
1182
+ const s = Array.isArray(n.files) ? n.files : [];
1183
+ for (const o of s) {
1184
+ const r = Zo(o);
1273
1185
  r && e.push(r);
1274
1186
  }
1275
1187
  }
1276
1188
  return e;
1277
- }, Fr = (t) => {
1278
- const e = qe(t), o = (Array.isArray(e?.changes) ? e.changes : []).map((s) => _(pt(s)?.path)).filter((s) => !!s).map(Gn);
1279
- return Array.from(new Set(o));
1280
- }, Lr = (t) => {
1281
- const e = qe(t), n = _(e?.diff);
1189
+ }, er = (t) => {
1190
+ const e = ye(t), s = (Array.isArray(e?.changes) ? e.changes : []).map((o) => I(ze(o)?.path)).filter((o) => !!o).map(xn);
1191
+ return Array.from(new Set(s));
1192
+ }, tr = (t) => {
1193
+ const e = ye(t), n = I(e?.diff);
1282
1194
  if (n) return n;
1283
- for (const r of Yn(t)) {
1284
- const i = _(r.diff);
1195
+ for (const r of Sn(t)) {
1196
+ const i = I(r.diff);
1285
1197
  if (i) return i;
1286
1198
  }
1287
- const o = Jn(t).map((r) => r.diff).filter((r) => !!r);
1288
- if (o.length > 0) return o.join(`
1199
+ const s = wn(t).map((r) => r.diff).filter((r) => !!r);
1200
+ if (s.length > 0) return s.join(`
1289
1201
  `);
1290
- const s = _(e?.patchText);
1291
- return s && Er(s) ? s : null;
1292
- }, $r = (t) => {
1202
+ const o = I(e?.patchText);
1203
+ return o && Jo(o) ? o : null;
1204
+ }, nr = (t) => {
1293
1205
  const e = /* @__PURE__ */ new Set(), n = [];
1294
- for (const o of t)
1295
- e.has(o.filePath) || (e.add(o.filePath), n.push({
1206
+ for (const s of t)
1207
+ e.has(s.filePath) || (e.add(s.filePath), n.push({
1296
1208
  kind: "diff",
1297
- fileName: ln(o.filePath),
1298
- filePath: o.filePath,
1299
- additions: o.additions,
1300
- deletions: o.deletions
1209
+ fileName: Rt(s.filePath),
1210
+ filePath: s.filePath,
1211
+ additions: s.additions,
1212
+ deletions: s.deletions
1301
1213
  }));
1302
1214
  return n;
1303
- }, Or = (t) => Array.from(new Set(t.map((e) => e.filePath))), Mt = (t) => {
1304
- const e = ht(t);
1305
- return _(t.state?.output) ?? _(e?.returnDisplay) ?? _(e?.preview) ?? _(e?.stdout) ?? _(e?.content);
1306
- }, zr = (t) => {
1215
+ }, sr = (t) => Array.from(new Set(t.map((e) => e.filePath))), et = (t) => {
1216
+ const e = qe(t);
1217
+ return I(t.state?.output) ?? I(e?.returnDisplay) ?? I(e?.preview) ?? I(e?.stdout) ?? I(e?.content);
1218
+ }, or = (t) => {
1307
1219
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1308
1220
  return e ? {
1309
- skillName: _(e[1]) ?? void 0,
1310
- content: _(e[2]) ?? ""
1221
+ skillName: I(e[1]) ?? void 0,
1222
+ content: I(e[2]) ?? ""
1311
1223
  } : null;
1312
- }, Qr = (t) => {
1313
- const e = qe(t);
1314
- return _(e?.name) ?? _(e?.skillName) ?? _(e?.skill) ?? _(e?.skill_name) ?? void 0;
1315
- }, un = (t, e) => ({
1224
+ }, rr = (t) => {
1225
+ const e = ye(t);
1226
+ return I(e?.name) ?? I(e?.skillName) ?? I(e?.skill) ?? I(e?.skill_name) ?? void 0;
1227
+ }, Pt = (t, e) => ({
1316
1228
  kind: "link",
1317
- text: ln(t),
1229
+ text: Rt(t),
1318
1230
  filePath: t,
1319
1231
  ...e ? {
1320
1232
  variant: e
1321
1233
  } : {}
1322
- }), Ie = (t, e) => !Xn(t) || !t.state?.errorText ? e : [{
1234
+ }), ue = (t, e) => !yn(t) || !t.state?.errorText ? e : [{
1323
1235
  type: "comment",
1324
1236
  text: t.state.errorText
1325
- }, ...e], Zn = (t) => Ir(t ?? void 0).map((e) => ({
1237
+ }, ...e], Tn = (t) => No(t ?? void 0).map((e) => ({
1326
1238
  type: "diff",
1327
1239
  language: "diff",
1328
1240
  original: e.original,
1329
1241
  modified: e.modified,
1330
1242
  sideBySide: !1
1331
- })), qr = (t) => Sr(t ?? void 0), Wr = (t) => wr(t ?? void 0), Hr = (t) => {
1332
- const e = Lr(t), n = Jn(t), o = Fr(t), s = ke(t, void 0, "Apply patch"), r = qr(e);
1333
- r.length > 0 ? s.push(...r) : n.length > 0 ? s.push(...$r(n)) : s.push(...o.map((l) => un(l, "bubble")));
1334
- const i = [...Zn(e)];
1243
+ })), ir = (t) => zo(t ?? void 0), lr = (t) => Qo(t ?? void 0), ar = (t) => {
1244
+ const e = tr(t), n = wn(t), s = er(t), o = ce(t, void 0, "Apply patch"), r = ir(e);
1245
+ r.length > 0 ? o.push(...r) : n.length > 0 ? o.push(...nr(n)) : o.push(...s.map((l) => Pt(l, "bubble")));
1246
+ const i = [...Tn(e)];
1335
1247
  if (i.length === 0)
1336
1248
  for (const l of n)
1337
1249
  !l.before && !l.after || i.push({
@@ -1342,92 +1254,92 @@ const _r = {
1342
1254
  sideBySide: !1
1343
1255
  });
1344
1256
  if (i.length === 0) {
1345
- const l = Wr(e);
1346
- l.length === 0 && l.push(...Or(n)), l.length === 0 && l.push(...o), l.length > 0 && i.push({
1257
+ const l = lr(e);
1258
+ l.length === 0 && l.push(...sr(n)), l.length === 0 && l.push(...s), l.length > 0 && i.push({
1347
1259
  type: "references",
1348
1260
  references: l
1349
1261
  });
1350
1262
  }
1351
1263
  return {
1352
- indicator: Ce(t),
1353
- title: s,
1354
- blocks: Ie(t, i)
1264
+ indicator: ae(t),
1265
+ title: o,
1266
+ blocks: ue(t, i)
1355
1267
  };
1356
- }, Vr = (t, e) => [{
1268
+ }, cr = (t, e) => [{
1357
1269
  type: "diff",
1358
1270
  language: "text",
1359
1271
  original: t,
1360
1272
  modified: e,
1361
1273
  sideBySide: !1
1362
- }], Nr = (t) => {
1363
- const e = qe(t), n = ht(t), o = _(e?.filePath) ?? _(e?.file_path) ?? _(n?.filePath) ?? void 0, s = _(n?.oldString) ?? _(e?.old_string) ?? void 0, r = _(n?.newString) ?? _(e?.new_string) ?? void 0, i = ke(t, void 0, "Edit file");
1364
- o && i.push(un(o));
1365
- const l = s !== void 0 && r !== void 0 ? Vr(s, r) : Zn(_(n?.diff));
1274
+ }], ur = (t) => {
1275
+ const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(n?.filePath) ?? void 0, o = I(n?.oldString) ?? I(e?.old_string) ?? void 0, r = I(n?.newString) ?? I(e?.new_string) ?? void 0, i = ce(t, void 0, "Edit file");
1276
+ s && i.push(Pt(s));
1277
+ const l = o !== void 0 && r !== void 0 ? cr(o, r) : Tn(I(n?.diff));
1366
1278
  return {
1367
- indicator: Ce(t),
1279
+ indicator: ae(t),
1368
1280
  title: i,
1369
- blocks: Ie(t, l)
1281
+ blocks: ue(t, l)
1370
1282
  };
1371
- }, Ur = (t) => {
1283
+ }, dr = (t) => {
1372
1284
  const {
1373
1285
  buildBaseTitle: e,
1374
1286
  buildIndicator: n,
1375
- prependErrorBlock: o
1287
+ prependErrorBlock: s
1376
1288
  } = t;
1377
- return (s) => {
1378
- const r = we(s.state?.output) ?? we(s.state?.metadata), i = Wn(s.state?.input), l = i ? {
1289
+ return (o) => {
1290
+ const r = re(o.state?.output) ?? re(o.state?.metadata), i = dn(o.state?.input), l = i ? {
1379
1291
  type: "question-form",
1380
1292
  questions: i.questions
1381
1293
  } : null;
1382
1294
  if (!r && !l) return null;
1383
1295
  const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, u = r ? [] : [l];
1384
1296
  return {
1385
- indicator: n(s),
1386
- title: e(s, a, "Question"),
1387
- blocks: o(s, u),
1297
+ indicator: n(o),
1298
+ title: e(o, a, "Question"),
1299
+ blocks: s(o, u),
1388
1300
  expandable: !1
1389
1301
  };
1390
1302
  };
1391
- }, jr = (t) => {
1392
- const e = qe(t), n = ht(t), o = _(e?.filePath) ?? _(e?.file_path) ?? _(e?.file) ?? _(n?.filePath) ?? _(n?.file) ?? _(n?.path) ?? void 0, s = ke(t, void 0, "Read file");
1393
- return o && s.push(un(o)), {
1394
- indicator: Ce(t),
1395
- title: s,
1396
- blocks: Ie(t, [])
1303
+ }, fr = (t) => {
1304
+ const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(e?.file) ?? I(n?.filePath) ?? I(n?.file) ?? I(n?.path) ?? void 0, o = ce(t, void 0, "Read file");
1305
+ return s && o.push(Pt(s)), {
1306
+ indicator: ae(t),
1307
+ title: o,
1308
+ blocks: ue(t, [])
1397
1309
  };
1398
- }, es = (t, e) => {
1399
- const n = qe(t), o = ht(t), s = _(n?.command) ?? void 0, r = ke(t, s, e, "monospace"), i = [], l = Mt(t);
1310
+ }, An = (t, e) => {
1311
+ const n = ye(t), s = qe(t), o = I(n?.command) ?? void 0, r = ce(t, o, e, "monospace"), i = [], l = et(t);
1400
1312
  l && i.push({
1401
1313
  type: "code",
1402
1314
  language: "text",
1403
1315
  code: l
1404
1316
  });
1405
- const a = _(o?.stderr);
1317
+ const a = I(s?.stderr);
1406
1318
  return a && a !== l && i.push({
1407
1319
  type: "code",
1408
1320
  language: "text",
1409
1321
  code: a
1410
- }), typeof o?.exitCode == "number" && i.push({
1322
+ }), typeof s?.exitCode == "number" && i.push({
1411
1323
  type: "text",
1412
- text: `Exit code: ${o.exitCode}`
1324
+ text: `Exit code: ${s.exitCode}`
1413
1325
  }), {
1414
- indicator: Ce(t),
1326
+ indicator: ae(t),
1415
1327
  title: r,
1416
- blocks: Ie(t, i)
1328
+ blocks: ue(t, i)
1417
1329
  };
1418
- }, Kr = (t) => es(t, "Run command"), Xr = (t) => es(t, "Shell"), Gr = (t) => {
1419
- const e = qe(t), n = Mt(t), o = _(e?.pattern) ?? void 0, s = ke(t, o, "Search files"), r = n ? [{
1330
+ }, pr = (t) => An(t, "Run command"), mr = (t) => An(t, "Shell"), hr = (t) => {
1331
+ const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Search files"), r = n ? [{
1420
1332
  type: "code",
1421
1333
  language: "text",
1422
1334
  code: n
1423
1335
  }] : [];
1424
1336
  return {
1425
- indicator: Ce(t),
1426
- title: s,
1427
- blocks: Ie(t, r)
1337
+ indicator: ae(t),
1338
+ title: o,
1339
+ blocks: ue(t, r)
1428
1340
  };
1429
- }, Yr = (t) => {
1430
- const e = qe(t), n = Mt(t), o = _(e?.pattern) ?? void 0, s = ke(t, o, "Find files"), r = [];
1341
+ }, gr = (t) => {
1342
+ const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Find files"), r = [];
1431
1343
  if (n) {
1432
1344
  const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
1433
1345
  i.length > 0 && r.push({
@@ -1436,63 +1348,63 @@ const _r = {
1436
1348
  });
1437
1349
  }
1438
1350
  return {
1439
- indicator: Ce(t),
1440
- title: s,
1441
- blocks: Ie(t, r)
1351
+ indicator: ae(t),
1352
+ title: o,
1353
+ blocks: ue(t, r)
1442
1354
  };
1443
- }, Jr = (t) => {
1444
- const e = Mt(t), n = e ? zr(e) : null, o = Qr(t) ?? n?.skillName, s = ke(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
1355
+ }, br = (t) => {
1356
+ const e = et(t), n = e ? or(e) : null, s = rr(t) ?? n?.skillName, o = ce(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
1445
1357
  type: "code",
1446
1358
  language: "markdown",
1447
1359
  code: r
1448
1360
  }] : [];
1449
1361
  return {
1450
- indicator: Ce(t),
1451
- title: s,
1452
- blocks: Ie(t, i)
1362
+ indicator: ae(t),
1363
+ title: o,
1364
+ blocks: ue(t, i)
1453
1365
  };
1454
- }, jt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ts = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Zr = (t) => {
1455
- const e = ts(t);
1366
+ }, ht = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, kn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
1367
+ const e = kn(t);
1456
1368
  if (!e) return null;
1457
- const n = jt(e.content) ?? jt(e.title);
1369
+ const n = ht(e.content) ?? ht(e.title);
1458
1370
  if (!n) return null;
1459
- const o = jt(e.status);
1371
+ const s = ht(e.status);
1460
1372
  return {
1461
1373
  label: n,
1462
- checked: o === "completed"
1374
+ checked: s === "completed"
1463
1375
  };
1464
- }, xn = (t) => {
1376
+ }, qt = (t) => {
1465
1377
  if (!t) return {
1466
1378
  items: [],
1467
1379
  explicit: !1
1468
1380
  };
1469
1381
  const e = (() => {
1470
1382
  if (Array.isArray(t)) return t;
1471
- const n = ts(t);
1383
+ const n = kn(t);
1472
1384
  return !n || !Array.isArray(n.todos) ? null : n.todos;
1473
1385
  })();
1474
1386
  return e ? {
1475
- items: e.map(Zr).filter((n) => n !== null),
1387
+ items: e.map(yr).filter((n) => n !== null),
1476
1388
  explicit: !0
1477
1389
  } : {
1478
1390
  items: [],
1479
1391
  explicit: !1
1480
1392
  };
1481
- }, ei = (t) => {
1393
+ }, xr = (t) => {
1482
1394
  const {
1483
1395
  buildBaseTitle: e,
1484
1396
  buildIndicator: n,
1485
- prependErrorBlock: o
1397
+ prependErrorBlock: s
1486
1398
  } = t;
1487
- return (s) => {
1488
- const r = xn(s.state?.input), i = xn(s.state?.output), l = i.explicit ? i : r;
1399
+ return (o) => {
1400
+ const r = qt(o.state?.input), i = qt(o.state?.output), l = i.explicit ? i : r;
1489
1401
  if (!l.explicit) return null;
1490
- const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(s, u, "Update todos");
1402
+ const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
1491
1403
  if (a.length === 0)
1492
1404
  return {
1493
- indicator: n(s),
1405
+ indicator: n(o),
1494
1406
  title: d,
1495
- blocks: o(s, [{
1407
+ blocks: s(o, [{
1496
1408
  type: "comment",
1497
1409
  text: "No todos"
1498
1410
  }])
@@ -1502,45 +1414,45 @@ const _r = {
1502
1414
  items: a
1503
1415
  }];
1504
1416
  return {
1505
- indicator: n(s),
1417
+ indicator: n(o),
1506
1418
  title: d,
1507
- blocks: o(s, f)
1419
+ blocks: s(o, f)
1508
1420
  };
1509
1421
  };
1510
- }, ti = Ur({
1511
- buildBaseTitle: ke,
1512
- buildIndicator: Ce,
1513
- prependErrorBlock: Ie
1514
- }), Sn = ei({
1515
- buildBaseTitle: ke,
1516
- buildIndicator: Ce,
1517
- prependErrorBlock: Ie
1518
- }), wn = () => ({
1519
- apply_patch: Hr,
1520
- bash: Kr,
1521
- edit: Nr,
1522
- glob: Yr,
1523
- grep: Gr,
1524
- question: ti,
1525
- read: jr,
1526
- shell: Xr,
1527
- skill: Jr,
1528
- todo_write: Sn,
1529
- todowrite: Sn
1530
- }), Tn = {
1422
+ }, Sr = dr({
1423
+ buildBaseTitle: ce,
1424
+ buildIndicator: ae,
1425
+ prependErrorBlock: ue
1426
+ }), Wt = xr({
1427
+ buildBaseTitle: ce,
1428
+ buildIndicator: ae,
1429
+ prependErrorBlock: ue
1430
+ }), Ht = () => ({
1431
+ apply_patch: ar,
1432
+ bash: pr,
1433
+ edit: ur,
1434
+ glob: gr,
1435
+ grep: hr,
1436
+ question: Sr,
1437
+ read: fr,
1438
+ shell: mr,
1439
+ skill: br,
1440
+ todo_write: Wt,
1441
+ todowrite: Wt
1442
+ }), Vt = {
1531
1443
  error: "failed",
1532
1444
  "output-error": "failed",
1533
1445
  "input-streaming": "running"
1534
- }, ni = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ns = (t) => {
1535
- const e = vt(t ?? "tool").replace(/_/g, " ");
1536
- return ni(e);
1537
- }, ss = (t) => t === "error" || t === "output-error", si = (t) => ss(t.state?.status) ? {
1446
+ }, wr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Cn = (t) => {
1447
+ const e = Je(t ?? "tool").replace(/_/g, " ");
1448
+ return wr(e);
1449
+ }, In = (t) => t === "error" || t === "output-error", Tr = (t) => In(t.state?.status) ? {
1538
1450
  type: "icon",
1539
1451
  icon: "danger"
1540
1452
  } : {
1541
1453
  type: "icon",
1542
- icon: Nn(t.tool ?? "tool")
1543
- }, oi = (t) => !t || typeof t != "string" ? null : Tn[t] ? Tn[t] : t.includes("stream") ? "running" : null, ri = (t) => {
1454
+ icon: mn(t.tool ?? "tool")
1455
+ }, Ar = (t) => !t || typeof t != "string" ? null : Vt[t] ? Vt[t] : t.includes("stream") ? "running" : null, kr = (t) => {
1544
1456
  if (typeof t == "string") return t;
1545
1457
  if (t == null) return null;
1546
1458
  try {
@@ -1548,31 +1460,31 @@ const _r = {
1548
1460
  } catch {
1549
1461
  return null;
1550
1462
  }
1551
- }, Jt = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(Jt) : typeof t == "object" ? Object.values(t).every(Jt) : !1, Pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ii = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), An = (t) => !!t?.startsWith("image/"), li = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, os = (t, e) => {
1552
- const n = Pt(t);
1463
+ }, St = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(St) : typeof t == "object" ? Object.values(t).every(St) : !1, tt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Cr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), Nt = (t) => !!t?.startsWith("image/"), Ir = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, _n = (t, e) => {
1464
+ const n = tt(t);
1553
1465
  if (!n) return null;
1554
- const o = ii(n), s = N(n.data);
1555
- if (s && An(o))
1466
+ const s = Cr(n), o = N(n.data);
1467
+ if (o && Nt(s))
1556
1468
  return {
1557
1469
  type: "image",
1558
- src: `data:${o};base64,${s}`,
1470
+ src: `data:${s};base64,${o}`,
1559
1471
  alt: e
1560
1472
  };
1561
1473
  const r = N(n.url) ?? N(n.src);
1562
- return r && (An(o) || li.test(r)) ? {
1474
+ return r && (Nt(s) || Ir.test(r)) ? {
1563
1475
  type: "image",
1564
1476
  src: r,
1565
1477
  alt: e
1566
1478
  } : null;
1567
- }, rs = (t) => {
1568
- const e = Pt(t);
1479
+ }, Rn = (t) => {
1480
+ const e = tt(t);
1569
1481
  if (!e) return null;
1570
- const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), o = N(e.content) ?? N(e.body) ?? N(e.text);
1571
- return !n || o === null ? null : {
1482
+ const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), s = N(e.content) ?? N(e.body) ?? N(e.text);
1483
+ return !n || s === null ? null : {
1572
1484
  filePath: n,
1573
- content: o
1485
+ content: s
1574
1486
  };
1575
- }, ai = {
1487
+ }, _r = {
1576
1488
  css: "css",
1577
1489
  html: "html",
1578
1490
  js: "js",
@@ -1584,88 +1496,88 @@ const _r = {
1584
1496
  tsx: "tsx",
1585
1497
  yaml: "yaml",
1586
1498
  yml: "yaml"
1587
- }, ci = (t) => {
1499
+ }, Rr = (t) => {
1588
1500
  const e = t.split(".").pop()?.toLowerCase();
1589
- return e ? ai[e] ?? e : "text";
1590
- }, Cn = (t, e) => e.length === 0 ? [] : [{
1501
+ return e ? _r[e] ?? e : "text";
1502
+ }, Ut = (t, e) => e.length === 0 ? [] : [{
1591
1503
  type: "text",
1592
1504
  text: t
1593
- }, ...e], ui = (t, e) => {
1505
+ }, ...e], vr = (t, e) => {
1594
1506
  const n = [];
1595
- for (const o of t) {
1596
- const s = Pt(o), r = N(s?.type);
1507
+ for (const s of t) {
1508
+ const o = tt(s), r = N(o?.type);
1597
1509
  if (r === "image") {
1598
- const i = os(o, e);
1510
+ const i = _n(s, e);
1599
1511
  i && n.push(i);
1600
1512
  continue;
1601
1513
  }
1602
1514
  if (r === "text") {
1603
- const i = N(s?.text);
1515
+ const i = N(o?.text);
1604
1516
  i && n.push({
1605
1517
  type: "text",
1606
1518
  text: i
1607
1519
  });
1608
1520
  continue;
1609
1521
  }
1610
- n.push(...Zt(o, e));
1522
+ n.push(...wt(s, e));
1611
1523
  }
1612
1524
  return n;
1613
- }, di = (t) => {
1614
- const e = rs(t);
1525
+ }, Mr = (t) => {
1526
+ const e = Rn(t);
1615
1527
  return e ? [{
1616
1528
  type: "code",
1617
- language: ci(e.filePath),
1529
+ language: Rr(e.filePath),
1618
1530
  code: e.content
1619
1531
  }] : null;
1620
- }, fi = (t) => {
1621
- const e = Pt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), o = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1622
- return !n && !o ? null : [{
1532
+ }, Pr = (t) => {
1533
+ const e = tt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), s = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1534
+ return !n && !s ? null : [{
1623
1535
  type: "text",
1624
- text: n ?? `Attachment ${o}`
1536
+ text: n ?? `Attachment ${s}`
1625
1537
  }];
1626
- }, Zt = (t, e) => {
1627
- if (Jt(t)) return [];
1628
- const n = os(t, e);
1538
+ }, wt = (t, e) => {
1539
+ if (St(t)) return [];
1540
+ const n = _n(t, e);
1629
1541
  if (n) return [n];
1630
- if (Array.isArray(t)) return ui(t, e);
1631
- const o = di(t);
1632
- if (o) return o;
1633
- const s = fi(t);
1542
+ if (Array.isArray(t)) return vr(t, e);
1543
+ const s = Mr(t);
1634
1544
  if (s) return s;
1635
- const r = ri(t);
1545
+ const o = Pr(t);
1546
+ if (o) return o;
1547
+ const r = kr(t);
1636
1548
  return r?.trim() ? [{
1637
1549
  type: "code",
1638
1550
  language: typeof t == "string" ? "text" : "json",
1639
1551
  code: r
1640
1552
  }] : [];
1641
- }, pi = (t) => {
1642
- const e = [], n = ns(t.tool);
1643
- return ss(t.state?.status) && t.state?.errorText && e.push({
1553
+ }, Er = (t) => {
1554
+ const e = [], n = Cn(t.tool);
1555
+ return In(t.state?.status) && t.state?.errorText && e.push({
1644
1556
  type: "comment",
1645
1557
  text: t.state.errorText
1646
- }), e.push(...Cn("Input", Zt(t.state?.input, `${n} input`))), e.push(...Cn("Output", Zt(t.state?.output, `${n} output`))), e;
1647
- }, mi = (t) => {
1558
+ }), e.push(...Ut("Input", wt(t.state?.input, `${n} input`))), e.push(...Ut("Output", wt(t.state?.output, `${n} output`))), e;
1559
+ }, Dr = (t) => {
1648
1560
  const e = [{
1649
1561
  kind: "text",
1650
- text: ns(t.tool),
1562
+ text: Cn(t.tool),
1651
1563
  bold: !0
1652
- }], n = rs(t.state?.output);
1564
+ }], n = Rn(t.state?.output);
1653
1565
  n && e.push({
1654
1566
  kind: "link",
1655
1567
  text: n.filePath,
1656
1568
  filePath: n.filePath
1657
1569
  });
1658
- const o = oi(t.state?.status);
1659
- return o && e.push({
1570
+ const s = Ar(t.state?.status);
1571
+ return s && e.push({
1660
1572
  kind: "text",
1661
- text: o,
1573
+ text: s,
1662
1574
  muted: !0
1663
1575
  }), {
1664
- indicator: si(t),
1576
+ indicator: Tr(t),
1665
1577
  title: e,
1666
- blocks: pi(t)
1578
+ blocks: Er(t)
1667
1579
  };
1668
- }, hi = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, gi = (t) => {
1580
+ }, Br = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, Fr = (t) => {
1669
1581
  switch (t.type) {
1670
1582
  case "comment":
1671
1583
  case "code":
@@ -1685,83 +1597,83 @@ const _r = {
1685
1597
  case "component":
1686
1598
  return !0;
1687
1599
  }
1688
- }, bi = (t) => {
1689
- const e = t.title.some(hi), n = (t.blocks ?? []).some(gi);
1600
+ }, Lr = (t) => {
1601
+ const e = t.title.some(Br), n = (t.blocks ?? []).some(Fr);
1690
1602
  return e || n;
1691
- }, yi = (t) => t ? {
1692
- ...wn(),
1603
+ }, $r = (t) => t ? {
1604
+ ...Ht(),
1693
1605
  ...t
1694
- } : wn(), xi = (t, e) => {
1606
+ } : Ht(), Or = (t, e) => {
1695
1607
  const n = t.tool ?? "tool";
1696
- for (const o of ur(n)) {
1697
- const s = e[o];
1698
- if (s) return s;
1608
+ for (const s of vo(n)) {
1609
+ const o = e[s];
1610
+ if (o) return o;
1699
1611
  }
1700
- }, Si = (t, e, n) => {
1701
- const o = xi(t, e);
1702
- if (o) {
1703
- const s = o(t, n);
1704
- if (s) return s;
1612
+ }, zr = (t, e, n) => {
1613
+ const s = Or(t, e);
1614
+ if (s) {
1615
+ const o = s(t, n);
1616
+ if (o) return o;
1705
1617
  }
1706
- return mi(t);
1707
- }, wi = (t, e) => {
1708
- const n = yi(e?.toolRenderers);
1618
+ return Dr(t);
1619
+ }, Qr = (t, e) => {
1620
+ const n = $r(e?.toolRenderers);
1709
1621
  return {
1710
- items: t.map((s) => Si(s, n, e)).filter(bi)
1622
+ items: t.map((o) => zr(o, n, e)).filter(Lr)
1711
1623
  };
1712
- }, is = (t, e, n, o = !1) => {
1713
- o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1624
+ }, vn = (t, e, n, s = !1) => {
1625
+ s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1714
1626
  };
1715
- function Ti(t) {
1627
+ function qr(t) {
1716
1628
  const e = A(6), {
1717
1629
  seg: n
1718
1630
  } = t;
1719
- let o;
1720
- e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ c(rt.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
1721
1631
  let s;
1722
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ c(rt.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
1632
+ e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
1633
+ let o;
1634
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
1723
1635
  let r;
1724
- return e[4] !== o ? (r = /* @__PURE__ */ C(rt.Root, { width: "1.5rem", height: "1.5rem", children: [
1725
- o,
1726
- s
1727
- ] }), e[4] = o, e[5] = r) : r = e[5], r;
1636
+ return e[4] !== s ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
1637
+ s,
1638
+ o
1639
+ ] }), e[4] = s, e[5] = r) : r = e[5], r;
1728
1640
  }
1729
- function Ai(t) {
1641
+ function Wr(t) {
1730
1642
  const e = A(9), {
1731
1643
  seg: n,
1732
- onOpenFile: o
1733
- } = t, s = n.additions ?? 0, r = n.deletions ?? 0;
1644
+ onOpenFile: s
1645
+ } = t, o = n.additions ?? 0, r = n.deletions ?? 0;
1734
1646
  let i;
1735
- e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1647
+ e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1736
1648
  const a = n.filePath ?? n.fileName;
1737
- o?.(a);
1738
- }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1649
+ s?.(a);
1650
+ }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1739
1651
  let l;
1740
- return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ c(so, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1652
+ return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ c(Cs, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1741
1653
  }
1742
- function Ci(t) {
1654
+ function Hr(t) {
1743
1655
  const e = A(13), {
1744
1656
  seg: n,
1745
- onOpenFile: o
1746
- } = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1657
+ onOpenFile: s
1658
+ } = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1747
1659
  let u;
1748
- e[0] !== o || e[1] !== n ? (u = (p) => is(p, n, o, !0), e[0] = o, e[1] = n, e[2] = u) : u = e[2];
1660
+ e[0] !== s || e[1] !== n ? (u = (m) => vn(m, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
1749
1661
  const d = n.muted ? "fg.muted" : "fg.blue-dark";
1750
1662
  let f;
1751
1663
  e[3] !== d ? (f = {
1752
1664
  textDecoration: "underline",
1753
1665
  color: d
1754
1666
  }, e[3] = d, e[4] = f) : f = e[4];
1755
- let m;
1756
- return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ c(Mn, { href: i, fontWeight: s, color: l, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
1667
+ let p;
1668
+ return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== u || e[11] !== f ? (p = /* @__PURE__ */ c(Jt, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = u, e[11] = f, e[12] = p) : p = e[12], p;
1757
1669
  }
1758
- function ki(t) {
1670
+ function Vr(t) {
1759
1671
  const e = A(12), {
1760
1672
  seg: n,
1761
- onOpenFile: o
1762
- } = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1673
+ onOpenFile: s
1674
+ } = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1763
1675
  let l;
1764
- e[0] !== o || e[1] !== n ? (l = (f) => is(f, n, o), e[0] = o, e[1] = n, e[2] = l) : l = e[2];
1676
+ e[0] !== s || e[1] !== n ? (l = (f) => vn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
1765
1677
  const a = n.muted ? "fg.muted" : "accent.primary";
1766
1678
  let u;
1767
1679
  e[3] !== a ? (u = {
@@ -1769,54 +1681,54 @@ function ki(t) {
1769
1681
  textDecoration: "underline"
1770
1682
  }, e[3] = a, e[4] = u) : u = e[4];
1771
1683
  let d;
1772
- return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ c(Mn, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
1684
+ return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ c(Jt, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
1773
1685
  }
1774
- function Ii(t) {
1686
+ function Nr(t) {
1775
1687
  const e = A(14), {
1776
1688
  seg: n,
1777
- isClickable: o
1778
- } = t, s = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, u = n.truncate ? "nowrap" : void 0, d = o && !n.muted ? "fg" : "fg.muted";
1689
+ isClickable: s
1690
+ } = t, o = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, u = n.truncate ? "nowrap" : void 0, d = s && !n.muted ? "fg" : "fg.muted";
1779
1691
  let f;
1780
1692
  e[0] !== d ? (f = {
1781
1693
  color: d
1782
1694
  }, e[0] = d, e[1] = f) : f = e[1];
1783
- let m;
1784
- e[2] !== n.text || e[3] !== s || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== f ? (m = /* @__PURE__ */ c(dt, { fontWeight: s, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: u, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = s, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = u, e[9] = f, e[10] = m) : m = e[10];
1785
- const p = m;
1695
+ let p;
1696
+ e[2] !== n.text || e[3] !== o || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== f ? (p = /* @__PURE__ */ c($e, { fontWeight: o, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: u, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = o, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = u, e[9] = f, e[10] = p) : p = e[10];
1697
+ const m = p;
1786
1698
  if (!n.truncate)
1787
- return p;
1699
+ return m;
1788
1700
  let h;
1789
- return e[11] !== n.text || e[12] !== p ? (h = /* @__PURE__ */ c(sn, { content: n.text, children: p }), e[11] = n.text, e[12] = p, e[13] = h) : h = e[13], h;
1701
+ return e[11] !== n.text || e[12] !== m ? (h = /* @__PURE__ */ c(Ct, { content: n.text, children: m }), e[11] = n.text, e[12] = m, e[13] = h) : h = e[13], h;
1790
1702
  }
1791
- function _i(t) {
1703
+ function Ur(t) {
1792
1704
  const e = A(11), {
1793
1705
  seg: n,
1794
- isClickable: o,
1795
- onOpenFile: s
1706
+ isClickable: s,
1707
+ onOpenFile: o
1796
1708
  } = t;
1797
1709
  switch (n.kind) {
1798
1710
  case "avatar": {
1799
1711
  let r;
1800
- return e[0] !== n ? (r = /* @__PURE__ */ c(Ti, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1712
+ return e[0] !== n ? (r = /* @__PURE__ */ c(qr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1801
1713
  }
1802
1714
  case "diff": {
1803
1715
  let r;
1804
- return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ c(Ai, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
1716
+ return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ c(Wr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
1805
1717
  }
1806
1718
  case "link": {
1807
1719
  let r;
1808
- return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ c(Ci, { seg: n, onOpenFile: s }) : /* @__PURE__ */ c(ki, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
1720
+ return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ c(Hr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ c(Vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
1809
1721
  }
1810
1722
  case "text": {
1811
1723
  let r;
1812
- return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ c(Ii, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
1724
+ return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ c(Nr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
1813
1725
  }
1814
1726
  default:
1815
1727
  return null;
1816
1728
  }
1817
1729
  }
1818
- const Oe = As;
1819
- function vi(t) {
1730
+ const he = Nn;
1731
+ function jr(t) {
1820
1732
  const e = A(10), {
1821
1733
  ind: n
1822
1734
  } = t;
@@ -1824,216 +1736,216 @@ function vi(t) {
1824
1736
  return null;
1825
1737
  if (n.type === "icon") {
1826
1738
  let i;
1827
- e[0] !== n.icon ? (i = pr(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1739
+ e[0] !== n.icon ? (i = Eo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1828
1740
  const l = i;
1829
1741
  let a;
1830
- return e[2] !== l ? (a = /* @__PURE__ */ c(Oe.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ c(dt, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ c(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1742
+ return e[2] !== l ? (a = /* @__PURE__ */ c(he.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ c(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1831
1743
  }
1832
- let o;
1833
- e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ c(rt.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1834
1744
  let s;
1835
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ c(rt.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
1745
+ e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1746
+ let o;
1747
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
1836
1748
  let r;
1837
- return e[8] !== o ? (r = /* @__PURE__ */ c(Oe.Indicator, { children: /* @__PURE__ */ C(rt.Root, { boxSize: "full", children: [
1838
- o,
1839
- s
1840
- ] }) }), e[8] = o, e[9] = r) : r = e[9], r;
1749
+ return e[8] !== s ? (r = /* @__PURE__ */ c(he.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
1750
+ s,
1751
+ o
1752
+ ] }) }), e[8] = s, e[9] = r) : r = e[9], r;
1841
1753
  }
1842
- function Ri(t) {
1754
+ function Kr(t) {
1843
1755
  const e = A(5), {
1844
1756
  code: n,
1845
- language: o
1846
- } = t, s = o ? `${o} code block` : "code block";
1757
+ language: s
1758
+ } = t, o = s ? `${s} code block` : "code block";
1847
1759
  let r;
1848
- e[0] !== n ? (r = /* @__PURE__ */ c(B, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1760
+ e[0] !== n ? (r = /* @__PURE__ */ c(P, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1849
1761
  let i;
1850
- return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ c(_t, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ c(B, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": s, children: r }) }), e[2] = s, e[3] = r, e[4] = i) : i = e[4], i;
1762
+ return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ c(Ye, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ c(P, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
1851
1763
  }
1852
- function Mi(t) {
1764
+ function Xr(t) {
1853
1765
  const e = A(38), {
1854
1766
  b: n,
1855
- onOpenFile: o
1767
+ onOpenFile: s
1856
1768
  } = t;
1857
1769
  switch (n.type) {
1858
1770
  case "comment": {
1859
- let s;
1860
- e[0] !== n.text ? (s = /* @__PURE__ */ c(le.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
1771
+ let o;
1772
+ e[0] !== n.text ? (o = /* @__PURE__ */ c(Y.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1861
1773
  let r;
1862
- e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(le.Footer, { children: /* @__PURE__ */ C(ft, { children: [
1774
+ e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(Y.Footer, { children: /* @__PURE__ */ k(Oe, { children: [
1863
1775
  "👏 ",
1864
1776
  n.reactions.clap
1865
1777
  ] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
1866
1778
  let i;
1867
- return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ C(le.Root, { children: [
1868
- s,
1779
+ return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(Y.Root, { children: [
1780
+ o,
1869
1781
  r
1870
- ] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
1782
+ ] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
1871
1783
  }
1872
1784
  case "code": {
1873
- let s;
1874
- return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ c(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(le.Body, { padding: "0", children: /* @__PURE__ */ c(Ri, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
1785
+ let o;
1786
+ return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(Kr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1875
1787
  }
1876
1788
  case "diff": {
1877
- const s = n.sideBySide ?? !1;
1789
+ const o = n.sideBySide ?? !1;
1878
1790
  let r;
1879
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ c(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(le.Body, { padding: "0", children: /* @__PURE__ */ c(B, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ c(oo, { original: n.original, modified: n.modified, language: n.language, sideBySide: s, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = s, e[14] = r) : r = e[14], r;
1791
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(P, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ c(Is, { original: n.original, modified: n.modified, language: n.language, sideBySide: o, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = o, e[14] = r) : r = e[14], r;
1880
1792
  }
1881
1793
  case "text": {
1882
- let s;
1883
- return e[15] !== n.text ? (s = /* @__PURE__ */ c(le.Root, { background: "transparent", children: /* @__PURE__ */ c(le.Body, { padding: "sm", children: /* @__PURE__ */ c(j, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
1794
+ let o;
1795
+ return e[15] !== n.text ? (o = /* @__PURE__ */ c(Y.Root, { background: "transparent", children: /* @__PURE__ */ c(Y.Body, { padding: "sm", children: /* @__PURE__ */ c(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1884
1796
  }
1885
1797
  case "todo-list": {
1886
- let s;
1887
- return e[17] !== n.items ? (s = /* @__PURE__ */ c(Mo, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
1798
+ let o;
1799
+ return e[17] !== n.items ? (o = /* @__PURE__ */ c(Ys, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
1888
1800
  }
1889
1801
  case "question-form": {
1890
- let s;
1891
- return e[19] !== n.questions ? (s = /* @__PURE__ */ c(qn, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
1802
+ let o;
1803
+ return e[19] !== n.questions ? (o = /* @__PURE__ */ c(un, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
1892
1804
  }
1893
1805
  case "references": {
1894
- let s;
1895
- e[21] !== n.references ? (s = n.references.map(Pi), e[21] = n.references, e[22] = s) : s = e[22];
1806
+ let o;
1807
+ e[21] !== n.references ? (o = n.references.map(Gr), e[21] = n.references, e[22] = o) : o = e[22];
1896
1808
  let r;
1897
- return e[23] !== s ? (r = /* @__PURE__ */ c(G, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
1809
+ return e[23] !== o ? (r = /* @__PURE__ */ c(j, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
1898
1810
  }
1899
1811
  case "image": {
1900
1812
  if (!n.src.trim())
1901
1813
  return null;
1902
- let s;
1903
- e[25] !== n.alt || e[26] !== n.src ? (s = /* @__PURE__ */ c(Pn, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = s) : s = e[27];
1814
+ let o;
1815
+ e[25] !== n.alt || e[26] !== n.src ? (o = /* @__PURE__ */ c(Zt, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = o) : o = e[27];
1904
1816
  let r;
1905
- e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(j, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1817
+ e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1906
1818
  let i;
1907
- return e[30] !== s || e[31] !== r ? (i = /* @__PURE__ */ c(le.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ C(le.Body, { padding: "0", children: [
1908
- s,
1819
+ return e[30] !== o || e[31] !== r ? (i = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(Y.Body, { padding: "0", children: [
1820
+ o,
1909
1821
  r
1910
- ] }) }), e[30] = s, e[31] = r, e[32] = i) : i = e[32], i;
1822
+ ] }) }), e[30] = o, e[31] = r, e[32] = i) : i = e[32], i;
1911
1823
  }
1912
1824
  case "component": {
1913
- let s;
1914
- e[33] !== n || e[34] !== o ? (s = n.render({
1915
- onOpenFile: o
1916
- }), e[33] = n, e[34] = o, e[35] = s) : s = e[35];
1825
+ let o;
1826
+ e[33] !== n || e[34] !== s ? (o = n.render({
1827
+ onOpenFile: s
1828
+ }), e[33] = n, e[34] = s, e[35] = o) : o = e[35];
1917
1829
  let r;
1918
- return e[36] !== s ? (r = /* @__PURE__ */ c(tn, { children: s }), e[36] = s, e[37] = r) : r = e[37], r;
1830
+ return e[36] !== o ? (r = /* @__PURE__ */ c(At, { children: o }), e[36] = o, e[37] = r) : r = e[37], r;
1919
1831
  }
1920
1832
  }
1921
1833
  }
1922
- function Pi(t) {
1923
- return /* @__PURE__ */ c(on, { fileName: t }, t);
1834
+ function Gr(t) {
1835
+ return /* @__PURE__ */ c(It, { fileName: t }, t);
1924
1836
  }
1925
- function Di(t) {
1837
+ function Yr(t) {
1926
1838
  const e = A(23), {
1927
1839
  item: n,
1928
- itemKey: o,
1929
- isOpen: s,
1840
+ itemKey: s,
1841
+ isOpen: o,
1930
1842
  canExpand: r,
1931
1843
  hasBlocks: i,
1932
1844
  onToggle: l,
1933
1845
  onOpenFile: a
1934
1846
  } = t;
1935
1847
  let u;
1936
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(Oe.Separator, {}), e[0] = u) : u = e[0];
1848
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(he.Separator, {}), e[0] = u) : u = e[0];
1937
1849
  let d;
1938
- e[1] !== n.indicator ? (d = /* @__PURE__ */ C(Oe.Connector, { children: [
1850
+ e[1] !== n.indicator ? (d = /* @__PURE__ */ k(he.Connector, { children: [
1939
1851
  u,
1940
- /* @__PURE__ */ c(vi, { ind: n.indicator })
1852
+ /* @__PURE__ */ c(jr, { ind: n.indicator })
1941
1853
  ] }), e[1] = n.indicator, e[2] = d) : d = e[2];
1942
- const f = s ? "auto" : "20px";
1943
- let m;
1944
- e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ c(Oe.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(o) : void 0, children: /* @__PURE__ */ C(dt, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1945
- /* @__PURE__ */ c(dt, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, y) => /* @__PURE__ */ c(_i, { seg: b, isClickable: r, onOpenFile: a }, y)) }),
1946
- r ? /* @__PURE__ */ c(dt, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1947
- color: "fg"
1948
- }, children: /* @__PURE__ */ c(Ns, { size: 12 }) }) : null
1949
- ] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = a, e[8] = l, e[9] = m) : m = e[9];
1854
+ const f = o ? "auto" : "20px";
1950
1855
  let p;
1951
- e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== a ? (p = i ? /* @__PURE__ */ c(B, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ c(B, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(Mi, { b, onOpenFile: a }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
1856
+ e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== l ? (p = n.title.length > 0 && /* @__PURE__ */ c(he.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k($e, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1857
+ /* @__PURE__ */ c($e, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, x) => /* @__PURE__ */ c(Ur, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
1858
+ r ? /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1859
+ color: "fg"
1860
+ }, children: /* @__PURE__ */ c(ps, { size: 12 }) }) : null
1861
+ ] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = l, e[9] = p) : p = e[9];
1862
+ let m;
1863
+ e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== a ? (m = i ? /* @__PURE__ */ c(P, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ c(P, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, x) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Xr, { b, onOpenFile: a }) }, x)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = a, e[14] = m) : m = e[14];
1952
1864
  let h;
1953
- e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ C(Oe.Content, { h: f, children: [
1954
- m,
1955
- p
1956
- ] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
1865
+ e[15] !== f || e[16] !== p || e[17] !== m ? (h = /* @__PURE__ */ k(he.Content, { h: f, children: [
1866
+ p,
1867
+ m
1868
+ ] }), e[15] = f, e[16] = p, e[17] = m, e[18] = h) : h = e[18];
1957
1869
  let g;
1958
- return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ C(Oe.Item, { gap: "xs", children: [
1870
+ return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(he.Item, { gap: "xs", children: [
1959
1871
  d,
1960
1872
  h
1961
- ] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1873
+ ] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1962
1874
  }
1963
- function Ei(t) {
1875
+ function Jr(t) {
1964
1876
  const e = A(11), {
1965
1877
  data: n,
1966
- onOpenFile: o
1878
+ onOpenFile: s
1967
1879
  } = t;
1968
- let s;
1969
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
1970
- const [r, i] = V(s), l = Bi;
1880
+ let o;
1881
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1882
+ const [r, i] = V(o), l = Zr;
1971
1883
  let a;
1972
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (m) => {
1973
- i((p) => ({
1974
- ...p,
1975
- [m]: !p[m]
1884
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
1885
+ i((m) => ({
1886
+ ...m,
1887
+ [p]: !m[p]
1976
1888
  }));
1977
1889
  }, e[1] = a) : a = e[1];
1978
1890
  const u = a;
1979
1891
  let d;
1980
- if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
1981
- let m;
1982
- e[6] !== r || e[7] !== o ? (m = (p, h) => {
1983
- const g = l(p, h), b = (p.blocks?.length ?? 0) > 0, y = (p.expandable ?? !0) && b, w = y ? r[g] ?? !1 : b;
1984
- return /* @__PURE__ */ c(Di, { item: p, itemKey: g, isOpen: w, canExpand: y, hasBlocks: b, onToggle: u, onOpenFile: o }, g);
1985
- }, e[6] = r, e[7] = o, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = o, e[5] = d;
1892
+ if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
1893
+ let p;
1894
+ e[6] !== r || e[7] !== s ? (p = (m, h) => {
1895
+ const g = l(m, h), b = (m.blocks?.length ?? 0) > 0, x = (m.expandable ?? !0) && b, y = x ? r[g] ?? !1 : b;
1896
+ return /* @__PURE__ */ c(Yr, { item: m, itemKey: g, isOpen: y, canExpand: x, hasBlocks: b, onToggle: u, onOpenFile: s }, g);
1897
+ }, e[6] = r, e[7] = s, e[8] = p) : p = e[8], d = n.items.map(p), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
1986
1898
  } else
1987
1899
  d = e[5];
1988
1900
  let f;
1989
- return e[9] !== d ? (f = /* @__PURE__ */ c(Oe.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1901
+ return e[9] !== d ? (f = /* @__PURE__ */ c(he.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1990
1902
  }
1991
- function Bi(t, e) {
1903
+ function Zr(t, e) {
1992
1904
  return t.id ? `id:${t.id}` : `idx:${e}`;
1993
1905
  }
1994
- const Fi = (t) => vt(t.tool ?? "").replace(/_/g, "") === "question", Li = (t) => {
1906
+ const ei = (t) => Je(t.tool ?? "").replace(/_/g, "") === "question", ti = (t) => {
1995
1907
  const e = t.state?.output;
1996
1908
  return typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : e && typeof e == "object" ? Object.keys(e).length > 0 : e != null;
1997
1909
  };
1998
- function $i(t) {
1910
+ function ni(t) {
1999
1911
  const e = A(8), {
2000
1912
  invocations: n,
2001
- labeledBlocks: o,
2002
- hideQuestionForms: s,
1913
+ labeledBlocks: s,
1914
+ hideQuestionForms: o,
2003
1915
  onOpenFile: r
2004
- } = t, i = s === void 0 ? !1 : s;
1916
+ } = t, i = o === void 0 ? !1 : o;
2005
1917
  let l, a;
2006
- if (e[0] !== i || e[1] !== n || e[2] !== o) {
1918
+ if (e[0] !== i || e[1] !== n || e[2] !== s) {
2007
1919
  a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
2008
1920
  e: {
2009
- const f = i ? n.filter(Oi) : n;
1921
+ const f = i ? n.filter(si) : n;
2010
1922
  if (f.length === 0) {
2011
1923
  a = null;
2012
1924
  break e;
2013
1925
  }
2014
- l = wi(f, {
2015
- labeledBlocks: o
1926
+ l = Qr(f, {
1927
+ labeledBlocks: s
2016
1928
  });
2017
1929
  }
2018
- e[0] = i, e[1] = n, e[2] = o, e[3] = l, e[4] = a;
1930
+ e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = a;
2019
1931
  } else
2020
1932
  l = e[3], a = e[4];
2021
1933
  if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
2022
1934
  return a;
2023
1935
  const u = l;
2024
1936
  let d;
2025
- return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(Ei, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
1937
+ return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(Jr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
2026
1938
  }
2027
- function Oi(t) {
2028
- return !Fi(t) || Li(t);
1939
+ function si(t) {
1940
+ return !ei(t) || ti(t);
2029
1941
  }
2030
- const zi = (t) => t.type === "tool", dn = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", Qi = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, qi = (t) => t.mediaType?.startsWith("image/") || Qi.test(dn(t)), Wi = (t) => qi(t) ? /* @__PURE__ */ c(Pn, { src: t.url, alt: `${dn(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, Hi = (t, e) => {
1942
+ const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", ri = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ii = (t) => t.mediaType?.startsWith("image/") || ri.test(Et(t)), li = (t) => ii(t) ? /* @__PURE__ */ c(Zt, { src: t.url, alt: `${Et(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, ai = (t, e) => {
2031
1943
  if (e) {
2032
1944
  e(t.url);
2033
1945
  return;
2034
1946
  }
2035
1947
  typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
2036
- }, Vi = (t) => {
1948
+ }, ci = (t) => {
2037
1949
  if (t.message && t.message.trim().length > 0)
2038
1950
  return t.message;
2039
1951
  const {
@@ -2049,371 +1961,371 @@ const zi = (t) => t.type === "tool", dn = (t) => t.filename ?? t.url.split("/").
2049
1961
  default:
2050
1962
  return "An error occurred.";
2051
1963
  }
2052
- }, Ni = {
1964
+ }, ui = {
2053
1965
  info: "blue",
2054
1966
  warning: "orange",
2055
1967
  error: "red",
2056
1968
  success: "green",
2057
1969
  loading: "blue"
2058
- }, Ui = (t, e) => {
1970
+ }, di = (t, e) => {
2059
1971
  const n = [];
2060
- let o = e;
2061
- for (; o < t.length; ) {
2062
- const s = t[o];
2063
- if (!zi(s)) break;
2064
- n.push(s), o += 1;
1972
+ let s = e;
1973
+ for (; s < t.length; ) {
1974
+ const o = t[s];
1975
+ if (!oi(o)) break;
1976
+ n.push(o), s += 1;
2065
1977
  }
2066
1978
  return {
2067
1979
  invocations: n,
2068
- nextIndex: o - 1
1980
+ nextIndex: s - 1
2069
1981
  };
2070
1982
  };
2071
- function ls(t) {
1983
+ function Mn(t) {
2072
1984
  const e = A(8), {
2073
1985
  message: n,
2074
- hideQuestionForms: o,
2075
- onOpenFile: s,
1986
+ hideQuestionForms: s,
1987
+ onOpenFile: o,
2076
1988
  toolInvocationTimeline: r
2077
- } = t, i = o === void 0 ? !1 : o, l = r ?? $i;
1989
+ } = t, i = s === void 0 ? !1 : s, l = r ?? ni;
2078
1990
  let a;
2079
1991
  e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
2080
1992
  const u = a;
2081
1993
  let d;
2082
- if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== u) {
1994
+ if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
2083
1995
  const f = [];
2084
- for (let m = 0; m < u.length; m = m + 1, m) {
2085
- const p = u[m], h = `${n.id}-${m}`;
2086
- e: switch (p.type) {
1996
+ for (let p = 0; p < u.length; p = p + 1, p) {
1997
+ const m = u[p], h = `${n.id}-${p}`;
1998
+ e: switch (m.type) {
2087
1999
  case "text": {
2088
- f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(cr, { children: p.text }) }, h));
2000
+ f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(Ro, { children: m.text }) }, h));
2089
2001
  break e;
2090
2002
  }
2091
2003
  case "reasoning": {
2092
- f.push(/* @__PURE__ */ c(B, { padding: "0", css: {
2004
+ f.push(/* @__PURE__ */ c(P, { padding: "0", css: {
2093
2005
  "& .rich-text, & .rich-text *": {
2094
2006
  color: "fg.subtle !important",
2095
2007
  fontSize: ".75rem !important",
2096
2008
  fontWeight: "normal !important"
2097
2009
  }
2098
- }, children: /* @__PURE__ */ c($n, { defaultState: p.text, fullWidth: !0 }) }, h));
2010
+ }, children: /* @__PURE__ */ c(rn, { defaultState: m.text, fullWidth: !0 }) }, h));
2099
2011
  break e;
2100
2012
  }
2101
2013
  case "tool": {
2102
2014
  const {
2103
2015
  invocations: g,
2104
2016
  nextIndex: b
2105
- } = Ui(u, m);
2106
- m = b, f.push(/* @__PURE__ */ c(B, { width: "full", children: /* @__PURE__ */ c(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
2017
+ } = di(u, p);
2018
+ p = b, f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
2107
2019
  break e;
2108
2020
  }
2109
2021
  case "file": {
2110
- f.push(/* @__PURE__ */ c(B, { width: "fit-content", children: /* @__PURE__ */ c(on, { fileName: dn(p), size: "sm", tone: "neutral", icon: Wi(p), onSelect: () => Hi(p, s) }) }, h));
2022
+ f.push(/* @__PURE__ */ c(P, { width: "fit-content", children: /* @__PURE__ */ c(It, { fileName: Et(m), size: "sm", tone: "neutral", icon: li(m), onSelect: () => ai(m, o) }) }, h));
2111
2023
  break e;
2112
2024
  }
2113
2025
  case "error": {
2114
- f.push(/* @__PURE__ */ c(B, { py: "2", width: "full", children: /* @__PURE__ */ c(pn, { borderRadius: "xs", status: "error", colorPalette: "red", title: Vi(p), size: "sm" }) }, h));
2026
+ f.push(/* @__PURE__ */ c(P, { py: "2", width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: "error", colorPalette: "red", title: ci(m), size: "sm" }) }, h));
2115
2027
  break e;
2116
2028
  }
2117
2029
  case "token_usage":
2118
2030
  break e;
2119
2031
  case "alert": {
2120
- f.push(/* @__PURE__ */ c(B, { width: "full", children: /* @__PURE__ */ c(pn, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: Ni[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ c(nn, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
2032
+ f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: m.status === "loading" ? "info" : m.status, colorPalette: ui[m.status], title: m.title, icon: m.status === "loading" ? /* @__PURE__ */ c(kt, { size: "sm" }) : void 0, size: "sm", children: m.message }) }, h));
2121
2033
  break e;
2122
2034
  }
2123
2035
  default:
2124
2036
  f.push(null);
2125
2037
  }
2126
2038
  }
2127
- d = /* @__PURE__ */ c(tn, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = s, e[6] = u, e[7] = d;
2039
+ d = /* @__PURE__ */ c(At, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
2128
2040
  } else
2129
2041
  d = e[7];
2130
2042
  return d;
2131
2043
  }
2132
- const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", as = (t) => t.text.trim().length > 0, Ki = (t) => t.title.trim().length > 0 || !!t.message?.trim(), Xi = (t) => {
2044
+ const fi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Pn = (t) => t.text.trim().length > 0, pi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), mi = (t) => {
2133
2045
  switch (t.type) {
2134
2046
  case "text":
2135
2047
  case "reasoning":
2136
- return as(t);
2048
+ return Pn(t);
2137
2049
  case "tool":
2138
2050
  case "file":
2139
2051
  case "error":
2140
2052
  return !0;
2141
2053
  case "alert":
2142
- return Ki(t);
2054
+ return pi(t);
2143
2055
  default:
2144
2056
  return !1;
2145
2057
  }
2146
- }, Gi = (t) => t.type === "reasoning" || t.type === "tool", Yi = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(Gi), Ji = (t) => {
2058
+ }, hi = (t) => t.type === "reasoning" || t.type === "tool", gi = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(hi), bi = (t) => {
2147
2059
  if (t.length === 0) return null;
2148
2060
  const [e, ...n] = t;
2149
2061
  return e ? {
2150
2062
  ...e,
2151
2063
  role: "assistant",
2152
- parts: t.flatMap((o) => o.parts),
2064
+ parts: t.flatMap((s) => s.parts),
2153
2065
  modelId: n.at(-1)?.modelId ?? e.modelId,
2154
2066
  providerId: n.at(-1)?.providerId ?? e.providerId
2155
2067
  } : null;
2156
- }, Zi = (t, e = {}) => {
2068
+ }, yi = (t, e = {}) => {
2157
2069
  const n = [];
2158
- let o = [];
2159
- const s = () => {
2160
- o = [];
2070
+ let s = [];
2071
+ const o = () => {
2072
+ s = [];
2161
2073
  };
2162
2074
  for (const r of t) {
2163
- const i = (r.parts ?? []).filter(Xi);
2075
+ const i = (r.parts ?? []).filter(mi);
2164
2076
  if (i.length === 0) continue;
2165
2077
  const l = {
2166
2078
  ...r,
2167
2079
  parts: i
2168
2080
  };
2169
2081
  if (l.role === "user") {
2170
- s(), n.push(l);
2082
+ o(), n.push(l);
2171
2083
  continue;
2172
2084
  }
2173
- if (Yi(l)) {
2174
- o.push(l);
2085
+ if (gi(l)) {
2086
+ s.push(l);
2175
2087
  continue;
2176
2088
  }
2177
- if (o.length > 0) {
2089
+ if (s.length > 0) {
2178
2090
  n.push({
2179
2091
  ...l,
2180
- parts: [...o.flatMap((a) => a.parts), ...l.parts]
2181
- }), s();
2092
+ parts: [...s.flatMap((a) => a.parts), ...l.parts]
2093
+ }), o();
2182
2094
  continue;
2183
2095
  }
2184
2096
  n.push(l);
2185
2097
  }
2186
- if (e.streaming && o.length > 0) {
2187
- const r = Ji(o);
2098
+ if (e.streaming && s.length > 0) {
2099
+ const r = bi(s);
2188
2100
  r && n.push(r);
2189
2101
  }
2190
2102
  return n;
2191
- }, cs = (t) => {
2103
+ }, En = (t) => {
2192
2104
  const e = t.at(-1);
2193
- return e?.role !== "assistant" ? null : e.parts.some((o) => o.type === "text" && as(o)) ? e.id : null;
2194
- }, el = (t) => {
2105
+ return e?.role !== "assistant" ? null : e.parts.some((s) => s.type === "text" && Pn(s)) ? e.id : null;
2106
+ }, xi = (t) => {
2195
2107
  const e = [], n = [];
2196
- for (const o of t)
2197
- o.role === "user" ? e.push({
2198
- userMessage: o,
2108
+ for (const s of t)
2109
+ s.role === "user" ? e.push({
2110
+ userMessage: s,
2199
2111
  responses: []
2200
- }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
2112
+ }) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
2201
2113
  return {
2202
2114
  groups: e,
2203
2115
  leadingResponses: n
2204
2116
  };
2205
- }, us = (t) => {
2117
+ }, Dn = (t) => {
2206
2118
  const e = A(18), {
2207
2119
  message: n,
2208
- streaming: o,
2209
- hideQuestionForms: s,
2120
+ streaming: s,
2121
+ hideQuestionForms: o,
2210
2122
  animate: r,
2211
2123
  showAssistantActions: i
2212
- } = t, l = s === void 0 ? !1 : s, a = r === void 0 ? !1 : r;
2124
+ } = t, l = o === void 0 ? !1 : o, a = r === void 0 ? !1 : r;
2213
2125
  let u;
2214
- e[0] !== n.role ? (u = ji(n.role), e[0] = n.role, e[1] = u) : u = e[1];
2215
- const d = u, f = d === "user" || d === "assistant" && i, m = a ? Hn : void 0;
2216
- let p;
2217
- e[2] !== l || e[3] !== n || e[4] !== o ? (p = /* @__PURE__ */ c(ls, { message: n, streaming: o, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = o, e[5] = p) : p = e[5];
2126
+ e[0] !== n.role ? (u = fi(n.role), e[0] = n.role, e[1] = u) : u = e[1];
2127
+ const d = u, f = d === "user" || d === "assistant" && i, p = a ? fn : void 0;
2128
+ let m;
2129
+ e[2] !== l || e[3] !== n || e[4] !== s ? (m = /* @__PURE__ */ c(Mn, { message: n, streaming: s, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = s, e[5] = m) : m = e[5];
2218
2130
  let h;
2219
- e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(Yt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2131
+ e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(xt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2220
2132
  let g;
2221
- e[10] !== d || e[11] !== p || e[12] !== h ? (g = /* @__PURE__ */ C(ze.Content, { from: d, children: [
2222
- p,
2133
+ e[10] !== d || e[11] !== m || e[12] !== h ? (g = /* @__PURE__ */ k(ge.Content, { from: d, children: [
2134
+ m,
2223
2135
  h
2224
- ] }), e[10] = d, e[11] = p, e[12] = h, e[13] = g) : g = e[13];
2136
+ ] }), e[10] = d, e[11] = m, e[12] = h, e[13] = g) : g = e[13];
2225
2137
  let b;
2226
- return e[14] !== d || e[15] !== m || e[16] !== g ? (b = /* @__PURE__ */ c(ze.Root, { from: d, ...m, children: g }), e[14] = d, e[15] = m, e[16] = g, e[17] = b) : b = e[17], b;
2227
- }, tl = (t) => {
2138
+ return e[14] !== d || e[15] !== p || e[16] !== g ? (b = /* @__PURE__ */ c(ge.Root, { from: d, ...p, children: g }), e[14] = d, e[15] = p, e[16] = g, e[17] = b) : b = e[17], b;
2139
+ }, Si = (t) => {
2228
2140
  const e = A(7), {
2229
2141
  label: n,
2230
- onClick: o,
2231
- actionPanel: s
2232
- } = t, r = s ? "space-between" : "flex-end";
2142
+ onClick: s,
2143
+ actionPanel: o
2144
+ } = t, r = o ? "space-between" : "flex-end";
2233
2145
  let i;
2234
- e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ c(ft, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
2146
+ e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ c(Oe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
2235
2147
  let l;
2236
- return e[3] !== s || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ C(Qe, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2237
- s,
2148
+ return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(be, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2149
+ o,
2238
2150
  i
2239
- ] }), e[3] = s, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2240
- }, nl = 360, sl = 4, ol = "min(10vh, 4rem)", ds = "min(70dvh, calc(100dvh - 12rem), 22rem)", Kt = 1, rl = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2151
+ ] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2152
+ }, wi = 360, Ti = 4, Ai = "min(10vh, 4rem)", Bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", gt = 1, ki = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2241
2153
  lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
2242
2154
  textLength: e.textLength + n.text.length
2243
2155
  }, {
2244
2156
  lineCount: 0,
2245
2157
  textLength: 0
2246
- }), il = (t) => {
2158
+ }), Ci = (t) => {
2247
2159
  if (t.role !== "user") return !1;
2248
2160
  const {
2249
2161
  lineCount: e,
2250
2162
  textLength: n
2251
- } = rl(t);
2252
- return n > nl || e > sl;
2253
- }, ll = (t, e) => {
2163
+ } = ki(t);
2164
+ return n > wi || e > Ti;
2165
+ }, Ii = (t, e) => {
2254
2166
  const n = Math.max(0, t.scrollHeight - t.clientHeight);
2255
- return e === 0 || n <= Kt ? !1 : e < 0 ? t.scrollTop > Kt : t.scrollTop < n - Kt;
2256
- }, fs = 720, al = 1, cl = 3, ul = 20, kn = 1, dl = 4, ps = 8, fl = (t, e) => {
2257
- const n = cs(t);
2258
- return [...t.map((o) => ({
2167
+ return e === 0 || n <= gt ? !1 : e < 0 ? t.scrollTop > gt : t.scrollTop < n - gt;
2168
+ }, Fn = 720, _i = 1, Ri = 3, vi = 20, jt = 1, Mi = 4, Ln = 8, Pi = (t, e) => {
2169
+ const n = En(t);
2170
+ return [...t.map((s) => ({
2259
2171
  type: "leading-response",
2260
- key: o.id,
2261
- message: o,
2262
- showAssistantActions: o.id === n
2263
- })), ...e.map((o, s) => ({
2172
+ key: s.id,
2173
+ message: s,
2174
+ showAssistantActions: s.id === n
2175
+ })), ...e.map((s, o) => ({
2264
2176
  type: "group",
2265
- key: o.userMessage.id,
2266
- group: o,
2267
- groupIndex: s
2177
+ key: s.userMessage.id,
2178
+ group: s,
2179
+ groupIndex: o
2268
2180
  }))];
2269
- }, pl = (t, e) => {
2181
+ }, Ei = (t, e) => {
2270
2182
  if (t === 0) return 0;
2271
- const n = t * fs + (t - 1) * ps;
2183
+ const n = t * Fn + (t - 1) * Ln;
2272
2184
  return Math.max(n - e, 0);
2273
- }, ml = (t) => t?.clientHeight || al, hl = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= kn && Math.abs(t.totalSize - e.totalSize) <= kn, gl = (t, e) => ({
2185
+ }, Di = (t) => t?.clientHeight || _i, Bi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= jt && Math.abs(t.totalSize - e.totalSize) <= jt, Fi = (t, e) => ({
2274
2186
  scrollTop: t?.scrollTop ?? 0,
2275
2187
  totalSize: e
2276
- }), bl = (t) => {
2188
+ }), Li = (t) => {
2277
2189
  const e = A(8), {
2278
2190
  itemCount: n,
2279
- onReady: o,
2280
- scrollRef: s,
2191
+ onReady: s,
2192
+ scrollRef: o,
2281
2193
  totalSize: r
2282
- } = t, i = Te(o);
2194
+ } = t, i = ie(s);
2283
2195
  let l, a;
2284
- e[0] !== o ? (l = () => {
2285
- i.current = o;
2286
- }, a = [o], e[0] = o, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), ae(l, a);
2196
+ e[0] !== s ? (l = () => {
2197
+ i.current = s;
2198
+ }, a = [s], e[0] = s, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), J(l, a);
2287
2199
  let u, d;
2288
- e[3] !== n || e[4] !== s || e[5] !== r ? (u = () => {
2200
+ e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
2289
2201
  if (n === 0 || typeof requestAnimationFrame > "u") {
2290
2202
  i.current?.();
2291
2203
  return;
2292
2204
  }
2293
- let f = 0, m = 0, p = 0, h = null;
2205
+ let f = 0, p = 0, m = 0, h = null;
2294
2206
  const g = () => {
2295
- m = m + 1;
2296
- const b = gl(s.current, r);
2297
- if (p = h && hl(b, h) ? p + 1 : 0, h = b, p >= cl || m >= ul) {
2207
+ p = p + 1;
2208
+ const b = Fi(o.current, r);
2209
+ if (m = h && Bi(b, h) ? m + 1 : 0, h = b, m >= Ri || p >= vi) {
2298
2210
  i.current?.();
2299
2211
  return;
2300
2212
  }
2301
2213
  f = requestAnimationFrame(g);
2302
2214
  };
2303
2215
  return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
2304
- }, d = [n, s, r], e[3] = n, e[4] = s, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), ae(u, d);
2305
- }, yl = (t) => {
2306
- ll(t.currentTarget, t.deltaY) && t.stopPropagation();
2307
- }, xl = (t, e) => {
2216
+ }, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), J(u, d);
2217
+ }, $i = (t) => {
2218
+ Ii(t.currentTarget, t.deltaY) && t.stopPropagation();
2219
+ }, Oi = (t, e) => {
2308
2220
  if (t)
2309
- return e ? ds : ol;
2310
- }, Sl = (t) => {
2221
+ return e ? Bn : Ai;
2222
+ }, zi = (t) => {
2311
2223
  if (t)
2312
- return ds;
2313
- }, wl = (t) => {
2224
+ return Bn;
2225
+ }, Qi = (t) => {
2314
2226
  const e = A(50), {
2315
2227
  group: n,
2316
- streaming: o,
2317
- hideQuestionForms: s,
2228
+ streaming: s,
2229
+ hideQuestionForms: o,
2318
2230
  isExpanded: r,
2319
2231
  animate: i,
2320
2232
  onToggleStickyMessage: l
2321
2233
  } = t;
2322
2234
  let a, u, d;
2323
- e[0] !== n.userMessage || e[1] !== r ? (a = il(n.userMessage), u = a && r, d = xl(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = u, e[4] = d) : (a = e[2], u = e[3], d = e[4]);
2235
+ e[0] !== n.userMessage || e[1] !== r ? (a = Ci(n.userMessage), u = a && r, d = Oi(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = u, e[4] = d) : (a = e[2], u = e[3], d = e[4]);
2324
2236
  const f = d;
2325
- let m;
2326
- e[5] !== n.userMessage.id || e[6] !== l ? (m = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = m) : m = e[7];
2327
- const p = m;
2237
+ let p;
2238
+ e[5] !== n.userMessage.id || e[6] !== l ? (p = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = p) : p = e[7];
2239
+ const m = p;
2328
2240
  let h;
2329
- e[8] !== n.responses ? (h = cs(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2330
- const g = h, b = i ? Hn : void 0, y = a ? "0" : void 0, w = a ? "relative" : void 0, x = a ? r ? "expanded" : "collapsed" : void 0;
2241
+ e[8] !== n.responses ? (h = En(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2242
+ const g = h, b = i ? fn : void 0, x = a ? "0" : void 0, y = a ? "relative" : void 0, T = a ? r ? "expanded" : "collapsed" : void 0;
2331
2243
  let S;
2332
- e[10] !== u ? (S = Sl(u), e[10] = u, e[11] = S) : S = e[11];
2333
- const T = u ? "auto" : "visible", k = a ? "xs" : void 0, I = a ? "xs" : void 0, v = u ? "3rem" : void 0, L = u ? yl : void 0;
2334
- let D;
2335
- e[12] !== n.userMessage || e[13] !== o ? (D = /* @__PURE__ */ c(ls, { message: n.userMessage, streaming: o }), e[12] = n.userMessage, e[13] = o, e[14] = D) : D = e[14];
2336
- let $;
2337
- e[15] !== I || e[16] !== v || e[17] !== L || e[18] !== D || e[19] !== x || e[20] !== S || e[21] !== T || e[22] !== k ? ($ = /* @__PURE__ */ c(B, { "data-sticky-user-message-content": x, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: T, px: k, py: I, pb: v, onWheel: L, children: D }), e[15] = I, e[16] = v, e[17] = L, e[18] = D, e[19] = x, e[20] = S, e[21] = T, e[22] = k, e[23] = $) : $ = e[23];
2244
+ e[10] !== u ? (S = zi(u), e[10] = u, e[11] = S) : S = e[11];
2245
+ const w = u ? "auto" : "visible", C = a ? "xs" : void 0, _ = a ? "xs" : void 0, R = u ? "3rem" : void 0, L = u ? $i : void 0;
2338
2246
  let E;
2339
- e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== p ? (E = a ? /* @__PURE__ */ c(tl, { label: r ? "Show less" : "Show more", onClick: p, actionPanel: /* @__PURE__ */ c(Yt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ c(Yt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = p, e[28] = E) : E = e[28];
2247
+ e[12] !== n.userMessage || e[13] !== s ? (E = /* @__PURE__ */ c(Mn, { message: n.userMessage, streaming: s }), e[12] = n.userMessage, e[13] = s, e[14] = E) : E = e[14];
2248
+ let Q;
2249
+ e[15] !== _ || e[16] !== R || e[17] !== L || e[18] !== E || e[19] !== T || e[20] !== S || e[21] !== w || e[22] !== C ? (Q = /* @__PURE__ */ c(P, { "data-sticky-user-message-content": T, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: w, px: C, py: _, pb: R, onWheel: L, children: E }), e[15] = _, e[16] = R, e[17] = L, e[18] = E, e[19] = T, e[20] = S, e[21] = w, e[22] = C, e[23] = Q) : Q = e[23];
2340
2250
  let M;
2341
- e[29] !== f || e[30] !== $ || e[31] !== E || e[32] !== y || e[33] !== w ? (M = /* @__PURE__ */ C(ze.Content, { from: "user", maxH: f, overflow: "hidden", p: y, position: w, children: [
2342
- $,
2343
- E
2344
- ] }), e[29] = f, e[30] = $, e[31] = E, e[32] = y, e[33] = w, e[34] = M) : M = e[34];
2345
- let P;
2346
- e[35] !== M || e[36] !== b ? (P = /* @__PURE__ */ c(B, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ c(ze.Root, { from: "user", ...b, children: M }) }), e[35] = M, e[36] = b, e[37] = P) : P = e[37];
2347
- let F;
2348
- if (e[38] !== g || e[39] !== n.responses || e[40] !== s || e[41] !== o) {
2349
- let O;
2350
- e[43] !== g || e[44] !== s || e[45] !== o ? (O = (z) => /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(us, { message: z, streaming: o, hideQuestionForms: s, showAssistantActions: z.id === g }) }, z.id), e[43] = g, e[44] = s, e[45] = o, e[46] = O) : O = e[46], F = n.responses.map(O), e[38] = g, e[39] = n.responses, e[40] = s, e[41] = o, e[42] = F;
2251
+ e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== m ? (M = a ? /* @__PURE__ */ c(Si, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = m, e[28] = M) : M = e[28];
2252
+ let D;
2253
+ e[29] !== f || e[30] !== Q || e[31] !== M || e[32] !== x || e[33] !== y ? (D = /* @__PURE__ */ k(ge.Content, { from: "user", maxH: f, overflow: "hidden", p: x, position: y, children: [
2254
+ Q,
2255
+ M
2256
+ ] }), e[29] = f, e[30] = Q, e[31] = M, e[32] = x, e[33] = y, e[34] = D) : D = e[34];
2257
+ let B;
2258
+ e[35] !== D || e[36] !== b ? (B = /* @__PURE__ */ c(P, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ c(ge.Root, { from: "user", ...b, children: D }) }), e[35] = D, e[36] = b, e[37] = B) : B = e[37];
2259
+ let $;
2260
+ if (e[38] !== g || e[39] !== n.responses || e[40] !== o || e[41] !== s) {
2261
+ let F;
2262
+ e[43] !== g || e[44] !== o || e[45] !== s ? (F = (z) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Dn, { message: z, streaming: s, hideQuestionForms: o, showAssistantActions: z.id === g }) }, z.id), e[43] = g, e[44] = o, e[45] = s, e[46] = F) : F = e[46], $ = n.responses.map(F), e[38] = g, e[39] = n.responses, e[40] = o, e[41] = s, e[42] = $;
2351
2263
  } else
2352
- F = e[42];
2353
- let Q;
2354
- return e[47] !== P || e[48] !== F ? (Q = /* @__PURE__ */ C(B, { children: [
2355
- P,
2356
- F
2357
- ] }), e[47] = P, e[48] = F, e[49] = Q) : Q = e[49], Q;
2358
- }, Tl = (t, e) => {
2264
+ $ = e[42];
2265
+ let O;
2266
+ return e[47] !== B || e[48] !== $ ? (O = /* @__PURE__ */ k(P, { children: [
2267
+ B,
2268
+ $
2269
+ ] }), e[47] = B, e[48] = $, e[49] = O) : O = e[49], O;
2270
+ }, qi = (t, e) => {
2359
2271
  const {
2360
2272
  groups: n,
2361
- streaming: o,
2362
- hideActiveQuestionForms: s,
2273
+ streaming: s,
2274
+ hideActiveQuestionForms: o,
2363
2275
  expandedStickyMessageIds: r,
2364
2276
  animatedItemKeys: i,
2365
2277
  onToggleStickyMessage: l
2366
2278
  } = e;
2367
- return t.type === "leading-response" ? /* @__PURE__ */ c(us, { message: t.message, streaming: o, hideQuestionForms: n.length > 0 || s, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ c(wl, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2368
- }, Al = (t) => {
2279
+ return t.type === "leading-response" ? /* @__PURE__ */ c(Dn, { message: t.message, streaming: s, hideQuestionForms: n.length > 0 || o, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ c(Qi, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2280
+ }, Wi = (t) => {
2369
2281
  const {
2370
2282
  leadingResponses: e,
2371
2283
  groups: n,
2372
- streaming: o,
2373
- hideActiveQuestionForms: s,
2284
+ streaming: s,
2285
+ hideActiveQuestionForms: o,
2374
2286
  expandedStickyMessageIds: r,
2375
2287
  onToggleStickyMessage: i,
2376
2288
  onReady: l
2377
2289
  } = t, {
2378
2290
  scrollRef: a
2379
- } = It(), u = fl(e, n), d = or(u.map((h) => h.key)), f = ml(a.current), m = no({
2291
+ } = Ge(), u = Pi(e, n), d = Ao(u.map((h) => h.key)), f = Di(a.current), p = ks({
2380
2292
  count: u.length,
2381
2293
  getScrollElement: () => a.current,
2382
- estimateSize: () => fs,
2294
+ estimateSize: () => Fn,
2383
2295
  getItemKey: (h) => u[h]?.key ?? h,
2384
- overscan: dl,
2385
- gap: ps,
2296
+ overscan: Mi,
2297
+ gap: Ln,
2386
2298
  initialRect: {
2387
2299
  width: 0,
2388
2300
  height: f
2389
2301
  },
2390
- initialOffset: () => pl(u.length, f)
2391
- }), p = m.getTotalSize();
2392
- return bl({
2302
+ initialOffset: () => Ei(u.length, f)
2303
+ }), m = p.getTotalSize();
2304
+ return Li({
2393
2305
  itemCount: u.length,
2394
2306
  onReady: l,
2395
2307
  scrollRef: a,
2396
- totalSize: p
2397
- }), /* @__PURE__ */ c(B, { px: "xs", children: /* @__PURE__ */ c(B, { position: "relative", width: "100%", style: {
2398
- height: p
2399
- }, children: m.getVirtualItems().map((h) => {
2308
+ totalSize: m
2309
+ }), /* @__PURE__ */ c(P, { px: "xs", children: /* @__PURE__ */ c(P, { position: "relative", width: "100%", style: {
2310
+ height: m
2311
+ }, children: p.getVirtualItems().map((h) => {
2400
2312
  const g = u[h.index];
2401
- return g ? /* @__PURE__ */ c(B, { ref: m.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2313
+ return g ? /* @__PURE__ */ c(P, { ref: p.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2402
2314
  top: h.start
2403
- }, children: Tl(g, {
2315
+ }, children: qi(g, {
2404
2316
  groups: n,
2405
- streaming: o,
2406
- hideActiveQuestionForms: s,
2317
+ streaming: s,
2318
+ hideActiveQuestionForms: o,
2407
2319
  expandedStickyMessageIds: r,
2408
2320
  animatedItemKeys: d,
2409
2321
  onToggleStickyMessage: i
2410
2322
  }) }, h.key) : null;
2411
2323
  }) }) });
2412
- }, Cl = (t) => {
2324
+ }, Hi = (t) => {
2413
2325
  const e = A(48), {
2414
2326
  item: n,
2415
- index: o,
2416
- isFirst: s,
2327
+ index: s,
2328
+ isFirst: o,
2417
2329
  isLast: r,
2418
2330
  isEditing: i,
2419
2331
  isDragTarget: l,
@@ -2421,166 +2333,166 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
2421
2333
  onRemove: u,
2422
2334
  onDragStart: d,
2423
2335
  onDragEnd: f,
2424
- onDragOver: m,
2425
- onDrop: p
2426
- } = t, h = !!a, g = !!u, b = !s || !r, y = `Drag queued follow-up ${o + 1}`, w = s ? "0" : "1px", x = l ? "border.accent-light" : "border.subtle", S = s ? "0" : "2xs", T = i ? "bg.muted" : void 0;
2427
- let k;
2428
- e[0] !== n.id || e[1] !== m ? (k = (H) => m(H, n.id), e[0] = n.id, e[1] = m, e[2] = k) : k = e[2];
2429
- let I;
2430
- e[3] !== n.id || e[4] !== p ? (I = (H) => p(H, n.id), e[3] = n.id, e[4] = p, e[5] = I) : I = e[5];
2431
- const v = b ? "grab" : "default", L = !b;
2432
- let D;
2433
- e[6] !== n.id || e[7] !== d ? (D = (H) => {
2434
- H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
2435
- }, e[6] = n.id, e[7] = d, e[8] = D) : D = e[8];
2436
- let $;
2437
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ c(Ht, { as: Us, boxSize: "14px" }), e[9] = $) : $ = e[9];
2336
+ onDragOver: p,
2337
+ onDrop: m
2338
+ } = t, h = !!a, g = !!u, b = !o || !r, x = `Drag queued follow-up ${s + 1}`, y = o ? "0" : "1px", T = l ? "border.accent-light" : "border.subtle", S = o ? "0" : "2xs", w = i ? "bg.muted" : void 0;
2339
+ let C;
2340
+ e[0] !== n.id || e[1] !== p ? (C = (H) => p(H, n.id), e[0] = n.id, e[1] = p, e[2] = C) : C = e[2];
2341
+ let _;
2342
+ e[3] !== n.id || e[4] !== m ? (_ = (H) => m(H, n.id), e[3] = n.id, e[4] = m, e[5] = _) : _ = e[5];
2343
+ const R = b ? "grab" : "default", L = !b;
2438
2344
  let E;
2439
- e[10] !== b || e[11] !== y || e[12] !== f || e[13] !== v || e[14] !== L || e[15] !== D ? (E = /* @__PURE__ */ c(ot, { size: "2xs", variant: "ghost", draggable: b, "aria-label": y, title: y, color: "fg.muted", cursor: v, disabled: L, onDragStart: D, onDragEnd: f, children: $ }), e[10] = b, e[11] = y, e[12] = f, e[13] = v, e[14] = L, e[15] = D, e[16] = E) : E = e[16];
2345
+ e[6] !== n.id || e[7] !== d ? (E = (H) => {
2346
+ H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
2347
+ }, e[6] = n.id, e[7] = d, e[8] = E) : E = e[8];
2348
+ let Q;
2349
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ c(dt, { as: ms, boxSize: "14px" }), e[9] = Q) : Q = e[9];
2440
2350
  let M;
2441
- e[17] !== n.prompt ? (M = /* @__PURE__ */ c(j, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = M) : M = e[18];
2442
- let P;
2443
- e[19] !== n.attachments ? (P = n.attachments?.length ? /* @__PURE__ */ C(Cs, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2351
+ e[10] !== b || e[11] !== x || e[12] !== f || e[13] !== R || e[14] !== L || e[15] !== E ? (M = /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": x, title: x, color: "fg.muted", cursor: R, disabled: L, onDragStart: E, onDragEnd: f, children: Q }), e[10] = b, e[11] = x, e[12] = f, e[13] = R, e[14] = L, e[15] = E, e[16] = M) : M = e[16];
2352
+ let D;
2353
+ e[17] !== n.prompt ? (D = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = D) : D = e[18];
2354
+ let B;
2355
+ e[19] !== n.attachments ? (B = n.attachments?.length ? /* @__PURE__ */ k(Un, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2444
2356
  n.attachments.length,
2445
2357
  " attachments"
2446
- ] }) : null, e[19] = n.attachments, e[20] = P) : P = e[20];
2447
- let F;
2448
- e[21] !== M || e[22] !== P ? (F = /* @__PURE__ */ C(G, { gap: "2xs", flex: "1", minWidth: "0", children: [
2449
- M,
2450
- P
2451
- ] }), e[21] = M, e[22] = P, e[23] = F) : F = e[23];
2452
- let Q;
2453
- e[24] !== h || e[25] !== n || e[26] !== a ? (Q = h ? /* @__PURE__ */ c(ot, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(Ht, { as: js, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = Q) : Q = e[27];
2358
+ ] }) : null, e[19] = n.attachments, e[20] = B) : B = e[20];
2359
+ let $;
2360
+ e[21] !== D || e[22] !== B ? ($ = /* @__PURE__ */ k(j, { gap: "2xs", flex: "1", minWidth: "0", children: [
2361
+ D,
2362
+ B
2363
+ ] }), e[21] = D, e[22] = B, e[23] = $) : $ = e[23];
2454
2364
  let O;
2455
- e[28] !== g || e[29] !== n.id || e[30] !== u ? (O = g ? /* @__PURE__ */ c(ot, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => u?.(n.id), children: /* @__PURE__ */ c(Ht, { as: En, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = u, e[31] = O) : O = e[31];
2365
+ e[24] !== h || e[25] !== n || e[26] !== a ? (O = h ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(dt, { as: hs, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = O) : O = e[27];
2366
+ let F;
2367
+ e[28] !== g || e[29] !== n.id || e[30] !== u ? (F = g ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => u?.(n.id), children: /* @__PURE__ */ c(dt, { as: tn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = u, e[31] = F) : F = e[31];
2456
2368
  let z;
2457
- e[32] !== Q || e[33] !== O ? (z = /* @__PURE__ */ C(ce, { gap: "2xs", flexShrink: 0, children: [
2458
- Q,
2459
- O
2460
- ] }), e[32] = Q, e[33] = O, e[34] = z) : z = e[34];
2461
- let R;
2462
- e[35] !== E || e[36] !== F || e[37] !== z ? (R = /* @__PURE__ */ C(ce, { gap: "xs", alignItems: "flex-start", children: [
2463
- E,
2464
- F,
2369
+ e[32] !== O || e[33] !== F ? (z = /* @__PURE__ */ k(Z, { gap: "2xs", flexShrink: 0, children: [
2370
+ O,
2371
+ F
2372
+ ] }), e[32] = O, e[33] = F, e[34] = z) : z = e[34];
2373
+ let v;
2374
+ e[35] !== M || e[36] !== $ || e[37] !== z ? (v = /* @__PURE__ */ k(Z, { gap: "xs", alignItems: "flex-start", children: [
2375
+ M,
2376
+ $,
2465
2377
  z
2466
- ] }), e[35] = E, e[36] = F, e[37] = z, e[38] = R) : R = e[38];
2378
+ ] }), e[35] = M, e[36] = $, e[37] = z, e[38] = v) : v = e[38];
2467
2379
  let W;
2468
- return e[39] !== n.id || e[40] !== w || e[41] !== x || e[42] !== R || e[43] !== S || e[44] !== T || e[45] !== k || e[46] !== I ? (W = /* @__PURE__ */ c(B, { minWidth: "0", borderTopWidth: w, borderColor: x, paddingTop: S, paddingBottom: "2xs", bg: T, onDragOver: k, onDrop: I, "data-queued-follow-up-id": n.id, children: R }), e[39] = n.id, e[40] = w, e[41] = x, e[42] = R, e[43] = S, e[44] = T, e[45] = k, e[46] = I, e[47] = W) : W = e[47], W;
2469
- }, kl = (t) => {
2380
+ return e[39] !== n.id || e[40] !== y || e[41] !== T || e[42] !== v || e[43] !== S || e[44] !== w || e[45] !== C || e[46] !== _ ? (W = /* @__PURE__ */ c(P, { minWidth: "0", borderTopWidth: y, borderColor: T, paddingTop: S, paddingBottom: "2xs", bg: w, onDragOver: C, onDrop: _, "data-queued-follow-up-id": n.id, children: v }), e[39] = n.id, e[40] = y, e[41] = T, e[42] = v, e[43] = S, e[44] = w, e[45] = C, e[46] = _, e[47] = W) : W = e[47], W;
2381
+ }, Vi = (t) => {
2470
2382
  const e = A(24), {
2471
2383
  items: n,
2472
- editingItemId: o,
2473
- onEdit: s,
2384
+ editingItemId: s,
2385
+ onEdit: o,
2474
2386
  onRemove: r,
2475
2387
  onMove: i
2476
2388
  } = t, [l, a] = V(null), [u, d] = V(null);
2477
2389
  if (n.length === 0)
2478
2390
  return null;
2479
2391
  let f;
2480
- e[0] !== l ? (f = (y, w) => {
2481
- !l || l === w || (y.preventDefault(), y.dataTransfer.dropEffect = "move", d(w));
2392
+ e[0] !== l ? (f = (x, y) => {
2393
+ !l || l === y || (x.preventDefault(), x.dataTransfer.dropEffect = "move", d(y));
2482
2394
  }, e[0] = l, e[1] = f) : f = e[1];
2483
- const m = f;
2484
- let p;
2485
- e[2] !== l || e[3] !== n || e[4] !== i ? (p = (y, w) => {
2486
- y.preventDefault();
2487
- const x = l ?? y.dataTransfer.getData("text/plain");
2488
- if (a(null), d(null), !x || x === w)
2395
+ const p = f;
2396
+ let m;
2397
+ e[2] !== l || e[3] !== n || e[4] !== i ? (m = (x, y) => {
2398
+ x.preventDefault();
2399
+ const T = l ?? x.dataTransfer.getData("text/plain");
2400
+ if (a(null), d(null), !T || T === y)
2489
2401
  return;
2490
- const S = n.findIndex((I) => I.id === x), T = n.findIndex((I) => I.id === w);
2491
- if (S === -1 || T === -1 || S === T)
2402
+ const S = n.findIndex((_) => _.id === T), w = n.findIndex((_) => _.id === y);
2403
+ if (S === -1 || w === -1 || S === w)
2492
2404
  return;
2493
- const k = T < S ? "up" : "down";
2494
- i?.(x, k, Math.abs(T - S));
2495
- }, e[2] = l, e[3] = n, e[4] = i, e[5] = p) : p = e[5];
2496
- const h = p;
2405
+ const C = w < S ? "up" : "down";
2406
+ i?.(T, C, Math.abs(w - S));
2407
+ }, e[2] = l, e[3] = n, e[4] = i, e[5] = m) : m = e[5];
2408
+ const h = m;
2497
2409
  let g;
2498
- if (e[6] !== u || e[7] !== o || e[8] !== m || e[9] !== h || e[10] !== n || e[11] !== s || e[12] !== r) {
2499
- let y;
2500
- e[14] !== u || e[15] !== o || e[16] !== m || e[17] !== h || e[18] !== n.length || e[19] !== s || e[20] !== r ? (y = (w, x) => /* @__PURE__ */ c(Cl, { item: w, index: x, isFirst: x === 0, isLast: x === n.length - 1, isEditing: o === w.id, isDragTarget: u === w.id, onEdit: s, onRemove: r, onDragStart: a, onDragEnd: () => {
2410
+ if (e[6] !== u || e[7] !== s || e[8] !== p || e[9] !== h || e[10] !== n || e[11] !== o || e[12] !== r) {
2411
+ let x;
2412
+ e[14] !== u || e[15] !== s || e[16] !== p || e[17] !== h || e[18] !== n.length || e[19] !== o || e[20] !== r ? (x = (y, T) => /* @__PURE__ */ c(Hi, { item: y, index: T, isFirst: T === 0, isLast: T === n.length - 1, isEditing: s === y.id, isDragTarget: u === y.id, onEdit: o, onRemove: r, onDragStart: a, onDragEnd: () => {
2501
2413
  a(null), d(null);
2502
- }, onDragOver: m, onDrop: h }, w.id), e[14] = u, e[15] = o, e[16] = m, e[17] = h, e[18] = n.length, e[19] = s, e[20] = r, e[21] = y) : y = e[21], g = n.map(y), e[6] = u, e[7] = o, e[8] = m, e[9] = h, e[10] = n, e[11] = s, e[12] = r, e[13] = g;
2414
+ }, onDragOver: p, onDrop: h }, y.id), e[14] = u, e[15] = s, e[16] = p, e[17] = h, e[18] = n.length, e[19] = o, e[20] = r, e[21] = x) : x = e[21], g = n.map(x), e[6] = u, e[7] = s, e[8] = p, e[9] = h, e[10] = n, e[11] = o, e[12] = r, e[13] = g;
2503
2415
  } else
2504
2416
  g = e[13];
2505
2417
  let b;
2506
- return e[22] !== g ? (b = /* @__PURE__ */ c(G, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2507
- }, Il = (t) => {
2418
+ return e[22] !== g ? (b = /* @__PURE__ */ c(j, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2419
+ }, Ni = (t) => {
2508
2420
  const e = Math.max(0, Math.floor(t));
2509
2421
  if (e < 60) return `${e}s`;
2510
2422
  const n = Math.floor(e / 60);
2511
2423
  return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
2512
- }, _l = (t) => {
2424
+ }, Ui = (t) => {
2513
2425
  const e = A(9), {
2514
2426
  hidden: n
2515
- } = t, o = n === void 0 ? !1 : n, [s, r] = V(0);
2427
+ } = t, s = n === void 0 ? !1 : n, [o, r] = V(0);
2516
2428
  let i;
2517
2429
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
2518
- const l = Te(i);
2430
+ const l = ie(i);
2519
2431
  let a, u;
2520
- if (e[1] !== o ? (a = () => {
2521
- if (o)
2432
+ if (e[1] !== s ? (a = () => {
2433
+ if (s)
2522
2434
  return;
2523
- const p = () => r((Date.now() - l.current) / 1e3);
2524
- p();
2525
- const h = setInterval(p, 1e3);
2435
+ const m = () => r((Date.now() - l.current) / 1e3);
2436
+ m();
2437
+ const h = setInterval(m, 1e3);
2526
2438
  return () => clearInterval(h);
2527
- }, u = [o], e[1] = o, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), ae(a, u), o)
2439
+ }, u = [s], e[1] = s, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), J(a, u), s)
2528
2440
  return null;
2529
2441
  let d;
2530
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(nn, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2442
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2531
2443
  let f;
2532
- e[5] !== s ? (f = Il(s), e[5] = s, e[6] = f) : f = e[6];
2533
- let m;
2534
- return e[7] !== f ? (m = /* @__PURE__ */ C(ce, { gap: "2xs", px: "sm", py: "xs", children: [
2444
+ e[5] !== o ? (f = Ni(o), e[5] = o, e[6] = f) : f = e[6];
2445
+ let p;
2446
+ return e[7] !== f ? (p = /* @__PURE__ */ k(Z, { gap: "2xs", px: "sm", py: "xs", children: [
2535
2447
  d,
2536
- /* @__PURE__ */ c(j, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2537
- ] }), e[7] = f, e[8] = m) : m = e[8], m;
2538
- }, vl = (t) => {
2448
+ /* @__PURE__ */ c(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2449
+ ] }), e[7] = f, e[8] = p) : p = e[8], p;
2450
+ }, ji = (t) => {
2539
2451
  const e = A(19), {
2540
2452
  queuedFollowUps: n,
2541
- defaultValue: o,
2542
- onChange: s,
2453
+ defaultValue: s,
2454
+ onChange: o,
2543
2455
  onSubmit: r,
2544
2456
  onUpdate: i
2545
- } = t, [l, a] = V(null), [u, d] = V(""), [f, m] = V(0), p = l ? u : o;
2457
+ } = t, [l, a] = V(null), [u, d] = V(""), [f, p] = V(0), m = l ? u : s;
2546
2458
  let h, g;
2547
2459
  e[0] !== l || e[1] !== n ? (h = () => {
2548
- l && (n.some((v) => v.id === l) || (a(null), d("")));
2549
- }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), ae(h, g);
2460
+ l && (n.some((R) => R.id === l) || (a(null), d("")));
2461
+ }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), J(h, g);
2550
2462
  let b;
2551
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (v) => {
2552
- a(v.id), d(v.prompt), m(Ml);
2463
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (R) => {
2464
+ a(R.id), d(R.prompt), p(Xi);
2553
2465
  }, e[4] = b) : b = e[4];
2554
- const y = b;
2555
- let w;
2556
- e[5] !== l || e[6] !== s ? (w = (v) => {
2557
- l || s?.(v);
2558
- }, e[5] = l, e[6] = s, e[7] = w) : w = e[7];
2559
- const x = w;
2466
+ const x = b;
2467
+ let y;
2468
+ e[5] !== l || e[6] !== o ? (y = (R) => {
2469
+ l || o?.(R);
2470
+ }, e[5] = l, e[6] = o, e[7] = y) : y = e[7];
2471
+ const T = y;
2560
2472
  let S;
2561
- e[8] !== l || e[9] !== r || e[10] !== i ? (S = (v, L, D) => {
2473
+ e[8] !== l || e[9] !== r || e[10] !== i ? (S = (R, L, E) => {
2562
2474
  if (l) {
2563
- i?.(l, v), a(null), d("");
2475
+ i?.(l, R), a(null), d("");
2564
2476
  return;
2565
2477
  }
2566
- r?.(v, L, D);
2478
+ return r?.(R, L, E);
2567
2479
  }, e[8] = l, e[9] = r, e[10] = i, e[11] = S) : S = e[11];
2568
- const T = S, k = !!l;
2569
- let I;
2570
- return e[12] !== x || e[13] !== l || e[14] !== f || e[15] !== p || e[16] !== T || e[17] !== k ? (I = {
2571
- change: x,
2572
- edit: y,
2480
+ const w = S, C = !!l;
2481
+ let _;
2482
+ return e[12] !== T || e[13] !== l || e[14] !== f || e[15] !== m || e[16] !== w || e[17] !== C ? (_ = {
2483
+ change: T,
2484
+ edit: x,
2573
2485
  editingItemId: l,
2574
2486
  focusSignal: f,
2575
- inputValue: p,
2576
- isEditing: k,
2577
- submit: T
2578
- }, e[12] = x, e[13] = l, e[14] = f, e[15] = p, e[16] = T, e[17] = k, e[18] = I) : I = e[18], I;
2579
- }, Rl = (t) => {
2487
+ inputValue: m,
2488
+ isEditing: C,
2489
+ submit: w
2490
+ }, e[12] = T, e[13] = l, e[14] = f, e[15] = m, e[16] = w, e[17] = C, e[18] = _) : _ = e[18], _;
2491
+ }, Ki = (t) => {
2580
2492
  const e = A(44), {
2581
2493
  actions: n,
2582
- attachedResources: o,
2583
- attachmentList: s,
2494
+ attachedResources: s,
2495
+ attachmentList: o,
2584
2496
  chatInputAutoFocus: r,
2585
2497
  chatInputPlaceholder: i,
2586
2498
  chatInputQuestionPrompt: l,
@@ -2588,39 +2500,39 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
2588
2500
  hasWorkspaceHub: u,
2589
2501
  inputDisabled: d,
2590
2502
  submitDisabled: f,
2591
- onAttachFiles: m,
2592
- onAttachText: p,
2503
+ onAttachFiles: p,
2504
+ onAttachText: m,
2593
2505
  onChatInputAddReference: h,
2594
2506
  onClearAttachments: g,
2595
2507
  onInterrupt: b,
2596
- onQueuedFollowUpMove: y,
2597
- onQueuedFollowUpRemove: w,
2598
- onQueuedFollowUpUpdate: x,
2508
+ onQueuedFollowUpMove: x,
2509
+ onQueuedFollowUpRemove: y,
2510
+ onQueuedFollowUpUpdate: T,
2599
2511
  queuedComposer: S,
2600
- queuedFollowUps: T,
2601
- streaming: k,
2602
- workspaceHub: I
2603
- } = t, v = T.length > 0, L = u ? "2xs" : "xs", D = u ? "2xs" : "0", $ = u ? "2xs" : void 0, E = u ? "1px" : void 0, M = u ? "border" : void 0, P = u ? "sm" : void 0, F = u ? "bg.subtle" : void 0, Q = x ? S.edit : void 0;
2604
- let O;
2605
- e[0] !== y || e[1] !== w || e[2] !== S.editingItemId || e[3] !== T || e[4] !== Q ? (O = /* @__PURE__ */ c(kl, { items: T, editingItemId: S.editingItemId, onEdit: Q, onRemove: w, onMove: y }), e[0] = y, e[1] = w, e[2] = S.editingItemId, e[3] = T, e[4] = Q, e[5] = O) : O = e[5];
2512
+ queuedFollowUps: w,
2513
+ streaming: C,
2514
+ workspaceHub: _
2515
+ } = t, R = w.length > 0, L = u ? "2xs" : "xs", E = u ? "2xs" : "0", Q = u ? "2xs" : void 0, M = u ? "1px" : void 0, D = u ? "border" : void 0, B = u ? "sm" : void 0, $ = u ? "bg.subtle" : void 0, O = T ? S.edit : void 0;
2516
+ let F;
2517
+ e[0] !== x || e[1] !== y || e[2] !== S.editingItemId || e[3] !== w || e[4] !== O ? (F = /* @__PURE__ */ c(Vi, { items: w, editingItemId: S.editingItemId, onEdit: O, onRemove: y, onMove: x }), e[0] = x, e[1] = y, e[2] = S.editingItemId, e[3] = w, e[4] = O, e[5] = F) : F = e[5];
2606
2518
  let z;
2607
- e[6] !== S.inputValue ? (z = tr(S.inputValue), e[6] = S.inputValue, e[7] = z) : z = e[7];
2608
- const R = S.isEditing ? "Save queued follow-up" : void 0;
2519
+ e[6] !== S.inputValue ? (z = So(S.inputValue), e[6] = S.inputValue, e[7] = z) : z = e[7];
2520
+ const v = S.isEditing ? "Save queued follow-up" : void 0;
2609
2521
  let W;
2610
- e[8] !== n || e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== i || e[13] !== l || e[14] !== a || e[15] !== v || e[16] !== u || e[17] !== d || e[18] !== m || e[19] !== p || e[20] !== h || e[21] !== g || e[22] !== b || e[23] !== S.change || e[24] !== S.focusSignal || e[25] !== S.submit || e[26] !== k || e[27] !== f || e[28] !== R || e[29] !== z ? (W = /* @__PURE__ */ c(No, { placeholder: i, defaultState: z, streaming: k, onSubmit: S.submit, onInterrupt: b, onAttachFiles: m, onAttachText: p, onChange: S.change, actions: n, attachedResources: o, onClearAttachments: g, attachmentList: s, isDisabled: d, submitDisabled: f, attachedToTop: v, recessed: u, questionPrompt: l, autoFocus: r, focusSignal: S.focusSignal, submitTitle: R, references: a, onAddReference: h }), e[8] = n, e[9] = o, e[10] = s, e[11] = r, e[12] = i, e[13] = l, e[14] = a, e[15] = v, e[16] = u, e[17] = d, e[18] = m, e[19] = p, e[20] = h, e[21] = g, e[22] = b, e[23] = S.change, e[24] = S.focusSignal, e[25] = S.submit, e[26] = k, e[27] = f, e[28] = R, e[29] = z, e[30] = W) : W = e[30];
2522
+ e[8] !== n || e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== i || e[13] !== l || e[14] !== a || e[15] !== R || e[16] !== u || e[17] !== d || e[18] !== p || e[19] !== m || e[20] !== h || e[21] !== g || e[22] !== b || e[23] !== S.change || e[24] !== S.focusSignal || e[25] !== S.submit || e[26] !== C || e[27] !== f || e[28] !== v || e[29] !== z ? (W = /* @__PURE__ */ c(po, { placeholder: i, defaultState: z, streaming: C, onSubmit: S.submit, onInterrupt: b, onAttachFiles: p, onAttachText: m, onChange: S.change, actions: n, attachedResources: s, onClearAttachments: g, attachmentList: o, isDisabled: d, submitDisabled: f, attachedToTop: R, recessed: u, questionPrompt: l, autoFocus: r, focusSignal: S.focusSignal, submitTitle: v, references: a, onAddReference: h }), e[8] = n, e[9] = s, e[10] = o, e[11] = r, e[12] = i, e[13] = l, e[14] = a, e[15] = R, e[16] = u, e[17] = d, e[18] = p, e[19] = m, e[20] = h, e[21] = g, e[22] = b, e[23] = S.change, e[24] = S.focusSignal, e[25] = S.submit, e[26] = C, e[27] = f, e[28] = v, e[29] = z, e[30] = W) : W = e[30];
2611
2523
  let H;
2612
- e[31] !== D || e[32] !== W || e[33] !== $ || e[34] !== E || e[35] !== M || e[36] !== P || e[37] !== F || e[38] !== O || e[39] !== I ? (H = /* @__PURE__ */ C(G, { gap: D, p: $, borderWidth: E, borderColor: M, borderRadius: P, bg: F, children: [
2613
- I,
2614
- O,
2524
+ e[31] !== E || e[32] !== W || e[33] !== Q || e[34] !== M || e[35] !== D || e[36] !== B || e[37] !== $ || e[38] !== F || e[39] !== _ ? (H = /* @__PURE__ */ k(j, { gap: E, p: Q, borderWidth: M, borderColor: D, borderRadius: B, bg: $, children: [
2525
+ _,
2526
+ F,
2615
2527
  W
2616
- ] }), e[31] = D, e[32] = W, e[33] = $, e[34] = E, e[35] = M, e[36] = P, e[37] = F, e[38] = O, e[39] = I, e[40] = H) : H = e[40];
2617
- let ne;
2618
- return e[41] !== L || e[42] !== H ? (ne = /* @__PURE__ */ c(G, { px: L, gap: "0", children: H }), e[41] = L, e[42] = H, e[43] = ne) : ne = e[43], ne;
2619
- }, ea = (t) => {
2528
+ ] }), e[31] = E, e[32] = W, e[33] = Q, e[34] = M, e[35] = D, e[36] = B, e[37] = $, e[38] = F, e[39] = _, e[40] = H) : H = e[40];
2529
+ let K;
2530
+ return e[41] !== L || e[42] !== H ? (K = /* @__PURE__ */ c(j, { px: L, gap: "0", children: H }), e[41] = L, e[42] = H, e[43] = K) : K = e[43], K;
2531
+ }, Sl = (t) => {
2620
2532
  const e = A(78), {
2621
2533
  conversationKey: n,
2622
- messages: o,
2623
- loading: s,
2534
+ messages: s,
2535
+ loading: o,
2624
2536
  streaming: r,
2625
2537
  emptyStateTitle: i,
2626
2538
  emptyStateDescription: l,
@@ -2628,158 +2540,158 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
2628
2540
  loaderComponent: u,
2629
2541
  chatInputPlaceholder: d,
2630
2542
  chatInputDefaultValue: f,
2631
- onSubmitMessage: m,
2632
- onInterrupt: p,
2543
+ onSubmitMessage: p,
2544
+ onInterrupt: m,
2633
2545
  onAttachFiles: h,
2634
2546
  onAttachText: g,
2635
2547
  onChatInputChange: b,
2636
- actions: y,
2637
- attachedResources: w,
2638
- onClearAttachments: x,
2548
+ actions: x,
2549
+ attachedResources: y,
2550
+ onClearAttachments: T,
2639
2551
  attachmentList: S,
2640
- approvalPrompt: T,
2641
- workspaceHub: k,
2642
- workspaceInitializing: I,
2643
- inputDisabled: v,
2552
+ approvalPrompt: w,
2553
+ workspaceHub: C,
2554
+ workspaceInitializing: _,
2555
+ inputDisabled: R,
2644
2556
  submitDisabled: L,
2645
- chatInputQuestionPrompt: D,
2646
- chatInputAutoFocus: $,
2647
- queuedFollowUps: E,
2648
- onQueuedFollowUpUpdate: M,
2649
- onQueuedFollowUpRemove: P,
2650
- onQueuedFollowUpMove: F,
2651
- chatInputReferences: Q,
2652
- onChatInputAddReference: O
2653
- } = t, z = s === void 0 ? !1 : s, R = r === void 0 ? !1 : r, W = f === void 0 ? "" : f, H = I === void 0 ? !1 : I, ne = v === void 0 ? !1 : v, We = L === void 0 ? !1 : L, _e = $ === void 0 ? !1 : $;
2654
- let ve;
2655
- e[0] !== E ? (ve = E === void 0 ? [] : E, e[0] = E, e[1] = ve) : ve = e[1];
2656
- const de = ve;
2657
- let Re;
2658
- e[2] !== Q ? (Re = Q === void 0 ? [] : Q, e[2] = Q, e[3] = Re) : Re = e[3];
2659
- const Ue = Re;
2660
- let Y, ee, fe, pe, U;
2661
- if (e[4] !== n || e[5] !== o || e[6] !== R) {
2662
- const X = Zi(o, {
2663
- streaming: R
2557
+ chatInputQuestionPrompt: E,
2558
+ chatInputAutoFocus: Q,
2559
+ queuedFollowUps: M,
2560
+ onQueuedFollowUpUpdate: D,
2561
+ onQueuedFollowUpRemove: B,
2562
+ onQueuedFollowUpMove: $,
2563
+ chatInputReferences: O,
2564
+ onChatInputAddReference: F
2565
+ } = t, z = o === void 0 ? !1 : o, v = r === void 0 ? !1 : r, W = f === void 0 ? "" : f, H = _ === void 0 ? !1 : _, K = R === void 0 ? !1 : R, oe = L === void 0 ? !1 : L, xe = Q === void 0 ? !1 : Q;
2566
+ let Se;
2567
+ e[0] !== M ? (Se = M === void 0 ? [] : M, e[0] = M, e[1] = Se) : Se = e[1];
2568
+ const ee = Se;
2569
+ let Te;
2570
+ e[2] !== O ? (Te = O === void 0 ? [] : O, e[2] = O, e[3] = Te) : Te = e[3];
2571
+ const Be = Te;
2572
+ let X, G, de, te, fe;
2573
+ if (e[4] !== n || e[5] !== s || e[6] !== v) {
2574
+ const me = yi(s, {
2575
+ streaming: v
2664
2576
  });
2665
- Y = X.length > 0, fe = n ?? X[0]?.id, ee = Y ? fe ?? "active-conversation" : null, U = X.reduce(Pl, 0), pe = el(X), e[4] = n, e[5] = o, e[6] = R, e[7] = Y, e[8] = ee, e[9] = fe, e[10] = pe, e[11] = U;
2577
+ X = me.length > 0, de = n ?? me[0]?.id, G = X ? de ?? "active-conversation" : null, fe = me.reduce(Gi, 0), te = xi(me), e[4] = n, e[5] = s, e[6] = v, e[7] = X, e[8] = G, e[9] = de, e[10] = te, e[11] = fe;
2666
2578
  } else
2667
- Y = e[7], ee = e[8], fe = e[9], pe = e[10], U = e[11];
2579
+ X = e[7], G = e[8], de = e[9], te = e[10], fe = e[11];
2668
2580
  const {
2669
- groups: Me,
2670
- leadingResponses: Pe
2671
- } = pe, [J, je] = V(Dl), [He, lt] = V(null), Ke = !Y && z;
2581
+ groups: Fe,
2582
+ leadingResponses: Ae
2583
+ } = te, [we, nt] = V(Yi), [st, q] = V(null), ne = !X && z;
2584
+ let se;
2585
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ c(gs, { size: 48, strokeWidth: 1.5 }), e[12] = se) : se = e[12];
2586
+ let pe;
2587
+ e[13] !== l || e[14] !== i ? (pe = /* @__PURE__ */ c(As, { icon: se, title: i, description: l }), e[13] = l, e[14] = i, e[15] = pe) : pe = e[15];
2588
+ const ot = ne ? u : a ?? pe, rt = !!C;
2589
+ let We;
2590
+ e[16] !== E || e[17] !== s ? (We = E ?? xo(s), e[16] = E, e[17] = s, e[18] = We) : We = e[18];
2591
+ const Le = We, it = !!Le, lt = v && X && !H && !Le, He = !G || st === G;
2672
2592
  let Ve;
2673
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ve = /* @__PURE__ */ c(Ks, { size: 48, strokeWidth: 1.5 }), e[12] = Ve) : Ve = e[12];
2674
- let me;
2675
- e[13] !== l || e[14] !== i ? (me = /* @__PURE__ */ c(to, { icon: Ve, title: i, description: l }), e[13] = l, e[14] = i, e[15] = me) : me = e[15];
2676
- const De = Ke ? u : a ?? me, Ee = !!k;
2677
- let he;
2678
- e[16] !== D || e[17] !== o ? (he = D ?? er(o), e[16] = D, e[17] = o, e[18] = he) : he = e[18];
2679
- const se = he, Be = !!se, Fe = R && Y && !H && !se, ge = !ee || He === ee;
2680
- let be;
2681
- e[19] !== W || e[20] !== b || e[21] !== M || e[22] !== m || e[23] !== de ? (be = {
2682
- queuedFollowUps: de,
2593
+ e[19] !== W || e[20] !== b || e[21] !== D || e[22] !== p || e[23] !== ee ? (Ve = {
2594
+ queuedFollowUps: ee,
2683
2595
  defaultValue: W,
2684
2596
  onChange: b,
2685
- onSubmit: m,
2686
- onUpdate: M
2687
- }, e[19] = W, e[20] = b, e[21] = M, e[22] = m, e[23] = de, e[24] = be) : be = e[24];
2688
- const Le = vl(be);
2689
- let ye;
2690
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ye = (X) => {
2691
- je((Ge) => {
2692
- const $e = new Set(Ge);
2693
- return $e.has(X) ? $e.delete(X) : $e.add(X), $e;
2597
+ onSubmit: p,
2598
+ onUpdate: D
2599
+ }, e[19] = W, e[20] = b, e[21] = D, e[22] = p, e[23] = ee, e[24] = Ve) : Ve = e[24];
2600
+ const at = ji(Ve);
2601
+ let Ne;
2602
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ne = (me) => {
2603
+ nt((On) => {
2604
+ const je = new Set(On);
2605
+ return je.has(me) ? je.delete(me) : je.add(me), je;
2694
2606
  });
2695
- }, e[25] = ye) : ye = e[25];
2696
- const Xe = ye, ct = fe ?? null;
2697
- let oe;
2698
- e[26] !== ct || e[27] !== U ? (oe = /* @__PURE__ */ c(To, { conversationKey: ct, userMessageCount: U }), e[26] = ct, e[27] = U, e[28] = oe) : oe = e[28];
2699
- const Ne = ge ? "visible" : "hidden";
2700
- let Z;
2701
- e[29] !== De || e[30] !== J || e[31] !== Me || e[32] !== Y || e[33] !== Be || e[34] !== Pe || e[35] !== ee || e[36] !== R ? (Z = Y ? /* @__PURE__ */ c(Al, { leadingResponses: Pe, groups: Me, streaming: R, hideActiveQuestionForms: Be, expandedStickyMessageIds: J, onToggleStickyMessage: Xe, onReady: () => lt(ee) }, ee) : De, e[29] = De, e[30] = J, e[31] = Me, e[32] = Y, e[33] = Be, e[34] = Pe, e[35] = ee, e[36] = R, e[37] = Z) : Z = e[37];
2702
- let K;
2703
- e[38] !== Ne || e[39] !== Z ? (K = /* @__PURE__ */ c(Nt.Viewport, { visibility: Ne, children: Z }), e[38] = Ne, e[39] = Z, e[40] = K) : K = e[40];
2704
- let re;
2705
- e[41] !== ge ? (re = ge ? /* @__PURE__ */ c(Nt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = ge, e[42] = re) : re = e[42];
2706
- let te;
2707
- e[43] !== oe || e[44] !== K || e[45] !== re ? (te = /* @__PURE__ */ C(Nt.Root, { children: [
2708
- oe,
2709
- K,
2710
- re
2711
- ] }), e[43] = oe, e[44] = K, e[45] = re, e[46] = te) : te = e[46];
2712
- let ie;
2713
- e[47] !== Fe || e[48] !== R ? (ie = R ? /* @__PURE__ */ c(_l, { hidden: !Fe }) : null, e[47] = Fe, e[48] = R, e[49] = ie) : ie = e[49];
2714
- let ue;
2715
- e[50] !== y || e[51] !== se || e[52] !== w || e[53] !== S || e[54] !== _e || e[55] !== d || e[56] !== Ue || e[57] !== Ee || e[58] !== ne || e[59] !== h || e[60] !== g || e[61] !== O || e[62] !== x || e[63] !== p || e[64] !== F || e[65] !== P || e[66] !== M || e[67] !== Le || e[68] !== de || e[69] !== R || e[70] !== We || e[71] !== k ? (ue = /* @__PURE__ */ c(Rl, { actions: y, attachedResources: w, attachmentList: S, chatInputAutoFocus: _e, chatInputPlaceholder: d, chatInputQuestionPrompt: se, chatInputReferences: Ue, hasWorkspaceHub: Ee, inputDisabled: ne, submitDisabled: We, onAttachFiles: h, onAttachText: g, onChatInputAddReference: O, onClearAttachments: x, onInterrupt: p, onQueuedFollowUpMove: F, onQueuedFollowUpRemove: P, onQueuedFollowUpUpdate: M, queuedComposer: Le, queuedFollowUps: de, streaming: R, workspaceHub: k }), e[50] = y, e[51] = se, e[52] = w, e[53] = S, e[54] = _e, e[55] = d, e[56] = Ue, e[57] = Ee, e[58] = ne, e[59] = h, e[60] = g, e[61] = O, e[62] = x, e[63] = p, e[64] = F, e[65] = P, e[66] = M, e[67] = Le, e[68] = de, e[69] = R, e[70] = We, e[71] = k, e[72] = ue) : ue = e[72];
2716
- let xe;
2717
- return e[73] !== T || e[74] !== te || e[75] !== ie || e[76] !== ue ? (xe = /* @__PURE__ */ C(Qe, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2718
- te,
2719
- T,
2720
- ie,
2721
- ue
2722
- ] }), e[73] = T, e[74] = te, e[75] = ie, e[76] = ue, e[77] = xe) : xe = e[77], xe;
2607
+ }, e[25] = Ne) : Ne = e[25];
2608
+ const $n = Ne, ct = de ?? null;
2609
+ let ke;
2610
+ e[26] !== ct || e[27] !== fe ? (ke = /* @__PURE__ */ c(Hs, { conversationKey: ct, userMessageCount: fe }), e[26] = ct, e[27] = fe, e[28] = ke) : ke = e[28];
2611
+ const ut = He ? "visible" : "hidden";
2612
+ let Ce;
2613
+ e[29] !== ot || e[30] !== we || e[31] !== Fe || e[32] !== X || e[33] !== it || e[34] !== Ae || e[35] !== G || e[36] !== v ? (Ce = X ? /* @__PURE__ */ c(Wi, { leadingResponses: Ae, groups: Fe, streaming: v, hideActiveQuestionForms: it, expandedStickyMessageIds: we, onToggleStickyMessage: $n, onReady: () => q(G) }, G) : ot, e[29] = ot, e[30] = we, e[31] = Fe, e[32] = X, e[33] = it, e[34] = Ae, e[35] = G, e[36] = v, e[37] = Ce) : Ce = e[37];
2614
+ let Ie;
2615
+ e[38] !== ut || e[39] !== Ce ? (Ie = /* @__PURE__ */ c(pt.Viewport, { visibility: ut, children: Ce }), e[38] = ut, e[39] = Ce, e[40] = Ie) : Ie = e[40];
2616
+ let _e;
2617
+ e[41] !== He ? (_e = He ? /* @__PURE__ */ c(pt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = He, e[42] = _e) : _e = e[42];
2618
+ let Re;
2619
+ e[43] !== ke || e[44] !== Ie || e[45] !== _e ? (Re = /* @__PURE__ */ k(pt.Root, { children: [
2620
+ ke,
2621
+ Ie,
2622
+ _e
2623
+ ] }), e[43] = ke, e[44] = Ie, e[45] = _e, e[46] = Re) : Re = e[46];
2624
+ let ve;
2625
+ e[47] !== lt || e[48] !== v ? (ve = v ? /* @__PURE__ */ c(Ui, { hidden: !lt }) : null, e[47] = lt, e[48] = v, e[49] = ve) : ve = e[49];
2626
+ let Me;
2627
+ e[50] !== x || e[51] !== Le || e[52] !== y || e[53] !== S || e[54] !== xe || e[55] !== d || e[56] !== Be || e[57] !== rt || e[58] !== K || e[59] !== h || e[60] !== g || e[61] !== F || e[62] !== T || e[63] !== m || e[64] !== $ || e[65] !== B || e[66] !== D || e[67] !== at || e[68] !== ee || e[69] !== v || e[70] !== oe || e[71] !== C ? (Me = /* @__PURE__ */ c(Ki, { actions: x, attachedResources: y, attachmentList: S, chatInputAutoFocus: xe, chatInputPlaceholder: d, chatInputQuestionPrompt: Le, chatInputReferences: Be, hasWorkspaceHub: rt, inputDisabled: K, submitDisabled: oe, onAttachFiles: h, onAttachText: g, onChatInputAddReference: F, onClearAttachments: T, onInterrupt: m, onQueuedFollowUpMove: $, onQueuedFollowUpRemove: B, onQueuedFollowUpUpdate: D, queuedComposer: at, queuedFollowUps: ee, streaming: v, workspaceHub: C }), e[50] = x, e[51] = Le, e[52] = y, e[53] = S, e[54] = xe, e[55] = d, e[56] = Be, e[57] = rt, e[58] = K, e[59] = h, e[60] = g, e[61] = F, e[62] = T, e[63] = m, e[64] = $, e[65] = B, e[66] = D, e[67] = at, e[68] = ee, e[69] = v, e[70] = oe, e[71] = C, e[72] = Me) : Me = e[72];
2628
+ let Ue;
2629
+ return e[73] !== w || e[74] !== Re || e[75] !== ve || e[76] !== Me ? (Ue = /* @__PURE__ */ k(be, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2630
+ Re,
2631
+ w,
2632
+ ve,
2633
+ Me
2634
+ ] }), e[73] = w, e[74] = Re, e[75] = ve, e[76] = Me, e[77] = Ue) : Ue = e[77], Ue;
2723
2635
  };
2724
- function Ml(t) {
2636
+ function Xi(t) {
2725
2637
  return t + 1;
2726
2638
  }
2727
- function Pl(t, e) {
2639
+ function Gi(t, e) {
2728
2640
  return t + (e.role === "user" ? 1 : 0);
2729
2641
  }
2730
- function Dl() {
2642
+ function Yi() {
2731
2643
  return /* @__PURE__ */ new Set();
2732
2644
  }
2733
- const In = (t) => /* @__PURE__ */ c(G, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ c(ks, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), ta = () => {
2645
+ const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ c(jn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), wl = () => {
2734
2646
  const t = A(2);
2735
2647
  let e;
2736
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(ze.Root, { from: "user", children: /* @__PURE__ */ c(ze.Content, { from: "user", children: In(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2648
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(ge.Root, { from: "user", children: /* @__PURE__ */ c(ge.Content, { from: "user", children: Kt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2737
2649
  let n;
2738
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ C(G, { minH: "full", py: "xs", gap: "0", children: [
2650
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(j, { minH: "full", py: "xs", gap: "0", children: [
2739
2651
  e,
2740
- /* @__PURE__ */ c(ze.Root, { from: "assistant", children: /* @__PURE__ */ c(ze.Content, { from: "assistant", children: In(["76%", "62%", "40%"]) }) })
2652
+ /* @__PURE__ */ c(ge.Root, { from: "assistant", children: /* @__PURE__ */ c(ge.Content, { from: "assistant", children: Kt(["76%", "62%", "40%"]) }) })
2741
2653
  ] }), t[1] = n) : n = t[1], n;
2742
- }, El = 3, _n = 10, Bl = 26, en = 4, Fl = (t, e) => {
2654
+ }, Ji = 3, Xt = 10, Zi = 26, Tt = 4, el = (t, e) => {
2743
2655
  if (e === null) return 0;
2744
2656
  const n = Math.abs(t - e);
2745
- return n >= en ? 0 : (1 + Math.cos(Math.PI * n / en)) / 2;
2746
- }, Ll = (t, e) => {
2657
+ return n >= Tt ? 0 : (1 + Math.cos(Math.PI * n / Tt)) / 2;
2658
+ }, tl = (t, e) => {
2747
2659
  if (e === null) return "fg.subtle";
2748
2660
  const n = Math.abs(t - e);
2749
- return n < 0.5 ? "fg" : n < en ? "fg.muted" : "fg.subtle";
2750
- }, $l = (t) => {
2661
+ return n < 0.5 ? "fg" : n < Tt ? "fg.muted" : "fg.subtle";
2662
+ }, nl = (t) => {
2751
2663
  const e = A(11), {
2752
2664
  item: n,
2753
- position: o
2754
- } = t, s = `${o.left}px`, r = `${o.top}px`;
2665
+ position: s
2666
+ } = t, o = `${s.left}px`, r = `${s.top}px`;
2755
2667
  let i;
2756
- e[0] !== n.message ? (i = /* @__PURE__ */ c(j, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2668
+ e[0] !== n.message ? (i = /* @__PURE__ */ c(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2757
2669
  let l;
2758
- e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2670
+ e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2759
2671
  let a;
2760
- e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ C(G, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2672
+ e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(j, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2761
2673
  i,
2762
2674
  l
2763
2675
  ] }), e[4] = i, e[5] = l, e[6] = a) : a = e[6];
2764
2676
  let u;
2765
- return e[7] !== s || e[8] !== r || e[9] !== a ? (u = /* @__PURE__ */ c(Rn, { children: /* @__PURE__ */ c(B, { position: "fixed", left: s, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = s, e[8] = r, e[9] = a, e[10] = u) : u = e[10], u;
2766
- }, na = (t) => {
2677
+ return e[7] !== o || e[8] !== r || e[9] !== a ? (u = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(P, { position: "fixed", left: o, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = o, e[8] = r, e[9] = a, e[10] = u) : u = e[10], u;
2678
+ }, Tl = (t) => {
2767
2679
  const e = A(22), {
2768
2680
  items: n,
2769
- onSelect: o,
2770
- floating: s
2771
- } = t, r = s === void 0 ? !1 : s, [i, l] = V(null), [a, u] = V(null);
2772
- if (n.length < El)
2681
+ onSelect: s,
2682
+ floating: o
2683
+ } = t, r = o === void 0 ? !1 : o, [i, l] = V(null), [a, u] = V(null);
2684
+ if (n.length < Ji)
2773
2685
  return null;
2774
2686
  let d;
2775
2687
  e[0] !== n.length ? (d = (S) => {
2776
- const T = S.currentTarget.getBoundingClientRect(), k = (S.clientY - T.top) / T.height, I = Math.min(n.length - 1, Math.max(0, k * n.length - 0.5)), v = Math.round(I);
2777
- l(I), u({
2778
- left: T.right,
2779
- top: T.top + (v + 0.5) / n.length * T.height
2688
+ const w = S.currentTarget.getBoundingClientRect(), C = (S.clientY - w.top) / w.height, _ = Math.min(n.length - 1, Math.max(0, C * n.length - 0.5)), R = Math.round(_);
2689
+ l(_), u({
2690
+ left: w.right,
2691
+ top: w.top + (R + 0.5) / n.length * w.height
2780
2692
  });
2781
2693
  }, e[0] = n.length, e[1] = d) : d = e[1];
2782
- const f = d, m = i === null ? null : Math.round(i), p = m === null ? null : n[m];
2694
+ const f = d, p = i === null ? null : Math.round(i), m = p === null ? null : n[p];
2783
2695
  let h;
2784
2696
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => l(null), e[2] = h) : h = e[2];
2785
2697
  let g;
@@ -2791,100 +2703,100 @@ const In = (t) => /* @__PURE__ */ c(G, { gap: "xs", w: "full", children: t.map((
2791
2703
  bg: "bg"
2792
2704
  } : {}, e[3] = r, e[4] = g) : g = e[4];
2793
2705
  let b;
2794
- if (e[5] !== n || e[6] !== o || e[7] !== i) {
2706
+ if (e[5] !== n || e[6] !== s || e[7] !== i) {
2795
2707
  let S;
2796
- e[9] !== o || e[10] !== i ? (S = (T, k) => /* @__PURE__ */ c(vn.button, { type: "button", h: "2px", w: `${_n + (Bl - _n) * Fl(k, i)}px`, bg: Ll(k, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${k + 1}`, onClick: () => o?.(T.id) }, T.id), e[9] = o, e[10] = i, e[11] = S) : S = e[11], b = n.map(S), e[5] = n, e[6] = o, e[7] = i, e[8] = b;
2708
+ e[9] !== s || e[10] !== i ? (S = (w, C) => /* @__PURE__ */ c(Gt.button, { type: "button", h: "2px", w: `${Xt + (Zi - Xt) * el(C, i)}px`, bg: tl(C, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${C + 1}`, onClick: () => s?.(w.id) }, w.id), e[9] = s, e[10] = i, e[11] = S) : S = e[11], b = n.map(S), e[5] = n, e[6] = s, e[7] = i, e[8] = b;
2797
2709
  } else
2798
2710
  b = e[8];
2799
- let y;
2800
- e[12] !== f || e[13] !== g || e[14] !== b ? (y = /* @__PURE__ */ c(Qe, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = y) : y = e[15];
2801
- let w;
2802
- e[16] !== p || e[17] !== a ? (w = p && a ? /* @__PURE__ */ c($l, { item: p, position: a }) : null, e[16] = p, e[17] = a, e[18] = w) : w = e[18];
2803
2711
  let x;
2804
- return e[19] !== y || e[20] !== w ? (x = /* @__PURE__ */ C(B, { position: "relative", w: "10", flexShrink: 0, children: [
2805
- y,
2806
- w
2807
- ] }), e[19] = y, e[20] = w, e[21] = x) : x = e[21], x;
2808
- }, Ol = (t) => {
2712
+ e[12] !== f || e[13] !== g || e[14] !== b ? (x = /* @__PURE__ */ c(be, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = x) : x = e[15];
2713
+ let y;
2714
+ e[16] !== m || e[17] !== a ? (y = m && a ? /* @__PURE__ */ c(nl, { item: m, position: a }) : null, e[16] = m, e[17] = a, e[18] = y) : y = e[18];
2715
+ let T;
2716
+ return e[19] !== x || e[20] !== y ? (T = /* @__PURE__ */ k(P, { position: "relative", w: "10", flexShrink: 0, children: [
2717
+ x,
2718
+ y
2719
+ ] }), e[19] = x, e[20] = y, e[21] = T) : T = e[21], T;
2720
+ }, sl = (t) => {
2809
2721
  const e = A(13), {
2810
2722
  status: n,
2811
- statusLabel: o,
2812
- additions: s,
2723
+ statusLabel: s,
2724
+ additions: o,
2813
2725
  deletions: r
2814
2726
  } = t;
2815
2727
  if (n === "loading") {
2816
2728
  let u;
2817
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(nn, { size: "xs", color: "fg.muted" }), e[0] = u) : u = e[0];
2818
- const d = o ?? "Setting up workspace...";
2729
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[0] = u) : u = e[0];
2730
+ const d = s ?? "Setting up workspace...";
2819
2731
  let f;
2820
- return e[1] !== d ? (f = /* @__PURE__ */ C(ce, { gap: "2xs", minW: "0", children: [
2732
+ return e[1] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2821
2733
  u,
2822
- /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2734
+ /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2823
2735
  ] }), e[1] = d, e[2] = f) : f = e[2], f;
2824
2736
  }
2825
2737
  if (n === "error") {
2826
2738
  let u;
2827
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(Fn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = u) : u = e[3];
2828
- const d = o ?? "Workspace setup failed";
2739
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(sn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = u) : u = e[3];
2740
+ const d = s ?? "Workspace setup failed";
2829
2741
  let f;
2830
- return e[4] !== d ? (f = /* @__PURE__ */ C(ce, { gap: "2xs", minW: "0", children: [
2742
+ return e[4] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2831
2743
  u,
2832
- /* @__PURE__ */ c(j, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2744
+ /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2833
2745
  ] }), e[4] = d, e[5] = f) : f = e[5], f;
2834
2746
  }
2835
- if (s <= 0 && r <= 0)
2747
+ if (o <= 0 && r <= 0)
2836
2748
  return null;
2837
2749
  let i;
2838
- e[6] !== s ? (i = /* @__PURE__ */ C(j, { textStyle: "label/XS/medium", color: "fg.success", children: [
2750
+ e[6] !== o ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
2839
2751
  "+",
2840
- s
2841
- ] }), e[6] = s, e[7] = i) : i = e[7];
2752
+ o
2753
+ ] }), e[6] = o, e[7] = i) : i = e[7];
2842
2754
  let l;
2843
- e[8] !== r ? (l = /* @__PURE__ */ C(j, { textStyle: "label/XS/medium", color: "fg.error", children: [
2755
+ e[8] !== r ? (l = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.error", children: [
2844
2756
  "−",
2845
2757
  r
2846
2758
  ] }), e[8] = r, e[9] = l) : l = e[9];
2847
2759
  let a;
2848
- return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ C(ce, { gap: "2xs", children: [
2760
+ return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(Z, { gap: "2xs", children: [
2849
2761
  i,
2850
2762
  l
2851
2763
  ] }), e[10] = i, e[11] = l, e[12] = a) : a = e[12], a;
2852
- }, sa = (t) => {
2764
+ }, Al = (t) => {
2853
2765
  const e = A(13), {
2854
2766
  workspaceControl: n,
2855
- additions: o,
2856
- deletions: s,
2767
+ additions: s,
2768
+ deletions: o,
2857
2769
  action: r,
2858
2770
  status: i,
2859
2771
  statusLabel: l
2860
2772
  } = t, a = i === void 0 ? "ready" : i;
2861
2773
  let u;
2862
- e[0] !== o || e[1] !== s || e[2] !== a || e[3] !== l ? (u = /* @__PURE__ */ c(Ol, { status: a, statusLabel: l, additions: o, deletions: s }), e[0] = o, e[1] = s, e[2] = a, e[3] = l, e[4] = u) : u = e[4];
2774
+ e[0] !== s || e[1] !== o || e[2] !== a || e[3] !== l ? (u = /* @__PURE__ */ c(sl, { status: a, statusLabel: l, additions: s, deletions: o }), e[0] = s, e[1] = o, e[2] = a, e[3] = l, e[4] = u) : u = e[4];
2863
2775
  let d;
2864
- e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */ C(ce, { gap: "sm", minW: "0", children: [
2776
+ e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */ k(Z, { gap: "sm", minW: "0", children: [
2865
2777
  n,
2866
2778
  u
2867
2779
  ] }), e[5] = u, e[6] = n, e[7] = d) : d = e[7];
2868
2780
  let f;
2869
- e[8] !== r ? (f = r ? /* @__PURE__ */ c(Qe, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2870
- let m;
2871
- return e[10] !== d || e[11] !== f ? (m = /* @__PURE__ */ C(Qe, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2781
+ e[8] !== r ? (f = r ? /* @__PURE__ */ c(be, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2782
+ let p;
2783
+ return e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ k(be, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2872
2784
  d,
2873
2785
  f
2874
- ] }), e[10] = d, e[11] = f, e[12] = m) : m = e[12], m;
2786
+ ] }), e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
2875
2787
  };
2876
2788
  export {
2877
- Jl as ApprovalPrompt,
2878
- Zl as AttachmentList,
2879
- To as AutoScroll,
2880
- No as ChatInput,
2881
- ze as ChatMessage,
2882
- ea as ChatPanel,
2883
- Nt as ChatPrimitives,
2884
- ta as ChatSkeleton,
2885
- sa as ChatWorkspaceHub,
2886
- na as ConversationBrowse,
2887
- Ho as SendButton,
2888
- tr as createSerializedPromptState
2789
+ yl as ApprovalPrompt,
2790
+ xl as AttachmentList,
2791
+ Hs as AutoScroll,
2792
+ po as ChatInput,
2793
+ ge as ChatMessage,
2794
+ Sl as ChatPanel,
2795
+ pt as ChatPrimitives,
2796
+ wl as ChatSkeleton,
2797
+ Al as ChatWorkspaceHub,
2798
+ Tl as ConversationBrowse,
2799
+ uo as SendButton,
2800
+ So as createSerializedPromptState
2889
2801
  };
2890
2802
  //# sourceMappingURL=chat-ui.js.map