@actioneer/ads 0.2.3 → 0.3.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 (70) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +88 -19
  2. package/components/ai-elements/chain-of-thought.js +358 -149
  3. package/components/ai-elements/chart.d.ts +30 -0
  4. package/components/ai-elements/chart.js +303 -0
  5. package/components/ai-elements/index.d.ts +2 -1
  6. package/components/ai-elements/message.d.ts +19 -4
  7. package/components/ai-elements/message.js +177 -130
  8. package/components/ai-elements/research-activity.d.ts +45 -0
  9. package/components/ai-elements/research-activity.js +260 -0
  10. package/components/ai-elements/task-progress.js +69 -66
  11. package/components/ai-elements/tool.js +42 -38
  12. package/components/answer.d.ts +19 -0
  13. package/components/answer.js +363 -300
  14. package/components/assistant-ui/attachment.js +5 -1
  15. package/components/assistant-ui/composer-deep-research.js +44 -29
  16. package/components/assistant-ui/composer-harness.js +55 -38
  17. package/components/assistant-ui/composer.js +16 -16
  18. package/components/assistant-ui/index.d.ts +0 -1
  19. package/components/assistant-ui/message.d.ts +7 -0
  20. package/components/assistant-ui/message.js +64 -51
  21. package/components/assistant-ui/primitives.d.ts +1 -1
  22. package/components/assistant-ui/thread-context.d.ts +2 -0
  23. package/components/assistant-ui/thread.js +34 -32
  24. package/components/brand-texture.d.ts +37 -0
  25. package/components/brand-texture.js +54 -0
  26. package/components/chart.d.ts +64 -2
  27. package/components/chart.js +717 -456
  28. package/components/code-block.d.ts +36 -0
  29. package/components/code-block.js +136 -0
  30. package/components/command-palette.d.ts +43 -0
  31. package/components/command-palette.js +146 -0
  32. package/components/drawer.d.ts +1 -1
  33. package/components/file-dropzone.d.ts +32 -0
  34. package/components/file-dropzone.js +134 -0
  35. package/components/index.d.ts +11 -0
  36. package/components/index.js +480 -430
  37. package/components/infinite-canvas.d.ts +50 -0
  38. package/components/infinite-canvas.js +215 -0
  39. package/components/page-header.d.ts +22 -0
  40. package/components/page-header.js +52 -0
  41. package/components/resizable-panel.d.ts +29 -0
  42. package/components/resizable-panel.js +102 -0
  43. package/components/reveal.d.ts +36 -0
  44. package/components/reveal.js +35 -0
  45. package/components/scroll-area.d.ts +19 -0
  46. package/components/scroll-area.js +57 -0
  47. package/components/setting-row.d.ts +35 -0
  48. package/components/setting-row.js +86 -0
  49. package/components/sidebar.d.ts +4 -1
  50. package/components/sidebar.js +134 -132
  51. package/components/stepper.d.ts +32 -0
  52. package/components/stepper.js +113 -0
  53. package/components/table.js +16 -15
  54. package/components/tabs.js +1 -1
  55. package/hooks/agents-ui/voice-visualizer-types.js +1 -0
  56. package/lib/icons.d.ts +24 -0
  57. package/lib/icons.js +100 -110
  58. package/lib/motion.d.ts +5 -3
  59. package/lib/motion.js +46 -20
  60. package/lib/router.js +19 -0
  61. package/lib/utils.js +5 -0
  62. package/llms.txt +143 -39
  63. package/manifest.json +1232 -100
  64. package/package.json +2 -2
  65. package/styles.css +71 -28
  66. package/theme.css +19 -15
  67. package/components/ai-elements/reasoning.d.ts +0 -26
  68. package/components/ai-elements/reasoning.js +0 -131
  69. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  70. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -1,169 +1,180 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
- import * as h from "react";
4
- import { cva as E } from "class-variance-authority";
5
- import { z as t } from "zod/v4";
6
- import { Alert as B, AlertTitle as L, AlertDescription as $ } from "./alert.js";
7
- import { Badge as g } from "./badge.js";
8
- import { Button as D } from "./button.js";
2
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
3
+ import * as u from "react";
4
+ import { cva as L } from "class-variance-authority";
5
+ import { z as e } from "zod/v4";
6
+ import { Alert as E, AlertTitle as B, AlertDescription as $ } from "./alert.js";
7
+ import { Badge as p } from "./badge.js";
8
+ import { Button as z } from "./button.js";
9
9
  import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.js";
10
- import { AreaChart as V, BarChart as _, LineChart as z } from "./chart.js";
11
- import { Progress as P } from "./progress.js";
10
+ import { Source as P, SourceTitle as V } from "./assistant-ui/sources.js";
11
+ import { AreaChart as _, BarChart as M, LineChart as W } from "./chart.js";
12
+ import { Progress as I } from "./progress.js";
12
13
  import { cn as c } from "../lib/cn.js";
