@actioneer/ads 0.5.4 → 0.5.5

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 (91) hide show
  1. package/components/accordion.js +15 -15
  2. package/components/agent-icon.d.ts +64 -0
  3. package/components/agent-icon.js +251 -0
  4. package/components/ai-elements/agent-trace.d.ts +8 -1
  5. package/components/ai-elements/agent-trace.js +164 -129
  6. package/components/ai-elements/chain-of-thought-icon.d.ts +42 -0
  7. package/components/ai-elements/chain-of-thought-icon.js +283 -0
  8. package/components/ai-elements/chain-of-thought.js +7 -7
  9. package/components/ai-elements/chart.js +38 -35
  10. package/components/ai-elements/index.d.ts +1 -0
  11. package/components/ai-elements/inline-citation.js +40 -40
  12. package/components/ai-elements/message.js +5 -5
  13. package/components/ai-elements/queue.js +1 -1
  14. package/components/ai-elements/research-activity.d.ts +2 -0
  15. package/components/ai-elements/research-activity.js +79 -81
  16. package/components/ai-elements/task-progress.js +2 -2
  17. package/components/ai-elements/tool.d.ts +4 -2
  18. package/components/ai-elements/tool.js +74 -54
  19. package/components/ai-elements/transcript.js +1 -1
  20. package/components/alert.js +1 -1
  21. package/components/answer.d.ts +2643 -311
  22. package/components/answer.js +1836 -425
  23. package/components/assistant-ui/answer-tool-ui.js +23 -28
  24. package/components/assistant-ui/chain-of-thought.d.ts +7 -2
  25. package/components/assistant-ui/composer-harness.js +20 -16
  26. package/components/assistant-ui/reasoning.js +35 -31
  27. package/components/assistant-ui/tool-fallback.js +125 -122
  28. package/components/assistant-ui/tool-group.d.ts +3 -1
  29. package/components/assistant-ui/tool-group.js +48 -43
  30. package/components/audio-waveform.js +14 -14
  31. package/components/autocomplete.js +52 -48
  32. package/components/avatar.js +58 -44
  33. package/components/badge.js +3 -3
  34. package/components/brand-texture.js +1 -1
  35. package/components/breadcrumbs.d.ts +27 -1
  36. package/components/breadcrumbs.js +94 -42
  37. package/components/button.js +15 -15
  38. package/components/carousel.js +10 -10
  39. package/components/chart.js +77 -77
  40. package/components/chip.js +3 -3
  41. package/components/code-block.d.ts +39 -17
  42. package/components/code-block.js +153 -104
  43. package/components/command-palette.js +27 -25
  44. package/components/connector-card.js +2 -2
  45. package/components/dropdown.js +65 -61
  46. package/components/empty-state.js +15 -15
  47. package/components/field.js +23 -23
  48. package/components/index.d.ts +4 -0
  49. package/components/index.js +523 -477
  50. package/components/infinite-canvas.js +60 -60
  51. package/components/kbd.js +6 -6
  52. package/components/link.js +6 -6
  53. package/components/modal.js +22 -20
  54. package/components/page-header.js +1 -1
  55. package/components/pagination.js +22 -22
  56. package/components/pixel-blast-svg.js +1 -1
  57. package/components/pixel-icon.d.ts +31 -0
  58. package/components/pixel-icon.js +733 -0
  59. package/components/popover.js +46 -42
  60. package/components/ripple.d.ts +29 -0
  61. package/components/ripple.js +17 -0
  62. package/components/segmented.js +24 -23
  63. package/components/select.js +71 -67
  64. package/components/selection-action-bar.js +22 -22
  65. package/components/sidebar.d.ts +11 -3
  66. package/components/sidebar.js +161 -148
  67. package/components/stepper.d.ts +2 -0
  68. package/components/stepper.js +80 -43
  69. package/components/table.d.ts +7 -0
  70. package/components/table.js +223 -155
  71. package/components/tabs.d.ts +3 -1
  72. package/components/tabs.js +165 -144
  73. package/components/textarea.js +10 -8
  74. package/components/toast.js +48 -46
  75. package/components/tooltip.js +61 -59
  76. package/components/tree.js +44 -41
  77. package/components/typography.d.ts +1 -1
  78. package/components/typography.js +25 -25
  79. package/components/viz-charts.js +133 -133
  80. package/fonts/aribau-grotesk-500.otf +0 -0
  81. package/fonts/aribau-grotesk-600.woff2 +0 -0
  82. package/fonts.css +6 -4
  83. package/lib/icons.d.ts +411 -402
  84. package/lib/icons.js +109 -107
  85. package/llms.txt +96 -8
  86. package/manifest.json +951 -54
  87. package/package.json +5 -5
  88. package/styles.css +206 -81
  89. package/theme.css +200 -77
  90. package/fonts/aribau-grotesk-400.otf +0 -0
  91. package/fonts/aribau-grotesk-700.otf +0 -0
