@actioneer/ads 1.0.9 → 1.0.10

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 (51) hide show
  1. package/DESIGN.md +98 -57
  2. package/README.md +19 -7
  3. package/components/answer.js +1 -1
  4. package/components/assistant-ui/composer-harness.js +13 -10
  5. package/components/body-page-header.d.ts +9 -4
  6. package/components/body-page-header.js +10 -10
  7. package/components/breadcrumbs.js +22 -22
  8. package/components/card.js +18 -18
  9. package/components/chart.d.ts +9 -0
  10. package/components/chart.js +738 -717
  11. package/components/chip.js +12 -12
  12. package/components/collection-header.js +4 -4
  13. package/components/connector-card.js +30 -30
  14. package/components/date-range-picker.js +1 -1
  15. package/components/detail-list.d.ts +28 -0
  16. package/components/detail-list.js +52 -0
  17. package/components/drawer.d.ts +38 -15
  18. package/components/drawer.js +150 -86
  19. package/components/empty-state.d.ts +3 -2
  20. package/components/empty-state.js +22 -22
  21. package/components/field.d.ts +16 -0
  22. package/components/field.js +63 -42
  23. package/components/file-dropzone.d.ts +15 -4
  24. package/components/file-dropzone.js +100 -64
  25. package/components/filter-bar.d.ts +44 -0
  26. package/components/filter-bar.js +89 -0
  27. package/components/index.d.ts +3 -0
  28. package/components/index.js +526 -513
  29. package/components/input-field.d.ts +1 -1
  30. package/components/input-field.js +24 -22
  31. package/components/modal.js +56 -53
  32. package/components/panel.js +26 -27
  33. package/components/sidebar.js +54 -54
  34. package/components/sparkline.d.ts +30 -0
  35. package/components/sparkline.js +69 -0
  36. package/demo/components/add-to-artifact.js +5 -2
  37. package/examples/README.md +4 -2
  38. package/examples/call-logs-screen.tsx +381 -0
  39. package/examples/campaign-analysis-screen.tsx +114 -72
  40. package/examples/campaigns-screen.tsx +218 -160
  41. package/examples/guardrails-settings-screen.tsx +123 -0
  42. package/fonts/geist-variable.woff2 +0 -0
  43. package/fonts.css +12 -17
  44. package/lib/icons.js +3 -3
  45. package/llms.txt +107 -39
  46. package/manifest.json +3100 -892
  47. package/package.json +1 -1
  48. package/styles.css +102 -59
  49. package/theme.css +81 -37
  50. package/fonts/aribau-grotesk-medium.woff2 +0 -0
  51. package/fonts/aribau-grotesk-regular.woff2 +0 -0
@@ -1,94 +1,94 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as e, Fragment as oe } from "react/jsx-runtime";
2
+ import { jsxs as A, jsx as e, Fragment as ce } from "react/jsx-runtime";
3
3
  import * as C from "react";
