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