@pstdio/ui 0.2.2 → 0.2.4

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 (33) hide show
  1. package/dist/chat-ui.js +689 -637
  2. package/dist/chat-ui.js.map +1 -1
  3. package/dist/components/chat-ui/components/chat-input.d.ts +1 -0
  4. package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +4 -0
  5. package/dist/components/chat-ui/components/chat-panel.d.ts +3 -0
  6. package/dist/components/chat-ui/components/chat-panel.sticky-user-message.test.d.ts +1 -0
  7. package/dist/components/chat-ui/components/chat-panel.stories.d.ts +2 -0
  8. package/dist/components/chat-ui/components/chat-skeleton.d.ts +1 -0
  9. package/dist/components/chat-ui/components/workspace-hub.d.ts +9 -0
  10. package/dist/components/chat-ui/components/workspace-hub.stories.d.ts +6 -0
  11. package/dist/components/chat-ui/index.d.ts +2 -0
  12. package/dist/components/diff-editor.d.ts +2 -0
  13. package/dist/components/diff-view-adapter.d.ts +14 -0
  14. package/dist/components/diff-view-adapter.test.d.ts +1 -0
  15. package/dist/components/rich-text/shared/components/content-editable.d.ts +2 -1
  16. package/dist/components/tickets/types.d.ts +4 -6
  17. package/dist/empty-state-DHSKuwia.js +160 -0
  18. package/dist/empty-state-DHSKuwia.js.map +1 -0
  19. package/dist/index.js +1334 -1317
  20. package/dist/index.js.map +1 -1
  21. package/dist/{rich-message-C0_i-4Ux.js → rich-message-ZT2CEiwt.js} +413 -404
  22. package/dist/rich-message-ZT2CEiwt.js.map +1 -0
  23. package/dist/rich-text.js +5 -5
  24. package/dist/rich-text.js.map +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/tooltip-Dze4WXVl.js +86 -0
  27. package/dist/tooltip-Dze4WXVl.js.map +1 -0
  28. package/package.json +6 -4
  29. package/dist/rich-message-C0_i-4Ux.js.map +0 -1
  30. package/dist/scroll-area-DZs-GiIp.js +0 -267
  31. package/dist/scroll-area-DZs-GiIp.js.map +0 -1
  32. package/dist/tooltip-Gm7PLwZG.js +0 -51
  33. package/dist/tooltip-Gm7PLwZG.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as i, jsxs as x, Fragment as Le } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as b, Fragment as Ue } from "react/jsx-runtime";
2
2
  import { c as y } from "react/compiler-runtime";
3
- import { chakra as gt, AbsoluteCenter as bt, IconButton as Ye, defineSlotRecipe as xt, createSlotRecipeContext as yt, Text as te, Code as Ue, Button as $e, HStack as Qe, Box as k, Flex as be, Tooltip as ge, Portal as St, Kbd as kt, Spacer as Tt, Timeline as wt, Span as ae, Avatar as ne, Card as N, Link as Ze, Stack as et, Spinner as Ct } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Pt, ShieldX as _t, ShieldCheck as Rt, Square as It, ArrowUp as Bt, Move as Dt, FileDown as At, FileUp as vt, FileDiff as Ft, Trash2 as zt, FilePen as $t, FileText as Mt, ListTree as Ot, Terminal as tt, File as Lt, Globe as Wt, Search as Et, AlertTriangle as Ht, DotIcon as Nt, ChevronUpIcon as jt, MessageCircleIcon as Ut } from "lucide-react";
5
- import { StickToBottom as Vt, useStickToBottomContext as We } from "use-stick-to-bottom";
6
- import { S as nt, D as qt, a as Kt, E as Gt } from "./scroll-area-DZs-GiIp.js";
7
- import { useRef as Me, useEffect as Oe, useState as ce } from "react";
8
- import { f as Ae, P as Jt, g as Xt, R as rt, h as Yt } from "./rich-message-C0_i-4Ux.js";
3
+ import { chakra as wt, AbsoluteCenter as _t, IconButton as rt, defineSlotRecipe as Pt, createSlotRecipeContext as Rt, Text as re, Code as Xe, Button as me, HStack as st, Box as k, Flex as V, Tooltip as Ce, Portal as It, Kbd as vt, Spacer as Bt, Timeline as Mt, Span as pe, Avatar as se, Card as A, Link as it, Stack as he, Spinner as At, Skeleton as Dt } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as zt, ShieldX as $t, ShieldCheck as Et, Square as Ft, ArrowUp as Lt, Move as Ot, FileDown as Ht, FileUp as Wt, FileDiff as jt, Trash2 as Nt, FilePen as Ut, FileText as Vt, ListTree as qt, Terminal as lt, File as Gt, Globe as Kt, Search as Yt, AlertTriangle as Xt, DotIcon as Jt, ChevronUpIcon as Qt, MessageCircleIcon as Zt } from "lucide-react";
5
+ import { StickToBottom as en, useStickToBottomContext as Ve } from "use-stick-to-bottom";
6
+ import { S as ct } from "./tooltip-Dze4WXVl.js";
7
+ import { useRef as je, useEffect as Ne, useState as oe } from "react";
8
+ import { f as Oe, P as tn, g as nn, R as at, h as on } from "./rich-message-ZT2CEiwt.js";
9
9
  import "@lexical/react/LexicalCollaborationContext";
10
10
  import "@lexical/react/LexicalCollaborationPlugin";
11
11
  import "@lexical/react/LexicalComposer";
@@ -24,18 +24,18 @@ import "@lexical/rich-text";
24
24
  import "@lexical/selection";
25
25
  import "@lexical/utils";
26
26
  import "react-dom";
27
- import "./tooltip-Gm7PLwZG.js";
28
27
  import "@lexical/markdown";
29
28
  import "@lexical/react/LexicalAutoFocusPlugin";
30
29
  import "@lexical/react/LexicalHistoryPlugin";
31
30
  import "@lexical/react/LexicalOnChangePlugin";
32
31
  import "@lexical/react/LexicalTreeView";
