mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,563 lines • 309 kB
JavaScript
function Pl(t) {
for (var e = [], i = 1; i < arguments.length; i++)
e[i - 1] = arguments[i];
var r = Array.from(typeof t == "string" ? [t] : t);
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
var n = r.reduce(function(a, l) {
var h = l.match(/\n([\t ]+|(?!\s).)/g);
return h ? a.concat(h.map(function(c) {
var u, g;
return (g = (u = c.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && g !== void 0 ? g : 0;
})) : a;
}, []);
if (n.length) {
var o = new RegExp(`
[ ]{` + Math.min.apply(Math, n) + "}", "g");
r = r.map(function(a) {
return a.replace(o, `
`);
});
}
r[0] = r[0].replace(/^\r?\n/, "");
var s = r[0];
return e.forEach(function(a, l) {
var h = s.match(/(?:^|\n)( *)$/), c = h ? h[1] : "", u = a;
typeof a == "string" && a.includes(`
`) && (u = String(a).split(`
`).map(function(g, p) {
return p === 0 ? g : "" + c + g;
}).join(`
`)), s += u + r[l + 1];
}), s;
}
var zl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Wl(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var cs = { exports: {} };
(function(t, e) {
(function(i, r) {
t.exports = r();
})(zl, function() {
var i = 1e3, r = 6e4, n = 36e5, o = "millisecond", s = "second", a = "minute", l = "hour", h = "day", c = "week", u = "month", g = "quarter", p = "year", _ = "date", v = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, q = /\[([^\]]+)]|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, k = { 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(E) {
var T = ["th", "st", "nd", "rd"], x = E % 100;
return "[" + E + (T[(x - 20) % 10] || T[x] || T[0]) + "]";
} }, z = function(E, T, x) {
var O = String(E);
return !O || O.length >= T ? E : "" + Array(T + 1 - O.length).join(x) + E;
}, Q = { s: z, z: function(E) {
var T = -E.utcOffset(), x = Math.abs(T), O = Math.floor(x / 60), y = x % 60;
return (T <= 0 ? "+" : "-") + z(O, 2, "0") + ":" + z(y, 2, "0");
}, m: function E(T, x) {
if (T.date() < x.date())
return -E(x, T);
var O = 12 * (x.year() - T.year()) + (x.month() - T.month()), y = T.clone().add(O, u), D = x - y < 0, w = T.clone().add(O + (D ? -1 : 1), u);
return +(-(O + (x - y) / (D ? y - w : w - y)) || 0);
}, a: function(E) {
return E < 0 ? Math.ceil(E) || 0 : Math.floor(E);
}, p: function(E) {
return { M: u, y: p, w: c, d: h, D: _, h: l, m: a, s, ms: o, Q: g }[E] || String(E || "").toLowerCase().replace(/s$/, "");
}, u: function(E) {
return E === void 0;
} }, X = "en", G = {};
G[X] = k;
var W = function(E) {
return E instanceof $t;
}, Yt = function E(T, x, O) {
var y;
if (!T)
return X;
if (typeof T == "string") {
var D = T.toLowerCase();
G[D] && (y = D), x && (G[D] = x, y = D);
var w = T.split("-");
if (!y && w.length > 1)
return E(w[0]);
} else {
var H = T.name;
G[H] = T, y = H;
}
return !O && y && (X = y), y || !O && X;
}, K = function(E, T) {
if (W(E))
return E.clone();
var x = typeof T == "object" ? T : {};
return x.date = E, x.args = arguments, new $t(x);
}, $ = Q;
$.l = Yt, $.i = W, $.w = function(E, T) {
return K(E, { locale: T.$L, utc: T.$u, x: T.$x, $offset: T.$offset });
};
var $t = function() {
function E(x) {
this.$L = Yt(x.locale, null, !0), this.parse(x);
}
var T = E.prototype;
return T.parse = function(x) {
this.$d = function(O) {
var y = O.date, D = O.utc;
if (y === null)
return /* @__PURE__ */ new Date(NaN);
if ($.u(y))
return /* @__PURE__ */ new Date();
if (y instanceof Date)
return new Date(y);
if (typeof y == "string" && !/Z$/i.test(y)) {
var w = y.match(M);
if (w) {
var H = w[2] - 1 || 0, R = (w[7] || "0").substring(0, 3);
return D ? new Date(Date.UTC(w[1], H, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, R)) : new Date(w[1], H, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, R);
}
}
return new Date(y);
}(x), this.$x = x.x || {}, this.init();
}, T.init = function() {
var x = this.$d;
this.$y = x.getFullYear(), this.$M = x.getMonth(), this.$D = x.getDate(), this.$W = x.getDay(), this.$H = x.getHours(), this.$m = x.getMinutes(), this.$s = x.getSeconds(), this.$ms = x.getMilliseconds();
}, T.$utils = function() {
return $;
}, T.isValid = function() {
return this.$d.toString() !== v;
}, T.isSame = function(x, O) {
var y = K(x);
return this.startOf(O) <= y && y <= this.endOf(O);
}, T.isAfter = function(x, O) {
return K(x) < this.startOf(O);
}, T.isBefore = function(x, O) {
return this.endOf(O) < K(x);
}, T.$g = function(x, O, y) {
return $.u(x) ? this[O] : this.set(y, x);
}, T.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, T.valueOf = function() {
return this.$d.getTime();
}, T.startOf = function(x, O) {
var y = this, D = !!$.u(O) || O, w = $.p(x), H = function(Nt, it) {
var st = $.w(y.$u ? Date.UTC(y.$y, it, Nt) : new Date(y.$y, it, Nt), y);
return D ? st : st.endOf(h);
}, R = function(Nt, it) {
return $.w(y.toDate()[Nt].apply(y.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(it)), y);
}, U = this.$W, P = this.$M, ct = this.$D, pt = "set" + (this.$u ? "UTC" : "");
switch (w) {
case p:
return D ? H(1, 0) : H(31, 11);
case u:
return D ? H(1, P) : H(0, P + 1);
case c:
var Gt = this.$locale().weekStart || 0, Dt = (U < Gt ? U + 7 : U) - Gt;
return H(D ? ct - Dt : ct + (6 - Dt), P);
case h:
case _:
return R(pt + "Hours", 0);
case l:
return R(pt + "Minutes", 1);
case a:
return R(pt + "Seconds", 2);
case s:
return R(pt + "Milliseconds", 3);
default:
return this.clone();
}
}, T.endOf = function(x) {
return this.startOf(x, !1);
}, T.$set = function(x, O) {
var y, D = $.p(x), w = "set" + (this.$u ? "UTC" : ""), H = (y = {}, y[h] = w + "Date", y[_] = w + "Date", y[u] = w + "Month", y[p] = w + "FullYear", y[l] = w + "Hours", y[a] = w + "Minutes", y[s] = w + "Seconds", y[o] = w + "Milliseconds", y)[D], R = D === h ? this.$D + (O - this.$W) : O;
if (D === u || D === p) {
var U = this.clone().set(_, 1);
U.$d[H](R), U.init(), this.$d = U.set(_, Math.min(this.$D, U.daysInMonth())).$d;
} else
H && this.$d[H](R);
return this.init(), this;
}, T.set = function(x, O) {
return this.clone().$set(x, O);
}, T.get = function(x) {
return this[$.p(x)]();
}, T.add = function(x, O) {
var y, D = this;
x = Number(x);
var w = $.p(O), H = function(P) {
var ct = K(D);
return $.w(ct.date(ct.date() + Math.round(P * x)), D);
};
if (w === u)
return this.set(u, this.$M + x);
if (w === p)
return this.set(p, this.$y + x);
if (w === h)
return H(1);
if (w === c)
return H(7);
var R = (y = {}, y[a] = r, y[l] = n, y[s] = i, y)[w] || 1, U = this.$d.getTime() + x * R;
return $.w(U, this);
}, T.subtract = function(x, O) {
return this.add(-1 * x, O);
}, T.format = function(x) {
var O = this, y = this.$locale();
if (!this.isValid())
return y.invalidDate || v;
var D = x || "YYYY-MM-DDTHH:mm:ssZ", w = $.z(this), H = this.$H, R = this.$m, U = this.$M, P = y.weekdays, ct = y.months, pt = function(it, st, Tt, Vt) {
return it && (it[st] || it(O, D)) || Tt[st].slice(0, Vt);
}, Gt = function(it) {
return $.s(H % 12 || 12, it, "0");
}, Dt = y.meridiem || function(it, st, Tt) {
var Vt = it < 12 ? "AM" : "PM";
return Tt ? Vt.toLowerCase() : Vt;
}, Nt = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: U + 1, MM: $.s(U + 1, 2, "0"), MMM: pt(y.monthsShort, U, ct, 3), MMMM: pt(ct, U), D: this.$D, DD: $.s(this.$D, 2, "0"), d: String(this.$W), dd: pt(y.weekdaysMin, this.$W, P, 2), ddd: pt(y.weekdaysShort, this.$W, P, 3), dddd: P[this.$W], H: String(H), HH: $.s(H, 2, "0"), h: Gt(1), hh: Gt(2), a: Dt(H, R, !0), A: Dt(H, R, !1), m: String(R), mm: $.s(R, 2, "0"), s: String(this.$s), ss: $.s(this.$s, 2, "0"), SSS: $.s(this.$ms, 3, "0"), Z: w };
return D.replace(q, function(it, st) {
return st || Nt[it] || w.replace(":", "");
});
}, T.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, T.diff = function(x, O, y) {
var D, w = $.p(O), H = K(x), R = (H.utcOffset() - this.utcOffset()) * r, U = this - H, P = $.m(this, H);
return P = (D = {}, D[p] = P / 12, D[u] = P, D[g] = P / 3, D[c] = (U - R) / 6048e5, D[h] = (U - R) / 864e5, D[l] = U / n, D[a] = U / r, D[s] = U / i, D)[w] || U, y ? P : $.a(P);
}, T.daysInMonth = function() {
return this.endOf(u).$D;
}, T.$locale = function() {
return G[this.$L];
}, T.locale = function(x, O) {
if (!x)
return this.$L;
var y = this.clone(), D = Yt(x, O, !0);
return D && (y.$L = D), y;
}, T.clone = function() {
return $.w(this.$d, this);
}, T.toDate = function() {
return new Date(this.valueOf());
}, T.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, T.toISOString = function() {
return this.$d.toISOString();
}, T.toString = function() {
return this.$d.toUTCString();
}, E;
}(), Ft = $t.prototype;
return K.prototype = Ft, [["$ms", o], ["$s", s], ["$m", a], ["$H", l], ["$W", h], ["$M", u], ["$y", p], ["$D", _]].forEach(function(E) {
Ft[E[1]] = function(T) {
return this.$g(T, E[0], E[1]);
};
}), K.extend = function(E, T) {
return E.$i || (E(T, $t, K), E.$i = !0), K;
}, K.locale = Yt, K.isDayjs = W, K.unix = function(E) {
return K(1e3 * E);
}, K.en = G[X], K.Ls = G, K.p = {}, K;
});
})(cs);
var Hl = cs.exports;
const jl = /* @__PURE__ */ Wl(Hl), Pt = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5
}, S = {
trace: (...t) => {
},
debug: (...t) => {
},
info: (...t) => {
},
warn: (...t) => {
},
error: (...t) => {
},
fatal: (...t) => {
}
}, dn = function(t = "fatal") {
let e = Pt.fatal;
typeof t == "string" ? (t = t.toLowerCase(), t in Pt && (e = Pt[t])) : typeof t == "number" && (e = t), S.trace = () => {
}, S.debug = () => {
}, S.info = () => {
}, S.warn = () => {
}, S.error = () => {
}, S.fatal = () => {
}, e <= Pt.fatal && (S.fatal = console.error ? console.error.bind(console, yt("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", yt("FATAL"))), e <= Pt.error && (S.error = console.error ? console.error.bind(console, yt("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", yt("ERROR"))), e <= Pt.warn && (S.warn = console.warn ? console.warn.bind(console, yt("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", yt("WARN"))), e <= Pt.info && (S.info = console.info ? console.info.bind(console, yt("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", yt("INFO"))), e <= Pt.debug && (S.debug = console.debug ? console.debug.bind(console, yt("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("DEBUG"))), e <= Pt.trace && (S.trace = console.debug ? console.debug.bind(console, yt("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("TRACE")));
}, yt = (t) => `%c${jl().format("ss.SSS")} : ${t} : `;
var pn = {};
Object.defineProperty(pn, "__esModule", { value: !0 });
var us = pn.sanitizeUrl = void 0, Ul = /^([^\w]*)(javascript|data|vbscript)/im, Yl = /&#(\w+)(^\w|;)?/g, Gl = /&(newline|tab);/gi, Vl = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, Xl = /^.+(:|:)/gim, Kl = [".", "/"];
function Zl(t) {
return Kl.indexOf(t[0]) > -1;
}
function Jl(t) {
return t.replace(Yl, function(e, i) {
return String.fromCharCode(i);
});
}
function Ql(t) {
var e = Jl(t || "").replace(Gl, "").replace(Vl, "").trim();
if (!e)
return "about:blank";
if (Zl(e))
return e;
var i = e.match(Xl);
if (!i)
return e;
var r = i[0];
return Ul.test(r) ? "about:blank" : e;
}
us = pn.sanitizeUrl = Ql;
var th = { value: () => {
} };
function fs() {
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 ki(i);
}
function ki(t) {
this._ = t;
}
function eh(t, e) {
return t.trim().split(/^|\s+/).map(function(i) {
var r = "", n = i.indexOf(".");
if (n >= 0 && (r = i.slice(n + 1), i = i.slice(0, n)), i && !e.hasOwnProperty(i))
throw new Error("unknown type: " + i);
return { type: i, name: r };
});
}
ki.prototype = fs.prototype = {
constructor: ki,
on: function(t, e) {
var i = this._, r = eh(t + "", i), n, o = -1, s = r.length;
if (arguments.length < 2) {
for (; ++o < s; )
if ((n = (t = r[o]).type) && (n = ih(i[n], t.name)))
return n;
return;
}
if (e != null && typeof e != "function")
throw new Error("invalid callback: " + e);
for (; ++o < s; )
if (n = (t = r[o]).type)
i[n] = no(i[n], t.name, e);
else if (e == null)
for (n in i)
i[n] = no(i[n], t.name, null);
return this;
},
copy: function() {
var t = {}, e = this._;
for (var i in e)
t[i] = e[i].slice();
return new ki(t);
},
call: function(t, e) {
if ((n = arguments.length - 2) > 0)
for (var i = new Array(n), r = 0, n, o; r < n; ++r)
i[r] = arguments[r + 2];
if (!this._.hasOwnProperty(t))
throw new Error("unknown type: " + t);
for (o = this._[t], r = 0, n = o.length; r < n; ++r)
o[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], n = 0, o = r.length; n < o; ++n)
r[n].value.apply(e, i);
}
};
function ih(t, e) {
for (var i = 0, r = t.length, n; i < r; ++i)
if ((n = t[i]).name === e)
return n.value;
}
function no(t, e, i) {
for (var r = 0, n = t.length; r < n; ++r)
if (t[r].name === e) {
t[r] = th, t = t.slice(0, r).concat(t.slice(r + 1));
break;
}
return i != null && t.push({ name: e, value: i }), t;
}
var Yr = "http://www.w3.org/1999/xhtml";
const oo = {
svg: "http://www.w3.org/2000/svg",
xhtml: Yr,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function rr(t) {
var e = t += "", i = e.indexOf(":");
return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), oo.hasOwnProperty(e) ? { space: oo[e], local: t } : t;
}
function rh(t) {
return function() {
var e = this.ownerDocument, i = this.namespaceURI;
return i === Yr && e.documentElement.namespaceURI === Yr ? e.createElement(t) : e.createElementNS(i, t);
};
}
function nh(t) {
return function() {
return this.ownerDocument.createElementNS(t.space, t.local);
};
}
function ds(t) {
var e = rr(t);
return (e.local ? nh : rh)(e);
}
function oh() {
}
function gn(t) {
return t == null ? oh : function() {
return this.querySelector(t);
};
}
function sh(t) {
typeof t != "function" && (t = gn(t));
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
for (var o = e[n], s = o.length, a = r[n] = new Array(s), l, h, c = 0; c < s; ++c)
(l = o[c]) && (h = t.call(l, l.__data__, c, o)) && ("__data__" in l && (h.__data__ = l.__data__), a[c] = h);
return new mt(r, this._parents);
}
function ah(t) {
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function lh() {
return [];
}
function ps(t) {
return t == null ? lh : function() {
return this.querySelectorAll(t);
};
}
function hh(t) {
return function() {
return ah(t.apply(this, arguments));
};
}
function ch(t) {
typeof t == "function" ? t = hh(t) : t = ps(t);
for (var e = this._groups, i = e.length, r = [], n = [], o = 0; o < i; ++o)
for (var s = e[o], a = s.length, l, h = 0; h < a; ++h)
(l = s[h]) && (r.push(t.call(l, l.__data__, h, s)), n.push(l));
return new mt(r, n);
}
function gs(t) {
return function() {
return this.matches(t);
};
}
function ms(t) {
return function(e) {
return e.matches(t);
};
}
var uh = Array.prototype.find;
function fh(t) {
return function() {
return uh.call(this.children, t);
};
}
function dh() {
return this.firstElementChild;
}
function ph(t) {
return this.select(t == null ? dh : fh(typeof t == "function" ? t : ms(t)));
}
var gh = Array.prototype.filter;
function mh() {
return Array.from(this.children);
}
function _h(t) {
return function() {
return gh.call(this.children, t);
};
}
function yh(t) {
return this.selectAll(t == null ? mh : _h(typeof t == "function" ? t : ms(t)));
}
function Ch(t) {
typeof t != "function" && (t = gs(t));
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
for (var o = e[n], s = o.length, a = r[n] = [], l, h = 0; h < s; ++h)
(l = o[h]) && t.call(l, l.__data__, h, o) && a.push(l);
return new mt(r, this._parents);
}
function _s(t) {
return new Array(t.length);
}
function xh() {
return new mt(this._enter || this._groups.map(_s), this._parents);
}
function Di(t, e) {
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
}
Di.prototype = {
constructor: Di,
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 bh(t) {
return function() {
return t;
};
}
function Th(t, e, i, r, n, o) {
for (var s = 0, a, l = e.length, h = o.length; s < h; ++s)
(a = e[s]) ? (a.__data__ = o[s], r[s] = a) : i[s] = new Di(t, o[s]);
for (; s < l; ++s)
(a = e[s]) && (n[s] = a);
}
function Sh(t, e, i, r, n, o, s) {
var a, l, h = /* @__PURE__ */ new Map(), c = e.length, u = o.length, g = new Array(c), p;
for (a = 0; a < c; ++a)
(l = e[a]) && (g[a] = p = s.call(l, l.__data__, a, e) + "", h.has(p) ? n[a] = l : h.set(p, l));
for (a = 0; a < u; ++a)
p = s.call(t, o[a], a, o) + "", (l = h.get(p)) ? (r[a] = l, l.__data__ = o[a], h.delete(p)) : i[a] = new Di(t, o[a]);
for (a = 0; a < c; ++a)
(l = e[a]) && h.get(g[a]) === l && (n[a] = l);
}
function kh(t) {
return t.__data__;
}
function vh(t, e) {
if (!arguments.length)
return Array.from(this, kh);
var i = e ? Sh : Th, r = this._parents, n = this._groups;
typeof t != "function" && (t = bh(t));
for (var o = n.length, s = new Array(o), a = new Array(o), l = new Array(o), h = 0; h < o; ++h) {
var c = r[h], u = n[h], g = u.length, p = wh(t.call(c, c && c.__data__, h, r)), _ = p.length, v = a[h] = new Array(_), M = s[h] = new Array(_), q = l[h] = new Array(g);
i(c, u, v, M, q, p, e);
for (var k = 0, z = 0, Q, X; k < _; ++k)
if (Q = v[k]) {
for (k >= z && (z = k + 1); !(X = M[z]) && ++z < _; )
;
Q._next = X || null;
}
}
return s = new mt(s, r), s._enter = a, s._exit = l, s;
}
function wh(t) {
return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function Bh() {
return new mt(this._exit || this._groups.map(_s), this._parents);
}
function Fh(t, e, i) {
var r = this.enter(), n = this, o = this.exit();
return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (n = e(n), n && (n = n.selection())), i == null ? o.remove() : i(o), r && n ? r.merge(n).order() : n;
}
function Lh(t) {
for (var e = t.selection ? t.selection() : t, i = this._groups, r = e._groups, n = i.length, o = r.length, s = Math.min(n, o), a = new Array(n), l = 0; l < s; ++l)
for (var h = i[l], c = r[l], u = h.length, g = a[l] = new Array(u), p, _ = 0; _ < u; ++_)
(p = h[_] || c[_]) && (g[_] = p);
for (; l < n; ++l)
a[l] = i[l];
return new mt(a, this._parents);
}
function Ah() {
for (var t = this._groups, e = -1, i = t.length; ++e < i; )
for (var r = t[e], n = r.length - 1, o = r[n], s; --n >= 0; )
(s = r[n]) && (o && s.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(s, o), o = s);
return this;
}
function Eh(t) {
t || (t = Mh);
function e(u, g) {
return u && g ? t(u.__data__, g.__data__) : !u - !g;
}
for (var i = this._groups, r = i.length, n = new Array(r), o = 0; o < r; ++o) {
for (var s = i[o], a = s.length, l = n[o] = new Array(a), h, c = 0; c < a; ++c)
(h = s[c]) && (l[c] = h);
l.sort(e);
}
return new mt(n, this._parents).order();
}
function Mh(t, e) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function Oh() {
var t = arguments[0];
return arguments[0] = this, t.apply(null, arguments), this;
}
function Ih() {
return Array.from(this);
}
function $h() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], n = 0, o = r.length; n < o; ++n) {
var s = r[n];
if (s)
return s;
}
return null;
}
function Dh() {
let t = 0;
for (const e of this)
++t;
return t;
}
function Nh() {
return !this.node();
}
function Rh(t) {
for (var e = this._groups, i = 0, r = e.length; i < r; ++i)
for (var n = e[i], o = 0, s = n.length, a; o < s; ++o)
(a = n[o]) && t.call(a, a.__data__, o, n);
return this;
}
function qh(t) {
return function() {
this.removeAttribute(t);
};
}
function Ph(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function zh(t, e) {
return function() {
this.setAttribute(t, e);
};
}
function Wh(t, e) {
return function() {
this.setAttributeNS(t.space, t.local, e);
};
}
function Hh(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? this.removeAttribute(t) : this.setAttribute(t, i);
};
}
function jh(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 Uh(t, e) {
var i = rr(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 ? Ph : qh : typeof e == "function" ? i.local ? jh : Hh : i.local ? Wh : zh)(i, e));
}
function ys(t) {
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function Yh(t) {
return function() {
this.style.removeProperty(t);
};
}
function Gh(t, e, i) {
return function() {
this.style.setProperty(t, e, i);
};
}
function Vh(t, e, i) {
return function() {
var r = e.apply(this, arguments);
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i);
};
}
function Xh(t, e, i) {
return arguments.length > 1 ? this.each((e == null ? Yh : typeof e == "function" ? Vh : Gh)(t, e, i ?? "")) : we(this.node(), t);
}
function we(t, e) {
return t.style.getPropertyValue(e) || ys(t).getComputedStyle(t, null).getPropertyValue(e);
}
function Kh(t) {
return function() {
delete this[t];
};
}
function Zh(t, e) {
return function() {
this[t] = e;
};
}
function Jh(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? delete this[t] : this[t] = i;
};
}
function Qh(t, e) {
return arguments.length > 1 ? this.each((e == null ? Kh : typeof e == "function" ? Jh : Zh)(t, e)) : this.node()[t];
}
function Cs(t) {
return t.trim().split(/^|\s+/);
}
function mn(t) {
return t.classList || new xs(t);
}
function xs(t) {
this._node = t, this._names = Cs(t.getAttribute("class") || "");
}
xs.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 bs(t, e) {
for (var i = mn(t), r = -1, n = e.length; ++r < n; )
i.add(e[r]);
}
function Ts(t, e) {
for (var i = mn(t), r = -1, n = e.length; ++r < n; )
i.remove(e[r]);
}
function tc(t) {
return function() {
bs(this, t);
};
}
function ec(t) {
return function() {
Ts(this, t);
};
}
function ic(t, e) {
return function() {
(e.apply(this, arguments) ? bs : Ts)(this, t);
};
}
function rc(t, e) {
var i = Cs(t + "");
if (arguments.length < 2) {
for (var r = mn(this.node()), n = -1, o = i.length; ++n < o; )
if (!r.contains(i[n]))
return !1;
return !0;
}
return this.each((typeof e == "function" ? ic : e ? tc : ec)(i, e));
}
function nc() {
this.textContent = "";
}
function oc(t) {
return function() {
this.textContent = t;
};
}
function sc(t) {
return function() {
var e = t.apply(this, arguments);
this.textContent = e ?? "";
};
}
function ac(t) {
return arguments.length ? this.each(t == null ? nc : (typeof t == "function" ? sc : oc)(t)) : this.node().textContent;
}
function lc() {
this.innerHTML = "";
}
function hc(t) {
return function() {
this.innerHTML = t;
};
}
function cc(t) {
return function() {
var e = t.apply(this, arguments);
this.innerHTML = e ?? "";
};
}
function uc(t) {
return arguments.length ? this.each(t == null ? lc : (typeof t == "function" ? cc : hc)(t)) : this.node().innerHTML;
}
function fc() {
this.nextSibling && this.parentNode.appendChild(this);
}
function dc() {
return this.each(fc);
}
function pc() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function gc() {
return this.each(pc);
}
function mc(t) {
var e = typeof t == "function" ? t : ds(t);
return this.select(function() {
return this.appendChild(e.apply(this, arguments));
});
}
function _c() {
return null;
}
function yc(t, e) {
var i = typeof t == "function" ? t : ds(t), r = e == null ? _c : typeof e == "function" ? e : gn(e);
return this.select(function() {
return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null);
});
}
function Cc() {
var t = this.parentNode;
t && t.removeChild(this);
}
function xc() {
return this.each(Cc);
}
function bc() {
var t = this.cloneNode(!1), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Tc() {
var t = this.cloneNode(!0), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Sc(t) {
return this.select(t ? Tc : bc);
}
function kc(t) {
return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function vc(t) {
return function(e) {
t.call(this, e, this.__data__);
};
}
function wc(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 Bc(t) {
return function() {
var e = this.__on;
if (e) {
for (var i = 0, r = -1, n = e.length, o; i < n; ++i)
o = e[i], (!t.type || o.type === t.type) && o.name === t.name ? this.removeEventListener(o.type, o.listener, o.options) : e[++r] = o;
++r ? e.length = r : delete this.__on;
}
};
}
function Fc(t, e, i) {
return function() {
var r = this.__on, n, o = vc(e);
if (r) {
for (var s = 0, a = r.length; s < a; ++s)
if ((n = r[s]).type === t.type && n.name === t.name) {
this.removeEventListener(n.type, n.listener, n.options), this.addEventListener(n.type, n.listener = o, n.options = i), n.value = e;
return;
}
}
this.addEventListener(t.type, o, i), n = { type: t.type, name: t.name, value: e, listener: o, options: i }, r ? r.push(n) : this.__on = [n];
};
}
function Lc(t, e, i) {
var r = wc(t + ""), n, o = r.length, s;
if (arguments.length < 2) {
var a = this.node().__on;
if (a) {
for (var l = 0, h = a.length, c; l < h; ++l)
for (n = 0, c = a[l]; n < o; ++n)
if ((s = r[n]).type === c.type && s.name === c.name)
return c.value;
}
return;
}
for (a = e ? Fc : Bc, n = 0; n < o; ++n)
this.each(a(r[n], e, i));
return this;
}
function Ss(t, e, i) {
var r = ys(t), n = r.CustomEvent;
typeof n == "function" ? n = new n(e, i) : (n = r.document.createEvent("Event"), i ? (n.initEvent(e, i.bubbles, i.cancelable), n.detail = i.detail) : n.initEvent(e, !1, !1)), t.dispatchEvent(n);
}
function Ac(t, e) {
return function() {
return Ss(this, t, e);
};
}
function Ec(t, e) {
return function() {
return Ss(this, t, e.apply(this, arguments));
};
}
function Mc(t, e) {
return this.each((typeof e == "function" ? Ec : Ac)(t, e));
}
function* Oc() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], n = 0, o = r.length, s; n < o; ++n)
(s = r[n]) && (yield s);
}
var ks = [null];
function mt(t, e) {
this._groups = t, this._parents = e;
}
function ni() {
return new mt([[document.documentElement]], ks);
}
function Ic() {
return this;
}
mt.prototype = ni.prototype = {
constructor: mt,
select: sh,
selectAll: ch,
selectChild: ph,
selectChildren: yh,
filter: Ch,
data: vh,
enter: xh,
exit: Bh,
join: Fh,
merge: Lh,
selection: Ic,
order: Ah,
sort: Eh,
call: Oh,
nodes: Ih,
node: $h,
size: Dh,
empty: Nh,
each: Rh,
attr: Uh,
style: Xh,
property: Qh,
classed: rc,
text: ac,
html: uc,
raise: dc,
lower: gc,
append: mc,
insert: yc,
remove: xc,
clone: Sc,
datum: kc,
on: Lc,
dispatch: Mc,
[Symbol.iterator]: Oc
};
function At(t) {
return typeof t == "string" ? new mt([[document.querySelector(t)]], [document.documentElement]) : new mt([[t]], ks);
}
function _n(t, e, i) {
t.prototype = e.prototype = i, i.constructor = t;
}
function vs(t, e) {
var i = Object.create(t.prototype);
for (var r in e)
i[r] = e[r];
return i;
}
function oi() {
}
var Ve = 0.7, Ni = 1 / Ve, ve = "\\s*([+-]?\\d+)\\s*", Xe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", $c = /^#([0-9a-f]{3,8})$/, Dc = new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`), Nc = new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`), Rc = new RegExp(`^rgba\\(${ve},${ve},${ve},${Xe}\\)$`), qc = new RegExp(`^rgba\\(${Et},${Et},${Et},${Xe}\\)$`), Pc = new RegExp(`^hsl\\(${Xe},${Et},${Et}\\)$`), zc = new RegExp(`^hsla\\(${Xe},${Et},${Et},${Xe}\\)$`), so = {
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
};
_n(oi, Ke, {
copy(t) {
return Object.assign(new this.constructor(), this, t);
},
displayable() {
return this.rgb().displayable();
},
hex: ao,
// Deprecated! Use color.formatHex.
formatHex: ao,
formatHex8: Wc,
formatHsl: Hc,
formatRgb: lo,
toString: lo
});
function ao() {
return this.rgb().formatHex();
}
function Wc() {
return this.rgb().formatHex8();
}
function Hc() {
return ws(this).formatHsl();
}
function lo() {
return this.rgb().formatRgb();
}
function Ke(t) {
var e, i;
return t = (t + "").trim().toLowerCase(), (e = $c.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? ho(e) : i === 3 ? new ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? gi(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? gi(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 = Dc.exec(t)) ? new ft(e[1], e[2], e[3], 1) : (e = Nc.exec(t)) ? new ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Rc.exec(t)) ? gi(e[1], e[2], e[3], e[4]) : (e = qc.exec(t)) ? gi(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Pc.exec(t)) ? fo(e[1], e[2] / 100, e[3] / 100, 1) : (e = zc.exec(t)) ? fo(e[1], e[2] / 100, e[3] / 100, e[4]) : so.hasOwnProperty(t) ? ho(so[t]) : t === "transparent" ? new ft(NaN, NaN, NaN, 0) : null;
}
function ho(t) {
return new ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function gi(t, e, i, r) {
return r <= 0 && (t = e = i = NaN), new ft(t, e, i, r);
}
function jc(t) {
return t instanceof oi || (t = Ke(t)), t ? (t = t.rgb(), new ft(t.r, t.g, t.b, t.opacity)) : new ft();
}
function Gr(t, e, i, r) {
return arguments.length === 1 ? jc(t) : new ft(t, e, i, r ?? 1);
}
function ft(t, e, i, r) {
this.r = +t, this.g = +e, this.b = +i, this.opacity = +r;
}
_n(ft, Gr, vs(oi, {
brighter(t) {
return t = t == null ? Ni : Math.pow(Ni, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
},
darker(t) {
return t = t == null ? Ve : Math.pow(Ve, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new ft(le(this.r), le(this.g), le(this.b), Ri(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: co,
// Deprecated! Use color.formatHex.
formatHex: co,
formatHex8: Uc,
formatRgb: uo,
toString: uo
}));
function co() {
return `#${ae(this.r)}${ae(this.g)}${ae(this.b)}`;
}
function Uc() {
return `#${ae(this.r)}${ae(this.g)}${ae(this.b)}${ae((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function uo() {
const t = Ri(this.opacity);
return `${t === 1 ? "rgb(" : "rgba("}${le(this.r)}, ${le(this.g)}, ${le(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function Ri(t) {
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function le(t) {
return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function ae(t) {
return t = le(t), (t < 16 ? "0" : "") + t.toString(16);
}
function fo(t, e, i, r) {
return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new kt(t, e, i, r);
}
function ws(t) {
if (t instanceof kt)
return new kt(t.h, t.s, t.l, t.opacity);
if (t instanceof oi || (t = Ke(t)), !t)
return new kt();
if (t instanceof kt)
return t;
t = t.rgb();
var e = t.r / 255, i = t.g / 255, r = t.b / 255, n = Math.min(e, i, r), o = Math.max(e, i, r), s = NaN, a = o - n, l = (o + n) / 2;
return a ? (e === o ? s = (i - r) / a + (i < r) * 6 : i === o ? s = (r - e) / a + 2 : s = (e - i) / a + 4, a /= l < 0.5 ? o + n : 2 - o - n, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new kt(s, a, l, t.opacity);
}
function Yc(t, e, i, r) {
return arguments.length === 1 ? ws(t) : new kt(t, e, i, r ?? 1);
}
function kt(t, e, i, r) {
this.h = +t, this.s = +e, this.l = +i, this.opacity = +r;
}
_n(kt, Yc, vs(oi, {
brighter(t) {
return t = t == null ? Ni : Math.pow(Ni, t), new kt(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? Ve : Math.pow(Ve, t), new kt(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, n = 2 * i - r;
return new ft(
Lr(t >= 240 ? t - 240 : t + 120, n, r),
Lr(t, n, r),
Lr(t < 120 ? t + 240 : t - 120, n, r),
this.opacity
);
},
clamp() {
return new kt(po(this.h), mi(this.s), mi(this.l), Ri(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 = Ri(this.opacity);
return `${t === 1 ? "hsl(" : "hsla("}${po(this.h)}, ${mi(this.s) * 100}%, ${mi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
}
}));
function po(t) {
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function mi(t) {
return Math.max(0, Math.min(1, t || 0));
}
function Lr(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 yn = (t) => () => t;
function Bs(t, e) {
return function(i) {
return t + i * e;
};
}
function Gc(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 wx(t, e) {
var i = e - t;
return i ? Bs(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : yn(isNaN(t) ? e : t);
}
function Vc(t) {
return (t = +t) == 1 ? Fs : function(e, i) {
return i - e ? Gc(e, i, t) : yn(isNaN(e) ? i : e);
};
}
function Fs(t, e) {
var i = e - t;
return i ? Bs(t, i) : yn(isNaN(t) ? e : t);
}
const go = function t(e) {
var i = Vc(e);
function r(n, o) {
var s = i((n = Gr(n)).r, (o = Gr(o)).r), a = i(n.g, o.g), l = i(n.b, o.b), h = Fs(n.opacity, o.opacity);
return function(c) {
return n.r = s(c), n.g = a(c), n.b = l(c), n.opacity = h(c), n + "";
};
}
return r.gamma = t, r;
}(1);
function Zt(t, e) {
return t = +t, e = +e, function(i) {
return t * (1 - i) + e * i;
};
}
var Vr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ar = new RegExp(Vr.source, "g");
function Xc(t) {
return function() {
return t;
};
}
function Kc(t) {
return function(e) {
return t(e) + "";
};
}
function Zc(t, e) {
var i = Vr.lastIndex = Ar.lastIndex = 0, r, n, o, s = -1, a = [], l = [];
for (t = t + "", e = e + ""; (r = Vr.exec(t)) && (n = Ar.exec(e)); )
(o = n.index) > i && (o = e.slice(i, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (n = n[0]) ? a[s] ? a[s] += n : a[++s] = n : (a[++s] = null, l.push({ i: s, x: Zt(r, n) })), i = Ar.lastIndex;
return i < e.length && (o = e.slice(i), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? Kc(l[0].x) : Xc(e) : (e = l.length, function(h) {
for (var c = 0, u; c < e; ++c)
a[(u = l[c]).i] = u.x(h);
return a.join("");
});
}
var mo = 180 / Math.PI, Xr = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function Ls(t, e, i, r, n, o) {
var s, a, l;
return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (l = t * i + e * r) && (i -= t * l, r -= e * l), (a = Math.sqrt(i * i + r * r)) && (i /= a, r /= a, l /= a), t * r < e * i && (t = -t, e = -e, l = -l, s = -s), {
translateX: n,
translateY: o,
rotate: Math.atan2(e, t) * mo,
skewX: Math.atan(l) * mo,
scaleX: s,
scaleY: a
};
}
var _i;
function Jc(t) {
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
return e.isIdentity ? Xr : Ls(e.a, e.b, e.c, e.d, e.e, e.f);
}
function Qc(t) {
return t == null || (_i || (_i = document.createElementNS("http://www.w3.org/2000/svg", "g")), _i.setAttribute("transform", t), !(t = _i.transform.baseVal.consolidate())) ? Xr : (t = t.matrix, Ls(t.a, t.b, t.c, t.d, t.e, t.f));
}
function As(t, e, i, r) {
function n(h) {
return h.length ? h.pop() + " " : "";
}
function o(h, c, u, g, p, _) {
if (h !== u || c !== g) {
var v = p.push("translate(", null, e, null, i);
_.push({ i: v - 4, x: Zt(h, u) }, { i: v - 2, x: Zt(c, g) });
} else
(u || g) && p.push("translate(" + u + e + g + i);
}
function s(h, c, u, g) {
h !== c ? (h - c > 180 ? c += 360 : c - h > 180 && (h += 360), g.push({ i: u.push(n(u) + "rotate(", null, r) - 2, x: Zt(h, c) })) : c && u.push(n(u) + "rotate(" + c + r);
}
function a(h, c, u, g) {
h !== c ? g.push({ i: u.push(n(u) + "skewX(", null, r) - 2, x: Zt(h, c) }) : c && u.push(n(u) + "skewX(" + c + r);
}
function l(h, c, u, g, p, _) {
if (h !== u || c !== g) {
var v = p.push(n(p) + "scale(", null, ",", null, ")");
_.push({ i: v - 4, x: Zt(h, u) }, { i: v - 2, x: Zt(c, g) });
} else
(u !== 1 || g !== 1) && p.push(n(p) + "scale(" + u + "," + g + ")");
}
return function(h, c) {
var u = [], g = [];
return h = t(h), c = t(c), o(h.translateX, h.translateY, c.translateX, c.translateY, u, g), s(h.rotate, c.rotate, u, g), a(h.skewX, c.skewX, u, g), l(h.scaleX, h.scaleY, c.scaleX, c.scaleY, u, g), h = c = null, function(p) {
for (var _ = -1, v = g.length, M; ++_ < v; )
u[(M = g[_]).i] = M.x(p);
return u.join("");
};
};
}
var tu = As(Jc, "px, ", "px)", "deg)"), eu = As(Qc, ", ", ")", ")"), Be = 0, ze = 0, Ne = 0, Es = 1e3, qi, We, Pi = 0, ue = 0, nr = 0, Ze = typeof performance == "object" && performance.now ? performance : Date, Ms = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
setTimeout(t, 17);
};
function Cn() {
return ue || (Ms(iu), ue = Ze.now() + nr);
}
function iu() {
ue = 0;
}
function zi() {
this._call = this._time = this._next = null;
}
zi.prototype = Os.prototype = {
constructor: zi,
restart: function(t, e, i) {
if (typeof t != "function")
throw new TypeError("callback is not a function");
i = (i == null ? Cn() : +i) + (e == null ? 0 : +e), !this._next && We !== this && (We ? We._next = this : qi = this, We = this), this._call = t, this._time = i, Kr();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, Kr());
}
};
function Os(t, e, i) {
var r = new zi();
return r.restart(t, e, i), r;
}
function ru() {
Cn(), ++Be;
for (var t = qi, e; t; )
(e = ue - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
--Be;
}
function _o() {
ue = (Pi = Ze.now()) + nr, Be = ze = 0;
try {
ru();
} finally {
Be = 0, ou(), ue = 0;
}
}
function nu() {
var t = Ze.now(), e = t - Pi;
e > Es && (nr -= e, Pi = t);
}
function ou() {
for (var t, e = qi, 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 : qi = i);
We = t, Kr(r);
}
function Kr(t) {
if (!Be) {
ze && (ze = clearTimeout(ze));
var e = t - ue;
e > 24 ? (t < 1 / 0 && (ze = setTimeout(_o, t - Ze.now() - nr)), Ne && (Ne = clearInterval(Ne))) : (Ne || (Pi = Ze.now(), Ne = setInterval(nu, Es)), Be = 1, Ms(_o));
}
}
function yo(t, e, i) {
var r = new zi();
return e = e == null ? 0 : +e, r.restart((n) => {
r.stop(), t(n + e);
}, e, i), r;
}
var su = fs("start", "end", "cancel", "interrupt"), au = [], Is = 0, Co = 1, Zr = 2, vi = 3, xo = 4, Jr = 5, wi = 6;
function or(t, e, i, r, n, o) {
var s = t.__transition;
if (!s)
t.__transition = {};
else if (i in s)
return;
lu(t, i, {
name: e,
index: r,
// For context during callback.
group: n,
// For context during callback.
on: su,
tween: au,
time: o.time,
delay: o.delay,
duration: o.duration,
ease: o.ease,
timer: null,
state: Is
});
}
function xn(t, e) {
var i = Bt(t, e);
if (i.state > Is)
throw new Error("too late; already scheduled");
return i;
}
function It(t, e) {
var i = Bt(t, e);
if (i.state > vi)
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 lu(t, e, i) {
var r = t.__transition, n;
r[e] = i, i.timer = Os(o, 0, i.time);
function o(h) {
i.state = Co, i.timer.restart(s, i.delay, i.time), i.delay <= h && s(h - i.delay);
}
function s(h) {
var c, u, g, p;
if (i.state !== Co)
return l();
for (c in r)
if (p = r[c], p.name === i.name) {
if (p.state === vi)
return yo(s);
p.state === xo ? (p.state = wi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < e && (p.state = wi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]);
}
if (yo(function() {
i.state === vi && (i.state = xo, i.timer.restart(a, i.delay, i.time), a(h));
}), i.state = Zr, i.on.call("start", t, t.__data__, i.index, i.group), i.state === Zr) {
for (i.state = vi, n = new Array(g = i.tween.length), c = 0, u = -1; c < g; ++c)
(p = i.tween[c].value.call(t, t.__data__, i.index, i.group)) && (n[++u] = p);
n.length = u + 1;
}
}
function a(h) {
for (var c = h < i.duration ? i.ease.call(null, h / i.duration) : (i.timer.restart(l), i.state = Jr, 1), u = -1, g = n.length; ++u < g; )
n[u].call(t, c);
i.state === Jr && (i.on.call("end", t, t.__data__, i.index, i.group), l());
}
function l() {
i.state = wi, i.timer.stop(), delete r[e];
for (var h in r)
return;
delete t.__transition;
}
}
function hu(t, e) {
var i = t.__transition, r, n, o = !0, s;
if (i) {
e = e == null ? null : e + "";
for (s in i) {
if ((r = i[s]).name !== e) {
o = !1;
continue;
}
n = r.state > Zr && r.state < Jr, r.state = wi, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s];
}
o && delete t.__transition;
}
}
function cu(t) {
return this.each(function() {
hu(this, t);
});
}
function uu(t, e) {
var i, r;
return function() {
var n = It(this, t), o = n.tween;
if (o !== i) {
r = i = o;
for (var s = 0, a = r.length; s < a; ++s)
if (r[s].name === e) {
r = r.slice(), r.splice(s, 1);
break;
}
}
n.tween = r;
};
}
function fu(t, e, i) {
var r, n;
if (typeof i != "function")
throw new Error();
return function() {
var o = It(this, t), s = o