UNPKG

@explorables/ride_my_kuramotocycle

Version:

This explorable illustrates the Kuramoto model for phase coupled oscillators. This model is used to describe synchronization phenomena in natural systems, e.g. the flash synchronization of fire flies or wall-mounted clocks.

1,475 lines 235 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-text-2xl:1.5rem;--tw-text-2xl--line-height:calc(2/1.5);--tw-text-3xl:1.875rem;--tw-text-3xl--line-height: 1.2 ;--tw-text-5xl:3rem;--tw-text-5xl--line-height:1;--tw-font-weight-light:300}}@layer base,components;@layer utilities{.tw\\:m-8{margin:calc(var(--tw-spacing)*8)}.tw\\:grid{display:grid}.tw\\:max-w-5xl{max-width:var(--tw-container-5xl)}.tw\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.tw\\:border-1{border-style:var(--tw-border-style);border-width:1px}.tw\\:border-black{border-color:var(--tw-color-black)}.tw\\:bg-white{background-color:var(--tw-color-white)}.tw\\:p-0{padding:calc(var(--tw-spacing)*0)}.tw\\:px-1{padding-inline:calc(var(--tw-spacing)*1)}.tw\\:px-10{padding-inline:calc(var(--tw-spacing)*10)}.tw\\:font-sans{font-family:var(--tw-font-sans)}.tw\\:text-2xl{font-size:var(--tw-text-2xl);line-height:var(--tw-leading,var(--tw-text-2xl--line-height))}.tw\\:text-3xl{font-size:var(--tw-text-3xl);line-height:var(--tw-leading,var(--tw-text-3xl--line-height))}.tw\\:text-5xl{font-size:var(--tw-text-5xl);line-height:var(--tw-leading,var(--tw-text-5xl--line-height))}.tw\\:font-light{--tw-font-weight:var(--tw-font-weight-light);font-weight:var(--tw-font-weight-light)}.tw\\:text-black{color:var(--tw-color-black)}@media (min-width:40rem){.tw\\:sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.tw\\:sm\\:gap-8{gap:calc(var(--tw-spacing)*8)}.tw\\:sm\\:p-0{padding:calc(var(--tw-spacing)*0)}}@media (prefers-color-scheme:dark){.tw\\:dark\\:border-white{border-color:var(--tw-color-white)}.tw\\:dark\\:bg-black{background-color:var(--tw-color-black)}.tw\\:dark\\:text-white{color:var(--tw-color-white)}}.debug-grid-16{background-image:linear-gradient(90deg,#0000ff1a 1px,#0000 1px),linear-gradient(#0000ff1a 1px,#0000 1px);background-repeat:repeat;background-size:6.25% 6.25%,6.25% 6.25%}}.explorable *,.explorable :before,.explorable :after{box-sizing:border-box}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}._agent_79sa2_1{opacity:.7;stroke:#000;stroke-width:.5px}._xlabel_79sa2_22,._ylabel_79sa2_25{text-anchor:middle}._caxis_79sa2_28{stroke:#000;stroke-width:.5px;stroke-opacity:.5}._dot_79sa2_34{stroke:gray;stroke-width:.5px;fill:#8b0000}._op_79sa2_40{stroke:#8b0000;stroke-width:.5px;fill:none}._plotline_79sa2_46{stroke:#8b0000;stroke-width:2px;fill:none}._osctrack_79sa2_52{fill:none;stroke-width:1px;stroke-opacity:.6;stroke:gray}@media (prefers-color-scheme: dark){._caxis_79sa2_28{stroke:#fff}._plot_79sa2_11{color:#fff}._xlabel_79sa2_22,._ylabel_79sa2_25{fill:#fff}._plotline_79sa2_46{stroke:red}._op_79sa2_40{stroke:red;stroke-width:1px;fill:none}._dot_79sa2_34{stroke:gray;stroke-width:.5px;fill:red}}._displayPanel_79sa2_89,._controlPanel_79sa2_96{display:block;line-height:0;box-sizing:border-box}._displayPanel_79sa2_89>canvas,._displayPanel_79sa2_89>svg,._controlPanel_79sa2_96>svg,._controlPanel_79sa2_96>canvas{display:block;box-sizing:border-box}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); const ol = { display_type: "svg", // either svg or canvas depending on explorable debug: !1, // if set to true, draws dots on the control panel to help widget placement debug_lattice: "debug-grid-16", controls_grid: { nx: 12, ny: 12 }, display_size: { width: 500, height: 500 }, controls_size: { width: 480, height: 480 }, display_class: " tw:p-0 tw:border-1 tw:border-black tw:dark:border-white", controls_class: "d3-widgets tw:p-0", container_class: "tw:font-sans tw:font-light tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:sm:gap-8 tw:px-1 tw:sm:p-0 tw:m-8" }; function oe(t, n) { return t == null || n == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function sl(t, n) { return t == null || n == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN; } function Uo(t) { let n, e, r; t.length !== 2 ? (n = oe, e = (s, l) => oe(t(s), l), r = (s, l) => t(s) - l) : (n = t === oe || t === sl ? t : ul, e = t, r = t); function i(s, l, u = 0, c = s.length) { if (u < c) { if (n(l, l) !== 0) return c; do { const h = u + c >>> 1; e(s[h], l) < 0 ? u = h + 1 : c = h; } while (u < c); } return u; } function a(s, l, u = 0, c = s.length) { if (u < c) { if (n(l, l) !== 0) return c; do { const h = u + c >>> 1; e(s[h], l) <= 0 ? u = h + 1 : c = h; } while (u < c); } return u; } function o(s, l, u = 0, c = s.length) { const h = i(s, l, u, c - 1); return h > u && r(s[h - 1], l) > -r(s[h], l) ? h - 1 : h; } return { left: i, center: o, right: a }; } function ul() { return 0; } function ll(t) { return t === null ? NaN : +t; } const cl = Uo(oe), fl = cl.right; Uo(ll).center; const hl = Math.sqrt(50), dl = Math.sqrt(10), pl = Math.sqrt(2); function me(t, n, e) { const r = (n - t) / Math.max(0, e), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), o = a >= hl ? 10 : a >= dl ? 5 : a >= pl ? 2 : 1; let s, l, u; return i < 0 ? (u = Math.pow(10, -i) / o, s = Math.round(t * u), l = Math.round(n * u), s / u < t && ++s, l / u > n && --l, u = -u) : (u = Math.pow(10, i) * o, s = Math.round(t / u), l = Math.round(n / u), s * u < t && ++s, l * u > n && --l), l < s && 0.5 <= e && e < 2 ? me(t, n, e * 2) : [s, l, u]; } function gl(t, n, e) { if (n = +n, t = +t, e = +e, !(e > 0)) return []; if (t === n) return [t]; const r = n < t, [i, a, o] = r ? me(n, t, e) : me(t, n, e); if (!(a >= i)) return []; const s = a - i + 1, l = new Array(s); if (r) if (o < 0) for (let u = 0; u < s; ++u) l[u] = (a - u) / -o; else for (let u = 0; u < s; ++u) l[u] = (a - u) * o; else if (o < 0) for (let u = 0; u < s; ++u) l[u] = (i + u) / -o; else for (let u = 0; u < s; ++u) l[u] = (i + u) * o; return l; } function Sr(t, n, e) { return n = +n, t = +t, e = +e, me(t, n, e)[2]; } function _l(t, n, e) { n = +n, t = +t, e = +e; const r = n < t, i = r ? Sr(n, t, e) : Sr(t, n, e); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i); } function yl(t) { return t; } var pr = 1, gr = 2, Pr = 3, vn = 4, ia = 1e-6; function ml(t) { return "translate(" + t + ",0)"; } function vl(t) { return "translate(0," + t + ")"; } function wl(t) { return (n) => +t(n); } function bl(t, n) { return n = Math.max(0, t.bandwidth() - n * 2) / 2, t.round() && (n = Math.round(n)), (e) => +t(e) + n; } function xl() { return !this.__axis; } function Yo(t, n) { var e = [], r = null, i = null, a = 6, o = 6, s = 3, l = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, u = t === pr || t === vn ? -1 : 1, c = t === vn || t === gr ? "x" : "y", h = t === pr || t === Pr ? ml : vl; function f(d) { var g = r ?? (n.ticks ? n.ticks.apply(n, e) : n.domain()), y = i ?? (n.tickFormat ? n.tickFormat.apply(n, e) : yl), w = Math.max(a, 0) + s, x = n.range(), p = +x[0] + l, M = +x[x.length - 1] + l, _ = (n.bandwidth ? bl : wl)(n.copy(), l), v = d.selection ? d.selection() : d, N = v.selectAll(".domain").data([null]), T = v.selectAll(".tick").data(g, n).order(), z = T.exit(), L = T.enter().append("g").attr("class", "tick"), R = T.select("line"), m = T.select("text"); N = N.merge(N.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), T = T.merge(L), R = R.merge(L.append("line").attr("stroke", "currentColor").attr(c + "2", u * a)), m = m.merge(L.append("text").attr("fill", "currentColor").attr(c, u * w).attr("dy", t === pr ? "0em" : t === Pr ? "0.71em" : "0.32em")), d !== v && (N = N.transition(d), T = T.transition(d), R = R.transition(d), m = m.transition(d), z = z.transition(d).attr("opacity", ia).attr("transform", function(S) { return isFinite(S = _(S)) ? h(S + l) : this.getAttribute("transform"); }), L.attr("opacity", ia).attr("transform", function(S) { var $ = this.parentNode.__axis; return h(($ && isFinite($ = $(S)) ? $ : _(S)) + l); })), z.remove(), N.attr("d", t === vn || t === gr ? o ? "M" + u * o + "," + p + "H" + l + "V" + M + "H" + u * o : "M" + l + "," + p + "V" + M : o ? "M" + p + "," + u * o + "V" + l + "H" + M + "V" + u * o : "M" + p + "," + l + "H" + M), T.attr("opacity", 1).attr("transform", function(S) { return h(_(S) + l); }), R.attr(c + "2", u * a), m.attr(c, u * w).text(y), v.filter(xl).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === gr ? "start" : t === vn ? "end" : "middle"), v.each(function() { this.__axis = _; }); } return f.scale = function(d) { return arguments.length ? (n = d, f) : n; }, f.ticks = function() { return e = Array.from(arguments), f; }, f.tickArguments = function(d) { return arguments.length ? (e = d == null ? [] : Array.from(d), f) : e.slice(); }, f.tickValues = function(d) { return arguments.length ? (r = d == null ? null : Array.from(d), f) : r && r.slice(); }, f.tickFormat = function(d) { return arguments.length ? (i = d, f) : i; }, f.tickSize = function(d) { return arguments.length ? (a = o = +d, f) : a; }, f.tickSizeInner = function(d) { return arguments.length ? (a = +d, f) : a; }, f.tickSizeOuter = function(d) { return arguments.length ? (o = +d, f) : o; }, f.tickPadding = function(d) { return arguments.length ? (s = +d, f) : s; }, f.offset = function(d) { return arguments.length ? (l = +d, f) : l; }, f; } function Ml(t) { return Yo(Pr, t); } function Al(t) { return Yo(vn, t); } var $l = { value: () => { } }; function Go() { 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 se(e); } function se(t) { this._ = t; } function Tl(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 }; }); } se.prototype = Go.prototype = { constructor: se, on: function(t, n) { var e = this._, r = Tl(t + "", e), i, a = -1, o = r.length; if (arguments.length < 2) { for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = kl(e[i], t.name))) return i; return; } if (n != null && typeof n != "function") throw new Error("invalid callback: " + n); for (; ++a < o; ) if (i = (t = r[a]).type) e[i] = aa(e[i], t.name, n); else if (n == null) for (i in e) e[i] = aa(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 se(t); }, call: function(t, n) { if ((i = arguments.length - 2) > 0) for (var e = new Array(i), r = 0, i, a; r < i; ++r) e[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (a = this._[t], r = 0, i = a.length; r < i; ++r) a[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, a = r.length; i < a; ++i) r[i].value.apply(n, e); } }; function kl(t, n) { for (var e = 0, r = t.length, i; e < r; ++e) if ((i = t[e]).name === n) return i.value; } function aa(t, n, e) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === n) { t[r] = $l, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return e != null && t.push({ name: n, value: e }), t; } var Er = "http://www.w3.org/1999/xhtml"; const oa = { svg: "http://www.w3.org/2000/svg", xhtml: Er, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function qe(t) { var n = t += "", e = n.indexOf(":"); return e >= 0 && (n = t.slice(0, e)) !== "xmlns" && (t = t.slice(e + 1)), oa.hasOwnProperty(n) ? { space: oa[n], local: t } : t; } function Nl(t) { return function() { var n = this.ownerDocument, e = this.namespaceURI; return e === Er && n.documentElement.namespaceURI === Er ? n.createElement(t) : n.createElementNS(e, t); }; } function Sl(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Vo(t) { var n = qe(t); return (n.local ? Sl : Nl)(n); } function Pl() { } function di(t) { return t == null ? Pl : function() { return this.querySelector(t); }; } function El(t) { typeof t != "function" && (t = di(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var a = n[i], o = a.length, s = r[i] = new Array(o), l, u, c = 0; c < o; ++c) (l = a[c]) && (u = t.call(l, l.__data__, c, a)) && ("__data__" in l && (u.__data__ = l.__data__), s[c] = u); return new B(r, this._parents); } function Ol(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function zl() { return []; } function Ko(t) { return t == null ? zl : function() { return this.querySelectorAll(t); }; } function Cl(t) { return function() { return Ol(t.apply(this, arguments)); }; } function Il(t) { typeof t == "function" ? t = Cl(t) : t = Ko(t); for (var n = this._groups, e = n.length, r = [], i = [], a = 0; a < e; ++a) for (var o = n[a], s = o.length, l, u = 0; u < s; ++u) (l = o[u]) && (r.push(t.call(l, l.__data__, u, o)), i.push(l)); return new B(r, i); } function Zo(t) { return function() { return this.matches(t); }; } function Wo(t) { return function(n) { return n.matches(t); }; } var Rl = Array.prototype.find; function jl(t) { return function() { return Rl.call(this.children, t); }; } function Fl() { return this.firstElementChild; } function Ll(t) { return this.select(t == null ? Fl : jl(typeof t == "function" ? t : Wo(t))); } var Dl = Array.prototype.filter; function ql() { return Array.from(this.children); } function Hl(t) { return function() { return Dl.call(this.children, t); }; } function Xl(t) { return this.selectAll(t == null ? ql : Hl(typeof t == "function" ? t : Wo(t))); } function Bl(t) { typeof t != "function" && (t = Zo(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var a = n[i], o = a.length, s = r[i] = [], l, u = 0; u < o; ++u) (l = a[u]) && t.call(l, l.__data__, u, a) && s.push(l); return new B(r, this._parents); } function Jo(t) { return new Array(t.length); } function Ul() { return new B(this._enter || this._groups.map(Jo), this._parents); } function ve(t, n) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n; } ve.prototype = { constructor: ve, 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 Yl(t) { return function() { return t; }; } function Gl(t, n, e, r, i, a) { for (var o = 0, s, l = n.length, u = a.length; o < u; ++o) (s = n[o]) ? (s.__data__ = a[o], r[o] = s) : e[o] = new ve(t, a[o]); for (; o < l; ++o) (s = n[o]) && (i[o] = s); } function Vl(t, n, e, r, i, a, o) { var s, l, u = /* @__PURE__ */ new Map(), c = n.length, h = a.length, f = new Array(c), d; for (s = 0; s < c; ++s) (l = n[s]) && (f[s] = d = o.call(l, l.__data__, s, n) + "", u.has(d) ? i[s] = l : u.set(d, l)); for (s = 0; s < h; ++s) d = o.call(t, a[s], s, a) + "", (l = u.get(d)) ? (r[s] = l, l.__data__ = a[s], u.delete(d)) : e[s] = new ve(t, a[s]); for (s = 0; s < c; ++s) (l = n[s]) && u.get(f[s]) === l && (i[s] = l); } function Kl(t) { return t.__data__; } function Zl(t, n) { if (!arguments.length) return Array.from(this, Kl); var e = n ? Vl : Gl, r = this._parents, i = this._groups; typeof t != "function" && (t = Yl(t)); for (var a = i.length, o = new Array(a), s = new Array(a), l = new Array(a), u = 0; u < a; ++u) { var c = r[u], h = i[u], f = h.length, d = Wl(t.call(c, c && c.__data__, u, r)), g = d.length, y = s[u] = new Array(g), w = o[u] = new Array(g), x = l[u] = new Array(f); e(c, h, y, w, x, d, n); for (var p = 0, M = 0, _, v; p < g; ++p) if (_ = y[p]) { for (p >= M && (M = p + 1); !(v = w[M]) && ++M < g; ) ; _._next = v || null; } } return o = new B(o, r), o._enter = s, o._exit = l, o; } function Wl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Jl() { return new B(this._exit || this._groups.map(Jo), this._parents); } function Ql(t, n, e) { var r = this.enter(), i = this, a = 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 ? a.remove() : e(a), r && i ? r.merge(i).order() : i; } function tc(t) { for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, a = r.length, o = Math.min(i, a), s = new Array(i), l = 0; l < o; ++l) for (var u = e[l], c = r[l], h = u.length, f = s[l] = new Array(h), d, g = 0; g < h; ++g) (d = u[g] || c[g]) && (f[g] = d); for (; l < i; ++l) s[l] = e[l]; return new B(s, this._parents); } function nc() { for (var t = this._groups, n = -1, e = t.length; ++n < e; ) for (var r = t[n], i = r.length - 1, a = r[i], o; --i >= 0; ) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o); return this; } function ec(t) { t || (t = rc); function n(h, f) { return h && f ? t(h.__data__, f.__data__) : !h - !f; } for (var e = this._groups, r = e.length, i = new Array(r), a = 0; a < r; ++a) { for (var o = e[a], s = o.length, l = i[a] = new Array(s), u, c = 0; c < s; ++c) (u = o[c]) && (l[c] = u); l.sort(n); } return new B(i, this._parents).order(); } function rc(t, n) { return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function ic() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function ac() { return Array.from(this); } function oc() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, a = r.length; i < a; ++i) { var o = r[i]; if (o) return o; } return null; } function sc() { let t = 0; for (const n of this) ++t; return t; } function uc() { return !this.node(); } function lc(t) { for (var n = this._groups, e = 0, r = n.length; e < r; ++e) for (var i = n[e], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && t.call(s, s.__data__, a, i); return this; } function cc(t) { return function() { this.removeAttribute(t); }; } function fc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function hc(t, n) { return function() { this.setAttribute(t, n); }; } function dc(t, n) { return function() { this.setAttributeNS(t.space, t.local, n); }; } function pc(t, n) { return function() { var e = n.apply(this, arguments); e == null ? this.removeAttribute(t) : this.setAttribute(t, e); }; } function gc(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 _c(t, n) { var e = qe(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 ? fc : cc : typeof n == "function" ? e.local ? gc : pc : e.local ? dc : hc)(e, n)); } function Qo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function yc(t) { return function() { this.style.removeProperty(t); }; } function mc(t, n, e) { return function() { this.style.setProperty(t, n, e); }; } function vc(t, n, e) { return function() { var r = n.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e); }; } function wc(t, n, e) { return arguments.length > 1 ? this.each((n == null ? yc : typeof n == "function" ? vc : mc)(t, n, e ?? "")) : nn(this.node(), t); } function nn(t, n) { return t.style.getPropertyValue(n) || Qo(t).getComputedStyle(t, null).getPropertyValue(n); } function bc(t) { return function() { delete this[t]; }; } function xc(t, n) { return function() { this[t] = n; }; } function Mc(t, n) { return function() { var e = n.apply(this, arguments); e == null ? delete this[t] : this[t] = e; }; } function Ac(t, n) { return arguments.length > 1 ? this.each((n == null ? bc : typeof n == "function" ? Mc : xc)(t, n)) : this.node()[t]; } function ts(t) { return t.trim().split(/^|\s+/); } function pi(t) { return t.classList || new ns(t); } function ns(t) { this._node = t, this._names = ts(t.getAttribute("class") || ""); } ns.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 es(t, n) { for (var e = pi(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]); } function rs(t, n) { for (var e = pi(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]); } function $c(t) { return function() { es(this, t); }; } function Tc(t) { return function() { rs(this, t); }; } function kc(t, n) { return function() { (n.apply(this, arguments) ? es : rs)(this, t); }; } function Nc(t, n) { var e = ts(t + ""); if (arguments.length < 2) { for (var r = pi(this.node()), i = -1, a = e.length; ++i < a; ) if (!r.contains(e[i])) return !1; return !0; } return this.each((typeof n == "function" ? kc : n ? $c : Tc)(e, n)); } function Sc() { this.textContent = ""; } function Pc(t) { return function() { this.textContent = t; }; } function Ec(t) { return function() { var n = t.apply(this, arguments); this.textContent = n ?? ""; }; } function Oc(t) { return arguments.length ? this.each(t == null ? Sc : (typeof t == "function" ? Ec : Pc)(t)) : this.node().textContent; } function zc() { this.innerHTML = ""; } function Cc(t) { return function() { this.innerHTML = t; }; } function Ic(t) { return function() { var n = t.apply(this, arguments); this.innerHTML = n ?? ""; }; } function Rc(t) { return arguments.length ? this.each(t == null ? zc : (typeof t == "function" ? Ic : Cc)(t)) : this.node().innerHTML; } function jc() { this.nextSibling && this.parentNode.appendChild(this); } function Fc() { return this.each(jc); } function Lc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Dc() { return this.each(Lc); } function qc(t) { var n = typeof t == "function" ? t : Vo(t); return this.select(function() { return this.appendChild(n.apply(this, arguments)); }); } function Hc() { return null; } function Xc(t, n) { var e = typeof t == "function" ? t : Vo(t), r = n == null ? Hc : typeof n == "function" ? n : di(n); return this.select(function() { return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null); }); } function Bc() { var t = this.parentNode; t && t.removeChild(this); } function Uc() { return this.each(Bc); } function Yc() { var t = this.cloneNode(!1), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function Gc() { var t = this.cloneNode(!0), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function Vc(t) { return this.select(t ? Gc : Yc); } function Kc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function Zc(t) { return function(n) { t.call(this, n, this.__data__); }; } function Wc(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 Jc(t) { return function() { var n = this.__on; if (n) { for (var e = 0, r = -1, i = n.length, a; e < i; ++e) a = n[e], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : n[++r] = a; ++r ? n.length = r : delete this.__on; } }; } function Qc(t, n, e) { return function() { var r = this.__on, i, a = Zc(n); if (r) { for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = e), i.value = n; return; } } this.addEventListener(t.type, a, e), i = { type: t.type, name: t.name, value: n, listener: a, options: e }, r ? r.push(i) : this.__on = [i]; }; } function tf(t, n, e) { var r = Wc(t + ""), i, a = r.length, o; if (arguments.length < 2) { var s = this.node().__on; if (s) { for (var l = 0, u = s.length, c; l < u; ++l) for (i = 0, c = s[l]; i < a; ++i) if ((o = r[i]).type === c.type && o.name === c.name) return c.value; } return; } for (s = n ? Qc : Jc, i = 0; i < a; ++i) this.each(s(r[i], n, e)); return this; } function is(t, n, e) { var r = Qo(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 nf(t, n) { return function() { return is(this, t, n); }; } function ef(t, n) { return function() { return is(this, t, n.apply(this, arguments)); }; } function rf(t, n) { return this.each((typeof n == "function" ? ef : nf)(t, n)); } function* af() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o); } var as = [null]; function B(t, n) { this._groups = t, this._parents = n; } function qn() { return new B([[document.documentElement]], as); } function of() { return this; } B.prototype = qn.prototype = { constructor: B, select: El, selectAll: Il, selectChild: Ll, selectChildren: Xl, filter: Bl, data: Zl, enter: Ul, exit: Jl, join: Ql, merge: tc, selection: of, order: nc, sort: ec, call: ic, nodes: ac, node: oc, size: sc, empty: uc, each: lc, attr: _c, style: wc, property: Ac, classed: Nc, text: Oc, html: Rc, raise: Fc, lower: Dc, append: qc, insert: Xc, remove: Uc, clone: Vc, datum: Kc, on: tf, dispatch: rf, [Symbol.iterator]: af }; function sf(t) { return typeof t == "string" ? new B([[document.querySelector(t)]], [document.documentElement]) : new B([[t]], as); } function gi(t, n, e) { t.prototype = n.prototype = e, e.constructor = t; } function os(t, n) { var e = Object.create(t.prototype); for (var r in n) e[r] = n[r]; return e; } function Hn() { } var Nn = 0.7, we = 1 / Nn, Kt = "\\s*([+-]?\\d+)\\s*", Sn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", rt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", uf = /^#([0-9a-f]{3,8})$/, lf = new RegExp(`^rgb\\(${Kt},${Kt},${Kt}\\)$`), cf = new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`), ff = new RegExp(`^rgba\\(${Kt},${Kt},${Kt},${Sn}\\)$`), hf = new RegExp(`^rgba\\(${rt},${rt},${rt},${Sn}\\)$`), df = new RegExp(`^hsl\\(${Sn},${rt},${rt}\\)$`), pf = new RegExp(`^hsla\\(${Sn},${rt},${rt},${Sn}\\)$`), sa = { 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 }; gi(Hn, It, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: ua, // Deprecated! Use color.formatHex. formatHex: ua, formatHex8: gf, formatHsl: _f, formatRgb: la, toString: la }); function ua() { return this.rgb().formatHex(); } function gf() { return this.rgb().formatHex8(); } function _f() { return ss(this).formatHsl(); } function la() { return this.rgb().formatRgb(); } function It(t) { var n, e; return t = (t + "").trim().toLowerCase(), (n = uf.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? ca(n) : e === 3 ? new q(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? Gn(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? Gn(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 = lf.exec(t)) ? new q(n[1], n[2], n[3], 1) : (n = cf.exec(t)) ? new q(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = ff.exec(t)) ? Gn(n[1], n[2], n[3], n[4]) : (n = hf.exec(t)) ? Gn(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = df.exec(t)) ? da(n[1], n[2] / 100, n[3] / 100, 1) : (n = pf.exec(t)) ? da(n[1], n[2] / 100, n[3] / 100, n[4]) : sa.hasOwnProperty(t) ? ca(sa[t]) : t === "transparent" ? new q(NaN, NaN, NaN, 0) : null; } function ca(t) { return new q(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function Gn(t, n, e, r) { return r <= 0 && (t = n = e = NaN), new q(t, n, e, r); } function yf(t) { return t instanceof Hn || (t = It(t)), t ? (t = t.rgb(), new q(t.r, t.g, t.b, t.opacity)) : new q(); } function be(t, n, e, r) { return arguments.length === 1 ? yf(t) : new q(t, n, e, r ?? 1); } function q(t, n, e, r) { this.r = +t, this.g = +n, this.b = +e, this.opacity = +r; } gi(q, be, os(Hn, { brighter(t) { return t = t == null ? we : Math.pow(we, t), new q(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Nn : Math.pow(Nn, t), new q(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new q(zt(this.r), zt(this.g), zt(this.b), xe(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: fa, // Deprecated! Use color.formatHex. formatHex: fa, formatHex8: mf, formatRgb: ha, toString: ha })); function fa() { return `#${Et(this.r)}${Et(this.g)}${Et(this.b)}`; } function mf() { return `#${Et(this.r)}${Et(this.g)}${Et(this.b)}${Et((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function ha() { const t = xe(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${zt(this.r)}, ${zt(this.g)}, ${zt(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function xe(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function zt(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function Et(t) { return t = zt(t), (t < 16 ? "0" : "") + t.toString(16); } function da(t, n, e, r) { return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new W(t, n, e, r); } function ss(t) { if (t instanceof W) return new W(t.h, t.s, t.l, t.opacity); if (t instanceof Hn || (t = It(t)), !t) return new W(); if (t instanceof W) return t; t = t.rgb(); var n = t.r / 255, e = t.g / 255, r = t.b / 255, i = Math.min(n, e, r), a = Math.max(n, e, r), o = NaN, s = a - i, l = (a + i) / 2; return s ? (n === a ? o = (e - r) / s + (e < r) * 6 : e === a ? o = (r - n) / s + 2 : o = (n - e) / s + 4, s /= l < 0.5 ? a + i : 2 - a - i, o *= 60) : s = l > 0 && l < 1 ? 0 : o, new W(o, s, l, t.opacity); } function vf(t, n, e, r) { return arguments.length === 1 ? ss(t) : new W(t, n, e, r ?? 1); } function W(t, n, e, r) { this.h = +t, this.s = +n, this.l = +e, this.opacity = +r; } gi(W, vf, os(Hn, { brighter(t) { return t = t == null ? we : Math.pow(we, t), new W(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Nn : Math.pow(Nn, t), new W(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 q( _r(t >= 240 ? t - 240 : t + 120, i, r), _r(t, i, r), _r(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new W(pa(this.h), Vn(this.s), Vn(this.l), xe(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 = xe(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${pa(this.h)}, ${Vn(this.s) * 100}%, ${Vn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function pa(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function Vn(t) { return Math.max(0, Math.min(1, t || 0)); } function _r(t, n, e) { return (t < 60 ? n + (e - n) * t / 60 : t < 180 ? e : t < 240 ? n + (e - n) * (240 - t) / 60 : n) * 255; } function wf(t, n, e, r, i) { var a = t * t, o = a * t; return ((1 - 3 * t + 3 * a - o) * n + (4 - 6 * a + 3 * o) * e + (1 + 3 * t + 3 * a - 3 * o) * r + o * i) / 6; } function bf(t) { var n = t.length - 1; return function(e) { var r = e <= 0 ? e = 0 : e >= 1 ? (e = 1, n - 1) : Math.floor(e * n), i = t[r], a = t[r + 1], o = r > 0 ? t[r - 1] : 2 * i - a, s = r < n - 1 ? t[r + 2] : 2 * a - i; return wf((e - r / n) * n, o, i, a, s); }; } const _i = (t) => () => t; function xf(t, n) { return function(e) { return t + e * n; }; } function Mf(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 Af(t) { return (t = +t) == 1 ? us : function(n, e) { return e - n ? Mf(n, e, t) : _i(isNaN(n) ? e : n); }; } function us(t, n) { var e = n - t; return e ? xf(t, e) : _i(isNaN(t) ? n : t); } const Me = function t(n) { var e = Af(n); function r(i, a) { var o = e((i = be(i)).r, (a = be(a)).r), s = e(i.g, a.g), l = e(i.b, a.b), u = us(i.opacity, a.opacity); return function(c) { return i.r = o(c), i.g = s(c), i.b = l(c), i.opacity = u(c), i + ""; }; } return r.gamma = t, r; }(1); function $f(t) { return function(n) { var e = n.length, r = new Array(e), i = new Array(e), a = new Array(e), o, s; for (o = 0; o < e; ++o) s = be(n[o]), r[o] = s.r || 0, i[o] = s.g || 0, a[o] = s.b || 0; return r = t(r), i = t(i), a = t(a), s.opacity = 1, function(l) { return s.r = r(l), s.g = i(l), s.b = a(l), s + ""; }; }; } var Tf = $f(bf); function kf(t, n) { n || (n = []); var e = t ? Math.min(n.length, t.length) : 0, r = n.slice(), i; return function(a) { for (i = 0; i < e; ++i) r[i] = t[i] * (1 - a) + n[i] * a; return r; }; } function Nf(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Sf(t, n) { var e = n ? n.length : 0, r = t ? Math.min(e, t.length) : 0, i = new Array(r), a = new Array(e), o; for (o = 0; o < r; ++o) i[o] = yi(t[o], n[o]); for (; o < e; ++o) a[o] = n[o]; return function(s) { for (o = 0; o < r; ++o) a[o] = i[o](s); return a; }; } function Pf(t, n) { var e = /* @__PURE__ */ new Date(); return t = +t, n = +n, function(r) { return e.setTime(t * (1 - r) + n * r), e; }; } function K(t, n) { return t = +t, n = +n, function(e) { return t * (1 - e) + n * e; }; } function Ef(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] = yi(t[i], n[i]) : r[i] = n[i]; return function(a) { for (i in e) r[i] = e[i](a); return r; }; } var Or = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, yr = new RegExp(Or.source, "g"); function Of(t) { return function() { return t; }; } function zf(t) { return function(n) { return t(n) + ""; }; } function ls(t, n) { var e = Or.lastIndex = yr.lastIndex = 0, r, i, a, o = -1, s = [], l = []; for (t = t + "", n = n + ""; (r = Or.exec(t)) && (i = yr.exec(n)); ) (a = i.index) > e && (a = n.slice(e, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, l.push({ i: o, x: K(r, i) })), e = yr.lastIndex; return e < n.length && (a = n.slice(e), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? l[0] ? zf(l[0].x) : Of(n) : (n = l.length, function(u) { for (var c = 0, h; c < n; ++c) s[(h = l[c]).i] = h.x(u); return s.join(""); }); } function yi(t, n) { var e = typeof n, r; return n == null || e === "boolean" ? _i(n) : (e === "number" ? K : e === "string" ? (r = It(n)) ? (n = r, Me) : ls : n instanceof It ? Me : n instanceof Date ? Pf : Nf(n) ? kf : Array.isArray(n) ? Sf : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? Ef : K)(t, n); } function Cf(t, n) { return t = +t, n = +n, function(e) { return Math.round(t * (1 - e) + n * e); }; } var ga = 180 / Math.PI, zr = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function cs(t, n, e, r, i, a) { var o, s, l; return (o = Math.sqrt(t * t + n * n)) && (t /= o, n /= o), (l = t * e + n * r) && (e -= t * l, r -= n * l), (s = Math.sqrt(e * e + r * r)) && (e /= s, r /= s, l /= s), t * r < n * e && (t = -t, n = -n, l = -l, o = -o), { translateX: i, translateY: a, rotate: Math.atan2(n, t) * ga, skewX: Math.atan(l) * ga, scaleX: o, scaleY: s }; } var Kn; function If(t) { const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return n.isIdentity ? zr : cs(n.a, n.b, n.c, n.d, n.e, n.f); } function Rf(t) { return t == null || (Kn || (Kn = document.createElementNS("http://www.w3.org/2000/svg", "g")), Kn.setAttribute("transform", t), !(t = Kn.transform.baseVal.consolidate())) ? zr : (t = t.matrix, cs(t.a, t.b, t.c, t.d, t.e, t.f)); } function fs(t, n, e, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function a(u, c, h, f, d, g) { if (u !== h || c !== f) { var y = d.push("translate(", null, n, null, e); g.push({ i: y - 4, x: K(u, h) }, { i: y - 2, x: K(c, f) }); } else (h || f) && d.push("translate(" + h + n + f + e); } function o(u, c, h, f) { u !== c ? (u - c > 180 ? c += 360 : c - u > 180 && (u += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: K(u, c) })) : c && h.push(i(h) + "rotate(" + c + r); } function s(u, c, h, f) { u !== c ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: K(u, c) }) : c && h.push(i(h) + "skewX(" + c + r); } function l(u, c, h, f, d, g) { if (u !== h || c !== f) { var y = d.push(i(d) + "scale(", null, ",", null, ")"); g.push({ i: y - 4, x: K(u, h) }, { i: y - 2, x: K(c, f) }); } else (h !== 1 || f !== 1) && d.push(i(d) + "scale(" + h + "," + f + ")"); } return function(u, c) { var h = [], f = []; return u = t(u), c = t(c), a(u.translateX, u.translateY, c.translateX, c.translateY, h, f), o(u.rotate, c.rotate, h, f), s(u.skewX, c.skewX, h, f), l(u.scaleX, u.scaleY, c.scaleX, c.scaleY, h, f), u = c = null, function(d) { for (var g = -1, y = f.length, w; ++g < y; ) h[(w = f[g]).i] = w.x(d); return h.join(""); }; }; } var jf = fs(If, "px, ", "px)", "deg)"), Ff = fs(Rf, ", ", ")", ")"), en = 0, wn = 0, gn = 0, hs = 1e3, Ae, bn, $e = 0, Rt = 0, He = 0, Pn = typeof performance == "object" && performance.now ? performance : Date, ds = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Xe() { return Rt || (ds(Lf), Rt = Pn.now() + He); } function Lf() { Rt = 0; } function En() { this._call = this._time = this._next = null; } En.prototype = ps.prototype = { constructor: En, restart: function(t, n, e) { if (typeof t != "function") throw new TypeError("callback is not a function"); e = (e == null ? Xe() : +e) + (n == null ? 0 : +n), !this._next && bn !== this && (bn ? bn._next = this : Ae = this, bn = this), this._call = t, this._time = e, Cr(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Cr()); } }; function ps(t, n, e) { var r = new En(); return r.restart(t, n, e), r; } function Df() { Xe(), ++en; for (var t = Ae, n; t; ) (n = Rt - t._time) >= 0 && t._call.call(void 0, n), t = t._next; --en; } function _a() { Rt = ($e = Pn.now()) + He, en = wn = 0; try { Df(); } finally { en = 0, Hf(), Rt = 0; } } function qf() { var t = Pn.now(), n = t - $e; n > hs && (He -= n, $e = t); } function Hf() { for (var t, n = Ae, 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 : Ae = e); bn = t, Cr(r); } function Cr(t) { if (!en) { wn && (wn = clearTimeout(wn)); var n = t - Rt; n > 24 ? (t < 1 / 0 && (wn = setTimeout(_a, t - Pn.now() - He)), gn && (gn = clearInterval(gn))) : (gn || ($e = Pn.now(), gn = setInterval(qf, hs)), en = 1, ds(_a)); } } function ya(t, n, e) { var r = new En(); return n = n == null ? 0 : +n, r.restart((i) => { r.stop(), t(i + n); }, n, e), r; } function Xf(t, n, e) { var r = new En(), i = n; return r._restart = r.restart, r.restart = function(a, o, s) { o = +o, s = s == null ? Xe() : +s, r._restart(function l(u) { u += i, r._restart(l, i += o, s), a(u); }, o, s); }, r.restart(t, n, e), r; } var Bf = Go("start", "end", "cancel", "interrupt"), Uf = [], gs = 0, ma = 1, Ir = 2, ue = 3, va = 4, Rr = 5, le = 6; function Be(t, n, e, r, i, a) { var o = t.__transition; if (!o) t.__transition = {}; else if (e in o) return; Yf(t, e, { name: n, index: r, // For context during callback. group: i, // For context during callback. on: Bf, tween: Uf, time: a.time, delay: a.delay, duration: a.duration, ease: a.ease, timer: null, state: gs }); } function mi(t, n) { var e = tt(t, n); if (e.state > gs) throw new Error("too late; already scheduled"); return e; } function ot(t, n) { var e = tt(t, n); if (e.state > ue) throw new Error("too late; already running"); return e; } function tt(t, n) { var e = t.__transition; if (!e || !(e = e[n])) throw new Error("transition not found"); return e; } function Yf(t, n, e) { var r = t.__transition, i; r[n] = e, e.timer = ps(a, 0, e.time); function a(u) { e.state = ma, e.timer.restart(o, e.delay, e.time), e.delay <= u && o(u - e.delay); } function o(u) { var c, h, f, d; if (e.state !== ma) return l(); for (c in r) if (d = r[c], d.name === e.name) { if (d.state === ue) return ya(o); d.state === va ? (d.state = le, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[c]) : +c < n && (d.state = le, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[c]); } if (ya(function() { e.state === ue && (e.state = va, e.timer.restart(s, e.delay, e.time), s(u)); }), e.state = Ir, e.on.call("start", t, t.__data__, e.index, e.group), e.state === Ir) { for (e.state = ue, i = new Array(f = e.tween.length), c = 0, h = -1; c < f; ++c) (d = e.tween[c].value.call(t, t.__data__, e.index, e.group)) && (i[++h] = d); i.length = h + 1; } } function s(u) { for (var c = u < e.duration ? e.ease.call(null, u / e.duration) : (e.timer.restart(l), e.state = Rr, 1), h = -1, f = i.length; ++h < f; ) i[h].call(t, c); e.state === Rr && (e.on.call("end", t, t.__data__, e.index, e.group), l()); } function l() { e.state = le, e.timer.stop(), delete r[n]; for (var u in r) return; delete t.__transition; } } function Gf(t, n) { var e = t.__transition, r, i, a = !0, o; if (e) { n = n == null ? null : n + ""; for (o in e) { if ((r = e[o]).name !== n) { a = !1; continue; } i = r.state > Ir && r.state < Rr, r.state = le, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[o]; } a && delete t.__transition; } } function Vf(t) { return this.each(function() { Gf(this, t); }); } function Kf(t, n) { var e, r; return function() { var i = ot(this, t), a = i.tween; if (a !== e) { r = e = a; for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === n) { r = r.slice(), r.splice(o, 1); break; } } i.tween = r; }; } function Zf(t, n, e) { var r, i; if (typeof e != "function") throw new Error(); return function() { var a = ot(this, t), o = a.tween; if (o !== r) { i = (r = o).slice(); for (var s = { name: n, value: e }, l = 0, u = i.length; l < u; ++l) if (i[l].name === n) { i[l] = s; break; } l === u && i.push(s); } a.tween = i; }; } function Wf(t, n) { var e = this._id; if (t += "", arguments.length < 2) { for (var r = tt(this.node(), e).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === t) return o.value; return null; } return this.each((n == null ? Kf : Zf)(e, t, n)); } function vi(t, n, e) { var r = t._id; return t.each(function() { var i = ot(this, r); (i.value || (i.value = {}))[n] = e.apply(this, arguments); }), function(i) { return tt(i, r).value[n]; }; } function _s(t, n) { var e; return (typeof n == "number" ? K : n instanceof It ? Me : (e = It(n)) ? (n = e, Me) : ls)(t, n); } function Jf(t