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