@actioneer/ads 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +88 -19
  2. package/components/ai-elements/chain-of-thought.js +358 -149
  3. package/components/ai-elements/chart.d.ts +30 -0
  4. package/components/ai-elements/chart.js +303 -0
  5. package/components/ai-elements/index.d.ts +2 -1
  6. package/components/ai-elements/message.d.ts +19 -4
  7. package/components/ai-elements/message.js +177 -130
  8. package/components/ai-elements/research-activity.d.ts +45 -0
  9. package/components/ai-elements/research-activity.js +260 -0
  10. package/components/ai-elements/task-progress.js +69 -66
  11. package/components/ai-elements/tool.js +42 -38
  12. package/components/answer.d.ts +19 -0
  13. package/components/answer.js +363 -300
  14. package/components/assistant-ui/attachment.js +5 -1
  15. package/components/assistant-ui/composer-deep-research.js +44 -29
  16. package/components/assistant-ui/composer-harness.js +55 -38
  17. package/components/assistant-ui/composer.js +16 -16
  18. package/components/assistant-ui/index.d.ts +0 -1
  19. package/components/assistant-ui/message.d.ts +7 -0
  20. package/components/assistant-ui/message.js +64 -51
  21. package/components/assistant-ui/primitives.d.ts +1 -1
  22. package/components/assistant-ui/thread-context.d.ts +2 -0
  23. package/components/assistant-ui/thread.js +34 -32
  24. package/components/brand-texture.d.ts +37 -0
  25. package/components/brand-texture.js +54 -0
  26. package/components/chart.d.ts +64 -2
  27. package/components/chart.js +717 -456
  28. package/components/code-block.d.ts +36 -0
  29. package/components/code-block.js +136 -0
  30. package/components/command-palette.d.ts +43 -0
  31. package/components/command-palette.js +146 -0
  32. package/components/drawer.d.ts +1 -1
  33. package/components/file-dropzone.d.ts +32 -0
  34. package/components/file-dropzone.js +134 -0
  35. package/components/index.d.ts +11 -0
  36. package/components/index.js +480 -430
  37. package/components/infinite-canvas.d.ts +50 -0
  38. package/components/infinite-canvas.js +215 -0
  39. package/components/page-header.d.ts +22 -0
  40. package/components/page-header.js +52 -0
  41. package/components/resizable-panel.d.ts +29 -0
  42. package/components/resizable-panel.js +102 -0
  43. package/components/reveal.d.ts +36 -0
  44. package/components/reveal.js +35 -0
  45. package/components/scroll-area.d.ts +19 -0
  46. package/components/scroll-area.js +57 -0
  47. package/components/setting-row.d.ts +35 -0
  48. package/components/setting-row.js +86 -0
  49. package/components/sidebar.d.ts +4 -1
  50. package/components/sidebar.js +134 -132
  51. package/components/stepper.d.ts +32 -0
  52. package/components/stepper.js +113 -0
  53. package/components/table.js +16 -15
  54. package/components/tabs.js +1 -1
  55. package/hooks/agents-ui/voice-visualizer-types.js +1 -0
  56. package/lib/icons.d.ts +24 -0
  57. package/lib/icons.js +100 -110
  58. package/lib/motion.d.ts +5 -3
  59. package/lib/motion.js +46 -20
  60. package/lib/router.js +19 -0
  61. package/lib/utils.js +5 -0
  62. package/llms.txt +143 -39
  63. package/manifest.json +1232 -100
  64. package/package.json +2 -2
  65. package/styles.css +71 -28
  66. package/theme.css +19 -15
  67. package/components/ai-elements/reasoning.d.ts +0 -26
  68. package/components/ai-elements/reasoning.js +0 -131
  69. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  70. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as g, jsx as e, Fragment as Z } from "react/jsx-runtime";
3
- import * as N from "react";
4
- import { ResponsiveContainer as F, LineChart as q, Tooltip as C, Line as z, AreaChart as J, Area as Q, BarChart as K, Bar as G, Cell as W, ComposedChart as ee, YAxis as D, ScatterChart as te, CartesianGrid as E, XAxis as _, Scatter as re, PieChart as ae, Pie as ne, RadarChart as ie, PolarGrid as le, PolarAngleAxis as H, PolarRadiusAxis as oe, Radar as se, RadialBarChart as ce, RadialBar as de, Treemap as me, FunnelChart as fe, Funnel as ue, LabelList as he, ReferenceArea as xe, ReferenceLine as ge, ReferenceDot as ve } from "recharts";
5
- import { MotionConfig as pe, AnimatePresence as be, motion as Ne } from "motion/react";
6
- import { cn as k } from "../lib/cn.js";
7
- import { floatVariants as Ae } from "../lib/motion.js";
8
- const V = (t) => `var(--color-chart-${t % 6 + 1})`, j = [
2
+ import { jsxs as y, jsx as e, Fragment as G } from "react/jsx-runtime";
3
+ import * as k from "react";
4
+ import { ResponsiveContainer as $, LineChart as re, Tooltip as F, Line as U, AreaChart as ae, Area as ne, CartesianGrid as Y, XAxis as H, YAxis as I, BarChart as ie, Bar as Z, Cell as X, ComposedChart as oe, ScatterChart as le, Scatter as se, PieChart as ce, Pie as de, RadarChart as me, PolarGrid as fe, PolarAngleAxis as q, PolarRadiusAxis as ue, Radar as he, RadialBarChart as xe, RadialBar as ve, Treemap as ge, FunnelChart as be, Funnel as pe, LabelList as ye, ReferenceArea as ke, ReferenceLine as Ne, ReferenceDot as we } from "recharts";
5
+ import { MotionConfig as Ae, AnimatePresence as Ce, motion as Re } from "motion/react";
6
+ import { cn as C } from "../lib/cn.js";
7
+ import { floatVariants as Fe } from "../lib/motion.js";
8
+ const J = (r) => `var(--color-chart-${r % 6 + 1})`, E = [
9
9
  "var(--color-ink-950)",
10
10
  "var(--color-ink-700)",
11
11
  "var(--color-ink-500)",
@@ -13,86 +13,105 @@ const V = (t) => `var(--color-chart-${t % 6 + 1})`, j = [
13
13
  "var(--color-ink-300)",
14
14
  "var(--color-ink-200)",
15
15
  "var(--color-ink-100)"
16
- ], M = (t) => j[t % j.length], P = "var(--color-chart-3)", R = {
16
+ ], B = (r) => E[r % E.length], _ = "var(--color-chart-3)", S = {
17
17
  primary: { ref: "var(--brand)", pill: "bg-fill text-fill-foreground" },
18
18
  success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
19
19
  warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
20
20
  danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
21
21
  info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
22
- }, w = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), X = (t, r) => {
22
+ }, L = (r) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(r), Q = (r, n) => {
23
23
  const a = [];
24
- for (const n of t)
25
- for (const i of Object.keys(n))
26
- i !== r && typeof n[i] == "number" && !a.includes(i) && a.push(i);
24
+ for (const i of r)
25
+ for (const t of Object.keys(i))
26
+ t !== n && typeof i[t] == "number" && !a.includes(t) && a.push(t);
27
27
  return a;
28
28
  };
29
- function L({ x: t, y: r, payload: a, anchor: n, dy: i, format: l }) {
30
- const o = (a == null ? void 0 : a.value) ?? "", s = l && typeof o == "number" ? l(o) : o;
31
- return /* @__PURE__ */ e("text", { x: t, y: r, dy: i, textAnchor: n, className: "fill-tertiary text-xs tabular-nums", children: s });
29
+ function T({ x: r, y: n, payload: a, anchor: i, dy: t, format: s }) {
30
+ const c = (a == null ? void 0 : a.value) ?? "", m = s ? s(c) : c;
31
+ return /* @__PURE__ */ e("text", { x: r, y: n, dy: t, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: m });
32
32
  }
33
- function y({
34
- active: t,
35
- payload: r,
33
+ function M({
34
+ active: r,
35
+ payload: n,
36
36
  label: a,
37
- format: n
37
+ format: i,
38
+ labelKey: t,
39
+ renderer: s
38
40
  }) {
39
- if (!t || !(r != null && r.length)) return null;
40
- const i = r.length === 1, l = a ?? (i ? r[0].name : void 0);
41
- return /* @__PURE__ */ g("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
42
- /* @__PURE__ */ e("div", { className: k("text-xs font-medium tracking-wide uppercase text-background/60", !i && "mb-1"), children: l }),
43
- r.map((o, s) => /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
44
- !i && /* @__PURE__ */ g(Z, { children: [
45
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: o.color } }),
46
- /* @__PURE__ */ e("span", { className: "text-background/70", children: o.name })
41
+ var x, u;
42
+ const c = (n ?? []).map((d, p) => {
43
+ const h = d.payload && typeof d.payload == "object" ? d.payload : void 0;
44
+ return {
45
+ key: d.dataKey ?? p,
46
+ name: d.name ?? d.dataKey ?? p,
47
+ value: d.value,
48
+ color: d.color,
49
+ datum: h
50
+ };
51
+ }), m = t ? (u = (x = c[0]) == null ? void 0 : x.datum) == null ? void 0 : u[t] : void 0, f = {
52
+ active: !!r,
53
+ label: typeof m == "string" || typeof m == "number" ? m : a,
54
+ items: c,
55
+ formatValue: i
56
+ };
57
+ if (s) return /* @__PURE__ */ e(G, { children: s(f) });
58
+ if (!f.active || !c.length) return null;
59
+ const l = c.length === 1, g = f.label ?? (l ? c[0].name : void 0);
60
+ return /* @__PURE__ */ y("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
61
+ /* @__PURE__ */ e("div", { className: C("text-xs font-medium tracking-wide uppercase text-background/60", !l && "mb-1"), children: g }),
62
+ c.map((d) => /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
63
+ !l && /* @__PURE__ */ y(G, { children: [
64
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: d.color } }),
65
+ /* @__PURE__ */ e("span", { className: "text-background/70", children: d.name })
47
66
  ] }),
48
- /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof o.value == "number" ? n(o.value) : String(o.value ?? "") })
49
- ] }, o.dataKey ?? s))
67
+ /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof d.value == "number" ? i(d.value) : String(d.value ?? "") })
68
+ ] }, d.key))
50
69
  ] });