13
- const I = "render_answer", K = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", x = t.enum([
14
+ const K = "render_answer", H = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", x = e.enum([
14
15
  "default",
15
16
  "primary",
16
17
  "success",
17
18
  "warning",
18
19
  "danger",
19
20
  "info"
20
- ]), M = t.object({
21
- id: t.string().min(1),
22
- label: t.string().min(1),
23
- prompt: t.string().min(1).optional()
24
- }), W = t.object({
25
- id: t.string().min(1),
26
- label: t.string().min(1),
27
- description: t.string().optional()
28
- }), b = t.object({
29
- label: t.string().optional(),
30
- text: t.string().min(1),
21
+ ]), F = e.object({
22
+ id: e.string().min(1),
23
+ label: e.string().min(1),
24
+ prompt: e.string().min(1).optional()
25
+ }), q = e.object({
26
+ id: e.string().min(1),
27
+ label: e.string().min(1),
28
+ description: e.string().optional(),
29
+ href: e.string().min(1).refine((t) => {
30
+ if (t.startsWith("/") || t.startsWith("#")) return !0;
31
+ try {
32
+ const r = new URL(t).protocol;
33
+ return r === "http:" || r === "https:";
34
+ } catch {
35
+ return !1;
36
+ }
37
+ }, "Source link must be HTTP(S) or app-relative").optional().describe("Destination opened in a new tab when the source is selected")
38
+ }), b = e.object({
39
+ label: e.string().optional(),
40
+ text: e.string().min(1),
31
41
  tone: x.optional()
32
- }), p = {
33
- eyebrow: t.string().optional(),
34
- headline: t.string().min(1),
35
- summary: t.string().optional(),
36
- followUps: t.array(M).max(3).optional(),
37
- sources: t.array(W).max(8).optional()
38
- }, A = t.object({
39
- value: t.string().min(1),
40
- detail: t.string().optional(),
42
+ }), f = {
43
+ eyebrow: e.string().optional(),
44
+ headline: e.string().min(1),
45
+ summary: e.string().optional(),
46
+ followUps: e.array(F).max(3).optional(),
47
+ sources: e.array(q).max(8).optional()
48
+ }, A = e.object({
49
+ value: e.string().min(1),
50
+ detail: e.string().optional(),
41
51
  tone: x.optional()
42
- }), F = t.object({
43
- ...p,
44
- kind: t.literal("comparison"),
45
- subjects: t.tuple([
46
- t.object({ label: t.string().min(1), description: t.string().optional() }),
47
- t.object({ label: t.string().min(1), description: t.string().optional() })
52
+ }), G = e.object({
53
+ ...f,
54
+ kind: e.literal("comparison"),
55
+ subjects: e.tuple([
56
+ e.object({ label: e.string().min(1), description: e.string().optional() }),
57
+ e.object({ label: e.string().min(1), description: e.string().optional() })
48
58
  ]),
49
- rows: t.array(
50
- t.object({
51
- label: t.string().min(1),
52
- values: t.tuple([A, A]),
53
- delta: t.object({
54
- value: t.string().min(1),
59
+ rows: e.array(
60
+ e.object({
61
+ label: e.string().min(1),
62
+ description: e.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
63
+ values: e.tuple([A, A]),
64
+ delta: e.object({
65
+ value: e.string().min(1),
55
66
  tone: x.optional()
56
67
  }).optional()
57
68
  })
58
69
  ).min(1).max(8),
59
70
  takeaway: b.optional()
60
- }), v = t.enum([
71
+ }), k = e.enum([
61
72
  "primary",
62
73
  "success",
63
74
  "warning",
64
75
  "danger",
65
76
  "info"
66
- ]), H = t.discriminatedUnion("kind", [
67
- t.object({
68
- kind: t.literal("line"),
69
- value: t.union([t.number(), t.string()]),
70
- axis: t.enum(["x", "y"]).optional(),
71
- label: t.string().optional(),
72
- color: v.optional()
77
+ ]), J = e.discriminatedUnion("kind", [
78
+ e.object({
79
+ kind: e.literal("line"),
80
+ value: e.union([e.number(), e.string()]),
81
+ axis: e.enum(["x", "y"]).optional(),
82
+ label: e.string().optional(),
83
+ color: k.optional()
73
84
  }),
74
- t.object({
75
- kind: t.literal("band"),
76
- from: t.union([t.number(), t.string()]),
77
- to: t.union([t.number(), t.string()]),
78
- axis: t.enum(["x", "y"]).optional(),
79
- label: t.string().optional(),
80
- color: v.optional()
85
+ e.object({
86
+ kind: e.literal("band"),
87
+ from: e.union([e.number(), e.string()]),
88
+ to: e.union([e.number(), e.string()]),
89
+ axis: e.enum(["x", "y"]).optional(),
90
+ label: e.string().optional(),
91
+ color: k.optional()
81
92
  }),
82
- t.object({
83
- kind: t.literal("point"),
84
- x: t.union([t.number(), t.string()]),
85
- y: t.number(),
86
- label: t.string().min(1),
87
- description: t.string().optional(),
88
- color: v.optional()
93
+ e.object({
94
+ kind: e.literal("point"),
95
+ x: e.union([e.number(), e.string()]),
96
+ y: e.number(),
97
+ label: e.string().min(1),
98
+ description: e.string().optional(),
99
+ color: k.optional()
89
100
  })
90
- ]), q = t.record(
91
- t.string(),
92
- t.union([t.string(), t.number(), t.null()])
93
- ), G = t.object({
94
- ...p,
95
- kind: t.literal("trend"),
96
- metric: t.object({
97
- label: t.string().min(1),
98
- value: t.string().min(1),
99
- change: t.string().optional(),
101
+ ]), Q = e.record(
102
+ e.string(),
103
+ e.union([e.string(), e.number(), e.null()])
104
+ ), U = e.object({
105
+ ...f,
106
+ kind: e.literal("trend"),
107
+ metric: e.object({
108
+ label: e.string().min(1),
109
+ value: e.string().min(1),
110
+ change: e.string().optional(),
100
111
  tone: x.optional()
101
112
  }).optional(),
102
- chart: t.object({
103
- type: t.enum(["line", "area", "bar"]),
104
- data: t.array(q).min(1).max(100),
105
- categoryKey: t.string().min(1),
106
- series: t.array(t.string().min(1)).min(1).max(4),
107
- seriesLabels: t.record(t.string(), t.string()).optional(),
108
- highlight: t.string().optional(),
109
- unit: t.string().optional(),
110
- annotations: t.array(H).max(8).optional()
113
+ chart: e.object({
114
+ type: e.enum(["line", "area", "bar"]),
115
+ data: e.array(Q).min(1).max(100),
116
+ categoryKey: e.string().min(1),
117
+ series: e.array(e.string().min(1)).min(1).max(4),
118
+ seriesLabels: e.record(e.string(), e.string()).optional(),
119
+ highlight: e.string().optional(),
120
+ unit: e.string().optional(),
121
+ annotations: e.array(J).max(8).optional()
111
122
  }),
112
123
  insight: b.optional()
113
- }), J = t.object({
114
- ...p,
115
- kind: t.literal("status"),
116
- overall: t.object({
117
- label: t.string().min(1),
118
- value: t.string().min(1),
124
+ }), X = e.object({
125
+ ...f,
126
+ kind: e.literal("status"),
127
+ overall: e.object({
128
+ label: e.string().min(1),
129
+ value: e.string().min(1),
119
130
  tone: x.optional()
120
131
  }).optional(),
121
- items: t.array(
122
- t.object({
123
- label: t.string().min(1),
124
- status: t.string().min(1),
125
- detail: t.string().optional(),
126
- meta: t.string().optional(),
132
+ items: e.array(
133
+ e.object({
134
+ label: e.string().min(1),
135
+ status: e.string().min(1),
136
+ detail: e.string().optional(),
137
+ meta: e.string().optional(),
127
138
  tone: x.optional()
128
139
  })
129
140
  ).min(1).max(12),
130
141
  recommendation: b.optional()
131
- }), Q = t.object({
132
- ...p,
133
- kind: t.literal("breakdown"),
134
- total: t.object({ label: t.string().min(1), value: t.string().min(1) }).optional(),
135
- items: t.array(
136
- t.object({
137
- label: t.string().min(1),
138
- value: t.string().min(1),
139
- share: t.number().min(0).max(100),
140
- detail: t.string().optional(),
142
+ }), Y = e.object({
143
+ ...f,
144
+ kind: e.literal("breakdown"),
145
+ total: e.object({ label: e.string().min(1), value: e.string().min(1) }).optional(),
146
+ items: e.array(
147
+ e.object({
148
+ label: e.string().min(1),
149
+ value: e.string().min(1),
150
+ share: e.number().min(0).max(100),
151
+ detail: e.string().optional(),
141
152
  tone: x.optional()
142
153
  })
143
154
  ).min(1).max(12),
144
155
  insight: b.optional()
145
- }), X = t.object({
146
- ...p,
147
- kind: t.literal("explanation"),
148
- sections: t.array(
149
- t.object({
150
- title: t.string().min(1),
151
- body: t.string().optional(),
152
- bullets: t.array(t.string().min(1)).max(5).optional()
156
+ }), Z = e.object({
157
+ ...f,
158
+ kind: e.literal("explanation"),
159
+ sections: e.array(
160
+ e.object({
161
+ title: e.string().min(1),
162
+ body: e.string().optional(),
163
+ bullets: e.array(e.string().min(1)).max(5).optional()
153
164
  })
154
165
  ).min(1).max(6),
155
166
  takeaway: b.optional()
156
- }), Y = t.discriminatedUnion("kind", [
157
- F,
167
+ }), ee = e.discriminatedUnion("kind", [
158
168
  G,
159
- J,
160
- Q,
161
- X
162
- ]), ht = {
163
- name: I,
164
- description: K,
165
- inputSchema: Y
166
- }, N = E("font-semibold tabular-nums text-foreground", {
169
+ U,
170
+ X,
171
+ Y,
172
+ Z
173
+ ]), pe = {
174
+ name: K,
175
+ description: H,
176
+ inputSchema: ee
177
+ }, v = L("font-semibold tabular-nums text-foreground", {
167
178
  variants: {
168
179
  tone: {
169
180
  default: "text-foreground",
@@ -175,45 +186,49 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
175
186
  }
176
187
  },
177
188
  defaultVariants: { tone: "default" }
178
- }), Z = new Intl.NumberFormat("en-US", {
189
+ }), te = new Intl.NumberFormat("en-US", {
179
190
  notation: "compact",
180
191
  maximumFractionDigits: 1
181
- }), U = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "default", tt = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "primary";
182
- function f({ spec: a }) {
192
+ }), ae = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "default", ne = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "primary";
193
+ function y({ spec: t }) {
183
194
  return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
184
- a.eyebrow && /* @__PURE__ */ e("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: a.eyebrow }),
185
- /* @__PURE__ */ e("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: a.headline }),
186
- a.summary && /* @__PURE__ */ e("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: a.summary })
195
+ t.eyebrow && /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: t.eyebrow }),
196
+ /* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: t.headline }),
197
+ t.summary && /* @__PURE__ */ a("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: t.summary })
187
198
  ] });
188
199
  }
189
- function y({ signal: a }) {
190
- return /* @__PURE__ */ i(B, { variant: U(a.tone), children: [
191
- /* @__PURE__ */ e(L, { children: a.label ?? "Takeaway" }),
192
- /* @__PURE__ */ e($, { children: a.text })
200
+ function w({ signal: t }) {
201
+ return /* @__PURE__ */ i(E, { variant: ae(t.tone), children: [
202
+ /* @__PURE__ */ a(B, { children: t.label ?? "Takeaway" }),
203
+ /* @__PURE__ */ a($, { children: t.text })
193
204
  ] });
194
205
  }
195
- function w({
196
- followUps: a,
206
+ function N({
207
+ followUps: t,
197
208
  sources: r,
198
209
  onFollowUp: s,
199
210
  onSourceSelect: o
200
211
  }) {
201
- return !(a != null && a.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
202
- !!(a != null && a.length) && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((l) => /* @__PURE__ */ e(
203
- O,
204
- {
205
- type: "button",
206
- disabled: !s,
207
- onClick: () => s == null ? void 0 : s(l),
208
- children: l.label
209
- },
210
- l.id
211
- )) }),
212
+ return !(t != null && t.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
212
213
  !!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
213
- /* @__PURE__ */ e("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
214
+ /* @__PURE__ */ a("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
214
215
  r.map(
215
- (l) => o ? /* @__PURE__ */ e(
216
- D,
216
+ (l) => l.href ? /* @__PURE__ */ i(
217
+ P,
218
+ {
219
+ href: l.href,
220
+ variant: "muted",
221
+ size: "sm",
222
+ title: l.description,
223
+ className: "h-6 rounded-full px-2",
224
+ children: [
225
+ /* @__PURE__ */ a(V, { children: l.label }),
226
+ /* @__PURE__ */ a("span", { className: "sr-only", children: " (opens in a new tab)" })
227
+ ]
228
+ },
229
+ l.id
230
+ ) : o ? /* @__PURE__ */ a(
231
+ z,
217
232
  {
218
233
  type: "button",
219
234
  size: "xs",
@@ -224,64 +239,112 @@ function w({
224
239
  children: l.label
225
240
  },
226
241
  l.id
227
- ) : /* @__PURE__ */ e(g, { variant: "soft", title: l.description, children: l.label }, l.id)
242
+ ) : /* @__PURE__ */ a(p, { variant: "soft", title: l.description, children: l.label }, l.id)
228
243
  )
229
- ] })
244
+ ] }),
245
+ !!(t != null && t.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: t.map((l) => /* @__PURE__ */ a(
246
+ O,
247
+ {
248
+ type: "button",
249
+ disabled: !s,
250
+ onClick: () => s == null ? void 0 : s(l),
251
+ children: l.label
252
+ },
253
+ l.id
254
+ )) })
230
255
  ] });
231
256
  }
232
- const j = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
257
+ const j = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
233
258
  "div",
234
259
  {
235
- ref: d,
236
- "data-answer-kind": a.kind,
260
+ ref: m,
261
+ "data-answer-kind": t.kind,
237
262
  className: c("w-full max-w-2xl space-y-5", o),
238
263
  ...l,
239
264
  children: [
240
- /* @__PURE__ */ e(f, { spec: a }),
241
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
242
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
243
- /* @__PURE__ */ e("th", { className: "w-2/5 px-3 py-2 text-xs font-medium text-tertiary", children: "Measure" }),
244
- a.subjects.map((n) => /* @__PURE__ */ i("th", { className: "px-3 py-2 align-bottom", children: [
245
- /* @__PURE__ */ e("span", { className: "block text-sm font-semibold text-foreground", children: n.label }),
246
- n.description && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: n.description })
247
- ] }, n.label))
265
+ /* @__PURE__ */ a(y, { spec: t }),
266
+ /* @__PURE__ */ a("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
267
+ /* @__PURE__ */ a("caption", { className: "sr-only", children: t.headline }),
268
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ i("tr", { children: [
269
+ /* @__PURE__ */ a(
270
+ "th",
271
+ {
272
+ scope: "col",
273
+ className: "w-1/3 px-3 py-2 text-xs font-medium text-tertiary",
274
+ children: "Measure"
275
+ }
276
+ ),
277
+ t.subjects.map((n) => /* @__PURE__ */ i(
278
+ "th",
279
+ {
280
+ scope: "col",
281
+ className: "px-3 py-2 align-bottom",
282
+ children: [
283
+ /* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: n.label }),
284
+ n.description && /* @__PURE__ */ a("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: n.description })
285
+ ]
286
+ },
287
+ n.label
288
+ )),
289
+ /* @__PURE__ */ i("th", { scope: "col", className: "px-3 py-2 align-bottom", children: [
290
+ /* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: "Difference" }),
291
+ /* @__PURE__ */ i("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: [
292
+ t.subjects[1].label,
293
+ " − ",
294
+ t.subjects[0].label
295
+ ] })
296
+ ] })
248
297
  ] }) }),
249
- /* @__PURE__ */ e("tbody", { children: a.rows.map((n) => /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
250
- /* @__PURE__ */ i("th", { className: "rounded-l-xl px-3 py-3 text-xs font-medium text-secondary", children: [
251
- /* @__PURE__ */ e("span", { children: n.label }),
252
- n.delta && /* @__PURE__ */ e(
298
+ /* @__PURE__ */ a("tbody", { children: t.rows.map((n) => {
299
+ const d = n.values[0].detail === n.values[1].detail ? n.values[0].detail : void 0, h = n.description ?? d;
300
+ return /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
301
+ /* @__PURE__ */ i(
302
+ "th",
303
+ {
304
+ scope: "row",
305
+ className: "rounded-l-xl px-3 py-3 align-top text-left",
306
+ children: [
307
+ /* @__PURE__ */ a("span", { className: "block text-sm font-medium text-secondary", children: n.label }),
308
+ h && /* @__PURE__ */ a("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: h })
309
+ ]
310
+ }
311
+ ),
312
+ n.values.map((g, D) => /* @__PURE__ */ a(
313
+ "td",
314
+ {
315
+ className: "px-3 py-3 align-top",
316
+ children: /* @__PURE__ */ a(
317
+ "span",
318
+ {
319
+ className: c(
320
+ v({ tone: g.tone }),
321
+ "block text-sm"
322
+ ),
323
+ children: g.value
324
+ }
325
+ )
326
+ },
327
+ `${n.label}-${t.subjects[D].label}`
328
+ )),
329
+ /* @__PURE__ */ a("td", { className: "rounded-r-xl px-3 py-3 align-top", children: n.delta ? /* @__PURE__ */ a(
253
330
  "span",
254
331
  {
255
332
  className: c(
256
- N({ tone: n.delta.tone }),
257
- "ml-2 text-xs"
333
+ v({ tone: n.delta.tone }),
334
+ "block text-sm"
258
335
  ),
259
336
  children: n.delta.value
260
337
  }
261
- )
262
- ] }),
263
- n.values.map((m, u) => /* @__PURE__ */ i(
264
- "td",
265
- {
266
- className: c(
267
- "px-3 py-3 align-top last:rounded-r-xl",
268
- N({ tone: m.tone })
269
- ),
270
- children: [
271
- /* @__PURE__ */ e("span", { className: "block text-sm", children: m.value }),
272
- m.detail && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: m.detail })
273
- ]
274
- },
275
- `${n.label}-${a.subjects[u].label}`
276
- ))
277
- ] }, n.label)) })
338
+ ) : /* @__PURE__ */ a("span", { "aria-label": "Not provided", className: "text-sm text-tertiary", children: "—" }) })
339
+ ] }, n.label);
340
+ }) })
278
341
  ] }) }),
279
- a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
280
- /* @__PURE__ */ e(
281
- w,
342
+ t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
343
+ /* @__PURE__ */ a(
344
+ N,
282
345
  {
283
- followUps: a.followUps,
284
- sources: a.sources,
346
+ followUps: t.followUps,
347
+ sources: t.sources,
285
348
  onFollowUp: r,
286
349
  onSourceSelect: s
287
350
  }
@@ -290,53 +353,53 @@ const j = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
290
353
  }
291
354
  ));
292
355
  j.displayName = "ComparisonAnswer";
293
- const S = h.forwardRef(
294
- ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => {
295
- const n = h.useMemo(
296
- () => a.chart.unit ? (u) => `${Z.format(u)}${a.chart.unit}` : void 0,
297
- [a.chart.unit]
298
- ), m = {
299
- data: a.chart.data,
300
- categoryKey: a.chart.categoryKey,
301
- series: a.chart.series,
302
- seriesLabels: a.chart.seriesLabels,
303
- highlight: a.chart.highlight,
304
- annotations: a.chart.annotations,
356
+ const S = u.forwardRef(
357
+ ({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => {
358
+ const n = u.useMemo(
359
+ () => t.chart.unit ? (h) => `${te.format(h)}${t.chart.unit}` : void 0,
360
+ [t.chart.unit]
361
+ ), d = {
362
+ data: t.chart.data,
363
+ categoryKey: t.chart.categoryKey,
364
+ series: t.chart.series,
365
+ seriesLabels: t.chart.seriesLabels,
366
+ highlight: t.chart.highlight,
367
+ annotations: t.chart.annotations,
305
368
  formatValue: n,
306
369
  height: 224
307
370
  };
308
371
  return /* @__PURE__ */ i(
309
372
  "div",
310
373
  {
311
- ref: d,
312
- "data-answer-kind": a.kind,
374
+ ref: m,
375
+ "data-answer-kind": t.kind,
313
376
  className: c("w-full max-w-2xl space-y-5", o),
314
377
  ...l,
315
378
  children: [
316
379
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
317
- /* @__PURE__ */ e(f, { spec: a }),
318
- a.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 sm:text-right", children: [
319
- /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.metric.label }),
320
- /* @__PURE__ */ e(
380
+ /* @__PURE__ */ a(y, { spec: t }),
381
+ t.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 text-left", children: [
382
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.metric.label }),
383
+ /* @__PURE__ */ a(
321
384
  "p",
322
385
  {
323
386
  className: c(
324
- N({ tone: a.metric.tone }),
387
+ v({ tone: t.metric.tone }),
325
388
  "mt-1 text-2xl tracking-tight"
326
389
  ),
327
- children: a.metric.value
390
+ children: t.metric.value
328
391
  }
329
392
  ),
330
- a.metric.change && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-secondary", children: a.metric.change })
393
+ t.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: t.metric.change })
331
394
  ] })
332
395
  ] }),
333
- /* @__PURE__ */ e("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: a.chart.type === "area" ? /* @__PURE__ */ e(V, { ...m }) : a.chart.type === "bar" ? /* @__PURE__ */ e(_, { ...m }) : /* @__PURE__ */ e(z, { ...m }) }),
334
- a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
335
- /* @__PURE__ */ e(
336
- w,
396
+ /* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: t.chart.type === "area" ? /* @__PURE__ */ a(_, { ...d }) : t.chart.type === "bar" ? /* @__PURE__ */ a(M, { ...d }) : /* @__PURE__ */ a(W, { ...d }) }),
397
+ t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
398
+ /* @__PURE__ */ a(
399
+ N,
337
400
  {
338
- followUps: a.followUps,
339
- sources: a.sources,
401
+ followUps: t.followUps,
402
+ sources: t.sources,
340
403
  onFollowUp: r,
341
404
  onSourceSelect: s
342
405
  }
@@ -347,54 +410,54 @@ const S = h.forwardRef(
347
410
  }
348
411
  );
349
412
  S.displayName = "TrendAnswer";
350
- const C = h.forwardRef(
351
- ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
413
+ const C = u.forwardRef(
414
+ ({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
352
415
  "div",
353
416
  {
354
- ref: d,
355
- "data-answer-kind": a.kind,
417
+ ref: m,
418
+ "data-answer-kind": t.kind,
356
419
  className: c("w-full max-w-2xl space-y-5", o),
357
420
  ...l,
358
421
  children: [
359
422
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
360
- /* @__PURE__ */ e(f, { spec: a }),
361
- a.overall && /* @__PURE__ */ i(
362
- g,
423
+ /* @__PURE__ */ a(y, { spec: t }),
424
+ t.overall && /* @__PURE__ */ i(
425
+ p,
363
426
  {
364
427
  variant: "soft",
365
- color: a.overall.tone ?? "default",
428
+ color: t.overall.tone ?? "default",
366
429
  className: "self-start",
367
430
  children: [
368
- a.overall.label,
431
+ t.overall.label,
369
432
  " · ",
370
- a.overall.value
433
+ t.overall.value
371
434
  ]
372
435
  }
373
436
  )
374
437
  ] }),
375
- /* @__PURE__ */ e("ul", { className: "space-y-2", children: a.items.map((n) => /* @__PURE__ */ i(
438
+ /* @__PURE__ */ a("ul", { className: "space-y-2", children: t.items.map((n) => /* @__PURE__ */ i(
376
439
  "li",
377
440
  {
378
441
  className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
379
442
  children: [
380
443
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
381
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
382
- n.detail && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
444
+ /* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
445
+ n.detail && /* @__PURE__ */ a("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
383
446
  ] }),
384
447
  /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
385
- /* @__PURE__ */ e(g, { variant: "dot", color: n.tone ?? "default", children: n.status }),
386
- n.meta && /* @__PURE__ */ e("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
448
+ /* @__PURE__ */ a(p, { variant: "dot", color: n.tone ?? "default", children: n.status }),
449
+ n.meta && /* @__PURE__ */ a("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
387
450
  ] })
388
451
  ]
389
452
  },
390
453
  n.label
391
454
  )) }),
392
- a.recommendation && /* @__PURE__ */ e(y, { signal: a.recommendation }),
393
- /* @__PURE__ */ e(
394
- w,
455
+ t.recommendation && /* @__PURE__ */ a(w, { signal: t.recommendation }),
456
+ /* @__PURE__ */ a(
457
+ N,
395
458
  {
396
- followUps: a.followUps,
397
- sources: a.sources,
459
+ followUps: t.followUps,
460
+ sources: t.sources,
398
461
  onFollowUp: r,
399
462
  onSourceSelect: s
400
463
  }
@@ -404,54 +467,54 @@ const C = h.forwardRef(
404
467
  )
405
468
  );
406
469
  C.displayName = "StatusAnswer";
407
- const R = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
470
+ const T = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
408
471
  "div",
409
472
  {
410
- ref: d,
411
- "data-answer-kind": a.kind,
473
+ ref: m,
474
+ "data-answer-kind": t.kind,
412
475
  className: c("w-full max-w-2xl space-y-5", o),
413
476
  ...l,
414
477
  children: [
415
478
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
416
- /* @__PURE__ */ e(f, { spec: a }),
417
- a.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
418
- /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.total.label }),
419
- /* @__PURE__ */ e("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: a.total.value })
479
+ /* @__PURE__ */ a(y, { spec: t }),
480
+ t.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
481
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.total.label }),
482
+ /* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: t.total.value })
420
483
  ] })
421
484
  ] }),
422
- /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.items.map((n, m) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
485
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: t.items.map((n, d) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
423
486
  /* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
424
487
  /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
425
- /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 tabular-nums", children: m + 1 }),
488
+ /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
426
489
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
427
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
428
- n.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
490
+ /* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
491
+ n.detail && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
429
492
  ] })
430
493
  ] }),
431
494
  /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
432
- /* @__PURE__ */ e("p", { className: c(N({ tone: n.tone }), "text-sm"), children: n.value }),
495
+ /* @__PURE__ */ a("p", { className: c(v({ tone: n.tone }), "text-sm"), children: n.value }),
433
496
  /* @__PURE__ */ i("p", { className: "mt-0.5 text-xs tabular-nums text-tertiary", children: [
434
497
  n.share,
435
498
  "%"
436
499
  ] })
437
500
  ] })
438
501
  ] }),
439
- /* @__PURE__ */ e(
440
- P,
502
+ /* @__PURE__ */ a(
503
+ I,
441
504
  {
442
505
  value: n.share,
443
506
  size: "sm",
444
- color: tt(n.tone),
507
+ color: ne(n.tone),
445
508
  label: `${n.label}: ${n.share}%`
446
509
  }
447
510
  )
448
511
  ] }, n.label)) }),
449
- a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
450
- /* @__PURE__ */ e(
451
- w,
512
+ t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
513
+ /* @__PURE__ */ a(
514
+ N,
452
515
  {
453
- followUps: a.followUps,
454
- sources: a.sources,
516
+ followUps: t.followUps,
517
+ sources: t.sources,
455
518
  onFollowUp: r,
456
519
  onSourceSelect: s
457
520
  }
@@ -459,42 +522,42 @@ const R = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
459
522
  ]
460
523
  }
461
524
  ));
462
- R.displayName = "BreakdownAnswer";
463
- const T = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
525
+ T.displayName = "BreakdownAnswer";
526
+ const R = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
464
527
  "div",
465
528
  {
466
- ref: d,
467
- "data-answer-kind": a.kind,
529
+ ref: m,
530
+ "data-answer-kind": t.kind,
468
531
  className: c("w-full max-w-2xl space-y-5", o),
469
532
  ...l,
470
533
  children: [
471
- /* @__PURE__ */ e(f, { spec: a }),
472
- /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.sections.map((n, m) => {
473
- var u;
534
+ /* @__PURE__ */ a(y, { spec: t }),
535
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: t.sections.map((n, d) => {
536
+ var h;
474
537
  return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
475
- /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: m + 1 }),
538
+ /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
476
539
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
477
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
478
- n.body && /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
479
- !!((u = n.bullets) != null && u.length) && /* @__PURE__ */ e("ul", { className: "mt-2 space-y-1.5", children: n.bullets.map((k) => /* @__PURE__ */ i("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
480
- /* @__PURE__ */ e(
540
+ /* @__PURE__ */ a("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
541
+ n.body && /* @__PURE__ */ a("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
542
+ !!((h = n.bullets) != null && h.length) && /* @__PURE__ */ a("ul", { className: "mt-2 space-y-1.5", children: n.bullets.map((g) => /* @__PURE__ */ i("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
543
+ /* @__PURE__ */ a(
481
544
  "span",
482
545
  {
483
546
  "aria-hidden": !0,
484
547
  className: "mt-2 size-1 shrink-0 rounded-dot bg-muted-foreground"
485
548
  }
486
549
  ),
487
- /* @__PURE__ */ e("span", { children: k })
488
- ] }, k)) })
550
+ /* @__PURE__ */ a("span", { children: g })
551
+ ] }, g)) })
489
552
  ] })
490
553
  ] }, n.title);
