@actioneer/ads 1.0.6 → 1.0.8

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