@@ -1,180 +1,465 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { jsxs as n, jsx as t, Fragment as D } from "react/jsx-runtime";
3
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
- import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.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";
13
- import { cn as c } from "../lib/cn.js";
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([
4
+ import { cva as H } from "class-variance-authority";
5
+ import { z as a } from "zod/v4";
6
+ import { Alert as T, AlertTitle as O, AlertDescription as L } from "./alert.js";
7
+ import { Badge as w } from "./badge.js";
8
+ import { Button as Ne } from "./button.js";
9
+ import { CodeBlock as R } from "./code-block.js";
10
+ import { Popover as we, PopoverTrigger as ve, PopoverContent as ke } from "./popover.js";
11
+ import { FollowUpSuggestion as Ae } from "./assistant-ui/follow-up-suggestions.js";
12
+ import { Source as je, SourceTitle as Se } from "./assistant-ui/sources.js";
13
+ import { AreaChart as Ce, BarChart as Re, LineChart as Te } from "./chart.js";
14
+ import { Progress as Oe } from "./progress.js";
15
+ import { Skeleton as p } from "./skeleton.js";
16
+ import { Table as Le, TableHeader as ze, TableRow as B, TableColumn as De, TableBody as qe, TableCell as M } from "./table.js";
17
+ import { Check as q, Minus as Be, WarningCircle as Ke, Clock as Ee, Database as We } from "../lib/icons.js";
18
+ import { cn as g } from "../lib/cn.js";
19
+ const Fe = "render_answer", Pe = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer — data kinds (fact, table, ranking, trend, comparison, breakdown, report), narrative kinds (explanation, knowledge, decision, status), task kinds (confirmation), and situation kinds (clarification, empty, error, refusal) — and provide only validated data; the application owns the layout.", N = a.enum([
15
20
  "default",
16
21
  "primary",
17
22
  "success",
18
23
  "warning",
19
24
  "danger",
20
25
  "info"
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;
26
+ ]), $e = a.object({
27
+ id: a.string().min(1),
28
+ label: a.string().min(1),
29
+ prompt: a.string().min(1).optional()
30
+ }), Ve = a.object({
31
+ id: a.string().min(1),
32
+ label: a.string().min(1),
33
+ description: a.string().optional(),
34
+ prompt: a.string().min(1).optional()
35
+ }), Me = a.object({
36
+ id: a.string().min(1),
37
+ label: a.string().min(1),
38
+ description: a.string().optional(),
39
+ href: a.string().min(1).refine((e) => {
40
+ if (e.startsWith("/") || e.startsWith("#")) return !0;
31
41
  try {
32
- const r = new URL(t).protocol;
33
- return r === "http:" || r === "https:";
42
+ const l = new URL(e).protocol;
43
+ return l === "http:" || l === "https:";
34
44
  } catch {
35
45
  return !1;
36
46
  }
37
47
  }, "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),
41
- tone: x.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(),
51
- tone: x.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
+ }), v = a.object({
49
+ label: a.string().optional(),
50
+ text: a.string().min(1),
51
+ tone: N.optional()
52
+ }), _e = a.union([
53
+ a.string().min(1),
54
+ a.object({
55
+ label: a.string().min(1),
56
+ query: a.string().optional().describe("The SQL that produced the cited value — shown when opened"),
57
+ source: a.string().optional().describe("Connection or table the query ran against"),
58
+ rows: a.number().int().nonnegative().optional().describe("Row count the query returned")
59
+ })
60
+ ]), S = a.array(_e).max(6), P = a.object({
61
+ label: a.string().min(1),
62
+ value: a.string().min(1),
63
+ code: a.boolean().optional().describe("Render the value monospace — table paths, filters, identifiers"),
64
+ tone: N.optional()
65
+ }), Q = a.object({
66
+ label: a.string().min(1),
67
+ value: a.string().min(1),
68
+ change: a.string().optional(),
69
+ tone: N.optional()
70
+ }), x = {
71
+ eyebrow: a.string().optional(),
72
+ headline: a.string().min(1),
73
+ summary: a.string().optional(),
74
+ method: a.string().optional().describe("One-line methodology note — how the number was computed"),
75
+ caveats: a.array(a.string().min(1)).max(4).optional().describe("Assumptions, limitations, freshness or partial-period notes"),
76
+ followUps: a.array($e).max(3).optional(),
77
+ sources: a.array(Me).max(8).optional()
78
+ }, _ = a.object({
79
+ value: a.string().min(1),
80
+ detail: a.string().optional(),
81
+ tone: N.optional()
82
+ }), Ie = a.object({
83
+ ...x,
84
+ kind: a.literal("comparison"),
85
+ subjects: a.tuple([
86
+ a.object({ label: a.string().min(1), description: a.string().optional() }),
87
+ a.object({ label: a.string().min(1), description: a.string().optional() })
58
88
  ]),
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),
66
- tone: x.optional()
89
+ rows: a.array(
90
+ a.object({
91
+ label: a.string().min(1),
92
+ description: a.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
93
+ values: a.tuple([_, _]),
94
+ delta: a.object({
95
+ value: a.string().min(1),
96
+ tone: N.optional()
67
97
  }).optional()
68
98
  })
69
99
  ).min(1).max(8),
70
- takeaway: b.optional()
71
- }), k = e.enum([
100
+ takeaway: v.optional()
101
+ }), K = a.enum([
72
102
  "primary",
73
103
  "success",
74
104
  "warning",
75
105
  "danger",
76
106
  "info"
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()
107
+ ]), He = a.discriminatedUnion("kind", [
108
+ a.object({
109
+ kind: a.literal("line"),
110
+ value: a.union([a.number(), a.string()]),
111
+ axis: a.enum(["x", "y"]).optional(),
112
+ label: a.string().optional(),
113
+ color: K.optional()
84
114
  }),
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()
115
+ a.object({
116
+ kind: a.literal("band"),
117
+ from: a.union([a.number(), a.string()]),
118
+ to: a.union([a.number(), a.string()]),
119
+ axis: a.enum(["x", "y"]).optional(),
120
+ label: a.string().optional(),
121
+ color: K.optional()
92
122
  }),
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()
123
+ a.object({
124
+ kind: a.literal("point"),
125
+ x: a.union([a.number(), a.string()]),
126
+ y: a.number(),
127
+ label: a.string().min(1),
128
+ description: a.string().optional(),
129
+ color: K.optional()
100
130
  })
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(),
111
- tone: x.optional()
131
+ ]), Qe = a.record(
132
+ a.string(),
133
+ a.union([a.string(), a.number(), a.null()])
134
+ ), Y = a.object({
135
+ type: a.enum(["line", "area", "bar"]),
136
+ data: a.array(Qe).min(1).max(100),
137
+ categoryKey: a.string().min(1),
138
+ series: a.array(a.string().min(1)).min(1).max(4),
139
+ seriesLabels: a.record(a.string(), a.string()).optional(),
140
+ highlight: a.string().optional(),
141
+ forecastKeys: a.array(a.string().min(1)).max(2).optional().describe("Series keys drawn dashed as projections (line and area only)"),
142
+ unit: a.string().optional(),
143
+ annotations: a.array(He).max(8).optional()
144
+ }), Ye = a.object({
145
+ ...x,
146
+ kind: a.literal("trend"),
147
+ metric: a.object({
148
+ label: a.string().min(1),
149
+ value: a.string().min(1),
150
+ change: a.string().optional(),
151
+ tone: N.optional()
112
152
  }).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()
122
- }),
123
- insight: b.optional()
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),
130
- tone: x.optional()
153
+ chart: Y,
154
+ insight: v.optional()
155
+ }), Ge = a.object({
156
+ ...x,
157
+ kind: a.literal("status"),
158
+ overall: a.object({
159
+ label: a.string().min(1),
160
+ value: a.string().min(1),
161
+ tone: N.optional()
131
162
  }).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(),
138
- tone: x.optional()
163
+ items: a.array(
164
+ a.object({
165
+ label: a.string().min(1),
166
+ status: a.string().min(1),
167
+ detail: a.string().optional(),
168
+ meta: a.string().optional(),
169
+ tone: N.optional()
170
+ })
171
+ ).min(1).max(12),
172
+ recommendation: v.optional()
173
+ }), Xe = a.object({
174
+ ...x,
175
+ kind: a.literal("breakdown"),
176
+ total: a.object({ label: a.string().min(1), value: a.string().min(1) }).optional(),
177
+ items: a.array(
178
+ a.object({
179
+ label: a.string().min(1),
180
+ value: a.string().min(1),
181
+ share: a.number().min(0).max(100),
182
+ detail: a.string().optional(),
183
+ tone: N.optional()
139
184
  })
140
185
  ).min(1).max(12),
141
- recommendation: b.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(),
152
- tone: x.optional()
186
+ insight: v.optional()
187
+ }), Je = a.object({
188
+ ...x,
189
+ kind: a.literal("explanation"),
190
+ sections: a.array(
191
+ a.object({
192
+ title: a.string().min(1),
193
+ body: a.string().optional(),
194
+ bullets: a.array(a.string().min(1)).max(5).optional(),
195
+ code: a.string().optional().describe("A formula or query illustrating the section"),
196
+ codeLanguage: a.string().optional()
197
+ })
198
+ ).min(1).max(6),
199
+ takeaway: v.optional()
200
+ }), Ze = a.object({
201
+ ...x,
202
+ kind: a.literal("narrative"),
203
+ lead: a.string().optional().describe("The opening framing paragraph — supports blank-line breaks"),
204
+ blocks: a.array(
205
+ a.object({
206
+ heading: a.string().optional(),
207
+ lead: a.string().optional().describe("Bold lead phrase before the body — the finding, the claim"),
208
+ body: a.string().min(1).describe("Prose; blank lines (\\n\\n) split into paragraphs"),
209
+ bullets: a.array(a.string().min(1)).max(6).optional(),
210
+ citations: S.optional(),
211
+ tone: N.optional()
212
+ })
213
+ ).min(1).max(10),
214
+ takeaways: a.array(
215
+ a.object({ lead: a.string().optional(), body: a.string().min(1) })
216
+ ).max(6).optional().describe("Key-takeaways tail — bold lead, then elaboration"),
217
+ bottomLine: v.optional().describe(
218
+ "The emphasized closing verdict"
219
+ )
220
+ }), Ue = a.object({
221
+ ...x,
222
+ kind: a.literal("fact"),
223
+ value: a.object({
224
+ label: a.string().min(1),
225
+ value: a.string().min(1),
226
+ change: a.string().optional(),
227
+ asOf: a.string().optional().describe('Freshness qualifier, e.g. "as of Apr 18, latest ingested"'),
228
+ tone: N.optional()
229
+ }),
230
+ facts: a.array(Q).max(6).optional(),
231
+ citations: S.optional(),
232
+ insight: v.optional()
233
+ }), ea = a.union([
234
+ a.string(),
235
+ a.object({ value: a.string(), tone: N.optional() })
236
+ ]), G = {
237
+ columns: a.array(
238
+ a.object({
239
+ key: a.string().min(1),
240
+ label: a.string().min(1),
241
+ align: a.enum(["left", "right"]).optional()
242
+ })
243
+ ).min(2).max(6),
244
+ rows: a.array(
245
+ a.object({
246
+ cells: a.record(a.string(), ea),
247
+ emphasis: a.boolean().optional().describe("Bold the row — the winner, the current period")
153
248
  })
154
249
  ).min(1).max(12),
155
- insight: b.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()
250
+ totals: a.object({
251
+ label: a.string().min(1).optional(),
252
+ cells: a.record(a.string(), a.string())
253
+ }).optional(),
254
+ note: a.string().optional().describe(
255
+ 'Footnote under the table — row caps ("showing 10 of 1,000"), provenance, partial periods'
256
+ ),
257
+ citations: S.optional()
258
+ }, aa = a.object({
259
+ ...x,
260
+ kind: a.literal("table"),
261
+ ...G,
262
+ insight: v.optional()
263
+ }), ta = a.object({
264
+ ...x,
265
+ kind: a.literal("ranking"),
266
+ metricLabel: a.string().optional().describe('What the ranked value measures, e.g. "Total fee · EUR"'),
267
+ items: a.array(
268
+ a.object({
269
+ label: a.string().min(1),
270
+ value: a.string().min(1),
271
+ detail: a.string().optional().describe("Secondary metric, coverage, or an ineligibility reason"),
272
+ delta: a.object({
273
+ value: a.string().min(1),
274
+ tone: N.optional()
275
+ }).optional(),
276
+ highlight: a.boolean().optional().describe("Mark the winner — set on every member of a tie group"),
277
+ tone: N.optional()
278
+ })
279
+ ).min(1).max(10),
280
+ tiebreak: a.string().optional().describe("How a tie between highlighted items resolves"),
281
+ citations: S.optional(),
282
+ insight: v.optional()
283
+ }), na = a.object({
284
+ ...x,
285
+ kind: a.literal("confirmation"),
286
+ outcome: a.object({
287
+ label: a.string().min(1).describe('The receipt verdict, e.g. "Deployed"'),
288
+ detail: a.string().optional().describe('e.g. "schema version 62"'),
289
+ tone: N.optional()
290
+ }),
291
+ changes: a.array(P).max(8).optional().describe("What was added or configured, as label–value pairs"),
292
+ steps: a.array(
293
+ a.object({
294
+ label: a.string().min(1),
295
+ status: a.enum(["done", "pending", "failed", "skipped"]),
296
+ detail: a.string().optional()
297
+ })
298
+ ).max(10).optional(),
299
+ safety: a.string().optional().describe('The no-side-effects line, e.g. "No existing cubes were modified."'),
300
+ next: a.string().optional().describe("Forward behavior or the step the system takes next"),
301
+ warning: v.optional()
302
+ }), ra = a.object({
303
+ ...x,
304
+ kind: a.literal("clarification"),
305
+ findings: a.array(P).max(6).optional().describe("What was already established — the facts that framed the ask"),
306
+ question: a.string().min(1),
307
+ options: a.array(Ve).min(1).max(4).optional()
308
+ }), ia = a.object({
309
+ ...x,
310
+ kind: a.literal("empty"),
311
+ checks: a.array(
312
+ a.object({
313
+ label: a.string().min(1),
314
+ result: a.string().min(1).describe('e.g. "0 rows"'),
315
+ tone: N.optional()
316
+ })
317
+ ).max(8).optional().describe("What was searched, with each probe's outcome — the proof of absence"),
318
+ reason: a.string().optional().describe("Why the result is empty — cause hypothesis or table semantics"),
319
+ baseline: a.object({ label: a.string().min(1), value: a.string().min(1) }).optional().describe("An adjacent known-good value for calibration"),
320
+ citations: S.optional(),
321
+ alternative: v.optional()
322
+ }), la = a.object({
323
+ ...x,
324
+ kind: a.literal("error"),
325
+ failure: a.object({
326
+ summary: a.string().min(1),
327
+ tally: a.string().optional().describe('Repeat-attempt tally, e.g. "12+ attempts over 7 weeks"'),
328
+ detail: a.string().optional().describe("The verbatim error, rendered monospace")
329
+ }),
330
+ attempts: a.array(
331
+ a.object({
332
+ label: a.string().min(1).describe("What was tried — a path, a query"),
333
+ result: a.string().min(1)
334
+ })
335
+ ).max(6).optional(),
336
+ resolution: a.array(
337
+ a.object({
338
+ action: a.string().min(1),
339
+ owner: a.enum(["user", "admin", "platform", "agent"]).optional()
340
+ })
341
+ ).max(5).optional(),
342
+ preserved: a.object({
343
+ label: a.string().optional(),
344
+ code: a.string().min(1),
345
+ language: a.string().optional()
346
+ }).optional().describe("Prepared work that survives the failure — ready-to-run SQL, a chart config")
347
+ }), sa = a.object({
348
+ ...x,
349
+ kind: a.literal("refusal"),
350
+ reason: a.string().min(1),
351
+ scope: a.string().optional().describe('The role statement, e.g. "read-only data analysis assistant"'),
352
+ completed: a.string().optional().describe("The allowed portion that WAS carried out before declining"),
353
+ alternatives: a.array(
354
+ a.object({
355
+ label: a.string().min(1),
356
+ description: a.string().optional()
357
+ })
358
+ ).max(4).optional()
359
+ }), oa = a.object({
360
+ ...x,
361
+ kind: a.literal("knowledge"),
362
+ entries: a.array(
363
+ a.object({
364
+ term: a.string().min(1),
365
+ category: a.string().optional().describe('e.g. "Formula", "Field", "Rule"'),
366
+ body: a.string().optional(),
367
+ formula: a.string().optional(),
368
+ items: a.array(P).max(6).optional()
164
369
  })
165
370
  ).min(1).max(6),
166
- takeaway: b.optional()
167
- }), ee = e.discriminatedUnion("kind", [
168
- G,
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", {
371
+ gaps: a.array(a.string().min(1)).max(5).optional().describe("What the knowledge base does NOT cover"),
372
+ compliance: a.string().optional().describe('The constraint honored, e.g. "No SQL was executed."'),
373
+ citations: S.optional()
374
+ }), da = a.object({
375
+ ...x,
376
+ kind: a.literal("decision"),
377
+ options: a.array(
378
+ a.object({
379
+ name: a.string().min(1),
380
+ tag: a.string().optional().describe('e.g. "Forward-looking", "Requires input"'),
381
+ description: a.string().optional(),
382
+ pros: a.array(a.string().min(1)).max(5).optional(),
383
+ cons: a.array(a.string().min(1)).max(5).optional(),
384
+ recommended: a.boolean().optional()
385
+ })
386
+ ).min(2).max(4),
387
+ guidance: a.array(a.object({ when: a.string().min(1), choose: a.string().min(1) })).max(5).optional().describe('Goal-to-option mapping — "if you want X, pick Y"')
388
+ }), ca = a.discriminatedUnion("type", [
389
+ a.object({
390
+ type: a.literal("text"),
391
+ title: a.string().optional(),
392
+ body: a.string().min(1)
393
+ }),
394
+ a.object({
395
+ type: a.literal("metrics"),
396
+ title: a.string().optional(),
397
+ items: a.array(Q).min(2).max(4)
398
+ }),
399
+ a.object({
400
+ type: a.literal("table"),
401
+ title: a.string().optional(),
402
+ ...G
403
+ }),
404
+ a.object({
405
+ type: a.literal("chart"),
406
+ title: a.string().optional(),
407
+ chart: Y,
408
+ note: a.string().optional()
409
+ }),
410
+ a.object({
411
+ type: a.literal("list"),
412
+ title: a.string().optional(),
413
+ items: a.array(
414
+ a.object({ lead: a.string().optional(), body: a.string().min(1) })
415
+ ).min(1).max(6)
416
+ })
417
+ ]), ma = a.object({
418
+ ...x,
419
+ kind: a.literal("report"),
420
+ sections: a.array(ca).min(2).max(8),
421
+ definitions: a.array(a.object({ term: a.string().min(1), meaning: a.string().min(1) })).max(8).optional()
422
+ }), ha = a.discriminatedUnion("kind", [
423
+ Ie,
424
+ Ye,
425
+ Ge,
426
+ Xe,
427
+ Je,
428
+ Ze,
429
+ Ue,
430
+ aa,
431
+ ta,
432
+ na,
433
+ ra,
434
+ ia,
435
+ la,
436
+ sa,
437
+ oa,
438
+ da,
439
+ ma
440
+ ]), Wa = [
441
+ "comparison",
442
+ "trend",
443
+ "status",
444
+ "breakdown",
445
+ "explanation",
446
+ "narrative",
447
+ "fact",
448
+ "table",
449
+ "ranking",
450
+ "confirmation",
451
+ "clarification",
452
+ "empty",
453
+ "error",
454
+ "refusal",
455
+ "knowledge",
456
+ "decision",
457
+ "report"
458
+ ], Fa = {
459
+ name: Fe,
460
+ description: Pe,
461
+ inputSchema: ha
462
+ }, A = H("font-semibold tabular-nums text-foreground", {
178
463
  variants: {
179
464
  tone: {
180
465
  default: "text-foreground",
@@ -186,421 +471,1547 @@ const K = "render_answer", H = "Render the final answer with one curated ADS tem
186
471
  }
187
472
  },
188
473
  defaultVariants: { tone: "default" }
189
- }), te = new Intl.NumberFormat("en-US", {
474
+ }), $ = H("", {
475
+ variants: {
476
+ tone: {
477
+ default: "text-secondary",
478
+ primary: "text-brand",
479
+ success: "text-success-700",
480
+ warning: "text-warning-700",
481
+ danger: "text-danger-700",
482
+ info: "text-info-700"
483
+ }
484
+ },
485
+ defaultVariants: { tone: "default" }
486
+ }), ga = new Intl.NumberFormat("en-US", {
190
487
  notation: "compact",
191
488
  maximumFractionDigits: 1
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 }) {
194
- return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
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 })
489
+ }), X = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "default", ba = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "primary", J = u.createContext(void 0);
490
+ function f({ spec: e }) {
491
+ return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
492
+ e.eyebrow && /* @__PURE__ */ t("p", { className: "text-base font-normal text-tertiary", children: e.eyebrow }),
493
+ /* @__PURE__ */ t("h2", { className: "max-w-2xl text-xl font-normal leading-tight tracking-tight text-foreground", children: e.headline }),
494
+ e.summary && /* @__PURE__ */ t("p", { className: "max-w-2xl text-base leading-6 text-secondary", children: e.summary })
198
495
  ] });
