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