@mechane-ai/elements 0.65.0 → 0.68.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 (129) hide show
  1. package/README.md +21 -10
  2. package/dist/ai.js +288 -205
  3. package/dist/{article-BrUa4Wz1.js → article-Ni152e-v.js} +107 -92
  4. package/dist/article.js +1 -1
  5. package/dist/catalog.json +151 -34
  6. package/dist/{categorical-values-AXJkMt-Y.js → categorical-values-6Iz03F1i.js} +1 -1
  7. package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
  8. package/dist/charts/cartesian.js +1 -1
  9. package/dist/charts/cells.js +1 -1
  10. package/dist/charts/comparison.js +1 -1
  11. package/dist/charts/distribution.js +1 -1
  12. package/dist/charts/figure.js +12 -12
  13. package/dist/charts/graph.js +1 -1
  14. package/dist/charts/hierarchy.js +1 -1
  15. package/dist/charts/image.js +1 -1
  16. package/dist/charts/matrix.js +2 -2
  17. package/dist/charts/plot.js +16 -15
  18. package/dist/charts/relationship.js +1 -1
  19. package/dist/charts/text.js +1 -1
  20. package/dist/charts/timeline.js +2 -2
  21. package/dist/charts/trend.js +1 -1
  22. package/dist/charts.js +3 -3
  23. package/dist/{code-block-BDRmjlES.js → code-block-DbW_t9U4.js} +1 -1
  24. package/dist/collections.js +1 -1
  25. package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
  26. package/dist/{commands-rzsDElrG.js → commands-C7Zrp-tG.js} +2 -2
  27. package/dist/content/code.js +1 -1
  28. package/dist/content/diff.js +3 -3
  29. package/dist/content/link.js +1 -1
  30. package/dist/content/markdown.js +1 -1
  31. package/dist/content/tree.js +2 -2
  32. package/dist/{content-link-DRaNf1mD.js → content-link-BN4NPp0u.js} +1 -1
  33. package/dist/content.js +1 -1
  34. package/dist/{dates-wu-gKO2C.js → dates-OTq-xU33.js} +2 -2
  35. package/dist/{dumbbell-plot-VFajQtEW.js → dumbbell-plot-jaQvOctJ.js} +4 -4
  36. package/dist/{embedding-map-BqDEmy88.js → embedding-map-DnZL1kvY.js} +8 -8
  37. package/dist/feedback.js +1 -1
  38. package/dist/figure-format-BVb7yFCA.js +46 -0
  39. package/dist/{figure-frame-Dd-pOeZN.js → figure-frame-96zFqsWz.js} +22 -21
  40. package/dist/forms/dates.js +1 -1
  41. package/dist/{forms-Bjx7JQ30.js → forms-iAOjGRTO.js} +1 -1
  42. package/dist/forms.js +2 -2
  43. package/dist/{image-grid-Dpyqxgwy.js → image-grid-B6fdmE9c.js} +4 -4
  44. package/dist/index.js +1 -1
  45. package/dist/kits/evaluation.js +15 -15
  46. package/dist/kits/interpretability.js +49 -45
  47. package/dist/kits/operations.js +81 -80
  48. package/dist/kits/research.js +776 -499
  49. package/dist/kits/training.js +108 -107
  50. package/dist/layout.js +1 -1
  51. package/dist/lesson.js +3 -3
  52. package/dist/markdown-JeuBeMDZ.js +293 -0
  53. package/dist/mdx.js +6 -6
  54. package/dist/navigation/commands.js +1 -1
  55. package/dist/{navigation-Cp3p0gss.js → navigation-CTnYtVD8.js} +1 -1
  56. package/dist/navigation.js +3 -3
  57. package/dist/packages/ai/src/index.d.ts +2 -0
  58. package/dist/packages/ai/src/message-reactions.d.ts +51 -0
  59. package/dist/packages/ai/src/message.d.ts +3 -1
  60. package/dist/packages/charts/src/plot/index.d.ts +2 -0
  61. package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
  62. package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
  63. package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
  64. package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
  65. package/dist/packages/collections/src/card-columns.d.ts +30 -0
  66. package/dist/packages/collections/src/collection-page.d.ts +43 -0
  67. package/dist/packages/collections/src/column-card.d.ts +15 -0
  68. package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
  69. package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
  70. package/dist/packages/collections/src/data-table.d.ts +2 -2
  71. package/dist/packages/collections/src/index.d.ts +5 -0
  72. package/dist/packages/collections/src/table-query.d.ts +9 -1
  73. package/dist/packages/feedback/src/feedback.d.ts +0 -4
  74. package/dist/packages/feedback/src/index.d.ts +1 -1
  75. package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
  76. package/dist/packages/kits/src/research/index.d.ts +7 -2
  77. package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
  78. package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
  79. package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
  80. package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
  81. package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
  82. package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
  83. package/dist/{param-CwT1RvUS.js → param-Dk92C-K1.js} +2 -2
  84. package/dist/{pierre-diff-DuvK3kLF.js → pierre-diff-DXVIwW7o.js} +1 -1
  85. package/dist/plot-CpTwLIYN.js +101 -0
  86. package/dist/{plot-layout-CvkeUuG6.js → plot-layout-1MG72ZWn.js} +175 -124
  87. package/dist/{plot-surface-yy37R4vs.js → plot-surface-8-FZI94y.js} +1 -1
  88. package/dist/{reference-lines-AMeDkYlo.js → reference-lines-C18o1yEY.js} +1 -1
  89. package/dist/{scene-BRhI8XSy.js → scene-B8dppj5V.js} +7 -7
  90. package/dist/scene.js +1 -1
  91. package/dist/{slope-chart-BMOCaa8R.js → slope-chart-CELflRJd.js} +5 -5
  92. package/dist/{src-9n2M1V_y.js → src-BCAelv4f.js} +3 -3
  93. package/dist/{src-BgmAkau8.js → src-Bkov5TTa.js} +171 -164
  94. package/dist/{src-Bns-5joF.js → src-BsqbWDxS.js} +4 -4
  95. package/dist/{src-BdyO4PgQ.js → src-CIyuaSCi.js} +101 -107
  96. package/dist/{src-Tu6d_Pm8.js → src-Dc1t1ugL.js} +958 -585
  97. package/dist/{src-C5SH3jjU.js → src-DceyVyL0.js} +2 -2
  98. package/dist/{src-C_E29-DX.js → src-Dlh99sPD.js} +1 -1
  99. package/dist/styles2.css +33 -1
  100. package/dist/{time-series-CTNVqoUQ.js → time-series-DtAtGoT_.js} +9 -9
  101. package/dist/{timeline-DrsDtEIW.js → timeline-CzianQir.js} +5 -5
  102. package/dist/{token-heatmap-DddArdH8.js → token-heatmap-m6oaMwkK.js} +274 -289
  103. package/dist/{token-predictions-CBykmPID.js → token-predictions-CpGVjOIs.js} +4 -4
  104. package/dist/{transport-r1QgELf8.js → transport-DQ1yzsQl.js} +5 -5
  105. package/dist/{tree-diagram-BIJFK4pl.js → tree-diagram-D9ekymCQ.js} +5 -5
  106. package/dist/{treemap-DgmEw_mr.js → treemap-DT8q65LQ.js} +5 -5
  107. package/dist/{use-tween-BWf44Jy4.js → use-tween-DbXVZBR8.js} +1 -1
  108. package/dist/{violin-plot-BYJnv6sG.js → violin-plot-83HSjnQM.js} +4 -4
  109. package/dist/visible-motion-D6NwjGNz.js +24 -0
  110. package/dist/{waterfall-BNseqMas.js → waterfall-DmApvdrY.js} +5 -5
  111. package/package.json +1 -1
  112. package/recipes/recorded-motion.tsx +14 -0
  113. package/recipes/searchable-collection.tsx +74 -76
  114. package/skills/extend-elements/SKILL.md +2 -1
  115. package/skills/review-elements/SKILL.md +15 -7
  116. package/skills/review-explainer/SKILL.md +4 -0
  117. package/skills/upgrade-elements/SKILL.md +3 -1
  118. package/skills/upgrade-elements/references/releases.md +20 -0
  119. package/skills/use-elements/SKILL.md +10 -6
  120. package/skills/use-elements/references/collections.md +59 -12
  121. package/skills/use-elements/references/conversations.md +32 -0
  122. package/skills/use-elements/references/editorial-restraint.md +17 -29
  123. package/skills/use-elements/references/figures.md +6 -2
  124. package/skills/use-elements/references/kits.md +23 -0
  125. package/skills/use-elements/references/workspace.md +5 -5
  126. package/skills/write-explainer/SKILL.md +5 -0
  127. package/dist/figure-format-B8kRZMlo.js +0 -36
  128. package/dist/markdown--nfaDoR1.js +0 -313
  129. package/dist/packages/kits/src/research/collection-page.d.ts +0 -71
