@pstdio/ui 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/MermaidComponent-CatfVUxA.js +60 -0
  2. package/dist/MermaidComponent-CatfVUxA.js.map +1 -0
  3. package/dist/chat-ui.js +1220 -1144
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/chat-ui/components/chat-input-attachments.d.ts +12 -0
  6. package/dist/components/chat-ui/components/chat-input.d.ts +3 -0
  7. package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
  8. package/dist/components/chat-ui/components/message-parts-renderer.d.ts +1 -1
  9. package/dist/components/chat-ui/components/message-types.d.ts +90 -3
  10. package/dist/components/chat-ui/index.d.ts +2 -2
  11. package/dist/components/chat-ui/mocks/library/index.d.ts +2 -2
  12. package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +1 -1
  13. package/dist/components/chat-ui/performance/chat-performance-story-utils.d.ts +1 -1
  14. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +3 -3
  15. package/dist/components/chat-ui/tool-rendering/question-renderer.d.ts +1 -1
  16. package/dist/components/chat-ui/tool-rendering/shared.d.ts +2 -2
  17. package/dist/components/chat-ui/tool-rendering/todowrite-renderer.d.ts +1 -1
  18. package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -1
  19. package/dist/components/data-renderer/data-renderer-board-column-header.d.ts +8 -0
  20. package/dist/components/data-renderer/data-renderer-board-group-section.d.ts +17 -0
  21. package/dist/components/data-renderer/data-renderer-board-move.d.ts +21 -0
  22. package/dist/components/data-renderer/data-renderer-board.d.ts +3 -2
  23. package/dist/components/data-renderer/data-renderer-content.d.ts +7 -2
  24. package/dist/components/data-renderer/data-renderer.d.ts +2 -2
  25. package/dist/components/diff-viewer/diff-card-body.d.ts +16 -0
  26. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  27. package/dist/components/diff-viewer/diff-size.d.ts +1 -1
  28. package/dist/components/mermaid-renderer/download-png.d.ts +7 -0
  29. package/dist/components/mermaid-renderer/index.d.ts +2 -0
  30. package/dist/components/mermaid-renderer/mermaid-error-state.d.ts +6 -0
  31. package/dist/components/mermaid-renderer/mermaid-fixtures.d.ts +9 -0
  32. package/dist/components/mermaid-renderer/mermaid-fullscreen.d.ts +10 -0
  33. package/dist/components/mermaid-renderer/mermaid-renderer.d.ts +8 -0
  34. package/dist/components/mermaid-renderer/mermaid-svg-view.d.ts +12 -0
  35. package/dist/components/mermaid-renderer/mermaid-toolbar.d.ts +12 -0
  36. package/dist/components/mermaid-renderer/mermaid-zoom.d.ts +6 -0
  37. package/dist/components/mermaid-renderer/svg-data-url.d.ts +6 -0
  38. package/dist/components/mermaid-renderer/use-mermaid-render.d.ts +5 -0
  39. package/dist/components/palette-shortcut.d.ts +8 -0
  40. package/dist/index.d.ts +3 -0
  41. package/dist/index.js +3393 -3221
  42. package/dist/index.js.map +1 -1
  43. package/dist/mermaid-renderer-DYEiYmYQ.js +411 -0
  44. package/dist/mermaid-renderer-DYEiYmYQ.js.map +1 -0
  45. package/dist/resource-badge-D33IFv74.js +188 -0
  46. package/dist/resource-badge-D33IFv74.js.map +1 -0
  47. package/dist/{rich-message-CEOSsdR2.js → rich-message-BFtvH9H7.js} +430 -518
  48. package/dist/rich-message-BFtvH9H7.js.map +1 -0
  49. package/dist/rich-text.js +3 -3
  50. package/dist/{theme-D2LYEa0j.js → theme-C5qHTCU9.js} +3 -3
  51. package/dist/{theme-D2LYEa0j.js.map → theme-C5qHTCU9.js.map} +1 -1
  52. package/dist/theme.js +1 -1
  53. package/package.json +3 -2
  54. package/dist/MermaidComponent-Cz_Iob5U.js +0 -127
  55. package/dist/MermaidComponent-Cz_Iob5U.js.map +0 -1
  56. package/dist/components/chat-ui/agent-types.d.ts +0 -220
  57. package/dist/get-file-type-icon-ufFb0IkR.js +0 -102
  58. package/dist/get-file-type-icon-ufFb0IkR.js.map +0 -1
  59. package/dist/rich-message-CEOSsdR2.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as l, jsxs as T, Fragment as Lt } from "react/jsx-runtime";
2
- import { c as k } from "react/compiler-runtime";
3
- import { chakra as Pn, AbsoluteCenter as Ln, IconButton as vt, defineSlotRecipe as vn, createSlotRecipeContext as $n, Text as q, Code as Qt, Button as Ke, HStack as Ee, Box as I, Flex as Ce, Stack as Z, Textarea as On, Tooltip as it, Portal as Dn, Kbd as Fn, Spacer as zn, Timeline as qn, Span as Ue, Avatar as qe, Card as le, Link as Zt, Spinner as $t, Skeleton as Qn } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Hn, ShieldX as Wn, ShieldCheck as Nn, Check as en, Square as Vn, ArrowUp as jn, Copy as Un, Move as Kn, FileDown as Gn, FileUp as Xn, FileDiff as Yn, Trash2 as Jn, FilePen as Zn, FileText as es, ListTree as ts, Terminal as tn, ListTodo as ns, CircleQuestionMark as ss, File as os, Globe as rs, Search as is, AlertTriangle as nn, DotIcon as ls, ChevronUpIcon as as, MessageCircleIcon as cs } from "lucide-react";
5
- import { StickToBottom as us, useStickToBottomContext as ct } from "use-stick-to-bottom";
6
- import { S as ut, T as sn } from "./get-file-type-icon-ufFb0IkR.js";
7
- import { useRef as Qe, useEffect as Te, useState as G } from "react";
8
- import { i as At, P as ds, h as fs, R as on, j as ps } from "./rich-message-CEOSsdR2.js";
1
+ import { jsx as a, jsxs as k, Fragment as $t } from "react/jsx-runtime";
2
+ import { c as T } from "react/compiler-runtime";
3
+ import { chakra as zn, AbsoluteCenter as qn, IconButton as Ft, defineSlotRecipe as Hn, createSlotRecipeContext as Qn, Text as X, Code as Ut, Button as Ze, HStack as Me, Box as I, Flex as Re, Stack as Y, Textarea as Wn, Tooltip as dt, Portal as Nn, Kbd as Vn, Spacer as jn, Timeline as Un, Span as Je, Avatar as We, Card as ue, Link as rn, Spinner as zt, Image as Kn, Skeleton as Gn } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as Xn, ShieldX as Yn, ShieldCheck as Jn, Check as ln, Square as Zn, ArrowUp as eo, Copy as to, Move as no, FileDown as oo, FileUp as so, FileDiff as ro, Trash2 as io, FilePen as lo, FileText as ao, ListTree as co, Terminal as an, ListTodo as uo, CircleQuestionMark as fo, File as po, Globe as mo, Search as ho, AlertTriangle as cn, DotIcon as go, ChevronUpIcon as bo, MessageCircleIcon as yo } from "lucide-react";
5
+ import { StickToBottom as xo, useStickToBottomContext as mt } from "use-stick-to-bottom";
6
+ import { S as ht, R as qt, T as un } from "./resource-badge-D33IFv74.js";
7
+ import { Fragment as So, useRef as Ne, useEffect as Ae, useState as G } from "react";
8
+ import { i as Et, P as To, h as wo, R as dn } from "./rich-message-BFtvH9H7.js";
9
9
  import "@lexical/react/LexicalCollaborationContext";
10
10
  import "@lexical/react/LexicalCollaborationPlugin";
11
11
  import "@lexical/react/LexicalComposer";
@@ -33,14 +33,14 @@ import "@lexical/react/LexicalHistoryPlugin";
33
33
  import "@lexical/react/LexicalOnChangePlugin";
34
34
  import "@lexical/react/LexicalTreeView";
35
35
  import "@lexical/react/LexicalClickableLinkPlugin";