4
- import { ResponsiveContainer as q, LineChart as Fe, Tooltip as z, Line as be, AreaChart as Te, Area as Ie, CartesianGrid as ce, XAxis as de, YAxis as ee, BarChart as De, Bar as ge, LabelList as me, Cell as te, ComposedChart as Ee, ScatterChart as ke, Scatter as Be, PieChart as He, Pie as _e, RadarChart as ze, PolarGrid as je, PolarAngleAxis as pe, PolarRadiusAxis as Pe, Radar as We, RadialBarChart as Ge, RadialBar as Ve, Treemap as Ue, ReferenceArea as Ye, ReferenceLine as Xe, ReferenceDot as Ze } from "recharts";
5
- import { MotionConfig as Qe, AnimatePresence as qe, motion as Je } from "motion/react";
6
- import { cn as D } from "../lib/cn.js";
7
- import { floatVariants as Ke } from "../lib/motion.js";
8
- const ne = (t) => `var(--color-chart-${t % 6 + 1})`, se = (t) => ne(t), re = "var(--chart-context)", ae = 2.5, et = /* @__PURE__ */ new Set([
4
+ import { ResponsiveContainer as J, ComposedChart as pe, Tooltip as j, Area as Ne, Line as we, AreaChart as Be, CartesianGrid as ue, XAxis as me, YAxis as ne, BarChart as He, Bar as Ae, LabelList as he, Cell as re, ScatterChart as _e, Scatter as ze, PieChart as ke, Pie as je, RadarChart as Ge, PolarGrid as Pe, PolarAngleAxis as Ce, PolarRadiusAxis as We, Radar as Ue, RadialBarChart as Ve, RadialBar as Ye, Treemap as Xe, ReferenceArea as Ze, ReferenceLine as Qe, ReferenceDot as qe } from "recharts";
5
+ import { MotionConfig as Je, AnimatePresence as Ke, motion as et } from "motion/react";
6
+ import { cn as I } from "../lib/cn.js";
7
+ import { floatVariants as tt } from "../lib/motion.js";
8
+ const ae = (t) => `var(--color-chart-${t % 6 + 1})`, de = (t) => ae(t), ie = "var(--chart-context)", le = 2.5, nt = /* @__PURE__ */ new Set([
9
9
  "var(--color-chart-2)",
10
10
  "var(--color-chart-6)",
11
- re
12
- ]), Ne = (t) => et.has(t), fe = 20, tt = 0.55, W = "transition-opacity duration-150 ease-out motion-reduce:transition-none", X = (t, n, r = tt) => n == null || n === t ? 1 : r, we = (t) => t != null && t.isTooltipActive && t.activeTooltipIndex != null ? t.activeTooltipIndex : null;
13
- function Ae() {
11
+ ie
12
+ ]), Me = (t) => nt.has(t), xe = 20, rt = 0.55, z = "transition-opacity duration-150 ease-out motion-reduce:transition-none", Y = (t, n, r = rt) => n == null || n === t ? 1 : r, Se = (t) => t != null && t.isTooltipActive && t.activeTooltipIndex != null ? t.activeTooltipIndex : null;
13
+ function Re() {
14
14
  const [t, n] = C.useState(null), r = C.useMemo(
15
15
  () => ({
16
- onMouseMove: (i) => n(we(i)),
16
+ onMouseMove: (i) => n(Se(i)),
17
17
  onMouseLeave: () => n(null)
18
18
  }),
19
19
  []
20
20
  );
21
21
  return { activeIndex: t, handlers: r };
22
22
  }
23
- function Ce(t, n) {
24
- const r = C.useRef(null), [i, o] = C.useState(null), [a, l] = C.useState(null);
25
- return { frameRef: r, activeIndex: i, isDimmed: (d) => a != null && t(d) !== a, handlers: { onMouseMove: (d) => {
26
- const b = we(d);
27
- o(b);
28
- const v = d == null ? void 0 : d.chartY;
29
- if (b == null || !n || v == null || !r.current) {
30
- l(null);
23
+ function ye(t, n) {
24
+ const r = C.useRef(null), [i, l] = C.useState(null), [a, o] = C.useState(null);
25
+ return { frameRef: r, activeIndex: i, isDimmed: (c) => a != null && t(c) !== a, handlers: { onMouseMove: (c) => {
26
+ const b = Se(c);
27
+ l(b);
28
+ const g = c == null ? void 0 : c.chartY;
29
+ if (b == null || !n || g == null || !r.current) {
30
+ o(null);
31
31
  return;
32
32
  }
33
- let f = null, p = 1 / 0;
33
+ let h = null, N = 1 / 0;
34
34
  r.current.querySelectorAll(`circle[data-chart-index="${b}"]`).forEach((M) => {
35
- const y = M.dataset.chartSeries, x = Number(M.getAttribute("cy"));
36
- if (y == null || Number.isNaN(x)) return;
37
- const u = Math.abs(x - v);
38
- u < p && (p = u, f = t(y));
39
- }), l(f);
35
+ const R = M.dataset.chartSeries, p = Number(M.getAttribute("cy"));
36
+ if (R == null || Number.isNaN(p)) return;
37
+ const m = Math.abs(p - g);
38
+ m < N && (N = m, h = t(R));
39
+ }), o(h);
40
40
  }, onMouseLeave: () => {
41
- o(null), l(null);
41
+ l(null), o(null);
42
42
  } } };
43
43
  }
44
- function Me(t, n) {
44
+ function Le(t, n) {
45
45
  return (r) => {
46
46
  if (!(n != null && n.includes(r))) return r;
47
- const i = t.filter((o) => !n.includes(o));
47
+ const i = t.filter((l) => !n.includes(l));
48
48
  return i[n.indexOf(r)] ?? i[0] ?? r;
49
49
  };
50
50
  }
51
- const nt = 2.5, Y = {
51
+ const at = 2.5, V = {
52
52
  primary: { ref: "var(--brand)", pill: "bg-action-primary-soft text-brand-text" },
53
53
  success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
54
54
  warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
55
55
  danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
56
56
  info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
57
- }, _ = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), ye = (t, n) => {
57
+ }, k = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), $e = (t, n) => {
58
58
  const r = [];
59
59
  for (const i of t)
60
- for (const o of Object.keys(i))
61
- o !== n && typeof i[o] == "number" && !r.includes(o) && r.push(o);
60
+ for (const l of Object.keys(i))
61
+ l !== n && typeof i[l] == "number" && !r.includes(l) && r.push(l);
62
62
  return r;
63
63
  };
64
- function V({ x: t, y: n, payload: r, anchor: i, dy: o, format: a }) {
65
- const l = (r == null ? void 0 : r.value) ?? "", h = a ? a(l) : l;
66
- return /* @__PURE__ */ e("text", { x: t, y: n, dy: o, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: h });
64
+ function W({ x: t, y: n, payload: r, anchor: i, dy: l, format: a }) {
65
+ const o = (r == null ? void 0 : r.value) ?? "", f = a ? a(o) : o;
66
+ return /* @__PURE__ */ e("text", { x: t, y: n, dy: l, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: f });
67
67
  }
68
- function Se({
68
+ function Oe({
69
69
  x: t,
70
70
  y: n,
71
71
  value: r,
72
72
  index: i,
73
- hidden: o,
73
+ hidden: l,
74
74
  skip: a,
75
- below: l,
76
- color: h,
77
- format: c
75
+ below: o,
76
+ color: f,
77
+ format: d
78
78
  }) {
79
- if (o || i != null && (a != null && a(i)) || t == null || n == null || r == null || r === "") return null;
80
- const m = Number(r);
81
- if (Number.isNaN(m)) return null;
82
- const d = i != null && (l == null ? void 0 : l(i));
79
+ if (l || i != null && (a != null && a(i)) || t == null || n == null || r == null || r === "") return null;
80
+ const u = Number(r);
81
+ if (Number.isNaN(u)) return null;
82
+ const c = i != null && (o == null ? void 0 : o(i));
83
83
  return /* @__PURE__ */ e(
84
84
  "text",
85
85
  {
86
86
  x: Number(t),
87
- y: d ? Number(n) + 20 : Number(n) - 10,
87
+ y: c ? Number(n) + 20 : Number(n) - 10,
88
88
  textAnchor: "middle",
89
- fill: h,
90
- className: D(!h && "fill-secondary", "text-xs tabular-nums"),
91
- children: c(m)
89
+ fill: f,
90
+ className: I(!f && "fill-secondary", "text-xs tabular-nums"),
91
+ children: d(u)
92
92
  }
93
93
  );
94
94
  }
@@ -97,208 +97,208 @@ function U({
97
97
  cy: n,
98
98
  color: r,
99
99
  active: i = !1,
100
- seriesKey: o,
100
+ seriesKey: l,
101
101
  index: a
102
102
  }) {
103
103
  if (t == null || n == null) return null;
104
- const l = o != null && !i;
104
+ const o = l != null && !i;
105
105
  return /* @__PURE__ */ e(
106
106
  "circle",
107
107
  {
108
108
  "aria-hidden": !0,
109
- "data-chart-series": l ? o : void 0,
110
- "data-chart-index": l ? a : void 0,
109
+ "data-chart-series": o ? l : void 0,
110
+ "data-chart-index": o ? a : void 0,
111
111
  cx: t,
112
112
  cy: n,
113
113
  r: i ? 5.5 : 4,
114
114
  fill: "var(--background)",
115
115
  stroke: r,
116
- strokeWidth: i ? 3 : nt
116
+ strokeWidth: i ? 3 : at
117
117
  }
118
118
  );
119
119
  }
120
- function rt({
120
+ function it({
121
121
  x: t,
122
122
  y: n,
123
123
  width: r,
124
124
  height: i,
125
- value: o,
125
+ value: l,
126
126
  format: a,
127
- horizontal: l
127
+ horizontal: o
128
128
  }) {
129
- if (t == null || n == null || o == null || o === "") return null;
130
- const h = Number(o);
131
- if (Number.isNaN(h)) return null;
132
- const c = Number(t), m = Number(n), d = Number(r ?? 0), b = Number(i ?? 0);
133
- return l ? /* @__PURE__ */ e(
129
+ if (t == null || n == null || l == null || l === "") return null;
130
+ const f = Number(l);
131
+ if (Number.isNaN(f)) return null;
132
+ const d = Number(t), u = Number(n), c = Number(r ?? 0), b = Number(i ?? 0);
133
+ return o ? /* @__PURE__ */ e(
134
134
  "text",
135
135
  {
136
- x: c + d + 8,
137
- y: m + b / 2,
136
+ x: d + c + 8,
137
+ y: u + b / 2,
138
138
  dy: "0.32em",
139
139
  textAnchor: "start",
140
140
  className: "fill-secondary text-xs tabular-nums",
141
- children: a(h)
141
+ children: a(f)
142
142
  }
143
143
  ) : /* @__PURE__ */ e(
144
144
  "text",
145
145
  {
146
- x: c + d / 2,
147
- y: m - 8,
146
+ x: d + c / 2,
147
+ y: u - 8,
148
148
  textAnchor: "middle",
149
149
  className: "fill-secondary text-xs tabular-nums",
150
- children: a(h)
150
+ children: a(f)
151
151
  }
152
152
  );
153
153
  }
154
- function at({
154
+ function lt({
155
155
  x: t,
156
156
  y: n,
157
157
  width: r,
158
158
  height: i,
159
- value: o,
159
+ value: l,
160
160
  format: a,
161
- horizontal: l,
162
- light: h
161
+ horizontal: o,
162
+ light: f
163
163
  }) {
164
- if (t == null || n == null || o == null || o === "") return null;
165
- const c = Number(o);
166
- if (Number.isNaN(c) || c === 0) return null;
167
- const m = Number(t), d = Number(n), b = Math.abs(Number(r ?? 0)), v = Math.abs(Number(i ?? 0)), f = a(c), p = l ? Math.max(fe, f.length * 6 + 8) : fe;
168
- return (l ? b : v) < p ? null : /* @__PURE__ */ e(
164
+ if (t == null || n == null || l == null || l === "") return null;
165
+ const d = Number(l);
166
+ if (Number.isNaN(d) || d === 0) return null;
167
+ const u = Number(t), c = Number(n), b = Math.abs(Number(r ?? 0)), g = Math.abs(Number(i ?? 0)), h = a(d), N = o ? Math.max(xe, h.length * 6 + 8) : xe;
168
+ return (o ? b : g) < N ? null : /* @__PURE__ */ e(
169
169
  "text",
170
170
  {
171
- x: m + Number(r ?? 0) / 2,
172
- y: d + Number(i ?? 0) / 2,
171
+ x: u + Number(r ?? 0) / 2,
172
+ y: c + Number(i ?? 0) / 2,
173
173
  dy: "0.32em",
174
174
  textAnchor: "middle",
175
175
  pointerEvents: "none",
176
- className: D("text-xs tabular-nums", h ? "fill-primary" : "fill-white"),
177
- children: f
176
+ className: I("text-xs tabular-nums", f ? "fill-primary" : "fill-white"),
177
+ children: h
178
178
  }
179
179
  );
180
180
  }
181
- function it({
181
+ function ot({
182
182
  x: t,
183
183
  y: n,
184
184
  width: r,
185
185
  height: i,
186
- index: o,
186
+ index: l,
187
187
  totals: a,
188
- format: l,
189
- horizontal: h
188
+ format: o,
189
+ horizontal: f
190
190
  }) {
191
- if (t == null || n == null || o == null) return null;
192
- const c = a[o];
193
- if (c == null) return null;
194
- const m = Number(t), d = Number(n), b = Number(r ?? 0), v = Number(i ?? 0);
195
- return h ? /* @__PURE__ */ e(
191
+ if (t == null || n == null || l == null) return null;
192
+ const d = a[l];
193
+ if (d == null) return null;
194
+ const u = Number(t), c = Number(n), b = Number(r ?? 0), g = Number(i ?? 0);
195
+ return f ? /* @__PURE__ */ e(
196
196
  "text",
197
197
  {
198
- x: m + b + 8,
199
- y: d + v / 2,
198
+ x: u + b + 8,
199
+ y: c + g / 2,
200
200
  dy: "0.32em",
201
201
  textAnchor: "start",
202
202
  className: "fill-primary text-xs font-medium tabular-nums",
203
- children: l(c)
203
+ children: o(d)
204
204
  }
205
205
  ) : /* @__PURE__ */ e(
206
206
  "text",
207
207
  {
208
- x: m + b / 2,
209
- y: d - 8,
208
+ x: u + b / 2,
209
+ y: c - 8,
210
210
  textAnchor: "middle",
211
211
  className: "fill-primary text-xs font-medium tabular-nums",
212
- children: l(c)
212
+ children: o(d)
213
213
  }
214
214
  );
215
215
  }
216
- function j({
216
+ function G({
217
217
  active: t,
218
218
  payload: n,
219
219
  label: r,
220
220
  format: i,
221
- labelKey: o,
221
+ labelKey: l,
222
222
  renderer: a
223
223
  }) {
224
- var b, v;
225
- const l = (n ?? []).map((f, p) => {
226
- const M = f.payload && typeof f.payload == "object" ? f.payload : void 0;
224
+ var b, g;
225
+ const o = (n ?? []).map((h, N) => {
226
+ const M = h.payload && typeof h.payload == "object" ? h.payload : void 0;
227
227
  return {
228
- key: f.dataKey ?? p,
229
- name: f.name ?? f.dataKey ?? p,
230
- value: f.value,
231
- color: f.color,
228
+ key: h.dataKey ?? N,
229
+ name: h.name ?? h.dataKey ?? N,
230
+ value: h.value,
231
+ color: h.color,
232
232
  datum: M
233
233
  };
234
- }), h = o ? (v = (b = l[0]) == null ? void 0 : b.datum) == null ? void 0 : v[o] : void 0, c = {
234
+ }), f = l ? (g = (b = o[0]) == null ? void 0 : b.datum) == null ? void 0 : g[l] : void 0, d = {
235
235
  active: !!t,
236
- label: typeof h == "string" || typeof h == "number" ? h : r,
237
- items: l,
236
+ label: typeof f == "string" || typeof f == "number" ? f : r,
237
+ items: o,
238
238
  formatValue: i
239
239
  };
240
- if (a) return /* @__PURE__ */ e(oe, { children: a(c) });
241
- if (!c.active || !l.length) return null;
242
- const m = l.length === 1, d = c.label ?? (m ? l[0].name : void 0);
243
- return /* @__PURE__ */ w("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
244
- /* @__PURE__ */ e("div", { className: D("text-xs font-normal tracking-wide uppercase text-background/60", !m && "mb-1"), children: d }),
245
- l.map((f) => /* @__PURE__ */ w("div", { className: "flex items-center gap-1.5", children: [
246
- !m && /* @__PURE__ */ w(oe, { children: [
247
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: f.color } }),
248
- /* @__PURE__ */ e("span", { className: "text-background/70", children: f.name })
240
+ if (a) return /* @__PURE__ */ e(ce, { children: a(d) });
241
+ if (!d.active || !o.length) return null;
242
+ const u = o.length === 1, c = d.label ?? (u ? o[0].name : void 0);
243
+ return /* @__PURE__ */ A("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
244
+ /* @__PURE__ */ e("div", { className: I("text-xs font-normal tracking-wide uppercase text-background/60", !u && "mb-1"), children: c }),
245
+ o.map((h) => /* @__PURE__ */ A("div", { className: "flex items-center gap-1.5", children: [
246
+ !u && /* @__PURE__ */ A(ce, { children: [
247
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: h.color } }),
248
+ /* @__PURE__ */ e("span", { className: "text-background/70", children: h.name })
249
249
  ] }),
250
- /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-normal tabular-nums", children: typeof f.value == "number" ? i(f.value) : String(f.value ?? "") })
251
- ] }, f.key))
250
+ /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-normal tabular-nums", children: typeof h.value == "number" ? i(h.value) : String(h.value ?? "") })
251
+ ] }, h.key))
252
252
  ] });
253
253
  }
254
- const Re = "pointer-events-none inline-flex min-h-4 items-center rounded-full px-2 py-0.5 text-xs font-normal whitespace-nowrap";
255
- function lt({
254
+ const Te = "pointer-events-none inline-flex min-h-4 items-center rounded-full px-2 py-0.5 text-xs font-normal whitespace-nowrap";
255
+ function st({
256
256
  viewBox: t,
257
257
  label: n,
258
258
  value: r,
259
259
  color: i,
260
- axis: o
260
+ axis: l
261
261
  }) {
262
- const a = t ?? {}, l = /* @__PURE__ */ w("span", { className: D(Re, Y[i].pill), children: [
262
+ const a = t ?? {}, o = /* @__PURE__ */ A("span", { className: I(Te, V[i].pill), children: [
263
263
  n,
264
264
  r != null && /* @__PURE__ */ e("span", { className: "ml-1 tabular-nums", children: r })
265
265
  ] });
266
- return o === "y" ? /* @__PURE__ */ e("foreignObject", { x: a.x ?? 0, y: (a.y ?? 0) - 12, width: a.width ?? 0, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: l }) }) : /* @__PURE__ */ e("foreignObject", { x: (a.x ?? 0) - 90, y: (a.y ?? 0) - 12, width: 180, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: l }) });
266
+ return l === "y" ? /* @__PURE__ */ e("foreignObject", { x: a.x ?? 0, y: (a.y ?? 0) - 12, width: a.width ?? 0, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: o }) }) : /* @__PURE__ */ e("foreignObject", { x: (a.x ?? 0) - 90, y: (a.y ?? 0) - 12, width: 180, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: o }) });
267
267
  }
268
- function ot({ viewBox: t, label: n, color: r }) {
268
+ function ct({ viewBox: t, label: n, color: r }) {
269
269
  const i = t ?? {};
270
- return /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: i.y ?? 0, width: i.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: D(Re, Y[r].pill), children: n }) }) });
270
+ return /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: i.y ?? 0, width: i.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: I(Te, V[r].pill), children: n }) }) });
271
271
  }
272
- function st({
272
+ function dt({
273
273
  cx: t,
274
274
  cy: n,
275
275
  n: r,
276
276
  ann: i,
277
- onEnter: o,
277
+ onEnter: l,
278
278
  onLeave: a
279
279
  }) {
280
- const [l, h] = C.useState(!1);
280
+ const [o, f] = C.useState(!1);
281
281
  if (t == null || n == null || !Number.isFinite(t) || !Number.isFinite(n)) return /* @__PURE__ */ e("g", {});
282
- const c = () => o({ ann: i, n: r, cx: t, cy: n }), m = () => a();
283
- return /* @__PURE__ */ w(
282
+ const d = () => l({ ann: i, n: r, cx: t, cy: n }), u = () => a();
283
+ return /* @__PURE__ */ A(
284
284
  "g",
285
285
  {
286
286
  tabIndex: 0,
287
287
  role: "img",
288
288
  "aria-label": `Annotation ${r}: ${i.label}`,
289
289
  className: "cursor-default outline-none [transform-box:fill-box] origin-center transition-transform ease-out [transition-duration:150ms] hover:scale-110 focus-visible:scale-110 motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100",
290
- onMouseEnter: c,
291
- onMouseLeave: m,
290
+ onMouseEnter: d,
291
+ onMouseLeave: u,
292
292
  onFocus: () => {
293
- h(!0), c();
293
+ f(!0), d();
294
294
  },
295
295
  onBlur: () => {
296
- h(!1), m();
296
+ f(!1), u();
297
297
  },
298
298
  children: [
299
- l && /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
299
+ o && /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
300
300
  /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 10, fill: "var(--background)" }),
301
- /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 8, fill: Y[i.color ?? "primary"].ref }),
301
+ /* @__PURE__ */ e("circle", { cx: t, cy: n, r: 8, fill: V[i.color ?? "primary"].ref }),
302
302
  /* @__PURE__ */ e(
303
303
  "text",
304
304
  {
@@ -314,8 +314,8 @@ function st({
314
314
  }
315
315
  );
316
316
  }
317
- function ct({ hovered: t, frameWidth: n, format: r }) {
318
- return /* @__PURE__ */ e(Qe, { reducedMotion: "user", children: /* @__PURE__ */ e(qe, { children: t && /* @__PURE__ */ e(
317
+ function ut({ hovered: t, frameWidth: n, format: r }) {
318
+ return /* @__PURE__ */ e(Je, { reducedMotion: "user", children: /* @__PURE__ */ e(Ke, { children: t && /* @__PURE__ */ e(
319
319
  "div",
320
320
  {
321
321
  className: "pointer-events-none absolute z-10",
@@ -323,29 +323,29 @@ function ct({ hovered: t, frameWidth: n, format: r }) {
323
323
  left: Math.max(96, Math.min(t.cx, Math.max(n - 96, 96))),
324
324
  top: t.cy - 16
325
325
  },
326
- children: /* @__PURE__ */ w(
327
- Je.div,
326
+ children: /* @__PURE__ */ A(
327
+ et.div,
328
328
  {
329
- variants: Ke,
329
+ variants: tt,
330
330
  initial: "hidden",
331
331
  animate: "visible",
332
332
  exit: "hidden",
333
333
  className: "w-max max-w-60 -translate-x-1/2 -translate-y-full origin-bottom rounded-lg bg-elevated p-3",
334
334
  children: [
335
- /* @__PURE__ */ w("div", { className: "flex items-center gap-2", children: [
335
+ /* @__PURE__ */ A("div", { className: "flex items-center gap-2", children: [
336
336
  /* @__PURE__ */ e(
337
337
  "span",
338
338
  {
339
339
  "aria-hidden": !0,
340
340
  className: "flex size-4.5 shrink-0 items-center justify-center rounded-full text-s font-medium text-brand-foreground",
341
- style: { background: Y[t.ann.color ?? "primary"].ref },
341
+ style: { background: V[t.ann.color ?? "primary"].ref },
342
342
  children: t.n
343
343
  }
344
344
  ),
345
345
  /* @__PURE__ */ e("span", { className: "text-xs font-normal text-foreground", children: t.ann.label })
346
346
  ] }),
347
347
  t.ann.description && /* @__PURE__ */ e("p", { className: "mt-1.5 text-xs leading-relaxed text-secondary", children: t.ann.description }),
348
- /* @__PURE__ */ w("div", { className: "mt-1.5 text-xs font-normal tracking-wide uppercase text-tertiary tabular-nums", children: [
348
+ /* @__PURE__ */ A("div", { className: "mt-1.5 text-xs font-normal tracking-wide uppercase text-tertiary tabular-nums", children: [
349
349
  t.ann.x,
350
350
  " · ",
351
351
  r(t.ann.y)
@@ -356,46 +356,46 @@ function ct({ hovered: t, frameWidth: n, format: r }) {
356
356
  }
357
357
  ) }) });
358
358
  }
359
- function Le(t, n) {
360
- const [r, i] = C.useState(null), o = C.useCallback(() => i(null), []), { back: a, front: l } = C.useMemo(() => {
361
- const h = [], c = [];
362
- let m = 0;
363
- return (t ?? []).forEach((d, b) => {
364
- const v = d.color ?? "primary";
365
- if (d.kind === "band") {
366
- const f = d.axis ?? "y";
367
- h.push(
359
+ function Fe(t, n) {
360
+ const [r, i] = C.useState(null), l = C.useCallback(() => i(null), []), { back: a, front: o } = C.useMemo(() => {
361
+ const f = [], d = [];
362
+ let u = 0;
363
+ return (t ?? []).forEach((c, b) => {
364
+ const g = c.color ?? "primary";
365
+ if (c.kind === "band") {
366
+ const h = c.axis ?? "y";
367
+ f.push(
368
368
  /* @__PURE__ */ e(
369
- Ye,
369
+ Ze,
370
370
  {
371
- ...f === "y" ? { y1: d.from, y2: d.to } : { x1: d.from, x2: d.to },
372
- fill: Y[v].ref,
371
+ ...h === "y" ? { y1: c.from, y2: c.to } : { x1: c.from, x2: c.to },
372
+ fill: V[g].ref,
373
373
  fillOpacity: 0.06,
374
374
  stroke: "none",
375
- ifOverflow: f === "y" ? "extendDomain" : "visible",
376
- label: d.label ? /* @__PURE__ */ e(ot, { label: d.label, color: v }) : void 0
375
+ ifOverflow: h === "y" ? "extendDomain" : "visible",
376
+ label: c.label ? /* @__PURE__ */ e(ct, { label: c.label, color: g }) : void 0
377
377
  },
378
378
  `ann-${b}`
379
379
  )
380
380
  );
381
- } else if (d.kind === "line") {
382
- const f = d.axis ?? "y";
383
- c.push(
381
+ } else if (c.kind === "line") {
382
+ const h = c.axis ?? "y";
383
+ d.push(
384
384
  /* @__PURE__ */ e(
385
- Xe,
385
+ Qe,
386
386
  {
387
- ...f === "y" ? { y: d.value } : { x: d.value },
388
- stroke: Y[v].ref,
387
+ ...h === "y" ? { y: c.value } : { x: c.value },
388
+ stroke: V[g].ref,
389
389
  strokeWidth: 1,
390
390
  strokeDasharray: "4 4",
391
- ifOverflow: f === "y" ? "extendDomain" : "visible",
392
- label: d.label ? /* @__PURE__ */ e(
393
- lt,
391
+ ifOverflow: h === "y" ? "extendDomain" : "visible",
392
+ label: c.label ? /* @__PURE__ */ e(
393
+ st,
394
394
  {
395
- label: d.label,
396
- value: typeof d.value == "number" ? n(d.value) : String(d.value),
397
- color: v,
398
- axis: f
395
+ label: c.label,
396
+ value: typeof c.value == "number" ? n(c.value) : String(c.value),
397
+ color: g,
398
+ axis: h
399
399
  }
400
400
  ) : void 0
401
401
  },
@@ -403,45 +403,45 @@ function Le(t, n) {
403
403
  )
404
404
  );
405
405
  } else {
406
- m += 1;
407
- const f = m;
408
- c.push(
406
+ u += 1;
407
+ const h = u;
408
+ d.push(
409
409
  /* @__PURE__ */ e(
410
- Ze,
410
+ qe,
411
411
  {
412
- x: d.x,
413
- y: d.y,
412
+ x: c.x,
413
+ y: c.y,
414
414
  ifOverflow: "visible",
415
- shape: (p) => /* @__PURE__ */ e(st, { cx: p.cx, cy: p.cy, n: f, ann: d, onEnter: i, onLeave: o })
415
+ shape: (N) => /* @__PURE__ */ e(dt, { cx: N.cx, cy: N.cy, n: h, ann: c, onEnter: i, onLeave: l })
416
416
  },
417
417
  `ann-${b}`
418
418
  )
419
419
  );
420
420
  }
421
- }), { back: h, front: c };
422
- }, [t, n, o]);
423
- return { back: a, front: l, hovered: r };
421
+ }), { back: f, front: d };
422
+ }, [t, n, l]);
423
+ return { back: a, front: o, hovered: r };
424
424
  }
425
- function Q({
425
+ function q({
426
426
  items: t,
427
427
  align: n = "end",
428
428
  className: r,
429
429
  onToggle: i
430
430
  }) {
431
- const o = {
431
+ const l = {
432
432
  start: "justify-start",
433
433
  center: "justify-center",
434
434
  end: "justify-end"
435
435
  }[n];
436
- return /* @__PURE__ */ e("div", { className: D("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", o, r), children: t.map(
437
- (a) => i && a.key !== void 0 ? /* @__PURE__ */ w(
436
+ return /* @__PURE__ */ e("div", { className: I("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", l, r), children: t.map(
437
+ (a) => i && a.key !== void 0 ? /* @__PURE__ */ A(
438
438
  "button",
439
439
  {
440
440
  type: "button",
441
441
  "aria-pressed": !a.hidden,
442
442
  "aria-label": `Toggle ${a.label} series`,
443
443
  onClick: () => i(a.key),
444
- className: D(
444
+ className: I(
445
445
  "inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-s outline-none",
446
446
  "transition-colors duration-150 ease-out motion-reduce:transition-none",
447
447
  "focus-visible:ring-2 focus-visible:ring-ring",
@@ -452,7 +452,7 @@ function Q({
452
452
  "span",
453
453
  {
454
454
  "aria-hidden": !0,
455
- className: D(
455
+ className: I(
456
456
  "size-2 rounded-dot transition-opacity duration-150 ease-out motion-reduce:transition-none",
457
457
  a.hidden && "opacity-25"
458
458
  ),
@@ -463,313 +463,334 @@ function Q({
463
463
  ]
464
464
  },
465
465
  a.label
466
- ) : /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5 text-s text-secondary", children: [
466
+ ) : /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1.5 text-s text-secondary", children: [
467
467
  /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: a.color } }),
468
468
  a.label
469
469
  ] }, a.label)
470
470
  ) });
471
471
  }
472
- const Z = C.forwardRef(
472
+ const X = C.forwardRef(
473
473
  ({
474
474
  className: t,
475
475
  height: n,
476
476
  legendItems: r,
477
477
  title: i,
478
- subtitle: o,
478
+ subtitle: l,
479
479
  legendPlacement: a,
480
- hovered: l,
481
- format: h,
482
- onLegendToggle: c,
483
- hoverRef: m,
484
- children: d,
480
+ hovered: o,
481
+ format: f,
482
+ onLegendToggle: d,
483
+ hoverRef: u,
484
+ children: c,
485
485
  ...b
486
- }, v) => {
487
- var u;
488
- const f = C.useRef(null), p = (g) => {
489
- f.current = g, m && (m.current = g), typeof v == "function" ? v(g) : v && (v.current = g);
490
- }, M = i != null || o != null, x = (a ?? (M ? "header" : "top")) === "header" && r != null;
491
- return /* @__PURE__ */ w("div", { ref: p, className: D("relative w-full font-sans", t), ...b, children: [
492
- (M || x) && // The header row: title block leads, the legend trails on the same
486
+ }, g) => {
487
+ var m;
488
+ const h = C.useRef(null), N = (x) => {
489
+ h.current = x, u && (u.current = x), typeof g == "function" ? g(x) : g && (g.current = x);
490
+ }, M = i != null || l != null, p = (a ?? (M ? "header" : "top")) === "header" && r != null;
491
+ return /* @__PURE__ */ A("div", { ref: N, className: I("relative w-full font-sans", t), ...b, children: [
492
+ (M || p) && // The header row: title block leads, the legend trails on the same
493
493
  // row. 36px separates the header block from the plot.
494
- /* @__PURE__ */ w(
494
+ /* @__PURE__ */ A(
495
495
  "div",
496
496
  {
497
497
  "data-slot": "chart-header",
498
- className: D(
498
+ className: I(
499
499
  "flex flex-wrap items-start gap-x-6 gap-y-2",
500
500
  M ? "justify-between" : "justify-end",
501
- x ? "mb-9" : "mb-3"
501
+ p ? "mb-9" : "mb-3"
502
502
  ),
503
503
  children: [
504
- M && /* @__PURE__ */ w("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
505
- i != null && /* @__PURE__ */ e("div", { className: "text-l font-medium text-on-white-primary", children: i }),
506
- o != null && /* @__PURE__ */ e("div", { className: "text-s text-on-white-secondary", children: o })
504
+ M && /* @__PURE__ */ A("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
505
+ i != null && /* @__PURE__ */ e("div", { className: "font-heading text-l font-medium text-on-white-primary", children: i }),
506
+ l != null && /* @__PURE__ */ e("div", { className: "text-s text-on-white-secondary", children: l })
507
507
  ] }),
508
- x && r && /* @__PURE__ */ e(Q, { items: r, onToggle: c, className: "mb-0 pt-1" })
508
+ p && r && /* @__PURE__ */ e(q, { items: r, onToggle: d, className: "mb-0 pt-1" })
509
509
  ]
510
510
  }
511
511
  ),
512
- r && !x && /* @__PURE__ */ e(Q, { items: r, onToggle: c }),
513
- /* @__PURE__ */ e(q, { width: "100%", height: Math.max(n, P), children: d }),
514
- /* @__PURE__ */ e(ct, { hovered: l, frameWidth: ((u = f.current) == null ? void 0 : u.clientWidth) ?? 0, format: h })
512
+ r && !p && /* @__PURE__ */ e(q, { items: r, onToggle: d }),
513
+ /* @__PURE__ */ e(J, { width: "100%", height: Math.max(n, P), children: c }),
514
+ /* @__PURE__ */ e(ut, { hovered: o, frameWidth: ((m = h.current) == null ? void 0 : m.clientWidth) ?? 0, format: f })
515
515
  ] });
516
516
  }
517
517
  );
518
- Z.displayName = "ChartFrame";
519
- function ie(t) {
518
+ X.displayName = "ChartFrame";
519
+ function oe(t) {
520
520
  const {
521
521
  data: n,
522
522
  categoryKey: r,
523
523
  series: i,
524
- seriesLabels: o,
524
+ seriesLabels: l,
525
525
  highlight: a,
526
- annotations: l,
527
- grid: h = !1,
528
- legend: c,
529
- showYAxis: m = !0,
530
- formatValue: d,
526
+ annotations: o,
527
+ grid: f = !1,
528
+ legend: d,
529
+ showYAxis: u = !0,
530
+ formatValue: c,
531
531
  xScale: b = "category",
532
- xDomain: v,
533
- yDomain: f,
534
- xTickFormatter: p,
532
+ xDomain: g,
533
+ yDomain: h,
534
+ xTickFormatter: N,
535
535
  yTickFormatter: M,
536
- yAxisWidth: y = 44,
537
- title: x,
538
- subtitle: u,
539
- legendPlacement: g
540
- } = t, S = { title: x, subtitle: u, legendPlacement: g }, $ = C.useMemo(() => i ?? ye(n, r), [i, n, r]), R = d ?? _, s = M ?? ((T) => typeof T == "number" ? R(T) : T), O = Le(l, R), A = (T, G) => a && $.includes(a) ? T === a ? "var(--color-chart-1)" : re : ne(G), I = (T) => (o == null ? void 0 : o[T]) ?? T, [L, E] = C.useState(
536
+ yAxisWidth: R = 44,
537
+ title: p,
538
+ subtitle: m,
539
+ legendPlacement: x
540
+ } = t, y = { title: p, subtitle: m, legendPlacement: x }, L = C.useMemo(() => i ?? $e(n, r), [i, n, r]), $ = c ?? k, s = M ?? ((S) => typeof S == "number" ? $(S) : S), O = Fe(o, $), w = (S, H) => a && L.includes(a) ? S === a ? "var(--color-chart-1)" : ie : ae(H), F = (S) => (l == null ? void 0 : l[S]) ?? S, [T, D] = C.useState(
541
541
  () => /* @__PURE__ */ new Set()
542
- ), N = C.useCallback((T) => {
543
- E((G) => {
544
- const H = new Set(G);
545
- return H.has(T) ? H.delete(T) : H.add(T), H;
542
+ ), _ = C.useCallback((S) => {
543
+ D((H) => {
544
+ const B = new Set(H);
545
+ return B.has(S) ? B.delete(S) : B.add(S), B;
546
546
  });
547
- }, []), F = (T) => L.has(T), B = c ?? $.length > 1 ? $.map((T, G) => ({
548
- key: T,
549
- label: I(T),
550
- color: A(T, G),
551
- hidden: L.has(T)
547
+ }, []), E = (S) => T.has(S), Z = d ?? L.length > 1 ? L.map((S, H) => ({
548
+ key: S,
549
+ label: F(S),
550
+ color: w(S, H),
551
+ hidden: T.has(S)
552
552
  })) : null;
553
553
  return {
554
- names: $,
555
- format: R,
554
+ names: L,
555
+ format: $,
556
556
  layers: O,
557
- legendItems: B,
558
- header: S,
557
+ legendItems: Z,
558
+ header: y,
559
559
  furniture: [
560
560
  /* Gridlines one step below the border token — guides, not content. */
561
- h ? /* @__PURE__ */ e(ce, { vertical: !1, stroke: "var(--chart-grid)" }, "grid") : null,
561
+ f ? /* @__PURE__ */ e(ue, { vertical: !1, stroke: "var(--chart-grid)" }, "grid") : null,
562
562
  /* @__PURE__ */ e(
563
- de,
563
+ me,
564
564
  {
565
565
  dataKey: r,
566
566
  type: b === "time" ? "number" : "category",
567
567
  scale: b === "time" ? "time" : "auto",
568
- domain: b === "time" ? v ?? ["dataMin", "dataMax"] : v,
569
- allowDataOverflow: !!v,
568
+ domain: b === "time" ? g ?? ["dataMin", "dataMax"] : g,
569
+ allowDataOverflow: !!g,
570
570
  axisLine: { stroke: "var(--chart-axis)" },
571
571
  tickLine: !1,
572
572
  minTickGap: 28,
573
573
  tickMargin: 24,
574
574
  padding: { left: 16, right: 16 },
575
575
  height: 40,
576
- tick: /* @__PURE__ */ e(V, { anchor: "middle", dy: 0, format: p })
576
+ tick: /* @__PURE__ */ e(W, { anchor: "middle", dy: 0, format: N })
577
577
  },
578
578
  "x"
579
579
  ),
580
- m ? /* @__PURE__ */ e(
581
- ee,
580
+ u ? /* @__PURE__ */ e(
581
+ ne,
582
582
  {
583
- width: y,
584
- domain: f,
585
- allowDataOverflow: !!f,
583
+ width: R,
584
+ domain: h,
585
+ allowDataOverflow: !!h,
586
586
  axisLine: { stroke: "var(--chart-axis)" },
587
587
  tickLine: !1,
588
588
  tickMargin: 12,
589
- tick: /* @__PURE__ */ e(V, { anchor: "end", dy: "0.32em", format: s })
589
+ tick: /* @__PURE__ */ e(W, { anchor: "end", dy: "0.32em", format: s })
590
590
  },
591
591
  "y"
592
592
  ) : null
593
593
  ],
594
- colorFor: A,
595
- labelFor: I,
596
- toggleSeries: N,
597
- isHidden: F
594
+ colorFor: w,
595
+ labelFor: F,
596
+ toggleSeries: _,
597
+ isHidden: E
598
598
  };
599
599
  }
600
- const P = 300, J = { top: 24, right: 12, bottom: 8, left: 0 };
601
- function ue(t, n, r, i) {
600
+ const P = 300, K = { top: 24, right: 12, bottom: 8, left: 0 };
601
+ function fe(t, n, r, i) {
602
602
  if (i === !0) return new Set(t);
603
603
  if (i === !1) return /* @__PURE__ */ new Set();
604
604
  if (r && t.includes(r)) {
605
- const a = (n ?? []).filter((l) => l !== r);
605
+ const a = (n ?? []).filter((o) => o !== r);
606
606
  return /* @__PURE__ */ new Set([r, ...a]);
607
607
  }
608
608
  return t.filter((a) => !(n != null && n.includes(a))).length === 1 ? new Set(t) : /* @__PURE__ */ new Set();
609
609
  }
610
- function $e(t, n, r) {
610
+ function Ie(t, n, r) {
611
611
  return C.useCallback(
612
- (i, o) => {
613
- if (!(n != null && n.includes(i))) return r(i, o);
614
- const a = t.filter((h) => !n.includes(h)), l = a[n.indexOf(i)] ?? a[0];
615
- return l ? r(l, t.indexOf(l)) : r(i, o);
612
+ (i, l) => {
613
+ if (!(n != null && n.includes(i))) return r(i, l);
614
+ const a = t.filter((f) => !n.includes(f)), o = a[n.indexOf(i)] ?? a[0];
615
+ return o ? r(o, t.indexOf(o)) : r(i, l);
616
616
  },
617
617
  [t, n, r]
618
618
  );
619
619
  }
620
- const dt = C.forwardRef(
620
+ const mt = C.forwardRef(
621
621
  // Straight segments by default: the house line is a solid stroke with a DOT
622
622
  // at every observation — the data points are visible, the path connects them
623
623
  // without inventing values between them.
624
624
  // A smooth curve invents values between observations; opt back in with
625
625
  // `curve="natural"` when the interpolation is the point.
626
- ({ height: t = P, curve: n = "linear", forecastKeys: r, animatedSeriesKeys: i, showValues: o = !0, className: a, ...l }, h) => {
627
- const { names: c, format: m, layers: d, legendItems: b, header: v, furniture: f, colorFor: p, labelFor: M, toggleSeries: y, isHidden: x } = ie(l), u = $e(c, r, p), g = ue(c, r, l.highlight, o), S = Me(c, r), $ = new Set(c.filter((N) => !x(N)).map(S)), R = Ce(S, $.size > 1), { activeIndex: s } = R, O = (N) => {
628
- if (!(r != null && r.includes(N))) return;
629
- const F = S(N);
630
- if (F !== N)
631
- return (B) => {
632
- var T;
633
- const k = (T = l.data[B]) == null ? void 0 : T[F];
634
- return k != null && k !== "" && !x(F);
626
+ ({ height: t = P, curve: n = "linear", forecastKeys: r, animatedSeriesKeys: i, showValues: l = !0, gradientFill: a = !0, className: o, ...f }, d) => {
627
+ const { names: u, format: c, layers: b, legendItems: g, header: h, furniture: N, colorFor: M, labelFor: R, toggleSeries: p, isHidden: m } = oe(f), x = Ie(u, r, M), y = fe(u, r, f.highlight, l), L = C.useId().replace(/[^a-zA-Z0-9]/g, ""), $ = a ? u.filter((v) => !(r != null && r.includes(v))) : [], s = Le(u, r), O = new Set(u.filter((v) => !m(v)).map(s)), w = ye(s, O.size > 1), { activeIndex: F } = w, T = (v) => {
628
+ if (!(r != null && r.includes(v))) return;
629
+ const S = s(v);
630
+ if (S !== v)
631
+ return (H) => {
632
+ var Q;
633
+ const B = (Q = f.data[H]) == null ? void 0 : Q[S];
634
+ return B != null && B !== "" && !m(S);
635
635
  };
636
- }, A = c.filter((N) => g.has(N) && !x(N)), I = (N, F) => {
637
- var k;
638
- const B = (k = l.data[N]) == null ? void 0 : k[F];
639
- return typeof B == "number" && !Number.isNaN(B) ? B : null;
636
+ }, D = u.filter((v) => y.has(v) && !m(v)), _ = (v, S) => {
637
+ var B;
638
+ const H = (B = f.data[v]) == null ? void 0 : B[S];
639
+ return typeof H == "number" && !Number.isNaN(H) ? H : null;
640
640
  };
641
- let L = 0;
642
- for (let N = 0; N < l.data.length; N++)
643
- for (const F of A) L = Math.max(L, Math.abs(I(N, F) ?? 0));
644
- const E = (N) => {
645
- if (A.length < 2 || L === 0) return;
646
- const F = A.indexOf(N);
647
- return (B) => {
648
- const k = I(B, N);
649
- return k == null ? !1 : A.some((T, G) => {
650
- if (T === N) return !1;
651
- const H = I(B, T);
652
- return H == null ? !1 : (H > k || H === k && G < F) && (H - k) / L < 0.1;
641
+ let E = 0;
642
+ for (let v = 0; v < f.data.length; v++)
643
+ for (const S of D) E = Math.max(E, Math.abs(_(v, S) ?? 0));
644
+ const Z = (v) => {
645
+ if (D.length < 2 || E === 0) return;
646
+ const S = D.indexOf(v);
647
+ return (H) => {
648
+ const B = _(H, v);
649
+ return B == null ? !1 : D.some((Q, Ee) => {
650
+ if (Q === v) return !1;
651
+ const ee = _(H, Q);
652
+ return ee == null ? !1 : (ee > B || ee === B && Ee < S) && (ee - B) / E < 0.1;
653
653
  });
654
654
  };
655
655
  };
656
- return /* @__PURE__ */ e(Z, { ref: h, className: a, height: t, legendItems: b, ...v, hovered: d.hovered, format: m, onLegendToggle: y, hoverRef: R.frameRef, children: /* @__PURE__ */ w(Fe, { data: l.data, margin: J, ...R.handlers, children: [
657
- f,
658
- l.tooltip !== !1 && /* @__PURE__ */ e(
659
- z,
656
+ return /* @__PURE__ */ e(X, { ref: d, className: o, height: t, legendItems: g, ...h, hovered: b.hovered, format: c, onLegendToggle: p, hoverRef: w.frameRef, children: /* @__PURE__ */ A(pe, { data: f.data, margin: K, ...w.handlers, children: [
657
+ $.length > 0 && /* @__PURE__ */ e("defs", { children: $.map((v) => /* @__PURE__ */ A("linearGradient", { id: `${L}-${u.indexOf(v)}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
658
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: x(v, u.indexOf(v)), stopOpacity: 0.2 }),
659
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: x(v, u.indexOf(v)), stopOpacity: 0 })
660
+ ] }, v)) }),
661
+ N,
662
+ f.tooltip !== !1 && /* @__PURE__ */ e(
663
+ j,
660
664
  {
661
665
  content: /* @__PURE__ */ e(
662
- j,
666
+ G,
663
667
  {
664
- format: m,
665
- renderer: l.tooltip
668
+ format: c,
669
+ renderer: f.tooltip
666
670
  }
667
671
  ),
668
672
  cursor: !1,
669
673
  isAnimationActive: !1
670
674
  }
671
675
  ),
672
- d.back,
673
- c.map((N, F) => /* @__PURE__ */ e(
674
- be,
676
+ b.back,
677
+ $.map((v) => /* @__PURE__ */ e(
678
+ Ne,
675
679
  {
676
- dataKey: N,
677
- name: M(N),
680
+ dataKey: v,
678
681
  type: n,
679
- className: D(W, R.isDimmed(N) && "opacity-30"),
680
- stroke: u(N, F),
681
- strokeWidth: ae,
682
- strokeDasharray: r != null && r.includes(N) ? "6 4" : void 0,
683
- dot: /* @__PURE__ */ e(U, { color: u(N, F), seriesKey: N }),
684
- activeDot: R.isDimmed(N) ? !1 : /* @__PURE__ */ e(U, { color: u(N, F), active: !0 }),
685
- label: g.has(N) ? /* @__PURE__ */ e(
686
- Se,
682
+ className: I(z, w.isDimmed(v) && "opacity-30"),
683
+ stroke: "none",
684
+ fill: `url(#${L}-${u.indexOf(v)})`,
685
+ dot: !1,
686
+ activeDot: !1,
687
+ legendType: "none",
688
+ tooltipType: "none",
689
+ hide: m(v),
690
+ isAnimationActive: !1
691
+ },
692
+ `${v}-fill`
693
+ )),
694
+ u.map((v, S) => /* @__PURE__ */ e(
695
+ we,
696
+ {
697
+ dataKey: v,
698
+ name: R(v),
699
+ type: n,
700
+ className: I(z, w.isDimmed(v) && "opacity-30"),
701
+ stroke: x(v, S),
702
+ strokeWidth: le,
703
+ strokeDasharray: r != null && r.includes(v) ? "6 4" : void 0,
704
+ dot: /* @__PURE__ */ e(U, { color: x(v, S), seriesKey: v }),
705
+ activeDot: w.isDimmed(v) ? !1 : /* @__PURE__ */ e(U, { color: x(v, S), active: !0 }),
706
+ label: y.has(v) ? /* @__PURE__ */ e(
707
+ Oe,
687
708
  {
688
- color: Ne(u(N, F)) ? void 0 : u(N, F),
689
- format: m,
690
- hidden: s != null,
691
- skip: O(N),
692
- below: E(N)
709
+ color: Me(x(v, S)) ? void 0 : x(v, S),
710
+ format: c,
711
+ hidden: F != null,
712
+ skip: T(v),
713
+ below: Z(v)
693
714
  }
694
715
  ) : void 0,
695
- hide: x(N),
696
- isAnimationActive: (i == null ? void 0 : i.includes(N)) ?? !1
716
+ hide: m(v),
717
+ isAnimationActive: (i == null ? void 0 : i.includes(v)) ?? !1
697
718
  },
698
- N
719
+ v
699
720
  )),
700
- d.front
721
+ b.front
701
722
  ] }) });
702
723
  }
703
724
  );
704
- dt.displayName = "LineChart";
705
- const ut = C.forwardRef(
706
- ({ height: t = P, curve: n = "linear", stacked: r = !1, forecastKeys: i, showValues: o, className: a, ...l }, h) => {
707
- const { names: c, format: m, layers: d, legendItems: b, header: v, furniture: f, colorFor: p, labelFor: M, toggleSeries: y, isHidden: x } = ie(l), u = $e(c, i, p), g = r ? /* @__PURE__ */ new Set() : ue(c, i, l.highlight, o), S = Me(c, i), $ = new Set(c.filter((A) => !x(A)).map(S)), R = Ce(S, $.size > 1), { activeIndex: s } = R, O = C.useId().replace(/[^a-zA-Z0-9]/g, "");
708
- return /* @__PURE__ */ e(Z, { ref: h, className: a, height: t, legendItems: b, ...v, hovered: d.hovered, format: m, onLegendToggle: y, hoverRef: R.frameRef, children: /* @__PURE__ */ w(Te, { data: l.data, margin: J, ...R.handlers, children: [
709
- /* @__PURE__ */ e("defs", { children: c.map((A, I) => /* @__PURE__ */ w("linearGradient", { id: `${O}-${I}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
710
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: p(A, I), stopOpacity: 0.18 }),
711
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: p(A, I), stopOpacity: 0.02 })
712
- ] }, A)) }),
713
- f,
714
- l.tooltip !== !1 && /* @__PURE__ */ e(
715
- z,
725
+ mt.displayName = "LineChart";
726
+ const ft = C.forwardRef(
727
+ ({ height: t = P, curve: n = "linear", stacked: r = !1, forecastKeys: i, showValues: l, className: a, ...o }, f) => {
728
+ const { names: d, format: u, layers: c, legendItems: b, header: g, furniture: h, colorFor: N, labelFor: M, toggleSeries: R, isHidden: p } = oe(o), m = Ie(d, i, N), x = r ? /* @__PURE__ */ new Set() : fe(d, i, o.highlight, l), y = Le(d, i), L = new Set(d.filter((w) => !p(w)).map(y)), $ = ye(y, L.size > 1), { activeIndex: s } = $, O = C.useId().replace(/[^a-zA-Z0-9]/g, "");
729
+ return /* @__PURE__ */ e(X, { ref: f, className: a, height: t, legendItems: b, ...g, hovered: c.hovered, format: u, onLegendToggle: R, hoverRef: $.frameRef, children: /* @__PURE__ */ A(Be, { data: o.data, margin: K, ...$.handlers, children: [
730
+ /* @__PURE__ */ e("defs", { children: d.map((w, F) => /* @__PURE__ */ A("linearGradient", { id: `${O}-${F}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
731
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: N(w, F), stopOpacity: 0.18 }),
732
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: N(w, F), stopOpacity: 0.02 })
733
+ ] }, w)) }),
734
+ h,
735
+ o.tooltip !== !1 && /* @__PURE__ */ e(
736
+ j,
716
737
  {
717
738
  content: /* @__PURE__ */ e(
718
- j,
739
+ G,
719
740
  {
720
- format: m,
721
- renderer: l.tooltip
741
+ format: u,
742
+ renderer: o.tooltip
722
743
  }
723
744
  ),
724
745
  cursor: !1,
725
746
  isAnimationActive: !1
726
747
  }
727
748
  ),
728
- d.back,
729
- c.map((A, I) => /* @__PURE__ */ e(
730
- Ie,
749
+ c.back,
750
+ d.map((w, F) => /* @__PURE__ */ e(
751
+ Ne,
731
752
  {
732
- dataKey: A,
733
- name: M(A),
753
+ dataKey: w,
754
+ name: M(w),
734
755
  type: n,
735
- className: D(W, R.isDimmed(A) && "opacity-30"),
756
+ className: I(z, $.isDimmed(w) && "opacity-30"),
736
757
  stackId: r ? "stack" : void 0,
737
- stroke: u(A, I),
738
- strokeWidth: ae,
739
- strokeDasharray: i != null && i.includes(A) ? "6 4" : void 0,
740
- fill: `url(#${O}-${I})`,
741
- dot: /* @__PURE__ */ e(U, { color: u(A, I), seriesKey: A }),
742
- activeDot: R.isDimmed(A) ? !1 : /* @__PURE__ */ e(U, { color: u(A, I), active: !0 }),
743
- label: g.has(A) ? /* @__PURE__ */ e(Se, { color: u(A, I), format: m, hidden: s != null }) : void 0,
744
- hide: x(A),
758
+ stroke: m(w, F),
759
+ strokeWidth: le,
760
+ strokeDasharray: i != null && i.includes(w) ? "6 4" : void 0,
761
+ fill: `url(#${O}-${F})`,
762
+ dot: /* @__PURE__ */ e(U, { color: m(w, F), seriesKey: w }),
763
+ activeDot: $.isDimmed(w) ? !1 : /* @__PURE__ */ e(U, { color: m(w, F), active: !0 }),
764
+ label: x.has(w) ? /* @__PURE__ */ e(Oe, { color: m(w, F), format: u, hidden: s != null }) : void 0,
765
+ hide: p(w),
745
766
  isAnimationActive: !1
746
767
  },
747
- A
768
+ w
748
769
  )),
749
- d.front
770
+ c.front
750
771
  ] }) });
751
772
  }
752
773
  );
753
- ut.displayName = "AreaChart";
754
- const mt = C.forwardRef(
774
+ ft.displayName = "AreaChart";
775
+ const ht = C.forwardRef(
755
776
  ({
756
777
  height: t = P,
757
778
  stacked: n = !1,
758
779
  layout: r = "vertical",
759
780
  showValues: i = !0,
760
- className: o,
781
+ className: l,
761
782
  ...a
762
- }, l) => {
763
- const { names: h, format: c, layers: m, legendItems: d, header: b, furniture: v, colorFor: f, labelFor: p, toggleSeries: M, isHidden: y } = ie(a), x = r === "horizontal", u = n ? /* @__PURE__ */ new Set() : ue(h, void 0, a.highlight, i), g = h.filter((L) => !y(L)), S = n ? g[g.length - 1] : void 0, $ = a.data.map((L) => {
764
- let E = null;
765
- for (const N of g) {
766
- const F = L[N];
767
- typeof F == "number" && !Number.isNaN(F) && (E = (E ?? 0) + F);
783
+ }, o) => {
784
+ const { names: f, format: d, layers: u, legendItems: c, header: b, furniture: g, colorFor: h, labelFor: N, toggleSeries: M, isHidden: R } = oe(a), p = r === "horizontal", m = n ? /* @__PURE__ */ new Set() : fe(f, void 0, a.highlight, i), x = f.filter((T) => !R(T)), y = n ? x[x.length - 1] : void 0, L = a.data.map((T) => {
785
+ let D = null;
786
+ for (const _ of x) {
787
+ const E = T[_];
788
+ typeof E == "number" && !Number.isNaN(E) && (D = (D ?? 0) + E);
768
789
  }
769
- return E;
770
- }), R = a.xTickFormatter ?? ((L) => typeof L == "number" ? c(L) : L), s = [
790
+ return D;
791
+ }), $ = a.xTickFormatter ?? ((T) => typeof T == "number" ? d(T) : T), s = [
771
792
  a.grid !== !1 ? /* @__PURE__ */ e(
772
- ce,
793
+ ue,
773
794
  {
774
795
  horizontal: !1,
775
796
  vertical: !0,
@@ -778,7 +799,7 @@ const mt = C.forwardRef(
778
799
  "grid"
779
800
  ) : null,
780
801
  /* @__PURE__ */ e(
781
- de,
802
+ me,
782
803
  {
783
804
  type: "number",
784
805
  domain: a.xDomain,
@@ -787,12 +808,12 @@ const mt = C.forwardRef(
787
808
  tickLine: !1,
788
809
  minTickGap: 28,
789
810
  tickMargin: 10,
790
- tick: /* @__PURE__ */ e(V, { anchor: "middle", dy: 0, format: R })
811
+ tick: /* @__PURE__ */ e(W, { anchor: "middle", dy: 0, format: $ })
791
812
  },
792
813
  "x"
793
814
  ),
794
815
  a.showYAxis !== !1 ? /* @__PURE__ */ e(
795
- ee,
816
+ ne,
796
817
  {
797
818
  type: "category",
798
819
  dataKey: a.categoryKey,
@@ -801,7 +822,7 @@ const mt = C.forwardRef(
801
822
  tickLine: !1,
802
823
  tickMargin: 6,
803
824
  tick: /* @__PURE__ */ e(
804
- V,
825
+ W,
805
826
  {
806
827
  anchor: "end",
807
828
  dy: "0.32em",
@@ -811,24 +832,24 @@ const mt = C.forwardRef(
811
832
  },
812
833
  "y"
813
834
  ) : null
814
- ], O = a.highlight && h.length === 1 && !h.includes(a.highlight) ? a.highlight : null, { activeIndex: A, handlers: I } = Ae();
815
- return /* @__PURE__ */ e(Z, { ref: l, className: o, height: t, legendItems: d, ...b, hovered: m.hovered, format: c, onLegendToggle: M, children: /* @__PURE__ */ w(
816
- De,
835
+ ], O = a.highlight && f.length === 1 && !f.includes(a.highlight) ? a.highlight : null, { activeIndex: w, handlers: F } = Re();
836
+ return /* @__PURE__ */ e(X, { ref: o, className: l, height: t, legendItems: c, ...b, hovered: u.hovered, format: d, onLegendToggle: M, children: /* @__PURE__ */ A(
837
+ He,
817
838
  {
818
839
  data: a.data,
819
- layout: x ? "vertical" : "horizontal",
820
- margin: J,
840
+ layout: p ? "vertical" : "horizontal",
841
+ margin: K,
821
842
  barCategoryGap: "24%",
822
- ...I,
843
+ ...F,
823
844
  children: [
824
- x ? s : v,
845
+ p ? s : g,
825
846
  a.tooltip !== !1 && /* @__PURE__ */ e(
826
- z,
847
+ j,
827
848
  {
828
849
  content: /* @__PURE__ */ e(
829
- j,
850
+ G,
830
851
  {
831
- format: c,
852
+ format: d,
832
853
  renderer: a.tooltip
833
854
  }
834
855
  ),
@@ -836,91 +857,91 @@ const mt = C.forwardRef(
836
857
  isAnimationActive: !1
837
858
  }
838
859
  ),
839
- m.back,
840
- h.map((L, E) => {
841
- const N = n ? L === S : !0, F = x ? [0, 4, 4, 0] : [4, 4, 0, 0];
842
- return /* @__PURE__ */ w(
843
- ge,
860
+ u.back,
861
+ f.map((T, D) => {
862
+ const _ = n ? T === y : !0, E = p ? [0, 4, 4, 0] : [4, 4, 0, 0];
863
+ return /* @__PURE__ */ A(
864
+ Ae,
844
865
  {
845
- dataKey: L,
846
- name: p(L),
866
+ dataKey: T,
867
+ name: N(T),
847
868
  stackId: n ? "stack" : void 0,
848
- fill: f(L, E),
849
- radius: N ? F : 0,
869
+ fill: h(T, D),
870
+ radius: _ ? E : 0,
850
871
  maxBarSize: 48,
851
- label: u.has(L) ? /* @__PURE__ */ e(rt, { format: c, horizontal: x }) : void 0,
852
- hide: y(L),
872
+ label: m.has(T) ? /* @__PURE__ */ e(it, { format: d, horizontal: p }) : void 0,
873
+ hide: R(T),
853
874
  isAnimationActive: !1,
854
875
  children: [
855
876
  n && i && /* @__PURE__ */ e(
856
- me,
877
+ he,
857
878
  {
858
- dataKey: L,
879
+ dataKey: T,
859
880
  content: /* @__PURE__ */ e(
860
- at,
881
+ lt,
861
882
  {
862
- format: c,
863
- horizontal: x,
864
- light: Ne(f(L, E))
883
+ format: d,
884
+ horizontal: p,
885
+ light: Me(h(T, D))
865
886
  }
866
887
  )
867
888
  }
868
889
  ),
869
- n && i && L === S && /* @__PURE__ */ e(
870
- me,
890
+ n && i && T === y && /* @__PURE__ */ e(
891
+ he,
871
892
  {
872
- dataKey: L,
893
+ dataKey: T,
873
894
  content: /* @__PURE__ */ e(
874
- it,
895
+ ot,
875
896
  {
876
- totals: $,
877
- format: c,
878
- horizontal: x
897
+ totals: L,
898
+ format: d,
899
+ horizontal: p
879
900
  }
880
901
  )
881
902
  }
882
903
  ),
883
- a.data.map((B, k) => /* @__PURE__ */ e(
884
- te,
904
+ a.data.map((Z, v) => /* @__PURE__ */ e(
905
+ re,
885
906
  {
886
- fill: O ? B[a.categoryKey] === O ? "var(--color-chart-1)" : re : f(L, E),
887
- className: W,
888
- opacity: X(k, A)
907
+ fill: O ? Z[a.categoryKey] === O ? "var(--color-chart-1)" : ie : h(T, D),
908
+ className: z,
909
+ opacity: Y(v, w)
889
910
  },
890
- k
911
+ v
891
912
  ))
892
913
  ]
893
914
  },
894
- L
915
+ T
895
916
  );
896
917
  }),
897
- m.front
918
+ u.front
898
919
  ]
899
920
  }
900
921
  ) });
901
922
  }
902
923
  );
903
- mt.displayName = "BarChart";
904
- const Oe = C.forwardRef(
905
- ({ height: t = P, lineKeys: n, dualAxis: r = !1, stacked: i = !1, forecastKeys: o, className: a, ...l }, h) => {
906
- const { names: c, format: m, layers: d, header: b, furniture: v, colorFor: f, labelFor: p, toggleSeries: M, isHidden: y } = ie(l), x = c.filter((s) => !n.includes(s)), u = (s, O) => n.length ? "var(--chart-axis)" : f(s, O), g = (s, O) => n.length ? "var(--color-chart-1)" : f(s, O), S = c.length > 1 ? [
907
- ...x.map((s) => ({
924
+ ht.displayName = "BarChart";
925
+ const De = C.forwardRef(
926
+ ({ height: t = P, lineKeys: n, dualAxis: r = !1, stacked: i = !1, forecastKeys: l, className: a, ...o }, f) => {
927
+ const { names: d, format: u, layers: c, header: b, furniture: g, colorFor: h, labelFor: N, toggleSeries: M, isHidden: R } = oe(o), p = d.filter((s) => !n.includes(s)), m = (s, O) => n.length ? "var(--chart-axis)" : h(s, O), x = (s, O) => n.length ? "var(--color-chart-1)" : h(s, O), y = d.length > 1 ? [
928
+ ...p.map((s) => ({
908
929
  key: s,
909
- label: p(s),
910
- color: u(s, c.indexOf(s)),
911
- hidden: y(s)
930
+ label: N(s),
931
+ color: m(s, d.indexOf(s)),
932
+ hidden: R(s)
912
933
  })),
913
934
  ...n.map((s) => ({
914
935
  key: s,
915
- label: p(s),
916
- color: g(s, c.indexOf(s)),
917
- hidden: y(s)
936
+ label: N(s),
937
+ color: x(s, d.indexOf(s)),
938
+ hidden: R(s)
918
939
  }))
919
- ] : null, { activeIndex: $, handlers: R } = Ae();
920
- return /* @__PURE__ */ e(Z, { ref: h, className: a, height: t, legendItems: S, ...b, hovered: d.hovered, format: m, onLegendToggle: M, children: /* @__PURE__ */ w(Ee, { data: l.data, margin: J, barCategoryGap: "24%", ...R, children: [
921
- v,
940
+ ] : null, { activeIndex: L, handlers: $ } = Re();
941
+ return /* @__PURE__ */ e(X, { ref: f, className: a, height: t, legendItems: y, ...b, hovered: c.hovered, format: u, onLegendToggle: M, children: /* @__PURE__ */ A(pe, { data: o.data, margin: K, barCategoryGap: "24%", ...$, children: [
942
+ g,
922
943
  r && /* @__PURE__ */ e(
923
- ee,
944
+ ne,
924
945
  {
925
946
  yAxisId: "right",
926
947
  orientation: "right",
@@ -929,144 +950,144 @@ const Oe = C.forwardRef(
929
950
  tickLine: !1,
930
951
  tickMargin: 6,
931
952
  tick: /* @__PURE__ */ e(
932
- V,
953
+ W,
933
954
  {
934
955
  anchor: "start",
935
956
  dy: "0.32em",
936
- format: (s) => typeof s == "number" ? m(s) : s
957
+ format: (s) => typeof s == "number" ? u(s) : s
937
958
  }
938
959
  )
939
960
  }
940
961
  ),
941
- l.tooltip !== !1 && /* @__PURE__ */ e(
942
- z,
962
+ o.tooltip !== !1 && /* @__PURE__ */ e(
963
+ j,
943
964
  {
944
965
  content: /* @__PURE__ */ e(
945
- j,
966
+ G,
946
967
  {
947
- format: m,
948
- renderer: l.tooltip
968
+ format: u,
969
+ renderer: o.tooltip
949
970
  }
950
971
  ),
951
972
  cursor: !1,
952
973
  isAnimationActive: !1
953
974
  }
954
975
  ),
955
- d.back,
956
- x.map((s) => {
957
- const O = c.indexOf(s), A = i ? s === x[x.length - 1] : !0;
976
+ c.back,
977
+ p.map((s) => {
978
+ const O = d.indexOf(s), w = i ? s === p[p.length - 1] : !0;
958
979
  return /* @__PURE__ */ e(
959
- ge,
980
+ Ae,
960
981
  {
961
982
  dataKey: s,
962
- name: p(s),
983
+ name: N(s),
963
984
  stackId: i ? "stack" : void 0,
964
- fill: u(s, O),
965
- radius: A ? [4, 4, 0, 0] : 0,
985
+ fill: m(s, O),
986
+ radius: w ? [4, 4, 0, 0] : 0,
966
987
  maxBarSize: 48,
967
- hide: y(s),
988
+ hide: R(s),
968
989
  isAnimationActive: !1,
969
- children: l.data.map((I, L) => /* @__PURE__ */ e(
970
- te,
990
+ children: o.data.map((F, T) => /* @__PURE__ */ e(
991
+ re,
971
992
  {
972
- fill: u(s, O),
973
- className: W,
974
- opacity: X(L, $)
993
+ fill: m(s, O),
994
+ className: z,
995
+ opacity: Y(T, L)
975
996
  },
976
- L
997
+ T
977
998
  ))
978
999
  },
979
1000
  s
980
1001
  );
981
1002
  }),
982
1003
  n.map((s) => {
983
- const O = c.indexOf(s);
1004
+ const O = d.indexOf(s);
984
1005
  return /* @__PURE__ */ e(
985
- be,
1006
+ we,
986
1007
  {
987
1008
  dataKey: s,
988
- name: p(s),
1009
+ name: N(s),
989
1010
  yAxisId: r ? "right" : void 0,
990
1011
  type: "linear",
991
- stroke: g(s, O),
992
- strokeWidth: ae,
993
- strokeDasharray: o != null && o.includes(s) ? "6 4" : void 0,
994
- dot: /* @__PURE__ */ e(U, { color: g(s, O) }),
995
- activeDot: /* @__PURE__ */ e(U, { color: g(s, O), active: !0 }),
996
- hide: y(s),
1012
+ stroke: x(s, O),
1013
+ strokeWidth: le,
1014
+ strokeDasharray: l != null && l.includes(s) ? "6 4" : void 0,
1015
+ dot: /* @__PURE__ */ e(U, { color: x(s, O) }),
1016
+ activeDot: /* @__PURE__ */ e(U, { color: x(s, O), active: !0 }),
1017
+ hide: R(s),
997
1018
  isAnimationActive: !1
998
1019
  },
999
1020
  s
1000
1021
  );
1001
1022
  }),
1002
- d.front
1023
+ c.front
1003
1024
  ] }) });
1004
1025
  }
1005
1026
  );
1006
- Oe.displayName = "ComboChart";
1007
- const ft = C.forwardRef(
1008
- (t, n) => /* @__PURE__ */ e(Oe, { ref: n, ...t })
1027
+ De.displayName = "ComboChart";
1028
+ const xt = C.forwardRef(
1029
+ (t, n) => /* @__PURE__ */ e(De, { ref: n, ...t })
1009
1030
  );
1010
- ft.displayName = "ComposedChart";
1011
- const ht = C.forwardRef(
1031
+ xt.displayName = "ComposedChart";
1032
+ const vt = C.forwardRef(
1012
1033
  ({
1013
1034
  data: t,
1014
1035
  xKey: n,
1015
1036
  yKey: r,
1016
1037
  labelKey: i,
1017
- annotations: o,
1038
+ annotations: l,
1018
1039
  height: a = P,
1019
- grid: l = !1,
1020
- showYAxis: h = !0,
1021
- formatValue: c,
1022
- xScale: m = "number",
1023
- xDomain: d,
1040
+ grid: o = !1,
1041
+ showYAxis: f = !0,
1042
+ formatValue: d,
1043
+ xScale: u = "number",
1044
+ xDomain: c,
1024
1045
  yDomain: b,
1025
- xTickFormatter: v,
1026
- yTickFormatter: f,
1027
- yAxisWidth: p = 44,
1046
+ xTickFormatter: g,
1047
+ yTickFormatter: h,
1048
+ yAxisWidth: N = 44,
1028
1049
  tooltip: M,
1029
- className: y
1030
- }, x) => {
1031
- const u = c ?? _, g = v ?? ((R) => typeof R == "number" ? _(R) : R), S = f ?? ((R) => typeof R == "number" ? u(R) : R), $ = Le(o, u);
1032
- return /* @__PURE__ */ e(Z, { ref: x, className: y, height: a, legendItems: null, hovered: $.hovered, format: u, children: /* @__PURE__ */ w(ke, { margin: J, children: [
1033
- l && /* @__PURE__ */ e(ce, { vertical: !1, stroke: "var(--chart-grid)" }),
1050
+ className: R
1051
+ }, p) => {
1052
+ const m = d ?? k, x = g ?? (($) => typeof $ == "number" ? k($) : $), y = h ?? (($) => typeof $ == "number" ? m($) : $), L = Fe(l, m);
1053
+ return /* @__PURE__ */ e(X, { ref: p, className: R, height: a, legendItems: null, hovered: L.hovered, format: m, children: /* @__PURE__ */ A(_e, { margin: K, children: [
1054
+ o && /* @__PURE__ */ e(ue, { vertical: !1, stroke: "var(--chart-grid)" }),
1034
1055
  /* @__PURE__ */ e(
1035
- de,
1056
+ me,
1036
1057
  {
1037
1058
  type: "number",
1038
1059
  dataKey: n,
1039
- scale: m === "time" ? "time" : "auto",
1040
- domain: d ?? (m === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
1041
- allowDataOverflow: !!d,
1060
+ scale: u === "time" ? "time" : "auto",
1061
+ domain: c ?? (u === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
1062
+ allowDataOverflow: !!c,
1042
1063
  axisLine: !1,
1043
1064
  tickLine: !1,
1044
1065
  minTickGap: 28,
1045
1066
  tickMargin: 10,
1046
- tick: /* @__PURE__ */ e(V, { anchor: "middle", dy: 0, format: g })
1067
+ tick: /* @__PURE__ */ e(W, { anchor: "middle", dy: 0, format: x })
1047
1068
  }
1048
1069
  ),
1049
- h && /* @__PURE__ */ e(
1050
- ee,
1070
+ f && /* @__PURE__ */ e(
1071
+ ne,
1051
1072
  {
1052
1073
  type: "number",
1053
1074
  dataKey: r,
1054
- width: p,
1075
+ width: N,
1055
1076
  domain: b,
1056
1077
  allowDataOverflow: !!b,
1057
1078
  axisLine: !1,
1058
1079
  tickLine: !1,
1059
1080
  tickMargin: 6,
1060
- tick: /* @__PURE__ */ e(V, { anchor: "end", dy: "0.32em", format: S })
1081
+ tick: /* @__PURE__ */ e(W, { anchor: "end", dy: "0.32em", format: y })
1061
1082
  }
1062
1083
  ),
1063
1084
  M !== !1 && /* @__PURE__ */ e(
1064
- z,
1085
+ j,
1065
1086
  {
1066
1087
  content: /* @__PURE__ */ e(
1067
- j,
1088
+ G,
1068
1089
  {
1069
- format: u,
1090
+ format: m,
1070
1091
  labelKey: i,
1071
1092
  renderer: M
1072
1093
  }
@@ -1075,58 +1096,58 @@ const ht = C.forwardRef(
1075
1096
  isAnimationActive: !1
1076
1097
  }
1077
1098
  ),
1078
- $.back,
1099
+ L.back,
1079
1100
  /* @__PURE__ */ e(
1080
- Be,
1101
+ ze,
1081
1102
  {
1082
1103
  data: t,
1083
1104
  fill: "var(--color-chart-1)",
1084
- shape: (R) => /* @__PURE__ */ e("circle", { cx: R.cx, cy: R.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
1105
+ shape: ($) => /* @__PURE__ */ e("circle", { cx: $.cx, cy: $.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
1085
1106
  isAnimationActive: !1
1086
1107
  }
1087
1108
  ),
1088
- $.front
1109
+ L.front
1089
1110
  ] }) });
1090
1111
  }
1091
1112
  );
1092
- ht.displayName = "ScatterChart";
1093
- const xt = C.forwardRef(
1113
+ vt.displayName = "ScatterChart";
1114
+ const bt = C.forwardRef(
1094
1115
  ({
1095
1116
  data: t,
1096
1117
  nameKey: n,
1097
1118
  valueKey: r,
1098
1119
  donut: i = !0,
1099
- centerLabel: o,
1120
+ centerLabel: l,
1100
1121
  highlight: a,
1101
- height: l = 260,
1102
- legend: h = !0,
1103
- formatValue: c,
1104
- tooltip: m,
1105
- className: d
1122
+ height: o = 260,
1123
+ legend: f = !0,
1124
+ formatValue: d,
1125
+ tooltip: u,
1126
+ className: c
1106
1127
  }, b) => {
1107
- const v = c ?? _, f = t.reduce((g, S) => g + (typeof S[r] == "number" ? S[r] : 0), 0), p = (g, S) => ne(S), M = (g) => a && g !== a ? 0.3 : 1, [y, x] = C.useState(null), u = h ? t.map((g, S) => ({
1108
- label: `${g[n]} · ${f ? Math.round(Number(g[r]) / f * 100) : 0}%`,
1109
- color: p(String(g[n]), S)
1128
+ const g = d ?? k, h = t.reduce((x, y) => x + (typeof y[r] == "number" ? y[r] : 0), 0), N = (x, y) => ae(y), M = (x) => a && x !== a ? 0.3 : 1, [R, p] = C.useState(null), m = f ? t.map((x, y) => ({
1129
+ label: `${x[n]} · ${h ? Math.round(Number(x[r]) / h * 100) : 0}%`,
1130
+ color: N(String(x[n]), y)
1110
1131
  })) : null;
1111
- return /* @__PURE__ */ w("div", { ref: b, className: D("relative w-full font-sans", d), children: [
1112
- u && /* @__PURE__ */ e(Q, { items: u }),
1113
- /* @__PURE__ */ w("div", { className: "relative", children: [
1114
- /* @__PURE__ */ e(q, { width: "100%", height: l, children: /* @__PURE__ */ w(He, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
1115
- m !== !1 && /* @__PURE__ */ e(
1116
- z,
1132
+ return /* @__PURE__ */ A("div", { ref: b, className: I("relative w-full font-sans", c), children: [
1133
+ m && /* @__PURE__ */ e(q, { items: m }),
1134
+ /* @__PURE__ */ A("div", { className: "relative", children: [
1135
+ /* @__PURE__ */ e(J, { width: "100%", height: o, children: /* @__PURE__ */ A(ke, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
1136
+ u !== !1 && /* @__PURE__ */ e(
1137
+ j,
1117
1138
  {
1118
1139
  content: /* @__PURE__ */ e(
1119
- j,
1140
+ G,
1120
1141
  {
1121
- format: v,
1122
- renderer: m
1142
+ format: g,
1143
+ renderer: u
1123
1144
  }
1124
1145
  ),
1125
1146
  isAnimationActive: !1
1126
1147
  }
1127
1148
  ),
1128
1149
  /* @__PURE__ */ e(
1129
- _e,
1150
+ je,
1130
1151
  {
1131
1152
  data: t,
1132
1153
  dataKey: r,
@@ -1137,61 +1158,61 @@ const xt = C.forwardRef(
1137
1158
  cornerRadius: i ? 4 : 2,
1138
1159
  stroke: "none",
1139
1160
  isAnimationActive: !1,
1140
- onMouseEnter: (g, S) => x(S),
1141
- onMouseLeave: () => x(null),
1142
- children: t.map((g, S) => /* @__PURE__ */ e(
1143
- te,
1161
+ onMouseEnter: (x, y) => p(y),
1162
+ onMouseLeave: () => p(null),
1163
+ children: t.map((x, y) => /* @__PURE__ */ e(
1164
+ re,
1144
1165
  {
1145
1166
  role: "presentation",
1146
1167
  "aria-hidden": "true",
1147
- className: W,
1148
- fill: p(String(g[n]), S),
1149
- fillOpacity: M(String(g[n])),
1150
- opacity: X(S, y)
1168
+ className: z,
1169
+ fill: N(String(x[n]), y),
1170
+ fillOpacity: M(String(x[n])),
1171
+ opacity: Y(y, R)
1151
1172
  },
1152
- String(g[n])
1173
+ String(x[n])
1153
1174
  ))
1154
1175
  }
1155
1176
  )
1156
1177
  ] }) }),
1157
- i && /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
1158
- /* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children: v(f) }),
1159
- o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
1178
+ i && /* @__PURE__ */ A("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
1179
+ /* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children: g(h) }),
1180
+ l && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: l })
1160
1181
  ] })
1161
1182
  ] })
1162
1183
  ] });
1163
1184
  }
1164
1185
  );
1165
- xt.displayName = "PieChart";
1166
- const vt = C.forwardRef(
1186
+ bt.displayName = "PieChart";
1187
+ const gt = C.forwardRef(
1167
1188
  ({
1168
1189
  data: t,
1169
1190
  categoryKey: n,
1170
1191
  series: r,
1171
1192
  seriesLabels: i,
1172
- highlight: o,
1193
+ highlight: l,
1173
1194
  maxValue: a,
1174
- height: l = 300,
1175
- legend: h,
1176
- formatValue: c,
1177
- tooltip: m,
1178
- className: d
1195
+ height: o = 300,
1196
+ legend: f,
1197
+ formatValue: d,
1198
+ tooltip: u,
1199
+ className: c
1179
1200
  }, b) => {
1180
- const v = C.useMemo(
1181
- () => r ?? ye(t, n),
1201
+ const g = C.useMemo(
1202
+ () => r ?? $e(t, n),
1182
1203
  [n, t, r]
1183
- ), f = c ?? _, p = a ?? Math.max(
1204
+ ), h = d ?? k, N = a ?? Math.max(
1184
1205
  1,
1185
1206
  ...t.flatMap(
1186
- (u) => v.map(
1187
- (g) => typeof u[g] == "number" ? u[g] : 0
1207
+ (m) => g.map(
1208
+ (x) => typeof m[x] == "number" ? m[x] : 0
1188
1209
  )
1189
1210
  )
1190
- ), M = (u) => (i == null ? void 0 : i[u]) ?? u, y = (u, g) => o && v.includes(o) ? u === o ? "var(--color-chart-1)" : re : ne(g), x = h ?? v.length > 1 ? v.map((u, g) => ({ label: M(u), color: y(u, g) })) : null;
1191
- return /* @__PURE__ */ w("div", { ref: b, className: D("relative w-full font-sans", d), children: [
1192
- x && /* @__PURE__ */ e(Q, { items: x, align: "center" }),
1193
- /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(q, { width: "100%", height: l, children: /* @__PURE__ */ w(
1194
- ze,
1211
+ ), M = (m) => (i == null ? void 0 : i[m]) ?? m, R = (m, x) => l && g.includes(l) ? m === l ? "var(--color-chart-1)" : ie : ae(x), p = f ?? g.length > 1 ? g.map((m, x) => ({ label: M(m), color: R(m, x) })) : null;
1212
+ return /* @__PURE__ */ A("div", { ref: b, className: I("relative w-full font-sans", c), children: [
1213
+ p && /* @__PURE__ */ e(q, { items: p, align: "center" }),
1214
+ /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(J, { width: "100%", height: o, children: /* @__PURE__ */ A(
1215
+ Ge,
1195
1216
  {
1196
1217
  data: t,
1197
1218
  cx: "50%",
@@ -1199,50 +1220,50 @@ const vt = C.forwardRef(
1199
1220
  outerRadius: "68%",
1200
1221
  margin: { top: 10, right: 56, bottom: 16, left: 56 },
1201
1222
  children: [
1202
- /* @__PURE__ */ e(je, { stroke: "var(--border)", radialLines: !0 }),
1223
+ /* @__PURE__ */ e(Pe, { stroke: "var(--border)", radialLines: !0 }),
1203
1224
  /* @__PURE__ */ e(
1204
- pe,
1225
+ Ce,
1205
1226
  {
1206
1227
  dataKey: n,
1207
1228
  tick: { fill: "var(--text-secondary)", fontSize: "var(--text-s)", fontWeight: 500 }
1208
1229
  }
1209
1230
  ),
1210
1231
  /* @__PURE__ */ e(
1211
- Pe,
1232
+ We,
1212
1233
  {
1213
1234
  angle: 90,
1214
- domain: [0, p],
1235
+ domain: [0, N],
1215
1236
  tick: !1,
1216
1237
  axisLine: !1,
1217
1238
  tickLine: !1
1218
1239
  }
1219
1240
  ),
1220
- m !== !1 && /* @__PURE__ */ e(
1221
- z,
1241
+ u !== !1 && /* @__PURE__ */ e(
1242
+ j,
1222
1243
  {
1223
1244
  content: /* @__PURE__ */ e(
1224
- j,
1245
+ G,
1225
1246
  {
1226
- format: f,
1227
- renderer: m
1247
+ format: h,
1248
+ renderer: u
1228
1249
  }
1229
1250
  ),
1230
1251
  isAnimationActive: !1
1231
1252
  }
1232
1253
  ),
1233
- v.map((u, g) => /* @__PURE__ */ e(
1234
- We,
1254
+ g.map((m, x) => /* @__PURE__ */ e(
1255
+ Ue,
1235
1256
  {
1236
- dataKey: u,
1237
- name: M(u),
1238
- stroke: y(u, g),
1239
- fill: y(u, g),
1240
- fillOpacity: o ? u === o ? 0.16 : 0.05 : 0.1,
1241
- strokeWidth: ae,
1242
- dot: /* @__PURE__ */ e(U, { color: y(u, g) }),
1257
+ dataKey: m,
1258
+ name: M(m),
1259
+ stroke: R(m, x),
1260
+ fill: R(m, x),
1261
+ fillOpacity: l ? m === l ? 0.16 : 0.05 : 0.1,
1262
+ strokeWidth: le,
1263
+ dot: /* @__PURE__ */ e(U, { color: R(m, x) }),
1243
1264
  isAnimationActive: !1
1244
1265
  },
1245
- u
1266
+ m
1246
1267
  ))
1247
1268
  ]
1248
1269
  }
@@ -1250,106 +1271,106 @@ const vt = C.forwardRef(
1250
1271
  ] });
1251
1272
  }
1252
1273
  );
1253
- vt.displayName = "RadarChart";
1254
- const bt = C.forwardRef(
1274
+ gt.displayName = "RadarChart";
1275
+ const pt = C.forwardRef(
1255
1276
  ({
1256
1277
  data: t,
1257
1278
  nameKey: n,
1258
1279
  valueKey: r,
1259
1280
  maxValue: i = 100,
1260
- centerLabel: o,
1281
+ centerLabel: l,
1261
1282
  height: a = P,
1262
- legend: l = !0,
1263
- formatValue: h,
1264
- tooltip: c,
1265
- className: m
1266
- }, d) => {
1267
- const b = h ?? _, [v, f] = C.useState(null), p = t.map((x, u) => ({
1268
- ...x,
1269
- name: String(x[n]),
1270
- fill: se(u)
1271
- })), M = p.length ? p.reduce(
1272
- (x, u) => x + (typeof u[r] == "number" ? u[r] : 0),
1283
+ legend: o = !0,
1284
+ formatValue: f,
1285
+ tooltip: d,
1286
+ className: u
1287
+ }, c) => {
1288
+ const b = f ?? k, [g, h] = C.useState(null), N = t.map((p, m) => ({
1289
+ ...p,
1290
+ name: String(p[n]),
1291
+ fill: de(m)
1292
+ })), M = N.length ? N.reduce(
1293
+ (p, m) => p + (typeof m[r] == "number" ? m[r] : 0),
1273
1294
  0
1274
- ) / p.length : 0, y = l ? p.map((x, u) => ({
1275
- label: String(x[n]),
1276
- color: se(u)
1295
+ ) / N.length : 0, R = o ? N.map((p, m) => ({
1296
+ label: String(p[n]),
1297
+ color: de(m)
1277
1298
  })) : null;
1278
- return /* @__PURE__ */ w("div", { ref: d, className: D("relative w-full font-sans", m), children: [
1279
- /* @__PURE__ */ w("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
1280
- /* @__PURE__ */ e(q, { width: "100%", height: a, children: /* @__PURE__ */ w(
1281
- Ge,
1299
+ return /* @__PURE__ */ A("div", { ref: c, className: I("relative w-full font-sans", u), children: [
1300
+ /* @__PURE__ */ A("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
1301
+ /* @__PURE__ */ e(J, { width: "100%", height: a, children: /* @__PURE__ */ A(
1302
+ Ve,
1282
1303
  {
1283
- data: p,
1304
+ data: N,
1284
1305
  innerRadius: "48%",
1285
1306
  outerRadius: "82%",
1286
1307
  startAngle: 90,
1287
1308
  endAngle: -270,
1288
1309
  margin: { top: 6, right: 6, bottom: 6, left: 6 },
1289
1310
  children: [
1290
- /* @__PURE__ */ e(pe, { type: "number", domain: [0, i], tick: !1 }),
1291
- c !== !1 && /* @__PURE__ */ e(
1292
- z,
1311
+ /* @__PURE__ */ e(Ce, { type: "number", domain: [0, i], tick: !1 }),
1312
+ d !== !1 && /* @__PURE__ */ e(
1313
+ j,
1293
1314
  {
1294
1315
  content: /* @__PURE__ */ e(
1295
- j,
1316
+ G,
1296
1317
  {
1297
1318
  format: b,
1298
- renderer: c
1319
+ renderer: d
1299
1320
  }
1300
1321
  ),
1301
1322
  isAnimationActive: !1
1302
1323
  }
1303
1324
  ),
1304
1325
  /* @__PURE__ */ e(
1305
- Ve,
1326
+ Ye,
1306
1327
  {
1307
1328
  dataKey: r,
1308
1329
  background: { fill: "var(--muted)" },
1309
1330
  cornerRadius: 999,
1310
1331
  maxBarSize: 18,
1311
1332
  isAnimationActive: !1,
1312
- onMouseEnter: (x, u) => f(u),
1313
- onMouseLeave: () => f(null),
1314
- children: p.map((x, u) => /* @__PURE__ */ e(
1315
- te,
1333
+ onMouseEnter: (p, m) => h(m),
1334
+ onMouseLeave: () => h(null),
1335
+ children: N.map((p, m) => /* @__PURE__ */ e(
1336
+ re,
1316
1337
  {
1317
- fill: x.fill,
1318
- className: W,
1319
- opacity: X(u, v)
1338
+ fill: p.fill,
1339
+ className: z,
1340
+ opacity: Y(m, g)
1320
1341
  },
1321
- `${x.name}-${u}`
1342
+ `${p.name}-${m}`
1322
1343
  ))
1323
1344
  }
1324
1345
  )
1325
1346
  ]
1326
1347
  }
1327
1348
  ) }),
1328
- /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
1349
+ /* @__PURE__ */ A("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
1329
1350
  /* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children: b(Math.round(M)) }),
1330
- o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
1351
+ l && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: l })
1331
1352
  ] })
1332
1353
  ] }),
1333
- y && /* @__PURE__ */ e(Q, { items: y, align: "center", className: "mb-0 mt-3" })
1354
+ R && /* @__PURE__ */ e(q, { items: R, align: "center", className: "mb-0 mt-3" })
1334
1355
  ] });
1335
1356
  }
1336
1357
  );
1337
- bt.displayName = "RadialBarChart";
1338
- function gt({
1358
+ pt.displayName = "RadialBarChart";
1359
+ function Nt({
1339
1360
  x: t = 0,
1340
1361
  y: n = 0,
1341
1362
  width: r = 0,
1342
1363
  height: i = 0,
1343
- depth: o = 0,
1364
+ depth: l = 0,
1344
1365
  index: a = 0,
1345
- name: l,
1346
- value: h,
1347
- format: c = _,
1348
- activeIndex: m = null
1366
+ name: o,
1367
+ value: f,
1368
+ format: d = k,
1369
+ activeIndex: u = null
1349
1370
  }) {
1350
- if (o === 0) return /* @__PURE__ */ e("g", {});
1351
- const d = o === 0 ? "transparent" : se(a), b = o > 0 && a < 4, v = r > 72 && i > 38;
1352
- return /* @__PURE__ */ w("g", { className: W, opacity: X(a, m), children: [
1371
+ if (l === 0) return /* @__PURE__ */ e("g", {});
1372
+ const c = l === 0 ? "transparent" : de(a), b = l > 0 && a < 4, g = r > 72 && i > 38;
1373
+ return /* @__PURE__ */ A("g", { className: z, opacity: Y(a, u), children: [
1353
1374
  /* @__PURE__ */ e(
1354
1375
  "rect",
1355
1376
  {
@@ -1359,12 +1380,12 @@ function gt({
1359
1380
  height: i,
1360
1381
  rx: 6,
1361
1382
  ry: 6,
1362
- fill: d,
1383
+ fill: c,
1363
1384
  stroke: "var(--background)",
1364
1385
  strokeWidth: 4
1365
1386
  }
1366
1387
  ),
1367
- v && /* @__PURE__ */ e(
1388
+ g && /* @__PURE__ */ e(
1368
1389
  "foreignObject",
1369
1390
  {
1370
1391
  x: t + 8,
@@ -1372,25 +1393,25 @@ function gt({
1372
1393
  width: Math.max(0, r - 16),
1373
1394
  height: Math.max(0, i - 16),
1374
1395
  className: "pointer-events-none overflow-hidden",
1375
- children: /* @__PURE__ */ w("div", { className: "flex h-full flex-col justify-between", children: [
1396
+ children: /* @__PURE__ */ A("div", { className: "flex h-full flex-col justify-between", children: [
1376
1397
  /* @__PURE__ */ e(
1377
1398
  "p",
1378
1399
  {
1379
- className: D(
1400
+ className: I(
1380
1401
  "truncate text-xs font-medium",
1381
1402
  b ? "text-background" : "text-foreground"
1382
1403
  ),
1383
- children: l
1404
+ children: o
1384
1405
  }
1385
1406
  ),
1386
- typeof h == "number" && i > 58 && /* @__PURE__ */ e(
1407
+ typeof f == "number" && i > 58 && /* @__PURE__ */ e(
1387
1408
  "p",
1388
1409
  {
1389
- className: D(
1410
+ className: I(
1390
1411
  "text-xs tabular-nums",
1391
1412
  b ? "text-background/70" : "text-tertiary"
1392
1413
  ),
1393
- children: c(h)
1414
+ children: d(f)
1394
1415
  }
1395
1416
  )
1396
1417
  ] })
@@ -1398,11 +1419,11 @@ function gt({
1398
1419
  )
1399
1420
  ] });
1400
1421
  }
1401
- function pt(t, n, r) {
1402
- const i = [], o = (a) => {
1403
- const l = Array.isArray(a.children) ? a.children : void 0;
1404
- if (l != null && l.length) {
1405
- l.forEach(o);
1422
+ function wt(t, n, r) {
1423
+ const i = [], l = (a) => {
1424
+ const o = Array.isArray(a.children) ? a.children : void 0;
1425
+ if (o != null && o.length) {
1426
+ o.forEach(l);
1406
1427
  return;
1407
1428
  }
1408
1429
  typeof a[r] == "number" && i.push({
@@ -1411,41 +1432,41 @@ function pt(t, n, r) {
1411
1432
  value: a[r]
1412
1433
  });
1413
1434
  };
1414
- return t.forEach(o), i.length ? i : t;
1435
+ return t.forEach(l), i.length ? i : t;
1415
1436
  }
1416
- const Nt = C.forwardRef(
1437
+ const At = C.forwardRef(
1417
1438
  ({
1418
1439
  data: t,
1419
1440
  nameKey: n,
1420
1441
  valueKey: r,
1421
1442
  height: i = P,
1422
- formatValue: o,
1443
+ formatValue: l,
1423
1444
  tooltip: a,
1424
- className: l
1425
- }, h) => {
1426
- const c = o ?? _, m = C.useMemo(
1427
- () => pt(t, n, r),
1445
+ className: o
1446
+ }, f) => {
1447
+ const d = l ?? k, u = C.useMemo(
1448
+ () => wt(t, n, r),
1428
1449
  [t, n, r]
1429
- ), [d, b] = C.useState(null);
1430
- return /* @__PURE__ */ e("div", { ref: h, className: D("relative w-full font-sans", l), children: /* @__PURE__ */ e(q, { width: "100%", height: i, children: /* @__PURE__ */ e(
1431
- Ue,
1450
+ ), [c, b] = C.useState(null);
1451
+ return /* @__PURE__ */ e("div", { ref: f, className: I("relative w-full font-sans", o), children: /* @__PURE__ */ e(J, { width: "100%", height: i, children: /* @__PURE__ */ e(
1452
+ Xe,
1432
1453
  {
1433
- data: m,
1454
+ data: u,
1434
1455
  nameKey: n,
1435
1456
  dataKey: r,
1436
1457
  type: "flat",
1437
1458
  aspectRatio: 1.6,
1438
- content: /* @__PURE__ */ e(gt, { format: c, activeIndex: d }),
1459
+ content: /* @__PURE__ */ e(Nt, { format: d, activeIndex: c }),
1439
1460
  isAnimationActive: !1,
1440
- onMouseEnter: (v) => b(v.depth ? v.index ?? null : null),
1461
+ onMouseEnter: (g) => b(g.depth ? g.index ?? null : null),
1441
1462
  onMouseLeave: () => b(null),
1442
1463
  children: a !== !1 && /* @__PURE__ */ e(
1443
- z,
1464
+ j,
1444
1465
  {
1445
1466
  content: /* @__PURE__ */ e(
1446
- j,
1467
+ G,
1447
1468
  {
1448
- format: c,
1469
+ format: d,
1449
1470
  renderer: a
1450
1471
  }
1451
1472
  ),
@@ -1456,92 +1477,92 @@ const Nt = C.forwardRef(
1456
1477
  ) }) });
1457
1478
  }
1458
1479
  );
1459
- Nt.displayName = "TreemapChart";
1460
- const le = "var(--color-chart-1)", wt = "var(--chart-track)", K = 24, At = 44, he = 0.55, xe = 4, ve = (t, n, r, i, o) => {
1461
- const a = Math.min(o, r / 2, i);
1480
+ At.displayName = "TreemapChart";
1481
+ const se = "var(--color-chart-1)", Ct = "var(--chart-track)", te = 24, Mt = 44, ve = 0.55, be = 4, ge = (t, n, r, i, l) => {
1482
+ const a = Math.min(l, r / 2, i);
1462
1483
  return `M ${t},${n + i} L ${t},${n + a} Q ${t},${n} ${t + a},${n} L ${t + r - a},${n} Q ${t + r},${n} ${t + r},${n + a} L ${t + r},${n + i} Z`;
1463
1484
  };
1464
- function Ct() {
1485
+ function St() {
1465
1486
  const t = C.useRef(null), [n, r] = C.useState(0);
1466
1487
  return C.useLayoutEffect(() => {
1467
1488
  const i = t.current;
1468
1489
  if (!i) return;
1469
1490
  r(i.getBoundingClientRect().width);
1470
- const o = new ResizeObserver((a) => {
1471
- var h;
1472
- const l = ((h = a[0]) == null ? void 0 : h.contentRect.width) ?? 0;
1473
- r((c) => Math.abs(c - l) > 0.5 ? l : c);
1491
+ const l = new ResizeObserver((a) => {
1492
+ var f;
1493
+ const o = ((f = a[0]) == null ? void 0 : f.contentRect.width) ?? 0;
1494
+ r((d) => Math.abs(d - o) > 0.5 ? o : d);
1474
1495
  });
1475
- return o.observe(i), () => o.disconnect();
1496
+ return l.observe(i), () => l.disconnect();
1476
1497
  }, []), { ref: t, width: n };
1477
1498
  }
1478
- const Mt = C.forwardRef(
1499
+ const Rt = C.forwardRef(
1479
1500
  ({
1480
1501
  data: t,
1481
1502
  nameKey: n,
1482
1503
  valueKey: r,
1483
1504
  height: i = P,
1484
- formatValue: o,
1505
+ formatValue: l,
1485
1506
  label: a,
1486
- tooltip: l,
1487
- className: h
1488
- }, c) => {
1489
- var R;
1490
- const m = o ?? _, { ref: d, width: b } = Ct(), [v, f] = C.useState(null), p = Number(((R = t[0]) == null ? void 0 : R[r]) ?? 0), M = t.length, y = Math.max(0, i - K - At), x = K + y, u = M > 0 ? b / (M + (M - 1) * he) : 0, g = u * he, S = t.map((s, O) => {
1491
- var F;
1492
- const A = Number(s[r]), I = Number(((F = t[O - 1]) == null ? void 0 : F[r]) ?? A), L = p ? A / p * 100 : 0, E = I ? A / I * 100 : 0, N = p && A > 0 ? Math.max(2, A / p * y) : 0;
1507
+ tooltip: o,
1508
+ className: f
1509
+ }, d) => {
1510
+ var $;
1511
+ const u = l ?? k, { ref: c, width: b } = St(), [g, h] = C.useState(null), N = Number((($ = t[0]) == null ? void 0 : $[r]) ?? 0), M = t.length, R = Math.max(0, i - te - Mt), p = te + R, m = M > 0 ? b / (M + (M - 1) * ve) : 0, x = m * ve, y = t.map((s, O) => {
1512
+ var E;
1513
+ const w = Number(s[r]), F = Number(((E = t[O - 1]) == null ? void 0 : E[r]) ?? w), T = N ? w / N * 100 : 0, D = F ? w / F * 100 : 0, _ = N && w > 0 ? Math.max(2, w / N * R) : 0;
1493
1514
  return {
1494
1515
  datum: s,
1495
1516
  index: O,
1496
1517
  name: String(s[n]),
1497
- value: A,
1498
- conversionFromFirst: L,
1499
- conversionFromPrevious: E,
1500
- dropOffFromPrevious: O === 0 ? 0 : 100 - E,
1501
- x: O * (u + g),
1502
- y: x - N,
1503
- width: u,
1504
- height: N,
1505
- formatValue: m
1518
+ value: w,
1519
+ conversionFromFirst: T,
1520
+ conversionFromPrevious: D,
1521
+ dropOffFromPrevious: O === 0 ? 0 : 100 - D,
1522
+ x: O * (m + x),
1523
+ y: p - _,
1524
+ width: m,
1525
+ height: _,
1526
+ formatValue: u
1506
1527
  };
1507
- }), $ = v != null ? S[v] : void 0;
1508
- return /* @__PURE__ */ e("div", { ref: c, className: D("relative w-full font-sans", h), children: /* @__PURE__ */ w("div", { ref: d, className: "relative w-full", style: { height: i }, children: [
1509
- b > 0 && M > 0 && /* @__PURE__ */ w("svg", { width: b, height: i, className: "block", children: [
1510
- S.slice(1).map((s) => {
1511
- const O = S[s.index - 1];
1528
+ }), L = g != null ? y[g] : void 0;
1529
+ return /* @__PURE__ */ e("div", { ref: d, className: I("relative w-full font-sans", f), children: /* @__PURE__ */ A("div", { ref: c, className: "relative w-full", style: { height: i }, children: [
1530
+ b > 0 && M > 0 && /* @__PURE__ */ A("svg", { width: b, height: i, className: "block", children: [
1531
+ y.slice(1).map((s) => {
1532
+ const O = y[s.index - 1];
1512
1533
  return /* @__PURE__ */ e(
1513
1534
  "path",
1514
1535
  {
1515
- d: `M ${O.x + O.width},${O.y} L ${s.x},${s.y} L ${s.x},${x} L ${O.x + O.width},${x} Z`,
1516
- fill: le,
1536
+ d: `M ${O.x + O.width},${O.y} L ${s.x},${s.y} L ${s.x},${p} L ${O.x + O.width},${p} Z`,
1537
+ fill: se,
1517
1538
  opacity: 0.14
1518
1539
  },
1519
1540
  `connector-${s.index}`
1520
1541
  );
1521
1542
  }),
1522
- S.map((s) => /* @__PURE__ */ w(
1543
+ y.map((s) => /* @__PURE__ */ A(
1523
1544
  "g",
1524
1545
  {
1525
1546
  role: "img",
1526
- "aria-label": `${s.name}: ${m(s.value)} (${Math.round(s.conversionFromFirst)}% of ${S[0].name})`,
1547
+ "aria-label": `${s.name}: ${u(s.value)} (${Math.round(s.conversionFromFirst)}% of ${y[0].name})`,
1527
1548
  children: [
1528
1549
  /* @__PURE__ */ e(
1529
1550
  "path",
1530
1551
  {
1531
- d: ve(s.x, K, s.width, y, xe),
1532
- fill: wt
1552
+ d: ge(s.x, te, s.width, R, be),
1553
+ fill: Ct
1533
1554
  }
1534
1555
  ),
1535
1556
  s.height > 0 && /* @__PURE__ */ e(
1536
1557
  "path",
1537
1558
  {
1538
- d: ve(s.x, s.y, s.width, s.height, xe),
1539
- fill: le,
1540
- className: W,
1541
- opacity: X(s.index, v)
1559
+ d: ge(s.x, s.y, s.width, s.height, be),
1560
+ fill: se,
1561
+ className: z,
1562
+ opacity: Y(s.index, g)
1542
1563
  }
1543
1564
  ),
1544
- a !== !1 && (a ? a(s) : /* @__PURE__ */ w(
1565
+ a !== !1 && (a ? a(s) : /* @__PURE__ */ A(
1545
1566
  "text",
1546
1567
  {
1547
1568
  x: s.x,
@@ -1558,7 +1579,7 @@ const Mt = C.forwardRef(
1558
1579
  "text",
1559
1580
  {
1560
1581
  x: s.x,
1561
- y: x + 18,
1582
+ y: p + 18,
1562
1583
  textAnchor: "start",
1563
1584
  className: "fill-primary text-xs font-normal",
1564
1585
  children: s.name
@@ -1568,22 +1589,22 @@ const Mt = C.forwardRef(
1568
1589
  "text",
1569
1590
  {
1570
1591
  x: s.x,
1571
- y: x + 34,
1592
+ y: p + 34,
1572
1593
  textAnchor: "start",
1573
1594
  className: "fill-tertiary text-xs tabular-nums",
1574
- children: m(s.value)
1595
+ children: u(s.value)
1575
1596
  }
1576
1597
  ),
1577
1598
  /* @__PURE__ */ e(
1578
1599
  "rect",
1579
1600
  {
1580
1601
  x: s.x,
1581
- y: K,
1582
- width: s.index === M - 1 ? u : u + g,
1583
- height: y,
1602
+ y: te,
1603
+ width: s.index === M - 1 ? m : m + x,
1604
+ height: R,
1584
1605
  fill: "transparent",
1585
- onMouseEnter: () => f(s.index),
1586
- onMouseLeave: () => f(null)
1606
+ onMouseEnter: () => h(s.index),
1607
+ onMouseLeave: () => h(null)
1587
1608
  }
1588
1609
  )
1589
1610
  ]
@@ -1591,34 +1612,34 @@ const Mt = C.forwardRef(
1591
1612
  `${s.name}-${s.index}`
1592
1613
  ))
1593
1614
  ] }),
1594
- l !== !1 && $ && /* @__PURE__ */ e(
1615
+ o !== !1 && L && /* @__PURE__ */ e(
1595
1616
  "div",
1596
1617
  {
1597
1618
  className: "pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-full",
1598
- style: { left: $.x + $.width / 2, top: $.y - 10 },
1599
- children: l ? l({
1619
+ style: { left: L.x + L.width / 2, top: L.y - 10 },
1620
+ children: o ? o({
1600
1621
  active: !0,
1601
- label: $.name,
1622
+ label: L.name,
1602
1623
  items: [
1603
1624
  {
1604
- key: $.name,
1605
- name: $.name,
1606
- value: $.value,
1607
- color: le,
1608
- datum: $.datum
1625
+ key: L.name,
1626
+ name: L.name,
1627
+ value: L.value,
1628
+ color: se,
1629
+ datum: L.datum
1609
1630
  }
1610
1631
  ],
1611
- formatValue: m
1612
- }) : /* @__PURE__ */ w("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs whitespace-nowrap text-background", children: [
1613
- /* @__PURE__ */ e("div", { className: "text-xs font-normal tracking-wide uppercase text-background/60", children: $.name }),
1614
- /* @__PURE__ */ e("div", { className: "font-normal tabular-nums", children: m($.value) }),
1615
- /* @__PURE__ */ w("div", { className: "text-background/70 tabular-nums", children: [
1616
- Math.round($.conversionFromFirst),
1632
+ formatValue: u
1633
+ }) : /* @__PURE__ */ A("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs whitespace-nowrap text-background", children: [
1634
+ /* @__PURE__ */ e("div", { className: "text-xs font-normal tracking-wide uppercase text-background/60", children: L.name }),
1635
+ /* @__PURE__ */ e("div", { className: "font-normal tabular-nums", children: u(L.value) }),
1636
+ /* @__PURE__ */ A("div", { className: "text-background/70 tabular-nums", children: [
1637
+ Math.round(L.conversionFromFirst),
1617
1638
  "% of ",
1618
- S[0].name,
1619
- $.index > 0 && /* @__PURE__ */ w(oe, { children: [
1639
+ y[0].name,
1640
+ L.index > 0 && /* @__PURE__ */ A(ce, { children: [
1620
1641
  " · −",
1621
- Math.round($.dropOffFromPrevious),
1642
+ Math.round(L.dropOffFromPrevious),
1622
1643
  "% step"
1623
1644
  ] })
1624
1645
  ] })
@@ -1628,18 +1649,18 @@ const Mt = C.forwardRef(
1628
1649
  ] }) });
1629
1650
  }
1630
1651
  );
1631
- Mt.displayName = "FunnelChart";
1652
+ Rt.displayName = "FunnelChart";
1632
1653
  export {
1633
- ut as AreaChart,
1634
- mt as BarChart,
1635
- Oe as ComboChart,
1636
- ft as ComposedChart,
1637
- Mt as FunnelChart,
1638
- dt as LineChart,
1654
+ ft as AreaChart,
1655
+ ht as BarChart,
1656
+ De as ComboChart,
1657
+ xt as ComposedChart,
1658
+ Rt as FunnelChart,
1659
+ mt as LineChart,
1639
1660
  P as MIN_HEIGHT,
1640
- xt as PieChart,
1641
- vt as RadarChart,
1642
- bt as RadialBarChart,
1643
- ht as ScatterChart,
1644
- Nt as TreemapChart
1661
+ bt as PieChart,
1662
+ gt as RadarChart,
1663
+ pt as RadialBarChart,
1664
+ vt as ScatterChart,
1665
+ At as TreemapChart
1645
1666
  };