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