199
496
  }
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 })
497
+ function k({ signal: e }) {
498
+ return /* @__PURE__ */ n(
499
+ T,
500
+ {
501
+ variant: X(e.tone),
502
+ className: "border border-border bg-card",
503
+ children: [
504
+ /* @__PURE__ */ t(O, { children: e.label ?? "Takeaway" }),
505
+ /* @__PURE__ */ t(L, { className: "text-base leading-6", children: e.text })
506
+ ]
507
+ }
508
+ );
509
+ }
510
+ function F({
511
+ text: e,
512
+ lead: l,
513
+ className: c
514
+ }) {
515
+ const d = e.split(/\n{2,}/).map((m) => m.trim()).filter(Boolean);
516
+ return /* @__PURE__ */ t("div", { className: g("space-y-2 text-sm leading-6 text-secondary", c), children: d.map((m, s) => /* @__PURE__ */ n("p", { children: [
517
+ s === 0 && l && /* @__PURE__ */ n("span", { className: "font-semibold text-foreground", children: [
518
+ l,
519
+ " — "
520
+ ] }),
521
+ m
522
+ ] }, s)) });
523
+ }
524
+ const Z = (e) => typeof e == "string" ? { label: e } : e, ua = (e) => e == null ? void 0 : e.split(" · ")[0], E = "inline-flex items-center gap-1 rounded-md px-2 py-0.5 font-mono text-xs tabular-nums", I = "cursor-pointer bg-info-50 text-info-700 outline-none transition-colors hover:bg-info-100 focus-visible:ring-3 focus-visible:ring-info/40 active:scale-(--scale-press)";
525
+ function W({ citation: e }) {
526
+ const l = ua(e.source);
527
+ return /* @__PURE__ */ n(D, { children: [
528
+ /* @__PURE__ */ t(We, { "aria-hidden": !0, className: "size-3 shrink-0 opacity-70" }),
529
+ /* @__PURE__ */ t("span", { children: e.label }),
530
+ l && /* @__PURE__ */ n("span", { className: "max-w-[12ch] truncate font-normal opacity-70", children: [
531
+ "· ",
532
+ l
533
+ ] }),
534
+ e.rows != null && /* @__PURE__ */ n("span", { className: "font-normal opacity-60", children: [
535
+ "· ",
536
+ e.rows.toLocaleString()
537
+ ] })
204
538
  ] });
205
539
  }
206
- function N({
207
- followUps: t,
208
- sources: r,
209
- onFollowUp: s,
210
- onSourceSelect: o
540
+ function U({ citation: e }) {
541
+ const l = u.useContext(J), c = !!(e.query || e.source || e.rows != null);
542
+ return l ? /* @__PURE__ */ t(
543
+ "button",
544
+ {
545
+ type: "button",
546
+ className: g(E, I),
547
+ "aria-label": `Inspect the query behind ${e.label}`,
548
+ onClick: () => l(e),
549
+ children: /* @__PURE__ */ t(W, { citation: e })
550
+ }
551
+ ) : c ? /* @__PURE__ */ n(we, { children: [
552
+ /* @__PURE__ */ t(ve, { children: /* @__PURE__ */ t(
553
+ "button",
554
+ {
555
+ type: "button",
556
+ className: g(E, I),
557
+ "aria-label": `Show the query behind ${e.label}`,
558
+ children: /* @__PURE__ */ t(W, { citation: e })
559
+ }
560
+ ) }),
561
+ /* @__PURE__ */ n(
562
+ ke,
563
+ {
564
+ align: "start",
565
+ className: "w-80 max-w-[calc(100vw-1rem)] overflow-hidden p-0",
566
+ children: [
567
+ /* @__PURE__ */ n("div", { className: "space-y-1 px-3 pb-2 pt-3", children: [
568
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3", children: [
569
+ /* @__PURE__ */ t("span", { className: "font-mono text-xs font-semibold text-foreground", children: e.label }),
570
+ e.rows != null && /* @__PURE__ */ n("span", { className: "text-xs tabular-nums text-tertiary", children: [
571
+ e.rows.toLocaleString(),
572
+ " ",
573
+ e.rows === 1 ? "row" : "rows"
574
+ ] })
575
+ ] }),
576
+ e.source && /* @__PURE__ */ t("p", { className: "text-xs text-tertiary", children: e.source })
577
+ ] }),
578
+ e.query && /* @__PURE__ */ t(
579
+ R,
580
+ {
581
+ language: "sql",
582
+ className: "max-h-56 rounded-none",
583
+ children: e.query
584
+ }
585
+ )
586
+ ]
587
+ }
588
+ )
589
+ ] }) : /* @__PURE__ */ t("span", { className: g(E, "bg-surface text-tertiary"), children: /* @__PURE__ */ t(W, { citation: e }) });
590
+ }
591
+ function z({
592
+ citations: e,
593
+ className: l
211
594
  }) {
212
- return !(t != null && t.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
213
- !!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
214
- /* @__PURE__ */ a("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
215
- r.map(
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,
595
+ return e != null && e.length ? /* @__PURE__ */ t("div", { className: g("flex flex-wrap items-center gap-1", l), children: e.map((c, d) => {
596
+ const m = Z(c);
597
+ return /* @__PURE__ */ t(U, { citation: m }, `${m.label}-${d}`);
598
+ }) }) : null;
599
+ }
600
+ function ee({
601
+ items: e,
602
+ className: l
603
+ }) {
604
+ return /* @__PURE__ */ t("dl", { className: g("rounded-2xl border border-border bg-card px-4 py-2", l), children: e.map((c) => /* @__PURE__ */ n(
605
+ "div",
606
+ {
607
+ className: "flex items-baseline justify-between gap-4 py-1.5",
608
+ children: [
609
+ /* @__PURE__ */ t("dt", { className: "text-sm font-normal text-secondary", children: c.label }),
610
+ /* @__PURE__ */ t(
611
+ "dd",
232
612
  {
233
- type: "button",
234
- size: "xs",
235
- variant: "ghost",
236
- title: l.description,
237
- className: "h-6 rounded-full px-2 text-muted-foreground",
238
- onClick: () => o(l),
239
- children: l.label
240
- },
241
- l.id
242
- ) : /* @__PURE__ */ a(p, { variant: "soft", title: l.description, children: l.label }, l.id)
243
- )
613
+ className: g(
614
+ "min-w-0 text-right text-sm",
615
+ c.code ? "break-all font-mono text-xs text-foreground" : A({ tone: c.tone })
616
+ ),
617
+ children: c.value
618
+ }
619
+ )
620
+ ]
621
+ },
622
+ c.label
623
+ )) });
624
+ }
625
+ function pa({ items: e }) {
626
+ return /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-2 @lg:grid-cols-3", children: e.map((l) => /* @__PURE__ */ n("div", { className: "rounded-xl border border-border bg-card px-4 py-3", children: [
627
+ /* @__PURE__ */ t("p", { className: "text-xs font-normal text-tertiary", children: l.label }),
628
+ /* @__PURE__ */ t(
629
+ "p",
630
+ {
631
+ className: g(
632
+ A({ tone: l.tone }),
633
+ "mt-1 text-lg tracking-tight"
634
+ ),
635
+ children: l.value
636
+ }
637
+ ),
638
+ l.change && /* @__PURE__ */ t("p", { className: "mt-0.5 text-xs text-secondary", children: l.change })
639
+ ] }, l.label)) });
640
+ }
641
+ function ae({
642
+ table: e,
643
+ caption: l
644
+ }) {
645
+ const c = (s) => s === void 0 ? void 0 : typeof s == "string" ? s : s.value, d = (s) => s !== void 0 && typeof s == "object" ? s.tone : void 0, m = (s, h, { first: r, emphasis: i }) => s === void 0 || s === "" ? /* @__PURE__ */ t("span", { "aria-label": "Not available", className: "text-tertiary", children: "—" }) : /* @__PURE__ */ t(
646
+ "span",
647
+ {
648
+ className: g(
649
+ r ? g("text-secondary", i && "font-semibold text-foreground") : g(
650
+ "tabular-nums",
651
+ h ? $({ tone: h }) : "text-foreground",
652
+ i && "font-semibold"
653
+ )
654
+ ),
655
+ children: s
656
+ }
657
+ );
658
+ return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
659
+ /* @__PURE__ */ n(Le, { "aria-label": l, isStatic: !0, children: [
660
+ /* @__PURE__ */ t(ze, { children: /* @__PURE__ */ t(B, { children: e.columns.map((s) => /* @__PURE__ */ t(De, { align: s.align, children: s.label }, s.key)) }) }),
661
+ /* @__PURE__ */ n(qe, { children: [
662
+ e.rows.map((s, h) => /* @__PURE__ */ t(B, { children: e.columns.map((r, i) => /* @__PURE__ */ t(M, { align: r.align, children: m(
663
+ c(s.cells[r.key]),
664
+ d(s.cells[r.key]),
665
+ { first: i === 0, emphasis: s.emphasis }
666
+ ) }, r.key)) }, h)),
667
+ e.totals && /* @__PURE__ */ t(B, { children: e.columns.map((s, h) => {
668
+ var i, o;
669
+ const r = ((i = e.totals) == null ? void 0 : i.cells[s.key]) ?? (h === 0 ? ((o = e.totals) == null ? void 0 : o.label) ?? "Total" : "");
670
+ return /* @__PURE__ */ t(M, { align: s.align, children: /* @__PURE__ */ t(
671
+ "span",
672
+ {
673
+ className: g(
674
+ "font-semibold text-foreground",
675
+ h > 0 && "tabular-nums"
676
+ ),
677
+ children: r
678
+ }
679
+ ) }, s.key);
680
+ }) })
681
+ ] })
682
+ ] }),
683
+ e.note && /* @__PURE__ */ t("p", { className: "text-base leading-6 text-tertiary", children: e.note }),
684
+ /* @__PURE__ */ t(z, { citations: e.citations })
685
+ ] });
686
+ }
687
+ function te({ chart: e }) {
688
+ const l = u.useMemo(
689
+ () => e.unit ? (d) => `${ga.format(d)}${e.unit}` : void 0,
690
+ [e.unit]
691
+ ), c = {
692
+ data: e.data,
693
+ categoryKey: e.categoryKey,
694
+ series: e.series,
695
+ seriesLabels: e.seriesLabels,
696
+ highlight: e.highlight,
697
+ annotations: e.annotations,
698
+ formatValue: l,
699
+ height: 224
700
+ };
701
+ return /* @__PURE__ */ t("div", { className: "rounded-2xl border border-border bg-card px-3 pb-2 pt-4 @md:px-4", children: e.type === "area" ? /* @__PURE__ */ t(Ce, { ...c, forecastKeys: e.forecastKeys }) : e.type === "bar" ? /* @__PURE__ */ t(Re, { ...c }) : /* @__PURE__ */ t(Te, { ...c, forecastKeys: e.forecastKeys }) });
702
+ }
703
+ function y({
704
+ spec: e,
705
+ citations: l,
706
+ onFollowUp: c,
707
+ onSourceSelect: d
708
+ }) {
709
+ const { method: m, caveats: s, followUps: h, sources: r } = e, i = !!(m || s != null && s.length || l != null && l.length || r != null && r.length);
710
+ return !i && !(h != null && h.length) ? null : /* @__PURE__ */ n("div", { className: "space-y-4 pt-1", children: [
711
+ i && /* @__PURE__ */ n("div", { className: "space-y-3", children: [
712
+ (m || !!(l != null && l.length)) && /* @__PURE__ */ n("p", { className: "text-base leading-6 text-tertiary", children: [
713
+ m && /* @__PURE__ */ n(D, { children: [
714
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: "How computed" }),
715
+ " · ",
716
+ m
717
+ ] }),
718
+ l == null ? void 0 : l.map((o, b) => /* @__PURE__ */ n(u.Fragment, { children: [
719
+ " ",
720
+ /* @__PURE__ */ t(U, { citation: Z(o) })
721
+ ] }, b))
722
+ ] }),
723
+ !!(s != null && s.length) && /* @__PURE__ */ t("ul", { className: "space-y-1", children: s.map((o) => /* @__PURE__ */ n(
724
+ "li",
725
+ {
726
+ className: "flex items-start gap-2 text-base leading-6 text-tertiary",
727
+ children: [
728
+ /* @__PURE__ */ t(
729
+ "span",
730
+ {
731
+ "aria-hidden": !0,
732
+ className: "mt-2.5 size-1 shrink-0 rounded-dot bg-muted-foreground"
733
+ }
734
+ ),
735
+ /* @__PURE__ */ t("span", { children: o })
736
+ ]
737
+ },
738
+ o
739
+ )) }),
740
+ !!(r != null && r.length) && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: [
741
+ /* @__PURE__ */ t("span", { className: "mx-0.5 text-xs font-normal text-tertiary", children: "Sources" }),
742
+ r == null ? void 0 : r.map(
743
+ (o) => o.href ? /* @__PURE__ */ n(
744
+ je,
745
+ {
746
+ href: o.href,
747
+ variant: "muted",
748
+ size: "sm",
749
+ title: o.description,
750
+ className: "h-6 rounded-full px-2",
751
+ children: [
752
+ /* @__PURE__ */ t(Se, { children: o.label }),
753
+ /* @__PURE__ */ t("span", { className: "sr-only", children: " (opens in a new tab)" })
754
+ ]
755
+ },
756
+ o.id
757
+ ) : d ? /* @__PURE__ */ t(
758
+ Ne,
759
+ {
760
+ type: "button",
761
+ size: "xs",
762
+ variant: "ghost",
763
+ title: o.description,
764
+ className: "h-6 rounded-full px-2 text-muted-foreground",
765
+ onClick: () => d(o),
766
+ children: o.label
767
+ },
768
+ o.id
769
+ ) : /* @__PURE__ */ t(w, { variant: "soft", title: o.description, children: o.label }, o.id)
770
+ )
771
+ ] })
244
772
  ] }),