33
- const Qt = {
32
+ import { D as rn, a as dt, E as sn } from "./empty-state-DHSKuwia.js";
33
+ const ln = {
34
34
  "aria-roledescription": "conversation",
35
35
  initial: "instant",
36
36
  resize: "instant",
37
37
  role: "log"
38
- }, Zt = gt(Vt, {
38
+ }, cn = wt(en, {
39
39
  base: {
40
40
  position: "relative",
41
41
  flex: 1,
@@ -44,42 +44,42 @@ const Qt = {
44
44
  }
45
45
  }, {
46
46
  forwardProps: ["resize"],
47
- defaultProps: Qt
48
- }), en = (t) => {
47
+ defaultProps: ln
48
+ }), an = (t) => {
49
49
  const e = y(9);
50
- let n, r;
50
+ let n, o;
51
51
  e[0] !== t ? ({
52
52
  children: n,
53
- ...r
54
- } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
53
+ ...o
54
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
55
55
  const {
56
- contentRef: o,
56
+ contentRef: r,
57
57
  scrollRef: s
58
- } = We(), l = s, c = o;
59
- let d;
60
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
58
+ } = Ve(), l = s, c = r;
59
+ let a;
60
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
61
61
  p: "sm",
62
62
  "aria-live": "polite",
63
63
  role: "list"
64
- }, e[3] = d) : d = e[3];
65
- let a;
66
- return e[4] !== n || e[5] !== r || e[6] !== l || e[7] !== c ? (a = /* @__PURE__ */ i(nt, { ...r, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: c, contentProps: d, children: n }), e[4] = n, e[5] = r, e[6] = l, e[7] = c, e[8] = a) : a = e[8], a;
67
- }, tn = {
64
+ }, e[3] = a) : a = e[3];
65
+ let d;
66
+ return e[4] !== n || e[5] !== o || e[6] !== l || e[7] !== c ? (d = /* @__PURE__ */ i(ct, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: c, contentProps: a, children: n }), e[4] = n, e[5] = o, e[6] = l, e[7] = c, e[8] = d) : d = e[8], d;
67
+ }, dn = {
68
68
  axis: "horizontal",
69
69
  bottom: "md",
70
70
  zIndex: 2
71
- }, nn = (t) => {
71
+ }, un = (t) => {
72
72
  const e = y(4), {
73
73
  isAtBottom: n,
74
- scrollToBottom: r
75
- } = We();
76
- let o;
77
- return e[0] !== n || e[1] !== t || e[2] !== r ? (o = !n && /* @__PURE__ */ i(bt, { ...tn, children: /* @__PURE__ */ i(Ye, { rounded: "full", onClick: () => r(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i(Pt, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = r, e[3] = o) : o = e[3], o;
78
- }, ve = {
79
- Root: Zt,
80
- Viewport: en,
81
- ScrollToBottom: nn
82
- }, rn = xt({
74
+ scrollToBottom: o
75
+ } = Ve();
76
+ let r;
77
+ return e[0] !== n || e[1] !== t || e[2] !== o ? (r = !n && /* @__PURE__ */ i(_t, { ...dn, children: /* @__PURE__ */ i(rt, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i(zt, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = r) : r = e[3], r;
78
+ }, He = {
79
+ Root: cn,
80
+ Viewport: an,
81
+ ScrollToBottom: un
82
+ }, fn = Pt({
83
83
  className: "ai-message",
84
84
  slots: ["root", "content"],
85
85
  base: {
@@ -188,267 +188,270 @@ const Qt = {
188
188
  shape: "rounded"
189
189
  }
190
190
  }), {
191
- withProvider: on,
192
- withContext: sn
193
- } = yt({
194
- recipe: rn
195
- }), ln = on("div", "root"), cn = sn("div", "content"), Ve = {
196
- Root: ln,
197
- Content: cn
198
- }, an = (t) => {
191
+ withProvider: pn,
192
+ withContext: mn
193
+ } = Rt({
194
+ recipe: fn
195
+ }), hn = pn("div", "root"), gn = mn("div", "content"), j = {
196
+ Root: hn,
197
+ Content: gn
198
+ }, bn = (t) => {
199
199
  if (t == null) return null;
200
200
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
201
201
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
202
- }, ho = (t) => {
202
+ }, Rr = (t) => {
203
203
  const e = y(19), {
204
204
  toolName: n,
205
- toolInput: r,
206
- onApprove: o,
205
+ toolInput: o,
206
+ onApprove: r,
207
207
  onDeny: s
208
208
  } = t;
209
209
  let l;
210
- e[0] !== r ? (l = an(r), e[0] = r, e[1] = l) : l = e[1];
210
+ e[0] !== o ? (l = bn(o), e[0] = o, e[1] = l) : l = e[1];
211
211
  const c = l;
212
- let d;
213
- e[2] !== n ? (d = /* @__PURE__ */ x(te, { textStyle: "label/S/medium", color: "fg", children: [
212
+ let a;
213
+ e[2] !== n ? (a = /* @__PURE__ */ b(re, { textStyle: "label/S/medium", color: "fg", children: [
214
214
  "Allow ",
215
- /* @__PURE__ */ i(Ue, { size: "sm", children: n }),
215
+ /* @__PURE__ */ i(Xe, { size: "sm", children: n }),
216
216
  "?"
217
- ] }), e[2] = n, e[3] = d) : d = e[3];
218
- let a;
219
- e[4] !== c ? (a = c ? /* @__PURE__ */ i(Ue, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = a) : a = e[5];
217
+ ] }), e[2] = n, e[3] = a) : a = e[3];
218
+ let d;
219
+ e[4] !== c ? (d = c ? /* @__PURE__ */ i(Xe, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = d) : d = e[5];
220
220
  let u;
221
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ i(_t, { size: 14 }), e[6] = u) : u = e[6];
221
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ i($t, { size: 14 }), e[6] = u) : u = e[6];
222
222
  let f;
223
- e[7] !== s ? (f = /* @__PURE__ */ x($e, { size: "xs", variant: "outline", onClick: s, children: [
223
+ e[7] !== s ? (f = /* @__PURE__ */ b(me, { size: "xs", variant: "outline", onClick: s, children: [
224
224
  u,
225
225
  "Deny"
226
226
  ] }), e[7] = s, e[8] = f) : f = e[8];
227
227
  let p;
228
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Rt, { size: 14 }), e[9] = p) : p = e[9];
228
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Et, { size: 14 }), e[9] = p) : p = e[9];
229
229
  let m;
230
- e[10] !== o ? (m = /* @__PURE__ */ x($e, { size: "xs", colorPalette: "green", onClick: o, children: [
230
+ e[10] !== r ? (m = /* @__PURE__ */ b(me, { size: "xs", colorPalette: "green", onClick: r, children: [
231
231
  p,
232
232
  "Allow"
233
- ] }), e[10] = o, e[11] = m) : m = e[11];
234
- let h;
235
- e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ x(Qe, { gap: "xs", justifyContent: "flex-end", children: [
233
+ ] }), e[10] = r, e[11] = m) : m = e[11];
234
+ let g;
235
+ e[12] !== f || e[13] !== m ? (g = /* @__PURE__ */ b(st, { gap: "xs", justifyContent: "flex-end", children: [
236
236
  f,
237
237
  m
238
- ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
239
- let b;
240
- return e[15] !== d || e[16] !== a || e[17] !== h ? (b = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ x(be, { direction: "column", gap: "xs", children: [
241
- d,
238
+ ] }), e[12] = f, e[13] = m, e[14] = g) : g = e[14];
239
+ let h;
240
+ return e[15] !== a || e[16] !== d || e[17] !== g ? (h = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b(V, { direction: "column", gap: "xs", children: [
242
241
  a,
243
- h
244
- ] }) }), e[15] = d, e[16] = a, e[17] = h, e[18] = b) : b = e[18], b;
245
- }, dn = (t) => {
242
+ d,
243
+ g
244
+ ] }) }), e[15] = a, e[16] = d, e[17] = g, e[18] = h) : h = e[18], h;
245
+ }, xn = (t) => {
246
246
  const {
247
247
  previousUserMessageCount: e,
248
248
  userMessageCount: n
249
249
  } = t;
250
250
  return e === 0 ? !1 : n > e;
251
251
  };
252
- function un(t) {
252
+ function yn(t) {
253
253
  const e = y(4), {
254
254
  userMessageCount: n
255
255
  } = t, {
256
- scrollToBottom: r
257
- } = We(), o = Me(n);
256
+ scrollToBottom: o
257
+ } = Ve(), r = je(n);
258
258
  let s, l;
259
- return e[0] !== r || e[1] !== n ? (s = () => {
260
- dn({
261
- previousUserMessageCount: o.current,
259
+ return e[0] !== o || e[1] !== n ? (s = () => {
260
+ xn({
261
+ previousUserMessageCount: r.current,
262
262
  userMessageCount: n
263
- }) && r(), o.current = n;
264
- }, l = [n, r], e[0] = r, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), Oe(s, l), null;
263
+ }) && o(), r.current = n;
264
+ }, l = [n, o], e[0] = o, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), Ne(s, l), null;
265
265
  }
266
- const fn = (t) => {
266
+ const Sn = (t) => {
267
267
  const e = y(22);
268
- let n, r, o, s;
268
+ let n, o, r, s;
269
269
  e[0] !== t ? ({
270
270
  title: s,
271
- shortcut: o,
271
+ shortcut: r,
272
272
  canInterrupt: n,
273
- ...r
274
- } = t, e[0] = t, e[1] = n, e[2] = r, e[3] = o, e[4] = s) : (n = e[1], r = e[2], o = e[3], s = e[4]);
275
- const l = r["aria-label"] ?? s;
273
+ ...o
274
+ } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = r, e[4] = s) : (n = e[1], o = e[2], r = e[3], s = e[4]);
275
+ const l = o["aria-label"] ?? s;
276
276
  let c;
277
- e[5] !== n ? (c = n ? /* @__PURE__ */ i(It, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Bt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
278
- const d = c;
279
- let a;
280
- e[7] !== l || e[8] !== d || e[9] !== r || e[10] !== s ? (a = /* @__PURE__ */ i(Ye, { size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...r, children: d }), e[7] = l, e[8] = d, e[9] = r, e[10] = s, e[11] = a) : a = e[11];
281
- const u = a;
277
+ e[5] !== n ? (c = n ? /* @__PURE__ */ i(Ft, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Lt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
278
+ const a = c;
279
+ let d;
280
+ e[7] !== l || e[8] !== a || e[9] !== o || e[10] !== s ? (d = /* @__PURE__ */ i(rt, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...o, children: a }), e[7] = l, e[8] = a, e[9] = o, e[10] = s, e[11] = d) : d = e[11];
281
+ const u = d;
282
282
  if (s) {
283
283
  let f;
284
- e[12] !== o || e[13] !== s ? (f = o ? /* @__PURE__ */ x(Le, { children: [
284
+ e[12] !== r || e[13] !== s ? (f = r ? /* @__PURE__ */ b(Ue, { children: [
285
285
  s,
286
286
  " ",
287
- /* @__PURE__ */ i(kt, { fontSize: "xs", children: o })
288
- ] }) : s, e[12] = o, e[13] = s, e[14] = f) : f = e[14];
287
+ /* @__PURE__ */ i(vt, { fontSize: "xs", children: r })
288
+ ] }) : s, e[12] = r, e[13] = s, e[14] = f) : f = e[14];
289
289
  const p = f;
290
290
  let m;
291
- e[15] !== u ? (m = /* @__PURE__ */ i(ge.Trigger, { asChild: !0, children: u }), e[15] = u, e[16] = m) : m = e[16];
291
+ e[15] !== u ? (m = /* @__PURE__ */ i(Ce.Trigger, { asChild: !0, children: u }), e[15] = u, e[16] = m) : m = e[16];
292
+ let g;
293
+ e[17] !== p ? (g = /* @__PURE__ */ i(It, { children: /* @__PURE__ */ i(Ce.Positioner, { children: /* @__PURE__ */ i(Ce.Content, { children: p }) }) }), e[17] = p, e[18] = g) : g = e[18];
292
294
  let h;
293
- e[17] !== p ? (h = /* @__PURE__ */ i(St, { children: /* @__PURE__ */ i(ge.Positioner, { children: /* @__PURE__ */ i(ge.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
294
- let b;
295
- return e[19] !== m || e[20] !== h ? (b = /* @__PURE__ */ x(ge.Root, { closeDelay: 50, openDelay: 100, children: [
295
+ return e[19] !== m || e[20] !== g ? (h = /* @__PURE__ */ b(Ce.Root, { closeDelay: 50, openDelay: 100, children: [
296
296
  m,
297
- h
298
- ] }), e[19] = m, e[20] = h, e[21] = b) : b = e[21], b;
297
+ g
298
+ ] }), e[19] = m, e[20] = g, e[21] = h) : h = e[21], h;
299
299
  }
300
300
  return u;
301
- }, pn = (t) => {
302
- const e = y(63), {
301
+ }, kn = (t) => {
302
+ const e = y(66), {
303
303
  defaultState: n,
304
- onSubmit: r,
305
- onInterrupt: o,
304
+ onSubmit: o,
305
+ onInterrupt: r,
306
306
  streaming: s,
307
307
  attachedResources: l,
308
308
  onClearAttachments: c,
309
- isDisabled: d,
310
- onChange: a,
309
+ isDisabled: a,
310
+ onChange: d,
311
311
  placeholder: u,
312
312
  attachmentList: f,
313
- actions: p
314
- } = t, m = r === void 0 ? mn : r, h = s === void 0 ? !1 : s;
315
- let b;
316
- e[0] !== l ? (b = l === void 0 ? [] : l, e[0] = l, e[1] = b) : b = e[1];
317
- const S = b, T = d === void 0 ? !1 : d, [P, M] = ce(!1), [v, O] = ce(n), [F, L] = ce(0);
313
+ actions: p,
314
+ attachedToTop: m
315
+ } = t, g = o === void 0 ? Tn : o, h = s === void 0 ? !1 : s;
316
+ let T;
317
+ e[0] !== l ? (T = l === void 0 ? [] : l, e[0] = l, e[1] = T) : T = e[1];
318
+ const D = T, w = a === void 0 ? !1 : a, I = m === void 0 ? !1 : m, [z, q] = oe(!1), [de, ge] = oe(n), [ue, be] = oe(0);
319
+ let G;
320
+ e[2] !== n ? (G = () => Oe(n), e[2] = n, e[3] = G) : G = e[3];
321
+ const [$, fe] = oe(G), N = je(null), E = je(d);
322
+ let U, F;
323
+ e[4] !== d ? (U = () => {
324
+ E.current = d;
325
+ }, F = [d], e[4] = d, e[5] = U, e[6] = F) : (U = e[5], F = e[6]), Ne(U, F);
326
+ let L, v;
327
+ e[7] !== n ? (v = () => {
328
+ const _ = Oe(n);
329
+ ge(n), be(Cn), fe(_), E.current?.(_);
330
+ }, L = [n], e[7] = n, e[8] = L, e[9] = v) : (L = e[8], v = e[9]), Ne(v, L);
331
+ let B;
332
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => {
333
+ const _ = N.current?.querySelector('[contenteditable="true"]');
334
+ _ instanceof HTMLElement && _.focus();
335
+ }, e[10] = B) : B = e[10];
336
+ const K = B;
318
337
  let R;
319
- e[2] !== n ? (R = () => Ae(n), e[2] = n, e[3] = R) : R = e[3];
320
- const [C, z] = ce(R), W = Me(null), $ = Me(a);
321
- let E, I;
322
- e[4] !== a ? (E = () => {
323
- $.current = a;
324
- }, I = [a], e[4] = a, e[5] = E, e[6] = I) : (E = e[5], I = e[6]), Oe(E, I);
325
- let B, D;
326
- e[7] !== n ? (B = () => {
327
- const w = Ae(n);
328
- O(n), L(hn), z(w), $.current?.(w);
329
- }, D = [n], e[7] = n, e[8] = B, e[9] = D) : (B = e[8], D = e[9]), Oe(B, D);
330
- let A;
331
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = () => {
332
- const w = W.current?.querySelector('[contenteditable="true"]');
333
- w instanceof HTMLElement && w.focus();
334
- }, e[10] = A) : A = e[10];
335
- const V = A;
336
- let j;
337
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = () => {
338
- M(!0), V();
339
- }, e[11] = j) : j = e[11];
340
- const we = j;
341
- let q;
342
- e[12] !== n ? (q = (w) => {
343
- const ht = w === void 0 ? !1 : w;
344
- O(n), L(gn);
345
- const je = Ae(n);
346
- z(je), $.current?.(je), ht && requestAnimationFrame(() => {
347
- V();
338
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = () => {
339
+ q(!0), K();
340
+ }, e[11] = R) : R = e[11];
341
+ const O = R;
342
+ let M;
343
+ e[12] !== n ? (M = (_) => {
344
+ const Ct = _ === void 0 ? !1 : _;
345
+ ge(n), be(wn);
346
+ const Ye = Oe(n);
347
+ fe(Ye), E.current?.(Ye), Ct && requestAnimationFrame(() => {
348
+ K();
348
349
  });
349
- }, e[12] = n, e[13] = q) : q = e[13];
350
- const ie = q;
351
- let K;
352
- e[14] !== S || e[15] !== T || e[16] !== c || e[17] !== o || e[18] !== m || e[19] !== ie || e[20] !== h || e[21] !== C ? (K = () => {
353
- if (T)
350
+ }, e[12] = n, e[13] = M) : M = e[13];
351
+ const H = M;
352
+ let S;
353
+ e[14] !== D || e[15] !== w || e[16] !== c || e[17] !== r || e[18] !== g || e[19] !== H || e[20] !== h || e[21] !== $ ? (S = () => {
354
+ if (w)
354
355
  return;
355
356
  if (h) {
356
- o?.();
357
+ r?.();
357
358
  return;
358
359
  }
359
- const w = C.trim();
360
- w && (m(w, S), ie(!0), c?.());
361
- }, e[14] = S, e[15] = T, e[16] = c, e[17] = o, e[18] = m, e[19] = ie, e[20] = h, e[21] = C, e[22] = K) : K = e[22];
362
- const _ = K, H = h && !!o;
363
- let de;
364
- e[23] !== u ? (de = u ? /* @__PURE__ */ i(te, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: u }) : void 0, e[23] = u, e[24] = de) : de = e[24];
365
- const Ce = de, Pe = P ? "blue.border" : "border.muted", _e = P ? "mid" : "low", Re = P ? "blue.border" : "border";
366
- let G;
367
- e[25] !== Re ? (G = {
368
- borderColor: Re,
369
- boxShadow: "mid"
370
- }, e[25] = Re, e[26] = G) : G = e[26];
371
- let ue;
372
- e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ue = {
360
+ const _ = $.trim();
361
+ _ && (g(_, D), H(!0), c?.());
362
+ }, e[14] = D, e[15] = w, e[16] = c, e[17] = r, e[18] = g, e[19] = H, e[20] = h, e[21] = $, e[22] = S) : S = e[22];
363
+ const P = S, C = h && !!r;
364
+ let Y;
365
+ e[23] !== u ? (Y = u ? /* @__PURE__ */ i(re, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: u }) : void 0, e[23] = u, e[24] = Y) : Y = e[24];
366
+ const ve = Y, Be = I ? "-1px" : void 0, Me = I ? "0" : void 0, Ae = z ? "blue.border" : "border.muted", De = z ? "mid" : "low", ze = z ? 1 : 0, $e = z ? "blue.border" : "border";
367
+ let X;
368
+ e[25] !== $e ? (X = {
369
+ borderColor: $e,
370
+ boxShadow: "mid",
371
+ zIndex: 1
372
+ }, e[25] = $e, e[26] = X) : X = e[26];
373
+ let xe;
374
+ e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (xe = {
373
375
  borderColor: "blue.border",
374
- boxShadow: "mid"
375
- }, e[27] = ue) : ue = e[27];
376
- let fe;
377
- e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (fe = () => M(!1), e[28] = fe) : fe = e[28];
378
- let pe;
379
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pe = {
376
+ boxShadow: "mid",
377
+ zIndex: 1
378
+ }, e[27] = xe) : xe = e[27];
379
+ let ye;
380
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ye = () => q(!1), e[28] = ye) : ye = e[28];
381
+ let Se;
382
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Se = {
380
383
  pr: "2xs"
381
- }, e[29] = pe) : pe = e[29];
382
- const Ie = !T;
384
+ }, e[29] = Se) : Se = e[29];
385
+ const Ee = !w;
383
386
  let J;
384
- e[30] !== a ? (J = (w) => {
385
- z(w), a?.(w);
386
- }, e[30] = a, e[31] = J) : J = e[31];
387
- let X;
388
- e[32] !== F || e[33] !== v || e[34] !== _ || e[35] !== Ce || e[36] !== Ie || e[37] !== J ? (X = /* @__PURE__ */ i(nt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: pe, children: /* @__PURE__ */ i(Jt, { defaultState: v, isEditable: Ie, placeholder: Ce, onChange: J, onSubmit: _ }, F) }), e[32] = F, e[33] = v, e[34] = _, e[35] = Ce, e[36] = Ie, e[37] = J, e[38] = X) : X = e[38];
389
- let me;
390
- e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (me = /* @__PURE__ */ i(Tt, {}), e[39] = me) : me = e[39];
391
- const Be = H ? "Stop Response" : "Message Sending", De = h ? void 0 : "Enter";
392
- let Y;
393
- e[40] !== H || e[41] !== T || e[42] !== h || e[43] !== C ? (Y = h && !H || !h && !C.trim() || T, e[40] = H, e[41] = T, e[42] = h, e[43] = C, e[44] = Y) : Y = e[44];
387
+ e[30] !== d ? (J = (_) => {
388
+ fe(_), d?.(_);
389
+ }, e[30] = d, e[31] = J) : J = e[31];
394
390
  let Q;
395
- e[45] !== H || e[46] !== _ || e[47] !== Be || e[48] !== De || e[49] !== Y ? (Q = /* @__PURE__ */ i(fn, { canInterrupt: H, title: Be, shortcut: De, onClick: _, disabled: Y }), e[45] = H, e[46] = _, e[47] = Be, e[48] = De, e[49] = Y, e[50] = Q) : Q = e[50];
391
+ e[32] !== ue || e[33] !== de || e[34] !== P || e[35] !== ve || e[36] !== Ee || e[37] !== J ? (Q = /* @__PURE__ */ i(ct, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: Se, children: /* @__PURE__ */ i(tn, { defaultState: de, isEditable: Ee, placeholder: ve, onChange: J, onSubmit: P }, ue) }), e[32] = ue, e[33] = de, e[34] = P, e[35] = ve, e[36] = Ee, e[37] = J, e[38] = Q) : Q = e[38];
392
+ let ke;
393
+ e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ke = /* @__PURE__ */ i(Bt, {}), e[39] = ke) : ke = e[39];
394
+ const Fe = C ? "Stop Response" : "Message Sending", Le = h ? void 0 : "Enter";
396
395
  let Z;
397
- e[51] !== p || e[52] !== Q ? (Z = /* @__PURE__ */ x(Qe, { gap: "1", mt: "md", children: [
398
- p,
399
- me,
400
- Q
401
- ] }), e[51] = p, e[52] = Q, e[53] = Z) : Z = e[53];
396
+ e[40] !== C || e[41] !== w || e[42] !== h || e[43] !== $ ? (Z = h && !C || !h && !$.trim() || w, e[40] = C, e[41] = w, e[42] = h, e[43] = $, e[44] = Z) : Z = e[44];
402
397
  let ee;
403
- e[54] !== f || e[55] !== X || e[56] !== Z ? (ee = /* @__PURE__ */ x(be, { direction: "column", color: "fg", children: [
398
+ e[45] !== C || e[46] !== P || e[47] !== Fe || e[48] !== Le || e[49] !== Z ? (ee = /* @__PURE__ */ i(Sn, { canInterrupt: C, title: Fe, shortcut: Le, onClick: P, disabled: Z }), e[45] = C, e[46] = P, e[47] = Fe, e[48] = Le, e[49] = Z, e[50] = ee) : ee = e[50];
399
+ let te;
400
+ e[51] !== p || e[52] !== ee ? (te = /* @__PURE__ */ b(st, { gap: "1", mt: "md", children: [
401
+ p,
402
+ ke,
403
+ ee
404
+ ] }), e[51] = p, e[52] = ee, e[53] = te) : te = e[53];
405
+ let ne;
406
+ e[54] !== f || e[55] !== Q || e[56] !== te ? (ne = /* @__PURE__ */ b(V, { direction: "column", color: "fg", children: [
404
407
  f,
405
- X,
406
- Z
407
- ] }), e[54] = f, e[55] = X, e[56] = Z, e[57] = ee) : ee = e[57];
408
- let he;
409
- return e[58] !== Pe || e[59] !== _e || e[60] !== G || e[61] !== ee ? (he = /* @__PURE__ */ i(k, { ref: W, width: "100%", paddingX: "lg", paddingY: "md", bg: "bg", borderRadius: "md", borderWidth: "1px", borderStyle: "solid", borderColor: Pe, boxShadow: _e, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: G, _focusWithin: ue, onClick: we, onBlur: fe, children: ee }), e[58] = Pe, e[59] = _e, e[60] = G, e[61] = ee, e[62] = he) : he = e[62], he;
408
+ Q,
409
+ te
410
+ ] }), e[54] = f, e[55] = Q, e[56] = te, e[57] = ne) : ne = e[57];
411
+ let Te;
412
+ return e[58] !== Be || e[59] !== Me || e[60] !== Ae || e[61] !== De || e[62] !== ze || e[63] !== X || e[64] !== ne ? (Te = /* @__PURE__ */ i(k, { ref: N, position: "relative", width: "100%", paddingX: "lg", paddingY: "md", mt: Be, bg: "bg", borderRadius: "md", borderTopRadius: Me, borderWidth: "1px", borderStyle: "solid", borderColor: Ae, boxShadow: De, zIndex: ze, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: X, _focusWithin: xe, onClick: O, onBlur: ye, children: ne }), e[58] = Be, e[59] = Me, e[60] = Ae, e[61] = De, e[62] = ze, e[63] = X, e[64] = ne, e[65] = Te) : Te = e[65], Te;
410
413
  };
411
- function mn() {
414
+ function Tn() {
412
415
  }
413
- function hn(t) {
416
+ function Cn(t) {
414
417
  return t + 1;
415
418
  }
416
- function gn(t) {
419
+ function wn(t) {
417
420
  return t + 1;
418
421
  }
419
- const bn = (t = "") => JSON.stringify(Xt(t)), xn = (t) => {
422
+ const _n = (t = "") => JSON.stringify(nn(t)), Pn = 360, Rn = "min(20vh, 8rem)", In = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : e + n.text.length, 0), vn = (t) => t.role !== "user" ? !1 : In(t) > Pn, Bn = (t) => {
420
423
  const e = y(8);
421
- let n, r;
424
+ let n, o;
422
425
  e[0] !== t ? ({
423
426
  children: n,
424
- ...r
425
- } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
426
- let o;
427
- e[3] !== n ? (o = /* @__PURE__ */ i(rt, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
427
+ ...o
428
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
429
+ let r;
430
+ e[3] !== n ? (r = /* @__PURE__ */ i(at, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = r) : r = e[4];
428
431
  let s;
429
- return e[5] !== r || e[6] !== o ? (s = /* @__PURE__ */ i(k, { ...r, children: o }), e[5] = r, e[6] = o, e[7] = s) : s = e[7], s;
430
- }, yn = xn, ot = {
431
- shell: tt,
432
- ls: Ot,
433
- read_file: Mt,
434
- write_file: $t,
435
- delete_file: zt,
436
- patch: Ft,
437
- upload_files: vt,
438
- download_file: At,
439
- move_file: Dt
440
- }, Sn = {
441
- dot: Nt,
442
- danger: Ht,
443
- search: Et,
444
- browser: Wt,
445
- file: Lt,
446
- terminal: tt,
447
- ...ot
448
- }, qe = "dot", kn = (t) => Object.hasOwn(ot, t), Tn = (t) => Sn[t], st = (t) => {
449
- if (!t) return qe;
432
+ return e[5] !== o || e[6] !== r ? (s = /* @__PURE__ */ i(k, { ...o, children: r }), e[5] = o, e[6] = r, e[7] = s) : s = e[7], s;
433
+ }, Mn = Bn, ut = {
434
+ shell: lt,
435
+ ls: qt,
436
+ read_file: Vt,
437
+ write_file: Ut,
438
+ delete_file: Nt,
439
+ patch: jt,
440
+ upload_files: Wt,
441
+ download_file: Ht,
442
+ move_file: Ot
443
+ }, An = {
444
+ dot: Jt,
445
+ danger: Xt,
446
+ search: Yt,
447
+ browser: Kt,
448
+ file: Gt,
449
+ terminal: lt,
450
+ ...ut
451
+ }, Je = "dot", Dn = (t) => Object.hasOwn(ut, t), zn = (t) => An[t], ft = (t) => {
452
+ if (!t) return Je;
450
453
  const e = t.replace(/^tool-/, "");
451
- if (kn(e)) return e;
454
+ if (Dn(e)) return e;
452
455
  switch (e) {
453
456
  case "read":
454
457
  return "file";
@@ -468,52 +471,52 @@ const bn = (t = "") => JSON.stringify(Xt(t)), xn = (t) => {
468
471
  case "file":
469
472
  return "file";
470
473
  default:
471
- return qe;
474
+ return Je;
472
475
  }
473
476
  };
474
- function Ee(t) {
477
+ function qe(t) {
475
478
  const e = t.lastIndexOf("/");
476
479
  return e >= 0 ? t.slice(e + 1) : t;
477
480
  }
478
- function xe(t) {
481
+ function we(t) {
479
482
  if (!t) return null;
480
483
  const e = t.split(" ")[0].trim();
481
484
  if (e === "/dev/null") return null;
482
485
  let n = e;
483
486
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
484
487
  }
485
- const Se = (t) => t.startsWith("--- "), He = (t) => t.startsWith("+++ "), Ne = (t) => t.startsWith("@@"), wn = (t) => t.startsWith("+") && !(He(t) || t === "+++"), Cn = (t) => t.startsWith("-") && !(Se(t) || t === "---"), Pn = (t, e) => {
488
+ const Pe = (t) => t.startsWith("--- "), Ge = (t) => t.startsWith("+++ "), Ke = (t) => t.startsWith("@@"), $n = (t) => t.startsWith("+") && !(Ge(t) || t === "+++"), En = (t) => t.startsWith("-") && !(Pe(t) || t === "---"), Fn = (t, e) => {
486
489
  t.has(e) || t.set(e, {
487
490
  additions: 0,
488
491
  deletions: 0
489
492
  });
490
- }, _n = (t, e) => {
493
+ }, Ln = (t, e) => {
491
494
  const n = t.get(e);
492
495
  n && (n.additions += 1);
493
- }, Rn = (t, e) => {
496
+ }, On = (t, e) => {
494
497
  const n = t.get(e);
495
498
  n && (n.deletions += 1);
496
- }, In = (t, e, n) => {
497
- if (Se(t))
499
+ }, Hn = (t, e, n) => {
500
+ if (Pe(t))
498
501
  return {
499
502
  ...e,
500
- lastMinusHeader: xe(t.slice(4)),
503
+ lastMinusHeader: we(t.slice(4)),
501
504
  inHunk: !1
502
505
  };
503
- if (He(t)) {
504
- const o = xe(t.slice(4)) ?? e.lastMinusHeader;
505
- return o && Pn(n, o), {
506
+ if (Ge(t)) {
507
+ const r = we(t.slice(4)) ?? e.lastMinusHeader;
508
+ return r && Fn(n, r), {
506
509
  ...e,
507
- currentPath: o,
510
+ currentPath: r,
508
511
  inHunk: !1
509
512
  };
510
513
  }
511
- return e.currentPath ? Ne(t) ? {
514
+ return e.currentPath ? Ke(t) ? {
512
515
  ...e,
513
516
  inHunk: !0
514
- } : e.inHunk ? wn(t) ? (_n(n, e.currentPath), e) : (Cn(t) && Rn(n, e.currentPath), e) : e : e;
517
+ } : e.inHunk ? $n(t) ? (Ln(n, e.currentPath), e) : (En(t) && On(n, e.currentPath), e) : e : e;
515
518
  };
516
- function lt(t) {
519
+ function pt(t) {
517
520
  if (!t || typeof t != "string") return [];
518
521
  const e = /* @__PURE__ */ new Map();
519
522
  let n = {
@@ -521,34 +524,34 @@ function lt(t) {
521
524
  lastMinusHeader: null,
522
525
  inHunk: !1
523
526
  };
524
- const r = t.split(/\r?\n/);
525
- for (const o of r)
526
- n = In(o, n, e);
527
- return Array.from(e.entries()).map(([o, {
527
+ const o = t.split(/\r?\n/);
528
+ for (const r of o)
529
+ n = Hn(r, n, e);
530
+ return Array.from(e.entries()).map(([r, {
528
531
  additions: s,
529
532
  deletions: l
530
533
  }]) => ({
531
- filePath: o,
534
+ filePath: r,
532
535
  additions: s,
533
536
  deletions: l
534
537
  }));
535
538
  }
536
- function Bn(t) {
537
- return lt(t).map((e) => ({
539
+ function Wn(t) {
540
+ return pt(t).map((e) => ({
538
541
  kind: "diff",
539
- fileName: Ee(e.filePath),
542
+ fileName: qe(e.filePath),
540
543
  filePath: e.filePath,
541
544
  additions: e.additions,
542
545
  deletions: e.deletions
543
546
  }));
544
547
  }
545
- function Dn(t) {
546
- return lt(t).map((e) => e.filePath);
548
+ function jn(t) {
549
+ return pt(t).map((e) => e.filePath);
547
550
  }
548
- const it = (t) => Se(t) || t.startsWith("diff --git "), An = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", vn = (t, e, n) => {
551
+ const mt = (t) => Pe(t) || t.startsWith("diff --git "), Nn = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Un = (t, e, n) => {
549
552
  if (t.startsWith(" ")) {
550
- const r = t.slice(1);
551
- e.push(r), n.push(r);
553
+ const o = t.slice(1);
554
+ e.push(o), n.push(o);
552
555
  return;
553
556
  }
554
557
  if (t.startsWith("-")) {
@@ -556,33 +559,33 @@ const it = (t) => Se(t) || t.startsWith("diff --git "), An = (t) => t.startsWith
556
559
  return;
557
560
  }
558
561
  t.startsWith("+") && n.push(t.slice(1));
559
- }, Fn = (t, e, n, r) => {
560
- let o = e;
561
- for (; o < t.length; ) {
562
- const s = t[o] || "";
563
- if (it(s) || Ne(s) || An(s))
562
+ }, Vn = (t, e, n, o) => {
563
+ let r = e;
564
+ for (; r < t.length; ) {
565
+ const s = t[r] || "";
566
+ if (mt(s) || Ke(s) || Nn(s))
564
567
  break;
565
- vn(s, n, r), o += 1;
568
+ Un(s, n, o), r += 1;
566
569
  }
567
- return (n.length > 0 || r.length > 0) && (n.push(""), r.push("")), o;
568
- }, zn = (t, e) => {
569
- const n = xe((t[e] || "").slice(4)), r = t[e + 1] || "";
570
- if (!He(r)) return {
570
+ return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), r;
571
+ }, qn = (t, e) => {
572
+ const n = we((t[e] || "").slice(4)), o = t[e + 1] || "";
573
+ if (!Ge(o)) return {
571
574
  nextIndex: e + 1
572
575
  };
573
- const s = xe(r.slice(4)) ?? n ?? "", l = [], c = [];
574
- let d = e + 2;
575
- for (; d < t.length; ) {
576
- const a = t[d] || "";
577
- if (it(a)) break;
578
- if (!Ne(a)) {
579
- d += 1;
576
+ const s = we(o.slice(4)) ?? n ?? "", l = [], c = [];
577
+ let a = e + 2;
578
+ for (; a < t.length; ) {
579
+ const d = t[a] || "";
580
+ if (mt(d)) break;
581
+ if (!Ke(d)) {
582
+ a += 1;
580
583
  continue;
581
584
  }
582
- d = Fn(t, d + 1, l, c);
585
+ a = Vn(t, a + 1, l, c);
583
586
  }
584
587
  return {
585
- nextIndex: d,
588
+ nextIndex: a,
586
589
  preview: {
587
590
  filePath: s,
588
591
  original: l.join(`
@@ -592,143 +595,143 @@ const it = (t) => Se(t) || t.startsWith("diff --git "), An = (t) => t.startsWith
592
595
  }
593
596
  };
594
597
  };
595
- function $n(t) {
598
+ function Gn(t) {
596
599
  if (!t || typeof t != "string") return [];
597
600
  const e = t.split(/\r?\n/), n = [];
598
- let r = 0;
599
- for (; r < e.length; ) {
600
- const o = e[r] || "";
601
- if (!Se(o)) {
602
- r += 1;
601
+ let o = 0;
602
+ for (; o < e.length; ) {
603
+ const r = e[o] || "";
604
+ if (!Pe(r)) {
605
+ o += 1;
603
606
  continue;
604
607
  }
605
608
  const {
606
609
  nextIndex: s,
607
610
  preview: l
608
- } = zn(e, r);
609
- l && n.push(l), r = Math.max(s, r + 1);
611
+ } = qn(e, o);
612
+ l && n.push(l), o = Math.max(s, o + 1);
610
613
  }
611
614
  return n;
612
615
  }
613
- const Mn = {
616
+ const Kn = {
614
617
  apply_patch: "Apply patch",
615
618
  read: "Read file",
616
619
  bash: "Run",
617
620
  grep: "Search files",
618
621
  glob: "Find files",
619
622
  skill: "Load skill"
620
- }, Ke = {
623
+ }, Qe = {
621
624
  pending: "queued",
622
625
  error: "failed",
623
626
  "output-error": "failed",
624
627
  "input-streaming": "running",
625
628
  "input-available": "queued"
626
- }, ct = (t) => t.replace(/^tool-/, ""), On = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ln = (t) => ct(t.tool ?? "tool"), Wn = (t) => {
627
- const e = ct(t);
628
- return Mn[e] ?? On(e.replace(/_/g, " "));
629
- }, En = (t) => !t || typeof t != "string" ? null : Ke[t] ? Ke[t] : t.includes("stream") ? "running" : null, at = (t) => t === "error" || t === "output-error", re = (t) => at(t.state?.status) ? {
629
+ }, ht = (t) => t.replace(/^tool-/, ""), Yn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Xn = (t) => ht(t.tool ?? "tool"), Jn = (t) => {
630
+ const e = ht(t);
631
+ return Kn[e] ?? Yn(e.replace(/_/g, " "));
632
+ }, Qn = (t) => !t || typeof t != "string" ? null : Qe[t] ? Qe[t] : t.includes("stream") ? "running" : null, gt = (t) => t === "error" || t === "output-error", ie = (t) => gt(t.state?.status) ? {
630
633
  type: "icon",
631
634
  icon: "danger"
632
635
  } : {
633
636
  type: "icon",
634
- icon: st(Ln(t))
635
- }, oe = (t, e, n) => {
636
- const o = [{
637
+ icon: ft(Xn(t))
638
+ }, le = (t, e, n) => {
639
+ const r = [{
637
640
  kind: "text",
638
- text: n ?? Wn(t.tool ?? "tool"),
641
+ text: n ?? Jn(t.tool ?? "tool"),
639
642
  bold: !0
640
643
  }];
641
- e && o.push({
644
+ e && r.push({
642
645
  kind: "text",
643
646
  text: e,
644
647
  muted: !0
645
648
  });
646
- const s = En(t.state?.status);
647
- return s && o.push({
649
+ const s = Qn(t.state?.status);
650
+ return s && r.push({
648
651
  kind: "text",
649
652
  text: s,
650
653
  muted: !0
651
- }), o;
652
- }, se = (t) => {
654
+ }), r;
655
+ }, ce = (t) => {
653
656
  const e = t.state?.input;
654
657
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
655
- }, ke = (t) => {
658
+ }, Re = (t) => {
656
659
  const e = t.state?.output;
657
660
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
658
- }, g = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ye = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Hn = (t, e) => {
659
- const n = ye(t.state);
660
- return n ? ye(n[e]) : null;
661
- }, Nn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), jn = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), dt = (t) => {
662
- const e = ke(t);
663
- return [Hn(t, "metadata"), ye(e?.metadata)].filter(Boolean);
664
- }, Un = (t) => {
665
- const e = ye(t);
661
+ }, x = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, _e = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Zn = (t, e) => {
662
+ const n = _e(t.state);
663
+ return n ? _e(n[e]) : null;
664
+ }, eo = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), to = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), bt = (t) => {
665
+ const e = Re(t);
666
+ return [Zn(t, "metadata"), _e(e?.metadata)].filter(Boolean);
667
+ }, no = (t) => {
668
+ const e = _e(t);
666
669
  if (!e) return null;
667
- const n = g(e.filePath) ?? g(e.relativePath) ?? g(e.path);
670
+ const n = x(e.filePath) ?? x(e.relativePath) ?? x(e.path);
668
671
  return n ? {
669
- filePath: Nn(n),
672
+ filePath: eo(n),
670
673
  additions: typeof e.additions == "number" ? e.additions : 0,
671
674
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
672
- diff: g(e.diff) ?? void 0,
673
- before: g(e.before) ?? void 0,
674
- after: g(e.after) ?? void 0
675
+ diff: x(e.diff) ?? void 0,
676
+ before: x(e.before) ?? void 0,
677
+ after: x(e.after) ?? void 0
675
678
  } : null;
676
- }, ut = (t) => {
679
+ }, xt = (t) => {
677
680
  const e = [];
678
- for (const n of dt(t)) {
679
- const r = Array.isArray(n.files) ? n.files : [];
680
- for (const o of r) {
681
- const s = Un(o);
681
+ for (const n of bt(t)) {
682
+ const o = Array.isArray(n.files) ? n.files : [];
683
+ for (const r of o) {
684
+ const s = no(r);
682
685
  s && e.push(s);
683
686
  }
684
687
  }
685
688
  return e;
686
- }, Vn = (t) => {
687
- const e = se(t), n = g(e?.diff);
689
+ }, oo = (t) => {
690
+ const e = ce(t), n = x(e?.diff);
688
691
  if (n) return n;
689
- for (const s of dt(t)) {
690
- const l = g(s.diff);
692
+ for (const s of bt(t)) {
693
+ const l = x(s.diff);
691
694
  if (l) return l;
692
695
  }
693
- const r = ut(t).map((s) => s.diff).filter((s) => !!s);
694
- if (r.length > 0) return r.join(`
696
+ const o = xt(t).map((s) => s.diff).filter((s) => !!s);
697
+ if (o.length > 0) return o.join(`
695
698
  `);
696
- const o = g(e?.patchText);
697
- return o && jn(o) ? o : null;
698
- }, qn = (t) => {
699
+ const r = x(e?.patchText);
700
+ return r && to(r) ? r : null;
701
+ }, ro = (t) => {
699
702
  const e = /* @__PURE__ */ new Set(), n = [];
700
- for (const r of t)
701
- e.has(r.filePath) || (e.add(r.filePath), n.push({
703
+ for (const o of t)
704
+ e.has(o.filePath) || (e.add(o.filePath), n.push({
702
705
  kind: "diff",
703
- fileName: Ee(r.filePath),
704
- filePath: r.filePath,
705
- additions: r.additions,
706
- deletions: r.deletions
706
+ fileName: qe(o.filePath),
707
+ filePath: o.filePath,
708
+ additions: o.additions,
709
+ deletions: o.deletions
707
710
  }));
708
711
  return n;
709
- }, Kn = (t) => Array.from(new Set(t.map((e) => e.filePath))), Te = (t) => {
710
- const e = ke(t);
711
- return g(t.state?.output) ?? g(e?.returnDisplay) ?? g(e?.preview) ?? g(e?.stdout);
712
- }, Gn = (t) => {
712
+ }, so = (t) => Array.from(new Set(t.map((e) => e.filePath))), Ie = (t) => {
713
+ const e = Re(t);
714
+ return x(t.state?.output) ?? x(e?.returnDisplay) ?? x(e?.preview) ?? x(e?.stdout);
715
+ }, io = (t) => {
713
716
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
714
717
  return e ? {
715
- skillName: g(e[1]) ?? void 0,
716
- content: g(e[2]) ?? ""
718
+ skillName: x(e[1]) ?? void 0,
719
+ content: x(e[2]) ?? ""
717
720
  } : null;
718
- }, Jn = (t) => {
719
- const e = se(t);
720
- return g(e?.name) ?? g(e?.skillName) ?? g(e?.skill) ?? g(e?.skill_name) ?? void 0;
721
- }, Xn = (t) => ({
721
+ }, lo = (t) => {
722
+ const e = ce(t);
723
+ return x(e?.name) ?? x(e?.skillName) ?? x(e?.skill) ?? x(e?.skill_name) ?? void 0;
724
+ }, co = (t) => ({
722
725
  kind: "link",
723
- text: Ee(t),
726
+ text: qe(t),
724
727
  filePath: t
725
- }), le = (t, e) => !at(t.state?.status) || !t.state?.errorText ? e : [{
728
+ }), ae = (t, e) => !gt(t.state?.status) || !t.state?.errorText ? e : [{
726
729
  type: "comment",
727
730
  text: t.state.errorText
728
- }, ...e], Yn = (t) => {
729
- const e = Vn(t), n = ut(t), r = oe(t, void 0, "Apply patch"), o = Bn(e ?? void 0);
730
- o.length > 0 ? r.push(...o) : r.push(...qn(n));
731
- const s = [], l = $n(e ?? void 0);
731
+ }, ...e], ao = (t) => {
732
+ const e = oo(t), n = xt(t), o = le(t, void 0, "Apply patch"), r = Wn(e ?? void 0);
733
+ r.length > 0 ? o.push(...r) : o.push(...ro(n));
734
+ const s = [], l = Gn(e ?? void 0);
732
735
  for (const c of l)
733
736
  s.push({
734
737
  type: "diff",
@@ -747,32 +750,32 @@ const Mn = {
747
750
  sideBySide: !1
748
751
  });
749
752
  if (s.length === 0) {
750
- const c = Dn(e ?? void 0);
751
- c.length === 0 && c.push(...Kn(n)), c.length > 0 && s.push({
753
+ const c = jn(e ?? void 0);
754
+ c.length === 0 && c.push(...so(n)), c.length > 0 && s.push({
752
755
  type: "references",
753
756
  references: c
754
757
  });
755
758
  }
756
759
  return {
757
- indicator: re(t),
758
- title: r,
759
- blocks: le(t, s)
760
- };
761
- }, Qn = (t) => {
762
- const e = se(t), n = ke(t), r = g(e?.filePath) ?? g(e?.file) ?? g(n?.filePath) ?? g(n?.file) ?? g(n?.path) ?? void 0, o = oe(t, void 0, "Read file");
763
- return r && o.push(Xn(r)), {
764
- indicator: re(t),
760
+ indicator: ie(t),
765
761
  title: o,
766
- blocks: le(t, [])
762
+ blocks: ae(t, s)
767
763
  };
768
- }, Zn = (t) => {
769
- const e = se(t), n = ke(t), r = g(e?.command) ?? void 0, o = oe(t, r, "Run command"), s = [], l = Te(t);
764
+ }, uo = (t) => {
765
+ const e = ce(t), n = Re(t), o = x(e?.filePath) ?? x(e?.file) ?? x(n?.filePath) ?? x(n?.file) ?? x(n?.path) ?? void 0, r = le(t, void 0, "Read file");
766
+ return o && r.push(co(o)), {
767
+ indicator: ie(t),
768
+ title: r,
769
+ blocks: ae(t, [])
770
+ };
771
+ }, fo = (t) => {
772
+ const e = ce(t), n = Re(t), o = x(e?.command) ?? void 0, r = le(t, o, "Run command"), s = [], l = Ie(t);
770
773
  l && s.push({
771
774
  type: "code",
772
775
  language: "text",
773
776
  code: l
774
777
  });
775
- const c = g(n?.stderr);
778
+ const c = x(n?.stderr);
776
779
  return c && c !== l && s.push({
777
780
  type: "code",
778
781
  language: "text",
@@ -781,23 +784,23 @@ const Mn = {
781
784
  type: "text",
782
785
  text: `Exit code: ${n.exitCode}`
783
786
  }), {
784
- indicator: re(t),
785
- title: o,
786
- blocks: le(t, s)
787
+ indicator: ie(t),
788
+ title: r,
789
+ blocks: ae(t, s)
787
790
  };
788
- }, er = (t) => {
789
- const e = se(t), n = Te(t), r = g(e?.pattern) ?? void 0, o = oe(t, r, "Search files"), s = n ? [{
791
+ }, po = (t) => {
792
+ const e = ce(t), n = Ie(t), o = x(e?.pattern) ?? void 0, r = le(t, o, "Search files"), s = n ? [{
790
793
  type: "code",
791
794
  language: "text",
792
795
  code: n
793
796
  }] : [];
794
797
  return {
795
- indicator: re(t),
796
- title: o,
797
- blocks: le(t, s)
798
+ indicator: ie(t),
799
+ title: r,
800
+ blocks: ae(t, s)
798
801
  };
799
- }, tr = (t) => {
800
- const e = se(t), n = Te(t), r = g(e?.pattern) ?? void 0, o = oe(t, r, "Find files"), s = [];
802
+ }, mo = (t) => {
803
+ const e = ce(t), n = Ie(t), o = x(e?.pattern) ?? void 0, r = le(t, o, "Find files"), s = [];
801
804
  if (n) {
802
805
  const l = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
803
806
  l.length > 0 && s.push({
@@ -806,44 +809,44 @@ const Mn = {
806
809
  });
807
810
  }
808
811
  return {
809
- indicator: re(t),
810
- title: o,
811
- blocks: le(t, s)
812
+ indicator: ie(t),
813
+ title: r,
814
+ blocks: ae(t, s)
812
815
  };
813
- }, nr = (t) => {
814
- const e = Te(t), n = e ? Gn(e) : null, r = Jn(t) ?? n?.skillName, o = oe(t, r, "Load skill"), s = n?.content ?? e, l = s ? [{
816
+ }, ho = (t) => {
817
+ const e = Ie(t), n = e ? io(e) : null, o = lo(t) ?? n?.skillName, r = le(t, o, "Load skill"), s = n?.content ?? e, l = s ? [{
815
818
  type: "code",
816
819
  language: "markdown",
817
820
  code: s
818
821
  }] : [];
819
822
  return {
820
- indicator: re(t),
821
- title: o,
822
- blocks: le(t, l)
823
+ indicator: ie(t),
824
+ title: r,
825
+ blocks: ae(t, l)
823
826
  };
824
- }, Ge = () => ({
825
- apply_patch: Yn,
826
- read: Qn,
827
- bash: Zn,
828
- grep: er,
829
- glob: tr,
830
- skill: nr
831
- }), Je = {
827
+ }, Ze = () => ({
828
+ apply_patch: ao,
829
+ read: uo,
830
+ bash: fo,
831
+ grep: po,
832
+ glob: mo,
833
+ skill: ho
834
+ }), et = {
832
835
  pending: "queued",
833
836
  error: "failed",
834
837
  "output-error": "failed",
835
838
  "input-streaming": "running",
836
839
  "input-available": "queued"
837
- }, ft = (t) => t.replace(/^tool-/, ""), rr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), or = (t) => {
838
- const e = ft(t ?? "tool").replace(/_/g, " ");
839
- return rr(e);
840
- }, pt = (t) => t === "error" || t === "output-error", sr = (t) => pt(t.state?.status) ? {
840
+ }, yt = (t) => t.replace(/^tool-/, ""), go = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), bo = (t) => {
841
+ const e = yt(t ?? "tool").replace(/_/g, " ");
842
+ return go(e);
843
+ }, St = (t) => t === "error" || t === "output-error", xo = (t) => St(t.state?.status) ? {
841
844
  type: "icon",
842
845
  icon: "danger"
843
846
  } : {
844
847
  type: "icon",
845
- icon: st(t.tool ?? "tool")
846
- }, lr = (t) => !t || typeof t != "string" ? null : Je[t] ? Je[t] : t.includes("stream") ? "running" : null, Xe = (t) => {
848
+ icon: ft(t.tool ?? "tool")
849
+ }, yo = (t) => !t || typeof t != "string" ? null : et[t] ? et[t] : t.includes("stream") ? "running" : null, tt = (t) => {
847
850
  if (typeof t == "string") return t;
848
851
  if (t == null) return null;
849
852
  try {
@@ -851,94 +854,94 @@ const Mn = {
851
854
  } catch {
852
855
  return null;
853
856
  }
854
- }, ir = (t) => {
857
+ }, So = (t) => {
855
858
  const e = [];
856
- pt(t.state?.status) && t.state?.errorText && e.push({
859
+ St(t.state?.status) && t.state?.errorText && e.push({
857
860
  type: "comment",
858
861
  text: t.state.errorText
859
862
  });
860
- const n = Xe(t.state?.input);
863
+ const n = tt(t.state?.input);
861
864
  n && e.push({
862
865
  type: "code",
863
866
  language: "json",
864
867
  code: n
865
868
  });
866
- const r = Xe(t.state?.output);
867
- return r && e.push({
869
+ const o = tt(t.state?.output);
870
+ return o && e.push({
868
871
  type: "code",
869
872
  language: "json",
870
- code: r
873
+ code: o
871
874
  }), e;
872
- }, cr = (t) => {
875
+ }, ko = (t) => {
873
876
  const e = [{
874
877
  kind: "text",
875
- text: or(t.tool),
878
+ text: bo(t.tool),
876
879
  bold: !0
877
- }], n = lr(t.state?.status);
880
+ }], n = yo(t.state?.status);
878
881
  return n && e.push({
879
882
  kind: "text",
880
883
  text: n,
881
884
  muted: !0
882
885
  }), {
883
- indicator: sr(t),
886
+ indicator: xo(t),
884
887
  title: e,
885
- blocks: ir(t)
888
+ blocks: So(t)
886
889
  };
887
- }, ar = (t) => t ? {
888
- ...Ge(),
890
+ }, To = (t) => t ? {
891
+ ...Ze(),
889
892
  ...t
890
- } : Ge(), dr = (t, e) => {
893
+ } : Ze(), Co = (t, e) => {
891
894
  const n = t.tool ?? "tool";
892
- return e[n] ?? e[ft(n)];
893
- }, ur = (t, e, n) => {
894
- const r = dr(t, e);
895
- if (r) {
896
- const o = r(t, n);
897
- if (o) return o;
895
+ return e[n] ?? e[yt(n)];
896
+ }, wo = (t, e, n) => {
897
+ const o = Co(t, e);
898
+ if (o) {
899
+ const r = o(t, n);
900
+ if (r) return r;
898
901
  }
899
- return cr(t);
900
- }, fr = (t, e) => {
901
- const n = ar(e?.toolRenderers);
902
+ return ko(t);
903
+ }, _o = (t, e) => {
904
+ const n = To(e?.toolRenderers);
902
905
  return {
903
- items: t.map((o) => ur(o, n, e))
906
+ items: t.map((r) => wo(r, n, e))
904
907
  };
905
- }, U = wt, mt = (t, e, n, r = !1) => {
906
- r && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
908
+ }, W = Mt, kt = (t, e, n, o = !1) => {
909
+ o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
907
910
  };
908
- function pr(t) {
911
+ function Po(t) {
909
912
  const e = y(6), {
910
913
  seg: n
911
914
  } = t;
912
- let r;
913
- e[0] !== n.alt || e[1] !== n.src ? (r = /* @__PURE__ */ i(ne.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = r) : r = e[2];
914
915
  let o;
915
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ne.Fallback, {}), e[3] = o) : o = e[3];
916
+ e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ i(se.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
917
+ let r;
918
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ i(se.Fallback, {}), e[3] = r) : r = e[3];
916
919
  let s;
917
- return e[4] !== r ? (s = /* @__PURE__ */ x(ne.Root, { width: "1.5rem", height: "1.5rem", children: [
918
- r,
919
- o
920
- ] }), e[4] = r, e[5] = s) : s = e[5], s;
920
+ return e[4] !== o ? (s = /* @__PURE__ */ b(se.Root, { width: "1.5rem", height: "1.5rem", children: [
921
+ o,
922
+ r
923
+ ] }), e[4] = o, e[5] = s) : s = e[5], s;
921
924
  }
922
- function mr(t) {
925
+ function Ro(t) {
923
926
  const e = y(9), {
924
927
  seg: n,
925
- onOpenFile: r
926
- } = t, o = n.additions ?? 0, s = n.deletions ?? 0;
928
+ onOpenFile: o
929
+ } = t, r = n.additions ?? 0, s = n.deletions ?? 0;
927
930
  let l;
928
- e[0] !== r || e[1] !== n.fileName || e[2] !== n.filePath ? (l = () => {
929
- const d = n.filePath ?? n.fileName;
930
- r?.(d);
931
- }, e[0] = r, e[1] = n.fileName, e[2] = n.filePath, e[3] = l) : l = e[3];
931
+ e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (l = () => {
932
+ const a = n.filePath ?? n.fileName;
933
+ o?.(a);
934
+ }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = l) : l = e[3];
932
935
  let c;
933
- return e[4] !== n.fileName || e[5] !== o || e[6] !== s || e[7] !== l ? (c = /* @__PURE__ */ i(Kt, { fileName: n.fileName, additions: o, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = o, e[6] = s, e[7] = l, e[8] = c) : c = e[8], c;
936
+ return e[4] !== n.fileName || e[5] !== r || e[6] !== s || e[7] !== l ? (c = /* @__PURE__ */ i(dt, { fileName: n.fileName, additions: r, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = r, e[6] = s, e[7] = l, e[8] = c) : c = e[8], c;
934
937
  }
935
- function hr(t) {
938
+ function Io(t) {
936
939
  const e = y(13), {
937
940
  seg: n,
938
- onOpenFile: r
939
- } = t, o = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", c = (n.muted, "fg.muted"), d = s ? "pointer" : "default";
940
- let a;
941
- e[0] !== r || e[1] !== n ? (a = (m) => mt(m, n, r, !0), e[0] = r, e[1] = n, e[2] = a) : a = e[2];
941
+ onOpenFile: o
942
+ } = t, r = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", c = (n.muted, "fg.muted"), a = s ? "pointer" : "default";
943
+ let d;
944
+ e[0] !== o || e[1] !== n ? (d = (m) => kt(m, n, o, !0), e[0] = o, e[1] = n, e[2] = d) : d = e[2];
942
945
  const u = n.muted ? "fg.muted" : "fg.blue-dark";
943
946
  let f;
944
947
  e[3] !== u ? (f = {
@@ -946,64 +949,64 @@ function hr(t) {
946
949
  color: u
947
950
  }, e[3] = u, e[4] = f) : f = e[4];
948
951
  let p;
949
- return e[5] !== o || e[6] !== n.text || e[7] !== l || e[8] !== c || e[9] !== d || e[10] !== a || e[11] !== f ? (p = /* @__PURE__ */ i(Ze, { href: l, fontWeight: o, color: c, textDecoration: "none", cursor: d, onClick: a, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = l, e[8] = c, e[9] = d, e[10] = a, e[11] = f, e[12] = p) : p = e[12], p;
952
+ return e[5] !== r || e[6] !== n.text || e[7] !== l || e[8] !== c || e[9] !== a || e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ i(it, { href: l, fontWeight: r, color: c, textDecoration: "none", cursor: a, onClick: d, _hover: f, children: n.text }), e[5] = r, e[6] = n.text, e[7] = l, e[8] = c, e[9] = a, e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
950
953
  }
951
- function gr(t) {
954
+ function vo(t) {
952
955
  const e = y(12), {
953
956
  seg: n,
954
- onOpenFile: r
955
- } = t, o = n.bold ? "medium" : void 0, s = n.href ?? "#", l = n.muted ? "fg.muted" : "accent.primary";
957
+ onOpenFile: o
958
+ } = t, r = n.bold ? "medium" : void 0, s = n.href ?? "#", l = n.muted ? "fg.muted" : "accent.primary";
956
959
  let c;
957
- e[0] !== r || e[1] !== n ? (c = (f) => mt(f, n, r), e[0] = r, e[1] = n, e[2] = c) : c = e[2];
958
- const d = n.muted ? "fg.muted" : "accent.primary";
959
- let a;
960
- e[3] !== d ? (a = {
961
- color: d,
960
+ e[0] !== o || e[1] !== n ? (c = (f) => kt(f, n, o), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
961
+ const a = n.muted ? "fg.muted" : "accent.primary";
962
+ let d;
963
+ e[3] !== a ? (d = {
964
+ color: a,
962
965
  textDecoration: "underline"
963
- }, e[3] = d, e[4] = a) : a = e[4];
966
+ }, e[3] = a, e[4] = d) : d = e[4];
964
967
  let u;
965
- return e[5] !== o || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== c || e[10] !== a ? (u = /* @__PURE__ */ i(Ze, { href: s, fontWeight: o, color: l, textDecoration: "underline", onClick: c, _hover: a, children: n.text }), e[5] = o, e[6] = n.text, e[7] = s, e[8] = l, e[9] = c, e[10] = a, e[11] = u) : u = e[11], u;
968
+ return e[5] !== r || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== c || e[10] !== d ? (u = /* @__PURE__ */ i(it, { href: s, fontWeight: r, color: l, textDecoration: "underline", onClick: c, _hover: d, children: n.text }), e[5] = r, e[6] = n.text, e[7] = s, e[8] = l, e[9] = c, e[10] = d, e[11] = u) : u = e[11], u;
966
969
  }
967
- function br(t) {
970
+ function Bo(t) {
968
971
  const e = y(6), {
969
972
  seg: n,
970
- isClickable: r
971
- } = t, o = n.bold ? "medium" : void 0, s = r && !n.muted ? "fg" : "fg.muted";
973
+ isClickable: o
974
+ } = t, r = n.bold ? "medium" : void 0, s = o && !n.muted ? "fg" : "fg.muted";
972
975
  let l;
973
976
  e[0] !== s ? (l = {
974
977
  color: s
975
978
  }, e[0] = s, e[1] = l) : l = e[1];
976
979
  let c;
977
- return e[2] !== n.text || e[3] !== o || e[4] !== l ? (c = /* @__PURE__ */ i(ae, { fontWeight: o, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = o, e[4] = l, e[5] = c) : c = e[5], c;
980
+ return e[2] !== n.text || e[3] !== r || e[4] !== l ? (c = /* @__PURE__ */ i(pe, { fontWeight: r, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = r, e[4] = l, e[5] = c) : c = e[5], c;
978
981
  }
979
- function xr(t) {
982
+ function Mo(t) {
980
983
  const e = y(11), {
981
984
  seg: n,
982
- isClickable: r,
983
- onOpenFile: o
985
+ isClickable: o,
986
+ onOpenFile: r
984
987
  } = t;
985
988
  switch (n.kind) {
986
989
  case "avatar": {
987
990
  let s;
988
- return e[0] !== n ? (s = /* @__PURE__ */ i(pr, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
991
+ return e[0] !== n ? (s = /* @__PURE__ */ i(Po, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
989
992
  }
990
993
  case "diff": {
991
994
  let s;
992
- return e[2] !== o || e[3] !== n ? (s = /* @__PURE__ */ i(mr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = s) : s = e[4], s;
995
+ return e[2] !== r || e[3] !== n ? (s = /* @__PURE__ */ i(Ro, { seg: n, onOpenFile: r }), e[2] = r, e[3] = n, e[4] = s) : s = e[4], s;
993
996
  }
994
997
  case "link": {
995
998
  let s;
996
- return e[5] !== o || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(hr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ i(gr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = s) : s = e[7], s;
999
+ return e[5] !== r || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(Io, { seg: n, onOpenFile: r }) : /* @__PURE__ */ i(vo, { seg: n, onOpenFile: r }), e[5] = r, e[6] = n, e[7] = s) : s = e[7], s;
997
1000
  }
998
1001
  case "text": {
999
1002
  let s;
1000
- return e[8] !== r || e[9] !== n ? (s = /* @__PURE__ */ i(br, { seg: n, isClickable: r }), e[8] = r, e[9] = n, e[10] = s) : s = e[10], s;
1003
+ return e[8] !== o || e[9] !== n ? (s = /* @__PURE__ */ i(Bo, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = s) : s = e[10], s;
1001
1004
  }
1002
1005
  default:
1003
1006
  return null;
1004
1007
  }
1005
1008
  }
1006
- function yr(t) {
1009
+ function Ao(t) {
1007
1010
  const e = y(10), {
1008
1011
  ind: n
1009
1012
  } = t;
@@ -1011,166 +1014,166 @@ function yr(t) {
1011
1014
  return null;
1012
1015
  if (n.type === "icon") {
1013
1016
  let l;
1014
- e[0] !== n.icon ? (l = Tn(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1017
+ e[0] !== n.icon ? (l = zn(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1015
1018
  const c = l;
1016
- let d;
1017
- return e[2] !== c ? (d = /* @__PURE__ */ i(U.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(ae, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = d) : d = e[3], d;
1019
+ let a;
1020
+ return e[2] !== c ? (a = /* @__PURE__ */ i(W.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = a) : a = e[3], a;
1018
1021
  }
1019
- let r;
1020
- e[4] !== n.alt || e[5] !== n.src ? (r = /* @__PURE__ */ i(ne.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = r) : r = e[6];
1021
1022
  let o;
1022
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ne.Fallback, {}), e[7] = o) : o = e[7];
1023
+ e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ i(se.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1024
+ let r;
1025
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ i(se.Fallback, {}), e[7] = r) : r = e[7];
1023
1026
  let s;
1024
- return e[8] !== r ? (s = /* @__PURE__ */ i(U.Indicator, { children: /* @__PURE__ */ x(ne.Root, { boxSize: "full", children: [
1025
- r,
1026
- o
1027
- ] }) }), e[8] = r, e[9] = s) : s = e[9], s;
1027
+ return e[8] !== o ? (s = /* @__PURE__ */ i(W.Indicator, { children: /* @__PURE__ */ b(se.Root, { boxSize: "full", children: [
1028
+ o,
1029
+ r
1030
+ ] }) }), e[8] = o, e[9] = s) : s = e[9], s;
1028
1031
  }
1029
- function Sr(t) {
1032
+ function Do(t) {
1030
1033
  const e = y(5), {
1031
1034
  code: n,
1032
- language: r
1033
- } = t, o = r ? `${r} code block` : "code block";
1035
+ language: o
1036
+ } = t, r = o ? `${o} code block` : "code block";
1034
1037
  let s;
1035
1038
  e[0] !== n ? (s = /* @__PURE__ */ i(k, { as: "code", children: n }), e[0] = n, e[1] = s) : s = e[1];
1036
1039
  let l;
1037
- return e[2] !== o || e[3] !== s ? (l = /* @__PURE__ */ i(k, { 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: s }), e[2] = o, e[3] = s, e[4] = l) : l = e[4], l;
1040
+ return e[2] !== r || e[3] !== s ? (l = /* @__PURE__ */ i(k, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": r, children: s }), e[2] = r, e[3] = s, e[4] = l) : l = e[4], l;
1038
1041
  }
1039
- function kr(t) {
1042
+ function zo(t) {
1040
1043
  const e = y(26), {
1041
1044
  b: n,
1042
- onOpenFile: r
1045
+ onOpenFile: o
1043
1046
  } = t;
1044
1047
  switch (n.type) {
1045
1048
  case "comment": {
1046
- let o;
1047
- e[0] !== n.text ? (o = /* @__PURE__ */ i(N.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1049
+ let r;
1050
+ e[0] !== n.text ? (r = /* @__PURE__ */ i(A.Body, { children: n.text }), e[0] = n.text, e[1] = r) : r = e[1];
1048
1051
  let s;
1049
- e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(N.Footer, { children: /* @__PURE__ */ x($e, { children: [
1052
+ e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(A.Footer, { children: /* @__PURE__ */ b(me, { children: [
1050
1053
  "👏 ",
1051
1054
  n.reactions.clap
1052
1055
  ] }) }) : null, e[2] = n.reactions, e[3] = s) : s = e[3];
1053
1056
  let l;
1054
- return e[4] !== o || e[5] !== s ? (l = /* @__PURE__ */ x(N.Root, { children: [
1055
- o,
1057
+ return e[4] !== r || e[5] !== s ? (l = /* @__PURE__ */ b(A.Root, { children: [
1058
+ r,
1056
1059
  s
1057
- ] }), e[4] = o, e[5] = s, e[6] = l) : l = e[6], l;
1060
+ ] }), e[4] = r, e[5] = s, e[6] = l) : l = e[6], l;
1058
1061
  }
1059
1062
  case "code": {
1060
- let o;
1061
- return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ i(N.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(N.Body, { padding: "0", children: /* @__PURE__ */ i(Sr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1063
+ let r;
1064
+ return e[7] !== n.code || e[8] !== n.language ? (r = /* @__PURE__ */ i(A.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(A.Body, { padding: "0", children: /* @__PURE__ */ i(Do, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = r) : r = e[9], r;
1062
1065
  }
1063
1066
  case "diff": {
1064
- const o = n.sideBySide ?? !1;
1067
+ const r = n.sideBySide ?? !1;
1065
1068
  let s;
1066
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (s = /* @__PURE__ */ i(N.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(N.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(qt, { 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] = s) : s = e[14], s;
1069
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== r ? (s = /* @__PURE__ */ i(A.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(A.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(rn, { original: n.original, modified: n.modified, language: n.language, sideBySide: r, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = r, e[14] = s) : s = e[14], s;
1067
1070
  }
1068
1071
  case "text": {
1069
- let o;
1070
- return e[15] !== n.text ? (o = /* @__PURE__ */ i(N.Root, { background: "transparent", children: /* @__PURE__ */ i(N.Body, { padding: "sm", children: /* @__PURE__ */ i(te, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1072
+ let r;
1073
+ return e[15] !== n.text ? (r = /* @__PURE__ */ i(A.Root, { background: "transparent", children: /* @__PURE__ */ i(A.Body, { padding: "sm", children: /* @__PURE__ */ i(re, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = r) : r = e[16], r;
1071
1074
  }
1072
1075
  case "references": {
1073
- let o;
1074
- e[17] !== n.references ? (o = n.references.map(Tr), e[17] = n.references, e[18] = o) : o = e[18];
1076
+ let r;
1077
+ e[17] !== n.references ? (r = n.references.map($o), e[17] = n.references, e[18] = r) : r = e[18];
1075
1078
  let s;
1076
- return e[19] !== o ? (s = /* @__PURE__ */ i(et, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[19] = o, e[20] = s) : s = e[20], s;
1079
+ return e[19] !== r ? (s = /* @__PURE__ */ i(he, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: r }), e[19] = r, e[20] = s) : s = e[20], s;
1077
1080
  }
1078
1081
  case "component": {
1079
- let o;
1080
- e[21] !== n || e[22] !== r ? (o = n.render({
1081
- onOpenFile: r
1082
- }), e[21] = n, e[22] = r, e[23] = o) : o = e[23];
1082
+ let r;
1083
+ e[21] !== n || e[22] !== o ? (r = n.render({
1084
+ onOpenFile: o
1085
+ }), e[21] = n, e[22] = o, e[23] = r) : r = e[23];
1083
1086
  let s;
1084
- return e[24] !== o ? (s = /* @__PURE__ */ i(Le, { children: o }), e[24] = o, e[25] = s) : s = e[25], s;
1087
+ return e[24] !== r ? (s = /* @__PURE__ */ i(Ue, { children: r }), e[24] = r, e[25] = s) : s = e[25], s;
1085
1088
  }
1086
1089
  }
1087
1090
  }
1088
- function Tr(t) {
1089
- return /* @__PURE__ */ i(Yt, { fileName: t }, t);
1091
+ function $o(t) {
1092
+ return /* @__PURE__ */ i(on, { fileName: t }, t);
1090
1093
  }
1091
- function wr(t) {
1094
+ function Eo(t) {
1092
1095
  const e = y(22), {
1093
1096
  item: n,
1094
- itemKey: r,
1095
- isOpen: o,
1097
+ itemKey: o,
1098
+ isOpen: r,
1096
1099
  canExpand: s,
1097
1100
  hasBlocks: l,
1098
1101
  onToggle: c,
1099
- onOpenFile: d
1102
+ onOpenFile: a
1100
1103
  } = t;
1101
- let a;
1102
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i(U.Separator, {}), e[0] = a) : a = e[0];
1104
+ let d;
1105
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(W.Separator, {}), e[0] = d) : d = e[0];
1103
1106
  let u;
1104
- e[1] !== n.indicator ? (u = /* @__PURE__ */ x(U.Connector, { children: [
1105
- a,
1106
- /* @__PURE__ */ i(yr, { ind: n.indicator })
1107
+ e[1] !== n.indicator ? (u = /* @__PURE__ */ b(W.Connector, { children: [
1108
+ d,
1109
+ /* @__PURE__ */ i(Ao, { ind: n.indicator })
1107
1110
  ] }), e[1] = n.indicator, e[2] = u) : u = e[2];
1108
1111
  let f;
1109
- e[3] !== s || e[4] !== o || e[5] !== n.title || e[6] !== r || e[7] !== d || e[8] !== c ? (f = n.title.length > 0 && /* @__PURE__ */ i(U.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => c(r) : void 0, children: /* @__PURE__ */ x(ae, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1110
- /* @__PURE__ */ i(ae, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((b, S) => /* @__PURE__ */ i(xr, { seg: b, isClickable: s, onOpenFile: d }, S)) }),
1111
- s ? /* @__PURE__ */ i(ae, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1112
+ e[3] !== s || e[4] !== r || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== c ? (f = n.title.length > 0 && /* @__PURE__ */ i(W.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => c(o) : void 0, children: /* @__PURE__ */ b(pe, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1113
+ /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((h, T) => /* @__PURE__ */ i(Mo, { seg: h, isClickable: s, onOpenFile: a }, T)) }),
1114
+ s ? /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: r ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1112
1115
  color: "fg"
1113
- }, children: /* @__PURE__ */ i(jt, { size: 12 }) }) : null
1114
- ] }) }), e[3] = s, e[4] = o, e[5] = n.title, e[6] = r, e[7] = d, e[8] = c, e[9] = f) : f = e[9];
1116
+ }, children: /* @__PURE__ */ i(Qt, { size: 12 }) }) : null
1117
+ ] }) }), e[3] = s, e[4] = r, e[5] = n.title, e[6] = o, e[7] = a, e[8] = c, e[9] = f) : f = e[9];
1115
1118
  let p;
1116
- e[10] !== l || e[11] !== o || e[12] !== n.blocks || e[13] !== d ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, S) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(kr, { b, onOpenFile: d }) }, S)) }) : null }) : null, e[10] = l, e[11] = o, e[12] = n.blocks, e[13] = d, e[14] = p) : p = e[14];
1119
+ e[10] !== l || e[11] !== r || e[12] !== n.blocks || e[13] !== a ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: r ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: r ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((h, T) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(zo, { b: h, onOpenFile: a }) }, T)) }) : null }) : null, e[10] = l, e[11] = r, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
1117
1120
  let m;
1118
- e[15] !== f || e[16] !== p ? (m = /* @__PURE__ */ x(U.Content, { pb: "xs", children: [
1121
+ e[15] !== f || e[16] !== p ? (m = /* @__PURE__ */ b(W.Content, { pb: "xs", children: [
1119
1122
  f,
1120
1123
  p
1121
1124
  ] }), e[15] = f, e[16] = p, e[17] = m) : m = e[17];
1122
- let h;
1123
- return e[18] !== r || e[19] !== u || e[20] !== m ? (h = /* @__PURE__ */ x(U.Item, { gap: "xs", children: [
1125
+ let g;
1126
+ return e[18] !== o || e[19] !== u || e[20] !== m ? (g = /* @__PURE__ */ b(W.Item, { gap: "xs", children: [
1124
1127
  u,
1125
1128
  m
1126
- ] }, r), e[18] = r, e[19] = u, e[20] = m, e[21] = h) : h = e[21], h;
1129
+ ] }, o), e[18] = o, e[19] = u, e[20] = m, e[21] = g) : g = e[21], g;
1127
1130
  }
1128
- function Cr(t) {
1131
+ function Fo(t) {
1129
1132
  const e = y(11), {
1130
1133
  data: n,
1131
- onOpenFile: r
1134
+ onOpenFile: o
1132
1135
  } = t;
1133
- let o;
1134
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1135
- const [s, l] = ce(o), c = Pr;
1136
- let d;
1137
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = (p) => {
1136
+ let r;
1137
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = {}, e[0] = r) : r = e[0];
1138
+ const [s, l] = oe(r), c = Lo;
1139
+ let a;
1140
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
1138
1141
  l((m) => ({
1139
1142
  ...m,
1140
1143
  [p]: !m[p]
1141
1144
  }));
1142
- }, e[1] = d) : d = e[1];
1143
- const a = d;
1145
+ }, e[1] = a) : a = e[1];
1146
+ const d = a;
1144
1147
  let u;
1145
- if (e[2] !== n.items || e[3] !== s || e[4] !== r) {
1148
+ if (e[2] !== n.items || e[3] !== s || e[4] !== o) {
1146
1149
  let p;
1147
- e[6] !== s || e[7] !== r ? (p = (m, h) => {
1148
- const b = c(m, h), S = (m.blocks?.length ?? 0) > 0, T = (m.expandable ?? !0) && S, P = T ? s[b] ?? !1 : S;
1149
- return /* @__PURE__ */ i(wr, { item: m, itemKey: b, isOpen: P, canExpand: T, hasBlocks: S, onToggle: a, onOpenFile: r }, b);
1150
- }, e[6] = s, e[7] = r, e[8] = p) : p = e[8], u = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = r, e[5] = u;
1150
+ e[6] !== s || e[7] !== o ? (p = (m, g) => {
1151
+ const h = c(m, g), T = (m.blocks?.length ?? 0) > 0, D = (m.expandable ?? !0) && T, w = D ? s[h] ?? !1 : T;
1152
+ return /* @__PURE__ */ i(Eo, { item: m, itemKey: h, isOpen: w, canExpand: D, hasBlocks: T, onToggle: d, onOpenFile: o }, h);
1153
+ }, e[6] = s, e[7] = o, e[8] = p) : p = e[8], u = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = o, e[5] = u;
1151
1154
  } else
1152
1155
  u = e[5];
1153
1156
  let f;
1154
- return e[9] !== u ? (f = /* @__PURE__ */ i(U.Root, { children: u }), e[9] = u, e[10] = f) : f = e[10], f;
1157
+ return e[9] !== u ? (f = /* @__PURE__ */ i(W.Root, { children: u }), e[9] = u, e[10] = f) : f = e[10], f;
1155
1158
  }
1156
- function Pr(t, e) {
1159
+ function Lo(t, e) {
1157
1160
  return t.id ? `id:${t.id}` : `idx:${e}`;
1158
1161
  }
1159
- function _r(t) {
1162
+ function Oo(t) {
1160
1163
  const e = y(6), {
1161
1164
  invocations: n,
1162
- labeledBlocks: r,
1163
- onOpenFile: o
1165
+ labeledBlocks: o,
1166
+ onOpenFile: r
1164
1167
  } = t;
1165
1168
  let s;
1166
- e[0] !== n || e[1] !== r ? (s = fr(n, {
1167
- labeledBlocks: r
1168
- }), e[0] = n, e[1] = r, e[2] = s) : s = e[2];
1169
+ e[0] !== n || e[1] !== o ? (s = _o(n, {
1170
+ labeledBlocks: o
1171
+ }), e[0] = n, e[1] = o, e[2] = s) : s = e[2];
1169
1172
  const l = s;
1170
1173
  let c;
1171
- return e[3] !== l || e[4] !== o ? (c = /* @__PURE__ */ i(Cr, { data: l, onOpenFile: o }), e[3] = l, e[4] = o, e[5] = c) : c = e[5], c;
1174
+ return e[3] !== l || e[4] !== r ? (c = /* @__PURE__ */ i(Fo, { data: l, onOpenFile: r }), e[3] = l, e[4] = r, e[5] = c) : c = e[5], c;
1172
1175
  }
1173
- const Rr = (t) => t.type === "tool", Fe = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Ir = (t) => {
1176
+ const Ho = (t) => t.type === "tool", We = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Wo = (t) => {
1174
1177
  if (t.message && t.message.trim().length > 0)
1175
1178
  return t.message;
1176
1179
  const {
@@ -1186,96 +1189,96 @@ const Rr = (t) => t.type === "tool", Fe = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1186
1189
  default:
1187
1190
  return "An error occurred.";
1188
1191
  }
1189
- }, Br = (t, e) => {
1192
+ }, jo = (t, e) => {
1190
1193
  const n = [];
1191
- let r = e;
1192
- for (; r < t.length; ) {
1193
- const o = t[r];
1194
- if (!Rr(o)) break;
1195
- n.push(o), r += 1;
1194
+ let o = e;
1195
+ for (; o < t.length; ) {
1196
+ const r = t[o];
1197
+ if (!Ho(r)) break;
1198
+ n.push(r), o += 1;
1196
1199
  }
1197
1200
  return {
1198
1201
  invocations: n,
1199
- nextIndex: r - 1
1202
+ nextIndex: o - 1
1200
1203
  };
1201
1204
  };
1202
- function Dr(t) {
1205
+ function Tt(t) {
1203
1206
  const e = y(7), {
1204
1207
  message: n,
1205
- onOpenFile: r,
1206
- toolInvocationTimeline: o
1207
- } = t, s = o ?? _r;
1208
+ onOpenFile: o,
1209
+ toolInvocationTimeline: r
1210
+ } = t, s = r ?? Oo;
1208
1211
  let l;
1209
1212
  e[0] !== n.parts ? (l = n.parts ?? [], e[0] = n.parts, e[1] = l) : l = e[1];
1210
1213
  const c = l;
1211
- let d;
1212
- if (e[2] !== s || e[3] !== n.id || e[4] !== r || e[5] !== c) {
1213
- const a = [];
1214
+ let a;
1215
+ if (e[2] !== s || e[3] !== n.id || e[4] !== o || e[5] !== c) {
1216
+ const d = [];
1214
1217
  for (let u = 0; u < c.length; u = u + 1, u) {
1215
1218
  const f = c[u], p = `${n.id}-${u}`;
1216
1219
  e: switch (f.type) {
1217
1220
  case "text": {
1218
- a.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(yn, { children: f.text }) }, p));
1221
+ d.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(Mn, { children: f.text }) }, p));
1219
1222
  break e;
1220
1223
  }
1221
1224
  case "reasoning": {
1222
- a.push(/* @__PURE__ */ i(k, { padding: "0", css: {
1225
+ d.push(/* @__PURE__ */ i(k, { padding: "0", css: {
1223
1226
  "& .rich-text, & .rich-text *": {
1224
1227
  color: "fg.subtle !important",
1225
1228
  fontSize: ".75rem !important",
1226
1229
  fontWeight: "normal !important"
1227
1230
  }
1228
- }, children: /* @__PURE__ */ i(rt, { defaultState: f.text, fullWidth: !0 }) }, p));
1231
+ }, children: /* @__PURE__ */ i(at, { defaultState: f.text, fullWidth: !0 }) }, p));
1229
1232
  break e;
1230
1233
  }
1231
1234
  case "tool": {
1232
1235
  const {
1233
1236
  invocations: m,
1234
- nextIndex: h
1235
- } = Br(c, u);
1236
- u = h, a.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: r }) }, p));
1237
+ nextIndex: g
1238
+ } = jo(c, u);
1239
+ u = g, d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: o }) }, p));
1237
1240
  break e;
1238
1241
  }
1239
1242
  case "loading": {
1240
- a.push(/* @__PURE__ */ x(k, { display: "flex", alignItems: "center", gap: "2", py: "2", children: [
1241
- /* @__PURE__ */ i(Ct, { size: "sm" }),
1242
- /* @__PURE__ */ i(te, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1243
+ d.push(/* @__PURE__ */ b(k, { display: "flex", alignItems: "center", gap: "2", py: "2", children: [
1244
+ /* @__PURE__ */ i(At, { size: "sm" }),
1245
+ /* @__PURE__ */ i(re, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1243
1246
  ] }, p));
1244
1247
  break e;
1245
1248
  }
1246
1249
  case "error": {
1247
- a.push(/* @__PURE__ */ i(k, { py: "2", children: /* @__PURE__ */ i(te, { fontSize: "sm", color: "fg.error", children: Ir(f) }) }, p));
1250
+ d.push(/* @__PURE__ */ i(k, { py: "2", children: /* @__PURE__ */ i(re, { fontSize: "sm", color: "fg.error", children: Wo(f) }) }, p));
1248
1251
  break e;
1249
1252
  }
1250
1253
  case "token_usage": {
1251
- a.push(/* @__PURE__ */ i(k, { py: "1", children: /* @__PURE__ */ x(te, { fontSize: "xs", color: "fg.subtle", children: [
1254
+ d.push(/* @__PURE__ */ i(k, { py: "1", children: /* @__PURE__ */ b(re, { fontSize: "xs", color: "fg.subtle", children: [
1252
1255
  "Tokens: ",
1253
- Fe(f.inputTokens),
1256
+ We(f.inputTokens),
1254
1257
  " in / ",
1255
- Fe(f.outputTokens),
1258
+ We(f.outputTokens),
1256
1259
  " out",
1257
- f.cacheReadTokens ? ` / ${Fe(f.cacheReadTokens)} cache read` : ""
1260
+ f.cacheReadTokens ? ` / ${We(f.cacheReadTokens)} cache read` : ""
1258
1261
  ] }) }, p));
1259
1262
  break e;
1260
1263
  }
1261
1264
  default:
1262
- a.push(null);
1265
+ d.push(null);
1263
1266
  }
1264
1267
  }
1265
- d = /* @__PURE__ */ i(Le, { children: a }), e[2] = s, e[3] = n.id, e[4] = r, e[5] = c, e[6] = d;
1268
+ a = /* @__PURE__ */ i(Ue, { children: d }), e[2] = s, e[3] = n.id, e[4] = o, e[5] = c, e[6] = a;
1266
1269
  } else
1267
- d = e[6];
1268
- return d;
1270
+ a = e[6];
1271
+ return a;
1269
1272
  }
1270
- const Ar = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", vr = (t) => {
1273
+ const No = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Uo = (t) => {
1271
1274
  const e = t.parts ?? [];
1272
- return e.length === 0 || e.some((r) => r.type === "text" && "text" in r) ? !1 : e.some((r) => r.type === "reasoning" || r.type === "tool");
1273
- }, Fr = (t) => {
1275
+ return e.length === 0 || e.some((o) => o.type === "text" && "text" in o) ? !1 : e.some((o) => o.type === "reasoning" || o.type === "tool");
1276
+ }, Vo = (t) => {
1274
1277
  const e = [];
1275
1278
  for (const n of t) {
1276
- const r = e[e.length - 1];
1277
- if (r && r.role === n.role && vr(n)) {
1278
- r.parts = [...r.parts ?? [], ...n.parts ?? []];
1279
+ const o = e[e.length - 1];
1280
+ if (o && o.role === n.role && Uo(n)) {
1281
+ o.parts = [...o.parts ?? [], ...n.parts ?? []];
1279
1282
  continue;
1280
1283
  }
1281
1284
  e.push({
@@ -1284,87 +1287,136 @@ const Ar = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1284
1287
  });
1285
1288
  }
1286
1289
  return e;
1287
- }, zr = (t) => {
1290
+ }, qo = (t) => {
1288
1291
  const e = [], n = [];
1289
- for (const r of t)
1290
- r.role === "user" ? e.push({
1291
- userMessage: r,
1292
+ for (const o of t)
1293
+ o.role === "user" ? e.push({
1294
+ userMessage: o,
1292
1295
  responses: []
1293
- }) : e.length > 0 ? e[e.length - 1].responses.push(r) : n.push(r);
1296
+ }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
1294
1297
  return {
1295
1298
  groups: e,
1296
1299
  leadingResponses: n
1297
1300
  };
1298
- }, ze = (t, e) => {
1299
- const n = Ar(t.role);
1300
- return /* @__PURE__ */ i(Ve.Root, { from: n, children: /* @__PURE__ */ i(Ve.Content, { from: n, children: /* @__PURE__ */ i(Dr, { message: t, streaming: e }) }) }, t.id);
1301
- }, go = (t) => {
1302
- const e = y(47), {
1301
+ }, nt = (t, e) => {
1302
+ const n = No(t.role);
1303
+ return /* @__PURE__ */ i(j.Root, { from: n, children: /* @__PURE__ */ i(j.Content, { from: n, children: /* @__PURE__ */ i(Tt, { message: t, streaming: e }) }) }, t.id);
1304
+ }, Ir = (t) => {
1305
+ const e = y(24), {
1303
1306
  messages: n,
1304
- streaming: r,
1305
- emptyStateTitle: o,
1307
+ streaming: o,
1308
+ emptyStateTitle: r,
1306
1309
  emptyStateDescription: s,
1307
- chatInputPlaceholder: l,
1308
- chatInputDefaultValue: c,
1309
- onSubmitMessage: d,
1310
- onChatInputChange: a,
1311
- actions: u,
1312
- repoMenu: f,
1313
- attachedResources: p,
1314
- onClearAttachments: m,
1315
- attachmentList: h,
1316
- approvalPrompt: b
1317
- } = t, S = r === void 0 ? !1 : r, T = c === void 0 ? "" : c;
1318
- let P, M, v, O, F, L, R, C, z, W;
1319
- if (e[0] !== s || e[1] !== o || e[2] !== n || e[3] !== S) {
1320
- const j = Fr(n), we = j.length > 0, q = j.reduce($r, 0), {
1321
- groups: ie,
1322
- leadingResponses: K
1323
- } = zr(j);
1324
- v = be, L = "relative", R = "column", C = "full", z = "full", W = "hidden", M = ve.Root, F = /* @__PURE__ */ i(un, { userMessageCount: q }), P = ve.Viewport, O = we ? /* @__PURE__ */ x(et, { gap: "sm", children: [
1325
- K.map((_) => ze(_, S)),
1326
- ie.map((_) => /* @__PURE__ */ x(k, { children: [
1327
- /* @__PURE__ */ i(k, { position: "sticky", top: "0", zIndex: 1, children: ze(_.userMessage, S) }),
1328
- _.responses.map((H) => ze(H, S))
1329
- ] }, _.userMessage.id))
1330
- ] }) : /* @__PURE__ */ i(Gt, { icon: /* @__PURE__ */ i(Ut, { size: 48, strokeWidth: 1.5 }), title: o, description: s }), e[0] = s, e[1] = o, e[2] = n, e[3] = S, e[4] = P, e[5] = M, e[6] = v, e[7] = O, e[8] = F, e[9] = L, e[10] = R, e[11] = C, e[12] = z, e[13] = W;
1331
- } else
1332
- P = e[4], M = e[5], v = e[6], O = e[7], F = e[8], L = e[9], R = e[10], C = e[11], z = e[12], W = e[13];
1333
- let $;
1334
- e[14] !== P || e[15] !== O ? ($ = /* @__PURE__ */ i(P, { children: O }), e[14] = P, e[15] = O, e[16] = $) : $ = e[16];
1310
+ emptyStateContent: l,
1311
+ loadingContent: c,
1312
+ chatInputPlaceholder: a,
1313
+ chatInputDefaultValue: d,
1314
+ onSubmitMessage: u,
1315
+ onChatInputChange: f,
1316
+ actions: p,
1317
+ repoMenu: m,
1318
+ attachedResources: g,
1319
+ onClearAttachments: h,
1320
+ attachmentList: T,
1321
+ approvalPrompt: D,
1322
+ workspaceHub: w
1323
+ } = t, I = o === void 0 ? !1 : o, z = d === void 0 ? "" : d, q = Vo(n), de = q.length > 0, ge = q.reduce(Go, 0), {
1324
+ groups: ue,
1325
+ leadingResponses: be
1326
+ } = qo(q), [G, $] = oe(Ko), fe = I ? c ?? l : l, N = !!w;
1335
1327
  let E;
1336
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ i(ve.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[17] = E) : E = e[17];
1337
- let I;
1338
- e[18] !== M || e[19] !== F || e[20] !== $ ? (I = /* @__PURE__ */ x(M, { children: [
1339
- F,
1340
- $,
1341
- E
1342
- ] }), e[18] = M, e[19] = F, e[20] = $, e[21] = I) : I = e[21];
1328
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = (S) => {
1329
+ $((P) => {
1330
+ const C = new Set(P);
1331
+ return C.has(S) ? C.delete(S) : C.add(S), C;
1332
+ });
1333
+ }, e[0] = E) : E = e[0];
1334
+ const U = E, F = He, L = de ? /* @__PURE__ */ b(he, { gap: "sm", children: [
1335
+ be.map((S) => nt(S, I)),
1336
+ ue.map((S) => {
1337
+ const P = vn(S.userMessage), C = G.has(S.userMessage.id);
1338
+ return /* @__PURE__ */ b(k, { children: [
1339
+ /* @__PURE__ */ b(k, { position: "sticky", top: "0", zIndex: 1, children: [
1340
+ /* @__PURE__ */ b(k, { position: "relative", children: [
1341
+ /* @__PURE__ */ i(j.Root, { from: "user", children: /* @__PURE__ */ i(j.Content, { from: "user", maxH: P && !C ? Rn : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(Tt, { message: S.userMessage, streaming: I }) }) }),
1342
+ P && !C && /* @__PURE__ */ i(V, { 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", children: /* @__PURE__ */ i(me, { size: "2xs", variant: "solid", onClick: () => U(S.userMessage.id), children: "Show more" }) })
1343
+ ] }),
1344
+ P && C && /* @__PURE__ */ i(V, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(me, { size: "2xs", variant: "ghost", onClick: () => U(S.userMessage.id), children: "Show less" }) })
1345
+ ] }),
1346
+ S.responses.map((Y) => nt(Y, I))
1347
+ ] }, S.userMessage.id);
1348
+ })
1349
+ ] }) : fe ?? /* @__PURE__ */ i(sn, { icon: /* @__PURE__ */ i(Zt, { size: 48, strokeWidth: 1.5 }), title: r, description: s });
1350
+ let v;
1351
+ e[1] !== F.Viewport || e[2] !== L ? (v = /* @__PURE__ */ i(F.Viewport, { children: L }), e[1] = F.Viewport, e[2] = L, e[3] = v) : v = e[3];
1343
1352
  let B;
1344
- e[22] !== T ? (B = bn(T), e[22] = T, e[23] = B) : B = e[23];
1345
- let D;
1346
- e[24] !== u || e[25] !== p || e[26] !== h || e[27] !== l || e[28] !== a || e[29] !== m || e[30] !== d || e[31] !== S || e[32] !== B ? (D = /* @__PURE__ */ i(k, { px: "sm", children: /* @__PURE__ */ i(pn, { placeholder: l, defaultState: B, streaming: S, onSubmit: d, onChange: a, actions: u, attachedResources: p, onClearAttachments: m, attachmentList: h }) }), e[24] = u, e[25] = p, e[26] = h, e[27] = l, e[28] = a, e[29] = m, e[30] = d, e[31] = S, e[32] = B, e[33] = D) : D = e[33];
1347
- let A;
1348
- e[34] !== f ? (A = /* @__PURE__ */ i(be, { p: "2xs", justifyContent: "flex-end", children: f }), e[34] = f, e[35] = A) : A = e[35];
1349
- let V;
1350
- return e[36] !== v || e[37] !== b || e[38] !== I || e[39] !== D || e[40] !== A || e[41] !== L || e[42] !== R || e[43] !== C || e[44] !== z || e[45] !== W ? (V = /* @__PURE__ */ x(v, { position: L, direction: R, w: C, h: z, overflow: W, children: [
1351
- I,
1352
- b,
1353
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ i(He.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = B) : B = e[4];
1354
+ const K = N ? "0" : "xs";
1355
+ let R;
1356
+ e[5] !== z ? (R = _n(z), e[5] = z, e[6] = R) : R = e[6];
1357
+ let O;
1358
+ e[7] !== p || e[8] !== g || e[9] !== T || e[10] !== a || e[11] !== N || e[12] !== f || e[13] !== h || e[14] !== u || e[15] !== I || e[16] !== R ? (O = /* @__PURE__ */ i(kn, { placeholder: a, defaultState: R, streaming: I, onSubmit: u, onChange: f, actions: p, attachedResources: g, onClearAttachments: h, attachmentList: T, attachedToTop: N }), e[7] = p, e[8] = g, e[9] = T, e[10] = a, e[11] = N, e[12] = f, e[13] = h, e[14] = u, e[15] = I, e[16] = R, e[17] = O) : O = e[17];
1359
+ let M;
1360
+ e[18] !== K || e[19] !== O || e[20] !== w ? (M = /* @__PURE__ */ b(he, { px: "sm", gap: K, children: [
1361
+ w,
1362
+ O
1363
+ ] }), e[18] = K, e[19] = O, e[20] = w, e[21] = M) : M = e[21];
1364
+ let H;
1365
+ return e[22] !== m ? (H = /* @__PURE__ */ i(V, { p: "2xs", justifyContent: "flex-end", children: m }), e[22] = m, e[23] = H) : H = e[23], /* @__PURE__ */ b(V, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
1366
+ /* @__PURE__ */ b(He.Root, { children: [
1367
+ /* @__PURE__ */ i(yn, { userMessageCount: ge }),
1368
+ v,
1369
+ B
1370
+ ] }),
1353
1371
  D,
1354
- A
1355
- ] }), e[36] = v, e[37] = b, e[38] = I, e[39] = D, e[40] = A, e[41] = L, e[42] = R, e[43] = C, e[44] = z, e[45] = W, e[46] = V) : V = e[46], V;
1372
+ M,
1373
+ H
1374
+ ] });
1356
1375
  };
1357
- function $r(t, e) {
1376
+ function Go(t, e) {
1358
1377
  return t + (e.role === "user" ? 1 : 0);
1359
1378
  }
1379
+ function Ko() {
1380
+ return /* @__PURE__ */ new Set();
1381
+ }
1382
+ const ot = (t) => /* @__PURE__ */ i(he, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ i(Dt, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), vr = () => {
1383
+ const t = y(2);
1384
+ let e;
1385
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ i(j.Root, { from: "user", children: /* @__PURE__ */ i(j.Content, { from: "user", children: ot(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
1386
+ let n;
1387
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ b(he, { minH: "full", py: "xs", gap: "0", children: [
1388
+ e,
1389
+ /* @__PURE__ */ i(j.Root, { from: "assistant", children: /* @__PURE__ */ i(j.Content, { from: "assistant", children: ot(["76%", "62%", "40%"]) }) })
1390
+ ] }), t[1] = n) : n = t[1], n;
1391
+ }, Br = (t) => {
1392
+ const e = y(8), {
1393
+ changesLabel: n,
1394
+ additions: o,
1395
+ deletions: r,
1396
+ action: s
1397
+ } = t;
1398
+ let l;
1399
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1400
+ background: "transparent"
1401
+ }, e[0] = l) : l = e[0];
1402
+ let c;
1403
+ e[1] !== o || e[2] !== n || e[3] !== r ? (c = /* @__PURE__ */ i(dt, { label: n, additions: o, deletions: r, variant: "ghost", size: "small", _hover: l }), e[1] = o, e[2] = n, e[3] = r, e[4] = c) : c = e[4];
1404
+ let a;
1405
+ return e[5] !== s || e[6] !== c ? (a = /* @__PURE__ */ b(V, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "xs", borderBottomRadius: "0", bg: "bg.subtle", children: [
1406
+ c,
1407
+ s
1408
+ ] }), e[5] = s, e[6] = c, e[7] = a) : a = e[7], a;
1409
+ };
1360
1410
  export {
1361
- ho as ApprovalPrompt,
1362
- un as AutoScroll,
1363
- pn as ChatInput,
1364
- Ve as ChatMessage,
1365
- go as ChatPanel,
1366
- ve as ChatPrimitives,
1367
- fn as SendButton,
1368
- bn as createSerializedPromptState
1411
+ Rr as ApprovalPrompt,
1412
+ yn as AutoScroll,
1413
+ kn as ChatInput,
1414
+ j as ChatMessage,
1415
+ Ir as ChatPanel,
1416
+ He as ChatPrimitives,
1417
+ vr as ChatSkeleton,
1418
+ Br as ChatWorkspaceHub,
1419
+ Sn as SendButton,
1420
+ _n as createSerializedPromptState
1369
1421
  };
1370
1422
  //# sourceMappingURL=chat-ui.js.map