package/dist/ai.js CHANGED
@@ -1,38 +1,40 @@
1
- import { A as e, E as t, F as n, O as r, h as i, i as a, k as o, m as s, t as c, v as l } from "./src-BgmAkau8.js";
2
- import { t as u } from "./code-block-BDRmjlES.js";
3
- import { f as d } from "./src-Bns-5joF.js";
4
- import { t as f } from "./content-link-DRaNf1mD.js";
5
- import { n as p, r as m } from "./markdown--nfaDoR1.js";
6
- import { r as h, t as g } from "./src-na2DdkKI.js";
7
- import { c as _, d as v } from "./src-BdyO4PgQ.js";
8
- import { i as y, t as b } from "./forms-Bjx7JQ30.js";
9
- import { t as ee } from "./accessibility-P89UG9-r.js";
10
- import * as x from "@stylexjs/stylex";
11
- import { createParts as S } from "@ui-sdk/react/primitive";
12
- import { createContext as C, useCallback as w, useContext as T, useEffect as E, useId as te, useLayoutEffect as D, useRef as O, useState as k } from "react";
13
- import { createInputHistory as ne, definePrimitive as A, dispatch as re, isComposing as ie } from "@ui-sdk/core";
14
- import { jsx as j, jsxs as M } from "react/jsx-runtime";
15
- import { ArrowDown as N, ArrowUp as ae, File as P, GitBranch as F, Square as oe, Terminal as I } from "lucide-react";
16
- import { matchesShortcut as L } from "@ui-sdk/core/shortcuts";
17
- import { useShortcutHint as se } from "@ui-sdk/react/shortcuts";
18
- import { ScrollArea as R, ScrollAreaContent as z, ScrollAreaScrollToEnd as B, ScrollAreaViewport as V, createScrollAreaController as H } from "@ui-sdk/react/scroll-area";
1
+ import { A as e, E as t, F as n, O as r, h as i, i as a, k as o, m as s, t as c, v as l } from "./src-Bkov5TTa.js";
2
+ import { t as u } from "./code-block-DbW_t9U4.js";
3
+ import { f as d } from "./src-BsqbWDxS.js";
4
+ import { t as f } from "./content-link-BN4NPp0u.js";
5
+ import { n as p } from "./markdown-JeuBeMDZ.js";
6
+ import { i as m, r as h, t as g } from "./src-na2DdkKI.js";
7
+ import { c as _, d as v } from "./src-CIyuaSCi.js";
8
+ import { i as y, t as b } from "./forms-iAOjGRTO.js";
9
+ import { t as x } from "./accessibility-P89UG9-r.js";
10
+ import { t as S } from "./visible-motion-D6NwjGNz.js";
11
+ import * as C from "@stylexjs/stylex";
12
+ import { createParts as w } from "@ui-sdk/react/primitive";
13
+ import { createContext as T, useCallback as E, useContext as D, useEffect as O, useId as ee, useLayoutEffect as k, useRef as A, useState as j } from "react";
14
+ import { createInputHistory as te, definePrimitive as M, dispatch as ne, isComposing as re } from "@ui-sdk/core";
15
+ import { jsx as N, jsxs as P } from "react/jsx-runtime";
16
+ import { ArrowDown as F, ArrowUp as ie, File as I, GitBranch as L, SmilePlus as R, Square as ae, Terminal as z } from "lucide-react";
17
+ import { Toggle as B } from "@ui-sdk/react/toggle";
18
+ import { matchesShortcut as V } from "@ui-sdk/core/shortcuts";
19
+ import { useShortcutHint as oe } from "@ui-sdk/react/shortcuts";
20
+ import { ScrollArea as H, ScrollAreaContent as U, ScrollAreaScrollToEnd as W, ScrollAreaViewport as se, createScrollAreaController as ce } from "@ui-sdk/react/scroll-area";
19
21
  // packages/ai/src/approval.tsx