245
- !!(t != null && t.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: t.map((l) => /* @__PURE__ */ a(
246
- O,
773
+ !!(h != null && h.length) && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: h.map((o) => /* @__PURE__ */ t(
774
+ Ae,
247
775
  {
248
776
  type: "button",
249
- disabled: !s,
250
- onClick: () => s == null ? void 0 : s(l),
251
- children: l.label
777
+ disabled: !c,
778
+ onClick: () => c == null ? void 0 : c(o),
779
+ children: o.label
252
780
  },
253
- l.id
781
+ o.id
254
782
  )) })
255
783
  ] });
256
784
  }
257
- const j = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
785
+ const ne = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
258
786
  "div",
259
787
  {
260
- ref: m,
261
- "data-answer-kind": t.kind,
262
- className: c("w-full max-w-2xl space-y-5", o),
263
- ...l,
788
+ ref: h,
789
+ "data-answer-kind": e.kind,
790
+ className: g("@container w-full max-w-2xl space-y-5", m),
791
+ ...s,
264
792
  children: [
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(
793
+ /* @__PURE__ */ t(f, { spec: e }),
794
+ /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
795
+ /* @__PURE__ */ t("caption", { className: "sr-only", children: e.headline }),
796
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ n("tr", { children: [
797
+ /* @__PURE__ */ t(
270
798
  "th",
271
799
  {
272
800
  scope: "col",
273
- className: "w-1/3 px-3 py-2 text-xs font-medium text-tertiary",
801
+ className: "w-1/3 px-3 py-2 text-base font-normal text-tertiary",
274
802
  children: "Measure"
275
803
  }
276
804
  ),
277
- t.subjects.map((n) => /* @__PURE__ */ i(
805
+ e.subjects.map((r) => /* @__PURE__ */ n(
278
806
  "th",
279
807
  {
280
808
  scope: "col",
281
809
  className: "px-3 py-2 align-bottom",
282
810
  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 })
811
+ /* @__PURE__ */ t("span", { className: "block text-base font-semibold text-foreground", children: r.label }),
812
+ r.description && /* @__PURE__ */ t("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: r.description })
285
813
  ]
286
814
  },
287
- n.label
815
+ r.label
288
816
  )),
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,
817
+ /* @__PURE__ */ n("th", { scope: "col", className: "px-3 py-2 align-bottom", children: [
818
+ /* @__PURE__ */ t("span", { className: "block text-sm font-semibold text-foreground", children: "Difference" }),
819
+ /* @__PURE__ */ n("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: [
820
+ e.subjects[1].label,
293
821
  " − ",
294
- t.subjects[0].label
822
+ e.subjects[0].label
295
823
  ] })
296
824
  ] })
297
825
  ] }) }),
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(
826
+ /* @__PURE__ */ t("tbody", { children: e.rows.map((r) => {
827
+ const i = r.values[0].detail === r.values[1].detail ? r.values[0].detail : void 0, o = r.description ?? i;
828
+ return /* @__PURE__ */ n("tr", { className: "[&>*]:bg-surface", children: [
829
+ /* @__PURE__ */ n(
302
830
  "th",
303
831
  {
304
832
  scope: "row",
305
833
  className: "rounded-l-xl px-3 py-3 align-top text-left",
306
834
  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 })
835
+ /* @__PURE__ */ t("span", { className: "block text-base font-normal text-secondary", children: r.label }),
836
+ o && /* @__PURE__ */ t("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: o })
309
837
  ]
310
838
  }
311
839
  ),
312
- n.values.map((g, D) => /* @__PURE__ */ a(
840
+ r.values.map((b, j) => /* @__PURE__ */ t(
313
841
  "td",
314
842
  {
315
843
  className: "px-3 py-3 align-top",
316
- children: /* @__PURE__ */ a(
844
+ children: /* @__PURE__ */ t(
317
845
  "span",
318
846
  {
319
- className: c(
320
- v({ tone: g.tone }),
321
- "block text-sm"
847
+ className: g(
848
+ A({ tone: b.tone }),
849
+ "block text-base"
322
850
  ),
323
- children: g.value
851
+ children: b.value
324
852
  }
325
853
  )
326
854
  },
327
- `${n.label}-${t.subjects[D].label}`
855
+ `${r.label}-${e.subjects[j].label}`
328
856
  )),
329
- /* @__PURE__ */ a("td", { className: "rounded-r-xl px-3 py-3 align-top", children: n.delta ? /* @__PURE__ */ a(
857
+ /* @__PURE__ */ t("td", { className: "rounded-r-xl px-3 py-3 align-top", children: r.delta ? /* @__PURE__ */ t(
330
858
  "span",
331
859
  {
332
- className: c(
333
- v({ tone: n.delta.tone }),
334
- "block text-sm"
860
+ className: g(
861
+ A({ tone: r.delta.tone }),
862
+ "block text-base"
335
863
  ),
336
- children: n.delta.value
864
+ children: r.delta.value
337
865
  }
338
- ) : /* @__PURE__ */ a("span", { "aria-label": "Not provided", className: "text-sm text-tertiary", children: "—" }) })
339
- ] }, n.label);
866
+ ) : /* @__PURE__ */ t("span", { "aria-label": "Not provided", className: "text-base text-tertiary", children: "—" }) })
867
+ ] }, r.label);
340
868
  }) })
341
869
  ] }) }),
342
- t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
343
- /* @__PURE__ */ a(
344
- N,
870
+ e.takeaway && /* @__PURE__ */ t(k, { signal: e.takeaway }),
871
+ /* @__PURE__ */ t(
872
+ y,
345
873
  {
346
- followUps: t.followUps,
347
- sources: t.sources,
348
- onFollowUp: r,
349
- onSourceSelect: s
874
+ spec: e,
875
+ onFollowUp: l,
876
+ onSourceSelect: d
350
877
  }
351
878
  )
352
879
  ]
353
880
  }
354
881
  ));
355
- j.displayName = "ComparisonAnswer";
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,
368
- formatValue: n,
369
- height: 224
370
- };
371
- return /* @__PURE__ */ i(
372
- "div",
373
- {
374
- ref: m,
375
- "data-answer-kind": t.kind,
376
- className: c("w-full max-w-2xl space-y-5", o),
377
- ...l,
378
- children: [
379
- /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
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(
384
- "p",
385
- {
386
- className: c(
387
- v({ tone: t.metric.tone }),
388
- "mt-1 text-2xl tracking-tight"
389
- ),
390
- children: t.metric.value
391
- }
392
- ),
393
- t.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: t.metric.change })
394
- ] })
395
- ] }),
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,
400
- {
401
- followUps: t.followUps,
402
- sources: t.sources,
403
- onFollowUp: r,
404
- onSourceSelect: s
405
- }
406
- )
407
- ]
408
- }
409
- );
410
- }
882
+ ne.displayName = "ComparisonAnswer";
883
+ const re = u.forwardRef(
884
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
885
+ "div",
886
+ {
887
+ ref: h,
888
+ "data-answer-kind": e.kind,
889
+ className: g("@container w-full max-w-2xl space-y-5", m),
890
+ ...s,
891
+ children: [
892
+ /* @__PURE__ */ n("div", { className: "flex flex-col justify-between gap-4 @md:flex-row @md:items-end", children: [
893
+ /* @__PURE__ */ t(f, { spec: e }),
894
+ e.metric && /* @__PURE__ */ n("div", { className: "shrink-0 rounded-xl border border-border bg-card px-4 py-3 text-left", children: [
895
+ /* @__PURE__ */ t("p", { className: "text-xs font-normal text-tertiary", children: e.metric.label }),
896
+ /* @__PURE__ */ t(
897
+ "p",
898
+ {
899
+ className: g(
900
+ A({ tone: e.metric.tone }),
901
+ "mt-1 text-2xl tracking-tight"
902
+ ),
903
+ children: e.metric.value
904
+ }
905
+ ),
906
+ e.metric.change && /* @__PURE__ */ t("p", { className: "mt-0.5 text-xs text-secondary", children: e.metric.change })
907
+ ] })
908
+ ] }),
909
+ /* @__PURE__ */ t(te, { chart: e.chart }),
910
+ e.insight && /* @__PURE__ */ t(k, { signal: e.insight }),
911
+ /* @__PURE__ */ t(
912
+ y,
913
+ {
914
+ spec: e,
915
+ onFollowUp: l,
916
+ onSourceSelect: d
917
+ }
918
+ )
919
+ ]
920
+ }
921
+ )
411
922
  );
