@object-ui/plugin-charts 0.3.1 → 2.0.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.
@@ -1,2530 +0,0 @@
1
- import { j as A } from "./index-CTfEtwhn.js";
2
- import * as s from "react";
3
- import { useMemo as oe, useRef as F, useState as Ne, useCallback as ee, isValidElement as ht, cloneElement as yt, Component as ca, PureComponent as ua, forwardRef as be, useEffect as da } from "react";
4
- import { q as U, w as M, x as gt, y as te, z as S, A as se, D as pa, E as va, F as Y, G as fa, H as ma, I as bt, J as ha, K as ya, M as $, N as ga, O as ba, P as xa, Q as Pa, S as H, U as Aa, V as Ea, W as Ia, Y as Oa, Z as xt, _ as ja, $ as wa, a0 as Ca, a1 as ae, a2 as Da, r as q, a3 as Te, a4 as Sa, a5 as re, a6 as Pt, h as V, a7 as ka, a8 as K, a9 as ne, aa as _e, ab as Re, ac as Ke, ad as $e, ae as La, af as R, ag as ue, ah as Ce, ai as Na, aj as At, ak as Ta, al as _a, am as Ra, an as Ka, ao as $a, ap as Wa, aq as Ma, ar as Ba, as as Et, at as We, au as za, av as ie, aw as pe, ax as de, ay as Fa, az as Va, aA as Me, aB as Ga, aC as Xa, aD as ve, aE as xe, aF as Pe, aG as Ua, aH as It, aI as Be, aJ as fe, aK as Ot, j as Ae, aL as jt, aM as wt, aN as Ct, aO as Dt, aP as St, aQ as kt, aR as Lt, aS as Ya, aT as me, aU as Nt, aV as Tt, aW as Ha, aX as qa, aY as ze, aZ as Fe, a_ as Za, a$ as Ja, b0 as Qa, b1 as er, b as tr, b2 as ar, b3 as he, b4 as rr, b5 as _t, b6 as Ve, u as nr, b7 as ir, b8 as lr, b9 as or, ba as sr, bb as cr, bc as ur, T as dr, L as pr, R as vr, B as qe, t as fr, X as mr, v as hr } from "./BarChart-RKJxvg5Y.js";
5
- function De() {
6
- return De = Object.assign ? Object.assign.bind() : function(t) {
7
- for (var e = 1; e < arguments.length; e++) {
8
- var a = arguments[e];
9
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
10
- }
11
- return t;
12
- }, De.apply(null, arguments);
13
- }
14
- var Rt = (t) => {
15
- var {
16
- cx: e,
17
- cy: a,
18
- r,
19
- className: n
20
- } = t, i = U("recharts-dot", n);
21
- return M(e) && M(a) && M(r) ? /* @__PURE__ */ s.createElement("circle", De({}, te(t), gt(t), {
22
- className: i,
23
- cx: e,
24
- cy: a,
25
- r
26
- })) : null;
27
- }, Kt = (t) => t.graphicalItems.polarItems, yr = S([se, pa], va), Ee = S([Kt, Y, yr], fa), gr = S([Ee], ma), Ie = S([gr, bt], ha), br = S([Ie, Y, Ee], ya);
28
- S([Ie, Y, Ee], (t, e, a) => a.length > 0 ? t.flatMap((r) => a.flatMap((n) => {
29
- var i, o = $(r, (i = e.dataKey) !== null && i !== void 0 ? i : n.dataKey);
30
- return {
31
- value: o,
32
- errorDomain: []
33
- // polar charts do not have error bars
34
- };
35
- })).filter(Boolean) : e?.dataKey != null ? t.map((r) => ({
36
- value: $(r, e.dataKey),
37
- errorDomain: []
38
- })) : t.map((r) => ({
39
- value: r,
40
- errorDomain: []
41
- })));
42
- var Ze = () => {
43
- }, xr = S([Ie, Y, Ee, ga, se], ba), Pr = S([Y, xa, Pa, Ze, xr, Ze, H, se], Aa), $t = S([Y, H, Ie, br, Ea, se, Pr], Ia), Ar = S([$t, Oa, xt], ja), Er = S([Y, $t, Ar, se], wa);
44
- S([xt, Er], Ca);
45
- function Je(t, e) {
46
- var a = Object.keys(t);
47
- if (Object.getOwnPropertySymbols) {
48
- var r = Object.getOwnPropertySymbols(t);
49
- e && (r = r.filter(function(n) {
50
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
51
- })), a.push.apply(a, r);
52
- }
53
- return a;
54
- }
55
- function Qe(t) {
56
- for (var e = 1; e < arguments.length; e++) {
57
- var a = arguments[e] != null ? arguments[e] : {};
58
- e % 2 ? Je(Object(a), !0).forEach(function(r) {
59
- Ir(t, r, a[r]);
60
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : Je(Object(a)).forEach(function(r) {
61
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
62
- });
63
- }
64
- return t;
65
- }
66
- function Ir(t, e, a) {
67
- return (e = Or(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
68
- }
69
- function Or(t) {
70
- var e = jr(t, "string");
71
- return typeof e == "symbol" ? e : e + "";
72
- }
73
- function jr(t, e) {
74
- if (typeof t != "object" || !t) return t;
75
- var a = t[Symbol.toPrimitive];
76
- if (a !== void 0) {
77
- var r = a.call(t, e);
78
- if (typeof r != "object") return r;
79
- throw new TypeError("@@toPrimitive must return a primitive value.");
80
- }
81
- return (e === "string" ? String : Number)(t);
82
- }
83
- var wr = (t, e) => e, Ge = S([Kt, wr], (t, e) => t.filter((a) => a.type === "pie").find((a) => a.id === e)), Cr = [], Xe = (t, e, a) => a?.length === 0 ? Cr : a, Wt = S([bt, Ge, Xe], (t, e, a) => {
84
- var {
85
- chartData: r
86
- } = t;
87
- if (e != null) {
88
- var n;
89
- if (e?.data != null && e.data.length > 0 ? n = e.data : n = r, (!n || !n.length) && a != null && (n = a.map((i) => Qe(Qe({}, e.presentationProps), i.props))), n != null)
90
- return n;
91
- }
92
- }), Dr = S([Wt, Ge, Xe], (t, e, a) => {
93
- if (!(t == null || e == null))
94
- return t.map((r, n) => {
95
- var i, o = $(r, e.nameKey, e.name), l;
96
- return a != null && (i = a[n]) !== null && i !== void 0 && (i = i.props) !== null && i !== void 0 && i.fill ? l = a[n].props.fill : typeof r == "object" && r != null && "fill" in r ? l = r.fill : l = e.fill, {
97
- value: ae(o, e.dataKey),
98
- color: l,
99
- // @ts-expect-error we need a better typing for our data inputs
100
- payload: r,
101
- type: e.legendType
102
- };
103
- });
104
- }), Sr = S([Wt, Ge, Xe, Da], (t, e, a, r) => {
105
- if (!(e == null || t == null))
106
- return qr({
107
- offset: r,
108
- pieSettings: e,
109
- displayedData: t,
110
- cells: a
111
- });
112
- }), kr = ["key"], Lr = ["onMouseEnter", "onClick", "onMouseLeave"], Nr = ["id"], Tr = ["id"];
113
- function et(t, e) {
114
- var a = Object.keys(t);
115
- if (Object.getOwnPropertySymbols) {
116
- var r = Object.getOwnPropertySymbols(t);
117
- e && (r = r.filter(function(n) {
118
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
119
- })), a.push.apply(a, r);
120
- }
121
- return a;
122
- }
123
- function L(t) {
124
- for (var e = 1; e < arguments.length; e++) {
125
- var a = arguments[e] != null ? arguments[e] : {};
126
- e % 2 ? et(Object(a), !0).forEach(function(r) {
127
- _r(t, r, a[r]);
128
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : et(Object(a)).forEach(function(r) {
129
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
130
- });
131
- }
132
- return t;
133
- }
134
- function _r(t, e, a) {
135
- return (e = Rr(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
136
- }
137
- function Rr(t) {
138
- var e = Kr(t, "string");
139
- return typeof e == "symbol" ? e : e + "";
140
- }
141
- function Kr(t, e) {
142
- if (typeof t != "object" || !t) return t;
143
- var a = t[Symbol.toPrimitive];
144
- if (a !== void 0) {
145
- var r = a.call(t, e);
146
- if (typeof r != "object") return r;
147
- throw new TypeError("@@toPrimitive must return a primitive value.");
148
- }
149
- return (e === "string" ? String : Number)(t);
150
- }
151
- function G() {
152
- return G = Object.assign ? Object.assign.bind() : function(t) {
153
- for (var e = 1; e < arguments.length; e++) {
154
- var a = arguments[e];
155
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
156
- }
157
- return t;
158
- }, G.apply(null, arguments);
159
- }
160
- function Oe(t, e) {
161
- if (t == null) return {};
162
- var a, r, n = $r(t, e);
163
- if (Object.getOwnPropertySymbols) {
164
- var i = Object.getOwnPropertySymbols(t);
165
- for (r = 0; r < i.length; r++) a = i[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
166
- }
167
- return n;
168
- }
169
- function $r(t, e) {
170
- if (t == null) return {};
171
- var a = {};
172
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
173
- if (e.indexOf(r) !== -1) continue;
174
- a[r] = t[r];
175
- }
176
- return a;
177
- }
178
- function Wr(t) {
179
- var e = oe(() => Pt(t.children, _e), [t.children]), a = V((r) => Dr(r, t.id, e));
180
- return a == null ? null : /* @__PURE__ */ s.createElement(ka, {
181
- legendPayload: a
182
- });
183
- }
184
- var Mr = /* @__PURE__ */ s.memo((t) => {
185
- var {
186
- dataKey: e,
187
- nameKey: a,
188
- sectors: r,
189
- stroke: n,
190
- strokeWidth: i,
191
- fill: o,
192
- name: l,
193
- hide: c,
194
- tooltipType: u,
195
- id: d
196
- } = t, f = {
197
- dataDefinedOnItem: r.map((p) => p.tooltipPayload),
198
- getPosition: (p) => {
199
- var v;
200
- return (v = r[Number(p)]) === null || v === void 0 ? void 0 : v.tooltipPosition;
201
- },
202
- settings: {
203
- stroke: n,
204
- strokeWidth: i,
205
- fill: o,
206
- dataKey: e,
207
- nameKey: a,
208
- name: ae(l, e),
209
- hide: c,
210
- type: u,
211
- color: o,
212
- unit: "",
213
- // why doesn't Pie support unit?
214
- graphicalItemId: d
215
- }
216
- };
217
- return /* @__PURE__ */ s.createElement(Re, {
218
- tooltipEntrySettings: f
219
- });
220
- }), Br = (t, e) => t > e ? "start" : t < e ? "end" : "middle", zr = (t, e, a) => typeof e == "function" ? ie(e(t), a, a * 0.8) : ie(e, a, a * 0.8), Fr = (t, e, a) => {
221
- var {
222
- top: r,
223
- left: n,
224
- width: i,
225
- height: o
226
- } = e, l = za(i, o), c = n + ie(t.cx, i, i / 2), u = r + ie(t.cy, o, o / 2), d = ie(t.innerRadius, l, 0), f = zr(a, t.outerRadius, l), p = t.maxRadius || Math.sqrt(i * i + o * o) / 2;
227
- return {
228
- cx: c,
229
- cy: u,
230
- innerRadius: d,
231
- outerRadius: f,
232
- maxRadius: p
233
- };
234
- }, Vr = (t, e) => {
235
- var a = ue(e - t), r = Math.min(Math.abs(e - t), 360);
236
- return a * r;
237
- }, Gr = (t, e) => {
238
- if (/* @__PURE__ */ s.isValidElement(t))
239
- return /* @__PURE__ */ s.cloneElement(t, e);
240
- if (typeof t == "function")
241
- return t(e);
242
- var a = U("recharts-pie-label-line", typeof t != "boolean" ? t.className : ""), {
243
- key: r
244
- } = e, n = Oe(e, kr);
245
- return /* @__PURE__ */ s.createElement(de, G({}, n, {
246
- type: "linear",
247
- className: a
248
- }));
249
- }, Xr = (t, e, a) => {
250
- if (/* @__PURE__ */ s.isValidElement(t))
251
- return /* @__PURE__ */ s.cloneElement(t, e);
252
- var r = a;
253
- if (typeof t == "function" && (r = t(e), /* @__PURE__ */ s.isValidElement(r)))
254
- return r;
255
- var n = U("recharts-pie-label-text", Fa(t));
256
- return /* @__PURE__ */ s.createElement(Va, G({}, e, {
257
- alignmentBaseline: "middle",
258
- className: n
259
- }), r);
260
- };
261
- function Ur(t) {
262
- var {
263
- sectors: e,
264
- props: a,
265
- showLabels: r
266
- } = t, {
267
- label: n,
268
- labelLine: i,
269
- dataKey: o
270
- } = a;
271
- if (!r || !n || !e)
272
- return null;
273
- var l = te(a), c = pe(n), u = pe(i), d = typeof n == "object" && "offsetRadius" in n && typeof n.offsetRadius == "number" && n.offsetRadius || 20, f = e.map((p, v) => {
274
- var y = (p.startAngle + p.endAngle) / 2, g = Ce(p.cx, p.cy, p.outerRadius + d, y), m = L(L(L(L({}, l), p), {}, {
275
- // @ts-expect-error customLabelProps is contributing unknown props
276
- stroke: "none"
277
- }, c), {}, {
278
- index: v,
279
- textAnchor: Br(g.x, p.cx)
280
- }, g), h = L(L(L(L({}, l), p), {}, {
281
- // @ts-expect-error customLabelLineProps is contributing unknown props
282
- fill: "none",
283
- // @ts-expect-error customLabelLineProps is contributing unknown props
284
- stroke: p.fill
285
- }, u), {}, {
286
- index: v,
287
- points: [Ce(p.cx, p.cy, p.outerRadius, y), g],
288
- key: "line"
289
- });
290
- return /* @__PURE__ */ s.createElement(ne, {
291
- zIndex: re.label,
292
- key: "label-".concat(p.startAngle, "-").concat(p.endAngle, "-").concat(p.midAngle, "-").concat(v)
293
- }, /* @__PURE__ */ s.createElement(K, null, i && Gr(i, h), Xr(n, m, $(p, o))));
294
- });
295
- return /* @__PURE__ */ s.createElement(K, {
296
- className: "recharts-pie-labels"
297
- }, f);
298
- }
299
- function Yr(t) {
300
- var {
301
- sectors: e,
302
- props: a,
303
- showLabels: r
304
- } = t, {
305
- label: n
306
- } = a;
307
- return typeof n == "object" && n != null && "position" in n ? /* @__PURE__ */ s.createElement(We, {
308
- label: n
309
- }) : /* @__PURE__ */ s.createElement(Ur, {
310
- sectors: e,
311
- props: a,
312
- showLabels: r
313
- });
314
- }
315
- function Hr(t) {
316
- var {
317
- sectors: e,
318
- activeShape: a,
319
- inactiveShape: r,
320
- allOtherPieProps: n,
321
- shape: i,
322
- id: o
323
- } = t, l = V(At), c = V(Ta), u = V(_a), {
324
- onMouseEnter: d,
325
- onClick: f,
326
- onMouseLeave: p
327
- } = n, v = Oe(n, Lr), y = Ra(d, n.dataKey, o), g = Ka(p), m = $a(f, n.dataKey, o);
328
- return e == null || e.length === 0 ? null : /* @__PURE__ */ s.createElement(s.Fragment, null, e.map((h, b) => {
329
- if (h?.startAngle === 0 && h?.endAngle === 0 && e.length !== 1) return null;
330
- var P = u == null || u === o, x = String(b) === l && (c == null || n.dataKey === c) && P, j = l ? r : null, I = a && x ? a : j, O = L(L({}, h), {}, {
331
- stroke: h.stroke,
332
- tabIndex: -1,
333
- [Ma]: b,
334
- [Wa]: o
335
- });
336
- return /* @__PURE__ */ s.createElement(K, G({
337
- key: "sector-".concat(h?.startAngle, "-").concat(h?.endAngle, "-").concat(h.midAngle, "-").concat(b),
338
- tabIndex: -1,
339
- className: "recharts-pie-sector"
340
- }, Ba(v, h, b), {
341
- // @ts-expect-error the types need a bit of attention
342
- onMouseEnter: y(h, b),
343
- onMouseLeave: g(h, b),
344
- onClick: m(h, b)
345
- }), /* @__PURE__ */ s.createElement(Et, G({
346
- option: i ?? I,
347
- index: b,
348
- shapeType: "sector",
349
- isActive: x
350
- }, O)));
351
- }));
352
- }
353
- function qr(t) {
354
- var e, {
355
- pieSettings: a,
356
- displayedData: r,
357
- cells: n,
358
- offset: i
359
- } = t, {
360
- cornerRadius: o,
361
- startAngle: l,
362
- endAngle: c,
363
- dataKey: u,
364
- nameKey: d,
365
- tooltipType: f
366
- } = a, p = Math.abs(a.minAngle), v = Vr(l, c), y = Math.abs(v), g = r.length <= 1 ? 0 : (e = a.paddingAngle) !== null && e !== void 0 ? e : 0, m = r.filter((I) => $(I, u, 0) !== 0).length, h = (y >= 360 ? m : m - 1) * g, b = y - m * p - h, P = r.reduce((I, O) => {
367
- var E = $(O, u, 0);
368
- return I + (M(E) ? E : 0);
369
- }, 0), x;
370
- if (P > 0) {
371
- var j;
372
- x = r.map((I, O) => {
373
- var E = $(I, u, 0), C = $(I, d, O), D = Fr(a, i, I), k = (M(E) ? E : 0) / P, w, N = L(L({}, I), n && n[O] && n[O].props);
374
- O ? w = j.endAngle + ue(v) * g * (E !== 0 ? 1 : 0) : w = l;
375
- var T = w + ue(v) * ((E !== 0 ? p : 0) + k * b), _ = (w + T) / 2, Z = (D.innerRadius + D.outerRadius) / 2, J = [{
376
- name: C,
377
- value: E,
378
- payload: N,
379
- dataKey: u,
380
- type: f,
381
- graphicalItemId: a.id
382
- }], ce = Ce(D.cx, D.cy, Z, _);
383
- return j = L(L(L(L({}, a.presentationProps), {}, {
384
- percent: k,
385
- cornerRadius: typeof o == "string" ? parseFloat(o) : o,
386
- name: C,
387
- tooltipPayload: J,
388
- midAngle: _,
389
- middleRadius: Z,
390
- tooltipPosition: ce
391
- }, N), D), {}, {
392
- value: E,
393
- dataKey: u,
394
- startAngle: w,
395
- endAngle: T,
396
- payload: N,
397
- paddingAngle: ue(v) * g
398
- }), j;
399
- });
400
- }
401
- return x;
402
- }
403
- function Zr(t) {
404
- var {
405
- showLabels: e,
406
- sectors: a,
407
- children: r
408
- } = t, n = oe(() => !e || !a ? [] : a.map((i) => ({
409
- value: i.value,
410
- payload: i.payload,
411
- clockWise: !1,
412
- parentViewBox: void 0,
413
- viewBox: {
414
- cx: i.cx,
415
- cy: i.cy,
416
- innerRadius: i.innerRadius,
417
- outerRadius: i.outerRadius,
418
- startAngle: i.startAngle,
419
- endAngle: i.endAngle,
420
- clockWise: !1
421
- },
422
- fill: i.fill
423
- })), [a, e]);
424
- return /* @__PURE__ */ s.createElement(Na, {
425
- value: e ? n : void 0
426
- }, r);
427
- }
428
- function Jr(t) {
429
- var {
430
- props: e,
431
- previousSectorsRef: a,
432
- id: r
433
- } = t, {
434
- sectors: n,
435
- isAnimationActive: i,
436
- animationBegin: o,
437
- animationDuration: l,
438
- animationEasing: c,
439
- activeShape: u,
440
- inactiveShape: d,
441
- onAnimationStart: f,
442
- onAnimationEnd: p
443
- } = e, v = Ke(e, "recharts-pie-"), y = a.current, [g, m] = Ne(!1), h = ee(() => {
444
- typeof p == "function" && p(), m(!1);
445
- }, [p]), b = ee(() => {
446
- typeof f == "function" && f(), m(!0);
447
- }, [f]);
448
- return /* @__PURE__ */ s.createElement(Zr, {
449
- showLabels: !g,
450
- sectors: n
451
- }, /* @__PURE__ */ s.createElement($e, {
452
- animationId: v,
453
- begin: o,
454
- duration: l,
455
- isActive: i,
456
- easing: c,
457
- onAnimationStart: b,
458
- onAnimationEnd: h,
459
- key: v
460
- }, (P) => {
461
- var x, j = [], I = n && n[0], O = (x = I?.startAngle) !== null && x !== void 0 ? x : 0;
462
- return n?.forEach((E, C) => {
463
- var D = y && y[C], k = C > 0 ? La(E, "paddingAngle", 0) : 0;
464
- if (D) {
465
- var w = R(D.endAngle - D.startAngle, E.endAngle - E.startAngle, P), N = L(L({}, E), {}, {
466
- startAngle: O + k,
467
- endAngle: O + w + k
468
- });
469
- j.push(N), O = N.endAngle;
470
- } else {
471
- var {
472
- endAngle: T,
473
- startAngle: _
474
- } = E, Z = R(0, T - _, P), J = L(L({}, E), {}, {
475
- startAngle: O + k,
476
- endAngle: O + Z + k
477
- });
478
- j.push(J), O = J.endAngle;
479
- }
480
- }), a.current = j, /* @__PURE__ */ s.createElement(K, null, /* @__PURE__ */ s.createElement(Hr, {
481
- sectors: j,
482
- activeShape: u,
483
- inactiveShape: d,
484
- allOtherPieProps: e,
485
- shape: e.shape,
486
- id: r
487
- }));
488
- }), /* @__PURE__ */ s.createElement(Yr, {
489
- showLabels: !g,
490
- sectors: n,
491
- props: e
492
- }), e.children);
493
- }
494
- var Qr = {
495
- animationBegin: 400,
496
- animationDuration: 1500,
497
- animationEasing: "ease",
498
- cx: "50%",
499
- cy: "50%",
500
- dataKey: "value",
501
- endAngle: 360,
502
- fill: "#808080",
503
- hide: !1,
504
- innerRadius: 0,
505
- isAnimationActive: "auto",
506
- label: !1,
507
- labelLine: !0,
508
- legendType: "rect",
509
- minAngle: 0,
510
- nameKey: "name",
511
- outerRadius: "80%",
512
- paddingAngle: 0,
513
- rootTabIndex: 0,
514
- startAngle: 0,
515
- stroke: "#fff",
516
- zIndex: re.area
517
- };
518
- function en(t) {
519
- var {
520
- id: e
521
- } = t, a = Oe(t, Nr), {
522
- hide: r,
523
- className: n,
524
- rootTabIndex: i
525
- } = t, o = oe(() => Pt(t.children, _e), [t.children]), l = V((d) => Sr(d, e, o)), c = F(null), u = U("recharts-pie", n);
526
- return r || l == null ? (c.current = null, /* @__PURE__ */ s.createElement(K, {
527
- tabIndex: i,
528
- className: u
529
- })) : /* @__PURE__ */ s.createElement(ne, {
530
- zIndex: t.zIndex
531
- }, /* @__PURE__ */ s.createElement(Mr, {
532
- dataKey: t.dataKey,
533
- nameKey: t.nameKey,
534
- sectors: l,
535
- stroke: t.stroke,
536
- strokeWidth: t.strokeWidth,
537
- fill: t.fill,
538
- name: t.name,
539
- hide: t.hide,
540
- tooltipType: t.tooltipType,
541
- id: e
542
- }), /* @__PURE__ */ s.createElement(K, {
543
- tabIndex: i,
544
- className: u
545
- }, /* @__PURE__ */ s.createElement(Jr, {
546
- props: L(L({}, a), {}, {
547
- sectors: l
548
- }),
549
- previousSectorsRef: c,
550
- id: e
551
- })));
552
- }
553
- function Mt(t) {
554
- var e = q(t, Qr), {
555
- id: a
556
- } = e, r = Oe(e, Tr), n = te(r);
557
- return /* @__PURE__ */ s.createElement(Te, {
558
- id: a,
559
- type: "pie"
560
- }, (i) => /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(Sa, {
561
- type: "pie",
562
- id: i,
563
- data: r.data,
564
- dataKey: r.dataKey,
565
- hide: r.hide,
566
- angleAxisId: 0,
567
- radiusAxisId: 0,
568
- name: r.name,
569
- nameKey: r.nameKey,
570
- tooltipType: r.tooltipType,
571
- legendType: r.legendType,
572
- fill: r.fill,
573
- cx: r.cx,
574
- cy: r.cy,
575
- startAngle: r.startAngle,
576
- endAngle: r.endAngle,
577
- paddingAngle: r.paddingAngle,
578
- minAngle: r.minAngle,
579
- innerRadius: r.innerRadius,
580
- outerRadius: r.outerRadius,
581
- cornerRadius: r.cornerRadius,
582
- presentationProps: n,
583
- maxRadius: e.maxRadius
584
- }), /* @__PURE__ */ s.createElement(Wr, G({}, r, {
585
- id: i
586
- })), /* @__PURE__ */ s.createElement(en, G({}, r, {
587
- id: i
588
- }))));
589
- }
590
- Mt.displayName = "Pie";
591
- var tn = ["points"];
592
- function tt(t, e) {
593
- var a = Object.keys(t);
594
- if (Object.getOwnPropertySymbols) {
595
- var r = Object.getOwnPropertySymbols(t);
596
- e && (r = r.filter(function(n) {
597
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
598
- })), a.push.apply(a, r);
599
- }
600
- return a;
601
- }
602
- function je(t) {
603
- for (var e = 1; e < arguments.length; e++) {
604
- var a = arguments[e] != null ? arguments[e] : {};
605
- e % 2 ? tt(Object(a), !0).forEach(function(r) {
606
- an(t, r, a[r]);
607
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : tt(Object(a)).forEach(function(r) {
608
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
609
- });
610
- }
611
- return t;
612
- }
613
- function an(t, e, a) {
614
- return (e = rn(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
615
- }
616
- function rn(t) {
617
- var e = nn(t, "string");
618
- return typeof e == "symbol" ? e : e + "";
619
- }
620
- function nn(t, e) {
621
- if (typeof t != "object" || !t) return t;
622
- var a = t[Symbol.toPrimitive];
623
- if (a !== void 0) {
624
- var r = a.call(t, e);
625
- if (typeof r != "object") return r;
626
- throw new TypeError("@@toPrimitive must return a primitive value.");
627
- }
628
- return (e === "string" ? String : Number)(t);
629
- }
630
- function ye() {
631
- return ye = Object.assign ? Object.assign.bind() : function(t) {
632
- for (var e = 1; e < arguments.length; e++) {
633
- var a = arguments[e];
634
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
635
- }
636
- return t;
637
- }, ye.apply(null, arguments);
638
- }
639
- function ln(t, e) {
640
- if (t == null) return {};
641
- var a, r, n = on(t, e);
642
- if (Object.getOwnPropertySymbols) {
643
- var i = Object.getOwnPropertySymbols(t);
644
- for (r = 0; r < i.length; r++) a = i[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
645
- }
646
- return n;
647
- }
648
- function on(t, e) {
649
- if (t == null) return {};
650
- var a = {};
651
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
652
- if (e.indexOf(r) !== -1) continue;
653
- a[r] = t[r];
654
- }
655
- return a;
656
- }
657
- function sn(t) {
658
- var {
659
- option: e,
660
- dotProps: a,
661
- className: r
662
- } = t;
663
- if (/* @__PURE__ */ ht(e))
664
- return /* @__PURE__ */ yt(e, a);
665
- if (typeof e == "function")
666
- return e(a);
667
- var n = U(r, typeof e != "boolean" ? e.className : ""), i = a ?? {}, {
668
- points: o
669
- } = i, l = ln(i, tn);
670
- return /* @__PURE__ */ s.createElement(Rt, ye({}, l, {
671
- className: n
672
- }));
673
- }
674
- function cn(t, e) {
675
- return t == null ? !1 : e ? !0 : t.length === 1;
676
- }
677
- function Bt(t) {
678
- var {
679
- points: e,
680
- dot: a,
681
- className: r,
682
- dotClassName: n,
683
- dataKey: i,
684
- baseProps: o,
685
- needClip: l,
686
- clipPathId: c,
687
- zIndex: u = re.scatter
688
- } = t;
689
- if (!cn(e, a))
690
- return null;
691
- var d = Me(a), f = Ga(a), p = e.map((y, g) => {
692
- var m, h, b = je(je(je({
693
- r: 3
694
- }, o), f), {}, {
695
- index: g,
696
- cx: (m = y.x) !== null && m !== void 0 ? m : void 0,
697
- cy: (h = y.y) !== null && h !== void 0 ? h : void 0,
698
- dataKey: i,
699
- value: y.value,
700
- payload: y.payload,
701
- points: e
702
- });
703
- return /* @__PURE__ */ s.createElement(sn, {
704
- key: "dot-".concat(g),
705
- option: a,
706
- dotProps: b,
707
- className: n
708
- });
709
- }), v = {};
710
- return l && c != null && (v.clipPath = "url(#clipPath-".concat(d ? "" : "dots-").concat(c, ")")), /* @__PURE__ */ s.createElement(ne, {
711
- zIndex: u
712
- }, /* @__PURE__ */ s.createElement(K, ye({
713
- className: r
714
- }, v), p));
715
- }
716
- function at(t, e) {
717
- var a = Object.keys(t);
718
- if (Object.getOwnPropertySymbols) {
719
- var r = Object.getOwnPropertySymbols(t);
720
- e && (r = r.filter(function(n) {
721
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
722
- })), a.push.apply(a, r);
723
- }
724
- return a;
725
- }
726
- function we(t) {
727
- for (var e = 1; e < arguments.length; e++) {
728
- var a = arguments[e] != null ? arguments[e] : {};
729
- e % 2 ? at(Object(a), !0).forEach(function(r) {
730
- un(t, r, a[r]);
731
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : at(Object(a)).forEach(function(r) {
732
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
733
- });
734
- }
735
- return t;
736
- }
737
- function un(t, e, a) {
738
- return (e = dn(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
739
- }
740
- function dn(t) {
741
- var e = pn(t, "string");
742
- return typeof e == "symbol" ? e : e + "";
743
- }
744
- function pn(t, e) {
745
- if (typeof t != "object" || !t) return t;
746
- var a = t[Symbol.toPrimitive];
747
- if (a !== void 0) {
748
- var r = a.call(t, e);
749
- if (typeof r != "object") return r;
750
- throw new TypeError("@@toPrimitive must return a primitive value.");
751
- }
752
- return (e === "string" ? String : Number)(t);
753
- }
754
- var vn = (t) => {
755
- var {
756
- point: e,
757
- childIndex: a,
758
- mainColor: r,
759
- activeDot: n,
760
- dataKey: i,
761
- clipPath: o
762
- } = t;
763
- if (n === !1 || e.x == null || e.y == null)
764
- return null;
765
- var l = {
766
- index: a,
767
- dataKey: i,
768
- cx: e.x,
769
- cy: e.y,
770
- r: 4,
771
- fill: r ?? "none",
772
- strokeWidth: 2,
773
- stroke: "#fff",
774
- payload: e.payload,
775
- value: e.value
776
- }, c = we(we(we({}, l), pe(n)), gt(n)), u;
777
- return /* @__PURE__ */ ht(n) ? u = /* @__PURE__ */ yt(n, c) : typeof n == "function" ? u = n(c) : u = /* @__PURE__ */ s.createElement(Rt, c), /* @__PURE__ */ s.createElement(K, {
778
- className: "recharts-active-dot",
779
- clipPath: o
780
- }, u);
781
- };
782
- function Se(t) {
783
- var {
784
- points: e,
785
- mainColor: a,
786
- activeDot: r,
787
- itemDataKey: n,
788
- clipPath: i,
789
- zIndex: o = re.activeDot
790
- } = t, l = V(At), c = Xa();
791
- if (e == null || c == null)
792
- return null;
793
- var u = e.find((d) => c.includes(d.payload));
794
- return ve(u) ? null : /* @__PURE__ */ s.createElement(ne, {
795
- zIndex: o
796
- }, /* @__PURE__ */ s.createElement(vn, {
797
- point: u,
798
- childIndex: Number(l),
799
- mainColor: a,
800
- dataKey: n,
801
- activeDot: r,
802
- clipPath: i
803
- }));
804
- }
805
- var zt = (t, e, a, r) => xe(t, "xAxis", e, r), Ft = (t, e, a, r) => Pe(t, "xAxis", e, r), Vt = (t, e, a, r) => xe(t, "yAxis", a, r), Gt = (t, e, a, r) => Pe(t, "yAxis", a, r), fn = S([H, zt, Vt, Ft, Gt], (t, e, a, r, n) => Be(t, "xAxis") ? fe(e, r, !1) : fe(a, n, !1)), mn = (t, e, a, r, n) => n;
806
- function hn(t) {
807
- return t.type === "line";
808
- }
809
- var yn = S([It, mn], (t, e) => t.filter(hn).find((a) => a.id === e)), gn = S([H, zt, Vt, Ft, Gt, yn, fn, Ua], (t, e, a, r, n, i, o, l) => {
810
- var {
811
- chartData: c,
812
- dataStartIndex: u,
813
- dataEndIndex: d
814
- } = l;
815
- if (!(i == null || e == null || a == null || r == null || n == null || r.length === 0 || n.length === 0 || o == null || t !== "horizontal" && t !== "vertical")) {
816
- var {
817
- dataKey: f,
818
- data: p
819
- } = i, v;
820
- if (p != null && p.length > 0 ? v = p : v = c?.slice(u, d + 1), v != null)
821
- return $n({
822
- layout: t,
823
- xAxis: e,
824
- yAxis: a,
825
- xAxisTicks: r,
826
- yAxisTicks: n,
827
- dataKey: f,
828
- bandSize: o,
829
- displayedData: v
830
- });
831
- }
832
- });
833
- function Xt(t) {
834
- var e = pe(t), a = 3, r = 2;
835
- if (e != null) {
836
- var {
837
- r: n,
838
- strokeWidth: i
839
- } = e, o = Number(n), l = Number(i);
840
- return (Number.isNaN(o) || o < 0) && (o = a), (Number.isNaN(l) || l < 0) && (l = r), {
841
- r: o,
842
- strokeWidth: l
843
- };
844
- }
845
- return {
846
- r: a,
847
- strokeWidth: r
848
- };
849
- }
850
- var bn = ["id"], xn = ["type", "layout", "connectNulls", "needClip", "shape"], Pn = ["activeDot", "animateNewValues", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "hide", "isAnimationActive", "label", "legendType", "xAxisId", "yAxisId", "id"];
851
- function le() {
852
- return le = Object.assign ? Object.assign.bind() : function(t) {
853
- for (var e = 1; e < arguments.length; e++) {
854
- var a = arguments[e];
855
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
856
- }
857
- return t;
858
- }, le.apply(null, arguments);
859
- }
860
- function rt(t, e) {
861
- var a = Object.keys(t);
862
- if (Object.getOwnPropertySymbols) {
863
- var r = Object.getOwnPropertySymbols(t);
864
- e && (r = r.filter(function(n) {
865
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
866
- })), a.push.apply(a, r);
867
- }
868
- return a;
869
- }
870
- function B(t) {
871
- for (var e = 1; e < arguments.length; e++) {
872
- var a = arguments[e] != null ? arguments[e] : {};
873
- e % 2 ? rt(Object(a), !0).forEach(function(r) {
874
- An(t, r, a[r]);
875
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : rt(Object(a)).forEach(function(r) {
876
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
877
- });
878
- }
879
- return t;
880
- }
881
- function An(t, e, a) {
882
- return (e = En(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
883
- }
884
- function En(t) {
885
- var e = In(t, "string");
886
- return typeof e == "symbol" ? e : e + "";
887
- }
888
- function In(t, e) {
889
- if (typeof t != "object" || !t) return t;
890
- var a = t[Symbol.toPrimitive];
891
- if (a !== void 0) {
892
- var r = a.call(t, e);
893
- if (typeof r != "object") return r;
894
- throw new TypeError("@@toPrimitive must return a primitive value.");
895
- }
896
- return (e === "string" ? String : Number)(t);
897
- }
898
- function Ue(t, e) {
899
- if (t == null) return {};
900
- var a, r, n = On(t, e);
901
- if (Object.getOwnPropertySymbols) {
902
- var i = Object.getOwnPropertySymbols(t);
903
- for (r = 0; r < i.length; r++) a = i[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
904
- }
905
- return n;
906
- }
907
- function On(t, e) {
908
- if (t == null) return {};
909
- var a = {};
910
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
911
- if (e.indexOf(r) !== -1) continue;
912
- a[r] = t[r];
913
- }
914
- return a;
915
- }
916
- var jn = (t) => {
917
- var {
918
- dataKey: e,
919
- name: a,
920
- stroke: r,
921
- legendType: n,
922
- hide: i
923
- } = t;
924
- return [{
925
- inactive: i,
926
- dataKey: e,
927
- type: n,
928
- color: r,
929
- value: ae(a, e),
930
- payload: t
931
- }];
932
- }, wn = /* @__PURE__ */ s.memo((t) => {
933
- var {
934
- dataKey: e,
935
- data: a,
936
- stroke: r,
937
- strokeWidth: n,
938
- fill: i,
939
- name: o,
940
- hide: l,
941
- unit: c,
942
- tooltipType: u,
943
- id: d
944
- } = t, f = {
945
- dataDefinedOnItem: a,
946
- getPosition: Ct,
947
- settings: {
948
- stroke: r,
949
- strokeWidth: n,
950
- fill: i,
951
- dataKey: e,
952
- nameKey: void 0,
953
- name: ae(o, e),
954
- hide: l,
955
- type: u,
956
- color: r,
957
- unit: c,
958
- graphicalItemId: d
959
- }
960
- };
961
- return /* @__PURE__ */ s.createElement(Re, {
962
- tooltipEntrySettings: f
963
- });
964
- }), Ut = (t, e) => "".concat(e, "px ").concat(t - e, "px");
965
- function Cn(t, e) {
966
- for (var a = t.length % 2 !== 0 ? [...t, 0] : t, r = [], n = 0; n < e; ++n)
967
- r = [...r, ...a];
968
- return r;
969
- }
970
- var Dn = (t, e, a) => {
971
- var r = a.reduce((v, y) => v + y);
972
- if (!r)
973
- return Ut(e, t);
974
- for (var n = Math.floor(t / r), i = t % r, o = e - t, l = [], c = 0, u = 0; c < a.length; u += (d = a[c]) !== null && d !== void 0 ? d : 0, ++c) {
975
- var d, f = a[c];
976
- if (f != null && u + f > i) {
977
- l = [...a.slice(0, c), i - u];
978
- break;
979
- }
980
- }
981
- var p = l.length % 2 === 0 ? [0, o] : [o];
982
- return [...Cn(a, n), ...l, ...p].map((v) => "".concat(v, "px")).join(", ");
983
- };
984
- function Sn(t) {
985
- var {
986
- clipPathId: e,
987
- points: a,
988
- props: r
989
- } = t, {
990
- dot: n,
991
- dataKey: i,
992
- needClip: o
993
- } = r, {
994
- id: l
995
- } = r, c = Ue(r, bn), u = te(c);
996
- return /* @__PURE__ */ s.createElement(Bt, {
997
- points: a,
998
- dot: n,
999
- className: "recharts-line-dots",
1000
- dotClassName: "recharts-line-dot",
1001
- dataKey: i,
1002
- baseProps: u,
1003
- needClip: o,
1004
- clipPathId: e
1005
- });
1006
- }
1007
- function kn(t) {
1008
- var {
1009
- showLabels: e,
1010
- children: a,
1011
- points: r
1012
- } = t, n = oe(() => r?.map((i) => {
1013
- var o, l, c = {
1014
- x: (o = i.x) !== null && o !== void 0 ? o : 0,
1015
- y: (l = i.y) !== null && l !== void 0 ? l : 0,
1016
- width: 0,
1017
- lowerWidth: 0,
1018
- upperWidth: 0,
1019
- height: 0
1020
- };
1021
- return B(B({}, c), {}, {
1022
- value: i.value,
1023
- payload: i.payload,
1024
- viewBox: c,
1025
- /*
1026
- * Line is not passing parentViewBox to the LabelList so the labels can escape - looks like a bug, should we pass parentViewBox?
1027
- * Or should this just be the root chart viewBox?
1028
- */
1029
- parentViewBox: void 0,
1030
- fill: void 0
1031
- });
1032
- }), [r]);
1033
- return /* @__PURE__ */ s.createElement(Nt, {
1034
- value: e ? n : void 0
1035
- }, a);
1036
- }
1037
- function nt(t) {
1038
- var {
1039
- clipPathId: e,
1040
- pathRef: a,
1041
- points: r,
1042
- strokeDasharray: n,
1043
- props: i
1044
- } = t, {
1045
- type: o,
1046
- layout: l,
1047
- connectNulls: c,
1048
- needClip: u,
1049
- shape: d
1050
- } = i, f = Ue(i, xn), p = B(B({}, Tt(f)), {}, {
1051
- fill: "none",
1052
- className: "recharts-line-curve",
1053
- clipPath: u ? "url(#clipPath-".concat(e, ")") : void 0,
1054
- points: r,
1055
- type: o,
1056
- layout: l,
1057
- connectNulls: c,
1058
- strokeDasharray: n ?? i.strokeDasharray
1059
- });
1060
- return /* @__PURE__ */ s.createElement(s.Fragment, null, r?.length > 1 && /* @__PURE__ */ s.createElement(Et, le({
1061
- shapeType: "curve",
1062
- option: d
1063
- }, p, {
1064
- pathRef: a
1065
- })), /* @__PURE__ */ s.createElement(Sn, {
1066
- points: r,
1067
- clipPathId: e,
1068
- props: i
1069
- }));
1070
- }
1071
- function Ln(t) {
1072
- try {
1073
- return t && t.getTotalLength && t.getTotalLength() || 0;
1074
- } catch {
1075
- return 0;
1076
- }
1077
- }
1078
- function Nn(t) {
1079
- var {
1080
- clipPathId: e,
1081
- props: a,
1082
- pathRef: r,
1083
- previousPointsRef: n,
1084
- longestAnimatedLengthRef: i
1085
- } = t, {
1086
- points: o,
1087
- strokeDasharray: l,
1088
- isAnimationActive: c,
1089
- animationBegin: u,
1090
- animationDuration: d,
1091
- animationEasing: f,
1092
- animateNewValues: p,
1093
- width: v,
1094
- height: y,
1095
- onAnimationEnd: g,
1096
- onAnimationStart: m
1097
- } = a, h = n.current, b = Ke(o, "recharts-line-"), P = F(b), [x, j] = Ne(!1), I = !x, O = ee(() => {
1098
- typeof g == "function" && g(), j(!1);
1099
- }, [g]), E = ee(() => {
1100
- typeof m == "function" && m(), j(!0);
1101
- }, [m]), C = Ln(r.current), D = F(0);
1102
- P.current !== b && (D.current = i.current, P.current = b);
1103
- var k = D.current;
1104
- return /* @__PURE__ */ s.createElement(kn, {
1105
- points: o,
1106
- showLabels: I
1107
- }, a.children, /* @__PURE__ */ s.createElement($e, {
1108
- animationId: b,
1109
- begin: u,
1110
- duration: d,
1111
- isActive: c,
1112
- easing: f,
1113
- onAnimationEnd: O,
1114
- onAnimationStart: E,
1115
- key: b
1116
- }, (w) => {
1117
- var N = R(k, C + k, w), T = Math.min(N, C), _;
1118
- if (c)
1119
- if (l) {
1120
- var Z = "".concat(l).split(/[,\s]+/gim).map((W) => parseFloat(W));
1121
- _ = Dn(T, C, Z);
1122
- } else
1123
- _ = Ut(C, T);
1124
- else
1125
- _ = l == null ? void 0 : String(l);
1126
- if (w > 0 && C > 0 && (n.current = o, i.current = Math.max(i.current, T)), h) {
1127
- var J = h.length / o.length, ce = w === 1 ? o : o.map((W, sa) => {
1128
- var Ye = Math.floor(sa * J);
1129
- if (h[Ye]) {
1130
- var He = h[Ye];
1131
- return B(B({}, W), {}, {
1132
- x: R(He.x, W.x, w),
1133
- y: R(He.y, W.y, w)
1134
- });
1135
- }
1136
- return p ? B(B({}, W), {}, {
1137
- x: R(v * 2, W.x, w),
1138
- y: R(y / 2, W.y, w)
1139
- }) : B(B({}, W), {}, {
1140
- x: W.x,
1141
- y: W.y
1142
- });
1143
- });
1144
- return n.current = ce, /* @__PURE__ */ s.createElement(nt, {
1145
- props: a,
1146
- points: ce,
1147
- clipPathId: e,
1148
- pathRef: r,
1149
- strokeDasharray: _
1150
- });
1151
- }
1152
- return /* @__PURE__ */ s.createElement(nt, {
1153
- props: a,
1154
- points: o,
1155
- clipPathId: e,
1156
- pathRef: r,
1157
- strokeDasharray: _
1158
- });
1159
- }), /* @__PURE__ */ s.createElement(We, {
1160
- label: a.label
1161
- }));
1162
- }
1163
- function Tn(t) {
1164
- var {
1165
- clipPathId: e,
1166
- props: a
1167
- } = t, r = F(null), n = F(0), i = F(null);
1168
- return /* @__PURE__ */ s.createElement(Nn, {
1169
- props: a,
1170
- clipPathId: e,
1171
- previousPointsRef: r,
1172
- longestAnimatedLengthRef: n,
1173
- pathRef: i
1174
- });
1175
- }
1176
- var _n = (t, e) => {
1177
- var a, r;
1178
- return {
1179
- x: (a = t.x) !== null && a !== void 0 ? a : void 0,
1180
- y: (r = t.y) !== null && r !== void 0 ? r : void 0,
1181
- value: t.value,
1182
- // @ts-expect-error getValueByDataKey does not validate the output type
1183
- errorVal: $(t.payload, e)
1184
- };
1185
- };
1186
- class Rn extends ca {
1187
- render() {
1188
- var {
1189
- hide: e,
1190
- dot: a,
1191
- points: r,
1192
- className: n,
1193
- xAxisId: i,
1194
- yAxisId: o,
1195
- top: l,
1196
- left: c,
1197
- width: u,
1198
- height: d,
1199
- id: f,
1200
- needClip: p,
1201
- zIndex: v
1202
- } = this.props;
1203
- if (e)
1204
- return null;
1205
- var y = U("recharts-line", n), g = f, {
1206
- r: m,
1207
- strokeWidth: h
1208
- } = Xt(a), b = Me(a), P = m * 2 + h, x = p ? "url(#clipPath-".concat(b ? "" : "dots-").concat(g, ")") : void 0;
1209
- return /* @__PURE__ */ s.createElement(ne, {
1210
- zIndex: v
1211
- }, /* @__PURE__ */ s.createElement(K, {
1212
- className: y
1213
- }, p && /* @__PURE__ */ s.createElement("defs", null, /* @__PURE__ */ s.createElement(Lt, {
1214
- clipPathId: g,
1215
- xAxisId: i,
1216
- yAxisId: o
1217
- }), !b && /* @__PURE__ */ s.createElement("clipPath", {
1218
- id: "clipPath-dots-".concat(g)
1219
- }, /* @__PURE__ */ s.createElement("rect", {
1220
- x: c - P / 2,
1221
- y: l - P / 2,
1222
- width: u + P,
1223
- height: d + P
1224
- }))), /* @__PURE__ */ s.createElement(Ya, {
1225
- xAxisId: i,
1226
- yAxisId: o,
1227
- data: r,
1228
- dataPointFormatter: _n,
1229
- errorBarOffset: 0
1230
- }, /* @__PURE__ */ s.createElement(Tn, {
1231
- props: this.props,
1232
- clipPathId: g
1233
- }))), /* @__PURE__ */ s.createElement(Se, {
1234
- activeDot: this.props.activeDot,
1235
- points: r,
1236
- mainColor: this.props.stroke,
1237
- itemDataKey: this.props.dataKey,
1238
- clipPath: x
1239
- }));
1240
- }
1241
- }
1242
- var Yt = {
1243
- activeDot: !0,
1244
- animateNewValues: !0,
1245
- animationBegin: 0,
1246
- animationDuration: 1500,
1247
- animationEasing: "ease",
1248
- connectNulls: !1,
1249
- dot: !0,
1250
- fill: "#fff",
1251
- hide: !1,
1252
- isAnimationActive: "auto",
1253
- label: !1,
1254
- legendType: "line",
1255
- stroke: "#3182bd",
1256
- strokeWidth: 1,
1257
- xAxisId: 0,
1258
- yAxisId: 0,
1259
- zIndex: re.line,
1260
- type: "linear"
1261
- };
1262
- function Kn(t) {
1263
- var e = q(t, Yt), {
1264
- activeDot: a,
1265
- animateNewValues: r,
1266
- animationBegin: n,
1267
- animationDuration: i,
1268
- animationEasing: o,
1269
- connectNulls: l,
1270
- dot: c,
1271
- hide: u,
1272
- isAnimationActive: d,
1273
- label: f,
1274
- legendType: p,
1275
- xAxisId: v,
1276
- yAxisId: y,
1277
- id: g
1278
- } = e, m = Ue(e, Pn), {
1279
- needClip: h
1280
- } = Dt(v, y), b = St(), P = kt(), x = Ae(), j = V((D) => gn(D, v, y, x, g));
1281
- if (P !== "horizontal" && P !== "vertical" || j == null || b == null)
1282
- return null;
1283
- var {
1284
- height: I,
1285
- width: O,
1286
- x: E,
1287
- y: C
1288
- } = b;
1289
- return /* @__PURE__ */ s.createElement(Rn, le({}, m, {
1290
- id: g,
1291
- connectNulls: l,
1292
- dot: c,
1293
- activeDot: a,
1294
- animateNewValues: r,
1295
- animationBegin: n,
1296
- animationDuration: i,
1297
- animationEasing: o,
1298
- isAnimationActive: d,
1299
- hide: u,
1300
- label: f,
1301
- legendType: p,
1302
- xAxisId: v,
1303
- yAxisId: y,
1304
- points: j,
1305
- layout: P,
1306
- height: I,
1307
- width: O,
1308
- left: E,
1309
- top: C,
1310
- needClip: h
1311
- }));
1312
- }
1313
- function $n(t) {
1314
- var {
1315
- layout: e,
1316
- xAxis: a,
1317
- yAxis: r,
1318
- xAxisTicks: n,
1319
- yAxisTicks: i,
1320
- dataKey: o,
1321
- bandSize: l,
1322
- displayedData: c
1323
- } = t;
1324
- return c.map((u, d) => {
1325
- var f = $(u, o);
1326
- if (e === "horizontal") {
1327
- var p = me({
1328
- axis: a,
1329
- ticks: n,
1330
- bandSize: l,
1331
- entry: u,
1332
- index: d
1333
- }), v = ve(f) ? null : r.scale.map(f);
1334
- return {
1335
- x: p,
1336
- y: v ?? null,
1337
- value: f,
1338
- payload: u
1339
- };
1340
- }
1341
- var y = ve(f) ? null : a.scale.map(f), g = me({
1342
- axis: r,
1343
- ticks: i,
1344
- bandSize: l,
1345
- entry: u,
1346
- index: d
1347
- });
1348
- return y == null || g == null ? null : {
1349
- x: y,
1350
- y: g,
1351
- value: f,
1352
- payload: u
1353
- };
1354
- }).filter(Boolean);
1355
- }
1356
- function Wn(t) {
1357
- var e = q(t, Yt), a = Ae();
1358
- return /* @__PURE__ */ s.createElement(Te, {
1359
- id: e.id,
1360
- type: "line"
1361
- }, (r) => /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(jt, {
1362
- legendPayload: jn(e)
1363
- }), /* @__PURE__ */ s.createElement(wn, {
1364
- dataKey: e.dataKey,
1365
- data: e.data,
1366
- stroke: e.stroke,
1367
- strokeWidth: e.strokeWidth,
1368
- fill: e.fill,
1369
- name: e.name,
1370
- hide: e.hide,
1371
- unit: e.unit,
1372
- tooltipType: e.tooltipType,
1373
- id: r
1374
- }), /* @__PURE__ */ s.createElement(wt, {
1375
- type: "line",
1376
- id: r,
1377
- data: e.data,
1378
- xAxisId: e.xAxisId,
1379
- yAxisId: e.yAxisId,
1380
- zAxisId: 0,
1381
- dataKey: e.dataKey,
1382
- hide: e.hide,
1383
- isPanorama: a
1384
- }), /* @__PURE__ */ s.createElement(Kn, le({}, e, {
1385
- id: r
1386
- }))));
1387
- }
1388
- var Ht = /* @__PURE__ */ s.memo(Wn, Ot);
1389
- Ht.displayName = "Line";
1390
- var qt = (t, e, a) => xe(t, "xAxis", ze(t, e), a), Zt = (t, e, a) => Pe(t, "xAxis", ze(t, e), a), Jt = (t, e, a) => xe(t, "yAxis", Fe(t, e), a), Qt = (t, e, a) => Pe(t, "yAxis", Fe(t, e), a), Mn = S([H, qt, Jt, Zt, Qt], (t, e, a, r, n) => Be(t, "xAxis") ? fe(e, r, !1) : fe(a, n, !1)), Bn = (t, e) => e, ea = S([It, Bn], (t, e) => t.filter((a) => a.type === "area").find((a) => a.id === e)), ta = (t) => {
1391
- var e = H(t), a = Be(e, "xAxis");
1392
- return a ? "yAxis" : "xAxis";
1393
- }, zn = (t, e) => {
1394
- var a = ta(t);
1395
- return a === "yAxis" ? Fe(t, e) : ze(t, e);
1396
- }, Fn = (t, e, a) => Za(t, ta(t), zn(t, e), a), Vn = S([ea, Fn], (t, e) => {
1397
- var a;
1398
- if (!(t == null || e == null)) {
1399
- var {
1400
- stackId: r
1401
- } = t, n = Ja(t);
1402
- if (!(r == null || n == null)) {
1403
- var i = (a = e[r]) === null || a === void 0 ? void 0 : a.stackedData, o = i?.find((l) => l.key === n);
1404
- if (o != null)
1405
- return o.map((l) => [l[0], l[1]]);
1406
- }
1407
- }
1408
- }), Gn = S([H, qt, Jt, Zt, Qt, Vn, Ha, Mn, ea, qa], (t, e, a, r, n, i, o, l, c, u) => {
1409
- var {
1410
- chartData: d,
1411
- dataStartIndex: f,
1412
- dataEndIndex: p
1413
- } = o;
1414
- if (!(c == null || t !== "horizontal" && t !== "vertical" || e == null || a == null || r == null || n == null || r.length === 0 || n.length === 0 || l == null)) {
1415
- var {
1416
- data: v
1417
- } = c, y;
1418
- if (v && v.length > 0 ? y = v : y = d?.slice(f, p + 1), y != null)
1419
- return ui({
1420
- layout: t,
1421
- xAxis: e,
1422
- yAxis: a,
1423
- xAxisTicks: r,
1424
- yAxisTicks: n,
1425
- dataStartIndex: f,
1426
- areaSettings: c,
1427
- stackedData: i,
1428
- displayedData: y,
1429
- chartBaseValue: u,
1430
- bandSize: l
1431
- });
1432
- }
1433
- }), Xn = ["id"], Un = ["activeDot", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "fill", "fillOpacity", "hide", "isAnimationActive", "legendType", "stroke", "xAxisId", "yAxisId"];
1434
- function X() {
1435
- return X = Object.assign ? Object.assign.bind() : function(t) {
1436
- for (var e = 1; e < arguments.length; e++) {
1437
- var a = arguments[e];
1438
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
1439
- }
1440
- return t;
1441
- }, X.apply(null, arguments);
1442
- }
1443
- function aa(t, e) {
1444
- if (t == null) return {};
1445
- var a, r, n = Yn(t, e);
1446
- if (Object.getOwnPropertySymbols) {
1447
- var i = Object.getOwnPropertySymbols(t);
1448
- for (r = 0; r < i.length; r++) a = i[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
1449
- }
1450
- return n;
1451
- }
1452
- function Yn(t, e) {
1453
- if (t == null) return {};
1454
- var a = {};
1455
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
1456
- if (e.indexOf(r) !== -1) continue;
1457
- a[r] = t[r];
1458
- }
1459
- return a;
1460
- }
1461
- function it(t, e) {
1462
- var a = Object.keys(t);
1463
- if (Object.getOwnPropertySymbols) {
1464
- var r = Object.getOwnPropertySymbols(t);
1465
- e && (r = r.filter(function(n) {
1466
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
1467
- })), a.push.apply(a, r);
1468
- }
1469
- return a;
1470
- }
1471
- function Q(t) {
1472
- for (var e = 1; e < arguments.length; e++) {
1473
- var a = arguments[e] != null ? arguments[e] : {};
1474
- e % 2 ? it(Object(a), !0).forEach(function(r) {
1475
- Hn(t, r, a[r]);
1476
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : it(Object(a)).forEach(function(r) {
1477
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
1478
- });
1479
- }
1480
- return t;
1481
- }
1482
- function Hn(t, e, a) {
1483
- return (e = qn(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
1484
- }
1485
- function qn(t) {
1486
- var e = Zn(t, "string");
1487
- return typeof e == "symbol" ? e : e + "";
1488
- }
1489
- function Zn(t, e) {
1490
- if (typeof t != "object" || !t) return t;
1491
- var a = t[Symbol.toPrimitive];
1492
- if (a !== void 0) {
1493
- var r = a.call(t, e);
1494
- if (typeof r != "object") return r;
1495
- throw new TypeError("@@toPrimitive must return a primitive value.");
1496
- }
1497
- return (e === "string" ? String : Number)(t);
1498
- }
1499
- function ge(t, e) {
1500
- return t && t !== "none" ? t : e;
1501
- }
1502
- var Jn = (t) => {
1503
- var {
1504
- dataKey: e,
1505
- name: a,
1506
- stroke: r,
1507
- fill: n,
1508
- legendType: i,
1509
- hide: o
1510
- } = t;
1511
- return [{
1512
- inactive: o,
1513
- dataKey: e,
1514
- type: i,
1515
- color: ge(r, n),
1516
- value: ae(a, e),
1517
- payload: t
1518
- }];
1519
- }, Qn = /* @__PURE__ */ s.memo((t) => {
1520
- var {
1521
- dataKey: e,
1522
- data: a,
1523
- stroke: r,
1524
- strokeWidth: n,
1525
- fill: i,
1526
- name: o,
1527
- hide: l,
1528
- unit: c,
1529
- tooltipType: u,
1530
- id: d
1531
- } = t, f = {
1532
- dataDefinedOnItem: a,
1533
- getPosition: Ct,
1534
- settings: {
1535
- stroke: r,
1536
- strokeWidth: n,
1537
- fill: i,
1538
- dataKey: e,
1539
- nameKey: void 0,
1540
- name: ae(o, e),
1541
- hide: l,
1542
- type: u,
1543
- color: ge(r, i),
1544
- unit: c,
1545
- graphicalItemId: d
1546
- }
1547
- };
1548
- return /* @__PURE__ */ s.createElement(Re, {
1549
- tooltipEntrySettings: f
1550
- });
1551
- });
1552
- function ei(t) {
1553
- var {
1554
- clipPathId: e,
1555
- points: a,
1556
- props: r
1557
- } = t, {
1558
- needClip: n,
1559
- dot: i,
1560
- dataKey: o
1561
- } = r, l = te(r);
1562
- return /* @__PURE__ */ s.createElement(Bt, {
1563
- points: a,
1564
- dot: i,
1565
- className: "recharts-area-dots",
1566
- dotClassName: "recharts-area-dot",
1567
- dataKey: o,
1568
- baseProps: l,
1569
- needClip: n,
1570
- clipPathId: e
1571
- });
1572
- }
1573
- function ti(t) {
1574
- var {
1575
- showLabels: e,
1576
- children: a,
1577
- points: r
1578
- } = t, n = r.map((i) => {
1579
- var o, l, c = {
1580
- x: (o = i.x) !== null && o !== void 0 ? o : 0,
1581
- y: (l = i.y) !== null && l !== void 0 ? l : 0,
1582
- width: 0,
1583
- lowerWidth: 0,
1584
- upperWidth: 0,
1585
- height: 0
1586
- };
1587
- return Q(Q({}, c), {}, {
1588
- value: i.value,
1589
- payload: i.payload,
1590
- parentViewBox: void 0,
1591
- viewBox: c,
1592
- fill: void 0
1593
- });
1594
- });
1595
- return /* @__PURE__ */ s.createElement(Nt, {
1596
- value: e ? n : void 0
1597
- }, a);
1598
- }
1599
- function lt(t) {
1600
- var {
1601
- points: e,
1602
- baseLine: a,
1603
- needClip: r,
1604
- clipPathId: n,
1605
- props: i
1606
- } = t, {
1607
- layout: o,
1608
- type: l,
1609
- stroke: c,
1610
- connectNulls: u,
1611
- isRange: d
1612
- } = i, {
1613
- id: f
1614
- } = i, p = aa(i, Xn), v = te(p), y = Tt(p);
1615
- return /* @__PURE__ */ s.createElement(s.Fragment, null, e?.length > 1 && /* @__PURE__ */ s.createElement(K, {
1616
- clipPath: r ? "url(#clipPath-".concat(n, ")") : void 0
1617
- }, /* @__PURE__ */ s.createElement(de, X({}, y, {
1618
- id: f,
1619
- points: e,
1620
- connectNulls: u,
1621
- type: l,
1622
- baseLine: a,
1623
- layout: o,
1624
- stroke: "none",
1625
- className: "recharts-area-area"
1626
- })), c !== "none" && /* @__PURE__ */ s.createElement(de, X({}, v, {
1627
- className: "recharts-area-curve",
1628
- layout: o,
1629
- type: l,
1630
- connectNulls: u,
1631
- fill: "none",
1632
- points: e
1633
- })), c !== "none" && d && /* @__PURE__ */ s.createElement(de, X({}, v, {
1634
- className: "recharts-area-curve",
1635
- layout: o,
1636
- type: l,
1637
- connectNulls: u,
1638
- fill: "none",
1639
- points: a
1640
- }))), /* @__PURE__ */ s.createElement(ei, {
1641
- points: e,
1642
- props: p,
1643
- clipPathId: n
1644
- }));
1645
- }
1646
- function ai(t) {
1647
- var e, a, {
1648
- alpha: r,
1649
- baseLine: n,
1650
- points: i,
1651
- strokeWidth: o
1652
- } = t, l = (e = i[0]) === null || e === void 0 ? void 0 : e.y, c = (a = i[i.length - 1]) === null || a === void 0 ? void 0 : a.y;
1653
- if (!he(l) || !he(c))
1654
- return null;
1655
- var u = r * Math.abs(l - c), d = Math.max(...i.map((f) => f.x || 0));
1656
- return M(n) ? d = Math.max(n, d) : n && Array.isArray(n) && n.length && (d = Math.max(...n.map((f) => f.x || 0), d)), M(d) ? /* @__PURE__ */ s.createElement("rect", {
1657
- x: 0,
1658
- y: l < c ? l : l - u,
1659
- width: d + (o ? parseInt("".concat(o), 10) : 1),
1660
- height: Math.floor(u)
1661
- }) : null;
1662
- }
1663
- function ri(t) {
1664
- var e, a, {
1665
- alpha: r,
1666
- baseLine: n,
1667
- points: i,
1668
- strokeWidth: o
1669
- } = t, l = (e = i[0]) === null || e === void 0 ? void 0 : e.x, c = (a = i[i.length - 1]) === null || a === void 0 ? void 0 : a.x;
1670
- if (!he(l) || !he(c))
1671
- return null;
1672
- var u = r * Math.abs(l - c), d = Math.max(...i.map((f) => f.y || 0));
1673
- return M(n) ? d = Math.max(n, d) : n && Array.isArray(n) && n.length && (d = Math.max(...n.map((f) => f.y || 0), d)), M(d) ? /* @__PURE__ */ s.createElement("rect", {
1674
- x: l < c ? l : l - u,
1675
- y: 0,
1676
- width: u,
1677
- height: Math.floor(d + (o ? parseInt("".concat(o), 10) : 1))
1678
- }) : null;
1679
- }
1680
- function ni(t) {
1681
- var {
1682
- alpha: e,
1683
- layout: a,
1684
- points: r,
1685
- baseLine: n,
1686
- strokeWidth: i
1687
- } = t;
1688
- return a === "vertical" ? /* @__PURE__ */ s.createElement(ai, {
1689
- alpha: e,
1690
- points: r,
1691
- baseLine: n,
1692
- strokeWidth: i
1693
- }) : /* @__PURE__ */ s.createElement(ri, {
1694
- alpha: e,
1695
- points: r,
1696
- baseLine: n,
1697
- strokeWidth: i
1698
- });
1699
- }
1700
- function ii(t) {
1701
- var {
1702
- needClip: e,
1703
- clipPathId: a,
1704
- props: r,
1705
- previousPointsRef: n,
1706
- previousBaselineRef: i
1707
- } = t, {
1708
- points: o,
1709
- baseLine: l,
1710
- isAnimationActive: c,
1711
- animationBegin: u,
1712
- animationDuration: d,
1713
- animationEasing: f,
1714
- onAnimationStart: p,
1715
- onAnimationEnd: v
1716
- } = r, y = oe(() => ({
1717
- points: o,
1718
- baseLine: l
1719
- }), [o, l]), g = Ke(y, "recharts-area-"), m = tr(), [h, b] = Ne(!1), P = !h, x = ee(() => {
1720
- typeof v == "function" && v(), b(!1);
1721
- }, [v]), j = ee(() => {
1722
- typeof p == "function" && p(), b(!0);
1723
- }, [p]);
1724
- if (m == null)
1725
- return null;
1726
- var I = n.current, O = i.current;
1727
- return /* @__PURE__ */ s.createElement(ti, {
1728
- showLabels: P,
1729
- points: o
1730
- }, r.children, /* @__PURE__ */ s.createElement($e, {
1731
- animationId: g,
1732
- begin: u,
1733
- duration: d,
1734
- isActive: c,
1735
- easing: f,
1736
- onAnimationEnd: x,
1737
- onAnimationStart: j,
1738
- key: g
1739
- }, (E) => {
1740
- if (I) {
1741
- var C = I.length / o.length, D = (
1742
- /*
1743
- * Here it is important that at the very end of the animation, on the last frame,
1744
- * we render the original points without any interpolation.
1745
- * This is needed because the code above is checking for reference equality to decide if the animation should run
1746
- * and if we create a new array instance (even if the numbers were the same)
1747
- * then we would break animations.
1748
- */
1749
- E === 1 ? o : o.map((w, N) => {
1750
- var T = Math.floor(N * C);
1751
- if (I[T]) {
1752
- var _ = I[T];
1753
- return Q(Q({}, w), {}, {
1754
- x: R(_.x, w.x, E),
1755
- y: R(_.y, w.y, E)
1756
- });
1757
- }
1758
- return w;
1759
- })
1760
- ), k;
1761
- return M(l) ? k = R(O, l, E) : ve(l) || ar(l) ? k = R(O, 0, E) : k = l.map((w, N) => {
1762
- var T = Math.floor(N * C);
1763
- if (Array.isArray(O) && O[T]) {
1764
- var _ = O[T];
1765
- return Q(Q({}, w), {}, {
1766
- x: R(_.x, w.x, E),
1767
- y: R(_.y, w.y, E)
1768
- });
1769
- }
1770
- return w;
1771
- }), E > 0 && (n.current = D, i.current = k), /* @__PURE__ */ s.createElement(lt, {
1772
- points: D,
1773
- baseLine: k,
1774
- needClip: e,
1775
- clipPathId: a,
1776
- props: r
1777
- });
1778
- }
1779
- return E > 0 && (n.current = o, i.current = l), /* @__PURE__ */ s.createElement(K, null, c && /* @__PURE__ */ s.createElement("defs", null, /* @__PURE__ */ s.createElement("clipPath", {
1780
- id: "animationClipPath-".concat(a)
1781
- }, /* @__PURE__ */ s.createElement(ni, {
1782
- alpha: E,
1783
- points: o,
1784
- baseLine: l,
1785
- layout: m,
1786
- strokeWidth: r.strokeWidth
1787
- }))), /* @__PURE__ */ s.createElement(K, {
1788
- clipPath: "url(#animationClipPath-".concat(a, ")")
1789
- }, /* @__PURE__ */ s.createElement(lt, {
1790
- points: o,
1791
- baseLine: l,
1792
- needClip: e,
1793
- clipPathId: a,
1794
- props: r
1795
- })));
1796
- }), /* @__PURE__ */ s.createElement(We, {
1797
- label: r.label
1798
- }));
1799
- }
1800
- function li(t) {
1801
- var {
1802
- needClip: e,
1803
- clipPathId: a,
1804
- props: r
1805
- } = t, n = F(null), i = F();
1806
- return /* @__PURE__ */ s.createElement(ii, {
1807
- needClip: e,
1808
- clipPathId: a,
1809
- props: r,
1810
- previousPointsRef: n,
1811
- previousBaselineRef: i
1812
- });
1813
- }
1814
- class oi extends ua {
1815
- render() {
1816
- var {
1817
- hide: e,
1818
- dot: a,
1819
- points: r,
1820
- className: n,
1821
- top: i,
1822
- left: o,
1823
- needClip: l,
1824
- xAxisId: c,
1825
- yAxisId: u,
1826
- width: d,
1827
- height: f,
1828
- id: p,
1829
- baseLine: v,
1830
- zIndex: y
1831
- } = this.props;
1832
- if (e)
1833
- return null;
1834
- var g = U("recharts-area", n), m = p, {
1835
- r: h,
1836
- strokeWidth: b
1837
- } = Xt(a), P = Me(a), x = h * 2 + b, j = l ? "url(#clipPath-".concat(P ? "" : "dots-").concat(m, ")") : void 0;
1838
- return /* @__PURE__ */ s.createElement(ne, {
1839
- zIndex: y
1840
- }, /* @__PURE__ */ s.createElement(K, {
1841
- className: g
1842
- }, l && /* @__PURE__ */ s.createElement("defs", null, /* @__PURE__ */ s.createElement(Lt, {
1843
- clipPathId: m,
1844
- xAxisId: c,
1845
- yAxisId: u
1846
- }), !P && /* @__PURE__ */ s.createElement("clipPath", {
1847
- id: "clipPath-dots-".concat(m)
1848
- }, /* @__PURE__ */ s.createElement("rect", {
1849
- x: o - x / 2,
1850
- y: i - x / 2,
1851
- width: d + x,
1852
- height: f + x
1853
- }))), /* @__PURE__ */ s.createElement(li, {
1854
- needClip: l,
1855
- clipPathId: m,
1856
- props: this.props
1857
- })), /* @__PURE__ */ s.createElement(Se, {
1858
- points: r,
1859
- mainColor: ge(this.props.stroke, this.props.fill),
1860
- itemDataKey: this.props.dataKey,
1861
- activeDot: this.props.activeDot,
1862
- clipPath: j
1863
- }), this.props.isRange && Array.isArray(v) && /* @__PURE__ */ s.createElement(Se, {
1864
- points: v,
1865
- mainColor: ge(this.props.stroke, this.props.fill),
1866
- itemDataKey: this.props.dataKey,
1867
- activeDot: this.props.activeDot,
1868
- clipPath: j
1869
- }));
1870
- }
1871
- }
1872
- var ra = {
1873
- activeDot: !0,
1874
- animationBegin: 0,
1875
- animationDuration: 1500,
1876
- animationEasing: "ease",
1877
- connectNulls: !1,
1878
- dot: !1,
1879
- fill: "#3182bd",
1880
- fillOpacity: 0.6,
1881
- hide: !1,
1882
- isAnimationActive: "auto",
1883
- legendType: "line",
1884
- stroke: "#3182bd",
1885
- strokeWidth: 1,
1886
- type: "linear",
1887
- label: !1,
1888
- xAxisId: 0,
1889
- yAxisId: 0,
1890
- zIndex: re.area
1891
- };
1892
- function si(t) {
1893
- var e, a = q(t, ra), {
1894
- activeDot: r,
1895
- animationBegin: n,
1896
- animationDuration: i,
1897
- animationEasing: o,
1898
- connectNulls: l,
1899
- dot: c,
1900
- fill: u,
1901
- fillOpacity: d,
1902
- hide: f,
1903
- isAnimationActive: p,
1904
- legendType: v,
1905
- stroke: y,
1906
- xAxisId: g,
1907
- yAxisId: m
1908
- } = a, h = aa(a, Un), b = kt(), P = er(), {
1909
- needClip: x
1910
- } = Dt(g, m), j = Ae(), {
1911
- points: I,
1912
- isRange: O,
1913
- baseLine: E
1914
- } = (e = V((T) => Gn(T, t.id, j))) !== null && e !== void 0 ? e : {}, C = St();
1915
- if (b !== "horizontal" && b !== "vertical" || C == null || P !== "AreaChart" && P !== "ComposedChart")
1916
- return null;
1917
- var {
1918
- height: D,
1919
- width: k,
1920
- x: w,
1921
- y: N
1922
- } = C;
1923
- return !I || !I.length ? null : /* @__PURE__ */ s.createElement(oi, X({}, h, {
1924
- activeDot: r,
1925
- animationBegin: n,
1926
- animationDuration: i,
1927
- animationEasing: o,
1928
- baseLine: E,
1929
- connectNulls: l,
1930
- dot: c,
1931
- fill: u,
1932
- fillOpacity: d,
1933
- height: D,
1934
- hide: f,
1935
- layout: b,
1936
- isAnimationActive: p === "auto" ? !rr.isSsr : p,
1937
- isRange: O,
1938
- legendType: v,
1939
- needClip: x,
1940
- points: I,
1941
- stroke: y,
1942
- width: k,
1943
- left: w,
1944
- top: N,
1945
- xAxisId: g,
1946
- yAxisId: m
1947
- }));
1948
- }
1949
- var ci = (t, e, a, r, n) => {
1950
- var i = a ?? e;
1951
- if (M(i))
1952
- return i;
1953
- var o = t === "horizontal" ? n : r, l = o.scale.domain();
1954
- if (o.type === "number") {
1955
- var c = Math.max(l[0], l[1]), u = Math.min(l[0], l[1]);
1956
- return i === "dataMin" ? u : i === "dataMax" || c < 0 ? c : Math.max(Math.min(l[0], l[1]), 0);
1957
- }
1958
- return i === "dataMin" ? l[0] : i === "dataMax" ? l[1] : l[0];
1959
- };
1960
- function ui(t) {
1961
- var {
1962
- areaSettings: {
1963
- connectNulls: e,
1964
- baseValue: a,
1965
- dataKey: r
1966
- },
1967
- stackedData: n,
1968
- layout: i,
1969
- chartBaseValue: o,
1970
- xAxis: l,
1971
- yAxis: c,
1972
- displayedData: u,
1973
- dataStartIndex: d,
1974
- xAxisTicks: f,
1975
- yAxisTicks: p,
1976
- bandSize: v
1977
- } = t, y = n && n.length, g = ci(i, o, a, l, c), m = i === "horizontal", h = !1, b = u.map((x, j) => {
1978
- var I, O, E, C;
1979
- if (y)
1980
- C = n[d + j];
1981
- else {
1982
- var D = $(x, r);
1983
- Array.isArray(D) ? (C = D, h = !0) : C = [g, D];
1984
- }
1985
- var k = (I = (O = C) === null || O === void 0 ? void 0 : O[1]) !== null && I !== void 0 ? I : null, w = k == null || y && !e && $(x, r) == null;
1986
- if (m) {
1987
- var N;
1988
- return {
1989
- x: me({
1990
- axis: l,
1991
- ticks: f,
1992
- bandSize: v,
1993
- entry: x,
1994
- index: j
1995
- }),
1996
- y: w ? null : (N = c.scale.map(k)) !== null && N !== void 0 ? N : null,
1997
- value: C,
1998
- payload: x
1999
- };
2000
- }
2001
- return {
2002
- x: w ? null : (E = l.scale.map(k)) !== null && E !== void 0 ? E : null,
2003
- y: me({
2004
- axis: c,
2005
- ticks: p,
2006
- bandSize: v,
2007
- entry: x,
2008
- index: j
2009
- }),
2010
- value: C,
2011
- payload: x
2012
- };
2013
- }), P;
2014
- return y || h ? P = b.map((x) => {
2015
- var j, I = Array.isArray(x.value) ? x.value[0] : null;
2016
- if (m) {
2017
- var O;
2018
- return {
2019
- x: x.x,
2020
- y: I != null && x.y != null && (O = c.scale.map(I)) !== null && O !== void 0 ? O : null,
2021
- payload: x.payload
2022
- };
2023
- }
2024
- return {
2025
- x: I != null && (j = l.scale.map(I)) !== null && j !== void 0 ? j : null,
2026
- y: x.y,
2027
- payload: x.payload
2028
- };
2029
- }) : P = m ? c.scale.map(g) : l.scale.map(g), {
2030
- points: b,
2031
- baseLine: P ?? 0,
2032
- isRange: h
2033
- };
2034
- }
2035
- function di(t) {
2036
- var e = q(t, ra), a = Ae();
2037
- return /* @__PURE__ */ s.createElement(Te, {
2038
- id: e.id,
2039
- type: "area"
2040
- }, (r) => /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(jt, {
2041
- legendPayload: Jn(e)
2042
- }), /* @__PURE__ */ s.createElement(Qn, {
2043
- dataKey: e.dataKey,
2044
- data: e.data,
2045
- stroke: e.stroke,
2046
- strokeWidth: e.strokeWidth,
2047
- fill: e.fill,
2048
- name: e.name,
2049
- hide: e.hide,
2050
- unit: e.unit,
2051
- tooltipType: e.tooltipType,
2052
- id: r
2053
- }), /* @__PURE__ */ s.createElement(wt, {
2054
- type: "area",
2055
- id: r,
2056
- data: e.data,
2057
- dataKey: e.dataKey,
2058
- xAxisId: e.xAxisId,
2059
- yAxisId: e.yAxisId,
2060
- zAxisId: 0,
2061
- stackId: Qa(e.stackId),
2062
- hide: e.hide,
2063
- barSize: void 0,
2064
- baseValue: e.baseValue,
2065
- isPanorama: a,
2066
- connectNulls: e.connectNulls
2067
- }), /* @__PURE__ */ s.createElement(si, X({}, e, {
2068
- id: r
2069
- }))));
2070
- }
2071
- var na = /* @__PURE__ */ s.memo(di, Ot);
2072
- na.displayName = "Area";
2073
- var pi = ["axis"], vi = /* @__PURE__ */ be((t, e) => /* @__PURE__ */ s.createElement(_t, {
2074
- chartName: "LineChart",
2075
- defaultTooltipEventType: "axis",
2076
- validateTooltipEventTypes: pi,
2077
- tooltipPayloadSearcher: Ve,
2078
- categoricalChartProps: t,
2079
- ref: e
2080
- }));
2081
- function fi(t) {
2082
- var e = nr();
2083
- return da(() => {
2084
- e(ir(t));
2085
- }, [e, t]), null;
2086
- }
2087
- var mi = ["layout"];
2088
- function ke() {
2089
- return ke = Object.assign ? Object.assign.bind() : function(t) {
2090
- for (var e = 1; e < arguments.length; e++) {
2091
- var a = arguments[e];
2092
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
2093
- }
2094
- return t;
2095
- }, ke.apply(null, arguments);
2096
- }
2097
- function hi(t, e) {
2098
- if (t == null) return {};
2099
- var a, r, n = yi(t, e);
2100
- if (Object.getOwnPropertySymbols) {
2101
- var i = Object.getOwnPropertySymbols(t);
2102
- for (r = 0; r < i.length; r++) a = i[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
2103
- }
2104
- return n;
2105
- }
2106
- function yi(t, e) {
2107
- if (t == null) return {};
2108
- var a = {};
2109
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
2110
- if (e.indexOf(r) !== -1) continue;
2111
- a[r] = t[r];
2112
- }
2113
- return a;
2114
- }
2115
- var gi = {
2116
- top: 5,
2117
- right: 5,
2118
- bottom: 5,
2119
- left: 5
2120
- }, ia = {
2121
- accessibilityLayer: !0,
2122
- stackOffset: "none",
2123
- barCategoryGap: "10%",
2124
- barGap: 4,
2125
- margin: gi,
2126
- reverseStackOrder: !1,
2127
- syncMethod: "index",
2128
- layout: "radial",
2129
- responsive: !1,
2130
- cx: "50%",
2131
- cy: "50%",
2132
- innerRadius: 0,
2133
- outerRadius: "80%"
2134
- }, bi = /* @__PURE__ */ be(function(e, a) {
2135
- var r, n = q(e.categoricalChartProps, ia), {
2136
- layout: i
2137
- } = n, o = hi(n, mi), {
2138
- chartName: l,
2139
- defaultTooltipEventType: c,
2140
- validateTooltipEventTypes: u,
2141
- tooltipPayloadSearcher: d
2142
- } = e, f = {
2143
- chartName: l,
2144
- defaultTooltipEventType: c,
2145
- validateTooltipEventTypes: u,
2146
- tooltipPayloadSearcher: d,
2147
- eventEmitter: void 0
2148
- };
2149
- return /* @__PURE__ */ s.createElement(lr, {
2150
- preloadedState: {
2151
- options: f
2152
- },
2153
- reduxStoreName: (r = n.id) !== null && r !== void 0 ? r : l
2154
- }, /* @__PURE__ */ s.createElement(or, {
2155
- chartData: n.data
2156
- }), /* @__PURE__ */ s.createElement(sr, {
2157
- layout: i,
2158
- margin: n.margin
2159
- }), /* @__PURE__ */ s.createElement(cr, {
2160
- baseValue: void 0,
2161
- accessibilityLayer: n.accessibilityLayer,
2162
- barCategoryGap: n.barCategoryGap,
2163
- maxBarSize: n.maxBarSize,
2164
- stackOffset: n.stackOffset,
2165
- barGap: n.barGap,
2166
- barSize: n.barSize,
2167
- syncId: n.syncId,
2168
- syncMethod: n.syncMethod,
2169
- className: n.className,
2170
- reverseStackOrder: n.reverseStackOrder
2171
- }), /* @__PURE__ */ s.createElement(fi, {
2172
- cx: n.cx,
2173
- cy: n.cy,
2174
- startAngle: n.startAngle,
2175
- endAngle: n.endAngle,
2176
- innerRadius: n.innerRadius,
2177
- outerRadius: n.outerRadius
2178
- }), /* @__PURE__ */ s.createElement(ur, ke({}, o, {
2179
- ref: a
2180
- })));
2181
- });
2182
- function ot(t, e) {
2183
- var a = Object.keys(t);
2184
- if (Object.getOwnPropertySymbols) {
2185
- var r = Object.getOwnPropertySymbols(t);
2186
- e && (r = r.filter(function(n) {
2187
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
2188
- })), a.push.apply(a, r);
2189
- }
2190
- return a;
2191
- }
2192
- function st(t) {
2193
- for (var e = 1; e < arguments.length; e++) {
2194
- var a = arguments[e] != null ? arguments[e] : {};
2195
- e % 2 ? ot(Object(a), !0).forEach(function(r) {
2196
- xi(t, r, a[r]);
2197
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : ot(Object(a)).forEach(function(r) {
2198
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
2199
- });
2200
- }
2201
- return t;
2202
- }
2203
- function xi(t, e, a) {
2204
- return (e = Pi(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
2205
- }
2206
- function Pi(t) {
2207
- var e = Ai(t, "string");
2208
- return typeof e == "symbol" ? e : e + "";
2209
- }
2210
- function Ai(t, e) {
2211
- if (typeof t != "object" || !t) return t;
2212
- var a = t[Symbol.toPrimitive];
2213
- if (a !== void 0) {
2214
- var r = a.call(t, e);
2215
- if (typeof r != "object") return r;
2216
- throw new TypeError("@@toPrimitive must return a primitive value.");
2217
- }
2218
- return (e === "string" ? String : Number)(t);
2219
- }
2220
- var Ei = ["item"], Ii = st(st({}, ia), {}, {
2221
- layout: "centric",
2222
- startAngle: 0,
2223
- endAngle: 360
2224
- }), ct = /* @__PURE__ */ be((t, e) => {
2225
- var a = q(t, Ii);
2226
- return /* @__PURE__ */ s.createElement(bi, {
2227
- chartName: "PieChart",
2228
- defaultTooltipEventType: "item",
2229
- validateTooltipEventTypes: Ei,
2230
- tooltipPayloadSearcher: Ve,
2231
- categoricalChartProps: a,
2232
- ref: e
2233
- });
2234
- }), Oi = ["axis"], ji = /* @__PURE__ */ be((t, e) => /* @__PURE__ */ s.createElement(_t, {
2235
- chartName: "AreaChart",
2236
- defaultTooltipEventType: "axis",
2237
- validateTooltipEventTypes: Oi,
2238
- tooltipPayloadSearcher: Ve,
2239
- categoricalChartProps: t,
2240
- ref: e
2241
- }));
2242
- const z = (...t) => t.filter(Boolean).join(" "), wi = { light: "", dark: ".dark" }, la = s.createContext(null);
2243
- function oa() {
2244
- const t = s.useContext(la);
2245
- if (!t)
2246
- throw new Error("useChart must be used within a <ChartContainer />");
2247
- return t;
2248
- }
2249
- function ut({
2250
- id: t,
2251
- className: e,
2252
- children: a,
2253
- config: r,
2254
- ...n
2255
- }) {
2256
- const i = s.useId(), o = `chart-${t || i.replace(/:/g, "")}`;
2257
- return /* @__PURE__ */ A.jsx(la.Provider, { value: { config: r }, children: /* @__PURE__ */ A.jsxs(
2258
- "div",
2259
- {
2260
- "data-slot": "chart",
2261
- "data-chart": o,
2262
- className: z(
2263
- "flex w-full h-[350px] justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
2264
- e
2265
- ),
2266
- ...n,
2267
- children: [
2268
- /* @__PURE__ */ A.jsx(Ci, { id: o, config: r }),
2269
- /* @__PURE__ */ A.jsx(vr, { width: "100%", height: "100%", children: a })
2270
- ]
2271
- }
2272
- ) });
2273
- }
2274
- const Ci = ({ id: t, config: e }) => {
2275
- const a = Object.entries(e).filter(
2276
- ([, r]) => r.theme || r.color
2277
- );
2278
- return a.length ? /* @__PURE__ */ A.jsx(
2279
- "style",
2280
- {
2281
- dangerouslySetInnerHTML: {
2282
- __html: Object.entries(wi).map(
2283
- ([r, n]) => `
2284
- ${n} [data-chart=${t}] {
2285
- ${a.map(([i, o]) => {
2286
- const l = o.theme?.[r] || o.color;
2287
- return l ? ` --color-${i}: ${l};` : null;
2288
- }).join(`
2289
- `)}
2290
- }
2291
- `
2292
- ).join(`
2293
- `)
2294
- }
2295
- }
2296
- ) : null;
2297
- }, dt = dr;
2298
- function pt({
2299
- active: t,
2300
- payload: e,
2301
- className: a,
2302
- indicator: r = "dot",
2303
- hideLabel: n = !1,
2304
- hideIndicator: i = !1,
2305
- label: o,
2306
- labelFormatter: l,
2307
- labelClassName: c,
2308
- formatter: u,
2309
- color: d,
2310
- nameKey: f,
2311
- labelKey: p
2312
- }) {
2313
- const { config: v } = oa(), y = s.useMemo(() => {
2314
- if (n || !e?.length)
2315
- return null;
2316
- const [m] = e, h = `${p || m?.dataKey || m?.name || "value"}`, b = Le(v, m, h), P = !p && typeof o == "string" ? v[o]?.label || o : b?.label;
2317
- return l ? /* @__PURE__ */ A.jsx("div", { className: z("font-medium", c), children: l(P, e) }) : P ? /* @__PURE__ */ A.jsx("div", { className: z("font-medium", c), children: P }) : null;
2318
- }, [
2319
- o,
2320
- l,
2321
- e,
2322
- n,
2323
- c,
2324
- v,
2325
- p
2326
- ]);
2327
- if (!t || !e?.length)
2328
- return null;
2329
- const g = e.length === 1 && r !== "dot";
2330
- return /* @__PURE__ */ A.jsxs(
2331
- "div",
2332
- {
2333
- className: z(
2334
- "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
2335
- a
2336
- ),
2337
- children: [
2338
- g ? null : y,
2339
- /* @__PURE__ */ A.jsx("div", { className: "grid gap-1.5", children: e.filter((m) => m.type !== "none").map((m, h) => {
2340
- const b = `${f || m.name || m.dataKey || "value"}`, P = Le(v, m, b), x = d || m.payload.fill || m.color;
2341
- return /* @__PURE__ */ A.jsx(
2342
- "div",
2343
- {
2344
- className: z(
2345
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
2346
- r === "dot" ? "items-center" : ""
2347
- ),
2348
- children: u && m?.value !== void 0 && m.name ? u(m.value, m.name, m, h, m.payload) : /* @__PURE__ */ A.jsxs(A.Fragment, { children: [
2349
- P?.icon ? /* @__PURE__ */ A.jsx(P.icon, {}) : !i && /* @__PURE__ */ A.jsx(
2350
- "div",
2351
- {
2352
- className: z(
2353
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
2354
- r === "dot" ? "h-2.5 w-2.5" : "",
2355
- r === "line" ? "w-1" : "",
2356
- r === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "",
2357
- g && r === "dashed" ? "my-0.5" : ""
2358
- ),
2359
- style: {
2360
- "--color-bg": x,
2361
- "--color-border": x
2362
- }
2363
- }
2364
- ),
2365
- /* @__PURE__ */ A.jsxs(
2366
- "div",
2367
- {
2368
- className: z(
2369
- "flex flex-1 justify-between leading-none",
2370
- g ? "items-end" : "items-center"
2371
- ),
2372
- children: [
2373
- /* @__PURE__ */ A.jsxs("div", { className: "grid gap-1.5", children: [
2374
- g ? y : null,
2375
- /* @__PURE__ */ A.jsx("span", { className: "text-muted-foreground", children: P?.label || m.name })
2376
- ] }),
2377
- m.value && /* @__PURE__ */ A.jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: m.value.toLocaleString() })
2378
- ]
2379
- }
2380
- )
2381
- ] })
2382
- },
2383
- m.dataKey
2384
- );
2385
- }) })
2386
- ]
2387
- }
2388
- );
2389
- }
2390
- const vt = pr;
2391
- function ft({
2392
- className: t,
2393
- hideIcon: e = !1,
2394
- payload: a,
2395
- verticalAlign: r = "bottom",
2396
- nameKey: n
2397
- }) {
2398
- const { config: i } = oa();
2399
- return a?.length ? /* @__PURE__ */ A.jsx(
2400
- "div",
2401
- {
2402
- className: z(
2403
- "flex items-center justify-center gap-4",
2404
- r === "top" ? "pb-3" : "pt-3",
2405
- t
2406
- ),
2407
- children: a.filter((o) => o.type !== "none").map((o) => {
2408
- const l = `${n || o.dataKey || "value"}`, c = Le(i, o, l);
2409
- return /* @__PURE__ */ A.jsxs(
2410
- "div",
2411
- {
2412
- className: z(
2413
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
2414
- ),
2415
- children: [
2416
- c?.icon && !e ? /* @__PURE__ */ A.jsx(c.icon, {}) : /* @__PURE__ */ A.jsx(
2417
- "div",
2418
- {
2419
- className: "h-2 w-2 shrink-0 rounded-[2px]",
2420
- style: {
2421
- backgroundColor: o.color
2422
- }
2423
- }
2424
- ),
2425
- c?.label
2426
- ]
2427
- },
2428
- o.value
2429
- );
2430
- })
2431
- }
2432
- ) : null;
2433
- }
2434
- function Le(t, e, a) {
2435
- if (typeof e != "object" || e === null)
2436
- return;
2437
- const r = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
2438
- let n = a;
2439
- return a in e && typeof e[a] == "string" ? n = e[a] : r && a in r && typeof r[a] == "string" && (n = r[a]), n in t ? t[n] : t[a];
2440
- }
2441
- const Di = "hsl(var(--primary))", Si = {
2442
- slate: "#64748b",
2443
- gray: "#6b7280",
2444
- zinc: "#71717a",
2445
- neutral: "#737373",
2446
- stone: "#78716c",
2447
- red: "#ef4444",
2448
- orange: "#f97316",
2449
- amber: "#f59e0b",
2450
- yellow: "#eab308",
2451
- lime: "#84cc16",
2452
- green: "#22c55e",
2453
- emerald: "#10b981",
2454
- teal: "#14b8a6",
2455
- cyan: "#06b6d4",
2456
- sky: "#0ea5e9",
2457
- blue: "#3b82f6",
2458
- indigo: "#6366f1",
2459
- violet: "#8b5cf6",
2460
- purple: "#a855f7",
2461
- fuchsia: "#d946ef",
2462
- pink: "#ec4899",
2463
- rose: "#f43f5e"
2464
- }, mt = (t) => Si[t] || t;
2465
- function Ti({
2466
- chartType: t = "bar",
2467
- data: e = [],
2468
- config: a = {},
2469
- xAxisKey: r = "name",
2470
- series: n = [],
2471
- className: i = ""
2472
- }) {
2473
- const o = {
2474
- bar: qe,
2475
- line: vi,
2476
- area: ji,
2477
- pie: ct
2478
- }[t] || qe;
2479
- return console.log("📈 Rendering Chart:", { chartType: t, dataLength: e.length, config: a, series: n, xAxisKey: r }), t === "pie" ? /* @__PURE__ */ A.jsx(ut, { config: a, className: i, children: /* @__PURE__ */ A.jsxs(ct, { children: [
2480
- /* @__PURE__ */ A.jsx(dt, { cursor: !1, content: /* @__PURE__ */ A.jsx(pt, { hideLabel: !0 }) }),
2481
- /* @__PURE__ */ A.jsx(
2482
- Mt,
2483
- {
2484
- data: e,
2485
- dataKey: n[0]?.dataKey || "value",
2486
- nameKey: r || "name",
2487
- innerRadius: 60,
2488
- strokeWidth: 5,
2489
- paddingAngle: 2,
2490
- outerRadius: 80,
2491
- children: e.map((l, c) => {
2492
- let u = a[l[r]]?.color;
2493
- if (!u) {
2494
- const d = [
2495
- "hsl(var(--chart-1))",
2496
- "hsl(var(--chart-2))",
2497
- "hsl(var(--chart-3))",
2498
- "hsl(var(--chart-4))",
2499
- "hsl(var(--chart-5))"
2500
- ];
2501
- u = d[c % d.length];
2502
- }
2503
- return /* @__PURE__ */ A.jsx(_e, { fill: mt(u) }, `cell-${c}`);
2504
- })
2505
- }
2506
- ),
2507
- /* @__PURE__ */ A.jsx(vt, { content: /* @__PURE__ */ A.jsx(ft, { nameKey: r }) })
2508
- ] }) }) : /* @__PURE__ */ A.jsx(ut, { config: a, className: i, children: /* @__PURE__ */ A.jsxs(o, { data: e, children: [
2509
- /* @__PURE__ */ A.jsx(fr, { vertical: !1 }),
2510
- /* @__PURE__ */ A.jsx(
2511
- mr,
2512
- {
2513
- dataKey: r,
2514
- tickLine: !1,
2515
- tickMargin: 10,
2516
- axisLine: !1,
2517
- tickFormatter: (l) => l && typeof l == "string" ? l.slice(0, 3) : l
2518
- }
2519
- ),
2520
- /* @__PURE__ */ A.jsx(dt, { content: /* @__PURE__ */ A.jsx(pt, {}) }),
2521
- /* @__PURE__ */ A.jsx(vt, { content: /* @__PURE__ */ A.jsx(ft, {}) }),
2522
- n.map((l) => {
2523
- const c = mt(a[l.dataKey]?.color || Di);
2524
- return t === "bar" ? /* @__PURE__ */ A.jsx(hr, { dataKey: l.dataKey, fill: c, radius: 4 }, l.dataKey) : t === "line" ? /* @__PURE__ */ A.jsx(Ht, { type: "monotone", dataKey: l.dataKey, stroke: c, strokeWidth: 2, dot: !1 }, l.dataKey) : t === "area" ? /* @__PURE__ */ A.jsx(na, { type: "monotone", dataKey: l.dataKey, fill: c, stroke: c, fillOpacity: 0.4 }, l.dataKey) : null;
2525
- })
2526
- ] }) });
2527
- }
2528
- export {
2529
- Ti as default
2530
- };