mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,582 lines (1,581 loc) • 238 kB
JavaScript
var To = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function rh(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var yi = {}, ko = {
get exports() {
return yi;
},
set exports(t) {
yi = t;
}
};
(function(t, e) {
(function(i, r) {
t.exports = r();
})(To, function() {
var i = 1e3, r = 6e4, o = 36e5, n = "millisecond", s = "second", l = "minute", h = "hour", u = "day", f = "week", g = "month", x = "quarter", _ = "year", M = "date", $ = "Invalid Date", K = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, It = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, nt = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
var y = ["th", "st", "nd", "rd"], p = k % 100;
return "[" + k + (y[(p - 20) % 10] || y[p] || y[0]) + "]";
} }, Q = function(k, y, p) {
var B = String(k);
return !B || B.length >= y ? k : "" + Array(y + 1 - B.length).join(p) + k;
}, H = { s: Q, z: function(k) {
var y = -k.utcOffset(), p = Math.abs(y), B = Math.floor(p / 60), b = p % 60;
return (y <= 0 ? "+" : "-") + Q(B, 2, "0") + ":" + Q(b, 2, "0");
}, m: function k(y, p) {
if (y.date() < p.date())
return -k(p, y);
var B = 12 * (p.year() - y.year()) + (p.month() - y.month()), b = y.clone().add(B, g), F = p - b < 0, w = y.clone().add(B + (F ? -1 : 1), g);
return +(-(B + (p - b) / (F ? b - w : w - b)) || 0);
}, a: function(k) {
return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
}, p: function(k) {
return { M: g, y: _, w: f, d: u, D: M, h, m: l, s, ms: n, Q: x }[k] || String(k || "").toLowerCase().replace(/s$/, "");
}, u: function(k) {
return k === void 0;
} }, at = "en", lt = {};
lt[at] = nt;
var Dt = function(k) {
return k instanceof qt;
}, Ht = function k(y, p, B) {
var b;
if (!y)
return at;
if (typeof y == "string") {
var F = y.toLowerCase();
lt[F] && (b = F), p && (lt[F] = p, b = F);
var w = y.split("-");
if (!b && w.length > 1)
return k(w[0]);
} else {
var O = y.name;
lt[O] = y, b = O;
}
return !B && b && (at = b), b || !B && at;
}, P = function(k, y) {
if (Dt(k))
return k.clone();
var p = typeof y == "object" ? y : {};
return p.date = k, p.args = arguments, new qt(p);
}, D = H;
D.l = Ht, D.i = Dt, D.w = function(k, y) {
return P(k, { locale: y.$L, utc: y.$u, x: y.$x, $offset: y.$offset });
};
var qt = function() {
function k(p) {
this.$L = Ht(p.locale, null, !0), this.parse(p);
}
var y = k.prototype;
return y.parse = function(p) {
this.$d = function(B) {
var b = B.date, F = B.utc;
if (b === null)
return new Date(NaN);
if (D.u(b))
return new Date();
if (b instanceof Date)
return new Date(b);
if (typeof b == "string" && !/Z$/i.test(b)) {
var w = b.match(K);
if (w) {
var O = w[2] - 1 || 0, z = (w[7] || "0").substring(0, 3);
return F ? new Date(Date.UTC(w[1], O, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, z)) : new Date(w[1], O, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, z);
}
}
return new Date(b);
}(p), this.$x = p.x || {}, this.init();
}, y.init = function() {
var p = this.$d;
this.$y = p.getFullYear(), this.$M = p.getMonth(), this.$D = p.getDate(), this.$W = p.getDay(), this.$H = p.getHours(), this.$m = p.getMinutes(), this.$s = p.getSeconds(), this.$ms = p.getMilliseconds();
}, y.$utils = function() {
return D;
}, y.isValid = function() {
return this.$d.toString() !== $;
}, y.isSame = function(p, B) {
var b = P(p);
return this.startOf(B) <= b && b <= this.endOf(B);
}, y.isAfter = function(p, B) {
return P(p) < this.startOf(B);
}, y.isBefore = function(p, B) {
return this.endOf(B) < P(p);
}, y.$g = function(p, B, b) {
return D.u(p) ? this[B] : this.set(b, p);
}, y.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, y.valueOf = function() {
return this.$d.getTime();
}, y.startOf = function(p, B) {
var b = this, F = !!D.u(B) || B, w = D.p(p), O = function(_t, G) {
var ct = D.w(b.$u ? Date.UTC(b.$y, G, _t) : new Date(b.$y, G, _t), b);
return F ? ct : ct.endOf(u);
}, z = function(_t, G) {
return D.w(b.toDate()[_t].apply(b.toDate("s"), (F ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(G)), b);
}, E = this.$W, W = this.$M, R = this.$D, ht = "set" + (this.$u ? "UTC" : "");
switch (w) {
case _:
return F ? O(1, 0) : O(31, 11);
case g:
return F ? O(1, W) : O(0, W + 1);
case f:
var N = this.$locale().weekStart || 0, dt = (E < N ? E + 7 : E) - N;
return O(F ? R - dt : R + (6 - dt), W);
case u:
case M:
return z(ht + "Hours", 0);
case h:
return z(ht + "Minutes", 1);
case l:
return z(ht + "Seconds", 2);
case s:
return z(ht + "Milliseconds", 3);
default:
return this.clone();
}
}, y.endOf = function(p) {
return this.startOf(p, !1);
}, y.$set = function(p, B) {
var b, F = D.p(p), w = "set" + (this.$u ? "UTC" : ""), O = (b = {}, b[u] = w + "Date", b[M] = w + "Date", b[g] = w + "Month", b[_] = w + "FullYear", b[h] = w + "Hours", b[l] = w + "Minutes", b[s] = w + "Seconds", b[n] = w + "Milliseconds", b)[F], z = F === u ? this.$D + (B - this.$W) : B;
if (F === g || F === _) {
var E = this.clone().set(M, 1);
E.$d[O](z), E.init(), this.$d = E.set(M, Math.min(this.$D, E.daysInMonth())).$d;
} else
O && this.$d[O](z);
return this.init(), this;
}, y.set = function(p, B) {
return this.clone().$set(p, B);
}, y.get = function(p) {
return this[D.p(p)]();
}, y.add = function(p, B) {
var b, F = this;
p = Number(p);
var w = D.p(B), O = function(W) {
var R = P(F);
return D.w(R.date(R.date() + Math.round(W * p)), F);
};
if (w === g)
return this.set(g, this.$M + p);
if (w === _)
return this.set(_, this.$y + p);
if (w === u)
return O(1);
if (w === f)
return O(7);
var z = (b = {}, b[l] = r, b[h] = o, b[s] = i, b)[w] || 1, E = this.$d.getTime() + p * z;
return D.w(E, this);
}, y.subtract = function(p, B) {
return this.add(-1 * p, B);
}, y.format = function(p) {
var B = this, b = this.$locale();
if (!this.isValid())
return b.invalidDate || $;
var F = p || "YYYY-MM-DDTHH:mm:ssZ", w = D.z(this), O = this.$H, z = this.$m, E = this.$M, W = b.weekdays, R = b.months, ht = function(G, ct, Ut, gt) {
return G && (G[ct] || G(B, F)) || Ut[ct].slice(0, gt);
}, N = function(G) {
return D.s(O % 12 || 12, G, "0");
}, dt = b.meridiem || function(G, ct, Ut) {
var gt = G < 12 ? "AM" : "PM";
return Ut ? gt.toLowerCase() : gt;
}, _t = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: E + 1, MM: D.s(E + 1, 2, "0"), MMM: ht(b.monthsShort, E, R, 3), MMMM: ht(R, E), D: this.$D, DD: D.s(this.$D, 2, "0"), d: String(this.$W), dd: ht(b.weekdaysMin, this.$W, W, 2), ddd: ht(b.weekdaysShort, this.$W, W, 3), dddd: W[this.$W], H: String(O), HH: D.s(O, 2, "0"), h: N(1), hh: N(2), a: dt(O, z, !0), A: dt(O, z, !1), m: String(z), mm: D.s(z, 2, "0"), s: String(this.$s), ss: D.s(this.$s, 2, "0"), SSS: D.s(this.$ms, 3, "0"), Z: w };
return F.replace(It, function(G, ct) {
return ct || _t[G] || w.replace(":", "");
});
}, y.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, y.diff = function(p, B, b) {
var F, w = D.p(B), O = P(p), z = (O.utcOffset() - this.utcOffset()) * r, E = this - O, W = D.m(this, O);
return W = (F = {}, F[_] = W / 12, F[g] = W, F[x] = W / 3, F[f] = (E - z) / 6048e5, F[u] = (E - z) / 864e5, F[h] = E / o, F[l] = E / r, F[s] = E / i, F)[w] || E, b ? W : D.a(W);
}, y.daysInMonth = function() {
return this.endOf(g).$D;
}, y.$locale = function() {
return lt[this.$L];
}, y.locale = function(p, B) {
if (!p)
return this.$L;
var b = this.clone(), F = Ht(p, B, !0);
return F && (b.$L = F), b;
}, y.clone = function() {
return D.w(this.$d, this);
}, y.toDate = function() {
return new Date(this.valueOf());
}, y.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, y.toISOString = function() {
return this.$d.toISOString();
}, y.toString = function() {
return this.$d.toUTCString();
}, k;
}(), ee = qt.prototype;
return P.prototype = ee, [["$ms", n], ["$s", s], ["$m", l], ["$H", h], ["$W", u], ["$M", g], ["$y", _], ["$D", M]].forEach(function(k) {
ee[k[1]] = function(y) {
return this.$g(y, k[0], k[1]);
};
}), P.extend = function(k, y) {
return k.$i || (k(y, qt, P), k.$i = !0), P;
}, P.locale = Ht, P.isDayjs = Dt, P.unix = function(k) {
return P(1e3 * k);
}, P.en = lt[at], P.Ls = lt, P.p = {}, P;
});
})(ko);
const So = yi, vt = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5
}, et = {
trace: (...t) => {
},
debug: (...t) => {
},
info: (...t) => {
},
warn: (...t) => {
},
error: (...t) => {
},
fatal: (...t) => {
}
}, oh = function(t = "fatal") {
let e = vt.fatal;
typeof t == "string" ? (t = t.toLowerCase(), t in vt && (e = vt[t])) : typeof t == "number" && (e = t), et.trace = () => {
}, et.debug = () => {
}, et.info = () => {
}, et.warn = () => {
}, et.error = () => {
}, et.fatal = () => {
}, e <= vt.fatal && (et.fatal = console.error ? console.error.bind(console, ut("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", ut("FATAL"))), e <= vt.error && (et.error = console.error ? console.error.bind(console, ut("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", ut("ERROR"))), e <= vt.warn && (et.warn = console.warn ? console.warn.bind(console, ut("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", ut("WARN"))), e <= vt.info && (et.info = console.info ? console.info.bind(console, ut("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", ut("INFO"))), e <= vt.debug && (et.debug = console.debug ? console.debug.bind(console, ut("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", ut("DEBUG"))), e <= vt.trace && (et.trace = console.debug ? console.debug.bind(console, ut("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", ut("TRACE")));
}, ut = (t) => `%c${So().format("ss.SSS")} : ${t} : `;
var Bo = { value: () => {
} };
function wr() {
for (var t = 0, e = arguments.length, i = {}, r; t < e; ++t) {
if (!(r = arguments[t] + "") || r in i || /[\s.]/.test(r))
throw new Error("illegal type: " + r);
i[r] = [];
}
return new Ae(i);
}
function Ae(t) {
this._ = t;
}
function vo(t, e) {
return t.trim().split(/^|\s+/).map(function(i) {
var r = "", o = i.indexOf(".");
if (o >= 0 && (r = i.slice(o + 1), i = i.slice(0, o)), i && !e.hasOwnProperty(i))
throw new Error("unknown type: " + i);
return { type: i, name: r };
});
}
Ae.prototype = wr.prototype = {
constructor: Ae,
on: function(t, e) {
var i = this._, r = vo(t + "", i), o, n = -1, s = r.length;
if (arguments.length < 2) {
for (; ++n < s; )
if ((o = (t = r[n]).type) && (o = wo(i[o], t.name)))
return o;
return;
}
if (e != null && typeof e != "function")
throw new Error("invalid callback: " + e);
for (; ++n < s; )
if (o = (t = r[n]).type)
i[o] = ir(i[o], t.name, e);
else if (e == null)
for (o in i)
i[o] = ir(i[o], t.name, null);
return this;
},
copy: function() {
var t = {}, e = this._;
for (var i in e)
t[i] = e[i].slice();
return new Ae(t);
},
call: function(t, e) {
if ((o = arguments.length - 2) > 0)
for (var i = new Array(o), r = 0, o, n; r < o; ++r)
i[r] = arguments[r + 2];
if (!this._.hasOwnProperty(t))
throw new Error("unknown type: " + t);
for (n = this._[t], r = 0, o = n.length; r < o; ++r)
n[r].value.apply(e, i);
},
apply: function(t, e, i) {
if (!this._.hasOwnProperty(t))
throw new Error("unknown type: " + t);
for (var r = this._[t], o = 0, n = r.length; o < n; ++o)
r[o].value.apply(e, i);
}
};
function wo(t, e) {
for (var i = 0, r = t.length, o; i < r; ++i)
if ((o = t[i]).name === e)
return o.value;
}
function ir(t, e, i) {
for (var r = 0, o = t.length; r < o; ++r)
if (t[r].name === e) {
t[r] = Bo, t = t.slice(0, r).concat(t.slice(r + 1));
break;
}
return i != null && t.push({ name: e, value: i }), t;
}
var bi = "http://www.w3.org/1999/xhtml";
const rr = {
svg: "http://www.w3.org/2000/svg",
xhtml: bi,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function Ve(t) {
var e = t += "", i = e.indexOf(":");
return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), rr.hasOwnProperty(e) ? { space: rr[e], local: t } : t;
}
function Lo(t) {
return function() {
var e = this.ownerDocument, i = this.namespaceURI;
return i === bi && e.documentElement.namespaceURI === bi ? e.createElement(t) : e.createElementNS(i, t);
};
}
function Fo(t) {
return function() {
return this.ownerDocument.createElementNS(t.space, t.local);
};
}
function Lr(t) {
var e = Ve(t);
return (e.local ? Fo : Lo)(e);
}
function Eo() {
}
function Mi(t) {
return t == null ? Eo : function() {
return this.querySelector(t);
};
}
function Ao(t) {
typeof t != "function" && (t = Mi(t));
for (var e = this._groups, i = e.length, r = new Array(i), o = 0; o < i; ++o)
for (var n = e[o], s = n.length, l = r[o] = new Array(s), h, u, f = 0; f < s; ++f)
(h = n[f]) && (u = t.call(h, h.__data__, f, n)) && ("__data__" in h && (u.__data__ = h.__data__), l[f] = u);
return new st(r, this._parents);
}
function Mo(t) {
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function Oo() {
return [];
}
function Fr(t) {
return t == null ? Oo : function() {
return this.querySelectorAll(t);
};
}
function Io(t) {
return function() {
return Mo(t.apply(this, arguments));
};
}
function Do(t) {
typeof t == "function" ? t = Io(t) : t = Fr(t);
for (var e = this._groups, i = e.length, r = [], o = [], n = 0; n < i; ++n)
for (var s = e[n], l = s.length, h, u = 0; u < l; ++u)
(h = s[u]) && (r.push(t.call(h, h.__data__, u, s)), o.push(h));
return new st(r, o);
}
function Er(t) {
return function() {
return this.matches(t);
};
}
function Ar(t) {
return function(e) {
return e.matches(t);
};
}
var Ro = Array.prototype.find;
function No(t) {
return function() {
return Ro.call(this.children, t);
};
}
function $o() {
return this.firstElementChild;
}
function zo(t) {
return this.select(t == null ? $o : No(typeof t == "function" ? t : Ar(t)));
}
var Po = Array.prototype.filter;
function Wo() {
return Array.from(this.children);
}
function Ho(t) {
return function() {
return Po.call(this.children, t);
};
}
function qo(t) {
return this.selectAll(t == null ? Wo : Ho(typeof t == "function" ? t : Ar(t)));
}
function Uo(t) {
typeof t != "function" && (t = Er(t));
for (var e = this._groups, i = e.length, r = new Array(i), o = 0; o < i; ++o)
for (var n = e[o], s = n.length, l = r[o] = [], h, u = 0; u < s; ++u)
(h = n[u]) && t.call(h, h.__data__, u, n) && l.push(h);
return new st(r, this._parents);
}
function Mr(t) {
return new Array(t.length);
}
function Go() {
return new st(this._enter || this._groups.map(Mr), this._parents);
}
function ze(t, e) {
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
}
ze.prototype = {
constructor: ze,
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 Vo(t) {
return function() {
return t;
};
}
function Yo(t, e, i, r, o, n) {
for (var s = 0, l, h = e.length, u = n.length; s < u; ++s)
(l = e[s]) ? (l.__data__ = n[s], r[s] = l) : i[s] = new ze(t, n[s]);
for (; s < h; ++s)
(l = e[s]) && (o[s] = l);
}
function Xo(t, e, i, r, o, n, s) {
var l, h, u = /* @__PURE__ */ new Map(), f = e.length, g = n.length, x = new Array(f), _;
for (l = 0; l < f; ++l)
(h = e[l]) && (x[l] = _ = s.call(h, h.__data__, l, e) + "", u.has(_) ? o[l] = h : u.set(_, h));
for (l = 0; l < g; ++l)
_ = s.call(t, n[l], l, n) + "", (h = u.get(_)) ? (r[l] = h, h.__data__ = n[l], u.delete(_)) : i[l] = new ze(t, n[l]);
for (l = 0; l < f; ++l)
(h = e[l]) && u.get(x[l]) === h && (o[l] = h);
}
function Ko(t) {
return t.__data__;
}
function jo(t, e) {
if (!arguments.length)
return Array.from(this, Ko);
var i = e ? Xo : Yo, r = this._parents, o = this._groups;
typeof t != "function" && (t = Vo(t));
for (var n = o.length, s = new Array(n), l = new Array(n), h = new Array(n), u = 0; u < n; ++u) {
var f = r[u], g = o[u], x = g.length, _ = Zo(t.call(f, f && f.__data__, u, r)), M = _.length, $ = l[u] = new Array(M), K = s[u] = new Array(M), It = h[u] = new Array(x);
i(f, g, $, K, It, _, e);
for (var nt = 0, Q = 0, H, at; nt < M; ++nt)
if (H = $[nt]) {
for (nt >= Q && (Q = nt + 1); !(at = K[Q]) && ++Q < M; )
;
H._next = at || null;
}
}
return s = new st(s, r), s._enter = l, s._exit = h, s;
}
function Zo(t) {
return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function Jo() {
return new st(this._exit || this._groups.map(Mr), this._parents);
}
function Qo(t, e, i) {
var r = this.enter(), o = this, n = this.exit();
return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (o = e(o), o && (o = o.selection())), i == null ? n.remove() : i(n), r && o ? r.merge(o).order() : o;
}
function tn(t) {
for (var e = t.selection ? t.selection() : t, i = this._groups, r = e._groups, o = i.length, n = r.length, s = Math.min(o, n), l = new Array(o), h = 0; h < s; ++h)
for (var u = i[h], f = r[h], g = u.length, x = l[h] = new Array(g), _, M = 0; M < g; ++M)
(_ = u[M] || f[M]) && (x[M] = _);
for (; h < o; ++h)
l[h] = i[h];
return new st(l, this._parents);
}
function en() {
for (var t = this._groups, e = -1, i = t.length; ++e < i; )
for (var r = t[e], o = r.length - 1, n = r[o], s; --o >= 0; )
(s = r[o]) && (n && s.compareDocumentPosition(n) ^ 4 && n.parentNode.insertBefore(s, n), n = s);
return this;
}
function rn(t) {
t || (t = on);
function e(g, x) {
return g && x ? t(g.__data__, x.__data__) : !g - !x;
}
for (var i = this._groups, r = i.length, o = new Array(r), n = 0; n < r; ++n) {
for (var s = i[n], l = s.length, h = o[n] = new Array(l), u, f = 0; f < l; ++f)
(u = s[f]) && (h[f] = u);
h.sort(e);
}
return new st(o, this._parents).order();
}
function on(t, e) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function nn() {
var t = arguments[0];
return arguments[0] = this, t.apply(null, arguments), this;
}
function sn() {
return Array.from(this);
}
function an() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], o = 0, n = r.length; o < n; ++o) {
var s = r[o];
if (s)
return s;
}
return null;
}
function ln() {
let t = 0;
for (const e of this)
++t;
return t;
}
function hn() {
return !this.node();
}
function cn(t) {
for (var e = this._groups, i = 0, r = e.length; i < r; ++i)
for (var o = e[i], n = 0, s = o.length, l; n < s; ++n)
(l = o[n]) && t.call(l, l.__data__, n, o);
return this;
}
function un(t) {
return function() {
this.removeAttribute(t);
};
}
function fn(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function dn(t, e) {
return function() {
this.setAttribute(t, e);
};
}
function gn(t, e) {
return function() {
this.setAttributeNS(t.space, t.local, e);
};
}
function pn(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? this.removeAttribute(t) : this.setAttribute(t, i);
};
}
function mn(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, i);
};
}
function Cn(t, e) {
var i = Ve(t);
if (arguments.length < 2) {
var r = this.node();
return i.local ? r.getAttributeNS(i.space, i.local) : r.getAttribute(i);
}
return this.each((e == null ? i.local ? fn : un : typeof e == "function" ? i.local ? mn : pn : i.local ? gn : dn)(i, e));
}
function Or(t) {
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function yn(t) {
return function() {
this.style.removeProperty(t);
};
}
function bn(t, e, i) {
return function() {
this.style.setProperty(t, e, i);
};
}
function _n(t, e, i) {
return function() {
var r = e.apply(this, arguments);
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i);
};
}
function xn(t, e, i) {
return arguments.length > 1 ? this.each((e == null ? yn : typeof e == "function" ? _n : bn)(t, e, i ?? "")) : Jt(this.node(), t);
}
function Jt(t, e) {
return t.style.getPropertyValue(e) || Or(t).getComputedStyle(t, null).getPropertyValue(e);
}
function Tn(t) {
return function() {
delete this[t];
};
}
function kn(t, e) {
return function() {
this[t] = e;
};
}
function Sn(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? delete this[t] : this[t] = i;
};
}
function Bn(t, e) {
return arguments.length > 1 ? this.each((e == null ? Tn : typeof e == "function" ? Sn : kn)(t, e)) : this.node()[t];
}
function Ir(t) {
return t.trim().split(/^|\s+/);
}
function Oi(t) {
return t.classList || new Dr(t);
}
function Dr(t) {
this._node = t, this._names = Ir(t.getAttribute("class") || "");
}
Dr.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 Rr(t, e) {
for (var i = Oi(t), r = -1, o = e.length; ++r < o; )
i.add(e[r]);
}
function Nr(t, e) {
for (var i = Oi(t), r = -1, o = e.length; ++r < o; )
i.remove(e[r]);
}
function vn(t) {
return function() {
Rr(this, t);
};
}
function wn(t) {
return function() {
Nr(this, t);
};
}
function Ln(t, e) {
return function() {
(e.apply(this, arguments) ? Rr : Nr)(this, t);
};
}
function Fn(t, e) {
var i = Ir(t + "");
if (arguments.length < 2) {
for (var r = Oi(this.node()), o = -1, n = i.length; ++o < n; )
if (!r.contains(i[o]))
return !1;
return !0;
}
return this.each((typeof e == "function" ? Ln : e ? vn : wn)(i, e));
}
function En() {
this.textContent = "";
}
function An(t) {
return function() {
this.textContent = t;
};
}
function Mn(t) {
return function() {
var e = t.apply(this, arguments);
this.textContent = e ?? "";
};
}
function On(t) {
return arguments.length ? this.each(t == null ? En : (typeof t == "function" ? Mn : An)(t)) : this.node().textContent;
}
function In() {
this.innerHTML = "";
}
function Dn(t) {
return function() {
this.innerHTML = t;
};
}
function Rn(t) {
return function() {
var e = t.apply(this, arguments);
this.innerHTML = e ?? "";
};
}
function Nn(t) {
return arguments.length ? this.each(t == null ? In : (typeof t == "function" ? Rn : Dn)(t)) : this.node().innerHTML;
}
function $n() {
this.nextSibling && this.parentNode.appendChild(this);
}
function zn() {
return this.each($n);
}
function Pn() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Wn() {
return this.each(Pn);
}
function Hn(t) {
var e = typeof t == "function" ? t : Lr(t);
return this.select(function() {
return this.appendChild(e.apply(this, arguments));
});
}
function qn() {
return null;
}
function Un(t, e) {
var i = typeof t == "function" ? t : Lr(t), r = e == null ? qn : typeof e == "function" ? e : Mi(e);
return this.select(function() {
return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null);
});
}
function Gn() {
var t = this.parentNode;
t && t.removeChild(this);
}
function Vn() {
return this.each(Gn);
}
function Yn() {
var t = this.cloneNode(!1), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Xn() {
var t = this.cloneNode(!0), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Kn(t) {
return this.select(t ? Xn : Yn);
}
function jn(t) {
return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function Zn(t) {
return function(e) {
t.call(this, e, this.__data__);
};
}
function Jn(t) {
return t.trim().split(/^|\s+/).map(function(e) {
var i = "", r = e.indexOf(".");
return r >= 0 && (i = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: i };
});
}
function Qn(t) {
return function() {
var e = this.__on;
if (e) {
for (var i = 0, r = -1, o = e.length, n; i < o; ++i)
n = e[i], (!t.type || n.type === t.type) && n.name === t.name ? this.removeEventListener(n.type, n.listener, n.options) : e[++r] = n;
++r ? e.length = r : delete this.__on;
}
};
}
function ts(t, e, i) {
return function() {
var r = this.__on, o, n = Zn(e);
if (r) {
for (var s = 0, l = r.length; s < l; ++s)
if ((o = r[s]).type === t.type && o.name === t.name) {
this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = n, o.options = i), o.value = e;
return;
}
}
this.addEventListener(t.type, n, i), o = { type: t.type, name: t.name, value: e, listener: n, options: i }, r ? r.push(o) : this.__on = [o];
};
}
function es(t, e, i) {
var r = Jn(t + ""), o, n = r.length, s;
if (arguments.length < 2) {
var l = this.node().__on;
if (l) {
for (var h = 0, u = l.length, f; h < u; ++h)
for (o = 0, f = l[h]; o < n; ++o)
if ((s = r[o]).type === f.type && s.name === f.name)
return f.value;
}
return;
}
for (l = e ? ts : Qn, o = 0; o < n; ++o)
this.each(l(r[o], e, i));
return this;
}
function $r(t, e, i) {
var r = Or(t), o = r.CustomEvent;
typeof o == "function" ? o = new o(e, i) : (o = r.document.createEvent("Event"), i ? (o.initEvent(e, i.bubbles, i.cancelable), o.detail = i.detail) : o.initEvent(e, !1, !1)), t.dispatchEvent(o);
}
function is(t, e) {
return function() {
return $r(this, t, e);
};
}
function rs(t, e) {
return function() {
return $r(this, t, e.apply(this, arguments));
};
}
function os(t, e) {
return this.each((typeof e == "function" ? rs : is)(t, e));
}
function* ns() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], o = 0, n = r.length, s; o < n; ++o)
(s = r[o]) && (yield s);
}
var zr = [null];
function st(t, e) {
this._groups = t, this._parents = e;
}
function me() {
return new st([[document.documentElement]], zr);
}
function ss() {
return this;
}
st.prototype = me.prototype = {
constructor: st,
select: Ao,
selectAll: Do,
selectChild: zo,
selectChildren: qo,
filter: Uo,
data: jo,
enter: Go,
exit: Jo,
join: Qo,
merge: tn,
selection: ss,
order: en,
sort: rn,
call: nn,
nodes: sn,
node: an,
size: ln,
empty: hn,
each: cn,
attr: Cn,
style: xn,
property: Bn,
classed: Fn,
text: On,
html: Nn,
raise: zn,
lower: Wn,
append: Hn,
insert: Un,
remove: Vn,
clone: Kn,
datum: jn,
on: es,
dispatch: os,
[Symbol.iterator]: ns
};
function nh(t) {
return typeof t == "string" ? new st([[document.querySelector(t)]], [document.documentElement]) : new st([[t]], zr);
}
function Ii(t, e, i) {
t.prototype = e.prototype = i, i.constructor = t;
}
function Pr(t, e) {
var i = Object.create(t.prototype);
for (var r in e)
i[r] = e[r];
return i;
}
function Ce() {
}
var fe = 0.7, Pe = 1 / fe, jt = "\\s*([+-]?\\d+)\\s*", de = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", xt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", as = /^#([0-9a-f]{3,8})$/, ls = new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`), hs = new RegExp(`^rgb\\(${xt},${xt},${xt}\\)$`), cs = new RegExp(`^rgba\\(${jt},${jt},${jt},${de}\\)$`), us = new RegExp(`^rgba\\(${xt},${xt},${xt},${de}\\)$`), fs = new RegExp(`^hsl\\(${de},${xt},${xt}\\)$`), ds = new RegExp(`^hsla\\(${de},${xt},${xt},${de}\\)$`), or = {
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
};
Ii(Ce, ge, {
copy(t) {
return Object.assign(new this.constructor(), this, t);
},
displayable() {
return this.rgb().displayable();
},
hex: nr,
// Deprecated! Use color.formatHex.
formatHex: nr,
formatHex8: gs,
formatHsl: ps,
formatRgb: sr,
toString: sr
});
function nr() {
return this.rgb().formatHex();
}
function gs() {
return this.rgb().formatHex8();
}
function ps() {
return Wr(this).formatHsl();
}
function sr() {
return this.rgb().formatRgb();
}
function ge(t) {
var e, i;
return t = (t + "").trim().toLowerCase(), (e = as.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? ar(e) : i === 3 ? new ot(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? Se(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? Se(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 = ls.exec(t)) ? new ot(e[1], e[2], e[3], 1) : (e = hs.exec(t)) ? new ot(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = cs.exec(t)) ? Se(e[1], e[2], e[3], e[4]) : (e = us.exec(t)) ? Se(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = fs.exec(t)) ? cr(e[1], e[2] / 100, e[3] / 100, 1) : (e = ds.exec(t)) ? cr(e[1], e[2] / 100, e[3] / 100, e[4]) : or.hasOwnProperty(t) ? ar(or[t]) : t === "transparent" ? new ot(NaN, NaN, NaN, 0) : null;
}
function ar(t) {
return new ot(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function Se(t, e, i, r) {
return r <= 0 && (t = e = i = NaN), new ot(t, e, i, r);
}
function ms(t) {
return t instanceof Ce || (t = ge(t)), t ? (t = t.rgb(), new ot(t.r, t.g, t.b, t.opacity)) : new ot();
}
function _i(t, e, i, r) {
return arguments.length === 1 ? ms(t) : new ot(t, e, i, r ?? 1);
}
function ot(t, e, i, r) {
this.r = +t, this.g = +e, this.b = +i, this.opacity = +r;
}
Ii(ot, _i, Pr(Ce, {
brighter(t) {
return t = t == null ? Pe : Math.pow(Pe, t), new ot(this.r * t, this.g * t, this.b * t, this.opacity);
},
darker(t) {
return t = t == null ? fe : Math.pow(fe, t), new ot(this.r * t, this.g * t, this.b * t, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new ot(Pt(this.r), Pt(this.g), Pt(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: lr,
// Deprecated! Use color.formatHex.
formatHex: lr,
formatHex8: Cs,
formatRgb: hr,
toString: hr
}));
function lr() {
return `#${zt(this.r)}${zt(this.g)}${zt(this.b)}`;
}
function Cs() {
return `#${zt(this.r)}${zt(this.g)}${zt(this.b)}${zt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function hr() {
const t = We(this.opacity);
return `${t === 1 ? "rgb(" : "rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function We(t) {
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function Pt(t) {
return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function zt(t) {
return t = Pt(t), (t < 16 ? "0" : "") + t.toString(16);
}
function cr(t, e, i, r) {
return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Ct(t, e, i, r);
}
function Wr(t) {
if (t instanceof Ct)
return new Ct(t.h, t.s, t.l, t.opacity);
if (t instanceof Ce || (t = ge(t)), !t)
return new Ct();
if (t instanceof Ct)
return t;
t = t.rgb();
var e = t.r / 255, i = t.g / 255, r = t.b / 255, o = Math.min(e, i, r), n = Math.max(e, i, r), s = NaN, l = n - o, h = (n + o) / 2;
return l ? (e === n ? s = (i - r) / l + (i < r) * 6 : i === n ? s = (r - e) / l + 2 : s = (e - i) / l + 4, l /= h < 0.5 ? n + o : 2 - n - o, s *= 60) : l = h > 0 && h < 1 ? 0 : s, new Ct(s, l, h, t.opacity);
}
function ys(t, e, i, r) {
return arguments.length === 1 ? Wr(t) : new Ct(t, e, i, r ?? 1);
}
function Ct(t, e, i, r) {
this.h = +t, this.s = +e, this.l = +i, this.opacity = +r;
}
Ii(Ct, ys, Pr(Ce, {
brighter(t) {
return t = t == null ? Pe : Math.pow(Pe, t), new Ct(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? fe : Math.pow(fe, t), new Ct(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, i = this.l, r = i + (i < 0.5 ? i : 1 - i) * e, o = 2 * i - r;
return new ot(
ci(t >= 240 ? t - 240 : t + 120, o, r),
ci(t, o, r),
ci(t < 120 ? t + 240 : t - 120, o, r),
this.opacity
);
},
clamp() {
return new Ct(ur(this.h), Be(this.s), Be(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("}${ur(this.h)}, ${Be(this.s) * 100}%, ${Be(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
}
}));
function ur(t) {
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function Be(t) {
return Math.max(0, Math.min(1, t || 0));
}
function ci(t, e, i) {
return (t < 60 ? e + (i - e) * t / 60 : t < 180 ? i : t < 240 ? e + (i - e) * (240 - t) / 60 : e) * 255;
}
const Di = (t) => () => t;
function Hr(t, e) {
return function(i) {
return t + i * e;
};
}
function bs(t, e, i) {
return t = Math.pow(t, i), e = Math.pow(e, i) - t, i = 1 / i, function(r) {
return Math.pow(t + r * e, i);
};
}
function sh(t, e) {
var i = e - t;
return i ? Hr(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : Di(isNaN(t) ? e : t);
}
function _s(t) {
return (t = +t) == 1 ? qr : function(e, i) {
return i - e ? bs(e, i, t) : Di(isNaN(e) ? i : e);
};
}
function qr(t, e) {
var i = e - t;
return i ? Hr(t, i) : Di(isNaN(t) ? e : t);
}
const fr = function t(e) {
var i = _s(e);
function r(o, n) {
var s = i((o = _i(o)).r, (n = _i(n)).r), l = i(o.g, n.g), h = i(o.b, n.b), u = qr(o.opacity, n.opacity);
return function(f) {
return o.r = s(f), o.g = l(f), o.b = h(f), o.opacity = u(f), o + "";
};
}
return r.gamma = t, r;
}(1);
function At(t, e) {
return t = +t, e = +e, function(i) {
return t * (1 - i) + e * i;
};
}
var xi = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ui = new RegExp(xi.source, "g");
function xs(t) {
return function() {
return t;
};
}
function Ts(t) {
return function(e) {
return t(e) + "";
};
}
function ks(t, e) {
var i = xi.lastIndex = ui.lastIndex = 0, r, o, n, s = -1, l = [], h = [];
for (t = t + "", e = e + ""; (r = xi.exec(t)) && (o = ui.exec(e)); )
(n = o.index) > i && (n = e.slice(i, n), l[s] ? l[s] += n : l[++s] = n), (r = r[0]) === (o = o[0]) ? l[s] ? l[s] += o : l[++s] = o : (l[++s] = null, h.push({ i: s, x: At(r, o) })), i = ui.lastIndex;
return i < e.length && (n = e.slice(i), l[s] ? l[s] += n : l[++s] = n), l.length < 2 ? h[0] ? Ts(h[0].x) : xs(e) : (e = h.length, function(u) {
for (var f = 0, g; f < e; ++f)
l[(g = h[f]).i] = g.x(u);
return l.join("");
});
}
var dr = 180 / Math.PI, Ti = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function Ur(t, e, i, r, o, n) {
var s, l, h;
return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (h = t * i + e * r) && (i -= t * h, r -= e * h), (l = Math.sqrt(i * i + r * r)) && (i /= l, r /= l, h /= l), t * r < e * i && (t = -t, e = -e, h = -h, s = -s), {
translateX: o,
translateY: n,
rotate: Math.atan2(e, t) * dr,
skewX: Math.atan(h) * dr,
scaleX: s,
scaleY: l
};
}
var ve;
function Ss(t) {
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
return e.isIdentity ? Ti : Ur(e.a, e.b, e.c, e.d, e.e, e.f);
}
function Bs(t) {
return t == null || (ve || (ve = document.createElementNS("http://www.w3.org/2000/svg", "g")), ve.setAttribute("transform", t), !(t = ve.transform.baseVal.consolidate())) ? Ti : (t = t.matrix, Ur(t.a, t.b, t.c, t.d, t.e, t.f));
}
function Gr(t, e, i, r) {
function o(u) {
return u.length ? u.pop() + " " : "";
}
function n(u, f, g, x, _, M) {
if (u !== g || f !== x) {
var $ = _.push("translate(", null, e, null, i);
M.push({ i: $ - 4, x: At(u, g) }, { i: $ - 2, x: At(f, x) });
} else
(g || x) && _.push("translate(" + g + e + x + i);
}
function s(u, f, g, x) {
u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), x.push({ i: g.push(o(g) + "rotate(", null, r) - 2, x: At(u, f) })) : f && g.push(o(g) + "rotate(" + f + r);
}
function l(u, f, g, x) {
u !== f ? x.push({ i: g.push(o(g) + "skewX(", null, r) - 2, x: At(u, f) }) : f && g.push(o(g) + "skewX(" + f + r);
}
function h(u, f, g, x, _, M) {
if (u !== g || f !== x) {
var $ = _.push(o(_) + "scale(", null, ",", null, ")");
M.push({ i: $ - 4, x: At(u, g) }, { i: $ - 2, x: At(f, x) });
} else
(g !== 1 || x !== 1) && _.push(o(_) + "scale(" + g + "," + x + ")");
}
return function(u, f) {
var g = [], x = [];
return u = t(u), f = t(f), n(u.translateX, u.translateY, f.translateX, f.translateY, g, x), s(u.rotate, f.rotate, g, x), l(u.skewX, f.skewX, g, x), h(u.scaleX, u.scaleY, f.scaleX, f.scaleY, g, x), u = f = null, function(_) {
for (var M = -1, $ = x.length, K; ++M < $; )
g[(K = x[M]).i] = K.x(_);
return g.join("");
};
};
}
var vs = Gr(Ss, "px, ", "px)", "deg)"), ws = Gr(Bs, ", ", ")", ")"), Qt = 0, se = 0, oe = 0, Vr = 1e3, He, ae, qe = 0, Wt = 0, Ye = 0, pe = typeof performance == "object" && performance.now ? performance : Date, Yr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
setTimeout(t, 17);
};
function Ri() {
return Wt || (Yr(Ls), Wt = pe.now() + Ye);
}
function Ls() {
Wt = 0;
}
function Ue() {
this._call = this._time = this._next = null;
}
Ue.prototype = Xr.prototype = {
constructor: Ue,
restart: function(t, e, i) {
if (typeof t != "function")
throw new TypeError("callback is not a function");
i = (i == null ? Ri() : +i) + (e == null ? 0 : +e), !this._next && ae !== this && (ae ? ae._next = this : He = this, ae = this), this._call = t, this._time = i, ki();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, ki());
}
};
function Xr(t, e, i) {
var r = new Ue();
return r.restart(t, e, i), r;
}
function Fs() {
Ri(), ++Qt;
for (var t = He, e; t; )
(e = Wt - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
--Qt;
}
function gr() {
Wt = (qe = pe.now()) + Ye, Qt = se = 0;
try {
Fs();
} finally {
Qt = 0, As(), Wt = 0;
}
}
function Es() {
var t = pe.now(), e = t - qe;
e > Vr && (Ye -= e, qe = t);
}
function As() {
for (var t, e = He, i, r = 1 / 0; e; )
e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (i = e._next, e._next = null, e = t ? t._next = i : He = i);
ae = t, ki(r);
}
function ki(t) {
if (!Qt) {
se && (se = clearTimeout(se));
var e = t - Wt;
e > 24 ? (t < 1 / 0 && (se = setTimeout(gr, t - pe.now() - Ye)), oe && (oe = clearInterval(oe))) : (oe || (qe = pe.now(), oe = setInterval(Es, Vr)), Qt = 1, Yr(gr));
}
}
function pr(t, e, i) {
var r = new Ue();
return e = e == null ? 0 : +e, r.restart((o) => {
r.stop(), t(o + e);
}, e, i), r;
}
var Ms = wr("start", "end", "cancel", "interrupt"), Os = [], Kr = 0, mr = 1, Si = 2, Me = 3, Cr = 4, Bi = 5, Oe = 6;
function Xe(t, e, i, r, o, n) {
var s = t.__transition;
if (!s)
t.__transition = {};
else if (i in s)
return;
Is(t, i, {
name: e,
index: r,
// For context during callback.
group: o,
// For context during callback.
on: Ms,
tween: Os,
time: n.time,
delay: n.delay,
duration: n.duration,
ease: n.ease,
timer: null,
state: Kr
});
}
function Ni(t, e) {
var i = bt(t, e);
if (i.state > Kr)
throw new Error("too late; already scheduled");
return i;
}
function Tt(t, e) {
var i = bt(t, e);
if (i.state > Me)
throw new Error("too late; already running");
return i;
}
function bt(t, e) {
var i = t.__transition;
if (!i || !(i = i[e]))
throw new Error("transition not found");
return i;
}
function Is(t, e, i) {
var r = t.__transition, o;
r[e] = i, i.timer = Xr(n, 0, i.time);
function n(u) {
i.state = mr, i.timer.restart(s, i.delay, i.time), i.delay <= u && s(u - i.delay);
}
function s(u) {
var f, g, x, _;
if (i.state !== mr)
return h();
for (f in r)
if (_ = r[f], _.name === i.name) {
if (_.state === Me)
return pr(s);
_.state === Cr ? (_.state = Oe, _.timer.stop(), _.on.call("interrupt", t, t.__data__, _.index, _.group), delete r[f]) : +f < e && (_.state = Oe, _.timer.stop(), _.on.call("cancel", t, t.__data__, _.index, _.group), delete r[f]);
}
if (pr(function() {
i.state === Me && (i.state = Cr, i.timer.restart(l, i.delay, i.time), l(u));
}), i.state = Si, i.on.call("start", t, t.__data__, i.index, i.group), i.state === Si) {
for (i.state = Me, o = new Array(x = i.tween.length), f = 0, g = -1; f < x; ++f)
(_ = i.tween[f].value.call(t, t.__data__, i.index, i.group)) && (o[++g] = _);
o.length = g + 1;
}
}
function l(u) {
for (var f = u < i.duration ? i.ease.call(null, u / i.duration) : (i.timer.restart(h), i.state = Bi, 1), g = -1, x = o.length; ++g < x; )
o[g].call(t, f);
i.state === Bi && (i.on.call("end", t, t.__data__, i.index, i.group), h());
}
function h() {
i.state = Oe, i.timer.stop(), delete r[e];
for (var u in r)
return;
delete t.__transition;
}
}
function Ds(t, e) {
var i = t.__transition, r, o, n = !0, s;
if (i) {
e = e == null ? null : e + "";
for (s in i) {
if ((r = i[s]).name !== e) {
n = !1;
continue;
}
o = r.state > Si && r.state < Bi, r.state = Oe, r.timer.stop(), r.on.call(o ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s];
}
n && delete t.__transition;
}
}
function Rs(t) {
return this.each(function() {
Ds(this, t);
});
}
function Ns(t, e) {
var i, r;
return function() {
var o = Tt(this, t), n = o.tween;
if (n !== i) {
r = i = n;
for (var s = 0, l = r.length; s < l; ++s)
if (r[s].name === e) {
r = r.slice(), r.splice(s, 1);
break;
}
}
o.tween = r;
};
}
function $s(t, e, i) {
var r, o;
if (typeof i != "function")
throw new Error();
return function() {
var n = Tt(this, t), s = n.tween;
if (s !== r) {
o = (r = s).slice();
for (var l = { name: e, value: i }, h = 0, u = o.length; h < u; ++h)
if (o[h].name === e) {
o[h] = l;
break;
}
h === u && o.push(l);
}
n.tween = o;
};
}
function zs(t, e) {
var i = this._id;
if (t += "", arguments.length < 2) {
for (var r = bt(this.node(), i).tween, o = 0, n = r.length, s; o < n; ++o)
if ((s = r[o]).name === t)
return s.value;
return null;
}
return this.each((e == null ? Ns : $s)(i, t, e));
}
function $i(t, e, i) {
var r = t._id;
return t.each(function() {
var o = Tt(this, r);
(o.value || (o.value = {}))[e] = i.apply(this, arguments);
}), function(o) {
return bt(o, r).value[e];
};
}
function jr(t, e) {
var i;
return (typeof e == "number" ? At : e instanceof ge ? fr : (i = ge(e)) ? (e = i, fr) : ks)(t, e);
}
function Ps(t) {
return function() {
this.removeAttribute(t);
};
}
function Ws(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function Hs(t, e, i) {
var r, o = i + "", n;
return function() {
var s = this.getAttribute(t);
return s === o ? null : s === r ? n : n = e(r = s, i);
};
}
function qs(t, e, i) {
var r, o = i + "", n;
return function() {
var s = this.getAttributeNS(t.space, t.local);
return s === o ? null : s === r ? n : n = e(r = s, i);
};
}
function Us(t, e, i) {
var r, o, n;
return function() {
var s, l = i(this), h;
return l == null ? void this.removeAttribute(t) : (s = this.getAttribute(t), h = l + "", s === h ? null : s === r && h === o ? n : (o = h, n = e(r = s, l)));
};
}
function Gs(t, e, i) {
var r, o, n;