412
- S.displayName = "TrendAnswer";
413
- const C = u.forwardRef(
414
- ({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
923
+ re.displayName = "TrendAnswer";
924
+ const ie = u.forwardRef(
925
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
415
926
  "div",
416
927
  {
417
- ref: m,
418
- "data-answer-kind": t.kind,
419
- className: c("w-full max-w-2xl space-y-5", o),
420
- ...l,
928
+ ref: h,
929
+ "data-answer-kind": e.kind,
930
+ className: g("@container w-full max-w-2xl space-y-5", m),
931
+ ...s,
421
932
  children: [
422
- /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
423
- /* @__PURE__ */ a(y, { spec: t }),
424
- t.overall && /* @__PURE__ */ i(
425
- p,
933
+ /* @__PURE__ */ n("div", { className: "flex flex-col justify-between gap-3 @md:flex-row @md:items-start", children: [
934
+ /* @__PURE__ */ t(f, { spec: e }),
935
+ e.overall && /* @__PURE__ */ n(
936
+ w,
426
937
  {
427
938
  variant: "soft",
428
- color: t.overall.tone ?? "default",
939
+ color: e.overall.tone ?? "default",
429
940
  className: "self-start",
430
941
  children: [
431
- t.overall.label,
942
+ e.overall.label,
432
943
  " · ",
433
- t.overall.value
944
+ e.overall.value
434
945
  ]
435
946
  }
436
947
  )
437
948
  ] }),
438
- /* @__PURE__ */ a("ul", { className: "space-y-2", children: t.items.map((n) => /* @__PURE__ */ i(
949
+ /* @__PURE__ */ t("ul", { className: "space-y-2", children: e.items.map((r) => /* @__PURE__ */ n(
439
950
  "li",
440
951
  {
441
- className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
952
+ className: "flex items-start justify-between gap-4 rounded-xl border border-border bg-card px-4 py-3",
442
953
  children: [
443
- /* @__PURE__ */ i("div", { className: "min-w-0", children: [
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 })
954
+ /* @__PURE__ */ n("div", { className: "min-w-0", children: [
955
+ /* @__PURE__ */ t("p", { className: "text-sm font-normal text-foreground", children: r.label }),
956
+ r.detail && /* @__PURE__ */ t("p", { className: "mt-1 text-xs leading-5 text-secondary", children: r.detail })
446
957
  ] }),
447
- /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
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 })
958
+ /* @__PURE__ */ n("div", { className: "shrink-0 text-right", children: [
959
+ /* @__PURE__ */ t(w, { variant: "dot", color: r.tone ?? "default", children: r.status }),
960
+ r.meta && /* @__PURE__ */ t("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: r.meta })
450
961
  ] })
451
962
  ]
452
963
  },
453
- n.label
964
+ r.label
454
965
  )) }),
455
- t.recommendation && /* @__PURE__ */ a(w, { signal: t.recommendation }),
456
- /* @__PURE__ */ a(
457
- N,
966
+ e.recommendation && /* @__PURE__ */ t(k, { signal: e.recommendation }),
967
+ /* @__PURE__ */ t(
968
+ y,
458
969
  {
459
- followUps: t.followUps,
460
- sources: t.sources,
461
- onFollowUp: r,
462
- onSourceSelect: s
970
+ spec: e,
971
+ onFollowUp: l,
972
+ onSourceSelect: d
463
973
  }
464
974
  )
465
975
  ]
466
976
  }
467
977
  )
468
978
  );
469
- C.displayName = "StatusAnswer";
470
- const T = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
979
+ ie.displayName = "StatusAnswer";
980
+ const le = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
471
981
  "div",
472
982
  {
473
- ref: m,
474
- "data-answer-kind": t.kind,
475
- className: c("w-full max-w-2xl space-y-5", o),
476
- ...l,
983
+ ref: h,
984
+ "data-answer-kind": e.kind,
985
+ className: g("@container w-full max-w-2xl space-y-5", m),
986
+ ...s,
477
987
  children: [
478
- /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
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 })
988
+ /* @__PURE__ */ n("div", { className: "flex flex-col justify-between gap-3 @md:flex-row @md:items-end", children: [
989
+ /* @__PURE__ */ t(f, { spec: e }),
990
+ e.total && /* @__PURE__ */ n("div", { className: "shrink-0 @md:text-right", children: [
991
+ /* @__PURE__ */ t("p", { className: "text-xs font-normal text-tertiary", children: e.total.label }),
992
+ /* @__PURE__ */ t("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: e.total.value })
483
993
  ] })
484
994
  ] }),
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: [
486
- /* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
487
- /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
488
- /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
489
- /* @__PURE__ */ i("div", { className: "min-w-0", children: [
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 })
995
+ /* @__PURE__ */ t("ol", { className: "space-y-2", children: e.items.map((r, i) => /* @__PURE__ */ n("li", { className: "rounded-xl border border-border bg-card px-4 py-3", children: [
996
+ /* @__PURE__ */ n("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
997
+ /* @__PURE__ */ n("div", { className: "flex min-w-0 items-start gap-2.5", children: [
998
+ /* @__PURE__ */ t(w, { variant: "soft", className: "mt-0.5 tabular-nums", children: i + 1 }),
999
+ /* @__PURE__ */ n("div", { className: "min-w-0", children: [
1000
+ /* @__PURE__ */ t("p", { className: "text-sm font-normal text-foreground", children: r.label }),
1001
+ r.detail && /* @__PURE__ */ t("p", { className: "mt-0.5 text-xs text-tertiary", children: r.detail })
492
1002
  ] })
493
1003
  ] }),
494
- /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
495
- /* @__PURE__ */ a("p", { className: c(v({ tone: n.tone }), "text-sm"), children: n.value }),
496
- /* @__PURE__ */ i("p", { className: "mt-0.5 text-xs tabular-nums text-tertiary", children: [
497
- n.share,
1004
+ /* @__PURE__ */ n("div", { className: "shrink-0 text-right", children: [
1005
+ /* @__PURE__ */ t("p", { className: g(A({ tone: r.tone }), "text-sm"), children: r.value }),
1006
+ /* @__PURE__ */ n("p", { className: "mt-0.5 text-xs tabular-nums text-tertiary", children: [
1007
+ r.share,
498
1008
  "%"
499
1009
  ] })
500
1010
  ] })
501
1011
  ] }),
502
- /* @__PURE__ */ a(
503
- I,
1012
+ /* @__PURE__ */ t(
1013
+ Oe,
504
1014
  {
505
- value: n.share,
1015
+ value: r.share,
506
1016
  size: "sm",
507
- color: ne(n.tone),
508
- label: `${n.label}: ${n.share}%`
1017
+ color: ba(r.tone),
1018
+ label: `${r.label}: ${r.share}%`
509
1019
  }
510
1020
  )
511
- ] }, n.label)) }),
512
- t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
513
- /* @__PURE__ */ a(
514
- N,
1021
+ ] }, r.label)) }),
1022
+ e.insight && /* @__PURE__ */ t(k, { signal: e.insight }),
1023
+ /* @__PURE__ */ t(
1024
+ y,
515
1025
  {
516
- followUps: t.followUps,
517
- sources: t.sources,
518
- onFollowUp: r,
519
- onSourceSelect: s
1026
+ spec: e,
1027
+ onFollowUp: l,
1028
+ onSourceSelect: d
520
1029
  }
521
1030
  )
522
1031
  ]
523
1032
  }
524
1033
  ));
525
- T.displayName = "BreakdownAnswer";
526
- const R = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
1034
+ le.displayName = "BreakdownAnswer";
1035
+ const se = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
527
1036
  "div",
528
1037
  {
529
- ref: m,
530
- "data-answer-kind": t.kind,
531
- className: c("w-full max-w-2xl space-y-5", o),
532
- ...l,
1038
+ ref: h,
1039
+ "data-answer-kind": e.kind,
1040
+ className: g("@container w-full max-w-2xl space-y-5", m),
1041
+ ...s,
533
1042
  children: [
534
- /* @__PURE__ */ a(y, { spec: t }),
535
- /* @__PURE__ */ a("ol", { className: "space-y-2", children: t.sections.map((n, d) => {
536
- var h;
537
- return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
538
- /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
539
- /* @__PURE__ */ i("div", { className: "min-w-0", children: [
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(
1043
+ /* @__PURE__ */ t(f, { spec: e }),
1044
+ /* @__PURE__ */ t("ol", { className: "space-y-2", children: e.sections.map((r, i) => {
1045
+ var o;
1046
+ return /* @__PURE__ */ n("li", { className: "flex gap-3 rounded-xl border border-border bg-card px-4 py-3.5", children: [
1047
+ /* @__PURE__ */ t(w, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: i + 1 }),
1048
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
1049
+ /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground", children: r.title }),
1050
+ r.body && /* @__PURE__ */ t("p", { className: "mt-1 text-sm leading-6 text-secondary", children: r.body }),
1051
+ !!((o = r.bullets) != null && o.length) && /* @__PURE__ */ t("ul", { className: "mt-2 space-y-1.5", children: r.bullets.map((b) => /* @__PURE__ */ n("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
1052
+ /* @__PURE__ */ t(
544
1053
  "span",
545
1054
  {
546
1055
  "aria-hidden": !0,
547
1056
  className: "mt-2 size-1 shrink-0 rounded-dot bg-muted-foreground"
548
1057
  }
549
1058
  ),
550
- /* @__PURE__ */ a("span", { children: g })
551
- ] }, g)) })
1059
+ /* @__PURE__ */ t("span", { children: b })
1060
+ ] }, b)) }),
1061
+ r.code && /* @__PURE__ */ t(
1062
+ R,
1063
+ {
1064
+ language: r.codeLanguage,
1065
+ isCopyable: !1,
1066
+ className: "mt-2",
1067
+ children: r.code
1068
+ }
1069
+ )
552
1070
  ] })
553
- ] }, n.title);
1071
+ ] }, r.title);
554
1072
  }) }),
555
- t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
556
- /* @__PURE__ */ a(
557
- N,
1073
+ e.takeaway && /* @__PURE__ */ t(k, { signal: e.takeaway }),
1074
+ /* @__PURE__ */ t(
1075
+ y,
558
1076
  {
559
- followUps: t.followUps,
560
- sources: t.sources,
561
- onFollowUp: r,
562
- onSourceSelect: s
1077
+ spec: e,
1078
+ onFollowUp: l,
1079
+ onSourceSelect: d
563
1080
  }
564
1081
  )
565
1082
  ]
566
1083
  }
567
1084
  ));
