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