chartformers 1.0.36

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.
@@ -0,0 +1,4011 @@
1
+ import ni, { useRef as Qe, useEffect as _t, useState as ot } from "react";
2
+ import { createPortal as tn } from "react-dom";
3
+ var Ee = { exports: {} }, ge = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.js
7
+ *
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var Hn;
14
+ function ri() {
15
+ if (Hn) return ge;
16
+ Hn = 1;
17
+ var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
18
+ function n(r, i, a) {
19
+ var s = null;
20
+ if (a !== void 0 && (s = "" + a), i.key !== void 0 && (s = "" + i.key), "key" in i) {
21
+ a = {};
22
+ for (var o in i)
23
+ o !== "key" && (a[o] = i[o]);
24
+ } else a = i;
25
+ return i = a.ref, {
26
+ $$typeof: t,
27
+ type: r,
28
+ key: s,
29
+ ref: i !== void 0 ? i : null,
30
+ props: a
31
+ };
32
+ }
33
+ return ge.Fragment = e, ge.jsx = n, ge.jsxs = n, ge;
34
+ }
35
+ var pe = {};
36
+ /**
37
+ * @license React
38
+ * react-jsx-runtime.development.js
39
+ *
40
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */
45
+ var zn;
46
+ function ii() {
47
+ return zn || (zn = 1, process.env.NODE_ENV !== "production" && (function() {
48
+ function t(g) {
49
+ if (g == null) return null;
50
+ if (typeof g == "function")
51
+ return g.$$typeof === x ? null : g.displayName || g.name || null;
52
+ if (typeof g == "string") return g;
53
+ switch (g) {
54
+ case L:
55
+ return "Fragment";
56
+ case I:
57
+ return "Profiler";
58
+ case $:
59
+ return "StrictMode";
60
+ case V:
61
+ return "Suspense";
62
+ case q:
63
+ return "SuspenseList";
64
+ case U:
65
+ return "Activity";
66
+ }
67
+ if (typeof g == "object")
68
+ switch (typeof g.tag == "number" && console.error(
69
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
+ ), g.$$typeof) {
71
+ case v:
72
+ return "Portal";
73
+ case O:
74
+ return g.displayName || "Context";
75
+ case A:
76
+ return (g._context.displayName || "Context") + ".Consumer";
77
+ case E:
78
+ var _ = g.render;
79
+ return g = g.displayName, g || (g = _.displayName || _.name || "", g = g !== "" ? "ForwardRef(" + g + ")" : "ForwardRef"), g;
80
+ case F:
81
+ return _ = g.displayName || null, _ !== null ? _ : t(g.type) || "Memo";
82
+ case j:
83
+ _ = g._payload, g = g._init;
84
+ try {
85
+ return t(g(_));
86
+ } catch {
87
+ }
88
+ }
89
+ return null;
90
+ }
91
+ function e(g) {
92
+ return "" + g;
93
+ }
94
+ function n(g) {
95
+ try {
96
+ e(g);
97
+ var _ = !1;
98
+ } catch {
99
+ _ = !0;
100
+ }
101
+ if (_) {
102
+ _ = console;
103
+ var N = _.error, Y = typeof Symbol == "function" && Symbol.toStringTag && g[Symbol.toStringTag] || g.constructor.name || "Object";
104
+ return N.call(
105
+ _,
106
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
+ Y
108
+ ), e(g);
109
+ }
110
+ }
111
+ function r(g) {
112
+ if (g === L) return "<>";
113
+ if (typeof g == "object" && g !== null && g.$$typeof === j)
114
+ return "<...>";
115
+ try {
116
+ var _ = t(g);
117
+ return _ ? "<" + _ + ">" : "<...>";
118
+ } catch {
119
+ return "<...>";
120
+ }
121
+ }
122
+ function i() {
123
+ var g = b.A;
124
+ return g === null ? null : g.getOwner();
125
+ }
126
+ function a() {
127
+ return Error("react-stack-top-frame");
128
+ }
129
+ function s(g) {
130
+ if (m.call(g, "key")) {
131
+ var _ = Object.getOwnPropertyDescriptor(g, "key").get;
132
+ if (_ && _.isReactWarning) return !1;
133
+ }
134
+ return g.key !== void 0;
135
+ }
136
+ function o(g, _) {
137
+ function N() {
138
+ C || (C = !0, console.error(
139
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
+ _
141
+ ));
142
+ }
143
+ N.isReactWarning = !0, Object.defineProperty(g, "key", {
144
+ get: N,
145
+ configurable: !0
146
+ });
147
+ }
148
+ function c() {
149
+ var g = t(this.type);
150
+ return k[g] || (k[g] = !0, console.error(
151
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
+ )), g = this.props.ref, g !== void 0 ? g : null;
153
+ }
154
+ function l(g, _, N, Y, Z, at) {
155
+ var et = N.ref;
156
+ return g = {
157
+ $$typeof: y,
158
+ type: g,
159
+ key: _,
160
+ props: N,
161
+ _owner: Y
162
+ }, (et !== void 0 ? et : null) !== null ? Object.defineProperty(g, "ref", {
163
+ enumerable: !1,
164
+ get: c
165
+ }) : Object.defineProperty(g, "ref", { enumerable: !1, value: null }), g._store = {}, Object.defineProperty(g._store, "validated", {
166
+ configurable: !1,
167
+ enumerable: !1,
168
+ writable: !0,
169
+ value: 0
170
+ }), Object.defineProperty(g, "_debugInfo", {
171
+ configurable: !1,
172
+ enumerable: !1,
173
+ writable: !0,
174
+ value: null
175
+ }), Object.defineProperty(g, "_debugStack", {
176
+ configurable: !1,
177
+ enumerable: !1,
178
+ writable: !0,
179
+ value: Z
180
+ }), Object.defineProperty(g, "_debugTask", {
181
+ configurable: !1,
182
+ enumerable: !1,
183
+ writable: !0,
184
+ value: at
185
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
186
+ }
187
+ function u(g, _, N, Y, Z, at) {
188
+ var et = _.children;
189
+ if (et !== void 0)
190
+ if (Y)
191
+ if (M(et)) {
192
+ for (Y = 0; Y < et.length; Y++)
193
+ h(et[Y]);
194
+ Object.freeze && Object.freeze(et);
195
+ } else
196
+ console.error(
197
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
+ );
199
+ else h(et);
200
+ if (m.call(_, "key")) {
201
+ et = t(g);
202
+ var rt = Object.keys(_).filter(function(ft) {
203
+ return ft !== "key";
204
+ });
205
+ Y = 0 < rt.length ? "{key: someKey, " + rt.join(": ..., ") + ": ...}" : "{key: someKey}", G[et + Y] || (rt = 0 < rt.length ? "{" + rt.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ `A props object containing a "key" prop is being spread into JSX:
207
+ let props = %s;
208
+ <%s {...props} />
209
+ React keys must be passed directly to JSX without using spread:
210
+ let props = %s;
211
+ <%s key={someKey} {...props} />`,
212
+ Y,
213
+ et,
214
+ rt,
215
+ et
216
+ ), G[et + Y] = !0);
217
+ }
218
+ if (et = null, N !== void 0 && (n(N), et = "" + N), s(_) && (n(_.key), et = "" + _.key), "key" in _) {
219
+ N = {};
220
+ for (var st in _)
221
+ st !== "key" && (N[st] = _[st]);
222
+ } else N = _;
223
+ return et && o(
224
+ N,
225
+ typeof g == "function" ? g.displayName || g.name || "Unknown" : g
226
+ ), l(
227
+ g,
228
+ et,
229
+ N,
230
+ i(),
231
+ Z,
232
+ at
233
+ );
234
+ }
235
+ function h(g) {
236
+ f(g) ? g._store && (g._store.validated = 1) : typeof g == "object" && g !== null && g.$$typeof === j && (g._payload.status === "fulfilled" ? f(g._payload.value) && g._payload.value._store && (g._payload.value._store.validated = 1) : g._store && (g._store.validated = 1));
237
+ }
238
+ function f(g) {
239
+ return typeof g == "object" && g !== null && g.$$typeof === y;
240
+ }
241
+ var d = ni, y = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), L = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), O = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), U = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), b = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, m = Object.prototype.hasOwnProperty, M = Array.isArray, it = console.createTask ? console.createTask : function() {
242
+ return null;
243
+ };
244
+ d = {
245
+ react_stack_bottom_frame: function(g) {
246
+ return g();
247
+ }
248
+ };
249
+ var C, k = {}, S = d.react_stack_bottom_frame.bind(
250
+ d,
251
+ a
252
+ )(), z = it(r(a)), G = {};
253
+ pe.Fragment = L, pe.jsx = function(g, _, N) {
254
+ var Y = 1e4 > b.recentlyCreatedOwnerStacks++;
255
+ return u(
256
+ g,
257
+ _,
258
+ N,
259
+ !1,
260
+ Y ? Error("react-stack-top-frame") : S,
261
+ Y ? it(r(g)) : z
262
+ );
263
+ }, pe.jsxs = function(g, _, N) {
264
+ var Y = 1e4 > b.recentlyCreatedOwnerStacks++;
265
+ return u(
266
+ g,
267
+ _,
268
+ N,
269
+ !0,
270
+ Y ? Error("react-stack-top-frame") : S,
271
+ Y ? it(r(g)) : z
272
+ );
273
+ };
274
+ })()), pe;
275
+ }
276
+ var jn;
277
+ function ai() {
278
+ return jn || (jn = 1, process.env.NODE_ENV === "production" ? Ee.exports = ri() : Ee.exports = ii()), Ee.exports;
279
+ }
280
+ var T = ai();
281
+ function be(t, e) {
282
+ return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
283
+ }
284
+ function si(t, e) {
285
+ return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
286
+ }
287
+ function yr(t) {
288
+ let e, n, r;
289
+ t.length !== 2 ? (e = be, n = (o, c) => be(t(o), c), r = (o, c) => t(o) - c) : (e = t === be || t === si ? t : oi, n = t, r = t);
290
+ function i(o, c, l = 0, u = o.length) {
291
+ if (l < u) {
292
+ if (e(c, c) !== 0) return u;
293
+ do {
294
+ const h = l + u >>> 1;
295
+ n(o[h], c) < 0 ? l = h + 1 : u = h;
296
+ } while (l < u);
297
+ }
298
+ return l;
299
+ }
300
+ function a(o, c, l = 0, u = o.length) {
301
+ if (l < u) {
302
+ if (e(c, c) !== 0) return u;
303
+ do {
304
+ const h = l + u >>> 1;
305
+ n(o[h], c) <= 0 ? l = h + 1 : u = h;
306
+ } while (l < u);
307
+ }
308
+ return l;
309
+ }
310
+ function s(o, c, l = 0, u = o.length) {
311
+ const h = i(o, c, l, u - 1);
312
+ return h > l && r(o[h - 1], c) > -r(o[h], c) ? h - 1 : h;
313
+ }
314
+ return { left: i, center: s, right: a };
315
+ }
316
+ function oi() {
317
+ return 0;
318
+ }
319
+ function li(t) {
320
+ return t === null ? NaN : +t;
321
+ }
322
+ const ci = yr(be), ui = ci.right;
323
+ yr(li).center;
324
+ class Fn extends Map {
325
+ constructor(e, n = di) {
326
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), e != null) for (const [r, i] of e) this.set(r, i);
327
+ }
328
+ get(e) {
329
+ return super.get(Yn(this, e));
330
+ }
331
+ has(e) {
332
+ return super.has(Yn(this, e));
333
+ }
334
+ set(e, n) {
335
+ return super.set(fi(this, e), n);
336
+ }
337
+ delete(e) {
338
+ return super.delete(hi(this, e));
339
+ }
340
+ }
341
+ function Yn({ _intern: t, _key: e }, n) {
342
+ const r = e(n);
343
+ return t.has(r) ? t.get(r) : n;
344
+ }
345
+ function fi({ _intern: t, _key: e }, n) {
346
+ const r = e(n);
347
+ return t.has(r) ? t.get(r) : (t.set(r, n), n);
348
+ }
349
+ function hi({ _intern: t, _key: e }, n) {
350
+ const r = e(n);
351
+ return t.has(r) && (n = t.get(r), t.delete(r)), n;
352
+ }
353
+ function di(t) {
354
+ return t !== null && typeof t == "object" ? t.valueOf() : t;
355
+ }
356
+ const gi = Math.sqrt(50), pi = Math.sqrt(10), mi = Math.sqrt(2);
357
+ function Fe(t, e, n) {
358
+ const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), s = a >= gi ? 10 : a >= pi ? 5 : a >= mi ? 2 : 1;
359
+ let o, c, l;
360
+ return i < 0 ? (l = Math.pow(10, -i) / s, o = Math.round(t * l), c = Math.round(e * l), o / l < t && ++o, c / l > e && --c, l = -l) : (l = Math.pow(10, i) * s, o = Math.round(t / l), c = Math.round(e / l), o * l < t && ++o, c * l > e && --c), c < o && 0.5 <= n && n < 2 ? Fe(t, e, n * 2) : [o, c, l];
361
+ }
362
+ function yi(t, e, n) {
363
+ if (e = +e, t = +t, n = +n, !(n > 0)) return [];
364
+ if (t === e) return [t];
365
+ const r = e < t, [i, a, s] = r ? Fe(e, t, n) : Fe(t, e, n);
366
+ if (!(a >= i)) return [];
367
+ const o = a - i + 1, c = new Array(o);
368
+ if (r)
369
+ if (s < 0) for (let l = 0; l < o; ++l) c[l] = (a - l) / -s;
370
+ else for (let l = 0; l < o; ++l) c[l] = (a - l) * s;
371
+ else if (s < 0) for (let l = 0; l < o; ++l) c[l] = (i + l) / -s;
372
+ else for (let l = 0; l < o; ++l) c[l] = (i + l) * s;
373
+ return c;
374
+ }
375
+ function pn(t, e, n) {
376
+ return e = +e, t = +t, n = +n, Fe(t, e, n)[2];
377
+ }
378
+ function xi(t, e, n) {
379
+ e = +e, t = +t, n = +n;
380
+ const r = e < t, i = r ? pn(e, t, n) : pn(t, e, n);
381
+ return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
382
+ }
383
+ function Et(t, e) {
384
+ let n;
385
+ if (e === void 0)
386
+ for (const r of t)
387
+ r != null && (n < r || n === void 0 && r >= r) && (n = r);
388
+ else {
389
+ let r = -1;
390
+ for (let i of t)
391
+ (i = e(i, ++r, t)) != null && (n < i || n === void 0 && i >= i) && (n = i);
392
+ }
393
+ return n;
394
+ }
395
+ function vi(t, e, n) {
396
+ t = +t, e = +e, n = (i = arguments.length) < 2 ? (e = t, t = 0, 1) : i < 3 ? 1 : +n;
397
+ for (var r = -1, i = Math.max(0, Math.ceil((e - t) / n)) | 0, a = new Array(i); ++r < i; )
398
+ a[r] = t + r * n;
399
+ return a;
400
+ }
401
+ const _i = bi(Math.random);
402
+ function bi(t) {
403
+ return function(n, r = 0, i = n.length) {
404
+ let a = i - (r = +r);
405
+ for (; a; ) {
406
+ const s = t() * a-- | 0, o = n[a + r];
407
+ n[a + r] = n[s + r], n[s + r] = o;
408
+ }
409
+ return n;
410
+ };
411
+ }
412
+ function wi(t) {
413
+ return t;
414
+ }
415
+ var un = 1, fn = 2, mn = 3, ye = 4, qn = 1e-6;
416
+ function ki(t) {
417
+ return "translate(" + t + ",0)";
418
+ }
419
+ function $i(t) {
420
+ return "translate(0," + t + ")";
421
+ }
422
+ function Ai(t) {
423
+ return (e) => +t(e);
424
+ }
425
+ function Ni(t, e) {
426
+ return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;
427
+ }
428
+ function Si() {
429
+ return !this.__axis;
430
+ }
431
+ function xr(t, e) {
432
+ var n = [], r = null, i = null, a = 6, s = 6, o = 3, c = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, l = t === un || t === ye ? -1 : 1, u = t === ye || t === fn ? "x" : "y", h = t === un || t === mn ? ki : $i;
433
+ function f(d) {
434
+ var y = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), v = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : wi), L = Math.max(a, 0) + o, $ = e.range(), I = +$[0] + c, A = +$[$.length - 1] + c, O = (e.bandwidth ? Ni : Ai)(e.copy(), c), E = d.selection ? d.selection() : d, V = E.selectAll(".domain").data([null]), q = E.selectAll(".tick").data(y, e).order(), F = q.exit(), j = q.enter().append("g").attr("class", "tick"), U = q.select("line"), x = q.select("text");
435
+ V = V.merge(V.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), q = q.merge(j), U = U.merge(j.append("line").attr("stroke", "currentColor").attr(u + "2", l * a)), x = x.merge(j.append("text").attr("fill", "currentColor").attr(u, l * L).attr("dy", t === un ? "0em" : t === mn ? "0.71em" : "0.32em")), d !== E && (V = V.transition(d), q = q.transition(d), U = U.transition(d), x = x.transition(d), F = F.transition(d).attr("opacity", qn).attr("transform", function(b) {
436
+ return isFinite(b = O(b)) ? h(b + c) : this.getAttribute("transform");
437
+ }), j.attr("opacity", qn).attr("transform", function(b) {
438
+ var m = this.parentNode.__axis;
439
+ return h((m && isFinite(m = m(b)) ? m : O(b)) + c);
440
+ })), F.remove(), V.attr("d", t === ye || t === fn ? s ? "M" + l * s + "," + I + "H" + c + "V" + A + "H" + l * s : "M" + c + "," + I + "V" + A : s ? "M" + I + "," + l * s + "V" + c + "H" + A + "V" + l * s : "M" + I + "," + c + "H" + A), q.attr("opacity", 1).attr("transform", function(b) {
441
+ return h(O(b) + c);
442
+ }), U.attr(u + "2", l * a), x.attr(u, l * L).text(v), E.filter(Si).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === fn ? "start" : t === ye ? "end" : "middle"), E.each(function() {
443
+ this.__axis = O;
444
+ });
445
+ }
446
+ return f.scale = function(d) {
447
+ return arguments.length ? (e = d, f) : e;
448
+ }, f.ticks = function() {
449
+ return n = Array.from(arguments), f;
450
+ }, f.tickArguments = function(d) {
451
+ return arguments.length ? (n = d == null ? [] : Array.from(d), f) : n.slice();
452
+ }, f.tickValues = function(d) {
453
+ return arguments.length ? (r = d == null ? null : Array.from(d), f) : r && r.slice();
454
+ }, f.tickFormat = function(d) {
455
+ return arguments.length ? (i = d, f) : i;
456
+ }, f.tickSize = function(d) {
457
+ return arguments.length ? (a = s = +d, f) : a;
458
+ }, f.tickSizeInner = function(d) {
459
+ return arguments.length ? (a = +d, f) : a;
460
+ }, f.tickSizeOuter = function(d) {
461
+ return arguments.length ? (s = +d, f) : s;
462
+ }, f.tickPadding = function(d) {
463
+ return arguments.length ? (o = +d, f) : o;
464
+ }, f.offset = function(d) {
465
+ return arguments.length ? (c = +d, f) : c;
466
+ }, f;
467
+ }
468
+ function Kt(t) {
469
+ return xr(mn, t);
470
+ }
471
+ function Ut(t) {
472
+ return xr(ye, t);
473
+ }
474
+ var Mi = { value: () => {
475
+ } };
476
+ function vr() {
477
+ for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) {
478
+ if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
479
+ n[r] = [];
480
+ }
481
+ return new Oe(n);
482
+ }
483
+ function Oe(t) {
484
+ this._ = t;
485
+ }
486
+ function Ri(t, e) {
487
+ return t.trim().split(/^|\s+/).map(function(n) {
488
+ var r = "", i = n.indexOf(".");
489
+ if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n);
490
+ return { type: n, name: r };
491
+ });
492
+ }
493
+ Oe.prototype = vr.prototype = {
494
+ constructor: Oe,
495
+ on: function(t, e) {
496
+ var n = this._, r = Ri(t + "", n), i, a = -1, s = r.length;
497
+ if (arguments.length < 2) {
498
+ for (; ++a < s; ) if ((i = (t = r[a]).type) && (i = Ti(n[i], t.name))) return i;
499
+ return;
500
+ }
501
+ if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
502
+ for (; ++a < s; )
503
+ if (i = (t = r[a]).type) n[i] = Vn(n[i], t.name, e);
504
+ else if (e == null) for (i in n) n[i] = Vn(n[i], t.name, null);
505
+ return this;
506
+ },
507
+ copy: function() {
508
+ var t = {}, e = this._;
509
+ for (var n in e) t[n] = e[n].slice();
510
+ return new Oe(t);
511
+ },
512
+ call: function(t, e) {
513
+ if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, a; r < i; ++r) n[r] = arguments[r + 2];
514
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
515
+ for (a = this._[t], r = 0, i = a.length; r < i; ++r) a[r].value.apply(e, n);
516
+ },
517
+ apply: function(t, e, n) {
518
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
519
+ for (var r = this._[t], i = 0, a = r.length; i < a; ++i) r[i].value.apply(e, n);
520
+ }
521
+ };
522
+ function Ti(t, e) {
523
+ for (var n = 0, r = t.length, i; n < r; ++n)
524
+ if ((i = t[n]).name === e)
525
+ return i.value;
526
+ }
527
+ function Vn(t, e, n) {
528
+ for (var r = 0, i = t.length; r < i; ++r)
529
+ if (t[r].name === e) {
530
+ t[r] = Mi, t = t.slice(0, r).concat(t.slice(r + 1));
531
+ break;
532
+ }
533
+ return n != null && t.push({ name: e, value: n }), t;
534
+ }
535
+ var yn = "http://www.w3.org/1999/xhtml";
536
+ const Wn = {
537
+ svg: "http://www.w3.org/2000/svg",
538
+ xhtml: yn,
539
+ xlink: "http://www.w3.org/1999/xlink",
540
+ xml: "http://www.w3.org/XML/1998/namespace",
541
+ xmlns: "http://www.w3.org/2000/xmlns/"
542
+ };
543
+ function en(t) {
544
+ var e = t += "", n = e.indexOf(":");
545
+ return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Wn.hasOwnProperty(e) ? { space: Wn[e], local: t } : t;
546
+ }
547
+ function Ei(t) {
548
+ return function() {
549
+ var e = this.ownerDocument, n = this.namespaceURI;
550
+ return n === yn && e.documentElement.namespaceURI === yn ? e.createElement(t) : e.createElementNS(n, t);
551
+ };
552
+ }
553
+ function Ci(t) {
554
+ return function() {
555
+ return this.ownerDocument.createElementNS(t.space, t.local);
556
+ };
557
+ }
558
+ function _r(t) {
559
+ var e = en(t);
560
+ return (e.local ? Ci : Ei)(e);
561
+ }
562
+ function Di() {
563
+ }
564
+ function Rn(t) {
565
+ return t == null ? Di : function() {
566
+ return this.querySelector(t);
567
+ };
568
+ }
569
+ function Pi(t) {
570
+ typeof t != "function" && (t = Rn(t));
571
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
572
+ for (var a = e[i], s = a.length, o = r[i] = new Array(s), c, l, u = 0; u < s; ++u)
573
+ (c = a[u]) && (l = t.call(c, c.__data__, u, a)) && ("__data__" in c && (l.__data__ = c.__data__), o[u] = l);
574
+ return new yt(r, this._parents);
575
+ }
576
+ function Li(t) {
577
+ return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
578
+ }
579
+ function Ii() {
580
+ return [];
581
+ }
582
+ function br(t) {
583
+ return t == null ? Ii : function() {
584
+ return this.querySelectorAll(t);
585
+ };
586
+ }
587
+ function Oi(t) {
588
+ return function() {
589
+ return Li(t.apply(this, arguments));
590
+ };
591
+ }
592
+ function Hi(t) {
593
+ typeof t == "function" ? t = Oi(t) : t = br(t);
594
+ for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a)
595
+ for (var s = e[a], o = s.length, c, l = 0; l < o; ++l)
596
+ (c = s[l]) && (r.push(t.call(c, c.__data__, l, s)), i.push(c));
597
+ return new yt(r, i);
598
+ }
599
+ function wr(t) {
600
+ return function() {
601
+ return this.matches(t);
602
+ };
603
+ }
604
+ function kr(t) {
605
+ return function(e) {
606
+ return e.matches(t);
607
+ };
608
+ }
609
+ var zi = Array.prototype.find;
610
+ function ji(t) {
611
+ return function() {
612
+ return zi.call(this.children, t);
613
+ };
614
+ }
615
+ function Fi() {
616
+ return this.firstElementChild;
617
+ }
618
+ function Yi(t) {
619
+ return this.select(t == null ? Fi : ji(typeof t == "function" ? t : kr(t)));
620
+ }
621
+ var qi = Array.prototype.filter;
622
+ function Vi() {
623
+ return Array.from(this.children);
624
+ }
625
+ function Wi(t) {
626
+ return function() {
627
+ return qi.call(this.children, t);
628
+ };
629
+ }
630
+ function Xi(t) {
631
+ return this.selectAll(t == null ? Vi : Wi(typeof t == "function" ? t : kr(t)));
632
+ }
633
+ function Bi(t) {
634
+ typeof t != "function" && (t = wr(t));
635
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
636
+ for (var a = e[i], s = a.length, o = r[i] = [], c, l = 0; l < s; ++l)
637
+ (c = a[l]) && t.call(c, c.__data__, l, a) && o.push(c);
638
+ return new yt(r, this._parents);
639
+ }
640
+ function $r(t) {
641
+ return new Array(t.length);
642
+ }
643
+ function Ki() {
644
+ return new yt(this._enter || this._groups.map($r), this._parents);
645
+ }
646
+ function Ye(t, e) {
647
+ this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
648
+ }
649
+ Ye.prototype = {
650
+ constructor: Ye,
651
+ appendChild: function(t) {
652
+ return this._parent.insertBefore(t, this._next);
653
+ },
654
+ insertBefore: function(t, e) {
655
+ return this._parent.insertBefore(t, e);
656
+ },
657
+ querySelector: function(t) {
658
+ return this._parent.querySelector(t);
659
+ },
660
+ querySelectorAll: function(t) {
661
+ return this._parent.querySelectorAll(t);
662
+ }
663
+ };
664
+ function Ui(t) {
665
+ return function() {
666
+ return t;
667
+ };
668
+ }
669
+ function Ji(t, e, n, r, i, a) {
670
+ for (var s = 0, o, c = e.length, l = a.length; s < l; ++s)
671
+ (o = e[s]) ? (o.__data__ = a[s], r[s] = o) : n[s] = new Ye(t, a[s]);
672
+ for (; s < c; ++s)
673
+ (o = e[s]) && (i[s] = o);
674
+ }
675
+ function Gi(t, e, n, r, i, a, s) {
676
+ var o, c, l = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u), d;
677
+ for (o = 0; o < u; ++o)
678
+ (c = e[o]) && (f[o] = d = s.call(c, c.__data__, o, e) + "", l.has(d) ? i[o] = c : l.set(d, c));
679
+ for (o = 0; o < h; ++o)
680
+ d = s.call(t, a[o], o, a) + "", (c = l.get(d)) ? (r[o] = c, c.__data__ = a[o], l.delete(d)) : n[o] = new Ye(t, a[o]);
681
+ for (o = 0; o < u; ++o)
682
+ (c = e[o]) && l.get(f[o]) === c && (i[o] = c);
683
+ }
684
+ function Zi(t) {
685
+ return t.__data__;
686
+ }
687
+ function Qi(t, e) {
688
+ if (!arguments.length) return Array.from(this, Zi);
689
+ var n = e ? Gi : Ji, r = this._parents, i = this._groups;
690
+ typeof t != "function" && (t = Ui(t));
691
+ for (var a = i.length, s = new Array(a), o = new Array(a), c = new Array(a), l = 0; l < a; ++l) {
692
+ var u = r[l], h = i[l], f = h.length, d = ta(t.call(u, u && u.__data__, l, r)), y = d.length, v = o[l] = new Array(y), L = s[l] = new Array(y), $ = c[l] = new Array(f);
693
+ n(u, h, v, L, $, d, e);
694
+ for (var I = 0, A = 0, O, E; I < y; ++I)
695
+ if (O = v[I]) {
696
+ for (I >= A && (A = I + 1); !(E = L[A]) && ++A < y; ) ;
697
+ O._next = E || null;
698
+ }
699
+ }
700
+ return s = new yt(s, r), s._enter = o, s._exit = c, s;
701
+ }
702
+ function ta(t) {
703
+ return typeof t == "object" && "length" in t ? t : Array.from(t);
704
+ }
705
+ function ea() {
706
+ return new yt(this._exit || this._groups.map($r), this._parents);
707
+ }
708
+ function na(t, e, n) {
709
+ var r = this.enter(), i = this, a = this.exit();
710
+ return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
711
+ }
712
+ function ra(t) {
713
+ for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, s = Math.min(i, a), o = new Array(i), c = 0; c < s; ++c)
714
+ for (var l = n[c], u = r[c], h = l.length, f = o[c] = new Array(h), d, y = 0; y < h; ++y)
715
+ (d = l[y] || u[y]) && (f[y] = d);
716
+ for (; c < i; ++c)
717
+ o[c] = n[c];
718
+ return new yt(o, this._parents);
719
+ }
720
+ function ia() {
721
+ for (var t = this._groups, e = -1, n = t.length; ++e < n; )
722
+ for (var r = t[e], i = r.length - 1, a = r[i], s; --i >= 0; )
723
+ (s = r[i]) && (a && s.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(s, a), a = s);
724
+ return this;
725
+ }
726
+ function aa(t) {
727
+ t || (t = sa);
728
+ function e(h, f) {
729
+ return h && f ? t(h.__data__, f.__data__) : !h - !f;
730
+ }
731
+ for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) {
732
+ for (var s = n[a], o = s.length, c = i[a] = new Array(o), l, u = 0; u < o; ++u)
733
+ (l = s[u]) && (c[u] = l);
734
+ c.sort(e);
735
+ }
736
+ return new yt(i, this._parents).order();
737
+ }
738
+ function sa(t, e) {
739
+ return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
740
+ }
741
+ function oa() {
742
+ var t = arguments[0];
743
+ return arguments[0] = this, t.apply(null, arguments), this;
744
+ }
745
+ function la() {
746
+ return Array.from(this);
747
+ }
748
+ function ca() {
749
+ for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
750
+ for (var r = t[e], i = 0, a = r.length; i < a; ++i) {
751
+ var s = r[i];
752
+ if (s) return s;
753
+ }
754
+ return null;
755
+ }
756
+ function ua() {
757
+ let t = 0;
758
+ for (const e of this) ++t;
759
+ return t;
760
+ }
761
+ function fa() {
762
+ return !this.node();
763
+ }
764
+ function ha(t) {
765
+ for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
766
+ for (var i = e[n], a = 0, s = i.length, o; a < s; ++a)
767
+ (o = i[a]) && t.call(o, o.__data__, a, i);
768
+ return this;
769
+ }
770
+ function da(t) {
771
+ return function() {
772
+ this.removeAttribute(t);
773
+ };
774
+ }
775
+ function ga(t) {
776
+ return function() {
777
+ this.removeAttributeNS(t.space, t.local);
778
+ };
779
+ }
780
+ function pa(t, e) {
781
+ return function() {
782
+ this.setAttribute(t, e);
783
+ };
784
+ }
785
+ function ma(t, e) {
786
+ return function() {
787
+ this.setAttributeNS(t.space, t.local, e);
788
+ };
789
+ }
790
+ function ya(t, e) {
791
+ return function() {
792
+ var n = e.apply(this, arguments);
793
+ n == null ? this.removeAttribute(t) : this.setAttribute(t, n);
794
+ };
795
+ }
796
+ function xa(t, e) {
797
+ return function() {
798
+ var n = e.apply(this, arguments);
799
+ n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n);
800
+ };
801
+ }
802
+ function va(t, e) {
803
+ var n = en(t);
804
+ if (arguments.length < 2) {
805
+ var r = this.node();
806
+ return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
807
+ }
808
+ return this.each((e == null ? n.local ? ga : da : typeof e == "function" ? n.local ? xa : ya : n.local ? ma : pa)(n, e));
809
+ }
810
+ function Ar(t) {
811
+ return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
812
+ }
813
+ function _a(t) {
814
+ return function() {
815
+ this.style.removeProperty(t);
816
+ };
817
+ }
818
+ function ba(t, e, n) {
819
+ return function() {
820
+ this.style.setProperty(t, e, n);
821
+ };
822
+ }
823
+ function wa(t, e, n) {
824
+ return function() {
825
+ var r = e.apply(this, arguments);
826
+ r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n);
827
+ };
828
+ }
829
+ function ka(t, e, n) {
830
+ return arguments.length > 1 ? this.each((e == null ? _a : typeof e == "function" ? wa : ba)(t, e, n ?? "")) : ce(this.node(), t);
831
+ }
832
+ function ce(t, e) {
833
+ return t.style.getPropertyValue(e) || Ar(t).getComputedStyle(t, null).getPropertyValue(e);
834
+ }
835
+ function $a(t) {
836
+ return function() {
837
+ delete this[t];
838
+ };
839
+ }
840
+ function Aa(t, e) {
841
+ return function() {
842
+ this[t] = e;
843
+ };
844
+ }
845
+ function Na(t, e) {
846
+ return function() {
847
+ var n = e.apply(this, arguments);
848
+ n == null ? delete this[t] : this[t] = n;
849
+ };
850
+ }
851
+ function Sa(t, e) {
852
+ return arguments.length > 1 ? this.each((e == null ? $a : typeof e == "function" ? Na : Aa)(t, e)) : this.node()[t];
853
+ }
854
+ function Nr(t) {
855
+ return t.trim().split(/^|\s+/);
856
+ }
857
+ function Tn(t) {
858
+ return t.classList || new Sr(t);
859
+ }
860
+ function Sr(t) {
861
+ this._node = t, this._names = Nr(t.getAttribute("class") || "");
862
+ }
863
+ Sr.prototype = {
864
+ add: function(t) {
865
+ var e = this._names.indexOf(t);
866
+ e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
867
+ },
868
+ remove: function(t) {
869
+ var e = this._names.indexOf(t);
870
+ e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
871
+ },
872
+ contains: function(t) {
873
+ return this._names.indexOf(t) >= 0;
874
+ }
875
+ };
876
+ function Mr(t, e) {
877
+ for (var n = Tn(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]);
878
+ }
879
+ function Rr(t, e) {
880
+ for (var n = Tn(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]);
881
+ }
882
+ function Ma(t) {
883
+ return function() {
884
+ Mr(this, t);
885
+ };
886
+ }
887
+ function Ra(t) {
888
+ return function() {
889
+ Rr(this, t);
890
+ };
891
+ }
892
+ function Ta(t, e) {
893
+ return function() {
894
+ (e.apply(this, arguments) ? Mr : Rr)(this, t);
895
+ };
896
+ }
897
+ function Ea(t, e) {
898
+ var n = Nr(t + "");
899
+ if (arguments.length < 2) {
900
+ for (var r = Tn(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1;
901
+ return !0;
902
+ }
903
+ return this.each((typeof e == "function" ? Ta : e ? Ma : Ra)(n, e));
904
+ }
905
+ function Ca() {
906
+ this.textContent = "";
907
+ }
908
+ function Da(t) {
909
+ return function() {
910
+ this.textContent = t;
911
+ };
912
+ }
913
+ function Pa(t) {
914
+ return function() {
915
+ var e = t.apply(this, arguments);
916
+ this.textContent = e ?? "";
917
+ };
918
+ }
919
+ function La(t) {
920
+ return arguments.length ? this.each(t == null ? Ca : (typeof t == "function" ? Pa : Da)(t)) : this.node().textContent;
921
+ }
922
+ function Ia() {
923
+ this.innerHTML = "";
924
+ }
925
+ function Oa(t) {
926
+ return function() {
927
+ this.innerHTML = t;
928
+ };
929
+ }
930
+ function Ha(t) {
931
+ return function() {
932
+ var e = t.apply(this, arguments);
933
+ this.innerHTML = e ?? "";
934
+ };
935
+ }
936
+ function za(t) {
937
+ return arguments.length ? this.each(t == null ? Ia : (typeof t == "function" ? Ha : Oa)(t)) : this.node().innerHTML;
938
+ }
939
+ function ja() {
940
+ this.nextSibling && this.parentNode.appendChild(this);
941
+ }
942
+ function Fa() {
943
+ return this.each(ja);
944
+ }
945
+ function Ya() {
946
+ this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
947
+ }
948
+ function qa() {
949
+ return this.each(Ya);
950
+ }
951
+ function Va(t) {
952
+ var e = typeof t == "function" ? t : _r(t);
953
+ return this.select(function() {
954
+ return this.appendChild(e.apply(this, arguments));
955
+ });
956
+ }
957
+ function Wa() {
958
+ return null;
959
+ }
960
+ function Xa(t, e) {
961
+ var n = typeof t == "function" ? t : _r(t), r = e == null ? Wa : typeof e == "function" ? e : Rn(e);
962
+ return this.select(function() {
963
+ return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
964
+ });
965
+ }
966
+ function Ba() {
967
+ var t = this.parentNode;
968
+ t && t.removeChild(this);
969
+ }
970
+ function Ka() {
971
+ return this.each(Ba);
972
+ }
973
+ function Ua() {
974
+ var t = this.cloneNode(!1), e = this.parentNode;
975
+ return e ? e.insertBefore(t, this.nextSibling) : t;
976
+ }
977
+ function Ja() {
978
+ var t = this.cloneNode(!0), e = this.parentNode;
979
+ return e ? e.insertBefore(t, this.nextSibling) : t;
980
+ }
981
+ function Ga(t) {
982
+ return this.select(t ? Ja : Ua);
983
+ }
984
+ function Za(t) {
985
+ return arguments.length ? this.property("__data__", t) : this.node().__data__;
986
+ }
987
+ function Qa(t) {
988
+ return function(e) {
989
+ t.call(this, e, this.__data__);
990
+ };
991
+ }
992
+ function ts(t) {
993
+ return t.trim().split(/^|\s+/).map(function(e) {
994
+ var n = "", r = e.indexOf(".");
995
+ return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n };
996
+ });
997
+ }
998
+ function es(t) {
999
+ return function() {
1000
+ var e = this.__on;
1001
+ if (e) {
1002
+ for (var n = 0, r = -1, i = e.length, a; n < i; ++n)
1003
+ a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a;
1004
+ ++r ? e.length = r : delete this.__on;
1005
+ }
1006
+ };
1007
+ }
1008
+ function ns(t, e, n) {
1009
+ return function() {
1010
+ var r = this.__on, i, a = Qa(e);
1011
+ if (r) {
1012
+ for (var s = 0, o = r.length; s < o; ++s)
1013
+ if ((i = r[s]).type === t.type && i.name === t.name) {
1014
+ this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = e;
1015
+ return;
1016
+ }
1017
+ }
1018
+ this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i];
1019
+ };
1020
+ }
1021
+ function rs(t, e, n) {
1022
+ var r = ts(t + ""), i, a = r.length, s;
1023
+ if (arguments.length < 2) {
1024
+ var o = this.node().__on;
1025
+ if (o) {
1026
+ for (var c = 0, l = o.length, u; c < l; ++c)
1027
+ for (i = 0, u = o[c]; i < a; ++i)
1028
+ if ((s = r[i]).type === u.type && s.name === u.name)
1029
+ return u.value;
1030
+ }
1031
+ return;
1032
+ }
1033
+ for (o = e ? ns : es, i = 0; i < a; ++i) this.each(o(r[i], e, n));
1034
+ return this;
1035
+ }
1036
+ function Tr(t, e, n) {
1037
+ var r = Ar(t), i = r.CustomEvent;
1038
+ typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i);
1039
+ }
1040
+ function is(t, e) {
1041
+ return function() {
1042
+ return Tr(this, t, e);
1043
+ };
1044
+ }
1045
+ function as(t, e) {
1046
+ return function() {
1047
+ return Tr(this, t, e.apply(this, arguments));
1048
+ };
1049
+ }
1050
+ function ss(t, e) {
1051
+ return this.each((typeof e == "function" ? as : is)(t, e));
1052
+ }
1053
+ function* os() {
1054
+ for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
1055
+ for (var r = t[e], i = 0, a = r.length, s; i < a; ++i)
1056
+ (s = r[i]) && (yield s);
1057
+ }
1058
+ var Er = [null];
1059
+ function yt(t, e) {
1060
+ this._groups = t, this._parents = e;
1061
+ }
1062
+ function Ne() {
1063
+ return new yt([[document.documentElement]], Er);
1064
+ }
1065
+ function ls() {
1066
+ return this;
1067
+ }
1068
+ yt.prototype = Ne.prototype = {
1069
+ constructor: yt,
1070
+ select: Pi,
1071
+ selectAll: Hi,
1072
+ selectChild: Yi,
1073
+ selectChildren: Xi,
1074
+ filter: Bi,
1075
+ data: Qi,
1076
+ enter: Ki,
1077
+ exit: ea,
1078
+ join: na,
1079
+ merge: ra,
1080
+ selection: ls,
1081
+ order: ia,
1082
+ sort: aa,
1083
+ call: oa,
1084
+ nodes: la,
1085
+ node: ca,
1086
+ size: ua,
1087
+ empty: fa,
1088
+ each: ha,
1089
+ attr: va,
1090
+ style: ka,
1091
+ property: Sa,
1092
+ classed: Ea,
1093
+ text: La,
1094
+ html: za,
1095
+ raise: Fa,
1096
+ lower: qa,
1097
+ append: Va,
1098
+ insert: Xa,
1099
+ remove: Ka,
1100
+ clone: Ga,
1101
+ datum: Za,
1102
+ on: rs,
1103
+ dispatch: ss,
1104
+ [Symbol.iterator]: os
1105
+ };
1106
+ function bt(t) {
1107
+ return typeof t == "string" ? new yt([[document.querySelector(t)]], [document.documentElement]) : new yt([[t]], Er);
1108
+ }
1109
+ function En(t, e, n) {
1110
+ t.prototype = e.prototype = n, n.constructor = t;
1111
+ }
1112
+ function Cr(t, e) {
1113
+ var n = Object.create(t.prototype);
1114
+ for (var r in e) n[r] = e[r];
1115
+ return n;
1116
+ }
1117
+ function Se() {
1118
+ }
1119
+ var we = 0.7, qe = 1 / we, le = "\\s*([+-]?\\d+)\\s*", ke = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ct = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", cs = /^#([0-9a-f]{3,8})$/, us = new RegExp(`^rgb\\(${le},${le},${le}\\)$`), fs = new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`), hs = new RegExp(`^rgba\\(${le},${le},${le},${ke}\\)$`), ds = new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${ke}\\)$`), gs = new RegExp(`^hsl\\(${ke},${Ct},${Ct}\\)$`), ps = new RegExp(`^hsla\\(${ke},${Ct},${Ct},${ke}\\)$`), Xn = {
1120
+ aliceblue: 15792383,
1121
+ antiquewhite: 16444375,
1122
+ aqua: 65535,
1123
+ aquamarine: 8388564,
1124
+ azure: 15794175,
1125
+ beige: 16119260,
1126
+ bisque: 16770244,
1127
+ black: 0,
1128
+ blanchedalmond: 16772045,
1129
+ blue: 255,
1130
+ blueviolet: 9055202,
1131
+ brown: 10824234,
1132
+ burlywood: 14596231,
1133
+ cadetblue: 6266528,
1134
+ chartreuse: 8388352,
1135
+ chocolate: 13789470,
1136
+ coral: 16744272,
1137
+ cornflowerblue: 6591981,
1138
+ cornsilk: 16775388,
1139
+ crimson: 14423100,
1140
+ cyan: 65535,
1141
+ darkblue: 139,
1142
+ darkcyan: 35723,
1143
+ darkgoldenrod: 12092939,
1144
+ darkgray: 11119017,
1145
+ darkgreen: 25600,
1146
+ darkgrey: 11119017,
1147
+ darkkhaki: 12433259,
1148
+ darkmagenta: 9109643,
1149
+ darkolivegreen: 5597999,
1150
+ darkorange: 16747520,
1151
+ darkorchid: 10040012,
1152
+ darkred: 9109504,
1153
+ darksalmon: 15308410,
1154
+ darkseagreen: 9419919,
1155
+ darkslateblue: 4734347,
1156
+ darkslategray: 3100495,
1157
+ darkslategrey: 3100495,
1158
+ darkturquoise: 52945,
1159
+ darkviolet: 9699539,
1160
+ deeppink: 16716947,
1161
+ deepskyblue: 49151,
1162
+ dimgray: 6908265,
1163
+ dimgrey: 6908265,
1164
+ dodgerblue: 2003199,
1165
+ firebrick: 11674146,
1166
+ floralwhite: 16775920,
1167
+ forestgreen: 2263842,
1168
+ fuchsia: 16711935,
1169
+ gainsboro: 14474460,
1170
+ ghostwhite: 16316671,
1171
+ gold: 16766720,
1172
+ goldenrod: 14329120,
1173
+ gray: 8421504,
1174
+ green: 32768,
1175
+ greenyellow: 11403055,
1176
+ grey: 8421504,
1177
+ honeydew: 15794160,
1178
+ hotpink: 16738740,
1179
+ indianred: 13458524,
1180
+ indigo: 4915330,
1181
+ ivory: 16777200,
1182
+ khaki: 15787660,
1183
+ lavender: 15132410,
1184
+ lavenderblush: 16773365,
1185
+ lawngreen: 8190976,
1186
+ lemonchiffon: 16775885,
1187
+ lightblue: 11393254,
1188
+ lightcoral: 15761536,
1189
+ lightcyan: 14745599,
1190
+ lightgoldenrodyellow: 16448210,
1191
+ lightgray: 13882323,
1192
+ lightgreen: 9498256,
1193
+ lightgrey: 13882323,
1194
+ lightpink: 16758465,
1195
+ lightsalmon: 16752762,
1196
+ lightseagreen: 2142890,
1197
+ lightskyblue: 8900346,
1198
+ lightslategray: 7833753,
1199
+ lightslategrey: 7833753,
1200
+ lightsteelblue: 11584734,
1201
+ lightyellow: 16777184,
1202
+ lime: 65280,
1203
+ limegreen: 3329330,
1204
+ linen: 16445670,
1205
+ magenta: 16711935,
1206
+ maroon: 8388608,
1207
+ mediumaquamarine: 6737322,
1208
+ mediumblue: 205,
1209
+ mediumorchid: 12211667,
1210
+ mediumpurple: 9662683,
1211
+ mediumseagreen: 3978097,
1212
+ mediumslateblue: 8087790,
1213
+ mediumspringgreen: 64154,
1214
+ mediumturquoise: 4772300,
1215
+ mediumvioletred: 13047173,
1216
+ midnightblue: 1644912,
1217
+ mintcream: 16121850,
1218
+ mistyrose: 16770273,
1219
+ moccasin: 16770229,
1220
+ navajowhite: 16768685,
1221
+ navy: 128,
1222
+ oldlace: 16643558,
1223
+ olive: 8421376,
1224
+ olivedrab: 7048739,
1225
+ orange: 16753920,
1226
+ orangered: 16729344,
1227
+ orchid: 14315734,
1228
+ palegoldenrod: 15657130,
1229
+ palegreen: 10025880,
1230
+ paleturquoise: 11529966,
1231
+ palevioletred: 14381203,
1232
+ papayawhip: 16773077,
1233
+ peachpuff: 16767673,
1234
+ peru: 13468991,
1235
+ pink: 16761035,
1236
+ plum: 14524637,
1237
+ powderblue: 11591910,
1238
+ purple: 8388736,
1239
+ rebeccapurple: 6697881,
1240
+ red: 16711680,
1241
+ rosybrown: 12357519,
1242
+ royalblue: 4286945,
1243
+ saddlebrown: 9127187,
1244
+ salmon: 16416882,
1245
+ sandybrown: 16032864,
1246
+ seagreen: 3050327,
1247
+ seashell: 16774638,
1248
+ sienna: 10506797,
1249
+ silver: 12632256,
1250
+ skyblue: 8900331,
1251
+ slateblue: 6970061,
1252
+ slategray: 7372944,
1253
+ slategrey: 7372944,
1254
+ snow: 16775930,
1255
+ springgreen: 65407,
1256
+ steelblue: 4620980,
1257
+ tan: 13808780,
1258
+ teal: 32896,
1259
+ thistle: 14204888,
1260
+ tomato: 16737095,
1261
+ turquoise: 4251856,
1262
+ violet: 15631086,
1263
+ wheat: 16113331,
1264
+ white: 16777215,
1265
+ whitesmoke: 16119285,
1266
+ yellow: 16776960,
1267
+ yellowgreen: 10145074
1268
+ };
1269
+ En(Se, te, {
1270
+ copy(t) {
1271
+ return Object.assign(new this.constructor(), this, t);
1272
+ },
1273
+ displayable() {
1274
+ return this.rgb().displayable();
1275
+ },
1276
+ hex: Bn,
1277
+ // Deprecated! Use color.formatHex.
1278
+ formatHex: Bn,
1279
+ formatHex8: ms,
1280
+ formatHsl: ys,
1281
+ formatRgb: Kn,
1282
+ toString: Kn
1283
+ });
1284
+ function Bn() {
1285
+ return this.rgb().formatHex();
1286
+ }
1287
+ function ms() {
1288
+ return this.rgb().formatHex8();
1289
+ }
1290
+ function ys() {
1291
+ return Dr(this).formatHsl();
1292
+ }
1293
+ function Kn() {
1294
+ return this.rgb().formatRgb();
1295
+ }
1296
+ function te(t) {
1297
+ var e, n;
1298
+ return t = (t + "").trim().toLowerCase(), (e = cs.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Un(e) : n === 3 ? new pt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ce(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ce(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = us.exec(t)) ? new pt(e[1], e[2], e[3], 1) : (e = fs.exec(t)) ? new pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = hs.exec(t)) ? Ce(e[1], e[2], e[3], e[4]) : (e = ds.exec(t)) ? Ce(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = gs.exec(t)) ? Zn(e[1], e[2] / 100, e[3] / 100, 1) : (e = ps.exec(t)) ? Zn(e[1], e[2] / 100, e[3] / 100, e[4]) : Xn.hasOwnProperty(t) ? Un(Xn[t]) : t === "transparent" ? new pt(NaN, NaN, NaN, 0) : null;
1299
+ }
1300
+ function Un(t) {
1301
+ return new pt(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
1302
+ }
1303
+ function Ce(t, e, n, r) {
1304
+ return r <= 0 && (t = e = n = NaN), new pt(t, e, n, r);
1305
+ }
1306
+ function xs(t) {
1307
+ return t instanceof Se || (t = te(t)), t ? (t = t.rgb(), new pt(t.r, t.g, t.b, t.opacity)) : new pt();
1308
+ }
1309
+ function xn(t, e, n, r) {
1310
+ return arguments.length === 1 ? xs(t) : new pt(t, e, n, r ?? 1);
1311
+ }
1312
+ function pt(t, e, n, r) {
1313
+ this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
1314
+ }
1315
+ En(pt, xn, Cr(Se, {
1316
+ brighter(t) {
1317
+ return t = t == null ? qe : Math.pow(qe, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity);
1318
+ },
1319
+ darker(t) {
1320
+ return t = t == null ? we : Math.pow(we, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity);
1321
+ },
1322
+ rgb() {
1323
+ return this;
1324
+ },
1325
+ clamp() {
1326
+ return new pt(Qt(this.r), Qt(this.g), Qt(this.b), Ve(this.opacity));
1327
+ },
1328
+ displayable() {
1329
+ return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
1330
+ },
1331
+ hex: Jn,
1332
+ // Deprecated! Use color.formatHex.
1333
+ formatHex: Jn,
1334
+ formatHex8: vs,
1335
+ formatRgb: Gn,
1336
+ toString: Gn
1337
+ }));
1338
+ function Jn() {
1339
+ return `#${Zt(this.r)}${Zt(this.g)}${Zt(this.b)}`;
1340
+ }
1341
+ function vs() {
1342
+ return `#${Zt(this.r)}${Zt(this.g)}${Zt(this.b)}${Zt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1343
+ }
1344
+ function Gn() {
1345
+ const t = Ve(this.opacity);
1346
+ return `${t === 1 ? "rgb(" : "rgba("}${Qt(this.r)}, ${Qt(this.g)}, ${Qt(this.b)}${t === 1 ? ")" : `, ${t})`}`;
1347
+ }
1348
+ function Ve(t) {
1349
+ return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
1350
+ }
1351
+ function Qt(t) {
1352
+ return Math.max(0, Math.min(255, Math.round(t) || 0));
1353
+ }
1354
+ function Zt(t) {
1355
+ return t = Qt(t), (t < 16 ? "0" : "") + t.toString(16);
1356
+ }
1357
+ function Zn(t, e, n, r) {
1358
+ return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new At(t, e, n, r);
1359
+ }
1360
+ function Dr(t) {
1361
+ if (t instanceof At) return new At(t.h, t.s, t.l, t.opacity);
1362
+ if (t instanceof Se || (t = te(t)), !t) return new At();
1363
+ if (t instanceof At) return t;
1364
+ t = t.rgb();
1365
+ var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), s = NaN, o = a - i, c = (a + i) / 2;
1366
+ return o ? (e === a ? s = (n - r) / o + (n < r) * 6 : n === a ? s = (r - e) / o + 2 : s = (e - n) / o + 4, o /= c < 0.5 ? a + i : 2 - a - i, s *= 60) : o = c > 0 && c < 1 ? 0 : s, new At(s, o, c, t.opacity);
1367
+ }
1368
+ function _s(t, e, n, r) {
1369
+ return arguments.length === 1 ? Dr(t) : new At(t, e, n, r ?? 1);
1370
+ }
1371
+ function At(t, e, n, r) {
1372
+ this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
1373
+ }
1374
+ En(At, _s, Cr(Se, {
1375
+ brighter(t) {
1376
+ return t = t == null ? qe : Math.pow(qe, t), new At(this.h, this.s, this.l * t, this.opacity);
1377
+ },
1378
+ darker(t) {
1379
+ return t = t == null ? we : Math.pow(we, t), new At(this.h, this.s, this.l * t, this.opacity);
1380
+ },
1381
+ rgb() {
1382
+ var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
1383
+ return new pt(
1384
+ hn(t >= 240 ? t - 240 : t + 120, i, r),
1385
+ hn(t, i, r),
1386
+ hn(t < 120 ? t + 240 : t - 120, i, r),
1387
+ this.opacity
1388
+ );
1389
+ },
1390
+ clamp() {
1391
+ return new At(Qn(this.h), De(this.s), De(this.l), Ve(this.opacity));
1392
+ },
1393
+ displayable() {
1394
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
1395
+ },
1396
+ formatHsl() {
1397
+ const t = Ve(this.opacity);
1398
+ return `${t === 1 ? "hsl(" : "hsla("}${Qn(this.h)}, ${De(this.s) * 100}%, ${De(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
1399
+ }
1400
+ }));
1401
+ function Qn(t) {
1402
+ return t = (t || 0) % 360, t < 0 ? t + 360 : t;
1403
+ }
1404
+ function De(t) {
1405
+ return Math.max(0, Math.min(1, t || 0));
1406
+ }
1407
+ function hn(t, e, n) {
1408
+ return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
1409
+ }
1410
+ const Cn = (t) => () => t;
1411
+ function bs(t, e) {
1412
+ return function(n) {
1413
+ return t + n * e;
1414
+ };
1415
+ }
1416
+ function ws(t, e, n) {
1417
+ return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
1418
+ return Math.pow(t + r * e, n);
1419
+ };
1420
+ }
1421
+ function ks(t) {
1422
+ return (t = +t) == 1 ? Pr : function(e, n) {
1423
+ return n - e ? ws(e, n, t) : Cn(isNaN(e) ? n : e);
1424
+ };
1425
+ }
1426
+ function Pr(t, e) {
1427
+ var n = e - t;
1428
+ return n ? bs(t, n) : Cn(isNaN(t) ? e : t);
1429
+ }
1430
+ const We = (function t(e) {
1431
+ var n = ks(e);
1432
+ function r(i, a) {
1433
+ var s = n((i = xn(i)).r, (a = xn(a)).r), o = n(i.g, a.g), c = n(i.b, a.b), l = Pr(i.opacity, a.opacity);
1434
+ return function(u) {
1435
+ return i.r = s(u), i.g = o(u), i.b = c(u), i.opacity = l(u), i + "";
1436
+ };
1437
+ }
1438
+ return r.gamma = t, r;
1439
+ })(1);
1440
+ function $s(t, e) {
1441
+ e || (e = []);
1442
+ var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i;
1443
+ return function(a) {
1444
+ for (i = 0; i < n; ++i) r[i] = t[i] * (1 - a) + e[i] * a;
1445
+ return r;
1446
+ };
1447
+ }
1448
+ function As(t) {
1449
+ return ArrayBuffer.isView(t) && !(t instanceof DataView);
1450
+ }
1451
+ function Ns(t, e) {
1452
+ var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), a = new Array(n), s;
1453
+ for (s = 0; s < r; ++s) i[s] = Wt(t[s], e[s]);
1454
+ for (; s < n; ++s) a[s] = e[s];
1455
+ return function(o) {
1456
+ for (s = 0; s < r; ++s) a[s] = i[s](o);
1457
+ return a;
1458
+ };
1459
+ }
1460
+ function Ss(t, e) {
1461
+ var n = /* @__PURE__ */ new Date();
1462
+ return t = +t, e = +e, function(r) {
1463
+ return n.setTime(t * (1 - r) + e * r), n;
1464
+ };
1465
+ }
1466
+ function $t(t, e) {
1467
+ return t = +t, e = +e, function(n) {
1468
+ return t * (1 - n) + e * n;
1469
+ };
1470
+ }
1471
+ function Ms(t, e) {
1472
+ var n = {}, r = {}, i;
1473
+ (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {});
1474
+ for (i in e)
1475
+ i in t ? n[i] = Wt(t[i], e[i]) : r[i] = e[i];
1476
+ return function(a) {
1477
+ for (i in n) r[i] = n[i](a);
1478
+ return r;
1479
+ };
1480
+ }
1481
+ var vn = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, dn = new RegExp(vn.source, "g");
1482
+ function Rs(t) {
1483
+ return function() {
1484
+ return t;
1485
+ };
1486
+ }
1487
+ function Ts(t) {
1488
+ return function(e) {
1489
+ return t(e) + "";
1490
+ };
1491
+ }
1492
+ function Lr(t, e) {
1493
+ var n = vn.lastIndex = dn.lastIndex = 0, r, i, a, s = -1, o = [], c = [];
1494
+ for (t = t + "", e = e + ""; (r = vn.exec(t)) && (i = dn.exec(e)); )
1495
+ (a = i.index) > n && (a = e.slice(n, a), o[s] ? o[s] += a : o[++s] = a), (r = r[0]) === (i = i[0]) ? o[s] ? o[s] += i : o[++s] = i : (o[++s] = null, c.push({ i: s, x: $t(r, i) })), n = dn.lastIndex;
1496
+ return n < e.length && (a = e.slice(n), o[s] ? o[s] += a : o[++s] = a), o.length < 2 ? c[0] ? Ts(c[0].x) : Rs(e) : (e = c.length, function(l) {
1497
+ for (var u = 0, h; u < e; ++u) o[(h = c[u]).i] = h.x(l);
1498
+ return o.join("");
1499
+ });
1500
+ }
1501
+ function Wt(t, e) {
1502
+ var n = typeof e, r;
1503
+ return e == null || n === "boolean" ? Cn(e) : (n === "number" ? $t : n === "string" ? (r = te(e)) ? (e = r, We) : Lr : e instanceof te ? We : e instanceof Date ? Ss : As(e) ? $s : Array.isArray(e) ? Ns : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Ms : $t)(t, e);
1504
+ }
1505
+ function Es(t, e) {
1506
+ return t = +t, e = +e, function(n) {
1507
+ return Math.round(t * (1 - n) + e * n);
1508
+ };
1509
+ }
1510
+ var tr = 180 / Math.PI, _n = {
1511
+ translateX: 0,
1512
+ translateY: 0,
1513
+ rotate: 0,
1514
+ skewX: 0,
1515
+ scaleX: 1,
1516
+ scaleY: 1
1517
+ };
1518
+ function Ir(t, e, n, r, i, a) {
1519
+ var s, o, c;
1520
+ return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (c = t * n + e * r) && (n -= t * c, r -= e * c), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, c /= o), t * r < e * n && (t = -t, e = -e, c = -c, s = -s), {
1521
+ translateX: i,
1522
+ translateY: a,
1523
+ rotate: Math.atan2(e, t) * tr,
1524
+ skewX: Math.atan(c) * tr,
1525
+ scaleX: s,
1526
+ scaleY: o
1527
+ };
1528
+ }
1529
+ var Pe;
1530
+ function Cs(t) {
1531
+ const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
1532
+ return e.isIdentity ? _n : Ir(e.a, e.b, e.c, e.d, e.e, e.f);
1533
+ }
1534
+ function Ds(t) {
1535
+ return t == null || (Pe || (Pe = document.createElementNS("http://www.w3.org/2000/svg", "g")), Pe.setAttribute("transform", t), !(t = Pe.transform.baseVal.consolidate())) ? _n : (t = t.matrix, Ir(t.a, t.b, t.c, t.d, t.e, t.f));
1536
+ }
1537
+ function Or(t, e, n, r) {
1538
+ function i(l) {
1539
+ return l.length ? l.pop() + " " : "";
1540
+ }
1541
+ function a(l, u, h, f, d, y) {
1542
+ if (l !== h || u !== f) {
1543
+ var v = d.push("translate(", null, e, null, n);
1544
+ y.push({ i: v - 4, x: $t(l, h) }, { i: v - 2, x: $t(u, f) });
1545
+ } else (h || f) && d.push("translate(" + h + e + f + n);
1546
+ }
1547
+ function s(l, u, h, f) {
1548
+ l !== u ? (l - u > 180 ? u += 360 : u - l > 180 && (l += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: $t(l, u) })) : u && h.push(i(h) + "rotate(" + u + r);
1549
+ }
1550
+ function o(l, u, h, f) {
1551
+ l !== u ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: $t(l, u) }) : u && h.push(i(h) + "skewX(" + u + r);
1552
+ }
1553
+ function c(l, u, h, f, d, y) {
1554
+ if (l !== h || u !== f) {
1555
+ var v = d.push(i(d) + "scale(", null, ",", null, ")");
1556
+ y.push({ i: v - 4, x: $t(l, h) }, { i: v - 2, x: $t(u, f) });
1557
+ } else (h !== 1 || f !== 1) && d.push(i(d) + "scale(" + h + "," + f + ")");
1558
+ }
1559
+ return function(l, u) {
1560
+ var h = [], f = [];
1561
+ return l = t(l), u = t(u), a(l.translateX, l.translateY, u.translateX, u.translateY, h, f), s(l.rotate, u.rotate, h, f), o(l.skewX, u.skewX, h, f), c(l.scaleX, l.scaleY, u.scaleX, u.scaleY, h, f), l = u = null, function(d) {
1562
+ for (var y = -1, v = f.length, L; ++y < v; ) h[(L = f[y]).i] = L.x(d);
1563
+ return h.join("");
1564
+ };
1565
+ };
1566
+ }
1567
+ var Ps = Or(Cs, "px, ", "px)", "deg)"), Ls = Or(Ds, ", ", ")", ")"), ue = 0, xe = 0, me = 0, Hr = 1e3, Xe, ve, Be = 0, ee = 0, nn = 0, $e = typeof performance == "object" && performance.now ? performance : Date, zr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
1568
+ setTimeout(t, 17);
1569
+ };
1570
+ function Dn() {
1571
+ return ee || (zr(Is), ee = $e.now() + nn);
1572
+ }
1573
+ function Is() {
1574
+ ee = 0;
1575
+ }
1576
+ function Ke() {
1577
+ this._call = this._time = this._next = null;
1578
+ }
1579
+ Ke.prototype = jr.prototype = {
1580
+ constructor: Ke,
1581
+ restart: function(t, e, n) {
1582
+ if (typeof t != "function") throw new TypeError("callback is not a function");
1583
+ n = (n == null ? Dn() : +n) + (e == null ? 0 : +e), !this._next && ve !== this && (ve ? ve._next = this : Xe = this, ve = this), this._call = t, this._time = n, bn();
1584
+ },
1585
+ stop: function() {
1586
+ this._call && (this._call = null, this._time = 1 / 0, bn());
1587
+ }
1588
+ };
1589
+ function jr(t, e, n) {
1590
+ var r = new Ke();
1591
+ return r.restart(t, e, n), r;
1592
+ }
1593
+ function Os() {
1594
+ Dn(), ++ue;
1595
+ for (var t = Xe, e; t; )
1596
+ (e = ee - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
1597
+ --ue;
1598
+ }
1599
+ function er() {
1600
+ ee = (Be = $e.now()) + nn, ue = xe = 0;
1601
+ try {
1602
+ Os();
1603
+ } finally {
1604
+ ue = 0, zs(), ee = 0;
1605
+ }
1606
+ }
1607
+ function Hs() {
1608
+ var t = $e.now(), e = t - Be;
1609
+ e > Hr && (nn -= e, Be = t);
1610
+ }
1611
+ function zs() {
1612
+ for (var t, e = Xe, n, r = 1 / 0; e; )
1613
+ e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : Xe = n);
1614
+ ve = t, bn(r);
1615
+ }
1616
+ function bn(t) {
1617
+ if (!ue) {
1618
+ xe && (xe = clearTimeout(xe));
1619
+ var e = t - ee;
1620
+ e > 24 ? (t < 1 / 0 && (xe = setTimeout(er, t - $e.now() - nn)), me && (me = clearInterval(me))) : (me || (Be = $e.now(), me = setInterval(Hs, Hr)), ue = 1, zr(er));
1621
+ }
1622
+ }
1623
+ function nr(t, e, n) {
1624
+ var r = new Ke();
1625
+ return e = e == null ? 0 : +e, r.restart((i) => {
1626
+ r.stop(), t(i + e);
1627
+ }, e, n), r;
1628
+ }
1629
+ var js = vr("start", "end", "cancel", "interrupt"), Fs = [], Fr = 0, rr = 1, wn = 2, He = 3, ir = 4, kn = 5, ze = 6;
1630
+ function rn(t, e, n, r, i, a) {
1631
+ var s = t.__transition;
1632
+ if (!s) t.__transition = {};
1633
+ else if (n in s) return;
1634
+ Ys(t, n, {
1635
+ name: e,
1636
+ index: r,
1637
+ // For context during callback.
1638
+ group: i,
1639
+ // For context during callback.
1640
+ on: js,
1641
+ tween: Fs,
1642
+ time: a.time,
1643
+ delay: a.delay,
1644
+ duration: a.duration,
1645
+ ease: a.ease,
1646
+ timer: null,
1647
+ state: Fr
1648
+ });
1649
+ }
1650
+ function Pn(t, e) {
1651
+ var n = Nt(t, e);
1652
+ if (n.state > Fr) throw new Error("too late; already scheduled");
1653
+ return n;
1654
+ }
1655
+ function Dt(t, e) {
1656
+ var n = Nt(t, e);
1657
+ if (n.state > He) throw new Error("too late; already running");
1658
+ return n;
1659
+ }
1660
+ function Nt(t, e) {
1661
+ var n = t.__transition;
1662
+ if (!n || !(n = n[e])) throw new Error("transition not found");
1663
+ return n;
1664
+ }
1665
+ function Ys(t, e, n) {
1666
+ var r = t.__transition, i;
1667
+ r[e] = n, n.timer = jr(a, 0, n.time);
1668
+ function a(l) {
1669
+ n.state = rr, n.timer.restart(s, n.delay, n.time), n.delay <= l && s(l - n.delay);
1670
+ }
1671
+ function s(l) {
1672
+ var u, h, f, d;
1673
+ if (n.state !== rr) return c();
1674
+ for (u in r)
1675
+ if (d = r[u], d.name === n.name) {
1676
+ if (d.state === He) return nr(s);
1677
+ d.state === ir ? (d.state = ze, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = ze, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]);
1678
+ }
1679
+ if (nr(function() {
1680
+ n.state === He && (n.state = ir, n.timer.restart(o, n.delay, n.time), o(l));
1681
+ }), n.state = wn, n.on.call("start", t, t.__data__, n.index, n.group), n.state === wn) {
1682
+ for (n.state = He, i = new Array(f = n.tween.length), u = 0, h = -1; u < f; ++u)
1683
+ (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d);
1684
+ i.length = h + 1;
1685
+ }
1686
+ }
1687
+ function o(l) {
1688
+ for (var u = l < n.duration ? n.ease.call(null, l / n.duration) : (n.timer.restart(c), n.state = kn, 1), h = -1, f = i.length; ++h < f; )
1689
+ i[h].call(t, u);
1690
+ n.state === kn && (n.on.call("end", t, t.__data__, n.index, n.group), c());
1691
+ }
1692
+ function c() {
1693
+ n.state = ze, n.timer.stop(), delete r[e];
1694
+ for (var l in r) return;
1695
+ delete t.__transition;
1696
+ }
1697
+ }
1698
+ function qs(t, e) {
1699
+ var n = t.__transition, r, i, a = !0, s;
1700
+ if (n) {
1701
+ e = e == null ? null : e + "";
1702
+ for (s in n) {
1703
+ if ((r = n[s]).name !== e) {
1704
+ a = !1;
1705
+ continue;
1706
+ }
1707
+ i = r.state > wn && r.state < kn, r.state = ze, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[s];
1708
+ }
1709
+ a && delete t.__transition;
1710
+ }
1711
+ }
1712
+ function Vs(t) {
1713
+ return this.each(function() {
1714
+ qs(this, t);
1715
+ });
1716
+ }
1717
+ function Ws(t, e) {
1718
+ var n, r;
1719
+ return function() {
1720
+ var i = Dt(this, t), a = i.tween;
1721
+ if (a !== n) {
1722
+ r = n = a;
1723
+ for (var s = 0, o = r.length; s < o; ++s)
1724
+ if (r[s].name === e) {
1725
+ r = r.slice(), r.splice(s, 1);
1726
+ break;
1727
+ }
1728
+ }
1729
+ i.tween = r;
1730
+ };
1731
+ }
1732
+ function Xs(t, e, n) {
1733
+ var r, i;
1734
+ if (typeof n != "function") throw new Error();
1735
+ return function() {
1736
+ var a = Dt(this, t), s = a.tween;
1737
+ if (s !== r) {
1738
+ i = (r = s).slice();
1739
+ for (var o = { name: e, value: n }, c = 0, l = i.length; c < l; ++c)
1740
+ if (i[c].name === e) {
1741
+ i[c] = o;
1742
+ break;
1743
+ }
1744
+ c === l && i.push(o);
1745
+ }
1746
+ a.tween = i;
1747
+ };
1748
+ }
1749
+ function Bs(t, e) {
1750
+ var n = this._id;
1751
+ if (t += "", arguments.length < 2) {
1752
+ for (var r = Nt(this.node(), n).tween, i = 0, a = r.length, s; i < a; ++i)
1753
+ if ((s = r[i]).name === t)
1754
+ return s.value;
1755
+ return null;
1756
+ }
1757
+ return this.each((e == null ? Ws : Xs)(n, t, e));
1758
+ }
1759
+ function Ln(t, e, n) {
1760
+ var r = t._id;
1761
+ return t.each(function() {
1762
+ var i = Dt(this, r);
1763
+ (i.value || (i.value = {}))[e] = n.apply(this, arguments);
1764
+ }), function(i) {
1765
+ return Nt(i, r).value[e];
1766
+ };
1767
+ }
1768
+ function Yr(t, e) {
1769
+ var n;
1770
+ return (typeof e == "number" ? $t : e instanceof te ? We : (n = te(e)) ? (e = n, We) : Lr)(t, e);
1771
+ }
1772
+ function Ks(t) {
1773
+ return function() {
1774
+ this.removeAttribute(t);
1775
+ };
1776
+ }
1777
+ function Us(t) {
1778
+ return function() {
1779
+ this.removeAttributeNS(t.space, t.local);
1780
+ };
1781
+ }
1782
+ function Js(t, e, n) {
1783
+ var r, i = n + "", a;
1784
+ return function() {
1785
+ var s = this.getAttribute(t);
1786
+ return s === i ? null : s === r ? a : a = e(r = s, n);
1787
+ };
1788
+ }
1789
+ function Gs(t, e, n) {
1790
+ var r, i = n + "", a;
1791
+ return function() {
1792
+ var s = this.getAttributeNS(t.space, t.local);
1793
+ return s === i ? null : s === r ? a : a = e(r = s, n);
1794
+ };
1795
+ }
1796
+ function Zs(t, e, n) {
1797
+ var r, i, a;
1798
+ return function() {
1799
+ var s, o = n(this), c;
1800
+ return o == null ? void this.removeAttribute(t) : (s = this.getAttribute(t), c = o + "", s === c ? null : s === r && c === i ? a : (i = c, a = e(r = s, o)));
1801
+ };
1802
+ }
1803
+ function Qs(t, e, n) {
1804
+ var r, i, a;
1805
+ return function() {
1806
+ var s, o = n(this), c;
1807
+ return o == null ? void this.removeAttributeNS(t.space, t.local) : (s = this.getAttributeNS(t.space, t.local), c = o + "", s === c ? null : s === r && c === i ? a : (i = c, a = e(r = s, o)));
1808
+ };
1809
+ }
1810
+ function to(t, e) {
1811
+ var n = en(t), r = n === "transform" ? Ls : Yr;
1812
+ return this.attrTween(t, typeof e == "function" ? (n.local ? Qs : Zs)(n, r, Ln(this, "attr." + t, e)) : e == null ? (n.local ? Us : Ks)(n) : (n.local ? Gs : Js)(n, r, e));
1813
+ }
1814
+ function eo(t, e) {
1815
+ return function(n) {
1816
+ this.setAttribute(t, e.call(this, n));
1817
+ };
1818
+ }
1819
+ function no(t, e) {
1820
+ return function(n) {
1821
+ this.setAttributeNS(t.space, t.local, e.call(this, n));
1822
+ };
1823
+ }
1824
+ function ro(t, e) {
1825
+ var n, r;
1826
+ function i() {
1827
+ var a = e.apply(this, arguments);
1828
+ return a !== r && (n = (r = a) && no(t, a)), n;
1829
+ }
1830
+ return i._value = e, i;
1831
+ }
1832
+ function io(t, e) {
1833
+ var n, r;
1834
+ function i() {
1835
+ var a = e.apply(this, arguments);
1836
+ return a !== r && (n = (r = a) && eo(t, a)), n;
1837
+ }
1838
+ return i._value = e, i;
1839
+ }
1840
+ function ao(t, e) {
1841
+ var n = "attr." + t;
1842
+ if (arguments.length < 2) return (n = this.tween(n)) && n._value;
1843
+ if (e == null) return this.tween(n, null);
1844
+ if (typeof e != "function") throw new Error();
1845
+ var r = en(t);
1846
+ return this.tween(n, (r.local ? ro : io)(r, e));
1847
+ }
1848
+ function so(t, e) {
1849
+ return function() {
1850
+ Pn(this, t).delay = +e.apply(this, arguments);
1851
+ };
1852
+ }
1853
+ function oo(t, e) {
1854
+ return e = +e, function() {
1855
+ Pn(this, t).delay = e;
1856
+ };
1857
+ }
1858
+ function lo(t) {
1859
+ var e = this._id;
1860
+ return arguments.length ? this.each((typeof t == "function" ? so : oo)(e, t)) : Nt(this.node(), e).delay;
1861
+ }
1862
+ function co(t, e) {
1863
+ return function() {
1864
+ Dt(this, t).duration = +e.apply(this, arguments);
1865
+ };
1866
+ }
1867
+ function uo(t, e) {
1868
+ return e = +e, function() {
1869
+ Dt(this, t).duration = e;
1870
+ };
1871
+ }
1872
+ function fo(t) {
1873
+ var e = this._id;
1874
+ return arguments.length ? this.each((typeof t == "function" ? co : uo)(e, t)) : Nt(this.node(), e).duration;
1875
+ }
1876
+ function ho(t, e) {
1877
+ if (typeof e != "function") throw new Error();
1878
+ return function() {
1879
+ Dt(this, t).ease = e;
1880
+ };
1881
+ }
1882
+ function go(t) {
1883
+ var e = this._id;
1884
+ return arguments.length ? this.each(ho(e, t)) : Nt(this.node(), e).ease;
1885
+ }
1886
+ function po(t, e) {
1887
+ return function() {
1888
+ var n = e.apply(this, arguments);
1889
+ if (typeof n != "function") throw new Error();
1890
+ Dt(this, t).ease = n;
1891
+ };
1892
+ }
1893
+ function mo(t) {
1894
+ if (typeof t != "function") throw new Error();
1895
+ return this.each(po(this._id, t));
1896
+ }
1897
+ function yo(t) {
1898
+ typeof t != "function" && (t = wr(t));
1899
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
1900
+ for (var a = e[i], s = a.length, o = r[i] = [], c, l = 0; l < s; ++l)
1901
+ (c = a[l]) && t.call(c, c.__data__, l, a) && o.push(c);
1902
+ return new Ht(r, this._parents, this._name, this._id);
1903
+ }
1904
+ function xo(t) {
1905
+ if (t._id !== this._id) throw new Error();
1906
+ for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), s = new Array(r), o = 0; o < a; ++o)
1907
+ for (var c = e[o], l = n[o], u = c.length, h = s[o] = new Array(u), f, d = 0; d < u; ++d)
1908
+ (f = c[d] || l[d]) && (h[d] = f);
1909
+ for (; o < r; ++o)
1910
+ s[o] = e[o];
1911
+ return new Ht(s, this._parents, this._name, this._id);
1912
+ }
1913
+ function vo(t) {
1914
+ return (t + "").trim().split(/^|\s+/).every(function(e) {
1915
+ var n = e.indexOf(".");
1916
+ return n >= 0 && (e = e.slice(0, n)), !e || e === "start";
1917
+ });
1918
+ }
1919
+ function _o(t, e, n) {
1920
+ var r, i, a = vo(e) ? Pn : Dt;
1921
+ return function() {
1922
+ var s = a(this, t), o = s.on;
1923
+ o !== r && (i = (r = o).copy()).on(e, n), s.on = i;
1924
+ };
1925
+ }
1926
+ function bo(t, e) {
1927
+ var n = this._id;
1928
+ return arguments.length < 2 ? Nt(this.node(), n).on.on(t) : this.each(_o(n, t, e));
1929
+ }
1930
+ function wo(t) {
1931
+ return function() {
1932
+ var e = this.parentNode;
1933
+ for (var n in this.__transition) if (+n !== t) return;
1934
+ e && e.removeChild(this);
1935
+ };
1936
+ }
1937
+ function ko() {
1938
+ return this.on("end.remove", wo(this._id));
1939
+ }
1940
+ function $o(t) {
1941
+ var e = this._name, n = this._id;
1942
+ typeof t != "function" && (t = Rn(t));
1943
+ for (var r = this._groups, i = r.length, a = new Array(i), s = 0; s < i; ++s)
1944
+ for (var o = r[s], c = o.length, l = a[s] = new Array(c), u, h, f = 0; f < c; ++f)
1945
+ (u = o[f]) && (h = t.call(u, u.__data__, f, o)) && ("__data__" in u && (h.__data__ = u.__data__), l[f] = h, rn(l[f], e, n, f, l, Nt(u, n)));
1946
+ return new Ht(a, this._parents, e, n);
1947
+ }
1948
+ function Ao(t) {
1949
+ var e = this._name, n = this._id;
1950
+ typeof t != "function" && (t = br(t));
1951
+ for (var r = this._groups, i = r.length, a = [], s = [], o = 0; o < i; ++o)
1952
+ for (var c = r[o], l = c.length, u, h = 0; h < l; ++h)
1953
+ if (u = c[h]) {
1954
+ for (var f = t.call(u, u.__data__, h, c), d, y = Nt(u, n), v = 0, L = f.length; v < L; ++v)
1955
+ (d = f[v]) && rn(d, e, n, v, f, y);
1956
+ a.push(f), s.push(u);
1957
+ }
1958
+ return new Ht(a, s, e, n);
1959
+ }
1960
+ var No = Ne.prototype.constructor;
1961
+ function So() {
1962
+ return new No(this._groups, this._parents);
1963
+ }
1964
+ function Mo(t, e) {
1965
+ var n, r, i;
1966
+ return function() {
1967
+ var a = ce(this, t), s = (this.style.removeProperty(t), ce(this, t));
1968
+ return a === s ? null : a === n && s === r ? i : i = e(n = a, r = s);
1969
+ };
1970
+ }
1971
+ function qr(t) {
1972
+ return function() {
1973
+ this.style.removeProperty(t);
1974
+ };
1975
+ }
1976
+ function Ro(t, e, n) {
1977
+ var r, i = n + "", a;
1978
+ return function() {
1979
+ var s = ce(this, t);
1980
+ return s === i ? null : s === r ? a : a = e(r = s, n);
1981
+ };
1982
+ }
1983
+ function To(t, e, n) {
1984
+ var r, i, a;
1985
+ return function() {
1986
+ var s = ce(this, t), o = n(this), c = o + "";
1987
+ return o == null && (c = o = (this.style.removeProperty(t), ce(this, t))), s === c ? null : s === r && c === i ? a : (i = c, a = e(r = s, o));
1988
+ };
1989
+ }
1990
+ function Eo(t, e) {
1991
+ var n, r, i, a = "style." + e, s = "end." + a, o;
1992
+ return function() {
1993
+ var c = Dt(this, t), l = c.on, u = c.value[a] == null ? o || (o = qr(e)) : void 0;
1994
+ (l !== n || i !== u) && (r = (n = l).copy()).on(s, i = u), c.on = r;
1995
+ };
1996
+ }
1997
+ function Co(t, e, n) {
1998
+ var r = (t += "") == "transform" ? Ps : Yr;
1999
+ return e == null ? this.styleTween(t, Mo(t, r)).on("end.style." + t, qr(t)) : typeof e == "function" ? this.styleTween(t, To(t, r, Ln(this, "style." + t, e))).each(Eo(this._id, t)) : this.styleTween(t, Ro(t, r, e), n).on("end.style." + t, null);
2000
+ }
2001
+ function Do(t, e, n) {
2002
+ return function(r) {
2003
+ this.style.setProperty(t, e.call(this, r), n);
2004
+ };
2005
+ }
2006
+ function Po(t, e, n) {
2007
+ var r, i;
2008
+ function a() {
2009
+ var s = e.apply(this, arguments);
2010
+ return s !== i && (r = (i = s) && Do(t, s, n)), r;
2011
+ }
2012
+ return a._value = e, a;
2013
+ }
2014
+ function Lo(t, e, n) {
2015
+ var r = "style." + (t += "");
2016
+ if (arguments.length < 2) return (r = this.tween(r)) && r._value;
2017
+ if (e == null) return this.tween(r, null);
2018
+ if (typeof e != "function") throw new Error();
2019
+ return this.tween(r, Po(t, e, n ?? ""));
2020
+ }
2021
+ function Io(t) {
2022
+ return function() {
2023
+ this.textContent = t;
2024
+ };
2025
+ }
2026
+ function Oo(t) {
2027
+ return function() {
2028
+ var e = t(this);
2029
+ this.textContent = e ?? "";
2030
+ };
2031
+ }
2032
+ function Ho(t) {
2033
+ return this.tween("text", typeof t == "function" ? Oo(Ln(this, "text", t)) : Io(t == null ? "" : t + ""));
2034
+ }
2035
+ function zo(t) {
2036
+ return function(e) {
2037
+ this.textContent = t.call(this, e);
2038
+ };
2039
+ }
2040
+ function jo(t) {
2041
+ var e, n;
2042
+ function r() {
2043
+ var i = t.apply(this, arguments);
2044
+ return i !== n && (e = (n = i) && zo(i)), e;
2045
+ }
2046
+ return r._value = t, r;
2047
+ }
2048
+ function Fo(t) {
2049
+ var e = "text";
2050
+ if (arguments.length < 1) return (e = this.tween(e)) && e._value;
2051
+ if (t == null) return this.tween(e, null);
2052
+ if (typeof t != "function") throw new Error();
2053
+ return this.tween(e, jo(t));
2054
+ }
2055
+ function Yo() {
2056
+ for (var t = this._name, e = this._id, n = Vr(), r = this._groups, i = r.length, a = 0; a < i; ++a)
2057
+ for (var s = r[a], o = s.length, c, l = 0; l < o; ++l)
2058
+ if (c = s[l]) {
2059
+ var u = Nt(c, e);
2060
+ rn(c, t, n, l, s, {
2061
+ time: u.time + u.delay + u.duration,
2062
+ delay: 0,
2063
+ duration: u.duration,
2064
+ ease: u.ease
2065
+ });
2066
+ }
2067
+ return new Ht(r, this._parents, t, n);
2068
+ }
2069
+ function qo() {
2070
+ var t, e, n = this, r = n._id, i = n.size();
2071
+ return new Promise(function(a, s) {
2072
+ var o = { value: s }, c = { value: function() {
2073
+ --i === 0 && a();
2074
+ } };
2075
+ n.each(function() {
2076
+ var l = Dt(this, r), u = l.on;
2077
+ u !== t && (e = (t = u).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(c)), l.on = e;
2078
+ }), i === 0 && a();
2079
+ });
2080
+ }
2081
+ var Vo = 0;
2082
+ function Ht(t, e, n, r) {
2083
+ this._groups = t, this._parents = e, this._name = n, this._id = r;
2084
+ }
2085
+ function Vr() {
2086
+ return ++Vo;
2087
+ }
2088
+ var It = Ne.prototype;
2089
+ Ht.prototype = {
2090
+ constructor: Ht,
2091
+ select: $o,
2092
+ selectAll: Ao,
2093
+ selectChild: It.selectChild,
2094
+ selectChildren: It.selectChildren,
2095
+ filter: yo,
2096
+ merge: xo,
2097
+ selection: So,
2098
+ transition: Yo,
2099
+ call: It.call,
2100
+ nodes: It.nodes,
2101
+ node: It.node,
2102
+ size: It.size,
2103
+ empty: It.empty,
2104
+ each: It.each,
2105
+ on: bo,
2106
+ attr: to,
2107
+ attrTween: ao,
2108
+ style: Co,
2109
+ styleTween: Lo,
2110
+ text: Ho,
2111
+ textTween: Fo,
2112
+ remove: ko,
2113
+ tween: Bs,
2114
+ delay: lo,
2115
+ duration: fo,
2116
+ ease: go,
2117
+ easeVarying: mo,
2118
+ end: qo,
2119
+ [Symbol.iterator]: It[Symbol.iterator]
2120
+ };
2121
+ function Wo(t) {
2122
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
2123
+ }
2124
+ var Xo = {
2125
+ time: null,
2126
+ // Set on use.
2127
+ delay: 0,
2128
+ duration: 250,
2129
+ ease: Wo
2130
+ };
2131
+ function Bo(t, e) {
2132
+ for (var n; !(n = t.__transition) || !(n = n[e]); )
2133
+ if (!(t = t.parentNode))
2134
+ throw new Error(`transition ${e} not found`);
2135
+ return n;
2136
+ }
2137
+ function Ko(t) {
2138
+ var e, n;
2139
+ t instanceof Ht ? (e = t._id, t = t._name) : (e = Vr(), (n = Xo).time = Dn(), t = t == null ? null : t + "");
2140
+ for (var r = this._groups, i = r.length, a = 0; a < i; ++a)
2141
+ for (var s = r[a], o = s.length, c, l = 0; l < o; ++l)
2142
+ (c = s[l]) && rn(c, t, e, l, s, n || Bo(c, e));
2143
+ return new Ht(r, this._parents, t, e);
2144
+ }
2145
+ Ne.prototype.interrupt = Vs;
2146
+ Ne.prototype.transition = Ko;
2147
+ const $n = Math.PI, An = 2 * $n, Gt = 1e-6, Uo = An - Gt;
2148
+ function Wr(t) {
2149
+ this._ += t[0];
2150
+ for (let e = 1, n = t.length; e < n; ++e)
2151
+ this._ += arguments[e] + t[e];
2152
+ }
2153
+ function Jo(t) {
2154
+ let e = Math.floor(t);
2155
+ if (!(e >= 0)) throw new Error(`invalid digits: ${t}`);
2156
+ if (e > 15) return Wr;
2157
+ const n = 10 ** e;
2158
+ return function(r) {
2159
+ this._ += r[0];
2160
+ for (let i = 1, a = r.length; i < a; ++i)
2161
+ this._ += Math.round(arguments[i] * n) / n + r[i];
2162
+ };
2163
+ }
2164
+ class Go {
2165
+ constructor(e) {
2166
+ this._x0 = this._y0 = // start of current subpath
2167
+ this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Wr : Jo(e);
2168
+ }
2169
+ moveTo(e, n) {
2170
+ this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`;
2171
+ }
2172
+ closePath() {
2173
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
2174
+ }
2175
+ lineTo(e, n) {
2176
+ this._append`L${this._x1 = +e},${this._y1 = +n}`;
2177
+ }
2178
+ quadraticCurveTo(e, n, r, i) {
2179
+ this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`;
2180
+ }
2181
+ bezierCurveTo(e, n, r, i, a, s) {
2182
+ this._append`C${+e},${+n},${+r},${+i},${this._x1 = +a},${this._y1 = +s}`;
2183
+ }
2184
+ arcTo(e, n, r, i, a) {
2185
+ if (e = +e, n = +n, r = +r, i = +i, a = +a, a < 0) throw new Error(`negative radius: ${a}`);
2186
+ let s = this._x1, o = this._y1, c = r - e, l = i - n, u = s - e, h = o - n, f = u * u + h * h;
2187
+ if (this._x1 === null)
2188
+ this._append`M${this._x1 = e},${this._y1 = n}`;
2189
+ else if (f > Gt) if (!(Math.abs(h * c - l * u) > Gt) || !a)
2190
+ this._append`L${this._x1 = e},${this._y1 = n}`;
2191
+ else {
2192
+ let d = r - s, y = i - o, v = c * c + l * l, L = d * d + y * y, $ = Math.sqrt(v), I = Math.sqrt(f), A = a * Math.tan(($n - Math.acos((v + f - L) / (2 * $ * I))) / 2), O = A / I, E = A / $;
2193
+ Math.abs(O - 1) > Gt && this._append`L${e + O * u},${n + O * h}`, this._append`A${a},${a},0,0,${+(h * d > u * y)},${this._x1 = e + E * c},${this._y1 = n + E * l}`;
2194
+ }
2195
+ }
2196
+ arc(e, n, r, i, a, s) {
2197
+ if (e = +e, n = +n, r = +r, s = !!s, r < 0) throw new Error(`negative radius: ${r}`);
2198
+ let o = r * Math.cos(i), c = r * Math.sin(i), l = e + o, u = n + c, h = 1 ^ s, f = s ? i - a : a - i;
2199
+ this._x1 === null ? this._append`M${l},${u}` : (Math.abs(this._x1 - l) > Gt || Math.abs(this._y1 - u) > Gt) && this._append`L${l},${u}`, r && (f < 0 && (f = f % An + An), f > Uo ? this._append`A${r},${r},0,1,${h},${e - o},${n - c}A${r},${r},0,1,${h},${this._x1 = l},${this._y1 = u}` : f > Gt && this._append`A${r},${r},0,${+(f >= $n)},${h},${this._x1 = e + r * Math.cos(a)},${this._y1 = n + r * Math.sin(a)}`);
2200
+ }
2201
+ rect(e, n, r, i) {
2202
+ this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`;
2203
+ }
2204
+ toString() {
2205
+ return this._;
2206
+ }
2207
+ }
2208
+ function Zo(t) {
2209
+ return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
2210
+ }
2211
+ function Ue(t, e) {
2212
+ if ((n = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e")) < 0) return null;
2213
+ var n, r = t.slice(0, n);
2214
+ return [
2215
+ r.length > 1 ? r[0] + r.slice(2) : r,
2216
+ +t.slice(n + 1)
2217
+ ];
2218
+ }
2219
+ function fe(t) {
2220
+ return t = Ue(Math.abs(t)), t ? t[1] : NaN;
2221
+ }
2222
+ function Qo(t, e) {
2223
+ return function(n, r) {
2224
+ for (var i = n.length, a = [], s = 0, o = t[0], c = 0; i > 0 && o > 0 && (c + o + 1 > r && (o = Math.max(1, r - c)), a.push(n.substring(i -= o, i + o)), !((c += o + 1) > r)); )
2225
+ o = t[s = (s + 1) % t.length];
2226
+ return a.reverse().join(e);
2227
+ };
2228
+ }
2229
+ function tl(t) {
2230
+ return function(e) {
2231
+ return e.replace(/[0-9]/g, function(n) {
2232
+ return t[+n];
2233
+ });
2234
+ };
2235
+ }
2236
+ var el = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
2237
+ function Je(t) {
2238
+ if (!(e = el.exec(t))) throw new Error("invalid format: " + t);
2239
+ var e;
2240
+ return new In({
2241
+ fill: e[1],
2242
+ align: e[2],
2243
+ sign: e[3],
2244
+ symbol: e[4],
2245
+ zero: e[5],
2246
+ width: e[6],
2247
+ comma: e[7],
2248
+ precision: e[8] && e[8].slice(1),
2249
+ trim: e[9],
2250
+ type: e[10]
2251
+ });
2252
+ }
2253
+ Je.prototype = In.prototype;
2254
+ function In(t) {
2255
+ this.fill = t.fill === void 0 ? " " : t.fill + "", this.align = t.align === void 0 ? ">" : t.align + "", this.sign = t.sign === void 0 ? "-" : t.sign + "", this.symbol = t.symbol === void 0 ? "" : t.symbol + "", this.zero = !!t.zero, this.width = t.width === void 0 ? void 0 : +t.width, this.comma = !!t.comma, this.precision = t.precision === void 0 ? void 0 : +t.precision, this.trim = !!t.trim, this.type = t.type === void 0 ? "" : t.type + "";
2256
+ }
2257
+ In.prototype.toString = function() {
2258
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
2259
+ };
2260
+ function nl(t) {
2261
+ t: for (var e = t.length, n = 1, r = -1, i; n < e; ++n)
2262
+ switch (t[n]) {
2263
+ case ".":
2264
+ r = i = n;
2265
+ break;
2266
+ case "0":
2267
+ r === 0 && (r = n), i = n;
2268
+ break;
2269
+ default:
2270
+ if (!+t[n]) break t;
2271
+ r > 0 && (r = 0);
2272
+ break;
2273
+ }
2274
+ return r > 0 ? t.slice(0, r) + t.slice(i + 1) : t;
2275
+ }
2276
+ var Xr;
2277
+ function rl(t, e) {
2278
+ var n = Ue(t, e);
2279
+ if (!n) return t + "";
2280
+ var r = n[0], i = n[1], a = i - (Xr = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, s = r.length;
2281
+ return a === s ? r : a > s ? r + new Array(a - s + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + Ue(t, Math.max(0, e + a - 1))[0];
2282
+ }
2283
+ function ar(t, e) {
2284
+ var n = Ue(t, e);
2285
+ if (!n) return t + "";
2286
+ var r = n[0], i = n[1];
2287
+ return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
2288
+ }
2289
+ const sr = {
2290
+ "%": (t, e) => (t * 100).toFixed(e),
2291
+ b: (t) => Math.round(t).toString(2),
2292
+ c: (t) => t + "",
2293
+ d: Zo,
2294
+ e: (t, e) => t.toExponential(e),
2295
+ f: (t, e) => t.toFixed(e),
2296
+ g: (t, e) => t.toPrecision(e),
2297
+ o: (t) => Math.round(t).toString(8),
2298
+ p: (t, e) => ar(t * 100, e),
2299
+ r: ar,
2300
+ s: rl,
2301
+ X: (t) => Math.round(t).toString(16).toUpperCase(),
2302
+ x: (t) => Math.round(t).toString(16)
2303
+ };
2304
+ function or(t) {
2305
+ return t;
2306
+ }
2307
+ var lr = Array.prototype.map, cr = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
2308
+ function il(t) {
2309
+ var e = t.grouping === void 0 || t.thousands === void 0 ? or : Qo(lr.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", a = t.numerals === void 0 ? or : tl(lr.call(t.numerals, String)), s = t.percent === void 0 ? "%" : t.percent + "", o = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
2310
+ function l(h) {
2311
+ h = Je(h);
2312
+ var f = h.fill, d = h.align, y = h.sign, v = h.symbol, L = h.zero, $ = h.width, I = h.comma, A = h.precision, O = h.trim, E = h.type;
2313
+ E === "n" ? (I = !0, E = "g") : sr[E] || (A === void 0 && (A = 12), O = !0, E = "g"), (L || f === "0" && d === "=") && (L = !0, f = "0", d = "=");
2314
+ var V = v === "$" ? n : v === "#" && /[boxX]/.test(E) ? "0" + E.toLowerCase() : "", q = v === "$" ? r : /[%p]/.test(E) ? s : "", F = sr[E], j = /[defgprs%]/.test(E);
2315
+ A = A === void 0 ? 6 : /[gprs]/.test(E) ? Math.max(1, Math.min(21, A)) : Math.max(0, Math.min(20, A));
2316
+ function U(x) {
2317
+ var b = V, m = q, M, it, C;
2318
+ if (E === "c")
2319
+ m = F(x) + m, x = "";
2320
+ else {
2321
+ x = +x;
2322
+ var k = x < 0 || 1 / x < 0;
2323
+ if (x = isNaN(x) ? c : F(Math.abs(x), A), O && (x = nl(x)), k && +x == 0 && y !== "+" && (k = !1), b = (k ? y === "(" ? y : o : y === "-" || y === "(" ? "" : y) + b, m = (E === "s" ? cr[8 + Xr / 3] : "") + m + (k && y === "(" ? ")" : ""), j) {
2324
+ for (M = -1, it = x.length; ++M < it; )
2325
+ if (C = x.charCodeAt(M), 48 > C || C > 57) {
2326
+ m = (C === 46 ? i + x.slice(M + 1) : x.slice(M)) + m, x = x.slice(0, M);
2327
+ break;
2328
+ }
2329
+ }
2330
+ }
2331
+ I && !L && (x = e(x, 1 / 0));
2332
+ var S = b.length + x.length + m.length, z = S < $ ? new Array($ - S + 1).join(f) : "";
2333
+ switch (I && L && (x = e(z + x, z.length ? $ - m.length : 1 / 0), z = ""), d) {
2334
+ case "<":
2335
+ x = b + x + m + z;
2336
+ break;
2337
+ case "=":
2338
+ x = b + z + x + m;
2339
+ break;
2340
+ case "^":
2341
+ x = z.slice(0, S = z.length >> 1) + b + x + m + z.slice(S);
2342
+ break;
2343
+ default:
2344
+ x = z + b + x + m;
2345
+ break;
2346
+ }
2347
+ return a(x);
2348
+ }
2349
+ return U.toString = function() {
2350
+ return h + "";
2351
+ }, U;
2352
+ }
2353
+ function u(h, f) {
2354
+ var d = l((h = Je(h), h.type = "f", h)), y = Math.max(-8, Math.min(8, Math.floor(fe(f) / 3))) * 3, v = Math.pow(10, -y), L = cr[8 + y / 3];
2355
+ return function($) {
2356
+ return d(v * $) + L;
2357
+ };
2358
+ }
2359
+ return {
2360
+ format: l,
2361
+ formatPrefix: u
2362
+ };
2363
+ }
2364
+ var Le, re, Br;
2365
+ al({
2366
+ thousands: ",",
2367
+ grouping: [3],
2368
+ currency: ["$", ""]
2369
+ });
2370
+ function al(t) {
2371
+ return Le = il(t), re = Le.format, Br = Le.formatPrefix, Le;
2372
+ }
2373
+ function sl(t) {
2374
+ return Math.max(0, -fe(Math.abs(t)));
2375
+ }
2376
+ function ol(t, e) {
2377
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(fe(e) / 3))) * 3 - fe(Math.abs(t)));
2378
+ }
2379
+ function ll(t, e) {
2380
+ return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0, fe(e) - fe(t)) + 1;
2381
+ }
2382
+ function On(t, e) {
2383
+ switch (arguments.length) {
2384
+ case 0:
2385
+ break;
2386
+ case 1:
2387
+ this.range(t);
2388
+ break;
2389
+ default:
2390
+ this.range(e).domain(t);
2391
+ break;
2392
+ }
2393
+ return this;
2394
+ }
2395
+ const ur = Symbol("implicit");
2396
+ function Kr() {
2397
+ var t = new Fn(), e = [], n = [], r = ur;
2398
+ function i(a) {
2399
+ let s = t.get(a);
2400
+ if (s === void 0) {
2401
+ if (r !== ur) return r;
2402
+ t.set(a, s = e.push(a) - 1);
2403
+ }
2404
+ return n[s % n.length];
2405
+ }
2406
+ return i.domain = function(a) {
2407
+ if (!arguments.length) return e.slice();
2408
+ e = [], t = new Fn();
2409
+ for (const s of a)
2410
+ t.has(s) || t.set(s, e.push(s) - 1);
2411
+ return i;
2412
+ }, i.range = function(a) {
2413
+ return arguments.length ? (n = Array.from(a), i) : n.slice();
2414
+ }, i.unknown = function(a) {
2415
+ return arguments.length ? (r = a, i) : r;
2416
+ }, i.copy = function() {
2417
+ return Kr(e, n).unknown(r);
2418
+ }, On.apply(i, arguments), i;
2419
+ }
2420
+ function he() {
2421
+ var t = Kr().unknown(void 0), e = t.domain, n = t.range, r = 0, i = 1, a, s, o = !1, c = 0, l = 0, u = 0.5;
2422
+ delete t.unknown;
2423
+ function h() {
2424
+ var f = e().length, d = i < r, y = d ? i : r, v = d ? r : i;
2425
+ a = (v - y) / Math.max(1, f - c + l * 2), o && (a = Math.floor(a)), y += (v - y - a * (f - c)) * u, s = a * (1 - c), o && (y = Math.round(y), s = Math.round(s));
2426
+ var L = vi(f).map(function($) {
2427
+ return y + a * $;
2428
+ });
2429
+ return n(d ? L.reverse() : L);
2430
+ }
2431
+ return t.domain = function(f) {
2432
+ return arguments.length ? (e(f), h()) : e();
2433
+ }, t.range = function(f) {
2434
+ return arguments.length ? ([r, i] = f, r = +r, i = +i, h()) : [r, i];
2435
+ }, t.rangeRound = function(f) {
2436
+ return [r, i] = f, r = +r, i = +i, o = !0, h();
2437
+ }, t.bandwidth = function() {
2438
+ return s;
2439
+ }, t.step = function() {
2440
+ return a;
2441
+ }, t.round = function(f) {
2442
+ return arguments.length ? (o = !!f, h()) : o;
2443
+ }, t.padding = function(f) {
2444
+ return arguments.length ? (c = Math.min(1, l = +f), h()) : c;
2445
+ }, t.paddingInner = function(f) {
2446
+ return arguments.length ? (c = Math.min(1, f), h()) : c;
2447
+ }, t.paddingOuter = function(f) {
2448
+ return arguments.length ? (l = +f, h()) : l;
2449
+ }, t.align = function(f) {
2450
+ return arguments.length ? (u = Math.max(0, Math.min(1, f)), h()) : u;
2451
+ }, t.copy = function() {
2452
+ return he(e(), [r, i]).round(o).paddingInner(c).paddingOuter(l).align(u);
2453
+ }, On.apply(h(), arguments);
2454
+ }
2455
+ function cl(t) {
2456
+ return function() {
2457
+ return t;
2458
+ };
2459
+ }
2460
+ function ul(t) {
2461
+ return +t;
2462
+ }
2463
+ var fr = [0, 1];
2464
+ function ie(t) {
2465
+ return t;
2466
+ }
2467
+ function Nn(t, e) {
2468
+ return (e -= t = +t) ? function(n) {
2469
+ return (n - t) / e;
2470
+ } : cl(isNaN(e) ? NaN : 0.5);
2471
+ }
2472
+ function fl(t, e) {
2473
+ var n;
2474
+ return t > e && (n = t, t = e, e = n), function(r) {
2475
+ return Math.max(t, Math.min(e, r));
2476
+ };
2477
+ }
2478
+ function hl(t, e, n) {
2479
+ var r = t[0], i = t[1], a = e[0], s = e[1];
2480
+ return i < r ? (r = Nn(i, r), a = n(s, a)) : (r = Nn(r, i), a = n(a, s)), function(o) {
2481
+ return a(r(o));
2482
+ };
2483
+ }
2484
+ function dl(t, e, n) {
2485
+ var r = Math.min(t.length, e.length) - 1, i = new Array(r), a = new Array(r), s = -1;
2486
+ for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++s < r; )
2487
+ i[s] = Nn(t[s], t[s + 1]), a[s] = n(e[s], e[s + 1]);
2488
+ return function(o) {
2489
+ var c = ui(t, o, 1, r) - 1;
2490
+ return a[c](i[c](o));
2491
+ };
2492
+ }
2493
+ function gl(t, e) {
2494
+ return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());
2495
+ }
2496
+ function pl() {
2497
+ var t = fr, e = fr, n = Wt, r, i, a, s = ie, o, c, l;
2498
+ function u() {
2499
+ var f = Math.min(t.length, e.length);
2500
+ return s !== ie && (s = fl(t[0], t[f - 1])), o = f > 2 ? dl : hl, c = l = null, h;
2501
+ }
2502
+ function h(f) {
2503
+ return f == null || isNaN(f = +f) ? a : (c || (c = o(t.map(r), e, n)))(r(s(f)));
2504
+ }
2505
+ return h.invert = function(f) {
2506
+ return s(i((l || (l = o(e, t.map(r), $t)))(f)));
2507
+ }, h.domain = function(f) {
2508
+ return arguments.length ? (t = Array.from(f, ul), u()) : t.slice();
2509
+ }, h.range = function(f) {
2510
+ return arguments.length ? (e = Array.from(f), u()) : e.slice();
2511
+ }, h.rangeRound = function(f) {
2512
+ return e = Array.from(f), n = Es, u();
2513
+ }, h.clamp = function(f) {
2514
+ return arguments.length ? (s = f ? !0 : ie, u()) : s !== ie;
2515
+ }, h.interpolate = function(f) {
2516
+ return arguments.length ? (n = f, u()) : n;
2517
+ }, h.unknown = function(f) {
2518
+ return arguments.length ? (a = f, h) : a;
2519
+ }, function(f, d) {
2520
+ return r = f, i = d, u();
2521
+ };
2522
+ }
2523
+ function ml() {
2524
+ return pl()(ie, ie);
2525
+ }
2526
+ function yl(t, e, n, r) {
2527
+ var i = xi(t, e, n), a;
2528
+ switch (r = Je(r ?? ",f"), r.type) {
2529
+ case "s": {
2530
+ var s = Math.max(Math.abs(t), Math.abs(e));
2531
+ return r.precision == null && !isNaN(a = ol(i, s)) && (r.precision = a), Br(r, s);
2532
+ }
2533
+ case "":
2534
+ case "e":
2535
+ case "g":
2536
+ case "p":
2537
+ case "r": {
2538
+ r.precision == null && !isNaN(a = ll(i, Math.max(Math.abs(t), Math.abs(e)))) && (r.precision = a - (r.type === "e"));
2539
+ break;
2540
+ }
2541
+ case "f":
2542
+ case "%": {
2543
+ r.precision == null && !isNaN(a = sl(i)) && (r.precision = a - (r.type === "%") * 2);
2544
+ break;
2545
+ }
2546
+ }
2547
+ return re(r);
2548
+ }
2549
+ function xl(t) {
2550
+ var e = t.domain;
2551
+ return t.ticks = function(n) {
2552
+ var r = e();
2553
+ return yi(r[0], r[r.length - 1], n ?? 10);
2554
+ }, t.tickFormat = function(n, r) {
2555
+ var i = e();
2556
+ return yl(i[0], i[i.length - 1], n ?? 10, r);
2557
+ }, t.nice = function(n) {
2558
+ n == null && (n = 10);
2559
+ var r = e(), i = 0, a = r.length - 1, s = r[i], o = r[a], c, l, u = 10;
2560
+ for (o < s && (l = s, s = o, o = l, l = i, i = a, a = l); u-- > 0; ) {
2561
+ if (l = pn(s, o, n), l === c)
2562
+ return r[i] = s, r[a] = o, e(r);
2563
+ if (l > 0)
2564
+ s = Math.floor(s / l) * l, o = Math.ceil(o / l) * l;
2565
+ else if (l < 0)
2566
+ s = Math.ceil(s * l) / l, o = Math.floor(o * l) / l;
2567
+ else
2568
+ break;
2569
+ c = l;
2570
+ }
2571
+ return t;
2572
+ }, t;
2573
+ }
2574
+ function ne() {
2575
+ var t = ml();
2576
+ return t.copy = function() {
2577
+ return gl(t, ne());
2578
+ }, On.apply(t, arguments), xl(t);
2579
+ }
2580
+ function Me(t) {
2581
+ for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6);
2582
+ return n;
2583
+ }
2584
+ const Ur = Me("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"), Jr = Me("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"), Gr = Me("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"), Zr = Me("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"), Qr = Me("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
2585
+ function lt(t) {
2586
+ return function() {
2587
+ return t;
2588
+ };
2589
+ }
2590
+ const hr = Math.abs, ht = Math.atan2, Jt = Math.cos, vl = Math.max, gn = Math.min, Rt = Math.sin, ae = Math.sqrt, gt = 1e-12, Ae = Math.PI, Ge = Ae / 2, je = 2 * Ae;
2591
+ function _l(t) {
2592
+ return t > 1 ? 0 : t < -1 ? Ae : Math.acos(t);
2593
+ }
2594
+ function dr(t) {
2595
+ return t >= 1 ? Ge : t <= -1 ? -Ge : Math.asin(t);
2596
+ }
2597
+ function bl(t) {
2598
+ let e = 3;
2599
+ return t.digits = function(n) {
2600
+ if (!arguments.length) return e;
2601
+ if (n == null)
2602
+ e = null;
2603
+ else {
2604
+ const r = Math.floor(n);
2605
+ if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`);
2606
+ e = r;
2607
+ }
2608
+ return t;
2609
+ }, () => new Go(e);
2610
+ }
2611
+ function wl(t) {
2612
+ return t.innerRadius;
2613
+ }
2614
+ function kl(t) {
2615
+ return t.outerRadius;
2616
+ }
2617
+ function $l(t) {
2618
+ return t.startAngle;
2619
+ }
2620
+ function Al(t) {
2621
+ return t.endAngle;
2622
+ }
2623
+ function Nl(t) {
2624
+ return t && t.padAngle;
2625
+ }
2626
+ function Sl(t, e, n, r, i, a, s, o) {
2627
+ var c = n - t, l = r - e, u = s - i, h = o - a, f = h * c - u * l;
2628
+ if (!(f * f < gt))
2629
+ return f = (u * (e - a) - h * (t - i)) / f, [t + f * c, e + f * l];
2630
+ }
2631
+ function Ie(t, e, n, r, i, a, s) {
2632
+ var o = t - n, c = e - r, l = (s ? a : -a) / ae(o * o + c * c), u = l * c, h = -l * o, f = t + u, d = e + h, y = n + u, v = r + h, L = (f + y) / 2, $ = (d + v) / 2, I = y - f, A = v - d, O = I * I + A * A, E = i - a, V = f * v - y * d, q = (A < 0 ? -1 : 1) * ae(vl(0, E * E * O - V * V)), F = (V * A - I * q) / O, j = (-V * I - A * q) / O, U = (V * A + I * q) / O, x = (-V * I + A * q) / O, b = F - L, m = j - $, M = U - L, it = x - $;
2633
+ return b * b + m * m > M * M + it * it && (F = U, j = x), {
2634
+ cx: F,
2635
+ cy: j,
2636
+ x01: -u,
2637
+ y01: -h,
2638
+ x11: F * (i / E - 1),
2639
+ y11: j * (i / E - 1)
2640
+ };
2641
+ }
2642
+ function gr() {
2643
+ var t = wl, e = kl, n = lt(0), r = null, i = $l, a = Al, s = Nl, o = null, c = bl(l);
2644
+ function l() {
2645
+ var u, h, f = +t.apply(this, arguments), d = +e.apply(this, arguments), y = i.apply(this, arguments) - Ge, v = a.apply(this, arguments) - Ge, L = hr(v - y), $ = v > y;
2646
+ if (o || (o = u = c()), d < f && (h = d, d = f, f = h), !(d > gt)) o.moveTo(0, 0);
2647
+ else if (L > je - gt)
2648
+ o.moveTo(d * Jt(y), d * Rt(y)), o.arc(0, 0, d, y, v, !$), f > gt && (o.moveTo(f * Jt(v), f * Rt(v)), o.arc(0, 0, f, v, y, $));
2649
+ else {
2650
+ var I = y, A = v, O = y, E = v, V = L, q = L, F = s.apply(this, arguments) / 2, j = F > gt && (r ? +r.apply(this, arguments) : ae(f * f + d * d)), U = gn(hr(d - f) / 2, +n.apply(this, arguments)), x = U, b = U, m, M;
2651
+ if (j > gt) {
2652
+ var it = dr(j / f * Rt(F)), C = dr(j / d * Rt(F));
2653
+ (V -= it * 2) > gt ? (it *= $ ? 1 : -1, O += it, E -= it) : (V = 0, O = E = (y + v) / 2), (q -= C * 2) > gt ? (C *= $ ? 1 : -1, I += C, A -= C) : (q = 0, I = A = (y + v) / 2);
2654
+ }
2655
+ var k = d * Jt(I), S = d * Rt(I), z = f * Jt(E), G = f * Rt(E);
2656
+ if (U > gt) {
2657
+ var g = d * Jt(A), _ = d * Rt(A), N = f * Jt(O), Y = f * Rt(O), Z;
2658
+ if (L < Ae)
2659
+ if (Z = Sl(k, S, N, Y, g, _, z, G)) {
2660
+ var at = k - Z[0], et = S - Z[1], rt = g - Z[0], st = _ - Z[1], ft = 1 / Rt(_l((at * rt + et * st) / (ae(at * at + et * et) * ae(rt * rt + st * st))) / 2), D = ae(Z[0] * Z[0] + Z[1] * Z[1]);
2661
+ x = gn(U, (f - D) / (ft - 1)), b = gn(U, (d - D) / (ft + 1));
2662
+ } else
2663
+ x = b = 0;
2664
+ }
2665
+ q > gt ? b > gt ? (m = Ie(N, Y, k, S, d, b, $), M = Ie(g, _, z, G, d, b, $), o.moveTo(m.cx + m.x01, m.cy + m.y01), b < U ? o.arc(m.cx, m.cy, b, ht(m.y01, m.x01), ht(M.y01, M.x01), !$) : (o.arc(m.cx, m.cy, b, ht(m.y01, m.x01), ht(m.y11, m.x11), !$), o.arc(0, 0, d, ht(m.cy + m.y11, m.cx + m.x11), ht(M.cy + M.y11, M.cx + M.x11), !$), o.arc(M.cx, M.cy, b, ht(M.y11, M.x11), ht(M.y01, M.x01), !$))) : (o.moveTo(k, S), o.arc(0, 0, d, I, A, !$)) : o.moveTo(k, S), !(f > gt) || !(V > gt) ? o.lineTo(z, G) : x > gt ? (m = Ie(z, G, g, _, f, -x, $), M = Ie(k, S, N, Y, f, -x, $), o.lineTo(m.cx + m.x01, m.cy + m.y01), x < U ? o.arc(m.cx, m.cy, x, ht(m.y01, m.x01), ht(M.y01, M.x01), !$) : (o.arc(m.cx, m.cy, x, ht(m.y01, m.x01), ht(m.y11, m.x11), !$), o.arc(0, 0, f, ht(m.cy + m.y11, m.cx + m.x11), ht(M.cy + M.y11, M.cx + M.x11), $), o.arc(M.cx, M.cy, x, ht(M.y11, M.x11), ht(M.y01, M.x01), !$))) : o.arc(0, 0, f, E, O, $);
2666
+ }
2667
+ if (o.closePath(), u) return o = null, u + "" || null;
2668
+ }
2669
+ return l.centroid = function() {
2670
+ var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +a.apply(this, arguments)) / 2 - Ae / 2;
2671
+ return [Jt(h) * u, Rt(h) * u];
2672
+ }, l.innerRadius = function(u) {
2673
+ return arguments.length ? (t = typeof u == "function" ? u : lt(+u), l) : t;
2674
+ }, l.outerRadius = function(u) {
2675
+ return arguments.length ? (e = typeof u == "function" ? u : lt(+u), l) : e;
2676
+ }, l.cornerRadius = function(u) {
2677
+ return arguments.length ? (n = typeof u == "function" ? u : lt(+u), l) : n;
2678
+ }, l.padRadius = function(u) {
2679
+ return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : lt(+u), l) : r;
2680
+ }, l.startAngle = function(u) {
2681
+ return arguments.length ? (i = typeof u == "function" ? u : lt(+u), l) : i;
2682
+ }, l.endAngle = function(u) {
2683
+ return arguments.length ? (a = typeof u == "function" ? u : lt(+u), l) : a;
2684
+ }, l.padAngle = function(u) {
2685
+ return arguments.length ? (s = typeof u == "function" ? u : lt(+u), l) : s;
2686
+ }, l.context = function(u) {
2687
+ return arguments.length ? (o = u ?? null, l) : o;
2688
+ }, l;
2689
+ }
2690
+ function ti(t) {
2691
+ return typeof t == "object" && "length" in t ? t : Array.from(t);
2692
+ }
2693
+ function Ml(t, e) {
2694
+ return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
2695
+ }
2696
+ function Rl(t) {
2697
+ return t;
2698
+ }
2699
+ function Tl() {
2700
+ var t = Rl, e = Ml, n = null, r = lt(0), i = lt(je), a = lt(0);
2701
+ function s(o) {
2702
+ var c, l = (o = ti(o)).length, u, h, f = 0, d = new Array(l), y = new Array(l), v = +r.apply(this, arguments), L = Math.min(je, Math.max(-je, i.apply(this, arguments) - v)), $, I = Math.min(Math.abs(L) / l, a.apply(this, arguments)), A = I * (L < 0 ? -1 : 1), O;
2703
+ for (c = 0; c < l; ++c)
2704
+ (O = y[d[c] = c] = +t(o[c], c, o)) > 0 && (f += O);
2705
+ for (e != null ? d.sort(function(E, V) {
2706
+ return e(y[E], y[V]);
2707
+ }) : n != null && d.sort(function(E, V) {
2708
+ return n(o[E], o[V]);
2709
+ }), c = 0, h = f ? (L - l * A) / f : 0; c < l; ++c, v = $)
2710
+ u = d[c], O = y[u], $ = v + (O > 0 ? O * h : 0) + A, y[u] = {
2711
+ data: o[u],
2712
+ index: c,
2713
+ value: O,
2714
+ startAngle: v,
2715
+ endAngle: $,
2716
+ padAngle: I
2717
+ };
2718
+ return y;
2719
+ }
2720
+ return s.value = function(o) {
2721
+ return arguments.length ? (t = typeof o == "function" ? o : lt(+o), s) : t;
2722
+ }, s.sortValues = function(o) {
2723
+ return arguments.length ? (e = o, n = null, s) : e;
2724
+ }, s.sort = function(o) {
2725
+ return arguments.length ? (n = o, e = null, s) : n;
2726
+ }, s.startAngle = function(o) {
2727
+ return arguments.length ? (r = typeof o == "function" ? o : lt(+o), s) : r;
2728
+ }, s.endAngle = function(o) {
2729
+ return arguments.length ? (i = typeof o == "function" ? o : lt(+o), s) : i;
2730
+ }, s.padAngle = function(o) {
2731
+ return arguments.length ? (a = typeof o == "function" ? o : lt(+o), s) : a;
2732
+ }, s;
2733
+ }
2734
+ function Sn(t, e) {
2735
+ if ((s = t.length) > 1)
2736
+ for (var n = 1, r, i, a = t[e[0]], s, o = a.length; n < s; ++n)
2737
+ for (i = a, a = t[e[n]], r = 0; r < o; ++r)
2738
+ a[r][1] += a[r][0] = isNaN(i[r][1]) ? i[r][0] : i[r][1];
2739
+ }
2740
+ function Mn(t) {
2741
+ for (var e = t.length, n = new Array(e); --e >= 0; ) n[e] = e;
2742
+ return n;
2743
+ }
2744
+ function El(t, e) {
2745
+ return t[e];
2746
+ }
2747
+ function Cl(t) {
2748
+ const e = [];
2749
+ return e.key = t, e;
2750
+ }
2751
+ function Ze() {
2752
+ var t = lt([]), e = Mn, n = Sn, r = El;
2753
+ function i(a) {
2754
+ var s = Array.from(t.apply(this, arguments), Cl), o, c = s.length, l = -1, u;
2755
+ for (const h of a)
2756
+ for (o = 0, ++l; o < c; ++o)
2757
+ (s[o][l] = [0, +r(h, s[o].key, l, a)]).data = h;
2758
+ for (o = 0, u = ti(e(s)); o < c; ++o)
2759
+ s[u[o]].index = o;
2760
+ return n(s, u), s;
2761
+ }
2762
+ return i.keys = function(a) {
2763
+ return arguments.length ? (t = typeof a == "function" ? a : lt(Array.from(a)), i) : t;
2764
+ }, i.value = function(a) {
2765
+ return arguments.length ? (r = typeof a == "function" ? a : lt(+a), i) : r;
2766
+ }, i.order = function(a) {
2767
+ return arguments.length ? (e = a == null ? Mn : typeof a == "function" ? a : lt(Array.from(a)), i) : e;
2768
+ }, i.offset = function(a) {
2769
+ return arguments.length ? (n = a ?? Sn, i) : n;
2770
+ }, i;
2771
+ }
2772
+ function Dl(t, e) {
2773
+ if ((r = t.length) > 0) {
2774
+ for (var n, r, i = 0, a = t[0].length, s; i < a; ++i) {
2775
+ for (s = n = 0; n < r; ++n) s += t[n][i][1] || 0;
2776
+ if (s) for (n = 0; n < r; ++n) t[n][i][1] /= s;
2777
+ }
2778
+ Sn(t, e);
2779
+ }
2780
+ }
2781
+ function _e(t, e, n) {
2782
+ this.k = t, this.x = e, this.y = n;
2783
+ }
2784
+ _e.prototype = {
2785
+ constructor: _e,
2786
+ scale: function(t) {
2787
+ return t === 1 ? this : new _e(this.k * t, this.x, this.y);
2788
+ },
2789
+ translate: function(t, e) {
2790
+ return t === 0 & e === 0 ? this : new _e(this.k, this.x + this.k * t, this.y + this.k * e);
2791
+ },
2792
+ apply: function(t) {
2793
+ return [t[0] * this.k + this.x, t[1] * this.k + this.y];
2794
+ },
2795
+ applyX: function(t) {
2796
+ return t * this.k + this.x;
2797
+ },
2798
+ applyY: function(t) {
2799
+ return t * this.k + this.y;
2800
+ },
2801
+ invert: function(t) {
2802
+ return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
2803
+ },
2804
+ invertX: function(t) {
2805
+ return (t - this.x) / this.k;
2806
+ },
2807
+ invertY: function(t) {
2808
+ return (t - this.y) / this.k;
2809
+ },
2810
+ rescaleX: function(t) {
2811
+ return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t));
2812
+ },
2813
+ rescaleY: function(t) {
2814
+ return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t));
2815
+ },
2816
+ toString: function() {
2817
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2818
+ }
2819
+ };
2820
+ _e.prototype;
2821
+ const zt = (t, e) => {
2822
+ const n = Qe(null);
2823
+ return _t(() => {
2824
+ e !== void 0 && n.current && t(bt(n.current));
2825
+ }, e === null ? void 0 : e), n;
2826
+ };
2827
+ function Re() {
2828
+ const t = Qe(null), [e, n] = ot({ width: 0, height: 0 });
2829
+ return _t(() => {
2830
+ const r = t.current;
2831
+ if (!r || !r.parentElement) return;
2832
+ const i = r.parentElement, a = () => {
2833
+ const o = i.getBoundingClientRect();
2834
+ n({ width: o.width, height: o.height });
2835
+ };
2836
+ a();
2837
+ const s = new ResizeObserver(() => a());
2838
+ return s.observe(i), () => s.disconnect();
2839
+ }, []), [t, e];
2840
+ }
2841
+ function an() {
2842
+ const [t, e] = ot(null);
2843
+ return _t(() => {
2844
+ const n = typeof document < "u" ? document.getElementById("UI-controls") : null;
2845
+ e(n);
2846
+ }, []), t;
2847
+ }
2848
+ const wt = (t) => {
2849
+ try {
2850
+ return JSON.parse(JSON.stringify(t));
2851
+ } catch {
2852
+ return console.log("error when cloning object : "), Array.isArray(t) ? [] : null;
2853
+ }
2854
+ }, se = [
2855
+ "#34D399",
2856
+ /* non - tailwind */
2857
+ "#6ee7b7",
2858
+ "#10b981",
2859
+ "#059669",
2860
+ "#bef264",
2861
+ "#a3e635",
2862
+ "#84cc16",
2863
+ "#86efac",
2864
+ "#4ade80",
2865
+ "#16a34a",
2866
+ "#5eead4",
2867
+ "#2dd4bf",
2868
+ "#14b8a6",
2869
+ "#67e8f9",
2870
+ "#22d3ee",
2871
+ "#06b6d4",
2872
+ "#7dd3fc",
2873
+ "#38bdf8",
2874
+ "#0ea5e9",
2875
+ "#93c5fd",
2876
+ "#60a5fa",
2877
+ "#3b82f6",
2878
+ "#a5b4fc",
2879
+ "#818cf8",
2880
+ "#6366f1",
2881
+ "#a78bfa",
2882
+ "#8b5cf6",
2883
+ "#7c3aed",
2884
+ "#d8b4fe",
2885
+ "#c084fc",
2886
+ "#a855f7",
2887
+ "#f9a8d4",
2888
+ "#f472b6",
2889
+ "#ec4899",
2890
+ "#fb7185",
2891
+ "#f43f5e",
2892
+ "#db2777",
2893
+ "#fca5a5",
2894
+ "#f87171",
2895
+ "#ef4444",
2896
+ "#fdba74",
2897
+ "#fb923c",
2898
+ "#f97316",
2899
+ "#fcd34d",
2900
+ "#fbbf24",
2901
+ "#f59e0b",
2902
+ "#fde047",
2903
+ "#facc15",
2904
+ "#eab308"
2905
+ ];
2906
+ _i([
2907
+ ...Gr,
2908
+ ...Jr,
2909
+ ...Zr,
2910
+ ...Qr,
2911
+ ...Ur
2912
+ ]);
2913
+ const pr = [
2914
+ ...Gr,
2915
+ ...Jr,
2916
+ ...Zr,
2917
+ ...Qr,
2918
+ ...Ur
2919
+ ], vt = (t, e = !0) => {
2920
+ const n = e ? [...se, ...pr] : [...pr, ...se];
2921
+ return t < n.length ? n[t] : n[t % n.length];
2922
+ }, oe = (t) => t < se.length ? se[t] : se[t % se.length], Bt = (t) => re(",")(t);
2923
+ function Pl(t, e, n) {
2924
+ const { top: r } = e.getBoundingClientRect(), i = t.clientY - r;
2925
+ return {
2926
+ pixelY: i,
2927
+ dataY: n.invert(i)
2928
+ };
2929
+ }
2930
+ const Ll = "_tooltip_4lu3m_3", Il = "_title_4lu3m_167", Xt = {
2931
+ tooltip: Ll,
2932
+ "tooltip--arrow-up": "_tooltip--arrow-up_4lu3m_73",
2933
+ "tooltip--arrow-down": "_tooltip--arrow-down_4lu3m_101",
2934
+ title: Il,
2935
+ "text-small": "_text-small_4lu3m_213",
2936
+ "right-label": "_right-label_4lu3m_225"
2937
+ }, sn = ({ pCount: t }) => /* @__PURE__ */ T.jsxs("div", { id: "tooltip", className: `${Xt.tooltip}`, children: [
2938
+ !t && /* @__PURE__ */ T.jsx("p", { className: `${Xt["text-small"]}` }),
2939
+ t === 3 && /* @__PURE__ */ T.jsxs(T.Fragment, { children: [
2940
+ /* @__PURE__ */ T.jsx("p", { className: `title ${Xt.title}` }),
2941
+ /* @__PURE__ */ T.jsx("p", { className: `top-label ${Xt["right-label"]}` }),
2942
+ /* @__PURE__ */ T.jsx("p", { className: `bottom-label ${Xt["right-label"]}` })
2943
+ ] })
2944
+ ] }), on = (t, e = "tooltip") => t.select(`#${e}`).style("pointer-events", "none").style("position", "fixed").style("left", "auto").style("top", "auto").style("bottom", "auto").style("right", "auto").style("padding", "8px 5px").style("max-width", "200px").style("opacity", 0);
2945
+ function ln(t, e) {
2946
+ const { e: n, svg: r, yScale: i } = e, { pixelY: a } = Pl(n, r, i), s = a < 100 ? "bottom" : "top", { offsetWidth: o, offsetHeight: c } = t.node() || {}, l = typeof document < "u" ? document.documentElement.clientWidth : 0, u = n.x - o / 2;
2947
+ let h = 0;
2948
+ if (u < 0)
2949
+ h = 0;
2950
+ else if (u + o > l) {
2951
+ const d = u + o - l;
2952
+ h = u - d;
2953
+ } else
2954
+ h = u;
2955
+ const f = s === "top" ? Xt["tooltip--arrow-down"] : Xt["tooltip--arrow-up"];
2956
+ t.attr("class", `${Xt.tooltip} ${f}`).style("left", h + "px").style(
2957
+ "top",
2958
+ s === "top" ? n.y - (c + 20) + "px" : n.y + 30 + "px"
2959
+ );
2960
+ }
2961
+ const Ot = "#d1d5db", Ol = "_disabled_18scr_67", tt = {
2962
+ "controls-container": "_controls-container_18scr_1",
2963
+ "fill-container": "_fill-container_18scr_25",
2964
+ "controls-label": "_controls-label_18scr_41",
2965
+ disabled: Ol,
2966
+ "controls-checkbox": "_controls-checkbox_18scr_75",
2967
+ "chart-svg": "_chart-svg_18scr_89"
2968
+ }, Hl = "_rotatedAxisText_f02qn_1", zl = "_axisText_f02qn_11", mr = {
2969
+ rotatedAxisText: Hl,
2970
+ axisText: zl
2971
+ }, Te = (t) => {
2972
+ const e = Qe([]);
2973
+ return _t(() => {
2974
+ const n = e.current;
2975
+ if (t.length === 0) {
2976
+ e.current = [];
2977
+ return;
2978
+ }
2979
+ const r = t.some((a) => n.includes(a)), i = t.filter((a) => !n.includes(a));
2980
+ if (!r) {
2981
+ e.current = [...t];
2982
+ return;
2983
+ }
2984
+ if (i.length > 0) {
2985
+ e.current = [...n, ...i];
2986
+ return;
2987
+ }
2988
+ }, [t]), e;
2989
+ };
2990
+ function uc({
2991
+ data: t,
2992
+ color: {
2993
+ idx: e = 0,
2994
+ // default idx
2995
+ type: n = "fixed"
2996
+ // default type
2997
+ } = { idx: 0, type: "fixed" },
2998
+ orientation: r = "vertical"
2999
+ }) {
3000
+ const [i, a] = Re(), { width: s, height: o } = a, [c, l] = ot(!1), u = Te(t.map((L) => L.label)), h = an(), f = /* @__PURE__ */ T.jsx(
3001
+ "div",
3002
+ {
3003
+ id: "controls",
3004
+ className: `${tt["controls-container"]} ${h ? tt["fill-container"] : ""}`,
3005
+ children: /* @__PURE__ */ T.jsxs("label", { className: tt["controls-label"], children: [
3006
+ /* @__PURE__ */ T.jsx(
3007
+ "input",
3008
+ {
3009
+ type: "checkbox",
3010
+ className: tt["controls-checkbox"],
3011
+ checked: c,
3012
+ onChange: (L) => l(L.target.checked)
3013
+ }
3014
+ ),
3015
+ "Sort"
3016
+ ] })
3017
+ }
3018
+ ), d = { idx: e, type: n }, y = 750, v = zt((L) => {
3019
+ if (s === 0 || o === 0) return;
3020
+ const $ = {
3021
+ top: 20,
3022
+ right: 30,
3023
+ bottom: r === "vertical" ? 50 : 30,
3024
+ left: r === "vertical" ? 25 : 50
3025
+ }, I = c ? wt(t).sort((C, k) => k.value - C.value) : wt(t), A = L.select("svg"), O = A.node(), E = A.select(".plot-area").attr("transform", "translate(" + $.left + "," + $.top + ")"), V = on(L).style("opacity", 0), F = s > 1024 ? mr.axisText : mr.rotatedAxisText, j = s - $.left - $.right, U = o - $.top - $.bottom, x = he().domain(I.map((C) => C.label)).rangeRound(r === "vertical" ? [0, j] : [U, 0]).padding(0.1), b = ne().domain([0, Et(I, (C) => C.value) ?? 0]).rangeRound(r === "vertical" ? [U, 0] : [0, j]), m = r === "vertical" ? Kt(x).tickValues(x.domain()).scale(x).tickSizeOuter(0) : Kt(b).ticks(null, "s");
3026
+ E.select(".x-axis").attr("transform", `translate(0, ${U})`).transition().duration(y).call(m).selectAll("text").attr("class", F), ne().domain([0, Et(I, (C) => C.value) ?? 0]).rangeRound([o - $.bottom, $.top]);
3027
+ const M = r === "vertical" ? Ut(b).ticks(null, "s") : Ut(x).tickSizeOuter(0);
3028
+ E.select(".y-axis").attr("transform", "translate(0, 0)").transition().duration(y).call(M);
3029
+ const it = (C) => {
3030
+ const { idx: k, type: S } = d, z = u.current.findIndex((G) => G === C.label);
3031
+ return oe(S === "fixed" ? k : k + z);
3032
+ };
3033
+ E.selectAll(".bar").data(I, (C) => C.label).join(
3034
+ (C) => C.append("rect").attr("class", "bar").attr("x", function(k) {
3035
+ return r === "vertical" ? x(k.label) ?? 0 : b(0);
3036
+ }).attr("width", function(k) {
3037
+ return r === "vertical" ? x.bandwidth() : 0;
3038
+ }).attr("y", function(k) {
3039
+ return r === "vertical" ? b(0) : x(k.label) ?? 0;
3040
+ }).attr("height", function() {
3041
+ return r === "vertical" ? 0 : x.bandwidth();
3042
+ }).attr("fill", it).transition().duration(y).attr("y", function(k) {
3043
+ return r === "vertical" ? b(k.value) : x(k.label) ?? 0;
3044
+ }).attr("width", function(k) {
3045
+ return r === "vertical" ? x.bandwidth() : b(k.value);
3046
+ }).attr("height", function(k) {
3047
+ return r === "vertical" ? b(0) - b(k.value) : x.bandwidth();
3048
+ }),
3049
+ void 0,
3050
+ (C) => C.transition().duration(y).attr("fill", Ot).attr("height", 0).attr("y", o).style("opacity", 0).remove()
3051
+ ).on(
3052
+ "mouseover",
3053
+ (C, k) => {
3054
+ E.selectAll("rect.bar").filter((S) => S.label === k.label).style("stroke", "#71717a").style("stroke-width", 1), V.style("opacity", 1).select("p").text(k.label + ` : ${re(",")(k.value)}`), bt(".x-axis").selectAll("text").filter((S) => S === k.label).style("font-weight", "bold");
3055
+ }
3056
+ ).on("mousemove", (C, k) => {
3057
+ ln(V, { e: C, svg: O, yScale: b });
3058
+ }).on(
3059
+ "mouseout",
3060
+ (C, k) => {
3061
+ E.selectAll("rect.bar").filter((S) => S.label === k.label).style("stroke", "none").style("stroke-width", 0), V.style("opacity", 0), bt(".x-axis").selectAll("text").filter((S) => S === k.label).style("font-weight", "normal");
3062
+ }
3063
+ ).transition().duration(y).attr("fill", it).attr("x", function(C) {
3064
+ return r === "vertical" ? x(C.label) ?? 0 : b(0);
3065
+ }).attr("width", function(C) {
3066
+ return r === "vertical" ? x.bandwidth() : b(C.value);
3067
+ }).attr("y", function(C) {
3068
+ return r === "vertical" ? b(C.value) : x(C.label) ?? 0;
3069
+ }).attr("height", function(C) {
3070
+ return r === "vertical" ? b(0) - b(C.value) : x.bandwidth();
3071
+ });
3072
+ }, [t, d, s, o, c, r]);
3073
+ return /* @__PURE__ */ T.jsxs(
3074
+ "div",
3075
+ {
3076
+ ref: i,
3077
+ style: { width: s, height: o, display: "flex", flexDirection: "column" },
3078
+ children: [
3079
+ h && tn(f, h),
3080
+ /* @__PURE__ */ T.jsxs(
3081
+ "div",
3082
+ {
3083
+ ref: v,
3084
+ className: `${tt["fill-container"]}`,
3085
+ style: { display: "flex", flexDirection: "column", position: "relative" },
3086
+ children: [
3087
+ /* @__PURE__ */ T.jsx(
3088
+ "svg",
3089
+ {
3090
+ className: `${tt["chart-svg"]} ${tt["fill-container"]}`,
3091
+ style: {},
3092
+ viewBox: `0 0 ${s} ${o}`,
3093
+ children: /* @__PURE__ */ T.jsxs("g", { className: "plot-area", children: [
3094
+ /* @__PURE__ */ T.jsx("g", { className: "y-axis" }),
3095
+ /* @__PURE__ */ T.jsx("g", { className: "x-axis" })
3096
+ ] })
3097
+ }
3098
+ ),
3099
+ !h && /* @__PURE__ */ T.jsxs(
3100
+ "label",
3101
+ {
3102
+ className: tt["controls-label"],
3103
+ style: { position: "absolute", right: "12px", top: "6px" },
3104
+ children: [
3105
+ /* @__PURE__ */ T.jsx(
3106
+ "input",
3107
+ {
3108
+ type: "checkbox",
3109
+ className: tt["controls-checkbox"],
3110
+ checked: c,
3111
+ onChange: (L) => l(L.target.checked)
3112
+ }
3113
+ ),
3114
+ "Sort"
3115
+ ]
3116
+ }
3117
+ ),
3118
+ /* @__PURE__ */ T.jsx(sn, {})
3119
+ ]
3120
+ }
3121
+ )
3122
+ ]
3123
+ }
3124
+ );
3125
+ }
3126
+ function cn() {
3127
+ const t = Qe(null), [e, n] = ot({ width: 0, height: 0 });
3128
+ return _t(() => {
3129
+ const r = t.current;
3130
+ if (!r) return;
3131
+ const i = new ResizeObserver(([a]) => {
3132
+ a?.contentRect && n({
3133
+ width: a.contentRect.width,
3134
+ height: a.contentRect.height
3135
+ });
3136
+ });
3137
+ return i.observe(r, { box: "border-box" }), n({
3138
+ width: r.offsetWidth,
3139
+ height: r.offsetHeight
3140
+ }), () => {
3141
+ i.disconnect();
3142
+ };
3143
+ }, []), [t, e];
3144
+ }
3145
+ const jl = "_legend_7ftsg_1", Fl = "_pieSlice_7ftsg_77", Yl = "_pieSliceNotHovered_7ftsg_87", ql = "_animateNotHovered_7ftsg_1", Vl = "_pieSliceExit_7ftsg_111", Wl = "_animateHide_7ftsg_1", Xl = "_pieLabelEnter_7ftsg_129", Bl = "_showText_7ftsg_1", Kl = "_pieLabelUnhover_7ftsg_153", Ul = "_pieLabelUpdate_7ftsg_183", Jl = "_pieLabelExit_7ftsg_197", Tt = {
3146
+ legend: jl,
3147
+ "legend-active": "_legend-active_7ftsg_1",
3148
+ "legend-rect": "_legend-rect_7ftsg_21",
3149
+ "legend-label": "_legend-label_7ftsg_35",
3150
+ pieSlice: Fl,
3151
+ pieSliceNotHovered: Yl,
3152
+ animateNotHovered: ql,
3153
+ pieSliceExit: Vl,
3154
+ animateHide: Wl,
3155
+ pieLabelEnter: Xl,
3156
+ showText: Bl,
3157
+ pieLabelUnhover: Kl,
3158
+ pieLabelUpdate: Ul,
3159
+ pieLabelExit: Jl
3160
+ };
3161
+ function fc({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r = 0 }) {
3162
+ const [i, a] = Re(), { width: s, height: o } = a, [c, l] = cn(), { width: u, height: h } = l, f = Te(t.map((q) => q.label)), [d, y] = ot([]), [v, L] = ot(!1), [$, I] = ot(""), A = 750, O = zt((q) => {
3163
+ const j = (n && v ? wt(t).sort((x, b) => x.value - b.value) : t).map((x) => x.label);
3164
+ q.selectAll(".legend-item").data([...j], (x) => x).join(
3165
+ (x) => {
3166
+ const b = x.append("div").attr("class", function(m) {
3167
+ return `${Tt[m === $ ? "legend-active" : "legend"]} legend-item`;
3168
+ }).style("left", "-10px").style("top", function(m, M) {
3169
+ return `${M * 20 + 10}px`;
3170
+ }).style("opacity", 0);
3171
+ return b.append("div").attr("class", `rect ${Tt["legend-rect"]}`).style("background-color", (m) => oe(f.current.findIndex((M) => M === m) + r)), b.append("span").attr("class", Tt["legend-label"]).style("color", (m) => "#333").text((m) => m), b.transition().duration(A).style("left", "6px").style("opacity", 1), b;
3172
+ },
3173
+ (x) => (x.attr("class", (b) => `
3174
+ ${Tt[b === $ ? "legend-active" : "legend"]} legend-item`).transition().duration(A).style("top", function(b, m) {
3175
+ return `${m * 20 + 10}px`;
3176
+ }).style("left", "6px").style("opacity", 1).select("div.rect").attr("class", `rect ${Tt["legend-rect"]}`).style("background-color", (b) => oe(f.current.findIndex((m) => m === b) + r)), x.select("span").style("color", (b) => "#333").text((b) => b), x),
3177
+ (x) => x.transition().duration(A).style("opacity", 0).style("left", "30px").remove()
3178
+ ).on("mouseover", (x, b) => {
3179
+ I(b);
3180
+ }).on("mouseout", () => {
3181
+ I("");
3182
+ });
3183
+ }, [t, r, u, h, $, v, n]), E = zt((q) => {
3184
+ if (u === 0 || h === 0) return;
3185
+ const F = { x: u / 2, y: h / 2 }, j = { top: 10, right: 20, bottom: 10, left: 20 }, U = t, x = u - (j.left + j.right), b = h - (j.top + j.bottom), m = Math.min(x, b) / 2, M = U.reduce((D, nt) => D + nt.value, 0), it = q.select(".plot-area").attr("transform", "translate(" + F.x + "," + F.y + ")"), C = Tl().value(function(D) {
3186
+ return D.value;
3187
+ }).sort(function(D, nt) {
3188
+ return v ? be(D.value, nt.value) : 0;
3189
+ }), k = wt(U), S = C(k), z = wt(k);
3190
+ y(C(z));
3191
+ let G = z.length > k.length;
3192
+ const g = d.map((D) => D.data.label), _ = S.map((D) => D.data.label);
3193
+ g.every((D) => G ? !1 : _.includes(D) ? !0 : (G = !0, !1));
3194
+ const N = d.length === 0, Z = gr().innerRadius(e * m).outerRadius(m - 12), at = gr().innerRadius(e * m).outerRadius(m), et = (D, nt) => {
3195
+ const K = Wt(
3196
+ nt === "exit" ? D.endAngle : D.startAngle,
3197
+ nt === "exit" ? D.startAngle : D.endAngle
3198
+ ), J = D.data.label === $;
3199
+ return function(ct) {
3200
+ return D.endAngle = K(ct), J ? at(D) || "" : Z(D) || "";
3201
+ };
3202
+ };
3203
+ it.selectAll("path").data(S, function(D) {
3204
+ return D.data.label;
3205
+ }).join(
3206
+ (D) => {
3207
+ const nt = D.append("path").attr("class", Tt.pieSlice).attr("fill", function(K) {
3208
+ const J = f.current.findIndex((ct) => ct === K.data.label) + r;
3209
+ return oe(J);
3210
+ });
3211
+ return nt.transition().duration(A).delay(N ? 0 : A).attr("d", Z).attrTween("d", function(K) {
3212
+ if (!N)
3213
+ return et(K, "not exit");
3214
+ const J = Wt(0, K.startAngle), ct = Wt(0, K.endAngle), St = K.data.label === $;
3215
+ return function(Pt) {
3216
+ return K.startAngle = J(Pt), K.endAngle = ct(Pt), St ? at(K) : Z(K);
3217
+ };
3218
+ }), nt;
3219
+ },
3220
+ (D) => {
3221
+ const nt = D;
3222
+ return D.transition().duration(A).attr("fill", function(K, J) {
3223
+ const ct = f.current.findIndex((St) => St === K.data.label) + r;
3224
+ return oe(ct);
3225
+ }).attrTween("d", function(K) {
3226
+ const J = d.find((xt) => xt.data.label === K.data.label), ct = J && J.startAngle ? J.startAngle : 0, St = Wt(ct, K.startAngle), Pt = J && J.endAngle ? J.endAngle : 0, jt = Wt(Pt, K.endAngle), Ft = K.data.label === $;
3227
+ return function(xt) {
3228
+ return K.startAngle = St(xt), K.endAngle = jt(xt), Ft ? at(K) || "" : Z(K) || "";
3229
+ };
3230
+ }), nt;
3231
+ },
3232
+ (D) => D.attr("class", Tt.pieSliceExit).transition().duration(A).attr("fill", Ot).attrTween("d", function(nt) {
3233
+ return et(nt, "exit");
3234
+ }).remove()
3235
+ ).on("mouseover", function(D, nt) {
3236
+ I(nt.data.label);
3237
+ }).on("mouseout", () => {
3238
+ I("");
3239
+ });
3240
+ const st = (D) => U.length === 1 ? "translate(0, 0)" : `translate(${Z.centroid(D)})`, ft = (D) => {
3241
+ const nt = D.value / M;
3242
+ return re(".1%")(nt);
3243
+ };
3244
+ it.selectAll("text").data(S, function(D) {
3245
+ return D.data.label;
3246
+ }).join(
3247
+ (D) => {
3248
+ const nt = D.append("text").text(ft).attr("class", Tt.pieLabelEnter);
3249
+ return nt.merge(nt).transition().duration(A).delay(
3250
+ A
3251
+ /* + exitDelay*/
3252
+ ).attr("transform", st), nt;
3253
+ },
3254
+ (D) => {
3255
+ const nt = D.text(ft);
3256
+ return D.merge(nt).attr("class", Tt.pieLabelUpdate).transition().duration($ !== "" ? 250 : A).style("opacity", function(K) {
3257
+ const J = $ === K.data.label;
3258
+ return $ === "" || J ? 1 : 0;
3259
+ }).attr("transform", st), nt;
3260
+ },
3261
+ (D) => D.transition().duration(A / 2).attr("class", Tt.pieLabelExit).remove()
3262
+ );
3263
+ }, [t, r, e, u, h, v, $]), V = s > o;
3264
+ return /* @__PURE__ */ T.jsxs(
3265
+ "div",
3266
+ {
3267
+ ref: i,
3268
+ style: {
3269
+ width: s,
3270
+ height: o,
3271
+ position: "relative",
3272
+ display: "flex",
3273
+ flexDirection: V ? "row" : "column",
3274
+ overflow: "hidden"
3275
+ },
3276
+ children: [
3277
+ /* @__PURE__ */ T.jsx(
3278
+ "div",
3279
+ {
3280
+ ref: c,
3281
+ style: {
3282
+ flex: 1,
3283
+ position: "relative",
3284
+ display: "flex"
3285
+ },
3286
+ children: /* @__PURE__ */ T.jsx(
3287
+ "svg",
3288
+ {
3289
+ ref: E,
3290
+ className: `${tt["chart-svg"]} ${tt["fill-container"]}`,
3291
+ viewBox: `0 0 ${u} ${h}`,
3292
+ children: /* @__PURE__ */ T.jsx("g", { className: "plot-area" })
3293
+ }
3294
+ )
3295
+ }
3296
+ ),
3297
+ /* @__PURE__ */ T.jsx(
3298
+ "div",
3299
+ {
3300
+ style: {
3301
+ width: V ? s > 480 ? "180px" : "100px" : "100%",
3302
+ height: V ? "100%" : o > 400 ? "180px" : "100px",
3303
+ flexShrink: 0,
3304
+ overflowY: "auto",
3305
+ background: "rgba(255, 255, 255)",
3306
+ borderLeft: V ? "1px solid #ddd" : "none",
3307
+ borderTop: V ? "none" : "1px solid #ddd",
3308
+ padding: "0px"
3309
+ },
3310
+ children: /* @__PURE__ */ T.jsx(
3311
+ "div",
3312
+ {
3313
+ ref: O,
3314
+ className: "legends-content",
3315
+ style: {
3316
+ display: "flex",
3317
+ flexDirection: "column",
3318
+ gap: "6px",
3319
+ padding: "8px 8px 16px 8px",
3320
+ boxSizing: "border-box",
3321
+ position: "relative"
3322
+ }
3323
+ }
3324
+ )
3325
+ }
3326
+ ),
3327
+ /* @__PURE__ */ T.jsxs(
3328
+ "label",
3329
+ {
3330
+ className: tt["controls-label"],
3331
+ style: { position: "absolute", left: "12px", top: "6px" },
3332
+ children: [
3333
+ /* @__PURE__ */ T.jsx(
3334
+ "input",
3335
+ {
3336
+ type: "checkbox",
3337
+ className: tt["controls-checkbox"],
3338
+ checked: v,
3339
+ onChange: (q) => L(q.target.checked)
3340
+ }
3341
+ ),
3342
+ "Sort"
3343
+ ]
3344
+ }
3345
+ )
3346
+ ]
3347
+ }
3348
+ );
3349
+ }
3350
+ const Gl = "_rect_brzcg_201", Zl = "_rectCard_brzcg_201", Ql = "_rectLegendNotHovered_brzcg_221", tc = "_legend_brzcg_1", ec = "_rectHoveredLegend_brzcg_257", nc = "_rectCardLegendHovered_brzcg_267", rc = "_rectLegendHovered_brzcg_279", ic = "_rotatedAxisText_brzcg_301", ac = "_axisText_brzcg_311", sc = "_hoveredAxisText_brzcg_321", oc = "_yAxisLabel_brzcg_335", B = {
3351
+ "legends-container": "_legends-container_brzcg_1",
3352
+ "legend-container": "_legend-container_brzcg_61",
3353
+ "legend-container-active": "_legend-container-active_brzcg_61",
3354
+ "legend-container-inactive": "_legend-container-inactive_brzcg_61",
3355
+ "legend-rect": "_legend-rect_brzcg_105",
3356
+ "legend-label": "_legend-label_brzcg_121",
3357
+ rect: Gl,
3358
+ rectCard: Zl,
3359
+ rectLegendNotHovered: Ql,
3360
+ legend: tc,
3361
+ rectHoveredLegend: ec,
3362
+ rectCardLegendHovered: nc,
3363
+ rectLegendHovered: rc,
3364
+ rotatedAxisText: ic,
3365
+ axisText: ac,
3366
+ hoveredAxisText: sc,
3367
+ yAxisLabel: oc
3368
+ };
3369
+ function hc({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "vertical" }) {
3370
+ const [i, a] = Re(), { width: s, height: o } = a, [c, l] = cn(), { height: u } = l, [h, f] = ot(null), [d, y] = ot(!1), [v, L] = ot(["all"]), [$, I] = ot(!1), [A, O] = ot(""), [E, V] = ot(!1), q = an(), F = t;
3371
+ _t(() => {
3372
+ L(["all"]), y(!0);
3373
+ }, [F]), _t(() => {
3374
+ L(["all"]);
3375
+ }, [e]);
3376
+ const j = 750;
3377
+ _t(() => {
3378
+ let S;
3379
+ return d && (S = setTimeout(() => {
3380
+ y(!1);
3381
+ }, j + 500)), () => {
3382
+ clearTimeout(S);
3383
+ };
3384
+ }, [d]);
3385
+ const U = q ? o : o - u, x = [s, U, v, n, e], b = wt(F), m = b.length === 0 ? [] : Object.keys(b[0]).filter((S) => S !== "label" && S !== "total"), M = Te(m), it = zt((S) => {
3386
+ if (d)
3387
+ return;
3388
+ const z = 80;
3389
+ S.selectAll(".legend-item").data([...m], (g) => g).join(
3390
+ (g) => {
3391
+ const _ = g.append("div").attr("class", function(N) {
3392
+ return `
3393
+ ${v.includes(N) ? B[e ? "legend-container-active" : "legend-container-inactive"] : B["legend-container"]}
3394
+ legend-item
3395
+ `;
3396
+ }).style("left", (N, Y) => `${Y * z}px`).style("top", "-53px").style("opacity", 0);
3397
+ return _.append("div").attr("class", B["legend-rect"]).style("background", (N) => {
3398
+ if (!e && v.includes(N))
3399
+ return Ot;
3400
+ const Y = M.current.findIndex((Z) => Z === N) + n;
3401
+ return vt(Y);
3402
+ }), _.append("span").attr("class", B["legend-label"]).style("color", (N) => !e && v.includes(N) ? "#d1d5db" : "#333").text((N) => N), _.transition().duration(j).style("top", "0px").style("opacity", 1), _;
3403
+ },
3404
+ (g) => (g.attr(
3405
+ "class",
3406
+ (_) => `
3407
+ ${v.includes(_) ? B[e ? "legend-container-active" : "legend-container-inactive"] : B["legend-container"]}
3408
+ legend-item`
3409
+ ).transition().duration(j).style("top", "0px").style("left", (_, N) => `${N * z}px`).style("opacity", 1).select(`.${B["legend-rect"]}`).style("background", (_) => {
3410
+ if (!e && v.includes(_))
3411
+ return Ot;
3412
+ const N = M.current.findIndex((Y) => Y === _) + n;
3413
+ return vt(N);
3414
+ }), g.select(`.${B["legend-label"]}`).style("color", (_) => !e && v.includes(_) ? Ot : "#333").text((_) => _), g),
3415
+ (g) => g.style("color", Ot).transition().duration(j).style("opacity", 0).style("top", "53px").remove()
3416
+ ).on("mouseover", function(g, _) {
3417
+ d || O(_);
3418
+ }).on("mouseout", function(g, _) {
3419
+ d || (O(""), $ && I(!1));
3420
+ }).on("click", (g, _) => {
3421
+ L((N) => {
3422
+ let Y = [];
3423
+ return e ? N[0] === _ ? Y = ["all"] : Y = [_] : N.includes(_) ? Y = N.filter((Z) => Z !== _) : Y = [...N, _], Y;
3424
+ }), I(!0);
3425
+ });
3426
+ }, [...x, m, d]), C = /* @__PURE__ */ T.jsxs(
3427
+ "div",
3428
+ {
3429
+ ref: c,
3430
+ className: `${tt["controls-container"]} ${q ? tt["fill-container"] : ""}`,
3431
+ children: [
3432
+ /* @__PURE__ */ T.jsxs("label", { className: tt["controls-label"], style: { paddingRight: "12px" }, children: [
3433
+ /* @__PURE__ */ T.jsx(
3434
+ "input",
3435
+ {
3436
+ type: "checkbox",
3437
+ className: tt["controls-checkbox"],
3438
+ checked: E,
3439
+ onChange: (S) => V(S.target.checked)
3440
+ }
3441
+ ),
3442
+ "Sort"
3443
+ ] }),
3444
+ /* @__PURE__ */ T.jsx(
3445
+ "div",
3446
+ {
3447
+ ref: it,
3448
+ id: "stacked-barchart-legends",
3449
+ className: `${B["legends-container"]}`
3450
+ }
3451
+ )
3452
+ ]
3453
+ }
3454
+ ), k = zt((S) => {
3455
+ if (s === 0 || U === 0 || A !== "" && d) return;
3456
+ const z = { top: 20, right: 30, bottom: 30, left: 40 }, G = s > 1024, g = e ? m : m.filter((p) => !v.includes(p));
3457
+ b.forEach((p) => {
3458
+ const H = g.reduce((P, ut) => {
3459
+ const dt = p[ut];
3460
+ return P + (typeof dt == "number" ? dt : 0);
3461
+ }, 0);
3462
+ p.total = H;
3463
+ });
3464
+ const _ = b, N = E ? wt(_).sort(function(p, H) {
3465
+ return e ? v[0] === "all" ? p.total - H.total : Number(p[v[0]]) - Number(H[v[0]]) : p.total - H.total;
3466
+ }) : _, Y = s - z.left - z.right, Z = U - z.top - z.bottom, at = S.select("svg"), et = at.node(), rt = at.select(".plot-area").attr("transform", "translate(" + z.left + "," + z.top + ")"), st = on(S).style("opacity", 0);
3467
+ let ft = !1;
3468
+ h === null && (ft = !0, f(wt(b)));
3469
+ const D = N.map(function(p) {
3470
+ return p.label;
3471
+ }), nt = he().domain(D).rangeRound(r === "vertical" ? [0, Y] : [Z, 0]).paddingInner(0.1).align(0.2), K = e ? v[0] === "all" ? Et(b, (p) => p.total) : Et(b, (p) => p[v[0]]) : Et(b, (p) => p.total), J = ne().domain([0, K ?? 0]).range(r === "vertical" ? [Z, 0] : [0, Y]), ct = G ? B.axisText : B.rotatedAxisText, St = [], Pt = r === "vertical" ? Kt(nt).tickValues(nt.domain()).tickSizeOuter(0) : Kt(J).tickValues(J.domain()).ticks(null, "s").tickSizeOuter(0);
3472
+ rt.select(".x-axis").attr("transform", `translate(0,${Z})`).transition().duration(j).call(Pt).selectAll("text").style("cursor", "pointer").attr("dy", G ? "1em" : ".20em").attr("dx", G ? "0em" : "-.8em").attr("class", ct);
3473
+ const jt = r === "vertical" ? Ut(J).ticks(null, "s") : Ut(nt).tickSizeOuter(0);
3474
+ rt.select(".y-axis").transition().duration(ft ? 0 : j).call(jt);
3475
+ const xt = Ze().keys(g)(N).map((p) => {
3476
+ const H = p.key, P = p.map((ut) => {
3477
+ const dt = ut.data.label;
3478
+ return {
3479
+ ...ut,
3480
+ key: `${H} - ${dt}`,
3481
+ barKey: H
3482
+ };
3483
+ });
3484
+ return P.key = H, P;
3485
+ }), Yt = rt.selectAll(".serie").data(xt, (p) => p.key).join(
3486
+ (p) => p.append("g").attr("class", "serie").attr("fill", (P) => {
3487
+ const ut = M.current.findIndex((de) => de === P.key) + n;
3488
+ return vt(ut);
3489
+ }).style("opacity", (P) => {
3490
+ if (A !== "")
3491
+ if (e) {
3492
+ if (v[0] === "all")
3493
+ return P.key === A || $ ? 1 : 0.25;
3494
+ } else
3495
+ return $ ? 1 : P.key === A ? 0.25 : 1;
3496
+ return e ? v[0] === "all" || P.key === v[0] ? 1 : 0 : 1;
3497
+ }).style("pointer-events", (P) => e ? v[0] === "all" || P.key === v[0] ? "auto" : "none" : "auto"),
3498
+ (p) => p.transition().duration(j).attr("fill", (P) => {
3499
+ const ut = M.current.findIndex((de) => de === P.key) + n;
3500
+ return vt(ut);
3501
+ }).style("opacity", (P) => {
3502
+ if (A !== "")
3503
+ if (e) {
3504
+ if (v[0] === "all")
3505
+ return P.key === A || $ ? 1 : 0.25;
3506
+ } else
3507
+ return $ ? 1 : P.key === A ? 0.25 : 1;
3508
+ return e ? v[0] === "all" || P.key === v[0] ? 1 : 0 : 1;
3509
+ }).style("pointer-events", (P) => e ? v[0] === "all" || P.key === v[0] ? "auto" : "none" : "auto"),
3510
+ (p) => p.transition().duration(j).attr("fill", Ot).style("opacity", 0).selectAll("rect").attr("y", Z).attr("height", 0).remove()
3511
+ ), qt = (p) => nt(p.data.label + "") ?? 0, Vt = nt.bandwidth(), Lt = (p) => {
3512
+ const H = r === "vertical" ? Z : Y;
3513
+ return ft ? 0 : v[0] === "all" ? J(r === "vertical" ? p[1] : p[0]) : (
3514
+ /*d.key.startsWith(plotted)
3515
+ ?*/
3516
+ e && r !== "vertical" ? J(0) : H - (J(p[0]) - J(p[1]))
3517
+ );
3518
+ }, Mt = (p) => {
3519
+ const H = r === "vertical" ? J(p[0]) - J(p[1]) : J(p[1]) - J(p[0]);
3520
+ return isNaN(H) || H < 0 ? 0 : H;
3521
+ }, kt = (p) => r === "vertical" ? qt(p) : Lt(p), mt = (p) => r === "vertical" ? Vt : Mt(p), R = (p) => r === "vertical" ? Lt(p) : qt(p), W = (p) => r === "vertical" ? Mt(p) : Vt, Q = (p) => {
3522
+ if (p.barKey === A)
3523
+ return "none";
3524
+ const H = mt(p), P = W(p);
3525
+ return g.indexOf(p.barKey) === g.length - 1 || p.barKey === v[0] ? r === "vertical" ? `${H + P} ${H} ${P}` : `${H + P + H}` : r === "vertical" ? `${P} ${H}` : `${H} ${P}`;
3526
+ }, w = (p) => {
3527
+ const H = mt(p), P = g.indexOf(p.barKey) === g.length - 1 || p.barKey === v[0];
3528
+ return r === "vertical" ? P ? 0 : H * -1 : 0;
3529
+ }, X = (p) => A !== "" && A === p.barKey && e ? `rect ${B.rectLegendHovered}` : `rect ${B.rect}`;
3530
+ Yt.selectAll("rect").data(
3531
+ (p) => p,
3532
+ // each group binds its stacked points
3533
+ (p) => p.data.label
3534
+ // unique key per bar
3535
+ ).join(
3536
+ (p) => p.append("rect").attr("class", `rect ${tt.rect}`).attr("x", function(P) {
3537
+ return r === "vertical" ? kt(P) : J(0);
3538
+ }).attr("width", function(P) {
3539
+ return r === "vertical" ? mt(P) : 0;
3540
+ }).attr("y", (P) => {
3541
+ if (r === "vertical") {
3542
+ if (!St.includes(P.data.label)) return Z;
3543
+ const ut = v[0] === "all" ? J(P[1]) : P.key.startsWith(v[0]) ? Z - (J(P[0]) - J(P[1])) : J(P[1]), dt = J(P[0]) - J(P[1]), de = isNaN(dt) || dt < 0 ? 0 : dt, ei = ut + de;
3544
+ return ft ? Z - (z.bottom + z.top) : ei;
3545
+ } else
3546
+ return R(P);
3547
+ }).attr("height", function(P) {
3548
+ return r === "vertical" ? 0 : W(P);
3549
+ }).attr("stroke-dasharray", Q).attr("stroke-dashoffset", w).transition().duration(j).attr("x", kt).attr("width", mt).attr("height", W).attr("y", R),
3550
+ void 0,
3551
+ // no custom update handler
3552
+ (p) => p.transition().duration(j).attr("opacity", 0).attr("y", Z).attr("height", 0).remove()
3553
+ ).attr("class", X).attr("stroke-dasharray", Q).attr("stroke-dashoffset", w).transition().duration(j).attr("x", kt).attr("width", mt).attr("height", W).attr("y", R).on("start", function() {
3554
+ }).on("end", function() {
3555
+ }), Yt.selectAll("rect").on("mouseover", function(p, H) {
3556
+ bt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((dt) => dt === H.data.label).attr("class", (r === "vertical" ? ct : "") + " " + B.hoveredAxisText), st.style("opacity", 1).select("p.title").text(H.data.label);
3557
+ const P = H.data[H.barKey], { total: ut } = H.data;
3558
+ st.select("p.top-label").text(H.barKey + " : " + Bt(P)), st.select("p.bottom-label").text(v[0] === "all" ? `Total : ${Bt(ut)}` : "~");
3559
+ }).on("touch", function(p, H) {
3560
+ bt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((P) => P === H.data.label);
3561
+ }).on("mousemove", (p, H) => {
3562
+ ln(st, { e: p, svg: et, yScale: J });
3563
+ }).on("mouseout", function(p, H) {
3564
+ bt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((P) => P === H.data.label).attr("class", r === "vertical" ? ct : ""), st.style("opacity", 0);
3565
+ });
3566
+ }, [...x, E, b, m, A, $, d, r]);
3567
+ return /* @__PURE__ */ T.jsxs(
3568
+ "div",
3569
+ {
3570
+ ref: i,
3571
+ style: { width: `${s}px`, height: `${o}px`, display: "flex", flexDirection: "column" },
3572
+ children: [
3573
+ q ? tn(C, q) : C,
3574
+ /* @__PURE__ */ T.jsxs(
3575
+ "div",
3576
+ {
3577
+ ref: k,
3578
+ className: `${tt["fill-container"]}`,
3579
+ style: { display: "flex", flexDirection: "column" },
3580
+ children: [
3581
+ /* @__PURE__ */ T.jsx(
3582
+ "svg",
3583
+ {
3584
+ className: `${tt["chart-svg"]} ${tt["fill-container"]}`,
3585
+ viewBox: `0 0 ${s} ${U}`,
3586
+ children: /* @__PURE__ */ T.jsxs("g", { className: "plot-area", children: [
3587
+ /* @__PURE__ */ T.jsx("g", { className: "plot-rects" }),
3588
+ /* @__PURE__ */ T.jsx("g", { className: "y-axis" }),
3589
+ /* @__PURE__ */ T.jsx("g", { className: "x-axis" })
3590
+ ] })
3591
+ }
3592
+ ),
3593
+ /* @__PURE__ */ T.jsx(sn, { pCount: 3 })
3594
+ ]
3595
+ }
3596
+ )
3597
+ ]
3598
+ }
3599
+ );
3600
+ }
3601
+ function dc({ data: t, colorIdx: e = 0, orientation: n = "vertical" }) {
3602
+ const [r, i] = Re(), { width: a, height: s } = i, [o, c] = cn(), { height: l } = c, [u, h] = ot(null), [f, d] = ot(!1), [y, v] = ot("all"), [L, $] = ot(!1), [I, A] = ot(""), [O, E] = ot(!1), V = an(), q = t;
3603
+ _t(() => {
3604
+ v("all"), d(!0), E(!1);
3605
+ }, [q]);
3606
+ const F = 750;
3607
+ _t(() => {
3608
+ let k;
3609
+ return f && (k = setTimeout(() => {
3610
+ d(!1);
3611
+ }, F + 500)), () => {
3612
+ clearTimeout(k);
3613
+ };
3614
+ }, [f]);
3615
+ const j = V ? s : s - l, U = [a, j, y, e], x = wt(q), b = x.length === 0 ? [] : Object.keys(x[0]).filter((k) => k !== "label" && k !== "total"), m = Te(b), M = zt((k) => {
3616
+ if (f) return;
3617
+ const S = 80;
3618
+ k.selectAll(".legend-item").data([...b], (G) => G).join(
3619
+ (G) => {
3620
+ const g = G.append("div").attr("class", function(_) {
3621
+ return `
3622
+ ${y === _ ? B["legend-container-active"] : B["legend-container"]}
3623
+ legend-item`;
3624
+ }).style("left", (_, N) => `${N * S}px`).style("top", "-53px").style("opacity", 0);
3625
+ return g.append("div").attr("class", B["legend-rect"]).style("background", (_) => {
3626
+ const N = m.current.findIndex((Y) => Y === _) + e;
3627
+ return vt(N);
3628
+ }), g.append("span").attr("class", B["legend-label"]).text((_) => _), g.transition().duration(F).style("top", "0px").style("opacity", 1), g;
3629
+ },
3630
+ (G) => (G.attr(
3631
+ "class",
3632
+ (g) => `
3633
+ ${y === g ? B["legend-container-active"] : B["legend-container"]}
3634
+ legend-item`
3635
+ ).transition().duration(F).style("top", "0px").style("left", (g, _) => `${_ * S}px`).style("opacity", 1).select(`.${B["legend-rect"]}`).style("background", (g) => {
3636
+ const _ = m.current.findIndex((N) => N === g) + e;
3637
+ return vt(_);
3638
+ }), G.select(`.${B["legend-label"]}`).text((g) => g), G),
3639
+ (G) => G.transition().duration(F).style("opacity", 0).style("top", "53px").remove().remove()
3640
+ ).on("click", (G, g) => {
3641
+ v((_) => _ === g ? (E(!1), "all") : g);
3642
+ }).on("mouseover", (G, g) => {
3643
+ A(g);
3644
+ }).on("mouseout", (G, g) => {
3645
+ A("");
3646
+ });
3647
+ }, [...U, b, f]), it = /* @__PURE__ */ T.jsxs(
3648
+ "div",
3649
+ {
3650
+ ref: o,
3651
+ className: `${tt["controls-container"]} ${V ? tt["fill-container"] : ""}`,
3652
+ children: [
3653
+ /* @__PURE__ */ T.jsxs("label", { className: tt["controls-label"], style: { paddingRight: "12px" }, children: [
3654
+ /* @__PURE__ */ T.jsx(
3655
+ "input",
3656
+ {
3657
+ type: "checkbox",
3658
+ className: `${tt["controls-checkbox"]} ${y === "all" ? tt.disabled : ""}`,
3659
+ checked: O,
3660
+ onChange: (k) => E(k.target.checked),
3661
+ disabled: y === "all"
3662
+ }
3663
+ ),
3664
+ "Sort"
3665
+ ] }),
3666
+ /* @__PURE__ */ T.jsx(
3667
+ "div",
3668
+ {
3669
+ ref: M,
3670
+ id: "stacked-barchart-legends",
3671
+ className: `${B["legends-container"]}`
3672
+ }
3673
+ )
3674
+ ]
3675
+ }
3676
+ ), C = zt((k) => {
3677
+ if (a === 0 || j === 0 || I !== "" && f) return;
3678
+ const S = { top: 20, right: 30, bottom: 30, left: 40 }, z = a > 1024;
3679
+ x.forEach(function(R) {
3680
+ R.total = b.reduce((W, Q) => {
3681
+ const w = R[Q];
3682
+ return W + (typeof w == "number" ? w : Number(w));
3683
+ }, 0);
3684
+ });
3685
+ const G = x, g = O ? wt(G).sort(function(R, W) {
3686
+ return Number(R[y]) - Number(W[y]);
3687
+ }) : G, _ = a - S.left - S.right, N = j - S.top - S.bottom, Y = k.select("svg"), Z = Y.node(), at = Y.select(".plot-area").attr("transform", "translate(" + S.left + "," + S.top + ")"), et = on(k).style("opacity", 0);
3688
+ let rt = !1;
3689
+ u === null && (rt = !0, h(wt(x)));
3690
+ const st = z ? B.axisText : B.rotatedAxisText, ft = g.map(function(R) {
3691
+ return R.label;
3692
+ }), D = he().domain(ft).rangeRound(n === "vertical" ? [0, _] : [N, 0]).paddingInner(0.1).align(0.2), nt = y === "all" ? Et(
3693
+ x,
3694
+ (R) => Et(
3695
+ Object.entries(R).filter(([W]) => W !== "total" && W !== "label").map(([, W]) => W)
3696
+ // value is number | string | undefined
3697
+ )
3698
+ ) : Et(x, (R) => R[y]), K = ne().domain([0, nt ?? 0]).range(n === "vertical" ? [N, 0] : [0, _]), J = n === "vertical" ? Kt(D).tickValues(D.domain()).tickSizeOuter(0) : Kt(K).tickValues(K.domain()).ticks(null, "s").tickSizeOuter(0);
3699
+ at.select(".x-axis").attr("transform", `translate(0,${N})`).transition().duration(F).call(J).selectAll("text").style("cursor", "pointer").attr("dy", z ? "1em" : ".20em").attr("dx", z ? "0em" : "-.8em").attr("class", st);
3700
+ const ct = n === "vertical" ? Ut(K).ticks(null, "s") : Ut(D).tickSizeOuter(0);
3701
+ at.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(F).call(ct);
3702
+ const Pt = Ze().keys(b)(g).map(
3703
+ (R) => {
3704
+ const W = R.key, Q = R.map((w) => ({
3705
+ ...w,
3706
+ key: `${W} - ${w.data.label}`,
3707
+ barKey: W
3708
+ }));
3709
+ return Q.key = W, Q;
3710
+ }
3711
+ ), jt = (R) => I !== "" ? `rect
3712
+ ${I === R.barKey ? B.rectLegendHovered : B.rectLegendNotHovered}` : `rect ${B.rect}`;
3713
+ let Ft = at.selectAll(".serie").data(Pt, function(R) {
3714
+ return R.key;
3715
+ }).join(
3716
+ (R) => R.append("g").attr("class", "serie").attr("fill", function(Q) {
3717
+ const w = m.current.findIndex((X) => X === Q.key) + e;
3718
+ return vt(w);
3719
+ }).style("opacity", (Q) => y === "all" || Q.key === y ? 1 : 0).style("pointer-events", (Q) => y === "all" || Q.key === y ? "auto" : "none"),
3720
+ (R) => R.transition().duration(F).attr("fill", function(Q) {
3721
+ const w = m.current.findIndex((X) => X === Q.key) + e;
3722
+ return vt(w);
3723
+ }).style("opacity", (Q) => y === "all" || Q.key === y ? 1 : 0).style("pointer-events", (Q) => y === "all" || Q.key === y ? "auto" : "none"),
3724
+ (R) => R.transition().duration(F).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", N).attr("height", 0).remove()
3725
+ );
3726
+ const xt = (R) => {
3727
+ const W = D(R.data.label + "") ?? 0;
3728
+ if (y === "all") {
3729
+ const Q = b.indexOf(R.barKey) || 0;
3730
+ return W + Q * (D.bandwidth() / b.length);
3731
+ }
3732
+ return W;
3733
+ }, Yt = () => y === "all" ? D.bandwidth() / b.length : D.bandwidth(), qt = (R) => n === "vertical" ? N - (K(R[0]) - K(R[1])) : K(0), Vt = (R) => {
3734
+ const W = n === "vertical" ? K(R[0]) - K(R[1]) : K(R[1]) - K(R[0]);
3735
+ return isNaN(W) || W < 0 ? 0 : W;
3736
+ }, Lt = (R) => n === "vertical" ? xt(R) : qt(R), Mt = (R) => n === "vertical" ? Yt() : Vt(R), kt = (R) => n === "vertical" ? qt(R) : xt(R), mt = (R) => n === "vertical" ? Vt(R) : Yt();
3737
+ Ft.selectAll("rect").data(
3738
+ (R) => R,
3739
+ (R) => R.data.label
3740
+ ).join(
3741
+ (R) => {
3742
+ let W;
3743
+ return W = R.append("rect").attr("class", jt).attr("x", function(Q) {
3744
+ return n === "vertical" ? Lt(Q) : 0;
3745
+ }).attr("width", function(Q) {
3746
+ return n === "vertical" ? y === "all" ? D.bandwidth() / b.length : D.bandwidth() : 0;
3747
+ }).attr("y", function(Q) {
3748
+ return n === "vertical" ? rt ? N - (S.bottom + S.top) : N : kt(Q);
3749
+ }).attr("height", function(Q) {
3750
+ return n === "vertical" ? 0 : y === "all" ? D.bandwidth() / b.length : D.bandwidth();
3751
+ }).transition().duration(F).attr("x", Lt).attr("width", Mt).attr("height", mt).attr("y", kt), W;
3752
+ },
3753
+ void 0,
3754
+ (R) => R.attr("fill", Ot).transition().duration(F).attr("opacity", 0).attr("height", 0).attr("y", N + S.bottom).remove()
3755
+ ).attr("class", jt).transition().duration(F).attr("x", Lt).attr("width", Mt).attr("height", mt).attr("y", kt), Ft.selectAll("rect").on("mouseover", function(R, W) {
3756
+ bt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((p) => p === W.data.label).attr("class", (n === "vertical" ? st : "") + " " + B.hoveredAxisText), et.style("opacity", 1).select("p.title").text(W.data.label);
3757
+ const Q = W.data[W.barKey], { total: w } = W.data, X = Q / w * 100;
3758
+ re(".1f")(X) + "", et.select("p.top-label").text(W.barKey + " : " + Bt(Q)), et.select("p.bottom-label").text(
3759
+ y === "all" ? `Total : ${Bt(w)}` : "~"
3760
+ );
3761
+ }).on("touch", function(R, W) {
3762
+ bt(".x-axis").selectAll("text").filter((Q) => Q === W.data.label).attr("class", st);
3763
+ }).on("mousemove", (R, W) => {
3764
+ ln(et, { e: R, svg: Z, yScale: K });
3765
+ }).on("mouseout", function(R, W) {
3766
+ bt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((Q) => Q === W.data.label).attr("class", n === "vertical" ? st : ""), et.style("opacity", 0);
3767
+ });
3768
+ }, [...U, O, x, b, I, L, n, f]);
3769
+ return /* @__PURE__ */ T.jsxs(
3770
+ "div",
3771
+ {
3772
+ ref: r,
3773
+ style: { width: a, height: s, display: "flex", flexDirection: "column" },
3774
+ children: [
3775
+ V ? tn(it, V) : it,
3776
+ /* @__PURE__ */ T.jsxs(
3777
+ "div",
3778
+ {
3779
+ ref: C,
3780
+ className: `${tt["fill-container"]}`,
3781
+ style: { display: "flex", flexDirection: "column" },
3782
+ children: [
3783
+ /* @__PURE__ */ T.jsx(
3784
+ "svg",
3785
+ {
3786
+ className: `${tt["chart-svg"]} ${tt["fill-container"]}`,
3787
+ viewBox: `0 0 ${a} ${j}`,
3788
+ children: /* @__PURE__ */ T.jsxs("g", { className: "plot-area", children: [
3789
+ /* @__PURE__ */ T.jsx("g", { className: "plot-rects" }),
3790
+ /* @__PURE__ */ T.jsx("g", { className: "y-axis" }),
3791
+ /* @__PURE__ */ T.jsx("g", { className: "x-axis" })
3792
+ ] })
3793
+ }
3794
+ ),
3795
+ /* @__PURE__ */ T.jsx(sn, { pCount: 3 })
3796
+ ]
3797
+ }
3798
+ )
3799
+ ]
3800
+ }
3801
+ );
3802
+ }
3803
+ function gc({ data: t, colorIdx: e = 0, orientation: n = "vertical" }) {
3804
+ const [r, i] = Re(), { width: a, height: s } = i, [o, c] = ot(""), [l, u] = ot(!0), [h, f] = ot(!1), [d, y] = cn(), { height: v } = y, [L, $] = ot("all"), I = an(), A = t;
3805
+ _t(() => {
3806
+ $("all"), u(!0), f(!0);
3807
+ }, [A]);
3808
+ const O = 750;
3809
+ _t(() => {
3810
+ let m;
3811
+ return h && (m = setTimeout(() => {
3812
+ f(!1);
3813
+ }, O + 500)), () => {
3814
+ clearTimeout(m);
3815
+ };
3816
+ }, [h]);
3817
+ const E = I ? s : s - v, V = [a, E, L, e], q = wt(A), F = q.length === 0 ? [] : Object.keys(q[0]).filter((m) => m !== "label" && m !== "total"), j = Te(F), U = zt((m) => {
3818
+ if (h) return;
3819
+ const M = 80;
3820
+ m.selectAll(".legend-item").data([...F], (C) => C).join(
3821
+ (C) => {
3822
+ const k = C.append("div").attr("class", function(S) {
3823
+ return `
3824
+ ${L === S ? B["legend-container-active"] : B["legend-container"]}
3825
+ legend-item`;
3826
+ }).style("left", (S, z) => `${z * M}px`).style("top", "-53px").style("opacity", 0);
3827
+ return k.append("div").attr("class", B["legend-rect"]).style("background", (S) => {
3828
+ const z = j.current.findIndex((G) => G === S) + e;
3829
+ return vt(z);
3830
+ }), k.append("span").attr("class", B["legend-label"]).text((S) => S), k.transition().duration(O).style("top", "0px").style("opacity", 1), k;
3831
+ },
3832
+ (C) => (C.attr(
3833
+ "class",
3834
+ (k) => `
3835
+ ${L === k ? B["legend-container-active"] : B["legend-container"]}
3836
+ legend-item`
3837
+ ).transition().duration(O).style("top", "0px").style("left", (k, S) => `${S * M}px`).style("opacity", 1).select(`.${B["legend-rect"]}`).style("background", (k) => {
3838
+ const S = j.current.findIndex((z) => z === k) + e;
3839
+ return vt(S);
3840
+ }), C.select(`.${B["legend-label"]}`).text((k) => k), C),
3841
+ (C) => C.transition().duration(O).style("opacity", 0).style("top", "53px").remove().remove().remove()
3842
+ ).on("mouseover", (C, k) => {
3843
+ c(k);
3844
+ }).on("mouseout", function(C) {
3845
+ c("");
3846
+ });
3847
+ }, [...V, F, h]), x = /* @__PURE__ */ T.jsxs(
3848
+ "div",
3849
+ {
3850
+ ref: d,
3851
+ className: `${tt["controls-container"]} ${I ? tt["fill-container"] : ""}`,
3852
+ children: [
3853
+ /* @__PURE__ */ T.jsxs("label", { className: tt["controls-label"], style: { paddingRight: "12px" }, children: [
3854
+ /* @__PURE__ */ T.jsx(
3855
+ "input",
3856
+ {
3857
+ type: "checkbox",
3858
+ className: tt["controls-checkbox"],
3859
+ checked: l,
3860
+ onChange: (m) => u(m.target.checked)
3861
+ }
3862
+ ),
3863
+ "Percentage"
3864
+ ] }),
3865
+ /* @__PURE__ */ T.jsx(
3866
+ "div",
3867
+ {
3868
+ ref: U,
3869
+ id: "stacked-barchart-legends",
3870
+ className: `${B["legends-container"]}`
3871
+ }
3872
+ )
3873
+ ]
3874
+ }
3875
+ ), b = zt((m) => {
3876
+ if (a === 0 || E === 0 || o !== "" && h) return;
3877
+ const M = { top: 20, right: 30, bottom: 30, left: 40 }, it = a > 1024;
3878
+ q.forEach(function(w) {
3879
+ w.total = F.reduce((X, p) => {
3880
+ const H = w[p];
3881
+ return X + (typeof H == "number" ? H : Number(H));
3882
+ }, 0);
3883
+ });
3884
+ const k = q.filter((w) => w?.total && w.total > 0), S = a - M.left - M.right, z = E - M.top - M.bottom, G = m.select("svg"), g = G.node(), _ = G.select(".plot-area").attr("transform", "translate(" + M.left + "," + M.top + ")"), N = on(m).style("opacity", 0), Y = it ? B.axisText : B.rotatedAxisText, Z = k.map(function(w) {
3885
+ return w.label;
3886
+ }), at = he().domain(Z).rangeRound(n === "vertical" ? [0, S] : [z, 0]).paddingInner(0.1).align(0.2), et = Et(q, (w) => w.total), rt = ne().domain([0, l ? 1 : et || 0]).nice().range(n === "vertical" ? [z, 0] : [0, S]), st = he().rangeRound([0, S]).paddingInner(0.1).align(0.2), ft = k.map(function(w) {
3887
+ return w.label;
3888
+ });
3889
+ st.domain(ft);
3890
+ const D = [], nt = n === "vertical" ? Kt(at).tickValues(at.domain()).tickSizeOuter(0) : Kt(rt).tickValues(rt.domain()).ticks(null, l ? ".0%" : "s").tickSizeOuter(0);
3891
+ _.select(".x-axis").attr("transform", `translate(0,${z})`).transition().duration(O).call(nt).selectAll("text").style("cursor", "pointer").attr("dy", it ? "1em" : ".20em").attr("dx", it ? "0em" : "-.8em").attr("class", Y);
3892
+ const K = Et(q, (w) => w.total), J = ne().domain([0, l ? 1 : K || 0]).nice().range([z, 0]), ct = n === "vertical" ? Ut(rt).ticks(null, l ? ".0%" : "s") : Ut(at).tickSizeOuter(0);
3893
+ _.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(O).call(ct);
3894
+ const St = Ze().order(Mn).offset(Dl), jt = (l ? St.keys(F)(k) : Ze().keys(F)(k)).map((w) => {
3895
+ const X = w.key, p = w.map((H) => {
3896
+ const P = H.data.label;
3897
+ return {
3898
+ ...H,
3899
+ key: `${X} - ${P}`,
3900
+ barKey: X
3901
+ };
3902
+ });
3903
+ return p.key = X, p;
3904
+ });
3905
+ let Ft = _.selectAll(".serie").data(jt, function(w) {
3906
+ return w.key;
3907
+ }).join(
3908
+ (w) => w.append("g").attr("class", "serie").attr("fill", function(p) {
3909
+ const H = j.current.findIndex((P) => P === p.key) + e;
3910
+ return vt(H);
3911
+ }).style("opacity", 1).style("pointer-events", "auto"),
3912
+ (w) => w.transition().duration(O).attr("fill", function(p) {
3913
+ const H = j.current.findIndex((P) => P === p.key) + e;
3914
+ return vt(H);
3915
+ }).style("opacity", 1).style("pointer-events", "auto"),
3916
+ (w) => w.transition().duration(O).style("opacity", 0).attr("fill", Ot).selectAll("rect").attr("y", z).attr("height", 0).remove()
3917
+ );
3918
+ const xt = (w) => at(w.data.label + "") ?? 0, Yt = at.bandwidth(), qt = (w) => rt(n === "vertical" ? w[1] : w[0]), Vt = (w) => {
3919
+ const X = n === "vertical" ? rt(w[0]) - rt(w[1]) : rt(w[1]) - rt(w[0]);
3920
+ return isNaN(X) || X < 0 ? 0 : X;
3921
+ }, Lt = (w) => n === "vertical" ? xt(w) : qt(w), Mt = (w) => n === "vertical" ? Yt : Vt(w), kt = (w) => n === "vertical" ? qt(w) : xt(w), mt = (w) => n === "vertical" ? Vt(w) : Yt;
3922
+ function R(w) {
3923
+ if (w.barKey === o)
3924
+ return "none";
3925
+ const X = Mt(w), p = mt(w);
3926
+ return F.indexOf(w.barKey) === F.length - 1 || w.barKey === L[0] ? n === "vertical" ? `${X + p} ${X} ${p}` : `${X + p + X}` : n === "vertical" ? `${p} ${X}` : `${X} ${p}`;
3927
+ }
3928
+ function W(w) {
3929
+ const X = Mt(w), p = F.indexOf(w.barKey) === F.length - 1;
3930
+ return n === "vertical" ? p ? 0 : X * -1 : 0;
3931
+ }
3932
+ const Q = (w) => o !== "" && o === w.barKey ? `rect ${B.rectLegendHovered}` : `rect ${B.rect}`;
3933
+ Ft.selectAll("rect").data(
3934
+ (w) => w,
3935
+ (w) => w.data.label
3936
+ ).join(
3937
+ (w) => {
3938
+ let X;
3939
+ return X = w.append("rect").attr("class", Q).attr("x", function(p) {
3940
+ return n === "vertical" ? st(p.data.label + "") ?? 0 : rt(0);
3941
+ }).attr("width", function(p) {
3942
+ return n === "vertical" ? at.bandwidth() : 0;
3943
+ }).attr("y", function(p) {
3944
+ if (n === "vertical") {
3945
+ if (!D.includes(p.data.label + ""))
3946
+ return z - M.bottom;
3947
+ const H = rt(p[1]), P = rt(p[0]) - rt(p[1]), ut = isNaN(P) || P < 0 ? 0 : P;
3948
+ return H + ut;
3949
+ } else
3950
+ return kt(p);
3951
+ }).attr("height", function(p) {
3952
+ return n === "vertical" ? 0 : mt(p);
3953
+ }).attr("stroke-dasharray", R).attr("stroke-dashoffset", W).transition().duration(O).attr("x", Lt).attr("width", Mt).attr("height", mt).attr("y", kt), X;
3954
+ },
3955
+ void 0,
3956
+ (w) => w.transition().duration(O).attr("opacity", 0).attr("height", 0).attr("y", z).remove()
3957
+ ).attr("class", Q).attr("stroke-dasharray", R).attr("stroke-dashoffset", W).transition().duration(O).attr("x", Lt).attr("width", Mt).attr("height", mt).attr("y", kt), Ft.selectAll("rect").on("mouseover", function(w, X) {
3958
+ bt(".x-axis").selectAll("text").filter((dt) => dt === X.data.name).attr("class", Y + " " + tt.hoveredAxisText), N.style("opacity", 1).select("p.title").text(X.data.label);
3959
+ const p = X.data[X.barKey] || 0, H = X.data.total || 0, P = p / H * 100, ut = re(".1f")(P) + "%";
3960
+ N.select("p.top-label").text(X.barKey + " : " + (l ? ut : Bt(p))), N.select("p.bottom-label").text(
3961
+ l ? `(${Bt(p)} of ${Bt(H)})` : `Total : ${Bt(H)}`
3962
+ );
3963
+ }).on("touch", function(w, X) {
3964
+ bt(".x-axis").selectAll("text").filter((p) => p === X.data.label).attr("class", Y);
3965
+ }).on("mousemove", (w, X) => {
3966
+ ln(N, { e: w, svg: g, yScale: J });
3967
+ }).on("mouseout", function(w, X) {
3968
+ bt(".x-axis").selectAll("text").filter((p) => p === X.data.name).attr("class", Y), N.style("opacity", 0);
3969
+ });
3970
+ }, [...V, q, F, l, o, n, h]);
3971
+ return /* @__PURE__ */ T.jsxs(
3972
+ "div",
3973
+ {
3974
+ ref: r,
3975
+ style: { width: a, height: s, display: "flex", flexDirection: "column" },
3976
+ children: [
3977
+ I ? tn(x, I) : x,
3978
+ /* @__PURE__ */ T.jsxs(
3979
+ "div",
3980
+ {
3981
+ ref: b,
3982
+ className: `${tt["fill-container"]}`,
3983
+ style: { display: "flex", flexDirection: "column" },
3984
+ children: [
3985
+ /* @__PURE__ */ T.jsx(
3986
+ "svg",
3987
+ {
3988
+ className: `${tt["chart-svg"]} ${tt["fill-container"]}`,
3989
+ viewBox: `0 0 ${a} ${E}`,
3990
+ children: /* @__PURE__ */ T.jsxs("g", { className: "plot-area", children: [
3991
+ /* @__PURE__ */ T.jsx("g", { className: "plot-rects" }),
3992
+ /* @__PURE__ */ T.jsx("g", { className: "y-axis" }),
3993
+ /* @__PURE__ */ T.jsx("g", { className: "x-axis" })
3994
+ ] })
3995
+ }
3996
+ ),
3997
+ /* @__PURE__ */ T.jsx(sn, { pCount: 3 })
3998
+ ]
3999
+ }
4000
+ )
4001
+ ]
4002
+ }
4003
+ );
4004
+ }
4005
+ export {
4006
+ uc as BarChart,
4007
+ dc as GroupedBarChart,
4008
+ gc as PercentageBarChart,
4009
+ fc as PieChart,
4010
+ hc as StackedBarChart
4011
+ };