491
554
  }) }),
492
- a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
493
- /* @__PURE__ */ e(
494
- w,
555
+ t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
556
+ /* @__PURE__ */ a(
557
+ N,
495
558
  {
496
- followUps: a.followUps,
497
- sources: a.sources,
559
+ followUps: t.followUps,
560
+ sources: t.sources,
498
561
  onFollowUp: r,
499
562
  onSourceSelect: s
500
563
  }
@@ -502,42 +565,42 @@ const T = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
502
565
  ]
503
566
  }
504
567
  ));
505
- T.displayName = "ExplanationAnswer";
506
- const at = h.forwardRef(
507
- ({ spec: a, ...r }, s) => {
508
- switch (a.kind) {
568
+ R.displayName = "ExplanationAnswer";
569
+ const ie = u.forwardRef(
570
+ ({ spec: t, ...r }, s) => {
571
+ switch (t.kind) {
509
572
  case "comparison":
510
- return /* @__PURE__ */ e(j, { ref: s, spec: a, ...r });
573
+ return /* @__PURE__ */ a(j, { ref: s, spec: t, ...r });
511
574
  case "trend":
512
- return /* @__PURE__ */ e(S, { ref: s, spec: a, ...r });
575
+ return /* @__PURE__ */ a(S, { ref: s, spec: t, ...r });
513
576
  case "status":
514
- return /* @__PURE__ */ e(C, { ref: s, spec: a, ...r });
577
+ return /* @__PURE__ */ a(C, { ref: s, spec: t, ...r });
515
578
  case "breakdown":
516
- return /* @__PURE__ */ e(R, { ref: s, spec: a, ...r });
579
+ return /* @__PURE__ */ a(T, { ref: s, spec: t, ...r });
517
580
  case "explanation":
518
- return /* @__PURE__ */ e(T, { ref: s, spec: a, ...r });
581
+ return /* @__PURE__ */ a(R, { ref: s, spec: t, ...r });
519
582
  }
520
583
  }
521
584
  );
522
- at.displayName = "AnswerRenderer";
585
+ ie.displayName = "AnswerRenderer";
523
586
  export {
524
- K as ANSWER_TOOL_DESCRIPTION,
525
- I as ANSWER_TOOL_NAME,
526
- M as AnswerFollowUpSchema,
527
- at as AnswerRenderer,
587
+ H as ANSWER_TOOL_DESCRIPTION,
588
+ K as ANSWER_TOOL_NAME,
589
+ F as AnswerFollowUpSchema,
590
+ ie as AnswerRenderer,
528
591
  b as AnswerSignalSchema,
529
- W as AnswerSourceSchema,
530
- Y as AnswerSpecSchema,
592
+ q as AnswerSourceSchema,
593
+ ee as AnswerSpecSchema,
531
594
  x as AnswerToneSchema,
532
- R as BreakdownAnswer,
533
- Q as BreakdownAnswerSchema,
595
+ T as BreakdownAnswer,
596
+ Y as BreakdownAnswerSchema,
534
597
  j as ComparisonAnswer,
535
- F as ComparisonAnswerSchema,
536
- T as ExplanationAnswer,
537
- X as ExplanationAnswerSchema,
598
+ G as ComparisonAnswerSchema,
599
+ R as ExplanationAnswer,
600
+ Z as ExplanationAnswerSchema,
538
601
  C as StatusAnswer,
539
- J as StatusAnswerSchema,
602
+ X as StatusAnswerSchema,
540
603
  S as TrendAnswer,
541
- G as TrendAnswerSchema,
542
- ht as answerTool
604
+ U as TrendAnswerSchema,
605
+ pe as answerTool
543
606
  };