UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

1,563 lines 316 kB
function oh(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 f, g; return (g = (f = c.match(/[\t ]/g)) === null || f === void 0 ? void 0 : f.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] : "", f = a; typeof a == "string" && a.includes(` `) && (f = String(a).split(` `).map(function(g, p) { return p === 0 ? g : "" + c + g; }).join(` `)), s += f + r[l + 1]; }), s; } var sh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function ah(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var As = { exports: {} }; (function(t, e) { (function(i, r) { t.exports = r(); })(sh, function() { var i = 1e3, r = 6e4, n = 36e5, o = "millisecond", s = "second", a = "minute", l = "hour", h = "day", c = "week", f = "month", g = "quarter", p = "year", _ = "date", k = "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, v = { 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 S = ["th", "st", "nd", "rd"], C = E % 100; return "[" + E + (S[(C - 20) % 10] || S[C] || S[0]) + "]"; } }, z = function(E, S, C) { var O = String(E); return !O || O.length >= S ? E : "" + Array(S + 1 - O.length).join(C) + E; }, Q = { s: z, z: function(E) { var S = -E.utcOffset(), C = Math.abs(S), O = Math.floor(C / 60), x = C % 60; return (S <= 0 ? "+" : "-") + z(O, 2, "0") + ":" + z(x, 2, "0"); }, m: function E(S, C) { if (S.date() < C.date()) return -E(C, S); var O = 12 * (C.year() - S.year()) + (C.month() - S.month()), x = S.clone().add(O, f), D = C - x < 0, T = S.clone().add(O + (D ? -1 : 1), f); return +(-(O + (C - x) / (D ? x - T : T - x)) || 0); }, a: function(E) { return E < 0 ? Math.ceil(E) || 0 : Math.floor(E); }, p: function(E) { return { M: f, 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] = v; var W = function(E) { return E instanceof Nt; }, Vt = function E(S, C, O) { var x; if (!S) return X; if (typeof S == "string") { var D = S.toLowerCase(); G[D] && (x = D), C && (G[D] = C, x = D); var T = S.split("-"); if (!x && T.length > 1) return E(T[0]); } else { var H = S.name; G[H] = S, x = H; } return !O && x && (X = x), x || !O && X; }, K = function(E, S) { if (W(E)) return E.clone(); var C = typeof S == "object" ? S : {}; return C.date = E, C.args = arguments, new Nt(C); }, I = Q; I.l = Vt, I.i = W, I.w = function(E, S) { return K(E, { locale: S.$L, utc: S.$u, x: S.$x, $offset: S.$offset }); }; var Nt = function() { function E(C) { this.$L = Vt(C.locale, null, !0), this.parse(C); } var S = E.prototype; return S.parse = function(C) { this.$d = function(O) { var x = O.date, D = O.utc; if (x === null) return /* @__PURE__ */ new Date(NaN); if (I.u(x)) return /* @__PURE__ */ new Date(); if (x instanceof Date) return new Date(x); if (typeof x == "string" && !/Z$/i.test(x)) { var T = x.match(M); if (T) { var H = T[2] - 1 || 0, R = (T[7] || "0").substring(0, 3); return D ? new Date(Date.UTC(T[1], H, T[3] || 1, T[4] || 0, T[5] || 0, T[6] || 0, R)) : new Date(T[1], H, T[3] || 1, T[4] || 0, T[5] || 0, T[6] || 0, R); } } return new Date(x); }(C), this.$x = C.x || {}, this.init(); }, S.init = function() { var C = this.$d; this.$y = C.getFullYear(), this.$M = C.getMonth(), this.$D = C.getDate(), this.$W = C.getDay(), this.$H = C.getHours(), this.$m = C.getMinutes(), this.$s = C.getSeconds(), this.$ms = C.getMilliseconds(); }, S.$utils = function() { return I; }, S.isValid = function() { return this.$d.toString() !== k; }, S.isSame = function(C, O) { var x = K(C); return this.startOf(O) <= x && x <= this.endOf(O); }, S.isAfter = function(C, O) { return K(C) < this.startOf(O); }, S.isBefore = function(C, O) { return this.endOf(O) < K(C); }, S.$g = function(C, O, x) { return I.u(C) ? this[O] : this.set(x, C); }, S.unix = function() { return Math.floor(this.valueOf() / 1e3); }, S.valueOf = function() { return this.$d.getTime(); }, S.startOf = function(C, O) { var x = this, D = !!I.u(O) || O, T = I.p(C), H = function(Pt, it) { var st = I.w(x.$u ? Date.UTC(x.$y, it, Pt) : new Date(x.$y, it, Pt), x); return D ? st : st.endOf(h); }, R = function(Pt, it) { return I.w(x.toDate()[Pt].apply(x.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(it)), x); }, U = this.$W, P = this.$M, ct = this.$D, pt = "set" + (this.$u ? "UTC" : ""); switch (T) { case p: return D ? H(1, 0) : H(31, 11); case f: return D ? H(1, P) : H(0, P + 1); case c: var Xt = this.$locale().weekStart || 0, Rt = (U < Xt ? U + 7 : U) - Xt; return H(D ? ct - Rt : ct + (6 - Rt), 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(); } }, S.endOf = function(C) { return this.startOf(C, !1); }, S.$set = function(C, O) { var x, D = I.p(C), T = "set" + (this.$u ? "UTC" : ""), H = (x = {}, x[h] = T + "Date", x[_] = T + "Date", x[f] = T + "Month", x[p] = T + "FullYear", x[l] = T + "Hours", x[a] = T + "Minutes", x[s] = T + "Seconds", x[o] = T + "Milliseconds", x)[D], R = D === h ? this.$D + (O - this.$W) : O; if (D === f || 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; }, S.set = function(C, O) { return this.clone().$set(C, O); }, S.get = function(C) { return this[I.p(C)](); }, S.add = function(C, O) { var x, D = this; C = Number(C); var T = I.p(O), H = function(P) { var ct = K(D); return I.w(ct.date(ct.date() + Math.round(P * C)), D); }; if (T === f) return this.set(f, this.$M + C); if (T === p) return this.set(p, this.$y + C); if (T === h) return H(1); if (T === c) return H(7); var R = (x = {}, x[a] = r, x[l] = n, x[s] = i, x)[T] || 1, U = this.$d.getTime() + C * R; return I.w(U, this); }, S.subtract = function(C, O) { return this.add(-1 * C, O); }, S.format = function(C) { var O = this, x = this.$locale(); if (!this.isValid()) return x.invalidDate || k; var D = C || "YYYY-MM-DDTHH:mm:ssZ", T = I.z(this), H = this.$H, R = this.$m, U = this.$M, P = x.weekdays, ct = x.months, pt = function(it, st, St, Kt) { return it && (it[st] || it(O, D)) || St[st].slice(0, Kt); }, Xt = function(it) { return I.s(H % 12 || 12, it, "0"); }, Rt = x.meridiem || function(it, st, St) { var Kt = it < 12 ? "AM" : "PM"; return St ? Kt.toLowerCase() : Kt; }, Pt = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: U + 1, MM: I.s(U + 1, 2, "0"), MMM: pt(x.monthsShort, U, ct, 3), MMMM: pt(ct, U), D: this.$D, DD: I.s(this.$D, 2, "0"), d: String(this.$W), dd: pt(x.weekdaysMin, this.$W, P, 2), ddd: pt(x.weekdaysShort, this.$W, P, 3), dddd: P[this.$W], H: String(H), HH: I.s(H, 2, "0"), h: Xt(1), hh: Xt(2), a: Rt(H, R, !0), A: Rt(H, R, !1), m: String(R), mm: I.s(R, 2, "0"), s: String(this.$s), ss: I.s(this.$s, 2, "0"), SSS: I.s(this.$ms, 3, "0"), Z: T }; return D.replace(q, function(it, st) { return st || Pt[it] || T.replace(":", ""); }); }, S.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, S.diff = function(C, O, x) { var D, T = I.p(O), H = K(C), R = (H.utcOffset() - this.utcOffset()) * r, U = this - H, P = I.m(this, H); return P = (D = {}, D[p] = P / 12, D[f] = 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)[T] || U, x ? P : I.a(P); }, S.daysInMonth = function() { return this.endOf(f).$D; }, S.$locale = function() { return G[this.$L]; }, S.locale = function(C, O) { if (!C) return this.$L; var x = this.clone(), D = Vt(C, O, !0); return D && (x.$L = D), x; }, S.clone = function() { return I.w(this.$d, this); }, S.toDate = function() { return new Date(this.valueOf()); }, S.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, S.toISOString = function() { return this.$d.toISOString(); }, S.toString = function() { return this.$d.toUTCString(); }, E; }(), At = Nt.prototype; return K.prototype = At, [["$ms", o], ["$s", s], ["$m", a], ["$H", l], ["$W", h], ["$M", f], ["$y", p], ["$D", _]].forEach(function(E) { At[E[1]] = function(S) { return this.$g(S, E[0], E[1]); }; }), K.extend = function(E, S) { return E.$i || (E(S, Nt, K), E.$i = !0), K; }, K.locale = Vt, K.isDayjs = W, K.unix = function(E) { return K(1e3 * E); }, K.en = G[X], K.Ls = G, K.p = {}, K; }); })(As); var lh = As.exports; const hh = /* @__PURE__ */ ah(lh), Wt = { trace: 0, debug: 1, info: 2, warn: 3, error: 4, fatal: 5 }, L = { trace: (...t) => { }, debug: (...t) => { }, info: (...t) => { }, warn: (...t) => { }, error: (...t) => { }, fatal: (...t) => { } }, bn = function(t = "fatal") { let e = Wt.fatal; typeof t == "string" ? (t = t.toLowerCase(), t in Wt && (e = Wt[t])) : typeof t == "number" && (e = t), L.trace = () => { }, L.debug = () => { }, L.info = () => { }, L.warn = () => { }, L.error = () => { }, L.fatal = () => { }, e <= Wt.fatal && (L.fatal = console.error ? console.error.bind(console, yt("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", yt("FATAL"))), e <= Wt.error && (L.error = console.error ? console.error.bind(console, yt("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", yt("ERROR"))), e <= Wt.warn && (L.warn = console.warn ? console.warn.bind(console, yt("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", yt("WARN"))), e <= Wt.info && (L.info = console.info ? console.info.bind(console, yt("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", yt("INFO"))), e <= Wt.debug && (L.debug = console.debug ? console.debug.bind(console, yt("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("DEBUG"))), e <= Wt.trace && (L.trace = console.debug ? console.debug.bind(console, yt("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("TRACE"))); }, yt = (t) => `%c${hh().format("ss.SSS")} : ${t} : `; var Tn = {}; Object.defineProperty(Tn, "__esModule", { value: !0 }); var Es = Tn.sanitizeUrl = void 0, ch = /^([^\w]*)(javascript|data|vbscript)/im, uh = /&#(\w+)(^\w|;)?/g, fh = /&(newline|tab);/gi, dh = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, ph = /^.+(:|&colon;)/gim, gh = [".", "/"]; function mh(t) { return gh.indexOf(t[0]) > -1; } function _h(t) { return t.replace(uh, function(e, i) { return String.fromCharCode(i); }); } function yh(t) { var e = _h(t || "").replace(fh, "").replace(dh, "").trim(); if (!e) return "about:blank"; if (mh(e)) return e; var i = e.match(ph); if (!i) return e; var r = i[0]; return ch.test(r) ? "about:blank" : e; } Es = Tn.sanitizeUrl = yh; var Ch = { value: () => { } }; function Ms() { 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 Fi(i); } function Fi(t) { this._ = t; } function xh(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 }; }); } Fi.prototype = Ms.prototype = { constructor: Fi, on: function(t, e) { var i = this._, r = xh(t + "", i), n, o = -1, s = r.length; if (arguments.length < 2) { for (; ++o < s; ) if ((n = (t = r[o]).type) && (n = bh(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] = yo(i[n], t.name, e); else if (e == null) for (n in i) i[n] = yo(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 Fi(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 bh(t, e) { for (var i = 0, r = t.length, n; i < r; ++i) if ((n = t[i]).name === e) return n.value; } function yo(t, e, i) { for (var r = 0, n = t.length; r < n; ++r) if (t[r].name === e) { t[r] = Ch, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return i != null && t.push({ name: e, value: i }), t; } var Zr = "http://www.w3.org/1999/xhtml"; const Co = { svg: "http://www.w3.org/2000/svg", xhtml: Zr, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function ar(t) { var e = t += "", i = e.indexOf(":"); return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), Co.hasOwnProperty(e) ? { space: Co[e], local: t } : t; } function Th(t) { return function() { var e = this.ownerDocument, i = this.namespaceURI; return i === Zr && e.documentElement.namespaceURI === Zr ? e.createElement(t) : e.createElementNS(i, t); }; } function Sh(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Os(t) { var e = ar(t); return (e.local ? Sh : Th)(e); } function vh() { } function Sn(t) { return t == null ? vh : function() { return this.querySelector(t); }; } function kh(t) { typeof t != "function" && (t = Sn(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 wh(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function Bh() { return []; } function $s(t) { return t == null ? Bh : function() { return this.querySelectorAll(t); }; } function Fh(t) { return function() { return wh(t.apply(this, arguments)); }; } function Lh(t) { typeof t == "function" ? t = Fh(t) : t = $s(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 Is(t) { return function() { return this.matches(t); }; } function Ds(t) { return function(e) { return e.matches(t); }; } var Ah = Array.prototype.find; function Eh(t) { return function() { return Ah.call(this.children, t); }; } function Mh() { return this.firstElementChild; } function Oh(t) { return this.select(t == null ? Mh : Eh(typeof t == "function" ? t : Ds(t))); } var $h = Array.prototype.filter; function Ih() { return Array.from(this.children); } function Dh(t) { return function() { return $h.call(this.children, t); }; } function Nh(t) { return this.selectAll(t == null ? Ih : Dh(typeof t == "function" ? t : Ds(t))); } function Rh(t) { typeof t != "function" && (t = Is(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 Ns(t) { return new Array(t.length); } function Ph() { return new mt(this._enter || this._groups.map(Ns), this._parents); } function Ri(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ri.prototype = { constructor: Ri, 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 qh(t) { return function() { return t; }; } function zh(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 Ri(t, o[s]); for (; s < l; ++s) (a = e[s]) && (n[s] = a); } function Wh(t, e, i, r, n, o, s) { var a, l, h = /* @__PURE__ */ new Map(), c = e.length, f = 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 < f; ++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 Ri(t, o[a]); for (a = 0; a < c; ++a) (l = e[a]) && h.get(g[a]) === l && (n[a] = l); } function Hh(t) { return t.__data__; } function jh(t, e) { if (!arguments.length) return Array.from(this, Hh); var i = e ? Wh : zh, r = this._parents, n = this._groups; typeof t != "function" && (t = qh(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], f = n[h], g = f.length, p = Uh(t.call(c, c && c.__data__, h, r)), _ = p.length, k = a[h] = new Array(_), M = s[h] = new Array(_), q = l[h] = new Array(g); i(c, f, k, M, q, p, e); for (var v = 0, z = 0, Q, X; v < _; ++v) if (Q = k[v]) { for (v >= z && (z = v + 1); !(X = M[z]) && ++z < _; ) ; Q._next = X || null; } } return s = new mt(s, r), s._enter = a, s._exit = l, s; } function Uh(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Yh() { return new mt(this._exit || this._groups.map(Ns), this._parents); } function Gh(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 Vh(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], f = h.length, g = a[l] = new Array(f), p, _ = 0; _ < f; ++_) (p = h[_] || c[_]) && (g[_] = p); for (; l < n; ++l) a[l] = i[l]; return new mt(a, this._parents); } function Xh() { 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 Kh(t) { t || (t = Zh); function e(f, g) { return f && g ? t(f.__data__, g.__data__) : !f - !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 Zh(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function Jh() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function Qh() { return Array.from(this); } function tc() { 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 ec() { let t = 0; for (const e of this) ++t; return t; } function ic() { return !this.node(); } function rc(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 nc(t) { return function() { this.removeAttribute(t); }; } function oc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function sc(t, e) { return function() { this.setAttribute(t, e); }; } function ac(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function lc(t, e) { return function() { var i = e.apply(this, arguments); i == null ? this.removeAttribute(t) : this.setAttribute(t, i); }; } function hc(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 cc(t, e) { var i = ar(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 ? oc : nc : typeof e == "function" ? i.local ? hc : lc : i.local ? ac : sc)(i, e)); } function Rs(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function uc(t) { return function() { this.style.removeProperty(t); }; } function fc(t, e, i) { return function() { this.style.setProperty(t, e, i); }; } function dc(t, e, i) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i); }; } function pc(t, e, i) { return arguments.length > 1 ? this.each((e == null ? uc : typeof e == "function" ? dc : fc)(t, e, i ?? "")) : Fe(this.node(), t); } function Fe(t, e) { return t.style.getPropertyValue(e) || Rs(t).getComputedStyle(t, null).getPropertyValue(e); } function gc(t) { return function() { delete this[t]; }; } function mc(t, e) { return function() { this[t] = e; }; } function _c(t, e) { return function() { var i = e.apply(this, arguments); i == null ? delete this[t] : this[t] = i; }; } function yc(t, e) { return arguments.length > 1 ? this.each((e == null ? gc : typeof e == "function" ? _c : mc)(t, e)) : this.node()[t]; } function Ps(t) { return t.trim().split(/^|\s+/); } function vn(t) { return t.classList || new qs(t); } function qs(t) { this._node = t, this._names = Ps(t.getAttribute("class") || ""); } qs.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 zs(t, e) { for (var i = vn(t), r = -1, n = e.length; ++r < n; ) i.add(e[r]); } function Ws(t, e) { for (var i = vn(t), r = -1, n = e.length; ++r < n; ) i.remove(e[r]); } function Cc(t) { return function() { zs(this, t); }; } function xc(t) { return function() { Ws(this, t); }; } function bc(t, e) { return function() { (e.apply(this, arguments) ? zs : Ws)(this, t); }; } function Tc(t, e) { var i = Ps(t + ""); if (arguments.length < 2) { for (var r = vn(this.node()), n = -1, o = i.length; ++n < o; ) if (!r.contains(i[n])) return !1; return !0; } return this.each((typeof e == "function" ? bc : e ? Cc : xc)(i, e)); } function Sc() { this.textContent = ""; } function vc(t) { return function() { this.textContent = t; }; } function kc(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function wc(t) { return arguments.length ? this.each(t == null ? Sc : (typeof t == "function" ? kc : vc)(t)) : this.node().textContent; } function Bc() { this.innerHTML = ""; } function Fc(t) { return function() { this.innerHTML = t; }; } function Lc(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function Ac(t) { return arguments.length ? this.each(t == null ? Bc : (typeof t == "function" ? Lc : Fc)(t)) : this.node().innerHTML; } function Ec() { this.nextSibling && this.parentNode.appendChild(this); } function Mc() { return this.each(Ec); } function Oc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function $c() { return this.each(Oc); } function Ic(t) { var e = typeof t == "function" ? t : Os(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function Dc() { return null; } function Nc(t, e) { var i = typeof t == "function" ? t : Os(t), r = e == null ? Dc : typeof e == "function" ? e : Sn(e); return this.select(function() { return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null); }); } function Rc() { var t = this.parentNode; t && t.removeChild(this); } function Pc() { return this.each(Rc); } function qc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function zc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Wc(t) { return this.select(t ? zc : qc); } function Hc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function jc(t) { return function(e) { t.call(this, e, this.__data__); }; } function Uc(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 Yc(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 Gc(t, e, i) { return function() { var r = this.__on, n, o = jc(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 Vc(t, e, i) { var r = Uc(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 ? Gc : Yc, n = 0; n < o; ++n) this.each(a(r[n], e, i)); return this; } function Hs(t, e, i) { var r = Rs(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 Xc(t, e) { return function() { return Hs(this, t, e); }; } function Kc(t, e) { return function() { return Hs(this, t, e.apply(this, arguments)); }; } function Zc(t, e) { return this.each((typeof e == "function" ? Kc : Xc)(t, e)); } function* Jc() { 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 js = [null]; function mt(t, e) { this._groups = t, this._parents = e; } function li() { return new mt([[document.documentElement]], js); } function Qc() { return this; } mt.prototype = li.prototype = { constructor: mt, select: kh, selectAll: Lh, selectChild: Oh, selectChildren: Nh, filter: Rh, data: jh, enter: Ph, exit: Yh, join: Gh, merge: Vh, selection: Qc, order: Xh, sort: Kh, call: Jh, nodes: Qh, node: tc, size: ec, empty: ic, each: rc, attr: cc, style: pc, property: yc, classed: Tc, text: wc, html: Ac, raise: Mc, lower: $c, append: Ic, insert: Nc, remove: Pc, clone: Wc, datum: Hc, on: Vc, dispatch: Zc, [Symbol.iterator]: Jc }; function Ct(t) { return typeof t == "string" ? new mt([[document.querySelector(t)]], [document.documentElement]) : new mt([[t]], js); } function kn(t, e, i) { t.prototype = e.prototype = i, i.constructor = t; } function Us(t, e) { var i = Object.create(t.prototype); for (var r in e) i[r] = e[r]; return i; } function hi() { } var Ze = 0.7, Pi = 1 / Ze, Be = "\\s*([+-]?\\d+)\\s*", Je = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Mt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tu = /^#([0-9a-f]{3,8})$/, eu = new RegExp(`^rgb\\(${Be},${Be},${Be}\\)$`), iu = new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`), ru = new RegExp(`^rgba\\(${Be},${Be},${Be},${Je}\\)$`), nu = new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${Je}\\)$`), ou = new RegExp(`^hsl\\(${Je},${Mt},${Mt}\\)$`), su = new RegExp(`^hsla\\(${Je},${Mt},${Mt},${Je}\\)$`), xo = { 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 }; kn(hi, Qe, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: bo, // Deprecated! Use color.formatHex. formatHex: bo, formatHex8: au, formatHsl: lu, formatRgb: To, toString: To }); function bo() { return this.rgb().formatHex(); } function au() { return this.rgb().formatHex8(); } function lu() { return Ys(this).formatHsl(); } function To() { return this.rgb().formatRgb(); } function Qe(t) { var e, i; return t = (t + "").trim().toLowerCase(), (e = tu.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? So(e) : i === 3 ? new ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? Ci(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? Ci(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 = eu.exec(t)) ? new ft(e[1], e[2], e[3], 1) : (e = iu.exec(t)) ? new ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ru.exec(t)) ? Ci(e[1], e[2], e[3], e[4]) : (e = nu.exec(t)) ? Ci(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = ou.exec(t)) ? wo(e[1], e[2] / 100, e[3] / 100, 1) : (e = su.exec(t)) ? wo(e[1], e[2] / 100, e[3] / 100, e[4]) : xo.hasOwnProperty(t) ? So(xo[t]) : t === "transparent" ? new ft(NaN, NaN, NaN, 0) : null; } function So(t) { return new ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function Ci(t, e, i, r) { return r <= 0 && (t = e = i = NaN), new ft(t, e, i, r); } function hu(t) { return t instanceof hi || (t = Qe(t)), t ? (t = t.rgb(), new ft(t.r, t.g, t.b, t.opacity)) : new ft(); } function Jr(t, e, i, r) { return arguments.length === 1 ? hu(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; } kn(ft, Jr, Us(hi, { brighter(t) { return t = t == null ? Pi : Math.pow(Pi, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Ze : Math.pow(Ze, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new ft(he(this.r), he(this.g), he(this.b), qi(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: vo, // Deprecated! Use color.formatHex. formatHex: vo, formatHex8: cu, formatRgb: ko, toString: ko })); function vo() { return `#${le(this.r)}${le(this.g)}${le(this.b)}`; } function cu() { return `#${le(this.r)}${le(this.g)}${le(this.b)}${le((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function ko() { const t = qi(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${he(this.r)}, ${he(this.g)}, ${he(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function qi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function he(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function le(t) { return t = he(t), (t < 16 ? "0" : "") + t.toString(16); } function wo(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 Ys(t) { if (t instanceof kt) return new kt(t.h, t.s, t.l, t.opacity); if (t instanceof hi || (t = Qe(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 uu(t, e, i, r) { return arguments.length === 1 ? Ys(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; } kn(kt, uu, Us(hi, { brighter(t) { return t = t == null ? Pi : Math.pow(Pi, t), new kt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Ze : Math.pow(Ze, 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( Ir(t >= 240 ? t - 240 : t + 120, n, r), Ir(t, n, r), Ir(t < 120 ? t + 240 : t - 120, n, r), this.opacity ); }, clamp() { return new kt(Bo(this.h), xi(this.s), xi(this.l), qi(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 = qi(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Bo(this.h)}, ${xi(this.s) * 100}%, ${xi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Bo(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function xi(t) { return Math.max(0, Math.min(1, t || 0)); } function Ir(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 wn = (t) => () => t; function Gs(t, e) { return function(i) { return t + i * e; }; } function fu(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 Zb(t, e) { var i = e - t; return i ? Gs(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : wn(isNaN(t) ? e : t); } function du(t) { return (t = +t) == 1 ? Vs : function(e, i) { return i - e ? fu(e, i, t) : wn(isNaN(e) ? i : e); }; } function Vs(t, e) { var i = e - t; return i ? Gs(t, i) : wn(isNaN(t) ? e : t); } const Fo = function t(e) { var i = du(e); function r(n, o) { var s = i((n = Jr(n)).r, (o = Jr(o)).r), a = i(n.g, o.g), l = i(n.b, o.b), h = Vs(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 Qt(t, e) { return t = +t, e = +e, function(i) { return t * (1 - i) + e * i; }; } var Qr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Dr = new RegExp(Qr.source, "g"); function pu(t) { return function() { return t; }; } function gu(t) { return function(e) { return t(e) + ""; }; } function mu(t, e) { var i = Qr.lastIndex = Dr.lastIndex = 0, r, n, o, s = -1, a = [], l = []; for (t = t + "", e = e + ""; (r = Qr.exec(t)) && (n = Dr.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: Qt(r, n) })), i = Dr.lastIndex; return i < e.length && (o = e.slice(i), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? gu(l[0].x) : pu(e) : (e = l.length, function(h) { for (var c = 0, f; c < e; ++c) a[(f = l[c]).i] = f.x(h); return a.join(""); }); } var Lo = 180 / Math.PI, tn = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function Xs(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) * Lo, skewX: Math.atan(l) * Lo, scaleX: s, scaleY: a }; } var bi; function _u(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? tn : Xs(e.a, e.b, e.c, e.d, e.e, e.f); } function yu(t) { return t == null || (bi || (bi = document.createElementNS("http://www.w3.org/2000/svg", "g")), bi.setAttribute("transform", t), !(t = bi.transform.baseVal.consolidate())) ? tn : (t = t.matrix, Xs(t.a, t.b, t.c, t.d, t.e, t.f)); } function Ks(t, e, i, r) { function n(h) { return h.length ? h.pop() + " " : ""; } function o(h, c, f, g, p, _) { if (h !== f || c !== g) { var k = p.push("translate(", null, e, null, i); _.push({ i: k - 4, x: Qt(h, f) }, { i: k - 2, x: Qt(c, g) }); } else (f || g) && p.push("translate(" + f + e + g + i); } function s(h, c, f, g) { h !== c ? (h - c > 180 ? c += 360 : c - h > 180 && (h += 360), g.push({ i: f.push(n(f) + "rotate(", null, r) - 2, x: Qt(h, c) })) : c && f.push(n(f) + "rotate(" + c + r); } function a(h, c, f, g) { h !== c ? g.push({ i: f.push(n(f) + "skewX(", null, r) - 2, x: Qt(h, c) }) : c && f.push(n(f) + "skewX(" + c + r); } function l(h, c, f, g, p, _) { if (h !== f || c !== g) { var k = p.push(n(p) + "scale(", null, ",", null, ")"); _.push({ i: k - 4, x: Qt(h, f) }, { i: k - 2, x: Qt(c, g) }); } else (f !== 1 || g !== 1) && p.push(n(p) + "scale(" + f + "," + g + ")"); } return function(h, c) { var f = [], g = []; return h = t(h), c = t(c), o(h.translateX, h.translateY, c.translateX, c.translateY, f, g), s(h.rotate, c.rotate, f, g), a(h.skewX, c.skewX, f, g), l(h.scaleX, h.scaleY, c.scaleX, c.scaleY, f, g), h = c = null, function(p) { for (var _ = -1, k = g.length, M; ++_ < k; ) f[(M = g[_]).i] = M.x(p); return f.join(""); }; }; } var Cu = Ks(_u, "px, ", "px)", "deg)"), xu = Ks(yu, ", ", ")", ")"), Le = 0, We = 0, Re = 0, Zs = 1e3, zi, He, Wi = 0, fe = 0, lr = 0, ti = typeof performance == "object" && performance.now ? performance : Date, Js = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Bn() { return fe || (Js(bu), fe = ti.now() + lr); } function bu() { fe = 0; } function Hi() { this._call = this._time = this._next = null; } Hi.prototype = Qs.prototype = { constructor: Hi, restart: function(t, e, i) { if (typeof t != "function") throw new TypeError("callback is not a function"); i = (i == null ? Bn() : +i) + (e == null ? 0 : +e), !this._next && He !== this && (He ? He._next = this : zi = this, He = this), this._call = t, this._time = i, en(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, en()); } }; function Qs(t, e, i) { var r = new Hi(); return r.restart(t, e, i), r; } function Tu() { Bn(), ++Le; for (var t = zi, e; t; ) (e = fe - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --Le; } function Ao() { fe = (Wi = ti.now()) + lr, Le = We = 0; try { Tu(); } finally { Le = 0, vu(), fe = 0; } } function Su() { var t = ti.now(), e = t - Wi; e > Zs && (lr -= e, Wi = t); } function vu() { for (var t, e = zi, 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 : zi = i); He = t, en(r); } function en(t) { if (!Le) { We && (We = clearTimeout(We)); var e = t - fe; e > 24 ? (t < 1 / 0 && (We = setTimeout(Ao, t - ti.now() - lr)), Re && (Re = clearInterval(Re))) : (Re || (Wi = ti.now(), Re = setInterval(Su, Zs)), Le = 1, Js(Ao)); } } function Eo(t, e, i) { var r = new Hi(); return e = e == null ? 0 : +e, r.restart((n) => { r.stop(), t(n + e); }, e, i), r; } var ku = Ms("start", "end", "cancel", "interrupt"), wu = [], ta = 0, Mo = 1, rn = 2, Li = 3, Oo = 4, nn = 5, Ai = 6; function hr(t, e, i, r, n, o) { var s = t.__transition; if (!s) t.__transition = {}; else if (i in s) return; Bu(t, i, { name: e, index: r, // For context during callback. group: n, // For context during callback. on: ku, tween: wu, time: o.time, delay: o.delay, duration: o.duration, ease: o.ease, timer: null, state: ta }); } function Fn(t, e) { var i = Lt(t, e); if (i.state > ta) throw new Error("too late; already scheduled"); return i; } function It(t, e) { var i = Lt(t, e); if (i.state > Li) throw new Error("too late; already running"); return i; } function Lt(t, e) { var i = t.__transition; if (!i || !(i = i[e])) throw new Error("transition not found"); return i; } function Bu(t, e, i) { var r = t.__transition, n; r[e] = i, i.timer = Qs(o, 0, i.time); function o(h) { i.state = Mo, i.timer.restart(s, i.delay, i.time), i.delay <= h && s(h - i.delay); } function s(h) { var c, f, g, p; if (i.state !== Mo) return l(); for (c in r) if (p = r[c], p.name === i.name) { if (p.state === Li) return Eo(s); p.state === Oo ? (p.state = Ai, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < e && (p.state = Ai, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]); } if (Eo(function() { i.state === Li && (i.state = Oo, i.timer.restart(a, i.delay, i.time), a(h)); }), i.state = rn, i.on.call("start", t, t.__data__, i.index, i.group), i.state === rn) { for (i.state = Li, n = new Array(g = i.tween.length), c = 0, f = -1; c < g; ++c) (p = i.tween[c].value.call(t, t.__data__, i.index, i.group)) && (n[++f] = p); n.length = f + 1; } } function a(h) { for (var c = h < i.duration ? i.ease.call(null, h / i.duration) : (i.timer.restart(l), i.state = nn, 1), f = -1, g = n.length; ++f < g; ) n[f].call(t, c); i.state === nn && (i.on.call("end", t, t.__data__, i.index, i.group), l()); } function l() { i.state = Ai, i.timer.stop(), delete r[e]; for (var h in r) return; delete t.__transition; } } function Fu(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 > rn && r.state < nn, r.state = Ai, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s]; } o && delete t.__transition; } } function Lu(t) { return this.each(function() { Fu(this, t); }); } function Au(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 Eu(t, e, i) { var r, n; if (typeof i != "function") throw new Error(); return function() { var o = It(this, t), s = o