568
- R.displayName = "ExplanationAnswer";
569
- const ie = u.forwardRef(
570
- ({ spec: t, ...r }, s) => {
571
- switch (t.kind) {
572
- case "comparison":
573
- return /* @__PURE__ */ a(j, { ref: s, spec: t, ...r });
574
- case "trend":
575
- return /* @__PURE__ */ a(S, { ref: s, spec: t, ...r });
576
- case "status":
577
- return /* @__PURE__ */ a(C, { ref: s, spec: t, ...r });
578
- case "breakdown":
579
- return /* @__PURE__ */ a(T, { ref: s, spec: t, ...r });
580
- case "explanation":
581
- return /* @__PURE__ */ a(R, { ref: s, spec: t, ...r });
1085
+ se.displayName = "ExplanationAnswer";
1086
+ const oe = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1087
+ var r;
1088
+ return /* @__PURE__ */ n(
1089
+ "div",
1090
+ {
1091
+ ref: h,
1092
+ "data-answer-kind": e.kind,
1093
+ className: g("@container w-full max-w-2xl space-y-5", m),
1094
+ ...s,
1095
+ children: [
1096
+ /* @__PURE__ */ t(f, { spec: e }),
1097
+ e.lead && /* @__PURE__ */ t(F, { text: e.lead, className: "text-base" }),
1098
+ /* @__PURE__ */ t("div", { className: "space-y-5", children: e.blocks.map((i, o) => {
1099
+ var b;
1100
+ return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1101
+ i.heading && /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground", children: i.heading }),
1102
+ i.tone && i.tone !== "default" ? /* @__PURE__ */ n(
1103
+ T,
1104
+ {
1105
+ variant: X(i.tone),
1106
+ className: "border border-border bg-card",
1107
+ children: [
1108
+ i.lead && /* @__PURE__ */ t(O, { children: i.lead }),
1109
+ /* @__PURE__ */ t(L, { className: "text-base leading-6", children: i.body })
1110
+ ]
1111
+ }
1112
+ ) : /* @__PURE__ */ t(F, { text: i.body, lead: i.lead }),
1113
+ !!((b = i.bullets) != null && b.length) && /* @__PURE__ */ t("ul", { className: "space-y-1.5", children: i.bullets.map((j) => /* @__PURE__ */ n(
1114
+ "li",
1115
+ {
1116
+ className: "flex items-start gap-2 text-sm leading-6 text-secondary",
1117
+ children: [
1118
+ /* @__PURE__ */ t(
1119
+ "span",
1120
+ {
1121
+ "aria-hidden": !0,
1122
+ className: "mt-2.5 size-1 shrink-0 rounded-dot bg-muted-foreground"
1123
+ }
1124
+ ),
1125
+ /* @__PURE__ */ t("span", { children: j })
1126
+ ]
1127
+ },
1128
+ j
1129
+ )) }),
1130
+ /* @__PURE__ */ t(z, { citations: i.citations })
1131
+ ] }, o);
1132
+ }) }),
1133
+ !!((r = e.takeaways) != null && r.length) && /* @__PURE__ */ n("div", { className: "space-y-2 rounded-2xl border border-border bg-card px-4 py-3.5", children: [
1134
+ /* @__PURE__ */ t("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: "Key takeaways" }),
1135
+ /* @__PURE__ */ t("ul", { className: "space-y-1.5", children: e.takeaways.map((i, o) => /* @__PURE__ */ n(
1136
+ "li",
1137
+ {
1138
+ className: "flex items-start gap-2 text-sm leading-6 text-secondary",
1139
+ children: [
1140
+ /* @__PURE__ */ t(
1141
+ "span",
1142
+ {
1143
+ "aria-hidden": !0,
1144
+ className: "mt-2.5 size-1 shrink-0 rounded-dot bg-muted-foreground"
1145
+ }
1146
+ ),
1147
+ /* @__PURE__ */ n("span", { children: [
1148
+ i.lead && /* @__PURE__ */ n("span", { className: "font-semibold text-foreground", children: [
1149
+ i.lead,
1150
+ " —",
1151
+ " "
1152
+ ] }),
1153
+ i.body
1154
+ ] })
1155
+ ]
1156
+ },
1157
+ o
1158
+ )) })
1159
+ ] }),
1160
+ e.bottomLine && /* @__PURE__ */ t(k, { signal: e.bottomLine }),
1161
+ /* @__PURE__ */ t(
1162
+ y,
1163
+ {
1164
+ spec: e,
1165
+ onFollowUp: l,
1166
+ onSourceSelect: d
1167
+ }
1168
+ )
1169
+ ]
582
1170
  }
1171
+ );
1172
+ });
1173
+ oe.displayName = "NarrativeAnswer";
1174
+ const de = u.forwardRef(
1175
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1176
+ var i;
1177
+ const r = [e.value.change, e.value.asOf].filter(Boolean).join(" · ");
1178
+ return /* @__PURE__ */ n(
1179
+ "div",
1180
+ {
1181
+ ref: h,
1182
+ "data-answer-kind": e.kind,
1183
+ className: g("@container w-full max-w-2xl space-y-5", m),
1184
+ ...s,
1185
+ children: [
1186
+ /* @__PURE__ */ t(f, { spec: e }),
1187
+ /* @__PURE__ */ n("div", { className: "rounded-2xl border border-border px-5 py-4", children: [
1188
+ /* @__PURE__ */ t("p", { className: "text-base font-normal text-tertiary", children: e.value.label }),
1189
+ /* @__PURE__ */ t(
1190
+ "p",
1191
+ {
1192
+ className: g(
1193
+ A({ tone: e.value.tone }),
1194
+ "mt-1 text-3xl font-normal tracking-tight"
1195
+ ),
1196
+ children: e.value.value
1197
+ }
1198
+ ),
1199
+ r && /* @__PURE__ */ t("p", { className: "mt-1 text-base text-secondary", children: r }),
1200
+ !!((i = e.facts) != null && i.length) && /* @__PURE__ */ t("dl", { className: "mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-1.5 border-t border-border pt-3", children: e.facts.map((o) => /* @__PURE__ */ n("div", { className: "flex items-baseline gap-1.5", children: [
1201
+ /* @__PURE__ */ t("dt", { className: "text-xs font-normal text-tertiary", children: o.label }),
1202
+ /* @__PURE__ */ t(
1203
+ "dd",
1204
+ {
1205
+ className: g(
1206
+ A({ tone: o.tone }),
1207
+ "text-base font-normal tabular-nums"
1208
+ ),
1209
+ children: o.value
1210
+ }
1211
+ ),
1212
+ o.change && /* @__PURE__ */ t("dd", { className: "text-xs text-secondary", children: o.change })
1213
+ ] }, o.label)) })
1214
+ ] }),
1215
+ e.insight && /* @__PURE__ */ t(k, { signal: e.insight }),
1216
+ /* @__PURE__ */ t(
1217
+ y,
1218
+ {
1219
+ spec: e,
1220
+ citations: e.citations,
1221
+ onFollowUp: l,
1222
+ onSourceSelect: d
1223
+ }
1224
+ )
1225
+ ]
1226
+ }
1227
+ );
1228
+ }
1229
+ );
1230
+ de.displayName = "FactAnswer";
1231
+ const ce = u.forwardRef(
1232
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
1233
+ "div",
1234
+ {
1235
+ ref: h,
1236
+ "data-answer-kind": e.kind,
1237
+ className: g("@container w-full max-w-2xl space-y-5", m),
1238
+ ...s,
1239
+ children: [
1240
+ /* @__PURE__ */ t(f, { spec: e }),
1241
+ /* @__PURE__ */ t(ae, { table: e, caption: e.headline }),
1242
+ e.insight && /* @__PURE__ */ t(k, { signal: e.insight }),
1243
+ /* @__PURE__ */ t(
1244
+ y,
1245
+ {
1246
+ spec: e,
1247
+ onFollowUp: l,
1248
+ onSourceSelect: d
1249
+ }
1250
+ )
1251
+ ]
1252
+ }
1253
+ )
1254
+ );
1255
+ ce.displayName = "TableAnswer";
1256
+ const me = u.forwardRef(
1257
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => /* @__PURE__ */ n(
1258
+ "div",
1259
+ {
1260
+ ref: h,
1261
+ "data-answer-kind": e.kind,
1262
+ className: g("@container w-full max-w-2xl space-y-5", m),
1263
+ ...s,
1264
+ children: [
1265
+ /* @__PURE__ */ t(f, { spec: e }),
1266
+ /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1267
+ e.metricLabel && /* @__PURE__ */ t("p", { className: "text-base font-normal text-tertiary", children: e.metricLabel }),
1268
+ /* @__PURE__ */ t("ol", { className: "space-y-2", children: e.items.map((r, i) => /* @__PURE__ */ n(
1269
+ "li",
1270
+ {
1271
+ className: "flex items-start justify-between gap-4 rounded-xl border border-border bg-card px-4 py-3",
1272
+ children: [
1273
+ /* @__PURE__ */ n("div", { className: "flex min-w-0 items-start gap-2.5", children: [
1274
+ /* @__PURE__ */ t(
1275
+ w,
1276
+ {
1277
+ variant: "soft",
1278
+ color: r.highlight ? "primary" : "default",
1279
+ className: "mt-0.5 tabular-nums",
1280
+ children: i + 1
1281
+ }
1282
+ ),
1283
+ /* @__PURE__ */ n("div", { className: "min-w-0", children: [
1284
+ /* @__PURE__ */ t(
1285
+ "p",
1286
+ {
1287
+ className: g(
1288
+ "text-base font-normal text-foreground",
1289
+ r.highlight && "font-semibold"
1290
+ ),
1291
+ children: r.label
1292
+ }
1293
+ ),
1294
+ r.detail && /* @__PURE__ */ t("p", { className: "mt-0.5 text-base text-tertiary", children: r.detail })
1295
+ ] })
1296
+ ] }),
1297
+ /* @__PURE__ */ n("div", { className: "shrink-0 text-right", children: [
1298
+ /* @__PURE__ */ t(
1299
+ "p",
1300
+ {
1301
+ className: g(
1302
+ A({ tone: r.tone }),
1303
+ "text-base",
1304
+ r.value === "—" && "font-normal text-tertiary"
1305
+ ),
1306
+ children: r.value
1307
+ }
1308
+ ),
1309
+ r.delta && /* @__PURE__ */ t(
1310
+ "p",
1311
+ {
1312
+ className: g(
1313
+ $({ tone: r.delta.tone }),
1314
+ "mt-0.5 text-xs tabular-nums"
1315
+ ),
1316
+ children: r.delta.value
1317
+ }
1318
+ )
1319
+ ] })
1320
+ ]
1321
+ },
1322
+ r.label
1323
+ )) }),
1324
+ e.tiebreak && /* @__PURE__ */ t("p", { className: "text-base leading-6 text-tertiary", children: e.tiebreak }),
1325
+ /* @__PURE__ */ t(z, { citations: e.citations })
1326
+ ] }),
1327
+ e.insight && /* @__PURE__ */ t(k, { signal: e.insight }),
1328
+ /* @__PURE__ */ t(
1329
+ y,
1330
+ {
1331
+ spec: e,
1332
+ onFollowUp: l,
1333
+ onSourceSelect: d
1334
+ }
1335
+ )
1336
+ ]
1337
+ }
1338
+ )
1339
+ );
1340
+ me.displayName = "RankingAnswer";
1341
+ const xa = {
1342
+ done: /* @__PURE__ */ t(q, { "aria-hidden": !0, className: "text-success-700" }),
1343
+ pending: /* @__PURE__ */ t(Ee, { "aria-hidden": !0, className: "text-tertiary" }),
1344
+ failed: /* @__PURE__ */ t(Ke, { "aria-hidden": !0, className: "text-danger-700" }),
1345
+ skipped: /* @__PURE__ */ t(Be, { "aria-hidden": !0, className: "text-tertiary" })
1346
+ }, fa = {
1347
+ done: "Done",
1348
+ pending: "Pending",
1349
+ failed: "Failed",
1350
+ skipped: "Skipped"
1351
+ }, he = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1352
+ var r, i;
1353
+ return /* @__PURE__ */ n(
1354
+ "div",
1355
+ {
1356
+ ref: h,
1357
+ "data-answer-kind": e.kind,
1358
+ className: g("@container w-full max-w-2xl space-y-5", m),
1359
+ ...s,
1360
+ children: [
1361
+ /* @__PURE__ */ n("div", { className: "flex flex-col justify-between gap-3 @md:flex-row @md:items-start", children: [
1362
+ /* @__PURE__ */ t(f, { spec: e }),
1363
+ /* @__PURE__ */ n(
1364
+ w,
1365
+ {
1366
+ variant: "soft",
1367
+ color: e.outcome.tone ?? "success",
1368
+ className: "self-start",
1369
+ children: [
1370
+ e.outcome.label,
1371
+ e.outcome.detail && ` · ${e.outcome.detail}`
1372
+ ]
1373
+ }
1374
+ )
1375
+ ] }),
1376
+ !!((r = e.changes) != null && r.length) && /* @__PURE__ */ t(ee, { items: e.changes }),
1377
+ !!((i = e.steps) != null && i.length) && /* @__PURE__ */ t("ul", { className: "space-y-2", children: e.steps.map((o) => /* @__PURE__ */ n(
1378
+ "li",
1379
+ {
1380
+ className: "flex items-start gap-3 rounded-xl border border-border bg-card px-4 py-3",
1381
+ children: [
1382
+ /* @__PURE__ */ t("span", { className: "mt-0.5 flex size-4 shrink-0 items-center justify-center [&_svg]:size-4", children: xa[o.status] }),
1383
+ /* @__PURE__ */ n("div", { className: "min-w-0", children: [
1384
+ /* @__PURE__ */ n(
1385
+ "p",
1386
+ {
1387
+ className: g(
1388
+ "text-sm font-normal",
1389
+ o.status === "skipped" ? "text-tertiary" : "text-foreground"
1390
+ ),
1391
+ children: [
1392
+ o.label,
1393
+ /* @__PURE__ */ n("span", { className: "sr-only", children: [
1394
+ " — ",
1395
+ fa[o.status]
1396
+ ] })
1397
+ ]
1398
+ }
1399
+ ),
1400
+ o.detail && /* @__PURE__ */ t("p", { className: "mt-0.5 text-xs leading-5 text-secondary", children: o.detail })
1401
+ ] })
1402
+ ]
1403
+ },
1404
+ o.label
1405
+ )) }),
1406
+ e.safety && /* @__PURE__ */ n("p", { className: "flex items-center gap-1.5 text-xs text-tertiary", children: [
1407
+ /* @__PURE__ */ t(q, { "aria-hidden": !0, className: "size-3.5 shrink-0 text-success-700" }),
1408
+ e.safety
1409
+ ] }),
1410
+ e.next && /* @__PURE__ */ t("p", { className: "text-sm leading-6 text-secondary", children: e.next }),
1411
+ e.warning && /* @__PURE__ */ t(k, { signal: e.warning }),
1412
+ /* @__PURE__ */ t(
1413
+ y,
1414
+ {
1415
+ spec: e,
1416
+ onFollowUp: l,
1417
+ onSourceSelect: d
1418
+ }
1419
+ )
1420
+ ]
1421
+ }
1422
+ );
1423
+ });
1424
+ he.displayName = "ConfirmationAnswer";
1425
+ const ge = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1426
+ var i, o;
1427
+ const r = c ?? l;
1428
+ return /* @__PURE__ */ n(
1429
+ "div",
1430
+ {
1431
+ ref: h,
1432
+ "data-answer-kind": e.kind,
1433
+ className: g("@container w-full max-w-2xl space-y-5", m),
1434
+ ...s,
1435
+ children: [
1436
+ /* @__PURE__ */ t(f, { spec: e }),
1437
+ !!((i = e.findings) != null && i.length) && /* @__PURE__ */ t(ee, { items: e.findings }),
1438
+ /* @__PURE__ */ t("p", { className: "text-sm font-semibold leading-6 text-foreground", children: e.question }),
1439
+ !!((o = e.options) != null && o.length) && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.options.map((b) => /* @__PURE__ */ n(
1440
+ "button",
1441
+ {
1442
+ type: "button",
1443
+ disabled: !r,
1444
+ onClick: () => r == null ? void 0 : r(b),
1445
+ className: g(
1446
+ "w-full rounded-xl bg-card px-4 py-3 text-left shadow-elevation",
1447
+ "transition-[background,transform,box-shadow] duration-(--duration-fast) ease-out motion-reduce:transition-none",
1448
+ "outline-none focus-visible:ring-3 focus-visible:ring-ring",
1449
+ "hover:bg-surface active:scale-(--scale-press)",
1450
+ "disabled:pointer-events-none"
1451
+ ),
1452
+ children: [
1453
+ /* @__PURE__ */ t("span", { className: "block text-sm font-semibold text-foreground", children: b.label }),
1454
+ b.description && /* @__PURE__ */ t("span", { className: "mt-0.5 block text-xs leading-5 text-secondary", children: b.description })
1455
+ ]
1456
+ },
1457
+ b.id
1458
+ )) }),
1459
+ /* @__PURE__ */ t(
1460
+ y,
1461
+ {
1462
+ spec: e,
1463
+ onFollowUp: l,
1464
+ onSourceSelect: d
1465
+ }
1466
+ )
1467
+ ]
1468
+ }
1469
+ );
1470
+ });
1471
+ ge.displayName = "ClarificationAnswer";
1472
+ const be = u.forwardRef(
1473
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1474
+ var r;
1475
+ return /* @__PURE__ */ n(
1476
+ "div",
1477
+ {
1478
+ ref: h,
1479
+ "data-answer-kind": e.kind,
1480
+ className: g("@container w-full max-w-2xl space-y-5", m),
1481
+ ...s,
1482
+ children: [
1483
+ /* @__PURE__ */ t(f, { spec: e }),
1484
+ !!((r = e.checks) != null && r.length) && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1485
+ /* @__PURE__ */ t("ul", { className: "space-y-2", children: e.checks.map((i) => /* @__PURE__ */ n(
1486
+ "li",
1487
+ {
1488
+ className: "flex items-start justify-between gap-4 rounded-xl border border-border bg-card px-4 py-2.5",
1489
+ children: [
1490
+ /* @__PURE__ */ t("span", { className: "min-w-0 text-sm font-normal text-foreground", children: i.label }),
1491
+ /* @__PURE__ */ t(
1492
+ "span",
1493
+ {
1494
+ className: g(
1495
+ "shrink-0 text-sm tabular-nums",
1496
+ i.tone ? $({ tone: i.tone }) : "text-tertiary"
1497
+ ),
1498
+ children: i.result
1499
+ }
1500
+ )
1501
+ ]
1502
+ },
1503
+ i.label
1504
+ )) }),
1505
+ /* @__PURE__ */ t(z, { citations: e.citations })
1506
+ ] }),
1507
+ e.reason && /* @__PURE__ */ t("p", { className: "text-sm leading-6 text-secondary", children: e.reason }),
1508
+ e.baseline && /* @__PURE__ */ n("div", { className: "rounded-xl border border-border bg-card px-4 py-3", children: [
1509
+ /* @__PURE__ */ t("p", { className: "text-xs font-normal text-tertiary", children: e.baseline.label }),
1510
+ /* @__PURE__ */ t("p", { className: "mt-1 text-lg font-semibold tabular-nums tracking-tight text-foreground", children: e.baseline.value })
1511
+ ] }),
1512
+ e.alternative && /* @__PURE__ */ t(k, { signal: e.alternative }),
1513
+ /* @__PURE__ */ t(
1514
+ y,
1515
+ {
1516
+ spec: e,
1517
+ onFollowUp: l,
1518
+ onSourceSelect: d
1519
+ }
1520
+ )
1521
+ ]
1522
+ }
1523
+ );
1524
+ }
1525
+ );
1526
+ be.displayName = "EmptyAnswer";
1527
+ const ya = {
1528
+ user: "You",
1529
+ admin: "Workspace admin",
1530
+ platform: "Platform team",
1531
+ agent: "Agent"
1532
+ }, ue = u.forwardRef(
1533
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1534
+ var r, i;
1535
+ return /* @__PURE__ */ n(
1536
+ "div",
1537
+ {
1538
+ ref: h,
1539
+ "data-answer-kind": e.kind,
1540
+ className: g("@container w-full max-w-2xl space-y-5", m),
1541
+ ...s,
1542
+ children: [
1543
+ /* @__PURE__ */ t(f, { spec: e }),
1544
+ /* @__PURE__ */ n(T, { variant: "danger", className: "border border-border bg-card", children: [
1545
+ /* @__PURE__ */ t(O, { children: e.failure.summary }),
1546
+ e.failure.tally && /* @__PURE__ */ t(L, { className: "text-base leading-6", children: e.failure.tally })
1547
+ ] }),
1548
+ e.failure.detail && /* @__PURE__ */ t(R, { isCopyable: !1, children: e.failure.detail }),
1549
+ !!((r = e.attempts) != null && r.length) && /* @__PURE__ */ t("ul", { className: "space-y-2", children: e.attempts.map((o) => /* @__PURE__ */ n(
1550
+ "li",
1551
+ {
1552
+ className: "flex items-start justify-between gap-4 rounded-xl border border-border bg-card px-4 py-2.5",
1553
+ children: [
1554
+ /* @__PURE__ */ t("span", { className: "min-w-0 break-all font-mono text-xs leading-5 text-foreground", children: o.label }),
1555
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-danger-700", children: o.result })
1556
+ ]
1557
+ },
1558
+ o.label
1559
+ )) }),
1560
+ !!((i = e.resolution) != null && i.length) && /* @__PURE__ */ t("ol", { className: "space-y-2", children: e.resolution.map((o, b) => /* @__PURE__ */ n(
1561
+ "li",
1562
+ {
1563
+ className: "flex items-start justify-between gap-4 rounded-xl border border-border bg-card px-4 py-3",
1564
+ children: [
1565
+ /* @__PURE__ */ n("div", { className: "flex min-w-0 items-start gap-2.5", children: [
1566
+ /* @__PURE__ */ t(w, { variant: "soft", className: "mt-0.5 tabular-nums", children: b + 1 }),
1567
+ /* @__PURE__ */ t("p", { className: "text-sm leading-6 text-foreground", children: o.action })
1568
+ ] }),
1569
+ o.owner && /* @__PURE__ */ t(w, { variant: "soft", className: "shrink-0", children: ya[o.owner] })
1570
+ ]
1571
+ },
1572
+ o.action
1573
+ )) }),
1574
+ e.preserved && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1575
+ /* @__PURE__ */ t("p", { className: "text-xs font-normal text-tertiary", children: "Ready to run once the connection is back" }),
1576
+ /* @__PURE__ */ t(
1577
+ R,
1578
+ {
1579
+ language: e.preserved.language,
1580
+ filename: e.preserved.label,
1581
+ className: "max-h-64",
1582
+ children: e.preserved.code
1583
+ }
1584
+ )
1585
+ ] }),
1586
+ /* @__PURE__ */ t(
1587
+ y,
1588
+ {
1589
+ spec: e,
1590
+ onFollowUp: l,
1591
+ onSourceSelect: d
1592
+ }
1593
+ )
1594
+ ]
1595
+ }
1596
+ );
1597
+ }
1598
+ );
1599
+ ue.displayName = "ErrorAnswer";
1600
+ const pe = u.forwardRef(
1601
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1602
+ var r;
1603
+ return /* @__PURE__ */ n(
1604
+ "div",
1605
+ {
1606
+ ref: h,
1607
+ "data-answer-kind": e.kind,
1608
+ className: g("@container w-full max-w-2xl space-y-5", m),
1609
+ ...s,
1610
+ children: [
1611
+ /* @__PURE__ */ t(f, { spec: e }),
1612
+ e.completed && /* @__PURE__ */ n("p", { className: "flex items-start gap-2 text-sm leading-6 text-secondary", children: [
1613
+ /* @__PURE__ */ t(q, { "aria-hidden": !0, className: "mt-1 size-4 shrink-0 text-success-700" }),
1614
+ /* @__PURE__ */ t("span", { children: e.completed })
1615
+ ] }),
1616
+ /* @__PURE__ */ n(T, { variant: "warning", className: "border border-border bg-card", children: [
1617
+ /* @__PURE__ */ t(O, { children: "Declined" }),
1618
+ /* @__PURE__ */ t(L, { className: "text-base leading-6", children: e.reason })
1619
+ ] }),
1620
+ e.scope && /* @__PURE__ */ t("p", { className: "text-xs leading-5 text-tertiary", children: e.scope }),
1621
+ !!((r = e.alternatives) != null && r.length) && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1622
+ /* @__PURE__ */ t("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: "Available instead" }),
1623
+ /* @__PURE__ */ t("ul", { className: "space-y-2", children: e.alternatives.map((i) => /* @__PURE__ */ n(
1624
+ "li",
1625
+ {
1626
+ className: "rounded-xl border border-border bg-card px-4 py-3",
1627
+ children: [
1628
+ /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-foreground", children: i.label }),
1629
+ i.description && /* @__PURE__ */ t("p", { className: "mt-0.5 text-xs leading-5 text-secondary", children: i.description })
1630
+ ]
1631
+ },
1632
+ i.label
1633
+ )) })
1634
+ ] }),
1635
+ /* @__PURE__ */ t(
1636
+ y,
1637
+ {
1638
+ spec: e,
1639
+ onFollowUp: l,
1640
+ onSourceSelect: d
1641
+ }
1642
+ )
1643
+ ]
1644
+ }
1645
+ );
1646
+ }
1647
+ );
1648
+ pe.displayName = "RefusalAnswer";
1649
+ const xe = u.forwardRef(({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1650
+ var r;
1651
+ return /* @__PURE__ */ n(
1652
+ "div",
1653
+ {
1654
+ ref: h,
1655
+ "data-answer-kind": e.kind,
1656
+ className: g("@container w-full max-w-2xl space-y-5", m),
1657
+ ...s,
1658
+ children: [
1659
+ /* @__PURE__ */ t(f, { spec: e }),
1660
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1661
+ e.entries.map((i) => {
1662
+ var o;
1663
+ return /* @__PURE__ */ n("div", { className: "rounded-xl border border-border bg-card px-4 py-3.5", children: [
1664
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
1665
+ /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground", children: i.term }),
1666
+ i.category && /* @__PURE__ */ t(w, { variant: "soft", children: i.category })
1667
+ ] }),
1668
+ i.body && /* @__PURE__ */ t("p", { className: "mt-1 text-sm leading-6 text-secondary", children: i.body }),
1669
+ i.formula && /* @__PURE__ */ t(R, { isCopyable: !1, className: "mt-2", children: i.formula }),
1670
+ !!((o = i.items) != null && o.length) && /* @__PURE__ */ t("ul", { className: "mt-2 space-y-1.5", children: i.items.map((b) => /* @__PURE__ */ n(
1671
+ "li",
1672
+ {
1673
+ className: "flex items-baseline justify-between gap-4 text-xs leading-5",
1674
+ children: [
1675
+ /* @__PURE__ */ t("span", { className: "font-normal text-secondary", children: b.label }),
1676
+ /* @__PURE__ */ t(
1677
+ "span",
1678
+ {
1679
+ className: g(
1680
+ "min-w-0 text-right text-foreground",
1681
+ b.code ? "break-all font-mono" : "tabular-nums"
1682
+ ),
1683
+ children: b.value
1684
+ }
1685
+ )
1686
+ ]
1687
+ },
1688
+ b.label
1689
+ )) })
1690
+ ] }, i.term);
1691
+ }),
1692
+ /* @__PURE__ */ t(z, { citations: e.citations })
1693
+ ] }),
1694
+ !!((r = e.gaps) != null && r.length) && /* @__PURE__ */ n(T, { variant: "warning", className: "border border-border bg-card", children: [
1695
+ /* @__PURE__ */ t(O, { children: "Not found" }),
1696
+ /* @__PURE__ */ t(L, { className: "text-base leading-6", children: e.gaps.map((i) => /* @__PURE__ */ t("span", { className: "mt-1 block first:mt-0", children: i }, i)) })
1697
+ ] }),
1698
+ e.compliance && /* @__PURE__ */ n("p", { className: "flex items-center gap-1.5 text-xs text-tertiary", children: [
1699
+ /* @__PURE__ */ t(q, { "aria-hidden": !0, className: "size-3.5 shrink-0 text-success-700" }),
1700
+ e.compliance
1701
+ ] }),
1702
+ /* @__PURE__ */ t(
1703
+ y,
1704
+ {
1705
+ spec: e,
1706
+ onFollowUp: l,
1707
+ onSourceSelect: d
1708
+ }
1709
+ )
1710
+ ]
1711
+ }
1712
+ );
1713
+ });
1714
+ xe.displayName = "KnowledgeAnswer";
1715
+ const fe = u.forwardRef(
1716
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1717
+ var r;
1718
+ return /* @__PURE__ */ n(
1719
+ "div",
1720
+ {
1721
+ ref: h,
1722
+ "data-answer-kind": e.kind,
1723
+ className: g("@container w-full max-w-2xl space-y-5", m),
1724
+ ...s,
1725
+ children: [
1726
+ /* @__PURE__ */ t(f, { spec: e }),
1727
+ /* @__PURE__ */ t("div", { className: "space-y-2", children: e.options.map((i) => {
1728
+ var o, b, j, V;
1729
+ return /* @__PURE__ */ n("div", { className: "rounded-2xl border border-border bg-card p-4", children: [
1730
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
1731
+ /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground", children: i.name }),
1732
+ i.tag && /* @__PURE__ */ t(w, { variant: "soft", children: i.tag }),
1733
+ i.recommended && /* @__PURE__ */ t(w, { variant: "soft", color: "primary", children: "Recommended" })
1734
+ ] }),
1735
+ i.description && /* @__PURE__ */ t("p", { className: "mt-1 text-sm leading-6 text-secondary", children: i.description }),
1736
+ (!!((o = i.pros) != null && o.length) || !!((b = i.cons) != null && b.length)) && /* @__PURE__ */ n("div", { className: "mt-3 grid gap-x-6 gap-y-1.5 @lg:grid-cols-2", children: [
1737
+ !!((j = i.pros) != null && j.length) && /* @__PURE__ */ t("ul", { className: "space-y-1.5", children: i.pros.map((C) => /* @__PURE__ */ n(
1738
+ "li",
1739
+ {
1740
+ className: "flex items-start gap-2 text-xs leading-5 text-secondary",
1741
+ children: [
1742
+ /* @__PURE__ */ t(
1743
+ "span",
1744
+ {
1745
+ "aria-hidden": !0,
1746
+ className: "mt-1.5 size-1 shrink-0 rounded-dot bg-success-700"
1747
+ }
1748
+ ),
1749
+ /* @__PURE__ */ t("span", { children: C })
1750
+ ]
1751
+ },
1752
+ C
1753
+ )) }),
1754
+ !!((V = i.cons) != null && V.length) && /* @__PURE__ */ t("ul", { className: "space-y-1.5", children: i.cons.map((C) => /* @__PURE__ */ n(
1755
+ "li",
1756
+ {
1757
+ className: "flex items-start gap-2 text-xs leading-5 text-secondary",
1758
+ children: [
1759
+ /* @__PURE__ */ t(
1760
+ "span",
1761
+ {
1762
+ "aria-hidden": !0,
1763
+ className: "mt-1.5 size-1 shrink-0 rounded-dot bg-danger-700"
1764
+ }
1765
+ ),
1766
+ /* @__PURE__ */ t("span", { children: C })
1767
+ ]
1768
+ },
1769
+ C
1770
+ )) })
1771
+ ] })
1772
+ ] }, i.name);
1773
+ }) }),
1774
+ !!((r = e.guidance) != null && r.length) && /* @__PURE__ */ t("dl", { className: "rounded-2xl border border-border bg-card px-4 py-2", children: e.guidance.map((i) => /* @__PURE__ */ n(
1775
+ "div",
1776
+ {
1777
+ className: "flex items-baseline justify-between gap-4 py-1.5",
1778
+ children: [
1779
+ /* @__PURE__ */ t("dt", { className: "text-sm font-normal text-secondary", children: i.when }),
1780
+ /* @__PURE__ */ t("dd", { className: "text-right text-sm font-semibold text-foreground", children: i.choose })
1781
+ ]
1782
+ },
1783
+ i.when
1784
+ )) }),
1785
+ /* @__PURE__ */ t(
1786
+ y,
1787
+ {
1788
+ spec: e,
1789
+ onFollowUp: l,
1790
+ onSourceSelect: d
1791
+ }
1792
+ )
1793
+ ]
1794
+ }
1795
+ );
1796
+ }
1797
+ );
1798
+ fe.displayName = "DecisionAnswer";
1799
+ const ye = u.forwardRef(
1800
+ ({ spec: e, onFollowUp: l, onOptionSelect: c, onSourceSelect: d, className: m, ...s }, h) => {
1801
+ var r;
1802
+ return /* @__PURE__ */ n(
1803
+ "div",
1804
+ {
1805
+ ref: h,
1806
+ "data-answer-kind": e.kind,
1807
+ className: g("@container w-full max-w-2xl space-y-5", m),
1808
+ ...s,
1809
+ children: [
1810
+ /* @__PURE__ */ t(f, { spec: e }),
1811
+ e.sections.map((i, o) => /* @__PURE__ */ n("section", { className: "space-y-2", children: [
1812
+ i.title && /* @__PURE__ */ t("h3", { className: "text-sm font-semibold text-foreground", children: i.title }),
1813
+ i.type === "text" && /* @__PURE__ */ t(F, { text: i.body }),
1814
+ i.type === "metrics" && /* @__PURE__ */ t(pa, { items: i.items }),
1815
+ i.type === "table" && /* @__PURE__ */ t(
1816
+ ae,
1817
+ {
1818
+ table: i,
1819
+ caption: i.title ?? e.headline
1820
+ }
1821
+ ),
1822
+ i.type === "chart" && /* @__PURE__ */ n(D, { children: [
1823
+ /* @__PURE__ */ t(te, { chart: i.chart }),
1824
+ i.note && /* @__PURE__ */ t("p", { className: "text-xs text-tertiary", children: i.note })
1825
+ ] }),
1826
+ i.type === "list" && /* @__PURE__ */ t("ul", { className: "space-y-1.5", children: i.items.map((b) => /* @__PURE__ */ n(
1827
+ "li",
1828
+ {
1829
+ className: "flex items-start gap-2 text-sm leading-6 text-secondary",
1830
+ children: [
1831
+ /* @__PURE__ */ t(
1832
+ "span",
1833
+ {
1834
+ "aria-hidden": !0,
1835
+ className: "mt-2.5 size-1 shrink-0 rounded-dot bg-muted-foreground"
1836
+ }
1837
+ ),
1838
+ /* @__PURE__ */ n("span", { children: [
1839
+ b.lead && /* @__PURE__ */ n("span", { className: "font-semibold text-foreground", children: [
1840
+ b.lead,
1841
+ " —",
1842
+ " "
1843
+ ] }),
1844
+ b.body
1845
+ ] })
1846
+ ]
1847
+ },
1848
+ b.body
1849
+ )) })
1850
+ ] }, o)),
1851
+ !!((r = e.definitions) != null && r.length) && /* @__PURE__ */ n("div", { className: "space-y-1.5 pt-1", children: [
1852
+ /* @__PURE__ */ t("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: "Definitions" }),
1853
+ /* @__PURE__ */ t("dl", { className: "space-y-1", children: e.definitions.map((i) => /* @__PURE__ */ n("div", { className: "text-xs leading-5", children: [
1854
+ /* @__PURE__ */ t("dt", { className: "inline font-semibold text-secondary", children: i.term }),
1855
+ " ",
1856
+ /* @__PURE__ */ n("dd", { className: "inline text-tertiary", children: [
1857
+ "— ",
1858
+ i.meaning
1859
+ ] })
1860
+ ] }, i.term)) })
1861
+ ] }),
1862
+ /* @__PURE__ */ t(
1863
+ y,
1864
+ {
1865
+ spec: e,
1866
+ onFollowUp: l,
1867
+ onSourceSelect: d
1868
+ }
1869
+ )
1870
+ ]
1871
+ }
1872
+ );
1873
+ }
1874
+ );
1875
+ ye.displayName = "ReportAnswer";
1876
+ const Na = u.forwardRef(
1877
+ ({ kind: e, className: l, ...c }, d) => {
1878
+ const m = e === "trend" ? "chart" : e === "fact" ? "tiles" : e === "table" || e === "comparison" || e === "report" ? "table" : e === "narrative" || e === "explanation" || e === "refusal" ? "prose" : e ? "rows" : "block";
1879
+ return /* @__PURE__ */ n(
1880
+ "div",
1881
+ {
1882
+ ref: d,
1883
+ "data-answer-kind": e,
1884
+ "aria-label": "Building answer",
1885
+ className: g("w-full max-w-2xl space-y-4", l),
1886
+ ...c,
1887
+ children: [
1888
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1889
+ /* @__PURE__ */ t(p, { className: "h-3 w-24" }),
1890
+ /* @__PURE__ */ t(p, { className: "h-7 w-4/5" }),
1891
+ /* @__PURE__ */ t(p, { className: "h-4 w-full" })
1892
+ ] }),
1893
+ m === "chart" && /* @__PURE__ */ t(p, { className: "h-56 w-full rounded-2xl" }),
1894
+ m === "tiles" && /* @__PURE__ */ n(D, { children: [
1895
+ /* @__PURE__ */ t(p, { className: "h-24 w-full rounded-2xl" }),
1896
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-2", children: [
1897
+ /* @__PURE__ */ t(p, { className: "h-16 rounded-xl" }),
1898
+ /* @__PURE__ */ t(p, { className: "h-16 rounded-xl" })
1899
+ ] })
1900
+ ] }),
1901
+ m === "table" && /* @__PURE__ */ t(p, { className: "h-48 w-full rounded-2xl" }),
1902
+ m === "rows" && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1903
+ /* @__PURE__ */ t(p, { className: "h-12 w-full rounded-xl" }),
1904
+ /* @__PURE__ */ t(p, { className: "h-12 w-full rounded-xl" }),
1905
+ /* @__PURE__ */ t(p, { className: "h-12 w-full rounded-xl" })
1906
+ ] }),
1907
+ m === "prose" && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1908
+ /* @__PURE__ */ t(p, { className: "h-4 w-full" }),
1909
+ /* @__PURE__ */ t(p, { className: "h-4 w-full" }),
1910
+ /* @__PURE__ */ t(p, { className: "h-4 w-11/12" }),
1911
+ /* @__PURE__ */ t(p, { className: "h-4 w-full" }),
1912
+ /* @__PURE__ */ t(p, { className: "h-4 w-4/5" })
1913
+ ] }),
1914
+ m === "block" && /* @__PURE__ */ t(p, { className: "h-48 w-full rounded-2xl" })
1915
+ ]
1916
+ }
1917
+ );
1918
+ }
1919
+ );
1920
+ Na.displayName = "AnswerSkeleton";
1921
+ const wa = u.forwardRef(
1922
+ ({ spec: e, onCitationSelect: l, ...c }, d) => {
1923
+ const m = (() => {
1924
+ switch (e.kind) {
1925
+ case "comparison":
1926
+ return /* @__PURE__ */ t(ne, { ref: d, spec: e, ...c });
1927
+ case "trend":
1928
+ return /* @__PURE__ */ t(re, { ref: d, spec: e, ...c });
1929
+ case "status":
1930
+ return /* @__PURE__ */ t(ie, { ref: d, spec: e, ...c });
1931
+ case "breakdown":
1932
+ return /* @__PURE__ */ t(le, { ref: d, spec: e, ...c });
1933
+ case "explanation":
1934
+ return /* @__PURE__ */ t(se, { ref: d, spec: e, ...c });
1935
+ case "narrative":
1936
+ return /* @__PURE__ */ t(oe, { ref: d, spec: e, ...c });
1937
+ case "fact":
1938
+ return /* @__PURE__ */ t(de, { ref: d, spec: e, ...c });
1939
+ case "table":
1940
+ return /* @__PURE__ */ t(ce, { ref: d, spec: e, ...c });
1941
+ case "ranking":
1942
+ return /* @__PURE__ */ t(me, { ref: d, spec: e, ...c });
1943
+ case "confirmation":
1944
+ return /* @__PURE__ */ t(he, { ref: d, spec: e, ...c });
1945
+ case "clarification":
1946
+ return /* @__PURE__ */ t(ge, { ref: d, spec: e, ...c });
1947
+ case "empty":
1948
+ return /* @__PURE__ */ t(be, { ref: d, spec: e, ...c });
1949
+ case "error":
1950
+ return /* @__PURE__ */ t(ue, { ref: d, spec: e, ...c });
1951
+ case "refusal":
1952
+ return /* @__PURE__ */ t(pe, { ref: d, spec: e, ...c });
1953
+ case "knowledge":
1954
+ return /* @__PURE__ */ t(xe, { ref: d, spec: e, ...c });
1955
+ case "decision":
1956
+ return /* @__PURE__ */ t(fe, { ref: d, spec: e, ...c });
1957
+ case "report":
1958
+ return /* @__PURE__ */ t(ye, { ref: d, spec: e, ...c });
1959
+ }
1960
+ })();
1961
+ return /* @__PURE__ */ t(J.Provider, { value: l, children: m });
583
1962
  }
584
1963
  );
