@explorables/flockn_roll
Version:
This is a model for collective behavior in animals, e.g. flocks of birds or schools of fish based on simple rules of interaction.
1,514 lines • 228 kB
JavaScript
(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-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--tw-color-red-300:oklch(80.8% .114 19.571);--tw-color-yellow-300:oklch(90.5% .182 98.111);--tw-color-blue-300:oklch(80.9% .105 251.813);--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-container-6xl:72rem;--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;--tw-default-font-family:var(--tw-font-sans);--tw-default-mono-font-family:var(--tw-font-mono)}}@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}._displayPanel_bnmb5_2,._controlPanel_bnmb5_9{display:block;line-height:0;box-sizing:border-box}._displayPanel_bnmb5_2>canvas,._displayPanel_bnmb5_2>svg,._controlPanel_bnmb5_9>svg,._controlPanel_bnmb5_9>canvas{display:block;box-sizing:border-box}._attract_scope_bnmb5_27{fill:#dcdcdc;stroke:#000;stroke-width:.5px}._orient_scope_bnmb5_33{fill:#b4b4b4;stroke:#000;stroke-width:.5px}._repell_scope_bnmb5_39,._speed_bnmb5_45{fill:#fff;stroke:#000;stroke-width:.5px}._drop_bnmb5_51{fill-opacity:1;fill:#000;stroke:#000}._agent_bnmb5_57{stroke-width:0px;stroke:#000;fill:#000}@media (prefers-color-scheme: dark){._agent_bnmb5_57{stroke:#fff;fill:#fff}._drop_bnmb5_51{fill:#fff;stroke:gray;stroke-width:.5px}._speed_bnmb5_45{fill:#fff;stroke:#fff}._repell_scope_bnmb5_39{fill:#000;stroke:gray;stroke-width:.5px}._orient_scope_bnmb5_33{fill:#b4b4b4;stroke:gray;stroke-width:.5px}._attract_scope_bnmb5_27{fill:#dcdcdc;stroke:gray;stroke-width:.5px}}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
const tl = {
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
controls_border: "",
display_border: "",
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 ce(t, n) {
return t == null || n == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;
}
function nl(t, n) {
return t == null || n == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN;
}
function Fa(t) {
let n, e, r;
t.length !== 2 ? (n = ce, e = (s, l) => ce(t(s), l), r = (s, l) => t(s) - l) : (n = t === ce || t === nl ? t : el, 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 o(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) {
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: a, right: o };
}
function el() {
return 0;
}
function rl(t) {
return t === null ? NaN : +t;
}
const il = Fa(ce), ol = il.right;
Fa(rl).center;
const al = Math.sqrt(50), sl = Math.sqrt(10), ul = Math.sqrt(2);
function ve(t, n, e) {
const r = (n - t) / Math.max(0, e), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), a = o >= al ? 10 : o >= sl ? 5 : o >= ul ? 2 : 1;
let s, l, u;
return i < 0 ? (u = Math.pow(10, -i) / a, 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) * a, 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 ? ve(t, n, e * 2) : [s, l, u];
}
function ll(t, n, e) {
if (n = +n, t = +t, e = +e, !(e > 0)) return [];
if (t === n) return [t];
const r = n < t, [i, o, a] = r ? ve(n, t, e) : ve(t, n, e);
if (!(o >= i)) return [];
const s = o - i + 1, l = new Array(s);
if (r)
if (a < 0) for (let u = 0; u < s; ++u) l[u] = (o - u) / -a;
else for (let u = 0; u < s; ++u) l[u] = (o - u) * a;
else if (a < 0) for (let u = 0; u < s; ++u) l[u] = (i + u) / -a;
else for (let u = 0; u < s; ++u) l[u] = (i + u) * a;
return l;
}
function Er(t, n, e) {
return n = +n, t = +t, e = +e, ve(t, n, e)[2];
}
function cl(t, n, e) {
n = +n, t = +t, e = +e;
const r = n < t, i = r ? Er(n, t, e) : Er(t, n, e);
return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
}
var fl = { value: () => {
} };
function Da() {
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 fe(e);
}
function fe(t) {
this._ = t;
}
function hl(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 };
});
}
fe.prototype = Da.prototype = {
constructor: fe,
on: function(t, n) {
var e = this._, r = hl(t + "", e), i, o = -1, a = r.length;
if (arguments.length < 2) {
for (; ++o < a; ) if ((i = (t = r[o]).type) && (i = pl(e[i], t.name))) return i;
return;
}
if (n != null && typeof n != "function") throw new Error("invalid callback: " + n);
for (; ++o < a; )
if (i = (t = r[o]).type) e[i] = Wi(e[i], t.name, n);
else if (n == null) for (i in e) e[i] = Wi(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 fe(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 pl(t, n) {
for (var e = 0, r = t.length, i; e < r; ++e)
if ((i = t[e]).name === n)
return i.value;
}
function Wi(t, n, e) {
for (var r = 0, i = t.length; r < i; ++r)
if (t[r].name === n) {
t[r] = fl, t = t.slice(0, r).concat(t.slice(r + 1));
break;
}
return e != null && t.push({ name: n, value: e }), t;
}
var kr = "http://www.w3.org/1999/xhtml";
const Ji = {
svg: "http://www.w3.org/2000/svg",
xhtml: kr,
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)), Ji.hasOwnProperty(n) ? { space: Ji[n], local: t } : t;
}
function dl(t) {
return function() {
var n = this.ownerDocument, e = this.namespaceURI;
return e === kr && n.documentElement.namespaceURI === kr ? n.createElement(t) : n.createElementNS(e, t);
};
}
function gl(t) {
return function() {
return this.ownerDocument.createElementNS(t.space, t.local);
};
}
function qa(t) {
var n = qe(t);
return (n.local ? gl : dl)(n);
}
function _l() {
}
function fi(t) {
return t == null ? _l : function() {
return this.querySelector(t);
};
}
function yl(t) {
typeof t != "function" && (t = fi(t));
for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)
for (var o = n[i], a = o.length, s = r[i] = new Array(a), l, u, c = 0; c < a; ++c)
(l = o[c]) && (u = t.call(l, l.__data__, c, o)) && ("__data__" in l && (u.__data__ = l.__data__), s[c] = u);
return new D(r, this._parents);
}
function vl(t) {
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function ml() {
return [];
}
function Ba(t) {
return t == null ? ml : function() {
return this.querySelectorAll(t);
};
}
function wl(t) {
return function() {
return vl(t.apply(this, arguments));
};
}
function bl(t) {
typeof t == "function" ? t = wl(t) : t = Ba(t);
for (var n = this._groups, e = n.length, r = [], i = [], o = 0; o < e; ++o)
for (var a = n[o], s = a.length, l, u = 0; u < s; ++u)
(l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l));
return new D(r, i);
}
function Xa(t) {
return function() {
return this.matches(t);
};
}
function Ha(t) {
return function(n) {
return n.matches(t);
};
}
var xl = Array.prototype.find;
function Ml(t) {
return function() {
return xl.call(this.children, t);
};
}
function $l() {
return this.firstElementChild;
}
function Al(t) {
return this.select(t == null ? $l : Ml(typeof t == "function" ? t : Ha(t)));
}
var Nl = Array.prototype.filter;
function Tl() {
return Array.from(this.children);
}
function Sl(t) {
return function() {
return Nl.call(this.children, t);
};
}
function Pl(t) {
return this.selectAll(t == null ? Tl : Sl(typeof t == "function" ? t : Ha(t)));
}
function El(t) {
typeof t != "function" && (t = Xa(t));
for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)
for (var o = n[i], a = o.length, s = r[i] = [], l, u = 0; u < a; ++u)
(l = o[u]) && t.call(l, l.__data__, u, o) && s.push(l);
return new D(r, this._parents);
}
function Ua(t) {
return new Array(t.length);
}
function kl() {
return new D(this._enter || this._groups.map(Ua), this._parents);
}
function me(t, n) {
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n;
}
me.prototype = {
constructor: me,
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 Ol(t) {
return function() {
return t;
};
}
function zl(t, n, e, r, i, o) {
for (var a = 0, s, l = n.length, u = o.length; a < u; ++a)
(s = n[a]) ? (s.__data__ = o[a], r[a] = s) : e[a] = new me(t, o[a]);
for (; a < l; ++a)
(s = n[a]) && (i[a] = s);
}
function Cl(t, n, e, r, i, o, a) {
var s, l, u = /* @__PURE__ */ new Map(), c = n.length, h = o.length, f = new Array(c), p;
for (s = 0; s < c; ++s)
(l = n[s]) && (f[s] = p = a.call(l, l.__data__, s, n) + "", u.has(p) ? i[s] = l : u.set(p, l));
for (s = 0; s < h; ++s)
p = a.call(t, o[s], s, o) + "", (l = u.get(p)) ? (r[s] = l, l.__data__ = o[s], u.delete(p)) : e[s] = new me(t, o[s]);
for (s = 0; s < c; ++s)
(l = n[s]) && u.get(f[s]) === l && (i[s] = l);
}
function Il(t) {
return t.__data__;
}
function Rl(t, n) {
if (!arguments.length) return Array.from(this, Il);
var e = n ? Cl : zl, r = this._parents, i = this._groups;
typeof t != "function" && (t = Ol(t));
for (var o = i.length, a = new Array(o), s = new Array(o), l = new Array(o), u = 0; u < o; ++u) {
var c = r[u], h = i[u], f = h.length, p = jl(t.call(c, c && c.__data__, u, r)), g = p.length, _ = s[u] = new Array(g), w = a[u] = new Array(g), b = l[u] = new Array(f);
e(c, h, _, w, b, p, n);
for (var d = 0, x = 0, y, m; d < g; ++d)
if (y = _[d]) {
for (d >= x && (x = d + 1); !(m = w[x]) && ++x < g; ) ;
y._next = m || null;
}
}
return a = new D(a, r), a._enter = s, a._exit = l, a;
}
function jl(t) {
return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function Ll() {
return new D(this._exit || this._groups.map(Ua), this._parents);
}
function Fl(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 Dl(t) {
for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, o = r.length, a = Math.min(i, o), s = new Array(i), l = 0; l < a; ++l)
for (var u = e[l], c = r[l], h = u.length, f = s[l] = new Array(h), p, g = 0; g < h; ++g)
(p = u[g] || c[g]) && (f[g] = p);
for (; l < i; ++l)
s[l] = e[l];
return new D(s, this._parents);
}
function ql() {
for (var t = this._groups, n = -1, e = t.length; ++n < e; )
for (var r = t[n], i = r.length - 1, o = r[i], a; --i >= 0; )
(a = r[i]) && (o && a.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(a, o), o = a);
return this;
}
function Bl(t) {
t || (t = Xl);
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), o = 0; o < r; ++o) {
for (var a = e[o], s = a.length, l = i[o] = new Array(s), u, c = 0; c < s; ++c)
(u = a[c]) && (l[c] = u);
l.sort(n);
}
return new D(i, this._parents).order();
}
function Xl(t, n) {
return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;
}
function Hl() {
var t = arguments[0];
return arguments[0] = this, t.apply(null, arguments), this;
}
function Ul() {
return Array.from(this);
}
function Gl() {
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 a = r[i];
if (a) return a;
}
return null;
}
function Yl() {
let t = 0;
for (const n of this) ++t;
return t;
}
function Vl() {
return !this.node();
}
function Kl(t) {
for (var n = this._groups, e = 0, r = n.length; e < r; ++e)
for (var i = n[e], o = 0, a = i.length, s; o < a; ++o)
(s = i[o]) && t.call(s, s.__data__, o, i);
return this;
}
function Zl(t) {
return function() {
this.removeAttribute(t);
};
}
function Wl(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function Jl(t, n) {
return function() {
this.setAttribute(t, n);
};
}
function Ql(t, n) {
return function() {
this.setAttributeNS(t.space, t.local, n);
};
}
function tc(t, n) {
return function() {
var e = n.apply(this, arguments);
e == null ? this.removeAttribute(t) : this.setAttribute(t, e);
};
}
function nc(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 ec(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 ? Wl : Zl : typeof n == "function" ? e.local ? nc : tc : e.local ? Ql : Jl)(e, n));
}
function Ga(t) {
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function rc(t) {
return function() {
this.style.removeProperty(t);
};
}
function ic(t, n, e) {
return function() {
this.style.setProperty(t, n, e);
};
}
function oc(t, n, e) {
return function() {
var r = n.apply(this, arguments);
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e);
};
}
function ac(t, n, e) {
return arguments.length > 1 ? this.each((n == null ? rc : typeof n == "function" ? oc : ic)(t, n, e ?? "")) : en(this.node(), t);
}
function en(t, n) {
return t.style.getPropertyValue(n) || Ga(t).getComputedStyle(t, null).getPropertyValue(n);
}
function sc(t) {
return function() {
delete this[t];
};
}
function uc(t, n) {
return function() {
this[t] = n;
};
}
function lc(t, n) {
return function() {
var e = n.apply(this, arguments);
e == null ? delete this[t] : this[t] = e;
};
}
function cc(t, n) {
return arguments.length > 1 ? this.each((n == null ? sc : typeof n == "function" ? lc : uc)(t, n)) : this.node()[t];
}
function Ya(t) {
return t.trim().split(/^|\s+/);
}
function hi(t) {
return t.classList || new Va(t);
}
function Va(t) {
this._node = t, this._names = Ya(t.getAttribute("class") || "");
}
Va.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 Ka(t, n) {
for (var e = hi(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]);
}
function Za(t, n) {
for (var e = hi(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]);
}
function fc(t) {
return function() {
Ka(this, t);
};
}
function hc(t) {
return function() {
Za(this, t);
};
}
function pc(t, n) {
return function() {
(n.apply(this, arguments) ? Ka : Za)(this, t);
};
}
function dc(t, n) {
var e = Ya(t + "");
if (arguments.length < 2) {
for (var r = hi(this.node()), i = -1, o = e.length; ++i < o; ) if (!r.contains(e[i])) return !1;
return !0;
}
return this.each((typeof n == "function" ? pc : n ? fc : hc)(e, n));
}
function gc() {
this.textContent = "";
}
function _c(t) {
return function() {
this.textContent = t;
};
}
function yc(t) {
return function() {
var n = t.apply(this, arguments);
this.textContent = n ?? "";
};
}
function vc(t) {
return arguments.length ? this.each(t == null ? gc : (typeof t == "function" ? yc : _c)(t)) : this.node().textContent;
}
function mc() {
this.innerHTML = "";
}
function wc(t) {
return function() {
this.innerHTML = t;
};
}
function bc(t) {
return function() {
var n = t.apply(this, arguments);
this.innerHTML = n ?? "";
};
}
function xc(t) {
return arguments.length ? this.each(t == null ? mc : (typeof t == "function" ? bc : wc)(t)) : this.node().innerHTML;
}
function Mc() {
this.nextSibling && this.parentNode.appendChild(this);
}
function $c() {
return this.each(Mc);
}
function Ac() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Nc() {
return this.each(Ac);
}
function Tc(t) {
var n = typeof t == "function" ? t : qa(t);
return this.select(function() {
return this.appendChild(n.apply(this, arguments));
});
}
function Sc() {
return null;
}
function Pc(t, n) {
var e = typeof t == "function" ? t : qa(t), r = n == null ? Sc : typeof n == "function" ? n : fi(n);
return this.select(function() {
return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null);
});
}
function Ec() {
var t = this.parentNode;
t && t.removeChild(this);
}
function kc() {
return this.each(Ec);
}
function Oc() {
var t = this.cloneNode(!1), n = this.parentNode;
return n ? n.insertBefore(t, this.nextSibling) : t;
}
function zc() {
var t = this.cloneNode(!0), n = this.parentNode;
return n ? n.insertBefore(t, this.nextSibling) : t;
}
function Cc(t) {
return this.select(t ? zc : Oc);
}
function Ic(t) {
return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function Rc(t) {
return function(n) {
t.call(this, n, this.__data__);
};
}
function jc(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 Lc(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 Fc(t, n, e) {
return function() {
var r = this.__on, i, o = Rc(n);
if (r) {
for (var a = 0, s = r.length; a < s; ++a)
if ((i = r[a]).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 Dc(t, n, e) {
var r = jc(t + ""), i, o = r.length, a;
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 < o; ++i)
if ((a = r[i]).type === c.type && a.name === c.name)
return c.value;
}
return;
}
for (s = n ? Fc : Lc, i = 0; i < o; ++i) this.each(s(r[i], n, e));
return this;
}
function Wa(t, n, e) {
var r = Ga(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 qc(t, n) {
return function() {
return Wa(this, t, n);
};
}
function Bc(t, n) {
return function() {
return Wa(this, t, n.apply(this, arguments));
};
}
function Xc(t, n) {
return this.each((typeof n == "function" ? Bc : qc)(t, n));
}
function* Hc() {
for (var t = this._groups, n = 0, e = t.length; n < e; ++n)
for (var r = t[n], i = 0, o = r.length, a; i < o; ++i)
(a = r[i]) && (yield a);
}
var Ja = [null];
function D(t, n) {
this._groups = t, this._parents = n;
}
function Xn() {
return new D([[document.documentElement]], Ja);
}
function Uc() {
return this;
}
D.prototype = Xn.prototype = {
constructor: D,
select: yl,
selectAll: bl,
selectChild: Al,
selectChildren: Pl,
filter: El,
data: Rl,
enter: kl,
exit: Ll,
join: Fl,
merge: Dl,
selection: Uc,
order: ql,
sort: Bl,
call: Hl,
nodes: Ul,
node: Gl,
size: Yl,
empty: Vl,
each: Kl,
attr: ec,
style: ac,
property: cc,
classed: dc,
text: vc,
html: xc,
raise: $c,
lower: Nc,
append: Tc,
insert: Pc,
remove: kc,
clone: Cc,
datum: Ic,
on: Dc,
dispatch: Xc,
[Symbol.iterator]: Hc
};
function Gc(t) {
return typeof t == "string" ? new D([[document.querySelector(t)]], [document.documentElement]) : new D([[t]], Ja);
}
function Be(t, n, e) {
t.prototype = n.prototype = e, e.constructor = t;
}
function pi(t, n) {
var e = Object.create(t.prototype);
for (var r in n) e[r] = n[r];
return e;
}
function pn() {
}
var It = 0.7, rn = 1 / It, Wt = "\\s*([+-]?\\d+)\\s*", En = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Yc = /^#([0-9a-f]{3,8})$/, Vc = new RegExp(`^rgb\\(${Wt},${Wt},${Wt}\\)$`), Kc = new RegExp(`^rgb\\(${et},${et},${et}\\)$`), Zc = new RegExp(`^rgba\\(${Wt},${Wt},${Wt},${En}\\)$`), Wc = new RegExp(`^rgba\\(${et},${et},${et},${En}\\)$`), Jc = new RegExp(`^hsl\\(${En},${et},${et}\\)$`), Qc = new RegExp(`^hsla\\(${En},${et},${et},${En}\\)$`), Qi = {
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
};
Be(pn, Rt, {
copy(t) {
return Object.assign(new this.constructor(), this, t);
},
displayable() {
return this.rgb().displayable();
},
hex: to,
// Deprecated! Use color.formatHex.
formatHex: to,
formatHex8: tf,
formatHsl: nf,
formatRgb: no,
toString: no
});
function to() {
return this.rgb().formatHex();
}
function tf() {
return this.rgb().formatHex8();
}
function nf() {
return ts(this).formatHsl();
}
function no() {
return this.rgb().formatRgb();
}
function Rt(t) {
var n, e;
return t = (t + "").trim().toLowerCase(), (n = Yc.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? eo(n) : e === 3 ? new R(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? Kn(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? Kn(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 = Vc.exec(t)) ? new R(n[1], n[2], n[3], 1) : (n = Kc.exec(t)) ? new R(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = Zc.exec(t)) ? Kn(n[1], n[2], n[3], n[4]) : (n = Wc.exec(t)) ? Kn(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = Jc.exec(t)) ? oo(n[1], n[2] / 100, n[3] / 100, 1) : (n = Qc.exec(t)) ? oo(n[1], n[2] / 100, n[3] / 100, n[4]) : Qi.hasOwnProperty(t) ? eo(Qi[t]) : t === "transparent" ? new R(NaN, NaN, NaN, 0) : null;
}
function eo(t) {
return new R(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function Kn(t, n, e, r) {
return r <= 0 && (t = n = e = NaN), new R(t, n, e, r);
}
function Qa(t) {
return t instanceof pn || (t = Rt(t)), t ? (t = t.rgb(), new R(t.r, t.g, t.b, t.opacity)) : new R();
}
function Or(t, n, e, r) {
return arguments.length === 1 ? Qa(t) : new R(t, n, e, r ?? 1);
}
function R(t, n, e, r) {
this.r = +t, this.g = +n, this.b = +e, this.opacity = +r;
}
Be(R, Or, pi(pn, {
brighter(t) {
return t = t == null ? rn : Math.pow(rn, t), new R(this.r * t, this.g * t, this.b * t, this.opacity);
},
darker(t) {
return t = t == null ? It : Math.pow(It, t), new R(this.r * t, this.g * t, this.b * t, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new R(kt(this.r), kt(this.g), kt(this.b), we(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: ro,
// Deprecated! Use color.formatHex.
formatHex: ro,
formatHex8: ef,
formatRgb: io,
toString: io
}));
function ro() {
return `#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}`;
}
function ef() {
return `#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}${Pt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function io() {
const t = we(this.opacity);
return `${t === 1 ? "rgb(" : "rgba("}${kt(this.r)}, ${kt(this.g)}, ${kt(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function we(t) {
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function kt(t) {
return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function Pt(t) {
return t = kt(t), (t < 16 ? "0" : "") + t.toString(16);
}
function oo(t, n, e, r) {
return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new Z(t, n, e, r);
}
function ts(t) {
if (t instanceof Z) return new Z(t.h, t.s, t.l, t.opacity);
if (t instanceof pn || (t = Rt(t)), !t) return new Z();
if (t instanceof Z) 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), a = NaN, s = o - i, l = (o + i) / 2;
return s ? (n === o ? a = (e - r) / s + (e < r) * 6 : e === o ? a = (r - n) / s + 2 : a = (n - e) / s + 4, s /= l < 0.5 ? o + i : 2 - o - i, a *= 60) : s = l > 0 && l < 1 ? 0 : a, new Z(a, s, l, t.opacity);
}
function rf(t, n, e, r) {
return arguments.length === 1 ? ts(t) : new Z(t, n, e, r ?? 1);
}
function Z(t, n, e, r) {
this.h = +t, this.s = +n, this.l = +e, this.opacity = +r;
}
Be(Z, rf, pi(pn, {
brighter(t) {
return t = t == null ? rn : Math.pow(rn, t), new Z(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? It : Math.pow(It, t), new Z(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 R(
_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 Z(ao(this.h), Zn(this.s), Zn(this.l), we(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 = we(this.opacity);
return `${t === 1 ? "hsl(" : "hsla("}${ao(this.h)}, ${Zn(this.s) * 100}%, ${Zn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
}
}));
function ao(t) {
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function Zn(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;
}
const of = Math.PI / 180, af = 180 / Math.PI;
var ns = -0.14861, di = 1.78277, gi = -0.29227, Xe = -0.90649, kn = 1.97294, so = kn * Xe, uo = kn * di, lo = di * gi - Xe * ns;
function sf(t) {
if (t instanceof Ot) return new Ot(t.h, t.s, t.l, t.opacity);
t instanceof R || (t = Qa(t));
var n = t.r / 255, e = t.g / 255, r = t.b / 255, i = (lo * r + so * n - uo * e) / (lo + so - uo), o = r - i, a = (kn * (e - i) - gi * o) / Xe, s = Math.sqrt(a * a + o * o) / (kn * i * (1 - i)), l = s ? Math.atan2(a, o) * af - 120 : NaN;
return new Ot(l < 0 ? l + 360 : l, s, i, t.opacity);
}
function Mt(t, n, e, r) {
return arguments.length === 1 ? sf(t) : new Ot(t, n, e, r ?? 1);
}
function Ot(t, n, e, r) {
this.h = +t, this.s = +n, this.l = +e, this.opacity = +r;
}
Be(Ot, Mt, pi(pn, {
brighter(t) {
return t = t == null ? rn : Math.pow(rn, t), new Ot(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? It : Math.pow(It, t), new Ot(this.h, this.s, this.l * t, this.opacity);
},
rgb() {
var t = isNaN(this.h) ? 0 : (this.h + 120) * of, n = +this.l, e = isNaN(this.s) ? 0 : this.s * n * (1 - n), r = Math.cos(t), i = Math.sin(t);
return new R(
255 * (n + e * (ns * r + di * i)),
255 * (n + e * (gi * r + Xe * i)),
255 * (n + e * (kn * r)),
this.opacity
);
}
}));
const He = (t) => () => t;
function es(t, n) {
return function(e) {
return t + e * n;
};
}
function uf(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 lf(t, n) {
var e = n - t;
return e ? es(t, e > 180 || e < -180 ? e - 360 * Math.round(e / 360) : e) : He(isNaN(t) ? n : t);
}
function cf(t) {
return (t = +t) == 1 ? Jt : function(n, e) {
return e - n ? uf(n, e, t) : He(isNaN(n) ? e : n);
};
}
function Jt(t, n) {
var e = n - t;
return e ? es(t, e) : He(isNaN(t) ? n : t);
}
const be = function t(n) {
var e = cf(n);
function r(i, o) {
var a = e((i = Or(i)).r, (o = Or(o)).r), s = e(i.g, o.g), l = e(i.b, o.b), u = Jt(i.opacity, o.opacity);
return function(c) {
return i.r = a(c), i.g = s(c), i.b = l(c), i.opacity = u(c), i + "";
};
}
return r.gamma = t, r;
}(1);
function ff(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 hf(t) {
return ArrayBuffer.isView(t) && !(t instanceof DataView);
}
function pf(t, n) {
var e = n ? n.length : 0, r = t ? Math.min(e, t.length) : 0, i = new Array(r), o = new Array(e), a;
for (a = 0; a < r; ++a) i[a] = _i(t[a], n[a]);
for (; a < e; ++a) o[a] = n[a];
return function(s) {
for (a = 0; a < r; ++a) o[a] = i[a](s);
return o;
};
}
function df(t, n) {
var e = /* @__PURE__ */ new Date();
return t = +t, n = +n, function(r) {
return e.setTime(t * (1 - r) + n * r), e;
};
}
function V(t, n) {
return t = +t, n = +n, function(e) {
return t * (1 - e) + n * e;
};
}
function gf(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] = _i(t[i], n[i]) : r[i] = n[i];
return function(o) {
for (i in e) r[i] = e[i](o);
return r;
};
}
var zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, yr = new RegExp(zr.source, "g");
function _f(t) {
return function() {
return t;
};
}
function yf(t) {
return function(n) {
return t(n) + "";
};
}
function rs(t, n) {
var e = zr.lastIndex = yr.lastIndex = 0, r, i, o, a = -1, s = [], l = [];
for (t = t + "", n = n + ""; (r = zr.exec(t)) && (i = yr.exec(n)); )
(o = i.index) > e && (o = n.slice(e, o), s[a] ? s[a] += o : s[++a] = o), (r = r[0]) === (i = i[0]) ? s[a] ? s[a] += i : s[++a] = i : (s[++a] = null, l.push({ i: a, x: V(r, i) })), e = yr.lastIndex;
return e < n.length && (o = n.slice(e), s[a] ? s[a] += o : s[++a] = o), s.length < 2 ? l[0] ? yf(l[0].x) : _f(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 _i(t, n) {
var e = typeof n, r;
return n == null || e === "boolean" ? He(n) : (e === "number" ? V : e === "string" ? (r = Rt(n)) ? (n = r, be) : rs : n instanceof Rt ? be : n instanceof Date ? df : hf(n) ? ff : Array.isArray(n) ? pf : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? gf : V)(t, n);
}
function vf(t, n) {
return t = +t, n = +n, function(e) {
return Math.round(t * (1 - e) + n * e);
};
}
var co = 180 / Math.PI, Cr = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function is(t, n, e, r, i, o) {
var a, s, l;
return (a = Math.sqrt(t * t + n * n)) && (t /= a, n /= a), (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, a = -a), {
translateX: i,
translateY: o,
rotate: Math.atan2(n, t) * co,
skewX: Math.atan(l) * co,
scaleX: a,
scaleY: s
};
}
var Wn;
function mf(t) {
const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
return n.isIdentity ? Cr : is(n.a, n.b, n.c, n.d, n.e, n.f);
}
function wf(t) {
return t == null || (Wn || (Wn = document.createElementNS("http://www.w3.org/2000/svg", "g")), Wn.setAttribute("transform", t), !(t = Wn.transform.baseVal.consolidate())) ? Cr : (t = t.matrix, is(t.a, t.b, t.c, t.d, t.e, t.f));
}
function os(t, n, e, r) {
function i(u) {
return u.length ? u.pop() + " " : "";
}
function o(u, c, h, f, p, g) {
if (u !== h || c !== f) {
var _ = p.push("translate(", null, n, null, e);
g.push({ i: _ - 4, x: V(u, h) }, { i: _ - 2, x: V(c, f) });
} else (h || f) && p.push("translate(" + h + n + f + e);
}
function a(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: V(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: V(u, c) }) : c && h.push(i(h) + "skewX(" + c + r);
}
function l(u, c, h, f, p, g) {
if (u !== h || c !== f) {
var _ = p.push(i(p) + "scale(", null, ",", null, ")");
g.push({ i: _ - 4, x: V(u, h) }, { i: _ - 2, x: V(c, f) });
} else (h !== 1 || f !== 1) && p.push(i(p) + "scale(" + h + "," + f + ")");
}
return function(u, c) {
var h = [], f = [];
return u = t(u), c = t(c), o(u.translateX, u.translateY, c.translateX, c.translateY, h, f), a(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(p) {
for (var g = -1, _ = f.length, w; ++g < _; ) h[(w = f[g]).i] = w.x(p);
return h.join("");
};
};
}
var bf = os(mf, "px, ", "px)", "deg)"), xf = os(wf, ", ", ")", ")");
function as(t) {
return function n(e) {
e = +e;
function r(i, o) {
var a = t((i = Mt(i)).h, (o = Mt(o)).h), s = Jt(i.s, o.s), l = Jt(i.l, o.l), u = Jt(i.opacity, o.opacity);
return function(c) {
return i.h = a(c), i.s = s(c), i.l = l(Math.pow(c, e)), i.opacity = u(c), i + "";
};
}
return r.gamma = n, r;
}(1);
}
as(lf);
var ss = as(Jt), on = 0, bn = 0, yn = 0, us = 1e3, xe, xn, Me = 0, jt = 0, Ue = 0, On = typeof performance == "object" && performance.now ? performance : Date, ls = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
setTimeout(t, 17);
};
function Ge() {
return jt || (ls(Mf), jt = On.now() + Ue);
}
function Mf() {
jt = 0;
}
function zn() {
this._call = this._time = this._next = null;
}
zn.prototype = cs.prototype = {
constructor: zn,
restart: function(t, n, e) {
if (typeof t != "function") throw new TypeError("callback is not a function");
e = (e == null ? Ge() : +e) + (n == null ? 0 : +n), !this._next && xn !== this && (xn ? xn._next = this : xe = this, xn = this), this._call = t, this._time = e, Ir();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, Ir());
}
};
function cs(t, n, e) {
var r = new zn();
return r.restart(t, n, e), r;
}
function $f() {
Ge(), ++on;
for (var t = xe, n; t; )
(n = jt - t._time) >= 0 && t._call.call(void 0, n), t = t._next;
--on;
}
function fo() {
jt = (Me = On.now()) + Ue, on = bn = 0;
try {
$f();
} finally {
on = 0, Nf(), jt = 0;
}
}
function Af() {
var t = On.now(), n = t - Me;
n > us && (Ue -= n, Me = t);
}
function Nf() {
for (var t, n = xe, 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 : xe = e);
xn = t, Ir(r);
}
function Ir(t) {
if (!on) {
bn && (bn = clearTimeout(bn));
var n = t - jt;
n > 24 ? (t < 1 / 0 && (bn = setTimeout(fo, t - On.now() - Ue)), yn && (yn = clearInterval(yn))) : (yn || (Me = On.now(), yn = setInterval(Af, us)), on = 1, ls(fo));
}
}
function ho(t, n, e) {
var r = new zn();
return n = n == null ? 0 : +n, r.restart((i) => {
r.stop(), t(i + n);
}, n, e), r;
}
function Tf(t, n, e) {
var r = new zn(), i = n;
return r._restart = r.restart, r.restart = function(o, a, s) {
a = +a, s = s == null ? Ge() : +s, r._restart(function l(u) {
u += i, r._restart(l, i += a, s), o(u);
}, a, s);
}, r.restart(t, n, e), r;
}
var Sf = Da("start", "end", "cancel", "interrupt"), Pf = [], fs = 0, po = 1, Rr = 2, he = 3, go = 4, jr = 5, pe = 6;
function Ye(t, n, e, r, i, o) {
var a = t.__transition;
if (!a) t.__transition = {};
else if (e in a) return;
Ef(t, e, {
name: n,
index: r,
// For context during callback.
group: i,
// For context during callback.
on: Sf,
tween: Pf,
time: o.time,
delay: o.delay,
duration: o.duration,
ease: o.ease,
timer: null,
state: fs
});
}
function yi(t, n) {
var e = Q(t, n);
if (e.state > fs) throw new Error("too late; already scheduled");
return e;
}
function ot(t, n) {
var e = Q(t, n);
if (e.state > he) 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 Ef(t, n, e) {
var r = t.__transition, i;
r[n] = e, e.timer = cs(o, 0, e.time);
function o(u) {
e.state = po, e.timer.restart(a, e.delay, e.time), e.delay <= u && a(u - e.delay);
}
function a(u) {
var c, h, f, p;
if (e.state !== po) return l();
for (c in r)
if (p = r[c], p.name === e.name) {
if (p.state === he) return ho(a);
p.state === go ? (p.state = pe, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < n && (p.state = pe, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]);
}
if (ho(function() {
e.state === he && (e.state = go, e.timer.restart(s, e.delay, e.time), s(u));
}), e.state = Rr, e.on.call("start", t, t.__data__, e.index, e.group), e.state === Rr) {
for (e.state = he, i = new Array(f = e.tween.length), c = 0, h = -1; c < f; ++c)
(p = e.tween[c].value.call(t, t.__data__, e.index, e.group)) && (i[++h] = p);
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 = jr, 1), h = -1, f = i.length; ++h < f; )
i[h].call(t, c);
e.state === jr && (e.on.call("end", t, t.__data__, e.index, e.group), l());
}
function l() {
e.state = pe, e.timer.stop(), delete r[n];
for (var u in r) return;
delete t.__transition;
}
}
function kf(t, n) {
var e = t.__transition, r, i, o = !0, a;
if (e) {
n = n == null ? null : n + "";
for (a in e) {
if ((r = e[a]).name !== n) {
o = !1;
continue;
}
i = r.state > Rr && r.state < jr, r.state = pe, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[a];
}
o && delete t.__transition;
}
}
function Of(t) {
return this.each(function() {
kf(this, t);
});
}
function zf(t, n) {
var e, r;
return function() {
var i = ot(this, t), o = i.tween;
if (o !== e) {
r = e = o;
for (var a = 0, s = r.length; a < s; ++a)
if (r[a].name === n) {
r = r.slice(), r.splice(a, 1);
break;
}
}
i.tween = r;
};
}
function Cf(t, n, e) {
var r, i;
if (typeof e != "function") throw new Error();
return function() {
var o = ot(this, t), a = o.tween;
if (a !== r) {
i = (r = a).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);
}
o.tween = i;
};
}
function If(t, n) {
var e = this._id;
if (t += "", arguments.length < 2) {
for (var r = Q(this.node(), e).tween, i = 0, o = r.length, a; i < o; ++i)
if ((a = r[i]).name === t)
return a.value;
return null;
}
return this.each((n == null ? zf : Cf)(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 Q(i, r).value[n];
};
}
function hs(t, n) {
var e;
return (typeof n == "number" ? V : n instanceof Rt ? be : (e = Rt(n)) ? (n = e, be) : rs)(t, n);
}
function Rf(t) {
return function() {
this.removeAttribute(t);
};
}
function jf(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function Lf(t, n, e) {
var r, i = e + "", o;
return function() {
var a = this.getAttribute(t);
return a === i ? null : a === r ? o : o = n(r = a, e);
};
}
function Ff(t, n, e) {
var r, i = e + "", o;
return function() {
var a = this.getAttributeNS(t.space, t.local);
return a === i ? null : a === r ? o : o = n(r = a, e);
};
}
function Df(t, n, e) {
var r, i, o;
return function() {
var a, s = e(this), l;
return s == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = s + "", a === l ? null : a === r && l === i ? o : (i = l, o = n(r = a, s)));
};
}
function qf(t, n, e) {
var r, i, o;
return function() {
var a, s = e(this), l;
return s == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = s + "", a === l ? null : a === r && l === i ? o : (i = l, o = n(r = a, s)));
};
}
function Bf(t, n) {
var e = qe(t), r = e === "transform" ? xf : hs;
return this.attrTween(t, typeof n == "function" ? (e.local ? qf : Df)(e, r, vi(this, "attr." + t, n)) : n == null ? (e.local ? jf : Rf)(e) : (e.local ? Ff : Lf)(e, r, n));
}
function Xf(t, n) {
return function(e) {
this.setAttribute(t, n.call(this, e));
};
}
function Hf(t, n) {
return function(e) {
this.setAttributeNS(t.space, t.local, n.call(this, e));
};
}
function Uf(t, n) {
var e, r;
function i() {
var o = n.apply(this, arguments);
return o !== r && (e = (r = o) && Hf(t, o)), e;
}
return i._value = n, i;
}
function Gf(t, n) {
var e, r;
function i() {
var o = n.apply(this, arguments);
return o !== r && (e = (r = o) && Xf(t, o)), e;
}
return i._value = n, i;
}
function Yf(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 != "f