@pstdio/ui 0.5.1 → 0.5.2

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