react-infinite-canvas
Version:
An Infinite Canvas Component for React where you can place your component anywhere on the canvas with zoom in, zoom out and panning functionality. It also supports custom components to control the canvas.
1,617 lines • 87.1 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._dotSvgContainer_64xbd_1{position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0}._container_1xxyl_1{position:relative;overflow:hidden;width:100%;height:100%}._canvasWrapper_1xxyl_8{position:relative;width:100%;height:100%;overflow:hidden;background-color:var(--kf-color-bg-gray);cursor:grab;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._canvasWrapper_1xxyl_8._panning_1xxyl_21{cursor:grabbing}._canvas_1xxyl_8{position:relative;z-index:2;width:100%;height:100%}._canvas_1xxyl_8>div:first-of-type{position:absolute;inset-inline-start:0;inset-block-start:0;transition:transform .01s ease}._contentWrapper_1xxyl_39{position:absolute}._verticalScrollBar_17thb_1{position:absolute;inset-inline-end:2px;inset-block-start:0;inset-block-end:0;background:transparent}._horizontalScrollBar_17thb_9{position:absolute;inset-block-end:2px;inset-inline-start:0;inset-inline-end:0;background:transparent}._verticalScrollBar_17thb_1>div,._horizontalScrollBar_17thb_9>div{position:absolute;border-radius:50px;z-index:8;cursor:pointer}._verticalScrollBar_17thb_1>div{width:100%}._horizontalScrollBar_17thb_9>div{height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
import { jsxs as fe, jsx as P } from "react/jsx-runtime";
import Ue, { forwardRef as Ke, useRef as tt, useState as Be, useImperativeHandle as Ge, useCallback as xt, useEffect as Ze, Fragment as Tn, memo as Cn, useMemo as Qe } from "react";
var ee = "http://www.w3.org/1999/xhtml";
const be = {
svg: "http://www.w3.org/2000/svg",
xhtml: ee,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function Bt(t) {
var e = t += "", n = e.indexOf(":");
return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), be.hasOwnProperty(e) ? { space: be[e], local: t } : t;
}
function Nn(t) {
return function() {
var e = this.ownerDocument, n = this.namespaceURI;
return n === ee && e.documentElement.namespaceURI === ee ? e.createElement(t) : e.createElementNS(n, t);
};
}
function zn(t) {
return function() {
return this.ownerDocument.createElementNS(t.space, t.local);
};
}
function Je(t) {
var e = Bt(t);
return (e.local ? zn : Nn)(e);
}
function Mn() {
}
function he(t) {
return t == null ? Mn : function() {
return this.querySelector(t);
};
}
function Rn(t) {
typeof t != "function" && (t = he(t));
for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
for (var a = e[i], o = a.length, s = r[i] = new Array(o), l, f, c = 0; c < o; ++c)
(l = a[c]) && (f = t.call(l, l.__data__, c, a)) && ("__data__" in l && (f.__data__ = l.__data__), s[c] = f);
return new G(r, this._parents);
}
function An(t) {
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function Ln() {
return [];
}
function We(t) {
return t == null ? Ln : function() {
return this.querySelectorAll(t);
};
}
function In(t) {
return function() {
return An(t.apply(this, arguments));
};
}
function $n(t) {
typeof t == "function" ? t = In(t) : t = We(t);
for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a)
for (var o = e[a], s = o.length, l, f = 0; f < s; ++f)
(l = o[f]) && (r.push(t.call(l, l.__data__, f, o)), i.push(l));
return new G(r, i);
}
function je(t) {
return function() {
return this.matches(t);
};
}
function tn(t) {
return function(e) {
return e.matches(t);
};
}
var Dn = Array.prototype.find;
function kn(t) {
return function() {
return Dn.call(this.children, t);
};
}
function Pn() {
return this.firstElementChild;
}
function On(t) {
return this.select(t == null ? Pn : kn(typeof t == "function" ? t : tn(t)));
}
var Xn = Array.prototype.filter;
function Fn() {
return Array.from(this.children);
}
function Yn(t) {
return function() {
return Xn.call(this.children, t);
};
}
function Vn(t) {
return this.selectAll(t == null ? Fn : Yn(typeof t == "function" ? t : tn(t)));
}
function qn(t) {
typeof t != "function" && (t = je(t));
for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
for (var a = e[i], o = a.length, s = r[i] = [], l, f = 0; f < o; ++f)
(l = a[f]) && t.call(l, l.__data__, f, a) && s.push(l);
return new G(r, this._parents);
}
function en(t) {
return new Array(t.length);
}
function Hn() {
return new G(this._enter || this._groups.map(en), this._parents);
}
function Ft(t, e) {
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
}
Ft.prototype = {
constructor: Ft,
appendChild: function(t) {
return this._parent.insertBefore(t, this._next);
},
insertBefore: function(t, e) {
return this._parent.insertBefore(t, e);
},
querySelector: function(t) {
return this._parent.querySelector(t);
},
querySelectorAll: function(t) {
return this._parent.querySelectorAll(t);
}
};
function Un(t) {
return function() {
return t;
};
}
function Kn(t, e, n, r, i, a) {
for (var o = 0, s, l = e.length, f = a.length; o < f; ++o)
(s = e[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Ft(t, a[o]);
for (; o < l; ++o)
(s = e[o]) && (i[o] = s);
}
function Bn(t, e, n, r, i, a, o) {
var s, l, f = /* @__PURE__ */ new Map(), c = e.length, p = a.length, _ = new Array(c), g;
for (s = 0; s < c; ++s)
(l = e[s]) && (_[s] = g = o.call(l, l.__data__, s, e) + "", f.has(g) ? i[s] = l : f.set(g, l));
for (s = 0; s < p; ++s)
g = o.call(t, a[s], s, a) + "", (l = f.get(g)) ? (r[s] = l, l.__data__ = a[s], f.delete(g)) : n[s] = new Ft(t, a[s]);
for (s = 0; s < c; ++s)
(l = e[s]) && f.get(_[s]) === l && (i[s] = l);
}
function Gn(t) {
return t.__data__;
}
function Zn(t, e) {
if (!arguments.length) return Array.from(this, Gn);
var n = e ? Bn : Kn, r = this._parents, i = this._groups;
typeof t != "function" && (t = Un(t));
for (var a = i.length, o = new Array(a), s = new Array(a), l = new Array(a), f = 0; f < a; ++f) {
var c = r[f], p = i[f], _ = p.length, g = Qn(t.call(c, c && c.__data__, f, r)), C = g.length, v = s[f] = new Array(C), N = o[f] = new Array(C), y = l[f] = new Array(_);
n(c, p, v, N, y, g, e);
for (var z = 0, L = 0, O, F; z < C; ++z)
if (O = v[z]) {
for (z >= L && (L = z + 1); !(F = N[L]) && ++L < C; ) ;
O._next = F || null;
}
}
return o = new G(o, r), o._enter = s, o._exit = l, o;
}
function Qn(t) {
return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function Jn() {
return new G(this._exit || this._groups.map(en), this._parents);
}
function Wn(t, e, n) {
var r = this.enter(), i = this, a = this.exit();
return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
}
function jn(t) {
for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, o = Math.min(i, a), s = new Array(i), l = 0; l < o; ++l)
for (var f = n[l], c = r[l], p = f.length, _ = s[l] = new Array(p), g, C = 0; C < p; ++C)
(g = f[C] || c[C]) && (_[C] = g);
for (; l < i; ++l)
s[l] = n[l];
return new G(s, this._parents);
}
function tr() {
for (var t = this._groups, e = -1, n = t.length; ++e < n; )
for (var r = t[e], 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 er(t) {
t || (t = nr);
function e(p, _) {
return p && _ ? t(p.__data__, _.__data__) : !p - !_;
}
for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) {
for (var o = n[a], s = o.length, l = i[a] = new Array(s), f, c = 0; c < s; ++c)
(f = o[c]) && (l[c] = f);
l.sort(e);
}
return new G(i, this._parents).order();
}
function nr(t, e) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function rr() {
var t = arguments[0];
return arguments[0] = this, t.apply(null, arguments), this;
}
function ir() {
return Array.from(this);
}
function or() {
for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
for (var r = t[e], i = 0, a = r.length; i < a; ++i) {
var o = r[i];
if (o) return o;
}
return null;
}
function ar() {
let t = 0;
for (const e of this) ++t;
return t;
}
function sr() {
return !this.node();
}
function cr(t) {
for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
for (var i = e[n], a = 0, o = i.length, s; a < o; ++a)
(s = i[a]) && t.call(s, s.__data__, a, i);
return this;
}
function ur(t) {
return function() {
this.removeAttribute(t);
};
}
function lr(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function fr(t, e) {
return function() {
this.setAttribute(t, e);
};
}
function hr(t, e) {
return function() {
this.setAttributeNS(t.space, t.local, e);
};
}
function pr(t, e) {
return function() {
var n = e.apply(this, arguments);
n == null ? this.removeAttribute(t) : this.setAttribute(t, n);
};
}
function dr(t, e) {
return function() {
var n = e.apply(this, arguments);
n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n);
};
}
function _r(t, e) {
var n = Bt(t);
if (arguments.length < 2) {
var r = this.node();
return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
}
return this.each((e == null ? n.local ? lr : ur : typeof e == "function" ? n.local ? dr : pr : n.local ? hr : fr)(n, e));
}
function nn(t) {
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function mr(t) {
return function() {
this.style.removeProperty(t);
};
}
function gr(t, e, n) {
return function() {
this.style.setProperty(t, e, n);
};
}
function yr(t, e, n) {
return function() {
var r = e.apply(this, arguments);
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n);
};
}
function wr(t, e, n) {
return arguments.length > 1 ? this.each((e == null ? mr : typeof e == "function" ? yr : gr)(t, e, n == null ? "" : n)) : dt(this.node(), t);
}
function dt(t, e) {
return t.style.getPropertyValue(e) || nn(t).getComputedStyle(t, null).getPropertyValue(e);
}
function xr(t) {
return function() {
delete this[t];
};
}
function vr(t, e) {
return function() {
this[t] = e;
};
}
function Sr(t, e) {
return function() {
var n = e.apply(this, arguments);
n == null ? delete this[t] : this[t] = n;
};
}
function br(t, e) {
return arguments.length > 1 ? this.each((e == null ? xr : typeof e == "function" ? Sr : vr)(t, e)) : this.node()[t];
}
function rn(t) {
return t.trim().split(/^|\s+/);
}
function pe(t) {
return t.classList || new on(t);
}
function on(t) {
this._node = t, this._names = rn(t.getAttribute("class") || "");
}
on.prototype = {
add: function(t) {
var e = this._names.indexOf(t);
e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
},
remove: function(t) {
var e = this._names.indexOf(t);
e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
},
contains: function(t) {
return this._names.indexOf(t) >= 0;
}
};
function an(t, e) {
for (var n = pe(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]);
}
function sn(t, e) {
for (var n = pe(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]);
}
function Er(t) {
return function() {
an(this, t);
};
}
function Tr(t) {
return function() {
sn(this, t);
};
}
function Cr(t, e) {
return function() {
(e.apply(this, arguments) ? an : sn)(this, t);
};
}
function Nr(t, e) {
var n = rn(t + "");
if (arguments.length < 2) {
for (var r = pe(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1;
return !0;
}
return this.each((typeof e == "function" ? Cr : e ? Er : Tr)(n, e));
}
function zr() {
this.textContent = "";
}
function Mr(t) {
return function() {
this.textContent = t;
};
}
function Rr(t) {
return function() {
var e = t.apply(this, arguments);
this.textContent = e == null ? "" : e;
};
}
function Ar(t) {
return arguments.length ? this.each(t == null ? zr : (typeof t == "function" ? Rr : Mr)(t)) : this.node().textContent;
}
function Lr() {
this.innerHTML = "";
}
function Ir(t) {
return function() {
this.innerHTML = t;
};
}
function $r(t) {
return function() {
var e = t.apply(this, arguments);
this.innerHTML = e == null ? "" : e;
};
}
function Dr(t) {
return arguments.length ? this.each(t == null ? Lr : (typeof t == "function" ? $r : Ir)(t)) : this.node().innerHTML;
}
function kr() {
this.nextSibling && this.parentNode.appendChild(this);
}
function Pr() {
return this.each(kr);
}
function Or() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Xr() {
return this.each(Or);
}
function Fr(t) {
var e = typeof t == "function" ? t : Je(t);
return this.select(function() {
return this.appendChild(e.apply(this, arguments));
});
}
function Yr() {
return null;
}
function Vr(t, e) {
var n = typeof t == "function" ? t : Je(t), r = e == null ? Yr : typeof e == "function" ? e : he(e);
return this.select(function() {
return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
});
}
function qr() {
var t = this.parentNode;
t && t.removeChild(this);
}
function Hr() {
return this.each(qr);
}
function Ur() {
var t = this.cloneNode(!1), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Kr() {
var t = this.cloneNode(!0), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Br(t) {
return this.select(t ? Kr : Ur);
}
function Gr(t) {
return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function Zr(t) {
return function(e) {
t.call(this, e, this.__data__);
};
}
function Qr(t) {
return t.trim().split(/^|\s+/).map(function(e) {
var n = "", r = e.indexOf(".");
return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n };
});
}
function Jr(t) {
return function() {
var e = this.__on;
if (e) {
for (var n = 0, r = -1, i = e.length, a; n < i; ++n)
a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a;
++r ? e.length = r : delete this.__on;
}
};
}
function Wr(t, e, n) {
return function() {
var r = this.__on, i, a = Zr(e);
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 = n), i.value = e;
return;
}
}
this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i];
};
}
function jr(t, e, n) {
var r = Qr(t + ""), i, a = r.length, o;
if (arguments.length < 2) {
var s = this.node().__on;
if (s) {
for (var l = 0, f = s.length, c; l < f; ++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 = e ? Wr : Jr, i = 0; i < a; ++i) this.each(s(r[i], e, n));
return this;
}
function cn(t, e, n) {
var r = nn(t), i = r.CustomEvent;
typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i);
}
function ti(t, e) {
return function() {
return cn(this, t, e);
};
}
function ei(t, e) {
return function() {
return cn(this, t, e.apply(this, arguments));
};
}
function ni(t, e) {
return this.each((typeof e == "function" ? ei : ti)(t, e));
}
function* ri() {
for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
for (var r = t[e], i = 0, a = r.length, o; i < a; ++i)
(o = r[i]) && (yield o);
}
var un = [null];
function G(t, e) {
this._groups = t, this._parents = e;
}
function Nt() {
return new G([[document.documentElement]], un);
}
function ii() {
return this;
}
G.prototype = Nt.prototype = {
constructor: G,
select: Rn,
selectAll: $n,
selectChild: On,
selectChildren: Vn,
filter: qn,
data: Zn,
enter: Hn,
exit: Jn,
join: Wn,
merge: jn,
selection: ii,
order: tr,
sort: er,
call: rr,
nodes: ir,
node: or,
size: ar,
empty: sr,
each: cr,
attr: _r,
style: wr,
property: br,
classed: Nr,
text: Ar,
html: Dr,
raise: Pr,
lower: Xr,
append: Fr,
insert: Vr,
remove: Hr,
clone: Br,
datum: Gr,
on: jr,
dispatch: ni,
[Symbol.iterator]: ri
};
function H(t) {
return typeof t == "string" ? new G([[document.querySelector(t)]], [document.documentElement]) : new G([[t]], un);
}
function oi(t) {
let e;
for (; e = t.sourceEvent; ) t = e;
return t;
}
function st(t, e) {
if (t = oi(t), e === void 0 && (e = t.currentTarget), e) {
var n = e.ownerSVGElement || e;
if (n.createSVGPoint) {
var r = n.createSVGPoint();
return r.x = t.clientX, r.y = t.clientY, r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y];
}
if (e.getBoundingClientRect) {
var i = e.getBoundingClientRect();
return [t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop];
}
}
return [t.pageX, t.pageY];
}
var ai = { value: () => {
} };
function de() {
for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) {
if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
n[r] = [];
}
return new kt(n);
}
function kt(t) {
this._ = t;
}
function si(t, e) {
return t.trim().split(/^|\s+/).map(function(n) {
var r = "", i = n.indexOf(".");
if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n);
return { type: n, name: r };
});
}
kt.prototype = de.prototype = {
constructor: kt,
on: function(t, e) {
var n = this._, r = si(t + "", n), i, a = -1, o = r.length;
if (arguments.length < 2) {
for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = ci(n[i], t.name))) return i;
return;
}
if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
for (; ++a < o; )
if (i = (t = r[a]).type) n[i] = Ee(n[i], t.name, e);
else if (e == null) for (i in n) n[i] = Ee(n[i], t.name, null);
return this;
},
copy: function() {
var t = {}, e = this._;
for (var n in e) t[n] = e[n].slice();
return new kt(t);
},
call: function(t, e) {
if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, a; r < i; ++r) n[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(e, n);
},
apply: function(t, e, n) {
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(e, n);
}
};
function ci(t, e) {
for (var n = 0, r = t.length, i; n < r; ++n)
if ((i = t[n]).name === e)
return i.value;
}
function Ee(t, e, n) {
for (var r = 0, i = t.length; r < i; ++r)
if (t[r].name === e) {
t[r] = ai, t = t.slice(0, r).concat(t.slice(r + 1));
break;
}
return n != null && t.push({ name: e, value: n }), t;
}
const ne = { capture: !0, passive: !1 };
function re(t) {
t.preventDefault(), t.stopImmediatePropagation();
}
function ui(t) {
var e = t.document.documentElement, n = H(t).on("dragstart.drag", re, ne);
"onselectstart" in e ? n.on("selectstart.drag", re, ne) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none");
}
function li(t, e) {
var n = t.document.documentElement, r = H(t).on("dragstart.drag", null);
e && (r.on("click.drag", re, ne), setTimeout(function() {
r.on("click.drag", null);
}, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
}
function _e(t, e, n) {
t.prototype = e.prototype = n, n.constructor = t;
}
function ln(t, e) {
var n = Object.create(t.prototype);
for (var r in e) n[r] = e[r];
return n;
}
function zt() {
}
var bt = 0.7, Yt = 1 / bt, pt = "\\s*([+-]?\\d+)\\s*", Et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", fi = /^#([0-9a-f]{3,8})$/, hi = new RegExp(`^rgb\\(${pt},${pt},${pt}\\)$`), pi = new RegExp(`^rgb\\(${et},${et},${et}\\)$`), di = new RegExp(`^rgba\\(${pt},${pt},${pt},${Et}\\)$`), _i = new RegExp(`^rgba\\(${et},${et},${et},${Et}\\)$`), mi = new RegExp(`^hsl\\(${Et},${et},${et}\\)$`), gi = new RegExp(`^hsla\\(${Et},${et},${et},${Et}\\)$`), Te = {
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
};
_e(zt, Tt, {
copy(t) {
return Object.assign(new this.constructor(), this, t);
},
displayable() {
return this.rgb().displayable();
},
hex: Ce,
// Deprecated! Use color.formatHex.
formatHex: Ce,
formatHex8: yi,
formatHsl: wi,
formatRgb: Ne,
toString: Ne
});
function Ce() {
return this.rgb().formatHex();
}
function yi() {
return this.rgb().formatHex8();
}
function wi() {
return fn(this).formatHsl();
}
function Ne() {
return this.rgb().formatRgb();
}
function Tt(t) {
var e, n;
return t = (t + "").trim().toLowerCase(), (e = fi.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ze(e) : n === 3 ? new K(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Lt(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Lt(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = hi.exec(t)) ? new K(e[1], e[2], e[3], 1) : (e = pi.exec(t)) ? new K(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = di.exec(t)) ? Lt(e[1], e[2], e[3], e[4]) : (e = _i.exec(t)) ? Lt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = mi.exec(t)) ? Ae(e[1], e[2] / 100, e[3] / 100, 1) : (e = gi.exec(t)) ? Ae(e[1], e[2] / 100, e[3] / 100, e[4]) : Te.hasOwnProperty(t) ? ze(Te[t]) : t === "transparent" ? new K(NaN, NaN, NaN, 0) : null;
}
function ze(t) {
return new K(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function Lt(t, e, n, r) {
return r <= 0 && (t = e = n = NaN), new K(t, e, n, r);
}
function xi(t) {
return t instanceof zt || (t = Tt(t)), t ? (t = t.rgb(), new K(t.r, t.g, t.b, t.opacity)) : new K();
}
function ie(t, e, n, r) {
return arguments.length === 1 ? xi(t) : new K(t, e, n, r == null ? 1 : r);
}
function K(t, e, n, r) {
this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
}
_e(K, ie, ln(zt, {
brighter(t) {
return t = t == null ? Yt : Math.pow(Yt, t), new K(this.r * t, this.g * t, this.b * t, this.opacity);
},
darker(t) {
return t = t == null ? bt : Math.pow(bt, t), new K(this.r * t, this.g * t, this.b * t, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new K(ft(this.r), ft(this.g), ft(this.b), Vt(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: Me,
// Deprecated! Use color.formatHex.
formatHex: Me,
formatHex8: vi,
formatRgb: Re,
toString: Re
}));
function Me() {
return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}`;
}
function vi() {
return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function Re() {
const t = Vt(this.opacity);
return `${t === 1 ? "rgb(" : "rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function Vt(t) {
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function ft(t) {
return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function lt(t) {
return t = ft(t), (t < 16 ? "0" : "") + t.toString(16);
}
function Ae(t, e, n, r) {
return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Q(t, e, n, r);
}
function fn(t) {
if (t instanceof Q) return new Q(t.h, t.s, t.l, t.opacity);
if (t instanceof zt || (t = Tt(t)), !t) return new Q();
if (t instanceof Q) return t;
t = t.rgb();
var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), o = NaN, s = a - i, l = (a + i) / 2;
return s ? (e === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - e) / s + 2 : o = (e - n) / s + 4, s /= l < 0.5 ? a + i : 2 - a - i, o *= 60) : s = l > 0 && l < 1 ? 0 : o, new Q(o, s, l, t.opacity);
}
function Si(t, e, n, r) {
return arguments.length === 1 ? fn(t) : new Q(t, e, n, r == null ? 1 : r);
}
function Q(t, e, n, r) {
this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
}
_e(Q, Si, ln(zt, {
brighter(t) {
return t = t == null ? Yt : Math.pow(Yt, t), new Q(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? bt : Math.pow(bt, t), new Q(this.h, this.s, this.l * t, this.opacity);
},
rgb() {
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
return new K(
Jt(t >= 240 ? t - 240 : t + 120, i, r),
Jt(t, i, r),
Jt(t < 120 ? t + 240 : t - 120, i, r),
this.opacity
);
},
clamp() {
return new Q(Le(this.h), It(this.s), It(this.l), Vt(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 = Vt(this.opacity);
return `${t === 1 ? "hsl(" : "hsla("}${Le(this.h)}, ${It(this.s) * 100}%, ${It(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
}
}));
function Le(t) {
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function It(t) {
return Math.max(0, Math.min(1, t || 0));
}
function Jt(t, e, n) {
return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
}
const hn = (t) => () => t;
function bi(t, e) {
return function(n) {
return t + n * e;
};
}
function Ei(t, e, n) {
return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
return Math.pow(t + r * e, n);
};
}
function Ti(t) {
return (t = +t) == 1 ? pn : function(e, n) {
return n - e ? Ei(e, n, t) : hn(isNaN(e) ? n : e);
};
}
function pn(t, e) {
var n = e - t;
return n ? bi(t, n) : hn(isNaN(t) ? e : t);
}
const Ie = function t(e) {
var n = Ti(e);
function r(i, a) {
var o = n((i = ie(i)).r, (a = ie(a)).r), s = n(i.g, a.g), l = n(i.b, a.b), f = pn(i.opacity, a.opacity);
return function(c) {
return i.r = o(c), i.g = s(c), i.b = l(c), i.opacity = f(c), i + "";
};
}
return r.gamma = t, r;
}(1);
function ct(t, e) {
return t = +t, e = +e, function(n) {
return t * (1 - n) + e * n;
};
}
var oe = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Wt = new RegExp(oe.source, "g");
function Ci(t) {
return function() {
return t;
};
}
function Ni(t) {
return function(e) {
return t(e) + "";
};
}
function zi(t, e) {
var n = oe.lastIndex = Wt.lastIndex = 0, r, i, a, o = -1, s = [], l = [];
for (t = t + "", e = e + ""; (r = oe.exec(t)) && (i = Wt.exec(e)); )
(a = i.index) > n && (a = e.slice(n, 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: ct(r, i) })), n = Wt.lastIndex;
return n < e.length && (a = e.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? l[0] ? Ni(l[0].x) : Ci(e) : (e = l.length, function(f) {
for (var c = 0, p; c < e; ++c) s[(p = l[c]).i] = p.x(f);
return s.join("");
});
}
var $e = 180 / Math.PI, ae = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function dn(t, e, n, r, i, a) {
var o, s, l;
return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (l = t * n + e * r) && (n -= t * l, r -= e * l), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, l /= s), t * r < e * n && (t = -t, e = -e, l = -l, o = -o), {
translateX: i,
translateY: a,
rotate: Math.atan2(e, t) * $e,
skewX: Math.atan(l) * $e,
scaleX: o,
scaleY: s
};
}
var $t;
function Mi(t) {
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
return e.isIdentity ? ae : dn(e.a, e.b, e.c, e.d, e.e, e.f);
}
function Ri(t) {
return t == null || ($t || ($t = document.createElementNS("http://www.w3.org/2000/svg", "g")), $t.setAttribute("transform", t), !(t = $t.transform.baseVal.consolidate())) ? ae : (t = t.matrix, dn(t.a, t.b, t.c, t.d, t.e, t.f));
}
function _n(t, e, n, r) {
function i(f) {
return f.length ? f.pop() + " " : "";
}
function a(f, c, p, _, g, C) {
if (f !== p || c !== _) {
var v = g.push("translate(", null, e, null, n);
C.push({ i: v - 4, x: ct(f, p) }, { i: v - 2, x: ct(c, _) });
} else (p || _) && g.push("translate(" + p + e + _ + n);
}
function o(f, c, p, _) {
f !== c ? (f - c > 180 ? c += 360 : c - f > 180 && (f += 360), _.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: ct(f, c) })) : c && p.push(i(p) + "rotate(" + c + r);
}
function s(f, c, p, _) {
f !== c ? _.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: ct(f, c) }) : c && p.push(i(p) + "skewX(" + c + r);
}
function l(f, c, p, _, g, C) {
if (f !== p || c !== _) {
var v = g.push(i(g) + "scale(", null, ",", null, ")");
C.push({ i: v - 4, x: ct(f, p) }, { i: v - 2, x: ct(c, _) });
} else (p !== 1 || _ !== 1) && g.push(i(g) + "scale(" + p + "," + _ + ")");
}
return function(f, c) {
var p = [], _ = [];
return f = t(f), c = t(c), a(f.translateX, f.translateY, c.translateX, c.translateY, p, _), o(f.rotate, c.rotate, p, _), s(f.skewX, c.skewX, p, _), l(f.scaleX, f.scaleY, c.scaleX, c.scaleY, p, _), f = c = null, function(g) {
for (var C = -1, v = _.length, N; ++C < v; ) p[(N = _[C]).i] = N.x(g);
return p.join("");
};
};
}
var Ai = _n(Mi, "px, ", "px)", "deg)"), Li = _n(Ri, ", ", ")", ")"), Ii = 1e-12;
function De(t) {
return ((t = Math.exp(t)) + 1 / t) / 2;
}
function $i(t) {
return ((t = Math.exp(t)) - 1 / t) / 2;
}
function Di(t) {
return ((t = Math.exp(2 * t)) - 1) / (t + 1);
}
const ki = function t(e, n, r) {
function i(a, o) {
var s = a[0], l = a[1], f = a[2], c = o[0], p = o[1], _ = o[2], g = c - s, C = p - l, v = g * g + C * C, N, y;
if (v < Ii)
y = Math.log(_ / f) / e, N = function(M) {
return [
s + M * g,
l + M * C,
f * Math.exp(e * M * y)
];
};
else {
var z = Math.sqrt(v), L = (_ * _ - f * f + r * v) / (2 * f * n * z), O = (_ * _ - f * f - r * v) / (2 * _ * n * z), F = Math.log(Math.sqrt(L * L + 1) - L), k = Math.log(Math.sqrt(O * O + 1) - O);
y = (k - F) / e, N = function(M) {
var R = M * y, I = De(F), B = f / (n * z) * (I * Di(e * R + F) - $i(F));
return [
s + B * g,
l + B * C,
f * I / De(e * R + F)
];
};
}
return N.duration = y * 1e3 * e / Math.SQRT2, N;
}
return i.rho = function(a) {
var o = Math.max(1e-3, +a), s = o * o, l = s * s;
return t(o, s, l);
}, i;
}(Math.SQRT2, 2, 4);
var _t = 0, yt = 0, mt = 0, mn = 1e3, qt, wt, Ht = 0, ht = 0, Gt = 0, Ct = typeof performance == "object" && performance.now ? performance : Date, gn = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
setTimeout(t, 17);
};
function me() {
return ht || (gn(Pi), ht = Ct.now() + Gt);
}
function Pi() {
ht = 0;
}
function Ut() {
this._call = this._time = this._next = null;
}
Ut.prototype = yn.prototype = {
constructor: Ut,
restart: function(t, e, n) {
if (typeof t != "function") throw new TypeError("callback is not a function");
n = (n == null ? me() : +n) + (e == null ? 0 : +e), !this._next && wt !== this && (wt ? wt._next = this : qt = this, wt = this), this._call = t, this._time = n, se();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, se());
}
};
function yn(t, e, n) {
var r = new Ut();
return r.restart(t, e, n), r;
}
function Oi() {
me(), ++_t;
for (var t = qt, e; t; )
(e = ht - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
--_t;
}
function ke() {
ht = (Ht = Ct.now()) + Gt, _t = yt = 0;
try {
Oi();
} finally {
_t = 0, Fi(), ht = 0;
}
}
function Xi() {
var t = Ct.now(), e = t - Ht;
e > mn && (Gt -= e, Ht = t);
}
function Fi() {
for (var t, e = qt, n, r = 1 / 0; e; )
e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : qt = n);
wt = t, se(r);
}
function se(t) {
if (!_t) {
yt && (yt = clearTimeout(yt));
var e = t - ht;
e > 24 ? (t < 1 / 0 && (yt = setTimeout(ke, t - Ct.now() - Gt)), mt && (mt = clearInterval(mt))) : (mt || (Ht = Ct.now(), mt = setInterval(Xi, mn)), _t = 1, gn(ke));
}
}
function Pe(t, e, n) {
var r = new Ut();
return e = e == null ? 0 : +e, r.restart((i) => {
r.stop(), t(i + e);
}, e, n), r;
}
var Yi = de("start", "end", "cancel", "interrupt"), Vi = [], wn = 0, Oe = 1, ce = 2, Pt = 3, Xe = 4, ue = 5, Ot = 6;
function Zt(t, e, n, r, i, a) {
var o = t.__transition;
if (!o) t.__transition = {};
else if (n in o) return;
qi(t, n, {
name: e,
index: r,
// For context during callback.
group: i,
// For context during callback.
on: Yi,
tween: Vi,
time: a.time,
delay: a.delay,
duration: a.duration,
ease: a.ease,
timer: null,
state: wn
});
}
function ge(t, e) {
var n = J(t, e);
if (n.state > wn) throw new Error("too late; already scheduled");
return n;
}
function nt(t, e) {
var n = J(t, e);
if (n.state > Pt) throw new Error("too late; already running");
return n;
}
function J(t, e) {
var n = t.__transition;
if (!n || !(n = n[e])) throw new Error("transition not found");
return n;
}
function qi(t, e, n) {
var r = t.__transition, i;
r[e] = n, n.timer = yn(a, 0, n.time);
function a(f) {
n.state = Oe, n.timer.restart(o, n.delay, n.time), n.delay <= f && o(f - n.delay);
}
function o(f) {
var c, p, _, g;
if (n.state !== Oe) return l();
for (c in r)
if (g = r[c], g.name === n.name) {
if (g.state === Pt) return Pe(o);
g.state === Xe ? (g.state = Ot, g.timer.stop(), g.on.call("interrupt", t, t.__data__, g.index, g.group), delete r[c]) : +c < e && (g.state = Ot, g.timer.stop(), g.on.call("cancel", t, t.__data__, g.index, g.group), delete r[c]);
}
if (Pe(function() {
n.state === Pt && (n.state = Xe, n.timer.restart(s, n.delay, n.time), s(f));
}), n.state = ce, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ce) {
for (n.state = Pt, i = new Array(_ = n.tween.length), c = 0, p = -1; c < _; ++c)
(g = n.tween[c].value.call(t, t.__data__, n.index, n.group)) && (i[++p] = g);
i.length = p + 1;
}
}
function s(f) {
for (var c = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(l), n.state = ue, 1), p = -1, _ = i.length; ++p < _; )
i[p].call(t, c);
n.state === ue && (n.on.call("end", t, t.__data__, n.index, n.group), l());
}
function l() {
n.state = Ot, n.timer.stop(), delete r[e];
for (var f in r) return;
delete t.__transition;
}
}
function Xt(t, e) {
var n = t.__transition, r, i, a = !0, o;
if (n) {
e = e == null ? null : e + "";
for (o in n) {
if ((r = n[o]).name !== e) {
a = !1;
continue;
}
i = r.state > ce && r.state < ue, r.state = Ot, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[o];
}
a && delete t.__transition;
}
}
function Hi(t) {
return this.each(function() {
Xt(this, t);
});
}
function Ui(t, e) {
var n, r;
return function() {
var i = nt(this, t), a = i.tween;
if (a !== n) {
r = n = a;
for (var o = 0, s = r.length; o < s; ++o)
if (r[o].name === e) {
r = r.slice(), r.splice(o, 1);
break;
}
}
i.tween = r;
};
}
function Ki(t, e, n) {
var r, i;
if (typeof n != "function") throw new Error();
return function() {
var a = nt(this, t), o = a.tween;
if (o !== r) {
i = (r = o).slice();
for (var s = { name: e, value: n }, l = 0, f = i.length; l < f; ++l)
if (i[l].name === e) {
i[l] = s;
break;
}
l === f && i.push(s);
}
a.tween = i;
};
}
function Bi(t, e) {
var n = this._id;
if (t += "", arguments.length < 2) {
for (var r = J(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i)
if ((o = r[i]).name === t)
return o.value;
return null;
}
return this.each((e == null ? Ui : Ki)(n, t, e));
}
function ye(t, e, n) {
var r = t._id;
return t.each(function() {
var i = nt(this, r);
(i.value || (i.value = {}))[e] = n.apply(this, arguments);
}), function(i) {
return J(i, r).value[e];
};
}
function xn(t, e) {
var n;
return (typeof e == "number" ? ct : e instanceof Tt ? Ie : (n = Tt(e)) ? (e = n, Ie) : zi)(t, e);
}
function Gi(t) {
return function() {
this.removeAttribute(t);
};
}
function Zi(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function Qi(t, e, n) {
var r, i = n + "", a;
return function() {
var o = this.getAttribute(t);
return o === i ? null : o === r ? a : a = e(r = o, n);
};
}
function Ji(t, e, n) {
var r, i = n + "", a;
return function() {
var o = this.getAttributeNS(t.space, t.local);
return o === i ? null : o === r ? a : a = e(r = o, n);
};
}
function Wi(t, e, n) {
var r, i, a;
return function() {
var o, s = n(this), l;
return s == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), l = s + "", o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s)));
};
}
function ji(t, e, n) {
var r, i, a;
return function() {
var o, s = n(this), l;
return s == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), l = s + "", o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s)));
};
}
function to(t, e) {
var n = Bt(t), r = n === "transform" ? Li : xn;
return this.attrTween(t, typeof e == "function" ? (n.local ? ji : Wi)(n, r, ye(this, "attr." + t, e)) : e == null ? (n.local ? Zi : Gi)(n) : (n.local ? Ji : Qi)(n, r, e));
}
function eo(t, e) {
return function(n) {
this.setAttribute(t, e.call(this, n));
};
}
function no(t, e) {
return function(n) {
this.setAttributeNS(t.space, t.local, e.call(this, n));
};
}
function ro(t, e) {
var n, r;
function i() {
var a = e.apply(this, arguments);
return a !== r && (n = (r = a) && no(t, a)), n;
}
return i._value = e, i;
}
function io(t, e) {
var n, r;
function i() {
var a = e.apply(this, arguments);
return a !== r && (n = (r = a) && eo(t, a)), n;
}
return i._value = e, i;
}
function oo(t, e) {
var n = "attr." + t;
if (arguments.length < 2) return (n = this.tween(n)) && n._value;
if (e == null) return this.tween(n, null);
if (typeof e != "function") throw new Error();
var r = Bt(t);
return this.tween(n, (r.local ? ro : io)(r, e));
}
function ao(t, e) {
return function() {
ge(this, t).delay = +e.apply(this, arguments);
};
}
function so(t, e) {
return e = +e, function() {
ge(this, t).delay = e;
};
}
function co(t) {
var e = this._id;
return arguments.length ? this.each((typeof t == "function" ? ao : so)(e, t)) : J(this.node(), e).delay;
}
function uo(t, e) {
return function() {
nt(this, t).duration = +e.apply(this, arguments);
};
}
function lo(t, e) {
return e = +e, function() {
nt(this, t).duration = e;
};
}
function fo(t) {
var e = this._id;
return arguments.length ? this.each((typeof t == "function" ? uo : lo)(e, t)) : J(this.node(), e).duration;
}
function ho(t, e) {
if (typeof e != "function") throw new Error();
return function() {
nt(this, t).ease = e;
};
}
function po(t) {
var e = this._id;
return arguments.length ? this.each(ho(e, t)) : J(this.node(), e).ease;
}
function _o(t, e) {
return function() {
var n = e.apply(this, arguments);
if (typeof n != "function") throw new Error();
nt(this, t).ease = n;
};
}
function mo(t) {
if (typeof t != "function") throw new Error();
return this.each(_o(this._id, t));
}
function go(t) {
typeof t != "function" && (t = je(t));
for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
for (var a = e[i], o = a.length, s = r[i] = [], l, f = 0; f < o; ++f)
(l = a[f]) && t.call(l, l.__data__, f, a) && s.push(l);
return new at(r, this._parents, this._name, this._id);
}
function yo(t) {
if (t._id !== this._id) throw new Error();
for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), o = new Array(r), s = 0; s < a; ++s)
for (var l = e[s], f = n[s], c = l.length, p = o[s] = new Array(c), _, g = 0; g < c; ++g)
(_ = l[g] || f[g]) && (p[g] = _);
for (; s < r; ++s)
o[s] = e[s];
return new at(o, this._parents, this._name, this._id);
}
function wo(t) {
return (t + "").trim().split(/^|\s+/).every(function(e) {
var n = e.indexOf(".");
return n >= 0 && (e = e.slice(0, n)), !e || e === "start";
});
}
function xo(t, e, n) {
var r, i, a = wo(e) ? ge : nt;
return function() {
var o = a(this, t), s = o.on;
s !== r && (i = (r = s).copy()).on(e, n), o.on = i;
};
}
function vo(t, e) {
var n = this._id;
return arguments.length < 2 ? J(this.node(), n).on.on(t) : this.each(xo(n, t, e));
}
function So(t) {
return function() {
var e = this.parentNode;
for (var n in this.__transition) if (+n !== t) return;
e && e.removeChild(this);
};
}
function bo() {
return this.on("end.remove", So(this._id));
}
function Eo(t) {
var e = this._name, n = this._id;
typeof t != "function" && (t = he(t));
for (var r = this._groups, i = r.length, a = new Array(i), o = 0; o < i; ++o)
for (var s = r[o], l = s.length, f = a[o] = new Array(l), c, p, _ = 0; _ < l; ++_)
(c = s[_]) && (p = t.call(c, c.__data__, _, s)) && ("__data__" in c && (p.__data__ = c.__data__), f[_] = p, Zt(f[_], e, n, _, f, J(c, n)));
return new at(a, this._parents, e, n);
}
function To(t) {
var e = this._name, n = this._id;
typeof t != "function" && (t = We(t));
for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s)
for (var l = r[s], f = l.length, c, p = 0; p < f; ++p)
if (c = l[p]) {
for (var _ = t.call(c, c.__data__, p, l), g, C = J(c, n), v = 0, N = _.length; v < N; ++v)
(g = _[v]) && Zt(g, e, n, v, _, C);
a.push(_), o.push(c);
}
return new at(a, o, e, n);
}
var Co = Nt.prototype.constructor;
function No() {
return new Co(this._groups, this._parents);
}
function zo(t, e) {
var n, r, i;
return function() {
var a = dt(this, t), o = (this.style.removeProperty(t), dt(this, t));
return a === o ? null : a === n && o === r ? i : i = e(n = a, r = o);
};
}
function vn(t) {
return function() {
this.style.removeProperty(t);
};
}
function Mo(t, e, n) {
var r, i = n + "", a;
return function() {
var o = dt(this, t);
return o === i ? null : o === r ? a : a = e(r = o, n);
};
}
function Ro(t, e, n) {
var r, i, a;
return function() {
var o = dt(this, t), s = n(this), l = s + "";
return s == null && (l = s = (this.style.removeProperty(t), dt(this, t))), o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s));
};
}
function Ao(t, e) {
var n, r, i, a = "style." + e, o = "end." + a, s;
return function() {
var l = nt(this, t), f = l.on, c = l.value[a] == null ? s || (s = vn(e)) : void 0;
(f !== n || i !== c) && (r = (n = f).copy()).on(o, i = c), l.on = r;
};
}
function Lo(t, e, n) {
var r = (t += "") == "transform" ? Ai : xn;
return e == null ? this.styleTween(t, zo(t, r)).on("end.style." + t, vn(t)) : typeof e == "function" ? this.styleTween(t, Ro(t, r, ye(this, "style." + t, e))).each(Ao(this._id, t)) : this.styleTween(t, Mo(t, r, e), n).on("end.style." + t, null);
}
function Io(t, e, n) {
return function(r) {
this.style.setProperty(t, e.call(this, r), n);
};
}
function $o(t, e, n) {
var r, i;
function a() {
var o = e.apply(this, arguments);
return o !== i && (r = (i = o) && Io(t, o, n)), r;
}
return a._value = e, a;
}
function Do(t, e, n) {
var r = "style." + (t += "");
if (arguments.length < 2) return (r = this.tween(r)) && r._value;
if (e == null) return this.tween(r, null);
if (typeof e != "function") throw new Error();
return this.tween(r, $o(t, e, n == null ? "" : n));
}
function ko(t) {
return function() {
this.textContent = t;
};
}
function Po(t) {
return function() {
var e = t(this);
this.textContent = e == null ? "" : e;
};
}
function Oo(t) {
return this.tween("text", typeof t == "function" ? Po(ye(this, "text", t)) : ko(t == null ? "" : t + ""));
}
function Xo(t) {
return function(e) {
this.textContent = t.call(this, e);
};
}
function Fo(t) {
var e, n;
function r() {
var i = t.apply(this, arguments);
return i !== n && (e = (n = i) && Xo(i)), e;
}
return r._value = t, r;
}
function Yo(t) {
var e = "text";
if (arguments.length < 1) return (e = this.tween(e)) && e._value;
if (t == null) return this.tween(e, null);
if (typeof t != "function") throw new Error();
return this.tween(e, Fo(t));
}
function Vo() {
for (var t = this._name, e = this._id, n = Sn(), r = this._groups, i = r.length, a = 0; a < i; ++a)
for (var o = r[a], s = o.length, l, f = 0; f < s; ++f)
if (l = o[f]) {
var c = J(l, e);
Zt(l, t, n, f, o,