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