20
- function U(e) {
21
- return /* @__PURE__ */ M("section", {
22
+ function le(e) {
23
+ return /* @__PURE__ */ P("section", {
22
24
  "aria-label": e.title,
23
25
  "data-request-id": e.requestId,
24
26
  className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
25
27
  children: [
26
- /* @__PURE__ */ j("h3", {
28
+ /* @__PURE__ */ N("h3", {
27
29
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
28
30
  children: e.title
29
31
  }),
30
- e.description !== void 0 && /* @__PURE__ */ j("p", {
32
+ e.description !== void 0 && /* @__PURE__ */ N("p", {
31
33
  className: "x1ghz6dp x153jb6y xj0a0fe",
32
34
  children: e.description
33
35
  }),
34
36
  e.children,
35
- e.status === "pending" ? /* @__PURE__ */ M(s, { children: [/* @__PURE__ */ j(t, {
37
+ e.status === "pending" ? /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(t, {
36
38
  variant: "solid",
37
39
  "data-agent-confirm": `Approve ${e.title}?`,
38
40
  onClick: e.onApprove,
@@ -40,23 +42,23 @@ function U(e) {
40
42
  isPending: e.busy === "approve",
41
43
  pendingLabel: "Approving…",
42
44
  children: e.approveLabel ?? "Approve"
43
- }), /* @__PURE__ */ j(t, {
45
+ }), /* @__PURE__ */ N(t, {
44
46
  "data-agent-confirm": `Deny ${e.title}?`,
45
47
  onClick: e.onDeny,
46
48
  disabled: e.isDisabled === !0 || e.busy !== void 0,
47
49
  isPending: e.busy === "deny",
48
50
  pendingLabel: "Denying…",
49
51
  children: e.denyLabel ?? "Deny"
50
- })] }) : /* @__PURE__ */ j(c, { children: e.statusLabel })
52
+ })] }) : /* @__PURE__ */ N(c, { children: e.statusLabel })
51
53
  ]
52
54
  });
53
55
  }
54
56
  // packages/ai/src/command-details.tsx
55
- function W({ command: e, output: t, commandNotice: n, outputNotice: r, outputLanguage: o, isRunning: s = !1 }) {
56
- return /* @__PURE__ */ M(i, {
57
+ function G({ command: e, output: t, commandNotice: n, outputNotice: r, outputLanguage: o, isRunning: s = !1 }) {
58
+ return /* @__PURE__ */ P(i, {
57
59
  isCompact: !0,
58
60
  children: [
59
- e === "" && n !== void 0 ? /* @__PURE__ */ j(a, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ j(a, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ j(u, {
61
+ e === "" && n !== void 0 ? /* @__PURE__ */ N(a, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ N(a, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ N(u, {
60
62
  code: e,
61
63
  language: "bash",
62
64
  filename: "Command",
@@ -65,13 +67,13 @@ function W({ command: e, output: t, commandNotice: n, outputNotice: r, outputLan
65
67
  shouldWrap: !0,
66
68
  maxHeight: 240
67
69
  }),
68
- n !== void 0 && /* @__PURE__ */ j(a, { children: n }),
69
- t === void 0 || t.length === 0 ? /* @__PURE__ */ j(a, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : r === void 0 ? "No output." : "Output omitted from this preview." }) : o === void 0 ? /* @__PURE__ */ j(d, {
70
+ n !== void 0 && /* @__PURE__ */ N(a, { children: n }),
71
+ t === void 0 || t.length === 0 ? /* @__PURE__ */ N(a, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : r === void 0 ? "No output." : "Output omitted from this preview." }) : o === void 0 ? /* @__PURE__ */ N(d, {
70
72
  output: t,
71
73
  label: "Output",
72
74
  variant: "embedded",
73
75
  isRunning: s
74
- }) : /* @__PURE__ */ j(u, {
76
+ }) : /* @__PURE__ */ N(u, {
75
77
  code: t,
76
78
  language: o,
77
79
  filename: "Output",
@@ -81,90 +83,90 @@ function W({ command: e, output: t, commandNotice: n, outputNotice: r, outputLan
81
83
  isStreaming: s,
82
84
  maxHeight: 320
83
85
  }),
84
- r !== void 0 && /* @__PURE__ */ j(a, { children: r })
86
+ r !== void 0 && /* @__PURE__ */ N(a, { children: r })
85
87
  ]
86
88
  });
87
89
  }
88
90
  // packages/ai/src/command-activity.tsx
89
- var G = {
91
+ var K = {
90
92
  pending: "Preparing",
91
93
  running: "Running",
92
94
  complete: "",
93
95
  failed: "Failed",
94
96
  stopped: "Stopped",
95
97
  unknown: "Outcome unknown"
96
- }, ce = /* @__PURE__ */ new Set(["pending", "running"]);
97
- function le({ status: e, duration: t, meta: n, ...r }) {
98
- let i = r.command?.trim().split(/\r\n|\n|\r/u)[0], a = i === void 0 || i.length === 0 ? "Command" : i, o = n !== void 0 && n.length > 0, s = t !== void 0 && t.length > 0, c = o || s, u = c ? /* @__PURE__ */ M("span", {
98
+ }, ue = /* @__PURE__ */ new Set(["pending", "running"]);
99
+ function de({ status: e, duration: t, meta: n, ...r }) {
100
+ let i = r.command?.trim().split(/\r\n|\n|\r/u)[0], a = i === void 0 || i.length === 0 ? "Command" : i, o = n !== void 0 && n.length > 0, s = t !== void 0 && t.length > 0, c = o || s, u = c ? /* @__PURE__ */ P("span", {
99
101
  className: "x3nfvp2 x6s0dn4 x1hnptsi xvc5jky x2lah0s xy8obcc xss6m8b x153jb6y xuxw1ft",
100
- children: [o && /* @__PURE__ */ j("span", {
102
+ children: [o && /* @__PURE__ */ N("span", {
101
103
  className: "x153jb6y",
102
104
  children: n
103
- }), s && /* @__PURE__ */ j("span", {
105
+ }), s && /* @__PURE__ */ N("span", {
104
106
  className: "x153jb6y",
105
107
  children: t
106
108
  })]
107
- }) : null, d = /* @__PURE__ */ M("span", {
109
+ }) : null, d = /* @__PURE__ */ P("span", {
108
110
  ...{
109
111
  0: { className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi" },
110
112
  1: { className: "x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi x78zum5 x12lumcd" }
111
113
  }[!!c | 0],
112
114
  children: [
113
- /* @__PURE__ */ j(I, {
115
+ /* @__PURE__ */ N(z, {
114
116
  size: 14,
115
117
  "aria-hidden": !0,
116
118
  className: "x2lah0s"
117
119
  }),
118
- /* @__PURE__ */ j("span", {
120
+ /* @__PURE__ */ N("span", {
119
121
  className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
120
122
  children: a
121
123
  }),
122
- G[e].length > 0 && /* @__PURE__ */ j("span", {
124
+ K[e].length > 0 && /* @__PURE__ */ N("span", {
123
125
  className: "x2lah0s xy8obcc x153jb6y",
124
- children: G[e]
126
+ children: K[e]
125
127
  }),
126
128
  u
127
129
  ]
128
130
  });
129
- return /* @__PURE__ */ M(l.Root, {
131
+ return /* @__PURE__ */ P(l.Root, {
130
132
  defaultOpen: !1,
131
- children: [c ? /* @__PURE__ */ j(l.Trigger, {
133
+ children: [c ? /* @__PURE__ */ N(l.Trigger, {
132
134
  className: "xt970qd xunmzkg x153jb6y xj57cvi",
133
135
  children: d
134
- }) : /* @__PURE__ */ j(l.Trigger, {
136
+ }) : /* @__PURE__ */ N(l.Trigger, {
135
137
  variant: "inline",
136
138
  children: d
137
- }), /* @__PURE__ */ j(l.Panel, { children: /* @__PURE__ */ j(W, {
139
+ }), /* @__PURE__ */ N(l.Panel, { children: /* @__PURE__ */ N(G, {
138
140
  ...r,
139
- isRunning: ce.has(e)
141
+ isRunning: ue.has(e)
140
142
  }) })]
141
143
  });
142
144
  }
143
145
  // packages/ai/src/conversation.tsx
144
- var K = C(void 0);
145
- function q() {
146
- let e = T(K);
146
+ var q = T(void 0);
147
+ function J() {
148
+ let e = D(q);
147
149
  if (e === void 0) throw Error("Render the parts of a conversation inside Conversation.Root.");
148
150
  return e;
149
151
  }
150
- function J(e) {
152
+ function Y(e) {
151
153
  return e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
152
154
  }
153
- function ue({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
154
- let i = O(null), a = r ?? i, [o] = k(t), [s] = k(H), [c, l] = k(o === "end"), [u] = k(() => ({
155
+ function fe({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
156
+ let i = A(null), a = r ?? i, [o] = j(t), [s] = j(ce), [c, l] = j(o === "end"), [u] = j(() => ({
155
157
  controller: s,
156
158
  viewport: a,
157
159
  reachEnd: () => l(!0)
158
160
  }));
159
- return D(() => {
161
+ return k(() => {
160
162
  typeof o == "object" && a.current?.scrollTo({
161
163
  top: o.top,
162
164
  left: o.left ?? 0,
163
165
  behavior: "instant"
164
166
  });
165
- }, [o, a]), /* @__PURE__ */ j(K.Provider, {
167
+ }, [o, a]), /* @__PURE__ */ N(q.Provider, {
166
168
  value: u,
167
- children: /* @__PURE__ */ j(R, {
169
+ children: /* @__PURE__ */ N(H, {
168
170
  stickToEnd: n && c,
169
171
  controller: s,
170
172
  className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
@@ -172,25 +174,25 @@ function ue({ children: e, initialPosition: t = "end", shouldFollow: n = !0, vie
172
174
  })
173
175
  });
174
176
  }
175
- function de({ label: e, children: t, scrollRestorationId: n }) {
176
- let { viewport: r, reachEnd: i } = q(), a = w((e) => {
177
- r.current = e, e !== null && J(e) && i();
177
+ function pe({ label: e, children: t, scrollRestorationId: n }) {
178
+ let { viewport: r, reachEnd: i } = J(), a = E((e) => {
179
+ r.current = e, e !== null && Y(e) && i();
178
180
  }, [r, i]);
179
- return /* @__PURE__ */ j(V, {
181
+ return /* @__PURE__ */ N(se, {
180
182
  ref: a,
181
183
  role: "region",
182
184
  "aria-label": e,
183
185
  tabIndex: 0,
184
186
  "data-scroll-restoration-id": n,
185
187
  onScroll: (e) => {
186
- J(e.currentTarget) && i();
188
+ Y(e.currentTarget) && i();
187
189
  },
188
190
  className: "x98rzlu x2lwn1j xeuugli x1odjw0f x1046ku7 x185mbhu xbluxkr x1ok0vyi x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal",
189
191
  children: t
190
192
  });
191
193
  }
192
- function fe({ children: e, isStreaming: t = !1 }) {
193
- return /* @__PURE__ */ j(z, {
194
+ function me({ children: e, isStreaming: t = !1 }) {
195
+ return /* @__PURE__ */ N(U, {
194
196
  "aria-live": "polite",
195
197
  "aria-relevant": "additions",
196
198
  "aria-busy": t,
@@ -198,61 +200,61 @@ function fe({ children: e, isStreaming: t = !1 }) {
198
200
  children: e
199
201
  });
200
202
  }
201
- function Y({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
202
- let { controller: r } = q();
203
- return D(() => {
203
+ function he({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
204
+ let { controller: r } = J();
205
+ return k(() => {
204
206
  t && r.scrollToEnd({ behavior: "instant" });
205
207
  }, [
206
208
  e,
207
209
  t,
208
210
  r
209
- ]), /* @__PURE__ */ j("div", {
211
+ ]), /* @__PURE__ */ N("div", {
210
212
  "data-message-id": e,
211
213
  className: "xeuugli xj0a0fe",
212
214
  children: n
213
215
  });
214
216
  }
215
- function pe({ children: e }) {
216
- return /* @__PURE__ */ j("div", {
217
+ function ge({ children: e }) {
218
+ return /* @__PURE__ */ N("div", {
217
219
  className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
218
220
  children: e
219
221
  });
220
222
  }
221
- function me({ label: e = "Jump to latest" }) {
222
- return /* @__PURE__ */ j(B, { render: (n, { visible: r }) => /* @__PURE__ */ j("div", {
223
+ function _e({ label: e = "Jump to latest" }) {
224
+ return /* @__PURE__ */ N(W, { render: (n, { visible: r }) => /* @__PURE__ */ N("div", {
223
225
  hidden: !r,
224
226
  className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
225
- children: /* @__PURE__ */ M(t, {
227
+ children: /* @__PURE__ */ P(t, {
226
228
  ...n,
227
- children: [/* @__PURE__ */ j(N, {
229
+ children: [/* @__PURE__ */ N(F, {
228
230
  size: 14,
229
231
  "aria-hidden": !0
230
232
  }), e]
231
233
  })
232
234
  }) });
233
235
  }
234
- function he({ label: e, onActivate: n }) {
235
- let { controller: r, viewport: i } = q();
236
- return /* @__PURE__ */ M(t, {
236
+ function ve({ label: e, onActivate: n }) {
237
+ let { controller: r, viewport: i } = J();
238
+ return /* @__PURE__ */ P(t, {
237
239
  onClick: () => {
238
240
  n?.(), requestAnimationFrame(() => {
239
241
  r.scrollToEnd({ behavior: "instant" }), i.current?.focus({ preventScroll: !0 });
240
242
  });
241
243
  },
242
- children: [/* @__PURE__ */ j(N, {
244
+ children: [/* @__PURE__ */ N(F, {
243
245
  size: 14,
244
246
  "aria-hidden": !0
245
247
  }), e]
246
248
  });
247
249
  }
248
- var ge = {
249
- Root: ue,
250
- Viewport: de,
251
- Content: fe,
252
- Item: Y,
253
- Controls: pe,
254
- LatestButton: he,
255
- JumpToLatest: me
250
+ var ye = {
251
+ Root: fe,
252
+ Viewport: pe,
253
+ Content: me,
254
+ Item: he,
255
+ Controls: ge,
256
+ LatestButton: ve,
257
+ JumpToLatest: _e
256
258
  }, X = {
257
259
  root: {
258
260
  k1xSpc: "x78zum5",
@@ -328,17 +330,17 @@ var ge = {
328
330
  k8WAf4: "xn9t2bk",
329
331
  $$css: !0
330
332
  }
331
- }, _e = {
333
+ }, be = {
332
334
  user: X.user,
333
335
  assistant: X.assistant,
334
336
  system: X.system
335
- }, ve = {
337
+ }, xe = {
336
338
  neutral: X.speakerNeutral,
337
339
  accent: X.speakerAccent,
338
340
  positive: X.speakerPositive,
339
341
  warning: X.speakerWarning,
340
342
  negative: X.speakerNegative
341
- }, ye = {
343
+ }, Se = {
342
344
  user: X.bubble,
343
345
  assistant: X.chatReply,
344
346
  system: null
@@ -346,7 +348,7 @@ var ge = {
346
348
  function Z({ kind: e }) {
347
349
  return { kind: e };
348
350
  }
349
- var be = A({
351
+ var Ce = M({
350
352
  name: "message",
351
353
  options: { kind: "string" },
352
354
  state: Z,
@@ -358,125 +360,206 @@ var be = A({
358
360
  root: e({}),
359
361
  description: e({})
360
362
  })
361
- }), { Root: xe, Description: Se } = S(be, {
363
+ }), { Root: we, Description: Te } = w(Ce, {
362
364
  root: "article",
363
365
  description: "div"
364
- }), Ce = {
366
+ }), Ee = {
365
367
  "x-default-marker": "x-default-marker",
366
368
  $$css: !0
367
369
  };
368
- function we({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default", speaker: l, speakerTone: u = "neutral", quote: d }) {
369
- let f = c === "chat", m = l !== void 0 && l.length > 0, h = d !== void 0 && d.length > 0, g = !f || a !== void 0 || i !== void 0 || m, _ = e.length > 0 && (!m || e !== l), v = e.length > 0 ? e : l ?? "", y = f && r === "assistant", b = g ? /* @__PURE__ */ M("header", {
370
+ function De({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, reactions: c, variant: l = "default", speaker: u, speakerTone: d = "neutral", quote: f }) {
371
+ let m = l === "chat", h = u !== void 0 && u.length > 0, g = f !== void 0 && f.length > 0, _ = !m || a !== void 0 || i !== void 0 || h, v = e.length > 0 && (!h || e !== u), y = e.length > 0 ? e : u ?? "", b = m && r === "assistant", x = _ ? /* @__PURE__ */ P("header", {
370
372
  className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
371
373
  children: [
372
- a !== void 0 && /* @__PURE__ */ j("span", {
374
+ a !== void 0 && /* @__PURE__ */ N("span", {
373
375
  className: "x3nfvp2 x2lah0s",
374
376
  children: a
375
377
  }),
376
- _ && /* @__PURE__ */ j("span", {
378
+ v && /* @__PURE__ */ N("span", {
377
379
  className: "xk4h15q xeuugli xj0a0fe",
378
380
  children: e
379
381
  }),
380
- m && /* @__PURE__ */ j("span", {
381
- ...x.props(X.speaker, ve[u]),
382
- children: l
382
+ h && /* @__PURE__ */ N("span", {
383
+ ...C.props(X.speaker, xe[d]),
384
+ children: u
383
385
  }),
384
- i !== void 0 && /* @__PURE__ */ j("div", {
386
+ i !== void 0 && /* @__PURE__ */ N("div", {
385
387
  className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
386
388
  children: i
387
389
  })
388
390
  ]
389
391
  }) : null;
390
- return /* @__PURE__ */ M(xe, {
392
+ return /* @__PURE__ */ P(we, {
391
393
  kind: r,
392
394
  ...n !== void 0 && { id: n },
393
- "aria-label": v,
394
- ...x.props(X.root, _e[r], f && ye[r], Ce),
395
+ "aria-label": y,
396
+ ...C.props(X.root, be[r], m && Se[r], Ee),
395
397
  children: [
396
- b,
397
- h && /* @__PURE__ */ j("p", {
398
- title: d,
398
+ x,
399
+ g && /* @__PURE__ */ N("p", {
400
+ title: f,
399
401
  className: "x1ghz6dp xyibt8p xyumdvf x1t7ytsu x97x49r x153jb6y xy8obcc xas2l8k xb3r6kr xlyipyv xuxw1ft xeuugli x193iq5w",
400
- children: d
402
+ children: f
401
403
  }),
402
- /* @__PURE__ */ j(Se, {
404
+ /* @__PURE__ */ N(Te, {
403
405
  className: "xeuugli xj0a0fe x1ytb0s6",
404
- children: f && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ j(p, { children: t }) : t
406
+ children: m && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ N(p, { children: t }) : t
405
407
  }),
406
- s !== void 0 && /* @__PURE__ */ j("div", {
408
+ s !== void 0 && /* @__PURE__ */ N("div", {
407
409
  className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
408
410
  children: s
409
411
  }),
410
- (o !== void 0 || y) && /* @__PURE__ */ j("footer", {
412
+ c,
413
+ (o !== void 0 || b) && /* @__PURE__ */ N("footer", {
411
414
  ...{
412
415
  0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
413
416
  1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
414
- }[!!y | 0],
417
+ }[!!b | 0],
415
418
  children: o
416
419
  })
417
420
  ]
418
421
  });
419
422
  }
420
- function Te({ name: e, description: t, href: n, actions: r }) {
421
- return /* @__PURE__ */ M("div", {
423
+ function Oe({ name: e, description: t, href: n, actions: r }) {
424
+ return /* @__PURE__ */ P("div", {
422
425
  className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
423
426
  children: [
424
- /* @__PURE__ */ j(P, {
427
+ /* @__PURE__ */ N(I, {
425
428
  size: 16,
426
429
  "aria-hidden": !0,
427
430
  className: "x153jb6y x2lah0s"
428
431
  }),
429
- /* @__PURE__ */ M("div", {
432
+ /* @__PURE__ */ P("div", {
430
433
  className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
431
- children: [n === void 0 ? /* @__PURE__ */ j("span", { children: e }) : /* @__PURE__ */ j(f, {
434
+ children: [n === void 0 ? /* @__PURE__ */ N("span", { children: e }) : /* @__PURE__ */ N(f, {
432
435
  href: n,
433
436
  children: e
434
- }), t !== void 0 && /* @__PURE__ */ j("span", {
437
+ }), t !== void 0 && /* @__PURE__ */ N("span", {
435
438
  className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
436
439
  children: t
437
440
  })]
438
441
  }),
439
- r !== void 0 && /* @__PURE__ */ j("div", {
442
+ r !== void 0 && /* @__PURE__ */ N("div", {
440
443
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
441
444
  children: r
442
445
  })
443
446
  ]
444
447
  });
445
448
  }
449
+ // packages/ai/src/message-reactions.tsx
450
+ var ke = {
451
+ reactions: "Reactions",
452
+ addReaction: "Add reaction",
453
+ reactionName: ({ name: e, count: t }) => `${e}, ${t}`
454
+ };
455
+ function Ae({ reaction: e, count: t, isDisabled: n, labels: r, onReactionToggle: i }) {
456
+ return /* @__PURE__ */ P(B, {
457
+ pressed: e.isReacted,
458
+ disabled: n,
459
+ "aria-label": r.reactionName({
460
+ name: e.name,
461
+ count: t
462
+ }),
463
+ onPressedChange: (t) => i({
464
+ emoji: e.emoji,
465
+ isReacted: t
466
+ }),
467
+ className: "x3nfvp2 x6s0dn4 xva7r70 x9f619 x159bbqr x17oiadl xt970qd x5g2kb4 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x153jb6y x1hz01jw xvmahel xy8obcc xas2l8k xj57cvi xss6m8b xuxw1ft x1ypdohk x17lu4q8 x1480za7 x726p7d x1h1mp10 x1lf1diw xqmg3gf xwj21n9 x1m8qfh3 x13qnu6 x9v5kkp x19rmrnh x13iak60",
468
+ children: [/* @__PURE__ */ N("span", {
469
+ "aria-hidden": !0,
470
+ className: "xtqrqnz xo5v014",
471
+ children: e.emoji
472
+ }), /* @__PURE__ */ N("span", {
473
+ "aria-hidden": !0,
474
+ children: t
475
+ })]
476
+ });
477
+ }
478
+ function je({ reactions: e, choices: t, isDisabled: n = !1, labels: i, onReactionToggle: a }) {
479
+ return /* @__PURE__ */ P(m.Root, { children: [/* @__PURE__ */ N(m.Trigger, { render: /* @__PURE__ */ N(r, {
480
+ variant: "ghost",
481
+ density: "compact",
482
+ disabled: n,
483
+ "aria-label": i.addReaction,
484
+ children: /* @__PURE__ */ N(R, { size: 14 })
485
+ }) }), /* @__PURE__ */ N(m.Popup, {
486
+ align: "start",
487
+ children: t.map((t) => /* @__PURE__ */ N(m.CheckboxItem, {
488
+ value: t.emoji,
489
+ closeOnSelect: !0,
490
+ checked: e.some((e) => e.emoji === t.emoji && e.isReacted),
491
+ onCheckedChange: (e) => a({
492
+ emoji: t.emoji,
493
+ isReacted: e
494
+ }),
495
+ children: /* @__PURE__ */ P("span", {
496
+ className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
497
+ children: [/* @__PURE__ */ N("span", {
498
+ "aria-hidden": !0,
499
+ children: t.emoji
500
+ }), /* @__PURE__ */ N("span", { children: t.name })]
501
+ })
502
+ }, t.emoji))
503
+ })] });
504
+ }
505
+ function Me({ reactions: e, choices: t, locale: n, onReactionToggle: r, isDisabled: i = !1, labels: a }) {
506
+ let o = {
507
+ ...ke,
508
+ ...a
509
+ }, s = new Intl.NumberFormat(n), c = t.length > 0;
510
+ return /* @__PURE__ */ P("div", {
511
+ role: "group",
512
+ "aria-label": o.reactions,
513
+ className: "x78zum5 x1a02dak x6s0dn4 xunmzkg xeuugli",
514
+ children: [e.map((e) => /* @__PURE__ */ N(Ae, {
515
+ reaction: e,
516
+ count: s.format(e.count),
517
+ isDisabled: i,
518
+ labels: o,
519
+ onReactionToggle: r
520
+ }, e.emoji)), c && /* @__PURE__ */ N(je, {
521
+ reactions: e,
522
+ choices: t,
523
+ isDisabled: i,
524
+ labels: o,
525
+ onReactionToggle: r
526
+ })]
527
+ });
528
+ }
446
529
  // packages/ai/src/message-action.tsx
447
- function Ee(e) {
530
+ function Ne(e) {
448
531
  if (e.kind === "link") {
449
532
  let { kind: t, label: n, ...r } = e;
450
- return /* @__PURE__ */ j(o, {
533
+ return /* @__PURE__ */ N(o, {
451
534
  ...r,
452
535
  "aria-label": n
453
536
  });
454
537
  }
455
538
  let { kind: t, label: n, ...i } = e;
456
- return /* @__PURE__ */ j(r, {
539
+ return /* @__PURE__ */ N(r, {
457
540
  ...i,
458
541
  variant: "ghost",
459
542
  "aria-label": n
460
543
  });
461
544
  }
462
- function De(e) {
463
- return /* @__PURE__ */ M(g.Root, { children: [/* @__PURE__ */ j(g.Trigger, { render: Ee(e) }), /* @__PURE__ */ j(g.Popup, { children: e.label })] });
545
+ function Pe(e) {
546
+ return /* @__PURE__ */ P(g.Root, { children: [/* @__PURE__ */ N(g.Trigger, { render: Ne(e) }), /* @__PURE__ */ N(g.Popup, { children: e.label })] });
464
547
  }
465
548
  // packages/ai/src/message-boundary.tsx
466
- function Oe({ label: e, children: t }) {
467
- return /* @__PURE__ */ M(l.Root, {
549
+ function Fe({ label: e, children: t }) {
550
+ return /* @__PURE__ */ P(l.Root, {
468
551
  className: "xeuugli x1kbiq1m xykt701 xpu655y",
469
- children: [/* @__PURE__ */ M(l.Trigger, {
552
+ children: [/* @__PURE__ */ P(l.Trigger, {
470
553
  className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
471
- children: [/* @__PURE__ */ j(F, {
554
+ children: [/* @__PURE__ */ N(L, {
472
555
  size: 14,
473
556
  "aria-hidden": !0,
474
557
  className: "x2lah0s"
475
- }), /* @__PURE__ */ j("span", {
558
+ }), /* @__PURE__ */ N("span", {
476
559
  className: "xeuugli xj0a0fe",
477
560
  children: e
478
561
  })]
479
- }), /* @__PURE__ */ j(l.Panel, {
562
+ }), /* @__PURE__ */ N(l.Panel, {
480
563
  className: "x153jb6y xy8obcc xas2l8k",
481
564
  children: t
482
565
  })]
@@ -494,25 +577,25 @@ var Q = {
494
577
  $$css: !0
495
578
  }
496
579
  }, $ = "mod+enter";
497
- function ke({ isCompact: e = !1 }) {
498
- return /* @__PURE__ */ j("div", {
580
+ function Ie({ isCompact: e = !1 }) {
581
+ return /* @__PURE__ */ N("div", {
499
582
  "aria-hidden": !0,
500
583
  inert: !0,
501
584
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
502
- children: /* @__PURE__ */ M("div", {
585
+ children: /* @__PURE__ */ P("div", {
503
586
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
504
- children: [/* @__PURE__ */ j("div", {
505
- ...x.props(n.base, n.field, n.textarea, n.plainTextarea),
506
- children: /* @__PURE__ */ j(v, {
587
+ children: [/* @__PURE__ */ N("div", {
588
+ ...C.props(n.base, n.field, n.textarea, n.plainTextarea),
589
+ children: /* @__PURE__ */ N(v, {
507
590
  lines: e ? 1 : 2,
508
591
  width: "22ch"
509
592
  })
510
- }), /* @__PURE__ */ M("div", {
593
+ }), /* @__PURE__ */ P("div", {
511
594
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
512
- children: [/* @__PURE__ */ j("div", {
595
+ children: [/* @__PURE__ */ N("div", {
513
596
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
514
- children: /* @__PURE__ */ j(v, { width: "8ch" })
515
- }), /* @__PURE__ */ j(_, {
597
+ children: /* @__PURE__ */ N(v, { width: "8ch" })
598
+ }), /* @__PURE__ */ N(_, {
516
599
  isIconOnly: !0,
517
600
  xstyle: Q.action
518
601
  })]
@@ -520,81 +603,81 @@ function ke({ isCompact: e = !1 }) {
520
603
  })
521
604
  });
522
605
  }
523
- function Ae({ label: e, value: t, onValueChange: n, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: d = !1, submitLabel: f = "Send message", pendingLabel: p = "Sending…", enterBehavior: m = "newline", history: h, isCompact: _ = !1, description: v, error: S, controls: C, attachments: w, onStop: T, isStopPending: E = !1, stopLabel: A = "Stop response" }) {
524
- let N = te(), P = u, F = _ && w === void 0 && C === void 0, I = !P && !l && !d, R = se($), z = O({
606
+ function Le({ label: e, value: t, onValueChange: n, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: d = !1, submitLabel: f = "Send message", pendingLabel: p = "Sending…", enterBehavior: m = "newline", history: h, isCompact: _ = !1, description: v, error: S, controls: w, attachments: T, onStop: E, isStopPending: D = !1, stopLabel: O = "Stop response" }) {
607
+ let M = ee(), F = u, I = _ && T === void 0 && w === void 0, L = !F && !l && !d, R = oe($), z = A({
525
608
  history: h,
526
609
  value: t,
527
610
  onValueChange: n
528
611
  });
529
- D(() => {
612
+ k(() => {
530
613
  z.current = {
531
614
  history: h,
532
615
  value: t,
533
616
  onValueChange: n
534
617
  };
535
618
  });
536
- let [B] = k(() => ne({
619
+ let [B] = j(() => te({
537
620
  entries: () => z.current.history,
538
621
  read: () => z.current.value,
539
- write: (e, t) => !re({ options: () => z.current }, "onValueChange", e, {
622
+ write: (e, t) => !ne({ options: () => z.current }, "onValueChange", e, {
540
623
  reason: "input-change",
541
624
  event: t
542
625
  })
543
- })), V = `${f} · ${R.text}`;
544
- T === void 0 ? l ? V = p : m === "submit" && (V = `${f} · Enter`) : V = E ? "Stopping…" : A;
545
- function H(e) {
546
- if (B.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || ie(e)) return;
547
- let t = L(e.nativeEvent, $), n = !t && L(e.nativeEvent, "enter");
548
- (t || m === "submit" && n) && (e.preventDefault(), I && T === void 0 && e.currentTarget.form?.requestSubmit());
549
- }
626
+ })), H = `${f} · ${R.text}`;
627
+ E === void 0 ? l ? H = p : m === "submit" && (H = `${f} · Enter`) : H = D ? "Stopping…" : O;
550
628
  function U(e) {
551
- e.preventDefault(), I && T === void 0 && i(e);
629
+ if (B.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || re(e)) return;
630
+ let t = V(e.nativeEvent, $), n = !t && V(e.nativeEvent, "enter");
631
+ (t || m === "submit" && n) && (e.preventDefault(), L && E === void 0 && e.currentTarget.form?.requestSubmit());
632
+ }
633
+ function W(e) {
634
+ e.preventDefault(), L && E === void 0 && i(e);
552
635
  }
553
- return /* @__PURE__ */ j("form", {
554
- onSubmit: U,
636
+ return /* @__PURE__ */ N("form", {
637
+ onSubmit: W,
555
638
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
556
- children: /* @__PURE__ */ M(b.Root, {
639
+ children: /* @__PURE__ */ P(b.Root, {
557
640
  invalid: S !== void 0,
558
641
  children: [
559
- /* @__PURE__ */ j(b.Label, {
560
- ...x.props(ee.hidden),
642
+ /* @__PURE__ */ N(b.Label, {
643
+ ...C.props(x.hidden),
561
644
  children: e
562
645
  }),
563
- /* @__PURE__ */ M("div", {
646
+ /* @__PURE__ */ P("div", {
564
647
  ...{
565
648
  0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
566
649
  2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
567
650
  1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
568
651
  3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
569
- }[!!F << 1 | S !== void 0],
652
+ }[!!I << 1 | S !== void 0],
570
653
  children: [
571
- /* @__PURE__ */ j(y, {
654
+ /* @__PURE__ */ N(y, {
572
655
  isSensitive: !0,
573
656
  appearance: "plain",
574
657
  rows: _ ? 1 : 2,
575
658
  isCompact: _,
576
- shouldGrow: F,
577
- xstyle: F ? Q.inlineInput : void 0,
659
+ shouldGrow: I,
660
+ xstyle: I ? Q.inlineInput : void 0,
578
661
  name: a,
579
662
  value: t,
580
663
  onValueChange: n,
581
- onKeyDown: H,
664
+ onKeyDown: U,
582
665
  placeholder: o ?? e,
583
666
  maxLength: s,
584
667
  required: c,
585
668
  disabled: u,
586
- "aria-errormessage": S === void 0 ? void 0 : N
669
+ "aria-errormessage": S === void 0 ? void 0 : M
587
670
  }),
588
- w,
589
- /* @__PURE__ */ M("div", {
671
+ T,
672
+ /* @__PURE__ */ P("div", {
590
673
  ...{
591
674
  0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
592
675
  1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
593
- }[!!F | 0],
594
- children: [C !== void 0 && /* @__PURE__ */ j("div", {
676
+ }[!!I | 0],
677
+ children: [w !== void 0 && /* @__PURE__ */ N("div", {
595
678
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
596
- children: C
597
- }), /* @__PURE__ */ M(g.Root, { children: [/* @__PURE__ */ j(g.Trigger, { render: T === void 0 ? /* @__PURE__ */ j(r, {
679
+ children: w
680
+ }), /* @__PURE__ */ P(g.Root, { children: [/* @__PURE__ */ N(g.Trigger, { render: E === void 0 ? /* @__PURE__ */ N(r, {
598
681
  xstyle: Q.action,
599
682
  type: "submit",
600
683
  "data-agent-confirm": f,
@@ -603,31 +686,31 @@ function Ae({ label: e, value: t, onValueChange: n, onSubmit: i, name: a = "prom
603
686
  "aria-keyshortcuts": m === "submit" ? `Enter ${R.ariaKeyshortcuts}` : R.ariaKeyshortcuts,
604
687
  disabled: u || d,
605
688
  isPending: l,
606
- children: /* @__PURE__ */ j(ae, {
689
+ children: /* @__PURE__ */ N(ie, {
607
690
  size: 16,
608
691
  "aria-hidden": !0
609
692
  })
610
- }) : /* @__PURE__ */ j(r, {
693
+ }) : /* @__PURE__ */ N(r, {
611
694
  xstyle: Q.action,
612
695
  type: "button",
613
- "data-agent-confirm": A,
614
- "aria-label": E ? "Stopping…" : A,
696
+ "data-agent-confirm": O,
697
+ "aria-label": D ? "Stopping…" : O,
615
698
  onClick: (e) => {
616
- e.preventDefault(), T();
699
+ e.preventDefault(), E();
617
700
  },
618
701
  disabled: u,
619
- isPending: E,
620
- children: /* @__PURE__ */ j(oe, {
702
+ isPending: D,
703
+ children: /* @__PURE__ */ N(ae, {
621
704
  size: 14,
622
705
  "aria-hidden": !0
623
706
  })
624
- }) }), /* @__PURE__ */ j(g.Popup, { children: V })] })]
707
+ }) }), /* @__PURE__ */ N(g.Popup, { children: H })] })]
625
708
  })
626
709
  ]
627
710
  }),
628
- v !== void 0 && /* @__PURE__ */ j(b.Description, { children: v }),
629
- S !== void 0 && /* @__PURE__ */ j(b.Error, {
630
- id: N,
711
+ v !== void 0 && /* @__PURE__ */ N(b.Description, { children: v }),
712
+ S !== void 0 && /* @__PURE__ */ N(b.Error, {
713
+ id: M,
631
714
  match: !0,
632
715
  role: "alert",
633
716
  children: S
@@ -637,15 +720,15 @@ function Ae({ label: e, value: t, onValueChange: n, onSubmit: i, name: a = "prom
637
720
  });
638
721
  }
639
722
  // packages/ai/src/reply-indicator.tsx
640
- function je({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
641
- let [r, i] = k(t === 0), { ref: a, isActive: o } = m(n && r);
642
- return E(() => {
723
+ function Re({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
724
+ let [r, i] = j(t === 0), { ref: a, isActive: o } = S(n && r);
725
+ return O(() => {
643
726
  let e = setTimeout(() => i(!0), t);
644
727
  return () => clearTimeout(e);
645
- }, [t]), /* @__PURE__ */ j("div", {
728
+ }, [t]), /* @__PURE__ */ N("div", {
646
729
  ref: a,
647
730
  className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
648
- children: r && /* @__PURE__ */ j("span", {
731
+ children: r && /* @__PURE__ */ N("span", {
649
732
  role: "status",
650
733
  ...{
651
734
  0: {},
@@ -658,27 +741,27 @@ function je({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
658
741
  });
659
742
  }
660
743
  // packages/ai/src/sources.tsx
661
- function Me({ sources: e, label: t = "Sources" }) {
662
- return /* @__PURE__ */ M("section", {
744
+ function ze({ sources: e, label: t = "Sources" }) {
745
+ return /* @__PURE__ */ P("section", {
663
746
  "aria-label": t,
664
747
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
665
748
  children: [
666
- /* @__PURE__ */ j("h3", {
749
+ /* @__PURE__ */ N("h3", {
667
750
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
668
751
  children: t
669
752
  }),
670
- e.length === 0 && /* @__PURE__ */ j("p", {
753
+ e.length === 0 && /* @__PURE__ */ N("p", {
671
754
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
672
755
  children: "No sources supplied."
673
756
  }),
674
- /* @__PURE__ */ j("ol", {
757
+ /* @__PURE__ */ N("ol", {
675
758
  className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
676
- children: e.map((e) => /* @__PURE__ */ M("li", {
759
+ children: e.map((e) => /* @__PURE__ */ P("li", {
677
760
  className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
678
- children: [/* @__PURE__ */ j("span", { children: /* @__PURE__ */ j(f, {
761
+ children: [/* @__PURE__ */ N("span", { children: /* @__PURE__ */ N(f, {
679
762
  href: e.href,
680
763
  children: e.title
681
- }) }), e.description !== void 0 && /* @__PURE__ */ j("p", {
764
+ }) }), e.description !== void 0 && /* @__PURE__ */ N("p", {
682
765
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
683
766
  children: e.description
684
767
  })]
@@ -687,21 +770,21 @@ function Me({ sources: e, label: t = "Sources" }) {
687
770
  ]
688
771
  });
689
772
  }
690
- function Ne({ source: t, label: n }) {
691
- return /* @__PURE__ */ j("span", {
773
+ function Be({ source: t, label: n }) {
774
+ return /* @__PURE__ */ N("span", {
692
775
  className: "xt0psk2 x11njtxf xss6m8b",
693
- children: /* @__PURE__ */ M(h.Root, { children: [/* @__PURE__ */ j(h.Trigger, {
694
- render: /* @__PURE__ */ j(e, {}),
776
+ children: /* @__PURE__ */ P(h.Root, { children: [/* @__PURE__ */ N(h.Trigger, {
777
+ render: /* @__PURE__ */ N(e, {}),
695
778
  "aria-label": `Source ${n}: ${t.title}`,
696
779
  children: n
697
- }), /* @__PURE__ */ j(h.Popup, {
780
+ }), /* @__PURE__ */ N(h.Popup, {
698
781
  side: "top",
699
- children: /* @__PURE__ */ M(i, {
782
+ children: /* @__PURE__ */ P(i, {
700
783
  isCompact: !0,
701
784
  children: [
702
- /* @__PURE__ */ j(h.Title, { children: t.title }),
703
- t.description !== void 0 && /* @__PURE__ */ j(h.Description, { children: t.description }),
704
- /* @__PURE__ */ j(f, {
785
+ /* @__PURE__ */ N(h.Title, { children: t.title }),
786
+ t.description !== void 0 && /* @__PURE__ */ N(h.Description, { children: t.description }),
787
+ /* @__PURE__ */ N(f, {
705
788
  href: t.href,
706
789
  children: "Open source"
707
790
  })
@@ -710,4 +793,4 @@ function Ne({ source: t, label: n }) {
710
793
  })] })
711
794
  });
712
795
  }
713
- export { U as Approval, le as CommandActivity, W as CommandDetails, ge as Conversation, Ne as InlineCitation, we as Message, De as MessageAction, Te as MessageAttachment, Oe as MessageBoundary, Ae as PromptInput, ke as PromptInputPlaceholder, je as ReplyIndicator, Me as Sources };
796
+ export { le as Approval, de as CommandActivity, G as CommandDetails, ye as Conversation, Be as InlineCitation, De as Message, Pe as MessageAction, Oe as MessageAttachment, Fe as MessageBoundary, Me as MessageReactions, Le as PromptInput, Ie as PromptInputPlaceholder, Re as ReplyIndicator, ze as Sources };