@object-ui/plugin-charts 3.1.2 → 3.1.4

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,4588 +0,0 @@
1
- import { j as b } from "./index-xUWSanB8.js";
2
- import * as o from "react";
3
- import { useMemo as le, useEffect as Rt, useRef as Z, useState as We, useCallback as re, isValidElement as Zr, cloneElement as Xr, Component as Ha, PureComponent as Ua, useLayoutEffect as dr, forwardRef as Oe } from "react";
4
- import { c as W, s as de, r as Ja, i as Q, b as Yr, d as N, e as w, f as it, g as Qa, h as Hr, j as en, k as ye, p as ce, l as tn, m as ee, n as rn, o as an, q as nn, t as $t, u as ln, v as on, w as sn, x as cn, y as un, z as dn, A as vn, D as pn, E as fn, F as mn, G as K, H as yn, I as Ur, J as hn, K as Jr, M as Nt, N as gn, O as bn, P as xn, Q as Pn, S as z, U as $, Z as X, V as ae, W as lt, _ as G, $ as Qr, a0 as ea, a1 as ta, a2 as ot, a3 as ra, a4 as ze, a5 as An, a6 as On, a7 as En, a8 as L, a9 as jn, aa as In, ab as aa, ac as pe, ad as st, ae as Kt, af as Bt, ag as wn, ah as Sn, ai as kn, aj as ue, ak as Je, al as ne, am as Dn, an as Fe, ao as na, ap as Mt, aq as ia, ar as ct, as as Ve, at as Ge, au as qe, av as _n, aw as R, ax as Ue, ay as Ln, az as Wt, aA as Cn, aB as Tn, aC as la, aD as oa, aE as sa, aF as ca, aG as Rn, aH as Qe, aI as Ze, aJ as $n, aK as Te, aL as Re, aM as zt, aN as Nn, aO as Kn, aP as H, aQ as ut, aR as Pe, aS as Bn, aT as dt, aU as ua, aV as Ee, aW as je, aX as Ft, aY as Vt, aZ as Gt, a_ as qt, a$ as Zt, b0 as da, b1 as va, b2 as Xt, b3 as pa, b4 as Ae, b5 as Mn, b6 as Wn, b7 as Yt, b8 as Ht, b9 as zn, ba as Fn, bb as Vn, bc as Gn, bd as qn, be as Zn, bf as et, bg as Xn, bh as Yn, bi as Hn, bj as oe, bk as Un, bl as Jn, bm as Qn, bn as ei, bo as ti, bp as ri, bq as Ut, br as Xe, bs as ai, bt as ni, bu as ii, bv as li, bw as oi, bx as si, T as ci, L as ui, R as di, C as yt, X as ht, Y as gt, B as He, a as vr } from "./BarChart-C_I0OFbj.js";
5
- var vi = ["points", "className", "baseLinePoints", "connectNulls"], pr;
6
- function be() {
7
- return be = Object.assign ? Object.assign.bind() : function(e) {
8
- for (var t = 1; t < arguments.length; t++) {
9
- var r = arguments[t];
10
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
11
- }
12
- return e;
13
- }, be.apply(null, arguments);
14
- }
15
- function pi(e, t) {
16
- if (e == null) return {};
17
- var r, a, n = fi(e, t);
18
- if (Object.getOwnPropertySymbols) {
19
- var i = Object.getOwnPropertySymbols(e);
20
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
21
- }
22
- return n;
23
- }
24
- function fi(e, t) {
25
- if (e == null) return {};
26
- var r = {};
27
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
28
- if (t.indexOf(a) !== -1) continue;
29
- r[a] = e[a];
30
- }
31
- return r;
32
- }
33
- function mi(e, t) {
34
- return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } }));
35
- }
36
- var fr = (e) => e != null && e.x === +e.x && e.y === +e.y, yi = function() {
37
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], r = [[]];
38
- t.forEach((l) => {
39
- var s = r[r.length - 1];
40
- fr(l) ? s && s.push(l) : s && s.length > 0 && r.push([]);
41
- });
42
- var a = t[0], n = r[r.length - 1];
43
- fr(a) && n && n.push(a);
44
- var i = r[r.length - 1];
45
- return i && i.length <= 0 && (r = r.slice(0, -1)), r;
46
- }, $e = (e, t) => {
47
- var r = yi(e);
48
- t && (r = [r.reduce((n, i) => [...n, ...i], [])]);
49
- var a = r.map((n) => n.reduce((i, l, s) => Ja(pr || (pr = mi(["", "", "", ",", ""])), i, s === 0 ? "M" : "L", l.x, l.y), "")).join("");
50
- return r.length === 1 ? "".concat(a, "Z") : a;
51
- }, hi = (e, t, r) => {
52
- var a = $e(e, r);
53
- return "".concat(a.slice(-1) === "Z" ? a.slice(0, -1) : a, "L").concat($e(Array.from(t).reverse(), r).slice(1));
54
- }, fa = (e) => {
55
- var {
56
- points: t,
57
- className: r,
58
- baseLinePoints: a,
59
- connectNulls: n
60
- } = e, i = pi(e, vi);
61
- if (!t || !t.length)
62
- return null;
63
- var l = W("recharts-polygon", r);
64
- if (a && a.length) {
65
- var s = i.stroke && i.stroke !== "none", c = hi(t, a, n);
66
- return /* @__PURE__ */ o.createElement("g", {
67
- className: l
68
- }, /* @__PURE__ */ o.createElement("path", be({}, de(i), {
69
- fill: c.slice(-1) === "Z" ? i.fill : "none",
70
- stroke: "none",
71
- d: c
72
- })), s ? /* @__PURE__ */ o.createElement("path", be({}, de(i), {
73
- fill: "none",
74
- d: $e(t, n)
75
- })) : null, s ? /* @__PURE__ */ o.createElement("path", be({}, de(i), {
76
- fill: "none",
77
- d: $e(a, n)
78
- })) : null);
79
- }
80
- var d = $e(t, n);
81
- return /* @__PURE__ */ o.createElement("path", be({}, de(i), {
82
- fill: d.slice(-1) === "Z" ? i.fill : "none",
83
- className: l,
84
- d
85
- }));
86
- };
87
- function kt() {
88
- return kt = Object.assign ? Object.assign.bind() : function(e) {
89
- for (var t = 1; t < arguments.length; t++) {
90
- var r = arguments[t];
91
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
92
- }
93
- return e;
94
- }, kt.apply(null, arguments);
95
- }
96
- var Jt = (e) => {
97
- var {
98
- cx: t,
99
- cy: r,
100
- r: a,
101
- className: n
102
- } = e, i = W("recharts-dot", n);
103
- return Q(t) && Q(r) && Q(a) ? /* @__PURE__ */ o.createElement("circle", kt({}, N(e), Yr(e), {
104
- className: i,
105
- cx: t,
106
- cy: r,
107
- r: a
108
- })) : null;
109
- }, Qt = (e) => e.graphicalItems.polarItems, gi = w([ce, fn], mn), vt = w([Qt, ye, gi], un), bi = w([vt], dn), pt = w([bi, $t], ln), ma = w([pt, ye, vt], nn);
110
- w([pt, ye, vt], (e, t, r) => r.length > 0 ? e.flatMap((a) => r.flatMap((n) => {
111
- var i, l = K(a, (i = t.dataKey) !== null && i !== void 0 ? i : n.dataKey);
112
- return {
113
- value: l,
114
- errorDomain: []
115
- // polar charts do not have error bars
116
- };
117
- })).filter(Boolean) : t?.dataKey != null ? e.map((a) => ({
118
- value: K(a, t.dataKey),
119
- errorDomain: []
120
- })) : e.map((a) => ({
121
- value: a,
122
- errorDomain: []
123
- })));
124
- var mr = () => {
125
- }, xi = w([pt, ye, vt, vn, ce], pn), Pi = w([ye, on, sn, mr, xi, mr, ee, ce], cn), ya = w([ye, ee, pt, ma, rn, ce, Pi], an), ha = w([ya, Hr, it], en), Ai = w([ye, ya, ha, ce], tn), Oi = w([it, Ai], Qa), er = (e, t, r) => {
126
- switch (t) {
127
- case "angleAxis":
128
- return Nt(e, r);
129
- case "radiusAxis":
130
- return Jr(e, r);
131
- default:
132
- throw new Error("Unexpected axis type: ".concat(t));
133
- }
134
- }, tr = (e, t, r) => {
135
- switch (t) {
136
- case "angleAxis":
137
- return bn(e, r);
138
- case "radiusAxis":
139
- return gn(e, r);
140
- default:
141
- throw new Error("Unexpected axis type: ".concat(t));
142
- }
143
- }, Ie = w([er, it, Oi, tr], yn), ga = w([ee, ma, Hr, ce], xn), we = w([ee, er, it, Ie, ha, tr, Ur, ga, ce], hn), Ei = w([we], (e) => {
144
- if (e) {
145
- var t = /* @__PURE__ */ new Map();
146
- return e.forEach((r) => {
147
- var a = (r.coordinate + 360) % 360;
148
- t.has(a) || t.set(a, r);
149
- }), Array.from(t.values());
150
- }
151
- });
152
- w([ee, er, Ie, tr, Ur, ga, ce], Pn);
153
- var ji = (e, t) => we(e, "angleAxis", t, !1), Ii = w([ji], (e) => {
154
- if (e)
155
- return e.map((t) => t.coordinate);
156
- }), wi = (e, t) => we(e, "radiusAxis", t, !1), Si = w([wi], (e) => {
157
- if (e)
158
- return e.map((t) => t.coordinate);
159
- }), ki = ["gridType", "radialLines", "angleAxisId", "radiusAxisId", "cx", "cy", "innerRadius", "outerRadius", "polarAngles", "polarRadius", "zIndex"];
160
- function Di(e, t) {
161
- if (e == null) return {};
162
- var r, a, n = _i(e, t);
163
- if (Object.getOwnPropertySymbols) {
164
- var i = Object.getOwnPropertySymbols(e);
165
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
166
- }
167
- return n;
168
- }
169
- function _i(e, t) {
170
- if (e == null) return {};
171
- var r = {};
172
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
173
- if (t.indexOf(a) !== -1) continue;
174
- r[a] = e[a];
175
- }
176
- return r;
177
- }
178
- function U() {
179
- return U = Object.assign ? Object.assign.bind() : function(e) {
180
- for (var t = 1; t < arguments.length; t++) {
181
- var r = arguments[t];
182
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
183
- }
184
- return e;
185
- }, U.apply(null, arguments);
186
- }
187
- function yr(e, t) {
188
- var r = Object.keys(e);
189
- if (Object.getOwnPropertySymbols) {
190
- var a = Object.getOwnPropertySymbols(e);
191
- t && (a = a.filter(function(n) {
192
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
193
- })), r.push.apply(r, a);
194
- }
195
- return r;
196
- }
197
- function ft(e) {
198
- for (var t = 1; t < arguments.length; t++) {
199
- var r = arguments[t] != null ? arguments[t] : {};
200
- t % 2 ? yr(Object(r), !0).forEach(function(a) {
201
- Li(e, a, r[a]);
202
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : yr(Object(r)).forEach(function(a) {
203
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
204
- });
205
- }
206
- return e;
207
- }
208
- function Li(e, t, r) {
209
- return (t = Ci(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
210
- }
211
- function Ci(e) {
212
- var t = Ti(e, "string");
213
- return typeof t == "symbol" ? t : t + "";
214
- }
215
- function Ti(e, t) {
216
- if (typeof e != "object" || !e) return e;
217
- var r = e[Symbol.toPrimitive];
218
- if (r !== void 0) {
219
- var a = r.call(e, t);
220
- if (typeof a != "object") return a;
221
- throw new TypeError("@@toPrimitive must return a primitive value.");
222
- }
223
- return (t === "string" ? String : Number)(e);
224
- }
225
- var Ri = (e, t, r, a) => {
226
- var n = "";
227
- return a.forEach((i, l) => {
228
- var s = G(t, r, e, i);
229
- l ? n += "L ".concat(s.x, ",").concat(s.y) : n += "M ".concat(s.x, ",").concat(s.y);
230
- }), n += "Z", n;
231
- }, $i = (e) => {
232
- var {
233
- cx: t,
234
- cy: r,
235
- innerRadius: a,
236
- outerRadius: n,
237
- polarAngles: i,
238
- radialLines: l
239
- } = e;
240
- if (!i || !i.length || !l)
241
- return null;
242
- var s = ft({
243
- stroke: "#ccc"
244
- }, N(e));
245
- return /* @__PURE__ */ o.createElement("g", {
246
- className: "recharts-polar-grid-angle"
247
- }, i.map((c) => {
248
- var d = G(t, r, a, c), p = G(t, r, n, c);
249
- return /* @__PURE__ */ o.createElement("line", U({
250
- key: "line-".concat(c)
251
- }, s, {
252
- x1: d.x,
253
- y1: d.y,
254
- x2: p.x,
255
- y2: p.y
256
- }));
257
- }));
258
- }, hr = (e) => {
259
- var {
260
- cx: t,
261
- cy: r,
262
- radius: a
263
- } = e, n = ft({
264
- stroke: "#ccc",
265
- fill: "none"
266
- }, N(e));
267
- return (
268
- // @ts-expect-error wrong SVG element type
269
- /* @__PURE__ */ o.createElement("circle", U({}, n, {
270
- className: W("recharts-polar-grid-concentric-circle", e.className),
271
- cx: t,
272
- cy: r,
273
- r: a
274
- }))
275
- );
276
- }, gr = (e) => {
277
- var {
278
- radius: t
279
- } = e, r = ft({
280
- stroke: "#ccc",
281
- fill: "none"
282
- }, N(e));
283
- return /* @__PURE__ */ o.createElement("path", U({}, r, {
284
- className: W("recharts-polar-grid-concentric-polygon", e.className),
285
- d: Ri(t, e.cx, e.cy, e.polarAngles)
286
- }));
287
- }, Ni = (e) => {
288
- var {
289
- polarRadius: t,
290
- gridType: r
291
- } = e;
292
- if (!t || !t.length)
293
- return null;
294
- var a = Math.max(...t), n = e.fill && e.fill !== "none";
295
- return /* @__PURE__ */ o.createElement("g", {
296
- className: "recharts-polar-grid-concentric"
297
- }, n && r === "circle" && /* @__PURE__ */ o.createElement(hr, U({}, e, {
298
- radius: a
299
- })), n && r !== "circle" && /* @__PURE__ */ o.createElement(gr, U({}, e, {
300
- radius: a
301
- })), t.map((i, l) => {
302
- var s = l;
303
- return r === "circle" ? /* @__PURE__ */ o.createElement(hr, U({
304
- key: s
305
- }, e, {
306
- fill: "none",
307
- radius: i
308
- })) : /* @__PURE__ */ o.createElement(gr, U({
309
- key: s
310
- }, e, {
311
- fill: "none",
312
- radius: i
313
- }));
314
- }));
315
- }, Ki = {
316
- angleAxisId: 0,
317
- radiusAxisId: 0,
318
- gridType: "polygon",
319
- radialLines: !0,
320
- zIndex: ae.grid
321
- }, ba = (e) => {
322
- var t, r, a, n, i, l, s, c, d = z(e, Ki), {
323
- gridType: p,
324
- radialLines: u,
325
- angleAxisId: v,
326
- radiusAxisId: f,
327
- cx: h,
328
- cy: g,
329
- innerRadius: y,
330
- outerRadius: m,
331
- polarAngles: x,
332
- polarRadius: P,
333
- zIndex: O
334
- } = d, I = Di(d, ki), A = $(lt), j = $((C) => Ii(C, v)), E = $((C) => Si(C, f)), S = Array.isArray(x) ? x : j, D = Array.isArray(P) ? P : E;
335
- if (S == null || D == null)
336
- return null;
337
- var _ = ft({
338
- cx: (t = (r = A?.cx) !== null && r !== void 0 ? r : h) !== null && t !== void 0 ? t : 0,
339
- cy: (a = (n = A?.cy) !== null && n !== void 0 ? n : g) !== null && a !== void 0 ? a : 0,
340
- innerRadius: (i = (l = A?.innerRadius) !== null && l !== void 0 ? l : y) !== null && i !== void 0 ? i : 0,
341
- outerRadius: (s = (c = A?.outerRadius) !== null && c !== void 0 ? c : m) !== null && s !== void 0 ? s : 0,
342
- polarAngles: S,
343
- polarRadius: D,
344
- zIndex: O
345
- }, I), {
346
- outerRadius: k
347
- } = _;
348
- return k <= 0 ? null : /* @__PURE__ */ o.createElement(X, {
349
- zIndex: _.zIndex
350
- }, /* @__PURE__ */ o.createElement("g", {
351
- className: "recharts-polar-grid"
352
- }, /* @__PURE__ */ o.createElement(Ni, U({
353
- gridType: p,
354
- radialLines: u
355
- }, _, {
356
- polarAngles: S,
357
- polarRadius: D
358
- })), /* @__PURE__ */ o.createElement($i, U({
359
- gridType: p,
360
- radialLines: u
361
- }, _, {
362
- polarAngles: S,
363
- polarRadius: D
364
- }))));
365
- };
366
- ba.displayName = "PolarGrid";
367
- var bt = {}, xt = {}, br;
368
- function Bi() {
369
- return br || (br = 1, (function(e) {
370
- Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
371
- function t(r, a) {
372
- if (r.length === 0)
373
- return;
374
- let n = r[0], i = a(n, 0, r);
375
- for (let l = 1; l < r.length; l++) {
376
- const s = r[l], c = a(s, l, r);
377
- c > i && (i = c, n = s);
378
- }
379
- return n;
380
- }
381
- e.maxBy = t;
382
- })(xt)), xt;
383
- }
384
- var xr;
385
- function Mi() {
386
- return xr || (xr = 1, (function(e) {
387
- Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
388
- const t = /* @__PURE__ */ Bi(), r = /* @__PURE__ */ ea(), a = /* @__PURE__ */ Qr();
389
- function n(i, l) {
390
- if (i != null)
391
- return t.maxBy(Array.from(i), a.iteratee(l ?? r.identity));
392
- }
393
- e.maxBy = n;
394
- })(bt)), bt;
395
- }
396
- var Pt, Pr;
397
- function Wi() {
398
- return Pr || (Pr = 1, Pt = Mi().maxBy), Pt;
399
- }
400
- var zi = /* @__PURE__ */ Wi();
401
- const Fi = /* @__PURE__ */ ta(zi);
402
- var At = {}, Ot = {}, Ar;
403
- function Vi() {
404
- return Ar || (Ar = 1, (function(e) {
405
- Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
406
- function t(r, a) {
407
- if (r.length === 0)
408
- return;
409
- let n = r[0], i = a(n, 0, r);
410
- for (let l = 1; l < r.length; l++) {
411
- const s = r[l], c = a(s, l, r);
412
- c < i && (i = c, n = s);
413
- }
414
- return n;
415
- }
416
- e.minBy = t;
417
- })(Ot)), Ot;
418
- }
419
- var Or;
420
- function Gi() {
421
- return Or || (Or = 1, (function(e) {
422
- Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
423
- const t = /* @__PURE__ */ Vi(), r = /* @__PURE__ */ ea(), a = /* @__PURE__ */ Qr();
424
- function n(i, l) {
425
- if (i != null)
426
- return t.minBy(Array.from(i), a.iteratee(l ?? r.identity));
427
- }
428
- e.minBy = n;
429
- })(At)), At;
430
- }
431
- var Et, Er;
432
- function qi() {
433
- return Er || (Er = 1, Et = Gi().minBy), Et;
434
- }
435
- var Zi = /* @__PURE__ */ qi();
436
- const Xi = /* @__PURE__ */ ta(Zi);
437
- var Yi = ["type"], Hi = ["cx", "cy", "angle", "axisLine"], Ui = ["angle", "tickFormatter", "stroke", "tick"];
438
- function Ke() {
439
- return Ke = Object.assign ? Object.assign.bind() : function(e) {
440
- for (var t = 1; t < arguments.length; t++) {
441
- var r = arguments[t];
442
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
443
- }
444
- return e;
445
- }, Ke.apply(null, arguments);
446
- }
447
- function jr(e, t) {
448
- var r = Object.keys(e);
449
- if (Object.getOwnPropertySymbols) {
450
- var a = Object.getOwnPropertySymbols(e);
451
- t && (a = a.filter(function(n) {
452
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
453
- })), r.push.apply(r, a);
454
- }
455
- return r;
456
- }
457
- function J(e) {
458
- for (var t = 1; t < arguments.length; t++) {
459
- var r = arguments[t] != null ? arguments[t] : {};
460
- t % 2 ? jr(Object(r), !0).forEach(function(a) {
461
- Ji(e, a, r[a]);
462
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : jr(Object(r)).forEach(function(a) {
463
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
464
- });
465
- }
466
- return e;
467
- }
468
- function Ji(e, t, r) {
469
- return (t = Qi(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
470
- }
471
- function Qi(e) {
472
- var t = el(e, "string");
473
- return typeof t == "symbol" ? t : t + "";
474
- }
475
- function el(e, t) {
476
- if (typeof e != "object" || !e) return e;
477
- var r = e[Symbol.toPrimitive];
478
- if (r !== void 0) {
479
- var a = r.call(e, t);
480
- if (typeof a != "object") return a;
481
- throw new TypeError("@@toPrimitive must return a primitive value.");
482
- }
483
- return (t === "string" ? String : Number)(e);
484
- }
485
- function rr(e, t) {
486
- if (e == null) return {};
487
- var r, a, n = tl(e, t);
488
- if (Object.getOwnPropertySymbols) {
489
- var i = Object.getOwnPropertySymbols(e);
490
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
491
- }
492
- return n;
493
- }
494
- function tl(e, t) {
495
- if (e == null) return {};
496
- var r = {};
497
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
498
- if (t.indexOf(a) !== -1) continue;
499
- r[a] = e[a];
500
- }
501
- return r;
502
- }
503
- var rl = "radiusAxis";
504
- function al(e) {
505
- var t = ot(), r = ra(), a = le(() => {
506
- var {
507
- type: n
508
- } = e, i = rr(e, Yi), l = aa(r, "radiusAxis", n);
509
- if (l != null)
510
- return J(J({}, i), {}, {
511
- type: l
512
- });
513
- }, [e, r]);
514
- return Rt(() => a == null ? ze : (t(An(a)), () => {
515
- t(On(a));
516
- }), [t, a]), null;
517
- }
518
- var nl = (e, t, r, a) => {
519
- var {
520
- coordinate: n
521
- } = e;
522
- return G(r, a, n, t);
523
- }, il = (e) => {
524
- var t;
525
- switch (e) {
526
- case "left":
527
- t = "end";
528
- break;
529
- case "right":
530
- t = "start";
531
- break;
532
- default:
533
- t = "middle";
534
- break;
535
- }
536
- return t;
537
- }, ll = (e, t, r, a) => {
538
- var n = Fi(a, (l) => l.coordinate || 0), i = Xi(a, (l) => l.coordinate || 0);
539
- return {
540
- cx: t,
541
- cy: r,
542
- startAngle: e,
543
- endAngle: e,
544
- innerRadius: i?.coordinate || 0,
545
- outerRadius: n?.coordinate || 0,
546
- clockWise: !1
547
- };
548
- }, ol = (e, t) => {
549
- var {
550
- cx: r,
551
- cy: a,
552
- angle: n,
553
- axisLine: i
554
- } = e, l = rr(e, Hi), s = t.reduce((u, v) => [Math.min(u[0], v.coordinate), Math.max(u[1], v.coordinate)], [1 / 0, -1 / 0]), c = G(r, a, s[0], n), d = G(r, a, s[1], n), p = J(J(J({}, N(l)), {}, {
555
- fill: "none"
556
- }, N(i)), {}, {
557
- x1: c.x,
558
- y1: c.y,
559
- x2: d.x,
560
- y2: d.y
561
- });
562
- return /* @__PURE__ */ o.createElement("line", Ke({
563
- className: "recharts-polar-radius-axis-line"
564
- }, p));
565
- }, sl = (e, t, r) => {
566
- var a;
567
- return /* @__PURE__ */ o.isValidElement(e) ? a = /* @__PURE__ */ o.cloneElement(e, t) : typeof e == "function" ? a = e(t) : a = /* @__PURE__ */ o.createElement(Bt, Ke({}, t, {
568
- className: "recharts-polar-radius-axis-tick-value"
569
- }), r), a;
570
- }, cl = (e, t) => {
571
- var {
572
- angle: r,
573
- tickFormatter: a,
574
- stroke: n,
575
- tick: i
576
- } = e, l = rr(e, Ui), s = il(e.orientation), c = N(l), d = pe(i), p = t.map((u, v) => {
577
- var f = nl(u, e.angle, e.cx, e.cy), h = J(J(J(J({
578
- textAnchor: s,
579
- transform: "rotate(".concat(90 - r, ", ").concat(f.x, ", ").concat(f.y, ")")
580
- }, c), {}, {
581
- stroke: "none",
582
- fill: n
583
- }, d), {}, {
584
- index: v
585
- }, f), {}, {
586
- payload: u
587
- });
588
- return /* @__PURE__ */ o.createElement(L, Ke({
589
- className: W("recharts-polar-radius-axis-tick", Kt(i)),
590
- key: "tick-".concat(u.coordinate)
591
- }, st(e, u, v)), sl(i, h, a ? a(u.value, v) : u.value));
592
- });
593
- return /* @__PURE__ */ o.createElement(L, {
594
- className: "recharts-polar-radius-axis-ticks"
595
- }, p);
596
- }, ul = (e) => {
597
- var {
598
- radiusAxisId: t
599
- } = e, r = $(lt), a = $((c) => Ie(c, "radiusAxis", t)), n = $((c) => we(c, "radiusAxis", t, !1));
600
- if (r == null || !n || !n.length || a == null)
601
- return null;
602
- var i = J(J({}, e), {}, {
603
- scale: a
604
- }, r), {
605
- tick: l,
606
- axisLine: s
607
- } = i;
608
- return /* @__PURE__ */ o.createElement(X, {
609
- zIndex: i.zIndex
610
- }, /* @__PURE__ */ o.createElement(L, {
611
- className: W("recharts-polar-radius-axis", rl, i.className)
612
- }, s && ol(i, n), l && cl(i, n), /* @__PURE__ */ o.createElement(jn, ll(i.angle, i.cx, i.cy, n), /* @__PURE__ */ o.createElement(In, {
613
- label: i.label
614
- }), i.children)));
615
- };
616
- function xa(e) {
617
- var t = z(e, En);
618
- return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(al, {
619
- domain: t.domain,
620
- id: t.radiusAxisId,
621
- scale: t.scale,
622
- type: t.type,
623
- dataKey: t.dataKey,
624
- unit: void 0,
625
- name: t.name,
626
- allowDuplicatedCategory: t.allowDuplicatedCategory,
627
- allowDataOverflow: t.allowDataOverflow,
628
- reversed: t.reversed,
629
- includeHidden: t.includeHidden,
630
- allowDecimals: t.allowDecimals,
631
- ticks: t.ticks,
632
- tickCount: t.tickCount,
633
- tick: t.tick
634
- }), /* @__PURE__ */ o.createElement(ul, t));
635
- }
636
- xa.displayName = "PolarRadiusAxis";
637
- var dl = ["children", "type"];
638
- function fe() {
639
- return fe = Object.assign ? Object.assign.bind() : function(e) {
640
- for (var t = 1; t < arguments.length; t++) {
641
- var r = arguments[t];
642
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
643
- }
644
- return e;
645
- }, fe.apply(null, arguments);
646
- }
647
- function Ir(e, t) {
648
- var r = Object.keys(e);
649
- if (Object.getOwnPropertySymbols) {
650
- var a = Object.getOwnPropertySymbols(e);
651
- t && (a = a.filter(function(n) {
652
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
653
- })), r.push.apply(r, a);
654
- }
655
- return r;
656
- }
657
- function q(e) {
658
- for (var t = 1; t < arguments.length; t++) {
659
- var r = arguments[t] != null ? arguments[t] : {};
660
- t % 2 ? Ir(Object(r), !0).forEach(function(a) {
661
- vl(e, a, r[a]);
662
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ir(Object(r)).forEach(function(a) {
663
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
664
- });
665
- }
666
- return e;
667
- }
668
- function vl(e, t, r) {
669
- return (t = pl(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
670
- }
671
- function pl(e) {
672
- var t = fl(e, "string");
673
- return typeof t == "symbol" ? t : t + "";
674
- }
675
- function fl(e, t) {
676
- if (typeof e != "object" || !e) return e;
677
- var r = e[Symbol.toPrimitive];
678
- if (r !== void 0) {
679
- var a = r.call(e, t);
680
- if (typeof a != "object") return a;
681
- throw new TypeError("@@toPrimitive must return a primitive value.");
682
- }
683
- return (t === "string" ? String : Number)(e);
684
- }
685
- function ml(e, t) {
686
- if (e == null) return {};
687
- var r, a, n = yl(e, t);
688
- if (Object.getOwnPropertySymbols) {
689
- var i = Object.getOwnPropertySymbols(e);
690
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
691
- }
692
- return n;
693
- }
694
- function yl(e, t) {
695
- if (e == null) return {};
696
- var r = {};
697
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
698
- if (t.indexOf(a) !== -1) continue;
699
- r[a] = e[a];
700
- }
701
- return r;
702
- }
703
- var wr = 1e-5, hl = Math.cos(Je(45)), gl = "angleAxis";
704
- function bl(e) {
705
- var t = ot(), r = ra(), a = le(() => {
706
- var {
707
- children: l,
708
- type: s
709
- } = e, c = ml(e, dl), d = aa(r, "angleAxis", s);
710
- if (d != null)
711
- return q(q({}, c), {}, {
712
- type: d
713
- });
714
- }, [e, r]), n = $((l) => Nt(l, a?.id)), i = a === n;
715
- return Rt(() => a == null ? ze : (t(wn(a)), () => {
716
- t(Sn(a));
717
- }), [t, a]), i ? e.children : null;
718
- }
719
- var xl = (e, t) => {
720
- var {
721
- cx: r,
722
- cy: a,
723
- radius: n,
724
- orientation: i,
725
- tickSize: l
726
- } = t, s = l || 8, c = G(r, a, n, e.coordinate), d = G(r, a, n + (i === "inner" ? -1 : 1) * s, e.coordinate);
727
- return {
728
- x1: c.x,
729
- y1: c.y,
730
- x2: d.x,
731
- y2: d.y
732
- };
733
- }, Pl = (e, t) => {
734
- var r = Math.cos(Je(-e.coordinate));
735
- return r > wr ? t === "outer" ? "start" : "end" : r < -wr ? t === "outer" ? "end" : "start" : "middle";
736
- }, Al = (e) => {
737
- var t = Math.cos(Je(-e.coordinate)), r = Math.sin(Je(-e.coordinate));
738
- return Math.abs(t) <= hl ? r > 0 ? "start" : "end" : "middle";
739
- }, Ol = (e) => {
740
- var {
741
- cx: t,
742
- cy: r,
743
- radius: a,
744
- axisLineType: n,
745
- axisLine: i,
746
- ticks: l
747
- } = e;
748
- if (!i)
749
- return null;
750
- var s = q(q({}, N(e)), {}, {
751
- fill: "none"
752
- }, N(i));
753
- if (n === "circle")
754
- return /* @__PURE__ */ o.createElement(Jt, fe({
755
- className: "recharts-polar-angle-axis-line"
756
- }, s, {
757
- cx: t,
758
- cy: r,
759
- r: a
760
- }));
761
- var c = l.map((d) => G(t, r, a, d.coordinate));
762
- return /* @__PURE__ */ o.createElement(fa, fe({
763
- className: "recharts-polar-angle-axis-line"
764
- }, s, {
765
- points: c
766
- }));
767
- }, El = (e) => {
768
- var {
769
- tick: t,
770
- tickProps: r,
771
- value: a
772
- } = e;
773
- return t ? /* @__PURE__ */ o.isValidElement(t) ? /* @__PURE__ */ o.cloneElement(t, r) : typeof t == "function" ? t(r) : /* @__PURE__ */ o.createElement(Bt, fe({}, r, {
774
- className: "recharts-polar-angle-axis-tick-value"
775
- }), a) : null;
776
- }, jl = (e) => {
777
- var {
778
- tick: t,
779
- tickLine: r,
780
- tickFormatter: a,
781
- stroke: n,
782
- ticks: i
783
- } = e, l = N(e), s = pe(t), c = q(q({}, l), {}, {
784
- fill: "none"
785
- }, N(r)), d = i.map((p, u) => {
786
- var v = xl(p, e), f = Pl(p, e.orientation), h = Al(p), g = q(q(q({}, l), {}, {
787
- // @ts-expect-error customTickProps is contributing unknown props
788
- textAnchor: f,
789
- verticalAnchor: h,
790
- // @ts-expect-error customTickProps is contributing unknown props
791
- stroke: "none",
792
- // @ts-expect-error customTickProps is contributing unknown props
793
- fill: n
794
- }, s), {}, {
795
- index: u,
796
- payload: p,
797
- x: v.x2,
798
- y: v.y2
799
- });
800
- return /* @__PURE__ */ o.createElement(L, fe({
801
- className: W("recharts-polar-angle-axis-tick", Kt(t)),
802
- key: "tick-".concat(p.coordinate)
803
- }, st(e, p, u)), r && /* @__PURE__ */ o.createElement("line", fe({
804
- className: "recharts-polar-angle-axis-tick-line"
805
- }, c, v)), /* @__PURE__ */ o.createElement(El, {
806
- tick: t,
807
- tickProps: g,
808
- value: a ? a(p.value, u) : p.value
809
- }));
810
- });
811
- return /* @__PURE__ */ o.createElement(L, {
812
- className: "recharts-polar-angle-axis-ticks"
813
- }, d);
814
- }, Il = (e) => {
815
- var {
816
- angleAxisId: t
817
- } = e, r = $(lt), a = $((s) => Ie(s, "angleAxis", t)), n = ue(), i = $((s) => Ei(s, "angleAxis", t, n));
818
- if (r == null || !i || !i.length || a == null)
819
- return null;
820
- var l = q(q(q({}, e), {}, {
821
- scale: a
822
- }, r), {}, {
823
- radius: r.outerRadius,
824
- ticks: i
825
- });
826
- return /* @__PURE__ */ o.createElement(X, {
827
- zIndex: l.zIndex
828
- }, /* @__PURE__ */ o.createElement(L, {
829
- className: W("recharts-polar-angle-axis", gl, l.className)
830
- }, /* @__PURE__ */ o.createElement(Ol, l), /* @__PURE__ */ o.createElement(jl, l)));
831
- };
832
- function Pa(e) {
833
- var t = z(e, kn);
834
- return /* @__PURE__ */ o.createElement(bl, {
835
- id: t.angleAxisId,
836
- scale: t.scale,
837
- type: t.type,
838
- dataKey: t.dataKey,
839
- unit: void 0,
840
- name: t.name,
841
- allowDuplicatedCategory: !1,
842
- allowDataOverflow: !1,
843
- reversed: t.reversed,
844
- includeHidden: !1,
845
- allowDecimals: t.allowDecimals,
846
- tickCount: t.tickCount,
847
- ticks: t.ticks,
848
- tick: t.tick,
849
- domain: t.domain
850
- }, /* @__PURE__ */ o.createElement(Il, t));
851
- }
852
- Pa.displayName = "PolarAngleAxis";
853
- function Sr(e, t) {
854
- var r = Object.keys(e);
855
- if (Object.getOwnPropertySymbols) {
856
- var a = Object.getOwnPropertySymbols(e);
857
- t && (a = a.filter(function(n) {
858
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
859
- })), r.push.apply(r, a);
860
- }
861
- return r;
862
- }
863
- function kr(e) {
864
- for (var t = 1; t < arguments.length; t++) {
865
- var r = arguments[t] != null ? arguments[t] : {};
866
- t % 2 ? Sr(Object(r), !0).forEach(function(a) {
867
- wl(e, a, r[a]);
868
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Sr(Object(r)).forEach(function(a) {
869
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
870
- });
871
- }
872
- return e;
873
- }
874
- function wl(e, t, r) {
875
- return (t = Sl(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
876
- }
877
- function Sl(e) {
878
- var t = kl(e, "string");
879
- return typeof t == "symbol" ? t : t + "";
880
- }
881
- function kl(e, t) {
882
- if (typeof e != "object" || !e) return e;
883
- var r = e[Symbol.toPrimitive];
884
- if (r !== void 0) {
885
- var a = r.call(e, t);
886
- if (typeof a != "object") return a;
887
- throw new TypeError("@@toPrimitive must return a primitive value.");
888
- }
889
- return (t === "string" ? String : Number)(e);
890
- }
891
- var Dl = (e, t) => t, ar = w([Qt, Dl], (e, t) => e.filter((r) => r.type === "pie").find((r) => r.id === t)), _l = [], nr = (e, t, r) => r?.length === 0 ? _l : r, Aa = w([$t, ar, nr], (e, t, r) => {
892
- var {
893
- chartData: a
894
- } = e;
895
- if (t != null) {
896
- var n;
897
- if (t?.data != null && t.data.length > 0 ? n = t.data : n = a, (!n || !n.length) && r != null && (n = r.map((i) => kr(kr({}, t.presentationProps), i.props))), n != null)
898
- return n;
899
- }
900
- }), Ll = w([Aa, ar, nr], (e, t, r) => {
901
- if (!(e == null || t == null))
902
- return e.map((a, n) => {
903
- var i, l = K(a, t.nameKey, t.name), s;
904
- return r != null && (i = r[n]) !== null && i !== void 0 && (i = i.props) !== null && i !== void 0 && i.fill ? s = r[n].props.fill : typeof a == "object" && a != null && "fill" in a ? s = a.fill : s = t.fill, {
905
- value: ne(l, t.dataKey),
906
- color: s,
907
- // @ts-expect-error we need a better typing for our data inputs
908
- payload: a,
909
- type: t.legendType
910
- };
911
- });
912
- }), Cl = w([Aa, ar, nr, Dn], (e, t, r, a) => {
913
- if (!(t == null || e == null))
914
- return Ql({
915
- offset: a,
916
- pieSettings: t,
917
- displayedData: e,
918
- cells: r
919
- });
920
- }), Tl = ["key"], Rl = ["onMouseEnter", "onClick", "onMouseLeave"], $l = ["id"], Nl = ["id"];
921
- function Dr(e, t) {
922
- var r = Object.keys(e);
923
- if (Object.getOwnPropertySymbols) {
924
- var a = Object.getOwnPropertySymbols(e);
925
- t && (a = a.filter(function(n) {
926
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
927
- })), r.push.apply(r, a);
928
- }
929
- return r;
930
- }
931
- function T(e) {
932
- for (var t = 1; t < arguments.length; t++) {
933
- var r = arguments[t] != null ? arguments[t] : {};
934
- t % 2 ? Dr(Object(r), !0).forEach(function(a) {
935
- Kl(e, a, r[a]);
936
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Dr(Object(r)).forEach(function(a) {
937
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
938
- });
939
- }
940
- return e;
941
- }
942
- function Kl(e, t, r) {
943
- return (t = Bl(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
944
- }
945
- function Bl(e) {
946
- var t = Ml(e, "string");
947
- return typeof t == "symbol" ? t : t + "";
948
- }
949
- function Ml(e, t) {
950
- if (typeof e != "object" || !e) return e;
951
- var r = e[Symbol.toPrimitive];
952
- if (r !== void 0) {
953
- var a = r.call(e, t);
954
- if (typeof a != "object") return a;
955
- throw new TypeError("@@toPrimitive must return a primitive value.");
956
- }
957
- return (t === "string" ? String : Number)(e);
958
- }
959
- function se() {
960
- return se = Object.assign ? Object.assign.bind() : function(e) {
961
- for (var t = 1; t < arguments.length; t++) {
962
- var r = arguments[t];
963
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
964
- }
965
- return e;
966
- }, se.apply(null, arguments);
967
- }
968
- function mt(e, t) {
969
- if (e == null) return {};
970
- var r, a, n = Wl(e, t);
971
- if (Object.getOwnPropertySymbols) {
972
- var i = Object.getOwnPropertySymbols(e);
973
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
974
- }
975
- return n;
976
- }
977
- function Wl(e, t) {
978
- if (e == null) return {};
979
- var r = {};
980
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
981
- if (t.indexOf(a) !== -1) continue;
982
- r[a] = e[a];
983
- }
984
- return r;
985
- }
986
- function zl(e) {
987
- var t = le(() => Mt(e.children, ct), [e.children]), r = $((a) => Ll(a, e.id, t));
988
- return r == null ? null : /* @__PURE__ */ o.createElement(ia, {
989
- legendPayload: r
990
- });
991
- }
992
- var Fl = /* @__PURE__ */ o.memo((e) => {
993
- var {
994
- dataKey: t,
995
- nameKey: r,
996
- sectors: a,
997
- stroke: n,
998
- strokeWidth: i,
999
- fill: l,
1000
- name: s,
1001
- hide: c,
1002
- tooltipType: d,
1003
- id: p
1004
- } = e, u = {
1005
- dataDefinedOnItem: a.map((v) => v.tooltipPayload),
1006
- getPosition: (v) => {
1007
- var f;
1008
- return (f = a[Number(v)]) === null || f === void 0 ? void 0 : f.tooltipPosition;
1009
- },
1010
- settings: {
1011
- stroke: n,
1012
- strokeWidth: i,
1013
- fill: l,
1014
- dataKey: t,
1015
- nameKey: r,
1016
- name: ne(s, t),
1017
- hide: c,
1018
- type: d,
1019
- color: l,
1020
- unit: "",
1021
- // why doesn't Pie support unit?
1022
- graphicalItemId: p
1023
- }
1024
- };
1025
- return /* @__PURE__ */ o.createElement(Ve, {
1026
- tooltipEntrySettings: u
1027
- });
1028
- }), Vl = (e, t) => e > t ? "start" : e < t ? "end" : "middle", Gl = (e, t, r) => typeof t == "function" ? Te(t(e), r, r * 0.8) : Te(t, r, r * 0.8), ql = (e, t, r) => {
1029
- var {
1030
- top: a,
1031
- left: n,
1032
- width: i,
1033
- height: l
1034
- } = t, s = $n(i, l), c = n + Te(e.cx, i, i / 2), d = a + Te(e.cy, l, l / 2), p = Te(e.innerRadius, s, 0), u = Gl(r, e.outerRadius, s), v = e.maxRadius || Math.sqrt(i * i + l * l) / 2;
1035
- return {
1036
- cx: c,
1037
- cy: d,
1038
- innerRadius: p,
1039
- outerRadius: u,
1040
- maxRadius: v
1041
- };
1042
- }, Zl = (e, t) => {
1043
- var r = Ue(t - e), a = Math.min(Math.abs(t - e), 360);
1044
- return r * a;
1045
- }, Xl = (e, t) => {
1046
- if (/* @__PURE__ */ o.isValidElement(e))
1047
- return /* @__PURE__ */ o.cloneElement(e, t);
1048
- if (typeof e == "function")
1049
- return e(t);
1050
- var r = W("recharts-pie-label-line", typeof e != "boolean" ? e.className : ""), {
1051
- key: a
1052
- } = t, n = mt(t, Tl);
1053
- return /* @__PURE__ */ o.createElement(Re, se({}, n, {
1054
- type: "linear",
1055
- className: r
1056
- }));
1057
- }, Yl = (e, t, r) => {
1058
- if (/* @__PURE__ */ o.isValidElement(e))
1059
- return /* @__PURE__ */ o.cloneElement(e, t);
1060
- var a = r;
1061
- if (typeof e == "function" && (a = e(t), /* @__PURE__ */ o.isValidElement(a)))
1062
- return a;
1063
- var n = W("recharts-pie-label-text", Kt(e));
1064
- return /* @__PURE__ */ o.createElement(Bt, se({}, t, {
1065
- alignmentBaseline: "middle",
1066
- className: n
1067
- }), a);
1068
- };
1069
- function Hl(e) {
1070
- var {
1071
- sectors: t,
1072
- props: r,
1073
- showLabels: a
1074
- } = e, {
1075
- label: n,
1076
- labelLine: i,
1077
- dataKey: l
1078
- } = r;
1079
- if (!a || !n || !t)
1080
- return null;
1081
- var s = N(r), c = pe(n), d = pe(i), p = typeof n == "object" && "offsetRadius" in n && typeof n.offsetRadius == "number" && n.offsetRadius || 20, u = t.map((v, f) => {
1082
- var h = (v.startAngle + v.endAngle) / 2, g = G(v.cx, v.cy, v.outerRadius + p, h), y = T(T(T(T({}, s), v), {}, {
1083
- // @ts-expect-error customLabelProps is contributing unknown props
1084
- stroke: "none"
1085
- }, c), {}, {
1086
- index: f,
1087
- textAnchor: Vl(g.x, v.cx)
1088
- }, g), m = T(T(T(T({}, s), v), {}, {
1089
- // @ts-expect-error customLabelLineProps is contributing unknown props
1090
- fill: "none",
1091
- // @ts-expect-error customLabelLineProps is contributing unknown props
1092
- stroke: v.fill
1093
- }, d), {}, {
1094
- index: f,
1095
- points: [G(v.cx, v.cy, v.outerRadius, h), g],
1096
- key: "line"
1097
- });
1098
- return /* @__PURE__ */ o.createElement(X, {
1099
- zIndex: ae.label,
1100
- key: "label-".concat(v.startAngle, "-").concat(v.endAngle, "-").concat(v.midAngle, "-").concat(f)
1101
- }, /* @__PURE__ */ o.createElement(L, null, i && Xl(i, m), Yl(n, y, K(v, l))));
1102
- });
1103
- return /* @__PURE__ */ o.createElement(L, {
1104
- className: "recharts-pie-labels"
1105
- }, u);
1106
- }
1107
- function Ul(e) {
1108
- var {
1109
- sectors: t,
1110
- props: r,
1111
- showLabels: a
1112
- } = e, {
1113
- label: n
1114
- } = r;
1115
- return typeof n == "object" && n != null && "position" in n ? /* @__PURE__ */ o.createElement(Ze, {
1116
- label: n
1117
- }) : /* @__PURE__ */ o.createElement(Hl, {
1118
- sectors: t,
1119
- props: r,
1120
- showLabels: a
1121
- });
1122
- }
1123
- function Jl(e) {
1124
- var {
1125
- sectors: t,
1126
- activeShape: r,
1127
- inactiveShape: a,
1128
- allOtherPieProps: n,
1129
- shape: i,
1130
- id: l
1131
- } = e, s = $(Wt), c = $(Cn), d = $(Tn), {
1132
- onMouseEnter: p,
1133
- onClick: u,
1134
- onMouseLeave: v
1135
- } = n, f = mt(n, Rl), h = la(p, n.dataKey, l), g = oa(v), y = sa(u, n.dataKey, l);
1136
- return t == null || t.length === 0 ? null : /* @__PURE__ */ o.createElement(o.Fragment, null, t.map((m, x) => {
1137
- if (m?.startAngle === 0 && m?.endAngle === 0 && t.length !== 1) return null;
1138
- var P = d == null || d === l, O = String(x) === s && (c == null || n.dataKey === c) && P, I = s ? a : null, A = r && O ? r : I, j = T(T({}, m), {}, {
1139
- stroke: m.stroke,
1140
- tabIndex: -1,
1141
- [Rn]: x,
1142
- [ca]: l
1143
- });
1144
- return /* @__PURE__ */ o.createElement(L, se({
1145
- key: "sector-".concat(m?.startAngle, "-").concat(m?.endAngle, "-").concat(m.midAngle, "-").concat(x),
1146
- tabIndex: -1,
1147
- className: "recharts-pie-sector"
1148
- }, st(f, m, x), {
1149
- // @ts-expect-error the types need a bit of attention
1150
- onMouseEnter: h(m, x),
1151
- onMouseLeave: g(m, x),
1152
- onClick: y(m, x)
1153
- }), /* @__PURE__ */ o.createElement(Qe, se({
1154
- option: i ?? A,
1155
- index: x,
1156
- shapeType: "sector",
1157
- isActive: O
1158
- }, j)));
1159
- }));
1160
- }
1161
- function Ql(e) {
1162
- var t, {
1163
- pieSettings: r,
1164
- displayedData: a,
1165
- cells: n,
1166
- offset: i
1167
- } = e, {
1168
- cornerRadius: l,
1169
- startAngle: s,
1170
- endAngle: c,
1171
- dataKey: d,
1172
- nameKey: p,
1173
- tooltipType: u
1174
- } = r, v = Math.abs(r.minAngle), f = Zl(s, c), h = Math.abs(f), g = a.length <= 1 ? 0 : (t = r.paddingAngle) !== null && t !== void 0 ? t : 0, y = a.filter((A) => K(A, d, 0) !== 0).length, m = (h >= 360 ? y : y - 1) * g, x = h - y * v - m, P = a.reduce((A, j) => {
1175
- var E = K(j, d, 0);
1176
- return A + (Q(E) ? E : 0);
1177
- }, 0), O;
1178
- if (P > 0) {
1179
- var I;
1180
- O = a.map((A, j) => {
1181
- var E = K(A, d, 0), S = K(A, p, j), D = ql(r, i, A), _ = (Q(E) ? E : 0) / P, k, C = T(T({}, A), n && n[j] && n[j].props);
1182
- j ? k = I.endAngle + Ue(f) * g * (E !== 0 ? 1 : 0) : k = s;
1183
- var B = k + Ue(f) * ((E !== 0 ? v : 0) + _ * x), M = (k + B) / 2, he = (D.innerRadius + D.outerRadius) / 2, ge = [{
1184
- name: S,
1185
- value: E,
1186
- payload: C,
1187
- dataKey: d,
1188
- type: u,
1189
- graphicalItemId: r.id
1190
- }], Ye = G(D.cx, D.cy, he, M);
1191
- return I = T(T(T(T({}, r.presentationProps), {}, {
1192
- percent: _,
1193
- cornerRadius: typeof l == "string" ? parseFloat(l) : l,
1194
- name: S,
1195
- tooltipPayload: ge,
1196
- midAngle: M,
1197
- middleRadius: he,
1198
- tooltipPosition: Ye
1199
- }, C), D), {}, {
1200
- value: E,
1201
- dataKey: d,
1202
- startAngle: k,
1203
- endAngle: B,
1204
- payload: C,
1205
- paddingAngle: Ue(f) * g
1206
- }), I;
1207
- });
1208
- }
1209
- return O;
1210
- }
1211
- function eo(e) {
1212
- var {
1213
- showLabels: t,
1214
- sectors: r,
1215
- children: a
1216
- } = e, n = le(() => !t || !r ? [] : r.map((i) => ({
1217
- value: i.value,
1218
- payload: i.payload,
1219
- clockWise: !1,
1220
- parentViewBox: void 0,
1221
- viewBox: {
1222
- cx: i.cx,
1223
- cy: i.cy,
1224
- innerRadius: i.innerRadius,
1225
- outerRadius: i.outerRadius,
1226
- startAngle: i.startAngle,
1227
- endAngle: i.endAngle,
1228
- clockWise: !1
1229
- },
1230
- fill: i.fill
1231
- })), [r, t]);
1232
- return /* @__PURE__ */ o.createElement(Ln, {
1233
- value: t ? n : void 0
1234
- }, a);
1235
- }
1236
- function to(e) {
1237
- var {
1238
- props: t,
1239
- previousSectorsRef: r,
1240
- id: a
1241
- } = e, {
1242
- sectors: n,
1243
- isAnimationActive: i,
1244
- animationBegin: l,
1245
- animationDuration: s,
1246
- animationEasing: c,
1247
- activeShape: d,
1248
- inactiveShape: p,
1249
- onAnimationStart: u,
1250
- onAnimationEnd: v
1251
- } = t, f = Ge(t, "recharts-pie-"), h = r.current, [g, y] = We(!1), m = re(() => {
1252
- typeof v == "function" && v(), y(!1);
1253
- }, [v]), x = re(() => {
1254
- typeof u == "function" && u(), y(!0);
1255
- }, [u]);
1256
- return /* @__PURE__ */ o.createElement(eo, {
1257
- showLabels: !g,
1258
- sectors: n
1259
- }, /* @__PURE__ */ o.createElement(qe, {
1260
- animationId: f,
1261
- begin: l,
1262
- duration: s,
1263
- isActive: i,
1264
- easing: c,
1265
- onAnimationStart: x,
1266
- onAnimationEnd: m,
1267
- key: f
1268
- }, (P) => {
1269
- var O, I = [], A = n && n[0], j = (O = A?.startAngle) !== null && O !== void 0 ? O : 0;
1270
- return n?.forEach((E, S) => {
1271
- var D = h && h[S], _ = S > 0 ? _n(E, "paddingAngle", 0) : 0;
1272
- if (D) {
1273
- var k = R(D.endAngle - D.startAngle, E.endAngle - E.startAngle, P), C = T(T({}, E), {}, {
1274
- startAngle: j + _,
1275
- endAngle: j + k + _
1276
- });
1277
- I.push(C), j = C.endAngle;
1278
- } else {
1279
- var {
1280
- endAngle: B,
1281
- startAngle: M
1282
- } = E, he = R(0, B - M, P), ge = T(T({}, E), {}, {
1283
- startAngle: j + _,
1284
- endAngle: j + he + _
1285
- });
1286
- I.push(ge), j = ge.endAngle;
1287
- }
1288
- }), r.current = I, /* @__PURE__ */ o.createElement(L, null, /* @__PURE__ */ o.createElement(Jl, {
1289
- sectors: I,
1290
- activeShape: d,
1291
- inactiveShape: p,
1292
- allOtherPieProps: t,
1293
- shape: t.shape,
1294
- id: a
1295
- }));
1296
- }), /* @__PURE__ */ o.createElement(Ul, {
1297
- showLabels: !g,
1298
- sectors: n,
1299
- props: t
1300
- }), t.children);
1301
- }
1302
- var ro = {
1303
- animationBegin: 400,
1304
- animationDuration: 1500,
1305
- animationEasing: "ease",
1306
- cx: "50%",
1307
- cy: "50%",
1308
- dataKey: "value",
1309
- endAngle: 360,
1310
- fill: "#808080",
1311
- hide: !1,
1312
- innerRadius: 0,
1313
- isAnimationActive: "auto",
1314
- label: !1,
1315
- labelLine: !0,
1316
- legendType: "rect",
1317
- minAngle: 0,
1318
- nameKey: "name",
1319
- outerRadius: "80%",
1320
- paddingAngle: 0,
1321
- rootTabIndex: 0,
1322
- startAngle: 0,
1323
- stroke: "#fff",
1324
- zIndex: ae.area
1325
- };
1326
- function ao(e) {
1327
- var {
1328
- id: t
1329
- } = e, r = mt(e, $l), {
1330
- hide: a,
1331
- className: n,
1332
- rootTabIndex: i
1333
- } = e, l = le(() => Mt(e.children, ct), [e.children]), s = $((p) => Cl(p, t, l)), c = Z(null), d = W("recharts-pie", n);
1334
- return a || s == null ? (c.current = null, /* @__PURE__ */ o.createElement(L, {
1335
- tabIndex: i,
1336
- className: d
1337
- })) : /* @__PURE__ */ o.createElement(X, {
1338
- zIndex: e.zIndex
1339
- }, /* @__PURE__ */ o.createElement(Fl, {
1340
- dataKey: e.dataKey,
1341
- nameKey: e.nameKey,
1342
- sectors: s,
1343
- stroke: e.stroke,
1344
- strokeWidth: e.strokeWidth,
1345
- fill: e.fill,
1346
- name: e.name,
1347
- hide: e.hide,
1348
- tooltipType: e.tooltipType,
1349
- id: t
1350
- }), /* @__PURE__ */ o.createElement(L, {
1351
- tabIndex: i,
1352
- className: d
1353
- }, /* @__PURE__ */ o.createElement(to, {
1354
- props: T(T({}, r), {}, {
1355
- sectors: s
1356
- }),
1357
- previousSectorsRef: c,
1358
- id: t
1359
- })));
1360
- }
1361
- function Oa(e) {
1362
- var t = z(e, ro), {
1363
- id: r
1364
- } = t, a = mt(t, Nl), n = N(a);
1365
- return /* @__PURE__ */ o.createElement(Fe, {
1366
- id: r,
1367
- type: "pie"
1368
- }, (i) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(na, {
1369
- type: "pie",
1370
- id: i,
1371
- data: a.data,
1372
- dataKey: a.dataKey,
1373
- hide: a.hide,
1374
- angleAxisId: 0,
1375
- radiusAxisId: 0,
1376
- name: a.name,
1377
- nameKey: a.nameKey,
1378
- tooltipType: a.tooltipType,
1379
- legendType: a.legendType,
1380
- fill: a.fill,
1381
- cx: a.cx,
1382
- cy: a.cy,
1383
- startAngle: a.startAngle,
1384
- endAngle: a.endAngle,
1385
- paddingAngle: a.paddingAngle,
1386
- minAngle: a.minAngle,
1387
- innerRadius: a.innerRadius,
1388
- outerRadius: a.outerRadius,
1389
- cornerRadius: a.cornerRadius,
1390
- presentationProps: n,
1391
- maxRadius: t.maxRadius
1392
- }), /* @__PURE__ */ o.createElement(zl, se({}, a, {
1393
- id: i
1394
- })), /* @__PURE__ */ o.createElement(ao, se({}, a, {
1395
- id: i
1396
- }))));
1397
- }
1398
- Oa.displayName = "Pie";
1399
- var no = ["points"];
1400
- function _r(e, t) {
1401
- var r = Object.keys(e);
1402
- if (Object.getOwnPropertySymbols) {
1403
- var a = Object.getOwnPropertySymbols(e);
1404
- t && (a = a.filter(function(n) {
1405
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
1406
- })), r.push.apply(r, a);
1407
- }
1408
- return r;
1409
- }
1410
- function jt(e) {
1411
- for (var t = 1; t < arguments.length; t++) {
1412
- var r = arguments[t] != null ? arguments[t] : {};
1413
- t % 2 ? _r(Object(r), !0).forEach(function(a) {
1414
- io(e, a, r[a]);
1415
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : _r(Object(r)).forEach(function(a) {
1416
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1417
- });
1418
- }
1419
- return e;
1420
- }
1421
- function io(e, t, r) {
1422
- return (t = lo(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1423
- }
1424
- function lo(e) {
1425
- var t = oo(e, "string");
1426
- return typeof t == "symbol" ? t : t + "";
1427
- }
1428
- function oo(e, t) {
1429
- if (typeof e != "object" || !e) return e;
1430
- var r = e[Symbol.toPrimitive];
1431
- if (r !== void 0) {
1432
- var a = r.call(e, t);
1433
- if (typeof a != "object") return a;
1434
- throw new TypeError("@@toPrimitive must return a primitive value.");
1435
- }
1436
- return (t === "string" ? String : Number)(e);
1437
- }
1438
- function tt() {
1439
- return tt = Object.assign ? Object.assign.bind() : function(e) {
1440
- for (var t = 1; t < arguments.length; t++) {
1441
- var r = arguments[t];
1442
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
1443
- }
1444
- return e;
1445
- }, tt.apply(null, arguments);
1446
- }
1447
- function so(e, t) {
1448
- if (e == null) return {};
1449
- var r, a, n = co(e, t);
1450
- if (Object.getOwnPropertySymbols) {
1451
- var i = Object.getOwnPropertySymbols(e);
1452
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
1453
- }
1454
- return n;
1455
- }
1456
- function co(e, t) {
1457
- if (e == null) return {};
1458
- var r = {};
1459
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
1460
- if (t.indexOf(a) !== -1) continue;
1461
- r[a] = e[a];
1462
- }
1463
- return r;
1464
- }
1465
- function uo(e) {
1466
- var {
1467
- option: t,
1468
- dotProps: r,
1469
- className: a
1470
- } = e;
1471
- if (/* @__PURE__ */ Zr(t))
1472
- return /* @__PURE__ */ Xr(t, r);
1473
- if (typeof t == "function")
1474
- return t(r);
1475
- var n = W(a, typeof t != "boolean" ? t.className : ""), i = r ?? {}, {
1476
- points: l
1477
- } = i, s = so(i, no);
1478
- return /* @__PURE__ */ o.createElement(Jt, tt({}, s, {
1479
- className: n
1480
- }));
1481
- }
1482
- function vo(e, t) {
1483
- return e == null ? !1 : t ? !0 : e.length === 1;
1484
- }
1485
- function ir(e) {
1486
- var {
1487
- points: t,
1488
- dot: r,
1489
- className: a,
1490
- dotClassName: n,
1491
- dataKey: i,
1492
- baseProps: l,
1493
- needClip: s,
1494
- clipPathId: c,
1495
- zIndex: d = ae.scatter
1496
- } = e;
1497
- if (!vo(t, r))
1498
- return null;
1499
- var p = zt(r), u = Nn(r), v = t.map((h, g) => {
1500
- var y, m, x = jt(jt(jt({
1501
- r: 3
1502
- }, l), u), {}, {
1503
- index: g,
1504
- cx: (y = h.x) !== null && y !== void 0 ? y : void 0,
1505
- cy: (m = h.y) !== null && m !== void 0 ? m : void 0,
1506
- dataKey: i,
1507
- value: h.value,
1508
- payload: h.payload,
1509
- points: t
1510
- });
1511
- return /* @__PURE__ */ o.createElement(uo, {
1512
- key: "dot-".concat(g),
1513
- option: r,
1514
- dotProps: x,
1515
- className: n
1516
- });
1517
- }), f = {};
1518
- return s && c != null && (f.clipPath = "url(#clipPath-".concat(p ? "" : "dots-").concat(c, ")")), /* @__PURE__ */ o.createElement(X, {
1519
- zIndex: d
1520
- }, /* @__PURE__ */ o.createElement(L, tt({
1521
- className: a
1522
- }, f), v));
1523
- }
1524
- function Lr(e, t) {
1525
- var r = Object.keys(e);
1526
- if (Object.getOwnPropertySymbols) {
1527
- var a = Object.getOwnPropertySymbols(e);
1528
- t && (a = a.filter(function(n) {
1529
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
1530
- })), r.push.apply(r, a);
1531
- }
1532
- return r;
1533
- }
1534
- function It(e) {
1535
- for (var t = 1; t < arguments.length; t++) {
1536
- var r = arguments[t] != null ? arguments[t] : {};
1537
- t % 2 ? Lr(Object(r), !0).forEach(function(a) {
1538
- po(e, a, r[a]);
1539
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Lr(Object(r)).forEach(function(a) {
1540
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1541
- });
1542
- }
1543
- return e;
1544
- }
1545
- function po(e, t, r) {
1546
- return (t = fo(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1547
- }
1548
- function fo(e) {
1549
- var t = mo(e, "string");
1550
- return typeof t == "symbol" ? t : t + "";
1551
- }
1552
- function mo(e, t) {
1553
- if (typeof e != "object" || !e) return e;
1554
- var r = e[Symbol.toPrimitive];
1555
- if (r !== void 0) {
1556
- var a = r.call(e, t);
1557
- if (typeof a != "object") return a;
1558
- throw new TypeError("@@toPrimitive must return a primitive value.");
1559
- }
1560
- return (t === "string" ? String : Number)(e);
1561
- }
1562
- var yo = (e) => {
1563
- var {
1564
- point: t,
1565
- childIndex: r,
1566
- mainColor: a,
1567
- activeDot: n,
1568
- dataKey: i,
1569
- clipPath: l
1570
- } = e;
1571
- if (n === !1 || t.x == null || t.y == null)
1572
- return null;
1573
- var s = {
1574
- index: r,
1575
- dataKey: i,
1576
- cx: t.x,
1577
- cy: t.y,
1578
- r: 4,
1579
- fill: a ?? "none",
1580
- strokeWidth: 2,
1581
- stroke: "#fff",
1582
- payload: t.payload,
1583
- value: t.value
1584
- }, c = It(It(It({}, s), pe(n)), Yr(n)), d;
1585
- return /* @__PURE__ */ Zr(n) ? d = /* @__PURE__ */ Xr(n, c) : typeof n == "function" ? d = n(c) : d = /* @__PURE__ */ o.createElement(Jt, c), /* @__PURE__ */ o.createElement(L, {
1586
- className: "recharts-active-dot",
1587
- clipPath: l
1588
- }, d);
1589
- };
1590
- function rt(e) {
1591
- var {
1592
- points: t,
1593
- mainColor: r,
1594
- activeDot: a,
1595
- itemDataKey: n,
1596
- clipPath: i,
1597
- zIndex: l = ae.activeDot
1598
- } = e, s = $(Wt), c = Kn();
1599
- if (t == null || c == null)
1600
- return null;
1601
- var d = t.find((p) => c.includes(p.payload));
1602
- return H(d) ? null : /* @__PURE__ */ o.createElement(X, {
1603
- zIndex: l
1604
- }, /* @__PURE__ */ o.createElement(yo, {
1605
- point: d,
1606
- childIndex: Number(s),
1607
- mainColor: r,
1608
- dataKey: n,
1609
- activeDot: a,
1610
- clipPath: i
1611
- }));
1612
- }
1613
- function Cr(e, t) {
1614
- var r = Object.keys(e);
1615
- if (Object.getOwnPropertySymbols) {
1616
- var a = Object.getOwnPropertySymbols(e);
1617
- t && (a = a.filter(function(n) {
1618
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
1619
- })), r.push.apply(r, a);
1620
- }
1621
- return r;
1622
- }
1623
- function at(e) {
1624
- for (var t = 1; t < arguments.length; t++) {
1625
- var r = arguments[t] != null ? arguments[t] : {};
1626
- t % 2 ? Cr(Object(r), !0).forEach(function(a) {
1627
- ho(e, a, r[a]);
1628
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Cr(Object(r)).forEach(function(a) {
1629
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1630
- });
1631
- }
1632
- return e;
1633
- }
1634
- function ho(e, t, r) {
1635
- return (t = go(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1636
- }
1637
- function go(e) {
1638
- var t = bo(e, "string");
1639
- return typeof t == "symbol" ? t : t + "";
1640
- }
1641
- function bo(e, t) {
1642
- if (typeof e != "object" || !e) return e;
1643
- var r = e[Symbol.toPrimitive];
1644
- if (r !== void 0) {
1645
- var a = r.call(e, t);
1646
- if (typeof a != "object") return a;
1647
- throw new TypeError("@@toPrimitive must return a primitive value.");
1648
- }
1649
- return (t === "string" ? String : Number)(e);
1650
- }
1651
- var Ea = (e, t) => Ie(e, "radiusAxis", t), xo = w([Ea], (e) => {
1652
- if (e != null)
1653
- return {
1654
- scale: e
1655
- };
1656
- }), Po = w([Jr, Ea], (e, t) => {
1657
- if (!(e == null || t == null))
1658
- return at(at({}, e), {}, {
1659
- scale: t
1660
- });
1661
- }), Ao = (e, t, r, a) => we(e, "radiusAxis", t, a), ja = (e, t, r) => Nt(e, r), Ia = (e, t, r) => Ie(e, "angleAxis", r), Oo = w([ja, Ia], (e, t) => {
1662
- if (!(e == null || t == null))
1663
- return at(at({}, e), {}, {
1664
- scale: t
1665
- });
1666
- }), Eo = (e, t, r, a) => we(e, "angleAxis", r, a), jo = w([ja, Ia, lt], (e, t, r) => {
1667
- if (!(r == null || t == null))
1668
- return {
1669
- scale: t,
1670
- type: e.type,
1671
- dataKey: e.dataKey,
1672
- cx: r.cx,
1673
- cy: r.cy
1674
- };
1675
- }), Io = (e, t, r, a, n) => n, wo = w([ee, Po, Ao, Oo, Eo], (e, t, r, a, n) => ut(e, "radiusAxis") ? Pe(t, r, !1) : Pe(a, n, !1)), So = w([Qt, Io], (e, t) => {
1676
- if (e != null) {
1677
- var r = e.find((a) => a.type === "radar" && t === a.id);
1678
- return r?.dataKey;
1679
- }
1680
- }), ko = w([xo, jo, $t, So, wo], (e, t, r, a, n) => {
1681
- var {
1682
- chartData: i,
1683
- dataStartIndex: l,
1684
- dataEndIndex: s
1685
- } = r;
1686
- if (!(e == null || t == null || i == null || n == null || a == null)) {
1687
- var c = i.slice(l, s + 1);
1688
- return Bo({
1689
- radiusAxis: e,
1690
- angleAxis: t,
1691
- displayedData: c,
1692
- dataKey: a,
1693
- bandSize: n
1694
- });
1695
- }
1696
- }), Do = ["id"];
1697
- function Be() {
1698
- return Be = Object.assign ? Object.assign.bind() : function(e) {
1699
- for (var t = 1; t < arguments.length; t++) {
1700
- var r = arguments[t];
1701
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
1702
- }
1703
- return e;
1704
- }, Be.apply(null, arguments);
1705
- }
1706
- function Tr(e, t) {
1707
- var r = Object.keys(e);
1708
- if (Object.getOwnPropertySymbols) {
1709
- var a = Object.getOwnPropertySymbols(e);
1710
- t && (a = a.filter(function(n) {
1711
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
1712
- })), r.push.apply(r, a);
1713
- }
1714
- return r;
1715
- }
1716
- function F(e) {
1717
- for (var t = 1; t < arguments.length; t++) {
1718
- var r = arguments[t] != null ? arguments[t] : {};
1719
- t % 2 ? Tr(Object(r), !0).forEach(function(a) {
1720
- _o(e, a, r[a]);
1721
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Tr(Object(r)).forEach(function(a) {
1722
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1723
- });
1724
- }
1725
- return e;
1726
- }
1727
- function _o(e, t, r) {
1728
- return (t = Lo(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1729
- }
1730
- function Lo(e) {
1731
- var t = Co(e, "string");
1732
- return typeof t == "symbol" ? t : t + "";
1733
- }
1734
- function Co(e, t) {
1735
- if (typeof e != "object" || !e) return e;
1736
- var r = e[Symbol.toPrimitive];
1737
- if (r !== void 0) {
1738
- var a = r.call(e, t);
1739
- if (typeof a != "object") return a;
1740
- throw new TypeError("@@toPrimitive must return a primitive value.");
1741
- }
1742
- return (t === "string" ? String : Number)(e);
1743
- }
1744
- function To(e, t) {
1745
- if (e == null) return {};
1746
- var r, a, n = Ro(e, t);
1747
- if (Object.getOwnPropertySymbols) {
1748
- var i = Object.getOwnPropertySymbols(e);
1749
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
1750
- }
1751
- return n;
1752
- }
1753
- function Ro(e, t) {
1754
- if (e == null) return {};
1755
- var r = {};
1756
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
1757
- if (t.indexOf(a) !== -1) continue;
1758
- r[a] = e[a];
1759
- }
1760
- return r;
1761
- }
1762
- function lr(e, t) {
1763
- return e && e !== "none" ? e : t;
1764
- }
1765
- var $o = (e) => {
1766
- var {
1767
- dataKey: t,
1768
- name: r,
1769
- stroke: a,
1770
- fill: n,
1771
- legendType: i,
1772
- hide: l
1773
- } = e;
1774
- return [{
1775
- inactive: l,
1776
- dataKey: t,
1777
- type: i,
1778
- color: lr(a, n),
1779
- value: ne(r, t),
1780
- payload: e
1781
- }];
1782
- }, No = /* @__PURE__ */ o.memo((e) => {
1783
- var {
1784
- dataKey: t,
1785
- stroke: r,
1786
- strokeWidth: a,
1787
- fill: n,
1788
- name: i,
1789
- hide: l,
1790
- tooltipType: s,
1791
- id: c
1792
- } = e, d = {
1793
- /*
1794
- * I suppose this here _could_ return props.points
1795
- * because while Radar does not support item tooltip mode, it _could_ support it.
1796
- * But when I actually do return the points here, a defaultIndex test starts failing.
1797
- * So, undefined it is.
1798
- */
1799
- dataDefinedOnItem: void 0,
1800
- getPosition: ze,
1801
- settings: {
1802
- stroke: r,
1803
- strokeWidth: a,
1804
- fill: n,
1805
- nameKey: void 0,
1806
- // RadarChart does not have nameKey unfortunately
1807
- dataKey: t,
1808
- name: ne(i, t),
1809
- hide: l,
1810
- type: s,
1811
- color: lr(r, n),
1812
- unit: "",
1813
- // why doesn't Radar support unit?
1814
- graphicalItemId: c
1815
- }
1816
- };
1817
- return /* @__PURE__ */ o.createElement(Ve, {
1818
- tooltipEntrySettings: d
1819
- });
1820
- });
1821
- function Ko(e) {
1822
- var {
1823
- points: t,
1824
- props: r
1825
- } = e, {
1826
- dot: a,
1827
- dataKey: n
1828
- } = r, {
1829
- id: i
1830
- } = r, l = To(r, Do), s = N(l);
1831
- return /* @__PURE__ */ o.createElement(ir, {
1832
- points: t,
1833
- dot: a,
1834
- className: "recharts-radar-dots",
1835
- dotClassName: "recharts-radar-dot",
1836
- dataKey: n,
1837
- baseProps: s
1838
- });
1839
- }
1840
- function Bo(e) {
1841
- var {
1842
- radiusAxis: t,
1843
- angleAxis: r,
1844
- displayedData: a,
1845
- dataKey: n,
1846
- bandSize: i
1847
- } = e, {
1848
- cx: l,
1849
- cy: s
1850
- } = r, c = !1, d = [], p = r.type !== "number" ? i ?? 0 : 0;
1851
- a.forEach((v, f) => {
1852
- var h, g, y = K(v, r.dataKey, f), m = K(v, n), x = ((h = r.scale.map(y)) !== null && h !== void 0 ? h : 0) + p, P = Array.isArray(m) ? Bn(m) : m, O = H(P) ? 0 : (g = t.scale.map(P)) !== null && g !== void 0 ? g : 0;
1853
- Array.isArray(m) && m.length >= 2 && (c = !0), d.push(F(F({}, G(l, s, O, x)), {}, {
1854
- // @ts-expect-error getValueByDataKey does not validate the output type
1855
- name: y,
1856
- // @ts-expect-error getValueByDataKey does not validate the output type
1857
- value: m,
1858
- cx: l,
1859
- cy: s,
1860
- radius: O,
1861
- angle: x,
1862
- payload: v
1863
- }));
1864
- });
1865
- var u = [];
1866
- return c && d.forEach((v) => {
1867
- if (Array.isArray(v.value)) {
1868
- var f, h = v.value[0], g = H(h) ? 0 : (f = t.scale.map(h)) !== null && f !== void 0 ? f : 0;
1869
- u.push(F(F({}, v), {}, {
1870
- radius: g
1871
- }, G(l, s, g, v.angle)));
1872
- } else
1873
- u.push(v);
1874
- }), {
1875
- points: d,
1876
- isRange: c,
1877
- baseLinePoints: u
1878
- };
1879
- }
1880
- function Mo(e) {
1881
- var {
1882
- showLabels: t,
1883
- points: r,
1884
- children: a
1885
- } = e, n = r.map((i) => {
1886
- var l, s = {
1887
- x: i.x,
1888
- y: i.y,
1889
- width: 0,
1890
- lowerWidth: 0,
1891
- upperWidth: 0,
1892
- height: 0
1893
- };
1894
- return F(F({}, s), {}, {
1895
- value: (l = i.value) !== null && l !== void 0 ? l : "",
1896
- payload: i.payload,
1897
- parentViewBox: void 0,
1898
- viewBox: s,
1899
- fill: void 0
1900
- });
1901
- });
1902
- return /* @__PURE__ */ o.createElement(dt, {
1903
- value: t ? n : void 0
1904
- }, a);
1905
- }
1906
- function Wo(e) {
1907
- var {
1908
- points: t,
1909
- baseLinePoints: r,
1910
- props: a
1911
- } = e;
1912
- if (t == null)
1913
- return null;
1914
- var {
1915
- shape: n,
1916
- isRange: i,
1917
- connectNulls: l
1918
- } = a, s = (p) => {
1919
- var {
1920
- onMouseEnter: u
1921
- } = a;
1922
- u && u(a, p);
1923
- }, c = (p) => {
1924
- var {
1925
- onMouseLeave: u
1926
- } = a;
1927
- u && u(a, p);
1928
- }, d;
1929
- return /* @__PURE__ */ o.isValidElement(n) ? d = /* @__PURE__ */ o.cloneElement(n, F(F({}, a), {}, {
1930
- points: t
1931
- })) : typeof n == "function" ? d = n(F(F({}, a), {}, {
1932
- points: t
1933
- })) : d = /* @__PURE__ */ o.createElement(fa, Be({}, de(a), {
1934
- onMouseEnter: s,
1935
- onMouseLeave: c,
1936
- points: t,
1937
- baseLinePoints: i ? r : void 0,
1938
- connectNulls: l
1939
- })), /* @__PURE__ */ o.createElement(L, {
1940
- className: "recharts-radar-polygon"
1941
- }, d, /* @__PURE__ */ o.createElement(Ko, {
1942
- props: a,
1943
- points: t
1944
- }));
1945
- }
1946
- var Rr = (e, t, r) => (a, n) => {
1947
- var i = e && e[Math.floor(n * t)];
1948
- return i ? F(F({}, a), {}, {
1949
- x: R(i.x, a.x, r),
1950
- y: R(i.y, a.y, r)
1951
- }) : F(F({}, a), {}, {
1952
- x: R(a.cx, a.x, r),
1953
- y: R(a.cy, a.y, r)
1954
- });
1955
- };
1956
- function zo(e) {
1957
- var {
1958
- props: t,
1959
- previousPointsRef: r,
1960
- previousBaseLinePointsRef: a
1961
- } = e, {
1962
- points: n,
1963
- baseLinePoints: i,
1964
- isAnimationActive: l,
1965
- animationBegin: s,
1966
- animationDuration: c,
1967
- animationEasing: d,
1968
- onAnimationEnd: p,
1969
- onAnimationStart: u
1970
- } = t, v = r.current, f = a.current, h = v ? v.length / n.length : 1, g = f ? f.length / i.length : 1, y = Ge(t, "recharts-radar-"), [m, x] = We(!1), P = !m, O = re(() => {
1971
- typeof p == "function" && p(), x(!1);
1972
- }, [p]), I = re(() => {
1973
- typeof u == "function" && u(), x(!0);
1974
- }, [u]);
1975
- return /* @__PURE__ */ o.createElement(Mo, {
1976
- showLabels: P,
1977
- points: n
1978
- }, /* @__PURE__ */ o.createElement(qe, {
1979
- animationId: y,
1980
- begin: s,
1981
- duration: c,
1982
- isActive: l,
1983
- easing: d,
1984
- key: "radar-".concat(y),
1985
- onAnimationEnd: O,
1986
- onAnimationStart: I
1987
- }, (A) => {
1988
- var j = A === 1 ? n : n.map(Rr(v, h, A)), E = A === 1 ? i : i?.map(Rr(f, g, A));
1989
- return A > 0 && (r.current = j, a.current = E), /* @__PURE__ */ o.createElement(Wo, {
1990
- points: j,
1991
- baseLinePoints: E,
1992
- props: t
1993
- });
1994
- }), /* @__PURE__ */ o.createElement(Ze, {
1995
- label: t.label
1996
- }), t.children);
1997
- }
1998
- function Fo(e) {
1999
- var t = Z(void 0), r = Z(void 0);
2000
- return /* @__PURE__ */ o.createElement(zo, {
2001
- props: e,
2002
- previousPointsRef: t,
2003
- previousBaseLinePointsRef: r
2004
- });
2005
- }
2006
- var Vo = {
2007
- activeDot: !0,
2008
- angleAxisId: 0,
2009
- animationBegin: 0,
2010
- animationDuration: 1500,
2011
- animationEasing: "ease",
2012
- dot: !1,
2013
- hide: !1,
2014
- isAnimationActive: "auto",
2015
- label: !1,
2016
- legendType: "rect",
2017
- radiusAxisId: 0,
2018
- zIndex: ae.area
2019
- };
2020
- function Go(e) {
2021
- var {
2022
- hide: t,
2023
- className: r,
2024
- points: a
2025
- } = e;
2026
- if (t)
2027
- return null;
2028
- var n = W("recharts-radar", r);
2029
- return /* @__PURE__ */ o.createElement(X, {
2030
- zIndex: e.zIndex
2031
- }, /* @__PURE__ */ o.createElement(L, {
2032
- className: n
2033
- }, /* @__PURE__ */ o.createElement(Fo, e)), /* @__PURE__ */ o.createElement(rt, {
2034
- points: a,
2035
- mainColor: lr(e.stroke, e.fill),
2036
- itemDataKey: e.dataKey,
2037
- activeDot: e.activeDot
2038
- }));
2039
- }
2040
- function qo(e) {
2041
- var t = ue(), r = $((a) => ko(a, e.radiusAxisId, e.angleAxisId, t, e.id));
2042
- return r?.points == null ? null : /* @__PURE__ */ o.createElement(Go, Be({}, e, {
2043
- points: r?.points,
2044
- baseLinePoints: r?.baseLinePoints,
2045
- isRange: r?.isRange
2046
- }));
2047
- }
2048
- function wa(e) {
2049
- var t = z(e, Vo);
2050
- return /* @__PURE__ */ o.createElement(Fe, {
2051
- id: t.id,
2052
- type: "radar"
2053
- }, (r) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(na, {
2054
- type: "radar",
2055
- id: r,
2056
- data: void 0,
2057
- dataKey: t.dataKey,
2058
- hide: t.hide,
2059
- angleAxisId: t.angleAxisId,
2060
- radiusAxisId: t.radiusAxisId
2061
- }), /* @__PURE__ */ o.createElement(ia, {
2062
- legendPayload: $o(t)
2063
- }), /* @__PURE__ */ o.createElement(No, {
2064
- dataKey: t.dataKey,
2065
- stroke: t.stroke,
2066
- strokeWidth: t.strokeWidth,
2067
- fill: t.fill,
2068
- name: t.name,
2069
- hide: t.hide,
2070
- tooltipType: t.tooltipType,
2071
- id: r
2072
- }), /* @__PURE__ */ o.createElement(qo, Be({}, t, {
2073
- id: r
2074
- }))));
2075
- }
2076
- wa.displayName = "Radar";
2077
- var Sa = (e, t, r, a) => Ee(e, "xAxis", t, a), ka = (e, t, r, a) => je(e, "xAxis", t, a), Da = (e, t, r, a) => Ee(e, "yAxis", r, a), _a = (e, t, r, a) => je(e, "yAxis", r, a), Zo = w([ee, Sa, Da, ka, _a], (e, t, r, a, n) => ut(e, "xAxis") ? Pe(t, a, !1) : Pe(r, n, !1)), Xo = (e, t, r, a, n) => n;
2078
- function Yo(e) {
2079
- return e.type === "line";
2080
- }
2081
- var Ho = w([Ft, Xo], (e, t) => e.filter(Yo).find((r) => r.id === t)), Uo = w([ee, Sa, Da, ka, _a, Ho, Zo, ua], (e, t, r, a, n, i, l, s) => {
2082
- var {
2083
- chartData: c,
2084
- dataStartIndex: d,
2085
- dataEndIndex: p
2086
- } = s;
2087
- if (!(i == null || t == null || r == null || a == null || n == null || a.length === 0 || n.length === 0 || l == null || e !== "horizontal" && e !== "vertical")) {
2088
- var {
2089
- dataKey: u,
2090
- data: v
2091
- } = i, f;
2092
- if (v != null && v.length > 0 ? f = v : f = c?.slice(d, p + 1), f != null)
2093
- return hs({
2094
- layout: e,
2095
- xAxis: t,
2096
- yAxis: r,
2097
- xAxisTicks: a,
2098
- yAxisTicks: n,
2099
- dataKey: u,
2100
- bandSize: l,
2101
- displayedData: f
2102
- });
2103
- }
2104
- });
2105
- function La(e) {
2106
- var t = pe(e), r = 3, a = 2;
2107
- if (t != null) {
2108
- var {
2109
- r: n,
2110
- strokeWidth: i
2111
- } = t, l = Number(n), s = Number(i);
2112
- return (Number.isNaN(l) || l < 0) && (l = r), (Number.isNaN(s) || s < 0) && (s = a), {
2113
- r: l,
2114
- strokeWidth: s
2115
- };
2116
- }
2117
- return {
2118
- r,
2119
- strokeWidth: a
2120
- };
2121
- }
2122
- var Jo = ["id"], Qo = ["type", "layout", "connectNulls", "needClip", "shape"], es = ["activeDot", "animateNewValues", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "hide", "isAnimationActive", "label", "legendType", "xAxisId", "yAxisId", "id"];
2123
- function Me() {
2124
- return Me = Object.assign ? Object.assign.bind() : function(e) {
2125
- for (var t = 1; t < arguments.length; t++) {
2126
- var r = arguments[t];
2127
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
2128
- }
2129
- return e;
2130
- }, Me.apply(null, arguments);
2131
- }
2132
- function $r(e, t) {
2133
- var r = Object.keys(e);
2134
- if (Object.getOwnPropertySymbols) {
2135
- var a = Object.getOwnPropertySymbols(e);
2136
- t && (a = a.filter(function(n) {
2137
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
2138
- })), r.push.apply(r, a);
2139
- }
2140
- return r;
2141
- }
2142
- function te(e) {
2143
- for (var t = 1; t < arguments.length; t++) {
2144
- var r = arguments[t] != null ? arguments[t] : {};
2145
- t % 2 ? $r(Object(r), !0).forEach(function(a) {
2146
- ts(e, a, r[a]);
2147
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : $r(Object(r)).forEach(function(a) {
2148
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
2149
- });
2150
- }
2151
- return e;
2152
- }
2153
- function ts(e, t, r) {
2154
- return (t = rs(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
2155
- }
2156
- function rs(e) {
2157
- var t = as(e, "string");
2158
- return typeof t == "symbol" ? t : t + "";
2159
- }
2160
- function as(e, t) {
2161
- if (typeof e != "object" || !e) return e;
2162
- var r = e[Symbol.toPrimitive];
2163
- if (r !== void 0) {
2164
- var a = r.call(e, t);
2165
- if (typeof a != "object") return a;
2166
- throw new TypeError("@@toPrimitive must return a primitive value.");
2167
- }
2168
- return (t === "string" ? String : Number)(e);
2169
- }
2170
- function or(e, t) {
2171
- if (e == null) return {};
2172
- var r, a, n = ns(e, t);
2173
- if (Object.getOwnPropertySymbols) {
2174
- var i = Object.getOwnPropertySymbols(e);
2175
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
2176
- }
2177
- return n;
2178
- }
2179
- function ns(e, t) {
2180
- if (e == null) return {};
2181
- var r = {};
2182
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
2183
- if (t.indexOf(a) !== -1) continue;
2184
- r[a] = e[a];
2185
- }
2186
- return r;
2187
- }
2188
- var is = (e) => {
2189
- var {
2190
- dataKey: t,
2191
- name: r,
2192
- stroke: a,
2193
- legendType: n,
2194
- hide: i
2195
- } = e;
2196
- return [{
2197
- inactive: i,
2198
- dataKey: t,
2199
- type: n,
2200
- color: a,
2201
- value: ne(r, t),
2202
- payload: e
2203
- }];
2204
- }, ls = /* @__PURE__ */ o.memo((e) => {
2205
- var {
2206
- dataKey: t,
2207
- data: r,
2208
- stroke: a,
2209
- strokeWidth: n,
2210
- fill: i,
2211
- name: l,
2212
- hide: s,
2213
- unit: c,
2214
- tooltipType: d,
2215
- id: p
2216
- } = e, u = {
2217
- dataDefinedOnItem: r,
2218
- getPosition: ze,
2219
- settings: {
2220
- stroke: a,
2221
- strokeWidth: n,
2222
- fill: i,
2223
- dataKey: t,
2224
- nameKey: void 0,
2225
- name: ne(l, t),
2226
- hide: s,
2227
- type: d,
2228
- color: a,
2229
- unit: c,
2230
- graphicalItemId: p
2231
- }
2232
- };
2233
- return /* @__PURE__ */ o.createElement(Ve, {
2234
- tooltipEntrySettings: u
2235
- });
2236
- }), Ca = (e, t) => "".concat(t, "px ").concat(e - t, "px");
2237
- function os(e, t) {
2238
- for (var r = e.length % 2 !== 0 ? [...e, 0] : e, a = [], n = 0; n < t; ++n)
2239
- a = [...a, ...r];
2240
- return a;
2241
- }
2242
- var ss = (e, t, r) => {
2243
- var a = r.reduce((f, h) => f + h);
2244
- if (!a)
2245
- return Ca(t, e);
2246
- for (var n = Math.floor(e / a), i = e % a, l = t - e, s = [], c = 0, d = 0; c < r.length; d += (p = r[c]) !== null && p !== void 0 ? p : 0, ++c) {
2247
- var p, u = r[c];
2248
- if (u != null && d + u > i) {
2249
- s = [...r.slice(0, c), i - d];
2250
- break;
2251
- }
2252
- }
2253
- var v = s.length % 2 === 0 ? [0, l] : [l];
2254
- return [...os(r, n), ...s, ...v].map((f) => "".concat(f, "px")).join(", ");
2255
- };
2256
- function cs(e) {
2257
- var {
2258
- clipPathId: t,
2259
- points: r,
2260
- props: a
2261
- } = e, {
2262
- dot: n,
2263
- dataKey: i,
2264
- needClip: l
2265
- } = a, {
2266
- id: s
2267
- } = a, c = or(a, Jo), d = N(c);
2268
- return /* @__PURE__ */ o.createElement(ir, {
2269
- points: r,
2270
- dot: n,
2271
- className: "recharts-line-dots",
2272
- dotClassName: "recharts-line-dot",
2273
- dataKey: i,
2274
- baseProps: d,
2275
- needClip: l,
2276
- clipPathId: t
2277
- });
2278
- }
2279
- function us(e) {
2280
- var {
2281
- showLabels: t,
2282
- children: r,
2283
- points: a
2284
- } = e, n = le(() => a?.map((i) => {
2285
- var l, s, c = {
2286
- x: (l = i.x) !== null && l !== void 0 ? l : 0,
2287
- y: (s = i.y) !== null && s !== void 0 ? s : 0,
2288
- width: 0,
2289
- lowerWidth: 0,
2290
- upperWidth: 0,
2291
- height: 0
2292
- };
2293
- return te(te({}, c), {}, {
2294
- value: i.value,
2295
- payload: i.payload,
2296
- viewBox: c,
2297
- /*
2298
- * Line is not passing parentViewBox to the LabelList so the labels can escape - looks like a bug, should we pass parentViewBox?
2299
- * Or should this just be the root chart viewBox?
2300
- */
2301
- parentViewBox: void 0,
2302
- fill: void 0
2303
- });
2304
- }), [a]);
2305
- return /* @__PURE__ */ o.createElement(dt, {
2306
- value: t ? n : void 0
2307
- }, r);
2308
- }
2309
- function Nr(e) {
2310
- var {
2311
- clipPathId: t,
2312
- pathRef: r,
2313
- points: a,
2314
- strokeDasharray: n,
2315
- props: i
2316
- } = e, {
2317
- type: l,
2318
- layout: s,
2319
- connectNulls: c,
2320
- needClip: d,
2321
- shape: p
2322
- } = i, u = or(i, Qo), v = te(te({}, de(u)), {}, {
2323
- fill: "none",
2324
- className: "recharts-line-curve",
2325
- clipPath: d ? "url(#clipPath-".concat(t, ")") : void 0,
2326
- points: a,
2327
- type: l,
2328
- layout: s,
2329
- connectNulls: c,
2330
- strokeDasharray: n ?? i.strokeDasharray
2331
- });
2332
- return /* @__PURE__ */ o.createElement(o.Fragment, null, a?.length > 1 && /* @__PURE__ */ o.createElement(Qe, Me({
2333
- shapeType: "curve",
2334
- option: p
2335
- }, v, {
2336
- pathRef: r
2337
- })), /* @__PURE__ */ o.createElement(cs, {
2338
- points: a,
2339
- clipPathId: t,
2340
- props: i
2341
- }));
2342
- }
2343
- function ds(e) {
2344
- try {
2345
- return e && e.getTotalLength && e.getTotalLength() || 0;
2346
- } catch {
2347
- return 0;
2348
- }
2349
- }
2350
- function vs(e) {
2351
- var {
2352
- clipPathId: t,
2353
- props: r,
2354
- pathRef: a,
2355
- previousPointsRef: n,
2356
- longestAnimatedLengthRef: i
2357
- } = e, {
2358
- points: l,
2359
- strokeDasharray: s,
2360
- isAnimationActive: c,
2361
- animationBegin: d,
2362
- animationDuration: p,
2363
- animationEasing: u,
2364
- animateNewValues: v,
2365
- width: f,
2366
- height: h,
2367
- onAnimationEnd: g,
2368
- onAnimationStart: y
2369
- } = r, m = n.current, x = Ge(l, "recharts-line-"), P = Z(x), [O, I] = We(!1), A = !O, j = re(() => {
2370
- typeof g == "function" && g(), I(!1);
2371
- }, [g]), E = re(() => {
2372
- typeof y == "function" && y(), I(!0);
2373
- }, [y]), S = ds(a.current), D = Z(0);
2374
- P.current !== x && (D.current = i.current, P.current = x);
2375
- var _ = D.current;
2376
- return /* @__PURE__ */ o.createElement(us, {
2377
- points: l,
2378
- showLabels: A
2379
- }, r.children, /* @__PURE__ */ o.createElement(qe, {
2380
- animationId: x,
2381
- begin: d,
2382
- duration: p,
2383
- isActive: c,
2384
- easing: u,
2385
- onAnimationEnd: j,
2386
- onAnimationStart: E,
2387
- key: x
2388
- }, (k) => {
2389
- var C = R(_, S + _, k), B = Math.min(C, S), M;
2390
- if (c)
2391
- if (s) {
2392
- var he = "".concat(s).split(/[,\s]+/gim).map((Y) => parseFloat(Y));
2393
- M = ss(B, S, he);
2394
- } else
2395
- M = Ca(S, B);
2396
- else
2397
- M = s == null ? void 0 : String(s);
2398
- if (k > 0 && S > 0 && (n.current = l, i.current = Math.max(i.current, B)), m) {
2399
- var ge = m.length / l.length, Ye = k === 1 ? l : l.map((Y, Ya) => {
2400
- var cr = Math.floor(Ya * ge);
2401
- if (m[cr]) {
2402
- var ur = m[cr];
2403
- return te(te({}, Y), {}, {
2404
- x: R(ur.x, Y.x, k),
2405
- y: R(ur.y, Y.y, k)
2406
- });
2407
- }
2408
- return v ? te(te({}, Y), {}, {
2409
- x: R(f * 2, Y.x, k),
2410
- y: R(h / 2, Y.y, k)
2411
- }) : te(te({}, Y), {}, {
2412
- x: Y.x,
2413
- y: Y.y
2414
- });
2415
- });
2416
- return n.current = Ye, /* @__PURE__ */ o.createElement(Nr, {
2417
- props: r,
2418
- points: Ye,
2419
- clipPathId: t,
2420
- pathRef: a,
2421
- strokeDasharray: M
2422
- });
2423
- }
2424
- return /* @__PURE__ */ o.createElement(Nr, {
2425
- props: r,
2426
- points: l,
2427
- clipPathId: t,
2428
- pathRef: a,
2429
- strokeDasharray: M
2430
- });
2431
- }), /* @__PURE__ */ o.createElement(Ze, {
2432
- label: r.label
2433
- }));
2434
- }
2435
- function ps(e) {
2436
- var {
2437
- clipPathId: t,
2438
- props: r
2439
- } = e, a = Z(null), n = Z(0), i = Z(null);
2440
- return /* @__PURE__ */ o.createElement(vs, {
2441
- props: r,
2442
- clipPathId: t,
2443
- previousPointsRef: a,
2444
- longestAnimatedLengthRef: n,
2445
- pathRef: i
2446
- });
2447
- }
2448
- var fs = (e, t) => {
2449
- var r, a;
2450
- return {
2451
- x: (r = e.x) !== null && r !== void 0 ? r : void 0,
2452
- y: (a = e.y) !== null && a !== void 0 ? a : void 0,
2453
- value: e.value,
2454
- // @ts-expect-error getValueByDataKey does not validate the output type
2455
- errorVal: K(e.payload, t)
2456
- };
2457
- };
2458
- class ms extends Ha {
2459
- render() {
2460
- var {
2461
- hide: t,
2462
- dot: r,
2463
- points: a,
2464
- className: n,
2465
- xAxisId: i,
2466
- yAxisId: l,
2467
- top: s,
2468
- left: c,
2469
- width: d,
2470
- height: p,
2471
- id: u,
2472
- needClip: v,
2473
- zIndex: f
2474
- } = this.props;
2475
- if (t)
2476
- return null;
2477
- var h = W("recharts-line", n), g = u, {
2478
- r: y,
2479
- strokeWidth: m
2480
- } = La(r), x = zt(r), P = y * 2 + m, O = v ? "url(#clipPath-".concat(x ? "" : "dots-").concat(g, ")") : void 0;
2481
- return /* @__PURE__ */ o.createElement(X, {
2482
- zIndex: f
2483
- }, /* @__PURE__ */ o.createElement(L, {
2484
- className: h
2485
- }, v && /* @__PURE__ */ o.createElement("defs", null, /* @__PURE__ */ o.createElement(Xt, {
2486
- clipPathId: g,
2487
- xAxisId: i,
2488
- yAxisId: l
2489
- }), !x && /* @__PURE__ */ o.createElement("clipPath", {
2490
- id: "clipPath-dots-".concat(g)
2491
- }, /* @__PURE__ */ o.createElement("rect", {
2492
- x: c - P / 2,
2493
- y: s - P / 2,
2494
- width: d + P,
2495
- height: p + P
2496
- }))), /* @__PURE__ */ o.createElement(pa, {
2497
- xAxisId: i,
2498
- yAxisId: l,
2499
- data: a,
2500
- dataPointFormatter: fs,
2501
- errorBarOffset: 0
2502
- }, /* @__PURE__ */ o.createElement(ps, {
2503
- props: this.props,
2504
- clipPathId: g
2505
- }))), /* @__PURE__ */ o.createElement(rt, {
2506
- activeDot: this.props.activeDot,
2507
- points: a,
2508
- mainColor: this.props.stroke,
2509
- itemDataKey: this.props.dataKey,
2510
- clipPath: O
2511
- }));
2512
- }
2513
- }
2514
- var Ta = {
2515
- activeDot: !0,
2516
- animateNewValues: !0,
2517
- animationBegin: 0,
2518
- animationDuration: 1500,
2519
- animationEasing: "ease",
2520
- connectNulls: !1,
2521
- dot: !0,
2522
- fill: "#fff",
2523
- hide: !1,
2524
- isAnimationActive: "auto",
2525
- label: !1,
2526
- legendType: "line",
2527
- stroke: "#3182bd",
2528
- strokeWidth: 1,
2529
- xAxisId: 0,
2530
- yAxisId: 0,
2531
- zIndex: ae.line,
2532
- type: "linear"
2533
- };
2534
- function ys(e) {
2535
- var t = z(e, Ta), {
2536
- activeDot: r,
2537
- animateNewValues: a,
2538
- animationBegin: n,
2539
- animationDuration: i,
2540
- animationEasing: l,
2541
- connectNulls: s,
2542
- dot: c,
2543
- hide: d,
2544
- isAnimationActive: p,
2545
- label: u,
2546
- legendType: v,
2547
- xAxisId: f,
2548
- yAxisId: h,
2549
- id: g
2550
- } = t, y = or(t, es), {
2551
- needClip: m
2552
- } = Zt(f, h), x = da(), P = va(), O = ue(), I = $((D) => Uo(D, f, h, O, g));
2553
- if (P !== "horizontal" && P !== "vertical" || I == null || x == null)
2554
- return null;
2555
- var {
2556
- height: A,
2557
- width: j,
2558
- x: E,
2559
- y: S
2560
- } = x;
2561
- return /* @__PURE__ */ o.createElement(ms, Me({}, y, {
2562
- id: g,
2563
- connectNulls: s,
2564
- dot: c,
2565
- activeDot: r,
2566
- animateNewValues: a,
2567
- animationBegin: n,
2568
- animationDuration: i,
2569
- animationEasing: l,
2570
- isAnimationActive: p,
2571
- hide: d,
2572
- label: u,
2573
- legendType: v,
2574
- xAxisId: f,
2575
- yAxisId: h,
2576
- points: I,
2577
- layout: P,
2578
- height: A,
2579
- width: j,
2580
- left: E,
2581
- top: S,
2582
- needClip: m
2583
- }));
2584
- }
2585
- function hs(e) {
2586
- var {
2587
- layout: t,
2588
- xAxis: r,
2589
- yAxis: a,
2590
- xAxisTicks: n,
2591
- yAxisTicks: i,
2592
- dataKey: l,
2593
- bandSize: s,
2594
- displayedData: c
2595
- } = e;
2596
- return c.map((d, p) => {
2597
- var u = K(d, l);
2598
- if (t === "horizontal") {
2599
- var v = Ae({
2600
- axis: r,
2601
- ticks: n,
2602
- bandSize: s,
2603
- entry: d,
2604
- index: p
2605
- }), f = H(u) ? null : a.scale.map(u);
2606
- return {
2607
- x: v,
2608
- y: f ?? null,
2609
- value: u,
2610
- payload: d
2611
- };
2612
- }
2613
- var h = H(u) ? null : r.scale.map(u), g = Ae({
2614
- axis: a,
2615
- ticks: i,
2616
- bandSize: s,
2617
- entry: d,
2618
- index: p
2619
- });
2620
- return h == null || g == null ? null : {
2621
- x: h,
2622
- y: g,
2623
- value: u,
2624
- payload: d
2625
- };
2626
- }).filter(Boolean);
2627
- }
2628
- function gs(e) {
2629
- var t = z(e, Ta), r = ue();
2630
- return /* @__PURE__ */ o.createElement(Fe, {
2631
- id: t.id,
2632
- type: "line"
2633
- }, (a) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Gt, {
2634
- legendPayload: is(t)
2635
- }), /* @__PURE__ */ o.createElement(ls, {
2636
- dataKey: t.dataKey,
2637
- data: t.data,
2638
- stroke: t.stroke,
2639
- strokeWidth: t.strokeWidth,
2640
- fill: t.fill,
2641
- name: t.name,
2642
- hide: t.hide,
2643
- unit: t.unit,
2644
- tooltipType: t.tooltipType,
2645
- id: a
2646
- }), /* @__PURE__ */ o.createElement(qt, {
2647
- type: "line",
2648
- id: a,
2649
- data: t.data,
2650
- xAxisId: t.xAxisId,
2651
- yAxisId: t.yAxisId,
2652
- zAxisId: 0,
2653
- dataKey: t.dataKey,
2654
- hide: t.hide,
2655
- isPanorama: r
2656
- }), /* @__PURE__ */ o.createElement(ys, Me({}, t, {
2657
- id: a
2658
- }))));
2659
- }
2660
- var Dt = /* @__PURE__ */ o.memo(gs, Vt);
2661
- Dt.displayName = "Line";
2662
- var Ra = (e, t, r) => Ee(e, "xAxis", Yt(e, t), r), $a = (e, t, r) => je(e, "xAxis", Yt(e, t), r), Na = (e, t, r) => Ee(e, "yAxis", Ht(e, t), r), Ka = (e, t, r) => je(e, "yAxis", Ht(e, t), r), bs = w([ee, Ra, Na, $a, Ka], (e, t, r, a, n) => ut(e, "xAxis") ? Pe(t, a, !1) : Pe(r, n, !1)), xs = (e, t) => t, Ba = w([Ft, xs], (e, t) => e.filter((r) => r.type === "area").find((r) => r.id === t)), Ma = (e) => {
2663
- var t = ee(e), r = ut(t, "xAxis");
2664
- return r ? "yAxis" : "xAxis";
2665
- }, Ps = (e, t) => {
2666
- var r = Ma(e);
2667
- return r === "yAxis" ? Ht(e, t) : Yt(e, t);
2668
- }, As = (e, t, r) => Fn(e, Ma(e), Ps(e, t), r), Os = w([Ba, As], (e, t) => {
2669
- var r;
2670
- if (!(e == null || t == null)) {
2671
- var {
2672
- stackId: a
2673
- } = e, n = zn(e);
2674
- if (!(a == null || n == null)) {
2675
- var i = (r = t[a]) === null || r === void 0 ? void 0 : r.stackedData, l = i?.find((s) => s.key === n);
2676
- if (l != null)
2677
- return l.map((s) => [s[0], s[1]]);
2678
- }
2679
- }
2680
- }), Es = w([ee, Ra, Na, $a, Ka, Os, Mn, bs, Ba, Wn], (e, t, r, a, n, i, l, s, c, d) => {
2681
- var {
2682
- chartData: p,
2683
- dataStartIndex: u,
2684
- dataEndIndex: v
2685
- } = l;
2686
- if (!(c == null || e !== "horizontal" && e !== "vertical" || t == null || r == null || a == null || n == null || a.length === 0 || n.length === 0 || s == null)) {
2687
- var {
2688
- data: f
2689
- } = c, h;
2690
- if (f && f.length > 0 ? h = f : h = p?.slice(u, v + 1), h != null)
2691
- return Fs({
2692
- layout: e,
2693
- xAxis: t,
2694
- yAxis: r,
2695
- xAxisTicks: a,
2696
- yAxisTicks: n,
2697
- dataStartIndex: u,
2698
- areaSettings: c,
2699
- stackedData: i,
2700
- displayedData: h,
2701
- chartBaseValue: d,
2702
- bandSize: s
2703
- });
2704
- }
2705
- }), js = ["id"], Is = ["activeDot", "animationBegin", "animationDuration", "animationEasing", "connectNulls", "dot", "fill", "fillOpacity", "hide", "isAnimationActive", "legendType", "stroke", "xAxisId", "yAxisId"];
2706
- function ve() {
2707
- return ve = Object.assign ? Object.assign.bind() : function(e) {
2708
- for (var t = 1; t < arguments.length; t++) {
2709
- var r = arguments[t];
2710
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
2711
- }
2712
- return e;
2713
- }, ve.apply(null, arguments);
2714
- }
2715
- function Wa(e, t) {
2716
- if (e == null) return {};
2717
- var r, a, n = ws(e, t);
2718
- if (Object.getOwnPropertySymbols) {
2719
- var i = Object.getOwnPropertySymbols(e);
2720
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
2721
- }
2722
- return n;
2723
- }
2724
- function ws(e, t) {
2725
- if (e == null) return {};
2726
- var r = {};
2727
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
2728
- if (t.indexOf(a) !== -1) continue;
2729
- r[a] = e[a];
2730
- }
2731
- return r;
2732
- }
2733
- function Kr(e, t) {
2734
- var r = Object.keys(e);
2735
- if (Object.getOwnPropertySymbols) {
2736
- var a = Object.getOwnPropertySymbols(e);
2737
- t && (a = a.filter(function(n) {
2738
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
2739
- })), r.push.apply(r, a);
2740
- }
2741
- return r;
2742
- }
2743
- function xe(e) {
2744
- for (var t = 1; t < arguments.length; t++) {
2745
- var r = arguments[t] != null ? arguments[t] : {};
2746
- t % 2 ? Kr(Object(r), !0).forEach(function(a) {
2747
- Ss(e, a, r[a]);
2748
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Kr(Object(r)).forEach(function(a) {
2749
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
2750
- });
2751
- }
2752
- return e;
2753
- }
2754
- function Ss(e, t, r) {
2755
- return (t = ks(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
2756
- }
2757
- function ks(e) {
2758
- var t = Ds(e, "string");
2759
- return typeof t == "symbol" ? t : t + "";
2760
- }
2761
- function Ds(e, t) {
2762
- if (typeof e != "object" || !e) return e;
2763
- var r = e[Symbol.toPrimitive];
2764
- if (r !== void 0) {
2765
- var a = r.call(e, t);
2766
- if (typeof a != "object") return a;
2767
- throw new TypeError("@@toPrimitive must return a primitive value.");
2768
- }
2769
- return (t === "string" ? String : Number)(e);
2770
- }
2771
- function nt(e, t) {
2772
- return e && e !== "none" ? e : t;
2773
- }
2774
- var _s = (e) => {
2775
- var {
2776
- dataKey: t,
2777
- name: r,
2778
- stroke: a,
2779
- fill: n,
2780
- legendType: i,
2781
- hide: l
2782
- } = e;
2783
- return [{
2784
- inactive: l,
2785
- dataKey: t,
2786
- type: i,
2787
- color: nt(a, n),
2788
- value: ne(r, t),
2789
- payload: e
2790
- }];
2791
- }, Ls = /* @__PURE__ */ o.memo((e) => {
2792
- var {
2793
- dataKey: t,
2794
- data: r,
2795
- stroke: a,
2796
- strokeWidth: n,
2797
- fill: i,
2798
- name: l,
2799
- hide: s,
2800
- unit: c,
2801
- tooltipType: d,
2802
- id: p
2803
- } = e, u = {
2804
- dataDefinedOnItem: r,
2805
- getPosition: ze,
2806
- settings: {
2807
- stroke: a,
2808
- strokeWidth: n,
2809
- fill: i,
2810
- dataKey: t,
2811
- nameKey: void 0,
2812
- name: ne(l, t),
2813
- hide: s,
2814
- type: d,
2815
- color: nt(a, i),
2816
- unit: c,
2817
- graphicalItemId: p
2818
- }
2819
- };
2820
- return /* @__PURE__ */ o.createElement(Ve, {
2821
- tooltipEntrySettings: u
2822
- });
2823
- });
2824
- function Cs(e) {
2825
- var {
2826
- clipPathId: t,
2827
- points: r,
2828
- props: a
2829
- } = e, {
2830
- needClip: n,
2831
- dot: i,
2832
- dataKey: l
2833
- } = a, s = N(a);
2834
- return /* @__PURE__ */ o.createElement(ir, {
2835
- points: r,
2836
- dot: i,
2837
- className: "recharts-area-dots",
2838
- dotClassName: "recharts-area-dot",
2839
- dataKey: l,
2840
- baseProps: s,
2841
- needClip: n,
2842
- clipPathId: t
2843
- });
2844
- }
2845
- function Ts(e) {
2846
- var {
2847
- showLabels: t,
2848
- children: r,
2849
- points: a
2850
- } = e, n = a.map((i) => {
2851
- var l, s, c = {
2852
- x: (l = i.x) !== null && l !== void 0 ? l : 0,
2853
- y: (s = i.y) !== null && s !== void 0 ? s : 0,
2854
- width: 0,
2855
- lowerWidth: 0,
2856
- upperWidth: 0,
2857
- height: 0
2858
- };
2859
- return xe(xe({}, c), {}, {
2860
- value: i.value,
2861
- payload: i.payload,
2862
- parentViewBox: void 0,
2863
- viewBox: c,
2864
- fill: void 0
2865
- });
2866
- });
2867
- return /* @__PURE__ */ o.createElement(dt, {
2868
- value: t ? n : void 0
2869
- }, r);
2870
- }
2871
- function Br(e) {
2872
- var {
2873
- points: t,
2874
- baseLine: r,
2875
- needClip: a,
2876
- clipPathId: n,
2877
- props: i
2878
- } = e, {
2879
- layout: l,
2880
- type: s,
2881
- stroke: c,
2882
- connectNulls: d,
2883
- isRange: p
2884
- } = i, {
2885
- id: u
2886
- } = i, v = Wa(i, js), f = N(v), h = de(v);
2887
- return /* @__PURE__ */ o.createElement(o.Fragment, null, t?.length > 1 && /* @__PURE__ */ o.createElement(L, {
2888
- clipPath: a ? "url(#clipPath-".concat(n, ")") : void 0
2889
- }, /* @__PURE__ */ o.createElement(Re, ve({}, h, {
2890
- id: u,
2891
- points: t,
2892
- connectNulls: d,
2893
- type: s,
2894
- baseLine: r,
2895
- layout: l,
2896
- stroke: "none",
2897
- className: "recharts-area-area"
2898
- })), c !== "none" && /* @__PURE__ */ o.createElement(Re, ve({}, f, {
2899
- className: "recharts-area-curve",
2900
- layout: l,
2901
- type: s,
2902
- connectNulls: d,
2903
- fill: "none",
2904
- points: t
2905
- })), c !== "none" && p && /* @__PURE__ */ o.createElement(Re, ve({}, f, {
2906
- className: "recharts-area-curve",
2907
- layout: l,
2908
- type: s,
2909
- connectNulls: d,
2910
- fill: "none",
2911
- points: r
2912
- }))), /* @__PURE__ */ o.createElement(Cs, {
2913
- points: t,
2914
- props: v,
2915
- clipPathId: n
2916
- }));
2917
- }
2918
- function Rs(e) {
2919
- var t, r, {
2920
- alpha: a,
2921
- baseLine: n,
2922
- points: i,
2923
- strokeWidth: l
2924
- } = e, s = (t = i[0]) === null || t === void 0 ? void 0 : t.y, c = (r = i[i.length - 1]) === null || r === void 0 ? void 0 : r.y;
2925
- if (!et(s) || !et(c))
2926
- return null;
2927
- var d = a * Math.abs(s - c), p = Math.max(...i.map((u) => u.x || 0));
2928
- return Q(n) ? p = Math.max(n, p) : n && Array.isArray(n) && n.length && (p = Math.max(...n.map((u) => u.x || 0), p)), Q(p) ? /* @__PURE__ */ o.createElement("rect", {
2929
- x: 0,
2930
- y: s < c ? s : s - d,
2931
- width: p + (l ? parseInt("".concat(l), 10) : 1),
2932
- height: Math.floor(d)
2933
- }) : null;
2934
- }
2935
- function $s(e) {
2936
- var t, r, {
2937
- alpha: a,
2938
- baseLine: n,
2939
- points: i,
2940
- strokeWidth: l
2941
- } = e, s = (t = i[0]) === null || t === void 0 ? void 0 : t.x, c = (r = i[i.length - 1]) === null || r === void 0 ? void 0 : r.x;
2942
- if (!et(s) || !et(c))
2943
- return null;
2944
- var d = a * Math.abs(s - c), p = Math.max(...i.map((u) => u.y || 0));
2945
- return Q(n) ? p = Math.max(n, p) : n && Array.isArray(n) && n.length && (p = Math.max(...n.map((u) => u.y || 0), p)), Q(p) ? /* @__PURE__ */ o.createElement("rect", {
2946
- x: s < c ? s : s - d,
2947
- y: 0,
2948
- width: d,
2949
- height: Math.floor(p + (l ? parseInt("".concat(l), 10) : 1))
2950
- }) : null;
2951
- }
2952
- function Ns(e) {
2953
- var {
2954
- alpha: t,
2955
- layout: r,
2956
- points: a,
2957
- baseLine: n,
2958
- strokeWidth: i
2959
- } = e;
2960
- return r === "vertical" ? /* @__PURE__ */ o.createElement(Rs, {
2961
- alpha: t,
2962
- points: a,
2963
- baseLine: n,
2964
- strokeWidth: i
2965
- }) : /* @__PURE__ */ o.createElement($s, {
2966
- alpha: t,
2967
- points: a,
2968
- baseLine: n,
2969
- strokeWidth: i
2970
- });
2971
- }
2972
- function Ks(e) {
2973
- var {
2974
- needClip: t,
2975
- clipPathId: r,
2976
- props: a,
2977
- previousPointsRef: n,
2978
- previousBaselineRef: i
2979
- } = e, {
2980
- points: l,
2981
- baseLine: s,
2982
- isAnimationActive: c,
2983
- animationBegin: d,
2984
- animationDuration: p,
2985
- animationEasing: u,
2986
- onAnimationStart: v,
2987
- onAnimationEnd: f
2988
- } = a, h = le(() => ({
2989
- points: l,
2990
- baseLine: s
2991
- }), [l, s]), g = Ge(h, "recharts-area-"), y = qn(), [m, x] = We(!1), P = !m, O = re(() => {
2992
- typeof f == "function" && f(), x(!1);
2993
- }, [f]), I = re(() => {
2994
- typeof v == "function" && v(), x(!0);
2995
- }, [v]);
2996
- if (y == null)
2997
- return null;
2998
- var A = n.current, j = i.current;
2999
- return /* @__PURE__ */ o.createElement(Ts, {
3000
- showLabels: P,
3001
- points: l
3002
- }, a.children, /* @__PURE__ */ o.createElement(qe, {
3003
- animationId: g,
3004
- begin: d,
3005
- duration: p,
3006
- isActive: c,
3007
- easing: u,
3008
- onAnimationEnd: O,
3009
- onAnimationStart: I,
3010
- key: g
3011
- }, (E) => {
3012
- if (A) {
3013
- var S = A.length / l.length, D = (
3014
- /*
3015
- * Here it is important that at the very end of the animation, on the last frame,
3016
- * we render the original points without any interpolation.
3017
- * This is needed because the code above is checking for reference equality to decide if the animation should run
3018
- * and if we create a new array instance (even if the numbers were the same)
3019
- * then we would break animations.
3020
- */
3021
- E === 1 ? l : l.map((k, C) => {
3022
- var B = Math.floor(C * S);
3023
- if (A[B]) {
3024
- var M = A[B];
3025
- return xe(xe({}, k), {}, {
3026
- x: R(M.x, k.x, E),
3027
- y: R(M.y, k.y, E)
3028
- });
3029
- }
3030
- return k;
3031
- })
3032
- ), _;
3033
- return Q(s) ? _ = R(j, s, E) : H(s) || Zn(s) ? _ = R(j, 0, E) : _ = s.map((k, C) => {
3034
- var B = Math.floor(C * S);
3035
- if (Array.isArray(j) && j[B]) {
3036
- var M = j[B];
3037
- return xe(xe({}, k), {}, {
3038
- x: R(M.x, k.x, E),
3039
- y: R(M.y, k.y, E)
3040
- });
3041
- }
3042
- return k;
3043
- }), E > 0 && (n.current = D, i.current = _), /* @__PURE__ */ o.createElement(Br, {
3044
- points: D,
3045
- baseLine: _,
3046
- needClip: t,
3047
- clipPathId: r,
3048
- props: a
3049
- });
3050
- }
3051
- return E > 0 && (n.current = l, i.current = s), /* @__PURE__ */ o.createElement(L, null, c && /* @__PURE__ */ o.createElement("defs", null, /* @__PURE__ */ o.createElement("clipPath", {
3052
- id: "animationClipPath-".concat(r)
3053
- }, /* @__PURE__ */ o.createElement(Ns, {
3054
- alpha: E,
3055
- points: l,
3056
- baseLine: s,
3057
- layout: y,
3058
- strokeWidth: a.strokeWidth
3059
- }))), /* @__PURE__ */ o.createElement(L, {
3060
- clipPath: "url(#animationClipPath-".concat(r, ")")
3061
- }, /* @__PURE__ */ o.createElement(Br, {
3062
- points: l,
3063
- baseLine: s,
3064
- needClip: t,
3065
- clipPathId: r,
3066
- props: a
3067
- })));
3068
- }), /* @__PURE__ */ o.createElement(Ze, {
3069
- label: a.label
3070
- }));
3071
- }
3072
- function Bs(e) {
3073
- var {
3074
- needClip: t,
3075
- clipPathId: r,
3076
- props: a
3077
- } = e, n = Z(null), i = Z();
3078
- return /* @__PURE__ */ o.createElement(Ks, {
3079
- needClip: t,
3080
- clipPathId: r,
3081
- props: a,
3082
- previousPointsRef: n,
3083
- previousBaselineRef: i
3084
- });
3085
- }
3086
- class Ms extends Ua {
3087
- render() {
3088
- var {
3089
- hide: t,
3090
- dot: r,
3091
- points: a,
3092
- className: n,
3093
- top: i,
3094
- left: l,
3095
- needClip: s,
3096
- xAxisId: c,
3097
- yAxisId: d,
3098
- width: p,
3099
- height: u,
3100
- id: v,
3101
- baseLine: f,
3102
- zIndex: h
3103
- } = this.props;
3104
- if (t)
3105
- return null;
3106
- var g = W("recharts-area", n), y = v, {
3107
- r: m,
3108
- strokeWidth: x
3109
- } = La(r), P = zt(r), O = m * 2 + x, I = s ? "url(#clipPath-".concat(P ? "" : "dots-").concat(y, ")") : void 0;
3110
- return /* @__PURE__ */ o.createElement(X, {
3111
- zIndex: h
3112
- }, /* @__PURE__ */ o.createElement(L, {
3113
- className: g
3114
- }, s && /* @__PURE__ */ o.createElement("defs", null, /* @__PURE__ */ o.createElement(Xt, {
3115
- clipPathId: y,
3116
- xAxisId: c,
3117
- yAxisId: d
3118
- }), !P && /* @__PURE__ */ o.createElement("clipPath", {
3119
- id: "clipPath-dots-".concat(y)
3120
- }, /* @__PURE__ */ o.createElement("rect", {
3121
- x: l - O / 2,
3122
- y: i - O / 2,
3123
- width: p + O,
3124
- height: u + O
3125
- }))), /* @__PURE__ */ o.createElement(Bs, {
3126
- needClip: s,
3127
- clipPathId: y,
3128
- props: this.props
3129
- })), /* @__PURE__ */ o.createElement(rt, {
3130
- points: a,
3131
- mainColor: nt(this.props.stroke, this.props.fill),
3132
- itemDataKey: this.props.dataKey,
3133
- activeDot: this.props.activeDot,
3134
- clipPath: I
3135
- }), this.props.isRange && Array.isArray(f) && /* @__PURE__ */ o.createElement(rt, {
3136
- points: f,
3137
- mainColor: nt(this.props.stroke, this.props.fill),
3138
- itemDataKey: this.props.dataKey,
3139
- activeDot: this.props.activeDot,
3140
- clipPath: I
3141
- }));
3142
- }
3143
- }
3144
- var za = {
3145
- activeDot: !0,
3146
- animationBegin: 0,
3147
- animationDuration: 1500,
3148
- animationEasing: "ease",
3149
- connectNulls: !1,
3150
- dot: !1,
3151
- fill: "#3182bd",
3152
- fillOpacity: 0.6,
3153
- hide: !1,
3154
- isAnimationActive: "auto",
3155
- legendType: "line",
3156
- stroke: "#3182bd",
3157
- strokeWidth: 1,
3158
- type: "linear",
3159
- label: !1,
3160
- xAxisId: 0,
3161
- yAxisId: 0,
3162
- zIndex: ae.area
3163
- };
3164
- function Ws(e) {
3165
- var t, r = z(e, za), {
3166
- activeDot: a,
3167
- animationBegin: n,
3168
- animationDuration: i,
3169
- animationEasing: l,
3170
- connectNulls: s,
3171
- dot: c,
3172
- fill: d,
3173
- fillOpacity: p,
3174
- hide: u,
3175
- isAnimationActive: v,
3176
- legendType: f,
3177
- stroke: h,
3178
- xAxisId: g,
3179
- yAxisId: y
3180
- } = r, m = Wa(r, Is), x = va(), P = Gn(), {
3181
- needClip: O
3182
- } = Zt(g, y), I = ue(), {
3183
- points: A,
3184
- isRange: j,
3185
- baseLine: E
3186
- } = (t = $((B) => Es(B, e.id, I))) !== null && t !== void 0 ? t : {}, S = da();
3187
- if (x !== "horizontal" && x !== "vertical" || S == null || P !== "AreaChart" && P !== "ComposedChart")
3188
- return null;
3189
- var {
3190
- height: D,
3191
- width: _,
3192
- x: k,
3193
- y: C
3194
- } = S;
3195
- return !A || !A.length ? null : /* @__PURE__ */ o.createElement(Ms, ve({}, m, {
3196
- activeDot: a,
3197
- animationBegin: n,
3198
- animationDuration: i,
3199
- animationEasing: l,
3200
- baseLine: E,
3201
- connectNulls: s,
3202
- dot: c,
3203
- fill: d,
3204
- fillOpacity: p,
3205
- height: D,
3206
- hide: u,
3207
- layout: x,
3208
- isAnimationActive: v === "auto" ? !Xn.isSsr : v,
3209
- isRange: j,
3210
- legendType: f,
3211
- needClip: O,
3212
- points: A,
3213
- stroke: h,
3214
- width: _,
3215
- left: k,
3216
- top: C,
3217
- xAxisId: g,
3218
- yAxisId: y
3219
- }));
3220
- }
3221
- var zs = (e, t, r, a, n) => {
3222
- var i = r ?? t;
3223
- if (Q(i))
3224
- return i;
3225
- var l = e === "horizontal" ? n : a, s = l.scale.domain();
3226
- if (l.type === "number") {
3227
- var c = Math.max(s[0], s[1]), d = Math.min(s[0], s[1]);
3228
- return i === "dataMin" ? d : i === "dataMax" || c < 0 ? c : Math.max(Math.min(s[0], s[1]), 0);
3229
- }
3230
- return i === "dataMin" ? s[0] : i === "dataMax" ? s[1] : s[0];
3231
- };
3232
- function Fs(e) {
3233
- var {
3234
- areaSettings: {
3235
- connectNulls: t,
3236
- baseValue: r,
3237
- dataKey: a
3238
- },
3239
- stackedData: n,
3240
- layout: i,
3241
- chartBaseValue: l,
3242
- xAxis: s,
3243
- yAxis: c,
3244
- displayedData: d,
3245
- dataStartIndex: p,
3246
- xAxisTicks: u,
3247
- yAxisTicks: v,
3248
- bandSize: f
3249
- } = e, h = n && n.length, g = zs(i, l, r, s, c), y = i === "horizontal", m = !1, x = d.map((O, I) => {
3250
- var A, j, E, S;
3251
- if (h)
3252
- S = n[p + I];
3253
- else {
3254
- var D = K(O, a);
3255
- Array.isArray(D) ? (S = D, m = !0) : S = [g, D];
3256
- }
3257
- var _ = (A = (j = S) === null || j === void 0 ? void 0 : j[1]) !== null && A !== void 0 ? A : null, k = _ == null || h && !t && K(O, a) == null;
3258
- if (y) {
3259
- var C;
3260
- return {
3261
- x: Ae({
3262
- axis: s,
3263
- ticks: u,
3264
- bandSize: f,
3265
- entry: O,
3266
- index: I
3267
- }),
3268
- y: k ? null : (C = c.scale.map(_)) !== null && C !== void 0 ? C : null,
3269
- value: S,
3270
- payload: O
3271
- };
3272
- }
3273
- return {
3274
- x: k ? null : (E = s.scale.map(_)) !== null && E !== void 0 ? E : null,
3275
- y: Ae({
3276
- axis: c,
3277
- ticks: v,
3278
- bandSize: f,
3279
- entry: O,
3280
- index: I
3281
- }),
3282
- value: S,
3283
- payload: O
3284
- };
3285
- }), P;
3286
- return h || m ? P = x.map((O) => {
3287
- var I, A = Array.isArray(O.value) ? O.value[0] : null;
3288
- if (y) {
3289
- var j;
3290
- return {
3291
- x: O.x,
3292
- y: A != null && O.y != null && (j = c.scale.map(A)) !== null && j !== void 0 ? j : null,
3293
- payload: O.payload
3294
- };
3295
- }
3296
- return {
3297
- x: A != null && (I = s.scale.map(A)) !== null && I !== void 0 ? I : null,
3298
- y: O.y,
3299
- payload: O.payload
3300
- };
3301
- }) : P = y ? c.scale.map(g) : s.scale.map(g), {
3302
- points: x,
3303
- baseLine: P ?? 0,
3304
- isRange: m
3305
- };
3306
- }
3307
- function Vs(e) {
3308
- var t = z(e, za), r = ue();
3309
- return /* @__PURE__ */ o.createElement(Fe, {
3310
- id: t.id,
3311
- type: "area"
3312
- }, (a) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Gt, {
3313
- legendPayload: _s(t)
3314
- }), /* @__PURE__ */ o.createElement(Ls, {
3315
- dataKey: t.dataKey,
3316
- data: t.data,
3317
- stroke: t.stroke,
3318
- strokeWidth: t.strokeWidth,
3319
- fill: t.fill,
3320
- name: t.name,
3321
- hide: t.hide,
3322
- unit: t.unit,
3323
- tooltipType: t.tooltipType,
3324
- id: a
3325
- }), /* @__PURE__ */ o.createElement(qt, {
3326
- type: "area",
3327
- id: a,
3328
- data: t.data,
3329
- dataKey: t.dataKey,
3330
- xAxisId: t.xAxisId,
3331
- yAxisId: t.yAxisId,
3332
- zAxisId: 0,
3333
- stackId: Vn(t.stackId),
3334
- hide: t.hide,
3335
- barSize: void 0,
3336
- baseValue: t.baseValue,
3337
- isPanorama: r,
3338
- connectNulls: t.connectNulls
3339
- }), /* @__PURE__ */ o.createElement(Ws, ve({}, t, {
3340
- id: a
3341
- }))));
3342
- }
3343
- var _t = /* @__PURE__ */ o.memo(Vs, Vt);
3344
- _t.displayName = "Area";
3345
- var Gs = ["option", "isActive"];
3346
- function Ne() {
3347
- return Ne = Object.assign ? Object.assign.bind() : function(e) {
3348
- for (var t = 1; t < arguments.length; t++) {
3349
- var r = arguments[t];
3350
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
3351
- }
3352
- return e;
3353
- }, Ne.apply(null, arguments);
3354
- }
3355
- function qs(e, t) {
3356
- if (e == null) return {};
3357
- var r, a, n = Zs(e, t);
3358
- if (Object.getOwnPropertySymbols) {
3359
- var i = Object.getOwnPropertySymbols(e);
3360
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
3361
- }
3362
- return n;
3363
- }
3364
- function Zs(e, t) {
3365
- if (e == null) return {};
3366
- var r = {};
3367
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
3368
- if (t.indexOf(a) !== -1) continue;
3369
- r[a] = e[a];
3370
- }
3371
- return r;
3372
- }
3373
- function Xs(e) {
3374
- var {
3375
- option: t,
3376
- isActive: r
3377
- } = e, a = qs(e, Gs);
3378
- return typeof t == "string" ? /* @__PURE__ */ o.createElement(Qe, Ne({
3379
- option: /* @__PURE__ */ o.createElement(Yn, Ne({
3380
- type: t
3381
- }, a)),
3382
- isActive: r,
3383
- shapeType: "symbols"
3384
- }, a)) : /* @__PURE__ */ o.createElement(Qe, Ne({
3385
- option: t,
3386
- isActive: r,
3387
- shapeType: "symbols"
3388
- }, a));
3389
- }
3390
- var Ys = (e, t, r, a, n, i, l) => Ee(e, "xAxis", t, l), Hs = (e, t, r, a, n, i, l) => je(e, "xAxis", t, l), Us = (e, t, r, a, n, i, l) => Ee(e, "yAxis", r, l), Js = (e, t, r, a, n, i, l) => je(e, "yAxis", r, l), Qs = (e, t, r, a) => Hn(e, "zAxis", a, !1), ec = (e, t, r, a, n) => n, tc = (e, t, r, a, n, i) => i, rc = (e, t, r, a, n, i, l) => ua(e, void 0, void 0, l), ac = w([Ft, ec], (e, t) => e.filter((r) => r.type === "scatter").find((r) => r.id === t)), nc = w([rc, Ys, Hs, Us, Js, Qs, ac, tc], (e, t, r, a, n, i, l, s) => {
3391
- var {
3392
- chartData: c,
3393
- dataStartIndex: d,
3394
- dataEndIndex: p
3395
- } = e;
3396
- if (l != null) {
3397
- var u;
3398
- if (l?.data != null && l.data.length > 0 ? u = l.data : u = c?.slice(d, p + 1), !(u == null || t == null || a == null || r == null || n == null || r?.length === 0 || n?.length === 0))
3399
- return gc({
3400
- displayedData: u,
3401
- xAxis: t,
3402
- yAxis: a,
3403
- zAxis: i,
3404
- scatterSettings: l,
3405
- xAxisTicks: r,
3406
- yAxisTicks: n,
3407
- cells: s
3408
- });
3409
- }
3410
- }), ic = ["id"], lc = ["onMouseEnter", "onClick", "onMouseLeave"], oc = ["animationBegin", "animationDuration", "animationEasing", "hide", "isAnimationActive", "legendType", "lineJointType", "lineType", "shape", "xAxisId", "yAxisId", "zAxisId"];
3411
- function Lt(e, t) {
3412
- if (e == null) return {};
3413
- var r, a, n = sc(e, t);
3414
- if (Object.getOwnPropertySymbols) {
3415
- var i = Object.getOwnPropertySymbols(e);
3416
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
3417
- }
3418
- return n;
3419
- }
3420
- function sc(e, t) {
3421
- if (e == null) return {};
3422
- var r = {};
3423
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
3424
- if (t.indexOf(a) !== -1) continue;
3425
- r[a] = e[a];
3426
- }
3427
- return r;
3428
- }
3429
- function me() {
3430
- return me = Object.assign ? Object.assign.bind() : function(e) {
3431
- for (var t = 1; t < arguments.length; t++) {
3432
- var r = arguments[t];
3433
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
3434
- }
3435
- return e;
3436
- }, me.apply(null, arguments);
3437
- }
3438
- function Mr(e, t) {
3439
- var r = Object.keys(e);
3440
- if (Object.getOwnPropertySymbols) {
3441
- var a = Object.getOwnPropertySymbols(e);
3442
- t && (a = a.filter(function(n) {
3443
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
3444
- })), r.push.apply(r, a);
3445
- }
3446
- return r;
3447
- }
3448
- function V(e) {
3449
- for (var t = 1; t < arguments.length; t++) {
3450
- var r = arguments[t] != null ? arguments[t] : {};
3451
- t % 2 ? Mr(Object(r), !0).forEach(function(a) {
3452
- cc(e, a, r[a]);
3453
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Mr(Object(r)).forEach(function(a) {
3454
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
3455
- });
3456
- }
3457
- return e;
3458
- }
3459
- function cc(e, t, r) {
3460
- return (t = uc(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
3461
- }
3462
- function uc(e) {
3463
- var t = dc(e, "string");
3464
- return typeof t == "symbol" ? t : t + "";
3465
- }
3466
- function dc(e, t) {
3467
- if (typeof e != "object" || !e) return e;
3468
- var r = e[Symbol.toPrimitive];
3469
- if (r !== void 0) {
3470
- var a = r.call(e, t);
3471
- if (typeof a != "object") return a;
3472
- throw new TypeError("@@toPrimitive must return a primitive value.");
3473
- }
3474
- return (t === "string" ? String : Number)(e);
3475
- }
3476
- var vc = (e) => {
3477
- var {
3478
- dataKey: t,
3479
- name: r,
3480
- fill: a,
3481
- legendType: n,
3482
- hide: i
3483
- } = e;
3484
- return [{
3485
- inactive: i,
3486
- dataKey: t,
3487
- type: n,
3488
- color: a,
3489
- value: ne(r, t),
3490
- payload: e
3491
- }];
3492
- }, pc = /* @__PURE__ */ o.memo((e) => {
3493
- var {
3494
- dataKey: t,
3495
- points: r,
3496
- stroke: a,
3497
- strokeWidth: n,
3498
- fill: i,
3499
- name: l,
3500
- hide: s,
3501
- tooltipType: c,
3502
- id: d
3503
- } = e, p = {
3504
- dataDefinedOnItem: r?.map((u) => u.tooltipPayload),
3505
- getPosition: (u) => {
3506
- var v;
3507
- return r == null || (v = r[Number(u)]) === null || v === void 0 ? void 0 : v.tooltipPosition;
3508
- },
3509
- settings: {
3510
- stroke: a,
3511
- strokeWidth: n,
3512
- fill: i,
3513
- nameKey: void 0,
3514
- dataKey: t,
3515
- name: ne(l, t),
3516
- hide: s,
3517
- type: c,
3518
- color: i,
3519
- unit: "",
3520
- // why doesn't Scatter support unit?
3521
- graphicalItemId: d
3522
- }
3523
- };
3524
- return /* @__PURE__ */ o.createElement(Ve, {
3525
- tooltipEntrySettings: p
3526
- });
3527
- });
3528
- function fc(e) {
3529
- var {
3530
- points: t,
3531
- props: r
3532
- } = e, {
3533
- line: a,
3534
- lineType: n,
3535
- lineJointType: i
3536
- } = r;
3537
- if (!a)
3538
- return null;
3539
- var l = N(r), s = pe(a), c, d;
3540
- if (n === "joint")
3541
- c = t.map((y) => {
3542
- var m, x;
3543
- return {
3544
- x: (m = y.cx) !== null && m !== void 0 ? m : null,
3545
- y: (x = y.cy) !== null && x !== void 0 ? x : null
3546
- };
3547
- });
3548
- else if (n === "fitting") {
3549
- var {
3550
- xmin: p,
3551
- xmax: u,
3552
- a: v,
3553
- b: f
3554
- } = Qn(t), h = (y) => v * y + f;
3555
- c = [{
3556
- x: p,
3557
- y: h(p)
3558
- }, {
3559
- x: u,
3560
- y: h(u)
3561
- }];
3562
- }
3563
- var g = V(V(V({}, l), {}, {
3564
- // @ts-expect-error customLineProps is contributing unknown props
3565
- fill: "none",
3566
- // @ts-expect-error customLineProps is contributing unknown props
3567
- stroke: l && l.fill
3568
- }, s), {}, {
3569
- // @ts-expect-error linePoints is used before it is assigned (???)
3570
- points: c
3571
- });
3572
- return /* @__PURE__ */ o.isValidElement(a) ? d = /* @__PURE__ */ o.cloneElement(a, g) : typeof a == "function" ? d = a(g) : d = /* @__PURE__ */ o.createElement(Re, me({}, g, {
3573
- type: i
3574
- })), /* @__PURE__ */ o.createElement(L, {
3575
- className: "recharts-scatter-line",
3576
- key: "recharts-scatter-line"
3577
- }, d);
3578
- }
3579
- function mc(e) {
3580
- var {
3581
- showLabels: t,
3582
- points: r,
3583
- children: a
3584
- } = e, n = Un(), i = le(() => r?.map((l) => {
3585
- var s, c, d = {
3586
- /*
3587
- * Scatter label uses x and y as the reference point for the label,
3588
- * not cx and cy.
3589
- */
3590
- x: (s = l.x) !== null && s !== void 0 ? s : 0,
3591
- /*
3592
- * Scatter label uses x and y as the reference point for the label,
3593
- * not cx and cy.
3594
- */
3595
- y: (c = l.y) !== null && c !== void 0 ? c : 0,
3596
- width: l.width,
3597
- height: l.height,
3598
- lowerWidth: l.width,
3599
- upperWidth: l.width
3600
- };
3601
- return V(V({}, d), {}, {
3602
- /*
3603
- * Here we put undefined because Scatter shows two values usually, one for X and one for Y.
3604
- * LabelList will see this undefined and will use its own `dataKey` prop to determine which value to show,
3605
- * using the payload below.
3606
- */
3607
- value: void 0,
3608
- payload: l.payload,
3609
- viewBox: d,
3610
- parentViewBox: n,
3611
- fill: void 0
3612
- });
3613
- }), [n, r]);
3614
- return /* @__PURE__ */ o.createElement(dt, {
3615
- value: t ? i : void 0
3616
- }, a);
3617
- }
3618
- function yc(e) {
3619
- var {
3620
- points: t,
3621
- allOtherScatterProps: r
3622
- } = e, {
3623
- shape: a,
3624
- activeShape: n,
3625
- dataKey: i
3626
- } = r, {
3627
- id: l
3628
- } = r, s = Lt(r, ic), c = $(Wt), {
3629
- onMouseEnter: d,
3630
- onClick: p,
3631
- onMouseLeave: u
3632
- } = r, v = Lt(r, lc), f = la(d, i, l), h = oa(u), g = sa(p, i, l);
3633
- if (!Jn(t))
3634
- return null;
3635
- var y = N(s);
3636
- return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(fc, {
3637
- points: t,
3638
- props: s
3639
- }), t.map((m, x) => {
3640
- var P = n != null && n !== !1, O = P && c === String(x), I = P && O ? n : a, A = V(V(V({}, y), m), {}, {
3641
- index: x,
3642
- [ca]: String(l)
3643
- });
3644
- return /* @__PURE__ */ o.createElement(X, {
3645
- key: "symbol-".concat(m?.cx, "-").concat(m?.cy, "-").concat(m?.size, "-").concat(x),
3646
- zIndex: O ? ae.activeDot : void 0
3647
- }, /* @__PURE__ */ o.createElement(L, me({
3648
- className: "recharts-scatter-symbol"
3649
- }, st(v, m, x), {
3650
- // @ts-expect-error the types need a bit of attention
3651
- onMouseEnter: f(m, x),
3652
- onMouseLeave: h(m, x),
3653
- onClick: g(m, x)
3654
- }), /* @__PURE__ */ o.createElement(Xs, me({
3655
- option: I,
3656
- isActive: O
3657
- }, A))));
3658
- }));
3659
- }
3660
- function hc(e) {
3661
- var {
3662
- previousPointsRef: t,
3663
- props: r
3664
- } = e, {
3665
- points: a,
3666
- isAnimationActive: n,
3667
- animationBegin: i,
3668
- animationDuration: l,
3669
- animationEasing: s
3670
- } = r, c = t.current, d = Ge(r, "recharts-scatter-"), [p, u] = We(!1), v = re(() => {
3671
- u(!1);
3672
- }, []), f = re(() => {
3673
- u(!0);
3674
- }, []), h = !p;
3675
- return /* @__PURE__ */ o.createElement(mc, {
3676
- showLabels: h,
3677
- points: a
3678
- }, r.children, /* @__PURE__ */ o.createElement(qe, {
3679
- animationId: d,
3680
- begin: i,
3681
- duration: l,
3682
- isActive: n,
3683
- easing: s,
3684
- onAnimationEnd: v,
3685
- onAnimationStart: f,
3686
- key: d
3687
- }, (g) => {
3688
- var y = g === 1 ? a : a?.map((m, x) => {
3689
- var P = c && c[x];
3690
- return P ? V(V({}, m), {}, {
3691
- cx: m.cx == null ? void 0 : R(P.cx, m.cx, g),
3692
- cy: m.cy == null ? void 0 : R(P.cy, m.cy, g),
3693
- size: R(P.size, m.size, g)
3694
- }) : V(V({}, m), {}, {
3695
- size: R(0, m.size, g)
3696
- });
3697
- });
3698
- return g > 0 && (t.current = y), /* @__PURE__ */ o.createElement(L, null, /* @__PURE__ */ o.createElement(yc, {
3699
- points: y,
3700
- allOtherScatterProps: r,
3701
- showLabels: h
3702
- }));
3703
- }), /* @__PURE__ */ o.createElement(Ze, {
3704
- label: r.label
3705
- }));
3706
- }
3707
- function gc(e) {
3708
- var {
3709
- displayedData: t,
3710
- xAxis: r,
3711
- yAxis: a,
3712
- zAxis: n,
3713
- scatterSettings: i,
3714
- xAxisTicks: l,
3715
- yAxisTicks: s,
3716
- cells: c
3717
- } = e, d = H(r.dataKey) ? i.dataKey : r.dataKey, p = H(a.dataKey) ? i.dataKey : a.dataKey, u = n && n.dataKey, v = n ? n.range : oe.range, f = v && v[0], h = r.scale.bandwidth ? r.scale.bandwidth() : 0, g = a.scale.bandwidth ? a.scale.bandwidth() : 0;
3718
- return t.map((y, m) => {
3719
- var x = K(y, d), P = K(y, p), O = !H(u) && K(y, u) || "-", I = [{
3720
- name: H(r.dataKey) ? i.name : r.name || String(r.dataKey),
3721
- unit: r.unit || "",
3722
- // @ts-expect-error getValueByDataKey does not validate the output type
3723
- value: x,
3724
- payload: y,
3725
- dataKey: d,
3726
- type: i.tooltipType
3727
- }, {
3728
- name: H(a.dataKey) ? i.name : a.name || String(a.dataKey),
3729
- unit: a.unit || "",
3730
- // @ts-expect-error getValueByDataKey does not validate the output type
3731
- value: P,
3732
- payload: y,
3733
- dataKey: p,
3734
- type: i.tooltipType
3735
- }];
3736
- O !== "-" && n != null && I.push({
3737
- // @ts-expect-error name prop should not have dataKey in it
3738
- name: n.name || n.dataKey,
3739
- unit: n.unit || "",
3740
- // @ts-expect-error getValueByDataKey does not validate the output type
3741
- value: O,
3742
- payload: y,
3743
- dataKey: u,
3744
- type: i.tooltipType
3745
- });
3746
- var A = Ae({
3747
- axis: r,
3748
- ticks: l,
3749
- bandSize: h,
3750
- entry: y,
3751
- index: m,
3752
- dataKey: d
3753
- }), j = Ae({
3754
- axis: a,
3755
- ticks: s,
3756
- bandSize: g,
3757
- entry: y,
3758
- index: m,
3759
- dataKey: p
3760
- }), E = O !== "-" && n != null ? n.scale.map(O) : f, S = E == null ? 0 : Math.sqrt(Math.max(E, 0) / Math.PI);
3761
- return V(V({}, y), {}, {
3762
- cx: A,
3763
- cy: j,
3764
- x: A == null ? void 0 : A - S,
3765
- y: j == null ? void 0 : j - S,
3766
- width: 2 * S,
3767
- height: 2 * S,
3768
- size: E,
3769
- node: {
3770
- x,
3771
- y: P,
3772
- z: O
3773
- },
3774
- tooltipPayload: I,
3775
- tooltipPosition: {
3776
- x: A,
3777
- y: j
3778
- },
3779
- payload: y
3780
- }, c && c[m] && c[m].props);
3781
- });
3782
- }
3783
- var bc = (e, t, r) => ({
3784
- x: e.cx,
3785
- y: e.cy,
3786
- value: Number(r === "x" ? e.node.x : e.node.y),
3787
- // @ts-expect-error getValueByDataKey does not validate the output type
3788
- errorVal: K(e, t)
3789
- });
3790
- function xc(e) {
3791
- var {
3792
- hide: t,
3793
- points: r,
3794
- className: a,
3795
- needClip: n,
3796
- xAxisId: i,
3797
- yAxisId: l,
3798
- id: s
3799
- } = e, c = Z(null);
3800
- if (t)
3801
- return null;
3802
- var d = W("recharts-scatter", a), p = s;
3803
- return /* @__PURE__ */ o.createElement(X, {
3804
- zIndex: e.zIndex
3805
- }, /* @__PURE__ */ o.createElement(L, {
3806
- className: d,
3807
- clipPath: n ? "url(#clipPath-".concat(p, ")") : void 0,
3808
- id: s
3809
- }, n && /* @__PURE__ */ o.createElement("defs", null, /* @__PURE__ */ o.createElement(Xt, {
3810
- clipPathId: p,
3811
- xAxisId: i,
3812
- yAxisId: l
3813
- })), /* @__PURE__ */ o.createElement(pa, {
3814
- xAxisId: i,
3815
- yAxisId: l,
3816
- data: r,
3817
- dataPointFormatter: bc,
3818
- errorBarOffset: 0
3819
- }, /* @__PURE__ */ o.createElement(L, {
3820
- key: "recharts-scatter-symbols"
3821
- }, /* @__PURE__ */ o.createElement(hc, {
3822
- props: e,
3823
- previousPointsRef: c
3824
- })))));
3825
- }
3826
- var Fa = {
3827
- xAxisId: 0,
3828
- yAxisId: 0,
3829
- zAxisId: 0,
3830
- label: !1,
3831
- line: !1,
3832
- legendType: "circle",
3833
- lineType: "joint",
3834
- lineJointType: "linear",
3835
- shape: "circle",
3836
- hide: !1,
3837
- isAnimationActive: "auto",
3838
- animationBegin: 0,
3839
- animationDuration: 400,
3840
- animationEasing: "linear",
3841
- zIndex: ae.scatter
3842
- };
3843
- function Pc(e) {
3844
- var t = z(e, Fa), {
3845
- animationBegin: r,
3846
- animationDuration: a,
3847
- animationEasing: n,
3848
- hide: i,
3849
- isAnimationActive: l,
3850
- legendType: s,
3851
- lineJointType: c,
3852
- lineType: d,
3853
- shape: p,
3854
- xAxisId: u,
3855
- yAxisId: v,
3856
- zAxisId: f
3857
- } = t, h = Lt(t, oc), {
3858
- needClip: g
3859
- } = Zt(u, v), y = le(() => Mt(e.children, ct), [e.children]), m = ue(), x = $((P) => nc(P, u, v, f, e.id, y, m));
3860
- return g == null || x == null ? null : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(pc, {
3861
- dataKey: e.dataKey,
3862
- points: x,
3863
- stroke: e.stroke,
3864
- strokeWidth: e.strokeWidth,
3865
- fill: e.fill,
3866
- name: e.name,
3867
- hide: e.hide,
3868
- tooltipType: e.tooltipType,
3869
- id: e.id
3870
- }), /* @__PURE__ */ o.createElement(xc, me({}, h, {
3871
- xAxisId: u,
3872
- yAxisId: v,
3873
- zAxisId: f,
3874
- lineType: d,
3875
- lineJointType: c,
3876
- legendType: s,
3877
- shape: p,
3878
- hide: i,
3879
- isAnimationActive: l,
3880
- animationBegin: r,
3881
- animationDuration: a,
3882
- animationEasing: n,
3883
- points: x,
3884
- needClip: g
3885
- })));
3886
- }
3887
- function Ac(e) {
3888
- var t = z(e, Fa), r = ue();
3889
- return /* @__PURE__ */ o.createElement(Fe, {
3890
- id: t.id,
3891
- type: "scatter"
3892
- }, (a) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Gt, {
3893
- legendPayload: vc(t)
3894
- }), /* @__PURE__ */ o.createElement(qt, {
3895
- type: "scatter",
3896
- id: a,
3897
- data: t.data,
3898
- xAxisId: t.xAxisId,
3899
- yAxisId: t.yAxisId,
3900
- zAxisId: t.zAxisId,
3901
- dataKey: t.dataKey,
3902
- hide: t.hide,
3903
- name: t.name,
3904
- tooltipType: t.tooltipType,
3905
- isPanorama: r
3906
- }), /* @__PURE__ */ o.createElement(Pc, me({}, t, {
3907
- id: a
3908
- }))));
3909
- }
3910
- var Va = /* @__PURE__ */ o.memo(Ac, Vt);
3911
- Va.displayName = "Scatter";
3912
- function Oc(e) {
3913
- var t = ot(), r = Z(null);
3914
- return dr(() => {
3915
- r.current === null ? t(ei(e)) : r.current !== e && t(ti({
3916
- prev: r.current,
3917
- next: e
3918
- })), r.current = e;
3919
- }, [e, t]), dr(() => () => {
3920
- r.current && (t(ri(r.current)), r.current = null);
3921
- }, [t]), null;
3922
- }
3923
- var Ec = {
3924
- zAxisId: 0,
3925
- range: oe.range,
3926
- scale: oe.scale,
3927
- type: oe.type
3928
- };
3929
- function Ga(e) {
3930
- var t = z(e, Ec);
3931
- return /* @__PURE__ */ o.createElement(Oc, {
3932
- domain: t.domain,
3933
- id: t.zAxisId,
3934
- dataKey: t.dataKey,
3935
- name: t.name,
3936
- unit: t.unit,
3937
- range: t.range,
3938
- scale: t.scale,
3939
- type: t.type,
3940
- allowDuplicatedCategory: oe.allowDuplicatedCategory,
3941
- allowDataOverflow: oe.allowDataOverflow,
3942
- reversed: oe.reversed,
3943
- includeHidden: oe.includeHidden
3944
- });
3945
- }
3946
- Ga.displayName = "ZAxis";
3947
- var jc = ["axis"], Ic = /* @__PURE__ */ Oe((e, t) => /* @__PURE__ */ o.createElement(Ut, {
3948
- chartName: "LineChart",
3949
- defaultTooltipEventType: "axis",
3950
- validateTooltipEventTypes: jc,
3951
- tooltipPayloadSearcher: Xe,
3952
- categoricalChartProps: e,
3953
- ref: t
3954
- }));
3955
- function wc(e) {
3956
- var t = ot();
3957
- return Rt(() => {
3958
- t(ai(e));
3959
- }, [t, e]), null;
3960
- }
3961
- var Sc = ["layout"];
3962
- function Ct() {
3963
- return Ct = Object.assign ? Object.assign.bind() : function(e) {
3964
- for (var t = 1; t < arguments.length; t++) {
3965
- var r = arguments[t];
3966
- for (var a in r) ({}).hasOwnProperty.call(r, a) && (e[a] = r[a]);
3967
- }
3968
- return e;
3969
- }, Ct.apply(null, arguments);
3970
- }
3971
- function kc(e, t) {
3972
- if (e == null) return {};
3973
- var r, a, n = Dc(e, t);
3974
- if (Object.getOwnPropertySymbols) {
3975
- var i = Object.getOwnPropertySymbols(e);
3976
- for (a = 0; a < i.length; a++) r = i[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
3977
- }
3978
- return n;
3979
- }
3980
- function Dc(e, t) {
3981
- if (e == null) return {};
3982
- var r = {};
3983
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
3984
- if (t.indexOf(a) !== -1) continue;
3985
- r[a] = e[a];
3986
- }
3987
- return r;
3988
- }
3989
- var _c = {
3990
- top: 5,
3991
- right: 5,
3992
- bottom: 5,
3993
- left: 5
3994
- }, sr = {
3995
- accessibilityLayer: !0,
3996
- stackOffset: "none",
3997
- barCategoryGap: "10%",
3998
- barGap: 4,
3999
- margin: _c,
4000
- reverseStackOrder: !1,
4001
- syncMethod: "index",
4002
- layout: "radial",
4003
- responsive: !1,
4004
- cx: "50%",
4005
- cy: "50%",
4006
- innerRadius: 0,
4007
- outerRadius: "80%"
4008
- }, qa = /* @__PURE__ */ Oe(function(t, r) {
4009
- var a, n = z(t.categoricalChartProps, sr), {
4010
- layout: i
4011
- } = n, l = kc(n, Sc), {
4012
- chartName: s,
4013
- defaultTooltipEventType: c,
4014
- validateTooltipEventTypes: d,
4015
- tooltipPayloadSearcher: p
4016
- } = t, u = {
4017
- chartName: s,
4018
- defaultTooltipEventType: c,
4019
- validateTooltipEventTypes: d,
4020
- tooltipPayloadSearcher: p,
4021
- eventEmitter: void 0
4022
- };
4023
- return /* @__PURE__ */ o.createElement(ni, {
4024
- preloadedState: {
4025
- options: u
4026
- },
4027
- reduxStoreName: (a = n.id) !== null && a !== void 0 ? a : s
4028
- }, /* @__PURE__ */ o.createElement(ii, {
4029
- chartData: n.data
4030
- }), /* @__PURE__ */ o.createElement(li, {
4031
- layout: i,
4032
- margin: n.margin
4033
- }), /* @__PURE__ */ o.createElement(oi, {
4034
- baseValue: void 0,
4035
- accessibilityLayer: n.accessibilityLayer,
4036
- barCategoryGap: n.barCategoryGap,
4037
- maxBarSize: n.maxBarSize,
4038
- stackOffset: n.stackOffset,
4039
- barGap: n.barGap,
4040
- barSize: n.barSize,
4041
- syncId: n.syncId,
4042
- syncMethod: n.syncMethod,
4043
- className: n.className,
4044
- reverseStackOrder: n.reverseStackOrder
4045
- }), /* @__PURE__ */ o.createElement(wc, {
4046
- cx: n.cx,
4047
- cy: n.cy,
4048
- startAngle: n.startAngle,
4049
- endAngle: n.endAngle,
4050
- innerRadius: n.innerRadius,
4051
- outerRadius: n.outerRadius
4052
- }), /* @__PURE__ */ o.createElement(si, Ct({}, l, {
4053
- ref: r
4054
- })));
4055
- });
4056
- function Wr(e, t) {
4057
- var r = Object.keys(e);
4058
- if (Object.getOwnPropertySymbols) {
4059
- var a = Object.getOwnPropertySymbols(e);
4060
- t && (a = a.filter(function(n) {
4061
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
4062
- })), r.push.apply(r, a);
4063
- }
4064
- return r;
4065
- }
4066
- function zr(e) {
4067
- for (var t = 1; t < arguments.length; t++) {
4068
- var r = arguments[t] != null ? arguments[t] : {};
4069
- t % 2 ? Wr(Object(r), !0).forEach(function(a) {
4070
- Lc(e, a, r[a]);
4071
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Wr(Object(r)).forEach(function(a) {
4072
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
4073
- });
4074
- }
4075
- return e;
4076
- }
4077
- function Lc(e, t, r) {
4078
- return (t = Cc(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
4079
- }
4080
- function Cc(e) {
4081
- var t = Tc(e, "string");
4082
- return typeof t == "symbol" ? t : t + "";
4083
- }
4084
- function Tc(e, t) {
4085
- if (typeof e != "object" || !e) return e;
4086
- var r = e[Symbol.toPrimitive];
4087
- if (r !== void 0) {
4088
- var a = r.call(e, t);
4089
- if (typeof a != "object") return a;
4090
- throw new TypeError("@@toPrimitive must return a primitive value.");
4091
- }
4092
- return (t === "string" ? String : Number)(e);
4093
- }
4094
- var Rc = ["item"], $c = zr(zr({}, sr), {}, {
4095
- layout: "centric",
4096
- startAngle: 0,
4097
- endAngle: 360
4098
- }), wt = /* @__PURE__ */ Oe((e, t) => {
4099
- var r = z(e, $c);
4100
- return /* @__PURE__ */ o.createElement(qa, {
4101
- chartName: "PieChart",
4102
- defaultTooltipEventType: "item",
4103
- validateTooltipEventTypes: Rc,
4104
- tooltipPayloadSearcher: Xe,
4105
- categoricalChartProps: r,
4106
- ref: t
4107
- });
4108
- });
4109
- function Fr(e, t) {
4110
- var r = Object.keys(e);
4111
- if (Object.getOwnPropertySymbols) {
4112
- var a = Object.getOwnPropertySymbols(e);
4113
- t && (a = a.filter(function(n) {
4114
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
4115
- })), r.push.apply(r, a);
4116
- }
4117
- return r;
4118
- }
4119
- function Vr(e) {
4120
- for (var t = 1; t < arguments.length; t++) {
4121
- var r = arguments[t] != null ? arguments[t] : {};
4122
- t % 2 ? Fr(Object(r), !0).forEach(function(a) {
4123
- Nc(e, a, r[a]);
4124
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Fr(Object(r)).forEach(function(a) {
4125
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
4126
- });
4127
- }
4128
- return e;
4129
- }
4130
- function Nc(e, t, r) {
4131
- return (t = Kc(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
4132
- }
4133
- function Kc(e) {
4134
- var t = Bc(e, "string");
4135
- return typeof t == "symbol" ? t : t + "";
4136
- }
4137
- function Bc(e, t) {
4138
- if (typeof e != "object" || !e) return e;
4139
- var r = e[Symbol.toPrimitive];
4140
- if (r !== void 0) {
4141
- var a = r.call(e, t);
4142
- if (typeof a != "object") return a;
4143
- throw new TypeError("@@toPrimitive must return a primitive value.");
4144
- }
4145
- return (t === "string" ? String : Number)(e);
4146
- }
4147
- var Mc = ["axis"], Wc = Vr(Vr({}, sr), {}, {
4148
- layout: "centric",
4149
- startAngle: 90,
4150
- endAngle: -270
4151
- }), Gr = /* @__PURE__ */ Oe((e, t) => {
4152
- var r = z(e, Wc);
4153
- return /* @__PURE__ */ o.createElement(qa, {
4154
- chartName: "RadarChart",
4155
- defaultTooltipEventType: "axis",
4156
- validateTooltipEventTypes: Mc,
4157
- tooltipPayloadSearcher: Xe,
4158
- categoricalChartProps: r,
4159
- ref: t
4160
- });
4161
- }), zc = ["item"], qr = /* @__PURE__ */ Oe((e, t) => /* @__PURE__ */ o.createElement(Ut, {
4162
- chartName: "ScatterChart",
4163
- defaultTooltipEventType: "item",
4164
- validateTooltipEventTypes: zc,
4165
- tooltipPayloadSearcher: Xe,
4166
- categoricalChartProps: e,
4167
- ref: t
4168
- })), Fc = ["axis"], Vc = /* @__PURE__ */ Oe((e, t) => /* @__PURE__ */ o.createElement(Ut, {
4169
- chartName: "AreaChart",
4170
- defaultTooltipEventType: "axis",
4171
- validateTooltipEventTypes: Fc,
4172
- tooltipPayloadSearcher: Xe,
4173
- categoricalChartProps: e,
4174
- ref: t
4175
- }));
4176
- const ie = (...e) => e.filter(Boolean).join(" "), Gc = { light: "", dark: ".dark" }, Za = o.createContext(null);
4177
- function Xa() {
4178
- const e = o.useContext(Za);
4179
- if (!e)
4180
- throw new Error("useChart must be used within a <ChartContainer />");
4181
- return e;
4182
- }
4183
- function Se({
4184
- id: e,
4185
- className: t,
4186
- children: r,
4187
- config: a,
4188
- ...n
4189
- }) {
4190
- const i = o.useId(), l = `chart-${e || i.replace(/:/g, "")}`;
4191
- return /* @__PURE__ */ b.jsx(Za.Provider, { value: { config: a }, children: /* @__PURE__ */ b.jsxs(
4192
- "div",
4193
- {
4194
- "data-slot": "chart",
4195
- "data-chart": l,
4196
- className: ie(
4197
- "flex w-full h-[350px] justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
4198
- t
4199
- ),
4200
- ...n,
4201
- children: [
4202
- /* @__PURE__ */ b.jsx(qc, { id: l, config: a }),
4203
- /* @__PURE__ */ b.jsx(di, { width: "100%", height: "100%", children: r })
4204
- ]
4205
- }
4206
- ) });
4207
- }
4208
- const qc = ({ id: e, config: t }) => {
4209
- const r = Object.entries(t).filter(
4210
- ([, a]) => a.theme || a.color
4211
- );
4212
- return r.length ? /* @__PURE__ */ b.jsx(
4213
- "style",
4214
- {
4215
- dangerouslySetInnerHTML: {
4216
- __html: Object.entries(Gc).map(
4217
- ([a, n]) => `
4218
- ${n} [data-chart=${e}] {
4219
- ${r.map(([i, l]) => {
4220
- const s = l.theme?.[a] || l.color;
4221
- return s ? ` --color-${i}: ${s};` : null;
4222
- }).join(`
4223
- `)}
4224
- }
4225
- `
4226
- ).join(`
4227
- `)
4228
- }
4229
- }
4230
- ) : null;
4231
- }, ke = ci;
4232
- function De({
4233
- active: e,
4234
- payload: t,
4235
- className: r,
4236
- indicator: a = "dot",
4237
- hideLabel: n = !1,
4238
- hideIndicator: i = !1,
4239
- label: l,
4240
- labelFormatter: s,
4241
- labelClassName: c,
4242
- formatter: d,
4243
- color: p,
4244
- nameKey: u,
4245
- labelKey: v
4246
- }) {
4247
- const { config: f } = Xa(), h = o.useMemo(() => {
4248
- if (n || !t?.length)
4249
- return null;
4250
- const [y] = t, m = `${v || y?.dataKey || y?.name || "value"}`, x = Tt(f, y, m), P = !v && typeof l == "string" ? f[l]?.label || l : x?.label;
4251
- return s ? /* @__PURE__ */ b.jsx("div", { className: ie("font-medium", c), children: s(P, t) }) : P ? /* @__PURE__ */ b.jsx("div", { className: ie("font-medium", c), children: P }) : null;
4252
- }, [
4253
- l,
4254
- s,
4255
- t,
4256
- n,
4257
- c,
4258
- f,
4259
- v
4260
- ]);
4261
- if (!e || !t?.length)
4262
- return null;
4263
- const g = t.length === 1 && a !== "dot";
4264
- return /* @__PURE__ */ b.jsxs(
4265
- "div",
4266
- {
4267
- className: ie(
4268
- "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",
4269
- r
4270
- ),
4271
- children: [
4272
- g ? null : h,
4273
- /* @__PURE__ */ b.jsx("div", { className: "grid gap-1.5", children: t.filter((y) => y.type !== "none").map((y, m) => {
4274
- const x = `${u || y.name || y.dataKey || "value"}`, P = Tt(f, y, x), O = p || y.payload.fill || y.color;
4275
- return /* @__PURE__ */ b.jsx(
4276
- "div",
4277
- {
4278
- className: ie(
4279
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
4280
- a === "dot" ? "items-center" : ""
4281
- ),
4282
- children: d && y?.value !== void 0 && y.name ? d(y.value, y.name, y, m, y.payload) : /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
4283
- P?.icon ? /* @__PURE__ */ b.jsx(P.icon, {}) : !i && /* @__PURE__ */ b.jsx(
4284
- "div",
4285
- {
4286
- className: ie(
4287
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
4288
- a === "dot" ? "h-2.5 w-2.5" : "",
4289
- a === "line" ? "w-1" : "",
4290
- a === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "",
4291
- g && a === "dashed" ? "my-0.5" : ""
4292
- ),
4293
- style: {
4294
- "--color-bg": O,
4295
- "--color-border": O
4296
- }
4297
- }
4298
- ),
4299
- /* @__PURE__ */ b.jsxs(
4300
- "div",
4301
- {
4302
- className: ie(
4303
- "flex flex-1 justify-between leading-none",
4304
- g ? "items-end" : "items-center"
4305
- ),
4306
- children: [
4307
- /* @__PURE__ */ b.jsxs("div", { className: "grid gap-1.5", children: [
4308
- g ? h : null,
4309
- /* @__PURE__ */ b.jsx("span", { className: "text-muted-foreground", children: P?.label || y.name })
4310
- ] }),
4311
- y.value && /* @__PURE__ */ b.jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: y.value.toLocaleString() })
4312
- ]
4313
- }
4314
- )
4315
- ] })
4316
- },
4317
- y.dataKey
4318
- );
4319
- }) })
4320
- ]
4321
- }
4322
- );
4323
- }
4324
- const _e = ui;
4325
- function Le({
4326
- className: e,
4327
- hideIcon: t = !1,
4328
- payload: r,
4329
- verticalAlign: a = "bottom",
4330
- nameKey: n
4331
- }) {
4332
- const { config: i } = Xa();
4333
- return r?.length ? /* @__PURE__ */ b.jsx(
4334
- "div",
4335
- {
4336
- className: ie(
4337
- "flex items-center justify-center gap-4",
4338
- a === "top" ? "pb-3" : "pt-3",
4339
- e
4340
- ),
4341
- children: r.filter((l) => l.type !== "none").map((l) => {
4342
- const s = `${n || l.dataKey || "value"}`, c = Tt(i, l, s);
4343
- return /* @__PURE__ */ b.jsxs(
4344
- "div",
4345
- {
4346
- className: ie(
4347
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
4348
- ),
4349
- children: [
4350
- c?.icon && !t ? /* @__PURE__ */ b.jsx(c.icon, {}) : /* @__PURE__ */ b.jsx(
4351
- "div",
4352
- {
4353
- className: "h-2 w-2 shrink-0 rounded-[2px]",
4354
- style: {
4355
- backgroundColor: l.color
4356
- }
4357
- }
4358
- ),
4359
- c?.label
4360
- ]
4361
- },
4362
- l.value
4363
- );
4364
- })
4365
- }
4366
- ) : null;
4367
- }
4368
- function Tt(e, t, r) {
4369
- if (typeof t != "object" || t === null)
4370
- return;
4371
- const a = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0;
4372
- let n = r;
4373
- return r in t && typeof t[r] == "string" ? n = t[r] : a && r in a && typeof a[r] == "string" && (n = a[r]), n in e ? e[n] : e[r];
4374
- }
4375
- const St = "hsl(var(--primary))", Zc = {
4376
- slate: "#64748b",
4377
- gray: "#6b7280",
4378
- zinc: "#71717a",
4379
- neutral: "#737373",
4380
- stone: "#78716c",
4381
- red: "#ef4444",
4382
- orange: "#f97316",
4383
- amber: "#f59e0b",
4384
- yellow: "#eab308",
4385
- lime: "#84cc16",
4386
- green: "#22c55e",
4387
- emerald: "#10b981",
4388
- teal: "#14b8a6",
4389
- cyan: "#06b6d4",
4390
- sky: "#0ea5e9",
4391
- blue: "#3b82f6",
4392
- indigo: "#6366f1",
4393
- violet: "#8b5cf6",
4394
- purple: "#a855f7",
4395
- fuchsia: "#d946ef",
4396
- pink: "#ec4899",
4397
- rose: "#f43f5e"
4398
- }, Ce = (e) => Zc[e] || e;
4399
- function Uc({
4400
- chartType: e = "bar",
4401
- data: t = [],
4402
- config: r = {},
4403
- xAxisKey: a = "name",
4404
- series: n = [],
4405
- className: i = ""
4406
- }) {
4407
- const l = Array.isArray(t) ? t : [], [s, c] = o.useState(!1);
4408
- o.useEffect(() => {
4409
- const u = () => c(window.innerWidth < 640);
4410
- return u(), window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
4411
- }, []);
4412
- const d = {
4413
- bar: He,
4414
- line: Ic,
4415
- area: Vc,
4416
- pie: wt,
4417
- donut: wt,
4418
- radar: Gr,
4419
- scatter: qr,
4420
- combo: He
4421
- }[e] || He;
4422
- console.log("📈 Rendering Chart:", { chartType: e, dataLength: l.length, config: r, series: n, xAxisKey: a });
4423
- const p = () => [
4424
- "hsl(var(--chart-1))",
4425
- "hsl(var(--chart-2))",
4426
- "hsl(var(--chart-3))",
4427
- "hsl(var(--chart-4))",
4428
- "hsl(var(--chart-5))"
4429
- ];
4430
- if (e === "pie" || e === "donut") {
4431
- const u = e === "donut" ? 60 : 0;
4432
- return /* @__PURE__ */ b.jsx(Se, { config: r, className: i, children: /* @__PURE__ */ b.jsxs(wt, { children: [
4433
- /* @__PURE__ */ b.jsx(ke, { cursor: !1, content: /* @__PURE__ */ b.jsx(De, { hideLabel: !0 }) }),
4434
- /* @__PURE__ */ b.jsx(
4435
- Oa,
4436
- {
4437
- data: l,
4438
- dataKey: n[0]?.dataKey || "value",
4439
- nameKey: a || "name",
4440
- innerRadius: u,
4441
- strokeWidth: 5,
4442
- paddingAngle: 2,
4443
- outerRadius: 80,
4444
- children: l.map((v, f) => {
4445
- let h = r[v[a]]?.color;
4446
- if (!h) {
4447
- const g = p();
4448
- h = g[f % g.length];
4449
- }
4450
- return /* @__PURE__ */ b.jsx(ct, { fill: Ce(h) }, `cell-${f}`);
4451
- })
4452
- }
4453
- ),
4454
- /* @__PURE__ */ b.jsx(
4455
- _e,
4456
- {
4457
- content: /* @__PURE__ */ b.jsx(Le, { nameKey: a }),
4458
- ...s && { verticalAlign: "bottom", wrapperStyle: { fontSize: "11px", paddingTop: "8px" } }
4459
- }
4460
- )
4461
- ] }) });
4462
- }
4463
- return e === "radar" ? /* @__PURE__ */ b.jsx(Se, { config: r, className: i, children: /* @__PURE__ */ b.jsxs(Gr, { data: l, children: [
4464
- /* @__PURE__ */ b.jsx(ba, {}),
4465
- /* @__PURE__ */ b.jsx(Pa, { dataKey: a }),
4466
- /* @__PURE__ */ b.jsx(xa, {}),
4467
- /* @__PURE__ */ b.jsx(ke, { content: /* @__PURE__ */ b.jsx(De, {}) }),
4468
- /* @__PURE__ */ b.jsx(
4469
- _e,
4470
- {
4471
- content: /* @__PURE__ */ b.jsx(Le, {}),
4472
- ...s && { verticalAlign: "bottom", wrapperStyle: { fontSize: "11px", paddingTop: "8px" } }
4473
- }
4474
- ),
4475
- n.map((u) => {
4476
- const v = Ce(r[u.dataKey]?.color || St);
4477
- return /* @__PURE__ */ b.jsx(
4478
- wa,
4479
- {
4480
- dataKey: u.dataKey,
4481
- stroke: v,
4482
- fill: v,
4483
- fillOpacity: 0.6
4484
- },
4485
- u.dataKey
4486
- );
4487
- })
4488
- ] }) }) : e === "scatter" ? /* @__PURE__ */ b.jsx(Se, { config: r, className: i, children: /* @__PURE__ */ b.jsxs(qr, { children: [
4489
- /* @__PURE__ */ b.jsx(yt, { vertical: !1 }),
4490
- /* @__PURE__ */ b.jsx(
4491
- ht,
4492
- {
4493
- type: "number",
4494
- dataKey: a,
4495
- name: String(r[a]?.label || a),
4496
- tickLine: !1,
4497
- axisLine: !1,
4498
- interval: s ? Math.ceil(l.length / 5) : 0
4499
- }
4500
- ),
4501
- /* @__PURE__ */ b.jsx(
4502
- gt,
4503
- {
4504
- type: "number",
4505
- dataKey: n[0]?.dataKey || "value",
4506
- name: String(r[n[0]?.dataKey]?.label || n[0]?.dataKey),
4507
- tickLine: !1,
4508
- axisLine: !1
4509
- }
4510
- ),
4511
- /* @__PURE__ */ b.jsx(Ga, { type: "number", range: [60, 400] }),
4512
- /* @__PURE__ */ b.jsx(ke, { content: /* @__PURE__ */ b.jsx(De, {}) }),
4513
- /* @__PURE__ */ b.jsx(
4514
- _e,
4515
- {
4516
- content: /* @__PURE__ */ b.jsx(Le, {}),
4517
- ...s && { verticalAlign: "bottom", wrapperStyle: { fontSize: "11px", paddingTop: "8px" } }
4518
- }
4519
- ),
4520
- n.map((u, v) => {
4521
- const f = p(), h = Ce(r[u.dataKey]?.color || f[v % f.length]);
4522
- return /* @__PURE__ */ b.jsx(
4523
- Va,
4524
- {
4525
- name: r[u.dataKey]?.label || u.dataKey,
4526
- data: l,
4527
- fill: h
4528
- },
4529
- u.dataKey
4530
- );
4531
- })
4532
- ] }) }) : e === "combo" ? /* @__PURE__ */ b.jsx(Se, { config: r, className: i, children: /* @__PURE__ */ b.jsxs(He, { data: l, children: [
4533
- /* @__PURE__ */ b.jsx(yt, { vertical: !1 }),
4534
- /* @__PURE__ */ b.jsx(
4535
- ht,
4536
- {
4537
- dataKey: a,
4538
- tickLine: !1,
4539
- tickMargin: 10,
4540
- axisLine: !1,
4541
- interval: s ? Math.ceil(l.length / 5) : 0,
4542
- tickFormatter: (u) => u && typeof u == "string" ? u.slice(0, 3) : u
4543
- }
4544
- ),
4545
- /* @__PURE__ */ b.jsx(gt, { yAxisId: "left", tickLine: !1, axisLine: !1 }),
4546
- /* @__PURE__ */ b.jsx(gt, { yAxisId: "right", orientation: "right", tickLine: !1, axisLine: !1 }),
4547
- /* @__PURE__ */ b.jsx(ke, { content: /* @__PURE__ */ b.jsx(De, {}) }),
4548
- /* @__PURE__ */ b.jsx(
4549
- _e,
4550
- {
4551
- content: /* @__PURE__ */ b.jsx(Le, {}),
4552
- ...s && { verticalAlign: "bottom", wrapperStyle: { fontSize: "11px", paddingTop: "8px" } }
4553
- }
4554
- ),
4555
- n.map((u, v) => {
4556
- const f = Ce(r[u.dataKey]?.color || St), h = u.chartType || (v === 0 ? "bar" : "line"), g = h === "bar" ? "left" : "right";
4557
- return h === "line" ? /* @__PURE__ */ b.jsx(Dt, { yAxisId: g, type: "monotone", dataKey: u.dataKey, stroke: f, strokeWidth: 2, dot: !1 }, u.dataKey) : h === "area" ? /* @__PURE__ */ b.jsx(_t, { yAxisId: g, type: "monotone", dataKey: u.dataKey, fill: f, stroke: f, fillOpacity: 0.4 }, u.dataKey) : /* @__PURE__ */ b.jsx(vr, { yAxisId: g, dataKey: u.dataKey, fill: f, radius: 4 }, u.dataKey);
4558
- })
4559
- ] }) }) : /* @__PURE__ */ b.jsx(Se, { config: r, className: i, children: /* @__PURE__ */ b.jsxs(d, { data: l, children: [
4560
- /* @__PURE__ */ b.jsx(yt, { vertical: !1 }),
4561
- /* @__PURE__ */ b.jsx(
4562
- ht,
4563
- {
4564
- dataKey: a,
4565
- tickLine: !1,
4566
- tickMargin: 10,
4567
- axisLine: !1,
4568
- interval: s ? Math.ceil(l.length / 5) : 0,
4569
- tickFormatter: (u) => u && typeof u == "string" ? u.slice(0, 3) : u
4570
- }
4571
- ),
4572
- /* @__PURE__ */ b.jsx(ke, { content: /* @__PURE__ */ b.jsx(De, {}) }),
4573
- /* @__PURE__ */ b.jsx(
4574
- _e,
4575
- {
4576
- content: /* @__PURE__ */ b.jsx(Le, {}),
4577
- ...s && { verticalAlign: "bottom", wrapperStyle: { fontSize: "11px", paddingTop: "8px" } }
4578
- }
4579
- ),
4580
- n.map((u) => {
4581
- const v = Ce(r[u.dataKey]?.color || St);
4582
- return e === "bar" ? /* @__PURE__ */ b.jsx(vr, { dataKey: u.dataKey, fill: v, radius: 4 }, u.dataKey) : e === "line" ? /* @__PURE__ */ b.jsx(Dt, { type: "monotone", dataKey: u.dataKey, stroke: v, strokeWidth: 2, dot: !1 }, u.dataKey) : e === "area" ? /* @__PURE__ */ b.jsx(_t, { type: "monotone", dataKey: u.dataKey, fill: v, stroke: v, fillOpacity: 0.4 }, u.dataKey) : null;
4583
- })
4584
- ] }) });
4585
- }
4586
- export {
4587
- Uc as default
4588
- };