@pstdio/ui 0.25.0 → 0.26.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/README.md +8 -1
- package/dist/{MermaidComponent-BVdDqDRU.js → MermaidComponent-X__B6qib.js} +3 -3
- package/dist/{MermaidComponent-BVdDqDRU.js.map → MermaidComponent-X__B6qib.js.map} +1 -1
- package/dist/activity-timeline-BynMjXSB.js +283 -0
- package/dist/activity-timeline-BynMjXSB.js.map +1 -0
- package/dist/alert-ubcrW24X.js +33 -0
- package/dist/alert-ubcrW24X.js.map +1 -0
- package/dist/browser-storage-BinyFNJX.js +40 -0
- package/dist/browser-storage-BinyFNJX.js.map +1 -0
- package/dist/chat-ui.js +1515 -1429
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/activity/index.d.ts +1 -3
- package/dist/components/chat-ui/components/chat-history-story.d.ts +14 -0
- package/dist/components/chat-ui/components/chat-input-history.d.ts +6 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +2 -0
- package/dist/components/chat-ui/components/chat-panel-composer.d.ts +49 -0
- package/dist/components/chat-ui/components/use-chat-input-history.d.ts +16 -0
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
- package/dist/components/diff-viewer/code-editor.d.ts +2 -0
- package/dist/components/rich-text/index.d.ts +2 -0
- package/dist/components/rich-text/markdown-editor/markdown-editor-scrolling.play.d.ts +4 -0
- package/dist/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.d.ts +3 -1
- package/dist/components/rich-text/prompt-input/plugins/keyboard-shortcuts.d.ts +2 -0
- package/dist/components/rich-text/prompt-input/prompt-input.d.ts +2 -0
- package/dist/components/{activity → rich-text/resource-activity-feed}/resource-activity-feed.d.ts +1 -1
- package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/should-show-floating-toolbar.d.ts +1 -0
- package/dist/data-table.js +6 -6
- package/dist/diff.js +524 -522
- package/dist/diff.js.map +1 -1
- package/dist/{edit-mode-data-table-B8UpWb7i.js → edit-mode-data-table-Nfmfi7bz.js} +23 -22
- package/dist/{edit-mode-data-table-B8UpWb7i.js.map → edit-mode-data-table-Nfmfi7bz.js.map} +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1766 -2232
- package/dist/index.js.map +1 -1
- package/dist/{kanban-renderer-toolbar-DzY6THJY.js → kanban-renderer-toolbar-Buek4icz.js} +34 -33
- package/dist/{kanban-renderer-toolbar-DzY6THJY.js.map → kanban-renderer-toolbar-Buek4icz.js.map} +1 -1
- package/dist/kanban-renderer.js +31 -30
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/lazy-markdown-editor-PzIBc9-l.js +42 -0
- package/dist/lazy-markdown-editor-PzIBc9-l.js.map +1 -0
- package/dist/{list-row-BDoV_iMV.js → list-row-DHzRa9-O.js} +2 -2
- package/dist/{list-row-BDoV_iMV.js.map → list-row-DHzRa9-O.js.map} +1 -1
- package/dist/{markdown-gNucAjnF.js → markdown-BCfPxNpb.js} +323 -303
- package/dist/markdown-BCfPxNpb.js.map +1 -0
- package/dist/markdown-editor-CsJ4KNGu.js +1034 -0
- package/dist/markdown-editor-CsJ4KNGu.js.map +1 -0
- package/dist/{mermaid-renderer-CVnuKs-A.js → mermaid-renderer-D0YP0FmJ.js} +3 -3
- package/dist/{mermaid-renderer-CVnuKs-A.js.map → mermaid-renderer-D0YP0FmJ.js.map} +1 -1
- package/dist/mermaid.js +1 -1
- package/dist/{param-editor-CTx3mDxQ.js → param-editor-CFM2Nf3l.js} +2 -2
- package/dist/{param-editor-CTx3mDxQ.js.map → param-editor-CFM2Nf3l.js.map} +1 -1
- package/dist/param-editor-field-Bj-AGUY6.js +1728 -0
- package/dist/param-editor-field-Bj-AGUY6.js.map +1 -0
- package/dist/param-editor.d.ts +2 -0
- package/dist/param-editor.js +47 -0
- package/dist/param-editor.js.map +1 -0
- package/dist/prism-n5gcERyD.js +202 -0
- package/dist/prism-n5gcERyD.js.map +1 -0
- package/dist/radio-BfjibByI.js +51 -0
- package/dist/radio-BfjibByI.js.map +1 -0
- package/dist/rich-message-q6Y6QJOq.js +633 -0
- package/dist/rich-message-q6Y6QJOq.js.map +1 -0
- package/dist/rich-text.js +342 -178
- package/dist/rich-text.js.map +1 -1
- package/dist/scroll-area-BMbg1WcD.js +91 -0
- package/dist/scroll-area-BMbg1WcD.js.map +1 -0
- package/dist/slider-DBHjdxsU.js +1092 -0
- package/dist/slider-DBHjdxsU.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/terminal.js +96 -93
- package/dist/terminal.js.map +1 -1
- package/dist/theme/recipes/timeline.d.ts +9 -0
- package/dist/{theme-Dc7hVvMC.js → theme-AzJH4Om3.js} +10 -1
- package/dist/theme-AzJH4Om3.js.map +1 -0
- package/dist/{theme-preference-Bpobguh4.js → theme-preference-DxGW1qg-.js} +2 -2
- package/dist/{theme-preference-Bpobguh4.js.map → theme-preference-DxGW1qg-.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{tree-list-CZvcg3_6.js → tree-list-CPjbGTvs.js} +2 -2
- package/dist/{tree-list-CZvcg3_6.js.map → tree-list-CPjbGTvs.js.map} +1 -1
- package/dist/{workspace-badge-BR_GgsAG.js → workspace-badge-CuOcmnZc.js} +2 -2
- package/dist/{workspace-badge-BR_GgsAG.js.map → workspace-badge-CuOcmnZc.js.map} +1 -1
- package/package.json +7 -2
- package/dist/browser-storage-DPtOQJx0.js +0 -127
- package/dist/browser-storage-DPtOQJx0.js.map +0 -1
- package/dist/lazy-markdown-editor-ClZPZuaU.js +0 -235
- package/dist/lazy-markdown-editor-ClZPZuaU.js.map +0 -1
- package/dist/markdown-editor-CAVqJ9yR.js +0 -1019
- package/dist/markdown-editor-CAVqJ9yR.js.map +0 -1
- package/dist/markdown-gNucAjnF.js.map +0 -1
- package/dist/param-editor-field-DteDEyeU.js +0 -2810
- package/dist/param-editor-field-DteDEyeU.js.map +0 -1
- package/dist/prompt-input-DNpRL5tI.js +0 -564
- package/dist/prompt-input-DNpRL5tI.js.map +0 -1
- package/dist/radio-cLMEBBZk.js +0 -76
- package/dist/radio-cLMEBBZk.js.map +0 -1
- package/dist/rich-message-CuPiKxKX.js +0 -78
- package/dist/rich-message-CuPiKxKX.js.map +0 -1
- package/dist/theme-Dc7hVvMC.js.map +0 -1
package/dist/chat-ui.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { AbsoluteCenter as
|
|
4
|
-
import { ArrowDownIcon as
|
|
5
|
-
import { useStickToBottomContext as
|
|
6
|
-
import { S as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { R as
|
|
9
|
-
import { a as
|
|
10
|
-
import { R as
|
|
11
|
-
import { E as
|
|
12
|
-
import { useVirtualizer as
|
|
13
|
-
import {
|
|
14
|
-
import { a as
|
|
15
|
-
const
|
|
1
|
+
import { jsx as u, jsxs as k, Fragment as It } from "react/jsx-runtime";
|
|
2
|
+
import { c as C } from "react/compiler-runtime";
|
|
3
|
+
import { AbsoluteCenter as Wn, IconButton as Pe, chakra as Jt, createSlotRecipeContext as Hn, defineSlotRecipe as Nn, Text as U, Code as Lt, Button as Qe, HStack as oe, Box as D, Flex as ye, Stack as X, Textarea as Vn, Tooltip as Je, Portal as Zt, Kbd as Un, Spacer as jn, Link as en, Span as ze, Avatar as Ee, Timeline as Kn, Image as tn, Card as se, Spinner as _t, Badge as Xn, Icon as mt, Skeleton as Gn } from "@chakra-ui/react";
|
|
4
|
+
import { ArrowDownIcon as Yn, ShieldX as Jn, ShieldCheck as Zn, Check as nn, Pause as es, ArrowUp as ts, Copy as ns, Move as ss, FileDown as os, FileUp as rs, FileDiff as is, Trash2 as sn, FilePen as ls, FileText as as, ListTree as cs, Terminal as on, ListTodo as us, CircleQuestionMark as ds, File as fs, Globe as ps, Search as ms, AlertTriangle as rn, DotIcon as hs, ChevronUpIcon as gs, GripVertical as bs, Pencil as ys, MessageCircleIcon as xs } from "lucide-react";
|
|
5
|
+
import { useStickToBottomContext as et, StickToBottom as Ss } from "use-stick-to-bottom";
|
|
6
|
+
import { S as tt, T as vt } from "./scroll-area-BMbg1WcD.js";
|
|
7
|
+
import { Fragment as ws, useRef as J, useEffect as Z, useState as W } from "react";
|
|
8
|
+
import { R as Mt, C as ln } from "./prism-n5gcERyD.js";
|
|
9
|
+
import { a as ht, P as Ts, R as an, g as As } from "./rich-message-q6Y6QJOq.js";
|
|
10
|
+
import { R as Cs, a as ks } from "./radio-BfjibByI.js";
|
|
11
|
+
import { E as Is } from "./empty-state-Bo4HVrgr.js";
|
|
12
|
+
import { useVirtualizer as _s } from "@tanstack/react-virtual";
|
|
13
|
+
import { A as $t } from "./alert-ubcrW24X.js";
|
|
14
|
+
import { a as vs, D as Ms } from "./diff-bubble-DvUPRnfB.js";
|
|
15
|
+
const Rs = {
|
|
16
16
|
"aria-roledescription": "conversation",
|
|
17
17
|
initial: "instant",
|
|
18
18
|
resize: "instant",
|
|
19
19
|
role: "log"
|
|
20
|
-
},
|
|
20
|
+
}, Ps = Jt(Ss, {
|
|
21
21
|
base: {
|
|
22
22
|
position: "relative",
|
|
23
23
|
flex: 1,
|
|
@@ -26,44 +26,44 @@ const _s = {
|
|
|
26
26
|
}
|
|
27
27
|
}, {
|
|
28
28
|
forwardProps: ["initial", "resize"],
|
|
29
|
-
defaultProps:
|
|
30
|
-
}),
|
|
31
|
-
const e =
|
|
32
|
-
let n,
|
|
29
|
+
defaultProps: Rs
|
|
30
|
+
}), Es = (t) => {
|
|
31
|
+
const e = C(10);
|
|
32
|
+
let n, o;
|
|
33
33
|
e[0] !== t ? ({
|
|
34
34
|
children: n,
|
|
35
|
-
...
|
|
36
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
35
|
+
...o
|
|
36
|
+
} = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
|
|
37
37
|
const {
|
|
38
|
-
contentRef:
|
|
38
|
+
contentRef: s,
|
|
39
39
|
scrollRef: r
|
|
40
|
-
} =
|
|
41
|
-
let a,
|
|
40
|
+
} = et(), i = r, l = s;
|
|
41
|
+
let a, c;
|
|
42
42
|
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
43
43
|
zIndex: 2
|
|
44
|
-
},
|
|
44
|
+
}, c = {
|
|
45
45
|
py: "sm",
|
|
46
46
|
"aria-live": "polite",
|
|
47
47
|
role: "list"
|
|
48
|
-
}, e[3] = a, e[4] =
|
|
48
|
+
}, e[3] = a, e[4] = c) : (a = e[3], c = e[4]);
|
|
49
49
|
let d;
|
|
50
|
-
return e[5] !== n || e[6] !==
|
|
51
|
-
},
|
|
50
|
+
return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ u(tt, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: c, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
|
|
51
|
+
}, Ds = {
|
|
52
52
|
axis: "horizontal",
|
|
53
53
|
bottom: "md",
|
|
54
54
|
zIndex: 2
|
|
55
|
-
},
|
|
56
|
-
const e =
|
|
55
|
+
}, Bs = (t) => {
|
|
56
|
+
const e = C(4), {
|
|
57
57
|
isAtBottom: n,
|
|
58
|
-
scrollToBottom:
|
|
59
|
-
} =
|
|
60
|
-
let
|
|
61
|
-
return e[0] !== n || e[1] !== t || e[2] !==
|
|
62
|
-
},
|
|
63
|
-
Root:
|
|
64
|
-
Viewport:
|
|
65
|
-
ScrollToBottom:
|
|
66
|
-
},
|
|
58
|
+
scrollToBottom: o
|
|
59
|
+
} = et();
|
|
60
|
+
let s;
|
|
61
|
+
return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ u(Wn, { ...Ds, children: /* @__PURE__ */ u(Pe, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ u(Yn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
|
|
62
|
+
}, gt = {
|
|
63
|
+
Root: Ps,
|
|
64
|
+
Viewport: Es,
|
|
65
|
+
ScrollToBottom: Bs
|
|
66
|
+
}, Fs = Nn({
|
|
67
67
|
className: "ai-message",
|
|
68
68
|
slots: ["root", "content"],
|
|
69
69
|
base: {
|
|
@@ -170,102 +170,102 @@ const _s = {
|
|
|
170
170
|
shape: "rounded"
|
|
171
171
|
}
|
|
172
172
|
}), {
|
|
173
|
-
withProvider:
|
|
174
|
-
withContext:
|
|
175
|
-
} =
|
|
176
|
-
recipe:
|
|
177
|
-
}),
|
|
178
|
-
Root:
|
|
179
|
-
Content:
|
|
180
|
-
},
|
|
173
|
+
withProvider: Ls,
|
|
174
|
+
withContext: $s
|
|
175
|
+
} = Hn({
|
|
176
|
+
recipe: Fs
|
|
177
|
+
}), Os = Ls("div", "root"), zs = $s("div", "content"), be = {
|
|
178
|
+
Root: Os,
|
|
179
|
+
Content: zs
|
|
180
|
+
}, Qs = (t) => {
|
|
181
181
|
if (t == null) return null;
|
|
182
182
|
const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
183
183
|
return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
|
|
184
|
-
},
|
|
185
|
-
const e =
|
|
184
|
+
}, kl = (t) => {
|
|
185
|
+
const e = C(19), {
|
|
186
186
|
toolName: n,
|
|
187
|
-
toolInput:
|
|
188
|
-
onApprove:
|
|
187
|
+
toolInput: o,
|
|
188
|
+
onApprove: s,
|
|
189
189
|
onDeny: r
|
|
190
190
|
} = t;
|
|
191
191
|
let i;
|
|
192
|
-
e[0] !==
|
|
192
|
+
e[0] !== o ? (i = Qs(o), e[0] = o, e[1] = i) : i = e[1];
|
|
193
193
|
const l = i;
|
|
194
194
|
let a;
|
|
195
195
|
e[2] !== n ? (a = /* @__PURE__ */ k(U, { textStyle: "label/S/medium", color: "fg", children: [
|
|
196
196
|
"Allow ",
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ u(Lt, { size: "sm", children: n }),
|
|
198
198
|
"?"
|
|
199
199
|
] }), e[2] = n, e[3] = a) : a = e[3];
|
|
200
|
-
let
|
|
201
|
-
e[4] !== l ? (
|
|
200
|
+
let c;
|
|
201
|
+
e[4] !== l ? (c = l ? /* @__PURE__ */ u(tt, { maxH: "6rem", children: /* @__PURE__ */ u(Lt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = c) : c = e[5];
|
|
202
202
|
let d;
|
|
203
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */
|
|
203
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(Jn, { size: 14 }), e[6] = d) : d = e[6];
|
|
204
204
|
let f;
|
|
205
|
-
e[7] !== r ? (f = /* @__PURE__ */ k(
|
|
205
|
+
e[7] !== r ? (f = /* @__PURE__ */ k(Qe, { size: "xs", variant: "outline", onClick: r, children: [
|
|
206
206
|
d,
|
|
207
207
|
"Deny"
|
|
208
208
|
] }), e[7] = r, e[8] = f) : f = e[8];
|
|
209
|
-
let p;
|
|
210
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ c(Gn, { size: 14 }), e[9] = p) : p = e[9];
|
|
211
209
|
let m;
|
|
212
|
-
e[
|
|
213
|
-
|
|
210
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ u(Zn, { size: 14 }), e[9] = m) : m = e[9];
|
|
211
|
+
let p;
|
|
212
|
+
e[10] !== s ? (p = /* @__PURE__ */ k(Qe, { size: "xs", colorPalette: "green", onClick: s, children: [
|
|
213
|
+
m,
|
|
214
214
|
"Allow"
|
|
215
|
-
] }), e[10] =
|
|
215
|
+
] }), e[10] = s, e[11] = p) : p = e[11];
|
|
216
216
|
let h;
|
|
217
|
-
e[12] !== f || e[13] !==
|
|
217
|
+
e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(oe, { gap: "xs", justifyContent: "flex-end", children: [
|
|
218
218
|
f,
|
|
219
|
-
|
|
220
|
-
] }), e[12] = f, e[13] =
|
|
219
|
+
p
|
|
220
|
+
] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
|
|
221
221
|
let g;
|
|
222
|
-
return e[15] !== a || e[16] !==
|
|
222
|
+
return e[15] !== a || e[16] !== c || e[17] !== h ? (g = /* @__PURE__ */ u(D, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(ye, { direction: "column", gap: "xs", children: [
|
|
223
223
|
a,
|
|
224
|
-
|
|
224
|
+
c,
|
|
225
225
|
h
|
|
226
|
-
] }) }), e[15] = a, e[16] =
|
|
227
|
-
},
|
|
228
|
-
const e =
|
|
226
|
+
] }) }), e[15] = a, e[16] = c, e[17] = h, e[18] = g) : g = e[18], g;
|
|
227
|
+
}, qs = "md", Ws = "neutral", Il = (t) => {
|
|
228
|
+
const e = C(17), {
|
|
229
229
|
attachments: n,
|
|
230
|
-
onSelect:
|
|
231
|
-
onRemove:
|
|
230
|
+
onSelect: o,
|
|
231
|
+
onRemove: s,
|
|
232
232
|
renderBadge: r,
|
|
233
233
|
size: i,
|
|
234
234
|
tone: l
|
|
235
235
|
} = t;
|
|
236
236
|
let a;
|
|
237
237
|
e[0] !== n ? (a = n === void 0 ? [] : n, e[0] = n, e[1] = a) : a = e[1];
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
238
|
+
const c = a, d = i === void 0 ? qs : i, f = l === void 0 ? Ws : l;
|
|
239
|
+
if (c.length === 0)
|
|
240
240
|
return null;
|
|
241
|
-
let
|
|
242
|
-
if (e[2] !==
|
|
241
|
+
let m;
|
|
242
|
+
if (e[2] !== c || e[3] !== s || e[4] !== o || e[5] !== r || e[6] !== d || e[7] !== f) {
|
|
243
243
|
let h;
|
|
244
|
-
e[9] !==
|
|
245
|
-
const b =
|
|
244
|
+
e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
|
|
245
|
+
const b = o ? () => o(g) : void 0, y = s ? () => s(g) : void 0;
|
|
246
246
|
if (r) {
|
|
247
|
-
const
|
|
247
|
+
const x = r({
|
|
248
248
|
attachmentId: g,
|
|
249
249
|
onSelect: b,
|
|
250
|
-
onRemove:
|
|
250
|
+
onRemove: y,
|
|
251
251
|
size: d,
|
|
252
252
|
tone: f
|
|
253
253
|
});
|
|
254
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ u(ws, { children: x }, g);
|
|
255
255
|
}
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
}, e[9] =
|
|
256
|
+
return /* @__PURE__ */ u(Mt, { fileName: g, onSelect: b, onRemove: y, size: d, tone: f }, g);
|
|
257
|
+
}, e[9] = s, e[10] = o, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = c.map(h), e[2] = c, e[3] = s, e[4] = o, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
|
|
258
258
|
} else
|
|
259
|
-
|
|
260
|
-
let
|
|
261
|
-
return e[15] !==
|
|
262
|
-
},
|
|
259
|
+
m = e[8];
|
|
260
|
+
let p;
|
|
261
|
+
return e[15] !== m ? (p = /* @__PURE__ */ u(X, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
|
|
262
|
+
}, Hs = (t) => {
|
|
263
263
|
const {
|
|
264
264
|
previousUserMessageCount: e,
|
|
265
265
|
userMessageCount: n
|
|
266
266
|
} = t;
|
|
267
267
|
return e === 0 ? !1 : n > e;
|
|
268
|
-
},
|
|
268
|
+
}, Ns = (t) => {
|
|
269
269
|
const e = t.conversationKey ?? null;
|
|
270
270
|
return t.state.conversationKey !== e ? {
|
|
271
271
|
shouldScroll: !1,
|
|
@@ -274,7 +274,7 @@ const _s = {
|
|
|
274
274
|
userMessageCount: t.userMessageCount
|
|
275
275
|
}
|
|
276
276
|
} : {
|
|
277
|
-
shouldScroll:
|
|
277
|
+
shouldScroll: Hs({
|
|
278
278
|
previousUserMessageCount: t.state.userMessageCount,
|
|
279
279
|
userMessageCount: t.userMessageCount
|
|
280
280
|
}),
|
|
@@ -283,56 +283,56 @@ const _s = {
|
|
|
283
283
|
userMessageCount: Math.max(t.state.userMessageCount, t.userMessageCount)
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
|
-
},
|
|
287
|
-
const e =
|
|
286
|
+
}, Vs = (t) => {
|
|
287
|
+
const e = Ns(t);
|
|
288
288
|
return e.shouldScroll && t.scrollToBottom("instant"), e;
|
|
289
289
|
};
|
|
290
|
-
function
|
|
291
|
-
const e =
|
|
290
|
+
function Us(t) {
|
|
291
|
+
const e = C(8), {
|
|
292
292
|
conversationKey: n,
|
|
293
|
-
userMessageCount:
|
|
293
|
+
userMessageCount: o
|
|
294
294
|
} = t, {
|
|
295
|
-
scrollToBottom:
|
|
296
|
-
} =
|
|
295
|
+
scrollToBottom: s
|
|
296
|
+
} = et(), r = n ?? null;
|
|
297
297
|
let i;
|
|
298
|
-
e[0] !== r || e[1] !==
|
|
298
|
+
e[0] !== r || e[1] !== o ? (i = {
|
|
299
299
|
conversationKey: r,
|
|
300
|
-
userMessageCount:
|
|
301
|
-
}, e[0] = r, e[1] =
|
|
302
|
-
const l =
|
|
303
|
-
let a,
|
|
304
|
-
return e[3] !== n || e[4] !==
|
|
305
|
-
const d =
|
|
300
|
+
userMessageCount: o
|
|
301
|
+
}, e[0] = r, e[1] = o, e[2] = i) : i = e[2];
|
|
302
|
+
const l = J(i);
|
|
303
|
+
let a, c;
|
|
304
|
+
return e[3] !== n || e[4] !== s || e[5] !== o ? (a = () => {
|
|
305
|
+
const d = Vs({
|
|
306
306
|
state: l.current,
|
|
307
307
|
conversationKey: n,
|
|
308
|
-
userMessageCount:
|
|
309
|
-
scrollToBottom:
|
|
308
|
+
userMessageCount: o,
|
|
309
|
+
scrollToBottom: s
|
|
310
310
|
});
|
|
311
311
|
l.current = d.state;
|
|
312
|
-
},
|
|
312
|
+
}, c = [n, o, s], e[3] = n, e[4] = s, e[5] = o, e[6] = a, e[7] = c) : (a = e[6], c = e[7]), Z(a, c), null;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const cn = (t) => t.trim().length > 0, js = (t) => {
|
|
315
315
|
const {
|
|
316
316
|
canSubmit: e,
|
|
317
317
|
isDisabled: n,
|
|
318
|
-
text:
|
|
318
|
+
text: o
|
|
319
319
|
} = t;
|
|
320
|
-
return n || !e || !
|
|
321
|
-
},
|
|
320
|
+
return n || !e || !cn(o) ? "none" : "submit";
|
|
321
|
+
}, Ks = (t) => {
|
|
322
322
|
const {
|
|
323
323
|
canInterrupt: e,
|
|
324
324
|
canSubmit: n,
|
|
325
|
-
hasQuestionPrompt:
|
|
326
|
-
isDisabled:
|
|
325
|
+
hasQuestionPrompt: o,
|
|
326
|
+
isDisabled: s,
|
|
327
327
|
streaming: r,
|
|
328
328
|
text: i
|
|
329
329
|
} = t;
|
|
330
|
-
return
|
|
331
|
-
},
|
|
330
|
+
return s ? "none" : n && cn(i) ? "submit" : r && !o && e ? "interrupt" : "none";
|
|
331
|
+
}, un = 200, Xs = (t, e = un) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Gs = (t) => {
|
|
332
332
|
const {
|
|
333
333
|
onAttachFiles: e,
|
|
334
334
|
onAttachText: n,
|
|
335
|
-
textAttachmentPasteLineThreshold:
|
|
335
|
+
textAttachmentPasteLineThreshold: o
|
|
336
336
|
} = t;
|
|
337
337
|
return {
|
|
338
338
|
onDragOver: (l) => {
|
|
@@ -348,467 +348,547 @@ const ln = (t) => t.trim().length > 0, Vs = (t) => {
|
|
|
348
348
|
l.preventDefault(), e(a);
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
const
|
|
352
|
-
n &&
|
|
351
|
+
const c = l.clipboardData.getData("text/plain");
|
|
352
|
+
n && Xs(c, o) && (l.preventDefault(), n(c));
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
},
|
|
355
|
+
}, Ys = (t) => {
|
|
356
356
|
t.preventDefault();
|
|
357
|
-
},
|
|
358
|
-
const e =
|
|
357
|
+
}, dn = (t) => {
|
|
358
|
+
const e = C(7), {
|
|
359
359
|
option: n
|
|
360
360
|
} = t;
|
|
361
|
-
let s;
|
|
362
|
-
e[0] !== n.label ? (s = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
|
|
363
361
|
let o;
|
|
364
|
-
e[
|
|
362
|
+
e[0] !== n.label ? (o = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
|
|
363
|
+
let s;
|
|
364
|
+
e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
|
|
365
365
|
let r;
|
|
366
|
-
return e[4] !==
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
] }), e[4] =
|
|
370
|
-
},
|
|
371
|
-
const e =
|
|
366
|
+
return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ k(X, { gap: "0", minWidth: "0", children: [
|
|
367
|
+
o,
|
|
368
|
+
s
|
|
369
|
+
] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
|
|
370
|
+
}, Js = (t) => {
|
|
371
|
+
const e = C(12), {
|
|
372
372
|
option: n,
|
|
373
|
-
name:
|
|
374
|
-
checked:
|
|
373
|
+
name: o,
|
|
374
|
+
checked: s,
|
|
375
375
|
editable: r,
|
|
376
376
|
onToggle: i
|
|
377
377
|
} = t, l = !r, a = r ? void 0 : "true";
|
|
378
|
-
let
|
|
379
|
-
e[0] !== r ? (
|
|
378
|
+
let c;
|
|
379
|
+
e[0] !== r ? (c = r ? void 0 : {
|
|
380
380
|
tabIndex: -1
|
|
381
|
-
}, e[0] = r, e[1] =
|
|
381
|
+
}, e[0] = r, e[1] = c) : c = e[1];
|
|
382
382
|
const d = r ? i : void 0;
|
|
383
383
|
let f;
|
|
384
|
-
e[2] !== n ? (f = /* @__PURE__ */
|
|
385
|
-
let
|
|
386
|
-
return e[4] !==
|
|
387
|
-
},
|
|
388
|
-
const e =
|
|
384
|
+
e[2] !== n ? (f = /* @__PURE__ */ u(dn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
|
|
385
|
+
let m;
|
|
386
|
+
return e[4] !== s || e[5] !== o || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ u(ln, { name: o, checked: s, readOnly: l, "aria-readonly": a, inputProps: c, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = s, e[5] = o, e[6] = l, e[7] = a, e[8] = c, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
|
|
387
|
+
}, Zs = (t) => {
|
|
388
|
+
const e = C(17), {
|
|
389
389
|
question: n,
|
|
390
|
-
questionIndex:
|
|
391
|
-
name:
|
|
390
|
+
questionIndex: o,
|
|
391
|
+
name: s,
|
|
392
392
|
selectedOption: r,
|
|
393
393
|
editable: i,
|
|
394
394
|
onToggleOption: l
|
|
395
|
-
} = t, a = r ?? null,
|
|
395
|
+
} = t, a = r ?? null, c = !i, d = i ? void 0 : "true";
|
|
396
396
|
let f;
|
|
397
|
-
e[0] !== i || e[1] !== l || e[2] !== n || e[3] !==
|
|
398
|
-
h.value && l?.(n,
|
|
399
|
-
} : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] =
|
|
400
|
-
let
|
|
397
|
+
e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== o ? (f = i ? (h) => {
|
|
398
|
+
h.value && l?.(n, o, h.value);
|
|
399
|
+
} : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = o, e[4] = f) : f = e[4];
|
|
400
|
+
let m;
|
|
401
401
|
if (e[5] !== i || e[6] !== n.options) {
|
|
402
402
|
let h;
|
|
403
|
-
e[8] !== i ? (h = (g) => /* @__PURE__ */
|
|
403
|
+
e[8] !== i ? (h = (g) => /* @__PURE__ */ u(Cs, { value: g.label, inputProps: i ? void 0 : {
|
|
404
404
|
tabIndex: -1
|
|
405
|
-
}, alignItems: "flex-start", children: /* @__PURE__ */
|
|
405
|
+
}, alignItems: "flex-start", children: /* @__PURE__ */ u(dn, { 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;
|
|
406
406
|
} else
|
|
407
|
-
|
|
408
|
-
let
|
|
409
|
-
return e[10] !==
|
|
410
|
-
},
|
|
411
|
-
const e =
|
|
407
|
+
m = e[7];
|
|
408
|
+
let p;
|
|
409
|
+
return e[10] !== s || e[11] !== a || e[12] !== c || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ u(ks, { name: s, value: a, readOnly: c, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = s, e[11] = a, e[12] = c, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
|
|
410
|
+
}, eo = (t) => {
|
|
411
|
+
const e = C(4), {
|
|
412
412
|
items: n
|
|
413
413
|
} = t;
|
|
414
|
-
let s;
|
|
415
|
-
e[0] !== n ? (s = n.map(Js), e[0] = n, e[1] = s) : s = e[1];
|
|
416
414
|
let o;
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
415
|
+
e[0] !== n ? (o = n.map(to), e[0] = n, e[1] = o) : o = e[1];
|
|
416
|
+
let s;
|
|
417
|
+
return e[2] !== o ? (s = /* @__PURE__ */ u(X, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
|
|
418
|
+
}, fn = (t) => {
|
|
419
|
+
const e = C(19), {
|
|
420
420
|
questions: n,
|
|
421
|
-
editable:
|
|
422
|
-
selectedOptionsByQuestion:
|
|
421
|
+
editable: o,
|
|
422
|
+
selectedOptionsByQuestion: s,
|
|
423
423
|
customAnswersByQuestion: r,
|
|
424
424
|
onToggleOption: i,
|
|
425
425
|
onCustomAnswerChange: l
|
|
426
|
-
} = t, a =
|
|
427
|
-
let
|
|
428
|
-
e[0] !==
|
|
429
|
-
const d =
|
|
426
|
+
} = t, a = o === void 0 ? !1 : o;
|
|
427
|
+
let c;
|
|
428
|
+
e[0] !== s ? (c = s === void 0 ? {} : s, e[0] = s, e[1] = c) : c = e[1];
|
|
429
|
+
const d = c;
|
|
430
430
|
let f;
|
|
431
431
|
e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
|
|
432
|
-
const
|
|
433
|
-
let
|
|
434
|
-
if (e[4] !==
|
|
432
|
+
const m = f;
|
|
433
|
+
let p;
|
|
434
|
+
if (e[4] !== m || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
|
|
435
435
|
let g;
|
|
436
|
-
e[11] !==
|
|
437
|
-
const
|
|
438
|
-
return /* @__PURE__ */ k(
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
441
|
-
b.allowCustomAnswer ? /* @__PURE__ */
|
|
442
|
-
] },
|
|
443
|
-
}, e[11] =
|
|
436
|
+
e[11] !== m || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, y) => {
|
|
437
|
+
const x = b.id ?? `question-${y}`, S = b.multiple ? "checkbox" : "radio", A = d[x] ?? [];
|
|
438
|
+
return /* @__PURE__ */ k(X, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
|
|
439
|
+
/* @__PURE__ */ u(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
|
|
440
|
+
S === "radio" ? /* @__PURE__ */ u(Zs, { question: b, questionIndex: y, name: x, selectedOption: A[0], editable: a, onToggleOption: i }) : b.options.map((T) => /* @__PURE__ */ u(Js, { option: T, name: x, checked: A.includes(T.label), editable: a, onToggle: () => i?.(b, y, T.label) }, T.label)),
|
|
441
|
+
b.allowCustomAnswer ? /* @__PURE__ */ u(Vn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: m[x] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (T) => l?.(b, y, T.currentTarget.value) }) : null
|
|
442
|
+
] }, x);
|
|
443
|
+
}, e[11] = m, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
|
|
444
444
|
} else
|
|
445
|
-
|
|
445
|
+
p = e[10];
|
|
446
446
|
let h;
|
|
447
|
-
return e[17] !==
|
|
447
|
+
return e[17] !== p ? (h = /* @__PURE__ */ u(X, { as: "form", gap: "sm", onSubmit: Ys, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
|
|
448
448
|
};
|
|
449
|
-
function
|
|
450
|
-
return /* @__PURE__ */
|
|
449
|
+
function to(t, e) {
|
|
450
|
+
return /* @__PURE__ */ u(D, { as: "li", children: /* @__PURE__ */ u(ln, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
|
|
451
451
|
tabIndex: -1
|
|
452
|
-
}, size: "xs", children: /* @__PURE__ */
|
|
452
|
+
}, size: "xs", children: /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
|
|
453
453
|
}
|
|
454
|
-
const
|
|
455
|
-
const
|
|
454
|
+
const de = (t, e) => t.id ?? `question-${e}`, no = (t, e, n, o) => {
|
|
455
|
+
const s = de(e, n), r = t[s] ?? [], i = r.includes(o);
|
|
456
456
|
return e.multiple ? {
|
|
457
457
|
...t,
|
|
458
|
-
[
|
|
458
|
+
[s]: i ? r.filter((l) => l !== o) : [...r, o]
|
|
459
459
|
} : {
|
|
460
460
|
...t,
|
|
461
|
-
[
|
|
461
|
+
[s]: i ? [] : [o]
|
|
462
462
|
};
|
|
463
|
-
},
|
|
464
|
-
id:
|
|
463
|
+
}, St = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
|
|
464
|
+
id: de(e, n),
|
|
465
465
|
question: e.question,
|
|
466
466
|
multiple: !!e.multiple,
|
|
467
467
|
required: !!e.required,
|
|
468
468
|
allowCustomAnswer: !!e.allowCustomAnswer,
|
|
469
|
-
options: e.options.map((
|
|
470
|
-
label:
|
|
471
|
-
description:
|
|
469
|
+
options: e.options.map((o) => ({
|
|
470
|
+
label: o.label,
|
|
471
|
+
description: o.description ?? ""
|
|
472
472
|
}))
|
|
473
|
-
}))) : "",
|
|
474
|
-
const
|
|
475
|
-
for (let
|
|
476
|
-
const r = t.questions[
|
|
477
|
-
|
|
473
|
+
}))) : "", so = (t, e, n) => {
|
|
474
|
+
const o = [];
|
|
475
|
+
for (let s = 0; s < t.questions.length; s += 1) {
|
|
476
|
+
const r = t.questions[s], i = de(r, s), l = e[i] ?? [], a = n[i]?.trim(), c = a ? [...l, a] : l;
|
|
477
|
+
c.length !== 0 && o.push(`${r.question}: ${c.join(", ")}`);
|
|
478
478
|
}
|
|
479
|
-
return
|
|
480
|
-
},
|
|
481
|
-
if (
|
|
479
|
+
return o;
|
|
480
|
+
}, oo = (t) => typeof t != "string", Rt = (t, e) => {
|
|
481
|
+
if (oo(e)) return e;
|
|
482
482
|
const n = e.trim();
|
|
483
483
|
if (n.length === 0) return {};
|
|
484
|
-
const
|
|
485
|
-
for (let
|
|
486
|
-
const r = t.questions[
|
|
487
|
-
r.allowCustomAnswer && (
|
|
484
|
+
const o = {};
|
|
485
|
+
for (let s = 0; s < t.questions.length; s += 1) {
|
|
486
|
+
const r = t.questions[s];
|
|
487
|
+
r.allowCustomAnswer && (o[de(r, s)] = n);
|
|
488
488
|
}
|
|
489
|
-
return
|
|
490
|
-
},
|
|
489
|
+
return o;
|
|
490
|
+
}, ro = (t, e, n) => {
|
|
491
491
|
if (!t) return typeof n == "string" ? n.trim() : "";
|
|
492
|
-
const
|
|
493
|
-
return r.length > 0 && !i &&
|
|
492
|
+
const o = Rt(t, n), s = so(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
|
|
493
|
+
return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
|
|
494
494
|
`);
|
|
495
|
-
},
|
|
496
|
-
const
|
|
497
|
-
return t.questions.map((
|
|
498
|
-
const i =
|
|
495
|
+
}, io = (t, e, n) => {
|
|
496
|
+
const o = Rt(t, n);
|
|
497
|
+
return t.questions.map((s, r) => {
|
|
498
|
+
const i = de(s, r), l = e[i] ?? [], a = o[i]?.trim();
|
|
499
499
|
return a ? [...l, a] : l;
|
|
500
500
|
});
|
|
501
|
-
},
|
|
501
|
+
}, lo = (t, e, n) => {
|
|
502
502
|
if (!t) return !1;
|
|
503
|
-
const
|
|
504
|
-
for (let
|
|
505
|
-
const r = t.questions[
|
|
503
|
+
const o = Rt(t, n);
|
|
504
|
+
for (let s = 0; s < t.questions.length; s += 1) {
|
|
505
|
+
const r = t.questions[s];
|
|
506
506
|
if (!r.required) continue;
|
|
507
|
-
const i =
|
|
508
|
-
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer &&
|
|
507
|
+
const i = de(r, s);
|
|
508
|
+
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
|
|
509
509
|
return !0;
|
|
510
510
|
}
|
|
511
511
|
return !1;
|
|
512
|
-
},
|
|
513
|
-
id:
|
|
512
|
+
}, ao = (t) => t.questions.map((e, n) => ({
|
|
513
|
+
id: de(e, n),
|
|
514
514
|
question: e.question,
|
|
515
515
|
options: e.options,
|
|
516
516
|
multiple: !!e.multiple,
|
|
517
517
|
required: !!e.required,
|
|
518
518
|
allowCustomAnswer: !!e.allowCustomAnswer
|
|
519
|
-
})),
|
|
520
|
-
const
|
|
521
|
-
return (n[
|
|
522
|
-
},
|
|
523
|
-
const e =
|
|
519
|
+
})), co = (t, e, n, o) => {
|
|
520
|
+
const s = de(t, e);
|
|
521
|
+
return (n[s] ?? []).length > 0 || !!o[s]?.trim();
|
|
522
|
+
}, uo = (t) => {
|
|
523
|
+
const e = C(22), {
|
|
524
524
|
question: n,
|
|
525
|
-
sourceQuestion:
|
|
526
|
-
questionIndex:
|
|
525
|
+
sourceQuestion: o,
|
|
526
|
+
questionIndex: s,
|
|
527
527
|
isActive: r,
|
|
528
528
|
selectedOptionsByQuestion: i,
|
|
529
529
|
customAnswersByQuestion: l,
|
|
530
530
|
onSelectStep: a
|
|
531
531
|
} = t;
|
|
532
|
-
let
|
|
533
|
-
e[0] !== l || e[1] !==
|
|
534
|
-
const d =
|
|
532
|
+
let c;
|
|
533
|
+
e[0] !== l || e[1] !== s || e[2] !== i || e[3] !== o ? (c = co(o, s, i, l), e[0] = l, e[1] = s, e[2] = i, e[3] = o, e[4] = c) : c = e[4];
|
|
534
|
+
const d = c, 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}`;
|
|
535
535
|
let b;
|
|
536
|
-
e[5] !== a || e[6] !==
|
|
537
|
-
let x;
|
|
538
|
-
e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ c(en, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
|
|
536
|
+
e[5] !== a || e[6] !== s ? (b = () => a(s), e[5] = a, e[6] = s, e[7] = b) : b = e[7];
|
|
539
537
|
let y;
|
|
540
|
-
e[
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
538
|
+
e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ u(nn, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
|
|
539
|
+
let x;
|
|
540
|
+
e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (x = /* @__PURE__ */ u(Qe, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: y }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = x) : x = e[18];
|
|
541
|
+
let S;
|
|
542
|
+
return e[19] !== n.question || e[20] !== x ? (S = /* @__PURE__ */ u(vt, { content: n.question, children: x }), e[19] = n.question, e[20] = x, e[21] = S) : S = e[21], S;
|
|
543
|
+
}, fo = (t) => {
|
|
544
|
+
const e = C(31), {
|
|
545
545
|
questionPrompt: n,
|
|
546
|
-
selectedOptionsByQuestion:
|
|
547
|
-
customAnswersByQuestion:
|
|
546
|
+
selectedOptionsByQuestion: o,
|
|
547
|
+
customAnswersByQuestion: s,
|
|
548
548
|
onToggleOption: r,
|
|
549
549
|
onCustomAnswerChange: i
|
|
550
550
|
} = t, {
|
|
551
551
|
questions: l
|
|
552
|
-
} = t, [a,
|
|
553
|
-
let
|
|
554
|
-
e[0] !==
|
|
555
|
-
const h = `question-step-panel-${f.id}`, g =
|
|
556
|
-
let x;
|
|
557
|
-
e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
|
|
552
|
+
} = t, [a, c] = W(0), d = Math.min(a, l.length - 1), f = l[d], m = l.length > 1;
|
|
553
|
+
let p;
|
|
554
|
+
e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== o ? (p = m ? /* @__PURE__ */ u(oe, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((I, _) => /* @__PURE__ */ u(uo, { question: I, sourceQuestion: n.questions[_], questionIndex: _, isActive: _ === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: c }, I.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = o, e[6] = p) : p = e[6];
|
|
555
|
+
const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${f.id}` : void 0;
|
|
558
556
|
let y;
|
|
559
|
-
e[
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
e[
|
|
564
|
-
i(n.questions[d], d, L);
|
|
565
|
-
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
|
|
557
|
+
e[7] !== f ? (y = [f], e[7] = f, e[8] = y) : y = e[8];
|
|
558
|
+
let x;
|
|
559
|
+
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (I, _, P) => {
|
|
560
|
+
r(n.questions[d], d, P);
|
|
561
|
+
}, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
|
|
566
562
|
let S;
|
|
567
|
-
e[
|
|
563
|
+
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (S = (I, _, P) => {
|
|
564
|
+
i(n.questions[d], d, P);
|
|
565
|
+
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = S) : S = e[16];
|
|
566
|
+
let A;
|
|
567
|
+
e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== x || e[21] !== S ? (A = /* @__PURE__ */ u(fn, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: x, onCustomAnswerChange: S }), e[17] = s, e[18] = o, e[19] = y, e[20] = x, e[21] = S, e[22] = A) : A = e[22];
|
|
568
|
+
let T;
|
|
569
|
+
e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== A ? (T = /* @__PURE__ */ u(X, { id: h, role: g, "aria-labelledby": b, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = b, e[26] = A, e[27] = T) : T = e[27];
|
|
568
570
|
let w;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}, co = (t) => {
|
|
576
|
-
const e = A(8), {
|
|
571
|
+
return e[28] !== p || e[29] !== T ? (w = /* @__PURE__ */ k(X, { gap: "xs", pb: "sm", children: [
|
|
572
|
+
p,
|
|
573
|
+
T
|
|
574
|
+
] }), e[28] = p, e[29] = T, e[30] = w) : w = e[30], w;
|
|
575
|
+
}, po = (t) => {
|
|
576
|
+
const e = C(8), {
|
|
577
577
|
questionPrompt: n
|
|
578
578
|
} = t;
|
|
579
|
-
let
|
|
580
|
-
e[0] !== n ? (
|
|
581
|
-
const
|
|
579
|
+
let o;
|
|
580
|
+
e[0] !== n ? (o = ao(n), e[0] = n, e[1] = o) : o = e[1];
|
|
581
|
+
const s = o;
|
|
582
582
|
let r;
|
|
583
|
-
e[2] !== n ? (r =
|
|
583
|
+
e[2] !== n ? (r = St(n), e[2] = n, e[3] = r) : r = e[3];
|
|
584
584
|
const i = r;
|
|
585
585
|
let l;
|
|
586
|
-
return e[4] !== t || e[5] !== i || e[6] !==
|
|
587
|
-
},
|
|
588
|
-
const e =
|
|
589
|
-
let n,
|
|
586
|
+
return e[4] !== t || e[5] !== i || e[6] !== s ? (l = /* @__PURE__ */ u(fo, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = l) : l = e[7], l;
|
|
587
|
+
}, Ot = "7", mo = (t) => {
|
|
588
|
+
const e = C(22);
|
|
589
|
+
let n, o, s, r;
|
|
590
590
|
e[0] !== t ? ({
|
|
591
591
|
title: r,
|
|
592
|
-
shortcut:
|
|
592
|
+
shortcut: s,
|
|
593
593
|
canInterrupt: n,
|
|
594
|
-
...
|
|
595
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
596
|
-
const i =
|
|
594
|
+
...o
|
|
595
|
+
} = t, e[0] = t, e[1] = n, e[2] = o, e[3] = s, e[4] = r) : (n = e[1], o = e[2], s = e[3], r = e[4]);
|
|
596
|
+
const i = o["aria-label"] ?? r;
|
|
597
597
|
let l;
|
|
598
|
-
e[5] !== n ? (l = n ? /* @__PURE__ */
|
|
598
|
+
e[5] !== n ? (l = n ? /* @__PURE__ */ u(es, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ u(ts, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
|
|
599
599
|
const a = l;
|
|
600
|
-
let
|
|
601
|
-
e[7] !== i || e[8] !== a || e[9] !==
|
|
602
|
-
const d =
|
|
600
|
+
let c;
|
|
601
|
+
e[7] !== i || e[8] !== a || e[9] !== o || e[10] !== r ? (c = /* @__PURE__ */ u(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...o, children: a }), e[7] = i, e[8] = a, e[9] = o, e[10] = r, e[11] = c) : c = e[11];
|
|
602
|
+
const d = c;
|
|
603
603
|
if (r) {
|
|
604
604
|
let f;
|
|
605
|
-
e[12] !==
|
|
605
|
+
e[12] !== s || e[13] !== r ? (f = s ? /* @__PURE__ */ k(It, { children: [
|
|
606
606
|
r,
|
|
607
607
|
" ",
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
] }) : r, e[12] =
|
|
610
|
-
const
|
|
611
|
-
let
|
|
612
|
-
e[15] !== d ? (
|
|
608
|
+
/* @__PURE__ */ u(Un, { fontSize: "xs", children: s })
|
|
609
|
+
] }) : r, e[12] = s, e[13] = r, e[14] = f) : f = e[14];
|
|
610
|
+
const m = f;
|
|
611
|
+
let p;
|
|
612
|
+
e[15] !== d ? (p = /* @__PURE__ */ u(Je.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
|
|
613
613
|
let h;
|
|
614
|
-
e[17] !==
|
|
614
|
+
e[17] !== m ? (h = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(Je.Positioner, { children: /* @__PURE__ */ u(Je.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
|
|
615
615
|
let g;
|
|
616
|
-
return e[19] !==
|
|
617
|
-
|
|
616
|
+
return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(Je.Root, { closeDelay: 50, openDelay: 100, children: [
|
|
617
|
+
p,
|
|
618
618
|
h
|
|
619
|
-
] }), e[19] =
|
|
619
|
+
] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
|
|
620
620
|
}
|
|
621
621
|
return d;
|
|
622
|
-
},
|
|
623
|
-
const e =
|
|
622
|
+
}, pn = 10, ho = (t) => {
|
|
623
|
+
const e = [];
|
|
624
|
+
for (let n = t.length - 1; n >= 0 && e.length < pn; n--) {
|
|
625
|
+
const o = t[n];
|
|
626
|
+
if (o.role !== "user") continue;
|
|
627
|
+
const s = o.parts.flatMap((r) => r.type === "text" ? [r.text] : []).join("");
|
|
628
|
+
s.trim() && e.push(s);
|
|
629
|
+
}
|
|
630
|
+
return e;
|
|
631
|
+
}, go = (t, e, n, o) => o === 0 ? null : t === null ? e === "previous" && n === "" ? {
|
|
632
|
+
index: 0
|
|
633
|
+
} : null : e === "previous" ? {
|
|
634
|
+
index: Math.min(t + 1, o - 1)
|
|
635
|
+
} : {
|
|
636
|
+
index: t === 0 ? null : t - 1
|
|
637
|
+
}, bo = (t) => {
|
|
638
|
+
const e = C(24), {
|
|
639
|
+
recentUserMessages: n,
|
|
640
|
+
text: o,
|
|
641
|
+
blocked: s,
|
|
642
|
+
resetKey: r,
|
|
643
|
+
onChange: i
|
|
644
|
+
} = t, l = J(null), a = J(null);
|
|
645
|
+
let c, d;
|
|
646
|
+
if (e[0] !== s || e[1] !== n || e[2] !== r) {
|
|
647
|
+
c = n.slice(0, pn);
|
|
648
|
+
const _ = JSON.stringify(c);
|
|
649
|
+
d = JSON.stringify([_, r, s]), e[0] = s, e[1] = n, e[2] = r, e[3] = c, e[4] = d;
|
|
650
|
+
} else
|
|
651
|
+
c = e[3], d = e[4];
|
|
652
|
+
const f = d, m = J(f);
|
|
653
|
+
let p, h;
|
|
654
|
+
e[5] !== f ? (p = () => {
|
|
655
|
+
m.current !== f && (m.current = f, a.current = null);
|
|
656
|
+
}, h = [f], e[5] = f, e[6] = p, e[7] = h) : (p = e[6], h = e[7]), Z(p, h);
|
|
657
|
+
let g;
|
|
658
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => {
|
|
659
|
+
a.current = null;
|
|
660
|
+
}, e[8] = g) : g = e[8];
|
|
661
|
+
const b = g;
|
|
662
|
+
let y;
|
|
663
|
+
e[9] !== i || e[10] !== c ? (y = (_) => {
|
|
664
|
+
a.current !== null && _ !== c[a.current] && b(), i(_);
|
|
665
|
+
}, e[9] = i, e[10] = c, e[11] = y) : y = e[11];
|
|
666
|
+
const x = y;
|
|
667
|
+
let S;
|
|
668
|
+
e[12] !== s || e[13] !== i || e[14] !== c || e[15] !== o ? (S = (_) => {
|
|
669
|
+
if (s)
|
|
670
|
+
return !1;
|
|
671
|
+
const P = go(a.current, _, o, c.length);
|
|
672
|
+
if (!P)
|
|
673
|
+
return !1;
|
|
674
|
+
a.current = P.index;
|
|
675
|
+
const M = P.index === null ? "" : c[P.index];
|
|
676
|
+
return l.current?.setEditorValue(M), i(M), !0;
|
|
677
|
+
}, e[12] = s, e[13] = i, e[14] = c, e[15] = o, e[16] = S) : S = e[16];
|
|
678
|
+
const A = S;
|
|
679
|
+
let T, w;
|
|
680
|
+
e[17] !== A ? (T = () => A("previous"), w = () => A("next"), e[17] = A, e[18] = T, e[19] = w) : (T = e[18], w = e[19]);
|
|
681
|
+
let I;
|
|
682
|
+
return e[20] !== x || e[21] !== T || e[22] !== w ? (I = {
|
|
683
|
+
editorRef: l,
|
|
684
|
+
reset: b,
|
|
685
|
+
change: x,
|
|
686
|
+
recallPrevious: T,
|
|
687
|
+
recallNext: w
|
|
688
|
+
}, e[20] = x, e[21] = T, e[22] = w, e[23] = I) : I = e[23], I;
|
|
689
|
+
}, yo = (t) => {
|
|
690
|
+
const e = C(2), {
|
|
624
691
|
placeholder: n
|
|
625
692
|
} = t;
|
|
626
693
|
if (!n)
|
|
627
694
|
return null;
|
|
628
|
-
let
|
|
629
|
-
return e[0] !== n ? (
|
|
630
|
-
},
|
|
695
|
+
let o;
|
|
696
|
+
return e[0] !== n ? (o = /* @__PURE__ */ u(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = o) : o = e[1], o;
|
|
697
|
+
}, bt = "border.accent-light", wt = (t) => {
|
|
631
698
|
const e = t?.querySelector('[contenteditable="true"]');
|
|
632
699
|
e instanceof HTMLElement && e.focus();
|
|
633
|
-
},
|
|
634
|
-
|
|
635
|
-
}),
|
|
700
|
+
}, zt = (t, e) => requestAnimationFrame(() => {
|
|
701
|
+
wt(t), e?.();
|
|
702
|
+
}), xo = (t, e, n, o) => {
|
|
703
|
+
const s = C(10);
|
|
704
|
+
let r, i;
|
|
705
|
+
s[0] !== e || s[1] !== t || s[2] !== o ? (r = () => {
|
|
706
|
+
if (!e)
|
|
707
|
+
return;
|
|
708
|
+
const c = zt(t.current, () => o(!0));
|
|
709
|
+
return () => cancelAnimationFrame(c);
|
|
710
|
+
}, i = [e, t, o], s[0] = e, s[1] = t, s[2] = o, s[3] = r, s[4] = i) : (r = s[3], i = s[4]), Z(r, i);
|
|
711
|
+
let l, a;
|
|
712
|
+
s[5] !== t || s[6] !== n || s[7] !== o ? (l = () => {
|
|
713
|
+
if (n === 0)
|
|
714
|
+
return;
|
|
715
|
+
const c = zt(t.current, () => o(!0));
|
|
716
|
+
return () => cancelAnimationFrame(c);
|
|
717
|
+
}, a = [n, t, o], s[5] = t, s[6] = n, s[7] = o, s[8] = l, s[9] = a) : (l = s[8], a = s[9]), Z(l, a);
|
|
718
|
+
}, So = (t) => {
|
|
636
719
|
const {
|
|
637
720
|
defaultState: e,
|
|
638
|
-
|
|
721
|
+
recentUserMessages: n = [],
|
|
722
|
+
onSubmit: o = () => {
|
|
639
723
|
},
|
|
640
724
|
onInterrupt: s,
|
|
641
|
-
onAttachFiles:
|
|
642
|
-
onAttachText:
|
|
643
|
-
textAttachmentPasteLineThreshold:
|
|
644
|
-
streaming:
|
|
645
|
-
attachedResources:
|
|
646
|
-
onClearAttachments:
|
|
647
|
-
isDisabled:
|
|
648
|
-
submitDisabled:
|
|
725
|
+
onAttachFiles: r,
|
|
726
|
+
onAttachText: i,
|
|
727
|
+
textAttachmentPasteLineThreshold: l = un,
|
|
728
|
+
streaming: a = !1,
|
|
729
|
+
attachedResources: c = [],
|
|
730
|
+
onClearAttachments: d,
|
|
731
|
+
isDisabled: f = !1,
|
|
732
|
+
submitDisabled: m = !1,
|
|
649
733
|
onChange: p,
|
|
650
|
-
placeholder:
|
|
651
|
-
attachmentList:
|
|
652
|
-
actions:
|
|
653
|
-
attachedToTop:
|
|
734
|
+
placeholder: h,
|
|
735
|
+
attachmentList: g,
|
|
736
|
+
actions: b,
|
|
737
|
+
attachedToTop: y = !1,
|
|
654
738
|
recessed: x = !1,
|
|
655
|
-
questionPrompt:
|
|
656
|
-
autoFocus:
|
|
657
|
-
focusSignal:
|
|
739
|
+
questionPrompt: S,
|
|
740
|
+
autoFocus: A = !1,
|
|
741
|
+
focusSignal: T = 0,
|
|
658
742
|
submitTitle: w,
|
|
659
|
-
references:
|
|
743
|
+
references: I = [],
|
|
660
744
|
onAddReference: _
|
|
661
|
-
} = t,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}, [p]),
|
|
665
|
-
const
|
|
666
|
-
|
|
745
|
+
} = t, P = x ? "border.subtle" : "border", [M, z] = W(!1), [B, E] = W(!1), [F, L] = W(e), [$, O] = W(0), [H, R] = W(() => ht(e)), [q, V] = W({}), [j, K] = W({}), G = J(null), Se = J(p), re = J(St(S));
|
|
746
|
+
Z(() => {
|
|
747
|
+
Se.current = p;
|
|
748
|
+
}, [p]), Z(() => {
|
|
749
|
+
const Q = ht(e);
|
|
750
|
+
L(e), O((Y) => Y + 1), R(Q), V({}), K({}), Se.current?.(Q);
|
|
667
751
|
}, [e]);
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}, [
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
z(ne), W({}), K({}), xe.current?.(ne), q && requestAnimationFrame(() => {
|
|
686
|
-
yt(oe.current);
|
|
752
|
+
const ie = St(S);
|
|
753
|
+
Z(() => {
|
|
754
|
+
re.current !== ie && (re.current = ie, V({}), K({}));
|
|
755
|
+
}, [ie]), xo(G, A, T, E);
|
|
756
|
+
const ee = bo({
|
|
757
|
+
recentUserMessages: n,
|
|
758
|
+
text: H,
|
|
759
|
+
blocked: f || M || !!S,
|
|
760
|
+
resetKey: JSON.stringify([e, $, ie]),
|
|
761
|
+
onChange: (Q) => {
|
|
762
|
+
R(Q), p?.(Q);
|
|
763
|
+
}
|
|
764
|
+
}), te = () => {
|
|
765
|
+
E(!0), wt(G.current);
|
|
766
|
+
}, ne = (Q = !1) => {
|
|
767
|
+
O((Y) => Y + 1), V({}), K({}), ee.reset(), ee.change(ht(e)), Q && requestAnimationFrame(() => {
|
|
768
|
+
wt(G.current);
|
|
687
769
|
});
|
|
688
|
-
},
|
|
689
|
-
canInterrupt:
|
|
690
|
-
canSubmit: !
|
|
691
|
-
hasQuestionPrompt: !!
|
|
692
|
-
isDisabled:
|
|
693
|
-
streaming:
|
|
694
|
-
text:
|
|
695
|
-
},
|
|
696
|
-
if (!
|
|
697
|
-
const
|
|
698
|
-
answers:
|
|
770
|
+
}, le = S ? ro(S, q, j) : H.trim(), Te = lo(S, q, j), ae = {
|
|
771
|
+
canInterrupt: a && !S && !!s,
|
|
772
|
+
canSubmit: !m,
|
|
773
|
+
hasQuestionPrompt: !!S,
|
|
774
|
+
isDisabled: f || M || Te,
|
|
775
|
+
streaming: a,
|
|
776
|
+
text: le
|
|
777
|
+
}, ce = Ks(ae), Be = a && !S ? "Queue message" : "Send message", Fe = async () => {
|
|
778
|
+
if (!le) return;
|
|
779
|
+
const Q = S ? {
|
|
780
|
+
answers: io(S, q, j)
|
|
699
781
|
} : void 0;
|
|
700
|
-
|
|
782
|
+
ee.reset(), z(!0);
|
|
701
783
|
try {
|
|
702
|
-
await
|
|
784
|
+
await o(le, c, Q), ne(!0), d?.();
|
|
703
785
|
} catch {
|
|
704
786
|
} finally {
|
|
705
|
-
|
|
787
|
+
z(!1);
|
|
706
788
|
}
|
|
707
|
-
},
|
|
708
|
-
|
|
709
|
-
},
|
|
710
|
-
onAttachFiles:
|
|
711
|
-
onAttachText:
|
|
712
|
-
textAttachmentPasteLineThreshold:
|
|
713
|
-
}),
|
|
714
|
-
|
|
715
|
-
},
|
|
716
|
-
const
|
|
717
|
-
K((
|
|
718
|
-
|
|
719
|
-
[
|
|
789
|
+
}, Ne = (Q) => {
|
|
790
|
+
Q === "interrupt" && s?.(), Q === "submit" && Fe();
|
|
791
|
+
}, Le = Gs({
|
|
792
|
+
onAttachFiles: r,
|
|
793
|
+
onAttachText: i,
|
|
794
|
+
textAttachmentPasteLineThreshold: l
|
|
795
|
+
}), it = (Q, Y, Ve) => {
|
|
796
|
+
V((we) => no(we, Q, Y, Ve));
|
|
797
|
+
}, lt = (Q, Y, Ve) => {
|
|
798
|
+
const we = de(Q, Y);
|
|
799
|
+
K(($e) => ({
|
|
800
|
+
...$e,
|
|
801
|
+
[we]: Ve
|
|
720
802
|
}));
|
|
721
803
|
};
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
borderColor:
|
|
804
|
+
return /* @__PURE__ */ u(D, { ref: G, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: y ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: y ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: B ? bt : P, zIndex: B ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
|
|
805
|
+
borderColor: B ? bt : P,
|
|
724
806
|
zIndex: 1
|
|
725
807
|
}, _focusWithin: {
|
|
726
|
-
borderColor:
|
|
808
|
+
borderColor: bt,
|
|
727
809
|
zIndex: 1
|
|
728
|
-
}, onPasteCapture:
|
|
729
|
-
|
|
730
|
-
|
|
810
|
+
}, onPasteCapture: Le.onPasteCapture, onDropCapture: Le.onDropCapture, onDragOver: Le.onDragOver, onClick: te, onBlur: () => E(!1), children: /* @__PURE__ */ k(ye, { direction: "column", color: "fg", gap: "xs", children: [
|
|
811
|
+
g ? /* @__PURE__ */ u(D, { children: g }) : null,
|
|
812
|
+
S ? /* @__PURE__ */ u(po, { questionPrompt: S, selectedOptionsByQuestion: q, customAnswersByQuestion: j, onToggleOption: it, onCustomAnswerChange: lt }) : (
|
|
731
813
|
// The editor is its own composer row: it centres a single line at the shared
|
|
732
814
|
// control height and grows with content, never shrinking below it, so the row
|
|
733
815
|
// aligns with the toolbar beneath it.
|
|
734
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ u(tt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
735
817
|
pr: "2xs"
|
|
736
|
-
}, children: /* @__PURE__ */
|
|
737
|
-
z(q), p?.(q);
|
|
738
|
-
}, onSubmit: () => Ae(Vs(de)), references: C, onAddReference: _ }, $) }) })
|
|
818
|
+
}, children: /* @__PURE__ */ u(ye, { minH: Ot, align: "center", children: /* @__PURE__ */ u(Ts, { ref: ee.editorRef, onRecallPrevious: ee.recallPrevious, onRecallNext: ee.recallNext, defaultState: F, isEditable: !f && !M, placeholder: /* @__PURE__ */ u(yo, { placeholder: h }), onChange: ee.change, onSubmit: () => Ne(js(ae)), references: I, onAddReference: _ }, $) }) })
|
|
739
819
|
),
|
|
740
|
-
/* @__PURE__ */ k(
|
|
741
|
-
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ k(oe, { gap: "1", minH: Ot, align: "center", children: [
|
|
821
|
+
b,
|
|
822
|
+
/* @__PURE__ */ u(jn, {}),
|
|
823
|
+
/* @__PURE__ */ u(mo, { canInterrupt: ce === "interrupt", title: ce === "interrupt" ? "Stop Response" : w ?? Be, shortcut: ce === "submit" ? "Enter" : void 0, onClick: () => Ne(ce), disabled: ce === "none" })
|
|
744
824
|
] })
|
|
745
825
|
] }) });
|
|
746
|
-
},
|
|
826
|
+
}, We = (t) => typeof t == "object" && t !== null && !Array.isArray(t), wo = (t) => {
|
|
747
827
|
try {
|
|
748
828
|
const e = JSON.parse(t);
|
|
749
|
-
return
|
|
829
|
+
return We(e) ? e : null;
|
|
750
830
|
} catch {
|
|
751
831
|
return null;
|
|
752
832
|
}
|
|
753
|
-
},
|
|
833
|
+
}, To = (t) => We(t) ? t : typeof t == "string" && t.trim().length > 0 ? wo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ue = (t) => {
|
|
754
834
|
const e = De(t);
|
|
755
835
|
if (e) return e;
|
|
756
836
|
if (Array.isArray(t)) {
|
|
757
|
-
const n = t.map(
|
|
837
|
+
const n = t.map(ue).filter((o) => o !== null);
|
|
758
838
|
return n.length > 0 ? n.join(`
|
|
759
839
|
`) : null;
|
|
760
840
|
}
|
|
761
|
-
return
|
|
762
|
-
},
|
|
841
|
+
return We(t) ? ue(t.response) ?? ue(t.answer) ?? ue(t.text) ?? ue(t.answers) : null;
|
|
842
|
+
}, Ao = (t) => {
|
|
763
843
|
if (typeof t == "string" && t.trim().length > 0)
|
|
764
844
|
return {
|
|
765
845
|
label: t,
|
|
766
846
|
description: void 0
|
|
767
847
|
};
|
|
768
|
-
if (!
|
|
848
|
+
if (!We(t)) return null;
|
|
769
849
|
const e = De(t.label);
|
|
770
850
|
return e ? {
|
|
771
851
|
label: e,
|
|
772
852
|
description: De(t.description) ?? void 0
|
|
773
853
|
} : null;
|
|
774
|
-
},
|
|
775
|
-
if (!
|
|
854
|
+
}, Co = (t, e) => {
|
|
855
|
+
if (!We(t)) return null;
|
|
776
856
|
const n = De(t.question);
|
|
777
857
|
if (!n) return null;
|
|
778
|
-
const
|
|
858
|
+
const o = Array.isArray(t.options) ? t.options.map(Ao).filter((i) => i !== null) : [], s = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o.length === 0 || s === "freeform" || s === "text";
|
|
779
859
|
return {
|
|
780
860
|
id: De(t.id) ?? `question-${e}`,
|
|
781
861
|
question: n,
|
|
782
|
-
options:
|
|
783
|
-
multiple: typeof t.multiple == "boolean" ? t.multiple :
|
|
862
|
+
options: o,
|
|
863
|
+
multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
|
|
784
864
|
required: typeof t.required == "boolean" ? t.required : !0,
|
|
785
865
|
allowCustomAnswer: r
|
|
786
866
|
};
|
|
787
|
-
},
|
|
788
|
-
const e =
|
|
867
|
+
}, mn = (t) => {
|
|
868
|
+
const e = To(t);
|
|
789
869
|
if (!e || !Array.isArray(e.questions)) return null;
|
|
790
|
-
const n = e.questions.map(
|
|
870
|
+
const n = e.questions.map(Co).filter((o) => o !== null);
|
|
791
871
|
return n.length === 0 ? null : {
|
|
792
872
|
questions: n
|
|
793
873
|
};
|
|
794
|
-
},
|
|
874
|
+
}, ko = (t) => t.tool.toLowerCase() === "question", Io = (t) => {
|
|
795
875
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
796
876
|
const n = t[e];
|
|
797
877
|
if (n.role === "assistant")
|
|
798
|
-
for (let
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
return
|
|
878
|
+
for (let o = n.parts.length - 1; o >= 0; o -= 1) {
|
|
879
|
+
const s = n.parts[o];
|
|
880
|
+
if (s.type !== "tool" || !ko(s)) continue;
|
|
881
|
+
return ue(s.state?.output) ?? ue(s.state?.metadata) ? void 0 : mn(s.state?.input) ?? void 0;
|
|
802
882
|
}
|
|
803
883
|
}
|
|
804
|
-
},
|
|
884
|
+
}, hn = {
|
|
805
885
|
animationName: "message-fade-in",
|
|
806
886
|
animationDuration: "200ms",
|
|
807
887
|
animationTimingFunction: "ease-out"
|
|
808
|
-
},
|
|
888
|
+
}, _o = (t) => {
|
|
809
889
|
const e = /* @__PURE__ */ new Set(), n = new Set(t.state.seenKeys);
|
|
810
|
-
for (const
|
|
811
|
-
t.state.initialized && !n.has(
|
|
890
|
+
for (const o of t.itemKeys)
|
|
891
|
+
t.state.initialized && !n.has(o) && e.add(o), n.add(o);
|
|
812
892
|
return {
|
|
813
893
|
animatedKeys: e,
|
|
814
894
|
state: {
|
|
@@ -816,70 +896,70 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
|
|
|
816
896
|
seenKeys: n
|
|
817
897
|
}
|
|
818
898
|
};
|
|
819
|
-
},
|
|
899
|
+
}, vo = (t, e) => {
|
|
820
900
|
if (t.length !== e.length) return !1;
|
|
821
901
|
for (let n = 0; n < t.length; n += 1) if (t[n] !== e[n]) return !1;
|
|
822
902
|
return !0;
|
|
823
|
-
},
|
|
824
|
-
const e =
|
|
903
|
+
}, Mo = (t) => {
|
|
904
|
+
const e = J({
|
|
825
905
|
initialized: !1,
|
|
826
906
|
seenKeys: /* @__PURE__ */ new Set()
|
|
827
|
-
}), n =
|
|
828
|
-
if (n.current &&
|
|
907
|
+
}), n = J(null);
|
|
908
|
+
if (n.current && vo(n.current.itemKeys, t))
|
|
829
909
|
return n.current.animatedKeys;
|
|
830
|
-
const
|
|
910
|
+
const o = _o({
|
|
831
911
|
itemKeys: t,
|
|
832
912
|
state: e.current
|
|
833
913
|
});
|
|
834
|
-
return e.current =
|
|
914
|
+
return e.current = o.state, n.current = {
|
|
835
915
|
itemKeys: [...t],
|
|
836
|
-
animatedKeys:
|
|
837
|
-
},
|
|
838
|
-
},
|
|
916
|
+
animatedKeys: o.animatedKeys
|
|
917
|
+
}, o.animatedKeys;
|
|
918
|
+
}, Ro = (t) => t.type === "text", Po = (t) => (t.parts ?? []).filter(Ro).map((e) => e.text.trim()).filter(Boolean).join(`
|
|
839
919
|
|
|
840
|
-
`),
|
|
920
|
+
`), Eo = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
|
|
841
921
|
hour: "numeric",
|
|
842
922
|
minute: "2-digit",
|
|
843
923
|
timeZone: n
|
|
844
|
-
}).format(new Date(t.createdAt)) : "",
|
|
845
|
-
const e =
|
|
924
|
+
}).format(new Date(t.createdAt)) : "", Tt = (t) => {
|
|
925
|
+
const e = C(20), {
|
|
846
926
|
message: n,
|
|
847
|
-
alwaysVisible:
|
|
848
|
-
copyAlwaysVisible:
|
|
849
|
-
} = t, r =
|
|
927
|
+
alwaysVisible: o,
|
|
928
|
+
copyAlwaysVisible: s
|
|
929
|
+
} = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [l, a] = W(!1), c = J(null);
|
|
850
930
|
let d;
|
|
851
|
-
e[0] !== n ? (d =
|
|
931
|
+
e[0] !== n ? (d = Po(n), e[0] = n, e[1] = d) : d = e[1];
|
|
852
932
|
const f = d;
|
|
853
|
-
let
|
|
854
|
-
e[2] !== n ? (
|
|
855
|
-
const
|
|
933
|
+
let m;
|
|
934
|
+
e[2] !== n ? (m = Eo(n), e[2] = n, e[3] = m) : m = e[3];
|
|
935
|
+
const p = m;
|
|
856
936
|
let h, g;
|
|
857
937
|
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
|
|
858
|
-
|
|
859
|
-
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]),
|
|
938
|
+
c.current !== null && window.clearTimeout(c.current);
|
|
939
|
+
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Z(h, g);
|
|
860
940
|
let b;
|
|
861
941
|
e[6] !== f ? (b = async () => {
|
|
862
942
|
if (f)
|
|
863
943
|
try {
|
|
864
|
-
await navigator.clipboard.writeText(f), a(!0),
|
|
944
|
+
await navigator.clipboard.writeText(f), a(!0), c.current !== null && window.clearTimeout(c.current), c.current = window.setTimeout(() => a(!1), 1200);
|
|
865
945
|
} catch {
|
|
866
946
|
a(!1);
|
|
867
947
|
}
|
|
868
948
|
}, e[6] = f, e[7] = b) : b = e[7];
|
|
869
|
-
const
|
|
870
|
-
if (!f && !
|
|
949
|
+
const y = b;
|
|
950
|
+
if (!f && !p)
|
|
871
951
|
return null;
|
|
872
|
-
const
|
|
873
|
-
let
|
|
874
|
-
e[8] !==
|
|
952
|
+
const x = r ? "1" : "0", S = r ? "auto" : "none";
|
|
953
|
+
let A;
|
|
954
|
+
e[8] !== p ? (A = p ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
|
|
955
|
+
let T;
|
|
956
|
+
e[10] !== i || e[11] !== y || e[12] !== f || e[13] !== l ? (T = f ? /* @__PURE__ */ u(D, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Qt, children: /* @__PURE__ */ u(vt, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ u(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: l ? /* @__PURE__ */ u(nn, { size: 12 }) : /* @__PURE__ */ u(ns, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = f, e[13] = l, e[14] = T) : T = e[14];
|
|
875
957
|
let w;
|
|
876
|
-
e[
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
] }), e[15] = w, e[16] = y, e[17] = T, e[18] = S, e[19] = C) : C = e[19], C;
|
|
882
|
-
}, Ot = {
|
|
958
|
+
return e[15] !== T || e[16] !== x || e[17] !== S || e[18] !== A ? (w = /* @__PURE__ */ k(oe, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: S, transition: "opacity 120ms ease", css: Qt, children: [
|
|
959
|
+
A,
|
|
960
|
+
T
|
|
961
|
+
] }), e[15] = T, e[16] = x, e[17] = S, e[18] = A, e[19] = w) : w = e[19], w;
|
|
962
|
+
}, Qt = {
|
|
883
963
|
"[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
|
|
884
964
|
opacity: 1,
|
|
885
965
|
pointerEvents: "auto"
|
|
@@ -892,44 +972,44 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
|
|
|
892
972
|
opacity: 1,
|
|
893
973
|
pointerEvents: "auto"
|
|
894
974
|
}
|
|
895
|
-
},
|
|
896
|
-
const e =
|
|
897
|
-
let n,
|
|
975
|
+
}, Do = (t) => {
|
|
976
|
+
const e = C(8);
|
|
977
|
+
let n, o;
|
|
898
978
|
e[0] !== t ? ({
|
|
899
979
|
children: n,
|
|
900
|
-
...
|
|
901
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
902
|
-
let
|
|
903
|
-
e[3] !== n ? (
|
|
980
|
+
...o
|
|
981
|
+
} = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
|
|
982
|
+
let s;
|
|
983
|
+
e[3] !== n ? (s = /* @__PURE__ */ u(an, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
|
|
904
984
|
let r;
|
|
905
|
-
return e[5] !==
|
|
906
|
-
},
|
|
907
|
-
const e =
|
|
985
|
+
return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ u(D, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
|
|
986
|
+
}, Bo = Do, nt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), Fo = (t) => {
|
|
987
|
+
const e = nt(t), n = e.replace(/_/g, "");
|
|
908
988
|
return [.../* @__PURE__ */ new Set([t, e, n])];
|
|
909
|
-
},
|
|
910
|
-
shell:
|
|
911
|
-
ls:
|
|
912
|
-
read_file:
|
|
913
|
-
write_file:
|
|
914
|
-
delete_file:
|
|
915
|
-
patch:
|
|
916
|
-
upload_files:
|
|
917
|
-
download_file:
|
|
918
|
-
move_file:
|
|
919
|
-
},
|
|
920
|
-
dot:
|
|
921
|
-
danger:
|
|
922
|
-
search:
|
|
923
|
-
browser:
|
|
924
|
-
file:
|
|
925
|
-
question:
|
|
926
|
-
todo:
|
|
927
|
-
terminal:
|
|
928
|
-
...
|
|
929
|
-
},
|
|
930
|
-
if (!t) return
|
|
931
|
-
const e =
|
|
932
|
-
if (
|
|
989
|
+
}, gn = {
|
|
990
|
+
shell: on,
|
|
991
|
+
ls: cs,
|
|
992
|
+
read_file: as,
|
|
993
|
+
write_file: ls,
|
|
994
|
+
delete_file: sn,
|
|
995
|
+
patch: is,
|
|
996
|
+
upload_files: rs,
|
|
997
|
+
download_file: os,
|
|
998
|
+
move_file: ss
|
|
999
|
+
}, Lo = {
|
|
1000
|
+
dot: hs,
|
|
1001
|
+
danger: rn,
|
|
1002
|
+
search: ms,
|
|
1003
|
+
browser: ps,
|
|
1004
|
+
file: fs,
|
|
1005
|
+
question: ds,
|
|
1006
|
+
todo: us,
|
|
1007
|
+
terminal: on,
|
|
1008
|
+
...gn
|
|
1009
|
+
}, qt = "dot", $o = (t) => Object.hasOwn(gn, t), Oo = (t) => Lo[t], bn = (t) => {
|
|
1010
|
+
if (!t) return qt;
|
|
1011
|
+
const e = nt(t);
|
|
1012
|
+
if ($o(e)) return e;
|
|
933
1013
|
const n = e.replace(/_/g, "");
|
|
934
1014
|
switch (e) {
|
|
935
1015
|
case "read":
|
|
@@ -956,52 +1036,52 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
|
|
|
956
1036
|
case "file":
|
|
957
1037
|
return "file";
|
|
958
1038
|
default:
|
|
959
|
-
return n === "todowrite" || n === "todo" ? "todo" :
|
|
1039
|
+
return n === "todowrite" || n === "todo" ? "todo" : qt;
|
|
960
1040
|
}
|
|
961
1041
|
};
|
|
962
|
-
function
|
|
1042
|
+
function Pt(t) {
|
|
963
1043
|
const e = t.lastIndexOf("/");
|
|
964
1044
|
return e >= 0 ? t.slice(e + 1) : t;
|
|
965
1045
|
}
|
|
966
|
-
function
|
|
1046
|
+
function Ze(t) {
|
|
967
1047
|
if (!t) return null;
|
|
968
1048
|
const e = t.split(" ")[0].trim();
|
|
969
1049
|
if (e === "/dev/null") return null;
|
|
970
1050
|
let n = e;
|
|
971
1051
|
return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
|
|
972
1052
|
}
|
|
973
|
-
const
|
|
1053
|
+
const st = (t) => t.startsWith("--- "), Et = (t) => t.startsWith("+++ "), Dt = (t) => t.startsWith("@@"), zo = (t) => t.startsWith("+") && !(Et(t) || t === "+++"), Qo = (t) => t.startsWith("-") && !(st(t) || t === "---"), qo = (t, e) => {
|
|
974
1054
|
t.has(e) || t.set(e, {
|
|
975
1055
|
additions: 0,
|
|
976
1056
|
deletions: 0
|
|
977
1057
|
});
|
|
978
|
-
},
|
|
1058
|
+
}, Wo = (t, e) => {
|
|
979
1059
|
const n = t.get(e);
|
|
980
1060
|
n && (n.additions += 1);
|
|
981
|
-
},
|
|
1061
|
+
}, Ho = (t, e) => {
|
|
982
1062
|
const n = t.get(e);
|
|
983
1063
|
n && (n.deletions += 1);
|
|
984
|
-
},
|
|
985
|
-
if (
|
|
1064
|
+
}, No = (t, e, n) => {
|
|
1065
|
+
if (st(t))
|
|
986
1066
|
return {
|
|
987
1067
|
...e,
|
|
988
|
-
lastMinusHeader:
|
|
1068
|
+
lastMinusHeader: Ze(t.slice(4)),
|
|
989
1069
|
inHunk: !1
|
|
990
1070
|
};
|
|
991
|
-
if (
|
|
992
|
-
const
|
|
993
|
-
return
|
|
1071
|
+
if (Et(t)) {
|
|
1072
|
+
const s = Ze(t.slice(4)) ?? e.lastMinusHeader;
|
|
1073
|
+
return s && qo(n, s), {
|
|
994
1074
|
...e,
|
|
995
|
-
currentPath:
|
|
1075
|
+
currentPath: s,
|
|
996
1076
|
inHunk: !1
|
|
997
1077
|
};
|
|
998
1078
|
}
|
|
999
|
-
return e.currentPath ?
|
|
1079
|
+
return e.currentPath ? Dt(t) ? {
|
|
1000
1080
|
...e,
|
|
1001
1081
|
inHunk: !0
|
|
1002
|
-
} : e.inHunk ?
|
|
1082
|
+
} : e.inHunk ? zo(t) ? (Wo(n, e.currentPath), e) : (Qo(t) && Ho(n, e.currentPath), e) : e : e;
|
|
1003
1083
|
};
|
|
1004
|
-
function
|
|
1084
|
+
function yn(t) {
|
|
1005
1085
|
if (!t || typeof t != "string") return [];
|
|
1006
1086
|
const e = /* @__PURE__ */ new Map();
|
|
1007
1087
|
let n = {
|
|
@@ -1009,34 +1089,34 @@ function hn(t) {
|
|
|
1009
1089
|
lastMinusHeader: null,
|
|
1010
1090
|
inHunk: !1
|
|
1011
1091
|
};
|
|
1012
|
-
const
|
|
1013
|
-
for (const
|
|
1014
|
-
n =
|
|
1015
|
-
return Array.from(e.entries()).map(([
|
|
1092
|
+
const o = t.split(/\r?\n/);
|
|
1093
|
+
for (const s of o)
|
|
1094
|
+
n = No(s, n, e);
|
|
1095
|
+
return Array.from(e.entries()).map(([s, {
|
|
1016
1096
|
additions: r,
|
|
1017
1097
|
deletions: i
|
|
1018
1098
|
}]) => ({
|
|
1019
|
-
filePath:
|
|
1099
|
+
filePath: s,
|
|
1020
1100
|
additions: r,
|
|
1021
1101
|
deletions: i
|
|
1022
1102
|
}));
|
|
1023
1103
|
}
|
|
1024
|
-
function
|
|
1025
|
-
return
|
|
1104
|
+
function Vo(t) {
|
|
1105
|
+
return yn(t).map((e) => ({
|
|
1026
1106
|
kind: "diff",
|
|
1027
|
-
fileName:
|
|
1107
|
+
fileName: Pt(e.filePath),
|
|
1028
1108
|
filePath: e.filePath,
|
|
1029
1109
|
additions: e.additions,
|
|
1030
1110
|
deletions: e.deletions
|
|
1031
1111
|
}));
|
|
1032
1112
|
}
|
|
1033
|
-
function
|
|
1034
|
-
return
|
|
1113
|
+
function Uo(t) {
|
|
1114
|
+
return yn(t).map((e) => e.filePath);
|
|
1035
1115
|
}
|
|
1036
|
-
const
|
|
1116
|
+
const xn = (t) => st(t) || t.startsWith("diff --git "), jo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ko = (t, e, n) => {
|
|
1037
1117
|
if (t.startsWith(" ")) {
|
|
1038
|
-
const
|
|
1039
|
-
e.push(
|
|
1118
|
+
const o = t.slice(1);
|
|
1119
|
+
e.push(o), n.push(o);
|
|
1040
1120
|
return;
|
|
1041
1121
|
}
|
|
1042
1122
|
if (t.startsWith("-")) {
|
|
@@ -1044,30 +1124,30 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
|
|
|
1044
1124
|
return;
|
|
1045
1125
|
}
|
|
1046
1126
|
t.startsWith("+") && n.push(t.slice(1));
|
|
1047
|
-
},
|
|
1048
|
-
let
|
|
1049
|
-
for (;
|
|
1050
|
-
const r = t[
|
|
1051
|
-
if (
|
|
1127
|
+
}, Xo = (t, e, n, o) => {
|
|
1128
|
+
let s = e;
|
|
1129
|
+
for (; s < t.length; ) {
|
|
1130
|
+
const r = t[s] || "";
|
|
1131
|
+
if (xn(r) || Dt(r) || jo(r))
|
|
1052
1132
|
break;
|
|
1053
|
-
|
|
1133
|
+
Ko(r, n, o), s += 1;
|
|
1054
1134
|
}
|
|
1055
|
-
return (n.length > 0 ||
|
|
1056
|
-
},
|
|
1057
|
-
const n =
|
|
1058
|
-
if (!
|
|
1135
|
+
return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
|
|
1136
|
+
}, Go = (t, e) => {
|
|
1137
|
+
const n = Ze((t[e] || "").slice(4)), o = t[e + 1] || "";
|
|
1138
|
+
if (!Et(o)) return {
|
|
1059
1139
|
nextIndex: e + 1
|
|
1060
1140
|
};
|
|
1061
|
-
const r =
|
|
1141
|
+
const r = Ze(o.slice(4)) ?? n ?? "", i = [], l = [];
|
|
1062
1142
|
let a = e + 2;
|
|
1063
1143
|
for (; a < t.length; ) {
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
if (!
|
|
1144
|
+
const c = t[a] || "";
|
|
1145
|
+
if (xn(c)) break;
|
|
1146
|
+
if (!Dt(c)) {
|
|
1067
1147
|
a += 1;
|
|
1068
1148
|
continue;
|
|
1069
1149
|
}
|
|
1070
|
-
a =
|
|
1150
|
+
a = Xo(t, a + 1, i, l);
|
|
1071
1151
|
}
|
|
1072
1152
|
return {
|
|
1073
1153
|
nextIndex: a,
|
|
@@ -1080,25 +1160,25 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
|
|
|
1080
1160
|
}
|
|
1081
1161
|
};
|
|
1082
1162
|
};
|
|
1083
|
-
function
|
|
1163
|
+
function Yo(t) {
|
|
1084
1164
|
if (!t || typeof t != "string") return [];
|
|
1085
1165
|
const e = t.split(/\r?\n/), n = [];
|
|
1086
|
-
let
|
|
1087
|
-
for (;
|
|
1088
|
-
const
|
|
1089
|
-
if (!
|
|
1090
|
-
|
|
1166
|
+
let o = 0;
|
|
1167
|
+
for (; o < e.length; ) {
|
|
1168
|
+
const s = e[o] || "";
|
|
1169
|
+
if (!st(s)) {
|
|
1170
|
+
o += 1;
|
|
1091
1171
|
continue;
|
|
1092
1172
|
}
|
|
1093
1173
|
const {
|
|
1094
1174
|
nextIndex: r,
|
|
1095
1175
|
preview: i
|
|
1096
|
-
} =
|
|
1097
|
-
i && n.push(i),
|
|
1176
|
+
} = Go(e, o);
|
|
1177
|
+
i && n.push(i), o = Math.max(r, o + 1);
|
|
1098
1178
|
}
|
|
1099
1179
|
return n;
|
|
1100
1180
|
}
|
|
1101
|
-
const
|
|
1181
|
+
const Jo = {
|
|
1102
1182
|
apply_patch: "Apply patch",
|
|
1103
1183
|
bash: "Run command",
|
|
1104
1184
|
edit: "Edit file",
|
|
@@ -1107,143 +1187,143 @@ const Uo = {
|
|
|
1107
1187
|
read: "Read file",
|
|
1108
1188
|
skill: "Load skill",
|
|
1109
1189
|
todowrite: "Update todos"
|
|
1110
|
-
},
|
|
1190
|
+
}, Wt = {
|
|
1111
1191
|
error: "failed",
|
|
1112
1192
|
"output-error": "failed",
|
|
1113
1193
|
input_streaming: "running",
|
|
1114
1194
|
running: "running",
|
|
1115
1195
|
completed: "completed",
|
|
1116
1196
|
failed: "failed"
|
|
1117
|
-
},
|
|
1118
|
-
const e =
|
|
1119
|
-
return
|
|
1120
|
-
},
|
|
1197
|
+
}, Sn = (t) => t.replace(/^tool-/, "").toLowerCase(), Zo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), er = (t) => Sn(t.tool ?? "tool"), tr = (t) => {
|
|
1198
|
+
const e = Sn(t);
|
|
1199
|
+
return Jo[e] ?? Zo(e.replace(/_/g, " "));
|
|
1200
|
+
}, nr = (t) => {
|
|
1121
1201
|
const e = t.state?.status ?? t.status;
|
|
1122
1202
|
if (!e || typeof e != "string") return null;
|
|
1123
1203
|
const n = e.replace(/-/g, "_");
|
|
1124
|
-
return
|
|
1125
|
-
},
|
|
1204
|
+
return Wt[n] ? Wt[n] : n.includes("stream") ? "running" : null;
|
|
1205
|
+
}, wn = (t) => {
|
|
1126
1206
|
const e = t.state?.status ?? t.status;
|
|
1127
1207
|
return e === "error" || e === "output-error" || e === "failed";
|
|
1128
|
-
},
|
|
1208
|
+
}, fe = (t) => wn(t) ? {
|
|
1129
1209
|
type: "icon",
|
|
1130
1210
|
icon: "danger"
|
|
1131
1211
|
} : {
|
|
1132
1212
|
type: "icon",
|
|
1133
|
-
icon:
|
|
1134
|
-
},
|
|
1213
|
+
icon: bn(er(t))
|
|
1214
|
+
}, pe = (t, e, n, o) => {
|
|
1135
1215
|
const r = [{
|
|
1136
1216
|
kind: "text",
|
|
1137
|
-
text: n ??
|
|
1217
|
+
text: n ?? tr(t.tool ?? "tool"),
|
|
1138
1218
|
bold: !0
|
|
1139
1219
|
}];
|
|
1140
1220
|
e && r.push({
|
|
1141
1221
|
kind: "text",
|
|
1142
1222
|
text: e,
|
|
1143
1223
|
muted: !0,
|
|
1144
|
-
...
|
|
1224
|
+
...o === "monospace" ? {
|
|
1145
1225
|
truncate: !0,
|
|
1146
1226
|
monospace: !0
|
|
1147
1227
|
} : {}
|
|
1148
1228
|
});
|
|
1149
|
-
const i =
|
|
1229
|
+
const i = nr(t);
|
|
1150
1230
|
return i && i !== "completed" && r.push({
|
|
1151
1231
|
kind: "text",
|
|
1152
1232
|
text: i,
|
|
1153
1233
|
muted: !0
|
|
1154
1234
|
}), r;
|
|
1155
|
-
},
|
|
1235
|
+
}, xe = (t) => {
|
|
1156
1236
|
const e = t.state?.input;
|
|
1157
1237
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1158
|
-
},
|
|
1238
|
+
}, He = (t) => {
|
|
1159
1239
|
const e = t.state?.output;
|
|
1160
1240
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1161
|
-
},
|
|
1162
|
-
const n =
|
|
1163
|
-
return n ?
|
|
1164
|
-
},
|
|
1241
|
+
}, v = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, qe = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, sr = (t, e) => {
|
|
1242
|
+
const n = qe(t.state);
|
|
1243
|
+
return n ? qe(n[e]) : null;
|
|
1244
|
+
}, Tn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), or = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), An = (t) => {
|
|
1245
|
+
const e = He(t);
|
|
1246
|
+
return [sr(t, "metadata"), qe(e?.metadata)].filter(Boolean);
|
|
1247
|
+
}, rr = (t) => {
|
|
1165
1248
|
const e = qe(t);
|
|
1166
|
-
return [Yo(t, "metadata"), ze(e?.metadata)].filter(Boolean);
|
|
1167
|
-
}, Zo = (t) => {
|
|
1168
|
-
const e = ze(t);
|
|
1169
1249
|
if (!e) return null;
|
|
1170
|
-
const n =
|
|
1250
|
+
const n = v(e.filePath) ?? v(e.relativePath) ?? v(e.path);
|
|
1171
1251
|
return n ? {
|
|
1172
|
-
filePath:
|
|
1252
|
+
filePath: Tn(n),
|
|
1173
1253
|
additions: typeof e.additions == "number" ? e.additions : 0,
|
|
1174
1254
|
deletions: typeof e.deletions == "number" ? e.deletions : 0,
|
|
1175
|
-
diff:
|
|
1176
|
-
before:
|
|
1177
|
-
after:
|
|
1255
|
+
diff: v(e.diff) ?? void 0,
|
|
1256
|
+
before: v(e.before) ?? void 0,
|
|
1257
|
+
after: v(e.after) ?? void 0
|
|
1178
1258
|
} : null;
|
|
1179
|
-
},
|
|
1259
|
+
}, Cn = (t) => {
|
|
1180
1260
|
const e = [];
|
|
1181
|
-
for (const n of
|
|
1182
|
-
const
|
|
1183
|
-
for (const
|
|
1184
|
-
const r =
|
|
1261
|
+
for (const n of An(t)) {
|
|
1262
|
+
const o = Array.isArray(n.files) ? n.files : [];
|
|
1263
|
+
for (const s of o) {
|
|
1264
|
+
const r = rr(s);
|
|
1185
1265
|
r && e.push(r);
|
|
1186
1266
|
}
|
|
1187
1267
|
}
|
|
1188
1268
|
return e;
|
|
1189
|
-
},
|
|
1190
|
-
const e =
|
|
1191
|
-
return Array.from(new Set(
|
|
1192
|
-
},
|
|
1193
|
-
const e =
|
|
1269
|
+
}, ir = (t) => {
|
|
1270
|
+
const e = xe(t), o = (Array.isArray(e?.changes) ? e.changes : []).map((s) => v(qe(s)?.path)).filter((s) => !!s).map(Tn);
|
|
1271
|
+
return Array.from(new Set(o));
|
|
1272
|
+
}, lr = (t) => {
|
|
1273
|
+
const e = xe(t), n = v(e?.diff);
|
|
1194
1274
|
if (n) return n;
|
|
1195
|
-
for (const r of
|
|
1196
|
-
const i =
|
|
1275
|
+
for (const r of An(t)) {
|
|
1276
|
+
const i = v(r.diff);
|
|
1197
1277
|
if (i) return i;
|
|
1198
1278
|
}
|
|
1199
|
-
const
|
|
1200
|
-
if (
|
|
1279
|
+
const o = Cn(t).map((r) => r.diff).filter((r) => !!r);
|
|
1280
|
+
if (o.length > 0) return o.join(`
|
|
1201
1281
|
`);
|
|
1202
|
-
const
|
|
1203
|
-
return
|
|
1204
|
-
},
|
|
1282
|
+
const s = v(e?.patchText);
|
|
1283
|
+
return s && or(s) ? s : null;
|
|
1284
|
+
}, ar = (t) => {
|
|
1205
1285
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
1206
|
-
for (const
|
|
1207
|
-
e.has(
|
|
1286
|
+
for (const o of t)
|
|
1287
|
+
e.has(o.filePath) || (e.add(o.filePath), n.push({
|
|
1208
1288
|
kind: "diff",
|
|
1209
|
-
fileName:
|
|
1210
|
-
filePath:
|
|
1211
|
-
additions:
|
|
1212
|
-
deletions:
|
|
1289
|
+
fileName: Pt(o.filePath),
|
|
1290
|
+
filePath: o.filePath,
|
|
1291
|
+
additions: o.additions,
|
|
1292
|
+
deletions: o.deletions
|
|
1213
1293
|
}));
|
|
1214
1294
|
return n;
|
|
1215
|
-
},
|
|
1216
|
-
const e =
|
|
1217
|
-
return
|
|
1218
|
-
},
|
|
1295
|
+
}, cr = (t) => Array.from(new Set(t.map((e) => e.filePath))), ot = (t) => {
|
|
1296
|
+
const e = He(t);
|
|
1297
|
+
return v(t.state?.output) ?? v(e?.returnDisplay) ?? v(e?.preview) ?? v(e?.stdout) ?? v(e?.content);
|
|
1298
|
+
}, ur = (t) => {
|
|
1219
1299
|
const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
|
|
1220
1300
|
return e ? {
|
|
1221
|
-
skillName:
|
|
1222
|
-
content:
|
|
1301
|
+
skillName: v(e[1]) ?? void 0,
|
|
1302
|
+
content: v(e[2]) ?? ""
|
|
1223
1303
|
} : null;
|
|
1224
|
-
},
|
|
1225
|
-
const e =
|
|
1226
|
-
return
|
|
1227
|
-
},
|
|
1304
|
+
}, dr = (t) => {
|
|
1305
|
+
const e = xe(t);
|
|
1306
|
+
return v(e?.name) ?? v(e?.skillName) ?? v(e?.skill) ?? v(e?.skill_name) ?? void 0;
|
|
1307
|
+
}, Bt = (t, e) => ({
|
|
1228
1308
|
kind: "link",
|
|
1229
|
-
text:
|
|
1309
|
+
text: Pt(t),
|
|
1230
1310
|
filePath: t,
|
|
1231
1311
|
...e ? {
|
|
1232
1312
|
variant: e
|
|
1233
1313
|
} : {}
|
|
1234
|
-
}),
|
|
1314
|
+
}), me = (t, e) => !wn(t) || !t.state?.errorText ? e : [{
|
|
1235
1315
|
type: "comment",
|
|
1236
1316
|
text: t.state.errorText
|
|
1237
|
-
}, ...e],
|
|
1317
|
+
}, ...e], kn = (t) => Yo(t ?? void 0).map((e) => ({
|
|
1238
1318
|
type: "diff",
|
|
1239
1319
|
language: "diff",
|
|
1240
1320
|
original: e.original,
|
|
1241
1321
|
modified: e.modified,
|
|
1242
1322
|
sideBySide: !1
|
|
1243
|
-
})),
|
|
1244
|
-
const e =
|
|
1245
|
-
r.length > 0 ?
|
|
1246
|
-
const i = [...
|
|
1323
|
+
})), fr = (t) => Vo(t ?? void 0), pr = (t) => Uo(t ?? void 0), mr = (t) => {
|
|
1324
|
+
const e = lr(t), n = Cn(t), o = ir(t), s = pe(t, void 0, "Apply patch"), r = fr(e);
|
|
1325
|
+
r.length > 0 ? s.push(...r) : n.length > 0 ? s.push(...ar(n)) : s.push(...o.map((l) => Bt(l, "bubble")));
|
|
1326
|
+
const i = [...kn(e)];
|
|
1247
1327
|
if (i.length === 0)
|
|
1248
1328
|
for (const l of n)
|
|
1249
1329
|
!l.before && !l.after || i.push({
|
|
@@ -1254,92 +1334,92 @@ const Uo = {
|
|
|
1254
1334
|
sideBySide: !1
|
|
1255
1335
|
});
|
|
1256
1336
|
if (i.length === 0) {
|
|
1257
|
-
const l =
|
|
1258
|
-
l.length === 0 && l.push(...
|
|
1337
|
+
const l = pr(e);
|
|
1338
|
+
l.length === 0 && l.push(...cr(n)), l.length === 0 && l.push(...o), l.length > 0 && i.push({
|
|
1259
1339
|
type: "references",
|
|
1260
1340
|
references: l
|
|
1261
1341
|
});
|
|
1262
1342
|
}
|
|
1263
1343
|
return {
|
|
1264
|
-
indicator:
|
|
1265
|
-
title:
|
|
1266
|
-
blocks:
|
|
1344
|
+
indicator: fe(t),
|
|
1345
|
+
title: s,
|
|
1346
|
+
blocks: me(t, i)
|
|
1267
1347
|
};
|
|
1268
|
-
},
|
|
1348
|
+
}, hr = (t, e) => [{
|
|
1269
1349
|
type: "diff",
|
|
1270
1350
|
language: "text",
|
|
1271
1351
|
original: t,
|
|
1272
1352
|
modified: e,
|
|
1273
1353
|
sideBySide: !1
|
|
1274
|
-
}],
|
|
1275
|
-
const e =
|
|
1276
|
-
|
|
1277
|
-
const l =
|
|
1354
|
+
}], gr = (t) => {
|
|
1355
|
+
const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(n?.filePath) ?? void 0, s = v(n?.oldString) ?? v(e?.old_string) ?? void 0, r = v(n?.newString) ?? v(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
|
|
1356
|
+
o && i.push(Bt(o));
|
|
1357
|
+
const l = s !== void 0 && r !== void 0 ? hr(s, r) : kn(v(n?.diff));
|
|
1278
1358
|
return {
|
|
1279
|
-
indicator:
|
|
1359
|
+
indicator: fe(t),
|
|
1280
1360
|
title: i,
|
|
1281
|
-
blocks:
|
|
1361
|
+
blocks: me(t, l)
|
|
1282
1362
|
};
|
|
1283
|
-
},
|
|
1363
|
+
}, br = (t) => {
|
|
1284
1364
|
const {
|
|
1285
1365
|
buildBaseTitle: e,
|
|
1286
1366
|
buildIndicator: n,
|
|
1287
|
-
prependErrorBlock:
|
|
1367
|
+
prependErrorBlock: o
|
|
1288
1368
|
} = t;
|
|
1289
|
-
return (
|
|
1290
|
-
const r =
|
|
1369
|
+
return (s) => {
|
|
1370
|
+
const r = ue(s.state?.output) ?? ue(s.state?.metadata), i = mn(s.state?.input), l = i ? {
|
|
1291
1371
|
type: "question-form",
|
|
1292
1372
|
questions: i.questions
|
|
1293
1373
|
} : null;
|
|
1294
1374
|
if (!r && !l) return null;
|
|
1295
|
-
const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0,
|
|
1375
|
+
const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [l];
|
|
1296
1376
|
return {
|
|
1297
|
-
indicator: n(
|
|
1298
|
-
title: e(
|
|
1299
|
-
blocks: s
|
|
1377
|
+
indicator: n(s),
|
|
1378
|
+
title: e(s, a, "Question"),
|
|
1379
|
+
blocks: o(s, c),
|
|
1300
1380
|
expandable: !1
|
|
1301
1381
|
};
|
|
1302
1382
|
};
|
|
1303
|
-
},
|
|
1304
|
-
const e =
|
|
1305
|
-
return
|
|
1306
|
-
indicator:
|
|
1307
|
-
title:
|
|
1308
|
-
blocks:
|
|
1383
|
+
}, yr = (t) => {
|
|
1384
|
+
const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(e?.file) ?? v(n?.filePath) ?? v(n?.file) ?? v(n?.path) ?? void 0, s = pe(t, void 0, "Read file");
|
|
1385
|
+
return o && s.push(Bt(o)), {
|
|
1386
|
+
indicator: fe(t),
|
|
1387
|
+
title: s,
|
|
1388
|
+
blocks: me(t, [])
|
|
1309
1389
|
};
|
|
1310
|
-
},
|
|
1311
|
-
const n =
|
|
1390
|
+
}, In = (t, e) => {
|
|
1391
|
+
const n = xe(t), o = He(t), s = v(n?.command) ?? void 0, r = pe(t, s, e, "monospace"), i = [], l = ot(t);
|
|
1312
1392
|
l && i.push({
|
|
1313
1393
|
type: "code",
|
|
1314
1394
|
language: "text",
|
|
1315
1395
|
code: l
|
|
1316
1396
|
});
|
|
1317
|
-
const a =
|
|
1397
|
+
const a = v(o?.stderr);
|
|
1318
1398
|
return a && a !== l && i.push({
|
|
1319
1399
|
type: "code",
|
|
1320
1400
|
language: "text",
|
|
1321
1401
|
code: a
|
|
1322
|
-
}), typeof
|
|
1402
|
+
}), typeof o?.exitCode == "number" && i.push({
|
|
1323
1403
|
type: "text",
|
|
1324
|
-
text: `Exit code: ${
|
|
1404
|
+
text: `Exit code: ${o.exitCode}`
|
|
1325
1405
|
}), {
|
|
1326
|
-
indicator:
|
|
1406
|
+
indicator: fe(t),
|
|
1327
1407
|
title: r,
|
|
1328
|
-
blocks:
|
|
1408
|
+
blocks: me(t, i)
|
|
1329
1409
|
};
|
|
1330
|
-
},
|
|
1331
|
-
const e =
|
|
1410
|
+
}, xr = (t) => In(t, "Run command"), Sr = (t) => In(t, "Shell"), wr = (t) => {
|
|
1411
|
+
const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Search files"), r = n ? [{
|
|
1332
1412
|
type: "code",
|
|
1333
1413
|
language: "text",
|
|
1334
1414
|
code: n
|
|
1335
1415
|
}] : [];
|
|
1336
1416
|
return {
|
|
1337
|
-
indicator:
|
|
1338
|
-
title:
|
|
1339
|
-
blocks:
|
|
1417
|
+
indicator: fe(t),
|
|
1418
|
+
title: s,
|
|
1419
|
+
blocks: me(t, r)
|
|
1340
1420
|
};
|
|
1341
|
-
},
|
|
1342
|
-
const e =
|
|
1421
|
+
}, Tr = (t) => {
|
|
1422
|
+
const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Find files"), r = [];
|
|
1343
1423
|
if (n) {
|
|
1344
1424
|
const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
|
|
1345
1425
|
i.length > 0 && r.push({
|
|
@@ -1348,63 +1428,63 @@ const Uo = {
|
|
|
1348
1428
|
});
|
|
1349
1429
|
}
|
|
1350
1430
|
return {
|
|
1351
|
-
indicator:
|
|
1352
|
-
title:
|
|
1353
|
-
blocks:
|
|
1431
|
+
indicator: fe(t),
|
|
1432
|
+
title: s,
|
|
1433
|
+
blocks: me(t, r)
|
|
1354
1434
|
};
|
|
1355
|
-
},
|
|
1356
|
-
const e =
|
|
1435
|
+
}, Ar = (t) => {
|
|
1436
|
+
const e = ot(t), n = e ? ur(e) : null, o = dr(t) ?? n?.skillName, s = pe(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
|
|
1357
1437
|
type: "code",
|
|
1358
1438
|
language: "markdown",
|
|
1359
1439
|
code: r
|
|
1360
1440
|
}] : [];
|
|
1361
1441
|
return {
|
|
1362
|
-
indicator:
|
|
1363
|
-
title:
|
|
1364
|
-
blocks:
|
|
1442
|
+
indicator: fe(t),
|
|
1443
|
+
title: s,
|
|
1444
|
+
blocks: me(t, i)
|
|
1365
1445
|
};
|
|
1366
|
-
},
|
|
1367
|
-
const e =
|
|
1446
|
+
}, yt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, _n = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Cr = (t) => {
|
|
1447
|
+
const e = _n(t);
|
|
1368
1448
|
if (!e) return null;
|
|
1369
|
-
const n =
|
|
1449
|
+
const n = yt(e.content) ?? yt(e.title);
|
|
1370
1450
|
if (!n) return null;
|
|
1371
|
-
const
|
|
1451
|
+
const o = yt(e.status);
|
|
1372
1452
|
return {
|
|
1373
1453
|
label: n,
|
|
1374
|
-
checked:
|
|
1454
|
+
checked: o === "completed"
|
|
1375
1455
|
};
|
|
1376
|
-
},
|
|
1456
|
+
}, Ht = (t) => {
|
|
1377
1457
|
if (!t) return {
|
|
1378
1458
|
items: [],
|
|
1379
1459
|
explicit: !1
|
|
1380
1460
|
};
|
|
1381
1461
|
const e = (() => {
|
|
1382
1462
|
if (Array.isArray(t)) return t;
|
|
1383
|
-
const n =
|
|
1463
|
+
const n = _n(t);
|
|
1384
1464
|
return !n || !Array.isArray(n.todos) ? null : n.todos;
|
|
1385
1465
|
})();
|
|
1386
1466
|
return e ? {
|
|
1387
|
-
items: e.map(
|
|
1467
|
+
items: e.map(Cr).filter((n) => n !== null),
|
|
1388
1468
|
explicit: !0
|
|
1389
1469
|
} : {
|
|
1390
1470
|
items: [],
|
|
1391
1471
|
explicit: !1
|
|
1392
1472
|
};
|
|
1393
|
-
},
|
|
1473
|
+
}, kr = (t) => {
|
|
1394
1474
|
const {
|
|
1395
1475
|
buildBaseTitle: e,
|
|
1396
1476
|
buildIndicator: n,
|
|
1397
|
-
prependErrorBlock:
|
|
1477
|
+
prependErrorBlock: o
|
|
1398
1478
|
} = t;
|
|
1399
|
-
return (
|
|
1400
|
-
const r =
|
|
1479
|
+
return (s) => {
|
|
1480
|
+
const r = Ht(s.state?.input), i = Ht(s.state?.output), l = i.explicit ? i : r;
|
|
1401
1481
|
if (!l.explicit) return null;
|
|
1402
|
-
const a = l.items,
|
|
1482
|
+
const a = l.items, c = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(s, c, "Update todos");
|
|
1403
1483
|
if (a.length === 0)
|
|
1404
1484
|
return {
|
|
1405
|
-
indicator: n(
|
|
1485
|
+
indicator: n(s),
|
|
1406
1486
|
title: d,
|
|
1407
|
-
blocks: s
|
|
1487
|
+
blocks: o(s, [{
|
|
1408
1488
|
type: "comment",
|
|
1409
1489
|
text: "No todos"
|
|
1410
1490
|
}])
|
|
@@ -1414,45 +1494,45 @@ const Uo = {
|
|
|
1414
1494
|
items: a
|
|
1415
1495
|
}];
|
|
1416
1496
|
return {
|
|
1417
|
-
indicator: n(
|
|
1497
|
+
indicator: n(s),
|
|
1418
1498
|
title: d,
|
|
1419
|
-
blocks: s
|
|
1499
|
+
blocks: o(s, f)
|
|
1420
1500
|
};
|
|
1421
1501
|
};
|
|
1422
|
-
},
|
|
1423
|
-
buildBaseTitle:
|
|
1424
|
-
buildIndicator:
|
|
1425
|
-
prependErrorBlock:
|
|
1426
|
-
}),
|
|
1427
|
-
buildBaseTitle:
|
|
1428
|
-
buildIndicator:
|
|
1429
|
-
prependErrorBlock:
|
|
1430
|
-
}),
|
|
1431
|
-
apply_patch:
|
|
1432
|
-
bash:
|
|
1433
|
-
edit:
|
|
1434
|
-
glob:
|
|
1435
|
-
grep:
|
|
1436
|
-
question:
|
|
1437
|
-
read:
|
|
1438
|
-
shell:
|
|
1439
|
-
skill:
|
|
1440
|
-
todo_write:
|
|
1441
|
-
todowrite:
|
|
1442
|
-
}),
|
|
1502
|
+
}, Ir = br({
|
|
1503
|
+
buildBaseTitle: pe,
|
|
1504
|
+
buildIndicator: fe,
|
|
1505
|
+
prependErrorBlock: me
|
|
1506
|
+
}), Nt = kr({
|
|
1507
|
+
buildBaseTitle: pe,
|
|
1508
|
+
buildIndicator: fe,
|
|
1509
|
+
prependErrorBlock: me
|
|
1510
|
+
}), Vt = () => ({
|
|
1511
|
+
apply_patch: mr,
|
|
1512
|
+
bash: xr,
|
|
1513
|
+
edit: gr,
|
|
1514
|
+
glob: Tr,
|
|
1515
|
+
grep: wr,
|
|
1516
|
+
question: Ir,
|
|
1517
|
+
read: yr,
|
|
1518
|
+
shell: Sr,
|
|
1519
|
+
skill: Ar,
|
|
1520
|
+
todo_write: Nt,
|
|
1521
|
+
todowrite: Nt
|
|
1522
|
+
}), Ut = {
|
|
1443
1523
|
error: "failed",
|
|
1444
1524
|
"output-error": "failed",
|
|
1445
1525
|
"input-streaming": "running"
|
|
1446
|
-
},
|
|
1447
|
-
const e =
|
|
1448
|
-
return
|
|
1449
|
-
},
|
|
1526
|
+
}, _r = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), vn = (t) => {
|
|
1527
|
+
const e = nt(t ?? "tool").replace(/_/g, " ");
|
|
1528
|
+
return _r(e);
|
|
1529
|
+
}, Mn = (t) => t === "error" || t === "output-error", vr = (t) => Mn(t.state?.status) ? {
|
|
1450
1530
|
type: "icon",
|
|
1451
1531
|
icon: "danger"
|
|
1452
1532
|
} : {
|
|
1453
1533
|
type: "icon",
|
|
1454
|
-
icon:
|
|
1455
|
-
},
|
|
1534
|
+
icon: bn(t.tool ?? "tool")
|
|
1535
|
+
}, Mr = (t) => !t || typeof t != "string" ? null : Ut[t] ? Ut[t] : t.includes("stream") ? "running" : null, Rr = (t) => {
|
|
1456
1536
|
if (typeof t == "string") return t;
|
|
1457
1537
|
if (t == null) return null;
|
|
1458
1538
|
try {
|
|
@@ -1460,31 +1540,31 @@ const Uo = {
|
|
|
1460
1540
|
} catch {
|
|
1461
1541
|
return null;
|
|
1462
1542
|
}
|
|
1463
|
-
},
|
|
1464
|
-
const n =
|
|
1543
|
+
}, At = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(At) : typeof t == "object" ? Object.values(t).every(At) : !1, rt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), jt = (t) => !!t?.startsWith("image/"), Er = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, Rn = (t, e) => {
|
|
1544
|
+
const n = rt(t);
|
|
1465
1545
|
if (!n) return null;
|
|
1466
|
-
const
|
|
1467
|
-
if (
|
|
1546
|
+
const o = Pr(n), s = N(n.data);
|
|
1547
|
+
if (s && jt(o))
|
|
1468
1548
|
return {
|
|
1469
1549
|
type: "image",
|
|
1470
|
-
src: `data:${
|
|
1550
|
+
src: `data:${o};base64,${s}`,
|
|
1471
1551
|
alt: e
|
|
1472
1552
|
};
|
|
1473
1553
|
const r = N(n.url) ?? N(n.src);
|
|
1474
|
-
return r && (
|
|
1554
|
+
return r && (jt(o) || Er.test(r)) ? {
|
|
1475
1555
|
type: "image",
|
|
1476
1556
|
src: r,
|
|
1477
1557
|
alt: e
|
|
1478
1558
|
} : null;
|
|
1479
|
-
},
|
|
1480
|
-
const e =
|
|
1559
|
+
}, Pn = (t) => {
|
|
1560
|
+
const e = rt(t);
|
|
1481
1561
|
if (!e) return null;
|
|
1482
|
-
const n = N(e.path) ?? N(e.filePath) ?? N(e.filename),
|
|
1483
|
-
return !n ||
|
|
1562
|
+
const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), o = N(e.content) ?? N(e.body) ?? N(e.text);
|
|
1563
|
+
return !n || o === null ? null : {
|
|
1484
1564
|
filePath: n,
|
|
1485
|
-
content:
|
|
1565
|
+
content: o
|
|
1486
1566
|
};
|
|
1487
|
-
},
|
|
1567
|
+
}, Dr = {
|
|
1488
1568
|
css: "css",
|
|
1489
1569
|
html: "html",
|
|
1490
1570
|
js: "js",
|
|
@@ -1496,88 +1576,88 @@ const Uo = {
|
|
|
1496
1576
|
tsx: "tsx",
|
|
1497
1577
|
yaml: "yaml",
|
|
1498
1578
|
yml: "yaml"
|
|
1499
|
-
},
|
|
1579
|
+
}, Br = (t) => {
|
|
1500
1580
|
const e = t.split(".").pop()?.toLowerCase();
|
|
1501
|
-
return e ?
|
|
1502
|
-
},
|
|
1581
|
+
return e ? Dr[e] ?? e : "text";
|
|
1582
|
+
}, Kt = (t, e) => e.length === 0 ? [] : [{
|
|
1503
1583
|
type: "text",
|
|
1504
1584
|
text: t
|
|
1505
|
-
}, ...e],
|
|
1585
|
+
}, ...e], Fr = (t, e) => {
|
|
1506
1586
|
const n = [];
|
|
1507
|
-
for (const
|
|
1508
|
-
const
|
|
1587
|
+
for (const o of t) {
|
|
1588
|
+
const s = rt(o), r = N(s?.type);
|
|
1509
1589
|
if (r === "image") {
|
|
1510
|
-
const i =
|
|
1590
|
+
const i = Rn(o, e);
|
|
1511
1591
|
i && n.push(i);
|
|
1512
1592
|
continue;
|
|
1513
1593
|
}
|
|
1514
1594
|
if (r === "text") {
|
|
1515
|
-
const i = N(
|
|
1595
|
+
const i = N(s?.text);
|
|
1516
1596
|
i && n.push({
|
|
1517
1597
|
type: "text",
|
|
1518
1598
|
text: i
|
|
1519
1599
|
});
|
|
1520
1600
|
continue;
|
|
1521
1601
|
}
|
|
1522
|
-
n.push(...
|
|
1602
|
+
n.push(...Ct(o, e));
|
|
1523
1603
|
}
|
|
1524
1604
|
return n;
|
|
1525
|
-
},
|
|
1526
|
-
const e =
|
|
1605
|
+
}, Lr = (t) => {
|
|
1606
|
+
const e = Pn(t);
|
|
1527
1607
|
return e ? [{
|
|
1528
1608
|
type: "code",
|
|
1529
|
-
language:
|
|
1609
|
+
language: Br(e.filePath),
|
|
1530
1610
|
code: e.content
|
|
1531
1611
|
}] : null;
|
|
1532
|
-
},
|
|
1533
|
-
const e =
|
|
1534
|
-
return !n && !
|
|
1612
|
+
}, $r = (t) => {
|
|
1613
|
+
const e = rt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), o = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
|
|
1614
|
+
return !n && !o ? null : [{
|
|
1535
1615
|
type: "text",
|
|
1536
|
-
text: n ?? `Attachment ${
|
|
1616
|
+
text: n ?? `Attachment ${o}`
|
|
1537
1617
|
}];
|
|
1538
|
-
},
|
|
1539
|
-
if (
|
|
1540
|
-
const n =
|
|
1618
|
+
}, Ct = (t, e) => {
|
|
1619
|
+
if (At(t)) return [];
|
|
1620
|
+
const n = Rn(t, e);
|
|
1541
1621
|
if (n) return [n];
|
|
1542
|
-
if (Array.isArray(t)) return
|
|
1543
|
-
const
|
|
1544
|
-
if (s) return s;
|
|
1545
|
-
const o = Pr(t);
|
|
1622
|
+
if (Array.isArray(t)) return Fr(t, e);
|
|
1623
|
+
const o = Lr(t);
|
|
1546
1624
|
if (o) return o;
|
|
1547
|
-
const
|
|
1625
|
+
const s = $r(t);
|
|
1626
|
+
if (s) return s;
|
|
1627
|
+
const r = Rr(t);
|
|
1548
1628
|
return r?.trim() ? [{
|
|
1549
1629
|
type: "code",
|
|
1550
1630
|
language: typeof t == "string" ? "text" : "json",
|
|
1551
1631
|
code: r
|
|
1552
1632
|
}] : [];
|
|
1553
|
-
},
|
|
1554
|
-
const e = [], n =
|
|
1555
|
-
return
|
|
1633
|
+
}, Or = (t) => {
|
|
1634
|
+
const e = [], n = vn(t.tool);
|
|
1635
|
+
return Mn(t.state?.status) && t.state?.errorText && e.push({
|
|
1556
1636
|
type: "comment",
|
|
1557
1637
|
text: t.state.errorText
|
|
1558
|
-
}), e.push(...
|
|
1559
|
-
},
|
|
1638
|
+
}), e.push(...Kt("Input", Ct(t.state?.input, `${n} input`))), e.push(...Kt("Output", Ct(t.state?.output, `${n} output`))), e;
|
|
1639
|
+
}, zr = (t) => {
|
|
1560
1640
|
const e = [{
|
|
1561
1641
|
kind: "text",
|
|
1562
|
-
text:
|
|
1642
|
+
text: vn(t.tool),
|
|
1563
1643
|
bold: !0
|
|
1564
|
-
}], n =
|
|
1644
|
+
}], n = Pn(t.state?.output);
|
|
1565
1645
|
n && e.push({
|
|
1566
1646
|
kind: "link",
|
|
1567
1647
|
text: n.filePath,
|
|
1568
1648
|
filePath: n.filePath
|
|
1569
1649
|
});
|
|
1570
|
-
const
|
|
1571
|
-
return
|
|
1650
|
+
const o = Mr(t.state?.status);
|
|
1651
|
+
return o && e.push({
|
|
1572
1652
|
kind: "text",
|
|
1573
|
-
text:
|
|
1653
|
+
text: o,
|
|
1574
1654
|
muted: !0
|
|
1575
1655
|
}), {
|
|
1576
|
-
indicator:
|
|
1656
|
+
indicator: vr(t),
|
|
1577
1657
|
title: e,
|
|
1578
|
-
blocks:
|
|
1658
|
+
blocks: Or(t)
|
|
1579
1659
|
};
|
|
1580
|
-
},
|
|
1660
|
+
}, Qr = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, qr = (t) => {
|
|
1581
1661
|
switch (t.type) {
|
|
1582
1662
|
case "comment":
|
|
1583
1663
|
case "code":
|
|
@@ -1597,355 +1677,355 @@ const Uo = {
|
|
|
1597
1677
|
case "component":
|
|
1598
1678
|
return !0;
|
|
1599
1679
|
}
|
|
1600
|
-
},
|
|
1601
|
-
const e = t.title.some(
|
|
1680
|
+
}, Wr = (t) => {
|
|
1681
|
+
const e = t.title.some(Qr), n = (t.blocks ?? []).some(qr);
|
|
1602
1682
|
return e || n;
|
|
1603
|
-
},
|
|
1604
|
-
...
|
|
1683
|
+
}, Hr = (t) => t ? {
|
|
1684
|
+
...Vt(),
|
|
1605
1685
|
...t
|
|
1606
|
-
} :
|
|
1686
|
+
} : Vt(), Nr = (t, e) => {
|
|
1607
1687
|
const n = t.tool ?? "tool";
|
|
1608
|
-
for (const
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1688
|
+
for (const o of Fo(n)) {
|
|
1689
|
+
const s = e[o];
|
|
1690
|
+
if (s) return s;
|
|
1611
1691
|
}
|
|
1612
|
-
},
|
|
1613
|
-
const
|
|
1614
|
-
if (
|
|
1615
|
-
const
|
|
1616
|
-
if (
|
|
1692
|
+
}, Vr = (t, e, n) => {
|
|
1693
|
+
const o = Nr(t, e);
|
|
1694
|
+
if (o) {
|
|
1695
|
+
const s = o(t, n);
|
|
1696
|
+
if (s) return s;
|
|
1617
1697
|
}
|
|
1618
|
-
return
|
|
1619
|
-
},
|
|
1620
|
-
const n =
|
|
1698
|
+
return zr(t);
|
|
1699
|
+
}, Ur = (t, e) => {
|
|
1700
|
+
const n = Hr(e?.toolRenderers);
|
|
1621
1701
|
return {
|
|
1622
|
-
items: t.map((
|
|
1702
|
+
items: t.map((s) => Vr(s, n, e)).filter(Wr)
|
|
1623
1703
|
};
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1704
|
+
}, En = (t, e, n, o = !1) => {
|
|
1705
|
+
o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
|
|
1626
1706
|
};
|
|
1627
|
-
function
|
|
1628
|
-
const e =
|
|
1707
|
+
function jr(t) {
|
|
1708
|
+
const e = C(6), {
|
|
1629
1709
|
seg: n
|
|
1630
1710
|
} = t;
|
|
1631
|
-
let s;
|
|
1632
|
-
e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
|
|
1633
1711
|
let o;
|
|
1634
|
-
e[
|
|
1712
|
+
e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
|
|
1713
|
+
let s;
|
|
1714
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
|
|
1635
1715
|
let r;
|
|
1636
|
-
return e[4] !==
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
] }), e[4] =
|
|
1716
|
+
return e[4] !== o ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
|
|
1717
|
+
o,
|
|
1718
|
+
s
|
|
1719
|
+
] }), e[4] = o, e[5] = r) : r = e[5], r;
|
|
1640
1720
|
}
|
|
1641
|
-
function
|
|
1642
|
-
const e =
|
|
1721
|
+
function Kr(t) {
|
|
1722
|
+
const e = C(9), {
|
|
1643
1723
|
seg: n,
|
|
1644
|
-
onOpenFile:
|
|
1645
|
-
} = t,
|
|
1724
|
+
onOpenFile: o
|
|
1725
|
+
} = t, s = n.additions ?? 0, r = n.deletions ?? 0;
|
|
1646
1726
|
let i;
|
|
1647
|
-
e[0] !==
|
|
1727
|
+
e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
|
|
1648
1728
|
const a = n.filePath ?? n.fileName;
|
|
1649
|
-
|
|
1650
|
-
}, e[0] =
|
|
1729
|
+
o?.(a);
|
|
1730
|
+
}, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
|
|
1651
1731
|
let l;
|
|
1652
|
-
return e[4] !== n.fileName || e[5] !==
|
|
1732
|
+
return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ u(vs, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
|
|
1653
1733
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const e =
|
|
1734
|
+
function Xr(t) {
|
|
1735
|
+
const e = C(13), {
|
|
1656
1736
|
seg: n,
|
|
1657
|
-
onOpenFile:
|
|
1658
|
-
} = t,
|
|
1659
|
-
let
|
|
1660
|
-
e[0] !==
|
|
1737
|
+
onOpenFile: o
|
|
1738
|
+
} = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
|
|
1739
|
+
let c;
|
|
1740
|
+
e[0] !== o || e[1] !== n ? (c = (p) => En(p, n, o, !0), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
|
|
1661
1741
|
const d = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1662
1742
|
let f;
|
|
1663
1743
|
e[3] !== d ? (f = {
|
|
1664
1744
|
textDecoration: "underline",
|
|
1665
1745
|
color: d
|
|
1666
1746
|
}, e[3] = d, e[4] = f) : f = e[4];
|
|
1667
|
-
let
|
|
1668
|
-
return e[5] !==
|
|
1747
|
+
let m;
|
|
1748
|
+
return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== c || e[11] !== f ? (m = /* @__PURE__ */ u(en, { href: i, fontWeight: s, color: l, textDecoration: "none", cursor: a, onClick: c, _hover: f, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = c, e[11] = f, e[12] = m) : m = e[12], m;
|
|
1669
1749
|
}
|
|
1670
|
-
function
|
|
1671
|
-
const e =
|
|
1750
|
+
function Gr(t) {
|
|
1751
|
+
const e = C(12), {
|
|
1672
1752
|
seg: n,
|
|
1673
|
-
onOpenFile:
|
|
1674
|
-
} = t,
|
|
1753
|
+
onOpenFile: o
|
|
1754
|
+
} = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
|
|
1675
1755
|
let l;
|
|
1676
|
-
e[0] !==
|
|
1756
|
+
e[0] !== o || e[1] !== n ? (l = (f) => En(f, n, o), e[0] = o, e[1] = n, e[2] = l) : l = e[2];
|
|
1677
1757
|
const a = n.muted ? "fg.muted" : "accent.primary";
|
|
1678
|
-
let
|
|
1679
|
-
e[3] !== a ? (
|
|
1758
|
+
let c;
|
|
1759
|
+
e[3] !== a ? (c = {
|
|
1680
1760
|
color: a,
|
|
1681
1761
|
textDecoration: "underline"
|
|
1682
|
-
}, e[3] = a, e[4] =
|
|
1762
|
+
}, e[3] = a, e[4] = c) : c = e[4];
|
|
1683
1763
|
let d;
|
|
1684
|
-
return e[5] !==
|
|
1764
|
+
return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== c ? (d = /* @__PURE__ */ u(en, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: l, _hover: c, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = c, e[11] = d) : d = e[11], d;
|
|
1685
1765
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const e =
|
|
1766
|
+
function Yr(t) {
|
|
1767
|
+
const e = C(14), {
|
|
1688
1768
|
seg: n,
|
|
1689
|
-
isClickable:
|
|
1690
|
-
} = t,
|
|
1769
|
+
isClickable: o
|
|
1770
|
+
} = t, s = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, c = n.truncate ? "nowrap" : void 0, d = o && !n.muted ? "fg" : "fg.muted";
|
|
1691
1771
|
let f;
|
|
1692
1772
|
e[0] !== d ? (f = {
|
|
1693
1773
|
color: d
|
|
1694
1774
|
}, e[0] = d, e[1] = f) : f = e[1];
|
|
1695
|
-
let
|
|
1696
|
-
e[2] !== n.text || e[3] !==
|
|
1697
|
-
const
|
|
1775
|
+
let m;
|
|
1776
|
+
e[2] !== n.text || e[3] !== s || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== f ? (m = /* @__PURE__ */ u(ze, { fontWeight: s, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: c, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = s, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = c, e[9] = f, e[10] = m) : m = e[10];
|
|
1777
|
+
const p = m;
|
|
1698
1778
|
if (!n.truncate)
|
|
1699
|
-
return
|
|
1779
|
+
return p;
|
|
1700
1780
|
let h;
|
|
1701
|
-
return e[11] !== n.text || e[12] !==
|
|
1781
|
+
return e[11] !== n.text || e[12] !== p ? (h = /* @__PURE__ */ u(vt, { content: n.text, children: p }), e[11] = n.text, e[12] = p, e[13] = h) : h = e[13], h;
|
|
1702
1782
|
}
|
|
1703
|
-
function
|
|
1704
|
-
const e =
|
|
1783
|
+
function Jr(t) {
|
|
1784
|
+
const e = C(11), {
|
|
1705
1785
|
seg: n,
|
|
1706
|
-
isClickable:
|
|
1707
|
-
onOpenFile:
|
|
1786
|
+
isClickable: o,
|
|
1787
|
+
onOpenFile: s
|
|
1708
1788
|
} = t;
|
|
1709
1789
|
switch (n.kind) {
|
|
1710
1790
|
case "avatar": {
|
|
1711
1791
|
let r;
|
|
1712
|
-
return e[0] !== n ? (r = /* @__PURE__ */
|
|
1792
|
+
return e[0] !== n ? (r = /* @__PURE__ */ u(jr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
|
|
1713
1793
|
}
|
|
1714
1794
|
case "diff": {
|
|
1715
1795
|
let r;
|
|
1716
|
-
return e[2] !==
|
|
1796
|
+
return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ u(Kr, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
|
|
1717
1797
|
}
|
|
1718
1798
|
case "link": {
|
|
1719
1799
|
let r;
|
|
1720
|
-
return e[5] !==
|
|
1800
|
+
return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ u(Xr, { seg: n, onOpenFile: s }) : /* @__PURE__ */ u(Gr, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
|
|
1721
1801
|
}
|
|
1722
1802
|
case "text": {
|
|
1723
1803
|
let r;
|
|
1724
|
-
return e[8] !==
|
|
1804
|
+
return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ u(Yr, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
|
|
1725
1805
|
}
|
|
1726
1806
|
default:
|
|
1727
1807
|
return null;
|
|
1728
1808
|
}
|
|
1729
1809
|
}
|
|
1730
|
-
const
|
|
1731
|
-
function
|
|
1732
|
-
const e =
|
|
1810
|
+
const ge = Kn;
|
|
1811
|
+
function Zr(t) {
|
|
1812
|
+
const e = C(10), {
|
|
1733
1813
|
ind: n
|
|
1734
1814
|
} = t;
|
|
1735
1815
|
if (!n || n.type === "none")
|
|
1736
1816
|
return null;
|
|
1737
1817
|
if (n.type === "icon") {
|
|
1738
1818
|
let i;
|
|
1739
|
-
e[0] !== n.icon ? (i =
|
|
1819
|
+
e[0] !== n.icon ? (i = Oo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
|
|
1740
1820
|
const l = i;
|
|
1741
1821
|
let a;
|
|
1742
|
-
return e[2] !== l ? (a = /* @__PURE__ */
|
|
1822
|
+
return e[2] !== l ? (a = /* @__PURE__ */ u(ge.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ u(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
|
|
1743
1823
|
}
|
|
1744
|
-
let s;
|
|
1745
|
-
e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
|
|
1746
1824
|
let o;
|
|
1747
|
-
e[
|
|
1825
|
+
e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
|
|
1826
|
+
let s;
|
|
1827
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
|
|
1748
1828
|
let r;
|
|
1749
|
-
return e[8] !==
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
] }) }), e[8] =
|
|
1829
|
+
return e[8] !== o ? (r = /* @__PURE__ */ u(ge.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
|
|
1830
|
+
o,
|
|
1831
|
+
s
|
|
1832
|
+
] }) }), e[8] = o, e[9] = r) : r = e[9], r;
|
|
1753
1833
|
}
|
|
1754
|
-
function
|
|
1755
|
-
const e =
|
|
1834
|
+
function ei(t) {
|
|
1835
|
+
const e = C(5), {
|
|
1756
1836
|
code: n,
|
|
1757
|
-
language:
|
|
1758
|
-
} = t,
|
|
1837
|
+
language: o
|
|
1838
|
+
} = t, s = o ? `${o} code block` : "code block";
|
|
1759
1839
|
let r;
|
|
1760
|
-
e[0] !== n ? (r = /* @__PURE__ */
|
|
1840
|
+
e[0] !== n ? (r = /* @__PURE__ */ u(D, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
|
|
1761
1841
|
let i;
|
|
1762
|
-
return e[2] !==
|
|
1842
|
+
return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ u(tt, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ u(D, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": s, children: r }) }), e[2] = s, e[3] = r, e[4] = i) : i = e[4], i;
|
|
1763
1843
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const e =
|
|
1844
|
+
function ti(t) {
|
|
1845
|
+
const e = C(38), {
|
|
1766
1846
|
b: n,
|
|
1767
|
-
onOpenFile:
|
|
1847
|
+
onOpenFile: o
|
|
1768
1848
|
} = t;
|
|
1769
1849
|
switch (n.type) {
|
|
1770
1850
|
case "comment": {
|
|
1771
|
-
let
|
|
1772
|
-
e[0] !== n.text ? (
|
|
1851
|
+
let s;
|
|
1852
|
+
e[0] !== n.text ? (s = /* @__PURE__ */ u(se.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
|
|
1773
1853
|
let r;
|
|
1774
|
-
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */
|
|
1854
|
+
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ u(se.Footer, { children: /* @__PURE__ */ k(Qe, { children: [
|
|
1775
1855
|
"👏 ",
|
|
1776
1856
|
n.reactions.clap
|
|
1777
1857
|
] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
|
|
1778
1858
|
let i;
|
|
1779
|
-
return e[4] !==
|
|
1780
|
-
|
|
1859
|
+
return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ k(se.Root, { children: [
|
|
1860
|
+
s,
|
|
1781
1861
|
r
|
|
1782
|
-
] }), e[4] =
|
|
1862
|
+
] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
|
|
1783
1863
|
}
|
|
1784
1864
|
case "code": {
|
|
1785
|
-
let
|
|
1786
|
-
return e[7] !== n.code || e[8] !== n.language ? (
|
|
1865
|
+
let s;
|
|
1866
|
+
return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(ei, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
|
|
1787
1867
|
}
|
|
1788
1868
|
case "diff": {
|
|
1789
|
-
const
|
|
1869
|
+
const s = n.sideBySide ?? !1;
|
|
1790
1870
|
let r;
|
|
1791
|
-
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !==
|
|
1871
|
+
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(D, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ u(Ms, { original: n.original, modified: n.modified, language: n.language, sideBySide: s, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = s, e[14] = r) : r = e[14], r;
|
|
1792
1872
|
}
|
|
1793
1873
|
case "text": {
|
|
1794
|
-
let
|
|
1795
|
-
return e[15] !== n.text ? (
|
|
1874
|
+
let s;
|
|
1875
|
+
return e[15] !== n.text ? (s = /* @__PURE__ */ u(se.Root, { background: "transparent", children: /* @__PURE__ */ u(se.Body, { padding: "sm", children: /* @__PURE__ */ u(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
|
|
1796
1876
|
}
|
|
1797
1877
|
case "todo-list": {
|
|
1798
|
-
let
|
|
1799
|
-
return e[17] !== n.items ? (
|
|
1878
|
+
let s;
|
|
1879
|
+
return e[17] !== n.items ? (s = /* @__PURE__ */ u(eo, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
|
|
1800
1880
|
}
|
|
1801
1881
|
case "question-form": {
|
|
1802
|
-
let
|
|
1803
|
-
return e[19] !== n.questions ? (
|
|
1882
|
+
let s;
|
|
1883
|
+
return e[19] !== n.questions ? (s = /* @__PURE__ */ u(fn, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
|
|
1804
1884
|
}
|
|
1805
1885
|
case "references": {
|
|
1806
|
-
let
|
|
1807
|
-
e[21] !== n.references ? (
|
|
1886
|
+
let s;
|
|
1887
|
+
e[21] !== n.references ? (s = n.references.map(ni), e[21] = n.references, e[22] = s) : s = e[22];
|
|
1808
1888
|
let r;
|
|
1809
|
-
return e[23] !==
|
|
1889
|
+
return e[23] !== s ? (r = /* @__PURE__ */ u(X, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
|
|
1810
1890
|
}
|
|
1811
1891
|
case "image": {
|
|
1812
1892
|
if (!n.src.trim())
|
|
1813
1893
|
return null;
|
|
1814
|
-
let
|
|
1815
|
-
e[25] !== n.alt || e[26] !== n.src ? (
|
|
1894
|
+
let s;
|
|
1895
|
+
e[25] !== n.alt || e[26] !== n.src ? (s = /* @__PURE__ */ u(tn, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = s) : s = e[27];
|
|
1816
1896
|
let r;
|
|
1817
|
-
e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */
|
|
1897
|
+
e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ u(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
|
|
1818
1898
|
let i;
|
|
1819
|
-
return e[30] !==
|
|
1820
|
-
|
|
1899
|
+
return e[30] !== s || e[31] !== r ? (i = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(se.Body, { padding: "0", children: [
|
|
1900
|
+
s,
|
|
1821
1901
|
r
|
|
1822
|
-
] }) }), e[30] =
|
|
1902
|
+
] }) }), e[30] = s, e[31] = r, e[32] = i) : i = e[32], i;
|
|
1823
1903
|
}
|
|
1824
1904
|
case "component": {
|
|
1825
|
-
let
|
|
1826
|
-
e[33] !== n || e[34] !==
|
|
1827
|
-
onOpenFile:
|
|
1828
|
-
}), e[33] = n, e[34] =
|
|
1905
|
+
let s;
|
|
1906
|
+
e[33] !== n || e[34] !== o ? (s = n.render({
|
|
1907
|
+
onOpenFile: o
|
|
1908
|
+
}), e[33] = n, e[34] = o, e[35] = s) : s = e[35];
|
|
1829
1909
|
let r;
|
|
1830
|
-
return e[36] !==
|
|
1910
|
+
return e[36] !== s ? (r = /* @__PURE__ */ u(It, { children: s }), e[36] = s, e[37] = r) : r = e[37], r;
|
|
1831
1911
|
}
|
|
1832
1912
|
}
|
|
1833
1913
|
}
|
|
1834
|
-
function
|
|
1835
|
-
return /* @__PURE__ */
|
|
1914
|
+
function ni(t) {
|
|
1915
|
+
return /* @__PURE__ */ u(Mt, { fileName: t }, t);
|
|
1836
1916
|
}
|
|
1837
|
-
function
|
|
1838
|
-
const e =
|
|
1917
|
+
function si(t) {
|
|
1918
|
+
const e = C(23), {
|
|
1839
1919
|
item: n,
|
|
1840
|
-
itemKey:
|
|
1841
|
-
isOpen:
|
|
1920
|
+
itemKey: o,
|
|
1921
|
+
isOpen: s,
|
|
1842
1922
|
canExpand: r,
|
|
1843
1923
|
hasBlocks: i,
|
|
1844
1924
|
onToggle: l,
|
|
1845
1925
|
onOpenFile: a
|
|
1846
1926
|
} = t;
|
|
1847
|
-
let
|
|
1848
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1927
|
+
let c;
|
|
1928
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(ge.Separator, {}), e[0] = c) : c = e[0];
|
|
1849
1929
|
let d;
|
|
1850
|
-
e[1] !== n.indicator ? (d = /* @__PURE__ */ k(
|
|
1851
|
-
|
|
1852
|
-
/* @__PURE__ */
|
|
1930
|
+
e[1] !== n.indicator ? (d = /* @__PURE__ */ k(ge.Connector, { children: [
|
|
1931
|
+
c,
|
|
1932
|
+
/* @__PURE__ */ u(Zr, { ind: n.indicator })
|
|
1853
1933
|
] }), e[1] = n.indicator, e[2] = d) : d = e[2];
|
|
1854
|
-
const f =
|
|
1855
|
-
let p;
|
|
1856
|
-
e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== l ? (p = n.title.length > 0 && /* @__PURE__ */ c(he.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k($e, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
|
|
1857
|
-
/* @__PURE__ */ c($e, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, x) => /* @__PURE__ */ c(Ur, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
|
|
1858
|
-
r ? /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
|
|
1859
|
-
color: "fg"
|
|
1860
|
-
}, children: /* @__PURE__ */ c(ps, { size: 12 }) }) : null
|
|
1861
|
-
] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = l, e[9] = p) : p = e[9];
|
|
1934
|
+
const f = s ? "auto" : "20px";
|
|
1862
1935
|
let m;
|
|
1863
|
-
e[
|
|
1936
|
+
e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ u(ge.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(o) : void 0, children: /* @__PURE__ */ k(ze, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
|
|
1937
|
+
/* @__PURE__ */ u(ze, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, y) => /* @__PURE__ */ u(Jr, { seg: b, isClickable: r, onOpenFile: a }, y)) }),
|
|
1938
|
+
r ? /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
|
|
1939
|
+
color: "fg"
|
|
1940
|
+
}, children: /* @__PURE__ */ u(gs, { size: 12 }) }) : null
|
|
1941
|
+
] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = a, e[8] = l, e[9] = m) : m = e[9];
|
|
1942
|
+
let p;
|
|
1943
|
+
e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== a ? (p = i ? /* @__PURE__ */ u(D, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ u(D, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(ti, { b, onOpenFile: a }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
|
|
1864
1944
|
let h;
|
|
1865
|
-
e[15] !== f || e[16] !==
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
] }), e[15] = f, e[16] =
|
|
1945
|
+
e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(ge.Content, { h: f, children: [
|
|
1946
|
+
m,
|
|
1947
|
+
p
|
|
1948
|
+
] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
|
|
1869
1949
|
let g;
|
|
1870
|
-
return e[19] !==
|
|
1950
|
+
return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(ge.Item, { gap: "xs", children: [
|
|
1871
1951
|
d,
|
|
1872
1952
|
h
|
|
1873
|
-
] },
|
|
1953
|
+
] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
|
|
1874
1954
|
}
|
|
1875
|
-
function
|
|
1876
|
-
const e =
|
|
1955
|
+
function oi(t) {
|
|
1956
|
+
const e = C(11), {
|
|
1877
1957
|
data: n,
|
|
1878
|
-
onOpenFile:
|
|
1958
|
+
onOpenFile: o
|
|
1879
1959
|
} = t;
|
|
1880
|
-
let
|
|
1881
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1882
|
-
const [r, i] =
|
|
1960
|
+
let s;
|
|
1961
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
|
|
1962
|
+
const [r, i] = W(s), l = ri;
|
|
1883
1963
|
let a;
|
|
1884
|
-
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (
|
|
1885
|
-
i((
|
|
1886
|
-
...
|
|
1887
|
-
[
|
|
1964
|
+
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (m) => {
|
|
1965
|
+
i((p) => ({
|
|
1966
|
+
...p,
|
|
1967
|
+
[m]: !p[m]
|
|
1888
1968
|
}));
|
|
1889
1969
|
}, e[1] = a) : a = e[1];
|
|
1890
|
-
const
|
|
1970
|
+
const c = a;
|
|
1891
1971
|
let d;
|
|
1892
|
-
if (e[2] !== n.items || e[3] !== r || e[4] !==
|
|
1893
|
-
let
|
|
1894
|
-
e[6] !== r || e[7] !==
|
|
1895
|
-
const g = l(
|
|
1896
|
-
return /* @__PURE__ */
|
|
1897
|
-
}, e[6] = r, e[7] =
|
|
1972
|
+
if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
|
|
1973
|
+
let m;
|
|
1974
|
+
e[6] !== r || e[7] !== o ? (m = (p, h) => {
|
|
1975
|
+
const g = l(p, h), b = (p.blocks?.length ?? 0) > 0, y = (p.expandable ?? !0) && b, x = y ? r[g] ?? !1 : b;
|
|
1976
|
+
return /* @__PURE__ */ u(si, { item: p, itemKey: g, isOpen: x, canExpand: y, hasBlocks: b, onToggle: c, onOpenFile: o }, g);
|
|
1977
|
+
}, e[6] = r, e[7] = o, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = o, e[5] = d;
|
|
1898
1978
|
} else
|
|
1899
1979
|
d = e[5];
|
|
1900
1980
|
let f;
|
|
1901
|
-
return e[9] !== d ? (f = /* @__PURE__ */
|
|
1981
|
+
return e[9] !== d ? (f = /* @__PURE__ */ u(ge.Root, { variant: "tool", children: d }), e[9] = d, e[10] = f) : f = e[10], f;
|
|
1902
1982
|
}
|
|
1903
|
-
function
|
|
1983
|
+
function ri(t, e) {
|
|
1904
1984
|
return t.id ? `id:${t.id}` : `idx:${e}`;
|
|
1905
1985
|
}
|
|
1906
|
-
const
|
|
1986
|
+
const ii = (t) => nt(t.tool ?? "").replace(/_/g, "") === "question", li = (t) => {
|
|
1907
1987
|
const e = t.state?.output;
|
|
1908
1988
|
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;
|
|
1909
1989
|
};
|
|
1910
|
-
function
|
|
1911
|
-
const e =
|
|
1990
|
+
function ai(t) {
|
|
1991
|
+
const e = C(8), {
|
|
1912
1992
|
invocations: n,
|
|
1913
|
-
labeledBlocks:
|
|
1914
|
-
hideQuestionForms:
|
|
1993
|
+
labeledBlocks: o,
|
|
1994
|
+
hideQuestionForms: s,
|
|
1915
1995
|
onOpenFile: r
|
|
1916
|
-
} = t, i =
|
|
1996
|
+
} = t, i = s === void 0 ? !1 : s;
|
|
1917
1997
|
let l, a;
|
|
1918
|
-
if (e[0] !== i || e[1] !== n || e[2] !==
|
|
1998
|
+
if (e[0] !== i || e[1] !== n || e[2] !== o) {
|
|
1919
1999
|
a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1920
2000
|
e: {
|
|
1921
|
-
const f = i ? n.filter(
|
|
2001
|
+
const f = i ? n.filter(ci) : n;
|
|
1922
2002
|
if (f.length === 0) {
|
|
1923
2003
|
a = null;
|
|
1924
2004
|
break e;
|
|
1925
2005
|
}
|
|
1926
|
-
l =
|
|
1927
|
-
labeledBlocks:
|
|
2006
|
+
l = Ur(f, {
|
|
2007
|
+
labeledBlocks: o
|
|
1928
2008
|
});
|
|
1929
2009
|
}
|
|
1930
|
-
e[0] = i, e[1] = n, e[2] =
|
|
2010
|
+
e[0] = i, e[1] = n, e[2] = o, e[3] = l, e[4] = a;
|
|
1931
2011
|
} else
|
|
1932
2012
|
l = e[3], a = e[4];
|
|
1933
2013
|
if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1934
2014
|
return a;
|
|
1935
|
-
const
|
|
2015
|
+
const c = l;
|
|
1936
2016
|
let d;
|
|
1937
|
-
return e[5] !==
|
|
2017
|
+
return e[5] !== c || e[6] !== r ? (d = /* @__PURE__ */ u(oi, { data: c, onOpenFile: r }), e[5] = c, e[6] = r, e[7] = d) : d = e[7], d;
|
|
1938
2018
|
}
|
|
1939
|
-
function
|
|
1940
|
-
return !
|
|
2019
|
+
function ci(t) {
|
|
2020
|
+
return !ii(t) || li(t);
|
|
1941
2021
|
}
|
|
1942
|
-
const
|
|
2022
|
+
const ui = (t) => t.type === "tool", Ft = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", di = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, fi = (t) => t.mediaType?.startsWith("image/") || di.test(Ft(t)), pi = (t) => fi(t) ? /* @__PURE__ */ u(tn, { src: t.url, alt: `${Ft(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, mi = (t, e) => {
|
|
1943
2023
|
if (e) {
|
|
1944
2024
|
e(t.url);
|
|
1945
2025
|
return;
|
|
1946
2026
|
}
|
|
1947
2027
|
typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
|
|
1948
|
-
},
|
|
2028
|
+
}, hi = (t) => {
|
|
1949
2029
|
if (t.message && t.message.trim().length > 0)
|
|
1950
2030
|
return t.message;
|
|
1951
2031
|
const {
|
|
@@ -1961,737 +2041,743 @@ const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").
|
|
|
1961
2041
|
default:
|
|
1962
2042
|
return "An error occurred.";
|
|
1963
2043
|
}
|
|
1964
|
-
},
|
|
2044
|
+
}, gi = {
|
|
1965
2045
|
info: "blue",
|
|
1966
2046
|
warning: "orange",
|
|
1967
2047
|
error: "red",
|
|
1968
2048
|
success: "green",
|
|
1969
2049
|
loading: "blue"
|
|
1970
|
-
},
|
|
2050
|
+
}, bi = (t, e) => {
|
|
1971
2051
|
const n = [];
|
|
1972
|
-
let
|
|
1973
|
-
for (;
|
|
1974
|
-
const
|
|
1975
|
-
if (!
|
|
1976
|
-
n.push(
|
|
2052
|
+
let o = e;
|
|
2053
|
+
for (; o < t.length; ) {
|
|
2054
|
+
const s = t[o];
|
|
2055
|
+
if (!ui(s)) break;
|
|
2056
|
+
n.push(s), o += 1;
|
|
1977
2057
|
}
|
|
1978
2058
|
return {
|
|
1979
2059
|
invocations: n,
|
|
1980
|
-
nextIndex:
|
|
2060
|
+
nextIndex: o - 1
|
|
1981
2061
|
};
|
|
1982
2062
|
};
|
|
1983
|
-
function
|
|
1984
|
-
const e =
|
|
2063
|
+
function Dn(t) {
|
|
2064
|
+
const e = C(8), {
|
|
1985
2065
|
message: n,
|
|
1986
|
-
hideQuestionForms:
|
|
1987
|
-
onOpenFile:
|
|
2066
|
+
hideQuestionForms: o,
|
|
2067
|
+
onOpenFile: s,
|
|
1988
2068
|
toolInvocationTimeline: r
|
|
1989
|
-
} = t, i =
|
|
2069
|
+
} = t, i = o === void 0 ? !1 : o, l = r ?? ai;
|
|
1990
2070
|
let a;
|
|
1991
2071
|
e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
|
|
1992
|
-
const
|
|
2072
|
+
const c = a;
|
|
1993
2073
|
let d;
|
|
1994
|
-
if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !==
|
|
2074
|
+
if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== c) {
|
|
1995
2075
|
const f = [];
|
|
1996
|
-
for (let
|
|
1997
|
-
const
|
|
1998
|
-
e: switch (
|
|
2076
|
+
for (let m = 0; m < c.length; m = m + 1, m) {
|
|
2077
|
+
const p = c[m], h = `${n.id}-${m}`;
|
|
2078
|
+
e: switch (p.type) {
|
|
1999
2079
|
case "text": {
|
|
2000
|
-
f.push(/* @__PURE__ */
|
|
2080
|
+
f.push(/* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Bo, { children: p.text }) }, h));
|
|
2001
2081
|
break e;
|
|
2002
2082
|
}
|
|
2003
2083
|
case "reasoning": {
|
|
2004
|
-
f.push(/* @__PURE__ */
|
|
2084
|
+
f.push(/* @__PURE__ */ u(D, { padding: "0", css: {
|
|
2005
2085
|
"& .rich-text, & .rich-text *": {
|
|
2006
2086
|
color: "fg.subtle !important",
|
|
2007
2087
|
fontSize: ".75rem !important",
|
|
2008
2088
|
fontWeight: "normal !important"
|
|
2009
2089
|
}
|
|
2010
|
-
}, children: /* @__PURE__ */
|
|
2090
|
+
}, children: /* @__PURE__ */ u(an, { defaultState: p.text, fullWidth: !0 }) }, h));
|
|
2011
2091
|
break e;
|
|
2012
2092
|
}
|
|
2013
2093
|
case "tool": {
|
|
2014
2094
|
const {
|
|
2015
2095
|
invocations: g,
|
|
2016
2096
|
nextIndex: b
|
|
2017
|
-
} =
|
|
2018
|
-
|
|
2097
|
+
} = bi(c, m);
|
|
2098
|
+
m = b, f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
|
|
2019
2099
|
break e;
|
|
2020
2100
|
}
|
|
2021
2101
|
case "file": {
|
|
2022
|
-
f.push(/* @__PURE__ */
|
|
2102
|
+
f.push(/* @__PURE__ */ u(D, { width: "fit-content", children: /* @__PURE__ */ u(Mt, { fileName: Ft(p), size: "sm", tone: "neutral", icon: pi(p), onSelect: () => mi(p, s) }) }, h));
|
|
2023
2103
|
break e;
|
|
2024
2104
|
}
|
|
2025
2105
|
case "error": {
|
|
2026
|
-
f.push(/* @__PURE__ */
|
|
2106
|
+
f.push(/* @__PURE__ */ u(D, { py: "2", width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: "error", colorPalette: "red", title: hi(p), size: "sm" }) }, h));
|
|
2027
2107
|
break e;
|
|
2028
2108
|
}
|
|
2029
2109
|
case "token_usage":
|
|
2030
2110
|
break e;
|
|
2031
2111
|
case "alert": {
|
|
2032
|
-
f.push(/* @__PURE__ */
|
|
2112
|
+
f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: gi[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ u(_t, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
|
|
2033
2113
|
break e;
|
|
2034
2114
|
}
|
|
2035
2115
|
default:
|
|
2036
2116
|
f.push(null);
|
|
2037
2117
|
}
|
|
2038
2118
|
}
|
|
2039
|
-
d = /* @__PURE__ */
|
|
2119
|
+
d = /* @__PURE__ */ u(It, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = s, e[6] = c, e[7] = d;
|
|
2040
2120
|
} else
|
|
2041
2121
|
d = e[7];
|
|
2042
2122
|
return d;
|
|
2043
2123
|
}
|
|
2044
|
-
const
|
|
2124
|
+
const yi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Bn = (t) => t.text.trim().length > 0, xi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), Si = (t) => {
|
|
2045
2125
|
switch (t.type) {
|
|
2046
2126
|
case "text":
|
|
2047
2127
|
case "reasoning":
|
|
2048
|
-
return
|
|
2128
|
+
return Bn(t);
|
|
2049
2129
|
case "tool":
|
|
2050
2130
|
case "file":
|
|
2051
2131
|
case "error":
|
|
2052
2132
|
return !0;
|
|
2053
2133
|
case "alert":
|
|
2054
|
-
return
|
|
2134
|
+
return xi(t);
|
|
2055
2135
|
default:
|
|
2056
2136
|
return !1;
|
|
2057
2137
|
}
|
|
2058
|
-
},
|
|
2138
|
+
}, wi = (t) => t.type === "reasoning" || t.type === "tool", Ti = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(wi), Ai = (t) => {
|
|
2059
2139
|
if (t.length === 0) return null;
|
|
2060
2140
|
const [e, ...n] = t;
|
|
2061
2141
|
return e ? {
|
|
2062
2142
|
...e,
|
|
2063
2143
|
role: "assistant",
|
|
2064
|
-
parts: t.flatMap((
|
|
2144
|
+
parts: t.flatMap((o) => o.parts),
|
|
2065
2145
|
modelId: n.at(-1)?.modelId ?? e.modelId,
|
|
2066
2146
|
providerId: n.at(-1)?.providerId ?? e.providerId
|
|
2067
2147
|
} : null;
|
|
2068
|
-
},
|
|
2148
|
+
}, Ci = (t, e = {}) => {
|
|
2069
2149
|
const n = [];
|
|
2070
|
-
let
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2150
|
+
let o = [];
|
|
2151
|
+
const s = () => {
|
|
2152
|
+
o = [];
|
|
2073
2153
|
};
|
|
2074
2154
|
for (const r of t) {
|
|
2075
|
-
const i = (r.parts ?? []).filter(
|
|
2155
|
+
const i = (r.parts ?? []).filter(Si);
|
|
2076
2156
|
if (i.length === 0) continue;
|
|
2077
2157
|
const l = {
|
|
2078
2158
|
...r,
|
|
2079
2159
|
parts: i
|
|
2080
2160
|
};
|
|
2081
2161
|
if (l.role === "user") {
|
|
2082
|
-
|
|
2162
|
+
s(), n.push(l);
|
|
2083
2163
|
continue;
|
|
2084
2164
|
}
|
|
2085
|
-
if (
|
|
2086
|
-
|
|
2165
|
+
if (Ti(l)) {
|
|
2166
|
+
o.push(l);
|
|
2087
2167
|
continue;
|
|
2088
2168
|
}
|
|
2089
|
-
if (
|
|
2169
|
+
if (o.length > 0) {
|
|
2090
2170
|
n.push({
|
|
2091
2171
|
...l,
|
|
2092
|
-
parts: [...
|
|
2093
|
-
}),
|
|
2172
|
+
parts: [...o.flatMap((a) => a.parts), ...l.parts]
|
|
2173
|
+
}), s();
|
|
2094
2174
|
continue;
|
|
2095
2175
|
}
|
|
2096
2176
|
n.push(l);
|
|
2097
2177
|
}
|
|
2098
|
-
if (e.streaming &&
|
|
2099
|
-
const r =
|
|
2178
|
+
if (e.streaming && o.length > 0) {
|
|
2179
|
+
const r = Ai(o);
|
|
2100
2180
|
r && n.push(r);
|
|
2101
2181
|
}
|
|
2102
2182
|
return n;
|
|
2103
|
-
},
|
|
2183
|
+
}, Fn = (t) => {
|
|
2104
2184
|
const e = t.at(-1);
|
|
2105
|
-
return e?.role !== "assistant" ? null : e.parts.some((
|
|
2106
|
-
},
|
|
2185
|
+
return e?.role !== "assistant" ? null : e.parts.some((o) => o.type === "text" && Bn(o)) ? e.id : null;
|
|
2186
|
+
}, ki = (t) => {
|
|
2107
2187
|
const e = [], n = [];
|
|
2108
|
-
for (const
|
|
2109
|
-
|
|
2110
|
-
userMessage:
|
|
2188
|
+
for (const o of t)
|
|
2189
|
+
o.role === "user" ? e.push({
|
|
2190
|
+
userMessage: o,
|
|
2111
2191
|
responses: []
|
|
2112
|
-
}) : e.length > 0 ? e[e.length - 1].responses.push(
|
|
2192
|
+
}) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
|
|
2113
2193
|
return {
|
|
2114
2194
|
groups: e,
|
|
2115
2195
|
leadingResponses: n
|
|
2116
2196
|
};
|
|
2117
|
-
},
|
|
2118
|
-
const e =
|
|
2197
|
+
}, Ln = (t) => {
|
|
2198
|
+
const e = C(18), {
|
|
2119
2199
|
message: n,
|
|
2120
|
-
streaming:
|
|
2121
|
-
hideQuestionForms:
|
|
2200
|
+
streaming: o,
|
|
2201
|
+
hideQuestionForms: s,
|
|
2122
2202
|
animate: r,
|
|
2123
2203
|
showAssistantActions: i
|
|
2124
|
-
} = t, l =
|
|
2125
|
-
let
|
|
2126
|
-
e[0] !== n.role ? (
|
|
2127
|
-
const d =
|
|
2128
|
-
let
|
|
2129
|
-
e[2] !== l || e[3] !== n || e[4] !==
|
|
2204
|
+
} = t, l = s === void 0 ? !1 : s, a = r === void 0 ? !1 : r;
|
|
2205
|
+
let c;
|
|
2206
|
+
e[0] !== n.role ? (c = yi(n.role), e[0] = n.role, e[1] = c) : c = e[1];
|
|
2207
|
+
const d = c, f = d === "user" || d === "assistant" && i, m = a ? hn : void 0;
|
|
2208
|
+
let p;
|
|
2209
|
+
e[2] !== l || e[3] !== n || e[4] !== o ? (p = /* @__PURE__ */ u(Dn, { message: n, streaming: o, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = o, e[5] = p) : p = e[5];
|
|
2130
2210
|
let h;
|
|
2131
|
-
e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */
|
|
2211
|
+
e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ u(Tt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
|
|
2132
2212
|
let g;
|
|
2133
|
-
e[10] !== d || e[11] !==
|
|
2134
|
-
|
|
2213
|
+
e[10] !== d || e[11] !== p || e[12] !== h ? (g = /* @__PURE__ */ k(be.Content, { from: d, children: [
|
|
2214
|
+
p,
|
|
2135
2215
|
h
|
|
2136
|
-
] }), e[10] = d, e[11] =
|
|
2216
|
+
] }), e[10] = d, e[11] = p, e[12] = h, e[13] = g) : g = e[13];
|
|
2137
2217
|
let b;
|
|
2138
|
-
return e[14] !== d || e[15] !==
|
|
2139
|
-
},
|
|
2140
|
-
const e =
|
|
2218
|
+
return e[14] !== d || e[15] !== m || e[16] !== g ? (b = /* @__PURE__ */ u(be.Root, { from: d, ...m, children: g }), e[14] = d, e[15] = m, e[16] = g, e[17] = b) : b = e[17], b;
|
|
2219
|
+
}, Ii = (t) => {
|
|
2220
|
+
const e = C(7), {
|
|
2141
2221
|
label: n,
|
|
2142
|
-
onClick:
|
|
2143
|
-
actionPanel:
|
|
2144
|
-
} = t, r =
|
|
2222
|
+
onClick: o,
|
|
2223
|
+
actionPanel: s
|
|
2224
|
+
} = t, r = s ? "space-between" : "flex-end";
|
|
2145
2225
|
let i;
|
|
2146
|
-
e[0] !== n || e[1] !==
|
|
2226
|
+
e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ u(Qe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
|
|
2147
2227
|
let l;
|
|
2148
|
-
return e[3] !==
|
|
2149
|
-
|
|
2228
|
+
return e[3] !== s || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(ye, { 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: [
|
|
2229
|
+
s,
|
|
2150
2230
|
i
|
|
2151
|
-
] }), e[3] =
|
|
2152
|
-
},
|
|
2231
|
+
] }), e[3] = s, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
|
|
2232
|
+
}, _i = 360, vi = 4, Mi = "min(10vh, 4rem)", $n = "min(70dvh, calc(100dvh - 12rem), 22rem)", xt = 1, Ri = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
|
|
2153
2233
|
lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
|
|
2154
2234
|
textLength: e.textLength + n.text.length
|
|
2155
2235
|
}, {
|
|
2156
2236
|
lineCount: 0,
|
|
2157
2237
|
textLength: 0
|
|
2158
|
-
}),
|
|
2238
|
+
}), Pi = (t) => {
|
|
2159
2239
|
if (t.role !== "user") return !1;
|
|
2160
2240
|
const {
|
|
2161
2241
|
lineCount: e,
|
|
2162
2242
|
textLength: n
|
|
2163
|
-
} =
|
|
2164
|
-
return n >
|
|
2165
|
-
},
|
|
2243
|
+
} = Ri(t);
|
|
2244
|
+
return n > _i || e > vi;
|
|
2245
|
+
}, Ei = (t, e) => {
|
|
2166
2246
|
const n = Math.max(0, t.scrollHeight - t.clientHeight);
|
|
2167
|
-
return e === 0 || n <=
|
|
2168
|
-
},
|
|
2169
|
-
const n =
|
|
2170
|
-
return [...t.map((
|
|
2247
|
+
return e === 0 || n <= xt ? !1 : e < 0 ? t.scrollTop > xt : t.scrollTop < n - xt;
|
|
2248
|
+
}, On = 720, Di = 1, Bi = 3, Fi = 20, Xt = 1, Li = 4, zn = 8, $i = (t, e) => {
|
|
2249
|
+
const n = Fn(t);
|
|
2250
|
+
return [...t.map((o) => ({
|
|
2171
2251
|
type: "leading-response",
|
|
2172
|
-
key:
|
|
2173
|
-
message:
|
|
2174
|
-
showAssistantActions:
|
|
2175
|
-
})), ...e.map((
|
|
2252
|
+
key: o.id,
|
|
2253
|
+
message: o,
|
|
2254
|
+
showAssistantActions: o.id === n
|
|
2255
|
+
})), ...e.map((o, s) => ({
|
|
2176
2256
|
type: "group",
|
|
2177
|
-
key:
|
|
2178
|
-
group:
|
|
2179
|
-
groupIndex:
|
|
2257
|
+
key: o.userMessage.id,
|
|
2258
|
+
group: o,
|
|
2259
|
+
groupIndex: s
|
|
2180
2260
|
}))];
|
|
2181
|
-
},
|
|
2261
|
+
}, Oi = (t, e) => {
|
|
2182
2262
|
if (t === 0) return 0;
|
|
2183
|
-
const n = t *
|
|
2263
|
+
const n = t * On + (t - 1) * zn;
|
|
2184
2264
|
return Math.max(n - e, 0);
|
|
2185
|
-
},
|
|
2265
|
+
}, zi = (t) => t?.clientHeight || Di, Qi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= Xt && Math.abs(t.totalSize - e.totalSize) <= Xt, qi = (t, e) => ({
|
|
2186
2266
|
scrollTop: t?.scrollTop ?? 0,
|
|
2187
2267
|
totalSize: e
|
|
2188
|
-
}),
|
|
2189
|
-
const e =
|
|
2268
|
+
}), Wi = (t) => {
|
|
2269
|
+
const e = C(8), {
|
|
2190
2270
|
itemCount: n,
|
|
2191
|
-
onReady:
|
|
2192
|
-
scrollRef:
|
|
2271
|
+
onReady: o,
|
|
2272
|
+
scrollRef: s,
|
|
2193
2273
|
totalSize: r
|
|
2194
|
-
} = t, i =
|
|
2274
|
+
} = t, i = J(o);
|
|
2195
2275
|
let l, a;
|
|
2196
|
-
e[0] !==
|
|
2197
|
-
i.current =
|
|
2198
|
-
}, a = [
|
|
2199
|
-
let
|
|
2200
|
-
e[3] !== n || e[4] !==
|
|
2276
|
+
e[0] !== o ? (l = () => {
|
|
2277
|
+
i.current = o;
|
|
2278
|
+
}, a = [o], e[0] = o, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), Z(l, a);
|
|
2279
|
+
let c, d;
|
|
2280
|
+
e[3] !== n || e[4] !== s || e[5] !== r ? (c = () => {
|
|
2201
2281
|
if (n === 0 || typeof requestAnimationFrame > "u") {
|
|
2202
2282
|
i.current?.();
|
|
2203
2283
|
return;
|
|
2204
2284
|
}
|
|
2205
|
-
let f = 0,
|
|
2285
|
+
let f = 0, m = 0, p = 0, h = null;
|
|
2206
2286
|
const g = () => {
|
|
2207
|
-
|
|
2208
|
-
const b =
|
|
2209
|
-
if (
|
|
2287
|
+
m = m + 1;
|
|
2288
|
+
const b = qi(s.current, r);
|
|
2289
|
+
if (p = h && Qi(b, h) ? p + 1 : 0, h = b, p >= Bi || m >= Fi) {
|
|
2210
2290
|
i.current?.();
|
|
2211
2291
|
return;
|
|
2212
2292
|
}
|
|
2213
2293
|
f = requestAnimationFrame(g);
|
|
2214
2294
|
};
|
|
2215
2295
|
return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
|
|
2216
|
-
}, d = [n,
|
|
2217
|
-
},
|
|
2218
|
-
|
|
2219
|
-
},
|
|
2296
|
+
}, d = [n, s, r], e[3] = n, e[4] = s, e[5] = r, e[6] = c, e[7] = d) : (c = e[6], d = e[7]), Z(c, d);
|
|
2297
|
+
}, Hi = (t) => {
|
|
2298
|
+
Ei(t.currentTarget, t.deltaY) && t.stopPropagation();
|
|
2299
|
+
}, Ni = (t, e) => {
|
|
2220
2300
|
if (t)
|
|
2221
|
-
return e ?
|
|
2222
|
-
},
|
|
2301
|
+
return e ? $n : Mi;
|
|
2302
|
+
}, Vi = (t) => {
|
|
2223
2303
|
if (t)
|
|
2224
|
-
return
|
|
2225
|
-
},
|
|
2226
|
-
const e =
|
|
2304
|
+
return $n;
|
|
2305
|
+
}, Ui = (t) => {
|
|
2306
|
+
const e = C(50), {
|
|
2227
2307
|
group: n,
|
|
2228
|
-
streaming:
|
|
2229
|
-
hideQuestionForms:
|
|
2308
|
+
streaming: o,
|
|
2309
|
+
hideQuestionForms: s,
|
|
2230
2310
|
isExpanded: r,
|
|
2231
2311
|
animate: i,
|
|
2232
2312
|
onToggleStickyMessage: l
|
|
2233
2313
|
} = t;
|
|
2234
|
-
let a,
|
|
2235
|
-
e[0] !== n.userMessage || e[1] !== r ? (a =
|
|
2314
|
+
let a, c, d;
|
|
2315
|
+
e[0] !== n.userMessage || e[1] !== r ? (a = Pi(n.userMessage), c = a && r, d = Ni(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = c, e[4] = d) : (a = e[2], c = e[3], d = e[4]);
|
|
2236
2316
|
const f = d;
|
|
2237
|
-
let
|
|
2238
|
-
e[5] !== n.userMessage.id || e[6] !== l ? (
|
|
2239
|
-
const
|
|
2317
|
+
let m;
|
|
2318
|
+
e[5] !== n.userMessage.id || e[6] !== l ? (m = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = m) : m = e[7];
|
|
2319
|
+
const p = m;
|
|
2240
2320
|
let h;
|
|
2241
|
-
e[8] !== n.responses ? (h =
|
|
2242
|
-
const g = h, b = i ?
|
|
2243
|
-
let
|
|
2244
|
-
e[10] !==
|
|
2245
|
-
const
|
|
2246
|
-
let E;
|
|
2247
|
-
e[12] !== n.userMessage || e[13] !== s ? (E = /* @__PURE__ */ c(Mn, { message: n.userMessage, streaming: s }), e[12] = n.userMessage, e[13] = s, e[14] = E) : E = e[14];
|
|
2248
|
-
let Q;
|
|
2249
|
-
e[15] !== _ || e[16] !== R || e[17] !== L || e[18] !== E || e[19] !== T || e[20] !== S || e[21] !== w || e[22] !== C ? (Q = /* @__PURE__ */ c(P, { "data-sticky-user-message-content": T, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: w, px: C, py: _, pb: R, onWheel: L, children: E }), e[15] = _, e[16] = R, e[17] = L, e[18] = E, e[19] = T, e[20] = S, e[21] = w, e[22] = C, e[23] = Q) : Q = e[23];
|
|
2321
|
+
e[8] !== n.responses ? (h = Fn(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
|
|
2322
|
+
const g = h, b = i ? hn : void 0, y = a ? "0" : void 0, x = a ? "relative" : void 0, S = a ? r ? "expanded" : "collapsed" : void 0;
|
|
2323
|
+
let A;
|
|
2324
|
+
e[10] !== c ? (A = Vi(c), e[10] = c, e[11] = A) : A = e[11];
|
|
2325
|
+
const T = c ? "auto" : "visible", w = a ? "xs" : void 0, I = a ? "xs" : void 0, _ = c ? "3rem" : void 0, P = c ? Hi : void 0;
|
|
2250
2326
|
let M;
|
|
2251
|
-
e[
|
|
2252
|
-
let
|
|
2253
|
-
e[
|
|
2254
|
-
Q,
|
|
2255
|
-
M
|
|
2256
|
-
] }), e[29] = f, e[30] = Q, e[31] = M, e[32] = x, e[33] = y, e[34] = D) : D = e[34];
|
|
2327
|
+
e[12] !== n.userMessage || e[13] !== o ? (M = /* @__PURE__ */ u(Dn, { message: n.userMessage, streaming: o }), e[12] = n.userMessage, e[13] = o, e[14] = M) : M = e[14];
|
|
2328
|
+
let z;
|
|
2329
|
+
e[15] !== I || e[16] !== _ || e[17] !== P || e[18] !== M || e[19] !== S || e[20] !== A || e[21] !== T || e[22] !== w ? (z = /* @__PURE__ */ u(D, { "data-sticky-user-message-content": S, display: "flex", flexDirection: "column", gap: "sm", maxH: A, minH: "0", overflowY: T, px: w, py: I, pb: _, onWheel: P, children: M }), e[15] = I, e[16] = _, e[17] = P, e[18] = M, e[19] = S, e[20] = A, e[21] = T, e[22] = w, e[23] = z) : z = e[23];
|
|
2257
2330
|
let B;
|
|
2258
|
-
e[
|
|
2259
|
-
let
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2331
|
+
e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== p ? (B = a ? /* @__PURE__ */ u(Ii, { label: r ? "Show less" : "Show more", onClick: p, actionPanel: /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = p, e[28] = B) : B = e[28];
|
|
2332
|
+
let E;
|
|
2333
|
+
e[29] !== f || e[30] !== z || e[31] !== B || e[32] !== y || e[33] !== x ? (E = /* @__PURE__ */ k(be.Content, { from: "user", maxH: f, overflow: "hidden", p: y, position: x, children: [
|
|
2334
|
+
z,
|
|
2335
|
+
B
|
|
2336
|
+
] }), e[29] = f, e[30] = z, e[31] = B, e[32] = y, e[33] = x, e[34] = E) : E = e[34];
|
|
2337
|
+
let F;
|
|
2338
|
+
e[35] !== E || e[36] !== b ? (F = /* @__PURE__ */ u(D, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ u(be.Root, { from: "user", ...b, children: E }) }), e[35] = E, e[36] = b, e[37] = F) : F = e[37];
|
|
2339
|
+
let L;
|
|
2340
|
+
if (e[38] !== g || e[39] !== n.responses || e[40] !== s || e[41] !== o) {
|
|
2341
|
+
let O;
|
|
2342
|
+
e[43] !== g || e[44] !== s || e[45] !== o ? (O = (H) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(Ln, { message: H, streaming: o, hideQuestionForms: s, showAssistantActions: H.id === g }) }, H.id), e[43] = g, e[44] = s, e[45] = o, e[46] = O) : O = e[46], L = n.responses.map(O), e[38] = g, e[39] = n.responses, e[40] = s, e[41] = o, e[42] = L;
|
|
2263
2343
|
} else
|
|
2264
|
-
|
|
2265
|
-
let
|
|
2266
|
-
return e[47] !==
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
] }), e[47] =
|
|
2270
|
-
},
|
|
2344
|
+
L = e[42];
|
|
2345
|
+
let $;
|
|
2346
|
+
return e[47] !== F || e[48] !== L ? ($ = /* @__PURE__ */ k(D, { children: [
|
|
2347
|
+
F,
|
|
2348
|
+
L
|
|
2349
|
+
] }), e[47] = F, e[48] = L, e[49] = $) : $ = e[49], $;
|
|
2350
|
+
}, ji = (t, e) => {
|
|
2271
2351
|
const {
|
|
2272
2352
|
groups: n,
|
|
2273
|
-
streaming:
|
|
2274
|
-
hideActiveQuestionForms:
|
|
2353
|
+
streaming: o,
|
|
2354
|
+
hideActiveQuestionForms: s,
|
|
2275
2355
|
expandedStickyMessageIds: r,
|
|
2276
2356
|
animatedItemKeys: i,
|
|
2277
2357
|
onToggleStickyMessage: l
|
|
2278
2358
|
} = e;
|
|
2279
|
-
return t.type === "leading-response" ? /* @__PURE__ */
|
|
2280
|
-
},
|
|
2359
|
+
return t.type === "leading-response" ? /* @__PURE__ */ u(Ln, { message: t.message, streaming: o, hideQuestionForms: n.length > 0 || s, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ u(Ui, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
|
|
2360
|
+
}, Ki = (t) => {
|
|
2281
2361
|
const {
|
|
2282
2362
|
leadingResponses: e,
|
|
2283
2363
|
groups: n,
|
|
2284
|
-
streaming:
|
|
2285
|
-
hideActiveQuestionForms:
|
|
2364
|
+
streaming: o,
|
|
2365
|
+
hideActiveQuestionForms: s,
|
|
2286
2366
|
expandedStickyMessageIds: r,
|
|
2287
2367
|
onToggleStickyMessage: i,
|
|
2288
2368
|
onReady: l
|
|
2289
2369
|
} = t, {
|
|
2290
2370
|
scrollRef: a
|
|
2291
|
-
} =
|
|
2292
|
-
count:
|
|
2371
|
+
} = et(), c = $i(e, n), d = Mo(c.map((h) => h.key)), f = zi(a.current), m = _s({
|
|
2372
|
+
count: c.length,
|
|
2293
2373
|
getScrollElement: () => a.current,
|
|
2294
|
-
estimateSize: () =>
|
|
2295
|
-
getItemKey: (h) =>
|
|
2296
|
-
overscan:
|
|
2297
|
-
gap:
|
|
2374
|
+
estimateSize: () => On,
|
|
2375
|
+
getItemKey: (h) => c[h]?.key ?? h,
|
|
2376
|
+
overscan: Li,
|
|
2377
|
+
gap: zn,
|
|
2298
2378
|
initialRect: {
|
|
2299
2379
|
width: 0,
|
|
2300
2380
|
height: f
|
|
2301
2381
|
},
|
|
2302
|
-
initialOffset: () =>
|
|
2303
|
-
}),
|
|
2304
|
-
return
|
|
2305
|
-
itemCount:
|
|
2382
|
+
initialOffset: () => Oi(c.length, f)
|
|
2383
|
+
}), p = m.getTotalSize();
|
|
2384
|
+
return Wi({
|
|
2385
|
+
itemCount: c.length,
|
|
2306
2386
|
onReady: l,
|
|
2307
2387
|
scrollRef: a,
|
|
2308
|
-
totalSize:
|
|
2309
|
-
}), /* @__PURE__ */
|
|
2310
|
-
height:
|
|
2311
|
-
}, children:
|
|
2312
|
-
const g =
|
|
2313
|
-
return g ? /* @__PURE__ */
|
|
2388
|
+
totalSize: p
|
|
2389
|
+
}), /* @__PURE__ */ u(D, { px: "xs", children: /* @__PURE__ */ u(D, { position: "relative", width: "100%", style: {
|
|
2390
|
+
height: p
|
|
2391
|
+
}, children: m.getVirtualItems().map((h) => {
|
|
2392
|
+
const g = c[h.index];
|
|
2393
|
+
return g ? /* @__PURE__ */ u(D, { ref: m.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
|
|
2314
2394
|
top: h.start
|
|
2315
|
-
}, children:
|
|
2395
|
+
}, children: ji(g, {
|
|
2316
2396
|
groups: n,
|
|
2317
|
-
streaming:
|
|
2318
|
-
hideActiveQuestionForms:
|
|
2397
|
+
streaming: o,
|
|
2398
|
+
hideActiveQuestionForms: s,
|
|
2319
2399
|
expandedStickyMessageIds: r,
|
|
2320
2400
|
animatedItemKeys: d,
|
|
2321
2401
|
onToggleStickyMessage: i
|
|
2322
2402
|
}) }, h.key) : null;
|
|
2323
2403
|
}) }) });
|
|
2324
|
-
},
|
|
2325
|
-
const e =
|
|
2404
|
+
}, Xi = (t = "") => JSON.stringify(As(t)), Gi = (t) => {
|
|
2405
|
+
const e = C(48), {
|
|
2326
2406
|
item: n,
|
|
2327
|
-
index:
|
|
2328
|
-
isFirst:
|
|
2407
|
+
index: o,
|
|
2408
|
+
isFirst: s,
|
|
2329
2409
|
isLast: r,
|
|
2330
2410
|
isEditing: i,
|
|
2331
2411
|
isDragTarget: l,
|
|
2332
2412
|
onEdit: a,
|
|
2333
|
-
onRemove:
|
|
2413
|
+
onRemove: c,
|
|
2334
2414
|
onDragStart: d,
|
|
2335
2415
|
onDragEnd: f,
|
|
2336
|
-
onDragOver:
|
|
2337
|
-
onDrop:
|
|
2338
|
-
} = t, h = !!a, g = !!
|
|
2339
|
-
let
|
|
2340
|
-
e[0] !== n.id || e[1] !==
|
|
2341
|
-
let
|
|
2342
|
-
e[3] !== n.id || e[4] !==
|
|
2343
|
-
const
|
|
2344
|
-
let E;
|
|
2345
|
-
e[6] !== n.id || e[7] !== d ? (E = (H) => {
|
|
2346
|
-
H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
|
|
2347
|
-
}, e[6] = n.id, e[7] = d, e[8] = E) : E = e[8];
|
|
2348
|
-
let Q;
|
|
2349
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ c(dt, { as: ms, boxSize: "14px" }), e[9] = Q) : Q = e[9];
|
|
2416
|
+
onDragOver: m,
|
|
2417
|
+
onDrop: p
|
|
2418
|
+
} = t, h = !!a, g = !!c, b = !s || !r, y = `Drag queued follow-up ${o + 1}`, x = s ? "0" : "1px", S = l ? "border.accent-light" : "border.subtle", A = s ? "0" : "2xs", T = i ? "bg.muted" : void 0;
|
|
2419
|
+
let w;
|
|
2420
|
+
e[0] !== n.id || e[1] !== m ? (w = (V) => m(V, n.id), e[0] = n.id, e[1] = m, e[2] = w) : w = e[2];
|
|
2421
|
+
let I;
|
|
2422
|
+
e[3] !== n.id || e[4] !== p ? (I = (V) => p(V, n.id), e[3] = n.id, e[4] = p, e[5] = I) : I = e[5];
|
|
2423
|
+
const _ = b ? "grab" : "default", P = !b;
|
|
2350
2424
|
let M;
|
|
2351
|
-
e[
|
|
2352
|
-
|
|
2353
|
-
e[
|
|
2425
|
+
e[6] !== n.id || e[7] !== d ? (M = (V) => {
|
|
2426
|
+
V.dataTransfer.effectAllowed = "move", V.dataTransfer.setData("text/plain", n.id), d(n.id);
|
|
2427
|
+
}, e[6] = n.id, e[7] = d, e[8] = M) : M = e[8];
|
|
2428
|
+
let z;
|
|
2429
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ u(mt, { as: bs, boxSize: "14px" }), e[9] = z) : z = e[9];
|
|
2354
2430
|
let B;
|
|
2355
|
-
e[
|
|
2431
|
+
e[10] !== b || e[11] !== y || e[12] !== f || e[13] !== _ || e[14] !== P || e[15] !== M ? (B = /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": y, title: y, color: "fg.muted", cursor: _, disabled: P, onDragStart: M, onDragEnd: f, children: z }), e[10] = b, e[11] = y, e[12] = f, e[13] = _, e[14] = P, e[15] = M, e[16] = B) : B = e[16];
|
|
2432
|
+
let E;
|
|
2433
|
+
e[17] !== n.prompt ? (E = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = E) : E = e[18];
|
|
2434
|
+
let F;
|
|
2435
|
+
e[19] !== n.attachments ? (F = n.attachments?.length ? /* @__PURE__ */ k(Xn, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
|
|
2356
2436
|
n.attachments.length,
|
|
2357
2437
|
" attachments"
|
|
2358
|
-
] }) : null, e[19] = n.attachments, e[20] =
|
|
2438
|
+
] }) : null, e[19] = n.attachments, e[20] = F) : F = e[20];
|
|
2439
|
+
let L;
|
|
2440
|
+
e[21] !== E || e[22] !== F ? (L = /* @__PURE__ */ k(X, { gap: "2xs", flex: "1", minWidth: "0", children: [
|
|
2441
|
+
E,
|
|
2442
|
+
F
|
|
2443
|
+
] }), e[21] = E, e[22] = F, e[23] = L) : L = e[23];
|
|
2359
2444
|
let $;
|
|
2360
|
-
e[
|
|
2361
|
-
D,
|
|
2362
|
-
B
|
|
2363
|
-
] }), e[21] = D, e[22] = B, e[23] = $) : $ = e[23];
|
|
2445
|
+
e[24] !== h || e[25] !== n || e[26] !== a ? ($ = h ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ u(mt, { as: ys, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = $) : $ = e[27];
|
|
2364
2446
|
let O;
|
|
2365
|
-
e[
|
|
2366
|
-
let
|
|
2367
|
-
e[
|
|
2368
|
-
let z;
|
|
2369
|
-
e[32] !== O || e[33] !== F ? (z = /* @__PURE__ */ k(Z, { gap: "2xs", flexShrink: 0, children: [
|
|
2370
|
-
O,
|
|
2371
|
-
F
|
|
2372
|
-
] }), e[32] = O, e[33] = F, e[34] = z) : z = e[34];
|
|
2373
|
-
let v;
|
|
2374
|
-
e[35] !== M || e[36] !== $ || e[37] !== z ? (v = /* @__PURE__ */ k(Z, { gap: "xs", alignItems: "flex-start", children: [
|
|
2375
|
-
M,
|
|
2447
|
+
e[28] !== g || e[29] !== n.id || e[30] !== c ? (O = g ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => c?.(n.id), children: /* @__PURE__ */ u(mt, { as: sn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = c, e[31] = O) : O = e[31];
|
|
2448
|
+
let H;
|
|
2449
|
+
e[32] !== $ || e[33] !== O ? (H = /* @__PURE__ */ k(oe, { gap: "2xs", flexShrink: 0, children: [
|
|
2376
2450
|
$,
|
|
2377
|
-
|
|
2378
|
-
] }), e[
|
|
2379
|
-
let
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2451
|
+
O
|
|
2452
|
+
] }), e[32] = $, e[33] = O, e[34] = H) : H = e[34];
|
|
2453
|
+
let R;
|
|
2454
|
+
e[35] !== B || e[36] !== L || e[37] !== H ? (R = /* @__PURE__ */ k(oe, { gap: "xs", alignItems: "flex-start", children: [
|
|
2455
|
+
B,
|
|
2456
|
+
L,
|
|
2457
|
+
H
|
|
2458
|
+
] }), e[35] = B, e[36] = L, e[37] = H, e[38] = R) : R = e[38];
|
|
2459
|
+
let q;
|
|
2460
|
+
return e[39] !== n.id || e[40] !== x || e[41] !== S || e[42] !== R || e[43] !== A || e[44] !== T || e[45] !== w || e[46] !== I ? (q = /* @__PURE__ */ u(D, { minWidth: "0", borderTopWidth: x, borderColor: S, paddingTop: A, paddingBottom: "2xs", bg: T, onDragOver: w, onDrop: I, "data-queued-follow-up-id": n.id, children: R }), e[39] = n.id, e[40] = x, e[41] = S, e[42] = R, e[43] = A, e[44] = T, e[45] = w, e[46] = I, e[47] = q) : q = e[47], q;
|
|
2461
|
+
}, Yi = (t) => {
|
|
2462
|
+
const e = C(24), {
|
|
2383
2463
|
items: n,
|
|
2384
|
-
editingItemId:
|
|
2385
|
-
onEdit:
|
|
2464
|
+
editingItemId: o,
|
|
2465
|
+
onEdit: s,
|
|
2386
2466
|
onRemove: r,
|
|
2387
2467
|
onMove: i
|
|
2388
|
-
} = t, [l, a] =
|
|
2468
|
+
} = t, [l, a] = W(null), [c, d] = W(null);
|
|
2389
2469
|
if (n.length === 0)
|
|
2390
2470
|
return null;
|
|
2391
2471
|
let f;
|
|
2392
|
-
e[0] !== l ? (f = (
|
|
2393
|
-
!l || l ===
|
|
2472
|
+
e[0] !== l ? (f = (y, x) => {
|
|
2473
|
+
!l || l === x || (y.preventDefault(), y.dataTransfer.dropEffect = "move", d(x));
|
|
2394
2474
|
}, e[0] = l, e[1] = f) : f = e[1];
|
|
2395
|
-
const
|
|
2396
|
-
let
|
|
2397
|
-
e[2] !== l || e[3] !== n || e[4] !== i ? (
|
|
2398
|
-
|
|
2399
|
-
const
|
|
2400
|
-
if (a(null), d(null), !
|
|
2475
|
+
const m = f;
|
|
2476
|
+
let p;
|
|
2477
|
+
e[2] !== l || e[3] !== n || e[4] !== i ? (p = (y, x) => {
|
|
2478
|
+
y.preventDefault();
|
|
2479
|
+
const S = l ?? y.dataTransfer.getData("text/plain");
|
|
2480
|
+
if (a(null), d(null), !S || S === x)
|
|
2401
2481
|
return;
|
|
2402
|
-
const
|
|
2403
|
-
if (
|
|
2482
|
+
const A = n.findIndex((I) => I.id === S), T = n.findIndex((I) => I.id === x);
|
|
2483
|
+
if (A === -1 || T === -1 || A === T)
|
|
2404
2484
|
return;
|
|
2405
|
-
const
|
|
2406
|
-
i?.(
|
|
2407
|
-
}, e[2] = l, e[3] = n, e[4] = i, e[5] =
|
|
2408
|
-
const h =
|
|
2485
|
+
const w = T < A ? "up" : "down";
|
|
2486
|
+
i?.(S, w, Math.abs(T - A));
|
|
2487
|
+
}, e[2] = l, e[3] = n, e[4] = i, e[5] = p) : p = e[5];
|
|
2488
|
+
const h = p;
|
|
2409
2489
|
let g;
|
|
2410
|
-
if (e[6] !==
|
|
2411
|
-
let
|
|
2412
|
-
e[14] !==
|
|
2490
|
+
if (e[6] !== c || e[7] !== o || e[8] !== m || e[9] !== h || e[10] !== n || e[11] !== s || e[12] !== r) {
|
|
2491
|
+
let y;
|
|
2492
|
+
e[14] !== c || e[15] !== o || e[16] !== m || e[17] !== h || e[18] !== n.length || e[19] !== s || e[20] !== r ? (y = (x, S) => /* @__PURE__ */ u(Gi, { item: x, index: S, isFirst: S === 0, isLast: S === n.length - 1, isEditing: o === x.id, isDragTarget: c === x.id, onEdit: s, onRemove: r, onDragStart: a, onDragEnd: () => {
|
|
2413
2493
|
a(null), d(null);
|
|
2414
|
-
}, onDragOver:
|
|
2494
|
+
}, onDragOver: m, onDrop: h }, x.id), e[14] = c, e[15] = o, e[16] = m, e[17] = h, e[18] = n.length, e[19] = s, e[20] = r, e[21] = y) : y = e[21], g = n.map(y), e[6] = c, e[7] = o, e[8] = m, e[9] = h, e[10] = n, e[11] = s, e[12] = r, e[13] = g;
|
|
2415
2495
|
} else
|
|
2416
2496
|
g = e[13];
|
|
2417
2497
|
let b;
|
|
2418
|
-
return e[22] !== g ? (b = /* @__PURE__ */
|
|
2419
|
-
},
|
|
2420
|
-
const e =
|
|
2421
|
-
if (e < 60) return `${e}s`;
|
|
2422
|
-
const n = Math.floor(e / 60);
|
|
2423
|
-
return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
|
|
2424
|
-
}, Ui = (t) => {
|
|
2425
|
-
const e = A(9), {
|
|
2426
|
-
hidden: n
|
|
2427
|
-
} = t, s = n === void 0 ? !1 : n, [o, r] = V(0);
|
|
2428
|
-
let i;
|
|
2429
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
|
|
2430
|
-
const l = ie(i);
|
|
2431
|
-
let a, u;
|
|
2432
|
-
if (e[1] !== s ? (a = () => {
|
|
2433
|
-
if (s)
|
|
2434
|
-
return;
|
|
2435
|
-
const m = () => r((Date.now() - l.current) / 1e3);
|
|
2436
|
-
m();
|
|
2437
|
-
const h = setInterval(m, 1e3);
|
|
2438
|
-
return () => clearInterval(h);
|
|
2439
|
-
}, u = [s], e[1] = s, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), J(a, u), s)
|
|
2440
|
-
return null;
|
|
2441
|
-
let d;
|
|
2442
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
|
|
2443
|
-
let f;
|
|
2444
|
-
e[5] !== o ? (f = Ni(o), e[5] = o, e[6] = f) : f = e[6];
|
|
2445
|
-
let p;
|
|
2446
|
-
return e[7] !== f ? (p = /* @__PURE__ */ k(Z, { gap: "2xs", px: "sm", py: "xs", children: [
|
|
2447
|
-
d,
|
|
2448
|
-
/* @__PURE__ */ c(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
|
|
2449
|
-
] }), e[7] = f, e[8] = p) : p = e[8], p;
|
|
2450
|
-
}, ji = (t) => {
|
|
2451
|
-
const e = A(19), {
|
|
2498
|
+
return e[22] !== g ? (b = /* @__PURE__ */ u(X, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
|
|
2499
|
+
}, Ji = (t) => {
|
|
2500
|
+
const e = C(19), {
|
|
2452
2501
|
queuedFollowUps: n,
|
|
2453
|
-
defaultValue:
|
|
2454
|
-
onChange:
|
|
2502
|
+
defaultValue: o,
|
|
2503
|
+
onChange: s,
|
|
2455
2504
|
onSubmit: r,
|
|
2456
2505
|
onUpdate: i
|
|
2457
|
-
} = t, [l, a] =
|
|
2506
|
+
} = t, [l, a] = W(null), [c, d] = W(""), [f, m] = W(0), p = l ? c : o;
|
|
2458
2507
|
let h, g;
|
|
2459
2508
|
e[0] !== l || e[1] !== n ? (h = () => {
|
|
2460
|
-
l && (n.some((
|
|
2461
|
-
}, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]),
|
|
2509
|
+
l && (n.some((_) => _.id === l) || (a(null), d("")));
|
|
2510
|
+
}, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), Z(h, g);
|
|
2462
2511
|
let b;
|
|
2463
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (
|
|
2464
|
-
a(
|
|
2512
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (_) => {
|
|
2513
|
+
a(_.id), d(_.prompt), m(el);
|
|
2465
2514
|
}, e[4] = b) : b = e[4];
|
|
2466
|
-
const
|
|
2467
|
-
let
|
|
2468
|
-
e[5] !== l || e[6] !==
|
|
2469
|
-
l ||
|
|
2470
|
-
}, e[5] = l, e[6] =
|
|
2471
|
-
const
|
|
2472
|
-
let
|
|
2473
|
-
e[8] !== l || e[9] !== r || e[10] !== i ? (
|
|
2515
|
+
const y = b;
|
|
2516
|
+
let x;
|
|
2517
|
+
e[5] !== l || e[6] !== s ? (x = (_) => {
|
|
2518
|
+
l || s?.(_);
|
|
2519
|
+
}, e[5] = l, e[6] = s, e[7] = x) : x = e[7];
|
|
2520
|
+
const S = x;
|
|
2521
|
+
let A;
|
|
2522
|
+
e[8] !== l || e[9] !== r || e[10] !== i ? (A = (_, P, M) => {
|
|
2474
2523
|
if (l) {
|
|
2475
|
-
i?.(l,
|
|
2524
|
+
i?.(l, _), a(null), d("");
|
|
2476
2525
|
return;
|
|
2477
2526
|
}
|
|
2478
|
-
return r?.(
|
|
2479
|
-
}, e[8] = l, e[9] = r, e[10] = i, e[11] =
|
|
2480
|
-
const
|
|
2481
|
-
let
|
|
2482
|
-
return e[12] !==
|
|
2483
|
-
change:
|
|
2484
|
-
edit:
|
|
2527
|
+
return r?.(_, P, M);
|
|
2528
|
+
}, e[8] = l, e[9] = r, e[10] = i, e[11] = A) : A = e[11];
|
|
2529
|
+
const T = A, w = !!l;
|
|
2530
|
+
let I;
|
|
2531
|
+
return e[12] !== S || e[13] !== l || e[14] !== f || e[15] !== p || e[16] !== T || e[17] !== w ? (I = {
|
|
2532
|
+
change: S,
|
|
2533
|
+
edit: y,
|
|
2485
2534
|
editingItemId: l,
|
|
2486
2535
|
focusSignal: f,
|
|
2487
|
-
inputValue:
|
|
2488
|
-
isEditing:
|
|
2489
|
-
submit:
|
|
2490
|
-
}, e[12] =
|
|
2491
|
-
},
|
|
2492
|
-
const e =
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2536
|
+
inputValue: p,
|
|
2537
|
+
isEditing: w,
|
|
2538
|
+
submit: T
|
|
2539
|
+
}, e[12] = S, e[13] = l, e[14] = f, e[15] = p, e[16] = T, e[17] = w, e[18] = I) : I = e[18], I;
|
|
2540
|
+
}, Zi = (t) => {
|
|
2541
|
+
const e = C(46), {
|
|
2542
|
+
conversationKey: n,
|
|
2543
|
+
recentUserMessages: o,
|
|
2544
|
+
actions: s,
|
|
2545
|
+
attachedResources: r,
|
|
2546
|
+
attachmentList: i,
|
|
2547
|
+
chatInputAutoFocus: l,
|
|
2548
|
+
chatInputPlaceholder: a,
|
|
2549
|
+
chatInputQuestionPrompt: c,
|
|
2550
|
+
chatInputReferences: d,
|
|
2551
|
+
hasWorkspaceHub: f,
|
|
2552
|
+
inputDisabled: m,
|
|
2553
|
+
submitDisabled: p,
|
|
2554
|
+
onAttachFiles: h,
|
|
2555
|
+
onAttachText: g,
|
|
2556
|
+
onChatInputAddReference: b,
|
|
2557
|
+
onClearAttachments: y,
|
|
2558
|
+
onInterrupt: x,
|
|
2559
|
+
onQueuedFollowUpMove: S,
|
|
2560
|
+
onQueuedFollowUpRemove: A,
|
|
2510
2561
|
onQueuedFollowUpUpdate: T,
|
|
2511
|
-
queuedComposer:
|
|
2512
|
-
queuedFollowUps:
|
|
2513
|
-
streaming:
|
|
2514
|
-
workspaceHub:
|
|
2515
|
-
} = t,
|
|
2516
|
-
let
|
|
2517
|
-
e[0] !==
|
|
2518
|
-
let
|
|
2519
|
-
e[6] !==
|
|
2520
|
-
const
|
|
2521
|
-
let
|
|
2522
|
-
e[8] !==
|
|
2523
|
-
let H;
|
|
2524
|
-
e[31] !== E || e[32] !== W || e[33] !== Q || e[34] !== M || e[35] !== D || e[36] !== B || e[37] !== $ || e[38] !== F || e[39] !== _ ? (H = /* @__PURE__ */ k(j, { gap: E, p: Q, borderWidth: M, borderColor: D, borderRadius: B, bg: $, children: [
|
|
2525
|
-
_,
|
|
2526
|
-
F,
|
|
2527
|
-
W
|
|
2528
|
-
] }), e[31] = E, e[32] = W, e[33] = Q, e[34] = M, e[35] = D, e[36] = B, e[37] = $, e[38] = F, e[39] = _, e[40] = H) : H = e[40];
|
|
2562
|
+
queuedComposer: w,
|
|
2563
|
+
queuedFollowUps: I,
|
|
2564
|
+
streaming: _,
|
|
2565
|
+
workspaceHub: P
|
|
2566
|
+
} = t, M = I.length > 0, z = f ? "2xs" : "xs", B = f ? "2xs" : "0", E = f ? "2xs" : void 0, F = f ? "1px" : void 0, L = f ? "border" : void 0, $ = f ? "sm" : void 0, O = f ? "bg.subtle" : void 0, H = T ? w.edit : void 0;
|
|
2567
|
+
let R;
|
|
2568
|
+
e[0] !== S || e[1] !== A || e[2] !== w.editingItemId || e[3] !== I || e[4] !== H ? (R = /* @__PURE__ */ u(Yi, { items: I, editingItemId: w.editingItemId, onEdit: H, onRemove: A, onMove: S }), e[0] = S, e[1] = A, e[2] = w.editingItemId, e[3] = I, e[4] = H, e[5] = R) : R = e[5];
|
|
2569
|
+
let q;
|
|
2570
|
+
e[6] !== w.inputValue ? (q = Xi(w.inputValue), e[6] = w.inputValue, e[7] = q) : q = e[7];
|
|
2571
|
+
const V = w.isEditing ? "Save queued follow-up" : void 0;
|
|
2572
|
+
let j;
|
|
2573
|
+
e[8] !== s || e[9] !== r || e[10] !== i || e[11] !== l || e[12] !== a || e[13] !== c || e[14] !== d || e[15] !== n || e[16] !== M || e[17] !== f || e[18] !== m || e[19] !== h || e[20] !== g || e[21] !== b || e[22] !== y || e[23] !== x || e[24] !== w.change || e[25] !== w.focusSignal || e[26] !== w.submit || e[27] !== o || e[28] !== _ || e[29] !== p || e[30] !== V || e[31] !== q ? (j = /* @__PURE__ */ u(So, { recentUserMessages: o, placeholder: a, defaultState: q, streaming: _, onSubmit: w.submit, onInterrupt: x, onAttachFiles: h, onAttachText: g, onChange: w.change, actions: s, attachedResources: r, onClearAttachments: y, attachmentList: i, isDisabled: m, submitDisabled: p, attachedToTop: M, recessed: f, questionPrompt: c, autoFocus: l, focusSignal: w.focusSignal, submitTitle: V, references: d, onAddReference: b }, n), e[8] = s, e[9] = r, e[10] = i, e[11] = l, e[12] = a, e[13] = c, e[14] = d, e[15] = n, e[16] = M, e[17] = f, e[18] = m, e[19] = h, e[20] = g, e[21] = b, e[22] = y, e[23] = x, e[24] = w.change, e[25] = w.focusSignal, e[26] = w.submit, e[27] = o, e[28] = _, e[29] = p, e[30] = V, e[31] = q, e[32] = j) : j = e[32];
|
|
2529
2574
|
let K;
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2575
|
+
e[33] !== B || e[34] !== j || e[35] !== E || e[36] !== F || e[37] !== L || e[38] !== $ || e[39] !== O || e[40] !== R || e[41] !== P ? (K = /* @__PURE__ */ k(X, { gap: B, p: E, borderWidth: F, borderColor: L, borderRadius: $, bg: O, children: [
|
|
2576
|
+
P,
|
|
2577
|
+
R,
|
|
2578
|
+
j
|
|
2579
|
+
] }), e[33] = B, e[34] = j, e[35] = E, e[36] = F, e[37] = L, e[38] = $, e[39] = O, e[40] = R, e[41] = P, e[42] = K) : K = e[42];
|
|
2580
|
+
let G;
|
|
2581
|
+
return e[43] !== z || e[44] !== K ? (G = /* @__PURE__ */ u(X, { px: z, gap: "0", children: K }), e[43] = z, e[44] = K, e[45] = G) : G = e[45], G;
|
|
2582
|
+
};
|
|
2583
|
+
function el(t) {
|
|
2584
|
+
return t + 1;
|
|
2585
|
+
}
|
|
2586
|
+
const tl = (t) => {
|
|
2587
|
+
const e = Math.max(0, Math.floor(t));
|
|
2588
|
+
if (e < 60) return `${e}s`;
|
|
2589
|
+
const n = Math.floor(e / 60);
|
|
2590
|
+
return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
|
|
2591
|
+
}, nl = (t) => {
|
|
2592
|
+
const e = C(9), {
|
|
2593
|
+
hidden: n
|
|
2594
|
+
} = t, o = n === void 0 ? !1 : n, [s, r] = W(0);
|
|
2595
|
+
let i;
|
|
2596
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
|
|
2597
|
+
const l = J(i);
|
|
2598
|
+
let a, c;
|
|
2599
|
+
if (e[1] !== o ? (a = () => {
|
|
2600
|
+
if (o)
|
|
2601
|
+
return;
|
|
2602
|
+
const p = () => r((Date.now() - l.current) / 1e3);
|
|
2603
|
+
p();
|
|
2604
|
+
const h = setInterval(p, 1e3);
|
|
2605
|
+
return () => clearInterval(h);
|
|
2606
|
+
}, c = [o], e[1] = o, e[2] = a, e[3] = c) : (a = e[2], c = e[3]), Z(a, c), o)
|
|
2607
|
+
return null;
|
|
2608
|
+
let d;
|
|
2609
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
|
|
2610
|
+
let f;
|
|
2611
|
+
e[5] !== s ? (f = tl(s), e[5] = s, e[6] = f) : f = e[6];
|
|
2612
|
+
let m;
|
|
2613
|
+
return e[7] !== f ? (m = /* @__PURE__ */ k(oe, { gap: "2xs", px: "sm", py: "xs", children: [
|
|
2614
|
+
d,
|
|
2615
|
+
/* @__PURE__ */ u(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
|
|
2616
|
+
] }), e[7] = f, e[8] = m) : m = e[8], m;
|
|
2617
|
+
}, _l = (t) => {
|
|
2618
|
+
const e = C(82), {
|
|
2533
2619
|
conversationKey: n,
|
|
2534
|
-
messages:
|
|
2535
|
-
loading:
|
|
2620
|
+
messages: o,
|
|
2621
|
+
loading: s,
|
|
2536
2622
|
streaming: r,
|
|
2537
2623
|
emptyStateTitle: i,
|
|
2538
2624
|
emptyStateDescription: l,
|
|
2539
2625
|
emptyStateContent: a,
|
|
2540
|
-
loaderComponent:
|
|
2626
|
+
loaderComponent: c,
|
|
2541
2627
|
chatInputPlaceholder: d,
|
|
2542
2628
|
chatInputDefaultValue: f,
|
|
2543
|
-
onSubmitMessage:
|
|
2544
|
-
onInterrupt:
|
|
2629
|
+
onSubmitMessage: m,
|
|
2630
|
+
onInterrupt: p,
|
|
2545
2631
|
onAttachFiles: h,
|
|
2546
2632
|
onAttachText: g,
|
|
2547
2633
|
onChatInputChange: b,
|
|
2548
|
-
actions:
|
|
2549
|
-
attachedResources:
|
|
2550
|
-
onClearAttachments:
|
|
2551
|
-
attachmentList:
|
|
2552
|
-
approvalPrompt:
|
|
2553
|
-
workspaceHub:
|
|
2554
|
-
workspaceInitializing:
|
|
2555
|
-
inputDisabled:
|
|
2556
|
-
submitDisabled:
|
|
2557
|
-
chatInputQuestionPrompt:
|
|
2558
|
-
chatInputAutoFocus:
|
|
2559
|
-
queuedFollowUps:
|
|
2560
|
-
onQueuedFollowUpUpdate:
|
|
2561
|
-
onQueuedFollowUpRemove:
|
|
2562
|
-
onQueuedFollowUpMove:
|
|
2563
|
-
chatInputReferences:
|
|
2564
|
-
onChatInputAddReference:
|
|
2565
|
-
} = t,
|
|
2634
|
+
actions: y,
|
|
2635
|
+
attachedResources: x,
|
|
2636
|
+
onClearAttachments: S,
|
|
2637
|
+
attachmentList: A,
|
|
2638
|
+
approvalPrompt: T,
|
|
2639
|
+
workspaceHub: w,
|
|
2640
|
+
workspaceInitializing: I,
|
|
2641
|
+
inputDisabled: _,
|
|
2642
|
+
submitDisabled: P,
|
|
2643
|
+
chatInputQuestionPrompt: M,
|
|
2644
|
+
chatInputAutoFocus: z,
|
|
2645
|
+
queuedFollowUps: B,
|
|
2646
|
+
onQueuedFollowUpUpdate: E,
|
|
2647
|
+
onQueuedFollowUpRemove: F,
|
|
2648
|
+
onQueuedFollowUpMove: L,
|
|
2649
|
+
chatInputReferences: $,
|
|
2650
|
+
onChatInputAddReference: O
|
|
2651
|
+
} = t, H = s === void 0 ? !1 : s, R = r === void 0 ? !1 : r, q = f === void 0 ? "" : f, V = I === void 0 ? !1 : I, j = _ === void 0 ? !1 : _, K = P === void 0 ? !1 : P, G = z === void 0 ? !1 : z;
|
|
2566
2652
|
let Se;
|
|
2567
|
-
e[0] !==
|
|
2568
|
-
const
|
|
2569
|
-
let
|
|
2570
|
-
e[2] !==
|
|
2571
|
-
const
|
|
2572
|
-
let
|
|
2573
|
-
if (e[4] !== n || e[5] !==
|
|
2574
|
-
const
|
|
2575
|
-
streaming:
|
|
2653
|
+
e[0] !== B ? (Se = B === void 0 ? [] : B, e[0] = B, e[1] = Se) : Se = e[1];
|
|
2654
|
+
const re = Se;
|
|
2655
|
+
let ie;
|
|
2656
|
+
e[2] !== $ ? (ie = $ === void 0 ? [] : $, e[2] = $, e[3] = ie) : ie = e[3];
|
|
2657
|
+
const ee = ie;
|
|
2658
|
+
let te, ne, le, Te, ae;
|
|
2659
|
+
if (e[4] !== n || e[5] !== o || e[6] !== R) {
|
|
2660
|
+
const he = Ci(o, {
|
|
2661
|
+
streaming: R
|
|
2576
2662
|
});
|
|
2577
|
-
|
|
2663
|
+
te = he.length > 0, le = n ?? he[0]?.id, ne = te ? le ?? "active-conversation" : null, ae = he.reduce(sl, 0), Te = ki(he), e[4] = n, e[5] = o, e[6] = R, e[7] = te, e[8] = ne, e[9] = le, e[10] = Te, e[11] = ae;
|
|
2578
2664
|
} else
|
|
2579
|
-
|
|
2665
|
+
te = e[7], ne = e[8], le = e[9], Te = e[10], ae = e[11];
|
|
2580
2666
|
const {
|
|
2581
|
-
groups:
|
|
2582
|
-
leadingResponses:
|
|
2583
|
-
} =
|
|
2584
|
-
let
|
|
2585
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
2586
|
-
let
|
|
2587
|
-
e[13] !== l || e[14] !== i ? (
|
|
2588
|
-
const
|
|
2589
|
-
let
|
|
2590
|
-
e[16] !==
|
|
2591
|
-
const
|
|
2592
|
-
let
|
|
2593
|
-
e[19] !==
|
|
2594
|
-
queuedFollowUps:
|
|
2595
|
-
defaultValue:
|
|
2667
|
+
groups: ce,
|
|
2668
|
+
leadingResponses: Be
|
|
2669
|
+
} = Te, [Fe, Ne] = W(ol), [Le, it] = W(null), lt = !te && H;
|
|
2670
|
+
let Q;
|
|
2671
|
+
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ u(xs, { size: 48, strokeWidth: 1.5 }), e[12] = Q) : Q = e[12];
|
|
2672
|
+
let Y;
|
|
2673
|
+
e[13] !== l || e[14] !== i ? (Y = /* @__PURE__ */ u(Is, { icon: Q, title: i, description: l }), e[13] = l, e[14] = i, e[15] = Y) : Y = e[15];
|
|
2674
|
+
const we = lt ? c : a ?? Y, $e = !!w;
|
|
2675
|
+
let Ue;
|
|
2676
|
+
e[16] !== M || e[17] !== o ? (Ue = M ?? Io(o), e[16] = M, e[17] = o, e[18] = Ue) : Ue = e[18];
|
|
2677
|
+
const Oe = Ue, at = !!Oe, ct = R && te && !V && !Oe, je = !ne || Le === ne;
|
|
2678
|
+
let Ke;
|
|
2679
|
+
e[19] !== q || e[20] !== b || e[21] !== E || e[22] !== m || e[23] !== re ? (Ke = {
|
|
2680
|
+
queuedFollowUps: re,
|
|
2681
|
+
defaultValue: q,
|
|
2596
2682
|
onChange: b,
|
|
2597
|
-
onSubmit:
|
|
2598
|
-
onUpdate:
|
|
2599
|
-
}, e[19] =
|
|
2600
|
-
const
|
|
2601
|
-
let
|
|
2602
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
2603
|
-
|
|
2604
|
-
const
|
|
2605
|
-
return
|
|
2683
|
+
onSubmit: m,
|
|
2684
|
+
onUpdate: E
|
|
2685
|
+
}, e[19] = q, e[20] = b, e[21] = E, e[22] = m, e[23] = re, e[24] = Ke) : Ke = e[24];
|
|
2686
|
+
const ut = Ji(Ke);
|
|
2687
|
+
let Xe;
|
|
2688
|
+
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Xe = (he) => {
|
|
2689
|
+
Ne((qn) => {
|
|
2690
|
+
const Ye = new Set(qn);
|
|
2691
|
+
return Ye.has(he) ? Ye.delete(he) : Ye.add(he), Ye;
|
|
2606
2692
|
});
|
|
2607
|
-
}, e[25] =
|
|
2608
|
-
const
|
|
2609
|
-
let
|
|
2610
|
-
e[26] !==
|
|
2611
|
-
const
|
|
2693
|
+
}, e[25] = Xe) : Xe = e[25];
|
|
2694
|
+
const Qn = Xe, dt = le ?? null;
|
|
2695
|
+
let Ae;
|
|
2696
|
+
e[26] !== dt || e[27] !== ae ? (Ae = /* @__PURE__ */ u(Us, { conversationKey: dt, userMessageCount: ae }), e[26] = dt, e[27] = ae, e[28] = Ae) : Ae = e[28];
|
|
2697
|
+
const ft = je ? "visible" : "hidden";
|
|
2612
2698
|
let Ce;
|
|
2613
|
-
e[29] !==
|
|
2699
|
+
e[29] !== we || e[30] !== Fe || e[31] !== ce || e[32] !== te || e[33] !== at || e[34] !== Be || e[35] !== ne || e[36] !== R ? (Ce = te ? /* @__PURE__ */ u(Ki, { leadingResponses: Be, groups: ce, streaming: R, hideActiveQuestionForms: at, expandedStickyMessageIds: Fe, onToggleStickyMessage: Qn, onReady: () => it(ne) }, ne) : we, e[29] = we, e[30] = Fe, e[31] = ce, e[32] = te, e[33] = at, e[34] = Be, e[35] = ne, e[36] = R, e[37] = Ce) : Ce = e[37];
|
|
2700
|
+
let ke;
|
|
2701
|
+
e[38] !== ft || e[39] !== Ce ? (ke = /* @__PURE__ */ u(gt.Viewport, { visibility: ft, children: Ce }), e[38] = ft, e[39] = Ce, e[40] = ke) : ke = e[40];
|
|
2614
2702
|
let Ie;
|
|
2615
|
-
e[
|
|
2703
|
+
e[41] !== je ? (Ie = je ? /* @__PURE__ */ u(gt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = je, e[42] = Ie) : Ie = e[42];
|
|
2616
2704
|
let _e;
|
|
2617
|
-
e[
|
|
2618
|
-
|
|
2619
|
-
e[43] !== ke || e[44] !== Ie || e[45] !== _e ? (Re = /* @__PURE__ */ k(pt.Root, { children: [
|
|
2705
|
+
e[43] !== Ae || e[44] !== ke || e[45] !== Ie ? (_e = /* @__PURE__ */ k(gt.Root, { children: [
|
|
2706
|
+
Ae,
|
|
2620
2707
|
ke,
|
|
2621
|
-
Ie
|
|
2622
|
-
|
|
2623
|
-
] }), e[43] = ke, e[44] = Ie, e[45] = _e, e[46] = Re) : Re = e[46];
|
|
2708
|
+
Ie
|
|
2709
|
+
] }), e[43] = Ae, e[44] = ke, e[45] = Ie, e[46] = _e) : _e = e[46];
|
|
2624
2710
|
let ve;
|
|
2625
|
-
e[47] !==
|
|
2711
|
+
e[47] !== ct || e[48] !== R ? (ve = R ? /* @__PURE__ */ u(nl, { hidden: !ct }) : null, e[47] = ct, e[48] = R, e[49] = ve) : ve = e[49];
|
|
2712
|
+
const pt = n ?? o[0]?.id;
|
|
2626
2713
|
let Me;
|
|
2627
|
-
e[50] !==
|
|
2628
|
-
let
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2714
|
+
e[50] !== o ? (Me = ho(o), e[50] = o, e[51] = Me) : Me = e[51];
|
|
2715
|
+
let Re;
|
|
2716
|
+
e[52] !== y || e[53] !== Oe || e[54] !== x || e[55] !== A || e[56] !== G || e[57] !== d || e[58] !== ee || e[59] !== $e || e[60] !== j || e[61] !== h || e[62] !== g || e[63] !== O || e[64] !== S || e[65] !== p || e[66] !== L || e[67] !== F || e[68] !== E || e[69] !== ut || e[70] !== re || e[71] !== R || e[72] !== K || e[73] !== pt || e[74] !== Me || e[75] !== w ? (Re = /* @__PURE__ */ u(Zi, { conversationKey: pt, recentUserMessages: Me, actions: y, attachedResources: x, attachmentList: A, chatInputAutoFocus: G, chatInputPlaceholder: d, chatInputQuestionPrompt: Oe, chatInputReferences: ee, hasWorkspaceHub: $e, inputDisabled: j, submitDisabled: K, onAttachFiles: h, onAttachText: g, onChatInputAddReference: O, onClearAttachments: S, onInterrupt: p, onQueuedFollowUpMove: L, onQueuedFollowUpRemove: F, onQueuedFollowUpUpdate: E, queuedComposer: ut, queuedFollowUps: re, streaming: R, workspaceHub: w }), e[52] = y, e[53] = Oe, e[54] = x, e[55] = A, e[56] = G, e[57] = d, e[58] = ee, e[59] = $e, e[60] = j, e[61] = h, e[62] = g, e[63] = O, e[64] = S, e[65] = p, e[66] = L, e[67] = F, e[68] = E, e[69] = ut, e[70] = re, e[71] = R, e[72] = K, e[73] = pt, e[74] = Me, e[75] = w, e[76] = Re) : Re = e[76];
|
|
2717
|
+
let Ge;
|
|
2718
|
+
return e[77] !== T || e[78] !== _e || e[79] !== ve || e[80] !== Re ? (Ge = /* @__PURE__ */ k(ye, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
|
|
2719
|
+
_e,
|
|
2720
|
+
T,
|
|
2632
2721
|
ve,
|
|
2633
|
-
|
|
2634
|
-
] }), e[
|
|
2722
|
+
Re
|
|
2723
|
+
] }), e[77] = T, e[78] = _e, e[79] = ve, e[80] = Re, e[81] = Ge) : Ge = e[81], Ge;
|
|
2635
2724
|
};
|
|
2636
|
-
function
|
|
2637
|
-
return t + 1;
|
|
2638
|
-
}
|
|
2639
|
-
function Gi(t, e) {
|
|
2725
|
+
function sl(t, e) {
|
|
2640
2726
|
return t + (e.role === "user" ? 1 : 0);
|
|
2641
2727
|
}
|
|
2642
|
-
function
|
|
2728
|
+
function ol() {
|
|
2643
2729
|
return /* @__PURE__ */ new Set();
|
|
2644
2730
|
}
|
|
2645
|
-
const
|
|
2646
|
-
const t =
|
|
2731
|
+
const Gt = (t) => /* @__PURE__ */ u(X, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ u(Gn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), vl = () => {
|
|
2732
|
+
const t = C(2);
|
|
2647
2733
|
let e;
|
|
2648
|
-
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
2734
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ u(be.Root, { from: "user", children: /* @__PURE__ */ u(be.Content, { from: "user", children: Gt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
|
|
2649
2735
|
let n;
|
|
2650
|
-
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(
|
|
2736
|
+
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(X, { minH: "full", py: "xs", gap: "0", children: [
|
|
2651
2737
|
e,
|
|
2652
|
-
/* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ u(be.Root, { from: "assistant", children: /* @__PURE__ */ u(be.Content, { from: "assistant", children: Gt(["76%", "62%", "40%"]) }) })
|
|
2653
2739
|
] }), t[1] = n) : n = t[1], n;
|
|
2654
|
-
},
|
|
2740
|
+
}, rl = 3, Yt = 10, il = 26, kt = 4, ll = (t, e) => {
|
|
2655
2741
|
if (e === null) return 0;
|
|
2656
2742
|
const n = Math.abs(t - e);
|
|
2657
|
-
return n >=
|
|
2658
|
-
},
|
|
2743
|
+
return n >= kt ? 0 : (1 + Math.cos(Math.PI * n / kt)) / 2;
|
|
2744
|
+
}, al = (t, e) => {
|
|
2659
2745
|
if (e === null) return "fg.subtle";
|
|
2660
2746
|
const n = Math.abs(t - e);
|
|
2661
|
-
return n < 0.5 ? "fg" : n <
|
|
2662
|
-
},
|
|
2663
|
-
const e =
|
|
2747
|
+
return n < 0.5 ? "fg" : n < kt ? "fg.muted" : "fg.subtle";
|
|
2748
|
+
}, cl = (t) => {
|
|
2749
|
+
const e = C(11), {
|
|
2664
2750
|
item: n,
|
|
2665
|
-
position:
|
|
2666
|
-
} = t,
|
|
2751
|
+
position: o
|
|
2752
|
+
} = t, s = `${o.left}px`, r = `${o.top}px`;
|
|
2667
2753
|
let i;
|
|
2668
|
-
e[0] !== n.message ? (i = /* @__PURE__ */
|
|
2754
|
+
e[0] !== n.message ? (i = /* @__PURE__ */ u(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
|
|
2669
2755
|
let l;
|
|
2670
|
-
e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */
|
|
2756
|
+
e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
|
|
2671
2757
|
let a;
|
|
2672
|
-
e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(
|
|
2758
|
+
e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(X, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
|
|
2673
2759
|
i,
|
|
2674
2760
|
l
|
|
2675
2761
|
] }), e[4] = i, e[5] = l, e[6] = a) : a = e[6];
|
|
2676
|
-
let
|
|
2677
|
-
return e[7] !==
|
|
2678
|
-
},
|
|
2679
|
-
const e =
|
|
2762
|
+
let c;
|
|
2763
|
+
return e[7] !== s || e[8] !== r || e[9] !== a ? (c = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(D, { position: "fixed", left: s, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = s, e[8] = r, e[9] = a, e[10] = c) : c = e[10], c;
|
|
2764
|
+
}, Ml = (t) => {
|
|
2765
|
+
const e = C(22), {
|
|
2680
2766
|
items: n,
|
|
2681
|
-
onSelect:
|
|
2682
|
-
floating:
|
|
2683
|
-
} = t, r =
|
|
2684
|
-
if (n.length <
|
|
2767
|
+
onSelect: o,
|
|
2768
|
+
floating: s
|
|
2769
|
+
} = t, r = s === void 0 ? !1 : s, [i, l] = W(null), [a, c] = W(null);
|
|
2770
|
+
if (n.length < rl)
|
|
2685
2771
|
return null;
|
|
2686
2772
|
let d;
|
|
2687
|
-
e[0] !== n.length ? (d = (
|
|
2688
|
-
const
|
|
2689
|
-
l(
|
|
2690
|
-
left:
|
|
2691
|
-
top:
|
|
2773
|
+
e[0] !== n.length ? (d = (A) => {
|
|
2774
|
+
const T = A.currentTarget.getBoundingClientRect(), w = (A.clientY - T.top) / T.height, I = Math.min(n.length - 1, Math.max(0, w * n.length - 0.5)), _ = Math.round(I);
|
|
2775
|
+
l(I), c({
|
|
2776
|
+
left: T.right,
|
|
2777
|
+
top: T.top + (_ + 0.5) / n.length * T.height
|
|
2692
2778
|
});
|
|
2693
2779
|
}, e[0] = n.length, e[1] = d) : d = e[1];
|
|
2694
|
-
const f = d,
|
|
2780
|
+
const f = d, m = i === null ? null : Math.round(i), p = m === null ? null : n[m];
|
|
2695
2781
|
let h;
|
|
2696
2782
|
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => l(null), e[2] = h) : h = e[2];
|
|
2697
2783
|
let g;
|
|
@@ -2703,100 +2789,100 @@ const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((
|
|
|
2703
2789
|
bg: "bg"
|
|
2704
2790
|
} : {}, e[3] = r, e[4] = g) : g = e[4];
|
|
2705
2791
|
let b;
|
|
2706
|
-
if (e[5] !== n || e[6] !==
|
|
2707
|
-
let
|
|
2708
|
-
e[9] !==
|
|
2792
|
+
if (e[5] !== n || e[6] !== o || e[7] !== i) {
|
|
2793
|
+
let A;
|
|
2794
|
+
e[9] !== o || e[10] !== i ? (A = (T, w) => /* @__PURE__ */ u(Jt.button, { type: "button", h: "2px", w: `${Yt + (il - Yt) * ll(w, i)}px`, bg: al(w, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${w + 1}`, onClick: () => o?.(T.id) }, T.id), e[9] = o, e[10] = i, e[11] = A) : A = e[11], b = n.map(A), e[5] = n, e[6] = o, e[7] = i, e[8] = b;
|
|
2709
2795
|
} else
|
|
2710
2796
|
b = e[8];
|
|
2711
|
-
let x;
|
|
2712
|
-
e[12] !== f || e[13] !== g || e[14] !== b ? (x = /* @__PURE__ */ c(be, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = x) : x = e[15];
|
|
2713
2797
|
let y;
|
|
2714
|
-
e[
|
|
2715
|
-
let
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2798
|
+
e[12] !== f || e[13] !== g || e[14] !== b ? (y = /* @__PURE__ */ u(ye, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = y) : y = e[15];
|
|
2799
|
+
let x;
|
|
2800
|
+
e[16] !== p || e[17] !== a ? (x = p && a ? /* @__PURE__ */ u(cl, { item: p, position: a }) : null, e[16] = p, e[17] = a, e[18] = x) : x = e[18];
|
|
2801
|
+
let S;
|
|
2802
|
+
return e[19] !== y || e[20] !== x ? (S = /* @__PURE__ */ k(D, { position: "relative", w: "10", flexShrink: 0, children: [
|
|
2803
|
+
y,
|
|
2804
|
+
x
|
|
2805
|
+
] }), e[19] = y, e[20] = x, e[21] = S) : S = e[21], S;
|
|
2806
|
+
}, ul = (t) => {
|
|
2807
|
+
const e = C(13), {
|
|
2722
2808
|
status: n,
|
|
2723
|
-
statusLabel:
|
|
2724
|
-
additions:
|
|
2809
|
+
statusLabel: o,
|
|
2810
|
+
additions: s,
|
|
2725
2811
|
deletions: r
|
|
2726
2812
|
} = t;
|
|
2727
2813
|
if (n === "loading") {
|
|
2728
|
-
let
|
|
2729
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
2730
|
-
const d =
|
|
2814
|
+
let c;
|
|
2815
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[0] = c) : c = e[0];
|
|
2816
|
+
const d = o ?? "Setting up workspace...";
|
|
2731
2817
|
let f;
|
|
2732
|
-
return e[1] !== d ? (f = /* @__PURE__ */ k(
|
|
2733
|
-
|
|
2734
|
-
/* @__PURE__ */
|
|
2818
|
+
return e[1] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
|
|
2819
|
+
c,
|
|
2820
|
+
/* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
|
|
2735
2821
|
] }), e[1] = d, e[2] = f) : f = e[2], f;
|
|
2736
2822
|
}
|
|
2737
2823
|
if (n === "error") {
|
|
2738
|
-
let
|
|
2739
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
2740
|
-
const d =
|
|
2824
|
+
let c;
|
|
2825
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(rn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = c) : c = e[3];
|
|
2826
|
+
const d = o ?? "Workspace setup failed";
|
|
2741
2827
|
let f;
|
|
2742
|
-
return e[4] !== d ? (f = /* @__PURE__ */ k(
|
|
2743
|
-
|
|
2744
|
-
/* @__PURE__ */
|
|
2828
|
+
return e[4] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
|
|
2829
|
+
c,
|
|
2830
|
+
/* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
|
|
2745
2831
|
] }), e[4] = d, e[5] = f) : f = e[5], f;
|
|
2746
2832
|
}
|
|
2747
|
-
if (
|
|
2833
|
+
if (s <= 0 && r <= 0)
|
|
2748
2834
|
return null;
|
|
2749
2835
|
let i;
|
|
2750
|
-
e[6] !==
|
|
2836
|
+
e[6] !== s ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
|
|
2751
2837
|
"+",
|
|
2752
|
-
|
|
2753
|
-
] }), e[6] =
|
|
2838
|
+
s
|
|
2839
|
+
] }), e[6] = s, e[7] = i) : i = e[7];
|
|
2754
2840
|
let l;
|
|
2755
2841
|
e[8] !== r ? (l = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.error", children: [
|
|
2756
2842
|
"−",
|
|
2757
2843
|
r
|
|
2758
2844
|
] }), e[8] = r, e[9] = l) : l = e[9];
|
|
2759
2845
|
let a;
|
|
2760
|
-
return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(
|
|
2846
|
+
return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(oe, { gap: "2xs", children: [
|
|
2761
2847
|
i,
|
|
2762
2848
|
l
|
|
2763
2849
|
] }), e[10] = i, e[11] = l, e[12] = a) : a = e[12], a;
|
|
2764
|
-
},
|
|
2765
|
-
const e =
|
|
2850
|
+
}, Rl = (t) => {
|
|
2851
|
+
const e = C(13), {
|
|
2766
2852
|
workspaceControl: n,
|
|
2767
|
-
additions:
|
|
2768
|
-
deletions:
|
|
2853
|
+
additions: o,
|
|
2854
|
+
deletions: s,
|
|
2769
2855
|
action: r,
|
|
2770
2856
|
status: i,
|
|
2771
2857
|
statusLabel: l
|
|
2772
2858
|
} = t, a = i === void 0 ? "ready" : i;
|
|
2773
|
-
let
|
|
2774
|
-
e[0] !==
|
|
2859
|
+
let c;
|
|
2860
|
+
e[0] !== o || e[1] !== s || e[2] !== a || e[3] !== l ? (c = /* @__PURE__ */ u(ul, { status: a, statusLabel: l, additions: o, deletions: s }), e[0] = o, e[1] = s, e[2] = a, e[3] = l, e[4] = c) : c = e[4];
|
|
2775
2861
|
let d;
|
|
2776
|
-
e[5] !==
|
|
2862
|
+
e[5] !== c || e[6] !== n ? (d = /* @__PURE__ */ k(oe, { gap: "sm", minW: "0", children: [
|
|
2777
2863
|
n,
|
|
2778
|
-
|
|
2779
|
-
] }), e[5] =
|
|
2864
|
+
c
|
|
2865
|
+
] }), e[5] = c, e[6] = n, e[7] = d) : d = e[7];
|
|
2780
2866
|
let f;
|
|
2781
|
-
e[8] !== r ? (f = r ? /* @__PURE__ */
|
|
2782
|
-
let
|
|
2783
|
-
return e[10] !== d || e[11] !== f ? (
|
|
2867
|
+
e[8] !== r ? (f = r ? /* @__PURE__ */ u(ye, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
|
|
2868
|
+
let m;
|
|
2869
|
+
return e[10] !== d || e[11] !== f ? (m = /* @__PURE__ */ k(ye, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
|
|
2784
2870
|
d,
|
|
2785
2871
|
f
|
|
2786
|
-
] }), e[10] = d, e[11] = f, e[12] =
|
|
2872
|
+
] }), e[10] = d, e[11] = f, e[12] = m) : m = e[12], m;
|
|
2787
2873
|
};
|
|
2788
2874
|
export {
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2875
|
+
kl as ApprovalPrompt,
|
|
2876
|
+
Il as AttachmentList,
|
|
2877
|
+
Us as AutoScroll,
|
|
2878
|
+
So as ChatInput,
|
|
2879
|
+
be as ChatMessage,
|
|
2880
|
+
_l as ChatPanel,
|
|
2881
|
+
gt as ChatPrimitives,
|
|
2882
|
+
vl as ChatSkeleton,
|
|
2883
|
+
Rl as ChatWorkspaceHub,
|
|
2884
|
+
Ml as ConversationBrowse,
|
|
2885
|
+
mo as SendButton,
|
|
2886
|
+
Xi as createSerializedPromptState
|
|
2801
2887
|
};
|
|
2802
2888
|
//# sourceMappingURL=chat-ui.js.map
|