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