36
- import { C as rn, R as ms, a as hs, D as gs, b as ln, A as Ht, E as bs } from "./radio-DJtQY9po.js";
37
- import { useVirtualizer as ys } from "@tanstack/react-virtual";
38
- const xs = {
36
+ import { C as fn, R as ko, a as Co, D as Ao, b as pn, A as Kt, E as _o } from "./radio-DJtQY9po.js";
37
+ import { useVirtualizer as Ro } from "@tanstack/react-virtual";
38
+ const Io = {
39
39
  "aria-roledescription": "conversation",
40
40
  initial: "instant",
41
41
  resize: "instant",
42
42
  role: "log"
43
- }, Ss = Pn(us, {
43
+ }, Po = zn(xo, {
44
44
  base: {
45
45
  position: "relative",
46
46
  flex: 1,
@@ -49,18 +49,18 @@ const xs = {
49
49
  }
50
50
  }, {
51
51
  forwardProps: ["initial", "resize"],
52
- defaultProps: xs
53
- }), ks = (t) => {
54
- const e = k(10);
55
- let n, o;
52
+ defaultProps: Io
53
+ }), Mo = (t) => {
54
+ const e = T(10);
55
+ let n, s;
56
56
  e[0] !== t ? ({
57
57
  children: n,
58
- ...o
59
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
58
+ ...s
59
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
60
60
  const {
61
- contentRef: s,
61
+ contentRef: o,
62
62
  scrollRef: r
63
- } = ct(), i = r, a = s;
63
+ } = mt(), i = r, l = o;
64
64
  let c, u;
65
65
  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
66
66
  zIndex: 2
@@ -70,23 +70,23 @@ const xs = {
70
70
  role: "list"
71
71
  }, e[3] = c, e[4] = u) : (c = e[3], u = e[4]);
72
72
  let d;
73
- return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== a ? (d = /* @__PURE__ */ l(ut, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: a, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = a, e[9] = d) : d = e[9], d;
74
- }, Ts = {
73
+ return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ a(ht, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
74
+ }, Eo = {
75
75
  axis: "horizontal",
76
76
  bottom: "md",
77
77
  zIndex: 2
78
- }, ws = (t) => {
79
- const e = k(4), {
78
+ }, vo = (t) => {
79
+ const e = T(4), {
80
80
  isAtBottom: n,
81
- scrollToBottom: o
82
- } = ct();
83
- let s;
84
- return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ l(Ln, { ...Ts, children: /* @__PURE__ */ l(vt, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ l(Hn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
85
- }, Rt = {
86
- Root: Ss,
87
- Viewport: ks,
88
- ScrollToBottom: ws
89
- }, Cs = vn({
81
+ scrollToBottom: s
82
+ } = mt();
83
+ let o;
84
+ return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ a(qn, { ...Eo, children: /* @__PURE__ */ a(Ft, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ a(Xn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
85
+ }, vt = {
86
+ Root: Po,
87
+ Viewport: Mo,
88
+ ScrollToBottom: vo
89
+ }, Lo = Hn({
90
90
  className: "ai-message",
91
91
  slots: ["root", "content"],
92
92
  base: {
@@ -196,611 +196,683 @@ const xs = {
196
196
  shape: "rounded"
197
197
  }
198
198
  }), {
199
- withProvider: _s,
200
- withContext: As
201
- } = $n({
202
- recipe: Cs
203
- }), Rs = _s("div", "root"), Is = As("div", "content"), we = {
204
- Root: Rs,
205
- Content: Is
206
- }, Ms = (t) => {
199
+ withProvider: Do,
200
+ withContext: Bo
201
+ } = Qn({
202
+ recipe: Lo
203
+ }), Oo = Do("div", "root"), $o = Bo("div", "content"), _e = {
204
+ Root: Oo,
205
+ Content: $o
206
+ }, Fo = (t) => {
207
207
  if (t == null) return null;
208
208
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
209
209
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
210
- }, ji = (t) => {
211
- const e = k(19), {
210
+ }, cl = (t) => {
211
+ const e = T(19), {
212
212
  toolName: n,
213
- toolInput: o,
214
- onApprove: s,
213
+ toolInput: s,
214
+ onApprove: o,
215
215
  onDeny: r
216
216
  } = t;
217
217
  let i;
218
- e[0] !== o ? (i = Ms(o), e[0] = o, e[1] = i) : i = e[1];
219
- const a = i;
218
+ e[0] !== s ? (i = Fo(s), e[0] = s, e[1] = i) : i = e[1];
219
+ const l = i;
220
220
  let c;
221
- e[2] !== n ? (c = /* @__PURE__ */ T(q, { textStyle: "label/S/medium", color: "fg", children: [
221
+ e[2] !== n ? (c = /* @__PURE__ */ k(X, { textStyle: "label/S/medium", color: "fg", children: [
222
222
  "Allow ",
223
- /* @__PURE__ */ l(Qt, { size: "sm", children: n }),
223
+ /* @__PURE__ */ a(Ut, { size: "sm", children: n }),
224
224
  "?"
225
225
  ] }), e[2] = n, e[3] = c) : c = e[3];
226
226
  let u;
227
- e[4] !== a ? (u = a ? /* @__PURE__ */ l(ut, { maxH: "6rem", children: /* @__PURE__ */ l(Qt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: a }) }) : null, e[4] = a, e[5] = u) : u = e[5];
227
+ e[4] !== l ? (u = l ? /* @__PURE__ */ a(ht, { maxH: "6rem", children: /* @__PURE__ */ a(Ut, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
228
228
  let d;
229
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ l(Wn, { size: 14 }), e[6] = d) : d = e[6];
230
- let p;
231
- e[7] !== r ? (p = /* @__PURE__ */ T(Ke, { size: "xs", variant: "outline", onClick: r, children: [
229
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(Yn, { size: 14 }), e[6] = d) : d = e[6];
230
+ let f;
231
+ e[7] !== r ? (f = /* @__PURE__ */ k(Ze, { size: "xs", variant: "outline", onClick: r, children: [
232
232
  d,
233
233
  "Deny"
234
- ] }), e[7] = r, e[8] = p) : p = e[8];
234
+ ] }), e[7] = r, e[8] = f) : f = e[8];
235
235
  let m;
236
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ l(Nn, { size: 14 }), e[9] = m) : m = e[9];
237
- let f;
238
- e[10] !== s ? (f = /* @__PURE__ */ T(Ke, { size: "xs", colorPalette: "green", onClick: s, children: [
236
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ a(Jn, { size: 14 }), e[9] = m) : m = e[9];
237
+ let p;
238
+ e[10] !== o ? (p = /* @__PURE__ */ k(Ze, { size: "xs", colorPalette: "green", onClick: o, children: [
239
239
  m,
240
240
  "Allow"
241
- ] }), e[10] = s, e[11] = f) : f = e[11];
241
+ ] }), e[10] = o, e[11] = p) : p = e[11];
242
242
  let h;
243
- e[12] !== p || e[13] !== f ? (h = /* @__PURE__ */ T(Ee, { gap: "xs", justifyContent: "flex-end", children: [
244
- p,
245
- f
246
- ] }), e[12] = p, e[13] = f, e[14] = h) : h = e[14];
243
+ e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(Me, { gap: "xs", justifyContent: "flex-end", children: [
244
+ f,
245
+ p
246
+ ] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
247
247
  let g;
248
- return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ l(I, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ T(Ce, { direction: "column", gap: "xs", children: [
248
+ return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ a(I, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(Re, { direction: "column", gap: "xs", children: [
249
249
  c,
250
250
  u,
251
251
  h
252
252
  ] }) }), e[15] = c, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
253
- }, Es = (t) => {
253
+ }, zo = "md", qo = "neutral", ul = (t) => {
254
+ const e = T(17), {
255
+ attachments: n,
256
+ onSelect: s,
257
+ onRemove: o,
258
+ renderBadge: r,
259
+ size: i,
260
+ tone: l
261
+ } = t;
262
+ let c;
263
+ e[0] !== n ? (c = n === void 0 ? [] : n, e[0] = n, e[1] = c) : c = e[1];
264
+ const u = c, d = i === void 0 ? zo : i, f = l === void 0 ? qo : l;
265
+ if (u.length === 0)
266
+ return null;
267
+ let m;
268
+ if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
269
+ let h;
270
+ e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
271
+ const y = s ? () => s(g) : void 0, b = o ? () => o(g) : void 0;
272
+ if (r) {
273
+ const x = r({
274
+ attachmentId: g,
275
+ onSelect: y,
276
+ onRemove: b,
277
+ size: d,
278
+ tone: f
279
+ });
280
+ return /* @__PURE__ */ a(So, { children: x }, g);
281
+ }
282
+ return /* @__PURE__ */ a(qt, { fileName: g, onSelect: y, onRemove: b, size: d, tone: f }, g);
283
+ }, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
284
+ } else
285
+ m = e[8];
286
+ let p;
287
+ return e[15] !== m ? (p = /* @__PURE__ */ a(Y, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
288
+ }, Ho = (t) => {
254
289
  const {
255
290
  previousUserMessageCount: e,
256
291
  userMessageCount: n
257
292
  } = t;
258
293
  return e === 0 ? !1 : n > e;
259
294
  };
260
- function Bs(t) {
261
- const e = k(4), {
295
+ function Qo(t) {
296
+ const e = T(4), {
262
297
  userMessageCount: n
263
298
  } = t, {
264
- scrollToBottom: o
265
- } = ct(), s = Qe(n);
299
+ scrollToBottom: s
300
+ } = mt(), o = Ne(n);
266
301
  let r, i;
267
- return e[0] !== o || e[1] !== n ? (r = () => {
268
- Es({
269
- previousUserMessageCount: s.current,
302
+ return e[0] !== s || e[1] !== n ? (r = () => {
303
+ Ho({
304
+ previousUserMessageCount: o.current,
270
305
  userMessageCount: n
271
- }) && o(), s.current = n;
272
- }, i = [n, o], e[0] = o, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Te(r, i), null;
306
+ }) && s(), o.current = n;
307
+ }, i = [n, s], e[0] = s, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Ae(r, i), null;
273
308
  }
274
- const an = (t) => t.trim().length > 0, Ps = (t) => {
309
+ const mn = (t) => t.trim().length > 0, Wo = (t) => {
275
310
  const {
276
311
  isDisabled: e,
277
312
  streaming: n,
278
- text: o
313
+ text: s
279
314
  } = t;
280
- return e || n || !an(o) ? "none" : "submit";
281
- }, Ls = (t) => {
315
+ return e || n || !mn(s) ? "none" : "submit";
316
+ }, No = (t) => {
282
317
  const {
283
318
  canInterrupt: e,
284
319
  isDisabled: n,
285
- streaming: o,
286
- text: s
320
+ streaming: s,
321
+ text: o
322
+ } = t;
323
+ return n ? "none" : s ? e ? "interrupt" : "none" : mn(o) ? "submit" : "none";
324
+ }, hn = 200, Vo = (t, e = hn) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, jo = (t) => {
325
+ const {
326
+ onAttachFiles: e,
327
+ onAttachText: n,
328
+ textAttachmentPasteLineThreshold: s
287
329
  } = t;
288
- return n ? "none" : o ? e ? "interrupt" : "none" : an(s) ? "submit" : "none";
289
- }, vs = (t) => {
330
+ return {
331
+ onDragOver: (l) => {
332
+ !e || !Array.from(l.dataTransfer.types).includes("Files") || l.preventDefault();
333
+ },
334
+ onDropCapture: (l) => {
335
+ const c = Array.from(l.dataTransfer.files ?? []);
336
+ c.length === 0 || !e || (l.preventDefault(), e(c));
337
+ },
338
+ onPasteCapture: (l) => {
339
+ const c = Array.from(l.clipboardData.files ?? []);
340
+ if (c.length > 0 && e) {
341
+ l.preventDefault(), e(c);
342
+ return;
343
+ }
344
+ const u = l.clipboardData.getData("text/plain");
345
+ n && Vo(u, s) && (l.preventDefault(), n(u));
346
+ }
347
+ };
348
+ }, Uo = (t) => {
290
349
  t.preventDefault();
291
- }, cn = (t) => {
292
- const e = k(7), {
350
+ }, gn = (t) => {
351
+ const e = T(7), {
293
352
  option: n
294
353
  } = t;
295
- let o;
296
- e[0] !== n.label ? (o = /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
297
354
  let s;
298
- e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
355
+ e[0] !== n.label ? (s = /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
356
+ let o;
357
+ e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
299
358
  let r;
300
- return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ T(Z, { gap: "0", minWidth: "0", children: [
301
- o,
302
- s
303
- ] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
304
- }, $s = (t) => {
305
- const e = k(12), {
359
+ return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(Y, { gap: "0", minWidth: "0", children: [
360
+ s,
361
+ o
362
+ ] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
363
+ }, Ko = (t) => {
364
+ const e = T(12), {
306
365
  option: n,
307
- name: o,
308
- checked: s,
366
+ name: s,
367
+ checked: o,
309
368
  editable: r,
310
369
  onToggle: i
311
- } = t, a = !r, c = r ? void 0 : "true";
370
+ } = t, l = !r, c = r ? void 0 : "true";
312
371
  let u;
313
372
  e[0] !== r ? (u = r ? void 0 : {
314
373
  tabIndex: -1
315
374
  }, e[0] = r, e[1] = u) : u = e[1];
316
375
  const d = r ? i : void 0;
317
- let p;
318
- e[2] !== n ? (p = /* @__PURE__ */ l(cn, { option: n }), e[2] = n, e[3] = p) : p = e[3];
376
+ let f;
377
+ e[2] !== n ? (f = /* @__PURE__ */ a(gn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
319
378
  let m;
320
- return e[4] !== s || e[5] !== o || e[6] !== a || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== p ? (m = /* @__PURE__ */ l(rn, { name: o, checked: s, readOnly: a, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: p }), e[4] = s, e[5] = o, e[6] = a, e[7] = c, e[8] = u, e[9] = d, e[10] = p, e[11] = m) : m = e[11], m;
321
- }, Os = (t) => {
322
- const e = k(17), {
379
+ return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ a(fn, { name: s, checked: o, readOnly: l, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = c, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
380
+ }, Go = (t) => {
381
+ const e = T(17), {
323
382
  question: n,
324
- questionIndex: o,
325
- name: s,
383
+ questionIndex: s,
384
+ name: o,
326
385
  selectedOption: r,
327
386
  editable: i,
328
- onToggleOption: a
387
+ onToggleOption: l
329
388
  } = t, c = r ?? null, u = !i, d = i ? void 0 : "true";
330
- let p;
331
- e[0] !== i || e[1] !== a || e[2] !== n || e[3] !== o ? (p = i ? (h) => {
332
- h.value && a?.(n, o, h.value);
333
- } : void 0, e[0] = i, e[1] = a, e[2] = n, e[3] = o, e[4] = p) : p = e[4];
389
+ let f;
390
+ e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
391
+ h.value && l?.(n, s, h.value);
392
+ } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
334
393
  let m;
335
394
  if (e[5] !== i || e[6] !== n.options) {
336
395
  let h;
337
- e[8] !== i ? (h = (g) => /* @__PURE__ */ l(ms, { value: g.label, inputProps: i ? void 0 : {
396
+ e[8] !== i ? (h = (g) => /* @__PURE__ */ a(ko, { value: g.label, inputProps: i ? void 0 : {
338
397
  tabIndex: -1
339
- }, alignItems: "flex-start", children: /* @__PURE__ */ l(cn, { 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;
398
+ }, alignItems: "flex-start", children: /* @__PURE__ */ a(gn, { 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;
340
399
  } else
341
400
  m = e[7];
342
- let f;
343
- return e[10] !== s || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== p || e[15] !== m ? (f = /* @__PURE__ */ l(hs, { name: s, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: p, children: m }), e[10] = s, e[11] = c, e[12] = u, e[13] = d, e[14] = p, e[15] = m, e[16] = f) : f = e[16], f;
344
- }, Ds = (t) => {
345
- const e = k(4), {
401
+ let p;
402
+ return e[10] !== o || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ a(Co, { name: o, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = o, e[11] = c, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
403
+ }, Xo = (t) => {
404
+ const e = T(4), {
346
405
  items: n
347
406
  } = t;
348
- let o;
349
- e[0] !== n ? (o = n.map(Fs), e[0] = n, e[1] = o) : o = e[1];
350
407
  let s;
351
- return e[2] !== o ? (s = /* @__PURE__ */ l(Z, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
352
- }, un = (t) => {
353
- const e = k(19), {
408
+ e[0] !== n ? (s = n.map(Yo), e[0] = n, e[1] = s) : s = e[1];
409
+ let o;
410
+ return e[2] !== s ? (o = /* @__PURE__ */ a(Y, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
411
+ }, bn = (t) => {
412
+ const e = T(19), {
354
413
  questions: n,
355
- editable: o,
356
- selectedOptionsByQuestion: s,
414
+ editable: s,
415
+ selectedOptionsByQuestion: o,
357
416
  customAnswersByQuestion: r,
358
417
  onToggleOption: i,
359
- onCustomAnswerChange: a
360
- } = t, c = o === void 0 ? !1 : o;
418
+ onCustomAnswerChange: l
419
+ } = t, c = s === void 0 ? !1 : s;
361
420
  let u;
362
- e[0] !== s ? (u = s === void 0 ? {} : s, e[0] = s, e[1] = u) : u = e[1];
421
+ e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
363
422
  const d = u;
364
- let p;
365
- e[2] !== r ? (p = r === void 0 ? {} : r, e[2] = r, e[3] = p) : p = e[3];
366
- const m = p;
367
423
  let f;
368
- if (e[4] !== m || e[5] !== c || e[6] !== a || e[7] !== i || e[8] !== n || e[9] !== d) {
424
+ e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
425
+ const m = f;
426
+ let p;
427
+ if (e[4] !== m || e[5] !== c || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
369
428
  let g;
370
- e[11] !== m || e[12] !== c || e[13] !== a || e[14] !== i || e[15] !== d ? (g = (b, y) => {
371
- const x = b.id ?? `question-${y}`, _ = b.multiple ? "checkbox" : "radio", C = d[x] ?? [];
372
- return /* @__PURE__ */ T(Z, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
373
- /* @__PURE__ */ l(q, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
374
- _ === "radio" ? /* @__PURE__ */ l(Os, { question: b, questionIndex: y, name: x, selectedOption: C[0], editable: c, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ l($s, { option: w, name: x, checked: C.includes(w.label), editable: c, onToggle: () => i?.(b, y, w.label) }, w.label)),
375
- b.allowCustomAnswer ? /* @__PURE__ */ l(On, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => a?.(b, y, w.currentTarget.value) }) : null
429
+ e[11] !== m || e[12] !== c || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (y, b) => {
430
+ const x = y.id ?? `question-${b}`, C = y.multiple ? "checkbox" : "radio", A = d[x] ?? [];
431
+ return /* @__PURE__ */ k(Y, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
432
+ /* @__PURE__ */ a(X, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: y.question }),
433
+ C === "radio" ? /* @__PURE__ */ a(Go, { question: y, questionIndex: b, name: x, selectedOption: A[0], editable: c, onToggleOption: i }) : y.options.map((w) => /* @__PURE__ */ a(Ko, { option: w, name: x, checked: A.includes(w.label), editable: c, onToggle: () => i?.(y, b, w.label) }, w.label)),
434
+ y.allowCustomAnswer ? /* @__PURE__ */ a(Wn, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": y.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => l?.(y, b, w.currentTarget.value) }) : null
376
435
  ] }, x);
377
- }, e[11] = m, e[12] = c, e[13] = a, e[14] = i, e[15] = d, e[16] = g) : g = e[16], f = n.map(g), e[4] = m, e[5] = c, e[6] = a, e[7] = i, e[8] = n, e[9] = d, e[10] = f;
436
+ }, e[11] = m, e[12] = c, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = c, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
378
437
  } else
379
- f = e[10];
438
+ p = e[10];
380
439
  let h;
381
- return e[17] !== f ? (h = /* @__PURE__ */ l(Z, { as: "form", gap: "sm", onSubmit: vs, "aria-label": "Question form", children: f }), e[17] = f, e[18] = h) : h = e[18], h;
440
+ return e[17] !== p ? (h = /* @__PURE__ */ a(Y, { as: "form", gap: "sm", onSubmit: Uo, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
382
441
  };
383
- function Fs(t, e) {
384
- return /* @__PURE__ */ l(I, { as: "li", children: /* @__PURE__ */ l(rn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
442
+ function Yo(t, e) {
443
+ return /* @__PURE__ */ a(I, { as: "li", children: /* @__PURE__ */ a(fn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
385
444
  tabIndex: -1
386
- }, size: "xs", children: /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
445
+ }, size: "xs", children: /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
387
446
  }
388
- const ae = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
389
- id: ae(e, n),
447
+ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
448
+ id: de(e, n),
390
449
  question: e.question,
391
450
  multiple: !!e.multiple,
392
451
  required: !!e.required,
393
452
  allowCustomAnswer: !!e.allowCustomAnswer,
394
- options: e.options.map((o) => ({
395
- label: o.label,
396
- description: o.description ?? ""
453
+ options: e.options.map((s) => ({
454
+ label: s.label,
455
+ description: s.description ?? ""
397
456
  }))
398
- }))) : "", zs = (t, e, n) => {
399
- const o = [];
400
- for (let s = 0; s < t.questions.length; s += 1) {
401
- const r = t.questions[s], i = ae(r, s), a = e[i] ?? [], c = n[i]?.trim(), u = c ? [...a, c] : a;
402
- u.length !== 0 && o.push(`${r.question}: ${u.join(", ")}`);
457
+ }))) : "", Jo = (t, e, n) => {
458
+ const s = [];
459
+ for (let o = 0; o < t.questions.length; o += 1) {
460
+ const r = t.questions[o], i = de(r, o), l = e[i] ?? [], c = n[i]?.trim(), u = c ? [...l, c] : l;
461
+ u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
403
462
  }
404
- return o;
405
- }, qs = (t) => typeof t != "string", Ot = (t, e) => {
406
- if (qs(e)) return e;
463
+ return s;
464
+ }, Zo = (t) => typeof t != "string", Ht = (t, e) => {
465
+ if (Zo(e)) return e;
407
466
  const n = e.trim();
408
467
  if (n.length === 0) return {};
409
- const o = {};
410
- for (let s = 0; s < t.questions.length; s += 1) {
411
- const r = t.questions[s];
412
- r.allowCustomAnswer && (o[ae(r, s)] = n);
468
+ const s = {};
469
+ for (let o = 0; o < t.questions.length; o += 1) {
470
+ const r = t.questions[o];
471
+ r.allowCustomAnswer && (s[de(r, o)] = n);
413
472
  }
414
- return o;
415
- }, Qs = (t, e, n) => {
473
+ return s;
474
+ }, es = (t, e, n) => {
416
475
  if (!t) return typeof n == "string" ? n.trim() : "";
417
- const o = Ot(t, n), s = zs(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((a) => a.allowCustomAnswer);
418
- return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
476
+ const s = Ht(t, n), o = Jo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
477
+ return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
419
478
  `);
420
- }, Hs = (t, e, n) => {
421
- const o = Ot(t, n);
422
- return t.questions.map((s, r) => {
423
- const i = ae(s, r), a = e[i] ?? [], c = o[i]?.trim();
424
- return c ? [...a, c] : a;
479
+ }, ts = (t, e, n) => {
480
+ const s = Ht(t, n);
481
+ return t.questions.map((o, r) => {
482
+ const i = de(o, r), l = e[i] ?? [], c = s[i]?.trim();
483
+ return c ? [...l, c] : l;
425
484
  });
426
- }, Ws = (t, e, n) => {
485
+ }, ns = (t, e, n) => {
427
486
  if (!t) return !1;
428
- const o = Ot(t, n);
429
- for (let s = 0; s < t.questions.length; s += 1) {
430
- const r = t.questions[s];
487
+ const s = Ht(t, n);
488
+ for (let o = 0; o < t.questions.length; o += 1) {
489
+ const r = t.questions[o];
431
490
  if (!r.required) continue;
432
- const i = ae(r, s);
433
- if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
491
+ const i = de(r, o);
492
+ if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
434
493
  return !0;
435
494
  }
436
495
  return !1;
437
- }, Ns = (t) => t.questions.map((e, n) => ({
438
- id: ae(e, n),
496
+ }, os = (t) => t.questions.map((e, n) => ({
497
+ id: de(e, n),
439
498
  question: e.question,
440
499
  options: e.options,
441
500
  multiple: !!e.multiple,
442
501
  required: !!e.required,
443
502
  allowCustomAnswer: !!e.allowCustomAnswer
444
- })), Vs = (t, e, n, o) => {
445
- const s = ae(t, e);
446
- return (n[s] ?? []).length > 0 || !!o[s]?.trim();
447
- }, js = (t) => {
448
- const e = k(22), {
503
+ })), ss = (t, e, n, s) => {
504
+ const o = de(t, e);
505
+ return (n[o] ?? []).length > 0 || !!s[o]?.trim();
506
+ }, rs = (t) => {
507
+ const e = T(22), {
449
508
  question: n,
450
- sourceQuestion: o,
451
- questionIndex: s,
509
+ sourceQuestion: s,
510
+ questionIndex: o,
452
511
  isActive: r,
453
512
  selectedOptionsByQuestion: i,
454
- customAnswersByQuestion: a,
513
+ customAnswersByQuestion: l,
455
514
  onSelectStep: c
456
515
  } = t;
457
516
  let u;
458
- e[0] !== a || e[1] !== s || e[2] !== i || e[3] !== o ? (u = Vs(o, s, i, a), e[0] = a, e[1] = s, e[2] = i, e[3] = o, e[4] = u) : u = e[4];
459
- const d = u, p = d ? "answered" : "not answered", m = r ? "outline" : "ghost", f = `question-step-tab-${n.id}`, h = `${n.question} (${p})`, g = `question-step-panel-${n.id}`;
460
- let b;
461
- e[5] !== c || e[6] !== s ? (b = () => c(s), e[5] = c, e[6] = s, e[7] = b) : b = e[7];
517
+ e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = ss(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
518
+ 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}`;
462
519
  let y;
463
- e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ l(en, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
520
+ e[5] !== c || e[6] !== o ? (y = () => c(o), e[5] = c, e[6] = o, e[7] = y) : y = e[7];
521
+ let b;
522
+ e[8] !== d || e[9] !== o ? (b = d ? /* @__PURE__ */ a(ln, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = b) : b = e[10];
464
523
  let x;
465
- e[11] !== r || e[12] !== f || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (x = /* @__PURE__ */ l(Ke, { id: f, 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] = f, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = x) : x = e[18];
466
- let _;
467
- return e[19] !== n.question || e[20] !== x ? (_ = /* @__PURE__ */ l(sn, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = _) : _ = e[21], _;
468
- }, Us = (t) => {
469
- const e = k(31), {
524
+ e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== y || e[16] !== b || e[17] !== m ? (x = /* @__PURE__ */ a(Ze, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: y, children: b }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = y, e[16] = b, e[17] = m, e[18] = x) : x = e[18];
525
+ let C;
526
+ return e[19] !== n.question || e[20] !== x ? (C = /* @__PURE__ */ a(un, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = C) : C = e[21], C;
527
+ }, is = (t) => {
528
+ const e = T(31), {
470
529
  questionPrompt: n,
471
- selectedOptionsByQuestion: o,
472
- customAnswersByQuestion: s,
530
+ selectedOptionsByQuestion: s,
531
+ customAnswersByQuestion: o,
473
532
  onToggleOption: r,
474
533
  onCustomAnswerChange: i
475
534
  } = t, {
476
- questions: a
477
- } = t, [c, u] = G(0), d = Math.min(c, a.length - 1), p = a[d], m = a.length > 1;
478
- let f;
479
- e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== a || e[4] !== d || e[5] !== o ? (f = m ? /* @__PURE__ */ l(Ee, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: a.map((B, M) => /* @__PURE__ */ l(js, { question: B, sourceQuestion: n.questions[M], questionIndex: M, isActive: M === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: u }, B.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = a, e[4] = d, e[5] = o, e[6] = f) : f = e[6];
480
- const h = `question-step-panel-${p.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${p.id}` : void 0;
481
- let y;
482
- e[7] !== p ? (y = [p], e[7] = p, e[8] = y) : y = e[8];
535
+ questions: l
536
+ } = t, [c, u] = G(0), d = Math.min(c, l.length - 1), f = l[d], m = l.length > 1;
537
+ let p;
538
+ e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ a(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((M, P) => /* @__PURE__ */ a(rs, { question: M, sourceQuestion: n.questions[P], questionIndex: P, isActive: P === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, M.id)) }) : null, e[0] = o, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = p) : p = e[6];
539
+ const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, y = m ? `question-step-tab-${f.id}` : void 0;
540
+ let b;
541
+ e[7] !== f ? (b = [f], e[7] = f, e[8] = b) : b = e[8];
483
542
  let x;
484
- e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (B, M, P) => {
485
- r(n.questions[d], d, P);
543
+ e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (M, P, v) => {
544
+ r(n.questions[d], d, v);
486
545
  }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
487
- let _;
488
- e[13] !== i || e[14] !== n.questions || e[15] !== d ? (_ = (B, M, P) => {
489
- i(n.questions[d], d, P);
490
- }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = _) : _ = e[16];
491
546
  let C;
492
- e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== x || e[21] !== _ ? (C = /* @__PURE__ */ l(un, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: x, onCustomAnswerChange: _ }), e[17] = s, e[18] = o, e[19] = y, e[20] = x, e[21] = _, e[22] = C) : C = e[22];
547
+ e[13] !== i || e[14] !== n.questions || e[15] !== d ? (C = (M, P, v) => {
548
+ i(n.questions[d], d, v);
549
+ }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = C) : C = e[16];
550
+ let A;
551
+ e[17] !== o || e[18] !== s || e[19] !== b || e[20] !== x || e[21] !== C ? (A = /* @__PURE__ */ a(bn, { questions: b, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: x, onCustomAnswerChange: C }), e[17] = o, e[18] = s, e[19] = b, e[20] = x, e[21] = C, e[22] = A) : A = e[22];
493
552
  let w;
494
- e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== C ? (w = /* @__PURE__ */ l(Z, { id: h, role: g, "aria-labelledby": b, gap: "0", children: C }), e[23] = h, e[24] = g, e[25] = b, e[26] = C, e[27] = w) : w = e[27];
495
- let R;
496
- return e[28] !== f || e[29] !== w ? (R = /* @__PURE__ */ T(Z, { gap: "xs", pb: "sm", children: [
497
- f,
553
+ e[23] !== h || e[24] !== g || e[25] !== y || e[26] !== A ? (w = /* @__PURE__ */ a(Y, { id: h, role: g, "aria-labelledby": y, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = y, e[26] = A, e[27] = w) : w = e[27];
554
+ let _;
555
+ return e[28] !== p || e[29] !== w ? (_ = /* @__PURE__ */ k(Y, { gap: "xs", pb: "sm", children: [
556
+ p,
498
557
  w
499
- ] }), e[28] = f, e[29] = w, e[30] = R) : R = e[30], R;
500
- }, Ks = (t) => {
501
- const e = k(8), {
558
+ ] }), e[28] = p, e[29] = w, e[30] = _) : _ = e[30], _;
559
+ }, ls = (t) => {
560
+ const e = T(8), {
502
561
  questionPrompt: n
503
562
  } = t;
504
- let o;
505
- e[0] !== n ? (o = Ns(n), e[0] = n, e[1] = o) : o = e[1];
506
- const s = o;
563
+ let s;
564
+ e[0] !== n ? (s = os(n), e[0] = n, e[1] = s) : s = e[1];
565
+ const o = s;
507
566
  let r;
508
567
  e[2] !== n ? (r = Bt(n), e[2] = n, e[3] = r) : r = e[3];
509
568
  const i = r;
510
- let a;
511
- return e[4] !== t || e[5] !== i || e[6] !== s ? (a = /* @__PURE__ */ l(Us, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = a) : a = e[7], a;
512
- }, Gs = (t) => {
513
- const e = k(22);
514
- let n, o, s, r;
569
+ let l;
570
+ return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ a(is, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
571
+ }, as = (t) => {
572
+ const e = T(22);
573
+ let n, s, o, r;
515
574
  e[0] !== t ? ({
516
575
  title: r,
517
- shortcut: s,
576
+ shortcut: o,
518
577
  canInterrupt: n,
519
- ...o
520
- } = 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]);
521
- const i = o["aria-label"] ?? r;
522
- let a;
523
- e[5] !== n ? (a = n ? /* @__PURE__ */ l(Vn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ l(jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = a) : a = e[6];
524
- const c = a;
578
+ ...s
579
+ } = 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]);
580
+ const i = s["aria-label"] ?? r;
581
+ let l;
582
+ e[5] !== n ? (l = n ? /* @__PURE__ */ a(Zn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ a(eo, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
583
+ const c = l;
525
584
  let u;
526
- e[7] !== i || e[8] !== c || e[9] !== o || e[10] !== r ? (u = /* @__PURE__ */ l(vt, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...o, children: c }), e[7] = i, e[8] = c, e[9] = o, e[10] = r, e[11] = u) : u = e[11];
585
+ e[7] !== i || e[8] !== c || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ a(Ft, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...s, children: c }), e[7] = i, e[8] = c, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
527
586
  const d = u;
528
587
  if (r) {
529
- let p;
530
- e[12] !== s || e[13] !== r ? (p = s ? /* @__PURE__ */ T(Lt, { children: [
588
+ let f;
589
+ e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k($t, { children: [
531
590
  r,
532
591
  " ",
533
- /* @__PURE__ */ l(Fn, { fontSize: "xs", children: s })
534
- ] }) : r, e[12] = s, e[13] = r, e[14] = p) : p = e[14];
535
- const m = p;
536
- let f;
537
- e[15] !== d ? (f = /* @__PURE__ */ l(it.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = f) : f = e[16];
592
+ /* @__PURE__ */ a(Vn, { fontSize: "xs", children: o })
593
+ ] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
594
+ const m = f;
595
+ let p;
596
+ e[15] !== d ? (p = /* @__PURE__ */ a(dt.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
538
597
  let h;
539
- e[17] !== m ? (h = /* @__PURE__ */ l(Dn, { children: /* @__PURE__ */ l(it.Positioner, { children: /* @__PURE__ */ l(it.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
598
+ e[17] !== m ? (h = /* @__PURE__ */ a(Nn, { children: /* @__PURE__ */ a(dt.Positioner, { children: /* @__PURE__ */ a(dt.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
540
599
  let g;
541
- return e[19] !== f || e[20] !== h ? (g = /* @__PURE__ */ T(it.Root, { closeDelay: 50, openDelay: 100, children: [
542
- f,
600
+ return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(dt.Root, { closeDelay: 50, openDelay: 100, children: [
601
+ p,
543
602
  h
544
- ] }), e[19] = f, e[20] = h, e[21] = g) : g = e[21], g;
603
+ ] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
545
604
  }
546
605
  return d;
547
- }, Xs = (t) => {
548
- const e = k(94), {
606
+ }, cs = (t) => {
607
+ const e = T(2), {
608
+ placeholder: n
609
+ } = t;
610
+ if (!n)
611
+ return null;
612
+ let s;
613
+ return e[0] !== n ? (s = /* @__PURE__ */ a(X, { 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;
614
+ }, us = (t) => {
615
+ const e = T(101), {
549
616
  defaultState: n,
550
- onSubmit: o,
551
- onInterrupt: s,
552
- streaming: r,
553
- attachedResources: i,
554
- onClearAttachments: a,
555
- isDisabled: c,
556
- onChange: u,
557
- placeholder: d,
558
- attachmentList: p,
559
- actions: m,
560
- attachedToTop: f,
561
- questionPrompt: h,
562
- autoFocus: g
563
- } = t, b = o === void 0 ? Ys : o, y = r === void 0 ? !1 : r;
564
- let x;
565
- e[0] !== i ? (x = i === void 0 ? [] : i, e[0] = i, e[1] = x) : x = e[1];
566
- const _ = x, C = c === void 0 ? !1 : c, w = f === void 0 ? !1 : f, R = g === void 0 ? !1 : g, [B, M] = G(!1), [P, Q] = G(n), [L, H] = G(0);
617
+ onSubmit: s,
618
+ onInterrupt: o,
619
+ onAttachFiles: r,
620
+ onAttachText: i,
621
+ textAttachmentPasteLineThreshold: l,
622
+ streaming: c,
623
+ attachedResources: u,
624
+ onClearAttachments: d,
625
+ isDisabled: f,
626
+ onChange: m,
627
+ placeholder: p,
628
+ attachmentList: h,
629
+ actions: g,
630
+ attachedToTop: y,
631
+ questionPrompt: b,
632
+ autoFocus: x
633
+ } = t, C = s === void 0 ? ds : s, A = l === void 0 ? hn : l, w = c === void 0 ? !1 : c;
634
+ let _;
635
+ e[0] !== u ? (_ = u === void 0 ? [] : u, e[0] = u, e[1] = _) : _ = e[1];
636
+ const M = _, P = f === void 0 ? !1 : f, v = y === void 0 ? !1 : y, L = x === void 0 ? !1 : x, [q, J] = G(!1), [B, ve] = G(n), [je, Le] = G(0);
637
+ let he;
638
+ e[2] !== n ? (he = () => Et(n), e[2] = n, e[3] = he) : he = e[3];
639
+ const [F, z] = G(he);
567
640
  let ee;
568
- e[2] !== n ? (ee = () => At(n), e[2] = n, e[3] = ee) : ee = e[3];
569
- const [_e, Ae] = G(ee);
570
- let $;
571
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = {}, e[4] = $) : $ = e[4];
572
- const [E, te] = G($);
573
- let W;
574
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = {}, e[5] = W) : W = e[5];
575
- const [O, fe] = G(W), Re = Qe(null), We = Qe(u);
576
- let Pe;
577
- e[6] !== h ? (Pe = Bt(h), e[6] = h, e[7] = Pe) : Pe = e[7];
578
- const Ye = Qe(Pe);
579
- let Le, ne;
580
- e[8] !== u ? (Le = () => {
581
- We.current = u;
582
- }, ne = [u], e[8] = u, e[9] = Le, e[10] = ne) : (Le = e[9], ne = e[10]), Te(Le, ne);
583
- let se, Ne;
584
- e[11] !== n ? (se = () => {
585
- const A = At(n);
586
- Q(n), H(Js), Ae(A), te({}), fe({}), We.current?.(A);
587
- }, Ne = [n], e[11] = n, e[12] = se, e[13] = Ne) : (se = e[12], Ne = e[13]), Te(se, Ne);
588
- let pe;
589
- e[14] !== h ? (pe = Bt(h), e[14] = h, e[15] = pe) : pe = e[15];
590
- const X = pe;
591
- let me, he;
592
- e[16] !== X ? (me = () => {
593
- Ye.current !== X && (Ye.current = X, te({}), fe({}));
594
- }, he = [X], e[16] = X, e[17] = me, e[18] = he) : (me = e[17], he = e[18]), Te(me, he);
595
- let oe;
596
- e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (oe = () => {
597
- const A = Re.current?.querySelector('[contenteditable="true"]');
598
- A instanceof HTMLElement && A.focus();
599
- }, e[19] = oe) : oe = e[19];
600
- const Ie = oe;
601
- let ve, N;
602
- e[20] !== R ? (ve = () => {
603
- if (!R)
641
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = {}, e[4] = ee) : ee = e[4];
642
+ const [E, ge] = G(ee);
643
+ let be;
644
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = {}, e[5] = be) : be = e[5];
645
+ const [O, De] = G(be), Ue = Ne(null), Ke = Ne(m);
646
+ let Be;
647
+ e[6] !== b ? (Be = Bt(b), e[6] = b, e[7] = Be) : Be = e[7];
648
+ const Ie = Ne(Be);
649
+ let te, Ge;
650
+ e[8] !== m ? (te = () => {
651
+ Ke.current = m;
652
+ }, Ge = [m], e[8] = m, e[9] = te, e[10] = Ge) : (te = e[9], Ge = e[10]), Ae(te, Ge);
653
+ let ye, ne;
654
+ e[11] !== n ? (ye = () => {
655
+ const R = Et(n);
656
+ ve(n), Le(fs), z(R), ge({}), De({}), Ke.current?.(R);
657
+ }, ne = [n], e[11] = n, e[12] = ye, e[13] = ne) : (ye = e[12], ne = e[13]), Ae(ye, ne);
658
+ let xe;
659
+ e[14] !== b ? (xe = Bt(b), e[14] = b, e[15] = xe) : xe = e[15];
660
+ const oe = xe;
661
+ let se, re;
662
+ e[16] !== oe ? (se = () => {
663
+ Ie.current !== oe && (Ie.current = oe, ge({}), De({}));
664
+ }, re = [oe], e[16] = oe, e[17] = se, e[18] = re) : (se = e[17], re = e[18]), Ae(se, re);
665
+ let Oe;
666
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Oe = () => {
667
+ const R = Ue.current?.querySelector('[contenteditable="true"]');
668
+ R instanceof HTMLElement && R.focus();
669
+ }, e[19] = Oe) : Oe = e[19];
670
+ const ie = Oe;
671
+ let Se, Q;
672
+ e[20] !== L ? (Se = () => {
673
+ if (!L)
604
674
  return;
605
- const A = requestAnimationFrame(() => {
606
- const Se = Re.current?.querySelector('[contenteditable="true"]');
607
- Se instanceof HTMLElement && Se.focus(), M(!0);
675
+ const R = requestAnimationFrame(() => {
676
+ const ke = Ue.current?.querySelector('[contenteditable="true"]');
677
+ ke instanceof HTMLElement && ke.focus(), J(!0);
608
678
  });
609
- return () => cancelAnimationFrame(A);
610
- }, N = [R], e[20] = R, e[21] = ve, e[22] = N) : (ve = e[21], N = e[22]), Te(ve, N);
611
- let ge;
612
- e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = () => {
613
- M(!0), Ie();
614
- }, e[23] = ge) : ge = e[23];
615
- const be = ge;
616
- let V;
617
- e[24] !== n ? (V = (A) => {
618
- const Se = A === void 0 ? !1 : A;
619
- Q(n), H(Zs);
620
- const ie = At(n);
621
- Ae(ie), te({}), fe({}), We.current?.(ie), Se && requestAnimationFrame(() => {
622
- Ie();
679
+ return () => cancelAnimationFrame(R);
680
+ }, Q = [L], e[20] = L, e[21] = Se, e[22] = Q) : (Se = e[21], Q = e[22]), Ae(Se, Q);
681
+ let W;
682
+ e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => {
683
+ J(!0), ie();
684
+ }, e[23] = W) : W = e[23];
685
+ const Te = W;
686
+ let N;
687
+ e[24] !== n ? (N = (R) => {
688
+ const ke = R === void 0 ? !1 : R;
689
+ ve(n), Le(ps);
690
+ const ce = Et(n);
691
+ z(ce), ge({}), De({}), Ke.current?.(ce), ke && requestAnimationFrame(() => {
692
+ ie();
623
693
  });
624
- }, e[24] = n, e[25] = V) : V = e[25];
625
- const Y = V, D = y && !!s;
626
- let F, z, j;
627
- if (e[26] !== D || e[27] !== O || e[28] !== C || e[29] !== h || e[30] !== E || e[31] !== y || e[32] !== _e) {
628
- z = h ? Qs(h, E, O) : _e.trim();
629
- const A = Ws(h, E, O);
630
- F = {
631
- canInterrupt: D,
632
- isDisabled: C || A,
633
- streaming: y,
634
- text: z
635
- }, j = Ls(F), e[26] = D, e[27] = O, e[28] = C, e[29] = h, e[30] = E, e[31] = y, e[32] = _e, e[33] = F, e[34] = z, e[35] = j;
694
+ }, e[24] = n, e[25] = N) : N = e[25];
695
+ const Z = N, V = w && !!o;
696
+ let $, D, j;
697
+ if (e[26] !== V || e[27] !== O || e[28] !== P || e[29] !== b || e[30] !== E || e[31] !== w || e[32] !== F) {
698
+ D = b ? es(b, E, O) : F.trim();
699
+ const R = ns(b, E, O);
700
+ $ = {
701
+ canInterrupt: V,
702
+ isDisabled: P || R,
703
+ streaming: w,
704
+ text: D
705
+ }, j = No($), e[26] = V, e[27] = O, e[28] = P, e[29] = b, e[30] = E, e[31] = w, e[32] = F, e[33] = $, e[34] = D, e[35] = j;
636
706
  } else
637
- F = e[33], z = e[34], j = e[35];
707
+ $ = e[33], D = e[34], j = e[35];
638
708
  const U = j;
639
- let K;
640
- e[36] !== _ || e[37] !== O || e[38] !== a || e[39] !== b || e[40] !== h || e[41] !== Y || e[42] !== z || e[43] !== E ? (K = () => {
641
- if (!z)
709
+ let le;
710
+ e[36] !== M || e[37] !== O || e[38] !== d || e[39] !== C || e[40] !== b || e[41] !== Z || e[42] !== D || e[43] !== E ? (le = () => {
711
+ if (!D)
642
712
  return;
643
- const A = h ? {
644
- answers: Hs(h, E, O)
713
+ const R = b ? {
714
+ answers: ts(b, E, O)
645
715
  } : void 0;
646
- b(z, _, A), Y(!0), a?.();
647
- }, e[36] = _, e[37] = O, e[38] = a, e[39] = b, e[40] = h, e[41] = Y, e[42] = z, e[43] = E, e[44] = K) : K = e[44];
648
- const J = K;
649
- let re;
650
- e[45] !== s || e[46] !== J ? (re = (A) => {
651
- if (A === "interrupt") {
652
- s?.();
716
+ C(D, M, R), Z(!0), d?.();
717
+ }, e[36] = M, e[37] = O, e[38] = d, e[39] = C, e[40] = b, e[41] = Z, e[42] = D, e[43] = E, e[44] = le) : le = e[44];
718
+ const H = le;
719
+ let we;
720
+ e[45] !== o || e[46] !== H ? (we = (R) => {
721
+ if (R === "interrupt") {
722
+ o?.();
653
723
  return;
654
724
  }
655
- A === "submit" && J();
656
- }, e[45] = s, e[46] = J, e[47] = re) : re = e[47];
657
- const v = re;
658
- let ye;
659
- e[48] !== F || e[49] !== v ? (ye = () => {
660
- v(Ps(F));
661
- }, e[48] = F, e[49] = v, e[50] = ye) : ye = e[50];
662
- const xe = ye;
663
- let Je;
664
- e[51] !== U || e[52] !== v ? (Je = () => {
665
- v(U);
666
- }, e[51] = U, e[52] = v, e[53] = Je) : Je = e[53];
667
- const mt = Je;
668
- let Ze;
669
- e[54] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ze = (A, Se, ie) => {
670
- const Ve = ae(A, Se);
671
- te((je) => {
672
- const _t = je[Ve] ?? [], qt = _t.includes(ie);
673
- return A.multiple ? {
674
- ...je,
675
- [Ve]: qt ? _t.filter((Bn) => Bn !== ie) : [..._t, ie]
725
+ R === "submit" && H();
726
+ }, e[45] = o, e[46] = H, e[47] = we) : we = e[47];
727
+ const K = we;
728
+ let nt;
729
+ e[48] !== $ || e[49] !== K ? (nt = () => K(Wo($)), e[48] = $, e[49] = K, e[50] = nt) : nt = e[50];
730
+ const xt = nt;
731
+ let ot;
732
+ e[51] !== U || e[52] !== K ? (ot = () => K(U), e[51] = U, e[52] = K, e[53] = ot) : ot = e[53];
733
+ const St = ot;
734
+ let st;
735
+ e[54] !== r || e[55] !== i || e[56] !== A ? (st = jo({
736
+ onAttachFiles: r,
737
+ onAttachText: i,
738
+ textAttachmentPasteLineThreshold: A
739
+ }), e[54] = r, e[55] = i, e[56] = A, e[57] = st) : st = e[57];
740
+ const ae = st;
741
+ let rt;
742
+ e[58] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (R, ke, ce) => {
743
+ const Xe = de(R, ke);
744
+ ge((Ye) => {
745
+ const Mt = Ye[Xe] ?? [], jt = Mt.includes(ce);
746
+ return R.multiple ? {
747
+ ...Ye,
748
+ [Xe]: jt ? Mt.filter((Fn) => Fn !== ce) : [...Mt, ce]
676
749
  } : {
677
- ...je,
678
- [Ve]: qt ? [] : [ie]
750
+ ...Ye,
751
+ [Xe]: jt ? [] : [ce]
679
752
  };
680
753
  });
681
- }, e[54] = Ze) : Ze = e[54];
682
- const Mn = Ze;
683
- let et;
684
- e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (et = (A, Se, ie) => {
685
- const Ve = ae(A, Se);
686
- fe((je) => ({
687
- ...je,
688
- [Ve]: ie
754
+ }, e[58] = rt) : rt = e[58];
755
+ const On = rt;
756
+ let it;
757
+ e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (it = (R, ke, ce) => {
758
+ const Xe = de(R, ke);
759
+ De((Ye) => ({
760
+ ...Ye,
761
+ [Xe]: ce
689
762
  }));
690
- }, e[55] = et) : et = e[55];
691
- const En = et;
692
- let tt;
693
- e[56] !== d ? (tt = d ? /* @__PURE__ */ l(q, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: d }) : void 0, e[56] = d, e[57] = tt) : tt = e[57];
694
- const ht = tt, gt = w ? "-1px" : void 0, bt = w ? "0" : void 0, yt = B ? "blue.border" : "border.muted", xt = B ? "mid" : "low", St = B ? 1 : 0, kt = B ? "blue.border" : "border";
763
+ }, e[59] = it) : it = e[59];
764
+ const $n = it, Tt = v ? "-1px" : void 0, wt = v ? "0" : void 0, kt = q ? "blue.border" : "border.muted", Ct = q ? "mid" : "low", At = q ? 1 : 0, _t = q ? "blue.border" : "border";
695
765
  let $e;
696
- e[58] !== kt ? ($e = {
697
- borderColor: kt,
766
+ e[60] !== _t ? ($e = {
767
+ borderColor: _t,
698
768
  boxShadow: "mid",
699
769
  zIndex: 1
700
- }, e[58] = kt, e[59] = $e) : $e = e[59];
701
- let nt;
702
- e[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (nt = {
770
+ }, e[60] = _t, e[61] = $e) : $e = e[61];
771
+ let lt;
772
+ e[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = {
703
773
  borderColor: "blue.border",
704
774
  boxShadow: "mid",
705
775
  zIndex: 1
706
- }, e[60] = nt) : nt = e[60];
707
- let st;
708
- e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (st = () => M(!1), e[61] = st) : st = e[61];
709
- let Oe;
710
- e[62] !== O || e[63] !== L || e[64] !== P || e[65] !== xe || e[66] !== C || e[67] !== u || e[68] !== ht || e[69] !== h || e[70] !== E ? (Oe = h ? /* @__PURE__ */ l(Ks, { questionPrompt: h, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Mn, onCustomAnswerChange: En }) : /* @__PURE__ */ l(ut, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
711
- pr: "2xs"
712
- }, children: /* @__PURE__ */ l(ds, { defaultState: P, isEditable: !C, placeholder: ht, onChange: (A) => {
713
- Ae(A), u?.(A);
714
- }, onSubmit: xe }, L) }), e[62] = O, e[63] = L, e[64] = P, e[65] = xe, e[66] = C, e[67] = u, e[68] = ht, e[69] = h, e[70] = E, e[71] = Oe) : Oe = e[71];
715
- let ot;
716
- e[72] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ot = /* @__PURE__ */ l(zn, {}), e[72] = ot) : ot = e[72];
717
- const Tt = D ? "Stop Response" : "Message Sending", wt = y ? void 0 : "Enter", Ct = U === "none";
718
- let De;
719
- e[73] !== D || e[74] !== mt || e[75] !== Tt || e[76] !== wt || e[77] !== Ct ? (De = /* @__PURE__ */ l(Gs, { canInterrupt: D, title: Tt, shortcut: wt, onClick: mt, disabled: Ct }), e[73] = D, e[74] = mt, e[75] = Tt, e[76] = wt, e[77] = Ct, e[78] = De) : De = e[78];
776
+ }, e[62] = lt) : lt = e[62];
777
+ let at;
778
+ e[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (at = () => J(!1), e[63] = at) : at = e[63];
720
779
  let Fe;
721
- e[79] !== m || e[80] !== De ? (Fe = /* @__PURE__ */ T(Ee, { gap: "1", mt: "md", children: [
722
- m,
723
- ot,
724
- De
725
- ] }), e[79] = m, e[80] = De, e[81] = Fe) : Fe = e[81];
780
+ e[64] !== h ? (Fe = h ? /* @__PURE__ */ a(I, { mb: "xs", children: h }) : null, e[64] = h, e[65] = Fe) : Fe = e[65];
726
781
  let ze;
727
- e[82] !== p || e[83] !== Oe || e[84] !== Fe ? (ze = /* @__PURE__ */ T(Ce, { direction: "column", color: "fg", children: [
728
- p,
729
- Oe,
730
- Fe
731
- ] }), e[82] = p, e[83] = Oe, e[84] = Fe, e[85] = ze) : ze = e[85];
732
- let rt;
733
- return e[86] !== gt || e[87] !== bt || e[88] !== yt || e[89] !== xt || e[90] !== St || e[91] !== $e || e[92] !== ze ? (rt = /* @__PURE__ */ l(I, { ref: Re, position: "relative", width: "100%", paddingX: "xs", paddingY: "md", mt: gt, bg: "bg", borderRadius: "md", borderTopRadius: bt, borderWidth: "1px", borderStyle: "solid", borderColor: yt, boxShadow: xt, zIndex: St, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: $e, _focusWithin: nt, onClick: be, onBlur: st, children: ze }), e[86] = gt, e[87] = bt, e[88] = yt, e[89] = xt, e[90] = St, e[91] = $e, e[92] = ze, e[93] = rt) : rt = e[93], rt;
782
+ e[66] !== O || e[67] !== je || e[68] !== B || e[69] !== xt || e[70] !== P || e[71] !== m || e[72] !== p || e[73] !== b || e[74] !== E ? (ze = b ? /* @__PURE__ */ a(ls, { questionPrompt: b, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: On, onCustomAnswerChange: $n }) : /* @__PURE__ */ a(ht, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
783
+ pr: "2xs"
784
+ }, children: /* @__PURE__ */ a(To, { defaultState: B, isEditable: !P, placeholder: /* @__PURE__ */ a(cs, { placeholder: p }), onChange: (R) => {
785
+ z(R), m?.(R);
786
+ }, onSubmit: xt }, je) }), e[66] = O, e[67] = je, e[68] = B, e[69] = xt, e[70] = P, e[71] = m, e[72] = p, e[73] = b, e[74] = E, e[75] = ze) : ze = e[75];
787
+ let ct;
788
+ e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = /* @__PURE__ */ a(jn, {}), e[76] = ct) : ct = e[76];
789
+ const Rt = V ? "Stop Response" : "Message Sending", It = w ? void 0 : "Enter", Pt = U === "none";
790
+ let qe;
791
+ e[77] !== V || e[78] !== St || e[79] !== Rt || e[80] !== It || e[81] !== Pt ? (qe = /* @__PURE__ */ a(as, { canInterrupt: V, title: Rt, shortcut: It, onClick: St, disabled: Pt }), e[77] = V, e[78] = St, e[79] = Rt, e[80] = It, e[81] = Pt, e[82] = qe) : qe = e[82];
792
+ let He;
793
+ e[83] !== g || e[84] !== qe ? (He = /* @__PURE__ */ k(Me, { gap: "1", mt: "md", children: [
794
+ g,
795
+ ct,
796
+ qe
797
+ ] }), e[83] = g, e[84] = qe, e[85] = He) : He = e[85];
798
+ let Qe;
799
+ e[86] !== Fe || e[87] !== ze || e[88] !== He ? (Qe = /* @__PURE__ */ k(Re, { direction: "column", color: "fg", children: [
800
+ Fe,
801
+ ze,
802
+ He
803
+ ] }), e[86] = Fe, e[87] = ze, e[88] = He, e[89] = Qe) : Qe = e[89];
804
+ let ut;
805
+ return e[90] !== ae.onDragOver || e[91] !== ae.onDropCapture || e[92] !== ae.onPasteCapture || e[93] !== Tt || e[94] !== wt || e[95] !== kt || e[96] !== Ct || e[97] !== At || e[98] !== $e || e[99] !== Qe ? (ut = /* @__PURE__ */ a(I, { ref: Ue, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Tt, bg: "bg", borderRadius: "md", borderTopRadius: wt, borderWidth: "1px", borderStyle: "solid", borderColor: kt, boxShadow: Ct, zIndex: At, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: $e, _focusWithin: lt, onPasteCapture: ae.onPasteCapture, onDropCapture: ae.onDropCapture, onDragOver: ae.onDragOver, onClick: Te, onBlur: at, children: Qe }), e[90] = ae.onDragOver, e[91] = ae.onDropCapture, e[92] = ae.onPasteCapture, e[93] = Tt, e[94] = wt, e[95] = kt, e[96] = Ct, e[97] = At, e[98] = $e, e[99] = Qe, e[100] = ut) : ut = e[100], ut;
734
806
  };
735
- function Ys() {
807
+ function ds() {
736
808
  }
737
- function Js(t) {
809
+ function fs(t) {
738
810
  return t + 1;
739
811
  }
740
- function Zs(t) {
812
+ function ps(t) {
741
813
  return t + 1;
742
814
  }
743
- const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh, 4rem)", dn = "min(70dvh, calc(100dvh - 12rem), 22rem)", It = 1, oo = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
815
+ const ms = (t = "") => JSON.stringify(wo(t)), hs = 360, gs = 4, bs = "min(10vh, 4rem)", yn = "min(70dvh, calc(100dvh - 12rem), 22rem)", Lt = 1, ys = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
744
816
  lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
745
817
  textLength: e.textLength + n.text.length
746
818
  }, {
747
819
  lineCount: 0,
748
820
  textLength: 0
749
- }), ro = (t) => {
821
+ }), xs = (t) => {
750
822
  if (t.role !== "user") return !1;
751
823
  const {
752
824
  lineCount: e,
753
825
  textLength: n
754
- } = oo(t);
755
- return n > to || e > no;
756
- }, io = (t, e) => {
826
+ } = ys(t);
827
+ return n > hs || e > gs;
828
+ }, Ss = (t, e) => {
757
829
  const n = Math.max(0, t.scrollHeight - t.clientHeight);
758
- return e === 0 || n <= It ? !1 : e < 0 ? t.scrollTop > It : t.scrollTop < n - It;
759
- }, lo = (t) => t.type === "text", ao = (t) => (t.parts ?? []).filter(lo).map((e) => e.text.trim()).filter(Boolean).join(`
830
+ return e === 0 || n <= Lt ? !1 : e < 0 ? t.scrollTop > Lt : t.scrollTop < n - Lt;
831
+ }, Ts = (t) => t.type === "text", ws = (t) => (t.parts ?? []).filter(Ts).map((e) => e.text.trim()).filter(Boolean).join(`
760
832
 
761
- `), co = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
833
+ `), ks = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
762
834
  hour: "numeric",
763
835
  minute: "2-digit",
764
836
  timeZone: n
765
- }).format(new Date(t.createdAt)) : "", Pt = (t) => {
766
- const e = k(20), {
837
+ }).format(new Date(t.createdAt)) : "", Ot = (t) => {
838
+ const e = T(20), {
767
839
  message: n,
768
- alwaysVisible: o,
769
- copyAlwaysVisible: s
770
- } = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [a, c] = G(!1), u = Qe(null);
840
+ alwaysVisible: s,
841
+ copyAlwaysVisible: o
842
+ } = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, c] = G(!1), u = Ne(null);
771
843
  let d;
772
- e[0] !== n ? (d = ao(n), e[0] = n, e[1] = d) : d = e[1];
773
- const p = d;
844
+ e[0] !== n ? (d = ws(n), e[0] = n, e[1] = d) : d = e[1];
845
+ const f = d;
774
846
  let m;
775
- e[2] !== n ? (m = co(n), e[2] = n, e[3] = m) : m = e[3];
776
- const f = m;
847
+ e[2] !== n ? (m = ks(n), e[2] = n, e[3] = m) : m = e[3];
848
+ const p = m;
777
849
  let h, g;
778
850
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
779
851
  u.current !== null && window.clearTimeout(u.current);
780
- }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Te(h, g);
781
- let b;
782
- e[6] !== p ? (b = async () => {
783
- if (p)
852
+ }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Ae(h, g);
853
+ let y;
854
+ e[6] !== f ? (y = async () => {
855
+ if (f)
784
856
  try {
785
- await navigator.clipboard.writeText(p), c(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => c(!1), 1200);
857
+ await navigator.clipboard.writeText(f), c(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => c(!1), 1200);
786
858
  } catch {
787
859
  c(!1);
788
860
  }
789
- }, e[6] = p, e[7] = b) : b = e[7];
790
- const y = b;
791
- if (!p && !f)
861
+ }, e[6] = f, e[7] = y) : y = e[7];
862
+ const b = y;
863
+ if (!f && !p)
792
864
  return null;
793
- const x = r ? "1" : "0", _ = r ? "auto" : "none";
794
- let C;
795
- e[8] !== f ? (C = f ? /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: f }) : null, e[8] = f, e[9] = C) : C = e[9];
865
+ const x = r ? "1" : "0", C = r ? "auto" : "none";
866
+ let A;
867
+ e[8] !== p ? (A = p ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
796
868
  let w;
797
- e[10] !== i || e[11] !== y || e[12] !== p || e[13] !== a ? (w = p ? /* @__PURE__ */ l(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Wt, children: /* @__PURE__ */ l(sn, { content: a ? "Copied" : "Copy message", children: /* @__PURE__ */ l(vt, { "aria-label": a ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: a ? /* @__PURE__ */ l(en, { size: 12 }) : /* @__PURE__ */ l(Un, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = p, e[13] = a, e[14] = w) : w = e[14];
798
- let R;
799
- return e[15] !== w || e[16] !== x || e[17] !== _ || e[18] !== C ? (R = /* @__PURE__ */ T(Ee, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: _, transition: "opacity 120ms ease", css: Wt, children: [
800
- C,
869
+ e[10] !== i || e[11] !== b || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ a(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Gt, children: /* @__PURE__ */ a(un, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ a(Ft, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: b, children: l ? /* @__PURE__ */ a(ln, { size: 12 }) : /* @__PURE__ */ a(to, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = b, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
870
+ let _;
871
+ return e[15] !== w || e[16] !== x || e[17] !== C || e[18] !== A ? (_ = /* @__PURE__ */ k(Me, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: C, transition: "opacity 120ms ease", css: Gt, children: [
872
+ A,
801
873
  w
802
- ] }), e[15] = w, e[16] = x, e[17] = _, e[18] = C, e[19] = R) : R = e[19], R;
803
- }, Wt = {
874
+ ] }), e[15] = w, e[16] = x, e[17] = C, e[18] = A, e[19] = _) : _ = e[19], _;
875
+ }, Gt = {
804
876
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
805
877
  opacity: 1,
806
878
  pointerEvents: "auto"
@@ -813,44 +885,44 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
813
885
  opacity: 1,
814
886
  pointerEvents: "auto"
815
887
  }
816
- }, uo = (t) => {
817
- const e = k(8);
818
- let n, o;
888
+ }, Cs = (t) => {
889
+ const e = T(8);
890
+ let n, s;
819
891
  e[0] !== t ? ({
820
892
  children: n,
821
- ...o
822
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
823
- let s;
824
- e[3] !== n ? (s = /* @__PURE__ */ l(on, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
893
+ ...s
894
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
895
+ let o;
896
+ e[3] !== n ? (o = /* @__PURE__ */ a(dn, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
825
897
  let r;
826
- return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ l(I, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
827
- }, fo = uo, dt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), po = (t) => {
828
- const e = dt(t), n = e.replace(/_/g, "");
898
+ return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ a(I, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
899
+ }, As = Cs, gt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), _s = (t) => {
900
+ const e = gt(t), n = e.replace(/_/g, "");
829
901
  return [.../* @__PURE__ */ new Set([t, e, n])];
830
- }, fn = {
831
- shell: tn,
832
- ls: ts,
833
- read_file: es,
834
- write_file: Zn,
835
- delete_file: Jn,
836
- patch: Yn,
837
- upload_files: Xn,
838
- download_file: Gn,
839
- move_file: Kn
840
- }, mo = {
841
- dot: ls,
842
- danger: nn,
843
- search: is,
844
- browser: rs,
845
- file: os,
846
- question: ss,
847
- todo: ns,
848
- terminal: tn,
849
- ...fn
850
- }, Nt = "dot", ho = (t) => Object.hasOwn(fn, t), go = (t) => mo[t], pn = (t) => {
851
- if (!t) return Nt;
852
- const e = dt(t);
853
- if (ho(e)) return e;
902
+ }, xn = {
903
+ shell: an,
904
+ ls: co,
905
+ read_file: ao,
906
+ write_file: lo,
907
+ delete_file: io,
908
+ patch: ro,
909
+ upload_files: so,
910
+ download_file: oo,
911
+ move_file: no
912
+ }, Rs = {
913
+ dot: go,
914
+ danger: cn,
915
+ search: ho,
916
+ browser: mo,
917
+ file: po,
918
+ question: fo,
919
+ todo: uo,
920
+ terminal: an,
921
+ ...xn
922
+ }, Xt = "dot", Is = (t) => Object.hasOwn(xn, t), Ps = (t) => Rs[t], Sn = (t) => {
923
+ if (!t) return Xt;
924
+ const e = gt(t);
925
+ if (Is(e)) return e;
854
926
  const n = e.replace(/_/g, "");
855
927
  switch (e) {
856
928
  case "read":
@@ -877,52 +949,52 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
877
949
  case "file":
878
950
  return "file";
879
951
  default:
880
- return n === "todowrite" || n === "todo" ? "todo" : Nt;
952
+ return n === "todowrite" || n === "todo" ? "todo" : Xt;
881
953
  }
882
954
  };
883
- function Dt(t) {
955
+ function Qt(t) {
884
956
  const e = t.lastIndexOf("/");
885
957
  return e >= 0 ? t.slice(e + 1) : t;
886
958
  }
887
- function lt(t) {
959
+ function ft(t) {
888
960
  if (!t) return null;
889
961
  const e = t.split(" ")[0].trim();
890
962
  if (e === "/dev/null") return null;
891
963
  let n = e;
892
964
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
893
965
  }
894
- const ft = (t) => t.startsWith("--- "), Ft = (t) => t.startsWith("+++ "), zt = (t) => t.startsWith("@@"), bo = (t) => t.startsWith("+") && !(Ft(t) || t === "+++"), yo = (t) => t.startsWith("-") && !(ft(t) || t === "---"), xo = (t, e) => {
966
+ const bt = (t) => t.startsWith("--- "), Wt = (t) => t.startsWith("+++ "), Nt = (t) => t.startsWith("@@"), Ms = (t) => t.startsWith("+") && !(Wt(t) || t === "+++"), Es = (t) => t.startsWith("-") && !(bt(t) || t === "---"), vs = (t, e) => {
895
967
  t.has(e) || t.set(e, {
896
968
  additions: 0,
897
969
  deletions: 0
898
970
  });
899
- }, So = (t, e) => {
971
+ }, Ls = (t, e) => {
900
972
  const n = t.get(e);
901
973
  n && (n.additions += 1);
902
- }, ko = (t, e) => {
974
+ }, Ds = (t, e) => {
903
975
  const n = t.get(e);
904
976
  n && (n.deletions += 1);
905
- }, To = (t, e, n) => {
906
- if (ft(t))
977
+ }, Bs = (t, e, n) => {
978
+ if (bt(t))
907
979
  return {
908
980
  ...e,
909
- lastMinusHeader: lt(t.slice(4)),
981
+ lastMinusHeader: ft(t.slice(4)),
910
982
  inHunk: !1
911
983
  };
912
- if (Ft(t)) {
913
- const s = lt(t.slice(4)) ?? e.lastMinusHeader;
914
- return s && xo(n, s), {
984
+ if (Wt(t)) {
985
+ const o = ft(t.slice(4)) ?? e.lastMinusHeader;
986
+ return o && vs(n, o), {
915
987
  ...e,
916
- currentPath: s,
988
+ currentPath: o,
917
989
  inHunk: !1
918
990
  };
919
991
  }
920
- return e.currentPath ? zt(t) ? {
992
+ return e.currentPath ? Nt(t) ? {
921
993
  ...e,
922
994
  inHunk: !0
923
- } : e.inHunk ? bo(t) ? (So(n, e.currentPath), e) : (yo(t) && ko(n, e.currentPath), e) : e : e;
995
+ } : e.inHunk ? Ms(t) ? (Ls(n, e.currentPath), e) : (Es(t) && Ds(n, e.currentPath), e) : e : e;
924
996
  };
925
- function mn(t) {
997
+ function Tn(t) {
926
998
  if (!t || typeof t != "string") return [];
927
999
  const e = /* @__PURE__ */ new Map();
928
1000
  let n = {
@@ -930,34 +1002,34 @@ function mn(t) {
930
1002
  lastMinusHeader: null,
931
1003
  inHunk: !1
932
1004
  };
933
- const o = t.split(/\r?\n/);
934
- for (const s of o)
935
- n = To(s, n, e);
936
- return Array.from(e.entries()).map(([s, {
1005
+ const s = t.split(/\r?\n/);
1006
+ for (const o of s)
1007
+ n = Bs(o, n, e);
1008
+ return Array.from(e.entries()).map(([o, {
937
1009
  additions: r,
938
1010
  deletions: i
939
1011
  }]) => ({
940
- filePath: s,
1012
+ filePath: o,
941
1013
  additions: r,
942
1014
  deletions: i
943
1015
  }));
944
1016
  }
945
- function wo(t) {
946
- return mn(t).map((e) => ({
1017
+ function Os(t) {
1018
+ return Tn(t).map((e) => ({
947
1019
  kind: "diff",
948
- fileName: Dt(e.filePath),
1020
+ fileName: Qt(e.filePath),
949
1021
  filePath: e.filePath,
950
1022
  additions: e.additions,
951
1023
  deletions: e.deletions
952
1024
  }));
953
1025
  }
954
- function Co(t) {
955
- return mn(t).map((e) => e.filePath);
1026
+ function $s(t) {
1027
+ return Tn(t).map((e) => e.filePath);
956
1028
  }
957
- const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ao = (t, e, n) => {
1029
+ const wn = (t) => bt(t) || t.startsWith("diff --git "), Fs = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", zs = (t, e, n) => {
958
1030
  if (t.startsWith(" ")) {
959
- const o = t.slice(1);
960
- e.push(o), n.push(o);
1031
+ const s = t.slice(1);
1032
+ e.push(s), n.push(s);
961
1033
  return;
962
1034
  }
963
1035
  if (t.startsWith("-")) {
@@ -965,30 +1037,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
965
1037
  return;
966
1038
  }
967
1039
  t.startsWith("+") && n.push(t.slice(1));
968
- }, Ro = (t, e, n, o) => {
969
- let s = e;
970
- for (; s < t.length; ) {
971
- const r = t[s] || "";
972
- if (hn(r) || zt(r) || _o(r))
1040
+ }, qs = (t, e, n, s) => {
1041
+ let o = e;
1042
+ for (; o < t.length; ) {
1043
+ const r = t[o] || "";
1044
+ if (wn(r) || Nt(r) || Fs(r))
973
1045
  break;
974
- Ao(r, n, o), s += 1;
1046
+ zs(r, n, s), o += 1;
975
1047
  }
976
- return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
977
- }, Io = (t, e) => {
978
- const n = lt((t[e] || "").slice(4)), o = t[e + 1] || "";
979
- if (!Ft(o)) return {
1048
+ return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
1049
+ }, Hs = (t, e) => {
1050
+ const n = ft((t[e] || "").slice(4)), s = t[e + 1] || "";
1051
+ if (!Wt(s)) return {
980
1052
  nextIndex: e + 1
981
1053
  };
982
- const r = lt(o.slice(4)) ?? n ?? "", i = [], a = [];
1054
+ const r = ft(s.slice(4)) ?? n ?? "", i = [], l = [];
983
1055
  let c = e + 2;
984
1056
  for (; c < t.length; ) {
985
1057
  const u = t[c] || "";
986
- if (hn(u)) break;
987
- if (!zt(u)) {
1058
+ if (wn(u)) break;
1059
+ if (!Nt(u)) {
988
1060
  c += 1;
989
1061
  continue;
990
1062
  }
991
- c = Ro(t, c + 1, i, a);
1063
+ c = qs(t, c + 1, i, l);
992
1064
  }
993
1065
  return {
994
1066
  nextIndex: c,
@@ -996,30 +1068,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
996
1068
  filePath: r,
997
1069
  original: i.join(`
998
1070
  `),
999
- modified: a.join(`
1071
+ modified: l.join(`
1000
1072
  `)
1001
1073
  }
1002
1074
  };
1003
1075
  };
1004
- function Mo(t) {
1076
+ function Qs(t) {
1005
1077
  if (!t || typeof t != "string") return [];
1006
1078
  const e = t.split(/\r?\n/), n = [];
1007
- let o = 0;
1008
- for (; o < e.length; ) {
1009
- const s = e[o] || "";
1010
- if (!ft(s)) {
1011
- o += 1;
1079
+ let s = 0;
1080
+ for (; s < e.length; ) {
1081
+ const o = e[s] || "";
1082
+ if (!bt(o)) {
1083
+ s += 1;
1012
1084
  continue;
1013
1085
  }
1014
1086
  const {
1015
1087
  nextIndex: r,
1016
1088
  preview: i
1017
- } = Io(e, o);
1018
- i && n.push(i), o = Math.max(r, o + 1);
1089
+ } = Hs(e, s);
1090
+ i && n.push(i), s = Math.max(r, s + 1);
1019
1091
  }
1020
1092
  return n;
1021
1093
  }
1022
- const Eo = {
1094
+ const Ws = {
1023
1095
  apply_patch: "Apply patch",
1024
1096
  bash: "Run command",
1025
1097
  edit: "Edit file",
@@ -1028,7 +1100,7 @@ const Eo = {
1028
1100
  read: "Read file",
1029
1101
  skill: "Load skill",
1030
1102
  todowrite: "Update todos"
1031
- }, Vt = {
1103
+ }, Yt = {
1032
1104
  pending: "queued",
1033
1105
  error: "failed",
1034
1106
  "output-error": "failed",
@@ -1037,126 +1109,126 @@ const Eo = {
1037
1109
  running: "running",
1038
1110
  completed: "completed",
1039
1111
  failed: "failed"
1040
- }, gn = (t) => t.replace(/^tool-/, "").toLowerCase(), Bo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Po = (t) => gn(t.tool ?? "tool"), Lo = (t) => {
1041
- const e = gn(t);
1042
- return Eo[e] ?? Bo(e.replace(/_/g, " "));
1043
- }, vo = (t) => {
1112
+ }, kn = (t) => t.replace(/^tool-/, "").toLowerCase(), Ns = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Vs = (t) => kn(t.tool ?? "tool"), js = (t) => {
1113
+ const e = kn(t);
1114
+ return Ws[e] ?? Ns(e.replace(/_/g, " "));
1115
+ }, Us = (t) => {
1044
1116
  const e = t.state?.status ?? t.status;
1045
1117
  if (!e || typeof e != "string") return null;
1046
1118
  const n = e.replace(/-/g, "_");
1047
- return Vt[n] ? Vt[n] : n.includes("stream") ? "running" : null;
1048
- }, bn = (t) => {
1119
+ return Yt[n] ? Yt[n] : n.includes("stream") ? "running" : null;
1120
+ }, Cn = (t) => {
1049
1121
  const e = t.state?.status ?? t.status;
1050
1122
  return e === "error" || e === "output-error" || e === "failed";
1051
- }, ce = (t) => bn(t) ? {
1123
+ }, fe = (t) => Cn(t) ? {
1052
1124
  type: "icon",
1053
1125
  icon: "danger"
1054
1126
  } : {
1055
1127
  type: "icon",
1056
- icon: pn(Po(t))
1057
- }, ue = (t, e, n) => {
1058
- const s = [{
1128
+ icon: Sn(Vs(t))
1129
+ }, pe = (t, e, n) => {
1130
+ const o = [{
1059
1131
  kind: "text",
1060
- text: n ?? Lo(t.tool ?? "tool"),
1132
+ text: n ?? js(t.tool ?? "tool"),
1061
1133
  bold: !0
1062
1134
  }];
1063
- e && s.push({
1135
+ e && o.push({
1064
1136
  kind: "text",
1065
1137
  text: e,
1066
1138
  muted: !0
1067
1139
  });
1068
- const r = vo(t);
1069
- return r && r !== "completed" && s.push({
1140
+ const r = Us(t);
1141
+ return r && r !== "completed" && o.push({
1070
1142
  kind: "text",
1071
1143
  text: r,
1072
1144
  muted: !0
1073
- }), s;
1074
- }, Be = (t) => {
1145
+ }), o;
1146
+ }, Ee = (t) => {
1075
1147
  const e = t.state?.input;
1076
1148
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1077
- }, Ge = (t) => {
1149
+ }, et = (t) => {
1078
1150
  const e = t.state?.output;
1079
1151
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1080
- }, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, at = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, $o = (t, e) => {
1081
- const n = at(t.state);
1082
- return n ? at(n[e]) : null;
1083
- }, Oo = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Do = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), yn = (t) => {
1084
- const e = Ge(t);
1085
- return [$o(t, "metadata"), at(e?.metadata)].filter(Boolean);
1086
- }, Fo = (t) => {
1087
- const e = at(t);
1152
+ }, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Ks = (t, e) => {
1153
+ const n = pt(t.state);
1154
+ return n ? pt(n[e]) : null;
1155
+ }, Gs = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Xs = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), An = (t) => {
1156
+ const e = et(t);
1157
+ return [Ks(t, "metadata"), pt(e?.metadata)].filter(Boolean);
1158
+ }, Ys = (t) => {
1159
+ const e = pt(t);
1088
1160
  if (!e) return null;
1089
1161
  const n = S(e.filePath) ?? S(e.relativePath) ?? S(e.path);
1090
1162
  return n ? {
1091
- filePath: Oo(n),
1163
+ filePath: Gs(n),
1092
1164
  additions: typeof e.additions == "number" ? e.additions : 0,
1093
1165
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
1094
1166
  diff: S(e.diff) ?? void 0,
1095
1167
  before: S(e.before) ?? void 0,
1096
1168
  after: S(e.after) ?? void 0
1097
1169
  } : null;
1098
- }, xn = (t) => {
1170
+ }, _n = (t) => {
1099
1171
  const e = [];
1100
- for (const n of yn(t)) {
1101
- const o = Array.isArray(n.files) ? n.files : [];
1102
- for (const s of o) {
1103
- const r = Fo(s);
1172
+ for (const n of An(t)) {
1173
+ const s = Array.isArray(n.files) ? n.files : [];
1174
+ for (const o of s) {
1175
+ const r = Ys(o);
1104
1176
  r && e.push(r);
1105
1177
  }
1106
1178
  }
1107
1179
  return e;
1108
- }, zo = (t) => {
1109
- const e = Be(t), n = S(e?.diff);
1180
+ }, Js = (t) => {
1181
+ const e = Ee(t), n = S(e?.diff);
1110
1182
  if (n) return n;
1111
- for (const r of yn(t)) {
1183
+ for (const r of An(t)) {
1112
1184
  const i = S(r.diff);
1113
1185
  if (i) return i;
1114
1186
  }
1115
- const o = xn(t).map((r) => r.diff).filter((r) => !!r);
1116
- if (o.length > 0) return o.join(`
1187
+ const s = _n(t).map((r) => r.diff).filter((r) => !!r);
1188
+ if (s.length > 0) return s.join(`
1117
1189
  `);
1118
- const s = S(e?.patchText);
1119
- return s && Do(s) ? s : null;
1120
- }, qo = (t) => {
1190
+ const o = S(e?.patchText);
1191
+ return o && Xs(o) ? o : null;
1192
+ }, Zs = (t) => {
1121
1193
  const e = /* @__PURE__ */ new Set(), n = [];
1122
- for (const o of t)
1123
- e.has(o.filePath) || (e.add(o.filePath), n.push({
1194
+ for (const s of t)
1195
+ e.has(s.filePath) || (e.add(s.filePath), n.push({
1124
1196
  kind: "diff",
1125
- fileName: Dt(o.filePath),
1126
- filePath: o.filePath,
1127
- additions: o.additions,
1128
- deletions: o.deletions
1197
+ fileName: Qt(s.filePath),
1198
+ filePath: s.filePath,
1199
+ additions: s.additions,
1200
+ deletions: s.deletions
1129
1201
  }));
1130
1202
  return n;
1131
- }, Qo = (t) => Array.from(new Set(t.map((e) => e.filePath))), pt = (t) => {
1132
- const e = Ge(t);
1203
+ }, er = (t) => Array.from(new Set(t.map((e) => e.filePath))), yt = (t) => {
1204
+ const e = et(t);
1133
1205
  return S(t.state?.output) ?? S(e?.returnDisplay) ?? S(e?.preview) ?? S(e?.stdout) ?? S(e?.content);
1134
- }, Ho = (t) => {
1206
+ }, tr = (t) => {
1135
1207
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1136
1208
  return e ? {
1137
1209
  skillName: S(e[1]) ?? void 0,
1138
1210
  content: S(e[2]) ?? ""
1139
1211
  } : null;
1140
- }, Wo = (t) => {
1141
- const e = Be(t);
1212
+ }, nr = (t) => {
1213
+ const e = Ee(t);
1142
1214
  return S(e?.name) ?? S(e?.skillName) ?? S(e?.skill) ?? S(e?.skill_name) ?? void 0;
1143
- }, Sn = (t) => ({
1215
+ }, Rn = (t) => ({
1144
1216
  kind: "link",
1145
- text: Dt(t),
1217
+ text: Qt(t),
1146
1218
  filePath: t
1147
- }), de = (t, e) => !bn(t) || !t.state?.errorText ? e : [{
1219
+ }), me = (t, e) => !Cn(t) || !t.state?.errorText ? e : [{
1148
1220
  type: "comment",
1149
1221
  text: t.state.errorText
1150
- }, ...e], kn = (t) => Mo(t ?? void 0).map((e) => ({
1222
+ }, ...e], In = (t) => Qs(t ?? void 0).map((e) => ({
1151
1223
  type: "diff",
1152
1224
  language: "diff",
1153
1225
  original: e.original,
1154
1226
  modified: e.modified,
1155
1227
  sideBySide: !1
1156
- })), No = (t) => wo(t ?? void 0), Vo = (t) => Co(t ?? void 0), jo = (t) => {
1157
- const e = zo(t), n = xn(t), o = ue(t, void 0, "Apply patch"), s = No(e);
1158
- s.length > 0 ? o.push(...s) : o.push(...qo(n));
1159
- const r = [...kn(e)];
1228
+ })), or = (t) => Os(t ?? void 0), sr = (t) => $s(t ?? void 0), rr = (t) => {
1229
+ const e = Js(t), n = _n(t), s = pe(t, void 0, "Apply patch"), o = or(e);
1230
+ o.length > 0 ? s.push(...o) : s.push(...Zs(n));
1231
+ const r = [...In(e)];
1160
1232
  if (r.length === 0)
1161
1233
  for (const i of n)
1162
1234
  !i.before && !i.after || r.push({
@@ -1167,252 +1239,252 @@ const Eo = {
1167
1239
  sideBySide: !1
1168
1240
  });
1169
1241
  if (r.length === 0) {
1170
- const i = Vo(e);
1171
- i.length === 0 && i.push(...Qo(n)), i.length > 0 && r.push({
1242
+ const i = sr(e);
1243
+ i.length === 0 && i.push(...er(n)), i.length > 0 && r.push({
1172
1244
  type: "references",
1173
1245
  references: i
1174
1246
  });
1175
1247
  }
1176
1248
  return {
1177
- indicator: ce(t),
1178
- title: o,
1179
- blocks: de(t, r)
1249
+ indicator: fe(t),
1250
+ title: s,
1251
+ blocks: me(t, r)
1180
1252
  };
1181
- }, Uo = (t, e) => [{
1253
+ }, ir = (t, e) => [{
1182
1254
  type: "diff",
1183
1255
  language: "text",
1184
1256
  original: t,
1185
1257
  modified: e,
1186
1258
  sideBySide: !1
1187
- }], Ko = (t) => {
1188
- const e = Be(t), n = Ge(t), o = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, s = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = ue(t, void 0, "Edit file");
1189
- o && i.push(Sn(o));
1190
- const a = s !== void 0 && r !== void 0 ? Uo(s, r) : kn(S(n?.diff));
1259
+ }], lr = (t) => {
1260
+ const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, o = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
1261
+ s && i.push(Rn(s));
1262
+ const l = o !== void 0 && r !== void 0 ? ir(o, r) : In(S(n?.diff));
1191
1263
  return {
1192
- indicator: ce(t),
1264
+ indicator: fe(t),
1193
1265
  title: i,
1194
- blocks: de(t, a)
1266
+ blocks: me(t, l)
1195
1267
  };
1196
- }, Xe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Go = (t) => {
1268
+ }, tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), ar = (t) => {
1197
1269
  try {
1198
1270
  const e = JSON.parse(t);
1199
- return Xe(e) ? e : null;
1271
+ return tt(e) ? e : null;
1200
1272
  } catch {
1201
1273
  return null;
1202
1274
  }
1203
- }, Xo = (t) => Xe(t) ? t : typeof t == "string" && t.trim().length > 0 ? Go(t) : null, He = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Me = (t) => {
1204
- const e = He(t);
1275
+ }, cr = (t) => tt(t) ? t : typeof t == "string" && t.trim().length > 0 ? ar(t) : null, Ve = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pe = (t) => {
1276
+ const e = Ve(t);
1205
1277
  if (e) return e;
1206
1278
  if (Array.isArray(t)) {
1207
- const n = t.map(Me).filter((o) => o !== null);
1279
+ const n = t.map(Pe).filter((s) => s !== null);
1208
1280
  return n.length > 0 ? n.join(`
1209
1281
  `) : null;
1210
1282
  }
1211
- return Xe(t) ? Me(t.response) ?? Me(t.answer) ?? Me(t.text) ?? Me(t.answers) : null;
1212
- }, Yo = (t) => {
1283
+ return tt(t) ? Pe(t.response) ?? Pe(t.answer) ?? Pe(t.text) ?? Pe(t.answers) : null;
1284
+ }, ur = (t) => {
1213
1285
  if (typeof t == "string" && t.trim().length > 0)
1214
1286
  return {
1215
1287
  label: t,
1216
1288
  description: void 0
1217
1289
  };
1218
- if (!Xe(t)) return null;
1219
- const e = He(t.label);
1290
+ if (!tt(t)) return null;
1291
+ const e = Ve(t.label);
1220
1292
  return e ? {
1221
1293
  label: e,
1222
- description: He(t.description) ?? void 0
1294
+ description: Ve(t.description) ?? void 0
1223
1295
  } : null;
1224
- }, Jo = (t, e) => {
1225
- if (!Xe(t)) return null;
1226
- const n = He(t.question);
1296
+ }, dr = (t, e) => {
1297
+ if (!tt(t)) return null;
1298
+ const n = Ve(t.question);
1227
1299
  if (!n) return null;
1228
- const o = Array.isArray(t.options) ? t.options.map(Yo).filter((i) => i !== null) : [], s = He(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s === "freeform" || s === "text";
1229
- return o.length === 0 && !r ? null : {
1230
- id: He(t.id) ?? `question-${e}`,
1300
+ const s = Array.isArray(t.options) ? t.options.map(ur).filter((i) => i !== null) : [], o = Ve(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o === "freeform" || o === "text";
1301
+ return s.length === 0 && !r ? null : {
1302
+ id: Ve(t.id) ?? `question-${e}`,
1231
1303
  question: n,
1232
- options: o,
1233
- multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
1304
+ options: s,
1305
+ multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
1234
1306
  required: typeof t.required == "boolean" ? t.required : !1,
1235
1307
  allowCustomAnswer: r
1236
1308
  };
1237
- }, Zo = (t) => {
1238
- const e = Xo(t);
1309
+ }, fr = (t) => {
1310
+ const e = cr(t);
1239
1311
  if (!e || !Array.isArray(e.questions)) return null;
1240
- const n = e.questions.map(Jo).filter((o) => o !== null);
1312
+ const n = e.questions.map(dr).filter((s) => s !== null);
1241
1313
  return n.length === 0 ? null : {
1242
1314
  type: "question-form",
1243
1315
  questions: n
1244
1316
  };
1245
- }, er = (t) => {
1317
+ }, pr = (t) => {
1246
1318
  const {
1247
1319
  buildBaseTitle: e,
1248
1320
  buildIndicator: n,
1249
- prependErrorBlock: o
1321
+ prependErrorBlock: s
1250
1322
  } = t;
1251
- return (s) => {
1252
- const r = Me(s.state?.output) ?? Me(s.state?.metadata), i = Zo(s.state?.input);
1323
+ return (o) => {
1324
+ const r = Pe(o.state?.output) ?? Pe(o.state?.metadata), i = fr(o.state?.input);
1253
1325
  if (!r && !i) return null;
1254
- const a = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
1326
+ const l = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
1255
1327
  return {
1256
- indicator: n(s),
1257
- title: e(s, a, "Question"),
1258
- blocks: o(s, c),
1328
+ indicator: n(o),
1329
+ title: e(o, l, "Question"),
1330
+ blocks: s(o, c),
1259
1331
  expandable: !1
1260
1332
  };
1261
1333
  };
1262
- }, tr = (t) => {
1263
- const e = Be(t), n = Ge(t), o = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, s = ue(t, void 0, "Read file");
1264
- return o && s.push(Sn(o)), {
1265
- indicator: ce(t),
1266
- title: s,
1267
- blocks: de(t, [])
1334
+ }, mr = (t) => {
1335
+ const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, o = pe(t, void 0, "Read file");
1336
+ return s && o.push(Rn(s)), {
1337
+ indicator: fe(t),
1338
+ title: o,
1339
+ blocks: me(t, [])
1268
1340
  };
1269
- }, nr = (t) => {
1270
- const e = Be(t), n = Ge(t), o = S(e?.command) ?? void 0, s = ue(t, o, "Run command"), r = [], i = pt(t);
1341
+ }, hr = (t) => {
1342
+ const e = Ee(t), n = et(t), s = S(e?.command) ?? void 0, o = pe(t, s, "Run command"), r = [], i = yt(t);
1271
1343
  i && r.push({
1272
1344
  type: "code",
1273
1345
  language: "text",
1274
1346
  code: i
1275
1347
  });
1276
- const a = S(n?.stderr);
1277
- return a && a !== i && r.push({
1348
+ const l = S(n?.stderr);
1349
+ return l && l !== i && r.push({
1278
1350
  type: "code",
1279
1351
  language: "text",
1280
- code: a
1352
+ code: l
1281
1353
  }), typeof n?.exitCode == "number" && r.push({
1282
1354
  type: "text",
1283
1355
  text: `Exit code: ${n.exitCode}`
1284
1356
  }), {
1285
- indicator: ce(t),
1286
- title: s,
1287
- blocks: de(t, r)
1357
+ indicator: fe(t),
1358
+ title: o,
1359
+ blocks: me(t, r)
1288
1360
  };
1289
- }, sr = (t) => {
1290
- const e = Be(t), n = pt(t), o = S(e?.pattern) ?? void 0, s = ue(t, o, "Search files"), r = n ? [{
1361
+ }, gr = (t) => {
1362
+ const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Search files"), r = n ? [{
1291
1363
  type: "code",
1292
1364
  language: "text",
1293
1365
  code: n
1294
1366
  }] : [];
1295
1367
  return {
1296
- indicator: ce(t),
1297
- title: s,
1298
- blocks: de(t, r)
1368
+ indicator: fe(t),
1369
+ title: o,
1370
+ blocks: me(t, r)
1299
1371
  };
1300
- }, or = (t) => {
1301
- const e = Be(t), n = pt(t), o = S(e?.pattern) ?? void 0, s = ue(t, o, "Find files"), r = [];
1372
+ }, br = (t) => {
1373
+ const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Find files"), r = [];
1302
1374
  if (n) {
1303
- const i = n.split(/\r?\n/).map((a) => a.trim()).filter((a) => a.length > 0);
1375
+ const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
1304
1376
  i.length > 0 && r.push({
1305
1377
  type: "references",
1306
1378
  references: i
1307
1379
  });
1308
1380
  }
1309
1381
  return {
1310
- indicator: ce(t),
1311
- title: s,
1312
- blocks: de(t, r)
1382
+ indicator: fe(t),
1383
+ title: o,
1384
+ blocks: me(t, r)
1313
1385
  };
1314
- }, rr = (t) => {
1315
- const e = pt(t), n = e ? Ho(e) : null, o = Wo(t) ?? n?.skillName, s = ue(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
1386
+ }, yr = (t) => {
1387
+ const e = yt(t), n = e ? tr(e) : null, s = nr(t) ?? n?.skillName, o = pe(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
1316
1388
  type: "code",
1317
1389
  language: "markdown",
1318
1390
  code: r
1319
1391
  }] : [];
1320
1392
  return {
1321
- indicator: ce(t),
1322
- title: s,
1323
- blocks: de(t, i)
1393
+ indicator: fe(t),
1394
+ title: o,
1395
+ blocks: me(t, i)
1324
1396
  };
1325
- }, Mt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Tn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, ir = (t) => {
1326
- const e = Tn(t);
1397
+ }, Dt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, xr = (t) => {
1398
+ const e = Pn(t);
1327
1399
  if (!e) return null;
1328
- const n = Mt(e.content) ?? Mt(e.title);
1400
+ const n = Dt(e.content) ?? Dt(e.title);
1329
1401
  if (!n) return null;
1330
- const o = Mt(e.status);
1402
+ const s = Dt(e.status);
1331
1403
  return {
1332
1404
  label: n,
1333
- checked: o === "completed"
1405
+ checked: s === "completed"
1334
1406
  };
1335
- }, jt = (t) => {
1407
+ }, Jt = (t) => {
1336
1408
  if (!t) return {
1337
1409
  items: [],
1338
1410
  explicit: !1
1339
1411
  };
1340
1412
  const e = (() => {
1341
1413
  if (Array.isArray(t)) return t;
1342
- const n = Tn(t);
1414
+ const n = Pn(t);
1343
1415
  return !n || !Array.isArray(n.todos) ? null : n.todos;
1344
1416
  })();
1345
1417
  return e ? {
1346
- items: e.map(ir).filter((n) => n !== null),
1418
+ items: e.map(xr).filter((n) => n !== null),
1347
1419
  explicit: !0
1348
1420
  } : {
1349
1421
  items: [],
1350
1422
  explicit: !1
1351
1423
  };
1352
- }, lr = (t) => {
1424
+ }, Sr = (t) => {
1353
1425
  const {
1354
1426
  buildBaseTitle: e,
1355
1427
  buildIndicator: n,
1356
- prependErrorBlock: o
1428
+ prependErrorBlock: s
1357
1429
  } = t;
1358
- return (s) => {
1359
- const r = jt(s.state?.input), i = jt(s.state?.output), a = i.explicit ? i : r;
1360
- if (!a.explicit) return null;
1361
- const c = a.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(s, u, "Update todos");
1430
+ return (o) => {
1431
+ const r = Jt(o.state?.input), i = Jt(o.state?.output), l = i.explicit ? i : r;
1432
+ if (!l.explicit) return null;
1433
+ const c = l.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
1362
1434
  if (c.length === 0)
1363
1435
  return {
1364
- indicator: n(s),
1436
+ indicator: n(o),
1365
1437
  title: d,
1366
- blocks: o(s, [{
1438
+ blocks: s(o, [{
1367
1439
  type: "comment",
1368
1440
  text: "No todos"
1369
1441
  }])
1370
1442
  };
1371
- const p = [{
1443
+ const f = [{
1372
1444
  type: "todo-list",
1373
1445
  items: c
1374
1446
  }];
1375
1447
  return {
1376
- indicator: n(s),
1448
+ indicator: n(o),
1377
1449
  title: d,
1378
- blocks: o(s, p)
1450
+ blocks: s(o, f)
1379
1451
  };
1380
1452
  };
1381
- }, ar = er({
1382
- buildBaseTitle: ue,
1383
- buildIndicator: ce,
1384
- prependErrorBlock: de
1385
- }), Ut = lr({
1386
- buildBaseTitle: ue,
1387
- buildIndicator: ce,
1388
- prependErrorBlock: de
1389
- }), Kt = () => ({
1390
- apply_patch: jo,
1391
- bash: nr,
1392
- edit: Ko,
1393
- glob: or,
1394
- grep: sr,
1395
- question: ar,
1396
- read: tr,
1397
- skill: rr,
1398
- todo_write: Ut,
1399
- todowrite: Ut
1400
- }), Gt = {
1453
+ }, Tr = pr({
1454
+ buildBaseTitle: pe,
1455
+ buildIndicator: fe,
1456
+ prependErrorBlock: me
1457
+ }), Zt = Sr({
1458
+ buildBaseTitle: pe,
1459
+ buildIndicator: fe,
1460
+ prependErrorBlock: me
1461
+ }), en = () => ({
1462
+ apply_patch: rr,
1463
+ bash: hr,
1464
+ edit: lr,
1465
+ glob: br,
1466
+ grep: gr,
1467
+ question: Tr,
1468
+ read: mr,
1469
+ skill: yr,
1470
+ todo_write: Zt,
1471
+ todowrite: Zt
1472
+ }), tn = {
1401
1473
  pending: "queued",
1402
1474
  error: "failed",
1403
1475
  "output-error": "failed",
1404
1476
  "input-streaming": "running",
1405
1477
  "input-available": "queued"
1406
- }, cr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ur = (t) => {
1407
- const e = dt(t ?? "tool").replace(/_/g, " ");
1408
- return cr(e);
1409
- }, wn = (t) => t === "error" || t === "output-error", dr = (t) => wn(t.state?.status) ? {
1478
+ }, wr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), kr = (t) => {
1479
+ const e = gt(t ?? "tool").replace(/_/g, " ");
1480
+ return wr(e);
1481
+ }, Mn = (t) => t === "error" || t === "output-error", Cr = (t) => Mn(t.state?.status) ? {
1410
1482
  type: "icon",
1411
1483
  icon: "danger"
1412
1484
  } : {
1413
1485
  type: "icon",
1414
- icon: pn(t.tool ?? "tool")
1415
- }, fr = (t) => !t || typeof t != "string" ? null : Gt[t] ? Gt[t] : t.includes("stream") ? "running" : null, Xt = (t) => {
1486
+ icon: Sn(t.tool ?? "tool")
1487
+ }, Ar = (t) => !t || typeof t != "string" ? null : tn[t] ? tn[t] : t.includes("stream") ? "running" : null, nn = (t) => {
1416
1488
  if (typeof t == "string") return t;
1417
1489
  if (t == null) return null;
1418
1490
  try {
@@ -1420,113 +1492,113 @@ const Eo = {
1420
1492
  } catch {
1421
1493
  return null;
1422
1494
  }
1423
- }, pr = (t) => {
1495
+ }, _r = (t) => {
1424
1496
  const e = [];
1425
- wn(t.state?.status) && t.state?.errorText && e.push({
1497
+ Mn(t.state?.status) && t.state?.errorText && e.push({
1426
1498
  type: "comment",
1427
1499
  text: t.state.errorText
1428
1500
  });
1429
- const n = Xt(t.state?.input);
1501
+ const n = nn(t.state?.input);
1430
1502
  n && e.push({
1431
1503
  type: "code",
1432
1504
  language: "json",
1433
1505
  code: n
1434
1506
  });
1435
- const o = Xt(t.state?.output);
1436
- return o && e.push({
1507
+ const s = nn(t.state?.output);
1508
+ return s && e.push({
1437
1509
  type: "code",
1438
1510
  language: "json",
1439
- code: o
1511
+ code: s
1440
1512
  }), e;
1441
- }, mr = (t) => {
1513
+ }, Rr = (t) => {
1442
1514
  const e = [{
1443
1515
  kind: "text",
1444
- text: ur(t.tool),
1516
+ text: kr(t.tool),
1445
1517
  bold: !0
1446
- }], n = fr(t.state?.status);
1518
+ }], n = Ar(t.state?.status);
1447
1519
  return n && e.push({
1448
1520
  kind: "text",
1449
1521
  text: n,
1450
1522
  muted: !0
1451
1523
  }), {
1452
- indicator: dr(t),
1524
+ indicator: Cr(t),
1453
1525
  title: e,
1454
- blocks: pr(t)
1526
+ blocks: _r(t)
1455
1527
  };
1456
- }, hr = (t) => t ? {
1457
- ...Kt(),
1528
+ }, Ir = (t) => t ? {
1529
+ ...en(),
1458
1530
  ...t
1459
- } : Kt(), gr = (t, e) => {
1531
+ } : en(), Pr = (t, e) => {
1460
1532
  const n = t.tool ?? "tool";
1461
- for (const o of po(n)) {
1462
- const s = e[o];
1463
- if (s) return s;
1533
+ for (const s of _s(n)) {
1534
+ const o = e[s];
1535
+ if (o) return o;
1464
1536
  }
1465
- }, br = (t, e, n) => {
1466
- const o = gr(t, e);
1467
- if (o) {
1468
- const s = o(t, n);
1469
- if (s) return s;
1537
+ }, Mr = (t, e, n) => {
1538
+ const s = Pr(t, e);
1539
+ if (s) {
1540
+ const o = s(t, n);
1541
+ if (o) return o;
1470
1542
  }
1471
- return mr(t);
1472
- }, yr = (t, e) => {
1473
- const n = hr(e?.toolRenderers);
1543
+ return Rr(t);
1544
+ }, Er = (t, e) => {
1545
+ const n = Ir(e?.toolRenderers);
1474
1546
  return {
1475
- items: t.map((s) => br(s, n, e))
1547
+ items: t.map((o) => Mr(o, n, e))
1476
1548
  };
1477
- }, ke = qn, Cn = (t, e, n, o = !1) => {
1478
- o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1549
+ }, Ce = Un, En = (t, e, n, s = !1) => {
1550
+ s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1479
1551
  };
1480
- function xr(t) {
1481
- const e = k(6), {
1552
+ function vr(t) {
1553
+ const e = T(6), {
1482
1554
  seg: n
1483
1555
  } = t;
1484
- let o;
1485
- e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
1486
1556
  let s;
1487
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(qe.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
1557
+ e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
1558
+ let o;
1559
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
1488
1560
  let r;
1489
- return e[4] !== o ? (r = /* @__PURE__ */ T(qe.Root, { width: "1.5rem", height: "1.5rem", children: [
1490
- o,
1491
- s
1492
- ] }), e[4] = o, e[5] = r) : r = e[5], r;
1561
+ return e[4] !== s ? (r = /* @__PURE__ */ k(We.Root, { width: "1.5rem", height: "1.5rem", children: [
1562
+ s,
1563
+ o
1564
+ ] }), e[4] = s, e[5] = r) : r = e[5], r;
1493
1565
  }
1494
- function Sr(t) {
1495
- const e = k(9), {
1566
+ function Lr(t) {
1567
+ const e = T(9), {
1496
1568
  seg: n,
1497
- onOpenFile: o
1498
- } = t, s = n.additions ?? 0, r = n.deletions ?? 0;
1569
+ onOpenFile: s
1570
+ } = t, o = n.additions ?? 0, r = n.deletions ?? 0;
1499
1571
  let i;
1500
- e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1572
+ e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1501
1573
  const c = n.filePath ?? n.fileName;
1502
- o?.(c);
1503
- }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1504
- let a;
1505
- return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (a = /* @__PURE__ */ l(ln, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = a) : a = e[8], a;
1574
+ s?.(c);
1575
+ }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1576
+ let l;
1577
+ return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ a(pn, { 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;
1506
1578
  }
1507
- function kr(t) {
1508
- const e = k(13), {
1579
+ function Dr(t) {
1580
+ const e = T(13), {
1509
1581
  seg: n,
1510
- onOpenFile: o
1511
- } = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", a = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
1582
+ onOpenFile: s
1583
+ } = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
1512
1584
  let u;
1513
- e[0] !== o || e[1] !== n ? (u = (f) => Cn(f, n, o, !0), e[0] = o, e[1] = n, e[2] = u) : u = e[2];
1585
+ e[0] !== s || e[1] !== n ? (u = (p) => En(p, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
1514
1586
  const d = n.muted ? "fg.muted" : "fg.blue-dark";
1515
- let p;
1516
- e[3] !== d ? (p = {
1587
+ let f;
1588
+ e[3] !== d ? (f = {
1517
1589
  textDecoration: "underline",
1518
1590
  color: d
1519
- }, e[3] = d, e[4] = p) : p = e[4];
1591
+ }, e[3] = d, e[4] = f) : f = e[4];
1520
1592
  let m;
1521
- return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== a || e[9] !== c || e[10] !== u || e[11] !== p ? (m = /* @__PURE__ */ l(Zt, { href: i, fontWeight: s, color: a, textDecoration: "none", cursor: c, onClick: u, _hover: p, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = a, e[9] = c, e[10] = u, e[11] = p, e[12] = m) : m = e[12], m;
1593
+ return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== c || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ a(rn, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: c, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = c, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
1522
1594
  }
1523
- function Tr(t) {
1524
- const e = k(12), {
1595
+ function Br(t) {
1596
+ const e = T(12), {
1525
1597
  seg: n,
1526
- onOpenFile: o
1527
- } = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1528
- let a;
1529
- e[0] !== o || e[1] !== n ? (a = (p) => Cn(p, n, o), e[0] = o, e[1] = n, e[2] = a) : a = e[2];
1598
+ onOpenFile: s
1599
+ } = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1600
+ let l;
1601
+ e[0] !== s || e[1] !== n ? (l = (f) => En(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
1530
1602
  const c = n.muted ? "fg.muted" : "accent.primary";
1531
1603
  let u;
1532
1604
  e[3] !== c ? (u = {
@@ -1534,246 +1606,252 @@ function Tr(t) {
1534
1606
  textDecoration: "underline"
1535
1607
  }, e[3] = c, e[4] = u) : u = e[4];
1536
1608
  let d;
1537
- return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== a || e[10] !== u ? (d = /* @__PURE__ */ l(Zt, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: a, _hover: u, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = a, e[10] = u, e[11] = d) : d = e[11], d;
1609
+ return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ a(rn, { 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;
1538
1610
  }
1539
- function wr(t) {
1540
- const e = k(6), {
1611
+ function Or(t) {
1612
+ const e = T(6), {
1541
1613
  seg: n,
1542
- isClickable: o
1543
- } = t, s = n.bold ? "medium" : void 0, r = o && !n.muted ? "fg" : "fg.muted";
1614
+ isClickable: s
1615
+ } = t, o = n.bold ? "medium" : void 0, r = s && !n.muted ? "fg" : "fg.muted";
1544
1616
  let i;
1545
1617
  e[0] !== r ? (i = {
1546
1618
  color: r
1547
1619
  }, e[0] = r, e[1] = i) : i = e[1];
1548
- let a;
1549
- return e[2] !== n.text || e[3] !== s || e[4] !== i ? (a = /* @__PURE__ */ l(Ue, { fontWeight: s, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = s, e[4] = i, e[5] = a) : a = e[5], a;
1620
+ let l;
1621
+ return e[2] !== n.text || e[3] !== o || e[4] !== i ? (l = /* @__PURE__ */ a(Je, { fontWeight: o, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = o, e[4] = i, e[5] = l) : l = e[5], l;
1550
1622
  }
1551
- function Cr(t) {
1552
- const e = k(11), {
1623
+ function $r(t) {
1624
+ const e = T(11), {
1553
1625
  seg: n,
1554
- isClickable: o,
1555
- onOpenFile: s
1626
+ isClickable: s,
1627
+ onOpenFile: o
1556
1628
  } = t;
1557
1629
  switch (n.kind) {
1558
1630
  case "avatar": {
1559
1631
  let r;
1560
- return e[0] !== n ? (r = /* @__PURE__ */ l(xr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1632
+ return e[0] !== n ? (r = /* @__PURE__ */ a(vr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1561
1633
  }
1562
1634
  case "diff": {
1563
1635
  let r;
1564
- return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ l(Sr, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
1636
+ return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ a(Lr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
1565
1637
  }
1566
1638
  case "link": {
1567
1639
  let r;
1568
- return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ l(kr, { seg: n, onOpenFile: s }) : /* @__PURE__ */ l(Tr, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
1640
+ return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ a(Dr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ a(Br, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
1569
1641
  }
1570
1642
  case "text": {
1571
1643
  let r;
1572
- return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ l(wr, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
1644
+ return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ a(Or, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
1573
1645
  }
1574
1646
  default:
1575
1647
  return null;
1576
1648
  }
1577
1649
  }
1578
- function _r(t) {
1579
- const e = k(10), {
1650
+ function Fr(t) {
1651
+ const e = T(10), {
1580
1652
  ind: n
1581
1653
  } = t;
1582
1654
  if (!n || n.type === "none")
1583
1655
  return null;
1584
1656
  if (n.type === "icon") {
1585
1657
  let i;
1586
- e[0] !== n.icon ? (i = go(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1587
- const a = i;
1658
+ e[0] !== n.icon ? (i = Ps(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1659
+ const l = i;
1588
1660
  let c;
1589
- return e[2] !== a ? (c = /* @__PURE__ */ l(ke.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ l(a, { size: 14, strokeWidth: 1 }) }) }), e[2] = a, e[3] = c) : c = e[3], c;
1661
+ return e[2] !== l ? (c = /* @__PURE__ */ a(Ce.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ a(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = c) : c = e[3], c;
1590
1662
  }
1591
- let o;
1592
- e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1593
1663
  let s;
1594
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(qe.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
1664
+ e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1665
+ let o;
1666
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
1595
1667
  let r;
1596
- return e[8] !== o ? (r = /* @__PURE__ */ l(ke.Indicator, { children: /* @__PURE__ */ T(qe.Root, { boxSize: "full", children: [
1597
- o,
1598
- s
1599
- ] }) }), e[8] = o, e[9] = r) : r = e[9], r;
1668
+ return e[8] !== s ? (r = /* @__PURE__ */ a(Ce.Indicator, { children: /* @__PURE__ */ k(We.Root, { boxSize: "full", children: [
1669
+ s,
1670
+ o
1671
+ ] }) }), e[8] = s, e[9] = r) : r = e[9], r;
1600
1672
  }
1601
- function Ar(t) {
1602
- const e = k(5), {
1673
+ function zr(t) {
1674
+ const e = T(5), {
1603
1675
  code: n,
1604
- language: o
1605
- } = t, s = o ? `${o} code block` : "code block";
1676
+ language: s
1677
+ } = t, o = s ? `${s} code block` : "code block";
1606
1678
  let r;
1607
- e[0] !== n ? (r = /* @__PURE__ */ l(I, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1679
+ e[0] !== n ? (r = /* @__PURE__ */ a(I, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1608
1680
  let i;
1609
- return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ l(ut, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ l(I, { as: "pre", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", whiteSpace: "pre", "aria-label": s, children: r }) }), e[2] = s, e[3] = r, e[4] = i) : i = e[4], i;
1681
+ return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ a(ht, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ a(I, { as: "pre", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
1610
1682
  }
1611
- function Rr(t) {
1612
- const e = k(30), {
1683
+ function qr(t) {
1684
+ const e = T(30), {
1613
1685
  b: n,
1614
- onOpenFile: o
1686
+ onOpenFile: s
1615
1687
  } = t;
1616
1688
  switch (n.type) {
1617
1689
  case "comment": {
1618
- let s;
1619
- e[0] !== n.text ? (s = /* @__PURE__ */ l(le.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
1690
+ let o;
1691
+ e[0] !== n.text ? (o = /* @__PURE__ */ a(ue.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1620
1692
  let r;
1621
- e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ l(le.Footer, { children: /* @__PURE__ */ T(Ke, { children: [
1693
+ e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ a(ue.Footer, { children: /* @__PURE__ */ k(Ze, { children: [
1622
1694
  "👏 ",
1623
1695
  n.reactions.clap
1624
1696
  ] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
1625
1697
  let i;
1626
- return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ T(le.Root, { children: [
1627
- s,
1698
+ return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(ue.Root, { children: [
1699
+ o,
1628
1700
  r
1629
- ] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
1701
+ ] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
1630
1702
  }
1631
1703
  case "code": {
1632
- let s;
1633
- return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ l(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(le.Body, { padding: "0", children: /* @__PURE__ */ l(Ar, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
1704
+ let o;
1705
+ return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(zr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1634
1706
  }
1635
1707
  case "diff": {
1636
- const s = n.sideBySide ?? !1;
1708
+ const o = n.sideBySide ?? !1;
1637
1709
  let r;
1638
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ l(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(le.Body, { padding: "0", children: /* @__PURE__ */ l(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ l(gs, { 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;
1710
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ a(Ao, { 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;
1639
1711
  }
1640
1712
  case "text": {
1641
- let s;
1642
- return e[15] !== n.text ? (s = /* @__PURE__ */ l(le.Root, { background: "transparent", children: /* @__PURE__ */ l(le.Body, { padding: "sm", children: /* @__PURE__ */ l(q, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
1713
+ let o;
1714
+ return e[15] !== n.text ? (o = /* @__PURE__ */ a(ue.Root, { background: "transparent", children: /* @__PURE__ */ a(ue.Body, { padding: "sm", children: /* @__PURE__ */ a(X, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1643
1715
  }
1644
1716
  case "todo-list": {
1645
- let s;
1646
- return e[17] !== n.items ? (s = /* @__PURE__ */ l(Ds, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
1717
+ let o;
1718
+ return e[17] !== n.items ? (o = /* @__PURE__ */ a(Xo, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
1647
1719
  }
1648
1720
  case "question-form": {
1649
- let s;
1650
- return e[19] !== n.questions ? (s = /* @__PURE__ */ l(un, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
1721
+ let o;
1722
+ return e[19] !== n.questions ? (o = /* @__PURE__ */ a(bn, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
1651
1723
  }
1652
1724
  case "references": {
1653
- let s;
1654
- e[21] !== n.references ? (s = n.references.map(Ir), e[21] = n.references, e[22] = s) : s = e[22];
1725
+ let o;
1726
+ e[21] !== n.references ? (o = n.references.map(Hr), e[21] = n.references, e[22] = o) : o = e[22];
1655
1727
  let r;
1656
- return e[23] !== s ? (r = /* @__PURE__ */ l(Z, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
1728
+ return e[23] !== o ? (r = /* @__PURE__ */ a(Y, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
1657
1729
  }
1658
1730
  case "component": {
1659
- let s;
1660
- e[25] !== n || e[26] !== o ? (s = n.render({
1661
- onOpenFile: o
1662
- }), e[25] = n, e[26] = o, e[27] = s) : s = e[27];
1731
+ let o;
1732
+ e[25] !== n || e[26] !== s ? (o = n.render({
1733
+ onOpenFile: s
1734
+ }), e[25] = n, e[26] = s, e[27] = o) : o = e[27];
1663
1735
  let r;
1664
- return e[28] !== s ? (r = /* @__PURE__ */ l(Lt, { children: s }), e[28] = s, e[29] = r) : r = e[29], r;
1736
+ return e[28] !== o ? (r = /* @__PURE__ */ a($t, { children: o }), e[28] = o, e[29] = r) : r = e[29], r;
1665
1737
  }
1666
1738
  }
1667
1739
  }
1668
- function Ir(t) {
1669
- return /* @__PURE__ */ l(ps, { fileName: t }, t);
1740
+ function Hr(t) {
1741
+ return /* @__PURE__ */ a(qt, { fileName: t }, t);
1670
1742
  }
1671
- function Mr(t) {
1672
- const e = k(23), {
1743
+ function Qr(t) {
1744
+ const e = T(23), {
1673
1745
  item: n,
1674
- itemKey: o,
1675
- isOpen: s,
1746
+ itemKey: s,
1747
+ isOpen: o,
1676
1748
  canExpand: r,
1677
1749
  hasBlocks: i,
1678
- onToggle: a,
1750
+ onToggle: l,
1679
1751
  onOpenFile: c
1680
1752
  } = t;
1681
1753
  let u;
1682
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(ke.Separator, {}), e[0] = u) : u = e[0];
1754
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ a(Ce.Separator, {}), e[0] = u) : u = e[0];
1683
1755
  let d;
1684
- e[1] !== n.indicator ? (d = /* @__PURE__ */ T(ke.Connector, { children: [
1756
+ e[1] !== n.indicator ? (d = /* @__PURE__ */ k(Ce.Connector, { children: [
1685
1757
  u,
1686
- /* @__PURE__ */ l(_r, { ind: n.indicator })
1758
+ /* @__PURE__ */ a(Fr, { ind: n.indicator })
1687
1759
  ] }), e[1] = n.indicator, e[2] = d) : d = e[2];
1688
- const p = s ? "auto" : "20px";
1760
+ const f = o ? "auto" : "20px";
1689
1761
  let m;
1690
- e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== c || e[8] !== a ? (m = n.title.length > 0 && /* @__PURE__ */ l(ke.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => a(o) : void 0, children: /* @__PURE__ */ T(Ue, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1691
- /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((b, y) => /* @__PURE__ */ l(Cr, { seg: b, isClickable: r, onOpenFile: c }, y)) }),
1692
- r ? /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1762
+ e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== c || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ a(Ce.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k(Je, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1763
+ /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((y, b) => /* @__PURE__ */ a($r, { seg: y, isClickable: r, onOpenFile: c }, b)) }),
1764
+ r ? /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1693
1765
  color: "fg"
1694
- }, children: /* @__PURE__ */ l(as, { size: 12 }) }) : null
1695
- ] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = c, e[8] = a, e[9] = m) : m = e[9];
1696
- let f;
1697
- e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== c ? (f = i ? /* @__PURE__ */ l(I, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ l(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ l(I, { children: /* @__PURE__ */ l(Rr, { b, onOpenFile: c }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = c, e[14] = f) : f = e[14];
1766
+ }, children: /* @__PURE__ */ a(bo, { size: 12 }) }) : null
1767
+ ] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = c, e[8] = l, e[9] = m) : m = e[9];
1768
+ let p;
1769
+ e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = i ? /* @__PURE__ */ a(I, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ a(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((y, b) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(qr, { b: y, onOpenFile: c }) }, b)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
1698
1770
  let h;
1699
- e[15] !== p || e[16] !== m || e[17] !== f ? (h = /* @__PURE__ */ T(ke.Content, { pb: "xs", h: p, overflow: "hidden", children: [
1771
+ e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(Ce.Content, { pb: "xs", h: f, overflow: "hidden", children: [
1700
1772
  m,
1701
- f
1702
- ] }), e[15] = p, e[16] = m, e[17] = f, e[18] = h) : h = e[18];
1773
+ p
1774
+ ] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
1703
1775
  let g;
1704
- return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ T(ke.Item, { gap: "xs", children: [
1776
+ return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(Ce.Item, { gap: "xs", children: [
1705
1777
  d,
1706
1778
  h
1707
- ] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1779
+ ] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1708
1780
  }
1709
- function Er(t) {
1710
- const e = k(11), {
1781
+ function Wr(t) {
1782
+ const e = T(11), {
1711
1783
  data: n,
1712
- onOpenFile: o
1784
+ onOpenFile: s
1713
1785
  } = t;
1714
- let s;
1715
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
1716
- const [r, i] = G(s), a = Br;
1786
+ let o;
1787
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1788
+ const [r, i] = G(o), l = Nr;
1717
1789
  let c;
1718
1790
  e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (m) => {
1719
- i((f) => ({
1720
- ...f,
1721
- [m]: !f[m]
1791
+ i((p) => ({
1792
+ ...p,
1793
+ [m]: !p[m]
1722
1794
  }));
1723
1795
  }, e[1] = c) : c = e[1];
1724
1796
  const u = c;
1725
1797
  let d;
1726
- if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
1798
+ if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
1727
1799
  let m;
1728
- e[6] !== r || e[7] !== o ? (m = (f, h) => {
1729
- const g = a(f, h), b = (f.blocks?.length ?? 0) > 0, y = (f.expandable ?? !0) && b, x = y ? r[g] ?? !1 : b;
1730
- return /* @__PURE__ */ l(Mr, { item: f, itemKey: g, isOpen: x, canExpand: y, hasBlocks: b, onToggle: u, onOpenFile: o }, g);
1731
- }, 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;
1800
+ e[6] !== r || e[7] !== s ? (m = (p, h) => {
1801
+ const g = l(p, h), y = (p.blocks?.length ?? 0) > 0, b = (p.expandable ?? !0) && y, x = b ? r[g] ?? !1 : y;
1802
+ return /* @__PURE__ */ a(Qr, { item: p, itemKey: g, isOpen: x, canExpand: b, hasBlocks: y, onToggle: u, onOpenFile: s }, g);
1803
+ }, e[6] = r, e[7] = s, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
1732
1804
  } else
1733
1805
  d = e[5];
1734
- let p;
1735
- return e[9] !== d ? (p = /* @__PURE__ */ l(ke.Root, { children: d }), e[9] = d, e[10] = p) : p = e[10], p;
1806
+ let f;
1807
+ return e[9] !== d ? (f = /* @__PURE__ */ a(Ce.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1736
1808
  }
1737
- function Br(t, e) {
1809
+ function Nr(t, e) {
1738
1810
  return t.id ? `id:${t.id}` : `idx:${e}`;
1739
1811
  }
1740
- const Pr = (t) => dt(t.tool ?? "").replace(/_/g, "") === "question", Lr = (t) => {
1812
+ const Vr = (t) => gt(t.tool ?? "").replace(/_/g, "") === "question", jr = (t) => {
1741
1813
  const e = t.state?.output;
1742
1814
  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;
1743
1815
  };
1744
- function vr(t) {
1745
- const e = k(8), {
1816
+ function Ur(t) {
1817
+ const e = T(8), {
1746
1818
  invocations: n,
1747
- labeledBlocks: o,
1748
- hideQuestionForms: s,
1819
+ labeledBlocks: s,
1820
+ hideQuestionForms: o,
1749
1821
  onOpenFile: r
1750
- } = t, i = s === void 0 ? !1 : s;
1751
- let a, c;
1752
- if (e[0] !== i || e[1] !== n || e[2] !== o) {
1822
+ } = t, i = o === void 0 ? !1 : o;
1823
+ let l, c;
1824
+ if (e[0] !== i || e[1] !== n || e[2] !== s) {
1753
1825
  c = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1754
1826
  e: {
1755
- const p = i ? n.filter($r) : n;
1756
- if (p.length === 0) {
1827
+ const f = i ? n.filter(Kr) : n;
1828
+ if (f.length === 0) {
1757
1829
  c = null;
1758
1830
  break e;
1759
1831
  }
1760
- a = yr(p, {
1761
- labeledBlocks: o
1832
+ l = Er(f, {
1833
+ labeledBlocks: s
1762
1834
  });
1763
1835
  }
1764
- e[0] = i, e[1] = n, e[2] = o, e[3] = a, e[4] = c;
1836
+ e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = c;
1765
1837
  } else
1766
- a = e[3], c = e[4];
1838
+ l = e[3], c = e[4];
1767
1839
  if (c !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1768
1840
  return c;
1769
- const u = a;
1841
+ const u = l;
1770
1842
  let d;
1771
- return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ l(Er, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
1843
+ return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ a(Wr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
1772
1844
  }
1773
- function $r(t) {
1774
- return !Pr(t) || Lr(t);
1845
+ function Kr(t) {
1846
+ return !Vr(t) || jr(t);
1775
1847
  }
1776
- const Or = (t) => t.type === "tool", Et = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Dr = (t) => {
1848
+ const Gr = (t) => t.type === "tool", Vt = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", Xr = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Yr = (t) => t.mediaType?.startsWith("image/") || Xr.test(Vt(t)), Jr = (t) => Yr(t) ? /* @__PURE__ */ a(Kn, { src: t.url, alt: `${Vt(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, Zr = (t, e) => {
1849
+ if (e) {
1850
+ e(t.url);
1851
+ return;
1852
+ }
1853
+ typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
1854
+ }, ei = (t) => {
1777
1855
  if (t.message && t.message.trim().length > 0)
1778
1856
  return t.message;
1779
1857
  const {
@@ -1789,100 +1867,95 @@ const Or = (t) => t.type === "tool", Et = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1789
1867
  default:
1790
1868
  return "An error occurred.";
1791
1869
  }
1792
- }, Fr = {
1870
+ }, ti = {
1793
1871
  info: "blue",
1794
1872
  warning: "orange",
1795
1873
  error: "red",
1796
1874
  success: "green",
1797
1875
  loading: "blue"
1798
- }, zr = (t, e) => {
1876
+ }, ni = (t, e) => {
1799
1877
  const n = [];
1800
- let o = e;
1801
- for (; o < t.length; ) {
1802
- const s = t[o];
1803
- if (!Or(s)) break;
1804
- n.push(s), o += 1;
1878
+ let s = e;
1879
+ for (; s < t.length; ) {
1880
+ const o = t[s];
1881
+ if (!Gr(o)) break;
1882
+ n.push(o), s += 1;
1805
1883
  }
1806
1884
  return {
1807
1885
  invocations: n,
1808
- nextIndex: o - 1
1886
+ nextIndex: s - 1
1809
1887
  };
1810
1888
  };
1811
- function _n(t) {
1812
- const e = k(8), {
1889
+ function vn(t) {
1890
+ const e = T(8), {
1813
1891
  message: n,
1814
- hideQuestionForms: o,
1815
- onOpenFile: s,
1892
+ hideQuestionForms: s,
1893
+ onOpenFile: o,
1816
1894
  toolInvocationTimeline: r
1817
- } = t, i = o === void 0 ? !1 : o, a = r ?? vr;
1895
+ } = t, i = s === void 0 ? !1 : s, l = r ?? Ur;
1818
1896
  let c;
1819
1897
  e[0] !== n.parts ? (c = n.parts ?? [], e[0] = n.parts, e[1] = c) : c = e[1];
1820
1898
  const u = c;
1821
1899
  let d;
1822
- if (e[2] !== a || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== u) {
1823
- const p = [];
1900
+ if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
1901
+ const f = [];
1824
1902
  for (let m = 0; m < u.length; m = m + 1, m) {
1825
- const f = u[m], h = `${n.id}-${m}`;
1826
- e: switch (f.type) {
1903
+ const p = u[m], h = `${n.id}-${m}`;
1904
+ e: switch (p.type) {
1827
1905
  case "text": {
1828
- p.push(/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(fo, { children: f.text }) }, h));
1906
+ f.push(/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(As, { children: p.text }) }, h));
1829
1907
  break e;
1830
1908
  }
1831
1909
  case "reasoning": {
1832
- p.push(/* @__PURE__ */ l(I, { padding: "0", css: {
1910
+ f.push(/* @__PURE__ */ a(I, { padding: "0", css: {
1833
1911
  "& .rich-text, & .rich-text *": {
1834
1912
  color: "fg.subtle !important",
1835
1913
  fontSize: ".75rem !important",
1836
1914
  fontWeight: "normal !important"
1837
1915
  }
1838
- }, children: /* @__PURE__ */ l(on, { defaultState: f.text, fullWidth: !0 }) }, h));
1916
+ }, children: /* @__PURE__ */ a(dn, { defaultState: p.text, fullWidth: !0 }) }, h));
1839
1917
  break e;
1840
1918
  }
1841
1919
  case "tool": {
1842
1920
  const {
1843
1921
  invocations: g,
1844
- nextIndex: b
1845
- } = zr(u, m);
1846
- m = b, p.push(/* @__PURE__ */ l(I, { width: "full", children: /* @__PURE__ */ l(a, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
1922
+ nextIndex: y
1923
+ } = ni(u, m);
1924
+ m = y, f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
1847
1925
  break e;
1848
1926
  }
1849
- case "error": {
1850
- p.push(/* @__PURE__ */ l(I, { py: "2", width: "full", children: /* @__PURE__ */ l(Ht, { borderRadius: "xs", status: "error", colorPalette: "red", title: Dr(f), size: "sm" }) }, h));
1927
+ case "file": {
1928
+ f.push(/* @__PURE__ */ a(I, { width: "fit-content", children: /* @__PURE__ */ a(qt, { fileName: Vt(p), size: "sm", tone: "neutral", icon: Jr(p), onSelect: () => Zr(p, o) }) }, h));
1851
1929
  break e;
1852
1930
  }
1853
- case "token_usage": {
1854
- p.push(/* @__PURE__ */ l(I, { children: /* @__PURE__ */ T(q, { fontSize: "xs", color: "fg.subtle", children: [
1855
- "Tokens: ",
1856
- Et(f.inputTokens),
1857
- " in / ",
1858
- Et(f.outputTokens),
1859
- " out",
1860
- f.cacheReadTokens ? ` / ${Et(f.cacheReadTokens)} cache read` : ""
1861
- ] }) }, h));
1931
+ case "error": {
1932
+ f.push(/* @__PURE__ */ a(I, { py: "2", width: "full", children: /* @__PURE__ */ a(Kt, { borderRadius: "xs", status: "error", colorPalette: "red", title: ei(p), size: "sm" }) }, h));
1862
1933
  break e;
1863
1934
  }
1935
+ case "token_usage":
1936
+ break e;
1864
1937
  case "alert": {
1865
- p.push(/* @__PURE__ */ l(I, { width: "full", children: /* @__PURE__ */ l(Ht, { borderRadius: "xs", status: f.status === "loading" ? "info" : f.status, colorPalette: Fr[f.status], title: f.title, icon: f.status === "loading" ? /* @__PURE__ */ l($t, { size: "sm" }) : void 0, size: "sm", children: f.message }) }, h));
1938
+ f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(Kt, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: ti[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ a(zt, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
1866
1939
  break e;
1867
1940
  }
1868
1941
  default:
1869
- p.push(null);
1942
+ f.push(null);
1870
1943
  }
1871
1944
  }
1872
- d = /* @__PURE__ */ l(Lt, { children: p }), e[2] = a, e[3] = i, e[4] = n.id, e[5] = s, e[6] = u, e[7] = d;
1945
+ d = /* @__PURE__ */ a($t, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
1873
1946
  } else
1874
1947
  d = e[7];
1875
1948
  return d;
1876
1949
  }
1877
- const qr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Qr = (t) => {
1950
+ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", si = (t) => {
1878
1951
  const e = t.parts ?? [];
1879
- return e.length === 0 || e.some((o) => o.type === "text" && "text" in o) ? !1 : e.some((o) => o.type === "reasoning" || o.type === "tool");
1880
- }, Hr = (t) => {
1952
+ return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
1953
+ }, ri = (t) => {
1881
1954
  const e = [];
1882
1955
  for (const n of t) {
1883
- const o = e[e.length - 1];
1884
- if (o && o.role === n.role && Qr(n)) {
1885
- o.parts = [...o.parts ?? [], ...n.parts ?? []];
1956
+ const s = e[e.length - 1];
1957
+ if (s && s.role === n.role && si(n)) {
1958
+ s.parts = [...s.parts ?? [], ...n.parts ?? []];
1886
1959
  continue;
1887
1960
  }
1888
1961
  e.push({
@@ -1891,325 +1964,328 @@ const qr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1891
1964
  });
1892
1965
  }
1893
1966
  return e;
1894
- }, Wr = (t) => {
1967
+ }, ii = (t) => {
1895
1968
  const e = [], n = [];
1896
- for (const o of t)
1897
- o.role === "user" ? e.push({
1898
- userMessage: o,
1969
+ for (const s of t)
1970
+ s.role === "user" ? e.push({
1971
+ userMessage: s,
1899
1972
  responses: []
1900
- }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
1973
+ }) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
1901
1974
  return {
1902
1975
  groups: e,
1903
1976
  leadingResponses: n
1904
1977
  };
1905
- }, An = 720, Nr = 1, Vr = 3, jr = 20, Yt = 1, Ur = 4, Rn = 8, Kr = (t, e) => [...t.map((n) => ({
1978
+ }, Ln = 720, li = 1, ai = 3, ci = 20, on = 1, ui = 4, Dn = 8, di = (t, e) => [...t.map((n) => ({
1906
1979
  type: "leading-response",
1907
1980
  key: n.id,
1908
1981
  message: n
1909
- })), ...e.map((n, o) => ({
1982
+ })), ...e.map((n, s) => ({
1910
1983
  type: "group",
1911
1984
  key: n.userMessage.id,
1912
1985
  group: n,
1913
- groupIndex: o
1914
- }))], Gr = (t, e) => {
1986
+ groupIndex: s
1987
+ }))], fi = (t, e) => {
1915
1988
  if (t === 0) return 0;
1916
- const n = t * An + (t - 1) * Rn;
1989
+ const n = t * Ln + (t - 1) * Dn;
1917
1990
  return Math.max(n - e, 0);
1918
- }, Xr = (t) => t?.clientHeight || Nr, Yr = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= Yt && Math.abs(t.totalSize - e.totalSize) <= Yt, Jr = (t, e) => ({
1991
+ }, pi = (t) => t?.clientHeight || li, mi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= on && Math.abs(t.totalSize - e.totalSize) <= on, hi = (t, e) => ({
1919
1992
  scrollTop: t?.scrollTop ?? 0,
1920
1993
  totalSize: e
1921
- }), Zr = (t) => {
1922
- const e = k(8), {
1994
+ }), gi = (t) => {
1995
+ const e = T(8), {
1923
1996
  itemCount: n,
1924
- onReady: o,
1925
- scrollRef: s,
1997
+ onReady: s,
1998
+ scrollRef: o,
1926
1999
  totalSize: r
1927
- } = t, i = Qe(o);
1928
- let a, c;
1929
- e[0] !== o ? (a = () => {
1930
- i.current = o;
1931
- }, c = [o], e[0] = o, e[1] = a, e[2] = c) : (a = e[1], c = e[2]), Te(a, c);
2000
+ } = t, i = Ne(s);
2001
+ let l, c;
2002
+ e[0] !== s ? (l = () => {
2003
+ i.current = s;
2004
+ }, c = [s], e[0] = s, e[1] = l, e[2] = c) : (l = e[1], c = e[2]), Ae(l, c);
1932
2005
  let u, d;
1933
- e[3] !== n || e[4] !== s || e[5] !== r ? (u = () => {
2006
+ e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
1934
2007
  if (n === 0 || typeof requestAnimationFrame > "u") {
1935
2008
  i.current?.();
1936
2009
  return;
1937
2010
  }
1938
- let p = 0, m = 0, f = 0, h = null;
2011
+ let f = 0, m = 0, p = 0, h = null;
1939
2012
  const g = () => {
1940
2013
  m = m + 1;
1941
- const b = Jr(s.current, r);
1942
- if (f = h && Yr(b, h) ? f + 1 : 0, h = b, f >= Vr || m >= jr) {
2014
+ const y = hi(o.current, r);
2015
+ if (p = h && mi(y, h) ? p + 1 : 0, h = y, p >= ai || m >= ci) {
1943
2016
  i.current?.();
1944
2017
  return;
1945
2018
  }
1946
- p = requestAnimationFrame(g);
2019
+ f = requestAnimationFrame(g);
1947
2020
  };
1948
- return p = requestAnimationFrame(g), () => cancelAnimationFrame(p);
1949
- }, 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]), Te(u, d);
1950
- }, ei = (t) => {
1951
- const e = k(7), {
2021
+ return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
2022
+ }, 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]), Ae(u, d);
2023
+ }, bi = (t) => {
2024
+ const e = T(7), {
1952
2025
  label: n,
1953
- onClick: o,
1954
- actionPanel: s
1955
- } = t, r = s ? "space-between" : "flex-end";
2026
+ onClick: s,
2027
+ actionPanel: o
2028
+ } = t, r = o ? "space-between" : "flex-end";
1956
2029
  let i;
1957
- e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ l(Ke, { size: "2xs", variant: "solid", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
1958
- let a;
1959
- return e[3] !== s || e[4] !== r || e[5] !== i ? (a = /* @__PURE__ */ T(Ce, { 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: [
1960
- s,
2030
+ e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ a(Ze, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
2031
+ let l;
2032
+ return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(Re, { 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: [
2033
+ o,
1961
2034
  i
1962
- ] }), e[3] = s, e[4] = r, e[5] = i, e[6] = a) : a = e[6], a;
1963
- }, In = (t, e, n = !1) => {
1964
- const o = qr(t.role);
1965
- return /* @__PURE__ */ l(we.Root, { from: o, children: /* @__PURE__ */ T(we.Content, { from: o, children: [
1966
- /* @__PURE__ */ l(_n, { message: t, streaming: e, hideQuestionForms: n }),
1967
- o === "assistant" || o === "user" ? /* @__PURE__ */ l(Pt, { message: t, alwaysVisible: o === "user", copyAlwaysVisible: o !== "user" }) : null
2035
+ ] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2036
+ }, Bn = (t, e, n = !1) => {
2037
+ const s = oi(t.role);
2038
+ return /* @__PURE__ */ a(_e.Root, { from: s, children: /* @__PURE__ */ k(_e.Content, { from: s, children: [
2039
+ /* @__PURE__ */ a(vn, { message: t, streaming: e, hideQuestionForms: n }),
2040
+ s === "assistant" || s === "user" ? /* @__PURE__ */ a(Ot, { message: t, alwaysVisible: s === "user", copyAlwaysVisible: s !== "user" }) : null
1968
2041
  ] }) });
1969
- }, ti = (t) => {
1970
- io(t.currentTarget, t.deltaY) && t.stopPropagation();
1971
- }, ni = (t, e) => {
2042
+ }, yi = (t) => {
2043
+ Ss(t.currentTarget, t.deltaY) && t.stopPropagation();
2044
+ }, xi = (t, e) => {
1972
2045
  if (t)
1973
- return e ? dn : so;
1974
- }, si = (t) => {
2046
+ return e ? yn : bs;
2047
+ }, Si = (t) => {
1975
2048
  if (t)
1976
- return dn;
1977
- }, oi = (t) => {
1978
- const e = k(43), {
2049
+ return yn;
2050
+ }, Ti = (t) => {
2051
+ const e = T(43), {
1979
2052
  group: n,
1980
- streaming: o,
1981
- hideQuestionForms: s,
2053
+ streaming: s,
2054
+ hideQuestionForms: o,
1982
2055
  isExpanded: r,
1983
2056
  onToggleStickyMessage: i
1984
2057
  } = t;
1985
- let a, c, u;
1986
- e[0] !== n.userMessage || e[1] !== r ? (a = ro(n.userMessage), c = a && r, u = ni(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = c, e[4] = u) : (a = e[2], c = e[3], u = e[4]);
2058
+ let l, c, u;
2059
+ e[0] !== n.userMessage || e[1] !== r ? (l = xs(n.userMessage), c = l && r, u = xi(l, r), e[0] = n.userMessage, e[1] = r, e[2] = l, e[3] = c, e[4] = u) : (l = e[2], c = e[3], u = e[4]);
1987
2060
  const d = u;
1988
- let p;
1989
- e[5] !== n.userMessage.id || e[6] !== i ? (p = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = p) : p = e[7];
1990
- const m = p, f = a ? "0" : void 0, h = a ? "relative" : void 0, g = a ? r ? "expanded" : "collapsed" : void 0;
1991
- let b;
1992
- e[8] !== c ? (b = si(c), e[8] = c, e[9] = b) : b = e[9];
1993
- const y = c ? "auto" : "visible", x = a ? "xs" : void 0, _ = a ? "xs" : void 0, C = c ? "3rem" : void 0, w = c ? ti : void 0;
1994
- let R;
1995
- e[10] !== n.userMessage || e[11] !== o ? (R = /* @__PURE__ */ l(_n, { message: n.userMessage, streaming: o }), e[10] = n.userMessage, e[11] = o, e[12] = R) : R = e[12];
1996
- let B;
1997
- e[13] !== w || e[14] !== R || e[15] !== g || e[16] !== b || e[17] !== y || e[18] !== x || e[19] !== _ || e[20] !== C ? (B = /* @__PURE__ */ l(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: b, minH: "0", overflowY: y, px: x, py: _, pb: C, onWheel: w, children: R }), e[13] = w, e[14] = R, e[15] = g, e[16] = b, e[17] = y, e[18] = x, e[19] = _, e[20] = C, e[21] = B) : B = e[21];
2061
+ let f;
2062
+ e[5] !== n.userMessage.id || e[6] !== i ? (f = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = f) : f = e[7];
2063
+ const m = f, p = l ? "0" : void 0, h = l ? "relative" : void 0, g = l ? r ? "expanded" : "collapsed" : void 0;
2064
+ let y;
2065
+ e[8] !== c ? (y = Si(c), e[8] = c, e[9] = y) : y = e[9];
2066
+ const b = c ? "auto" : "visible", x = l ? "xs" : void 0, C = l ? "xs" : void 0, A = c ? "3rem" : void 0, w = c ? yi : void 0;
2067
+ let _;
2068
+ e[10] !== n.userMessage || e[11] !== s ? (_ = /* @__PURE__ */ a(vn, { message: n.userMessage, streaming: s }), e[10] = n.userMessage, e[11] = s, e[12] = _) : _ = e[12];
1998
2069
  let M;
1999
- e[22] !== n.userMessage || e[23] !== a || e[24] !== r || e[25] !== m ? (M = a ? /* @__PURE__ */ l(ei, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ l(Pt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ l(Pt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = a, e[24] = r, e[25] = m, e[26] = M) : M = e[26];
2070
+ e[13] !== w || e[14] !== _ || e[15] !== g || e[16] !== y || e[17] !== b || e[18] !== x || e[19] !== C || e[20] !== A ? (M = /* @__PURE__ */ a(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: y, minH: "0", overflowY: b, px: x, py: C, pb: A, onWheel: w, children: _ }), e[13] = w, e[14] = _, e[15] = g, e[16] = y, e[17] = b, e[18] = x, e[19] = C, e[20] = A, e[21] = M) : M = e[21];
2000
2071
  let P;
2001
- e[27] !== d || e[28] !== B || e[29] !== M || e[30] !== f || e[31] !== h ? (P = /* @__PURE__ */ l(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ l(we.Root, { from: "user", children: /* @__PURE__ */ T(we.Content, { from: "user", maxH: d, overflow: "hidden", p: f, position: h, children: [
2002
- B,
2003
- M
2004
- ] }) }) }), e[27] = d, e[28] = B, e[29] = M, e[30] = f, e[31] = h, e[32] = P) : P = e[32];
2005
- let Q;
2006
- if (e[33] !== n.responses || e[34] !== s || e[35] !== o) {
2007
- let H;
2008
- e[37] !== s || e[38] !== o ? (H = (ee) => /* @__PURE__ */ l(I, { children: In(ee, o, s) }, ee.id), e[37] = s, e[38] = o, e[39] = H) : H = e[39], Q = n.responses.map(H), e[33] = n.responses, e[34] = s, e[35] = o, e[36] = Q;
2009
- } else
2010
- Q = e[36];
2072
+ e[22] !== n.userMessage || e[23] !== l || e[24] !== r || e[25] !== m ? (P = l ? /* @__PURE__ */ a(bi, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ a(Ot, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ a(Ot, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = l, e[24] = r, e[25] = m, e[26] = P) : P = e[26];
2073
+ let v;
2074
+ e[27] !== d || e[28] !== M || e[29] !== P || e[30] !== p || e[31] !== h ? (v = /* @__PURE__ */ a(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ k(_e.Content, { from: "user", maxH: d, overflow: "hidden", p, position: h, children: [
2075
+ M,
2076
+ P
2077
+ ] }) }) }), e[27] = d, e[28] = M, e[29] = P, e[30] = p, e[31] = h, e[32] = v) : v = e[32];
2011
2078
  let L;
2012
- return e[40] !== P || e[41] !== Q ? (L = /* @__PURE__ */ T(I, { children: [
2013
- P,
2014
- Q
2015
- ] }), e[40] = P, e[41] = Q, e[42] = L) : L = e[42], L;
2016
- }, ri = (t, e) => {
2079
+ if (e[33] !== n.responses || e[34] !== o || e[35] !== s) {
2080
+ let J;
2081
+ e[37] !== o || e[38] !== s ? (J = (B) => /* @__PURE__ */ a(I, { children: Bn(B, s, o) }, B.id), e[37] = o, e[38] = s, e[39] = J) : J = e[39], L = n.responses.map(J), e[33] = n.responses, e[34] = o, e[35] = s, e[36] = L;
2082
+ } else
2083
+ L = e[36];
2084
+ let q;
2085
+ return e[40] !== v || e[41] !== L ? (q = /* @__PURE__ */ k(I, { children: [
2086
+ v,
2087
+ L
2088
+ ] }), e[40] = v, e[41] = L, e[42] = q) : q = e[42], q;
2089
+ }, wi = (t, e) => {
2017
2090
  const {
2018
2091
  groups: n,
2019
- streaming: o,
2020
- hideActiveQuestionForms: s,
2092
+ streaming: s,
2093
+ hideActiveQuestionForms: o,
2021
2094
  expandedStickyMessageIds: r,
2022
2095
  onToggleStickyMessage: i
2023
2096
  } = e;
2024
- return t.type === "leading-response" ? In(t.message, o, n.length > 0 || s) : /* @__PURE__ */ l(oi, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
2025
- }, ii = (t) => {
2097
+ return t.type === "leading-response" ? Bn(t.message, s, n.length > 0 || o) : /* @__PURE__ */ a(Ti, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
2098
+ }, ki = (t) => {
2026
2099
  const {
2027
2100
  leadingResponses: e,
2028
2101
  groups: n,
2029
- streaming: o,
2030
- hideActiveQuestionForms: s,
2102
+ streaming: s,
2103
+ hideActiveQuestionForms: o,
2031
2104
  expandedStickyMessageIds: r,
2032
2105
  onToggleStickyMessage: i,
2033
- onReady: a
2106
+ onReady: l
2034
2107
  } = t, {
2035
2108
  scrollRef: c
2036
- } = ct(), u = Kr(e, n), d = Xr(c.current), p = ys({
2109
+ } = mt(), u = di(e, n), d = pi(c.current), f = Ro({
2037
2110
  count: u.length,
2038
2111
  getScrollElement: () => c.current,
2039
- estimateSize: () => An,
2040
- getItemKey: (f) => u[f]?.key ?? f,
2041
- overscan: Ur,
2042
- gap: Rn,
2112
+ estimateSize: () => Ln,
2113
+ getItemKey: (p) => u[p]?.key ?? p,
2114
+ overscan: ui,
2115
+ gap: Dn,
2043
2116
  initialRect: {
2044
2117
  width: 0,
2045
2118
  height: d
2046
2119
  },
2047
- initialOffset: () => Gr(u.length, d)
2048
- }), m = p.getTotalSize();
2049
- return Zr({
2120
+ initialOffset: () => fi(u.length, d)
2121
+ }), m = f.getTotalSize();
2122
+ return gi({
2050
2123
  itemCount: u.length,
2051
- onReady: a,
2124
+ onReady: l,
2052
2125
  scrollRef: c,
2053
2126
  totalSize: m
2054
- }), /* @__PURE__ */ l(I, { px: "xs", children: /* @__PURE__ */ l(I, { position: "relative", width: "100%", style: {
2127
+ }), /* @__PURE__ */ a(I, { px: "xs", children: /* @__PURE__ */ a(I, { position: "relative", width: "100%", style: {
2055
2128
  height: m
2056
- }, children: p.getVirtualItems().map((f) => {
2057
- const h = u[f.index];
2058
- return h ? /* @__PURE__ */ l(I, { ref: p.measureElement, "data-index": f.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2059
- top: f.start
2060
- }, children: ri(h, {
2129
+ }, children: f.getVirtualItems().map((p) => {
2130
+ const h = u[p.index];
2131
+ return h ? /* @__PURE__ */ a(I, { ref: f.measureElement, "data-index": p.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2132
+ top: p.start
2133
+ }, children: wi(h, {
2061
2134
  groups: n,
2062
- streaming: o,
2063
- hideActiveQuestionForms: s,
2135
+ streaming: s,
2136
+ hideActiveQuestionForms: o,
2064
2137
  expandedStickyMessageIds: r,
2065
2138
  onToggleStickyMessage: i
2066
- }) }, f.key) : null;
2139
+ }) }, p.key) : null;
2067
2140
  }) }) });
2068
- }, Ui = (t) => {
2069
- const e = k(62), {
2141
+ }, dl = (t) => {
2142
+ const e = T(64), {
2070
2143
  conversationKey: n,
2071
- messages: o,
2072
- loading: s,
2144
+ messages: s,
2145
+ loading: o,
2073
2146
  streaming: r,
2074
2147
  emptyStateTitle: i,
2075
- emptyStateDescription: a,
2148
+ emptyStateDescription: l,
2076
2149
  emptyStateContent: c,
2077
2150
  loaderComponent: u,
2078
2151
  chatInputPlaceholder: d,
2079
- chatInputDefaultValue: p,
2152
+ chatInputDefaultValue: f,
2080
2153
  onSubmitMessage: m,
2081
- onInterrupt: f,
2082
- onChatInputChange: h,
2083
- actions: g,
2084
- repoMenu: b,
2085
- attachedResources: y,
2086
- onClearAttachments: x,
2087
- attachmentList: _,
2088
- approvalPrompt: C,
2089
- workspaceHub: w,
2090
- workspaceInitializing: R,
2091
- inputDisabled: B,
2092
- chatInputQuestionPrompt: M,
2093
- chatInputAutoFocus: P
2094
- } = t, Q = s === void 0 ? !1 : s, L = r === void 0 ? !1 : r, H = p === void 0 ? "" : p, ee = R === void 0 ? !1 : R, _e = B === void 0 ? !1 : B, Ae = P === void 0 ? !1 : P;
2095
- let $, E, te, W;
2096
- if (e[0] !== n || e[1] !== o) {
2097
- const v = Hr(o);
2098
- $ = v.length > 0;
2099
- const ye = n ?? v[0]?.id;
2100
- E = $ ? ye ?? "active-conversation" : null, W = v.reduce(li, 0), te = Wr(v), e[0] = n, e[1] = o, e[2] = $, e[3] = E, e[4] = te, e[5] = W;
2154
+ onInterrupt: p,
2155
+ onAttachFiles: h,
2156
+ onAttachText: g,
2157
+ onChatInputChange: y,
2158
+ actions: b,
2159
+ repoMenu: x,
2160
+ attachedResources: C,
2161
+ onClearAttachments: A,
2162
+ attachmentList: w,
2163
+ approvalPrompt: _,
2164
+ workspaceHub: M,
2165
+ workspaceInitializing: P,
2166
+ inputDisabled: v,
2167
+ chatInputQuestionPrompt: L,
2168
+ chatInputAutoFocus: q
2169
+ } = t, J = o === void 0 ? !1 : o, B = r === void 0 ? !1 : r, ve = f === void 0 ? "" : f, je = P === void 0 ? !1 : P, Le = v === void 0 ? !1 : v, he = q === void 0 ? !1 : q;
2170
+ let F, z, ee, E;
2171
+ if (e[0] !== n || e[1] !== s) {
2172
+ const H = ri(s);
2173
+ F = H.length > 0;
2174
+ const we = n ?? H[0]?.id;
2175
+ z = F ? we ?? "active-conversation" : null, E = H.reduce(Ci, 0), ee = ii(H), e[0] = n, e[1] = s, e[2] = F, e[3] = z, e[4] = ee, e[5] = E;
2101
2176
  } else
2102
- $ = e[2], E = e[3], te = e[4], W = e[5];
2177
+ F = e[2], z = e[3], ee = e[4], E = e[5];
2103
2178
  const {
2104
- groups: O,
2105
- leadingResponses: fe
2106
- } = te, [Re, We] = G(ai), [Pe, Ye] = G(null), Le = !$ && Q;
2107
- let ne;
2108
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ l(cs, { size: 48, strokeWidth: 1.5 }), e[6] = ne) : ne = e[6];
2109
- let se;
2110
- e[7] !== a || e[8] !== i ? (se = /* @__PURE__ */ l(bs, { icon: ne, title: i, description: a }), e[7] = a, e[8] = i, e[9] = se) : se = e[9];
2111
- const pe = Le ? u : c ?? se, X = !!w, me = !!M, he = L && $ && !ee, oe = !E || Pe === E;
2179
+ groups: ge,
2180
+ leadingResponses: be
2181
+ } = ee, [O, De] = G(Ai), [Ue, Ke] = G(null), Be = !F && J;
2112
2182
  let Ie;
2113
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = (v) => {
2114
- We((ye) => {
2115
- const xe = new Set(ye);
2116
- return xe.has(v) ? xe.delete(v) : xe.add(v), xe;
2183
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ a(yo, { size: 48, strokeWidth: 1.5 }), e[6] = Ie) : Ie = e[6];
2184
+ let te;
2185
+ e[7] !== l || e[8] !== i ? (te = /* @__PURE__ */ a(_o, { icon: Ie, title: i, description: l }), e[7] = l, e[8] = i, e[9] = te) : te = e[9];
2186
+ const ye = Be ? u : c ?? te, ne = !!M, xe = !!L, oe = B && F && !je, se = !z || Ue === z;
2187
+ let re;
2188
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (H) => {
2189
+ De((we) => {
2190
+ const K = new Set(we);
2191
+ return K.has(H) ? K.delete(H) : K.add(H), K;
2117
2192
  });
2118
- }, e[10] = Ie) : Ie = e[10];
2119
- const ve = Ie;
2193
+ }, e[10] = re) : re = e[10];
2194
+ const Oe = re;
2195
+ let ie;
2196
+ e[11] !== E ? (ie = /* @__PURE__ */ a(Qo, { userMessageCount: E }), e[11] = E, e[12] = ie) : ie = e[12];
2197
+ const Se = se ? "visible" : "hidden";
2198
+ let Q;
2199
+ e[13] !== ye || e[14] !== O || e[15] !== ge || e[16] !== F || e[17] !== xe || e[18] !== be || e[19] !== z || e[20] !== B ? (Q = F ? /* @__PURE__ */ a(ki, { leadingResponses: be, groups: ge, streaming: B, hideActiveQuestionForms: xe, expandedStickyMessageIds: O, onToggleStickyMessage: Oe, onReady: () => Ke(z) }, z) : ye, e[13] = ye, e[14] = O, e[15] = ge, e[16] = F, e[17] = xe, e[18] = be, e[19] = z, e[20] = B, e[21] = Q) : Q = e[21];
2200
+ let W;
2201
+ e[22] !== Se || e[23] !== Q ? (W = /* @__PURE__ */ a(vt.Viewport, { visibility: Se, children: Q }), e[22] = Se, e[23] = Q, e[24] = W) : W = e[24];
2202
+ let Te;
2203
+ e[25] !== se ? (Te = se ? /* @__PURE__ */ a(vt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = se, e[26] = Te) : Te = e[26];
2120
2204
  let N;
2121
- e[11] !== W ? (N = /* @__PURE__ */ l(Bs, { userMessageCount: W }), e[11] = W, e[12] = N) : N = e[12];
2122
- const ge = oe ? "visible" : "hidden";
2123
- let be;
2124
- e[13] !== pe || e[14] !== Re || e[15] !== O || e[16] !== $ || e[17] !== me || e[18] !== fe || e[19] !== E || e[20] !== L ? (be = $ ? /* @__PURE__ */ l(ii, { leadingResponses: fe, groups: O, streaming: L, hideActiveQuestionForms: me, expandedStickyMessageIds: Re, onToggleStickyMessage: ve, onReady: () => Ye(E) }, E) : pe, e[13] = pe, e[14] = Re, e[15] = O, e[16] = $, e[17] = me, e[18] = fe, e[19] = E, e[20] = L, e[21] = be) : be = e[21];
2125
- let V;
2126
- e[22] !== ge || e[23] !== be ? (V = /* @__PURE__ */ l(Rt.Viewport, { visibility: ge, children: be }), e[22] = ge, e[23] = be, e[24] = V) : V = e[24];
2127
- let Y;
2128
- e[25] !== oe ? (Y = oe ? /* @__PURE__ */ l(Rt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = oe, e[26] = Y) : Y = e[26];
2205
+ e[27] !== ie || e[28] !== W || e[29] !== Te ? (N = /* @__PURE__ */ k(vt.Root, { children: [
2206
+ ie,
2207
+ W,
2208
+ Te
2209
+ ] }), e[27] = ie, e[28] = W, e[29] = Te, e[30] = N) : N = e[30];
2210
+ let Z;
2211
+ e[31] !== oe ? (Z = oe ? /* @__PURE__ */ k(Me, { gap: "xs", px: "sm", py: "2xs", children: [
2212
+ /* @__PURE__ */ a(zt, { size: "xs", color: "fg.muted" }),
2213
+ /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
2214
+ ] }) : null, e[31] = oe, e[32] = Z) : Z = e[32];
2215
+ const V = ne ? "0" : "xs";
2216
+ let $;
2217
+ e[33] !== ve ? ($ = ms(ve), e[33] = ve, e[34] = $) : $ = e[34];
2129
2218
  let D;
2130
- e[27] !== N || e[28] !== V || e[29] !== Y ? (D = /* @__PURE__ */ T(Rt.Root, { children: [
2131
- N,
2132
- V,
2133
- Y
2134
- ] }), e[27] = N, e[28] = V, e[29] = Y, e[30] = D) : D = e[30];
2135
- let F;
2136
- e[31] !== he ? (F = he ? /* @__PURE__ */ T(Ee, { gap: "xs", px: "sm", py: "2xs", children: [
2137
- /* @__PURE__ */ l($t, { size: "xs", color: "fg.muted" }),
2138
- /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
2139
- ] }) : null, e[31] = he, e[32] = F) : F = e[32];
2140
- const z = X ? "0" : "xs";
2219
+ e[35] !== b || e[36] !== C || e[37] !== w || e[38] !== he || e[39] !== d || e[40] !== L || e[41] !== ne || e[42] !== Le || e[43] !== h || e[44] !== g || e[45] !== y || e[46] !== A || e[47] !== p || e[48] !== m || e[49] !== B || e[50] !== $ ? (D = /* @__PURE__ */ a(us, { placeholder: d, defaultState: $, streaming: B, onSubmit: m, onInterrupt: p, onAttachFiles: h, onAttachText: g, onChange: y, actions: b, attachedResources: C, onClearAttachments: A, attachmentList: w, isDisabled: Le, attachedToTop: ne, questionPrompt: L, autoFocus: he }), e[35] = b, e[36] = C, e[37] = w, e[38] = he, e[39] = d, e[40] = L, e[41] = ne, e[42] = Le, e[43] = h, e[44] = g, e[45] = y, e[46] = A, e[47] = p, e[48] = m, e[49] = B, e[50] = $, e[51] = D) : D = e[51];
2141
2220
  let j;
2142
- e[33] !== H ? (j = eo(H), e[33] = H, e[34] = j) : j = e[34];
2221
+ e[52] !== V || e[53] !== D || e[54] !== M ? (j = /* @__PURE__ */ k(Y, { px: "xs", gap: V, children: [
2222
+ M,
2223
+ D
2224
+ ] }), e[52] = V, e[53] = D, e[54] = M, e[55] = j) : j = e[55];
2143
2225
  let U;
2144
- e[35] !== g || e[36] !== y || e[37] !== _ || e[38] !== Ae || e[39] !== d || e[40] !== M || e[41] !== X || e[42] !== _e || e[43] !== h || e[44] !== x || e[45] !== f || e[46] !== m || e[47] !== L || e[48] !== j ? (U = /* @__PURE__ */ l(Xs, { placeholder: d, defaultState: j, streaming: L, onSubmit: m, onInterrupt: f, onChange: h, actions: g, attachedResources: y, onClearAttachments: x, attachmentList: _, isDisabled: _e, attachedToTop: X, questionPrompt: M, autoFocus: Ae }), e[35] = g, e[36] = y, e[37] = _, e[38] = Ae, e[39] = d, e[40] = M, e[41] = X, e[42] = _e, e[43] = h, e[44] = x, e[45] = f, e[46] = m, e[47] = L, e[48] = j, e[49] = U) : U = e[49];
2145
- let K;
2146
- e[50] !== z || e[51] !== U || e[52] !== w ? (K = /* @__PURE__ */ T(Z, { px: "xs", gap: z, children: [
2147
- w,
2226
+ e[56] !== x ? (U = /* @__PURE__ */ a(Re, { p: "2xs", justifyContent: "flex-end", children: x }), e[56] = x, e[57] = U) : U = e[57];
2227
+ let le;
2228
+ return e[58] !== _ || e[59] !== N || e[60] !== Z || e[61] !== j || e[62] !== U ? (le = /* @__PURE__ */ k(Re, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2229
+ N,
2230
+ _,
2231
+ Z,
2232
+ j,
2148
2233
  U
2149
- ] }), e[50] = z, e[51] = U, e[52] = w, e[53] = K) : K = e[53];
2150
- let J;
2151
- e[54] !== b ? (J = /* @__PURE__ */ l(Ce, { p: "2xs", justifyContent: "flex-end", children: b }), e[54] = b, e[55] = J) : J = e[55];
2152
- let re;
2153
- return e[56] !== C || e[57] !== D || e[58] !== F || e[59] !== K || e[60] !== J ? (re = /* @__PURE__ */ T(Ce, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2154
- D,
2155
- C,
2156
- F,
2157
- K,
2158
- J
2159
- ] }), e[56] = C, e[57] = D, e[58] = F, e[59] = K, e[60] = J, e[61] = re) : re = e[61], re;
2234
+ ] }), e[58] = _, e[59] = N, e[60] = Z, e[61] = j, e[62] = U, e[63] = le) : le = e[63], le;
2160
2235
  };
2161
- function li(t, e) {
2236
+ function Ci(t, e) {
2162
2237
  return t + (e.role === "user" ? 1 : 0);
2163
2238
  }
2164
- function ai() {
2239
+ function Ai() {
2165
2240
  return /* @__PURE__ */ new Set();
2166
2241
  }
2167
- const Jt = (t) => /* @__PURE__ */ l(Z, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ l(Qn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Ki = () => {
2168
- const t = k(2);
2242
+ const sn = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ a(Gn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), fl = () => {
2243
+ const t = T(2);
2169
2244
  let e;
2170
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ l(we.Root, { from: "user", children: /* @__PURE__ */ l(we.Content, { from: "user", children: Jt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2245
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ a(_e.Content, { from: "user", children: sn(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2171
2246
  let n;
2172
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ T(Z, { minH: "full", py: "xs", gap: "0", children: [
2247
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(Y, { minH: "full", py: "xs", gap: "0", children: [
2173
2248
  e,
2174
- /* @__PURE__ */ l(we.Root, { from: "assistant", children: /* @__PURE__ */ l(we.Content, { from: "assistant", children: Jt(["76%", "62%", "40%"]) }) })
2249
+ /* @__PURE__ */ a(_e.Root, { from: "assistant", children: /* @__PURE__ */ a(_e.Content, { from: "assistant", children: sn(["76%", "62%", "40%"]) }) })
2175
2250
  ] }), t[1] = n) : n = t[1], n;
2176
- }, Gi = (t) => {
2177
- const e = k(14), {
2251
+ }, pl = (t) => {
2252
+ const e = T(14), {
2178
2253
  changesLabel: n,
2179
- additions: o,
2180
- deletions: s,
2254
+ additions: s,
2255
+ deletions: o,
2181
2256
  action: r,
2182
2257
  status: i,
2183
- statusLabel: a
2184
- } = t, c = i === void 0 ? "ready" : i, u = o > 0 || s > 0, d = c === "error" ? "border.error" : "border.muted", p = c === "error" ? "bg.error" : "bg.subtle";
2258
+ statusLabel: l
2259
+ } = t, c = i === void 0 ? "ready" : i, u = s > 0 || o > 0, d = c === "error" ? "border.error" : "border.muted", f = c === "error" ? "bg.error" : "bg.subtle";
2185
2260
  let m;
2186
- e[0] !== o || e[1] !== n || e[2] !== s || e[3] !== u || e[4] !== c || e[5] !== a ? (m = c === "loading" ? /* @__PURE__ */ T(Ee, { gap: "xs", minW: "0", children: [
2187
- /* @__PURE__ */ l($t, { size: "xs", color: "fg.muted" }),
2188
- /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: a ?? "Setting up workspace..." })
2189
- ] }) : c === "error" ? /* @__PURE__ */ T(Ee, { gap: "xs", minW: "0", children: [
2190
- /* @__PURE__ */ l(nn, { size: 14, color: "var(--chakra-colors-fg-error)" }),
2191
- /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: a ?? "Workspace setup failed" })
2192
- ] }) : u ? /* @__PURE__ */ l(ln, { label: n, additions: o, deletions: s, variant: "ghost", size: "small", _hover: {
2261
+ e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== u || e[4] !== c || e[5] !== l ? (m = c === "loading" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
2262
+ /* @__PURE__ */ a(zt, { size: "xs", color: "fg.muted" }),
2263
+ /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: l ?? "Setting up workspace..." })
2264
+ ] }) : c === "error" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
2265
+ /* @__PURE__ */ a(cn, { size: 14, color: "var(--chakra-colors-fg-error)" }),
2266
+ /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: l ?? "Workspace setup failed" })
2267
+ ] }) : u ? /* @__PURE__ */ a(pn, { label: n, additions: s, deletions: o, variant: "ghost", size: "small", _hover: {
2193
2268
  background: "transparent"
2194
- } }) : /* @__PURE__ */ l(Ce, { flex: "1" }), e[0] = o, e[1] = n, e[2] = s, e[3] = u, e[4] = c, e[5] = a, e[6] = m) : m = e[6];
2195
- let f;
2196
- e[7] !== r ? (f = r ? /* @__PURE__ */ l(Ce, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = f) : f = e[8];
2269
+ } }) : /* @__PURE__ */ a(Re, { flex: "1" }), e[0] = s, e[1] = n, e[2] = o, e[3] = u, e[4] = c, e[5] = l, e[6] = m) : m = e[6];
2270
+ let p;
2271
+ e[7] !== r ? (p = r ? /* @__PURE__ */ a(Re, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = p) : p = e[8];
2197
2272
  let h;
2198
- return e[9] !== d || e[10] !== p || e[11] !== m || e[12] !== f ? (h = /* @__PURE__ */ T(Ce, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: p, children: [
2273
+ return e[9] !== d || e[10] !== f || e[11] !== m || e[12] !== p ? (h = /* @__PURE__ */ k(Re, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: f, children: [
2199
2274
  m,
2200
- f
2201
- ] }), e[9] = d, e[10] = p, e[11] = m, e[12] = f, e[13] = h) : h = e[13], h;
2275
+ p
2276
+ ] }), e[9] = d, e[10] = f, e[11] = m, e[12] = p, e[13] = h) : h = e[13], h;
2202
2277
  };
2203
2278
  export {
2204
- ji as ApprovalPrompt,
2205
- Bs as AutoScroll,
2206
- Xs as ChatInput,
2207
- we as ChatMessage,
2208
- Ui as ChatPanel,
2209
- Rt as ChatPrimitives,
2210
- Ki as ChatSkeleton,
2211
- Gi as ChatWorkspaceHub,
2212
- Gs as SendButton,
2213
- eo as createSerializedPromptState
2279
+ cl as ApprovalPrompt,
2280
+ ul as AttachmentList,
2281
+ Qo as AutoScroll,
2282
+ us as ChatInput,
2283
+ _e as ChatMessage,
2284
+ dl as ChatPanel,
2285
+ vt as ChatPrimitives,
2286
+ fl as ChatSkeleton,
2287
+ pl as ChatWorkspaceHub,
2288
+ as as SendButton,
2289
+ ms as createSerializedPromptState
2214
2290
  };
2215
2291
  //# sourceMappingURL=chat-ui.js.map