UNPKG

@mermaid-js/mermaid-mindmap

Version:

Mindmap diagram module for MermaidJS.

1,535 lines 726 kB
var Ri = function() { var t = function(b, p, m, y) { for (m = m || {}, y = b.length; y--; m[b[y]] = p) ; return m; }, e = [1, 7], r = [1, 9], n = [1, 10], a = [1, 14], i = [1, 13], s = [1, 19], o = [1, 20], u = [6, 9], l = [1, 7, 12, 13, 16, 19], f = [1, 28], c = [1, 29], v = [1, 6, 7, 9, 12, 13, 16, 19], h = { trace: function() { }, yy: {}, symbols_: { error: 2, start: 3, MINDMAP: 4, document: 5, NL: 6, SPACELIST: 7, stop: 8, EOF: 9, statement: 10, node: 11, ICON: 12, CLASS: 13, nodeWithId: 14, nodeWithoutId: 15, NODE_DSTART: 16, NODE_DESCR: 17, NODE_DEND: 18, NODE_ID: 19, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "MINDMAP", 6: "NL", 7: "SPACELIST", 9: "EOF", 12: "ICON", 13: "CLASS", 16: "NODE_DSTART", 17: "NODE_DESCR", 18: "NODE_DEND", 19: "NODE_ID" }, productions_: [0, [3, 2], [3, 3], [3, 3], [8, 1], [8, 1], [8, 2], [8, 2], [5, 3], [5, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [11, 1], [11, 1], [15, 3], [14, 1], [14, 4]], performAction: function(p, m, y, E, C, D, w) { var T = D.length - 1; switch (C) { case 1: case 2: case 3: return E; case 4: E.getLogger().trace("Stop NL "); break; case 5: E.getLogger().trace("Stop EOF "); break; case 6: E.getLogger().trace("Stop NL2 "); break; case 7: E.getLogger().trace("Stop EOF2 "); break; case 10: E.getLogger().trace("Node: ", D[T].id), E.addNode(D[T - 1].length, D[T].id, D[T].descr, D[T].type); break; case 11: E.getLogger().trace("Icon: ", D[T]), E.decorateNode({ icon: D[T] }); break; case 12: case 15: E.decorateNode({ class: D[T] }); break; case 13: E.getLogger().trace("Node: ", D[T].id), E.addNode(0, D[T].id, D[T].descr, D[T].type); break; case 14: E.decorateNode({ icon: D[T] }); break; case 19: E.getLogger().trace("node found ..", D[T - 2]), this.$ = { id: D[T - 1], descr: D[T - 1], type: E.getType(D[T - 2], D[T]) }; break; case 20: this.$ = { id: D[T], descr: D[T], type: E.nodeType.DEFAULT }; break; case 21: E.getLogger().trace("node found ..", D[T - 3]), this.$ = { id: D[T - 3], descr: D[T - 1], type: E.getType(D[T - 2], D[T]) }; break; } }, table: [{ 3: 1, 4: [1, 2], 7: [1, 3] }, { 1: [3] }, { 5: 4, 6: [1, 5], 7: e, 10: 6, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, { 4: [1, 15] }, { 1: [2, 1], 7: e, 10: 16, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, { 5: 17, 7: e, 10: 6, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, { 6: s, 8: 18, 9: o }, t(u, [2, 16], { 14: 11, 15: 12, 11: 21, 12: [1, 22], 13: [1, 23], 16: a, 19: i }), t(u, [2, 13]), t(u, [2, 14]), t(u, [2, 15]), t(u, [2, 17]), t(u, [2, 18]), t(u, [2, 20], { 16: [1, 24] }), { 17: [1, 25] }, { 5: 26, 7: e, 10: 6, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, { 6: s, 8: 27, 9: o }, { 1: [2, 2], 7: e, 10: 16, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, t(l, [2, 9], { 6: f, 9: c }), t(v, [2, 4]), t(v, [2, 5]), t(u, [2, 10]), t(u, [2, 11]), t(u, [2, 12]), { 17: [1, 30] }, { 18: [1, 31] }, { 1: [2, 3], 7: e, 10: 16, 11: 8, 12: r, 13: n, 14: 11, 15: 12, 16: a, 19: i }, t(l, [2, 8], { 6: f, 9: c }), t(v, [2, 6]), t(v, [2, 7]), { 18: [1, 32] }, t(u, [2, 19]), t(u, [2, 21])], defaultActions: {}, parseError: function(p, m) { if (m.recoverable) this.trace(p); else { var y = new Error(p); throw y.hash = m, y; } }, parse: function(p) { var m = this, y = [0], E = [], C = [null], D = [], w = this.table, T = "", x = 0, S = 0, L = 2, A = 1, O = D.slice.call(arguments, 1), N = Object.create(this.lexer), R = { yy: {} }; for (var I in this.yy) Object.prototype.hasOwnProperty.call(this.yy, I) && (R.yy[I] = this.yy[I]); N.setInput(p, R.yy), R.yy.lexer = N, R.yy.parser = this, typeof N.yylloc > "u" && (N.yylloc = {}); var k = N.yylloc; D.push(k); var P = N.options && N.options.ranges; typeof R.yy.parseError == "function" ? this.parseError = R.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function B() { var Z; return Z = E.pop() || N.lex() || A, typeof Z != "number" && (Z instanceof Array && (E = Z, Z = E.pop()), Z = m.symbols_[Z] || Z), Z; } for (var _, F, G, z, V = {}, U, Y, $, X; ; ) { if (F = y[y.length - 1], this.defaultActions[F] ? G = this.defaultActions[F] : ((_ === null || typeof _ > "u") && (_ = B()), G = w[F] && w[F][_]), typeof G > "u" || !G.length || !G[0]) { var K = ""; X = []; for (U in w[F]) this.terminals_[U] && U > L && X.push("'" + this.terminals_[U] + "'"); N.showPosition ? K = "Parse error on line " + (x + 1) + `: ` + N.showPosition() + ` Expecting ` + X.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : K = "Parse error on line " + (x + 1) + ": Unexpected " + (_ == A ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(K, { text: N.match, token: this.terminals_[_] || _, line: N.yylineno, loc: k, expected: X }); } if (G[0] instanceof Array && G.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + F + ", token: " + _); switch (G[0]) { case 1: y.push(_), C.push(N.yytext), D.push(N.yylloc), y.push(G[1]), _ = null, S = N.yyleng, T = N.yytext, x = N.yylineno, k = N.yylloc; break; case 2: if (Y = this.productions_[G[1]][1], V.$ = C[C.length - Y], V._$ = { first_line: D[D.length - (Y || 1)].first_line, last_line: D[D.length - 1].last_line, first_column: D[D.length - (Y || 1)].first_column, last_column: D[D.length - 1].last_column }, P && (V._$.range = [ D[D.length - (Y || 1)].range[0], D[D.length - 1].range[1] ]), z = this.performAction.apply(V, [ T, S, x, R.yy, G[1], C, D ].concat(O)), typeof z < "u") return z; Y && (y = y.slice(0, -1 * Y * 2), C = C.slice(0, -1 * Y), D = D.slice(0, -1 * Y)), y.push(this.productions_[G[1]][0]), C.push(V.$), D.push(V._$), $ = w[y[y.length - 2]][y[y.length - 1]], y.push($); break; case 3: return !0; } } return !0; } }, d = function() { var b = { EOF: 1, parseError: function(m, y) { if (this.yy.parser) this.yy.parser.parseError(m, y); else throw new Error(m); }, setInput: function(p, m) { return this.yy = m || this.yy || {}, this._input = p, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, input: function() { var p = this._input[0]; this.yytext += p, this.yyleng++, this.offset++, this.match += p, this.matched += p; var m = p.match(/(?:\r\n?|\n).*/g); return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), p; }, unput: function(p) { var m = p.length, y = p.split(/(?:\r\n?|\n)/g); this._input = p + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m; var E = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), y.length - 1 && (this.yylineno -= y.length - 1); var C = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: y ? (y.length === E.length ? this.yylloc.first_column : 0) + E[E.length - y.length].length - y[0].length : this.yylloc.first_column - m }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this; }, more: function() { return this._more = !0, this; }, reject: function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, less: function(p) { this.unput(this.match.slice(p)); }, pastInput: function() { var p = this.matched.substr(0, this.matched.length - this.match.length); return (p.length > 20 ? "..." : "") + p.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var p = this.match; return p.length < 20 && (p += this._input.substr(0, 20 - p.length)), (p.substr(0, 20) + (p.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var p = this.pastInput(), m = new Array(p.length + 1).join("-"); return p + this.upcomingInput() + ` ` + m + "^"; }, test_match: function(p, m) { var y, E, C; if (this.options.backtrack_lexer && (C = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (C.yylloc.range = this.yylloc.range.slice(0))), E = p[0].match(/(?:\r\n?|\n).*/g), E && (this.yylineno += E.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: E ? E[E.length - 1].length - E[E.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + p[0].length }, this.yytext += p[0], this.match += p[0], this.matches = p, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(p[0].length), this.matched += p[0], y = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), y) return y; if (this._backtrack) { for (var D in C) this[D] = C[D]; return !1; } return !1; }, next: function() { if (this.done) return this.EOF; this._input || (this.done = !0); var p, m, y, E; this._more || (this.yytext = "", this.match = ""); for (var C = this._currentRules(), D = 0; D < C.length; D++) if (y = this._input.match(this.rules[C[D]]), y && (!m || y[0].length > m[0].length)) { if (m = y, E = D, this.options.backtrack_lexer) { if (p = this.test_match(y, C[D]), p !== !1) return p; if (this._backtrack) { m = !1; continue; } else return !1; } else if (!this.options.flex) break; } return m ? (p = this.test_match(m, C[E]), p !== !1 ? p : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, lex: function() { var m = this.next(); return m || this.lex(); }, begin: function(m) { this.conditionStack.push(m); }, popState: function() { var m = this.conditionStack.length - 1; return m > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, _currentRules: function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, topState: function(m) { return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL"; }, pushState: function(m) { this.begin(m); }, stateStackSize: function() { return this.conditionStack.length; }, options: { "case-insensitive": !0 }, performAction: function(m, y, E, C) { switch (E) { case 0: m.getLogger().trace("Found comment", y.yytext); break; case 1: return 4; case 2: this.begin("CLASS"); break; case 3: return this.popState(), 13; case 4: this.popState(); break; case 5: m.getLogger().trace("Begin icon"), this.begin("ICON"); break; case 6: return 6; case 7: return 12; case 8: m.getLogger().trace("end icon"), this.popState(); break; case 9: return m.getLogger().trace("Exploding node"), this.begin("NODE"), 16; case 10: return m.getLogger().trace("Cloud"), this.begin("NODE"), 16; case 11: return m.getLogger().trace("Explosion Bang"), this.begin("NODE"), 16; case 12: return m.getLogger().trace("Cloud Bang"), this.begin("NODE"), 16; case 13: return this.begin("NODE"), 16; case 14: return this.begin("NODE"), 16; case 15: return this.begin("NODE"), 16; case 16: return this.begin("NODE"), 16; case 17: return 7; case 18: return 19; case 19: return 9; case 20: m.getLogger().trace("Starting NSTR"), this.begin("NSTR"); break; case 21: return m.getLogger().trace("description:", y.yytext), "NODE_DESCR"; case 22: this.popState(); break; case 23: return this.popState(), m.getLogger().trace("node end ))"), "NODE_DEND"; case 24: return this.popState(), m.getLogger().trace("node end )"), "NODE_DEND"; case 25: return this.popState(), m.getLogger().trace("node end ...", y.yytext), "NODE_DEND"; case 26: return this.popState(), m.getLogger().trace("node end (("), "NODE_DEND"; case 27: return this.popState(), m.getLogger().trace("node end (-"), "NODE_DEND"; case 28: return this.popState(), m.getLogger().trace("node end (-"), "NODE_DEND"; case 29: return this.popState(), m.getLogger().trace("node end (("), "NODE_DEND"; case 30: return this.popState(), m.getLogger().trace("node end (("), "NODE_DEND"; case 31: return m.getLogger().trace("Long description:", y.yytext), 17; case 32: return m.getLogger().trace("Long description:", y.yytext), 17; } }, rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\-\)\{\}]+)/i, /^(?:$)/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i], conditions: { CLASS: { rules: [3, 4], inclusive: !1 }, ICON: { rules: [7, 8], inclusive: !1 }, NSTR: { rules: [21, 22], inclusive: !1 }, NODE: { rules: [20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], inclusive: !0 } } }; return b; }(); h.lexer = d; function g() { this.yy = {}; } return g.prototype = h, h.Parser = g, new g(); }(); Ri.parser = Ri; const Jf = Ri, Nr = (t) => { console.error("Log function was called before initialization", t); }, vt = { trace: Nr, debug: Nr, info: Nr, warn: Nr, error: Nr, fatal: Nr }; let Cn, Dn, wu; const jf = (t, e, r, n, a) => { t.info("Mermaid utils injected"), vt.trace = t.trace, vt.debug = t.debug, vt.info = t.info, vt.warn = t.warn, vt.error = t.error, vt.fatal = t.fatal, Cn = r, Dn = n, wu = a; }; let wt = [], Eu = 0, ts = {}; const ec = () => { wt = [], Eu = 0, ts = {}; }, tc = function(t) { for (let e = wt.length - 1; e >= 0; e--) if (wt[e].level < t) return wt[e]; return null; }, rc = () => wt.length > 0 ? wt[0] : null, nc = (t, e, r, n) => { vt.info("addNode", t, e, r, n); const a = Cn(), i = { id: Eu++, nodeId: Dn(e), level: t, descr: Dn(r), type: n, children: [], width: Cn().mindmap.maxNodeWidth }; switch (i.type) { case Ie.ROUNDED_RECT: i.padding = 2 * a.mindmap.padding; break; case Ie.RECT: i.padding = 2 * a.mindmap.padding; break; case Ie.HEXAGON: i.padding = 2 * a.mindmap.padding; break; default: i.padding = a.mindmap.padding; } const s = tc(t); if (s) s.children.push(i), wt.push(i); else if (wt.length === 0) wt.push(i); else { let o = new Error( 'There can be only one root. No parent could be found for ("' + i.descr + '")' ); throw o.hash = { text: "branch " + name, token: "branch " + name, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ['"checkout ' + name + '"'] }, o; } }, Ie = { DEFAULT: 0, NO_BORDER: 0, ROUNDED_RECT: 1, RECT: 2, CIRCLE: 3, CLOUD: 4, BANG: 5, HEXAGON: 6 }, ac = (t, e) => { switch (vt.debug("In get type", t, e), t) { case "[": return Ie.RECT; case "(": return e === ")" ? Ie.ROUNDED_RECT : Ie.CLOUD; case "((": return Ie.CIRCLE; case ")": return Ie.CLOUD; case "))": return Ie.BANG; case "{{": return Ie.HEXAGON; default: return Ie.DEFAULT; } }, xu = (t, e) => { ts[t] = e; }, ic = (t) => { const e = wt[wt.length - 1]; t && t.icon && (e.icon = Dn(t.icon)), t && t.class && (e.class = Dn(t.class)); }, Cr = (t) => { switch (t) { case Ie.DEFAULT: return "no-border"; case Ie.RECT: return "rect"; case Ie.ROUNDED_RECT: return "rounded-rect"; case Ie.CIRCLE: return "circle"; case Ie.CLOUD: return "cloud"; case Ie.BANG: return "bang"; case Ie.HEXAGON: return "hexgon"; default: return "no-border"; } }; let Tu; const sc = (t) => { Tu = t; }, oc = () => vt, uc = (t) => wt[t], rs = (t) => ts[t], lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, clear: ec, getMindmap: rc, addNode: nc, nodeType: Ie, getType: ac, setElementForId: xu, decorateNode: ic, type2Str: Cr, get parseError() { return Tu; }, setErrorHandler: sc, getLogger: oc, getNodeById: uc, getElementById: rs }, Symbol.toStringTag, { value: "Module" })); var fc = { value: () => { } }; function Cu() { for (var t = 0, e = arguments.length, r = {}, n; t < e; ++t) { if (!(n = arguments[t] + "") || n in r || /[\s.]/.test(n)) throw new Error("illegal type: " + n); r[n] = []; } return new ba(r); } function ba(t) { this._ = t; } function cc(t, e) { return t.trim().split(/^|\s+/).map(function(r) { var n = "", a = r.indexOf("."); if (a >= 0 && (n = r.slice(a + 1), r = r.slice(0, a)), r && !e.hasOwnProperty(r)) throw new Error("unknown type: " + r); return { type: r, name: n }; }); } ba.prototype = Cu.prototype = { constructor: ba, on: function(t, e) { var r = this._, n = cc(t + "", r), a, i = -1, s = n.length; if (arguments.length < 2) { for (; ++i < s; ) if ((a = (t = n[i]).type) && (a = hc(r[a], t.name))) return a; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++i < s; ) if (a = (t = n[i]).type) r[a] = _s(r[a], t.name, e); else if (e == null) for (a in r) r[a] = _s(r[a], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var r in e) t[r] = e[r].slice(); return new ba(t); }, call: function(t, e) { if ((a = arguments.length - 2) > 0) for (var r = new Array(a), n = 0, a, i; n < a; ++n) r[n] = arguments[n + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (i = this._[t], n = 0, a = i.length; n < a; ++n) i[n].value.apply(e, r); }, apply: function(t, e, r) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var n = this._[t], a = 0, i = n.length; a < i; ++a) n[a].value.apply(e, r); } }; function hc(t, e) { for (var r = 0, n = t.length, a; r < n; ++r) if ((a = t[r]).name === e) return a.value; } function _s(t, e, r) { for (var n = 0, a = t.length; n < a; ++n) if (t[n].name === e) { t[n] = fc, t = t.slice(0, n).concat(t.slice(n + 1)); break; } return r != null && t.push({ name: e, value: r }), t; } var Pi = "http://www.w3.org/1999/xhtml"; const $s = { svg: "http://www.w3.org/2000/svg", xhtml: Pi, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function qa(t) { var e = t += "", r = e.indexOf(":"); return r >= 0 && (e = t.slice(0, r)) !== "xmlns" && (t = t.slice(r + 1)), $s.hasOwnProperty(e) ? { space: $s[e], local: t } : t; } function vc(t) { return function() { var e = this.ownerDocument, r = this.namespaceURI; return r === Pi && e.documentElement.namespaceURI === Pi ? e.createElement(t) : e.createElementNS(r, t); }; } function dc(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Du(t) { var e = qa(t); return (e.local ? dc : vc)(e); } function gc() { } function ns(t) { return t == null ? gc : function() { return this.querySelector(t); }; } function pc(t) { typeof t != "function" && (t = ns(t)); for (var e = this._groups, r = e.length, n = new Array(r), a = 0; a < r; ++a) for (var i = e[a], s = i.length, o = n[a] = new Array(s), u, l, f = 0; f < s; ++f) (u = i[f]) && (l = t.call(u, u.__data__, f, i)) && ("__data__" in u && (l.__data__ = u.__data__), o[f] = l); return new gt(n, this._parents); } function yc(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function mc() { return []; } function Su(t) { return t == null ? mc : function() { return this.querySelectorAll(t); }; } function bc(t) { return function() { return yc(t.apply(this, arguments)); }; } function wc(t) { typeof t == "function" ? t = bc(t) : t = Su(t); for (var e = this._groups, r = e.length, n = [], a = [], i = 0; i < r; ++i) for (var s = e[i], o = s.length, u, l = 0; l < o; ++l) (u = s[l]) && (n.push(t.call(u, u.__data__, l, s)), a.push(u)); return new gt(n, a); } function Lu(t) { return function() { return this.matches(t); }; } function Au(t) { return function(e) { return e.matches(t); }; } var Ec = Array.prototype.find; function xc(t) { return function() { return Ec.call(this.children, t); }; } function Tc() { return this.firstElementChild; } function Cc(t) { return this.select(t == null ? Tc : xc(typeof t == "function" ? t : Au(t))); } var Dc = Array.prototype.filter; function Sc() { return Array.from(this.children); } function Lc(t) { return function() { return Dc.call(this.children, t); }; } function Ac(t) { return this.selectAll(t == null ? Sc : Lc(typeof t == "function" ? t : Au(t))); } function Nc(t) { typeof t != "function" && (t = Lu(t)); for (var e = this._groups, r = e.length, n = new Array(r), a = 0; a < r; ++a) for (var i = e[a], s = i.length, o = n[a] = [], u, l = 0; l < s; ++l) (u = i[l]) && t.call(u, u.__data__, l, i) && o.push(u); return new gt(n, this._parents); } function Nu(t) { return new Array(t.length); } function Mc() { return new gt(this._enter || this._groups.map(Nu), this._parents); } function Ia(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ia.prototype = { constructor: Ia, 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 Oc(t) { return function() { return t; }; } function Ic(t, e, r, n, a, i) { for (var s = 0, o, u = e.length, l = i.length; s < l; ++s) (o = e[s]) ? (o.__data__ = i[s], n[s] = o) : r[s] = new Ia(t, i[s]); for (; s < u; ++s) (o = e[s]) && (a[s] = o); } function kc(t, e, r, n, a, i, s) { var o, u, l = /* @__PURE__ */ new Map(), f = e.length, c = i.length, v = new Array(f), h; for (o = 0; o < f; ++o) (u = e[o]) && (v[o] = h = s.call(u, u.__data__, o, e) + "", l.has(h) ? a[o] = u : l.set(h, u)); for (o = 0; o < c; ++o) h = s.call(t, i[o], o, i) + "", (u = l.get(h)) ? (n[o] = u, u.__data__ = i[o], l.delete(h)) : r[o] = new Ia(t, i[o]); for (o = 0; o < f; ++o) (u = e[o]) && l.get(v[o]) === u && (a[o] = u); } function Rc(t) { return t.__data__; } function Pc(t, e) { if (!arguments.length) return Array.from(this, Rc); var r = e ? kc : Ic, n = this._parents, a = this._groups; typeof t != "function" && (t = Oc(t)); for (var i = a.length, s = new Array(i), o = new Array(i), u = new Array(i), l = 0; l < i; ++l) { var f = n[l], c = a[l], v = c.length, h = Bc(t.call(f, f && f.__data__, l, n)), d = h.length, g = o[l] = new Array(d), b = s[l] = new Array(d), p = u[l] = new Array(v); r(f, c, g, b, p, h, e); for (var m = 0, y = 0, E, C; m < d; ++m) if (E = g[m]) { for (m >= y && (y = m + 1); !(C = b[y]) && ++y < d; ) ; E._next = C || null; } } return s = new gt(s, n), s._enter = o, s._exit = u, s; } function Bc(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Fc() { return new gt(this._exit || this._groups.map(Nu), this._parents); } function _c(t, e, r) { var n = this.enter(), a = this, i = this.exit(); return typeof t == "function" ? (n = t(n), n && (n = n.selection())) : n = n.append(t + ""), e != null && (a = e(a), a && (a = a.selection())), r == null ? i.remove() : r(i), n && a ? n.merge(a).order() : a; } function $c(t) { for (var e = t.selection ? t.selection() : t, r = this._groups, n = e._groups, a = r.length, i = n.length, s = Math.min(a, i), o = new Array(a), u = 0; u < s; ++u) for (var l = r[u], f = n[u], c = l.length, v = o[u] = new Array(c), h, d = 0; d < c; ++d) (h = l[d] || f[d]) && (v[d] = h); for (; u < a; ++u) o[u] = r[u]; return new gt(o, this._parents); } function Gc() { for (var t = this._groups, e = -1, r = t.length; ++e < r; ) for (var n = t[e], a = n.length - 1, i = n[a], s; --a >= 0; ) (s = n[a]) && (i && s.compareDocumentPosition(i) ^ 4 && i.parentNode.insertBefore(s, i), i = s); return this; } function zc(t) { t || (t = Hc); function e(c, v) { return c && v ? t(c.__data__, v.__data__) : !c - !v; } for (var r = this._groups, n = r.length, a = new Array(n), i = 0; i < n; ++i) { for (var s = r[i], o = s.length, u = a[i] = new Array(o), l, f = 0; f < o; ++f) (l = s[f]) && (u[f] = l); u.sort(e); } return new gt(a, this._parents).order(); } function Hc(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function Vc() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function Yc() { return Array.from(this); } function Uc() { for (var t = this._groups, e = 0, r = t.length; e < r; ++e) for (var n = t[e], a = 0, i = n.length; a < i; ++a) { var s = n[a]; if (s) return s; } return null; } function Xc() { let t = 0; for (const e of this) ++t; return t; } function qc() { return !this.node(); } function Wc(t) { for (var e = this._groups, r = 0, n = e.length; r < n; ++r) for (var a = e[r], i = 0, s = a.length, o; i < s; ++i) (o = a[i]) && t.call(o, o.__data__, i, a); return this; } function Kc(t) { return function() { this.removeAttribute(t); }; } function Zc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Qc(t, e) { return function() { this.setAttribute(t, e); }; } function Jc(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function jc(t, e) { return function() { var r = e.apply(this, arguments); r == null ? this.removeAttribute(t) : this.setAttribute(t, r); }; } function eh(t, e) { return function() { var r = e.apply(this, arguments); r == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, r); }; } function th(t, e) { var r = qa(t); if (arguments.length < 2) { var n = this.node(); return r.local ? n.getAttributeNS(r.space, r.local) : n.getAttribute(r); } return this.each((e == null ? r.local ? Zc : Kc : typeof e == "function" ? r.local ? eh : jc : r.local ? Jc : Qc)(r, e)); } function Mu(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function rh(t) { return function() { this.style.removeProperty(t); }; } function nh(t, e, r) { return function() { this.style.setProperty(t, e, r); }; } function ah(t, e, r) { return function() { var n = e.apply(this, arguments); n == null ? this.style.removeProperty(t) : this.style.setProperty(t, n, r); }; } function ih(t, e, r) { return arguments.length > 1 ? this.each((e == null ? rh : typeof e == "function" ? ah : nh)(t, e, r == null ? "" : r)) : Yr(this.node(), t); } function Yr(t, e) { return t.style.getPropertyValue(e) || Mu(t).getComputedStyle(t, null).getPropertyValue(e); } function sh(t) { return function() { delete this[t]; }; } function oh(t, e) { return function() { this[t] = e; }; } function uh(t, e) { return function() { var r = e.apply(this, arguments); r == null ? delete this[t] : this[t] = r; }; } function lh(t, e) { return arguments.length > 1 ? this.each((e == null ? sh : typeof e == "function" ? uh : oh)(t, e)) : this.node()[t]; } function Ou(t) { return t.trim().split(/^|\s+/); } function as(t) { return t.classList || new Iu(t); } function Iu(t) { this._node = t, this._names = Ou(t.getAttribute("class") || ""); } Iu.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 ku(t, e) { for (var r = as(t), n = -1, a = e.length; ++n < a; ) r.add(e[n]); } function Ru(t, e) { for (var r = as(t), n = -1, a = e.length; ++n < a; ) r.remove(e[n]); } function fh(t) { return function() { ku(this, t); }; } function ch(t) { return function() { Ru(this, t); }; } function hh(t, e) { return function() { (e.apply(this, arguments) ? ku : Ru)(this, t); }; } function vh(t, e) { var r = Ou(t + ""); if (arguments.length < 2) { for (var n = as(this.node()), a = -1, i = r.length; ++a < i; ) if (!n.contains(r[a])) return !1; return !0; } return this.each((typeof e == "function" ? hh : e ? fh : ch)(r, e)); } function dh() { this.textContent = ""; } function gh(t) { return function() { this.textContent = t; }; } function ph(t) { return function() { var e = t.apply(this, arguments); this.textContent = e == null ? "" : e; }; } function yh(t) { return arguments.length ? this.each(t == null ? dh : (typeof t == "function" ? ph : gh)(t)) : this.node().textContent; } function mh() { this.innerHTML = ""; } function bh(t) { return function() { this.innerHTML = t; }; } function wh(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e == null ? "" : e; }; } function Eh(t) { return arguments.length ? this.each(t == null ? mh : (typeof t == "function" ? wh : bh)(t)) : this.node().innerHTML; } function xh() { this.nextSibling && this.parentNode.appendChild(this); } function Th() { return this.each(xh); } function Ch() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Dh() { return this.each(Ch); } function Sh(t) { var e = typeof t == "function" ? t : Du(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function Lh() { return null; } function Ah(t, e) { var r = typeof t == "function" ? t : Du(t), n = e == null ? Lh : typeof e == "function" ? e : ns(e); return this.select(function() { return this.insertBefore(r.apply(this, arguments), n.apply(this, arguments) || null); }); } function Nh() { var t = this.parentNode; t && t.removeChild(this); } function Mh() { return this.each(Nh); } function Oh() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Ih() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function kh(t) { return this.select(t ? Ih : Oh); } function Rh(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function Ph(t) { return function(e) { t.call(this, e, this.__data__); }; } function Bh(t) { return t.trim().split(/^|\s+/).map(function(e) { var r = "", n = e.indexOf("."); return n >= 0 && (r = e.slice(n + 1), e = e.slice(0, n)), { type: e, name: r }; }); } function Fh(t) { return function() { var e = this.__on; if (!!e) { for (var r = 0, n = -1, a = e.length, i; r < a; ++r) i = e[r], (!t.type || i.type === t.type) && i.name === t.name ? this.removeEventListener(i.type, i.listener, i.options) : e[++n] = i; ++n ? e.length = n : delete this.__on; } }; } function _h(t, e, r) { return function() { var n = this.__on, a, i = Ph(e); if (n) { for (var s = 0, o = n.length; s < o; ++s) if ((a = n[s]).type === t.type && a.name === t.name) { this.removeEventListener(a.type, a.listener, a.options), this.addEventListener(a.type, a.listener = i, a.options = r), a.value = e; return; } } this.addEventListener(t.type, i, r), a = { type: t.type, name: t.name, value: e, listener: i, options: r }, n ? n.push(a) : this.__on = [a]; }; } function $h(t, e, r) { var n = Bh(t + ""), a, i = n.length, s; if (arguments.length < 2) { var o = this.node().__on; if (o) { for (var u = 0, l = o.length, f; u < l; ++u) for (a = 0, f = o[u]; a < i; ++a) if ((s = n[a]).type === f.type && s.name === f.name) return f.value; } return; } for (o = e ? _h : Fh, a = 0; a < i; ++a) this.each(o(n[a], e, r)); return this; } function Pu(t, e, r) { var n = Mu(t), a = n.CustomEvent; typeof a == "function" ? a = new a(e, r) : (a = n.document.createEvent("Event"), r ? (a.initEvent(e, r.bubbles, r.cancelable), a.detail = r.detail) : a.initEvent(e, !1, !1)), t.dispatchEvent(a); } function Gh(t, e) { return function() { return Pu(this, t, e); }; } function zh(t, e) { return function() { return Pu(this, t, e.apply(this, arguments)); }; } function Hh(t, e) { return this.each((typeof e == "function" ? zh : Gh)(t, e)); } function* Vh() { for (var t = this._groups, e = 0, r = t.length; e < r; ++e) for (var n = t[e], a = 0, i = n.length, s; a < i; ++a) (s = n[a]) && (yield s); } var Bu = [null]; function gt(t, e) { this._groups = t, this._parents = e; } function Gn() { return new gt([[document.documentElement]], Bu); } function Yh() { return this; } gt.prototype = Gn.prototype = { constructor: gt, select: pc, selectAll: wc, selectChild: Cc, selectChildren: Ac, filter: Nc, data: Pc, enter: Mc, exit: Fc, join: _c, merge: $c, selection: Yh, order: Gc, sort: zc, call: Vc, nodes: Yc, node: Uc, size: Xc, empty: qc, each: Wc, attr: th, style: ih, property: lh, classed: vh, text: yh, html: Eh, raise: Th, lower: Dh, append: Sh, insert: Ah, remove: Mh, clone: kh, datum: Rh, on: $h, dispatch: Hh, [Symbol.iterator]: Vh }; function wn(t) { return typeof t == "string" ? new gt([[document.querySelector(t)]], [document.documentElement]) : new gt([[t]], Bu); } function is(t, e, r) { t.prototype = e.prototype = r, r.constructor = t; } function Fu(t, e) { var r = Object.create(t.prototype); for (var n in e) r[n] = e[n]; return r; } function zn() { } var Sn = 0.7, ka = 1 / Sn, $r = "\\s*([+-]?\\d+)\\s*", Ln = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", kt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uh = /^#([0-9a-f]{3,8})$/, Xh = new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`), qh = new RegExp(`^rgb\\(${kt},${kt},${kt}\\)$`), Wh = new RegExp(`^rgba\\(${$r},${$r},${$r},${Ln}\\)$`), Kh = new RegExp(`^rgba\\(${kt},${kt},${kt},${Ln}\\)$`), Zh = new RegExp(`^hsl\\(${Ln},${kt},${kt}\\)$`), Qh = new RegExp(`^hsla\\(${Ln},${kt},${kt},${Ln}\\)$`), Gs = { 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 }; is(zn, An, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: zs, formatHex: zs, formatHex8: Jh, formatHsl: jh, formatRgb: Hs, toString: Hs }); function zs() { return this.rgb().formatHex(); } function Jh() { return this.rgb().formatHex8(); } function jh() { return _u(this).formatHsl(); } function Hs() { return this.rgb().formatRgb(); } function An(t) { var e, r; return t = (t + "").trim().toLowerCase(), (e = Uh.exec(t)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? Vs(e) : r === 3 ? new ct(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : r === 8 ? na(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : r === 4 ? na(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 = Xh.exec(t)) ? new ct(e[1], e[2], e[3], 1) : (e = qh.exec(t)) ? new ct(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Wh.exec(t)) ? na(e[1], e[2], e[3], e[4]) : (e = Kh.exec(t)) ? na(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Zh.exec(t)) ? Xs(e[1], e[2] / 100, e[3] / 100, 1) : (e = Qh.exec(t)) ? Xs(e[1], e[2] / 100, e[3] / 100, e[4]) : Gs.hasOwnProperty(t) ? Vs(Gs[t]) : t === "transparent" ? new ct(NaN, NaN, NaN, 0) : null; } function Vs(t) { return new ct(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function na(t, e, r, n) { return n <= 0 && (t = e = r = NaN), new ct(t, e, r, n); } function ev(t) { return t instanceof zn || (t = An(t)), t ? (t = t.rgb(), new ct(t.r, t.g, t.b, t.opacity)) : new ct(); } function Bi(t, e, r, n) { return arguments.length === 1 ? ev(t) : new ct(t, e, r, n == null ? 1 : n); } function ct(t, e, r, n) { this.r = +t, this.g = +e, this.b = +r, this.opacity = +n; } is(ct, Bi, Fu(zn, { brighter(t) { return t = t == null ? ka : Math.pow(ka, t), new ct(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Sn : Math.pow(Sn, t), new ct(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new ct(pr(this.r), pr(this.g), pr(this.b), Ra(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: Ys, formatHex: Ys, formatHex8: tv, formatRgb: Us, toString: Us })); function Ys() { return `#${dr(this.r)}${dr(this.g)}${dr(this.b)}`; } function tv() { return `#${dr(this.r)}${dr(this.g)}${dr(this.b)}${dr((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Us() { const t = Ra(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${pr(this.r)}, ${pr(this.g)}, ${pr(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function Ra(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function pr(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function dr(t) { return t = pr(t), (t < 16 ? "0" : "") + t.toString(16); } function Xs(t, e, r, n) { return n <= 0 ? t = e = r = NaN : r <= 0 || r >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Lt(t, e, r, n); } function _u(t) { if (t instanceof Lt) return new Lt(t.h, t.s, t.l, t.opacity); if (t instanceof zn || (t = An(t)), !t) return new Lt(); if (t instanceof Lt) return t; t = t.rgb(); var e = t.r / 255, r = t.g / 255, n = t.b / 255, a = Math.min(e, r, n), i = Math.max(e, r, n), s = NaN, o = i - a, u = (i + a) / 2; return o ? (e === i ? s = (r - n) / o + (r < n) * 6 : r === i ? s = (n - e) / o + 2 : s = (e - r) / o + 4, o /= u < 0.5 ? i + a : 2 - i - a, s *= 60) : o = u > 0 && u < 1 ? 0 : s, new Lt(s, o, u, t.opacity); } function rv(t, e, r, n) { return arguments.length === 1 ? _u(t) : new Lt(t, e, r, n == null ? 1 : n); } function Lt(t, e, r, n) { this.h = +t, this.s = +e, this.l = +r, this.opacity = +n; } is(Lt, rv, Fu(zn, { brighter(t) { return t = t == null ? ka : Math.pow(ka, t), new Lt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Sn : Math.pow(Sn, t), new Lt(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, r = this.l, n = r + (r < 0.5 ? r : 1 - r) * e, a = 2 * r - n; return new ct( yi(t >= 240 ? t - 240 : t + 120, a, n), yi(t, a, n), yi(t < 120 ? t + 240 : t - 120, a, n), this.opacity ); }, clamp() { return new Lt(qs(this.h), aa(this.s), aa(this.l), Ra(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 = Ra(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${qs(this.h)}, ${aa(this.s) * 100}%, ${aa(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function qs(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function aa(t) { return Math.max(0, Math.min(1, t || 0)); } function yi(t, e, r) { return (t < 60 ? e + (r - e) * t / 60 : t < 180 ? r : t < 240 ? e + (r - e) * (240 - t) / 60 : e) * 255; } const $u = (t) => () => t; function nv(t, e) { return function(r) { return t + r * e; }; } function av(t, e, r) { return t = Math.pow(t, r), e = Math.pow(e, r) - t, r = 1 / r, function(n) { return Math.pow(t + n * e, r); }; } function iv(t) { return (t = +t) == 1 ? Gu : function(e, r) { return r - e ? av(e, r, t) : $u(isNaN(e) ? r : e); }; } function Gu(t, e) { var r = e - t; return r ? nv(t, r) : $u(isNaN(t) ? e : t); } const Ws = function t(e) { var r = iv(e); function n(a, i) { var s = r((a = Bi(a)).r, (i = Bi(i)).r), o = r(a.g, i.g), u = r(a.b, i.b), l = Gu(a.opacity, i.opacity); return function(f) { return a.r = s(f), a.g = o(f), a.b = u(f), a.opacity = l(f), a + ""; }; } return n.gamma = t, n; }(1); function Qt(t, e) { return t = +t, e = +e, function(r) { return t * (1 - r) + e * r; }; } var Fi = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, mi = new RegExp(Fi.source, "g"); function sv(t) { return function() { return t; }; } function ov(t) { return function(e) { return t(e) + ""; }; } function uv(t, e) { var r = Fi.lastIndex = mi.lastIndex = 0, n, a, i, s = -1, o = [], u = []; for (t = t + "", e = e + ""; (n = Fi.exec(t)) && (a = mi.exec(e)); ) (i = a.index) > r && (i = e.slice(r, i), o[s] ? o[s] += i : o[++s] = i), (n = n[0]) === (a = a[0]) ? o[s] ? o[s] += a : o[++s] = a : (o[++s] = null, u.push({ i: s, x: Qt(n, a) })), r = mi.lastIndex; return r < e.length && (i = e.slice(r), o[s] ? o[s] += i : o[++s] = i), o.length < 2 ? u[0] ? ov(u[0].x) : sv(e) : (e = u.length, function(l) { for (var f = 0, c; f < e; ++f) o[(c = u[f]).i] = c.x(l); return o.join(""); }); } var Ks = 180 / Math.PI, _i = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function zu(t, e, r, n, a, i) { var s, o, u; return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (u = t * r + e * n) && (r -= t * u, n -= e * u), (o = Math.sqrt(r * r + n * n)) && (r /= o, n /= o, u /= o), t * n < e *