51
70
  }
52
- const B = "pointer-events-none inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap";
53
- function ke({ viewBox: t, label: r, color: a, axis: n }) {
54
- const i = t ?? {};
55
- return n === "y" ? /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: (i.y ?? 0) - 10, width: i.width ?? 0, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: /* @__PURE__ */ e("span", { className: k(B, R[a].pill), children: r }) }) }) : /* @__PURE__ */ e("foreignObject", { x: (i.x ?? 0) - 90, y: (i.y ?? 0) - 10, width: 180, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("span", { className: k(B, R[a].pill), children: r }) }) });
71
+ const V = "pointer-events-none inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap";
72
+ function Me({ viewBox: r, label: n, color: a, axis: i }) {
73
+ const t = r ?? {};
74
+ return i === "y" ? /* @__PURE__ */ e("foreignObject", { x: t.x ?? 0, y: (t.y ?? 0) - 10, width: t.width ?? 0, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: /* @__PURE__ */ e("span", { className: C(V, S[a].pill), children: n }) }) }) : /* @__PURE__ */ e("foreignObject", { x: (t.x ?? 0) - 90, y: (t.y ?? 0) - 10, width: 180, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("span", { className: C(V, S[a].pill), children: n }) }) });
56
75
  }
57
- function Ce({ viewBox: t, label: r, color: a }) {
58
- const n = t ?? {};
59
- return /* @__PURE__ */ e("foreignObject", { x: n.x ?? 0, y: n.y ?? 0, width: n.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: k(B, R[a].pill), children: r }) }) });
76
+ function Le({ viewBox: r, label: n, color: a }) {
77
+ const i = r ?? {};
78
+ 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: C(V, S[a].pill), children: n }) }) });
60
79
  }
