UNPKG

@lueton/react-sparklines

Version:
1,661 lines 121 kB
import { jsx as E, Fragment as we, jsxs as G } from "react/jsx-runtime"; import { useRef as hn, useEffect as j, Children as wr, isValidElement as tt, cloneElement as xt, createElement as be, useState as gt, useCallback as lt, forwardRef as jt, useMemo as br } from "react"; function Dt(t, n) { return t == null || n == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function kr(t, n) { return t == null || n == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN; } function ke(t) { let n, e, r; t.length !== 2 ? (n = Dt, e = (a, u) => Dt(t(a), u), r = (a, u) => t(a) - u) : (n = t === Dt || t === kr ? t : Ar, e = t, r = t); function i(a, u, l = 0, c = a.length) { if (l < c) { if (n(u, u) !== 0) return c; do { const f = l + c >>> 1; e(a[f], u) < 0 ? l = f + 1 : c = f; } while (l < c); } return l; } function o(a, u, l = 0, c = a.length) { if (l < c) { if (n(u, u) !== 0) return c; do { const f = l + c >>> 1; e(a[f], u) <= 0 ? l = f + 1 : c = f; } while (l < c); } return l; } function s(a, u, l = 0, c = a.length) { const f = i(a, u, l, c - 1); return f > l && r(a[f - 1], u) > -r(a[f], u) ? f - 1 : f; } return { left: i, center: s, right: o }; } function Ar() { return 0; } function Er(t) { return t === null ? NaN : +t; } const $r = ke(Dt), Nr = $r.right; ke(Er).center; class Xn extends Map { constructor(n, e = Mr) { if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: e } }), n != null) for (const [r, i] of n) this.set(r, i); } get(n) { return super.get(zn(this, n)); } has(n) { return super.has(zn(this, n)); } set(n, e) { return super.set(Sr(this, n), e); } delete(n) { return super.delete(Tr(this, n)); } } function zn({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) ? t.get(r) : e; } function Sr({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) ? t.get(r) : (t.set(r, e), e); } function Tr({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) && (e = t.get(r), t.delete(r)), e; } function Mr(t) { return t !== null && typeof t == "object" ? t.valueOf() : t; } const Rr = Math.sqrt(50), Cr = Math.sqrt(10), Pr = Math.sqrt(2); function Bt(t, n, e) { const r = (n - t) / Math.max(0, e), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), s = o >= Rr ? 10 : o >= Cr ? 5 : o >= Pr ? 2 : 1; let a, u, l; return i < 0 ? (l = Math.pow(10, -i) / s, a = Math.round(t * l), u = Math.round(n * l), a / l < t && ++a, u / l > n && --u, l = -l) : (l = Math.pow(10, i) * s, a = Math.round(t / l), u = Math.round(n / l), a * l < t && ++a, u * l > n && --u), u < a && 0.5 <= e && e < 2 ? Bt(t, n, e * 2) : [a, u, l]; } function Ir(t, n, e) { if (n = +n, t = +t, e = +e, !(e > 0)) return []; if (t === n) return [t]; const r = n < t, [i, o, s] = r ? Bt(n, t, e) : Bt(t, n, e); if (!(o >= i)) return []; const a = o - i + 1, u = new Array(a); if (r) if (s < 0) for (let l = 0; l < a; ++l) u[l] = (o - l) / -s; else for (let l = 0; l < a; ++l) u[l] = (o - l) * s; else if (s < 0) for (let l = 0; l < a; ++l) u[l] = (i + l) / -s; else for (let l = 0; l < a; ++l) u[l] = (i + l) * s; return u; } function pn(t, n, e) { return n = +n, t = +t, e = +e, Bt(t, n, e)[2]; } function Lr(t, n, e) { n = +n, t = +t, e = +e; const r = n < t, i = r ? pn(n, t, e) : pn(t, n, e); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i); } function Dr(t, n, e) { t = +t, n = +n, e = (i = arguments.length) < 2 ? (n = t, t = 0, 1) : i < 3 ? 1 : +e; for (var r = -1, i = Math.max(0, Math.ceil((n - t) / e)) | 0, o = new Array(i); ++r < i; ) o[r] = t + r * e; return o; } var Or = { value: () => { } }; function Ae() { for (var t = 0, n = arguments.length, e = {}, r; t < n; ++t) { if (!(r = arguments[t] + "") || r in e || /[\s.]/.test(r)) throw new Error("illegal type: " + r); e[r] = []; } return new Ot(e); } function Ot(t) { this._ = t; } function Fr(t, n) { return t.trim().split(/^|\s+/).map(function(e) { var r = "", i = e.indexOf("."); if (i >= 0 && (r = e.slice(i + 1), e = e.slice(0, i)), e && !n.hasOwnProperty(e)) throw new Error("unknown type: " + e); return { type: e, name: r }; }); } Ot.prototype = Ae.prototype = { constructor: Ot, on: function(t, n) { var e = this._, r = Fr(t + "", e), i, o = -1, s = r.length; if (arguments.length < 2) { for (; ++o < s; ) if ((i = (t = r[o]).type) && (i = Yr(e[i], t.name))) return i; return; } if (n != null && typeof n != "function") throw new Error("invalid callback: " + n); for (; ++o < s; ) if (i = (t = r[o]).type) e[i] = qn(e[i], t.name, n); else if (n == null) for (i in e) e[i] = qn(e[i], t.name, null); return this; }, copy: function() { var t = {}, n = this._; for (var e in n) t[e] = n[e].slice(); return new Ot(t); }, call: function(t, n) { if ((i = arguments.length - 2) > 0) for (var e = new Array(i), r = 0, i, o; r < i; ++r) e[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (o = this._[t], r = 0, i = o.length; r < i; ++r) o[r].value.apply(n, e); }, apply: function(t, n, e) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], i = 0, o = r.length; i < o; ++i) r[i].value.apply(n, e); } }; function Yr(t, n) { for (var e = 0, r = t.length, i; e < r; ++e) if ((i = t[e]).name === n) return i.value; } function qn(t, n, e) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === n) { t[r] = Or, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return e != null && t.push({ name: n, value: e }), t; } var dn = "http://www.w3.org/1999/xhtml"; const Hn = { svg: "http://www.w3.org/2000/svg", xhtml: dn, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function tn(t) { var n = t += "", e = n.indexOf(":"); return e >= 0 && (n = t.slice(0, e)) !== "xmlns" && (t = t.slice(e + 1)), Hn.hasOwnProperty(n) ? { space: Hn[n], local: t } : t; } function Br(t) { return function() { var n = this.ownerDocument, e = this.namespaceURI; return e === dn && n.documentElement.namespaceURI === dn ? n.createElement(t) : n.createElementNS(e, t); }; } function Xr(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Ee(t) { var n = tn(t); return (n.local ? Xr : Br)(n); } function zr() { } function En(t) { return t == null ? zr : function() { return this.querySelector(t); }; } function qr(t) { typeof t != "function" && (t = En(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var o = n[i], s = o.length, a = r[i] = new Array(s), u, l, c = 0; c < s; ++c) (u = o[c]) && (l = t.call(u, u.__data__, c, o)) && ("__data__" in u && (l.__data__ = u.__data__), a[c] = l); return new z(r, this._parents); } function Hr(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function Wr() { return []; } function $e(t) { return t == null ? Wr : function() { return this.querySelectorAll(t); }; } function Vr(t) { return function() { return Hr(t.apply(this, arguments)); }; } function Ur(t) { typeof t == "function" ? t = Vr(t) : t = $e(t); for (var n = this._groups, e = n.length, r = [], i = [], o = 0; o < e; ++o) for (var s = n[o], a = s.length, u, l = 0; l < a; ++l) (u = s[l]) && (r.push(t.call(u, u.__data__, l, s)), i.push(u)); return new z(r, i); } function Ne(t) { return function() { return this.matches(t); }; } function Se(t) { return function(n) { return n.matches(t); }; } var Gr = Array.prototype.find; function Kr(t) { return function() { return Gr.call(this.children, t); }; } function Zr() { return this.firstElementChild; } function Qr(t) { return this.select(t == null ? Zr : Kr(typeof t == "function" ? t : Se(t))); } var Jr = Array.prototype.filter; function jr() { return Array.from(this.children); } function ti(t) { return function() { return Jr.call(this.children, t); }; } function ni(t) { return this.selectAll(t == null ? jr : ti(typeof t == "function" ? t : Se(t))); } function ei(t) { typeof t != "function" && (t = Ne(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var o = n[i], s = o.length, a = r[i] = [], u, l = 0; l < s; ++l) (u = o[l]) && t.call(u, u.__data__, l, o) && a.push(u); return new z(r, this._parents); } function Te(t) { return new Array(t.length); } function ri() { return new z(this._enter || this._groups.map(Te), this._parents); } function Xt(t, n) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n; } Xt.prototype = { constructor: Xt, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, insertBefore: function(t, n) { return this._parent.insertBefore(t, n); }, querySelector: function(t) { return this._parent.querySelector(t); }, querySelectorAll: function(t) { return this._parent.querySelectorAll(t); } }; function ii(t) { return function() { return t; }; } function oi(t, n, e, r, i, o) { for (var s = 0, a, u = n.length, l = o.length; s < l; ++s) (a = n[s]) ? (a.__data__ = o[s], r[s] = a) : e[s] = new Xt(t, o[s]); for (; s < u; ++s) (a = n[s]) && (i[s] = a); } function si(t, n, e, r, i, o, s) { var a, u, l = /* @__PURE__ */ new Map(), c = n.length, f = o.length, p = new Array(c), d; for (a = 0; a < c; ++a) (u = n[a]) && (p[a] = d = s.call(u, u.__data__, a, n) + "", l.has(d) ? i[a] = u : l.set(d, u)); for (a = 0; a < f; ++a) d = s.call(t, o[a], a, o) + "", (u = l.get(d)) ? (r[a] = u, u.__data__ = o[a], l.delete(d)) : e[a] = new Xt(t, o[a]); for (a = 0; a < c; ++a) (u = n[a]) && l.get(p[a]) === u && (i[a] = u); } function ai(t) { return t.__data__; } function li(t, n) { if (!arguments.length) return Array.from(this, ai); var e = n ? si : oi, r = this._parents, i = this._groups; typeof t != "function" && (t = ii(t)); for (var o = i.length, s = new Array(o), a = new Array(o), u = new Array(o), l = 0; l < o; ++l) { var c = r[l], f = i[l], p = f.length, d = ui(t.call(c, c && c.__data__, l, r)), m = d.length, h = a[l] = new Array(m), g = s[l] = new Array(m), w = u[l] = new Array(p); e(c, f, h, g, w, d, n); for (var b = 0, y = 0, v, _; b < m; ++b) if (v = h[b]) { for (b >= y && (y = b + 1); !(_ = g[y]) && ++y < m; ) ; v._next = _ || null; } } return s = new z(s, r), s._enter = a, s._exit = u, s; } function ui(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function ci() { return new z(this._exit || this._groups.map(Te), this._parents); } function fi(t, n, e) { var r = this.enter(), i = this, o = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), n != null && (i = n(i), i && (i = i.selection())), e == null ? o.remove() : e(o), r && i ? r.merge(i).order() : i; } function hi(t) { for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, o = r.length, s = Math.min(i, o), a = new Array(i), u = 0; u < s; ++u) for (var l = e[u], c = r[u], f = l.length, p = a[u] = new Array(f), d, m = 0; m < f; ++m) (d = l[m] || c[m]) && (p[m] = d); for (; u < i; ++u) a[u] = e[u]; return new z(a, this._parents); } function pi() { for (var t = this._groups, n = -1, e = t.length; ++n < e; ) for (var r = t[n], i = r.length - 1, o = r[i], s; --i >= 0; ) (s = r[i]) && (o && s.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(s, o), o = s); return this; } function di(t) { t || (t = mi); function n(f, p) { return f && p ? t(f.__data__, p.__data__) : !f - !p; } for (var e = this._groups, r = e.length, i = new Array(r), o = 0; o < r; ++o) { for (var s = e[o], a = s.length, u = i[o] = new Array(a), l, c = 0; c < a; ++c) (l = s[c]) && (u[c] = l); u.sort(n); } return new z(i, this._parents).order(); } function mi(t, n) { return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function _i() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function yi() { return Array.from(this); } function gi() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, o = r.length; i < o; ++i) { var s = r[i]; if (s) return s; } return null; } function vi() { let t = 0; for (const n of this) ++t; return t; } function xi() { return !this.node(); } function wi(t) { for (var n = this._groups, e = 0, r = n.length; e < r; ++e) for (var i = n[e], o = 0, s = i.length, a; o < s; ++o) (a = i[o]) && t.call(a, a.__data__, o, i); return this; } function bi(t) { return function() { this.removeAttribute(t); }; } function ki(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Ai(t, n) { return function() { this.setAttribute(t, n); }; } function Ei(t, n) { return function() { this.setAttributeNS(t.space, t.local, n); }; } function $i(t, n) { return function() { var e = n.apply(this, arguments); e == null ? this.removeAttribute(t) : this.setAttribute(t, e); }; } function Ni(t, n) { return function() { var e = n.apply(this, arguments); e == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, e); }; } function Si(t, n) { var e = tn(t); if (arguments.length < 2) { var r = this.node(); return e.local ? r.getAttributeNS(e.space, e.local) : r.getAttribute(e); } return this.each((n == null ? e.local ? ki : bi : typeof n == "function" ? e.local ? Ni : $i : e.local ? Ei : Ai)(e, n)); } function Me(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function Ti(t) { return function() { this.style.removeProperty(t); }; } function Mi(t, n, e) { return function() { this.style.setProperty(t, n, e); }; } function Ri(t, n, e) { return function() { var r = n.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e); }; } function Ci(t, n, e) { return arguments.length > 1 ? this.each((n == null ? Ti : typeof n == "function" ? Ri : Mi)(t, n, e ?? "")) : ft(this.node(), t); } function ft(t, n) { return t.style.getPropertyValue(n) || Me(t).getComputedStyle(t, null).getPropertyValue(n); } function Pi(t) { return function() { delete this[t]; }; } function Ii(t, n) { return function() { this[t] = n; }; } function Li(t, n) { return function() { var e = n.apply(this, arguments); e == null ? delete this[t] : this[t] = e; }; } function Di(t, n) { return arguments.length > 1 ? this.each((n == null ? Pi : typeof n == "function" ? Li : Ii)(t, n)) : this.node()[t]; } function Re(t) { return t.trim().split(/^|\s+/); } function $n(t) { return t.classList || new Ce(t); } function Ce(t) { this._node = t, this._names = Re(t.getAttribute("class") || ""); } Ce.prototype = { add: function(t) { var n = this._names.indexOf(t); n < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); }, remove: function(t) { var n = this._names.indexOf(t); n >= 0 && (this._names.splice(n, 1), this._node.setAttribute("class", this._names.join(" "))); }, contains: function(t) { return this._names.indexOf(t) >= 0; } }; function Pe(t, n) { for (var e = $n(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]); } function Ie(t, n) { for (var e = $n(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]); } function Oi(t) { return function() { Pe(this, t); }; } function Fi(t) { return function() { Ie(this, t); }; } function Yi(t, n) { return function() { (n.apply(this, arguments) ? Pe : Ie)(this, t); }; } function Bi(t, n) { var e = Re(t + ""); if (arguments.length < 2) { for (var r = $n(this.node()), i = -1, o = e.length; ++i < o; ) if (!r.contains(e[i])) return !1; return !0; } return this.each((typeof n == "function" ? Yi : n ? Oi : Fi)(e, n)); } function Xi() { this.textContent = ""; } function zi(t) { return function() { this.textContent = t; }; } function qi(t) { return function() { var n = t.apply(this, arguments); this.textContent = n ?? ""; }; } function Hi(t) { return arguments.length ? this.each(t == null ? Xi : (typeof t == "function" ? qi : zi)(t)) : this.node().textContent; } function Wi() { this.innerHTML = ""; } function Vi(t) { return function() { this.innerHTML = t; }; } function Ui(t) { return function() { var n = t.apply(this, arguments); this.innerHTML = n ?? ""; }; } function Gi(t) { return arguments.length ? this.each(t == null ? Wi : (typeof t == "function" ? Ui : Vi)(t)) : this.node().innerHTML; } function Ki() { this.nextSibling && this.parentNode.appendChild(this); } function Zi() { return this.each(Ki); } function Qi() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Ji() { return this.each(Qi); } function ji(t) { var n = typeof t == "function" ? t : Ee(t); return this.select(function() { return this.appendChild(n.apply(this, arguments)); }); } function to() { return null; } function no(t, n) { var e = typeof t == "function" ? t : Ee(t), r = n == null ? to : typeof n == "function" ? n : En(n); return this.select(function() { return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null); }); } function eo() { var t = this.parentNode; t && t.removeChild(this); } function ro() { return this.each(eo); } function io() { var t = this.cloneNode(!1), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function oo() { var t = this.cloneNode(!0), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function so(t) { return this.select(t ? oo : io); } function ao(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function lo(t) { return function(n) { t.call(this, n, this.__data__); }; } function uo(t) { return t.trim().split(/^|\s+/).map(function(n) { var e = "", r = n.indexOf("."); return r >= 0 && (e = n.slice(r + 1), n = n.slice(0, r)), { type: n, name: e }; }); } function co(t) { return function() { var n = this.__on; if (n) { for (var e = 0, r = -1, i = n.length, o; e < i; ++e) o = n[e], (!t.type || o.type === t.type) && o.name === t.name ? this.removeEventListener(o.type, o.listener, o.options) : n[++r] = o; ++r ? n.length = r : delete this.__on; } }; } function fo(t, n, e) { return function() { var r = this.__on, i, o = lo(n); if (r) { for (var s = 0, a = r.length; s < a; ++s) if ((i = r[s]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = o, i.options = e), i.value = n; return; } } this.addEventListener(t.type, o, e), i = { type: t.type, name: t.name, value: n, listener: o, options: e }, r ? r.push(i) : this.__on = [i]; }; } function ho(t, n, e) { var r = uo(t + ""), i, o = r.length, s; if (arguments.length < 2) { var a = this.node().__on; if (a) { for (var u = 0, l = a.length, c; u < l; ++u) for (i = 0, c = a[u]; i < o; ++i) if ((s = r[i]).type === c.type && s.name === c.name) return c.value; } return; } for (a = n ? fo : co, i = 0; i < o; ++i) this.each(a(r[i], n, e)); return this; } function Le(t, n, e) { var r = Me(t), i = r.CustomEvent; typeof i == "function" ? i = new i(n, e) : (i = r.document.createEvent("Event"), e ? (i.initEvent(n, e.bubbles, e.cancelable), i.detail = e.detail) : i.initEvent(n, !1, !1)), t.dispatchEvent(i); } function po(t, n) { return function() { return Le(this, t, n); }; } function mo(t, n) { return function() { return Le(this, t, n.apply(this, arguments)); }; } function _o(t, n) { return this.each((typeof n == "function" ? mo : po)(t, n)); } function* yo() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, o = r.length, s; i < o; ++i) (s = r[i]) && (yield s); } var go = [null]; function z(t, n) { this._groups = t, this._parents = n; } function Et() { return new z([[document.documentElement]], go); } function vo() { return this; } z.prototype = Et.prototype = { constructor: z, select: qr, selectAll: Ur, selectChild: Qr, selectChildren: ni, filter: ei, data: li, enter: ri, exit: ci, join: fi, merge: hi, selection: vo, order: pi, sort: di, call: _i, nodes: yi, node: gi, size: vi, empty: xi, each: wi, attr: Si, style: Ci, property: Di, classed: Bi, text: Hi, html: Gi, raise: Zi, lower: Ji, append: ji, insert: no, remove: ro, clone: so, datum: ao, on: ho, dispatch: _o, [Symbol.iterator]: yo }; function Nn(t, n, e) { t.prototype = n.prototype = e, e.constructor = t; } function De(t, n) { var e = Object.create(t.prototype); for (var r in n) e[r] = n[r]; return e; } function $t() { } var wt = 0.7, zt = 1 / wt, ct = "\\s*([+-]?\\d+)\\s*", bt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", H = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", xo = /^#([0-9a-f]{3,8})$/, wo = new RegExp(`^rgb\\(${ct},${ct},${ct}\\)$`), bo = new RegExp(`^rgb\\(${H},${H},${H}\\)$`), ko = new RegExp(`^rgba\\(${ct},${ct},${ct},${bt}\\)$`), Ao = new RegExp(`^rgba\\(${H},${H},${H},${bt}\\)$`), Eo = new RegExp(`^hsl\\(${bt},${H},${H}\\)$`), $o = new RegExp(`^hsla\\(${bt},${H},${H},${bt}\\)$`), Wn = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; Nn($t, ot, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: Vn, // Deprecated! Use color.formatHex. formatHex: Vn, formatHex8: No, formatHsl: So, formatRgb: Un, toString: Un }); function Vn() { return this.rgb().formatHex(); } function No() { return this.rgb().formatHex8(); } function So() { return Oe(this).formatHsl(); } function Un() { return this.rgb().formatRgb(); } function ot(t) { var n, e; return t = (t + "").trim().toLowerCase(), (n = xo.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? Gn(n) : e === 3 ? new L(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? Rt(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? Rt(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = wo.exec(t)) ? new L(n[1], n[2], n[3], 1) : (n = bo.exec(t)) ? new L(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = ko.exec(t)) ? Rt(n[1], n[2], n[3], n[4]) : (n = Ao.exec(t)) ? Rt(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = Eo.exec(t)) ? Qn(n[1], n[2] / 100, n[3] / 100, 1) : (n = $o.exec(t)) ? Qn(n[1], n[2] / 100, n[3] / 100, n[4]) : Wn.hasOwnProperty(t) ? Gn(Wn[t]) : t === "transparent" ? new L(NaN, NaN, NaN, 0) : null; } function Gn(t) { return new L(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function Rt(t, n, e, r) { return r <= 0 && (t = n = e = NaN), new L(t, n, e, r); } function To(t) { return t instanceof $t || (t = ot(t)), t ? (t = t.rgb(), new L(t.r, t.g, t.b, t.opacity)) : new L(); } function mn(t, n, e, r) { return arguments.length === 1 ? To(t) : new L(t, n, e, r ?? 1); } function L(t, n, e, r) { this.r = +t, this.g = +n, this.b = +e, this.opacity = +r; } Nn(L, mn, De($t, { brighter(t) { return t = t == null ? zt : Math.pow(zt, t), new L(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? wt : Math.pow(wt, t), new L(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new L(it(this.r), it(this.g), it(this.b), qt(this.opacity)); }, displayable() { 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; }, hex: Kn, // Deprecated! Use color.formatHex. formatHex: Kn, formatHex8: Mo, formatRgb: Zn, toString: Zn })); function Kn() { return `#${rt(this.r)}${rt(this.g)}${rt(this.b)}`; } function Mo() { return `#${rt(this.r)}${rt(this.g)}${rt(this.b)}${rt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Zn() { const t = qt(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${it(this.r)}, ${it(this.g)}, ${it(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function qt(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function it(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function rt(t) { return t = it(t), (t < 16 ? "0" : "") + t.toString(16); } function Qn(t, n, e, r) { return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new X(t, n, e, r); } function Oe(t) { if (t instanceof X) return new X(t.h, t.s, t.l, t.opacity); if (t instanceof $t || (t = ot(t)), !t) return new X(); if (t instanceof X) return t; t = t.rgb(); var n = t.r / 255, e = t.g / 255, r = t.b / 255, i = Math.min(n, e, r), o = Math.max(n, e, r), s = NaN, a = o - i, u = (o + i) / 2; return a ? (n === o ? s = (e - r) / a + (e < r) * 6 : e === o ? s = (r - n) / a + 2 : s = (n - e) / a + 4, a /= u < 0.5 ? o + i : 2 - o - i, s *= 60) : a = u > 0 && u < 1 ? 0 : s, new X(s, a, u, t.opacity); } function Ro(t, n, e, r) { return arguments.length === 1 ? Oe(t) : new X(t, n, e, r ?? 1); } function X(t, n, e, r) { this.h = +t, this.s = +n, this.l = +e, this.opacity = +r; } Nn(X, Ro, De($t, { brighter(t) { return t = t == null ? zt : Math.pow(zt, t), new X(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? wt : Math.pow(wt, t), new X(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, n = isNaN(t) || isNaN(this.s) ? 0 : this.s, e = this.l, r = e + (e < 0.5 ? e : 1 - e) * n, i = 2 * e - r; return new L( ln(t >= 240 ? t - 240 : t + 120, i, r), ln(t, i, r), ln(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new X(Jn(this.h), Ct(this.s), Ct(this.l), qt(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { const t = qt(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Jn(this.h)}, ${Ct(this.s) * 100}%, ${Ct(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Jn(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function Ct(t) { return Math.max(0, Math.min(1, t || 0)); } function ln(t, n, e) { return (t < 60 ? n + (e - n) * t / 60 : t < 180 ? e : t < 240 ? n + (e - n) * (240 - t) / 60 : n) * 255; } const Sn = (t) => () => t; function Co(t, n) { return function(e) { return t + e * n; }; } function Po(t, n, e) { return t = Math.pow(t, e), n = Math.pow(n, e) - t, e = 1 / e, function(r) { return Math.pow(t + r * n, e); }; } function Io(t) { return (t = +t) == 1 ? Fe : function(n, e) { return e - n ? Po(n, e, t) : Sn(isNaN(n) ? e : n); }; } function Fe(t, n) { var e = n - t; return e ? Co(t, e) : Sn(isNaN(t) ? n : t); } const Ht = function t(n) { var e = Io(n); function r(i, o) { var s = e((i = mn(i)).r, (o = mn(o)).r), a = e(i.g, o.g), u = e(i.b, o.b), l = Fe(i.opacity, o.opacity); return function(c) { return i.r = s(c), i.g = a(c), i.b = u(c), i.opacity = l(c), i + ""; }; } return r.gamma = t, r; }(1); function Lo(t, n) { n || (n = []); var e = t ? Math.min(n.length, t.length) : 0, r = n.slice(), i; return function(o) { for (i = 0; i < e; ++i) r[i] = t[i] * (1 - o) + n[i] * o; return r; }; } function Do(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Oo(t, n) { var e = n ? n.length : 0, r = t ? Math.min(e, t.length) : 0, i = new Array(r), o = new Array(e), s; for (s = 0; s < r; ++s) i[s] = Tn(t[s], n[s]); for (; s < e; ++s) o[s] = n[s]; return function(a) { for (s = 0; s < r; ++s) o[s] = i[s](a); return o; }; } function Fo(t, n) { var e = /* @__PURE__ */ new Date(); return t = +t, n = +n, function(r) { return e.setTime(t * (1 - r) + n * r), e; }; } function B(t, n) { return t = +t, n = +n, function(e) { return t * (1 - e) + n * e; }; } function Yo(t, n) { var e = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (n === null || typeof n != "object") && (n = {}); for (i in n) i in t ? e[i] = Tn(t[i], n[i]) : r[i] = n[i]; return function(o) { for (i in e) r[i] = e[i](o); return r; }; } var _n = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, un = new RegExp(_n.source, "g"); function Bo(t) { return function() { return t; }; } function Xo(t) { return function(n) { return t(n) + ""; }; } function Ye(t, n) { var e = _n.lastIndex = un.lastIndex = 0, r, i, o, s = -1, a = [], u = []; for (t = t + "", n = n + ""; (r = _n.exec(t)) && (i = un.exec(n)); ) (o = i.index) > e && (o = n.slice(e, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (i = i[0]) ? a[s] ? a[s] += i : a[++s] = i : (a[++s] = null, u.push({ i: s, x: B(r, i) })), e = un.lastIndex; return e < n.length && (o = n.slice(e), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? u[0] ? Xo(u[0].x) : Bo(n) : (n = u.length, function(l) { for (var c = 0, f; c < n; ++c) a[(f = u[c]).i] = f.x(l); return a.join(""); }); } function Tn(t, n) { var e = typeof n, r; return n == null || e === "boolean" ? Sn(n) : (e === "number" ? B : e === "string" ? (r = ot(n)) ? (n = r, Ht) : Ye : n instanceof ot ? Ht : n instanceof Date ? Fo : Do(n) ? Lo : Array.isArray(n) ? Oo : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? Yo : B)(t, n); } function zo(t, n) { return t = +t, n = +n, function(e) { return Math.round(t * (1 - e) + n * e); }; } var jn = 180 / Math.PI, yn = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function Be(t, n, e, r, i, o) { var s, a, u; return (s = Math.sqrt(t * t + n * n)) && (t /= s, n /= s), (u = t * e + n * r) && (e -= t * u, r -= n * u), (a = Math.sqrt(e * e + r * r)) && (e /= a, r /= a, u /= a), t * r < n * e && (t = -t, n = -n, u = -u, s = -s), { translateX: i, translateY: o, rotate: Math.atan2(n, t) * jn, skewX: Math.atan(u) * jn, scaleX: s, scaleY: a }; } var Pt; function qo(t) { const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return n.isIdentity ? yn : Be(n.a, n.b, n.c, n.d, n.e, n.f); } function Ho(t) { return t == null || (Pt || (Pt = document.createElementNS("http://www.w3.org/2000/svg", "g")), Pt.setAttribute("transform", t), !(t = Pt.transform.baseVal.consolidate())) ? yn : (t = t.matrix, Be(t.a, t.b, t.c, t.d, t.e, t.f)); } function Xe(t, n, e, r) { function i(l) { return l.length ? l.pop() + " " : ""; } function o(l, c, f, p, d, m) { if (l !== f || c !== p) { var h = d.push("translate(", null, n, null, e); m.push({ i: h - 4, x: B(l, f) }, { i: h - 2, x: B(c, p) }); } else (f || p) && d.push("translate(" + f + n + p + e); } function s(l, c, f, p) { l !== c ? (l - c > 180 ? c += 360 : c - l > 180 && (l += 360), p.push({ i: f.push(i(f) + "rotate(", null, r) - 2, x: B(l, c) })) : c && f.push(i(f) + "rotate(" + c + r); } function a(l, c, f, p) { l !== c ? p.push({ i: f.push(i(f) + "skewX(", null, r) - 2, x: B(l, c) }) : c && f.push(i(f) + "skewX(" + c + r); } function u(l, c, f, p, d, m) { if (l !== f || c !== p) { var h = d.push(i(d) + "scale(", null, ",", null, ")"); m.push({ i: h - 4, x: B(l, f) }, { i: h - 2, x: B(c, p) }); } else (f !== 1 || p !== 1) && d.push(i(d) + "scale(" + f + "," + p + ")"); } return function(l, c) { var f = [], p = []; return l = t(l), c = t(c), o(l.translateX, l.translateY, c.translateX, c.translateY, f, p), s(l.rotate, c.rotate, f, p), a(l.skewX, c.skewX, f, p), u(l.scaleX, l.scaleY, c.scaleX, c.scaleY, f, p), l = c = null, function(d) { for (var m = -1, h = p.length, g; ++m < h; ) f[(g = p[m]).i] = g.x(d); return f.join(""); }; }; } var Wo = Xe(qo, "px, ", "px)", "deg)"), Vo = Xe(Ho, ", ", ")", ")"), ht = 0, mt = 0, dt = 0, ze = 1e3, Wt, _t, Vt = 0, st = 0, nn = 0, kt = typeof performance == "object" && performance.now ? performance : Date, qe = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Mn() { return st || (qe(Uo), st = kt.now() + nn); } function Uo() { st = 0; } function Ut() { this._call = this._time = this._next = null; } Ut.prototype = He.prototype = { constructor: Ut, restart: function(t, n, e) { if (typeof t != "function") throw new TypeError("callback is not a function"); e = (e == null ? Mn() : +e) + (n == null ? 0 : +n), !this._next && _t !== this && (_t ? _t._next = this : Wt = this, _t = this), this._call = t, this._time = e, gn(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, gn()); } }; function He(t, n, e) { var r = new Ut(); return r.restart(t, n, e), r; } function Go() { Mn(), ++ht; for (var t = Wt, n; t; ) (n = st - t._time) >= 0 && t._call.call(void 0, n), t = t._next; --ht; } function te() { st = (Vt = kt.now()) + nn, ht = mt = 0; try { Go(); } finally { ht = 0, Zo(), st = 0; } } function Ko() { var t = kt.now(), n = t - Vt; n > ze && (nn -= n, Vt = t); } function Zo() { for (var t, n = Wt, e, r = 1 / 0; n; ) n._call ? (r > n._time && (r = n._time), t = n, n = n._next) : (e = n._next, n._next = null, n = t ? t._next = e : Wt = e); _t = t, gn(r); } function gn(t) { if (!ht) { mt && (mt = clearTimeout(mt)); var n = t - st; n > 24 ? (t < 1 / 0 && (mt = setTimeout(te, t - kt.now() - nn)), dt && (dt = clearInterval(dt))) : (dt || (Vt = kt.now(), dt = setInterval(Ko, ze)), ht = 1, qe(te)); } } function ne(t, n, e) { var r = new Ut(); return n = n == null ? 0 : +n, r.restart((i) => { r.stop(), t(i + n); }, n, e), r; } var Qo = Ae("start", "end", "cancel", "interrupt"), Jo = [], We = 0, ee = 1, vn = 2, Ft = 3, re = 4, xn = 5, Yt = 6; function en(t, n, e, r, i, o) { var s = t.__transition; if (!s) t.__transition = {}; else if (e in s) return; jo(t, e, { name: n, index: r, // For context during callback. group: i, // For context during callback. on: Qo, tween: Jo, time: o.time, delay: o.delay, duration: o.duration, ease: o.ease, timer: null, state: We }); } function Rn(t, n) { var e = q(t, n); if (e.state > We) throw new Error("too late; already scheduled"); return e; } function W(t, n) { var e = q(t, n); if (e.state > Ft) throw new Error("too late; already running"); return e; } function q(t, n) { var e = t.__transition; if (!e || !(e = e[n])) throw new Error("transition not found"); return e; } function jo(t, n, e) { var r = t.__transition, i; r[n] = e, e.timer = He(o, 0, e.time); function o(l) { e.state = ee, e.timer.restart(s, e.delay, e.time), e.delay <= l && s(l - e.delay); } function s(l) { var c, f, p, d; if (e.state !== ee) return u(); for (c in r) if (d = r[c], d.name === e.name) { if (d.state === Ft) return ne(s); d.state === re ? (d.state = Yt, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[c]) : +c < n && (d.state = Yt, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[c]); } if (ne(function() { e.state === Ft && (e.state = re, e.timer.restart(a, e.delay, e.time), a(l)); }), e.state = vn, e.on.call("start", t, t.__data__, e.index, e.group), e.state === vn) { for (e.state = Ft, i = new Array(p = e.tween.length), c = 0, f = -1; c < p; ++c) (d = e.tween[c].value.call(t, t.__data__, e.index, e.group)) && (i[++f] = d); i.length = f + 1; } } function a(l) { for (var c = l < e.duration ? e.ease.call(null, l / e.duration) : (e.timer.restart(u), e.state = xn, 1), f = -1, p = i.length; ++f < p; ) i[f].call(t, c); e.state === xn && (e.on.call("end", t, t.__data__, e.index, e.group), u()); } function u() { e.state = Yt, e.timer.stop(), delete r[n]; for (var l in r) return; delete t.__transition; } } function ts(t, n) { var e = t.__transition, r, i, o = !0, s; if (e) { n = n == null ? null : n + ""; for (s in e) { if ((r = e[s]).name !== n) { o = !1; continue; } i = r.state > vn && r.state < xn, r.state = Yt, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[s]; } o && delete t.__transition; } } function ns(t) { return this.each(function() { ts(this, t); }); } function es(t, n) { var e, r; return function() { var i = W(this, t), o = i.tween; if (o !== e) { r = e = o; for (var s = 0, a = r.length; s < a; ++s) if (r[s].name === n) { r = r.slice(), r.splice(s, 1); break; } } i.tween = r; }; } function rs(t, n, e) { var r, i; if (typeof e != "function") throw new Error(); return function() { var o = W(this, t), s = o.tween; if (s !== r) { i = (r = s).slice(); for (var a = { name: n, value: e }, u = 0, l = i.length; u < l; ++u) if (i[u].name === n) { i[u] = a; break; } u === l && i.push(a); } o.tween = i; }; } function is(t, n) { var e = this._id; if (t += "", arguments.length < 2) { for (var r = q(this.node(), e).tween, i = 0, o = r.length, s; i < o; ++i) if ((s = r[i]).name === t) return s.value; return null; } return this.each((n == null ? es : rs)(e, t, n)); } function Cn(t, n, e) { var r = t._id; return t.each(function() { var i = W(this, r); (i.value || (i.value = {}))[n] = e.apply(this, arguments); }), function(i) { return q(i, r).value[n]; }; } function Ve(t, n) { var e; return (typeof n == "number" ? B : n instanceof ot ? Ht : (e = ot(n)) ? (n = e, Ht) : Ye)(t, n); } function os(t) { return function() { this.removeAttribute(t); }; } function ss(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function as(t, n, e) { var r, i = e + "", o; return function() { var s = this.getAttribute(t); return s === i ? null : s === r ? o : o = n(r = s, e); }; } function ls(t, n, e) { var r, i = e + "", o; return function() { var s = this.getAttributeNS(t.space, t.local); return s === i ? null : s === r ? o : o = n(r = s, e); }; } function us(t, n, e) { var r, i, o; return function() { var s, a = e(this), u; return a == null ? void this.removeAttribute(t) : (s = this.getAttribute(t), u = a + "", s === u ? null : s === r && u === i ? o : (i = u, o = n(r = s, a))); }; } function cs(t, n, e) { var r, i, o; return function() { var s, a = e(this), u; return a == null ? void this.removeAttributeNS(t.space, t.local) : (s = this.getAttributeNS(t.space, t.local), u = a + "", s === u ? null : s === r && u === i ? o : (i = u, o = n(r = s, a))); }; } function fs(t, n) { var e = tn(t), r = e === "transform" ? Vo : Ve; return this.attrTween(t, typeof n == "function" ? (e.local ? cs : us)(e, r, Cn(this, "attr." + t, n)) : n == null ? (e.local ? ss : os)(e) : (e.local ? ls : as)(e, r, n)); } function hs(t, n) { return function(e) { this.setAttribute(t, n.call(this, e)); }; } function ps(t, n) { return function(e) { this.setAttributeNS(t.space, t.local, n.call(this, e)); }; } function ds(t, n) { var e, r; function i() { var o = n.apply(this, arguments); return o !== r && (e = (r = o) && ps(t, o)), e; } return i._value = n, i; } function ms(t, n) { var e, r; function i() { var o = n.apply(this, arguments); return o !== r && (e = (r = o) && hs(t, o)), e; } return i._value = n, i; } function _s(t, n) { var e = "attr." + t; if (arguments.length < 2) return (e = this.tween(e)) && e._value; if (n == null) return this.tween(e, null); if (typeof n != "function") throw new Error(); var r = tn(t); return this.tween(e, (r.local ? ds : ms)(r, n)); } function ys(t, n) { return function() { Rn(this, t).delay = +n.apply(this, arguments); }; } function gs(t, n) { return n = +n, function() { Rn(this, t).delay = n; }; } function vs(t) { var n = this._id; return arguments.length ? this.each((typeof t == "function" ? ys : gs)(n, t)) : q(this.node(), n).delay; } function xs(t, n) { return function() { W(this, t).duration = +n.apply(this, arguments); }; } function ws(t, n) { return n = +n, function() { W(this, t).duration = n; }; } function bs(t) { var n = this._id; return arguments.length ? this.each((typeof t == "function" ? xs : ws)(n, t)) : q(this.node(), n).duration; } function ks(t, n) { if (typeof n != "function") throw new Error(); return function() { W(this, t).ease = n; }; } function As(t) { var n = this._id; return arguments.length ? this.each(ks(n, t)) : q(this.node(), n).ease; } function Es(t, n) { return function() { var e = n.apply(this, arguments); if (typeof e != "function") throw new Error(); W(this, t).ease = e; }; } function $s(t) { if (typeof t != "function") throw new Error(); return this.each(Es(this._id, t)); } function Ns(t) { typeof t != "function" && (t = Ne(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var o = n[i], s = o.length, a = r[i] = [], u, l = 0; l < s; ++l) (u = o[l]) && t.call(u, u.__data__, l, o) && a.push(u); return new K(r, this._parents, this._name, this._id); } function Ss(t) { if (t._id !== this._id) throw new Error(); for (var n = this._groups, e = t._groups, r = n.length, i = e.length, o = Math.min(r, i), s = new Array(r), a = 0; a < o; ++a) for (var u = n[a], l = e[a], c = u.length, f = s[a] = new Array(c), p, d = 0; d < c; ++d) (p = u[d] || l[d]) && (f[d] = p); for (; a < r; ++a) s[a] = n[a]; return new K(s, this._parents, this._name, this._id); } function Ts(t) { return (t + "").trim().split(/^|\s+/).every(function(n) { var e = n.indexOf("."); return e >= 0 && (n = n.slice(0, e)), !n || n === "start"; }); } function Ms(t, n, e) { var r, i, o = Ts(n) ? Rn : W; return function() { var s = o(this, t), a = s.on; a !== r && (i = (r = a).copy()).on(n, e), s.on = i; }; } function Rs(t, n) { var e = this._id; return arguments.length < 2 ? q(this.node(), e).on.on(t) : this.each(Ms(e, t, n)); } function Cs(t) { return function() { var n = this.parentNode; for (var e in this.__transition) if (+e !== t) return; n && n.removeChild(this); }; } function Ps() { return this.on("end.remove", Cs(this._id)); } function Is(t) { var n = this._name, e = this._id; typeof t != "function" && (t = En(t)); for (var r = this._groups, i = r.length, o = new Array(i), s = 0; s < i; ++s) for (var a = r[s], u = a.length, l = o[s] = new Array(u), c, f, p = 0; p < u; ++p) (c = a[p]) && (f = t.call(c, c.__data__, p, a)) && ("__data__" in c && (f.__data__ = c.__data__), l[p] = f, en(l[p], n, e, p, l, q(c, e))); return new K(o, this._parents, n, e); } function Ls(t) { var n = this._name, e = this._id; typeof t != "function" && (t = $e(t)); for (var r = this._groups, i = r.length, o = [], s = [], a = 0; a < i; ++a) for (var u = r[a], l = u.length, c, f = 0; f < l; ++f) if (c = u[f]) { for (var p = t.call(c, c.__data__, f, u), d, m = q(c, e), h = 0, g = p.length; h < g; ++h) (d = p[h]) && en(d, n, e, h, p, m); o.push(p), s.push(c); } return new K(o, s, n, e); } var Ds = Et.prototype.constructor; function Os() { return new Ds(this._groups, this._parents); } function Fs(t, n) { var e, r, i; return function() { var o = ft(this, t), s = (this.style.removeProperty(t), ft(this, t)); return o === s ? null : o === e && s === r ? i : i = n(e = o, r = s); }; } function Ue(t) { return function() { this.style.removeProperty(t); }; } function Ys(t, n, e) { var r, i = e + "", o; return function() { var s = ft(this, t); return s === i ? null : s === r ? o : o = n(r = s, e); }; } function Bs(t, n, e) { var r, i, o; return function() { var s = ft(this, t), a = e(this), u = a + ""; return a == null && (u = a = (this.style.removeProperty(t), ft(this, t))), s === u ? null : s === r && u === i ? o : (i = u, o = n(r = s, a)); }; } function Xs(t, n) { var e, r, i, o = "style." + n, s = "end." + o, a; return function() { var u = W(this, t), l = u.on, c = u.value[o] == null ? a || (a = Ue(n)) : void 0; (l !== e || i !== c) && (r = (e = l).copy()).on(s, i = c), u.on = r; }; } function zs(t, n, e) { var r = (t += "") == "transform" ? Wo : Ve; return n == null ? this.styleTween(t, Fs(t, r)).on("end.style." + t, Ue(t)) : typeof n == "function" ? this.styleTween(t, Bs(t, r, Cn(this, "style." + t, n))).each(Xs(this._id, t)) : this.styleTween(t, Ys(t, r, n), e).on("end.style." + t, null); } function qs(t, n, e) { return function(r) { this.style.setProperty(t, n.call(this, r), e); }; } function Hs(t, n, e) { var r, i; function o() { var s = n.apply(this, arguments); return s !== i && (r = (i = s) && qs(t, s, e)), r; } return o._value = n, o; } function Ws(t, n, e) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (n == null) return this.tween(r, null); if (typeof n != "function") throw new Error(); return this.tween(r, Hs(t, n, e ?? "")); } function Vs(t) { return function() { this.textContent = t; }; } function Us(t) { retu