585
- ie.displayName = "AnswerRenderer";
1964
+ wa.displayName = "AnswerRenderer";
586
1965
  export {
587
- H as ANSWER_TOOL_DESCRIPTION,
588
- K as ANSWER_TOOL_NAME,
589
- F as AnswerFollowUpSchema,
590
- ie as AnswerRenderer,
591
- b as AnswerSignalSchema,
592
- q as AnswerSourceSchema,
593
- ee as AnswerSpecSchema,
594
- x as AnswerToneSchema,
595
- T as BreakdownAnswer,
596
- Y as BreakdownAnswerSchema,
597
- j as ComparisonAnswer,
598
- G as ComparisonAnswerSchema,
599
- R as ExplanationAnswer,
600
- Z as ExplanationAnswerSchema,
601
- C as StatusAnswer,
602
- X as StatusAnswerSchema,
603
- S as TrendAnswer,
604
- U as TrendAnswerSchema,
605
- pe as answerTool
1966
+ Wa as ANSWER_KINDS,
1967
+ Pe as ANSWER_TOOL_DESCRIPTION,
1968
+ Fe as ANSWER_TOOL_NAME,
1969
+ Y as AnswerChartSchema,
1970
+ _e as AnswerCitationSchema,
1971
+ S as AnswerCitationsSchema,
1972
+ $e as AnswerFollowUpSchema,
1973
+ P as AnswerKeyValueSchema,
1974
+ Q as AnswerMetricSchema,
1975
+ Ve as AnswerOptionSchema,
1976
+ wa as AnswerRenderer,
1977
+ v as AnswerSignalSchema,
1978
+ Na as AnswerSkeleton,
1979
+ Me as AnswerSourceSchema,
1980
+ ha as AnswerSpecSchema,
1981
+ N as AnswerToneSchema,
1982
+ le as BreakdownAnswer,
1983
+ Xe as BreakdownAnswerSchema,
1984
+ ge as ClarificationAnswer,
1985
+ ra as ClarificationAnswerSchema,
1986
+ ne as ComparisonAnswer,
1987
+ Ie as ComparisonAnswerSchema,
1988
+ he as ConfirmationAnswer,
1989
+ na as ConfirmationAnswerSchema,
1990
+ fe as DecisionAnswer,
1991
+ da as DecisionAnswerSchema,
1992
+ be as EmptyAnswer,
1993
+ ia as EmptyAnswerSchema,
1994
+ ue as ErrorAnswer,
1995
+ la as ErrorAnswerSchema,
1996
+ se as ExplanationAnswer,
1997
+ Je as ExplanationAnswerSchema,
1998
+ de as FactAnswer,
1999
+ Ue as FactAnswerSchema,
2000
+ xe as KnowledgeAnswer,
2001
+ oa as KnowledgeAnswerSchema,
2002
+ oe as NarrativeAnswer,
2003
+ Ze as NarrativeAnswerSchema,
2004
+ me as RankingAnswer,
2005
+ ta as RankingAnswerSchema,
2006
+ pe as RefusalAnswer,
2007
+ sa as RefusalAnswerSchema,
2008
+ ye as ReportAnswer,
2009
+ ma as ReportAnswerSchema,
2010
+ ie as StatusAnswer,
2011
+ Ge as StatusAnswerSchema,
2012
+ ce as TableAnswer,
2013
+ aa as TableAnswerSchema,
2014
+ re as TrendAnswer,
2015
+ Ye as TrendAnswerSchema,
2016
+ Fa as answerTool
606
2017
  };