61
- function we({
62
- cx: t,
63
- cy: r,
80
+ function Oe({
81
+ cx: r,
82
+ cy: n,
64
83
  n: a,
65
- ann: n,
66
- onEnter: i,
67
- onLeave: l
84
+ ann: i,
85
+ onEnter: t,
86
+ onLeave: s
68
87
  }) {
69
- const [o, s] = N.useState(!1);
70
- if (t == null || r == null || !Number.isFinite(t) || !Number.isFinite(r)) return /* @__PURE__ */ e("g", {});
71
- const f = () => i({ ann: n, n: a, cx: t, cy: r }), d = () => l();
72
- return /* @__PURE__ */ g(
88
+ const [c, m] = k.useState(!1);
89
+ if (r == null || n == null || !Number.isFinite(r) || !Number.isFinite(n)) return /* @__PURE__ */ e("g", {});
90
+ const f = () => t({ ann: i, n: a, cx: r, cy: n }), l = () => s();
91
+ return /* @__PURE__ */ y(
73
92
  "g",
74
93
  {
75
94
  tabIndex: 0,
76
95
  role: "img",
77
- "aria-label": `Annotation ${a}: ${n.label}`,
96
+ "aria-label": `Annotation ${a}: ${i.label}`,
78
97
  className: "cursor-default outline-none [transform-box:fill-box] origin-center transition-transform ease-out [transition-duration:var(--duration-fast)] hover:scale-110 focus-visible:scale-110",
79
98
  onMouseEnter: f,
80
- onMouseLeave: d,
99
+ onMouseLeave: l,
81
100
  onFocus: () => {
82
- s(!0), f();
101
+ m(!0), f();
83
102
  },
84
103
  onBlur: () => {
85
- s(!1), d();
104
+ m(!1), l();
86
105
  },
87
106
  children: [
88
- o && /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
89
- /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 10, fill: "var(--background)" }),
90
- /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 8, fill: R[n.color ?? "primary"].ref }),
107
+ c && /* @__PURE__ */ e("circle", { cx: r, cy: n, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
108
+ /* @__PURE__ */ e("circle", { cx: r, cy: n, r: 10, fill: "var(--background)" }),
109
+ /* @__PURE__ */ e("circle", { cx: r, cy: n, r: 8, fill: S[i.color ?? "primary"].ref }),
91
110
  /* @__PURE__ */ e(
92
111
  "text",
93
112
  {
94
- x: t,
95
- y: r,
113
+ x: r,
114
+ y: n,
96
115
  dy: "0.35em",
97
116
  textAnchor: "middle",
98
117
  className: "pointer-events-none fill-brand-foreground text-xs font-bold select-none",
@@ -103,41 +122,41 @@ function we({
103
122
  }
104
123
  );
105
124
  }
106
- function ye({ hovered: t, frameWidth: r, format: a }) {
107
- return /* @__PURE__ */ e(pe, { reducedMotion: "user", children: /* @__PURE__ */ e(be, { children: t && /* @__PURE__ */ e(
125
+ function Se({ hovered: r, frameWidth: n, format: a }) {
126
+ return /* @__PURE__ */ e(Ae, { reducedMotion: "user", children: /* @__PURE__ */ e(Ce, { children: r && /* @__PURE__ */ e(
108
127
  "div",
109
128
  {
110
129
  className: "pointer-events-none absolute z-10",
111
130
  style: {
112
- left: Math.max(96, Math.min(t.cx, Math.max(r - 96, 96))),
113
- top: t.cy - 16
131
+ left: Math.max(96, Math.min(r.cx, Math.max(n - 96, 96))),
132
+ top: r.cy - 16
114
133
  },
115
- children: /* @__PURE__ */ g(
116
- Ne.div,
134
+ children: /* @__PURE__ */ y(
135
+ Re.div,
117
136
  {
118
- variants: Ae,
137
+ variants: Fe,
119
138
  initial: "hidden",
120
139
  animate: "visible",
121
140
  exit: "hidden",
122
141
  className: "w-max max-w-60 -translate-x-1/2 -translate-y-full origin-bottom rounded-lg bg-elevated p-3 shadow-elevation",
123
142
  children: [
124
- /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
143
+ /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
125
144
  /* @__PURE__ */ e(
126
145
  "span",
127
146
  {
128
147
  "aria-hidden": !0,
129
148
  className: "flex size-4.5 shrink-0 items-center justify-center rounded-full text-xs font-bold text-brand-foreground",
130
- style: { background: R[t.ann.color ?? "primary"].ref },
131
- children: t.n
149
+ style: { background: S[r.ann.color ?? "primary"].ref },
150
+ children: r.n
132
151
  }
133
152
  ),
134
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-foreground", children: t.ann.label })
153
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-foreground", children: r.ann.label })
135
154
  ] }),
136
- t.ann.description && /* @__PURE__ */ e("p", { className: "mt-1.5 text-xs leading-relaxed text-secondary", children: t.ann.description }),
137
- /* @__PURE__ */ g("div", { className: "mt-1.5 text-xs font-medium tracking-wide uppercase text-tertiary tabular-nums", children: [
138
- t.ann.x,
155
+ r.ann.description && /* @__PURE__ */ e("p", { className: "mt-1.5 text-xs leading-relaxed text-secondary", children: r.ann.description }),
156
+ /* @__PURE__ */ y("div", { className: "mt-1.5 text-xs font-medium tracking-wide uppercase text-tertiary tabular-nums", children: [
157
+ r.ann.x,
139
158
  " · ",
140
- a(t.ann.y)
159
+ a(r.ann.y)
141
160
  ] })
142
161
  ]
143
162
  }
@@ -145,244 +164,344 @@ function ye({ hovered: t, frameWidth: r, format: a }) {
145
164
  }
146
165
  ) }) });
147
166
  }
148
- function Y(t) {
149
- const [r, a] = N.useState(null), n = N.useCallback(() => a(null), []), { back: i, front: l } = N.useMemo(() => {
150
- const o = [], s = [];
167
+ function K(r) {
168
+ const [n, a] = k.useState(null), i = k.useCallback(() => a(null), []), { back: t, front: s } = k.useMemo(() => {
169
+ const c = [], m = [];
151
170
  let f = 0;
152
- return (t ?? []).forEach((d, v) => {
153
- const c = d.color ?? "primary";
154
- if (d.kind === "band") {
155
- const h = d.axis ?? "y";
156
- o.push(
171
+ return (r ?? []).forEach((l, g) => {
172
+ const x = l.color ?? "primary";
173
+ if (l.kind === "band") {
174
+ const u = l.axis ?? "y";
175
+ c.push(
157
176
  /* @__PURE__ */ e(
158
- xe,
177
+ ke,
159
178
  {
160
- ...h === "y" ? { y1: d.from, y2: d.to } : { x1: d.from, x2: d.to },
161
- fill: R[c].ref,
179
+ ...u === "y" ? { y1: l.from, y2: l.to } : { x1: l.from, x2: l.to },
180
+ fill: S[x].ref,
162
181
  fillOpacity: 0.06,
163
182
  stroke: "none",
164
- ifOverflow: h === "y" ? "extendDomain" : "visible",
165
- label: d.label ? /* @__PURE__ */ e(Ce, { label: d.label, color: c }) : void 0
183
+ ifOverflow: u === "y" ? "extendDomain" : "visible",
184
+ label: l.label ? /* @__PURE__ */ e(Le, { label: l.label, color: x }) : void 0
166
185
  },
167
- `ann-${v}`
186
+ `ann-${g}`
168
187
  )
169
188
  );
170
- } else if (d.kind === "line") {
171
- const h = d.axis ?? "y";
172
- s.push(
189
+ } else if (l.kind === "line") {
190
+ const u = l.axis ?? "y";
191
+ m.push(
173
192
  /* @__PURE__ */ e(
174
- ge,
193
+ Ne,
175
194
  {
176
- ...h === "y" ? { y: d.value } : { x: d.value },
177
- stroke: R[c].ref,
195
+ ...u === "y" ? { y: l.value } : { x: l.value },
196
+ stroke: S[x].ref,
178
197
  strokeWidth: 1,
179
198
  strokeDasharray: "4 4",
180
- ifOverflow: h === "y" ? "extendDomain" : "visible",
181
- label: d.label ? /* @__PURE__ */ e(ke, { label: d.label, color: c, axis: h }) : void 0
199
+ ifOverflow: u === "y" ? "extendDomain" : "visible",
200
+ label: l.label ? /* @__PURE__ */ e(Me, { label: l.label, color: x, axis: u }) : void 0
182
201
  },
183
- `ann-${v}`
202
+ `ann-${g}`
184
203
  )
185
204
  );
186
205
  } else {
187
206
  f += 1;
188
- const h = f;
189
- s.push(
207
+ const u = f;
208
+ m.push(
190
209
  /* @__PURE__ */ e(
191
- ve,
210
+ we,
192
211
  {
193
- x: d.x,
194
- y: d.y,
212
+ x: l.x,
213
+ y: l.y,
195
214
  ifOverflow: "visible",
196
- shape: (x) => /* @__PURE__ */ e(we, { cx: x.cx, cy: x.cy, n: h, ann: d, onEnter: a, onLeave: n })
215
+ shape: (d) => /* @__PURE__ */ e(Oe, { cx: d.cx, cy: d.cy, n: u, ann: l, onEnter: a, onLeave: i })
197
216
  },
198
- `ann-${v}`
217
+ `ann-${g}`
199
218
  )
200
219
  );
201
220
  }
202
- }), { back: o, front: s };
203
- }, [t, n]);
204
- return { back: i, front: l, hovered: r };
221
+ }), { back: c, front: m };
222
+ }, [r, i]);
223
+ return { back: t, front: s, hovered: n };
205
224
  }
206
- function $({
207
- items: t,
208
- align: r = "end",
225
+ function W({
226
+ items: r,
227
+ align: n = "end",
209
228
  className: a
210
229
  }) {
211
- const n = {
230
+ const i = {
212
231
  start: "justify-start",
213
232
  center: "justify-center",
214
233
  end: "justify-end"
215
- }[r];
216
- return /* @__PURE__ */ e("div", { className: k("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", n, a), children: t.map((i) => /* @__PURE__ */ g("span", { className: "inline-flex items-center gap-1.5 text-xs text-secondary", children: [
217
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: i.color } }),
218
- i.label
219
- ] }, i.label)) });
234
+ }[n];
235
+ return /* @__PURE__ */ e("div", { className: C("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", i, a), children: r.map((t) => /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5 text-xs text-secondary", children: [
236
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: t.color } }),
237
+ t.label
238
+ ] }, t.label)) });
220
239
  }
221
- const S = N.forwardRef(
222
- ({ className: t, height: r, legendItems: a, hovered: n, format: i, children: l, ...o }, s) => {
223
- var v;
224
- const f = N.useRef(null);
225
- return /* @__PURE__ */ g("div", { ref: (c) => {
226
- f.current = c, typeof s == "function" ? s(c) : s && (s.current = c);
227
- }, className: k("relative w-full font-sans", t), ...o, children: [
228
- a && /* @__PURE__ */ e($, { items: a }),
229
- /* @__PURE__ */ e(F, { width: "100%", height: r, children: l }),
230
- /* @__PURE__ */ e(ye, { hovered: n, frameWidth: ((v = f.current) == null ? void 0 : v.clientWidth) ?? 0, format: i })
240
+ const D = k.forwardRef(
241
+ ({ className: r, height: n, legendItems: a, hovered: i, format: t, children: s, ...c }, m) => {
242
+ var g;
243
+ const f = k.useRef(null);
244
+ return /* @__PURE__ */ y("div", { ref: (x) => {
245
+ f.current = x, typeof m == "function" ? m(x) : m && (m.current = x);
246
+ }, className: C("relative w-full font-sans", r), ...c, children: [
247
+ a && /* @__PURE__ */ e(W, { items: a }),
248
+ /* @__PURE__ */ e($, { width: "100%", height: n, children: s }),
249
+ /* @__PURE__ */ e(Se, { hovered: i, frameWidth: ((g = f.current) == null ? void 0 : g.clientWidth) ?? 0, format: t })
231
250
  ] });
232
251
  }
233
252
  );
234
- S.displayName = "ChartFrame";
235
- function I(t) {
236
- const { data: r, categoryKey: a, series: n, seriesLabels: i, highlight: l, annotations: o, grid: s = !0, legend: f, showYAxis: d = !0, formatValue: v } = t, c = N.useMemo(() => n ?? X(r, a), [n, r, a]), h = v ?? w, x = Y(o), p = (A, T) => l && c.includes(l) ? A === l ? "var(--color-chart-1)" : P : V(T), m = (A) => (i == null ? void 0 : i[A]) ?? A, u = f ?? c.length > 1 ? c.map((A, T) => ({ label: m(A), color: p(A, T) })) : null;
237
- return { names: c, format: h, layers: x, legendItems: u, furniture: [
238
- s ? /* @__PURE__ */ e(E, { vertical: !1, stroke: "var(--border)" }, "grid") : null,
253
+ D.displayName = "ChartFrame";
254
+ function z(r) {
255
+ const {
256
+ data: n,
257
+ categoryKey: a,
258
+ series: i,
259
+ seriesLabels: t,
260
+ highlight: s,
261
+ annotations: c,
262
+ grid: m = !0,
263
+ legend: f,
264
+ showYAxis: l = !0,
265
+ formatValue: g,
266
+ xScale: x = "category",
267
+ xDomain: u,
268
+ yDomain: d,
269
+ xTickFormatter: p,
270
+ yTickFormatter: h,
271
+ yAxisWidth: o = 44
272
+ } = r, v = k.useMemo(() => i ?? Q(n, a), [i, n, a]), b = g ?? L, N = h ?? ((R) => typeof R == "number" ? b(R) : R), O = K(c), w = (R, P) => s && v.includes(s) ? R === s ? "var(--color-chart-1)" : _ : J(P), A = (R) => (t == null ? void 0 : t[R]) ?? R, te = f ?? v.length > 1 ? v.map((R, P) => ({ label: A(R), color: w(R, P) })) : null;
273
+ return { names: v, format: b, layers: O, legendItems: te, furniture: [
274
+ m ? /* @__PURE__ */ e(Y, { vertical: !1, stroke: "var(--border)" }, "grid") : null,
239
275
  /* @__PURE__ */ e(
240
- _,
276
+ H,
241
277
  {
242
278
  dataKey: a,
279
+ type: x === "time" ? "number" : "category",
280
+ scale: x === "time" ? "time" : "auto",
281
+ domain: x === "time" ? u ?? ["dataMin", "dataMax"] : u,
282
+ allowDataOverflow: !!u,
243
283
  axisLine: !1,
244
284
  tickLine: !1,
245
285
  minTickGap: 28,
246
286
  tickMargin: 10,
247
- tick: /* @__PURE__ */ e(L, { anchor: "middle", dy: 0 })
287
+ tick: /* @__PURE__ */ e(T, { anchor: "middle", dy: 0, format: p })
248
288
  },
249
289
  "x"
250
290
  ),
251
- d ? /* @__PURE__ */ e(
252
- D,
291
+ l ? /* @__PURE__ */ e(
292
+ I,
253
293
  {
254
- width: 44,
294
+ width: o,
295
+ domain: d,
296
+ allowDataOverflow: !!d,
255
297
  axisLine: !1,
256
298
  tickLine: !1,
257
299
  tickMargin: 6,
258
- tick: /* @__PURE__ */ e(L, { anchor: "end", dy: "0.32em", format: h })
300
+ tick: /* @__PURE__ */ e(T, { anchor: "end", dy: "0.32em", format: N })
259
301
  },
260
302
  "y"
261
303
  ) : null
262
- ], colorFor: p, labelFor: m };
304
+ ], colorFor: w, labelFor: A };
263
305
  }
264
- const O = { top: 20, right: 12, bottom: 4, left: 0 }, Re = N.forwardRef(
265
- ({ height: t = 280, curve: r = "natural", forecastKeys: a, className: n, ...i }, l) => {
266
- const { names: o, format: s, layers: f, legendItems: d, furniture: v, colorFor: c, labelFor: h } = I(i);
267
- return /* @__PURE__ */ e(S, { ref: l, className: n, height: t, legendItems: d, hovered: f.hovered, format: s, children: /* @__PURE__ */ g(q, { data: i.data, margin: O, children: [
268
- v,
269
- /* @__PURE__ */ e(
270
- C,
306
+ const j = { top: 20, right: 12, bottom: 4, left: 0 }, Te = k.forwardRef(
307
+ ({ height: r = 280, curve: n = "natural", forecastKeys: a, className: i, ...t }, s) => {
308
+ const { names: c, format: m, layers: f, legendItems: l, furniture: g, colorFor: x, labelFor: u } = z(t);
309
+ return /* @__PURE__ */ e(D, { ref: s, className: i, height: r, legendItems: l, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(re, { data: t.data, margin: j, children: [
310
+ g,
311
+ t.tooltip !== !1 && /* @__PURE__ */ e(
312
+ F,
271
313
  {
272
- content: /* @__PURE__ */ e(y, { format: s }),
314
+ content: /* @__PURE__ */ e(
315
+ M,
316
+ {
317
+ format: m,
318
+ renderer: t.tooltip
319
+ }
320
+ ),
273
321
  cursor: { stroke: "var(--border-strong)" },
274
322
  isAnimationActive: !1
275
323
  }
276
324
  ),
277
325
  f.back,
278
- o.map((x, p) => /* @__PURE__ */ e(
279
- z,
326
+ c.map((d, p) => /* @__PURE__ */ e(
327
+ U,
280
328
  {
281
- dataKey: x,
282
- name: h(x),
283
- type: r,
284
- stroke: c(x, p),
329
+ dataKey: d,
330
+ name: u(d),
331
+ type: n,
332
+ stroke: x(d, p),
285
333
  strokeWidth: 2,
286
- strokeDasharray: a != null && a.includes(x) ? "6 4" : void 0,
334
+ strokeDasharray: a != null && a.includes(d) ? "6 4" : void 0,
287
335
  dot: !1,
288
336
  activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
289
337
  isAnimationActive: !1
290
338
  },
291
- x
339
+ d
292
340
  )),
293
341
  f.front
294
342
  ] }) });
295
343
  }
296
344
  );
297
- Re.displayName = "LineChart";
298
- const Me = N.forwardRef(
299
- ({ height: t = 280, curve: r = "natural", stacked: a = !1, forecastKeys: n, className: i, ...l }, o) => {
300
- const { names: s, format: f, layers: d, legendItems: v, furniture: c, colorFor: h, labelFor: x } = I(l), p = N.useId().replace(/[^a-zA-Z0-9]/g, "");
301
- return /* @__PURE__ */ e(S, { ref: o, className: i, height: t, legendItems: v, hovered: d.hovered, format: f, children: /* @__PURE__ */ g(J, { data: l.data, margin: O, children: [
302
- /* @__PURE__ */ e("defs", { children: s.map((m, u) => /* @__PURE__ */ g("linearGradient", { id: `${p}-${u}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
303
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: h(m, u), stopOpacity: 0.18 }),
304
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: h(m, u), stopOpacity: 0.02 })
305
- ] }, m)) }),
306
- c,
307
- /* @__PURE__ */ e(
308
- C,
345
+ Te.displayName = "LineChart";
346
+ const Be = k.forwardRef(
347
+ ({ height: r = 280, curve: n = "natural", stacked: a = !1, forecastKeys: i, className: t, ...s }, c) => {
348
+ const { names: m, format: f, layers: l, legendItems: g, furniture: x, colorFor: u, labelFor: d } = z(s), p = k.useId().replace(/[^a-zA-Z0-9]/g, "");
349
+ return /* @__PURE__ */ e(D, { ref: c, className: t, height: r, legendItems: g, hovered: l.hovered, format: f, children: /* @__PURE__ */ y(ae, { data: s.data, margin: j, children: [
350
+ /* @__PURE__ */ e("defs", { children: m.map((h, o) => /* @__PURE__ */ y("linearGradient", { id: `${p}-${o}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
351
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: u(h, o), stopOpacity: 0.18 }),
352
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: u(h, o), stopOpacity: 0.02 })
353
+ ] }, h)) }),
354
+ x,
355
+ s.tooltip !== !1 && /* @__PURE__ */ e(
356
+ F,
309
357
  {
310
- content: /* @__PURE__ */ e(y, { format: f }),
358
+ content: /* @__PURE__ */ e(
359
+ M,
360
+ {
361
+ format: f,
362
+ renderer: s.tooltip
363
+ }
364
+ ),
311
365
  cursor: { stroke: "var(--border-strong)" },
312
366
  isAnimationActive: !1
313
367
  }
314
368
  ),
315
- d.back,
316
- s.map((m, u) => /* @__PURE__ */ e(
317
- Q,
369
+ l.back,
370
+ m.map((h, o) => /* @__PURE__ */ e(
371
+ ne,
318
372
  {
319
- dataKey: m,
320
- name: x(m),
321
- type: r,
373
+ dataKey: h,
374
+ name: d(h),
375
+ type: n,
322
376
  stackId: a ? "stack" : void 0,
323
- stroke: h(m, u),
377
+ stroke: u(h, o),
324
378
  strokeWidth: 2,
325
- strokeDasharray: n != null && n.includes(m) ? "6 4" : void 0,
326
- fill: `url(#${p}-${u})`,
379
+ strokeDasharray: i != null && i.includes(h) ? "6 4" : void 0,
380
+ fill: `url(#${p}-${o})`,
327
381
  activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
328
382
  isAnimationActive: !1
329
383
  },
330
- m
384
+ h
331
385
  )),
332
- d.front
386
+ l.front
333
387
  ] }) });
334
388
  }
335
389
  );
336
- Me.displayName = "AreaChart";
337
- const Fe = N.forwardRef(
338
- ({ height: t = 280, stacked: r = !1, className: a, ...n }, i) => {
339
- const { names: l, format: o, layers: s, legendItems: f, furniture: d, colorFor: v, labelFor: c } = I(n), h = n.highlight && l.length === 1 && !l.includes(n.highlight) ? n.highlight : null;
340
- return /* @__PURE__ */ e(S, { ref: i, className: a, height: t, legendItems: f, hovered: s.hovered, format: o, children: /* @__PURE__ */ g(K, { data: n.data, margin: O, barCategoryGap: "24%", children: [
341
- d,
390
+ Be.displayName = "AreaChart";
391
+ const $e = k.forwardRef(
392
+ ({
393
+ height: r = 280,
394
+ stacked: n = !1,
395
+ layout: a = "vertical",
396
+ className: i,
397
+ ...t
398
+ }, s) => {
399
+ const { names: c, format: m, layers: f, legendItems: l, furniture: g, colorFor: x, labelFor: u } = z(t), d = a === "horizontal", p = t.xTickFormatter ?? ((v) => typeof v == "number" ? m(v) : v), h = [
400
+ t.grid !== !1 ? /* @__PURE__ */ e(
401
+ Y,
402
+ {
403
+ horizontal: !1,
404
+ vertical: !0,
405
+ stroke: "var(--border)"
406
+ },
407
+ "grid"
408
+ ) : null,
342
409
  /* @__PURE__ */ e(
343
- C,
410
+ H,
344
411
  {
345
- content: /* @__PURE__ */ e(y, { format: o }),
346
- cursor: { fill: "var(--muted)" },
347
- isAnimationActive: !1
348
- }
412
+ type: "number",
413
+ domain: t.xDomain,
414
+ allowDataOverflow: !!t.xDomain,
415
+ axisLine: !1,
416
+ tickLine: !1,
417
+ minTickGap: 28,
418
+ tickMargin: 10,
419
+ tick: /* @__PURE__ */ e(T, { anchor: "middle", dy: 0, format: p })
420
+ },
421
+ "x"
349
422
  ),
350
- s.back,
351
- l.map((x, p) => {
352
- const m = r ? p === l.length - 1 : !0;
353
- return /* @__PURE__ */ e(
354
- G,
355
- {
356
- dataKey: x,
357
- name: c(x),
358
- stackId: r ? "stack" : void 0,
359
- fill: v(x, p),
360
- radius: m ? [4, 4, 0, 0] : 0,
361
- maxBarSize: 48,
362
- isAnimationActive: !1,
363
- children: h && n.data.map((u) => /* @__PURE__ */ e(
364
- W,
423
+ t.showYAxis !== !1 ? /* @__PURE__ */ e(
424
+ I,
425
+ {
426
+ type: "category",
427
+ dataKey: t.categoryKey,
428
+ width: t.yAxisWidth ?? 144,
429
+ axisLine: !1,
430
+ tickLine: !1,
431
+ tickMargin: 6,
432
+ tick: /* @__PURE__ */ e(
433
+ T,
434
+ {
435
+ anchor: "end",
436
+ dy: "0.32em",
437
+ format: t.yTickFormatter
438
+ }
439
+ )
440
+ },
441
+ "y"
442
+ ) : null
443
+ ], o = t.highlight && c.length === 1 && !c.includes(t.highlight) ? t.highlight : null;
444
+ return /* @__PURE__ */ e(D, { ref: s, className: i, height: r, legendItems: l, hovered: f.hovered, format: m, children: /* @__PURE__ */ y(
445
+ ie,
446
+ {
447
+ data: t.data,
448
+ layout: d ? "vertical" : "horizontal",
449
+ margin: j,
450
+ barCategoryGap: "24%",
451
+ children: [
452
+ d ? h : g,
453
+ t.tooltip !== !1 && /* @__PURE__ */ e(
454
+ F,
455
+ {
456
+ content: /* @__PURE__ */ e(
457
+ M,
458
+ {
459
+ format: m,
460
+ renderer: t.tooltip
461
+ }
462
+ ),
463
+ cursor: { fill: "var(--muted)" },
464
+ isAnimationActive: !1
465
+ }
466
+ ),
467
+ f.back,
468
+ c.map((v, b) => {
469
+ const N = n ? b === c.length - 1 : !0, O = d ? [0, 4, 4, 0] : [4, 4, 0, 0];
470
+ return /* @__PURE__ */ e(
471
+ Z,
365
472
  {
366
- fill: u[n.categoryKey] === h ? "var(--color-chart-1)" : P
473
+ dataKey: v,
474
+ name: u(v),
475
+ stackId: n ? "stack" : void 0,
476
+ fill: x(v, b),
477
+ radius: N ? O : 0,
478
+ maxBarSize: 48,
479
+ isAnimationActive: !1,
480
+ children: o && t.data.map((w) => /* @__PURE__ */ e(
481
+ X,
482
+ {
483
+ fill: w[t.categoryKey] === o ? "var(--color-chart-1)" : _
484
+ },
485
+ String(w[t.categoryKey])
486
+ ))
367
487
  },
368
- String(u[n.categoryKey])
369
- ))
370
- },
371
- x
372
- );
373
- }),
374
- s.front
375
- ] }) });
488
+ v
489
+ );
490
+ }),
491
+ f.front
492
+ ]
493
+ }
494
+ ) });
376
495
  }
377
496
  );
378
- Fe.displayName = "BarChart";
379
- const U = N.forwardRef(
380
- ({ height: t = 280, lineKeys: r, dualAxis: a = !1, stacked: n = !1, forecastKeys: i, className: l, ...o }, s) => {
381
- const { names: f, format: d, layers: v, legendItems: c, furniture: h, colorFor: x, labelFor: p } = I(o), m = f.filter((u) => !r.includes(u));
382
- return /* @__PURE__ */ e(S, { ref: s, className: l, height: t, legendItems: c, hovered: v.hovered, format: d, children: /* @__PURE__ */ g(ee, { data: o.data, margin: O, barCategoryGap: "24%", children: [
383
- h,
497
+ $e.displayName = "BarChart";
498
+ const ee = k.forwardRef(
499
+ ({ height: r = 280, lineKeys: n, dualAxis: a = !1, stacked: i = !1, forecastKeys: t, className: s, ...c }, m) => {
500
+ const { names: f, format: l, layers: g, legendItems: x, furniture: u, colorFor: d, labelFor: p } = z(c), h = f.filter((o) => !n.includes(o));
501
+ return /* @__PURE__ */ e(D, { ref: m, className: s, height: r, legendItems: x, hovered: g.hovered, format: l, children: /* @__PURE__ */ y(oe, { data: c.data, margin: j, barCategoryGap: "24%", children: [
502
+ u,
384
503
  a && /* @__PURE__ */ e(
385
- D,
504
+ I,
386
505
  {
387
506
  yAxisId: "right",
388
507
  orientation: "right",
@@ -390,232 +509,294 @@ const U = N.forwardRef(
390
509
  axisLine: !1,
391
510
  tickLine: !1,
392
511
  tickMargin: 6,
393
- tick: /* @__PURE__ */ e(L, { anchor: "start", dy: "0.32em", format: d })
512
+ tick: /* @__PURE__ */ e(
513
+ T,
514
+ {
515
+ anchor: "start",
516
+ dy: "0.32em",
517
+ format: (o) => typeof o == "number" ? l(o) : o
518
+ }
519
+ )
394
520
  }
395
521
  ),
396
- /* @__PURE__ */ e(
397
- C,
522
+ c.tooltip !== !1 && /* @__PURE__ */ e(
523
+ F,
398
524
  {
399
- content: /* @__PURE__ */ e(y, { format: d }),
525
+ content: /* @__PURE__ */ e(
526
+ M,
527
+ {
528
+ format: l,
529
+ renderer: c.tooltip
530
+ }
531
+ ),
400
532
  cursor: { fill: "var(--muted)" },
401
533
  isAnimationActive: !1
402
534
  }
403
535
  ),
404
- v.back,
405
- m.map((u) => {
406
- const b = f.indexOf(u), A = n ? u === m[m.length - 1] : !0;
536
+ g.back,
537
+ h.map((o) => {
538
+ const v = f.indexOf(o), b = i ? o === h[h.length - 1] : !0;
407
539
  return /* @__PURE__ */ e(
408
- G,
540
+ Z,
409
541
  {
410
- dataKey: u,
411
- name: p(u),
412
- stackId: n ? "stack" : void 0,
413
- fill: x(u, b),
414
- radius: A ? [4, 4, 0, 0] : 0,
542
+ dataKey: o,
543
+ name: p(o),
544
+ stackId: i ? "stack" : void 0,
545
+ fill: d(o, v),
546
+ radius: b ? [4, 4, 0, 0] : 0,
415
547
  maxBarSize: 48,
416
548
  isAnimationActive: !1
417
549
  },
418
- u
550
+ o
419
551
  );
420
552
  }),
421
- r.map((u) => {
422
- const b = f.indexOf(u);
553
+ n.map((o) => {
554
+ const v = f.indexOf(o);
423
555
  return /* @__PURE__ */ e(
424
- z,
556
+ U,
425
557
  {
426
- dataKey: u,
427
- name: p(u),
558
+ dataKey: o,
559
+ name: p(o),
428
560
  yAxisId: a ? "right" : void 0,
429
561
  type: "natural",
430
- stroke: x(u, b),
562
+ stroke: d(o, v),
431
563
  strokeWidth: 2,
432
- strokeDasharray: i != null && i.includes(u) ? "6 4" : void 0,
564
+ strokeDasharray: t != null && t.includes(o) ? "6 4" : void 0,
433
565
  dot: !1,
434
566
  activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
435
567
  isAnimationActive: !1
436
568
  },
437
- u
569
+ o
438
570
  );
439
571
  }),
440
- v.front
572
+ g.front
441
573
  ] }) });
442
574
  }
443
575
  );
444
- U.displayName = "ComboChart";
445
- const Se = N.forwardRef(
446
- (t, r) => /* @__PURE__ */ e(U, { ref: r, ...t })
576
+ ee.displayName = "ComboChart";
577
+ const De = k.forwardRef(
578
+ (r, n) => /* @__PURE__ */ e(ee, { ref: n, ...r })
447
579
  );
448
- Se.displayName = "ComposedChart";
449
- function Le({
450
- active: t,
451
- payload: r,
452
- labelKey: a,
453
- format: n
454
- }) {
455
- var o;
456
- if (!t || !(r != null && r.length)) return null;
457
- const i = (o = r[0]) == null ? void 0 : o.payload, l = a && i ? i[a] : void 0;
458
- return /* @__PURE__ */ g("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
459
- l != null && /* @__PURE__ */ e("div", { className: "mb-1 text-xs font-medium tracking-wide uppercase text-background/60", children: l }),
460
- r.map((s, f) => /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
461
- /* @__PURE__ */ e("span", { className: "text-background/70", children: s.name }),
462
- /* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof s.value == "number" ? n(s.value) : String(s.value ?? "") })
463
- ] }, f))
464
- ] });
465
- }
466
- const Oe = N.forwardRef(
467
- ({ data: t, xKey: r, yKey: a, labelKey: n, annotations: i, height: l = 280, grid: o = !0, showYAxis: s = !0, formatValue: f, className: d }, v) => {
468
- const c = f ?? w, h = Y(i);
469
- return /* @__PURE__ */ e(S, { ref: v, className: d, height: l, legendItems: null, hovered: h.hovered, format: c, children: /* @__PURE__ */ g(te, { margin: O, children: [
470
- o && /* @__PURE__ */ e(E, { vertical: !1, stroke: "var(--border)" }),
580
+ De.displayName = "ComposedChart";
581
+ const je = k.forwardRef(
582
+ ({
583
+ data: r,
584
+ xKey: n,
585
+ yKey: a,
586
+ labelKey: i,
587
+ annotations: t,
588
+ height: s = 280,
589
+ grid: c = !0,
590
+ showYAxis: m = !0,
591
+ formatValue: f,
592
+ xScale: l = "number",
593
+ xDomain: g,
594
+ yDomain: x,
595
+ xTickFormatter: u,
596
+ yTickFormatter: d,
597
+ yAxisWidth: p = 44,
598
+ tooltip: h,
599
+ className: o
600
+ }, v) => {
601
+ const b = f ?? L, N = u ?? ((A) => typeof A == "number" ? L(A) : A), O = d ?? ((A) => typeof A == "number" ? b(A) : A), w = K(t);
602
+ return /* @__PURE__ */ e(D, { ref: v, className: o, height: s, legendItems: null, hovered: w.hovered, format: b, children: /* @__PURE__ */ y(le, { margin: j, children: [
603
+ c && /* @__PURE__ */ e(Y, { vertical: !1, stroke: "var(--border)" }),
471
604
  /* @__PURE__ */ e(
472
- _,
605
+ H,
473
606
  {
474
607
  type: "number",
475
- dataKey: r,
476
- domain: ["auto", "auto"],
608
+ dataKey: n,
609
+ scale: l === "time" ? "time" : "auto",
610
+ domain: g ?? (l === "time" ? ["dataMin", "dataMax"] : ["auto", "auto"]),
611
+ allowDataOverflow: !!g,
477
612
  axisLine: !1,
478
613
  tickLine: !1,
479
614
  minTickGap: 28,
480
615
  tickMargin: 10,
481
- tick: /* @__PURE__ */ e(L, { anchor: "middle", dy: 0, format: w })
616
+ tick: /* @__PURE__ */ e(T, { anchor: "middle", dy: 0, format: N })
482
617
  }
483
618
  ),
484
- s && /* @__PURE__ */ e(
485
- D,
619
+ m && /* @__PURE__ */ e(
620
+ I,
486
621
  {
487
622
  type: "number",
488
623
  dataKey: a,
489
- width: 44,
624
+ width: p,
625
+ domain: x,
626
+ allowDataOverflow: !!x,
490
627
  axisLine: !1,
491
628
  tickLine: !1,
492
629
  tickMargin: 6,
493
- tick: /* @__PURE__ */ e(L, { anchor: "end", dy: "0.32em", format: c })
630
+ tick: /* @__PURE__ */ e(T, { anchor: "end", dy: "0.32em", format: O })
494
631
  }
495
632
  ),
496
- /* @__PURE__ */ e(
497
- C,
633
+ h !== !1 && /* @__PURE__ */ e(
634
+ F,
498
635
  {
499
- content: /* @__PURE__ */ e(Le, { labelKey: n, format: c }),
636
+ content: /* @__PURE__ */ e(
637
+ M,
638
+ {
639
+ format: b,
640
+ labelKey: i,
641
+ renderer: h
642
+ }
643
+ ),
500
644
  cursor: { stroke: "var(--border-strong)", strokeDasharray: "4 4" },
501
645
  isAnimationActive: !1
502
646
  }
503
647
  ),
504
- h.back,
648
+ w.back,
505
649
  /* @__PURE__ */ e(
506
- re,
650
+ se,
507
651
  {
508
- data: t,
652
+ data: r,
509
653
  fill: "var(--color-chart-1)",
510
- shape: (x) => /* @__PURE__ */ e("circle", { cx: x.cx, cy: x.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
654
+ shape: (A) => /* @__PURE__ */ e("circle", { cx: A.cx, cy: A.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
511
655
  isAnimationActive: !1
512
656
  }
513
657
  ),
514
- h.front
658
+ w.front
515
659
  ] }) });
516
660
  }
517
661
  );
518
- Oe.displayName = "ScatterChart";
519
- const $e = N.forwardRef(
520
- ({ data: t, nameKey: r, valueKey: a, donut: n = !0, centerLabel: i, highlight: l, height: o = 260, legend: s = !0, formatValue: f, className: d }, v) => {
521
- const c = f ?? w, h = t.reduce((m, u) => m + (typeof u[a] == "number" ? u[a] : 0), 0), x = (m, u) => l ? m === l ? "var(--color-chart-1)" : M(Math.min(u + 3, j.length - 1)) : M(u), p = s ? t.map((m, u) => ({
522
- label: `${m[r]} · ${h ? Math.round(Number(m[a]) / h * 100) : 0}%`,
523
- color: x(String(m[r]), u)
662
+ je.displayName = "ScatterChart";
663
+ const Ie = k.forwardRef(
664
+ ({
665
+ data: r,
666
+ nameKey: n,
667
+ valueKey: a,
668
+ donut: i = !0,
669
+ centerLabel: t,
670
+ highlight: s,
671
+ height: c = 260,
672
+ legend: m = !0,
673
+ formatValue: f,
674
+ tooltip: l,
675
+ className: g
676
+ }, x) => {
677
+ const u = f ?? L, d = r.reduce((o, v) => o + (typeof v[a] == "number" ? v[a] : 0), 0), p = (o, v) => s ? o === s ? "var(--color-chart-1)" : B(Math.min(v + 3, E.length - 1)) : B(v), h = m ? r.map((o, v) => ({
678
+ label: `${o[n]} · ${d ? Math.round(Number(o[a]) / d * 100) : 0}%`,
679
+ color: p(String(o[n]), v)
524
680
  })) : null;
525
- return /* @__PURE__ */ g("div", { ref: v, className: k("relative w-full font-sans", d), children: [
526
- p && /* @__PURE__ */ e($, { items: p }),
527
- /* @__PURE__ */ g("div", { className: "relative", children: [
528
- /* @__PURE__ */ e(F, { width: "100%", height: o, children: /* @__PURE__ */ g(ae, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
529
- /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: c }), isAnimationActive: !1 }),
681
+ return /* @__PURE__ */ y("div", { ref: x, className: C("relative w-full font-sans", g), children: [
682
+ h && /* @__PURE__ */ e(W, { items: h }),
683
+ /* @__PURE__ */ y("div", { className: "relative", children: [
684
+ /* @__PURE__ */ e($, { width: "100%", height: c, children: /* @__PURE__ */ y(ce, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
685
+ l !== !1 && /* @__PURE__ */ e(
686
+ F,
687
+ {
688
+ content: /* @__PURE__ */ e(
689
+ M,
690
+ {
691
+ format: u,
692
+ renderer: l
693
+ }
694
+ ),
695
+ isAnimationActive: !1
696
+ }
697
+ ),
530
698
  /* @__PURE__ */ e(
531
- ne,
699
+ de,
532
700
  {
533
- data: t,
701
+ data: r,
534
702
  dataKey: a,
535
- nameKey: r,
536
- innerRadius: n ? "62%" : 0,
703
+ nameKey: n,
704
+ innerRadius: i ? "62%" : 0,
537
705
  outerRadius: "88%",
538
- paddingAngle: n ? 2 : 1,
539
- cornerRadius: n ? 4 : 2,
706
+ paddingAngle: i ? 2 : 1,
707
+ cornerRadius: i ? 4 : 2,
540
708
  stroke: "none",
541
709
  isAnimationActive: !1,
542
- children: t.map((m, u) => /* @__PURE__ */ e(W, { fill: x(String(m[r]), u) }, String(m[r])))
710
+ children: r.map((o, v) => /* @__PURE__ */ e(X, { fill: p(String(o[n]), v) }, String(o[n])))
543
711
  }
544
712
  )
545
713
  ] }) }),
546
- n && /* @__PURE__ */ g("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
547
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: c(h) }),
548
- i && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: i })
714
+ i && /* @__PURE__ */ y("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
715
+ /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: u(d) }),
716
+ t && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: t })
549
717
  ] })
550
718
  ] })
551
719
  ] });
552
720
  }
553
721
  );
554
- $e.displayName = "PieChart";
555
- const Ie = N.forwardRef(
722
+ Ie.displayName = "PieChart";
723
+ const We = k.forwardRef(
556
724
  ({
557
- data: t,
558
- categoryKey: r,
725
+ data: r,
726
+ categoryKey: n,
559
727
  series: a,
560
- seriesLabels: n,
561
- highlight: i,
562
- maxValue: l,
563
- height: o = 300,
564
- legend: s,
728
+ seriesLabels: i,
729
+ highlight: t,
730
+ maxValue: s,
731
+ height: c = 300,
732
+ legend: m,
565
733
  formatValue: f,
566
- className: d
567
- }, v) => {
568
- const c = N.useMemo(
569
- () => a ?? X(t, r),
570
- [r, t, a]
571
- ), h = f ?? w, x = l ?? Math.max(
734
+ tooltip: l,
735
+ className: g
736
+ }, x) => {
737
+ const u = k.useMemo(
738
+ () => a ?? Q(r, n),
739
+ [n, r, a]
740
+ ), d = f ?? L, p = s ?? Math.max(
572
741
  1,
573
- ...t.flatMap(
574
- (b) => c.map(
575
- (A) => typeof b[A] == "number" ? b[A] : 0
742
+ ...r.flatMap(
743
+ (b) => u.map(
744
+ (N) => typeof b[N] == "number" ? b[N] : 0
576
745
  )
577
746
  )
578
- ), p = (b) => (n == null ? void 0 : n[b]) ?? b, m = (b, A) => i && c.includes(i) ? b === i ? "var(--color-chart-1)" : P : V(A), u = s ?? c.length > 1 ? c.map((b, A) => ({ label: p(b), color: m(b, A) })) : null;
579
- return /* @__PURE__ */ g("div", { ref: v, className: k("relative w-full font-sans", d), children: [
580
- u && /* @__PURE__ */ e($, { items: u, align: "center" }),
581
- /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(F, { width: "100%", height: o, children: /* @__PURE__ */ g(
582
- ie,
747
+ ), h = (b) => (i == null ? void 0 : i[b]) ?? b, o = (b, N) => t && u.includes(t) ? b === t ? "var(--color-chart-1)" : _ : J(N), v = m ?? u.length > 1 ? u.map((b, N) => ({ label: h(b), color: o(b, N) })) : null;
748
+ return /* @__PURE__ */ y("div", { ref: x, className: C("relative w-full font-sans", g), children: [
749
+ v && /* @__PURE__ */ e(W, { items: v, align: "center" }),
750
+ /* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e($, { width: "100%", height: c, children: /* @__PURE__ */ y(
751
+ me,
583
752
  {
584
- data: t,
753
+ data: r,
585
754
  cx: "50%",
586
755
  cy: "52%",
587
756
  outerRadius: "68%",
588
757
  margin: { top: 10, right: 56, bottom: 16, left: 56 },
589
758
  children: [
590
- /* @__PURE__ */ e(le, { stroke: "var(--border)", radialLines: !0 }),
759
+ /* @__PURE__ */ e(fe, { stroke: "var(--border)", radialLines: !0 }),
591
760
  /* @__PURE__ */ e(
592
- H,
761
+ q,
593
762
  {
594
- dataKey: r,
763
+ dataKey: n,
595
764
  tick: { fill: "var(--text-secondary)", fontSize: 11, fontWeight: 500 }
596
765
  }
597
766
  ),
598
767
  /* @__PURE__ */ e(
599
- oe,
768
+ ue,
600
769
  {
601
770
  angle: 90,
602
- domain: [0, x],
771
+ domain: [0, p],
603
772
  tick: !1,
604
773
  axisLine: !1,
605
774
  tickLine: !1
606
775
  }
607
776
  ),
608
- /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: h }), isAnimationActive: !1 }),
609
- c.map((b, A) => /* @__PURE__ */ e(
610
- se,
777
+ l !== !1 && /* @__PURE__ */ e(
778
+ F,
779
+ {
780
+ content: /* @__PURE__ */ e(
781
+ M,
782
+ {
783
+ format: d,
784
+ renderer: l
785
+ }
786
+ ),
787
+ isAnimationActive: !1
788
+ }
789
+ ),
790
+ u.map((b, N) => /* @__PURE__ */ e(
791
+ he,
611
792
  {
612
793
  dataKey: b,
613
- name: p(b),
614
- stroke: m(b, A),
615
- fill: m(b, A),
616
- fillOpacity: i ? b === i ? 0.16 : 0.05 : 0.1,
794
+ name: h(b),
795
+ stroke: o(b, N),
796
+ fill: o(b, N),
797
+ fillOpacity: t ? b === t ? 0.16 : 0.05 : 0.1,
617
798
  strokeWidth: 2,
618
- dot: { r: 2.5, fill: m(b, A), strokeWidth: 0 },
799
+ dot: { r: 2.5, fill: o(b, N), strokeWidth: 0 },
619
800
  isAnimationActive: !1
620
801
  },
621
802
  b
@@ -626,46 +807,59 @@ const Ie = N.forwardRef(
626
807
  ] });
627
808
  }
628
809
  );
629
- Ie.displayName = "RadarChart";
630
- const Te = N.forwardRef(
810
+ We.displayName = "RadarChart";
811
+ const ze = k.forwardRef(
631
812
  ({
632
- data: t,
633
- nameKey: r,
813
+ data: r,
814
+ nameKey: n,
634
815
  valueKey: a,
635
- maxValue: n = 100,
636
- centerLabel: i,
637
- height: l = 280,
638
- legend: o = !0,
639
- formatValue: s,
640
- className: f
641
- }, d) => {
642
- const v = s ?? w, c = t.map((p, m) => ({
643
- ...p,
644
- name: String(p[r]),
645
- fill: M(m)
646
- })), h = c.length ? c.reduce(
647
- (p, m) => p + (typeof m[a] == "number" ? m[a] : 0),
816
+ maxValue: i = 100,
817
+ centerLabel: t,
818
+ height: s = 280,
819
+ legend: c = !0,
820
+ formatValue: m,
821
+ tooltip: f,
822
+ className: l
823
+ }, g) => {
824
+ const x = m ?? L, u = r.map((h, o) => ({
825
+ ...h,
826
+ name: String(h[n]),
827
+ fill: B(o)
828
+ })), d = u.length ? u.reduce(
829
+ (h, o) => h + (typeof o[a] == "number" ? o[a] : 0),
648
830
  0
649
- ) / c.length : 0, x = o ? c.map((p, m) => ({
650
- label: String(p[r]),
651
- color: M(m)
831
+ ) / u.length : 0, p = c ? u.map((h, o) => ({
832
+ label: String(h[n]),
833
+ color: B(o)
652
834
  })) : null;
653
- return /* @__PURE__ */ g("div", { ref: d, className: k("relative w-full font-sans", f), children: [
654
- /* @__PURE__ */ g("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
655
- /* @__PURE__ */ e(F, { width: "100%", height: l, children: /* @__PURE__ */ g(
656
- ce,
835
+ return /* @__PURE__ */ y("div", { ref: g, className: C("relative w-full font-sans", l), children: [
836
+ /* @__PURE__ */ y("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
837
+ /* @__PURE__ */ e($, { width: "100%", height: s, children: /* @__PURE__ */ y(
838
+ xe,
657
839
  {
658
- data: c,
840
+ data: u,
659
841
  innerRadius: "48%",
660
842
  outerRadius: "82%",
661
843
  startAngle: 90,
662
844
  endAngle: -270,
663
845
  margin: { top: 6, right: 6, bottom: 6, left: 6 },
664
846
  children: [
665
- /* @__PURE__ */ e(H, { type: "number", domain: [0, n], tick: !1 }),
666
- /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: v }), isAnimationActive: !1 }),
847
+ /* @__PURE__ */ e(q, { type: "number", domain: [0, i], tick: !1 }),
848
+ f !== !1 && /* @__PURE__ */ e(
849
+ F,
850
+ {
851
+ content: /* @__PURE__ */ e(
852
+ M,
853
+ {
854
+ format: x,
855
+ renderer: f
856
+ }
857
+ ),
858
+ isAnimationActive: !1
859
+ }
860
+ ),
667
861
  /* @__PURE__ */ e(
668
- de,
862
+ ve,
669
863
  {
670
864
  dataKey: a,
671
865
  background: { fill: "var(--muted)" },
@@ -677,71 +871,71 @@ const Te = N.forwardRef(
677
871
  ]
678
872
  }
679
873
  ) }),
680
- /* @__PURE__ */ g("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
681
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: v(Math.round(h)) }),
682
- i && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: i })
874
+ /* @__PURE__ */ y("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
875
+ /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: x(Math.round(d)) }),
876
+ t && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: t })
683
877
  ] })
684
878
  ] }),
685
- x && /* @__PURE__ */ e($, { items: x, align: "center", className: "mb-0 mt-3" })
879
+ p && /* @__PURE__ */ e(W, { items: p, align: "center", className: "mb-0 mt-3" })
686
880
  ] });
687
881
  }
688
882
  );
689
- Te.displayName = "RadialBarChart";
690
- function je({
691
- x: t = 0,
692
- y: r = 0,
883
+ ze.displayName = "RadialBarChart";
884
+ function Pe({
885
+ x: r = 0,
886
+ y: n = 0,
693
887
  width: a = 0,
694
- height: n = 0,
695
- depth: i = 0,
696
- index: l = 0,
697
- name: o,
698
- value: s,
699
- format: f = w
888
+ height: i = 0,
889
+ depth: t = 0,
890
+ index: s = 0,
891
+ name: c,
892
+ value: m,
893
+ format: f = L
700
894
  }) {
701
- if (i === 0) return /* @__PURE__ */ e("g", {});
702
- const d = i === 0 ? "transparent" : M(l), v = i > 0 && l < 4, c = a > 72 && n > 38;
703
- return /* @__PURE__ */ g("g", { children: [
895
+ if (t === 0) return /* @__PURE__ */ e("g", {});
896
+ const l = t === 0 ? "transparent" : B(s), g = t > 0 && s < 4, x = a > 72 && i > 38;
897
+ return /* @__PURE__ */ y("g", { children: [
704
898
  /* @__PURE__ */ e(
705
899
  "rect",
706
900
  {
707
- x: t,
708
- y: r,
901
+ x: r,
902
+ y: n,
709
903
  width: a,
710
- height: n,
904
+ height: i,
711
905
  rx: 6,
712
906
  ry: 6,
713
- fill: d,
907
+ fill: l,
714
908
  stroke: "var(--background)",
715
909
  strokeWidth: 4
716
910
  }
717
911
  ),
718
- c && /* @__PURE__ */ e(
912
+ x && /* @__PURE__ */ e(
719
913
  "foreignObject",
720
914
  {
721
- x: t + 8,
722
- y: r + 8,
915
+ x: r + 8,
916
+ y: n + 8,
723
917
  width: Math.max(0, a - 16),
724
- height: Math.max(0, n - 16),
918
+ height: Math.max(0, i - 16),
725
919
  className: "pointer-events-none overflow-hidden",
726
- children: /* @__PURE__ */ g("div", { className: "flex h-full flex-col justify-between", children: [
920
+ children: /* @__PURE__ */ y("div", { className: "flex h-full flex-col justify-between", children: [
727
921
  /* @__PURE__ */ e(
728
922
  "p",
729
923
  {
730
- className: k(
924
+ className: C(
731
925
  "truncate text-xs font-semibold",
732
- v ? "text-background" : "text-foreground"
926
+ g ? "text-background" : "text-foreground"
733
927
  ),
734
- children: o
928
+ children: c
735
929
  }
736
930
  ),
737
- typeof s == "number" && n > 58 && /* @__PURE__ */ e(
931
+ typeof m == "number" && i > 58 && /* @__PURE__ */ e(
738
932
  "p",
739
933
  {
740
- className: k(
934
+ className: C(
741
935
  "text-xs tabular-nums",
742
- v ? "text-background/70" : "text-tertiary"
936
+ g ? "text-background/70" : "text-tertiary"
743
937
  ),
744
- children: f(s)
938
+ children: f(m)
745
939
  }
746
940
  )
747
941
  ] })
@@ -749,93 +943,160 @@ function je({
749
943
  )
750
944
  ] });
751
945
  }
752
- function Be(t, r, a) {
753
- const n = [], i = (l) => {
754
- const o = Array.isArray(l.children) ? l.children : void 0;
755
- if (o != null && o.length) {
756
- o.forEach(i);
946
+ function Ge(r, n, a) {
947
+ const i = [], t = (s) => {
948
+ const c = Array.isArray(s.children) ? s.children : void 0;
949
+ if (c != null && c.length) {
950
+ c.forEach(t);
757
951
  return;
758
952
  }
759
- typeof l[a] == "number" && n.push({
760
- ...l,
761
- name: String(l[r] ?? ""),
762
- value: l[a]
953
+ typeof s[a] == "number" && i.push({
954
+ ...s,
955
+ name: String(s[n] ?? ""),
956
+ value: s[a]
763
957
  });
764
958
  };
765
- return t.forEach(i), n.length ? n : t;
959
+ return r.forEach(t), i.length ? i : r;
766
960
  }
767
- const We = N.forwardRef(
768
- ({ data: t, nameKey: r, valueKey: a, height: n = 280, formatValue: i, className: l }, o) => {
769
- const s = i ?? w, f = N.useMemo(
770
- () => Be(t, r, a),
771
- [t, r, a]
961
+ const Ee = k.forwardRef(
962
+ ({
963
+ data: r,
964
+ nameKey: n,
965
+ valueKey: a,
966
+ height: i = 280,
967
+ formatValue: t,
968
+ tooltip: s,
969
+ className: c
970
+ }, m) => {
971
+ const f = t ?? L, l = k.useMemo(
972
+ () => Ge(r, n, a),
973
+ [r, n, a]
772
974
  );
773
- return /* @__PURE__ */ e("div", { ref: o, className: k("relative w-full font-sans", l), children: /* @__PURE__ */ e(F, { width: "100%", height: n, children: /* @__PURE__ */ e(
774
- me,
975
+ return /* @__PURE__ */ e("div", { ref: m, className: C("relative w-full font-sans", c), children: /* @__PURE__ */ e($, { width: "100%", height: i, children: /* @__PURE__ */ e(
976
+ ge,
775
977
  {
776
- data: f,
777
- nameKey: r,
978
+ data: l,
979
+ nameKey: n,
778
980
  dataKey: a,
779
981
  type: "flat",
780
982
  aspectRatio: 1.6,
781
- content: /* @__PURE__ */ e(je, { format: s }),
983
+ content: /* @__PURE__ */ e(Pe, { format: f }),
782
984
  isAnimationActive: !1,
783
- children: /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: s }), isAnimationActive: !1 })
985
+ children: s !== !1 && /* @__PURE__ */ e(
986
+ F,
987
+ {
988
+ content: /* @__PURE__ */ e(
989
+ M,
990
+ {
991
+ format: f,
992
+ renderer: s
993
+ }
994
+ ),
995
+ isAnimationActive: !1
996
+ }
997
+ )
784
998
  }
785
999
  ) }) });
786
1000
  }
787
1001
  );
788
- We.displayName = "TreemapChart";
789
- const De = N.forwardRef(
790
- ({ data: t, nameKey: r, valueKey: a, height: n = 280, formatValue: i, className: l }, o) => {
791
- var v;
792
- const s = i ?? w, f = Number(((v = t[0]) == null ? void 0 : v[a]) ?? 0), d = (c) => {
793
- const h = c.index ?? 0, x = t[h];
794
- if (!x) return /* @__PURE__ */ e("g", {});
795
- const p = Number(x[a]), m = f ? Math.round(p / f * 100) : 0;
796
- return /* @__PURE__ */ g(
1002
+ Ee.displayName = "TreemapChart";
1003
+ const Ve = k.forwardRef(
1004
+ ({
1005
+ data: r,
1006
+ nameKey: n,
1007
+ valueKey: a,
1008
+ height: i = 280,
1009
+ formatValue: t,
1010
+ label: s,
1011
+ labelWidth: c = 176,
1012
+ tooltip: m,
1013
+ className: f
1014
+ }, l) => {
1015
+ var d;
1016
+ const g = t ?? L, x = Number(((d = r[0]) == null ? void 0 : d[a]) ?? 0), u = (p) => {
1017
+ var A;
1018
+ const h = p.index ?? 0, o = r[h];
1019
+ if (!o) return /* @__PURE__ */ e("g", {});
1020
+ const v = Number(o[a]), b = Number(((A = r[h - 1]) == null ? void 0 : A[a]) ?? v), N = x ? v / x * 100 : 0, O = b ? v / b * 100 : 0, w = {
1021
+ datum: o,
1022
+ index: h,
1023
+ name: String(o[n]),
1024
+ value: v,
1025
+ conversionFromFirst: N,
1026
+ conversionFromPrevious: O,
1027
+ dropOffFromPrevious: h === 0 ? 0 : 100 - O,
1028
+ x: Number(p.x ?? 0),
1029
+ y: Number(p.y ?? 0),
1030
+ width: Number(p.width ?? 0),
1031
+ height: Number(p.height ?? 0),
1032
+ formatValue: g
1033
+ };
1034
+ return s === !1 ? /* @__PURE__ */ e("g", {}) : s ? /* @__PURE__ */ e(G, { children: s(w) }) : /* @__PURE__ */ y(
797
1035
  "text",
798
1036
  {
799
- x: Number(c.x ?? 0) + Number(c.width ?? 0) + 12,
800
- y: Number(c.y ?? 0) + Number(c.height ?? 0) / 2,
1037
+ x: w.x + w.width + 12,
1038
+ y: w.y + w.height / 2,
801
1039
  dy: "0.32em",
802
1040
  textAnchor: "start",
803
1041
  className: "text-xs",
804
1042
  children: [
805
- /* @__PURE__ */ e("tspan", { className: "fill-primary font-medium", children: String(x[r]) }),
806
- /* @__PURE__ */ g("tspan", { className: "fill-secondary", children: [
1043
+ /* @__PURE__ */ e("tspan", { className: "fill-primary font-medium", children: w.name }),
1044
+ /* @__PURE__ */ y("tspan", { className: "fill-secondary", children: [
807
1045
  " · ",
808
- s(p)
1046
+ g(v)
809
1047
  ] }),
810
- /* @__PURE__ */ g("tspan", { className: "fill-tertiary", children: [
1048
+ /* @__PURE__ */ y("tspan", { className: "fill-tertiary", children: [
811
1049
  " · ",
812
- m,
1050
+ Math.round(N),
813
1051
  "%"
814
1052
  ] })
815
1053
  ]
816
1054
  }
817
1055
  );
818
1056
  };
819
- return /* @__PURE__ */ e("div", { ref: o, className: k("relative w-full font-sans", l), children: /* @__PURE__ */ e(F, { width: "100%", height: n, children: /* @__PURE__ */ g(fe, { margin: { top: 8, right: 176, bottom: 8, left: 8 }, children: [
820
- /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: s }), isAnimationActive: !1 }),
821
- /* @__PURE__ */ g(ue, { data: t, dataKey: a, nameKey: r, isAnimationActive: !1, children: [
822
- t.map((c, h) => /* @__PURE__ */ e(W, { fill: M(h) }, String(c[r]))),
823
- /* @__PURE__ */ e(he, { position: "right", content: d })
824
- ] })
825
- ] }) }) });
1057
+ return /* @__PURE__ */ e("div", { ref: l, className: C("relative w-full font-sans", f), children: /* @__PURE__ */ e($, { width: "100%", height: i, children: /* @__PURE__ */ y(
1058
+ be,
1059
+ {
1060
+ margin: {
1061
+ top: 8,
1062
+ right: s === !1 ? 8 : c,
1063
+ bottom: 8,
1064
+ left: 8
1065
+ },
1066
+ children: [
1067
+ m !== !1 && /* @__PURE__ */ e(
1068
+ F,
1069
+ {
1070
+ content: /* @__PURE__ */ e(
1071
+ M,
1072
+ {
1073
+ format: g,
1074
+ renderer: m
1075
+ }
1076
+ ),
1077
+ isAnimationActive: !1
1078
+ }
1079
+ ),
1080
+ /* @__PURE__ */ y(pe, { data: r, dataKey: a, nameKey: n, isAnimationActive: !1, children: [
1081
+ r.map((p, h) => /* @__PURE__ */ e(X, { fill: B(h) }, String(p[n]))),
1082
+ /* @__PURE__ */ e(ye, { position: "right", content: u })
1083
+ ] })
1084
+ ]
1085
+ }
1086
+ ) }) });
826
1087
  }
827
1088
  );
828
- De.displayName = "FunnelChart";
1089
+ Ve.displayName = "FunnelChart";
829
1090
  export {
830
- Me as AreaChart,
831
- Fe as BarChart,
832
- U as ComboChart,
833
- Se as ComposedChart,
834
- De as FunnelChart,
835
- Re as LineChart,
836
- $e as PieChart,
837
- Ie as RadarChart,
838
- Te as RadialBarChart,
839
- Oe as ScatterChart,
840
- We as TreemapChart
1091
+ Be as AreaChart,
1092
+ $e as BarChart,
1093
+ ee as ComboChart,
1094
+ De as ComposedChart,
1095
+ Ve as FunnelChart,
1096
+ Te as LineChart,
1097
+ Ie as PieChart,
1098
+ We as RadarChart,
1099
+ ze as RadialBarChart,
1100
+ je as ScatterChart,
1101
+ Ee as TreemapChart
841
1102
  };