@pstdio/ui 0.24.1 → 0.24.2

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